diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bf44e05 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +Yangcai365_web/bin/* +Yangcai365_webV1.0R2022021801/* +Yangcai365_web/bin/* +Yangcai365_designV3.0R2022030701/* +Yangcai365_design/bin/* +Yangcai365_web/bin/* +zhiqim_manager/bin/org/zhiqim/manager/* +zhiqim_manager_release/* diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/Yangcai365_web/.classpath b/Yangcai365_web/.classpath new file mode 100644 index 0000000..2a1695e --- /dev/null +++ b/Yangcai365_web/.classpath @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Yangcai365_web/.idea/.gitignore b/Yangcai365_web/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/Yangcai365_web/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/Yangcai365_web/.idea/misc.xml b/Yangcai365_web/.idea/misc.xml new file mode 100644 index 0000000..6add2e1 --- /dev/null +++ b/Yangcai365_web/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Yangcai365_web/.idea/modules.xml b/Yangcai365_web/.idea/modules.xml new file mode 100644 index 0000000..cd5cea5 --- /dev/null +++ b/Yangcai365_web/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Yangcai365_web/.idea/runConfigurations.xml b/Yangcai365_web/.idea/runConfigurations.xml new file mode 100644 index 0000000..797acea --- /dev/null +++ b/Yangcai365_web/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/Yangcai365_web/.project b/Yangcai365_web/.project new file mode 100644 index 0000000..9e05f47 --- /dev/null +++ b/Yangcai365_web/.project @@ -0,0 +1,17 @@ + + + Yangcai365_web + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/Yangcai365_web/.settings/database.db b/Yangcai365_web/.settings/database.db new file mode 100644 index 0000000..e69de29 diff --git a/Yangcai365_web/.settings/org.eclipse.core.resources.prefs b/Yangcai365_web/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/Yangcai365_web/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/Yangcai365_web/.settings/org.eclipse.jdt.core.prefs b/Yangcai365_web/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0fee6a9 --- /dev/null +++ b/Yangcai365_web/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Yangcai365_web/.zmlignore b/Yangcai365_web/.zmlignore new file mode 100644 index 0000000..c52b898 --- /dev/null +++ b/Yangcai365_web/.zmlignore @@ -0,0 +1,3 @@ +/src/manage/com/zhiqim/yangcai/design/presenter/DesignerGroupPresenter.java +/conf/zhiqim.xml +/conf/httpd.xml diff --git a/Yangcai365_web/Yangcai365_web.iml b/Yangcai365_web/Yangcai365_web.iml new file mode 100644 index 0000000..b1f0b2e --- /dev/null +++ b/Yangcai365_web/Yangcai365_web.iml @@ -0,0 +1,624 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Yangcai365_web/conf/httpd.xml b/Yangcai365_web/conf/httpd.xml new file mode 100644 index 0000000..c5e762d --- /dev/null +++ b/Yangcai365_web/conf/httpd.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Yangcai365_web/conf/logging.xml b/Yangcai365_web/conf/logging.xml new file mode 100644 index 0000000..300e4e8 --- /dev/null +++ b/Yangcai365_web/conf/logging.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Yangcai365_web/conf/zhiqim.xml b/Yangcai365_web/conf/zhiqim.xml new file mode 100644 index 0000000..fd1da8d --- /dev/null +++ b/Yangcai365_web/conf/zhiqim.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Yangcai365_web/document/export/jar.exp.xml b/Yangcai365_web/document/export/jar.exp.xml new file mode 100644 index 0000000..bdd92b6 --- /dev/null +++ b/Yangcai365_web/document/export/jar.exp.xml @@ -0,0 +1,15 @@ + +
+
+ + + + + + + + + + +
+
diff --git a/Yangcai365_web/document/export/project.exp.xml b/Yangcai365_web/document/export/project.exp.xml new file mode 100644 index 0000000..d3948c2 --- /dev/null +++ b/Yangcai365_web/document/export/project.exp.xml @@ -0,0 +1,20 @@ + +
+
+ + + + + + + + + + + + + + + +
+
diff --git a/Yangcai365_web/document/export/project.server.xml b/Yangcai365_web/document/export/project.server.xml new file mode 100644 index 0000000..efccd1d --- /dev/null +++ b/Yangcai365_web/document/export/project.server.xml @@ -0,0 +1,20 @@ + +
+
+ + + + + + + + + + + + + + + +
+
diff --git a/Yangcai365_web/document/export/task.design.xml b/Yangcai365_web/document/export/task.design.xml new file mode 100644 index 0000000..e41ce12 --- /dev/null +++ b/Yangcai365_web/document/export/task.design.xml @@ -0,0 +1,20 @@ + +
+
+ + + + + + + + + + + + + + + +
+
diff --git a/Yangcai365_web/lib/zhiqim.jar b/Yangcai365_web/lib/zhiqim.jar new file mode 100644 index 0000000..5c710ad Binary files /dev/null and b/Yangcai365_web/lib/zhiqim.jar differ diff --git a/Yangcai365_web/lib/zhiqim_httpd.jar b/Yangcai365_web/lib/zhiqim_httpd.jar new file mode 100644 index 0000000..31f9b33 Binary files /dev/null and b/Yangcai365_web/lib/zhiqim_httpd.jar differ diff --git a/Yangcai365_web/lib/zhiqim_icepdf_6.2.0.jar b/Yangcai365_web/lib/zhiqim_icepdf_6.2.0.jar new file mode 100644 index 0000000..1c1c8a3 Binary files /dev/null and b/Yangcai365_web/lib/zhiqim_icepdf_6.2.0.jar differ diff --git a/Yangcai365_web/lib/zhiqim_manager.jar b/Yangcai365_web/lib/zhiqim_manager.jar new file mode 100644 index 0000000..8017368 Binary files /dev/null and b/Yangcai365_web/lib/zhiqim_manager.jar differ diff --git a/Yangcai365_web/lib/zhiqim_media_editor.jar b/Yangcai365_web/lib/zhiqim_media_editor.jar new file mode 100644 index 0000000..91448ee Binary files /dev/null and b/Yangcai365_web/lib/zhiqim_media_editor.jar differ diff --git a/Yangcai365_web/lib/zhiqim_mysql5.0.8.jar b/Yangcai365_web/lib/zhiqim_mysql5.0.8.jar new file mode 100644 index 0000000..0f3c501 Binary files /dev/null and b/Yangcai365_web/lib/zhiqim_mysql5.0.8.jar differ diff --git a/Yangcai365_web/lib/zhiqim_orm.jar b/Yangcai365_web/lib/zhiqim_orm.jar new file mode 100644 index 0000000..2e4dcef Binary files /dev/null and b/Yangcai365_web/lib/zhiqim_orm.jar differ diff --git a/Yangcai365_web/lib/zhiqim_oss.jar b/Yangcai365_web/lib/zhiqim_oss.jar new file mode 100644 index 0000000..4e8e643 Binary files /dev/null and b/Yangcai365_web/lib/zhiqim_oss.jar differ diff --git a/Yangcai365_web/lib/zhiqim_text_editor.jar b/Yangcai365_web/lib/zhiqim_text_editor.jar new file mode 100644 index 0000000..4eede44 Binary files /dev/null and b/Yangcai365_web/lib/zhiqim_text_editor.jar differ diff --git a/Yangcai365_web/lib/zhiqim_ui.jar b/Yangcai365_web/lib/zhiqim_ui.jar new file mode 100644 index 0000000..20dcff2 Binary files /dev/null and b/Yangcai365_web/lib/zhiqim_ui.jar differ diff --git a/Yangcai365_web/lib/zhiqim_upload_large.jar b/Yangcai365_web/lib/zhiqim_upload_large.jar new file mode 100644 index 0000000..7cb5a65 Binary files /dev/null and b/Yangcai365_web/lib/zhiqim_upload_large.jar differ diff --git a/Yangcai365_web/lib/zhiqim_zml.jar b/Yangcai365_web/lib/zhiqim_zml.jar new file mode 100644 index 0000000..0e2aa82 Binary files /dev/null and b/Yangcai365_web/lib/zhiqim_zml.jar differ diff --git a/Yangcai365_web/libext/aip-java-sdk-4.1.1.jar b/Yangcai365_web/libext/aip-java-sdk-4.1.1.jar new file mode 100644 index 0000000..6fbfa0b Binary files /dev/null and b/Yangcai365_web/libext/aip-java-sdk-4.1.1.jar differ diff --git a/Yangcai365_web/libext/aliyun-java-sdk-core-4.1.0.jar b/Yangcai365_web/libext/aliyun-java-sdk-core-4.1.0.jar new file mode 100644 index 0000000..cc7da01 Binary files /dev/null and b/Yangcai365_web/libext/aliyun-java-sdk-core-4.1.0.jar differ diff --git a/Yangcai365_web/libext/aliyun-java-sdk-dysmsapi-1.1.0.jar b/Yangcai365_web/libext/aliyun-java-sdk-dysmsapi-1.1.0.jar new file mode 100644 index 0000000..d07e04f Binary files /dev/null and b/Yangcai365_web/libext/aliyun-java-sdk-dysmsapi-1.1.0.jar differ diff --git a/Yangcai365_web/libext/aliyun-sdk-oss-2.8.2.jar b/Yangcai365_web/libext/aliyun-sdk-oss-2.8.2.jar new file mode 100644 index 0000000..68fecab Binary files /dev/null and b/Yangcai365_web/libext/aliyun-sdk-oss-2.8.2.jar differ diff --git a/Yangcai365_web/libext/aliyun-sdk-oss-3.10.2.jar b/Yangcai365_web/libext/aliyun-sdk-oss-3.10.2.jar new file mode 100644 index 0000000..4889f96 Binary files /dev/null and b/Yangcai365_web/libext/aliyun-sdk-oss-3.10.2.jar differ diff --git a/Yangcai365_web/libext/aliyun-sdk-oss-3.17.4.jar b/Yangcai365_web/libext/aliyun-sdk-oss-3.17.4.jar new file mode 100644 index 0000000..9a7b9d6 Binary files /dev/null and b/Yangcai365_web/libext/aliyun-sdk-oss-3.17.4.jar differ diff --git a/Yangcai365_web/libext/aspose-imaging-23.11-jdk16.jar b/Yangcai365_web/libext/aspose-imaging-23.11-jdk16.jar new file mode 100644 index 0000000..a4f7529 Binary files /dev/null and b/Yangcai365_web/libext/aspose-imaging-23.11-jdk16.jar differ diff --git a/Yangcai365_web/libext/batik-all-1.9.jar b/Yangcai365_web/libext/batik-all-1.9.jar new file mode 100644 index 0000000..e21ef6d Binary files /dev/null and b/Yangcai365_web/libext/batik-all-1.9.jar differ diff --git a/Yangcai365_web/libext/commons-codec-1.9.jar b/Yangcai365_web/libext/commons-codec-1.9.jar new file mode 100644 index 0000000..ef35f1c Binary files /dev/null and b/Yangcai365_web/libext/commons-codec-1.9.jar differ diff --git a/Yangcai365_web/libext/commons-lang3-3.4.jar b/Yangcai365_web/libext/commons-lang3-3.4.jar new file mode 100644 index 0000000..8ec91d4 Binary files /dev/null and b/Yangcai365_web/libext/commons-lang3-3.4.jar differ diff --git a/Yangcai365_web/libext/commons-pool2-2.9.0.jar b/Yangcai365_web/libext/commons-pool2-2.9.0.jar new file mode 100644 index 0000000..a038b36 Binary files /dev/null and b/Yangcai365_web/libext/commons-pool2-2.9.0.jar differ diff --git a/Yangcai365_web/libext/fastjson-1.2.51.jar b/Yangcai365_web/libext/fastjson-1.2.51.jar new file mode 100644 index 0000000..aab8edd Binary files /dev/null and b/Yangcai365_web/libext/fastjson-1.2.51.jar differ diff --git a/Yangcai365_web/libext/fop-transcoder-allinone-2.2.jar b/Yangcai365_web/libext/fop-transcoder-allinone-2.2.jar new file mode 100644 index 0000000..b65175e Binary files /dev/null and b/Yangcai365_web/libext/fop-transcoder-allinone-2.2.jar differ diff --git a/Yangcai365_web/libext/gson-2.8.5.jar b/Yangcai365_web/libext/gson-2.8.5.jar new file mode 100644 index 0000000..0d5baf3 Binary files /dev/null and b/Yangcai365_web/libext/gson-2.8.5.jar differ diff --git a/Yangcai365_web/libext/httpasyncclient-4.1.3.jar b/Yangcai365_web/libext/httpasyncclient-4.1.3.jar new file mode 100644 index 0000000..a79f664 Binary files /dev/null and b/Yangcai365_web/libext/httpasyncclient-4.1.3.jar differ diff --git a/Yangcai365_web/libext/httpclient-4.4.1.jar b/Yangcai365_web/libext/httpclient-4.4.1.jar new file mode 100644 index 0000000..b80d379 Binary files /dev/null and b/Yangcai365_web/libext/httpclient-4.4.1.jar differ diff --git a/Yangcai365_web/libext/httpcore-4.4.1.jar b/Yangcai365_web/libext/httpcore-4.4.1.jar new file mode 100644 index 0000000..99715b6 Binary files /dev/null and b/Yangcai365_web/libext/httpcore-4.4.1.jar differ diff --git a/Yangcai365_web/libext/httpcore-nio-4.4.9.jar b/Yangcai365_web/libext/httpcore-nio-4.4.9.jar new file mode 100644 index 0000000..00b3444 Binary files /dev/null and b/Yangcai365_web/libext/httpcore-nio-4.4.9.jar differ diff --git a/Yangcai365_web/libext/httpmime-4.5.5.jar b/Yangcai365_web/libext/httpmime-4.5.5.jar new file mode 100644 index 0000000..4d3ee66 Binary files /dev/null and b/Yangcai365_web/libext/httpmime-4.5.5.jar differ diff --git a/Yangcai365_web/libext/im4java-1.4.0.jar b/Yangcai365_web/libext/im4java-1.4.0.jar new file mode 100644 index 0000000..b08eba9 Binary files /dev/null and b/Yangcai365_web/libext/im4java-1.4.0.jar differ diff --git a/Yangcai365_web/libext/itext5-itextpdf-5.5.11.jar b/Yangcai365_web/libext/itext5-itextpdf-5.5.11.jar new file mode 100644 index 0000000..cec5fe1 Binary files /dev/null and b/Yangcai365_web/libext/itext5-itextpdf-5.5.11.jar differ diff --git a/Yangcai365_web/libext/jacob.jar b/Yangcai365_web/libext/jacob.jar new file mode 100644 index 0000000..c35ad12 Binary files /dev/null and b/Yangcai365_web/libext/jacob.jar differ diff --git a/Yangcai365_web/libext/jdom-1.1.jar b/Yangcai365_web/libext/jdom-1.1.jar new file mode 100644 index 0000000..97c85f5 Binary files /dev/null and b/Yangcai365_web/libext/jdom-1.1.jar differ diff --git a/Yangcai365_web/libext/jdom2-2.0.6.jar b/Yangcai365_web/libext/jdom2-2.0.6.jar new file mode 100644 index 0000000..2850ca1 Binary files /dev/null and b/Yangcai365_web/libext/jdom2-2.0.6.jar differ diff --git a/Yangcai365_web/libext/jedis-2.9.0.jar b/Yangcai365_web/libext/jedis-2.9.0.jar new file mode 100644 index 0000000..f4d27d3 Binary files /dev/null and b/Yangcai365_web/libext/jedis-2.9.0.jar differ diff --git a/Yangcai365_web/libext/js.jar b/Yangcai365_web/libext/js.jar new file mode 100644 index 0000000..ccad3cc Binary files /dev/null and b/Yangcai365_web/libext/js.jar differ diff --git a/Yangcai365_web/libext/json-20160810.jar b/Yangcai365_web/libext/json-20160810.jar new file mode 100644 index 0000000..a90e448 Binary files /dev/null and b/Yangcai365_web/libext/json-20160810.jar differ diff --git a/Yangcai365_web/libext/jxl.jar b/Yangcai365_web/libext/jxl.jar new file mode 100644 index 0000000..b210c06 Binary files /dev/null and b/Yangcai365_web/libext/jxl.jar differ diff --git a/Yangcai365_web/libext/jxl_src.jar b/Yangcai365_web/libext/jxl_src.jar new file mode 100644 index 0000000..33e951c Binary files /dev/null and b/Yangcai365_web/libext/jxl_src.jar differ diff --git a/Yangcai365_web/libext/log4j-1.2.17.jar b/Yangcai365_web/libext/log4j-1.2.17.jar new file mode 100644 index 0000000..1d425cf Binary files /dev/null and b/Yangcai365_web/libext/log4j-1.2.17.jar differ diff --git a/Yangcai365_web/libext/message-box-0.0.1-SNAPSHOT.jar b/Yangcai365_web/libext/message-box-0.0.1-SNAPSHOT.jar new file mode 100644 index 0000000..85b5db4 Binary files /dev/null and b/Yangcai365_web/libext/message-box-0.0.1-SNAPSHOT.jar differ diff --git a/Yangcai365_web/libext/mq-http-sdk-1.0.1.jar b/Yangcai365_web/libext/mq-http-sdk-1.0.1.jar new file mode 100644 index 0000000..9727a87 Binary files /dev/null and b/Yangcai365_web/libext/mq-http-sdk-1.0.1.jar differ diff --git a/Yangcai365_web/libext/netty-all-4.1.23.Final.jar b/Yangcai365_web/libext/netty-all-4.1.23.Final.jar new file mode 100644 index 0000000..8212bd4 Binary files /dev/null and b/Yangcai365_web/libext/netty-all-4.1.23.Final.jar differ diff --git a/Yangcai365_web/libext/noggit-0.6.jar b/Yangcai365_web/libext/noggit-0.6.jar new file mode 100644 index 0000000..c23e06f Binary files /dev/null and b/Yangcai365_web/libext/noggit-0.6.jar differ diff --git a/Yangcai365_web/libext/redxyz_commons.jar b/Yangcai365_web/libext/redxyz_commons.jar new file mode 100644 index 0000000..1b7a604 Binary files /dev/null and b/Yangcai365_web/libext/redxyz_commons.jar differ diff --git a/Yangcai365_web/libext/sanselan-0.97-incubator.jar b/Yangcai365_web/libext/sanselan-0.97-incubator.jar new file mode 100644 index 0000000..fff931f Binary files /dev/null and b/Yangcai365_web/libext/sanselan-0.97-incubator.jar differ diff --git a/Yangcai365_web/libext/serializer-2.7.2.jar b/Yangcai365_web/libext/serializer-2.7.2.jar new file mode 100644 index 0000000..10c881c Binary files /dev/null and b/Yangcai365_web/libext/serializer-2.7.2.jar differ diff --git a/Yangcai365_web/libext/slf4j-api-1.7.25.jar b/Yangcai365_web/libext/slf4j-api-1.7.25.jar new file mode 100644 index 0000000..0143c09 Binary files /dev/null and b/Yangcai365_web/libext/slf4j-api-1.7.25.jar differ diff --git a/Yangcai365_web/libext/solr-solrj-6.6.3.jar b/Yangcai365_web/libext/solr-solrj-6.6.3.jar new file mode 100644 index 0000000..5a829be Binary files /dev/null and b/Yangcai365_web/libext/solr-solrj-6.6.3.jar differ diff --git a/Yangcai365_web/libext/taobao-sdk-java-dingtalk-20191101.jar b/Yangcai365_web/libext/taobao-sdk-java-dingtalk-20191101.jar new file mode 100644 index 0000000..7385fc0 Binary files /dev/null and b/Yangcai365_web/libext/taobao-sdk-java-dingtalk-20191101.jar differ diff --git a/Yangcai365_web/libext/workwechat-service-provider-SNAPSHOT-1.0.0.jar b/Yangcai365_web/libext/workwechat-service-provider-SNAPSHOT-1.0.0.jar new file mode 100644 index 0000000..9f88093 Binary files /dev/null and b/Yangcai365_web/libext/workwechat-service-provider-SNAPSHOT-1.0.0.jar differ diff --git a/Yangcai365_web/libext/xalan-2.7.2.jar b/Yangcai365_web/libext/xalan-2.7.2.jar new file mode 100644 index 0000000..abdabe3 Binary files /dev/null and b/Yangcai365_web/libext/xalan-2.7.2.jar differ diff --git a/Yangcai365_web/libext/xercesImpl-2.9.1.jar b/Yangcai365_web/libext/xercesImpl-2.9.1.jar new file mode 100644 index 0000000..78abfdd Binary files /dev/null and b/Yangcai365_web/libext/xercesImpl-2.9.1.jar differ diff --git a/Yangcai365_web/libext/xml-apis-1.3.04.jar b/Yangcai365_web/libext/xml-apis-1.3.04.jar new file mode 100644 index 0000000..d42c0ea Binary files /dev/null and b/Yangcai365_web/libext/xml-apis-1.3.04.jar differ diff --git a/Yangcai365_web/libext/xml-apis-ext-1.3.04.jar b/Yangcai365_web/libext/xml-apis-ext-1.3.04.jar new file mode 100644 index 0000000..a7869d6 Binary files /dev/null and b/Yangcai365_web/libext/xml-apis-ext-1.3.04.jar differ diff --git a/Yangcai365_web/libext/xmlgraphics-commons-2.2.jar b/Yangcai365_web/libext/xmlgraphics-commons-2.2.jar new file mode 100644 index 0000000..d1813ff Binary files /dev/null and b/Yangcai365_web/libext/xmlgraphics-commons-2.2.jar differ diff --git a/Yangcai365_web/libext/zxing-core3.3.0.jar b/Yangcai365_web/libext/zxing-core3.3.0.jar new file mode 100644 index 0000000..b5fa0b3 Binary files /dev/null and b/Yangcai365_web/libext/zxing-core3.3.0.jar differ diff --git a/Yangcai365_web/libext/zxing-j2se3.3.0.jar b/Yangcai365_web/libext/zxing-j2se3.3.0.jar new file mode 100644 index 0000000..ebc53de Binary files /dev/null and b/Yangcai365_web/libext/zxing-j2se3.3.0.jar differ diff --git a/Yangcai365_web/logs/error.log b/Yangcai365_web/logs/error.log new file mode 100644 index 0000000..e69de29 diff --git a/Yangcai365_web/logs/info.log b/Yangcai365_web/logs/info.log new file mode 100644 index 0000000..e69de29 diff --git a/Yangcai365_web/manage/conf/config.xml b/Yangcai365_web/manage/conf/config.xml new file mode 100644 index 0000000..965c444 --- /dev/null +++ b/Yangcai365_web/manage/conf/config.xml @@ -0,0 +1,618 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Yangcai365_web/manage/conf/config.zml b/Yangcai365_web/manage/conf/config.zml new file mode 100644 index 0000000..c627935 --- /dev/null +++ b/Yangcai365_web/manage/conf/config.zml @@ -0,0 +1,921 @@ +<#----------------------------------------------------> +<#-- 以下为变量定义 ------------------------> +<#----------------------------------------------------> + +<#--脚注标注--> +<#var zmr_copyname="2021 秒绘科技"/> +<#var zmr_copyright="Copyright  © "+zmr_copyname+" All Rights Reserved"/> +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(context.getRootPath("/zinc/css/yangcai_question_main_v1.4.0R2018031701.css"))} +${Scripts.src(context.getRootPath("/zinc/css/zhiqim_search_auto_list_v1.4.0R2018031701.js"))} + +<#--属性定义--> +<#var name="设计运营后台"/> +<#var version="V1.0"/> +<#var zhiqim_uploadlarge.js = new ZmrCdnRuntime(context, "/service/res/zhiqim_upload_large_v1.5.0.r2018111001.js")/> + + +<#--刷新左边区域自定义块--> +<#function zhiqim_manager_topnav_left_defined()> + + + +<#-- 重写模板编辑版本号--> +<#var media_editor_js_version="v1.5.0_r2020121101"/> + +<#-- 重写模板定稿、预览--> +<#function zhqim_media_edit_print(mediaId)> + +<#if !isTemplateEdit> + + + + + + +<#-- 重写模板左边订单选项--> +<#function zhqim_media_edit_order_item_defined(mediaId)> + + +

  • 订单
  • + + + + +<#function zhqim_media_my_material_defined()> + + +
    + 全部 + 文字 + 图片 + 形状 + 二维码 +
    +
    +
    +
    +
    +
    已经到底了!!
    +
    +
    + + +<#--计算左侧宽高值--> +<#function yangcai_calc_Left_width_height(width, height)> + + + + +<#--计算指定元素的宽度--> +<#function yangcai_designer_calc_width(width, containerId)> + + + + +<#function sweet_alert_reuse_method()> + ${Scripts.src("/zinc/js/sweetalert2.min.js")} + + + +<#function Mydome()> + + diff --git a/Yangcai365_web/manage/favicon.ico b/Yangcai365_web/manage/favicon.ico new file mode 100644 index 0000000..6d95111 Binary files /dev/null and b/Yangcai365_web/manage/favicon.ico differ diff --git a/Yangcai365_web/manage/robots.txt b/Yangcai365_web/manage/robots.txt new file mode 100644 index 0000000..77470cb --- /dev/null +++ b/Yangcai365_web/manage/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/chart/data.js b/Yangcai365_web/manage/zinc/chart/data.js new file mode 100644 index 0000000..df5b6ad --- /dev/null +++ b/Yangcai365_web/manage/zinc/chart/data.js @@ -0,0 +1,26 @@ +/* + Highcharts JS v5.0.7 (2017-01-17) + Data module + + (c) 2012-2016 Torstein Honsi + + License: www.highcharts.com/license +*/ +(function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(g){var p=g.win.document,m=g.each,z=g.pick,w=g.inArray,x=g.isNumber,A=g.splat,n,u=function(b,a){this.init(b,a)};g.extend(u.prototype,{init:function(b,a){this.options=b;this.chartOptions=a;this.columns=b.columns||this.rowsToColumns(b.rows)||[];this.firstRowAsNames=z(b.firstRowAsNames,!0);this.decimalRegex=b.decimalPoint&&new RegExp("^(-?[0-9]+)"+b.decimalPoint+"([0-9]+)$");this.rawColumns=[]; +this.columns.length?this.dataFound():(this.parseCSV(),this.parseTable(),this.parseGoogleSpreadsheet())},getColumnDistribution:function(){var b=this.chartOptions,a=this.options,d=[],f=function(b){return(g.seriesTypes[b||"line"].prototype.pointArrayMap||[0]).length},e=b&&b.chart&&b.chart.type,c=[],k=[],t=0,h;m(b&&b.series||[],function(b){c.push(f(b.type||e))});m(a&&a.seriesMapping||[],function(b){d.push(b.x||0)});0===d.length&&d.push(0);m(a&&a.seriesMapping||[],function(a){var d=new n,r,v=c[t]||f(e), +q=g.seriesTypes[((b&&b.series||[])[t]||{}).type||e||"line"].prototype.pointArrayMap||["y"];d.addColumnReader(a.x,"x");for(r in a)a.hasOwnProperty(r)&&"x"!==r&&d.addColumnReader(a[r],r);for(h=0;h=e&&d<=c&&!r&&""!==g&&(a= +a.split(h),m(a,function(b,a){a>=k&&a<=t&&(f[a-k]||(f[a-k]=[]),f[a-k][y]=b)}),y+=1)}),this.dataFound())},parseTable:function(){var b=this.options,a=b.table,d=this.columns,f=b.startRow||0,e=b.endRow||Number.MAX_VALUE,c=b.startColumn||0,k=b.endColumn||Number.MAX_VALUE;a&&("string"===typeof a&&(a=p.getElementById(a)),m(a.getElementsByTagName("tr"),function(b,a){a>=f&&a<=e&&m(b.children,function(b,e){("TD"===b.tagName||"TH"===b.tagName)&&e>=c&&e<=k&&(d[e-c]||(d[e-c]=[]),d[e-c][a-f]=b.innerHTML)})}),this.dataFound())}, +parseGoogleSpreadsheet:function(){var b=this,a=this.options,d=a.googleSpreadsheetKey,f=this.columns,e=a.startRow||0,c=a.endRow||Number.MAX_VALUE,k=a.startColumn||0,g=a.endColumn||Number.MAX_VALUE,h,v;d&&jQuery.ajax({dataType:"json",url:"https://spreadsheets.google.com/feeds/cells/"+d+"/"+(a.googleSpreadsheetWorksheet||"od6")+"/public/values?alt\x3djson-in-script\x26callback\x3d?",error:a.error,success:function(a){a=a.feed.entry;var d,t=a.length,q=0,n=0,l;for(l=0;l=k&&l<=g&&(f[l-k]=[],f[l-k].length=Math.min(n,c-e));for(l=0;l=k&&v<=g&&h>=e&&h<=c&&(f[v-k][h-e]=d.content.$t);m(f,function(a){for(l=0;lb[e+1])):(k=this.parseDate(c),m&&x(k)&&"float"!==u?(r[e]=c,b[e]=k,b.isDatetime=!0,void 0!==b[e+1]&&(c=k>b[e+1],c!==q&&void 0!==q&&(this.alternativeFormat?(this.dateFormat=this.alternativeFormat,e=b.length,this.alternativeFormat=this.dateFormats[this.dateFormat].alternative):b.unsorted=!0),q=c)):(b[e]=""===g?null:g,0!==e&&(b.isDatetime||b.isNumeric)&&(b.mixed=!0)));m&&b.mixed&&(f[a]=d[a]);if(m&&q&&this.options.sort)for(a=0;a(.*?$)/);e&&(e= +'\x3cforeignObject x\x3d"0" y\x3d"0" width\x3d"'+c.chart.width+'" height\x3d"'+c.chart.height+'"\x3e\x3cbody xmlns\x3d"http://www.w3.org/1999/xhtml"\x3e'+e[1]+"\x3c/body\x3e\x3c/foreignObject\x3e",a=a.replace("\x3c/svg\x3e",e+"\x3c/svg\x3e"))}a=a.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|")(\S+)("|")\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/.*?$/,"\x3c/svg\x3e").replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g,'$1\x3d"rgb($2)" $1-opacity\x3d"$3"').replace(/ /g,"\u00a0").replace(/­/g,"\u00ad");return a=a.replace(//g,"\x3c$1title\x3e").replace(/height=([^" ]+)/g,'height\x3d"$1"').replace(/width=([^" ]+)/g,'width\x3d"$1"').replace(/hc-svg-href="([^"]+)">/g,'xlink:href\x3d"$1"/\x3e').replace(/ id=([^" >]+)/g,' id\x3d"$1"').replace(/class=([^" >]+)/g, +'class\x3d"$1"').replace(/ transform /g," ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(a){return a.toLowerCase()})},getChartHTML:function(){return this.container.innerHTML},getSVG:function(a){var c,e,b,w,m,g=p(this.options,a);n.createElementNS||(n.createElementNS=function(a,c){return n.createElement(c)});e=q("div",null,{position:"absolute",top:"-9999em",width:this.chartWidth+"px",height:this.chartHeight+"px"},n.body);b=this.renderTo.style.width;m=this.renderTo.style.height; +b=g.exporting.sourceWidth||g.chart.width||/px$/.test(b)&&parseInt(b,10)||600;m=g.exporting.sourceHeight||g.chart.height||/px$/.test(m)&&parseInt(m,10)||400;r(g.chart,{animation:!1,renderTo:e,forExport:!0,renderer:"SVGRenderer",width:b,height:m});g.exporting.enabled=!1;delete g.data;g.series=[];k(this.series,function(a){w=p(a.userOptions,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});w.isInternal||g.series.push(w)});k(this.axes,function(a){a.userOptions.internalKey=f.uniqueKey()}); +c=new f.Chart(g,this.callback);a&&k(["xAxis","yAxis","series"],function(b){var d={};a[b]&&(d[b]=a[b],c.update(d))});k(this.axes,function(a){var b=f.find(c.axes,function(b){return b.options.internalKey===a.userOptions.internalKey}),d=a.getExtremes(),e=d.userMin,d=d.userMax;!b||void 0===e&&void 0===d||b.setExtremes(e,d,!0,!1)});b=c.getChartHTML();b=this.sanitizeSVG(b,g);g=null;c.destroy();B(e);return b},getSVGForExport:function(a,c){var e=this.options.exporting;return this.getSVG(p({chart:{borderRadius:0}}, +e.chartOptions,c,{exporting:{sourceWidth:a&&a.sourceWidth||e.sourceWidth,sourceHeight:a&&a.sourceHeight||e.sourceHeight}}))},exportChart:function(a,c){c=this.getSVGForExport(a,c);a=p(this.options.exporting,a);f.post(a.url,{filename:a.filename||"chart",type:a.type,width:a.width||0,scale:a.scale,svg:c},a.formAttributes)},print:function(){var a=this,c=a.container,e=[],b=c.parentNode,f=n.body,m=f.childNodes,g=a.options.exporting.printMaxWidth,d,t;if(!a.isPrinting){a.isPrinting=!0;a.pointer.reset(null, +0);D(a,"beforePrint");if(t=g&&a.chartWidth>g)d=[a.options.chart.width,void 0,!1],a.setSize(g,void 0,!1);k(m,function(a,b){1===a.nodeType&&(e[b]=a.style.display,a.style.display="none")});f.appendChild(c);E.focus();E.print();setTimeout(function(){b.appendChild(c);k(m,function(a,b){1===a.nodeType&&(a.style.display=e[b])});a.isPrinting=!1;t&&a.setSize.apply(a,d);D(a,"afterPrint")},1E3)}},contextMenu:function(a,c,e,b,f,m,g){var d=this,t=d.options.navigation,w=d.chartWidth,h=d.chartHeight,p="cache-"+a, +l=d[p],x=Math.max(f,m),y,z;l||(d[p]=l=q("div",{className:a},{position:"absolute",zIndex:1E3,padding:x+"px"},d.container),y=q("div",{className:"highcharts-menu"},null,l),v(y,r({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},t.menuStyle)),z=function(){v(l,{display:"none"});g&&g.setState(0);d.openMenu=!1},u(l,"mouseleave",function(){l.hideTimer=setTimeout(z,500)}),u(l,"mouseenter",function(){clearTimeout(l.hideTimer)}),p=u(n,"mouseup",function(b){d.pointer.inClass(b.target, +a)||z()}),u(d,"destroy",p),k(c,function(a){if(a){var b;a.separator?b=q("hr",null,null,y):(b=q("div",{className:"highcharts-menu-item",onclick:function(b){b&&b.stopPropagation();z();a.onclick&&a.onclick.apply(d,arguments)},innerHTML:a.text||d.options.lang[a.textKey]},null,y),b.onmouseover=function(){v(this,t.menuItemHoverStyle)},b.onmouseout=function(){v(this,t.menuItemStyle)},v(b,r({cursor:"pointer"},t.menuItemStyle)));d.exportDivElements.push(b)}}),d.exportDivElements.push(y,l),d.exportMenuWidth= +l.offsetWidth,d.exportMenuHeight=l.offsetHeight);c={display:"block"};e+d.exportMenuWidth>w?c.right=w-e-f-x+"px":c.left=e-x+"px";b+m+d.exportMenuHeight>h&&"top"!==g.alignOptions.verticalAlign?c.bottom=h-b-x+"px":c.top=b+m-x+"px";v(l,c);d.openMenu=!0},addButton:function(a){var c=this,e=c.renderer,b=p(c.options.navigation.buttonOptions,a),f=b.onclick,m=b.menuItems,g,d,h=b.symbolSize||12;c.btnCount||(c.btnCount=0);c.exportDivElements||(c.exportDivElements=[],c.exportSVGElements=[]);if(!1!==b.enabled){var k= +b.theme,n=k.states,q=n&&n.hover,n=n&&n.select,l;delete k.states;f?l=function(a){a.stopPropagation();f.call(c,a)}:m&&(l=function(){c.contextMenu(d.menuClassName,m,d.translateX,d.translateY,d.width,d.height,d);d.setState(2)});b.text&&b.symbol?k.paddingLeft=C(k.paddingLeft,25):b.text||r(k,{width:b.width,height:b.height,padding:0});d=e.button(b.text,0,0,l,k,q,n).addClass(a.className).attr({"stroke-linecap":"round",title:c.options.lang[b._titleKey],zIndex:3});d.menuClassName=a.menuClassName||"highcharts-menu-"+ +c.btnCount++;b.symbol&&(g=e.symbol(b.symbol,b.symbolX-h/2,b.symbolY-h/2,h,h).addClass("highcharts-button-symbol").attr({zIndex:1}).add(d),g.attr({stroke:b.symbolStroke,fill:b.symbolFill,"stroke-width":b.symbolStrokeWidth||1}));d.add().align(r(b,{width:d.width,x:C(b.x,c.buttonOffset)}),!0,"spacingBox");c.buttonOffset+=(d.width+b.buttonSpacing)*("right"===b.align?-1:1);c.exportSVGElements.push(d,g)}},destroyExport:function(a){var c=a?a.target:this;a=c.exportSVGElements;var e=c.exportDivElements;a&& +(k(a,function(a,e){a&&(a.onclick=a.ontouchstart=null,c.exportSVGElements[e]=a.destroy())}),a.length=0);e&&(k(e,function(a,e){clearTimeout(a.hideTimer);F(a,"mouseleave");c.exportDivElements[e]=a.onmouseout=a.onmouseover=a.ontouchstart=a.onclick=null;B(a)}),e.length=0)}});H.menu=function(a,c,e,b){return["M",a,c+2.5,"L",a+e,c+2.5,"M",a,c+b/2+.5,"L",a+e,c+b/2+.5,"M",a,c+b-1.5,"L",a+e,c+b-1.5]};A.prototype.renderExporting=function(){var a,c=this.options.exporting,e=c.buttons,b=this.isDirtyExporting||!this.exportSVGElements; +this.buttonOffset=0;this.isDirtyExporting&&this.destroyExport();if(b&&!1!==c.enabled){for(a in e)this.addButton(e[a]);this.isDirtyExporting=!1}u(this,"destroy",this.destroyExport)};A.prototype.callbacks.push(function(a){a.renderExporting();u(a,"redraw",a.renderExporting);k(["exporting","navigation"],function(c){a[c]={update:function(e,b){a.isDirtyExporting=!0;p(!0,a.options[c],e);C(b,!0)&&a.redraw()}}})})})(h)}); diff --git a/Yangcai365_web/manage/zinc/chart/highcharts-zh_CN.js b/Yangcai365_web/manage/zinc/chart/highcharts-zh_CN.js new file mode 100644 index 0000000..276b73b --- /dev/null +++ b/Yangcai365_web/manage/zinc/chart/highcharts-zh_CN.js @@ -0,0 +1,92 @@ +/** + * Highcharts-zh_CN plugins v1.0.0 (2017-02-22) + * + * (c) 2017 Jianshu Technology CO.,LTD (https://jianshukeji.com) + * + * Author : John@jianshukeji.com, Blue Monkey + * + * License: Creative Commons Attribution (CC) + */ + +(function(H) { + var protocol = window.location.protocol; + + var defaultOptionsZhCn = { + lang: { + // Highcharts + contextButtonTitle: '图表导出菜单', + decimalPoint: '.', + downloadJPEG: "下载JPEG图片", + downloadPDF: "下载PDF文件", + downloadPNG: "下载PNG文件", + downloadSVG: "下载SVG文件", + drillUpText: "返回 {series.name}", + invalidDate: '无效的时间', + loading: '加载中...', + months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], + noData: "没有数据", + numericSymbols: null, + printChart: "打印图表", + resetZoom: '重置缩放比例', + resetZoomTitle: '重置为原始大小', + shortMonths: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], + thousandsSep: ',', + weekdays: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'], + + // Highstock + rangeSelectorFrom: '开始时间', + rangeSelectorTo: '结束时间', + rangeSelectorZoom: '缩放', + + // Highmaps + zoomIn: '缩小', + zoomOut: '放大' + }, + global: { + useUTC: true, + //timezoneOffset: -8 * 60, + canvasToolsURL: protocol + '//cdn.hcharts.cn/highcharts/modules/canvas-tools.js', + VMLRadialGradientURL: protocol + +'//cdn.hcharts.cn/highcharts/gfx/vml-radial-gradient.png' + }, + + title: { + text: '图表标题' + }, + tooltip: { + dateTimeLabelFormats: { + millisecond: '%H:%M:%S.%L', + second: '%H:%M:%S', + minute: '%H:%M', + hour: '%H:%M', + day: '%Y-%m-%d', + week: '%Y-%m-%d', + month: '%Y-%m', + year: '%Y' + } + }, + + exporting: { + url: protocol + '//export.highcharts.com.cn' + }, + credits: { + + text: 'Highcharts', + href: 'https://highcharts.com.cn', + + }, + xAxis: { + dateTimeLabelFormats: { + millisecond: '%H:%M:%S.%L', + second: '%H:%M:%S', + minute: '%H:%M', + hour: '%H:%M', + day: '%Y-%m-%d', + week: '%Y-%m-%d', + month: '%Y-%m', + year: '%Y' + } + } + }; + + H.setOptions(defaultOptionsZhCn); +}(Highcharts)); diff --git a/Yangcai365_web/manage/zinc/chart/highcharts.js b/Yangcai365_web/manage/zinc/chart/highcharts.js new file mode 100644 index 0000000..bc81ade --- /dev/null +++ b/Yangcai365_web/manage/zinc/chart/highcharts.js @@ -0,0 +1,5758 @@ +/* + Highcharts JS v5.0.7 (2017-01-17) + + (c) 2009-2016 Torstein Honsi + + License: www.highcharts.com/license + */ +(function (L, a) { + "object" === typeof module && module.exports ? module.exports = L.document ? a(L) : a : L.Highcharts = a(L) +})("undefined" !== typeof window ? window : this, function (L) { + L = function () { + var a = window, B = a.document, A = a.navigator && a.navigator.userAgent || "", H = B && B.createElementNS && !!B.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect, G = /(edge|msie|trident)/i.test(A) && !window.opera, r = !H, g = /Firefox/.test(A), f = g && 4 > parseInt(A.split("Firefox/")[1], 10); + return a.Highcharts ? a.Highcharts.error(16, !0) : { + product: "", + version: "5.0.7", + deg2rad: 2 * Math.PI / 360, + doc: B, + hasBidiBug: f, + hasTouch: B && void 0 !== B.documentElement.ontouchstart, + isMS: G, + isWebKit: /AppleWebKit/.test(A), + isFirefox: g, + isTouchDevice: /(Mobile|Android|Windows Phone)/.test(A), + SVG_NS: "http://www.w3.org/2000/svg", + chartCount: 0, + seriesTypes: {}, + symbolSizes: {}, + svg: H, + vml: r, + win: a, + charts: [], + marginNames: ["plotTop", "marginRight", "marginBottom", "plotLeft"], + noop: function () { + } + } + }(); + (function (a) { + var B = [], A = a.charts, H = a.doc, G = a.win; + a.error = function (r, g) { + r = a.isNumber(r) ? "Highcharts error #" + + r + ": www.highcharts.com/errors/" + r : r; + if (g)throw Error(r); + G.console && console.log(r) + }; + a.Fx = function (a, g, f) { + this.options = g; + this.elem = a; + this.prop = f + }; + a.Fx.prototype = { + dSetter: function () { + var a = this.paths[0], g = this.paths[1], f = [], u = this.now, l = a.length, q; + if (1 === u)f = this.toD; else if (l === g.length && 1 > u)for (; l--;)q = parseFloat(a[l]), f[l] = isNaN(q) ? a[l] : u * parseFloat(g[l] - q) + q; else f = g; + this.elem.attr("d", f, null, !0) + }, update: function () { + var a = this.elem, g = this.prop, f = this.now, u = this.options.step; + if (this[g + "Setter"])this[g + + "Setter"](); else a.attr ? a.element && a.attr(g, f, null, !0) : a.style[g] = f + this.unit; + u && u.call(a, f, this) + }, run: function (a, g, f) { + var r = this, l = function (a) { + return l.stopped ? !1 : r.step(a) + }, q; + this.startTime = +new Date; + this.start = a; + this.end = g; + this.unit = f; + this.now = this.start; + this.pos = 0; + l.elem = this.elem; + l.prop = this.prop; + l() && 1 === B.push(l) && (l.timerId = setInterval(function () { + for (q = 0; q < B.length; q++)B[q]() || B.splice(q--, 1); + B.length || clearInterval(l.timerId) + }, 13)) + }, step: function (a) { + var r = +new Date, f, u = this.options; + f = this.elem; + var l = u.complete, q = u.duration, d = u.curAnim, b; + if (f.attr && !f.element)f = !1; else if (a || r >= q + this.startTime) { + this.now = this.end; + this.pos = 1; + this.update(); + a = d[this.prop] = !0; + for (b in d)!0 !== d[b] && (a = !1); + a && l && l.call(f); + f = !1 + } else this.pos = u.easing((r - this.startTime) / q), this.now = this.start + (this.end - this.start) * this.pos, this.update(), f = !0; + return f + }, initPath: function (r, g, f) { + function u(a) { + var e, b; + for (n = a.length; n--;)e = "M" === a[n] || "L" === a[n], b = /[a-zA-Z]/.test(a[n + 3]), e && b && a.splice(n + 1, 0, a[n + 1], a[n + 2], a[n + 1], a[n + + 2]) + } + + function l(a, e) { + for (; a.length < m;) { + a[0] = e[m - a.length]; + var b = a.slice(0, t); + [].splice.apply(a, [0, 0].concat(b)); + E && (b = a.slice(a.length - t), [].splice.apply(a, [a.length, 0].concat(b)), n--) + } + a[0] = "M" + } + + function q(a, e) { + for (var b = (m - a.length) / t; 0 < b && b--;)c = a.slice().splice(a.length / z - t, t * z), c[0] = e[m - t - b * t], C && (c[t - 6] = c[t - 2], c[t - 5] = c[t - 1]), [].splice.apply(a, [a.length / z, 0].concat(c)), E && b-- + } + + g = g || ""; + var d, b = r.startX, p = r.endX, C = -1 < g.indexOf("C"), t = C ? 7 : 3, m, c, n; + g = g.split(" "); + f = f.slice(); + var E = r.isArea, z = E ? 2 : 1, e; + C && (u(g), u(f)); + if (b && p) { + for (n = 0; n < b.length; n++)if (b[n] === p[0]) { + d = n; + break + } else if (b[0] === p[p.length - b.length + n]) { + d = n; + e = !0; + break + } + void 0 === d && (g = []) + } + g.length && a.isNumber(d) && (m = f.length + d * z * t, e ? (l(g, f), q(f, g)) : (l(f, g), q(g, f))); + return [g, f] + } + }; + a.extend = function (a, g) { + var f; + a || (a = {}); + for (f in g)a[f] = g[f]; + return a + }; + a.merge = function () { + var r, g = arguments, f, u = {}, l = function (q, d) { + var b, p; + "object" !== typeof q && (q = {}); + for (p in d)d.hasOwnProperty(p) && (b = d[p], a.isObject(b, !0) && "renderTo" !== p && "number" !== typeof b.nodeType ? + q[p] = l(q[p] || {}, b) : q[p] = d[p]); + return q + }; + !0 === g[0] && (u = g[1], g = Array.prototype.slice.call(g, 2)); + f = g.length; + for (r = 0; r < f; r++)u = l(u, g[r]); + return u + }; + a.pInt = function (a, g) { + return parseInt(a, g || 10) + }; + a.isString = function (a) { + return "string" === typeof a + }; + a.isArray = function (a) { + a = Object.prototype.toString.call(a); + return "[object Array]" === a || "[object Array Iterator]" === a + }; + a.isObject = function (r, g) { + return r && "object" === typeof r && (!g || !a.isArray(r)) + }; + a.isNumber = function (a) { + return "number" === typeof a && !isNaN(a) + }; + a.erase = + function (a, g) { + for (var f = a.length; f--;)if (a[f] === g) { + a.splice(f, 1); + break + } + }; + a.defined = function (a) { + return void 0 !== a && null !== a + }; + a.attr = function (r, g, f) { + var u, l; + if (a.isString(g))a.defined(f) ? r.setAttribute(g, f) : r && r.getAttribute && (l = r.getAttribute(g)); else if (a.defined(g) && a.isObject(g))for (u in g)r.setAttribute(u, g[u]); + return l + }; + a.splat = function (r) { + return a.isArray(r) ? r : [r] + }; + a.syncTimeout = function (a, g, f) { + if (g)return setTimeout(a, g, f); + a.call(0, f) + }; + a.pick = function () { + var a = arguments, g, f, u = a.length; + for (g = + 0; g < u; g++)if (f = a[g], void 0 !== f && null !== f)return f + }; + a.css = function (r, g) { + a.isMS && !a.svg && g && void 0 !== g.opacity && (g.filter = "alpha(opacity\x3d" + 100 * g.opacity + ")"); + a.extend(r.style, g) + }; + a.createElement = function (r, g, f, u, l) { + r = H.createElement(r); + var q = a.css; + g && a.extend(r, g); + l && q(r, {padding: 0, border: "none", margin: 0}); + f && q(r, f); + u && u.appendChild(r); + return r + }; + a.extendClass = function (r, g) { + var f = function () { + }; + f.prototype = new r; + a.extend(f.prototype, g); + return f + }; + a.pad = function (a, g, f) { + return Array((g || 2) + 1 - String(a).length).join(f || + 0) + a + }; + a.relativeLength = function (a, g) { + return /%$/.test(a) ? g * parseFloat(a) / 100 : parseFloat(a) + }; + a.wrap = function (a, g, f) { + var r = a[g]; + a[g] = function () { + var a = Array.prototype.slice.call(arguments), q = arguments, d = this; + d.proceed = function () { + r.apply(d, arguments.length ? arguments : q) + }; + a.unshift(r); + a = f.apply(this, a); + d.proceed = null; + return a + } + }; + a.getTZOffset = function (r) { + var g = a.Date; + return 6E4 * (g.hcGetTimezoneOffset && g.hcGetTimezoneOffset(r) || g.hcTimezoneOffset || 0) + }; + a.dateFormat = function (r, g, f) { + if (!a.defined(g) || isNaN(g))return a.defaultOptions.lang.invalidDate || + ""; + r = a.pick(r, "%Y-%m-%d %H:%M:%S"); + var u = a.Date, l = new u(g - a.getTZOffset(g)), q, d = l[u.hcGetHours](), b = l[u.hcGetDay](), p = l[u.hcGetDate](), C = l[u.hcGetMonth](), t = l[u.hcGetFullYear](), m = a.defaultOptions.lang, c = m.weekdays, n = m.shortWeekdays, E = a.pad, u = a.extend({ + a: n ? n[b] : c[b].substr(0, 3), + A: c[b], + d: E(p), + e: E(p, 2, " "), + w: b, + b: m.shortMonths[C], + B: m.months[C], + m: E(C + 1), + y: t.toString().substr(2, 2), + Y: t, + H: E(d), + k: d, + I: E(d % 12 || 12), + l: d % 12 || 12, + M: E(l[u.hcGetMinutes]()), + p: 12 > d ? "AM" : "PM", + P: 12 > d ? "am" : "pm", + S: E(l.getSeconds()), + L: E(Math.round(g % + 1E3), 3) + }, a.dateFormats); + for (q in u)for (; -1 !== r.indexOf("%" + q);)r = r.replace("%" + q, "function" === typeof u[q] ? u[q](g) : u[q]); + return f ? r.substr(0, 1).toUpperCase() + r.substr(1) : r + }; + a.formatSingle = function (r, g) { + var f = /\.([0-9])/, u = a.defaultOptions.lang; + /f$/.test(r) ? (f = (f = r.match(f)) ? f[1] : -1, null !== g && (g = a.numberFormat(g, f, u.decimalPoint, -1 < r.indexOf(",") ? u.thousandsSep : ""))) : g = a.dateFormat(r, g); + return g + }; + a.format = function (r, g) { + for (var f = "{", u = !1, l, q, d, b, p = [], C; r;) { + f = r.indexOf(f); + if (-1 === f)break; + l = r.slice(0, + f); + if (u) { + l = l.split(":"); + q = l.shift().split("."); + b = q.length; + C = g; + for (d = 0; d < b; d++)C = C[q[d]]; + l.length && (C = a.formatSingle(l.join(":"), C)); + p.push(C) + } else p.push(l); + r = r.slice(f + 1); + f = (u = !u) ? "}" : "{" + } + p.push(r); + return p.join("") + }; + a.getMagnitude = function (a) { + return Math.pow(10, Math.floor(Math.log(a) / Math.LN10)) + }; + a.normalizeTickInterval = function (r, g, f, u, l) { + var q, d = r; + f = a.pick(f, 1); + q = r / f; + g || (g = l ? [1, 1.2, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 10] : [1, 2, 2.5, 5, 10], !1 === u && (1 === f ? g = a.grep(g, function (a) { + return 0 === a % 1 + }) : .1 >= f && (g = [1 / f]))); + for (u = 0; u < g.length && !(d = g[u], l && d * f >= r || !l && q <= (g[u] + (g[u + 1] || g[u])) / 2); u++); + return d = a.correctFloat(d * f, -Math.round(Math.log(.001) / Math.LN10)) + }; + a.stableSort = function (a, g) { + var f = a.length, r, l; + for (l = 0; l < f; l++)a[l].safeI = l; + a.sort(function (a, d) { + r = g(a, d); + return 0 === r ? a.safeI - d.safeI : r + }); + for (l = 0; l < f; l++)delete a[l].safeI + }; + a.arrayMin = function (a) { + for (var g = a.length, f = a[0]; g--;)a[g] < f && (f = a[g]); + return f + }; + a.arrayMax = function (a) { + for (var g = a.length, f = a[0]; g--;)a[g] > f && (f = a[g]); + return f + }; + a.destroyObjectProperties = + function (a, g) { + for (var f in a)a[f] && a[f] !== g && a[f].destroy && a[f].destroy(), delete a[f] + }; + a.discardElement = function (r) { + var g = a.garbageBin; + g || (g = a.createElement("div")); + r && g.appendChild(r); + g.innerHTML = "" + }; + a.correctFloat = function (a, g) { + return parseFloat(a.toPrecision(g || 14)) + }; + a.setAnimation = function (r, g) { + g.renderer.globalAnimation = a.pick(r, g.options.chart.animation, !0) + }; + a.animObject = function (r) { + return a.isObject(r) ? a.merge(r) : {duration: r ? 500 : 0} + }; + a.timeUnits = { + millisecond: 1, second: 1E3, minute: 6E4, hour: 36E5, + day: 864E5, week: 6048E5, month: 24192E5, year: 314496E5 + }; + a.numberFormat = function (r, g, f, u) { + r = +r || 0; + g = +g; + var l = a.defaultOptions.lang, q = (r.toString().split(".")[1] || "").length, d, b; + -1 === g ? g = Math.min(q, 20) : a.isNumber(g) || (g = 2); + b = (Math.abs(r) + Math.pow(10, -Math.max(g, q) - 1)).toFixed(g); + q = String(a.pInt(b)); + d = 3 < q.length ? q.length % 3 : 0; + f = a.pick(f, l.decimalPoint); + u = a.pick(u, l.thousandsSep); + r = (0 > r ? "-" : "") + (d ? q.substr(0, d) + u : ""); + r += q.substr(d).replace(/(\d{3})(?=\d)/g, "$1" + u); + g && (r += f + b.slice(-g)); + return r + }; + Math.easeInOutSine = + function (a) { + return -.5 * (Math.cos(Math.PI * a) - 1) + }; + a.getStyle = function (r, g) { + return "width" === g ? Math.min(r.offsetWidth, r.scrollWidth) - a.getStyle(r, "padding-left") - a.getStyle(r, "padding-right") : "height" === g ? Math.min(r.offsetHeight, r.scrollHeight) - a.getStyle(r, "padding-top") - a.getStyle(r, "padding-bottom") : (r = G.getComputedStyle(r, void 0)) && a.pInt(r.getPropertyValue(g)) + }; + a.inArray = function (a, g) { + return g.indexOf ? g.indexOf(a) : [].indexOf.call(g, a) + }; + a.grep = function (a, g) { + return [].filter.call(a, g) + }; + a.find = function (a, + g) { + return [].find.call(a, g) + }; + a.map = function (a, g) { + for (var f = [], u = 0, l = a.length; u < l; u++)f[u] = g.call(a[u], a[u], u, a); + return f + }; + a.offset = function (a) { + var g = H.documentElement; + a = a.getBoundingClientRect(); + return { + top: a.top + (G.pageYOffset || g.scrollTop) - (g.clientTop || 0), + left: a.left + (G.pageXOffset || g.scrollLeft) - (g.clientLeft || 0) + } + }; + a.stop = function (a, g) { + for (var f = B.length; f--;)B[f].elem !== a || g && g !== B[f].prop || (B[f].stopped = !0) + }; + a.each = function (a, g, f) { + return Array.prototype.forEach.call(a, g, f) + }; + a.addEvent = function (r, + g, f) { + function u(a) { + a.target = a.srcElement || G; + f.call(r, a) + } + + var l = r.hcEvents = r.hcEvents || {}; + r.addEventListener ? r.addEventListener(g, f, !1) : r.attachEvent && (r.hcEventsIE || (r.hcEventsIE = {}), r.hcEventsIE[f.toString()] = u, r.attachEvent("on" + g, u)); + l[g] || (l[g] = []); + l[g].push(f); + return function () { + a.removeEvent(r, g, f) + } + }; + a.removeEvent = function (r, g, f) { + function u(a, b) { + r.removeEventListener ? r.removeEventListener(a, b, !1) : r.attachEvent && (b = r.hcEventsIE[b.toString()], r.detachEvent("on" + a, b)) + } + + function l() { + var a, b; + if (r.nodeName)for (b in g ? + (a = {}, a[g] = !0) : a = d, a)if (d[b])for (a = d[b].length; a--;)u(b, d[b][a]) + } + + var q, d = r.hcEvents, b; + d && (g ? (q = d[g] || [], f ? (b = a.inArray(f, q), -1 < b && (q.splice(b, 1), d[g] = q), u(g, f)) : (l(), d[g] = [])) : (l(), r.hcEvents = {})) + }; + a.fireEvent = function (r, g, f, u) { + var l; + l = r.hcEvents; + var q, d; + f = f || {}; + if (H.createEvent && (r.dispatchEvent || r.fireEvent))l = H.createEvent("Events"), l.initEvent(g, !0, !0), a.extend(l, f), r.dispatchEvent ? r.dispatchEvent(l) : r.fireEvent(g, l); else if (l)for (l = l[g] || [], q = l.length, f.target || a.extend(f, { + preventDefault: function () { + f.defaultPrevented = !0 + }, target: r, type: g + }), g = 0; g < q; g++)(d = l[g]) && !1 === d.call(r, f) && f.preventDefault(); + u && !f.defaultPrevented && u(f) + }; + a.animate = function (r, g, f) { + var u, l = "", q, d, b; + a.isObject(f) || (u = arguments, f = {duration: u[2], easing: u[3], complete: u[4]}); + a.isNumber(f.duration) || (f.duration = 400); + f.easing = "function" === typeof f.easing ? f.easing : Math[f.easing] || Math.easeInOutSine; + f.curAnim = a.merge(g); + for (b in g)a.stop(r, b), d = new a.Fx(r, f, b), q = null, "d" === b ? (d.paths = d.initPath(r, r.d, g.d), d.toD = g.d, u = 0, q = 1) : r.attr ? u = r.attr(b) : (u = parseFloat(a.getStyle(r, + b)) || 0, "opacity" !== b && (l = "px")), q || (q = g[b]), q.match && q.match("px") && (q = q.replace(/px/g, "")), d.run(u, q, l) + }; + a.seriesType = function (r, g, f, u, l) { + var q = a.getOptions(), d = a.seriesTypes; + q.plotOptions[r] = a.merge(q.plotOptions[g], f); + d[r] = a.extendClass(d[g] || function () { + }, u); + d[r].prototype.type = r; + l && (d[r].prototype.pointClass = a.extendClass(a.Point, l)); + return d[r] + }; + a.uniqueKey = function () { + var a = Math.random().toString(36).substring(2, 9), g = 0; + return function () { + return "highcharts-" + a + "-" + g++ + } + }(); + G.jQuery && (G.jQuery.fn.highcharts = + function () { + var r = [].slice.call(arguments); + if (this[0])return r[0] ? (new (a[a.isString(r[0]) ? r.shift() : "Chart"])(this[0], r[0], r[1]), this) : A[a.attr(this[0], "data-highcharts-chart")] + }); + H && !H.defaultView && (a.getStyle = function (r, g) { + var f = {width: "clientWidth", height: "clientHeight"}[g]; + if (r.style[g])return a.pInt(r.style[g]); + "opacity" === g && (g = "filter"); + if (f)return r.style.zoom = 1, Math.max(r[f] - 2 * a.getStyle(r, "padding"), 0); + r = r.currentStyle[g.replace(/\-(\w)/g, function (a, l) { + return l.toUpperCase() + })]; + "filter" === + g && (r = r.replace(/alpha\(opacity=([0-9]+)\)/, function (a, l) { + return l / 100 + })); + return "" === r ? 1 : a.pInt(r) + }); + Array.prototype.forEach || (a.each = function (a, g, f) { + for (var u = 0, l = a.length; u < l; u++)if (!1 === g.call(f, a[u], u, a))return u + }); + Array.prototype.indexOf || (a.inArray = function (a, g) { + var f, u = 0; + if (g)for (f = g.length; u < f; u++)if (g[u] === a)return u; + return -1 + }); + Array.prototype.filter || (a.grep = function (a, g) { + for (var f = [], u = 0, l = a.length; u < l; u++)g(a[u], u) && f.push(a[u]); + return f + }); + Array.prototype.find || (a.find = function (a, g) { + var f, + u = a.length; + for (f = 0; f < u; f++)if (g(a[f], f))return a[f] + }) + })(L); + (function (a) { + var B = a.each, A = a.isNumber, H = a.map, G = a.merge, r = a.pInt; + a.Color = function (g) { + if (!(this instanceof a.Color))return new a.Color(g); + this.init(g) + }; + a.Color.prototype = { + parsers: [{ + regex: /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/, + parse: function (a) { + return [r(a[1]), r(a[2]), r(a[3]), parseFloat(a[4], 10)] + } + }, { + regex: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/, parse: function (a) { + return [r(a[1], + 16), r(a[2], 16), r(a[3], 16), 1] + } + }, { + regex: /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/, parse: function (a) { + return [r(a[1]), r(a[2]), r(a[3]), 1] + } + }], names: {white: "#ffffff", black: "#000000"}, init: function (g) { + var f, u, l, q; + if ((this.input = g = this.names[g] || g) && g.stops)this.stops = H(g.stops, function (d) { + return new a.Color(d[1]) + }); else for (l = this.parsers.length; l-- && !u;)q = this.parsers[l], (f = q.regex.exec(g)) && (u = q.parse(f)); + this.rgba = u || [] + }, get: function (a) { + var f = this.input, g = this.rgba, l; + this.stops ? + (l = G(f), l.stops = [].concat(l.stops), B(this.stops, function (f, d) { + l.stops[d] = [l.stops[d][0], f.get(a)] + })) : l = g && A(g[0]) ? "rgb" === a || !a && 1 === g[3] ? "rgb(" + g[0] + "," + g[1] + "," + g[2] + ")" : "a" === a ? g[3] : "rgba(" + g.join(",") + ")" : f; + return l + }, brighten: function (a) { + var f, g = this.rgba; + if (this.stops)B(this.stops, function (l) { + l.brighten(a) + }); else if (A(a) && 0 !== a)for (f = 0; 3 > f; f++)g[f] += r(255 * a), 0 > g[f] && (g[f] = 0), 255 < g[f] && (g[f] = 255); + return this + }, setOpacity: function (a) { + this.rgba[3] = a; + return this + } + }; + a.color = function (g) { + return new a.Color(g) + } + })(L); + (function (a) { + var B, A, H = a.addEvent, G = a.animate, r = a.attr, g = a.charts, f = a.color, u = a.css, l = a.createElement, q = a.defined, d = a.deg2rad, b = a.destroyObjectProperties, p = a.doc, C = a.each, t = a.extend, m = a.erase, c = a.grep, n = a.hasTouch, E = a.inArray, z = a.isArray, e = a.isFirefox, x = a.isMS, F = a.isObject, w = a.isString, h = a.isWebKit, y = a.merge, J = a.noop, K = a.pick, I = a.pInt, k = a.removeEvent, D = a.stop, P = a.svg, N = a.SVG_NS, S = a.symbolSizes, O = a.win; + B = a.SVGElement = function () { + return this + }; + B.prototype = { + opacity: 1, + SVG_NS: N, + textProps: "direction fontSize fontWeight fontFamily fontStyle color lineHeight width textDecoration textOverflow textOutline".split(" "), + init: function (a, k) { + this.element = "span" === k ? l(k) : p.createElementNS(this.SVG_NS, k); + this.renderer = a + }, + animate: function (v, k, e) { + k = a.animObject(K(k, this.renderer.globalAnimation, !0)); + 0 !== k.duration ? (e && (k.complete = e), G(this, v, k)) : this.attr(v, null, e); + return this + }, + colorGradient: function (v, k, e) { + var b = this.renderer, h, D, c, x, M, m, n, d, F, t, p, w = [], l; + v.linearGradient ? D = "linearGradient" : v.radialGradient && (D = "radialGradient"); + if (D) { + c = v[D]; + M = b.gradients; + n = v.stops; + t = e.radialReference; + z(c) && (v[D] = c = { + x1: c[0], y1: c[1], x2: c[2], + y2: c[3], gradientUnits: "userSpaceOnUse" + }); + "radialGradient" === D && t && !q(c.gradientUnits) && (x = c, c = y(c, b.getRadialAttr(t, x), {gradientUnits: "userSpaceOnUse"})); + for (p in c)"id" !== p && w.push(p, c[p]); + for (p in n)w.push(n[p]); + w = w.join(","); + M[w] ? t = M[w].attr("id") : (c.id = t = a.uniqueKey(), M[w] = m = b.createElement(D).attr(c).add(b.defs), m.radAttr = x, m.stops = [], C(n, function (v) { + 0 === v[1].indexOf("rgba") ? (h = a.color(v[1]), d = h.get("rgb"), F = h.get("a")) : (d = v[1], F = 1); + v = b.createElement("stop").attr({ + offset: v[0], "stop-color": d, + "stop-opacity": F + }).add(m); + m.stops.push(v) + })); + l = "url(" + b.url + "#" + t + ")"; + e.setAttribute(k, l); + e.gradient = w; + v.toString = function () { + return l + } + } + }, + applyTextOutline: function (a) { + var v = this.element, k, e, b, c; + -1 !== a.indexOf("contrast") && (a = a.replace(/contrast/g, this.renderer.getContrast(v.style.fill))); + this.fakeTS = !0; + this.ySetter = this.xSetter; + k = [].slice.call(v.getElementsByTagName("tspan")); + a = a.split(" "); + e = a[a.length - 1]; + (b = a[0]) && "none" !== b && (b = b.replace(/(^[\d\.]+)(.*?)$/g, function (a, v, k) { + return 2 * v + k + }), C(k, function (a) { + "highcharts-text-outline" === + a.getAttribute("class") && m(k, v.removeChild(a)) + }), c = v.firstChild, C(k, function (a, k) { + 0 === k && (a.setAttribute("x", v.getAttribute("x")), k = v.getAttribute("y"), a.setAttribute("y", k || 0), null === k && v.setAttribute("y", 0)); + a = a.cloneNode(1); + r(a, { + "class": "highcharts-text-outline", + fill: e, + stroke: e, + "stroke-width": b, + "stroke-linejoin": "round" + }); + v.insertBefore(a, c) + })) + }, + attr: function (a, k, e, b) { + var v, c = this.element, h, x = this, M; + "string" === typeof a && void 0 !== k && (v = a, a = {}, a[v] = k); + if ("string" === typeof a)x = (this[a + "Getter"] || + this._defaultGetter).call(this, a, c); else { + for (v in a)k = a[v], M = !1, b || D(this, v), this.symbolName && /^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(v) && (h || (this.symbolAttr(a), h = !0), M = !0), !this.rotation || "x" !== v && "y" !== v || (this.doTransform = !0), M || (M = this[v + "Setter"] || this._defaultSetter, M.call(this, k, v, c), this.shadows && /^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(v) && this.updateShadows(v, k, M)); + this.doTransform && (this.updateTransform(), this.doTransform = !1) + } + e && e(); + return x + }, + updateShadows: function (a, + k, e) { + for (var v = this.shadows, b = v.length; b--;)e.call(v[b], "height" === a ? Math.max(k - (v[b].cutHeight || 0), 0) : "d" === a ? this.d : k, a, v[b]) + }, + addClass: function (a, k) { + var v = this.attr("class") || ""; + -1 === v.indexOf(a) && (k || (a = (v + (v ? " " : "") + a).replace(" ", " ")), this.attr("class", a)); + return this + }, + hasClass: function (a) { + return -1 !== r(this.element, "class").indexOf(a) + }, + removeClass: function (a) { + r(this.element, "class", (r(this.element, "class") || "").replace(a, "")); + return this + }, + symbolAttr: function (a) { + var v = this; + C("x y r start end width height innerR anchorX anchorY".split(" "), + function (k) { + v[k] = K(a[k], v[k]) + }); + v.attr({d: v.renderer.symbols[v.symbolName](v.x, v.y, v.width, v.height, v)}) + }, + clip: function (a) { + return this.attr("clip-path", a ? "url(" + this.renderer.url + "#" + a.id + ")" : "none") + }, + crisp: function (a, k) { + var v, e = {}, b; + k = k || a.strokeWidth || 0; + b = Math.round(k) % 2 / 2; + a.x = Math.floor(a.x || this.x || 0) + b; + a.y = Math.floor(a.y || this.y || 0) + b; + a.width = Math.floor((a.width || this.width || 0) - 2 * b); + a.height = Math.floor((a.height || this.height || 0) - 2 * b); + q(a.strokeWidth) && (a.strokeWidth = k); + for (v in a)this[v] !== a[v] && + (this[v] = e[v] = a[v]); + return e + }, + css: function (a) { + var v = this.styles, k = {}, e = this.element, b, c, h = ""; + b = !v; + var D = ["textOverflow", "width"]; + a && a.color && (a.fill = a.color); + if (v)for (c in a)a[c] !== v[c] && (k[c] = a[c], b = !0); + if (b) { + b = this.textWidth = a && a.width && "text" === e.nodeName.toLowerCase() && I(a.width) || this.textWidth; + v && (a = t(v, k)); + this.styles = a; + b && !P && this.renderer.forExport && delete a.width; + if (x && !P)u(this.element, a); else { + v = function (a, v) { + return "-" + v.toLowerCase() + }; + for (c in a)-1 === E(c, D) && (h += c.replace(/([A-Z])/g, v) + + ":" + a[c] + ";"); + h && r(e, "style", h) + } + this.added && (b && this.renderer.buildText(this), a && a.textOutline && this.applyTextOutline(a.textOutline)) + } + return this + }, + strokeWidth: function () { + return this["stroke-width"] || 0 + }, + on: function (a, k) { + var v = this, e = v.element; + n && "click" === a ? (e.ontouchstart = function (a) { + v.touchEventFired = Date.now(); + a.preventDefault(); + k.call(e, a) + }, e.onclick = function (a) { + (-1 === O.navigator.userAgent.indexOf("Android") || 1100 < Date.now() - (v.touchEventFired || 0)) && k.call(e, a) + }) : e["on" + a] = k; + return this + }, + setRadialReference: function (a) { + var v = + this.renderer.gradients[this.element.gradient]; + this.element.radialReference = a; + v && v.radAttr && v.animate(this.renderer.getRadialAttr(a, v.radAttr)); + return this + }, + translate: function (a, k) { + return this.attr({translateX: a, translateY: k}) + }, + invert: function (a) { + this.inverted = a; + this.updateTransform(); + return this + }, + updateTransform: function () { + var a = this.translateX || 0, k = this.translateY || 0, e = this.scaleX, b = this.scaleY, c = this.inverted, h = this.rotation, D = this.element; + c && (a += this.width, k += this.height); + a = ["translate(" + a + "," + + k + ")"]; + c ? a.push("rotate(90) scale(-1,1)") : h && a.push("rotate(" + h + " " + (D.getAttribute("x") || 0) + " " + (D.getAttribute("y") || 0) + ")"); + (q(e) || q(b)) && a.push("scale(" + K(e, 1) + " " + K(b, 1) + ")"); + a.length && D.setAttribute("transform", a.join(" ")) + }, + toFront: function () { + var a = this.element; + a.parentNode.appendChild(a); + return this + }, + align: function (a, k, e) { + var v, b, c, h, D = {}; + b = this.renderer; + c = b.alignedObjects; + var x, y; + if (a) { + if (this.alignOptions = a, this.alignByTranslate = k, !e || w(e))this.alignTo = v = e || "renderer", m(c, this), c.push(this), + e = null + } else a = this.alignOptions, k = this.alignByTranslate, v = this.alignTo; + e = K(e, b[v], b); + v = a.align; + b = a.verticalAlign; + c = (e.x || 0) + (a.x || 0); + h = (e.y || 0) + (a.y || 0); + "right" === v ? x = 1 : "center" === v && (x = 2); + x && (c += (e.width - (a.width || 0)) / x); + D[k ? "translateX" : "x"] = Math.round(c); + "bottom" === b ? y = 1 : "middle" === b && (y = 2); + y && (h += (e.height - (a.height || 0)) / y); + D[k ? "translateY" : "y"] = Math.round(h); + this[this.placed ? "animate" : "attr"](D); + this.placed = !0; + this.alignAttr = D; + return this + }, + getBBox: function (a, k) { + var v, e = this.renderer, b, c = this.element, + h = this.styles, D, x = this.textStr, m, y = e.cache, n = e.cacheKeys, F; + k = K(k, this.rotation); + b = k * d; + D = h && h.fontSize; + void 0 !== x && (F = x.toString(), -1 === F.indexOf("\x3c") && (F = F.replace(/[0-9]/g, "0")), F += ["", k || 0, D, h && h.width, h && h.textOverflow].join()); + F && !a && (v = y[F]); + if (!v) { + if (c.namespaceURI === this.SVG_NS || e.forExport) { + try { + (m = this.fakeTS && function (a) { + C(c.querySelectorAll(".highcharts-text-outline"), function (v) { + v.style.display = a + }) + }) && m("none"), v = c.getBBox ? t({}, c.getBBox()) : { + width: c.offsetWidth, + height: c.offsetHeight + }, + m && m("") + } catch (W) { + } + if (!v || 0 > v.width)v = {width: 0, height: 0} + } else v = this.htmlGetBBox(); + e.isSVG && (a = v.width, e = v.height, h && "11px" === h.fontSize && 17 === Math.round(e) && (v.height = e = 14), k && (v.width = Math.abs(e * Math.sin(b)) + Math.abs(a * Math.cos(b)), v.height = Math.abs(e * Math.cos(b)) + Math.abs(a * Math.sin(b)))); + if (F && 0 < v.height) { + for (; 250 < n.length;)delete y[n.shift()]; + y[F] || n.push(F); + y[F] = v + } + } + return v + }, + show: function (a) { + return this.attr({visibility: a ? "inherit" : "visible"}) + }, + hide: function () { + return this.attr({visibility: "hidden"}) + }, + fadeOut: function (a) { + var v = this; + v.animate({opacity: 0}, { + duration: a || 150, complete: function () { + v.attr({y: -9999}) + } + }) + }, + add: function (a) { + var v = this.renderer, k = this.element, e; + a && (this.parentGroup = a); + this.parentInverted = a && a.inverted; + void 0 !== this.textStr && v.buildText(this); + this.added = !0; + if (!a || a.handleZ || this.zIndex)e = this.zIndexSetter(); + e || (a ? a.element : v.box).appendChild(k); + if (this.onAdd)this.onAdd(); + return this + }, + safeRemoveChild: function (a) { + var v = a.parentNode; + v && v.removeChild(a) + }, + destroy: function () { + var a = + this.element || {}, k = this.renderer.isSVG && "SPAN" === a.nodeName && this.parentGroup, e, b; + a.onclick = a.onmouseout = a.onmouseover = a.onmousemove = a.point = null; + D(this); + this.clipPath && (this.clipPath = this.clipPath.destroy()); + if (this.stops) { + for (b = 0; b < this.stops.length; b++)this.stops[b] = this.stops[b].destroy(); + this.stops = null + } + this.safeRemoveChild(a); + for (this.destroyShadows(); k && k.div && 0 === k.div.childNodes.length;)a = k.parentGroup, this.safeRemoveChild(k.div), delete k.div, k = a; + this.alignTo && m(this.renderer.alignedObjects, + this); + for (e in this)delete this[e]; + return null + }, + shadow: function (a, k, e) { + var v = [], b, c, h = this.element, D, x, m, y; + if (!a)this.destroyShadows(); else if (!this.shadows) { + x = K(a.width, 3); + m = (a.opacity || .15) / x; + y = this.parentInverted ? "(-1,-1)" : "(" + K(a.offsetX, 1) + ", " + K(a.offsetY, 1) + ")"; + for (b = 1; b <= x; b++)c = h.cloneNode(0), D = 2 * x + 1 - 2 * b, r(c, { + isShadow: "true", + stroke: a.color || "#000000", + "stroke-opacity": m * b, + "stroke-width": D, + transform: "translate" + y, + fill: "none" + }), e && (r(c, "height", Math.max(r(c, "height") - D, 0)), c.cutHeight = D), k ? + k.element.appendChild(c) : h.parentNode.insertBefore(c, h), v.push(c); + this.shadows = v + } + return this + }, + destroyShadows: function () { + C(this.shadows || [], function (a) { + this.safeRemoveChild(a) + }, this); + this.shadows = void 0 + }, + xGetter: function (a) { + "circle" === this.element.nodeName && ("x" === a ? a = "cx" : "y" === a && (a = "cy")); + return this._defaultGetter(a) + }, + _defaultGetter: function (a) { + a = K(this[a], this.element ? this.element.getAttribute(a) : null, 0); + /^[\-0-9\.]+$/.test(a) && (a = parseFloat(a)); + return a + }, + dSetter: function (a, k, e) { + a && a.join && (a = + a.join(" ")); + /(NaN| {2}|^$)/.test(a) && (a = "M 0 0"); + e.setAttribute(k, a); + this[k] = a + }, + dashstyleSetter: function (a) { + var v, k = this["stroke-width"]; + "inherit" === k && (k = 1); + if (a = a && a.toLowerCase()) { + a = a.replace("shortdashdotdot", "3,1,1,1,1,1,").replace("shortdashdot", "3,1,1,1").replace("shortdot", "1,1,").replace("shortdash", "3,1,").replace("longdash", "8,3,").replace(/dot/g, "1,3,").replace("dash", "4,3,").replace(/,$/, "").split(","); + for (v = a.length; v--;)a[v] = I(a[v]) * k; + a = a.join(",").replace(/NaN/g, "none"); + this.element.setAttribute("stroke-dasharray", + a) + } + }, + alignSetter: function (a) { + this.element.setAttribute("text-anchor", {left: "start", center: "middle", right: "end"}[a]) + }, + opacitySetter: function (a, k, e) { + this[k] = a; + e.setAttribute(k, a) + }, + titleSetter: function (a) { + var v = this.element.getElementsByTagName("title")[0]; + v || (v = p.createElementNS(this.SVG_NS, "title"), this.element.appendChild(v)); + v.firstChild && v.removeChild(v.firstChild); + v.appendChild(p.createTextNode(String(K(a), "").replace(/<[^>]*>/g, ""))) + }, + textSetter: function (a) { + a !== this.textStr && (delete this.bBox, + this.textStr = a, this.added && this.renderer.buildText(this)) + }, + fillSetter: function (a, k, e) { + "string" === typeof a ? e.setAttribute(k, a) : a && this.colorGradient(a, k, e) + }, + visibilitySetter: function (a, k, e) { + "inherit" === a ? e.removeAttribute(k) : e.setAttribute(k, a) + }, + zIndexSetter: function (a, k) { + var v = this.renderer, e = this.parentGroup, b = (e || v).element || v.box, c, h = this.element, D; + c = this.added; + var x; + q(a) && (h.zIndex = a, a = +a, this[k] === a && (c = !1), this[k] = a); + if (c) { + (a = this.zIndex) && e && (e.handleZ = !0); + k = b.childNodes; + for (x = 0; x < k.length && !D; x++)e = k[x], c = e.zIndex, e !== h && (I(c) > a || !q(a) && q(c) || 0 > a && !q(c) && b !== v.box) && (b.insertBefore(h, e), D = !0); + D || b.appendChild(h) + } + return D + }, + _defaultSetter: function (a, k, e) { + e.setAttribute(k, a) + } + }; + B.prototype.yGetter = B.prototype.xGetter; + B.prototype.translateXSetter = B.prototype.translateYSetter = B.prototype.rotationSetter = B.prototype.verticalAlignSetter = B.prototype.scaleXSetter = B.prototype.scaleYSetter = function (a, k) { + this[k] = a; + this.doTransform = !0 + }; + B.prototype["stroke-widthSetter"] = B.prototype.strokeSetter = function (a, + k, e) { + this[k] = a; + this.stroke && this["stroke-width"] ? (B.prototype.fillSetter.call(this, this.stroke, "stroke", e), e.setAttribute("stroke-width", this["stroke-width"]), this.hasStroke = !0) : "stroke-width" === k && 0 === a && this.hasStroke && (e.removeAttribute("stroke"), this.hasStroke = !1) + }; + A = a.SVGRenderer = function () { + this.init.apply(this, arguments) + }; + A.prototype = { + Element: B, SVG_NS: N, init: function (a, k, b, c, D, x) { + var v; + c = this.createElement("svg").attr({version: "1.1", "class": "highcharts-root"}).css(this.getStyle(c)); + v = c.element; + a.appendChild(v); + -1 === a.innerHTML.indexOf("xmlns") && r(v, "xmlns", this.SVG_NS); + this.isSVG = !0; + this.box = v; + this.boxWrapper = c; + this.alignedObjects = []; + this.url = (e || h) && p.getElementsByTagName("base").length ? O.location.href.replace(/#.*?$/, "").replace(/<[^>]*>/g, "").replace(/([\('\)])/g, "\\$1").replace(/ /g, "%20") : ""; + this.createElement("desc").add().element.appendChild(p.createTextNode("Created with Highcharts 5.0.7")); + this.defs = this.createElement("defs").add(); + this.allowHTML = x; + this.forExport = D; + this.gradients = + {}; + this.cache = {}; + this.cacheKeys = []; + this.imgCount = 0; + this.setSize(k, b, !1); + var m; + e && a.getBoundingClientRect && (k = function () { + u(a, {left: 0, top: 0}); + m = a.getBoundingClientRect(); + u(a, {left: Math.ceil(m.left) - m.left + "px", top: Math.ceil(m.top) - m.top + "px"}) + }, k(), this.unSubPixelFix = H(O, "resize", k)) + }, getStyle: function (a) { + return this.style = t({ + fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif', + fontSize: "12px" + }, a) + }, setStyle: function (a) { + this.boxWrapper.css(this.getStyle(a)) + }, isHidden: function () { + return !this.boxWrapper.getBBox().width + }, + destroy: function () { + var a = this.defs; + this.box = null; + this.boxWrapper = this.boxWrapper.destroy(); + b(this.gradients || {}); + this.gradients = null; + a && (this.defs = a.destroy()); + this.unSubPixelFix && this.unSubPixelFix(); + return this.alignedObjects = null + }, createElement: function (a) { + var k = new this.Element; + k.init(this, a); + return k + }, draw: J, getRadialAttr: function (a, k) { + return {cx: a[0] - a[2] / 2 + k.cx * a[2], cy: a[1] - a[2] / 2 + k.cy * a[2], r: k.r * a[2]} + }, buildText: function (a) { + var k = a.element, v = this, e = v.forExport, b = K(a.textStr, "").toString(), + h = -1 !== b.indexOf("\x3c"), D = k.childNodes, x, m, y, n, F = r(k, "x"), d = a.styles, t = a.textWidth, w = d && d.lineHeight, l = d && d.textOutline, z = d && "ellipsis" === d.textOverflow, f = d && "nowrap" === d.whiteSpace, E = d && d.fontSize, q, g = D.length, d = t && !a.added && this.box, J = function (a) { + var e; + e = /(px|em)$/.test(a && a.style.fontSize) ? a.style.fontSize : E || v.style.fontSize || 12; + return w ? I(w) : v.fontMetrics(e, a.getAttribute("style") ? a : k).h + }; + q = [b, z, f, w, l, E, t].join(); + if (q !== a.textCache) { + for (a.textCache = q; g--;)k.removeChild(D[g]); + h || l || z || t || -1 !== + b.indexOf(" ") ? (x = /<.*class="([^"]+)".*>/, m = /<.*style="([^"]+)".*>/, y = /<.*href="(http[^"]+)".*>/, d && d.appendChild(k), b = h ? b.replace(/<(b|strong)>/g, '\x3cspan style\x3d"font-weight:bold"\x3e').replace(/<(i|em)>/g, '\x3cspan style\x3d"font-style:italic"\x3e').replace(//g, "\x3c/span\x3e").split(//g) : [b], b = c(b, function (a) { + return "" !== a + }), C(b, function (b, c) { + var h, D = 0; + b = b.replace(/^\s+|\s+$/g, "").replace(//g, "\x3c/span\x3e|||"); + h = b.split("|||"); + C(h, function (b) { + if ("" !== b || 1 === h.length) { + var d = {}, w = p.createElementNS(v.SVG_NS, "tspan"), l, E; + x.test(b) && (l = b.match(x)[1], r(w, "class", l)); + m.test(b) && (E = b.match(m)[1].replace(/(;| |^)color([ :])/, "$1fill$2"), r(w, "style", E)); + y.test(b) && !e && (r(w, "onclick", 'location.href\x3d"' + b.match(y)[1] + '"'), u(w, {cursor: "pointer"})); + b = (b.replace(/<(.|\n)*?>/g, "") || " ").replace(/</g, "\x3c").replace(/>/g, "\x3e"); + if (" " !== b) { + w.appendChild(p.createTextNode(b)); + D ? d.dx = 0 : c && null !== F && (d.x = F); + r(w, d); + k.appendChild(w); + !D && c && (!P && e && u(w, {display: "block"}), r(w, "dy", J(w))); + if (t) { + d = b.replace(/([^\^])-/g, "$1- ").split(" "); + l = 1 < h.length || c || 1 < d.length && !f; + for (var q, g, M = [], C = J(w), K = a.rotation, I = b, Q = I.length; (l || z) && (d.length || M.length);)a.rotation = 0, q = a.getBBox(!0), g = q.width, !P && v.forExport && (g = v.measureSpanWidth(w.firstChild.data, a.styles)), q = g > t, void 0 === n && (n = q), z && n ? (Q /= 2, "" === I || !q && .5 > Q ? d = [] : (I = b.substring(0, I.length + (q ? -1 : 1) * Math.ceil(Q)), d = [I + (3 < t ? "\u2026" : "")], w.removeChild(w.firstChild))) : + q && 1 !== d.length ? (w.removeChild(w.firstChild), M.unshift(d.pop())) : (d = M, M = [], d.length && !f && (w = p.createElementNS(N, "tspan"), r(w, { + dy: C, + x: F + }), E && r(w, "style", E), k.appendChild(w)), g > t && (t = g)), d.length && w.appendChild(p.createTextNode(d.join(" ").replace(/- /g, "-"))); + a.rotation = K + } + D++ + } + } + }) + }), n && a.attr("title", a.textStr), d && d.removeChild(k), l && a.applyTextOutline && a.applyTextOutline(l)) : k.appendChild(p.createTextNode(b.replace(/</g, "\x3c").replace(/>/g, "\x3e"))) + } + }, getContrast: function (a) { + a = f(a).rgba; + return 510 < + a[0] + a[1] + a[2] ? "#000000" : "#FFFFFF" + }, button: function (a, k, e, b, c, h, D, m, d) { + var v = this.label(a, k, e, d, null, null, null, null, "button"), n = 0; + v.attr(y({padding: 8, r: 2}, c)); + var F, w, p, l; + c = y({ + fill: "#f7f7f7", + stroke: "#cccccc", + "stroke-width": 1, + style: {color: "#333333", cursor: "pointer", fontWeight: "normal"} + }, c); + F = c.style; + delete c.style; + h = y(c, {fill: "#e6e6e6"}, h); + w = h.style; + delete h.style; + D = y(c, {fill: "#e6ebf5", style: {color: "#000000", fontWeight: "bold"}}, D); + p = D.style; + delete D.style; + m = y(c, {style: {color: "#cccccc"}}, m); + l = m.style; + delete m.style; + H(v.element, x ? "mouseover" : "mouseenter", function () { + 3 !== n && v.setState(1) + }); + H(v.element, x ? "mouseout" : "mouseleave", function () { + 3 !== n && v.setState(n) + }); + v.setState = function (a) { + 1 !== a && (v.state = n = a); + v.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-" + ["normal", "hover", "pressed", "disabled"][a || 0]); + v.attr([c, h, D, m][a || 0]).css([F, w, p, l][a || 0]) + }; + v.attr(c).css(t({cursor: "default"}, F)); + return v.on("click", function (a) { + 3 !== n && b.call(v, a) + }) + }, crispLine: function (a, + k) { + a[1] === a[4] && (a[1] = a[4] = Math.round(a[1]) - k % 2 / 2); + a[2] === a[5] && (a[2] = a[5] = Math.round(a[2]) + k % 2 / 2); + return a + }, path: function (a) { + var k = {fill: "none"}; + z(a) ? k.d = a : F(a) && t(k, a); + return this.createElement("path").attr(k) + }, circle: function (a, k, e) { + a = F(a) ? a : {x: a, y: k, r: e}; + k = this.createElement("circle"); + k.xSetter = k.ySetter = function (a, k, e) { + e.setAttribute("c" + k, a) + }; + return k.attr(a) + }, arc: function (a, k, e, b, c, h) { + F(a) && (k = a.y, e = a.r, b = a.innerR, c = a.start, h = a.end, a = a.x); + a = this.symbol("arc", a || 0, k || 0, e || 0, e || 0, { + innerR: b || + 0, start: c || 0, end: h || 0 + }); + a.r = e; + return a + }, rect: function (a, k, e, b, c, h) { + c = F(a) ? a.r : c; + var v = this.createElement("rect"); + a = F(a) ? a : void 0 === a ? {} : {x: a, y: k, width: Math.max(e, 0), height: Math.max(b, 0)}; + void 0 !== h && (a.strokeWidth = h, a = v.crisp(a)); + a.fill = "none"; + c && (a.r = c); + v.rSetter = function (a, k, e) { + r(e, {rx: a, ry: a}) + }; + return v.attr(a) + }, setSize: function (a, k, e) { + var b = this.alignedObjects, v = b.length; + this.width = a; + this.height = k; + for (this.boxWrapper.animate({width: a, height: k}, { + step: function () { + this.attr({ + viewBox: "0 0 " + this.attr("width") + + " " + this.attr("height") + }) + }, duration: K(e, !0) ? void 0 : 0 + }); v--;)b[v].align() + }, g: function (a) { + var k = this.createElement("g"); + return a ? k.attr({"class": "highcharts-" + a}) : k + }, image: function (a, k, e, b, c) { + var v = {preserveAspectRatio: "none"}; + 1 < arguments.length && t(v, {x: k, y: e, width: b, height: c}); + v = this.createElement("image").attr(v); + v.element.setAttributeNS ? v.element.setAttributeNS("http://www.w3.org/1999/xlink", "href", a) : v.element.setAttribute("hc-svg-href", a); + return v + }, symbol: function (a, k, e, b, c, h) { + var v = this, D, x = this.symbols[a], + m = q(k) && x && this.symbols[a](Math.round(k), Math.round(e), b, c, h), y = /^url\((.*?)\)$/, d, n; + x ? (D = this.path(m), D.attr("fill", "none"), t(D, { + symbolName: a, + x: k, + y: e, + width: b, + height: c + }), h && t(D, h)) : y.test(a) && (d = a.match(y)[1], D = this.image(d), D.imgwidth = K(S[d] && S[d].width, h && h.width), D.imgheight = K(S[d] && S[d].height, h && h.height), n = function () { + D.attr({width: D.width, height: D.height}) + }, C(["width", "height"], function (a) { + D[a + "Setter"] = function (a, k) { + var e = {}, b = this["img" + k], v = "width" === k ? "translateX" : "translateY"; + this[k] = a; + q(b) && (this.element && this.element.setAttribute(k, b), this.alignByTranslate || (e[v] = ((this[k] || 0) - b) / 2, this.attr(e))) + } + }), q(k) && D.attr({ + x: k, + y: e + }), D.isImg = !0, q(D.imgwidth) && q(D.imgheight) ? n() : (D.attr({width: 0, height: 0}), l("img", { + onload: function () { + var a = g[v.chartIndex]; + 0 === this.width && (u(this, {position: "absolute", top: "-999em"}), p.body.appendChild(this)); + S[d] = {width: this.width, height: this.height}; + D.imgwidth = this.width; + D.imgheight = this.height; + D.element && n(); + this.parentNode && this.parentNode.removeChild(this); + v.imgCount--; + if (!v.imgCount && a && a.onload)a.onload() + }, src: d + }), this.imgCount++)); + return D + }, symbols: { + circle: function (a, k, e, b) { + return this.arc(a + e / 2, k + b / 2, e / 2, b / 2, {start: 0, end: 2 * Math.PI, open: !1}) + }, square: function (a, k, e, b) { + return ["M", a, k, "L", a + e, k, a + e, k + b, a, k + b, "Z"] + }, triangle: function (a, k, e, b) { + return ["M", a + e / 2, k, "L", a + e, k + b, a, k + b, "Z"] + }, "triangle-down": function (a, k, e, b) { + return ["M", a, k, "L", a + e, k, a + e / 2, k + b, "Z"] + }, diamond: function (a, k, e, b) { + return ["M", a + e / 2, k, "L", a + e, k + b / 2, a + e / 2, k + b, a, k + b / 2, "Z"] + }, arc: function (a, + k, e, b, c) { + var v = c.start, h = c.r || e, D = c.r || b || e, x = c.end - .001; + e = c.innerR; + b = c.open; + var m = Math.cos(v), d = Math.sin(v), y = Math.cos(x), x = Math.sin(x); + c = c.end - v < Math.PI ? 0 : 1; + h = ["M", a + h * m, k + D * d, "A", h, D, 0, c, 1, a + h * y, k + D * x]; + q(e) && h.push(b ? "M" : "L", a + e * y, k + e * x, "A", e, e, 0, c, 0, a + e * m, k + e * d); + h.push(b ? "" : "Z"); + return h + }, callout: function (a, k, e, b, c) { + var h = Math.min(c && c.r || 0, e, b), D = h + 6, v = c && c.anchorX; + c = c && c.anchorY; + var x; + x = ["M", a + h, k, "L", a + e - h, k, "C", a + e, k, a + e, k, a + e, k + h, "L", a + e, k + b - h, "C", a + e, k + b, a + e, k + b, a + e - h, k + b, "L", a + h, k + b, "C", + a, k + b, a, k + b, a, k + b - h, "L", a, k + h, "C", a, k, a, k, a + h, k]; + v && v > e ? c > k + D && c < k + b - D ? x.splice(13, 3, "L", a + e, c - 6, a + e + 6, c, a + e, c + 6, a + e, k + b - h) : x.splice(13, 3, "L", a + e, b / 2, v, c, a + e, b / 2, a + e, k + b - h) : v && 0 > v ? c > k + D && c < k + b - D ? x.splice(33, 3, "L", a, c + 6, a - 6, c, a, c - 6, a, k + h) : x.splice(33, 3, "L", a, b / 2, v, c, a, b / 2, a, k + h) : c && c > b && v > a + D && v < a + e - D ? x.splice(23, 3, "L", v + 6, k + b, v, k + b + 6, v - 6, k + b, a + h, k + b) : c && 0 > c && v > a + D && v < a + e - D && x.splice(3, 3, "L", v - 6, k, v, k - 6, v + 6, k, e - h, k); + return x + } + }, clipRect: function (k, e, b, c) { + var h = a.uniqueKey(), D = this.createElement("clipPath").attr({id: h}).add(this.defs); + k = this.rect(k, e, b, c, 0).add(D); + k.id = h; + k.clipPath = D; + k.count = 0; + return k + }, text: function (a, k, e, b) { + var c = !P && this.forExport, h = {}; + if (b && (this.allowHTML || !this.forExport))return this.html(a, k, e); + h.x = Math.round(k || 0); + e && (h.y = Math.round(e)); + if (a || 0 === a)h.text = a; + a = this.createElement("text").attr(h); + c && a.css({position: "absolute"}); + b || (a.xSetter = function (a, k, e) { + var b = e.getElementsByTagName("tspan"), c, h = e.getAttribute(k), D; + for (D = 0; D < b.length; D++)c = b[D], c.getAttribute(k) === h && c.setAttribute(k, a); + e.setAttribute(k, + a) + }); + return a + }, fontMetrics: function (a, k) { + a = a || k && k.style && k.style.fontSize || this.style && this.style.fontSize; + a = /px/.test(a) ? I(a) : /em/.test(a) ? parseFloat(a) * (k ? this.fontMetrics(null, k.parentNode).f : 16) : 12; + k = 24 > a ? a + 3 : Math.round(1.2 * a); + return {h: k, b: Math.round(.8 * k), f: a} + }, rotCorr: function (a, k, e) { + var b = a; + k && e && (b = Math.max(b * Math.cos(k * d), 4)); + return {x: -a / 3 * Math.sin(k * d), y: b} + }, label: function (a, e, b, c, h, D, x, m, d) { + var v = this, n = v.g("button" !== d && "label"), F = n.text = v.text("", 0, 0, x).attr({zIndex: 1}), w, p, l = 0, z = 3, + E = 0, f, g, J, K, P, N = {}, I, u, r = /^url\((.*?)\)$/.test(c), M = r, S, Q, R, O; + d && n.addClass("highcharts-" + d); + M = r; + S = function () { + return (I || 0) % 2 / 2 + }; + Q = function () { + var a = F.element.style, k = {}; + p = (void 0 === f || void 0 === g || P) && q(F.textStr) && F.getBBox(); + n.width = (f || p.width || 0) + 2 * z + E; + n.height = (g || p.height || 0) + 2 * z; + u = z + v.fontMetrics(a && a.fontSize, F).b; + M && (w || (n.box = w = v.symbols[c] || r ? v.symbol(c) : v.rect(), w.addClass(("button" === d ? "" : "highcharts-label-box") + (d ? " highcharts-" + d + "-box" : "")), w.add(n), a = S(), k.x = a, k.y = (m ? -u : 0) + a), k.width = + Math.round(n.width), k.height = Math.round(n.height), w.attr(t(k, N)), N = {}) + }; + R = function () { + var a = E + z, k; + k = m ? 0 : u; + q(f) && p && ("center" === P || "right" === P) && (a += {center: .5, right: 1}[P] * (f - p.width)); + if (a !== F.x || k !== F.y)F.attr("x", a), void 0 !== k && F.attr("y", k); + F.x = a; + F.y = k + }; + O = function (a, k) { + w ? w.attr(a, k) : N[a] = k + }; + n.onAdd = function () { + F.add(n); + n.attr({text: a || 0 === a ? a : "", x: e, y: b}); + w && q(h) && n.attr({anchorX: h, anchorY: D}) + }; + n.widthSetter = function (a) { + f = a + }; + n.heightSetter = function (a) { + g = a + }; + n["text-alignSetter"] = function (a) { + P = a + }; + n.paddingSetter = function (a) { + q(a) && a !== z && (z = n.padding = a, R()) + }; + n.paddingLeftSetter = function (a) { + q(a) && a !== E && (E = a, R()) + }; + n.alignSetter = function (a) { + a = {left: 0, center: .5, right: 1}[a]; + a !== l && (l = a, p && n.attr({x: J})) + }; + n.textSetter = function (a) { + void 0 !== a && F.textSetter(a); + Q(); + R() + }; + n["stroke-widthSetter"] = function (a, k) { + a && (M = !0); + I = this["stroke-width"] = a; + O(k, a) + }; + n.strokeSetter = n.fillSetter = n.rSetter = function (a, k) { + "fill" === k && a && (M = !0); + O(k, a) + }; + n.anchorXSetter = function (a, k) { + h = a; + O(k, Math.round(a) - S() - J) + }; + n.anchorYSetter = + function (a, k) { + D = a; + O(k, a - K) + }; + n.xSetter = function (a) { + n.x = a; + l && (a -= l * ((f || p.width) + 2 * z)); + J = Math.round(a); + n.attr("translateX", J) + }; + n.ySetter = function (a) { + K = n.y = Math.round(a); + n.attr("translateY", K) + }; + var V = n.css; + return t(n, { + css: function (a) { + if (a) { + var k = {}; + a = y(a); + C(n.textProps, function (e) { + void 0 !== a[e] && (k[e] = a[e], delete a[e]) + }); + F.css(k) + } + return V.call(n, a) + }, getBBox: function () { + return {width: p.width + 2 * z, height: p.height + 2 * z, x: p.x - z, y: p.y - z} + }, shadow: function (a) { + a && (Q(), w && w.shadow(a)); + return n + }, destroy: function () { + k(n.element, + "mouseenter"); + k(n.element, "mouseleave"); + F && (F = F.destroy()); + w && (w = w.destroy()); + B.prototype.destroy.call(n); + n = v = Q = R = O = null + } + }) + } + }; + a.Renderer = A + })(L); + (function (a) { + var B = a.attr, A = a.createElement, H = a.css, G = a.defined, r = a.each, g = a.extend, f = a.isFirefox, u = a.isMS, l = a.isWebKit, q = a.pInt, d = a.SVGRenderer, b = a.win, p = a.wrap; + g(a.SVGElement.prototype, { + htmlCss: function (a) { + var b = this.element; + if (b = a && "SPAN" === b.tagName && a.width)delete a.width, this.textWidth = b, this.updateTransform(); + a && "ellipsis" === a.textOverflow && (a.whiteSpace = + "nowrap", a.overflow = "hidden"); + this.styles = g(this.styles, a); + H(this.element, a); + return this + }, htmlGetBBox: function () { + var a = this.element; + "text" === a.nodeName && (a.style.position = "absolute"); + return {x: a.offsetLeft, y: a.offsetTop, width: a.offsetWidth, height: a.offsetHeight} + }, htmlUpdateTransform: function () { + if (this.added) { + var a = this.renderer, b = this.element, m = this.translateX || 0, c = this.translateY || 0, n = this.x || 0, d = this.y || 0, p = this.textAlign || "left", e = { + left: 0, + center: .5, + right: 1 + }[p], x = this.styles; + H(b, {marginLeft: m, marginTop: c}); + this.shadows && r(this.shadows, function (a) { + H(a, {marginLeft: m + 1, marginTop: c + 1}) + }); + this.inverted && r(b.childNodes, function (e) { + a.invertChild(e, b) + }); + if ("SPAN" === b.tagName) { + var F = this.rotation, w = q(this.textWidth), h = x && x.whiteSpace, y = [F, p, b.innerHTML, this.textWidth, this.textAlign].join(); + y !== this.cTT && (x = a.fontMetrics(b.style.fontSize).b, G(F) && this.setSpanRotation(F, e, x), H(b, { + width: "", + whiteSpace: h || "nowrap" + }), b.offsetWidth > w && /[ \-]/.test(b.textContent || b.innerText) && H(b, { + width: w + "px", display: "block", whiteSpace: h || + "normal" + }), this.getSpanCorrection(b.offsetWidth, x, e, F, p)); + H(b, {left: n + (this.xCorr || 0) + "px", top: d + (this.yCorr || 0) + "px"}); + l && (x = b.offsetHeight); + this.cTT = y + } + } else this.alignOnAdd = !0 + }, setSpanRotation: function (a, d, m) { + var c = {}, n = u ? "-ms-transform" : l ? "-webkit-transform" : f ? "MozTransform" : b.opera ? "-o-transform" : ""; + c[n] = c.transform = "rotate(" + a + "deg)"; + c[n + (f ? "Origin" : "-origin")] = c.transformOrigin = 100 * d + "% " + m + "px"; + H(this.element, c) + }, getSpanCorrection: function (a, b, m) { + this.xCorr = -a * m; + this.yCorr = -b + } + }); + g(d.prototype, + { + html: function (a, b, m) { + var c = this.createElement("span"), n = c.element, d = c.renderer, l = d.isSVG, e = function (a, e) { + r(["opacity", "visibility"], function (b) { + p(a, b + "Setter", function (a, b, c, x) { + a.call(this, b, c, x); + e[c] = b + }) + }) + }; + c.textSetter = function (a) { + a !== n.innerHTML && delete this.bBox; + n.innerHTML = this.textStr = a; + c.htmlUpdateTransform() + }; + l && e(c, c.element.style); + c.xSetter = c.ySetter = c.alignSetter = c.rotationSetter = function (a, e) { + "align" === e && (e = "textAlign"); + c[e] = a; + c.htmlUpdateTransform() + }; + c.attr({ + text: a, x: Math.round(b), + y: Math.round(m) + }).css({fontFamily: this.style.fontFamily, fontSize: this.style.fontSize, position: "absolute"}); + n.style.whiteSpace = "nowrap"; + c.css = c.htmlCss; + l && (c.add = function (a) { + var b, x = d.box.parentNode, h = []; + if (this.parentGroup = a) { + if (b = a.div, !b) { + for (; a;)h.push(a), a = a.parentGroup; + r(h.reverse(), function (a) { + var n, m = B(a.element, "class"); + m && (m = {className: m}); + b = a.div = a.div || A("div", m, { + position: "absolute", + left: (a.translateX || 0) + "px", + top: (a.translateY || 0) + "px", + display: a.display, + opacity: a.opacity, + pointerEvents: a.styles && + a.styles.pointerEvents + }, b || x); + n = b.style; + g(a, { + on: function () { + c.on.apply({element: h[0].div}, arguments); + return a + }, translateXSetter: function (e, k) { + n.left = e + "px"; + a[k] = e; + a.doTransform = !0 + }, translateYSetter: function (e, k) { + n.top = e + "px"; + a[k] = e; + a.doTransform = !0 + } + }); + e(a, n) + }) + } + } else b = x; + b.appendChild(n); + c.added = !0; + c.alignOnAdd && c.htmlUpdateTransform(); + return c + }); + return c + } + }) + })(L); + (function (a) { + var B, A, H = a.createElement, G = a.css, r = a.defined, g = a.deg2rad, f = a.discardElement, u = a.doc, l = a.each, q = a.erase, d = a.extend; + B = a.extendClass; + var b = a.isArray, p = a.isNumber, C = a.isObject, t = a.merge; + A = a.noop; + var m = a.pick, c = a.pInt, n = a.SVGElement, E = a.SVGRenderer, z = a.win; + a.svg || (A = { + docMode8: u && 8 === u.documentMode, init: function (a, b) { + var e = ["\x3c", b, ' filled\x3d"f" stroked\x3d"f"'], c = ["position: ", "absolute", ";"], h = "div" === b; + ("shape" === b || h) && c.push("left:0;top:0;width:1px;height:1px;"); + c.push("visibility: ", h ? "hidden" : "visible"); + e.push(' style\x3d"', c.join(""), '"/\x3e'); + b && (e = h || "span" === b || "img" === b ? e.join("") : a.prepVML(e), this.element = H(e)); + this.renderer = + a + }, add: function (a) { + var e = this.renderer, b = this.element, c = e.box, h = a && a.inverted, c = a ? a.element || a : c; + a && (this.parentGroup = a); + h && e.invertChild(b, c); + c.appendChild(b); + this.added = !0; + this.alignOnAdd && !this.deferUpdateTransform && this.updateTransform(); + if (this.onAdd)this.onAdd(); + this.className && this.attr("class", this.className); + return this + }, updateTransform: n.prototype.htmlUpdateTransform, setSpanRotation: function () { + var a = this.rotation, b = Math.cos(a * g), c = Math.sin(a * g); + G(this.element, { + filter: a ? ["progid:DXImageTransform.Microsoft.Matrix(M11\x3d", + b, ", M12\x3d", -c, ", M21\x3d", c, ", M22\x3d", b, ", sizingMethod\x3d'auto expand')"].join("") : "none" + }) + }, getSpanCorrection: function (a, b, c, n, h) { + var e = n ? Math.cos(n * g) : 1, x = n ? Math.sin(n * g) : 0, d = m(this.elemHeight, this.element.offsetHeight), F; + this.xCorr = 0 > e && -a; + this.yCorr = 0 > x && -d; + F = 0 > e * x; + this.xCorr += x * b * (F ? 1 - c : c); + this.yCorr -= e * b * (n ? F ? c : 1 - c : 1); + h && "left" !== h && (this.xCorr -= a * c * (0 > e ? -1 : 1), n && (this.yCorr -= d * c * (0 > x ? -1 : 1)), G(this.element, {textAlign: h})) + }, pathToVML: function (a) { + for (var b = a.length, e = []; b--;)p(a[b]) ? e[b] = + Math.round(10 * a[b]) - 5 : "Z" === a[b] ? e[b] = "x" : (e[b] = a[b], !a.isArc || "wa" !== a[b] && "at" !== a[b] || (e[b + 5] === e[b + 7] && (e[b + 7] += a[b + 7] > a[b + 5] ? 1 : -1), e[b + 6] === e[b + 8] && (e[b + 8] += a[b + 8] > a[b + 6] ? 1 : -1))); + return e.join(" ") || "x" + }, clip: function (a) { + var b = this, e; + a ? (e = a.members, q(e, b), e.push(b), b.destroyClip = function () { + q(e, b) + }, a = a.getCSS(b)) : (b.destroyClip && b.destroyClip(), a = {clip: b.docMode8 ? "inherit" : "rect(auto)"}); + return b.css(a) + }, css: n.prototype.htmlCss, safeRemoveChild: function (a) { + a.parentNode && f(a) + }, destroy: function () { + this.destroyClip && + this.destroyClip(); + return n.prototype.destroy.apply(this) + }, on: function (a, b) { + this.element["on" + a] = function () { + var a = z.event; + a.target = a.srcElement; + b(a) + }; + return this + }, cutOffPath: function (a, b) { + var e; + a = a.split(/[ ,]/); + e = a.length; + if (9 === e || 11 === e)a[e - 4] = a[e - 2] = c(a[e - 2]) - 10 * b; + return a.join(" ") + }, shadow: function (a, b, n) { + var e = [], h, d = this.element, x = this.renderer, p, F = d.style, k, D = d.path, l, t, z, f; + D && "string" !== typeof D.value && (D = "x"); + t = D; + if (a) { + z = m(a.width, 3); + f = (a.opacity || .15) / z; + for (h = 1; 3 >= h; h++)l = 2 * z + 1 - 2 * h, n && + (t = this.cutOffPath(D.value, l + .5)), k = ['\x3cshape isShadow\x3d"true" strokeweight\x3d"', l, '" filled\x3d"false" path\x3d"', t, '" coordsize\x3d"10 10" style\x3d"', d.style.cssText, '" /\x3e'], p = H(x.prepVML(k), null, { + left: c(F.left) + m(a.offsetX, 1), + top: c(F.top) + m(a.offsetY, 1) + }), n && (p.cutOff = l + 1), k = ['\x3cstroke color\x3d"', a.color || "#000000", '" opacity\x3d"', f * h, '"/\x3e'], H(x.prepVML(k), null, null, p), b ? b.element.appendChild(p) : d.parentNode.insertBefore(p, d), e.push(p); + this.shadows = e + } + return this + }, updateShadows: A, + setAttr: function (a, b) { + this.docMode8 ? this.element[a] = b : this.element.setAttribute(a, b) + }, classSetter: function (a) { + (this.added ? this.element : this).className = a + }, dashstyleSetter: function (a, b, c) { + (c.getElementsByTagName("stroke")[0] || H(this.renderer.prepVML(["\x3cstroke/\x3e"]), null, null, c))[b] = a || "solid"; + this[b] = a + }, dSetter: function (a, b, c) { + var e = this.shadows; + a = a || []; + this.d = a.join && a.join(" "); + c.path = a = this.pathToVML(a); + if (e)for (c = e.length; c--;)e[c].path = e[c].cutOff ? this.cutOffPath(a, e[c].cutOff) : a; + this.setAttr(b, + a) + }, fillSetter: function (a, b, c) { + var e = c.nodeName; + "SPAN" === e ? c.style.color = a : "IMG" !== e && (c.filled = "none" !== a, this.setAttr("fillcolor", this.renderer.color(a, c, b, this))) + }, "fill-opacitySetter": function (a, b, c) { + H(this.renderer.prepVML(["\x3c", b.split("-")[0], ' opacity\x3d"', a, '"/\x3e']), null, null, c) + }, opacitySetter: A, rotationSetter: function (a, b, c) { + c = c.style; + this[b] = c[b] = a; + c.left = -Math.round(Math.sin(a * g) + 1) + "px"; + c.top = Math.round(Math.cos(a * g)) + "px" + }, strokeSetter: function (a, b, c) { + this.setAttr("strokecolor", + this.renderer.color(a, c, b, this)) + }, "stroke-widthSetter": function (a, b, c) { + c.stroked = !!a; + this[b] = a; + p(a) && (a += "px"); + this.setAttr("strokeweight", a) + }, titleSetter: function (a, b) { + this.setAttr(b, a) + }, visibilitySetter: function (a, b, c) { + "inherit" === a && (a = "visible"); + this.shadows && l(this.shadows, function (c) { + c.style[b] = a + }); + "DIV" === c.nodeName && (a = "hidden" === a ? "-999em" : 0, this.docMode8 || (c.style[b] = a ? "visible" : "hidden"), b = "top"); + c.style[b] = a + }, xSetter: function (a, b, c) { + this[b] = a; + "x" === b ? b = "left" : "y" === b && (b = "top"); + this.updateClipping ? + (this[b] = a, this.updateClipping()) : c.style[b] = a + }, zIndexSetter: function (a, b, c) { + c.style[b] = a + } + }, A["stroke-opacitySetter"] = A["fill-opacitySetter"], a.VMLElement = A = B(n, A), A.prototype.ySetter = A.prototype.widthSetter = A.prototype.heightSetter = A.prototype.xSetter, A = { + Element: A, isIE8: -1 < z.navigator.userAgent.indexOf("MSIE 8.0"), init: function (a, b, c) { + var e, h; + this.alignedObjects = []; + e = this.createElement("div").css({position: "relative"}); + h = e.element; + a.appendChild(e.element); + this.isVML = !0; + this.box = h; + this.boxWrapper = + e; + this.gradients = {}; + this.cache = {}; + this.cacheKeys = []; + this.imgCount = 0; + this.setSize(b, c, !1); + if (!u.namespaces.hcv) { + u.namespaces.add("hcv", "urn:schemas-microsoft-com:vml"); + try { + u.createStyleSheet().cssText = "hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } " + } catch (y) { + u.styleSheets[0].cssText += "hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } " + } + } + }, isHidden: function () { + return !this.box.offsetWidth + }, + clipRect: function (a, b, c, n) { + var e = this.createElement(), m = C(a); + return d(e, { + members: [], + count: 0, + left: (m ? a.x : a) + 1, + top: (m ? a.y : b) + 1, + width: (m ? a.width : c) - 1, + height: (m ? a.height : n) - 1, + getCSS: function (a) { + var b = a.element, c = b.nodeName, k = a.inverted, e = this.top - ("shape" === c ? b.offsetTop : 0), h = this.left, b = h + this.width, n = e + this.height, e = {clip: "rect(" + Math.round(k ? h : e) + "px," + Math.round(k ? n : b) + "px," + Math.round(k ? b : n) + "px," + Math.round(k ? e : h) + "px)"}; + !k && a.docMode8 && "DIV" === c && d(e, {width: b + "px", height: n + "px"}); + return e + }, + updateClipping: function () { + l(e.members, + function (a) { + a.element && a.css(e.getCSS(a)) + }) + } + }) + }, color: function (b, c, n, m) { + var e = this, d, x = /^rgba/, p, t, k = "none"; + b && b.linearGradient ? t = "gradient" : b && b.radialGradient && (t = "pattern"); + if (t) { + var D, w, z = b.linearGradient || b.radialGradient, f, E, v, q, g, F = ""; + b = b.stops; + var C, u = [], r = function () { + p = ['\x3cfill colors\x3d"' + u.join(",") + '" opacity\x3d"', v, '" o:opacity2\x3d"', E, '" type\x3d"', t, '" ', F, 'focus\x3d"100%" method\x3d"any" /\x3e']; + H(e.prepVML(p), null, null, c) + }; + f = b[0]; + C = b[b.length - 1]; + 0 < f[0] && b.unshift([0, f[1]]); + 1 > + C[0] && b.push([1, C[1]]); + l(b, function (k, b) { + x.test(k[1]) ? (d = a.color(k[1]), D = d.get("rgb"), w = d.get("a")) : (D = k[1], w = 1); + u.push(100 * k[0] + "% " + D); + b ? (v = w, q = D) : (E = w, g = D) + }); + if ("fill" === n)if ("gradient" === t)n = z.x1 || z[0] || 0, b = z.y1 || z[1] || 0, f = z.x2 || z[2] || 0, z = z.y2 || z[3] || 0, F = 'angle\x3d"' + (90 - 180 * Math.atan((z - b) / (f - n)) / Math.PI) + '"', r(); else { + var k = z.r, A = 2 * k, B = 2 * k, G = z.cx, U = z.cy, L = c.radialReference, T, k = function () { + L && (T = m.getBBox(), G += (L[0] - T.x) / T.width - .5, U += (L[1] - T.y) / T.height - .5, A *= L[2] / T.width, B *= L[2] / T.height); + F = + 'src\x3d"' + a.getOptions().global.VMLRadialGradientURL + '" size\x3d"' + A + "," + B + '" origin\x3d"0.5,0.5" position\x3d"' + G + "," + U + '" color2\x3d"' + g + '" '; + r() + }; + m.added ? k() : m.onAdd = k; + k = q + } else k = D + } else x.test(b) && "IMG" !== c.tagName ? (d = a.color(b), m[n + "-opacitySetter"](d.get("a"), n, c), k = d.get("rgb")) : (k = c.getElementsByTagName(n), k.length && (k[0].opacity = 1, k[0].type = "solid"), k = b); + return k + }, prepVML: function (a) { + var b = this.isIE8; + a = a.join(""); + b ? (a = a.replace("/\x3e", ' xmlns\x3d"urn:schemas-microsoft-com:vml" /\x3e'), a = + -1 === a.indexOf('style\x3d"') ? a.replace("/\x3e", ' style\x3d"display:inline-block;behavior:url(#default#VML);" /\x3e') : a.replace('style\x3d"', 'style\x3d"display:inline-block;behavior:url(#default#VML);')) : a = a.replace("\x3c", "\x3chcv:"); + return a + }, text: E.prototype.html, path: function (a) { + var c = {coordsize: "10 10"}; + b(a) ? c.d = a : C(a) && d(c, a); + return this.createElement("shape").attr(c) + }, circle: function (a, b, c) { + var e = this.symbol("circle"); + C(a) && (c = a.r, b = a.y, a = a.x); + e.isCircle = !0; + e.r = c; + return e.attr({x: a, y: b}) + }, g: function (a) { + var b; + a && (b = {className: "highcharts-" + a, "class": "highcharts-" + a}); + return this.createElement("div").attr(b) + }, image: function (a, b, c, n, h) { + var e = this.createElement("img").attr({src: a}); + 1 < arguments.length && e.attr({x: b, y: c, width: n, height: h}); + return e + }, createElement: function (a) { + return "rect" === a ? this.symbol(a) : E.prototype.createElement.call(this, a) + }, invertChild: function (a, b) { + var e = this; + b = b.style; + var n = "IMG" === a.tagName && a.style; + G(a, { + flip: "x", + left: c(b.width) - (n ? c(n.top) : 1), + top: c(b.height) - (n ? c(n.left) : 1), + rotation: -90 + }); + l(a.childNodes, function (b) { + e.invertChild(b, a) + }) + }, symbols: { + arc: function (a, b, c, n, h) { + var e = h.start, m = h.end, d = h.r || c || n; + c = h.innerR; + n = Math.cos(e); + var p = Math.sin(e), k = Math.cos(m), D = Math.sin(m); + if (0 === m - e)return ["x"]; + e = ["wa", a - d, b - d, a + d, b + d, a + d * n, b + d * p, a + d * k, b + d * D]; + h.open && !c && e.push("e", "M", a, b); + e.push("at", a - c, b - c, a + c, b + c, a + c * k, b + c * D, a + c * n, b + c * p, "x", "e"); + e.isArc = !0; + return e + }, circle: function (a, b, c, n, h) { + h && r(h.r) && (c = n = 2 * h.r); + h && h.isCircle && (a -= c / 2, b -= n / 2); + return ["wa", a, b, a + c, b + n, a + c, b + n / 2, a + c, b + n / 2, "e"] + }, + rect: function (a, b, c, n, h) { + return E.prototype.symbols[r(h) && h.r ? "callout" : "square"].call(0, a, b, c, n, h) + } + } + }, a.VMLRenderer = B = function () { + this.init.apply(this, arguments) + }, B.prototype = t(E.prototype, A), a.Renderer = B); + E.prototype.measureSpanWidth = function (a, b) { + var c = u.createElement("span"); + a = u.createTextNode(a); + c.appendChild(a); + G(c, b); + this.box.appendChild(c); + b = c.offsetWidth; + f(c); + return b + } + })(L); + (function (a) { + function B() { + var l = a.defaultOptions.global, f = u.moment; + if (l.timezone) { + if (f)return function (a) { + return -f.tz(a, + l.timezone).utcOffset() + }; + a.error(25) + } + return l.useUTC && l.getTimezoneOffset + } + + function A() { + var l = a.defaultOptions.global, q, d = l.useUTC, b = d ? "getUTC" : "get", p = d ? "setUTC" : "set"; + a.Date = q = l.Date || u.Date; + q.hcTimezoneOffset = d && l.timezoneOffset; + q.hcGetTimezoneOffset = B(); + q.hcMakeTime = function (a, b, m, c, n, p) { + var l; + d ? (l = q.UTC.apply(0, arguments), l += r(l)) : l = (new q(a, b, f(m, 1), f(c, 0), f(n, 0), f(p, 0))).getTime(); + return l + }; + G("Minutes Hours Day Date Month FullYear".split(" "), function (a) { + q["hcGet" + a] = b + a + }); + G("Milliseconds Seconds Minutes Hours Date Month FullYear".split(" "), + function (a) { + q["hcSet" + a] = p + a + }) + } + + var H = a.color, G = a.each, r = a.getTZOffset, g = a.merge, f = a.pick, u = a.win; + a.defaultOptions = { + colors: "#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #2b908f #f45b5b #91e8e1".split(" "), + symbols: ["circle", "diamond", "square", "triangle", "triangle-down"], + lang: { + loading: "Loading...", + months: "January February March April May June July August September October November December".split(" "), + shortMonths: "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), + weekdays: "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), + decimalPoint: ".", + numericSymbols: "kMGTPE".split(""), + resetZoom: "Reset zoom", + resetZoomTitle: "Reset zoom level 1:1", + thousandsSep: " " + }, + global: {useUTC: !0, VMLRadialGradientURL: "http://code.highcharts.com/5.0.7/gfx/vml-radial-gradient.png"}, + chart: { + borderRadius: 0, + defaultSeriesType: "line", + ignoreHiddenSeries: !0, + spacing: [10, 10, 15, 10], + resetZoomButton: {theme: {zIndex: 20}, position: {align: "right", x: -10, y: 10}}, + width: null, + height: null, + borderColor: "#335cad", + backgroundColor: "#ffffff", + plotBorderColor: "#cccccc" + }, + title: { + text: "Chart title", + align: "center", margin: 15, widthAdjust: -44 + }, + subtitle: {text: "", align: "center", widthAdjust: -44}, + plotOptions: {}, + labels: {style: {position: "absolute", color: "#333333"}}, + legend: { + enabled: !0, + align: "center", + layout: "horizontal", + labelFormatter: function () { + return this.name + }, + borderColor: "#999999", + borderRadius: 0, + navigation: {activeColor: "#003399", inactiveColor: "#cccccc"}, + itemStyle: {color: "#333333", fontSize: "12px", fontWeight: "bold"}, + itemHoverStyle: {color: "#000000"}, + itemHiddenStyle: {color: "#cccccc"}, + shadow: !1, + itemCheckboxStyle: { + position: "absolute", + width: "13px", height: "13px" + }, + squareSymbol: !0, + symbolPadding: 5, + verticalAlign: "bottom", + x: 0, + y: 0, + title: {style: {fontWeight: "bold"}} + }, + loading: { + labelStyle: {fontWeight: "bold", position: "relative", top: "45%"}, + style: {position: "absolute", backgroundColor: "#ffffff", opacity: .5, textAlign: "center"} + }, + tooltip: { + enabled: !0, + animation: a.svg, + borderRadius: 3, + dateTimeLabelFormats: { + millisecond: "%A, %b %e, %H:%M:%S.%L", + second: "%A, %b %e, %H:%M:%S", + minute: "%A, %b %e, %H:%M", + hour: "%A, %b %e, %H:%M", + day: "%A, %b %e, %Y", + week: "Week from %A, %b %e, %Y", + month: "%B %Y", + year: "%Y" + }, + footerFormat: "", + padding: 8, + snap: a.isTouchDevice ? 25 : 10, + backgroundColor: H("#f7f7f7").setOpacity(.85).get(), + borderWidth: 1, + headerFormat: '\x3cspan style\x3d"font-size: 10px"\x3e{point.key}\x3c/span\x3e\x3cbr/\x3e', + pointFormat: '\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e {series.name}: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3e', + shadow: !0, + style: { + color: "#333333", + cursor: "default", + fontSize: "12px", + pointerEvents: "none", + whiteSpace: "nowrap" + } + }, + credits: { + } + }; + a.setOptions = function (l) { + a.defaultOptions = g(!0, a.defaultOptions, l); + A(); + return a.defaultOptions + }; + a.getOptions = function () { + return a.defaultOptions + }; + a.defaultPlotOptions = a.defaultOptions.plotOptions; + A() + })(L); + (function (a) { + var B = a.arrayMax, A = a.arrayMin, H = a.defined, G = a.destroyObjectProperties, r = a.each, g = a.erase, f = a.merge, u = a.pick; + a.PlotLineOrBand = function (a, f) { + this.axis = + a; + f && (this.options = f, this.id = f.id) + }; + a.PlotLineOrBand.prototype = { + render: function () { + var a = this, q = a.axis, d = q.horiz, b = a.options, p = b.label, g = a.label, t = b.to, m = b.from, c = b.value, n = H(m) && H(t), E = H(c), z = a.svgElem, e = !z, x = [], F, w = b.color, h = u(b.zIndex, 0), y = b.events, x = {"class": "highcharts-plot-" + (n ? "band " : "line ") + (b.className || "")}, J = {}, K = q.chart.renderer, I = n ? "bands" : "lines", k = q.log2lin; + q.isLog && (m = k(m), t = k(t), c = k(c)); + E ? (x = { + stroke: w, + "stroke-width": b.width + }, b.dashStyle && (x.dashstyle = b.dashStyle)) : n && (w && (x.fill = + w), b.borderWidth && (x.stroke = b.borderColor, x["stroke-width"] = b.borderWidth)); + J.zIndex = h; + I += "-" + h; + (w = q[I]) || (q[I] = w = K.g("plot-" + I).attr(J).add()); + e && (a.svgElem = z = K.path().attr(x).add(w)); + if (E)x = q.getPlotLinePath(c, z.strokeWidth()); else if (n)x = q.getPlotBandPath(m, t, b); else return; + if (e && x && x.length) { + if (z.attr({d: x}), y)for (F in b = function (b) { + z.on(b, function (k) { + y[b].apply(a, [k]) + }) + }, y)b(F) + } else z && (x ? (z.show(), z.animate({d: x})) : (z.hide(), g && (a.label = g = g.destroy()))); + p && H(p.text) && x && x.length && 0 < q.width && + 0 < q.height && !x.flat ? (p = f({ + align: d && n && "center", + x: d ? !n && 4 : 10, + verticalAlign: !d && n && "middle", + y: d ? n ? 16 : 10 : n ? 6 : -4, + rotation: d && !n && 90 + }, p), this.renderLabel(p, x, n, h)) : g && g.hide(); + return a + }, renderLabel: function (a, f, d, b) { + var p = this.label, l = this.axis.chart.renderer; + p || (p = { + align: a.textAlign || a.align, + rotation: a.rotation, + "class": "highcharts-plot-" + (d ? "band" : "line") + "-label " + (a.className || "") + }, p.zIndex = b, this.label = p = l.text(a.text, 0, 0, a.useHTML).attr(p).add(), p.css(a.style)); + b = [f[1], f[4], d ? f[6] : f[1]]; + f = [f[2], f[5], + d ? f[7] : f[2]]; + d = A(b); + l = A(f); + p.align(a, !1, {x: d, y: l, width: B(b) - d, height: B(f) - l}); + p.show() + }, destroy: function () { + g(this.axis.plotLinesAndBands, this); + delete this.axis; + G(this) + } + }; + a.AxisPlotLineOrBandExtension = { + getPlotBandPath: function (a, f) { + f = this.getPlotLinePath(f, null, null, !0); + (a = this.getPlotLinePath(a, null, null, !0)) && f ? (a.flat = a.toString() === f.toString(), a.push(f[4], f[5], f[1], f[2], "z")) : a = null; + return a + }, addPlotBand: function (a) { + return this.addPlotBandOrLine(a, "plotBands") + }, addPlotLine: function (a) { + return this.addPlotBandOrLine(a, + "plotLines") + }, addPlotBandOrLine: function (f, g) { + var d = (new a.PlotLineOrBand(this, f)).render(), b = this.userOptions; + d && (g && (b[g] = b[g] || [], b[g].push(f)), this.plotLinesAndBands.push(d)); + return d + }, removePlotBandOrLine: function (a) { + for (var f = this.plotLinesAndBands, d = this.options, b = this.userOptions, p = f.length; p--;)f[p].id === a && f[p].destroy(); + r([d.plotLines || [], b.plotLines || [], d.plotBands || [], b.plotBands || []], function (b) { + for (p = b.length; p--;)b[p].id === a && g(b, b[p]) + }) + } + } + })(L); + (function (a) { + var B = a.correctFloat, A = + a.defined, H = a.destroyObjectProperties, G = a.isNumber, r = a.merge, g = a.pick, f = a.deg2rad; + a.Tick = function (a, f, g, d) { + this.axis = a; + this.pos = f; + this.type = g || ""; + this.isNew = !0; + g || d || this.addLabel() + }; + a.Tick.prototype = { + addLabel: function () { + var a = this.axis, f = a.options, q = a.chart, d = a.categories, b = a.names, p = this.pos, C = f.labels, t = a.tickPositions, m = p === t[0], c = p === t[t.length - 1], b = d ? g(d[p], b[p], p) : p, d = this.label, t = t.info, n; + a.isDatetimeAxis && t && (n = f.dateTimeLabelFormats[t.higherRanks[p] || t.unitName]); + this.isFirst = m; + this.isLast = + c; + f = a.labelFormatter.call({ + axis: a, + chart: q, + isFirst: m, + isLast: c, + dateTimeLabelFormat: n, + value: a.isLog ? B(a.lin2log(b)) : b + }); + A(d) ? d && d.attr({text: f}) : (this.labelLength = (this.label = d = A(f) && C.enabled ? q.renderer.text(f, 0, 0, C.useHTML).css(r(C.style)).add(a.labelGroup) : null) && d.getBBox().width, this.rotation = 0) + }, getLabelSize: function () { + return this.label ? this.label.getBBox()[this.axis.horiz ? "height" : "width"] : 0 + }, handleOverflow: function (a) { + var l = this.axis, q = a.x, d = l.chart.chartWidth, b = l.chart.spacing, p = g(l.labelLeft, + Math.min(l.pos, b[3])), b = g(l.labelRight, Math.max(l.pos + l.len, d - b[1])), C = this.label, t = this.rotation, m = { + left: 0, + center: .5, + right: 1 + }[l.labelAlign], c = C.getBBox().width, n = l.getSlotWidth(), E = n, z = 1, e, x = {}; + if (t)0 > t && q - m * c < p ? e = Math.round(q / Math.cos(t * f) - p) : 0 < t && q + m * c > b && (e = Math.round((d - q) / Math.cos(t * f))); else if (d = q + (1 - m) * c, q - m * c < p ? E = a.x + E * (1 - m) - p : d > b && (E = b - a.x + E * m, z = -1), E = Math.min(n, E), E < n && "center" === l.labelAlign && (a.x += z * (n - E - m * (n - Math.min(c, E)))), c > E || l.autoRotation && (C.styles || {}).width)e = E; + e && (x.width = + e, (l.options.labels.style || {}).textOverflow || (x.textOverflow = "ellipsis"), C.css(x)) + }, getPosition: function (a, f, g, d) { + var b = this.axis, p = b.chart, l = d && p.oldChartHeight || p.chartHeight; + return { + x: a ? b.translate(f + g, null, null, d) + b.transB : b.left + b.offset + (b.opposite ? (d && p.oldChartWidth || p.chartWidth) - b.right - b.left : 0), + y: a ? l - b.bottom + b.offset - (b.opposite ? b.height : 0) : l - b.translate(f + g, null, null, d) - b.transB + } + }, getLabelPosition: function (a, g, q, d, b, p, C, t) { + var m = this.axis, c = m.transA, n = m.reversed, E = m.staggerLines, z = m.tickRotCorr || + {x: 0, y: 0}, e = b.y; + A(e) || (e = 0 === m.side ? q.rotation ? -8 : -q.getBBox().height : 2 === m.side ? z.y + 8 : Math.cos(q.rotation * f) * (z.y - q.getBBox(!1, 0).height / 2)); + a = a + b.x + z.x - (p && d ? p * c * (n ? -1 : 1) : 0); + g = g + e - (p && !d ? p * c * (n ? 1 : -1) : 0); + E && (q = C / (t || 1) % E, m.opposite && (q = E - q - 1), g += m.labelOffset / E * q); + return {x: a, y: Math.round(g)} + }, getMarkPath: function (a, f, g, d, b, p) { + return p.crispLine(["M", a, f, "L", a + (b ? 0 : -g), f + (b ? g : 0)], d) + }, render: function (a, f, q) { + var d = this.axis, b = d.options, p = d.chart.renderer, l = d.horiz, t = this.type, m = this.label, c = this.pos, + n = b.labels, E = this.gridLine, z = t ? t + "Tick" : "tick", e = d.tickSize(z), x = this.mark, F = !x, w = n.step, h = {}, y = !0, J = d.tickmarkOffset, K = this.getPosition(l, c, J, f), I = K.x, K = K.y, k = l && I === d.pos + d.len || !l && K === d.pos ? -1 : 1, D = t ? t + "Grid" : "grid", P = b[D + "LineWidth"], N = b[D + "LineColor"], r = b[D + "LineDashStyle"], D = g(b[z + "Width"], !t && d.isXAxis ? 1 : 0), z = b[z + "Color"]; + q = g(q, 1); + this.isActive = !0; + E || (h.stroke = N, h["stroke-width"] = P, r && (h.dashstyle = r), t || (h.zIndex = 1), f && (h.opacity = 0), this.gridLine = E = p.path().attr(h).addClass("highcharts-" + (t ? + t + "-" : "") + "grid-line").add(d.gridGroup)); + if (!f && E && (c = d.getPlotLinePath(c + J, E.strokeWidth() * k, f, !0)))E[this.isNew ? "attr" : "animate"]({ + d: c, + opacity: q + }); + e && (d.opposite && (e[0] = -e[0]), F && (this.mark = x = p.path().addClass("highcharts-" + (t ? t + "-" : "") + "tick").add(d.axisGroup), x.attr({ + stroke: z, + "stroke-width": D + })), x[F ? "attr" : "animate"]({ + d: this.getMarkPath(I, K, e[0], x.strokeWidth() * k, l, p), + opacity: q + })); + m && G(I) && (m.xy = K = this.getLabelPosition(I, K, m, l, n, J, a, w), this.isFirst && !this.isLast && !g(b.showFirstLabel, 1) || this.isLast && !this.isFirst && !g(b.showLastLabel, 1) ? y = !1 : !l || d.isRadial || n.step || n.rotation || f || 0 === q || this.handleOverflow(K), w && a % w && (y = !1), y && G(K.y) ? (K.opacity = q, m[this.isNew ? "attr" : "animate"](K)) : m.attr("y", -9999), this.isNew = !1) + }, destroy: function () { + H(this, this.axis) + } + } + })(L); + (function (a) { + var B = a.addEvent, A = a.animObject, H = a.arrayMax, G = a.arrayMin, r = a.AxisPlotLineOrBandExtension, g = a.color, f = a.correctFloat, u = a.defaultOptions, l = a.defined, q = a.deg2rad, d = a.destroyObjectProperties, b = a.each, p = a.extend, C = a.fireEvent, t = a.format, + m = a.getMagnitude, c = a.grep, n = a.inArray, E = a.isArray, z = a.isNumber, e = a.isString, x = a.merge, F = a.normalizeTickInterval, w = a.pick, h = a.PlotLineOrBand, y = a.removeEvent, J = a.splat, K = a.syncTimeout, I = a.Tick; + a.Axis = function () { + this.init.apply(this, arguments) + }; + a.Axis.prototype = { + defaultOptions: { + dateTimeLabelFormats: { + millisecond: "%H:%M:%S.%L", + second: "%H:%M:%S", + minute: "%H:%M", + hour: "%H:%M", + day: "%e. %b", + week: "%e. %b", + month: "%b '%y", + year: "%Y" + }, + endOnTick: !1, + labels: { + enabled: !0, style: {color: "#666666", cursor: "default", fontSize: "11px"}, + x: 0 + }, + minPadding: .01, + maxPadding: .01, + minorTickLength: 2, + minorTickPosition: "outside", + startOfWeek: 1, + startOnTick: !1, + tickLength: 10, + tickmarkPlacement: "between", + tickPixelInterval: 100, + tickPosition: "outside", + title: {align: "middle", style: {color: "#666666"}}, + type: "linear", + minorGridLineColor: "#f2f2f2", + minorGridLineWidth: 1, + minorTickColor: "#999999", + lineColor: "#ccd6eb", + lineWidth: 1, + gridLineColor: "#e6e6e6", + tickColor: "#ccd6eb" + }, + defaultYAxisOptions: { + endOnTick: !0, + tickPixelInterval: 72, + showLastLabel: !0, + labels: {x: -8}, + maxPadding: .05, + minPadding: .05, + startOnTick: !0, + title: {rotation: 270, text: "Values"}, + stackLabels: { + enabled: !1, formatter: function () { + return a.numberFormat(this.total, -1) + }, style: {fontSize: "11px", fontWeight: "bold", color: "#000000", textOutline: "1px contrast"} + }, + gridLineWidth: 1, + lineWidth: 0 + }, + defaultLeftAxisOptions: {labels: {x: -15}, title: {rotation: 270}}, + defaultRightAxisOptions: {labels: {x: 15}, title: {rotation: 90}}, + defaultBottomAxisOptions: {labels: {autoRotation: [-45], x: 0}, title: {rotation: 0}}, + defaultTopAxisOptions: { + labels: { + autoRotation: [-45], + x: 0 + }, title: {rotation: 0} + }, + init: function (a, b) { + var k = b.isX; + this.chart = a; + this.horiz = a.inverted ? !k : k; + this.isXAxis = k; + this.coll = this.coll || (k ? "xAxis" : "yAxis"); + this.opposite = b.opposite; + this.side = b.side || (this.horiz ? this.opposite ? 0 : 2 : this.opposite ? 1 : 3); + this.setOptions(b); + var c = this.options, e = c.type; + this.labelFormatter = c.labels.formatter || this.defaultLabelFormatter; + this.userOptions = b; + this.minPixelPadding = 0; + this.reversed = c.reversed; + this.visible = !1 !== c.visible; + this.zoomEnabled = !1 !== c.zoomEnabled; + this.hasNames = + "category" === e || !0 === c.categories; + this.categories = c.categories || this.hasNames; + this.names = this.names || []; + this.isLog = "logarithmic" === e; + this.isDatetimeAxis = "datetime" === e; + this.isLinked = l(c.linkedTo); + this.ticks = {}; + this.labelEdge = []; + this.minorTicks = {}; + this.plotLinesAndBands = []; + this.alternateBands = {}; + this.len = 0; + this.minRange = this.userMinRange = c.minRange || c.maxZoom; + this.range = c.range; + this.offset = c.offset || 0; + this.stacks = {}; + this.oldStacks = {}; + this.stacksTouched = 0; + this.min = this.max = null; + this.crosshair = w(c.crosshair, + J(a.options.tooltip.crosshairs)[k ? 0 : 1], !1); + var h; + b = this.options.events; + -1 === n(this, a.axes) && (k ? a.axes.splice(a.xAxis.length, 0, this) : a.axes.push(this), a[this.coll].push(this)); + this.series = this.series || []; + a.inverted && k && void 0 === this.reversed && (this.reversed = !0); + this.removePlotLine = this.removePlotBand = this.removePlotBandOrLine; + for (h in b)B(this, h, b[h]); + this.isLog && (this.val2lin = this.log2lin, this.lin2val = this.lin2log) + }, + setOptions: function (a) { + this.options = x(this.defaultOptions, "yAxis" === this.coll && this.defaultYAxisOptions, + [this.defaultTopAxisOptions, this.defaultRightAxisOptions, this.defaultBottomAxisOptions, this.defaultLeftAxisOptions][this.side], x(u[this.coll], a)) + }, + defaultLabelFormatter: function () { + var b = this.axis, c = this.value, e = b.categories, h = this.dateTimeLabelFormat, n = u.lang, d = n.numericSymbols, n = n.numericSymbolMagnitude || 1E3, v = d && d.length, m, f = b.options.labels.format, b = b.isLog ? c : b.tickInterval; + if (f)m = t(f, this); else if (e)m = c; else if (h)m = a.dateFormat(h, c); else if (v && 1E3 <= b)for (; v-- && void 0 === m;)e = Math.pow(n, v + 1), b >= + e && 0 === 10 * c % e && null !== d[v] && 0 !== c && (m = a.numberFormat(c / e, -1) + d[v]); + void 0 === m && (m = 1E4 <= Math.abs(c) ? a.numberFormat(c, -1) : a.numberFormat(c, -1, void 0, "")); + return m + }, + getSeriesExtremes: function () { + var a = this, e = a.chart; + a.hasVisibleSeries = !1; + a.dataMin = a.dataMax = a.threshold = null; + a.softThreshold = !a.isXAxis; + a.buildStacks && a.buildStacks(); + b(a.series, function (b) { + if (b.visible || !e.options.chart.ignoreHiddenSeries) { + var k = b.options, h = k.threshold, D; + a.hasVisibleSeries = !0; + a.isLog && 0 >= h && (h = null); + if (a.isXAxis)k = b.xData, + k.length && (b = G(k), z(b) || b instanceof Date || (k = c(k, function (a) { + return z(a) + }), b = G(k)), a.dataMin = Math.min(w(a.dataMin, k[0]), b), a.dataMax = Math.max(w(a.dataMax, k[0]), H(k))); else if (b.getExtremes(), D = b.dataMax, b = b.dataMin, l(b) && l(D) && (a.dataMin = Math.min(w(a.dataMin, b), b), a.dataMax = Math.max(w(a.dataMax, D), D)), l(h) && (a.threshold = h), !k.softThreshold || a.isLog)a.softThreshold = !1 + } + }) + }, + translate: function (a, b, c, e, h, n) { + var k = this.linkedParent || this, D = 1, m = 0, d = e ? k.oldTransA : k.transA; + e = e ? k.oldMin : k.min; + var f = k.minPixelPadding; + h = (k.isOrdinal || k.isBroken || k.isLog && h) && k.lin2val; + d || (d = k.transA); + c && (D *= -1, m = k.len); + k.reversed && (D *= -1, m -= D * (k.sector || k.len)); + b ? (a = (a * D + m - f) / d + e, h && (a = k.lin2val(a))) : (h && (a = k.val2lin(a)), a = D * (a - e) * d + m + D * f + (z(n) ? d * n : 0)); + return a + }, + toPixels: function (a, b) { + return this.translate(a, !1, !this.horiz, null, !0) + (b ? 0 : this.pos) + }, + toValue: function (a, b) { + return this.translate(a - (b ? 0 : this.pos), !0, !this.horiz, null, !0) + }, + getPlotLinePath: function (a, b, c, e, h) { + var k = this.chart, D = this.left, n = this.top, m, d, f = c && k.oldChartHeight || + k.chartHeight, p = c && k.oldChartWidth || k.chartWidth, y; + m = this.transB; + var t = function (a, b, k) { + if (a < b || a > k)e ? a = Math.min(Math.max(b, a), k) : y = !0; + return a + }; + h = w(h, this.translate(a, null, null, c)); + a = c = Math.round(h + m); + m = d = Math.round(f - h - m); + z(h) ? this.horiz ? (m = n, d = f - this.bottom, a = c = t(a, D, D + this.width)) : (a = D, c = p - this.right, m = d = t(m, n, n + this.height)) : y = !0; + return y && !e ? null : k.renderer.crispLine(["M", a, m, "L", c, d], b || 1) + }, + getLinearTickPositions: function (a, b, c) { + var k, e = f(Math.floor(b / a) * a), h = f(Math.ceil(c / a) * a), D = []; + if (b === + c && z(b))return [b]; + for (b = e; b <= h;) { + D.push(b); + b = f(b + a); + if (b === k)break; + k = b + } + return D + }, + getMinorTickPositions: function () { + var a = this.options, b = this.tickPositions, c = this.minorTickInterval, e = [], h, n = this.pointRangePadding || 0; + h = this.min - n; + var n = this.max + n, m = n - h; + if (m && m / c < this.len / 3)if (this.isLog)for (n = b.length, h = 1; h < n; h++)e = e.concat(this.getLogTickPositions(c, b[h - 1], b[h], !0)); else if (this.isDatetimeAxis && "auto" === a.minorTickInterval)e = e.concat(this.getTimeTicks(this.normalizeTimeTickInterval(c), h, n, a.startOfWeek)); + else for (b = h + (b[0] - h) % c; b <= n && b !== e[0]; b += c)e.push(b); + 0 !== e.length && this.trimTicks(e, a.startOnTick, a.endOnTick); + return e + }, + adjustForMinRange: function () { + var a = this.options, c = this.min, e = this.max, h, n = this.dataMax - this.dataMin >= this.minRange, m, v, d, f, p, y; + this.isXAxis && void 0 === this.minRange && !this.isLog && (l(a.min) || l(a.max) ? this.minRange = null : (b(this.series, function (a) { + f = a.xData; + for (v = p = a.xIncrement ? 1 : f.length - 1; 0 < v; v--)if (d = f[v] - f[v - 1], void 0 === m || d < m)m = d + }), this.minRange = Math.min(5 * m, this.dataMax - this.dataMin))); + e - c < this.minRange && (y = this.minRange, h = (y - e + c) / 2, h = [c - h, w(a.min, c - h)], n && (h[2] = this.isLog ? this.log2lin(this.dataMin) : this.dataMin), c = H(h), e = [c + y, w(a.max, c + y)], n && (e[2] = this.isLog ? this.log2lin(this.dataMax) : this.dataMax), e = G(e), e - c < y && (h[0] = e - y, h[1] = w(a.min, e - y), c = H(h))); + this.min = c; + this.max = e + }, + getClosest: function () { + var a; + this.categories ? a = 1 : b(this.series, function (b) { + var k = b.closestPointRange, c = b.visible || !b.chart.options.chart.ignoreHiddenSeries; + !b.noSharedTooltip && l(k) && c && (a = l(a) ? Math.min(a, k) : k) + }); + return a + }, + nameToX: function (a) { + var b = E(this.categories), k = b ? this.categories : this.names, c = a.options.x, e; + a.series.requireSorting = !1; + l(c) || (c = !1 === this.options.uniqueNames ? a.series.autoIncrement() : n(a.name, k)); + -1 === c ? b || (e = k.length) : e = c; + this.names[e] = a.name; + return e + }, + updateNames: function () { + var a = this; + 0 < this.names.length && (this.names.length = 0, this.minRange = void 0, b(this.series || [], function (k) { + k.xIncrement = null; + if (!k.points || k.isDirtyData)k.processData(), k.generatePoints(); + b(k.points, function (b, c) { + var e; + b.options && (e = a.nameToX(b), e !== b.x && (b.x = e, k.xData[c] = e)) + }) + })) + }, + setAxisTranslation: function (a) { + var k = this, c = k.max - k.min, h = k.axisPointRange || 0, n, m = 0, d = 0, f = k.linkedParent, y = !!k.categories, p = k.transA, t = k.isXAxis; + if (t || y || h)n = k.getClosest(), f ? (m = f.minPointOffset, d = f.pointRangePadding) : b(k.series, function (a) { + var b = y ? 1 : t ? w(a.options.pointRange, n, 0) : k.axisPointRange || 0; + a = a.options.pointPlacement; + h = Math.max(h, b); + k.single || (m = Math.max(m, e(a) ? 0 : b / 2), d = Math.max(d, "on" === a ? 0 : b)) + }), f = k.ordinalSlope && n ? k.ordinalSlope / + n : 1, k.minPointOffset = m *= f, k.pointRangePadding = d *= f, k.pointRange = Math.min(h, c), t && (k.closestPointRange = n); + a && (k.oldTransA = p); + k.translationSlope = k.transA = p = k.len / (c + d || 1); + k.transB = k.horiz ? k.left : k.bottom; + k.minPixelPadding = p * m + }, + minFromRange: function () { + return this.max - this.range + }, + setTickInterval: function (k) { + var c = this, e = c.chart, h = c.options, n = c.isLog, d = c.log2lin, v = c.isDatetimeAxis, y = c.isXAxis, p = c.isLinked, t = h.maxPadding, x = h.minPadding, g = h.tickInterval, E = h.tickPixelInterval, q = c.categories, J = c.threshold, + K = c.softThreshold, I, r, u, A; + v || q || p || this.getTickAmount(); + u = w(c.userMin, h.min); + A = w(c.userMax, h.max); + p ? (c.linkedParent = e[c.coll][h.linkedTo], e = c.linkedParent.getExtremes(), c.min = w(e.min, e.dataMin), c.max = w(e.max, e.dataMax), h.type !== c.linkedParent.options.type && a.error(11, 1)) : (!K && l(J) && (c.dataMin >= J ? (I = J, x = 0) : c.dataMax <= J && (r = J, t = 0)), c.min = w(u, I, c.dataMin), c.max = w(A, r, c.dataMax)); + n && (!k && 0 >= Math.min(c.min, w(c.dataMin, c.min)) && a.error(10, 1), c.min = f(d(c.min), 15), c.max = f(d(c.max), 15)); + c.range && l(c.max) && + (c.userMin = c.min = u = Math.max(c.min, c.minFromRange()), c.userMax = A = c.max, c.range = null); + C(c, "foundExtremes"); + c.beforePadding && c.beforePadding(); + c.adjustForMinRange(); + !(q || c.axisPointRange || c.usePercentage || p) && l(c.min) && l(c.max) && (d = c.max - c.min) && (!l(u) && x && (c.min -= d * x), !l(A) && t && (c.max += d * t)); + z(h.floor) ? c.min = Math.max(c.min, h.floor) : z(h.softMin) && (c.min = Math.min(c.min, h.softMin)); + z(h.ceiling) ? c.max = Math.min(c.max, h.ceiling) : z(h.softMax) && (c.max = Math.max(c.max, h.softMax)); + K && l(c.dataMin) && (J = J || 0, !l(u) && + c.min < J && c.dataMin >= J ? c.min = J : !l(A) && c.max > J && c.dataMax <= J && (c.max = J)); + c.tickInterval = c.min === c.max || void 0 === c.min || void 0 === c.max ? 1 : p && !g && E === c.linkedParent.options.tickPixelInterval ? g = c.linkedParent.tickInterval : w(g, this.tickAmount ? (c.max - c.min) / Math.max(this.tickAmount - 1, 1) : void 0, q ? 1 : (c.max - c.min) * E / Math.max(c.len, E)); + y && !k && b(c.series, function (a) { + a.processData(c.min !== c.oldMin || c.max !== c.oldMax) + }); + c.setAxisTranslation(!0); + c.beforeSetTickPositions && c.beforeSetTickPositions(); + c.postProcessTickInterval && + (c.tickInterval = c.postProcessTickInterval(c.tickInterval)); + c.pointRange && !g && (c.tickInterval = Math.max(c.pointRange, c.tickInterval)); + k = w(h.minTickInterval, c.isDatetimeAxis && c.closestPointRange); + !g && c.tickInterval < k && (c.tickInterval = k); + v || n || g || (c.tickInterval = F(c.tickInterval, null, m(c.tickInterval), w(h.allowDecimals, !(.5 < c.tickInterval && 5 > c.tickInterval && 1E3 < c.max && 9999 > c.max)), !!this.tickAmount)); + this.tickAmount || (c.tickInterval = c.unsquish()); + this.setTickPositions() + }, + setTickPositions: function () { + var a = + this.options, b, c = a.tickPositions, e = a.tickPositioner, h = a.startOnTick, n = a.endOnTick, m; + this.tickmarkOffset = this.categories && "between" === a.tickmarkPlacement && 1 === this.tickInterval ? .5 : 0; + this.minorTickInterval = "auto" === a.minorTickInterval && this.tickInterval ? this.tickInterval / 5 : a.minorTickInterval; + this.tickPositions = b = c && c.slice(); + !b && (b = this.isDatetimeAxis ? this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval, a.units), this.min, this.max, a.startOfWeek, this.ordinalPositions, this.closestPointRange, + !0) : this.isLog ? this.getLogTickPositions(this.tickInterval, this.min, this.max) : this.getLinearTickPositions(this.tickInterval, this.min, this.max), b.length > this.len && (b = [b[0], b.pop()]), this.tickPositions = b, e && (e = e.apply(this, [this.min, this.max]))) && (this.tickPositions = b = e); + this.trimTicks(b, h, n); + this.isLinked || (this.min === this.max && l(this.min) && !this.tickAmount && (m = !0, this.min -= .5, this.max += .5), this.single = m, c || e || this.adjustTickAmount()) + }, + trimTicks: function (a, b, c) { + var k = a[0], e = a[a.length - 1], h = this.minPointOffset || + 0; + if (!this.isLinked) { + if (b)this.min = k; else for (; this.min - h > a[0];)a.shift(); + if (c)this.max = e; else for (; this.max + h < a[a.length - 1];)a.pop(); + 0 === a.length && l(k) && a.push((e + k) / 2) + } + }, + alignToOthers: function () { + var a = {}, c, e = this.options; + !1 === this.chart.options.chart.alignTicks || !1 === e.alignTicks || this.isLog || b(this.chart[this.coll], function (b) { + var k = b.options, k = [b.horiz ? k.left : k.top, k.width, k.height, k.pane].join(); + b.series.length && (a[k] ? c = !0 : a[k] = 1) + }); + return c + }, + getTickAmount: function () { + var a = this.options, b = a.tickAmount, + c = a.tickPixelInterval; + !l(a.tickInterval) && this.len < c && !this.isRadial && !this.isLog && a.startOnTick && a.endOnTick && (b = 2); + !b && this.alignToOthers() && (b = Math.ceil(this.len / c) + 1); + 4 > b && (this.finalTickAmt = b, b = 5); + this.tickAmount = b + }, + adjustTickAmount: function () { + var a = this.tickInterval, b = this.tickPositions, c = this.tickAmount, e = this.finalTickAmt, h = b && b.length; + if (h < c) { + for (; b.length < c;)b.push(f(b[b.length - 1] + a)); + this.transA *= (h - 1) / (c - 1); + this.max = b[b.length - 1] + } else h > c && (this.tickInterval *= 2, this.setTickPositions()); + if (l(e)) { + for (a = c = b.length; a--;)(3 === e && 1 === a % 2 || 2 >= e && 0 < a && a < c - 1) && b.splice(a, 1); + this.finalTickAmt = void 0 + } + }, + setScale: function () { + var a, c; + this.oldMin = this.min; + this.oldMax = this.max; + this.oldAxisLength = this.len; + this.setAxisSize(); + c = this.len !== this.oldAxisLength; + b(this.series, function (b) { + if (b.isDirtyData || b.isDirty || b.xAxis.isDirty)a = !0 + }); + c || a || this.isLinked || this.forceRedraw || this.userMin !== this.oldUserMin || this.userMax !== this.oldUserMax || this.alignToOthers() ? (this.resetStacks && this.resetStacks(), this.forceRedraw = !1, this.getSeriesExtremes(), this.setTickInterval(), this.oldUserMin = this.userMin, this.oldUserMax = this.userMax, this.isDirty || (this.isDirty = c || this.min !== this.oldMin || this.max !== this.oldMax)) : this.cleanStacks && this.cleanStacks() + }, + setExtremes: function (a, c, e, h, n) { + var k = this, m = k.chart; + e = w(e, !0); + b(k.series, function (a) { + delete a.kdTree + }); + n = p(n, {min: a, max: c}); + C(k, "setExtremes", n, function () { + k.userMin = a; + k.userMax = c; + k.eventArgs = n; + e && m.redraw(h) + }) + }, + zoom: function (a, b) { + var c = this.dataMin, k = this.dataMax, e = this.options, + h = Math.min(c, w(e.min, c)), e = Math.max(k, w(e.max, k)); + if (a !== this.min || b !== this.max)this.allowZoomOutside || (l(c) && (a < h && (a = h), a > e && (a = e)), l(k) && (b < h && (b = h), b > e && (b = e))), this.displayBtn = void 0 !== a || void 0 !== b, this.setExtremes(a, b, !1, void 0, {trigger: "zoom"}); + return !0 + }, + setAxisSize: function () { + var a = this.chart, b = this.options, c = b.offsets || [0, 0, 0, 0], e = this.horiz, h = w(b.width, a.plotWidth - c[3] + c[1]), n = w(b.height, a.plotHeight - c[0] + c[2]), m = w(b.top, a.plotTop + c[0]), b = w(b.left, a.plotLeft + c[3]), c = /%$/; + c.test(n) && (n = + Math.round(parseFloat(n) / 100 * a.plotHeight)); + c.test(m) && (m = Math.round(parseFloat(m) / 100 * a.plotHeight + a.plotTop)); + this.left = b; + this.top = m; + this.width = h; + this.height = n; + this.bottom = a.chartHeight - n - m; + this.right = a.chartWidth - h - b; + this.len = Math.max(e ? h : n, 0); + this.pos = e ? b : m + }, + getExtremes: function () { + var a = this.isLog, b = this.lin2log; + return { + min: a ? f(b(this.min)) : this.min, + max: a ? f(b(this.max)) : this.max, + dataMin: this.dataMin, + dataMax: this.dataMax, + userMin: this.userMin, + userMax: this.userMax + } + }, + getThreshold: function (a) { + var b = + this.isLog, c = this.lin2log, k = b ? c(this.min) : this.min, b = b ? c(this.max) : this.max; + null === a ? a = k : k > a ? a = k : b < a && (a = b); + return this.translate(a, 0, 1, 0, 1) + }, + autoLabelAlign: function (a) { + a = (w(a, 0) - 90 * this.side + 720) % 360; + return 15 < a && 165 > a ? "right" : 195 < a && 345 > a ? "left" : "center" + }, + tickSize: function (a) { + var b = this.options, c = b[a + "Length"], k = w(b[a + "Width"], "tick" === a && this.isXAxis ? 1 : 0); + if (k && c)return "inside" === b[a + "Position"] && (c = -c), [c, k] + }, + labelMetrics: function () { + return this.chart.renderer.fontMetrics(this.options.labels.style && + this.options.labels.style.fontSize, this.ticks[0] && this.ticks[0].label) + }, + unsquish: function () { + var a = this.options.labels, c = this.horiz, e = this.tickInterval, h = e, n = this.len / (((this.categories ? 1 : 0) + this.max - this.min) / e), m, d = a.rotation, f = this.labelMetrics(), p, y = Number.MAX_VALUE, t, x = function (a) { + a /= n || 1; + a = 1 < a ? Math.ceil(a) : 1; + return a * e + }; + c ? (t = !a.staggerLines && !a.step && (l(d) ? [d] : n < w(a.autoRotationLimit, 80) && a.autoRotation)) && b(t, function (a) { + var b; + if (a === d || a && -90 <= a && 90 >= a)p = x(Math.abs(f.h / Math.sin(q * a))), b = p + + Math.abs(a / 360), b < y && (y = b, m = a, h = p) + }) : a.step || (h = x(f.h)); + this.autoRotation = t; + this.labelRotation = w(m, d); + return h + }, + getSlotWidth: function () { + var a = this.chart, b = this.horiz, c = this.options.labels, e = Math.max(this.tickPositions.length - (this.categories ? 0 : 1), 1), h = a.margin[3]; + return b && 2 > (c.step || 0) && !c.rotation && (this.staggerLines || 1) * this.len / e || !b && (h && h - a.spacing[3] || .33 * a.chartWidth) + }, + renderUnsquish: function () { + var a = this.chart, c = a.renderer, h = this.tickPositions, n = this.ticks, m = this.options.labels, d = this.horiz, + v = this.getSlotWidth(), f = Math.max(1, Math.round(v - 2 * (m.padding || 5))), p = {}, y = this.labelMetrics(), t = m.style && m.style.textOverflow, g, z = 0, E, w; + e(m.rotation) || (p.rotation = m.rotation || 0); + b(h, function (a) { + (a = n[a]) && a.labelLength > z && (z = a.labelLength) + }); + this.maxLabelLength = z; + if (this.autoRotation)z > f && z > y.h ? p.rotation = this.labelRotation : this.labelRotation = 0; else if (v && (g = {width: f + "px"}, !t))for (g.textOverflow = "clip", E = h.length; !d && E--;)if (w = h[E], f = n[w].label)f.styles && "ellipsis" === f.styles.textOverflow ? f.css({textOverflow: "clip"}) : + n[w].labelLength > v && f.css({width: v + "px"}), f.getBBox().height > this.len / h.length - (y.h - y.f) && (f.specCss = {textOverflow: "ellipsis"}); + p.rotation && (g = {width: (z > .5 * a.chartHeight ? .33 * a.chartHeight : a.chartHeight) + "px"}, t || (g.textOverflow = "ellipsis")); + if (this.labelAlign = m.align || this.autoLabelAlign(this.labelRotation))p.align = this.labelAlign; + b(h, function (a) { + var b = (a = n[a]) && a.label; + b && (b.attr(p), g && b.css(x(g, b.specCss)), delete b.specCss, a.rotation = p.rotation) + }); + this.tickRotCorr = c.rotCorr(y.b, this.labelRotation || + 0, 0 !== this.side) + }, + hasData: function () { + return this.hasVisibleSeries || l(this.min) && l(this.max) && !!this.tickPositions + }, + addTitle: function (a) { + var b = this.chart.renderer, c = this.horiz, k = this.opposite, e = this.options.title, h; + this.axisTitle || ((h = e.textAlign) || (h = (c ? { + low: "left", + middle: "center", + high: "right" + } : { + low: k ? "right" : "left", + middle: "center", + high: k ? "left" : "right" + })[e.align]), this.axisTitle = b.text(e.text, 0, 0, e.useHTML).attr({ + zIndex: 7, + rotation: e.rotation || 0, + align: h + }).addClass("highcharts-axis-title").css(e.style).add(this.axisGroup), + this.axisTitle.isNew = !0); + this.axisTitle[a ? "show" : "hide"](!0) + }, + generateTick: function (a) { + var b = this.ticks; + b[a] ? b[a].addLabel() : b[a] = new I(this, a) + }, + getOffset: function () { + var a = this, c = a.chart, e = c.renderer, h = a.options, n = a.tickPositions, m = a.ticks, d = a.horiz, f = a.side, p = c.inverted ? [1, 0, 3, 2][f] : f, y, t, x = 0, g, z = 0, E = h.title, q = h.labels, F = 0, J = c.axisOffset, c = c.clipOffset, K = [-1, 1, 1, -1][f], C, I = h.className, r = a.axisParent, u = this.tickSize("tick"); + y = a.hasData(); + a.showAxis = t = y || w(h.showEmpty, !0); + a.staggerLines = a.horiz && q.staggerLines; + a.axisGroup || (a.gridGroup = e.g("grid").attr({zIndex: h.gridZIndex || 1}).addClass("highcharts-" + this.coll.toLowerCase() + "-grid " + (I || "")).add(r), a.axisGroup = e.g("axis").attr({zIndex: h.zIndex || 2}).addClass("highcharts-" + this.coll.toLowerCase() + " " + (I || "")).add(r), a.labelGroup = e.g("axis-labels").attr({zIndex: q.zIndex || 7}).addClass("highcharts-" + a.coll.toLowerCase() + "-labels " + (I || "")).add(r)); + if (y || a.isLinked)b(n, function (b, c) { + a.generateTick(b, c) + }), a.renderUnsquish(), !1 === q.reserveSpace || 0 !== f && 2 !== f && + {1: "left", 3: "right"}[f] !== a.labelAlign && "center" !== a.labelAlign || b(n, function (a) { + F = Math.max(m[a].getLabelSize(), F) + }), a.staggerLines && (F *= a.staggerLines, a.labelOffset = F * (a.opposite ? -1 : 1)); else for (C in m)m[C].destroy(), delete m[C]; + E && E.text && !1 !== E.enabled && (a.addTitle(t), t && (x = a.axisTitle.getBBox()[d ? "height" : "width"], g = E.offset, z = l(g) ? 0 : w(E.margin, d ? 5 : 10))); + a.renderLine(); + a.offset = K * w(h.offset, J[f]); + a.tickRotCorr = a.tickRotCorr || {x: 0, y: 0}; + e = 0 === f ? -a.labelMetrics().h : 2 === f ? a.tickRotCorr.y : 0; + z = Math.abs(F) + + z; + F && (z = z - e + K * (d ? w(q.y, a.tickRotCorr.y + 8 * K) : q.x)); + a.axisTitleMargin = w(g, z); + J[f] = Math.max(J[f], a.axisTitleMargin + x + K * a.offset, z, y && n.length && u ? u[0] : 0); + h = h.offset ? 0 : 2 * Math.floor(a.axisLine.strokeWidth() / 2); + c[p] = Math.max(c[p], h) + }, + getLinePath: function (a) { + var b = this.chart, c = this.opposite, k = this.offset, e = this.horiz, h = this.left + (c ? this.width : 0) + k, k = b.chartHeight - this.bottom - (c ? this.height : 0) + k; + c && (a *= -1); + return b.renderer.crispLine(["M", e ? this.left : h, e ? k : this.top, "L", e ? b.chartWidth - this.right : h, e ? k : b.chartHeight - + this.bottom], a) + }, + renderLine: function () { + this.axisLine || (this.axisLine = this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup), this.axisLine.attr({ + stroke: this.options.lineColor, + "stroke-width": this.options.lineWidth, + zIndex: 7 + })) + }, + getTitlePosition: function () { + var a = this.horiz, b = this.left, c = this.top, e = this.len, h = this.options.title, n = a ? b : c, m = this.opposite, d = this.offset, f = h.x || 0, p = h.y || 0, y = this.chart.renderer.fontMetrics(h.style && h.style.fontSize, this.axisTitle).f, e = { + low: n + (a ? 0 : e), + middle: n + e / 2, high: n + (a ? e : 0) + }[h.align], b = (a ? c + this.height : b) + (a ? 1 : -1) * (m ? -1 : 1) * this.axisTitleMargin + (2 === this.side ? y : 0); + return { + x: a ? e + f : b + (m ? this.width : 0) + d + f, + y: a ? b + p - (m ? this.height : 0) + d : e + p + } + }, + renderMinorTick: function (a) { + var b = this.chart.hasRendered && z(this.oldMin), c = this.minorTicks; + c[a] || (c[a] = new I(this, a, "minor")); + b && c[a].isNew && c[a].render(null, !0); + c[a].render(null, !1, 1) + }, + renderTick: function (a, b) { + var c = this.isLinked, e = this.ticks, k = this.chart.hasRendered && z(this.oldMin); + if (!c || a >= this.min && a <= this.max)e[a] || + (e[a] = new I(this, a)), k && e[a].isNew && e[a].render(b, !0, .1), e[a].render(b) + }, + render: function () { + var a = this, c = a.chart, e = a.options, n = a.isLog, m = a.lin2log, d = a.isLinked, v = a.tickPositions, f = a.axisTitle, p = a.ticks, y = a.minorTicks, t = a.alternateBands, x = e.stackLabels, z = e.alternateGridColor, g = a.tickmarkOffset, E = a.axisLine, w = a.showAxis, l = A(c.renderer.globalAnimation), q, F; + a.labelEdge.length = 0; + a.overlap = !1; + b([p, y, t], function (a) { + for (var b in a)a[b].isActive = !1 + }); + if (a.hasData() || d)a.minorTickInterval && !a.categories && b(a.getMinorTickPositions(), + function (b) { + a.renderMinorTick(b) + }), v.length && (b(v, function (b, c) { + a.renderTick(b, c) + }), g && (0 === a.min || a.single) && (p[-1] || (p[-1] = new I(a, -1, null, !0)), p[-1].render(-1))), z && b(v, function (b, e) { + F = void 0 !== v[e + 1] ? v[e + 1] + g : a.max - g; + 0 === e % 2 && b < a.max && F <= a.max + (c.polar ? -g : g) && (t[b] || (t[b] = new h(a)), q = b + g, t[b].options = { + from: n ? m(q) : q, + to: n ? m(F) : F, + color: z + }, t[b].render(), t[b].isActive = !0) + }), a._addedPlotLB || (b((e.plotLines || []).concat(e.plotBands || []), function (b) { + a.addPlotBandOrLine(b) + }), a._addedPlotLB = !0); + b([p, y, t], + function (a) { + var b, e, h = [], k = l.duration; + for (b in a)a[b].isActive || (a[b].render(b, !1, 0), a[b].isActive = !1, h.push(b)); + K(function () { + for (e = h.length; e--;)a[h[e]] && !a[h[e]].isActive && (a[h[e]].destroy(), delete a[h[e]]) + }, a !== t && c.hasRendered && k ? k : 0) + }); + E && (E[E.isPlaced ? "animate" : "attr"]({d: this.getLinePath(E.strokeWidth())}), E.isPlaced = !0, E[w ? "show" : "hide"](!0)); + f && w && (f[f.isNew ? "attr" : "animate"](a.getTitlePosition()), f.isNew = !1); + x && x.enabled && a.renderStackTotals(); + a.isDirty = !1 + }, + redraw: function () { + this.visible && + (this.render(), b(this.plotLinesAndBands, function (a) { + a.render() + })); + b(this.series, function (a) { + a.isDirty = !0 + }) + }, + keepProps: "extKey hcEvents names series userMax userMin".split(" "), + destroy: function (a) { + var c = this, e = c.stacks, h, k = c.plotLinesAndBands, m; + a || y(c); + for (h in e)d(e[h]), e[h] = null; + b([c.ticks, c.minorTicks, c.alternateBands], function (a) { + d(a) + }); + if (k)for (a = k.length; a--;)k[a].destroy(); + b("stackTotalGroup axisLine axisTitle axisGroup gridGroup labelGroup cross".split(" "), function (a) { + c[a] && (c[a] = c[a].destroy()) + }); + for (m in c)c.hasOwnProperty(m) && -1 === n(m, c.keepProps) && delete c[m] + }, + drawCrosshair: function (a, b) { + var c, e = this.crosshair, h = w(e.snap, !0), k, n = this.cross; + a || (a = this.cross && this.cross.e); + this.crosshair && !1 !== (l(b) || !h) ? (h ? l(b) && (k = this.isXAxis ? b.plotX : this.len - b.plotY) : k = a && (this.horiz ? a.chartX - this.pos : this.len - a.chartY + this.pos), l(k) && (c = this.getPlotLinePath(b && (this.isXAxis ? b.x : w(b.stackY, b.y)), null, null, null, k) || null), l(c) ? (b = this.categories && !this.isRadial, n || (this.cross = n = this.chart.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-" + + (b ? "category " : "thin ") + e.className).attr({zIndex: w(e.zIndex, 2)}).add(), n.attr({ + stroke: e.color || (b ? g("#ccd6eb").setOpacity(.25).get() : "#cccccc"), + "stroke-width": w(e.width, 1) + }), e.dashStyle && n.attr({dashstyle: e.dashStyle})), n.show().attr({d: c}), b && !e.width && n.attr({"stroke-width": this.transA}), this.cross.e = a) : this.hideCrosshair()) : this.hideCrosshair() + }, + hideCrosshair: function () { + this.cross && this.cross.hide() + } + }; + p(a.Axis.prototype, r) + })(L); + (function (a) { + var B = a.Axis, A = a.Date, H = a.dateFormat, G = a.defaultOptions, + r = a.defined, g = a.each, f = a.extend, u = a.getMagnitude, l = a.getTZOffset, q = a.normalizeTickInterval, d = a.pick, b = a.timeUnits; + B.prototype.getTimeTicks = function (a, q, t, m) { + var c = [], n = {}, p = G.global.useUTC, z, e = new A(q - l(q)), x = A.hcMakeTime, F = a.unitRange, w = a.count, h; + if (r(q)) { + e[A.hcSetMilliseconds](F >= b.second ? 0 : w * Math.floor(e.getMilliseconds() / w)); + if (F >= b.second)e[A.hcSetSeconds](F >= b.minute ? 0 : w * Math.floor(e.getSeconds() / w)); + if (F >= b.minute)e[A.hcSetMinutes](F >= b.hour ? 0 : w * Math.floor(e[A.hcGetMinutes]() / w)); + if (F >= b.hour)e[A.hcSetHours](F >= + b.day ? 0 : w * Math.floor(e[A.hcGetHours]() / w)); + if (F >= b.day)e[A.hcSetDate](F >= b.month ? 1 : w * Math.floor(e[A.hcGetDate]() / w)); + F >= b.month && (e[A.hcSetMonth](F >= b.year ? 0 : w * Math.floor(e[A.hcGetMonth]() / w)), z = e[A.hcGetFullYear]()); + if (F >= b.year)e[A.hcSetFullYear](z - z % w); + if (F === b.week)e[A.hcSetDate](e[A.hcGetDate]() - e[A.hcGetDay]() + d(m, 1)); + z = e[A.hcGetFullYear](); + m = e[A.hcGetMonth](); + var y = e[A.hcGetDate](), J = e[A.hcGetHours](); + if (A.hcTimezoneOffset || A.hcGetTimezoneOffset)h = (!p || !!A.hcGetTimezoneOffset) && (t - q > 4 * b.month || + l(q) !== l(t)), e = e.getTime(), e = new A(e + l(e)); + p = e.getTime(); + for (q = 1; p < t;)c.push(p), p = F === b.year ? x(z + q * w, 0) : F === b.month ? x(z, m + q * w) : !h || F !== b.day && F !== b.week ? h && F === b.hour ? x(z, m, y, J + q * w) : p + F * w : x(z, m, y + q * w * (F === b.day ? 1 : 7)), q++; + c.push(p); + F <= b.hour && 1E4 > c.length && g(c, function (a) { + 0 === a % 18E5 && "000000000" === H("%H%M%S%L", a) && (n[a] = "day") + }) + } + c.info = f(a, {higherRanks: n, totalRange: F * w}); + return c + }; + B.prototype.normalizeTimeTickInterval = function (a, d) { + var f = d || [["millisecond", [1, 2, 5, 10, 20, 25, 50, 100, 200, 500]], ["second", + [1, 2, 5, 10, 15, 30]], ["minute", [1, 2, 5, 10, 15, 30]], ["hour", [1, 2, 3, 4, 6, 8, 12]], ["day", [1, 2]], ["week", [1, 2]], ["month", [1, 2, 3, 4, 6]], ["year", null]]; + d = f[f.length - 1]; + var m = b[d[0]], c = d[1], n; + for (n = 0; n < f.length && !(d = f[n], m = b[d[0]], c = d[1], f[n + 1] && a <= (m * c[c.length - 1] + b[f[n + 1][0]]) / 2); n++); + m === b.year && a < 5 * m && (c = [1, 2, 5]); + a = q(a / m, c, "year" === d[0] ? Math.max(u(a / m), 1) : 1); + return {unitRange: m, count: a, unitName: d[0]} + } + })(L); + (function (a) { + var B = a.Axis, A = a.getMagnitude, H = a.map, G = a.normalizeTickInterval, r = a.pick; + B.prototype.getLogTickPositions = + function (a, f, u, l) { + var g = this.options, d = this.len, b = this.lin2log, p = this.log2lin, C = []; + l || (this._minorAutoInterval = null); + if (.5 <= a)a = Math.round(a), C = this.getLinearTickPositions(a, f, u); else if (.08 <= a)for (var d = Math.floor(f), t, m, c, n, E, g = .3 < a ? [1, 2, 4] : .15 < a ? [1, 2, 4, 6, 8] : [1, 2, 3, 4, 5, 6, 7, 8, 9]; d < u + 1 && !E; d++)for (m = g.length, t = 0; t < m && !E; t++)c = p(b(d) * g[t]), c > f && (!l || n <= u) && void 0 !== n && C.push(n), n > u && (E = !0), n = c; else f = b(f), u = b(u), a = g[l ? "minorTickInterval" : "tickInterval"], a = r("auto" === a ? null : a, this._minorAutoInterval, + g.tickPixelInterval / (l ? 5 : 1) * (u - f) / ((l ? d / this.tickPositions.length : d) || 1)), a = G(a, null, A(a)), C = H(this.getLinearTickPositions(a, f, u), p), l || (this._minorAutoInterval = a / 5); + l || (this.tickInterval = a); + return C + }; + B.prototype.log2lin = function (a) { + return Math.log(a) / Math.LN10 + }; + B.prototype.lin2log = function (a) { + return Math.pow(10, a) + } + })(L); + (function (a) { + var B = a.dateFormat, A = a.each, H = a.extend, G = a.format, r = a.isNumber, g = a.map, f = a.merge, u = a.pick, l = a.splat, q = a.syncTimeout, d = a.timeUnits; + a.Tooltip = function () { + this.init.apply(this, + arguments) + }; + a.Tooltip.prototype = { + init: function (a, d) { + this.chart = a; + this.options = d; + this.crosshairs = []; + this.now = {x: 0, y: 0}; + this.isHidden = !0; + this.split = d.split && !a.inverted; + this.shared = d.shared || this.split + }, cleanSplit: function (a) { + A(this.chart.series, function (b) { + var d = b && b.tt; + d && (!d.isActive || a ? b.tt = d.destroy() : d.isActive = !1) + }) + }, getLabel: function () { + var a = this.chart.renderer, d = this.options; + this.label || (this.split ? this.label = a.g("tooltip") : (this.label = a.label("", 0, 0, d.shape || "callout", null, null, d.useHTML, + null, "tooltip").attr({ + padding: d.padding, + r: d.borderRadius + }), this.label.attr({ + fill: d.backgroundColor, + "stroke-width": d.borderWidth + }).css(d.style).shadow(d.shadow)), this.label.attr({zIndex: 8}).add()); + return this.label + }, update: function (a) { + this.destroy(); + this.init(this.chart, f(!0, this.options, a)) + }, destroy: function () { + this.label && (this.label = this.label.destroy()); + this.split && this.tt && (this.cleanSplit(this.chart, !0), this.tt = this.tt.destroy()); + clearTimeout(this.hideTimer); + clearTimeout(this.tooltipTimeout) + }, + move: function (a, d, f, t) { + var b = this, c = b.now, n = !1 !== b.options.animation && !b.isHidden && (1 < Math.abs(a - c.x) || 1 < Math.abs(d - c.y)), p = b.followPointer || 1 < b.len; + H(c, { + x: n ? (2 * c.x + a) / 3 : a, + y: n ? (c.y + d) / 2 : d, + anchorX: p ? void 0 : n ? (2 * c.anchorX + f) / 3 : f, + anchorY: p ? void 0 : n ? (c.anchorY + t) / 2 : t + }); + b.getLabel().attr(c); + n && (clearTimeout(this.tooltipTimeout), this.tooltipTimeout = setTimeout(function () { + b && b.move(a, d, f, t) + }, 32)) + }, hide: function (a) { + var b = this; + clearTimeout(this.hideTimer); + a = u(a, this.options.hideDelay, 500); + this.isHidden || (this.hideTimer = + q(function () { + b.getLabel()[a ? "fadeOut" : "hide"](); + b.isHidden = !0 + }, a)) + }, getAnchor: function (a, d) { + var b, f = this.chart, m = f.inverted, c = f.plotTop, n = f.plotLeft, p = 0, z = 0, e, x; + a = l(a); + b = a[0].tooltipPos; + this.followPointer && d && (void 0 === d.chartX && (d = f.pointer.normalize(d)), b = [d.chartX - f.plotLeft, d.chartY - c]); + b || (A(a, function (a) { + e = a.series.yAxis; + x = a.series.xAxis; + p += a.plotX + (!m && x ? x.left - n : 0); + z += (a.plotLow ? (a.plotLow + a.plotHigh) / 2 : a.plotY) + (!m && e ? e.top - c : 0) + }), p /= a.length, z /= a.length, b = [m ? f.plotWidth - z : p, this.shared && !m && 1 < a.length && d ? d.chartY - c : m ? f.plotHeight - p : z]); + return g(b, Math.round) + }, getPosition: function (a, d, f) { + var b = this.chart, m = this.distance, c = {}, n = f.h || 0, p, z = ["y", b.chartHeight, d, f.plotY + b.plotTop, b.plotTop, b.plotTop + b.plotHeight], e = ["x", b.chartWidth, a, f.plotX + b.plotLeft, b.plotLeft, b.plotLeft + b.plotWidth], x = !this.followPointer && u(f.ttBelow, !b.inverted === !!f.negative), g = function (a, b, e, h, d, f) { + var k = e < h - m, y = h + m + e < b, p = h - m - e; + h += m; + if (x && y)c[a] = h; else if (!x && k)c[a] = p; else if (k)c[a] = Math.min(f - e, 0 > p - n ? p : p - n); + else if (y)c[a] = Math.max(d, h + n + e > b ? h : h + n); else return !1 + }, w = function (a, b, e, h) { + var k; + h < m || h > b - m ? k = !1 : c[a] = h < e / 2 ? 1 : h > b - e / 2 ? b - e - 2 : h - e / 2; + return k + }, h = function (a) { + var b = z; + z = e; + e = b; + p = a + }, y = function () { + !1 !== g.apply(0, z) ? !1 !== w.apply(0, e) || p || (h(!0), y()) : p ? c.x = c.y = 0 : (h(!0), y()) + }; + (b.inverted || 1 < this.len) && h(); + y(); + return c + }, defaultFormatter: function (a) { + var b = this.points || l(this), d; + d = [a.tooltipFooterHeaderFormatter(b[0])]; + d = d.concat(a.bodyFormatter(b)); + d.push(a.tooltipFooterHeaderFormatter(b[0], !0)); + return d + }, refresh: function (a, + d) { + var b = this.chart, f, m = this.options, c, n, p = {}, z = []; + f = m.formatter || this.defaultFormatter; + var p = b.hoverPoints, e = this.shared; + clearTimeout(this.hideTimer); + this.followPointer = l(a)[0].series.tooltipOptions.followPointer; + n = this.getAnchor(a, d); + d = n[0]; + c = n[1]; + !e || a.series && a.series.noSharedTooltip ? p = a.getLabelConfig() : (b.hoverPoints = a, p && A(p, function (a) { + a.setState() + }), A(a, function (a) { + a.setState("hover"); + z.push(a.getLabelConfig()) + }), p = {x: a[0].category, y: a[0].y}, p.points = z, a = a[0]); + this.len = z.length; + p = f.call(p, + this); + e = a.series; + this.distance = u(e.tooltipOptions.distance, 16); + !1 === p ? this.hide() : (f = this.getLabel(), this.isHidden && f.attr({opacity: 1}).show(), this.split ? this.renderSplit(p, b.hoverPoints) : (f.attr({text: p && p.join ? p.join("") : p}), f.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-" + u(a.colorIndex, e.colorIndex)), f.attr({stroke: m.borderColor || a.color || e.color || "#666666"}), this.updatePosition({ + plotX: d, + plotY: c, + negative: a.negative, + ttBelow: a.ttBelow, + h: n[2] || 0 + })), this.isHidden = !1) + }, renderSplit: function (b, + d) { + var f = this, p = [], m = this.chart, c = m.renderer, n = !0, g = this.options, z, e = this.getLabel(); + A(b.slice(0, d.length + 1), function (a, b) { + b = d[b - 1] || {isHeader: !0, plotX: d[0].plotX}; + var x = b.series || f, h = x.tt, y = b.series || {}, t = "highcharts-color-" + u(b.colorIndex, y.colorIndex, "none"); + h || (x.tt = h = c.label(null, null, null, "callout").addClass("highcharts-tooltip-box " + t).attr({ + padding: g.padding, + r: g.borderRadius, + fill: g.backgroundColor, + stroke: b.color || y.color || "#333333", + "stroke-width": g.borderWidth + }).add(e)); + h.isActive = !0; + h.attr({text: a}); + h.css(g.style); + a = h.getBBox(); + y = a.width + h.strokeWidth(); + b.isHeader ? (z = a.height, y = Math.max(0, Math.min(b.plotX + m.plotLeft - y / 2, m.chartWidth - y))) : y = b.plotX + m.plotLeft - u(g.distance, 16) - y; + 0 > y && (n = !1); + a = (b.series && b.series.yAxis && b.series.yAxis.pos) + (b.plotY || 0); + a -= m.plotTop; + p.push({ + target: b.isHeader ? m.plotHeight + z : a, + rank: b.isHeader ? 1 : 0, + size: x.tt.getBBox().height + 1, + point: b, + x: y, + tt: h + }) + }); + this.cleanSplit(); + a.distribute(p, m.plotHeight + z); + A(p, function (a) { + var b = a.point, c = b.series; + a.tt.attr({ + visibility: void 0 === + a.pos ? "hidden" : "inherit", + x: n || b.isHeader ? a.x : b.plotX + m.plotLeft + u(g.distance, 16), + y: a.pos + m.plotTop, + anchorX: b.isHeader ? b.plotX + m.plotLeft : b.plotX + c.xAxis.pos, + anchorY: b.isHeader ? a.pos + m.plotTop - 15 : b.plotY + c.yAxis.pos + }) + }) + }, updatePosition: function (a) { + var b = this.chart, d = this.getLabel(), d = (this.options.positioner || this.getPosition).call(this, d.width, d.height, a); + this.move(Math.round(d.x), Math.round(d.y || 0), a.plotX + b.plotLeft, a.plotY + b.plotTop) + }, getDateFormat: function (a, f, g, t) { + var b = B("%m-%d %H:%M:%S.%L", + f), c, n, p = {millisecond: 15, second: 12, minute: 9, hour: 6, day: 3}, z = "millisecond"; + for (n in d) { + if (a === d.week && +B("%w", f) === g && "00:00:00.000" === b.substr(6)) { + n = "week"; + break + } + if (d[n] > a) { + n = z; + break + } + if (p[n] && b.substr(p[n]) !== "01-01 00:00:00.000".substr(p[n]))break; + "week" !== n && (z = n) + } + n && (c = t[n]); + return c + }, getXDateFormat: function (a, d, f) { + d = d.dateTimeLabelFormats; + var b = f && f.closestPointRange; + return (b ? this.getDateFormat(b, a.x, f.options.startOfWeek, d) : d.day) || d.year + }, tooltipFooterHeaderFormatter: function (a, d) { + var b = d ? "footer" : + "header"; + d = a.series; + var f = d.tooltipOptions, m = f.xDateFormat, c = d.xAxis, n = c && "datetime" === c.options.type && r(a.key), b = f[b + "Format"]; + n && !m && (m = this.getXDateFormat(a, f, c)); + n && m && (b = b.replace("{point.key}", "{point.key:" + m + "}")); + return G(b, {point: a, series: d}) + }, bodyFormatter: function (a) { + return g(a, function (a) { + var b = a.series.tooltipOptions; + return (b.pointFormatter || a.point.tooltipFormatter).call(a.point, b.pointFormat) + }) + } + } + })(L); + (function (a) { + var B = a.addEvent, A = a.attr, H = a.charts, G = a.color, r = a.css, g = a.defined, f = + a.doc, u = a.each, l = a.extend, q = a.fireEvent, d = a.offset, b = a.pick, p = a.removeEvent, C = a.splat, t = a.Tooltip, m = a.win; + a.Pointer = function (a, b) { + this.init(a, b) + }; + a.Pointer.prototype = { + init: function (a, d) { + this.options = d; + this.chart = a; + this.runChartClick = d.chart.events && !!d.chart.events.click; + this.pinchDown = []; + this.lastValidTouch = {}; + t && d.tooltip.enabled && (a.tooltip = new t(a, d.tooltip), this.followTouchMove = b(d.tooltip.followTouchMove, !0)); + this.setDOMEvents() + }, zoomOption: function (a) { + var c = this.chart, d = c.options.chart, m = d.zoomType || + "", c = c.inverted; + /touch/.test(a.type) && (m = b(d.pinchType, m)); + this.zoomX = a = /x/.test(m); + this.zoomY = m = /y/.test(m); + this.zoomHor = a && !c || m && c; + this.zoomVert = m && !c || a && c; + this.hasZoom = a || m + }, normalize: function (a, b) { + var c, n; + a = a || m.event; + a.target || (a.target = a.srcElement); + n = a.touches ? a.touches.length ? a.touches.item(0) : a.changedTouches[0] : a; + b || (this.chartPosition = b = d(this.chart.container)); + void 0 === n.pageX ? (c = Math.max(a.x, a.clientX - b.left), b = a.y) : (c = n.pageX - b.left, b = n.pageY - b.top); + return l(a, { + chartX: Math.round(c), + chartY: Math.round(b) + }) + }, getCoordinates: function (a) { + var b = {xAxis: [], yAxis: []}; + u(this.chart.axes, function (c) { + b[c.isXAxis ? "xAxis" : "yAxis"].push({axis: c, value: c.toValue(a[c.horiz ? "chartX" : "chartY"])}) + }); + return b + }, runPointActions: function (c) { + var d = this.chart, m = d.series, p = d.tooltip, e = p ? p.shared : !1, g = !0, t = d.hoverPoint, w = d.hoverSeries, h, y, l, q = [], r; + if (!e && !w)for (h = 0; h < m.length; h++)if (m[h].directTouch || !m[h].options.stickyTracking)m = []; + w && (e ? w.noSharedTooltip : w.directTouch) && t ? q = [t] : (e || !w || w.options.stickyTracking || + (m = [w]), u(m, function (a) { + y = a.noSharedTooltip && e; + l = !e && a.directTouch; + a.visible && !y && !l && b(a.options.enableMouseTracking, !0) && (r = a.searchPoint(c, !y && 1 === a.kdDimensions)) && r.series && q.push(r) + }), q.sort(function (a, b) { + var c = a.distX - b.distX, h = a.dist - b.dist, k = (b.series.group && b.series.group.zIndex) - (a.series.group && a.series.group.zIndex); + return 0 !== c && e ? c : 0 !== h ? h : 0 !== k ? k : a.series.index > b.series.index ? -1 : 1 + })); + if (e)for (h = q.length; h--;)(q[h].x !== q[0].x || q[h].series.noSharedTooltip) && q.splice(h, 1); + if (q[0] && (q[0] !== + this.prevKDPoint || p && p.isHidden)) { + if (e && !q[0].series.noSharedTooltip) { + for (h = 0; h < q.length; h++)q[h].onMouseOver(c, q[h] !== (w && w.directTouch && t || q[0])); + q.length && p && p.refresh(q.sort(function (a, b) { + return a.series.index - b.series.index + }), c) + } else if (p && p.refresh(q[0], c), !w || !w.directTouch)q[0].onMouseOver(c); + this.prevKDPoint = q[0]; + g = !1 + } + g && (m = w && w.tooltipOptions.followPointer, p && m && !p.isHidden && (m = p.getAnchor([{}], c), p.updatePosition({ + plotX: m[0], + plotY: m[1] + }))); + this.unDocMouseMove || (this.unDocMouseMove = B(f, + "mousemove", function (b) { + if (H[a.hoverChartIndex])H[a.hoverChartIndex].pointer.onDocumentMouseMove(b) + })); + u(e ? q : [b(t, q[0])], function (a) { + u(d.axes, function (b) { + (!a || a.series && a.series[b.coll] === b) && b.drawCrosshair(c, a) + }) + }) + }, reset: function (a, b) { + var c = this.chart, d = c.hoverSeries, e = c.hoverPoint, n = c.hoverPoints, m = c.tooltip, f = m && m.shared ? n : e; + a && f && u(C(f), function (b) { + b.series.isCartesian && void 0 === b.plotX && (a = !1) + }); + if (a)m && f && (m.refresh(f), e && (e.setState(e.state, !0), u(c.axes, function (a) { + a.crosshair && a.drawCrosshair(null, + e) + }))); else { + if (e)e.onMouseOut(); + n && u(n, function (a) { + a.setState() + }); + if (d)d.onMouseOut(); + m && m.hide(b); + this.unDocMouseMove && (this.unDocMouseMove = this.unDocMouseMove()); + u(c.axes, function (a) { + a.hideCrosshair() + }); + this.hoverX = this.prevKDPoint = c.hoverPoints = c.hoverPoint = null + } + }, scaleGroups: function (a, b) { + var c = this.chart, d; + u(c.series, function (e) { + d = a || e.getPlotBox(); + e.xAxis && e.xAxis.zoomEnabled && e.group && (e.group.attr(d), e.markerGroup && (e.markerGroup.attr(d), e.markerGroup.clip(b ? c.clipRect : null)), e.dataLabelsGroup && + e.dataLabelsGroup.attr(d)) + }); + c.clipRect.attr(b || c.clipBox) + }, dragStart: function (a) { + var b = this.chart; + b.mouseIsDown = a.type; + b.cancelClick = !1; + b.mouseDownX = this.mouseDownX = a.chartX; + b.mouseDownY = this.mouseDownY = a.chartY + }, drag: function (a) { + var b = this.chart, c = b.options.chart, d = a.chartX, e = a.chartY, m = this.zoomHor, f = this.zoomVert, p = b.plotLeft, h = b.plotTop, y = b.plotWidth, g = b.plotHeight, t, q = this.selectionMarker, k = this.mouseDownX, l = this.mouseDownY, r = c.panKey && a[c.panKey + "Key"]; + q && q.touch || (d < p ? d = p : d > p + y && (d = p + y), e < + h ? e = h : e > h + g && (e = h + g), this.hasDragged = Math.sqrt(Math.pow(k - d, 2) + Math.pow(l - e, 2)), 10 < this.hasDragged && (t = b.isInsidePlot(k - p, l - h), b.hasCartesianSeries && (this.zoomX || this.zoomY) && t && !r && !q && (this.selectionMarker = q = b.renderer.rect(p, h, m ? 1 : y, f ? 1 : g, 0).attr({ + fill: c.selectionMarkerFill || G("#335cad").setOpacity(.25).get(), + "class": "highcharts-selection-marker", + zIndex: 7 + }).add()), q && m && (d -= k, q.attr({ + width: Math.abs(d), + x: (0 < d ? 0 : d) + k + })), q && f && (d = e - l, q.attr({ + height: Math.abs(d), + y: (0 < d ? 0 : d) + l + })), t && !q && c.panning && b.pan(a, + c.panning))) + }, drop: function (a) { + var b = this, c = this.chart, d = this.hasPinched; + if (this.selectionMarker) { + var e = { + originalEvent: a, + xAxis: [], + yAxis: [] + }, m = this.selectionMarker, f = m.attr ? m.attr("x") : m.x, p = m.attr ? m.attr("y") : m.y, h = m.attr ? m.attr("width") : m.width, y = m.attr ? m.attr("height") : m.height, t; + if (this.hasDragged || d)u(c.axes, function (c) { + if (c.zoomEnabled && g(c.min) && (d || b[{xAxis: "zoomX", yAxis: "zoomY"}[c.coll]])) { + var m = c.horiz, k = "touchend" === a.type ? c.minPixelPadding : 0, n = c.toValue((m ? f : p) + k), m = c.toValue((m ? f + h : p + + y) - k); + e[c.coll].push({axis: c, min: Math.min(n, m), max: Math.max(n, m)}); + t = !0 + } + }), t && q(c, "selection", e, function (a) { + c.zoom(l(a, d ? {animation: !1} : null)) + }); + this.selectionMarker = this.selectionMarker.destroy(); + d && this.scaleGroups() + } + c && (r(c.container, {cursor: c._cursor}), c.cancelClick = 10 < this.hasDragged, c.mouseIsDown = this.hasDragged = this.hasPinched = !1, this.pinchDown = []) + }, onContainerMouseDown: function (a) { + a = this.normalize(a); + this.zoomOption(a); + a.preventDefault && a.preventDefault(); + this.dragStart(a) + }, onDocumentMouseUp: function (b) { + H[a.hoverChartIndex] && + H[a.hoverChartIndex].pointer.drop(b) + }, onDocumentMouseMove: function (a) { + var b = this.chart, c = this.chartPosition; + a = this.normalize(a, c); + !c || this.inClass(a.target, "highcharts-tracker") || b.isInsidePlot(a.chartX - b.plotLeft, a.chartY - b.plotTop) || this.reset() + }, onContainerMouseLeave: function (b) { + var c = H[a.hoverChartIndex]; + c && (b.relatedTarget || b.toElement) && (c.pointer.reset(), c.pointer.chartPosition = null) + }, onContainerMouseMove: function (b) { + var c = this.chart; + g(a.hoverChartIndex) && H[a.hoverChartIndex] && H[a.hoverChartIndex].mouseIsDown || + (a.hoverChartIndex = c.index); + b = this.normalize(b); + b.returnValue = !1; + "mousedown" === c.mouseIsDown && this.drag(b); + !this.inClass(b.target, "highcharts-tracker") && !c.isInsidePlot(b.chartX - c.plotLeft, b.chartY - c.plotTop) || c.openMenu || this.runPointActions(b) + }, inClass: function (a, b) { + for (var c; a;) { + if (c = A(a, "class")) { + if (-1 !== c.indexOf(b))return !0; + if (-1 !== c.indexOf("highcharts-container"))return !1 + } + a = a.parentNode + } + }, onTrackerMouseOut: function (a) { + var b = this.chart.hoverSeries; + a = a.relatedTarget || a.toElement; + if (!(!b || !a || + b.options.stickyTracking || this.inClass(a, "highcharts-tooltip") || this.inClass(a, "highcharts-series-" + b.index) && this.inClass(a, "highcharts-tracker")))b.onMouseOut() + }, onContainerClick: function (a) { + var b = this.chart, c = b.hoverPoint, d = b.plotLeft, e = b.plotTop; + a = this.normalize(a); + b.cancelClick || (c && this.inClass(a.target, "highcharts-tracker") ? (q(c.series, "click", l(a, {point: c})), b.hoverPoint && c.firePointEvent("click", a)) : (l(a, this.getCoordinates(a)), b.isInsidePlot(a.chartX - d, a.chartY - e) && q(b, "click", a))) + }, setDOMEvents: function () { + var b = + this, d = b.chart.container; + d.onmousedown = function (a) { + b.onContainerMouseDown(a) + }; + d.onmousemove = function (a) { + b.onContainerMouseMove(a) + }; + d.onclick = function (a) { + b.onContainerClick(a) + }; + B(d, "mouseleave", b.onContainerMouseLeave); + 1 === a.chartCount && B(f, "mouseup", b.onDocumentMouseUp); + a.hasTouch && (d.ontouchstart = function (a) { + b.onContainerTouchStart(a) + }, d.ontouchmove = function (a) { + b.onContainerTouchMove(a) + }, 1 === a.chartCount && B(f, "touchend", b.onDocumentTouchEnd)) + }, destroy: function () { + var b; + p(this.chart.container, "mouseleave", + this.onContainerMouseLeave); + a.chartCount || (p(f, "mouseup", this.onDocumentMouseUp), p(f, "touchend", this.onDocumentTouchEnd)); + clearInterval(this.tooltipTimeout); + for (b in this)this[b] = null + } + } + })(L); + (function (a) { + var B = a.charts, A = a.each, H = a.extend, G = a.map, r = a.noop, g = a.pick; + H(a.Pointer.prototype, { + pinchTranslate: function (a, g, l, q, d, b) { + this.zoomHor && this.pinchTranslateDirection(!0, a, g, l, q, d, b); + this.zoomVert && this.pinchTranslateDirection(!1, a, g, l, q, d, b) + }, pinchTranslateDirection: function (a, g, l, q, d, b, p, r) { + var f = + this.chart, m = a ? "x" : "y", c = a ? "X" : "Y", n = "chart" + c, E = a ? "width" : "height", z = f["plot" + (a ? "Left" : "Top")], e, x, F = r || 1, w = f.inverted, h = f.bounds[a ? "h" : "v"], y = 1 === g.length, J = g[0][n], u = l[0][n], I = !y && g[1][n], k = !y && l[1][n], D; + l = function () { + !y && 20 < Math.abs(J - I) && (F = r || Math.abs(u - k) / Math.abs(J - I)); + x = (z - u) / F + J; + e = f["plot" + (a ? "Width" : "Height")] / F + }; + l(); + g = x; + g < h.min ? (g = h.min, D = !0) : g + e > h.max && (g = h.max - e, D = !0); + D ? (u -= .8 * (u - p[m][0]), y || (k -= .8 * (k - p[m][1])), l()) : p[m] = [u, k]; + w || (b[m] = x - z, b[E] = e); + b = w ? 1 / F : F; + d[E] = e; + d[m] = g; + q[w ? a ? "scaleY" : + "scaleX" : "scale" + c] = F; + q["translate" + c] = b * z + (u - b * J) + }, pinch: function (a) { + var f = this, l = f.chart, q = f.pinchDown, d = a.touches, b = d.length, p = f.lastValidTouch, C = f.hasZoom, t = f.selectionMarker, m = {}, c = 1 === b && (f.inClass(a.target, "highcharts-tracker") && l.runTrackerClick || f.runChartClick), n = {}; + 1 < b && (f.initiated = !0); + C && f.initiated && !c && a.preventDefault(); + G(d, function (a) { + return f.normalize(a) + }); + "touchstart" === a.type ? (A(d, function (a, b) { + q[b] = {chartX: a.chartX, chartY: a.chartY} + }), p.x = [q[0].chartX, q[1] && q[1].chartX], p.y = [q[0].chartY, + q[1] && q[1].chartY], A(l.axes, function (a) { + if (a.zoomEnabled) { + var b = l.bounds[a.horiz ? "h" : "v"], c = a.minPixelPadding, d = a.toPixels(g(a.options.min, a.dataMin)), m = a.toPixels(g(a.options.max, a.dataMax)), f = Math.max(d, m); + b.min = Math.min(a.pos, Math.min(d, m) - c); + b.max = Math.max(a.pos + a.len, f + c) + } + }), f.res = !0) : f.followTouchMove && 1 === b ? this.runPointActions(f.normalize(a)) : q.length && (t || (f.selectionMarker = t = H({ + destroy: r, + touch: !0 + }, l.plotBox)), f.pinchTranslate(q, d, m, t, n, p), f.hasPinched = C, f.scaleGroups(m, n), f.res && (f.res = !1, this.reset(!1, 0))) + }, touch: function (f, r) { + var l = this.chart, q, d; + if (l.index !== a.hoverChartIndex)this.onContainerMouseLeave({relatedTarget: !0}); + a.hoverChartIndex = l.index; + 1 === f.touches.length ? (f = this.normalize(f), (d = l.isInsidePlot(f.chartX - l.plotLeft, f.chartY - l.plotTop)) && !l.openMenu ? (r && this.runPointActions(f), "touchmove" === f.type && (r = this.pinchDown, q = r[0] ? 4 <= Math.sqrt(Math.pow(r[0].chartX - f.chartX, 2) + Math.pow(r[0].chartY - f.chartY, 2)) : !1), g(q, !0) && this.pinch(f)) : r && this.reset()) : 2 === f.touches.length && + this.pinch(f) + }, onContainerTouchStart: function (a) { + this.zoomOption(a); + this.touch(a, !0) + }, onContainerTouchMove: function (a) { + this.touch(a) + }, onDocumentTouchEnd: function (f) { + B[a.hoverChartIndex] && B[a.hoverChartIndex].pointer.drop(f) + } + }) + })(L); + (function (a) { + var B = a.addEvent, A = a.charts, H = a.css, G = a.doc, r = a.extend, g = a.noop, f = a.Pointer, u = a.removeEvent, l = a.win, q = a.wrap; + if (l.PointerEvent || l.MSPointerEvent) { + var d = {}, b = !!l.PointerEvent, p = function () { + var a, b = []; + b.item = function (a) { + return this[a] + }; + for (a in d)d.hasOwnProperty(a) && + b.push({pageX: d[a].pageX, pageY: d[a].pageY, target: d[a].target}); + return b + }, C = function (b, d, c, f) { + "touch" !== b.pointerType && b.pointerType !== b.MSPOINTER_TYPE_TOUCH || !A[a.hoverChartIndex] || (f(b), f = A[a.hoverChartIndex].pointer, f[d]({ + type: c, + target: b.currentTarget, + preventDefault: g, + touches: p() + })) + }; + r(f.prototype, { + onContainerPointerDown: function (a) { + C(a, "onContainerTouchStart", "touchstart", function (a) { + d[a.pointerId] = {pageX: a.pageX, pageY: a.pageY, target: a.currentTarget} + }) + }, onContainerPointerMove: function (a) { + C(a, "onContainerTouchMove", + "touchmove", function (a) { + d[a.pointerId] = {pageX: a.pageX, pageY: a.pageY}; + d[a.pointerId].target || (d[a.pointerId].target = a.currentTarget) + }) + }, onDocumentPointerUp: function (a) { + C(a, "onDocumentTouchEnd", "touchend", function (a) { + delete d[a.pointerId] + }) + }, batchMSEvents: function (a) { + a(this.chart.container, b ? "pointerdown" : "MSPointerDown", this.onContainerPointerDown); + a(this.chart.container, b ? "pointermove" : "MSPointerMove", this.onContainerPointerMove); + a(G, b ? "pointerup" : "MSPointerUp", this.onDocumentPointerUp) + } + }); + q(f.prototype, + "init", function (a, b, c) { + a.call(this, b, c); + this.hasZoom && H(b.container, {"-ms-touch-action": "none", "touch-action": "none"}) + }); + q(f.prototype, "setDOMEvents", function (a) { + a.apply(this); + (this.hasZoom || this.followTouchMove) && this.batchMSEvents(B) + }); + q(f.prototype, "destroy", function (a) { + this.batchMSEvents(u); + a.call(this) + }) + } + })(L); + (function (a) { + var B, A = a.addEvent, H = a.css, G = a.discardElement, r = a.defined, g = a.each, f = a.extend, u = a.isFirefox, l = a.marginNames, q = a.merge, d = a.pick, b = a.setAnimation, p = a.stableSort, C = a.win, t = a.wrap; + B = a.Legend = function (a, b) { + this.init(a, b) + }; + B.prototype = { + init: function (a, b) { + this.chart = a; + this.setOptions(b); + b.enabled && (this.render(), A(this.chart, "endResize", function () { + this.legend.positionCheckboxes() + })) + }, setOptions: function (a) { + var b = d(a.padding, 8); + this.options = a; + this.itemStyle = a.itemStyle; + this.itemHiddenStyle = q(this.itemStyle, a.itemHiddenStyle); + this.itemMarginTop = a.itemMarginTop || 0; + this.initialItemX = this.padding = b; + this.initialItemY = b - 5; + this.itemHeight = this.maxItemWidth = 0; + this.symbolWidth = d(a.symbolWidth, + 16); + this.pages = [] + }, update: function (a, b) { + var c = this.chart; + this.setOptions(q(!0, this.options, a)); + this.destroy(); + c.isDirtyLegend = c.isDirtyBox = !0; + d(b, !0) && c.redraw() + }, colorizeItem: function (a, b) { + a.legendGroup[b ? "removeClass" : "addClass"]("highcharts-legend-item-hidden"); + var c = this.options, d = a.legendItem, m = a.legendLine, e = a.legendSymbol, f = this.itemHiddenStyle.color, c = b ? c.itemStyle.color : f, p = b ? a.color || f : f, g = a.options && a.options.marker, h = {fill: p}, y; + d && d.css({fill: c, color: c}); + m && m.attr({stroke: p}); + if (e) { + if (g && + e.isMarker && (h = a.pointAttribs(), !b))for (y in h)h[y] = f; + e.attr(h) + } + }, positionItem: function (a) { + var b = this.options, d = b.symbolPadding, b = !b.rtl, m = a._legendItemPos, f = m[0], m = m[1], e = a.checkbox; + (a = a.legendGroup) && a.element && a.translate(b ? f : this.legendWidth - f - 2 * d - 4, m); + e && (e.x = f, e.y = m) + }, destroyItem: function (a) { + var b = a.checkbox; + g(["legendItem", "legendLine", "legendSymbol", "legendGroup"], function (b) { + a[b] && (a[b] = a[b].destroy()) + }); + b && G(a.checkbox) + }, destroy: function () { + function a(a) { + this[a] && (this[a] = this[a].destroy()) + } + + g(this.getAllItems(), function (b) { + g(["legendItem", "legendGroup"], a, b) + }); + g(["box", "title", "group"], a, this); + this.display = null + }, positionCheckboxes: function (a) { + var b = this.group && this.group.alignAttr, d, m = this.clipHeight || this.legendHeight, f = this.titleHeight; + b && (d = b.translateY, g(this.allItems, function (c) { + var e = c.checkbox, n; + e && (n = d + f + e.y + (a || 0) + 3, H(e, { + left: b.translateX + c.checkboxOffset + e.x - 20 + "px", + top: n + "px", + display: n > d - 6 && n < d + m - 6 ? "" : "none" + })) + })) + }, renderTitle: function () { + var a = this.padding, b = this.options.title, + d = 0; + b.text && (this.title || (this.title = this.chart.renderer.label(b.text, a - 3, a - 4, null, null, null, null, null, "legend-title").attr({zIndex: 1}).css(b.style).add(this.group)), a = this.title.getBBox(), d = a.height, this.offsetWidth = a.width, this.contentGroup.attr({translateY: d})); + this.titleHeight = d + }, setText: function (b) { + var c = this.options; + b.legendItem.attr({text: c.labelFormat ? a.format(c.labelFormat, b) : c.labelFormatter.call(b)}) + }, renderItem: function (a) { + var b = this.chart, f = b.renderer, m = this.options, p = "horizontal" === + m.layout, e = this.symbolWidth, g = m.symbolPadding, l = this.itemStyle, t = this.itemHiddenStyle, h = this.padding, y = p ? d(m.itemDistance, 20) : 0, J = !m.rtl, r = m.width, I = m.itemMarginBottom || 0, k = this.itemMarginTop, u = this.initialItemX, C = a.legendItem, N = !a.series, A = !N && a.series.drawLegendSymbol ? a.series : a, B = A.options, B = this.createCheckboxForItem && B && B.showCheckbox, v = m.useHTML; + C || (a.legendGroup = f.g("legend-item").addClass("highcharts-" + A.type + "-series highcharts-color-" + a.colorIndex + (a.options.className ? " " + a.options.className : + "") + (N ? " highcharts-series-" + a.index : "")).attr({zIndex: 1}).add(this.scrollGroup), a.legendItem = C = f.text("", J ? e + g : -g, this.baseline || 0, v).css(q(a.visible ? l : t)).attr({ + align: J ? "left" : "right", + zIndex: 2 + }).add(a.legendGroup), this.baseline || (l = l.fontSize, this.fontMetrics = f.fontMetrics(l, C), this.baseline = this.fontMetrics.f + 3 + k, C.attr("y", this.baseline)), this.symbolHeight = m.symbolHeight || this.fontMetrics.f, A.drawLegendSymbol(this, a), this.setItemEvents && this.setItemEvents(a, C, v), B && this.createCheckboxForItem(a)); + this.colorizeItem(a, a.visible); + this.setText(a); + f = C.getBBox(); + e = a.checkboxOffset = m.itemWidth || a.legendItemWidth || e + g + f.width + y + (B ? 20 : 0); + this.itemHeight = g = Math.round(a.legendItemHeight || f.height); + p && this.itemX - u + e > (r || b.chartWidth - 2 * h - u - m.x) && (this.itemX = u, this.itemY += k + this.lastLineHeight + I, this.lastLineHeight = 0); + this.maxItemWidth = Math.max(this.maxItemWidth, e); + this.lastItemY = k + this.itemY + I; + this.lastLineHeight = Math.max(g, this.lastLineHeight); + a._legendItemPos = [this.itemX, this.itemY]; + p ? this.itemX += e : + (this.itemY += k + g + I, this.lastLineHeight = g); + this.offsetWidth = r || Math.max((p ? this.itemX - u - y : e) + h, this.offsetWidth) + }, getAllItems: function () { + var a = []; + g(this.chart.series, function (b) { + var c = b && b.options; + b && d(c.showInLegend, r(c.linkedTo) ? !1 : void 0, !0) && (a = a.concat(b.legendItems || ("point" === c.legendType ? b.data : b))) + }); + return a + }, adjustMargins: function (a, b) { + var c = this.chart, f = this.options, m = f.align.charAt(0) + f.verticalAlign.charAt(0) + f.layout.charAt(0); + f.floating || g([/(lth|ct|rth)/, /(rtv|rm|rbv)/, /(rbh|cb|lbh)/, + /(lbv|lm|ltv)/], function (e, n) { + e.test(m) && !r(a[n]) && (c[l[n]] = Math.max(c[l[n]], c.legend[(n + 1) % 2 ? "legendHeight" : "legendWidth"] + [1, -1, -1, 1][n] * f[n % 2 ? "x" : "y"] + d(f.margin, 12) + b[n])) + }) + }, render: function () { + var a = this, b = a.chart, d = b.renderer, q = a.group, l, e, t, r, w = a.box, h = a.options, y = a.padding; + a.itemX = a.initialItemX; + a.itemY = a.initialItemY; + a.offsetWidth = 0; + a.lastItemY = 0; + q || (a.group = q = d.g("legend").attr({zIndex: 7}).add(), a.contentGroup = d.g().attr({zIndex: 1}).add(q), a.scrollGroup = d.g().add(a.contentGroup)); + a.renderTitle(); + l = a.getAllItems(); + p(l, function (a, b) { + return (a.options && a.options.legendIndex || 0) - (b.options && b.options.legendIndex || 0) + }); + h.reversed && l.reverse(); + a.allItems = l; + a.display = e = !!l.length; + a.lastLineHeight = 0; + g(l, function (b) { + a.renderItem(b) + }); + t = (h.width || a.offsetWidth) + y; + r = a.lastItemY + a.lastLineHeight + a.titleHeight; + r = a.handleOverflow(r); + r += y; + w || (a.box = w = d.rect().addClass("highcharts-legend-box").attr({r: h.borderRadius}).add(q), w.isNew = !0); + w.attr({ + stroke: h.borderColor, "stroke-width": h.borderWidth || 0, fill: h.backgroundColor || + "none" + }).shadow(h.shadow); + 0 < t && 0 < r && (w[w.isNew ? "attr" : "animate"](w.crisp({ + x: 0, + y: 0, + width: t, + height: r + }, w.strokeWidth())), w.isNew = !1); + w[e ? "show" : "hide"](); + a.legendWidth = t; + a.legendHeight = r; + g(l, function (b) { + a.positionItem(b) + }); + e && q.align(f({width: t, height: r}, h), !0, "spacingBox"); + b.isResizing || this.positionCheckboxes() + }, handleOverflow: function (a) { + var b = this, f = this.chart, m = f.renderer, p = this.options, e = p.y, f = f.spacingBox.height + ("top" === p.verticalAlign ? -e : e) - this.padding, e = p.maxHeight, q, l = this.clipRect, t = p.navigation, + h = d(t.animation, !0), y = t.arrowSize || 12, r = this.nav, u = this.pages, I = this.padding, k, D = this.allItems, C = function (a) { + a ? l.attr({height: a}) : l && (b.clipRect = l.destroy(), b.contentGroup.clip()); + b.contentGroup.div && (b.contentGroup.div.style.clip = a ? "rect(" + I + "px,9999px," + (I + a) + "px,0)" : "auto") + }; + "horizontal" !== p.layout || "middle" === p.verticalAlign || p.floating || (f /= 2); + e && (f = Math.min(f, e)); + u.length = 0; + a > f && !1 !== t.enabled ? (this.clipHeight = q = Math.max(f - 20 - this.titleHeight - I, 0), this.currentPage = d(this.currentPage, 1), this.fullHeight = + a, g(D, function (a, b) { + var c = a._legendItemPos[1]; + a = Math.round(a.legendItem.getBBox().height); + var e = u.length; + if (!e || c - u[e - 1] > q && (k || c) !== u[e - 1])u.push(k || c), e++; + b === D.length - 1 && c + a - u[e - 1] > q && u.push(c); + c !== k && (k = c) + }), l || (l = b.clipRect = m.clipRect(0, I, 9999, 0), b.contentGroup.clip(l)), C(q), r || (this.nav = r = m.g().attr({zIndex: 1}).add(this.group), this.up = m.symbol("triangle", 0, 0, y, y).on("click", function () { + b.scroll(-1, h) + }).add(r), this.pager = m.text("", 15, 10).addClass("highcharts-legend-navigation").css(t.style).add(r), + this.down = m.symbol("triangle-down", 0, 0, y, y).on("click", function () { + b.scroll(1, h) + }).add(r)), b.scroll(0), a = f) : r && (C(), r.hide(), this.scrollGroup.attr({translateY: 1}), this.clipHeight = 0); + return a + }, scroll: function (a, c) { + var d = this.pages, f = d.length; + a = this.currentPage + a; + var m = this.clipHeight, e = this.options.navigation, p = this.pager, g = this.padding; + a > f && (a = f); + 0 < a && (void 0 !== c && b(c, this.chart), this.nav.attr({ + translateX: g, + translateY: m + this.padding + 7 + this.titleHeight, + visibility: "visible" + }), this.up.attr({ + "class": 1 === + a ? "highcharts-legend-nav-inactive" : "highcharts-legend-nav-active" + }), p.attr({text: a + "/" + f}), this.down.attr({ + x: 18 + this.pager.getBBox().width, + "class": a === f ? "highcharts-legend-nav-inactive" : "highcharts-legend-nav-active" + }), this.up.attr({fill: 1 === a ? e.inactiveColor : e.activeColor}).css({cursor: 1 === a ? "default" : "pointer"}), this.down.attr({fill: a === f ? e.inactiveColor : e.activeColor}).css({cursor: a === f ? "default" : "pointer"}), c = -d[a - 1] + this.initialItemY, this.scrollGroup.animate({translateY: c}), this.currentPage = + a, this.positionCheckboxes(c)) + } + }; + a.LegendSymbolMixin = { + drawRectangle: function (a, b) { + var c = a.symbolHeight, f = a.options.squareSymbol; + b.legendSymbol = this.chart.renderer.rect(f ? (a.symbolWidth - c) / 2 : 0, a.baseline - c + 1, f ? c : a.symbolWidth, c, d(a.options.symbolRadius, c / 2)).addClass("highcharts-point").attr({zIndex: 3}).add(b.legendGroup) + }, drawLineMarker: function (a) { + var b = this.options, f = b.marker, m = a.symbolWidth, p = a.symbolHeight, e = p / 2, g = this.chart.renderer, l = this.legendGroup; + a = a.baseline - Math.round(.3 * a.fontMetrics.b); + var t; + t = {"stroke-width": b.lineWidth || 0}; + b.dashStyle && (t.dashstyle = b.dashStyle); + this.legendLine = g.path(["M", 0, a, "L", m, a]).addClass("highcharts-graph").attr(t).add(l); + f && !1 !== f.enabled && (b = Math.min(d(f.radius, e), e), 0 === this.symbol.indexOf("url") && (f = q(f, { + width: p, + height: p + }), b = 0), this.legendSymbol = f = g.symbol(this.symbol, m / 2 - b, a - b, 2 * b, 2 * b, f).addClass("highcharts-point").add(l), f.isMarker = !0) + } + }; + (/Trident\/7\.0/.test(C.navigator.userAgent) || u) && t(B.prototype, "positionItem", function (a, b) { + var c = this, d = function () { + b._legendItemPos && + a.call(c, b) + }; + d(); + setTimeout(d) + }) + })(L); + (function (a) { + var B = a.addEvent, A = a.animate, H = a.animObject, G = a.attr, r = a.doc, g = a.Axis, f = a.createElement, u = a.defaultOptions, l = a.discardElement, q = a.charts, d = a.css, b = a.defined, p = a.each, C = a.extend, t = a.find, m = a.fireEvent, c = a.getStyle, n = a.grep, E = a.isNumber, z = a.isObject, e = a.isString, x = a.Legend, F = a.marginNames, w = a.merge, h = a.Pointer, y = a.pick, J = a.pInt, K = a.removeEvent, I = a.seriesTypes, k = a.splat, D = a.svg, P = a.syncTimeout, N = a.win, S = a.Renderer, O = a.Chart = function () { + this.getArgs.apply(this, + arguments) + }; + a.chart = function (a, b, c) { + return new O(a, b, c) + }; + O.prototype = { + callbacks: [], getArgs: function () { + var a = [].slice.call(arguments); + if (e(a[0]) || a[0].nodeName)this.renderTo = a.shift(); + this.init(a[0], a[1]) + }, init: function (b, c) { + var e, h = b.series; + b.series = null; + e = w(u, b); + e.series = b.series = h; + this.userOptions = b; + this.respRules = []; + b = e.chart; + h = b.events; + this.margin = []; + this.spacing = []; + this.bounds = {h: {}, v: {}}; + this.callback = c; + this.isResizing = 0; + this.options = e; + this.axes = []; + this.series = []; + this.hasCartesianSeries = b.showAxes; + var d; + this.index = q.length; + q.push(this); + a.chartCount++; + if (h)for (d in h)B(this, d, h[d]); + this.xAxis = []; + this.yAxis = []; + this.pointCount = this.colorCounter = this.symbolCounter = 0; + this.firstRender() + }, initSeries: function (b) { + var c = this.options.chart; + (c = I[b.type || c.type || c.defaultSeriesType]) || a.error(17, !0); + c = new c; + c.init(this, b); + return c + }, orderSeries: function (a) { + var b = this.series; + for (a = a || 0; a < b.length; a++)b[a] && (b[a].index = a, b[a].name = b[a].name || "Series " + (b[a].index + 1)) + }, isInsidePlot: function (a, b, c) { + var e = c ? + b : a; + a = c ? a : b; + return 0 <= e && e <= this.plotWidth && 0 <= a && a <= this.plotHeight + }, redraw: function (b) { + var c = this.axes, e = this.series, h = this.pointer, d = this.legend, k = this.isDirtyLegend, f, n, y = this.hasCartesianSeries, g = this.isDirtyBox, v = e.length, l = v, q = this.renderer, t = q.isHidden(), w = []; + this.setResponsive && this.setResponsive(!1); + a.setAnimation(b, this); + t && this.cloneRenderTo(); + for (this.layOutTitles(); l--;)if (b = e[l], b.options.stacking && (f = !0, b.isDirty)) { + n = !0; + break + } + if (n)for (l = v; l--;)b = e[l], b.options.stacking && (b.isDirty = !0); + p(e, function (a) { + a.isDirty && "point" === a.options.legendType && (a.updateTotals && a.updateTotals(), k = !0); + a.isDirtyData && m(a, "updatedData") + }); + k && d.options.enabled && (d.render(), this.isDirtyLegend = !1); + f && this.getStacks(); + y && p(c, function (a) { + a.updateNames(); + a.setScale() + }); + this.getMargins(); + y && (p(c, function (a) { + a.isDirty && (g = !0) + }), p(c, function (a) { + var b = a.min + "," + a.max; + a.extKey !== b && (a.extKey = b, w.push(function () { + m(a, "afterSetExtremes", C(a.eventArgs, a.getExtremes())); + delete a.eventArgs + })); + (g || f) && a.redraw() + })); + g && this.drawChartBox(); + m(this, "predraw"); + p(e, function (a) { + (g || a.isDirty) && a.visible && a.redraw(); + a.isDirtyData = !1 + }); + h && h.reset(!0); + q.draw(); + m(this, "redraw"); + m(this, "render"); + t && this.cloneRenderTo(!0); + p(w, function (a) { + a.call() + }) + }, get: function (a) { + function b(b) { + return b.id === a || b.options && b.options.id === a + } + + var c, e = this.series, h; + c = t(this.axes, b) || t(this.series, b); + for (h = 0; !c && h < e.length; h++)c = t(e[h].points || [], b); + return c + }, getAxes: function () { + var a = this, b = this.options, c = b.xAxis = k(b.xAxis || {}), b = b.yAxis = k(b.yAxis || + {}); + p(c, function (a, b) { + a.index = b; + a.isX = !0 + }); + p(b, function (a, b) { + a.index = b + }); + c = c.concat(b); + p(c, function (b) { + new g(a, b) + }) + }, getSelectedPoints: function () { + var a = []; + p(this.series, function (b) { + a = a.concat(n(b.points || [], function (a) { + return a.selected + })) + }); + return a + }, getSelectedSeries: function () { + return n(this.series, function (a) { + return a.selected + }) + }, setTitle: function (a, b, c) { + var e = this, h = e.options, d; + d = h.title = w({style: {color: "#333333", fontSize: h.isStock ? "16px" : "18px"}}, h.title, a); + h = h.subtitle = w({style: {color: "#666666"}}, + h.subtitle, b); + p([["title", a, d], ["subtitle", b, h]], function (a, b) { + var c = a[0], h = e[c], d = a[1]; + a = a[2]; + h && d && (e[c] = h = h.destroy()); + a && a.text && !h && (e[c] = e.renderer.text(a.text, 0, 0, a.useHTML).attr({ + align: a.align, + "class": "highcharts-" + c, + zIndex: a.zIndex || 4 + }).add(), e[c].update = function (a) { + e.setTitle(!b && a, b && a) + }, e[c].css(a.style)) + }); + e.layOutTitles(c) + }, layOutTitles: function (a) { + var b = 0, c, e = this.renderer, h = this.spacingBox; + p(["title", "subtitle"], function (a) { + var c = this[a], d = this.options[a], k; + c && (k = d.style.fontSize, + k = e.fontMetrics(k, c).b, c.css({width: (d.width || h.width + d.widthAdjust) + "px"}).align(C({y: b + k + ("title" === a ? -3 : 2)}, d), !1, "spacingBox"), d.floating || d.verticalAlign || (b = Math.ceil(b + c.getBBox().height))) + }, this); + c = this.titleOffset !== b; + this.titleOffset = b; + !this.isDirtyBox && c && (this.isDirtyBox = c, this.hasRendered && y(a, !0) && this.isDirtyBox && this.redraw()) + }, getChartSize: function () { + var a = this.options.chart, e = a.width, a = a.height, h = this.renderToClone || this.renderTo; + b(e) || (this.containerWidth = c(h, "width")); + b(a) || (this.containerHeight = + c(h, "height")); + this.chartWidth = Math.max(0, e || this.containerWidth || 600); + this.chartHeight = Math.max(0, a || this.containerHeight || 400) + }, cloneRenderTo: function (a) { + var b = this.renderToClone, c = this.container; + if (a) { + if (b) { + for (; b.childNodes.length;)this.renderTo.appendChild(b.firstChild); + l(b); + delete this.renderToClone + } + } else c && c.parentNode === this.renderTo && this.renderTo.removeChild(c), this.renderToClone = b = this.renderTo.cloneNode(0), d(b, { + position: "absolute", + top: "-9999px", + display: "block" + }), b.style.setProperty && + b.style.setProperty("display", "block", "important"), r.body.appendChild(b), c && b.appendChild(c) + }, setClassName: function (a) { + this.container.className = "highcharts-container " + (a || "") + }, getContainer: function () { + var b, c = this.options, h = c.chart, d, k; + b = this.renderTo; + var m = a.uniqueKey(), n; + b || (this.renderTo = b = h.renderTo); + e(b) && (this.renderTo = b = r.getElementById(b)); + b || a.error(13, !0); + d = J(G(b, "data-highcharts-chart")); + E(d) && q[d] && q[d].hasRendered && q[d].destroy(); + G(b, "data-highcharts-chart", this.index); + b.innerHTML = ""; + h.skipClone || b.offsetWidth || this.cloneRenderTo(); + this.getChartSize(); + d = this.chartWidth; + k = this.chartHeight; + n = C({ + position: "relative", + overflow: "hidden", + width: d + "px", + height: k + "px", + textAlign: "left", + lineHeight: "normal", + zIndex: 0, + "-webkit-tap-highlight-color": "rgba(0,0,0,0)" + }, h.style); + this.container = b = f("div", {id: m}, n, this.renderToClone || b); + this._cursor = b.style.cursor; + this.renderer = new (a[h.renderer] || S)(b, d, k, null, h.forExport, c.exporting && c.exporting.allowHTML); + this.setClassName(h.className); + this.renderer.setStyle(h.style); + this.renderer.chartIndex = this.index + }, getMargins: function (a) { + var c = this.spacing, e = this.margin, h = this.titleOffset; + this.resetMargins(); + h && !b(e[0]) && (this.plotTop = Math.max(this.plotTop, h + this.options.title.margin + c[0])); + this.legend.display && this.legend.adjustMargins(e, c); + this.extraMargin && (this[this.extraMargin.type] = (this[this.extraMargin.type] || 0) + this.extraMargin.value); + this.extraTopMargin && (this.plotTop += this.extraTopMargin); + a || this.getAxisMargins() + }, getAxisMargins: function () { + var a = this, c = a.axisOffset = + [0, 0, 0, 0], e = a.margin; + a.hasCartesianSeries && p(a.axes, function (a) { + a.visible && a.getOffset() + }); + p(F, function (h, d) { + b(e[d]) || (a[h] += c[d]) + }); + a.setChartSize() + }, reflow: function (a) { + var e = this, h = e.options.chart, d = e.renderTo, k = b(h.width), f = h.width || c(d, "width"), h = h.height || c(d, "height"), d = a ? a.target : N; + if (!k && !e.isPrinting && f && h && (d === N || d === r)) { + if (f !== e.containerWidth || h !== e.containerHeight)clearTimeout(e.reflowTimeout), e.reflowTimeout = P(function () { + e.container && e.setSize(void 0, void 0, !1) + }, a ? 100 : 0); + e.containerWidth = + f; + e.containerHeight = h + } + }, initReflow: function () { + var a = this, b; + b = B(N, "resize", function (b) { + a.reflow(b) + }); + B(a, "destroy", b) + }, setSize: function (b, c, e) { + var h = this, k = h.renderer; + h.isResizing += 1; + a.setAnimation(e, h); + h.oldChartHeight = h.chartHeight; + h.oldChartWidth = h.chartWidth; + void 0 !== b && (h.options.chart.width = b); + void 0 !== c && (h.options.chart.height = c); + h.getChartSize(); + b = k.globalAnimation; + (b ? A : d)(h.container, {width: h.chartWidth + "px", height: h.chartHeight + "px"}, b); + h.setChartSize(!0); + k.setSize(h.chartWidth, h.chartHeight, + e); + p(h.axes, function (a) { + a.isDirty = !0; + a.setScale() + }); + h.isDirtyLegend = !0; + h.isDirtyBox = !0; + h.layOutTitles(); + h.getMargins(); + h.redraw(e); + h.oldChartHeight = null; + m(h, "resize"); + P(function () { + h && m(h, "endResize", null, function () { + --h.isResizing + }) + }, H(b).duration) + }, setChartSize: function (a) { + var b = this.inverted, c = this.renderer, e = this.chartWidth, h = this.chartHeight, d = this.options.chart, k = this.spacing, f = this.clipOffset, m, n, y, g; + this.plotLeft = m = Math.round(this.plotLeft); + this.plotTop = n = Math.round(this.plotTop); + this.plotWidth = + y = Math.max(0, Math.round(e - m - this.marginRight)); + this.plotHeight = g = Math.max(0, Math.round(h - n - this.marginBottom)); + this.plotSizeX = b ? g : y; + this.plotSizeY = b ? y : g; + this.plotBorderWidth = d.plotBorderWidth || 0; + this.spacingBox = c.spacingBox = {x: k[3], y: k[0], width: e - k[3] - k[1], height: h - k[0] - k[2]}; + this.plotBox = c.plotBox = {x: m, y: n, width: y, height: g}; + e = 2 * Math.floor(this.plotBorderWidth / 2); + b = Math.ceil(Math.max(e, f[3]) / 2); + c = Math.ceil(Math.max(e, f[0]) / 2); + this.clipBox = { + x: b, y: c, width: Math.floor(this.plotSizeX - Math.max(e, f[1]) / + 2 - b), height: Math.max(0, Math.floor(this.plotSizeY - Math.max(e, f[2]) / 2 - c)) + }; + a || p(this.axes, function (a) { + a.setAxisSize(); + a.setAxisTranslation() + }) + }, resetMargins: function () { + var a = this, b = a.options.chart; + p(["margin", "spacing"], function (c) { + var e = b[c], h = z(e) ? e : [e, e, e, e]; + p(["Top", "Right", "Bottom", "Left"], function (e, d) { + a[c][d] = y(b[c + e], h[d]) + }) + }); + p(F, function (b, c) { + a[b] = y(a.margin[c], a.spacing[c]) + }); + a.axisOffset = [0, 0, 0, 0]; + a.clipOffset = [0, 0, 0, 0] + }, drawChartBox: function () { + var a = this.options.chart, b = this.renderer, c = + this.chartWidth, e = this.chartHeight, h = this.chartBackground, d = this.plotBackground, k = this.plotBorder, f, m = this.plotBGImage, n = a.backgroundColor, p = a.plotBackgroundColor, y = a.plotBackgroundImage, g, l = this.plotLeft, q = this.plotTop, t = this.plotWidth, w = this.plotHeight, x = this.plotBox, r = this.clipRect, z = this.clipBox, J = "animate"; + h || (this.chartBackground = h = b.rect().addClass("highcharts-background").add(), J = "attr"); + f = a.borderWidth || 0; + g = f + (a.shadow ? 8 : 0); + n = {fill: n || "none"}; + if (f || h["stroke-width"])n.stroke = a.borderColor, + n["stroke-width"] = f; + h.attr(n).shadow(a.shadow); + h[J]({x: g / 2, y: g / 2, width: c - g - f % 2, height: e - g - f % 2, r: a.borderRadius}); + J = "animate"; + d || (J = "attr", this.plotBackground = d = b.rect().addClass("highcharts-plot-background").add()); + d[J](x); + d.attr({fill: p || "none"}).shadow(a.plotShadow); + y && (m ? m.animate(x) : this.plotBGImage = b.image(y, l, q, t, w).add()); + r ? r.animate({width: z.width, height: z.height}) : this.clipRect = b.clipRect(z); + J = "animate"; + k || (J = "attr", this.plotBorder = k = b.rect().addClass("highcharts-plot-border").attr({zIndex: 1}).add()); + k.attr({stroke: a.plotBorderColor, "stroke-width": a.plotBorderWidth || 0, fill: "none"}); + k[J](k.crisp({x: l, y: q, width: t, height: w}, -k.strokeWidth())); + this.isDirtyBox = !1 + }, propFromSeries: function () { + var a = this, b = a.options.chart, c, e = a.options.series, h, d; + p(["inverted", "angular", "polar"], function (k) { + c = I[b.type || b.defaultSeriesType]; + d = b[k] || c && c.prototype[k]; + for (h = e && e.length; !d && h--;)(c = I[e[h].type]) && c.prototype[k] && (d = !0); + a[k] = d + }) + }, linkSeries: function () { + var a = this, b = a.series; + p(b, function (a) { + a.linkedSeries.length = + 0 + }); + p(b, function (b) { + var c = b.options.linkedTo; + e(c) && (c = ":previous" === c ? a.series[b.index - 1] : a.get(c)) && c.linkedParent !== b && (c.linkedSeries.push(b), b.linkedParent = c, b.visible = y(b.options.visible, c.options.visible, b.visible)) + }) + }, renderSeries: function () { + p(this.series, function (a) { + a.translate(); + a.render() + }) + }, renderLabels: function () { + var a = this, b = a.options.labels; + b.items && p(b.items, function (c) { + var e = C(b.style, c.style), h = J(e.left) + a.plotLeft, d = J(e.top) + a.plotTop + 12; + delete e.left; + delete e.top; + a.renderer.text(c.html, + h, d).attr({zIndex: 2}).css(e).add() + }) + }, render: function () { + var a = this.axes, b = this.renderer, c = this.options, e, h, d; + this.setTitle(); + this.legend = new x(this, c.legend); + this.getStacks && this.getStacks(); + this.getMargins(!0); + this.setChartSize(); + c = this.plotWidth; + e = this.plotHeight -= 21; + p(a, function (a) { + a.setScale() + }); + this.getAxisMargins(); + h = 1.1 < c / this.plotWidth; + d = 1.05 < e / this.plotHeight; + if (h || d)p(a, function (a) { + (a.horiz && h || !a.horiz && d) && a.setTickInterval(!0) + }), this.getMargins(); + this.drawChartBox(); + this.hasCartesianSeries && + p(a, function (a) { + a.visible && a.render() + }); + this.seriesGroup || (this.seriesGroup = b.g("series-group").attr({zIndex: 3}).add()); + this.renderSeries(); + this.renderLabels(); + this.addCredits(); + this.setResponsive && this.setResponsive(); + this.hasRendered = !0 + }, addCredits: function (a) { + var b = this; + a = w(!0, this.options.credits, a); + a.enabled && !this.credits && (this.credits = this.renderer.text(a.text + (this.mapCredits || ""), 0, 0).addClass("highcharts-credits").on("click", function () { + a.href && (N.location.href = a.href) + }).attr({ + align: a.position.align, + zIndex: 8 + }).css(a.style).add().align(a.position), this.credits.update = function (a) { + b.credits = b.credits.destroy(); + b.addCredits(a) + }) + }, destroy: function () { + var b = this, c = b.axes, e = b.series, h = b.container, d, k = h && h.parentNode; + m(b, "destroy"); + q[b.index] = void 0; + a.chartCount--; + b.renderTo.removeAttribute("data-highcharts-chart"); + K(b); + for (d = c.length; d--;)c[d] = c[d].destroy(); + this.scroller && this.scroller.destroy && this.scroller.destroy(); + for (d = e.length; d--;)e[d] = e[d].destroy(); + p("title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" "), + function (a) { + var c = b[a]; + c && c.destroy && (b[a] = c.destroy()) + }); + h && (h.innerHTML = "", K(h), k && l(h)); + for (d in b)delete b[d] + }, isReadyToRender: function () { + var a = this; + return D || N != N.top || "complete" === r.readyState ? !0 : (r.attachEvent("onreadystatechange", function () { + r.detachEvent("onreadystatechange", a.firstRender); + "complete" === r.readyState && a.firstRender() + }), !1) + }, firstRender: function () { + var a = this, b = a.options; + if (a.isReadyToRender()) { + a.getContainer(); + m(a, "init"); + a.resetMargins(); + a.setChartSize(); + a.propFromSeries(); + a.getAxes(); + p(b.series || [], function (b) { + a.initSeries(b) + }); + a.linkSeries(); + m(a, "beforeRender"); + h && (a.pointer = new h(a, b)); + a.render(); + if (!a.renderer.imgCount && a.onload)a.onload(); + a.cloneRenderTo(!0) + } + }, onload: function () { + p([this.callback].concat(this.callbacks), function (a) { + a && void 0 !== this.index && a.apply(this, [this]) + }, this); + m(this, "load"); + m(this, "render"); + b(this.index) && !1 !== this.options.chart.reflow && this.initReflow(); + this.onload = null + } + } + })(L); + (function (a) { + var B, A = a.each, H = a.extend, G = a.erase, r = a.fireEvent, + g = a.format, f = a.isArray, u = a.isNumber, l = a.pick, q = a.removeEvent; + B = a.Point = function () { + }; + B.prototype = { + init: function (a, b, f) { + this.series = a; + this.color = a.color; + this.applyOptions(b, f); + a.options.colorByPoint ? (b = a.options.colors || a.chart.options.colors, this.color = this.color || b[a.colorCounter], b = b.length, f = a.colorCounter, a.colorCounter++, a.colorCounter === b && (a.colorCounter = 0)) : f = a.colorIndex; + this.colorIndex = l(this.colorIndex, f); + a.chart.pointCount++; + return this + }, applyOptions: function (a, b) { + var d = this.series, f = d.options.pointValKey || + d.pointValKey; + a = B.prototype.optionsToObject.call(this, a); + H(this, a); + this.options = this.options ? H(this.options, a) : a; + a.group && delete this.group; + f && (this.y = this[f]); + this.isNull = l(this.isValid && !this.isValid(), null === this.x || !u(this.y, !0)); + this.selected && (this.state = "select"); + "name" in this && void 0 === b && d.xAxis && d.xAxis.hasNames && (this.x = d.xAxis.nameToX(this)); + void 0 === this.x && d && (this.x = void 0 === b ? d.autoIncrement(this) : b); + return this + }, optionsToObject: function (a) { + var b = {}, d = this.series, g = d.options.keys, + l = g || d.pointArrayMap || ["y"], m = l.length, c = 0, n = 0; + if (u(a) || null === a)b[l[0]] = a; else if (f(a))for (!g && a.length > m && (d = typeof a[0], "string" === d ? b.name = a[0] : "number" === d && (b.x = a[0]), c++); n < m;)g && void 0 === a[c] || (b[l[n]] = a[c]), c++, n++; else"object" === typeof a && (b = a, a.dataLabels && (d._hasPointLabels = !0), a.marker && (d._hasPointMarkers = !0)); + return b + }, getClassName: function () { + return "highcharts-point" + (this.selected ? " highcharts-point-select" : "") + (this.negative ? " highcharts-negative" : "") + (this.isNull ? " highcharts-null-point" : + "") + (void 0 !== this.colorIndex ? " highcharts-color-" + this.colorIndex : "") + (this.options.className ? " " + this.options.className : "") + (this.zone && this.zone.className ? " " + this.zone.className.replace("highcharts-negative", "") : "") + }, getZone: function () { + var a = this.series, b = a.zones, a = a.zoneAxis || "y", f = 0, g; + for (g = b[f]; this[a] >= g.value;)g = b[++f]; + g && g.color && !this.options.color && (this.color = g.color); + return g + }, destroy: function () { + var a = this.series.chart, b = a.hoverPoints, f; + a.pointCount--; + b && (this.setState(), G(b, this), b.length || + (a.hoverPoints = null)); + if (this === a.hoverPoint)this.onMouseOut(); + if (this.graphic || this.dataLabel)q(this), this.destroyElements(); + this.legendItem && a.legend.destroyItem(this); + for (f in this)this[f] = null + }, destroyElements: function () { + for (var a = ["graphic", "dataLabel", "dataLabelUpper", "connector", "shadowGroup"], b, f = 6; f--;)b = a[f], this[b] && (this[b] = this[b].destroy()) + }, getLabelConfig: function () { + return { + x: this.category, + y: this.y, + color: this.color, + colorIndex: this.colorIndex, + key: this.name || this.category, + series: this.series, + point: this, + percentage: this.percentage, + total: this.total || this.stackTotal + } + }, tooltipFormatter: function (a) { + var b = this.series, d = b.tooltipOptions, f = l(d.valueDecimals, ""), q = d.valuePrefix || "", m = d.valueSuffix || ""; + A(b.pointArrayMap || ["y"], function (b) { + b = "{point." + b; + if (q || m)a = a.replace(b + "}", q + b + "}" + m); + a = a.replace(b + "}", b + ":,." + f + "f}") + }); + return g(a, {point: this, series: this.series}) + }, firePointEvent: function (a, b, f) { + var d = this, g = this.series.options; + (g.point.events[a] || d.options && d.options.events && d.options.events[a]) && + this.importEvents(); + "click" === a && g.allowPointSelect && (f = function (a) { + d.select && d.select(null, a.ctrlKey || a.metaKey || a.shiftKey) + }); + r(this, a, b, f) + }, visible: !0 + } + })(L); + (function (a) { + var B = a.addEvent, A = a.animObject, H = a.arrayMax, G = a.arrayMin, r = a.correctFloat, g = a.Date, f = a.defaultOptions, u = a.defaultPlotOptions, l = a.defined, q = a.each, d = a.erase, b = a.extend, p = a.fireEvent, C = a.grep, t = a.isArray, m = a.isNumber, c = a.isString, n = a.merge, E = a.pick, z = a.removeEvent, e = a.splat, x = a.SVGElement, F = a.syncTimeout, w = a.win; + a.Series = a.seriesType("line", + null, { + lineWidth: 2, + allowPointSelect: !1, + showCheckbox: !1, + animation: {duration: 1E3}, + events: {}, + marker: { + lineWidth: 0, + lineColor: "#ffffff", + radius: 4, + states: { + hover: {animation: {duration: 50}, enabled: !0, radiusPlus: 2, lineWidthPlus: 1}, + select: {fillColor: "#cccccc", lineColor: "#000000", lineWidth: 2} + } + }, + point: {events: {}}, + dataLabels: { + align: "center", + formatter: function () { + return null === this.y ? "" : a.numberFormat(this.y, -1) + }, + style: {fontSize: "11px", fontWeight: "bold", color: "contrast", textOutline: "1px contrast"}, + verticalAlign: "bottom", + x: 0, + y: 0, + padding: 5 + }, + cropThreshold: 300, + pointRange: 0, + softThreshold: !0, + states: {hover: {lineWidthPlus: 1, marker: {}, halo: {size: 10, opacity: .25}}, select: {marker: {}}}, + stickyTracking: !0, + turboThreshold: 1E3 + }, { + isCartesian: !0, + pointClass: a.Point, + sorted: !0, + requireSorting: !0, + directTouch: !1, + axisTypes: ["xAxis", "yAxis"], + colorCounter: 0, + parallelArrays: ["x", "y"], + coll: "series", + init: function (a, c) { + var e = this, h, d, k = a.series, f; + e.chart = a; + e.options = c = e.setOptions(c); + e.linkedSeries = []; + e.bindAxes(); + b(e, { + name: c.name, state: "", visible: !1 !== + c.visible, selected: !0 === c.selected + }); + d = c.events; + for (h in d)B(e, h, d[h]); + if (d && d.click || c.point && c.point.events && c.point.events.click || c.allowPointSelect)a.runTrackerClick = !0; + e.getColor(); + e.getSymbol(); + q(e.parallelArrays, function (a) { + e[a + "Data"] = [] + }); + e.setData(c.data, !1); + e.isCartesian && (a.hasCartesianSeries = !0); + k.length && (f = k[k.length - 1]); + e._i = E(f && f._i, -1) + 1; + a.orderSeries(this.insert(k)) + }, + insert: function (a) { + var b = this.options.index, c; + if (m(b)) { + for (c = a.length; c--;)if (b >= E(a[c].options.index, a[c]._i)) { + a.splice(c + + 1, 0, this); + break + } + -1 === c && a.unshift(this); + c += 1 + } else a.push(this); + return E(c, a.length - 1) + }, + bindAxes: function () { + var b = this, c = b.options, e = b.chart, d; + q(b.axisTypes || [], function (h) { + q(e[h], function (a) { + d = a.options; + if (c[h] === d.index || void 0 !== c[h] && c[h] === d.id || void 0 === c[h] && 0 === d.index)b.insert(a.series), b[h] = a, a.isDirty = !0 + }); + b[h] || b.optionalAxis === h || a.error(18, !0) + }) + }, + updateParallelArrays: function (a, b) { + var c = a.series, e = arguments, h = m(b) ? function (e) { + var h = "y" === e && c.toYData ? c.toYData(a) : a[e]; + c[e + "Data"][b] = + h + } : function (a) { + Array.prototype[b].apply(c[a + "Data"], Array.prototype.slice.call(e, 2)) + }; + q(c.parallelArrays, h) + }, + autoIncrement: function () { + var a = this.options, b = this.xIncrement, c, e = a.pointIntervalUnit, b = E(b, a.pointStart, 0); + this.pointInterval = c = E(this.pointInterval, a.pointInterval, 1); + e && (a = new g(b), "day" === e ? a = +a[g.hcSetDate](a[g.hcGetDate]() + c) : "month" === e ? a = +a[g.hcSetMonth](a[g.hcGetMonth]() + c) : "year" === e && (a = +a[g.hcSetFullYear](a[g.hcGetFullYear]() + c)), c = a - b); + this.xIncrement = b + c; + return b + }, + setOptions: function (a) { + var b = + this.chart, c = b.options.plotOptions, b = b.userOptions || {}, e = b.plotOptions || {}, h = c[this.type]; + this.userOptions = a; + c = n(h, c.series, a); + this.tooltipOptions = n(f.tooltip, f.plotOptions[this.type].tooltip, b.tooltip, e.series && e.series.tooltip, e[this.type] && e[this.type].tooltip, a.tooltip); + null === h.marker && delete c.marker; + this.zoneAxis = c.zoneAxis; + a = this.zones = (c.zones || []).slice(); + !c.negativeColor && !c.negativeFillColor || c.zones || a.push({ + value: c[this.zoneAxis + "Threshold"] || c.threshold || 0, className: "highcharts-negative", + color: c.negativeColor, fillColor: c.negativeFillColor + }); + a.length && l(a[a.length - 1].value) && a.push({color: this.color, fillColor: this.fillColor}); + return c + }, + getCyclic: function (a, b, c) { + var e, h = this.chart, d = this.userOptions, f = a + "Index", n = a + "Counter", m = c ? c.length : E(h.options.chart[a + "Count"], h[a + "Count"]); + b || (e = E(d[f], d["_" + f]), l(e) || (h.series.length || (h[n] = 0), d["_" + f] = e = h[n] % m, h[n] += 1), c && (b = c[e])); + void 0 !== e && (this[f] = e); + this[a] = b + }, + getColor: function () { + this.options.colorByPoint ? this.options.color = null : this.getCyclic("color", + this.options.color || u[this.type].color, this.chart.options.colors) + }, + getSymbol: function () { + this.getCyclic("symbol", this.options.marker.symbol, this.chart.options.symbols) + }, + drawLegendSymbol: a.LegendSymbolMixin.drawLineMarker, + setData: function (b, e, d, f) { + var h = this, k = h.points, n = k && k.length || 0, g, p = h.options, y = h.chart, l = null, w = h.xAxis, x = p.turboThreshold, r = this.xData, z = this.yData, F = (g = h.pointArrayMap) && g.length; + b = b || []; + g = b.length; + e = E(e, !0); + if (!1 !== f && g && n === g && !h.cropped && !h.hasGroupedData && h.visible)q(b, function (a, + b) { + k[b].update && a !== p.data[b] && k[b].update(a, !1, null, !1) + }); else { + h.xIncrement = null; + h.colorCounter = 0; + q(this.parallelArrays, function (a) { + h[a + "Data"].length = 0 + }); + if (x && g > x) { + for (d = 0; null === l && d < g;)l = b[d], d++; + if (m(l))for (d = 0; d < g; d++)r[d] = this.autoIncrement(), z[d] = b[d]; else if (t(l))if (F)for (d = 0; d < g; d++)l = b[d], r[d] = l[0], z[d] = l.slice(1, F + 1); else for (d = 0; d < g; d++)l = b[d], r[d] = l[0], z[d] = l[1]; else a.error(12) + } else for (d = 0; d < g; d++)void 0 !== b[d] && (l = {series: h}, h.pointClass.prototype.applyOptions.apply(l, [b[d]]), h.updateParallelArrays(l, + d)); + c(z[0]) && a.error(14, !0); + h.data = []; + h.options.data = h.userOptions.data = b; + for (d = n; d--;)k[d] && k[d].destroy && k[d].destroy(); + w && (w.minRange = w.userMinRange); + h.isDirty = y.isDirtyBox = !0; + h.isDirtyData = !!k; + d = !1 + } + "point" === p.legendType && (this.processData(), this.generatePoints()); + e && y.redraw(d) + }, + processData: function (b) { + var c = this.xData, e = this.yData, h = c.length, d; + d = 0; + var k, f, n = this.xAxis, m, g = this.options; + m = g.cropThreshold; + var p = this.getExtremesFromAll || g.getExtremesFromAll, l = this.isCartesian, g = n && n.val2lin, q = n && + n.isLog, t, w; + if (l && !this.isDirty && !n.isDirty && !this.yAxis.isDirty && !b)return !1; + n && (b = n.getExtremes(), t = b.min, w = b.max); + if (l && this.sorted && !p && (!m || h > m || this.forceCrop))if (c[h - 1] < t || c[0] > w)c = [], e = []; else if (c[0] < t || c[h - 1] > w)d = this.cropData(this.xData, this.yData, t, w), c = d.xData, e = d.yData, d = d.start, k = !0; + for (m = c.length || 1; --m;)h = q ? g(c[m]) - g(c[m - 1]) : c[m] - c[m - 1], 0 < h && (void 0 === f || h < f) ? f = h : 0 > h && this.requireSorting && a.error(15); + this.cropped = k; + this.cropStart = d; + this.processedXData = c; + this.processedYData = e; + this.closestPointRange = + f + }, + cropData: function (a, b, c, e) { + var h = a.length, d = 0, f = h, n = E(this.cropShoulder, 1), m; + for (m = 0; m < h; m++)if (a[m] >= c) { + d = Math.max(0, m - n); + break + } + for (c = m; c < h; c++)if (a[c] > e) { + f = c + n; + break + } + return {xData: a.slice(d, f), yData: b.slice(d, f), start: d, end: f} + }, + generatePoints: function () { + var a = this.options.data, b = this.data, c, d = this.processedXData, f = this.processedYData, k = this.pointClass, n = d.length, m = this.cropStart || 0, g, p = this.hasGroupedData, l, q = [], t; + b || p || (b = [], b.length = a.length, b = this.data = b); + for (t = 0; t < n; t++)g = m + t, p ? (l = (new k).init(this, + [d[t]].concat(e(f[t]))), l.dataGroup = this.groupMap[t]) : (l = b[g]) || void 0 === a[g] || (b[g] = l = (new k).init(this, a[g], d[t])), l.index = g, q[t] = l; + if (b && (n !== (c = b.length) || p))for (t = 0; t < c; t++)t !== m || p || (t += n), b[t] && (b[t].destroyElements(), b[t].plotX = void 0); + this.data = b; + this.points = q + }, + getExtremes: function (a) { + var b = this.yAxis, c = this.processedXData, e, h = [], d = 0; + e = this.xAxis.getExtremes(); + var f = e.min, n = e.max, g, p, l, q; + a = a || this.stackedYData || this.processedYData || []; + e = a.length; + for (q = 0; q < e; q++)if (p = c[q], l = a[q], g = (m(l, !0) || + t(l)) && (!b.isLog || l.length || 0 < l), p = this.getExtremesFromAll || this.options.getExtremesFromAll || this.cropped || (c[q + 1] || p) >= f && (c[q - 1] || p) <= n, g && p)if (g = l.length)for (; g--;)null !== l[g] && (h[d++] = l[g]); else h[d++] = l; + this.dataMin = G(h); + this.dataMax = H(h) + }, + translate: function () { + this.processedXData || this.processData(); + this.generatePoints(); + var a = this.options, b = a.stacking, c = this.xAxis, e = c.categories, d = this.yAxis, k = this.points, f = k.length, n = !!this.modifyValue, g = a.pointPlacement, p = "between" === g || m(g), q = a.threshold, + t = a.startFromThreshold ? q : 0, w, x, z, F, u = Number.MAX_VALUE; + "between" === g && (g = .5); + m(g) && (g *= E(a.pointRange || c.pointRange)); + for (a = 0; a < f; a++) { + var C = k[a], A = C.x, B = C.y; + x = C.low; + var H = b && d.stacks[(this.negStacks && B < (t ? 0 : q) ? "-" : "") + this.stackKey], G; + d.isLog && null !== B && 0 >= B && (C.isNull = !0); + C.plotX = w = r(Math.min(Math.max(-1E5, c.translate(A, 0, 0, 0, 1, g, "flags" === this.type)), 1E5)); + b && this.visible && !C.isNull && H && H[A] && (F = this.getStackIndicator(F, A, this.index), G = H[A], B = G.points[F.key], x = B[0], B = B[1], x === t && F.key === H[A].base && + (x = E(q, d.min)), d.isLog && 0 >= x && (x = null), C.total = C.stackTotal = G.total, C.percentage = G.total && C.y / G.total * 100, C.stackY = B, G.setOffset(this.pointXOffset || 0, this.barW || 0)); + C.yBottom = l(x) ? d.translate(x, 0, 1, 0, 1) : null; + n && (B = this.modifyValue(B, C)); + C.plotY = x = "number" === typeof B && Infinity !== B ? Math.min(Math.max(-1E5, d.translate(B, 0, 1, 0, 1)), 1E5) : void 0; + C.isInside = void 0 !== x && 0 <= x && x <= d.len && 0 <= w && w <= c.len; + C.clientX = p ? r(c.translate(A, 0, 0, 0, 1, g)) : w; + C.negative = C.y < (q || 0); + C.category = e && void 0 !== e[C.x] ? e[C.x] : C.x; + C.isNull || + (void 0 !== z && (u = Math.min(u, Math.abs(w - z))), z = w); + C.zone = this.zones.length && C.getZone() + } + this.closestPointRangePx = u + }, + getValidPoints: function (a, b) { + var c = this.chart; + return C(a || this.points || [], function (a) { + return b && !c.isInsidePlot(a.plotX, a.plotY, c.inverted) ? !1 : !a.isNull + }) + }, + setClip: function (a) { + var b = this.chart, c = this.options, e = b.renderer, d = b.inverted, h = this.clipBox, f = h || b.clipBox, n = this.sharedClipKey || ["_sharedClip", a && a.duration, a && a.easing, f.height, c.xAxis, c.yAxis].join(), m = b[n], g = b[n + "m"]; + m || (a && (f.width = + 0, b[n + "m"] = g = e.clipRect(-99, d ? -b.plotLeft : -b.plotTop, 99, d ? b.chartWidth : b.chartHeight)), b[n] = m = e.clipRect(f), m.count = {length: 0}); + a && !m.count[this.index] && (m.count[this.index] = !0, m.count.length += 1); + !1 !== c.clip && (this.group.clip(a || h ? m : b.clipRect), this.markerGroup.clip(g), this.sharedClipKey = n); + a || (m.count[this.index] && (delete m.count[this.index], --m.count.length), 0 === m.count.length && n && b[n] && (h || (b[n] = b[n].destroy()), b[n + "m"] && (this.markerGroup.clip(), b[n + "m"] = b[n + "m"].destroy()))) + }, + animate: function (a) { + var b = + this.chart, c = A(this.options.animation), e; + a ? this.setClip(c) : (e = this.sharedClipKey, (a = b[e]) && a.animate({width: b.plotSizeX}, c), b[e + "m"] && b[e + "m"].animate({width: b.plotSizeX + 99}, c), this.animate = null) + }, + afterAnimate: function () { + this.setClip(); + p(this, "afterAnimate") + }, + drawPoints: function () { + var a = this.points, b = this.chart, c, e, d, k, f = this.options.marker, n, g, p, l, q = this.markerGroup, t = E(f.enabled, this.xAxis.isRadial ? !0 : null, this.closestPointRangePx > 2 * f.radius); + if (!1 !== f.enabled || this._hasPointMarkers)for (e = 0; e < a.length; e++)d = + a[e], c = d.plotY, k = d.graphic, n = d.marker || {}, g = !!d.marker, p = t && void 0 === n.enabled || n.enabled, l = d.isInside, p && m(c) && null !== d.y ? (c = E(n.symbol, this.symbol), d.hasImage = 0 === c.indexOf("url"), p = this.markerAttribs(d, d.selected && "select"), k ? k[l ? "show" : "hide"](!0).animate(p) : l && (0 < p.width || d.hasImage) && (d.graphic = k = b.renderer.symbol(c, p.x, p.y, p.width, p.height, g ? n : f).add(q)), k && k.attr(this.pointAttribs(d, d.selected && "select")), k && k.addClass(d.getClassName(), !0)) : k && (d.graphic = k.destroy()) + }, + markerAttribs: function (a, + b) { + var c = this.options.marker, e = a.marker || {}, d = E(e.radius, c.radius); + b && (c = c.states[b], b = e.states && e.states[b], d = E(b && b.radius, c && c.radius, d + (c && c.radiusPlus || 0))); + a.hasImage && (d = 0); + a = {x: Math.floor(a.plotX) - d, y: a.plotY - d}; + d && (a.width = a.height = 2 * d); + return a + }, + pointAttribs: function (a, b) { + var c = this.options.marker, e = a && a.options, d = e && e.marker || {}, h = this.color, f = e && e.color, n = a && a.color, e = E(d.lineWidth, c.lineWidth); + a = a && a.zone && a.zone.color; + h = f || a || n || h; + a = d.fillColor || c.fillColor || h; + h = d.lineColor || c.lineColor || + h; + b && (c = c.states[b], b = d.states && d.states[b] || {}, e = E(b.lineWidth, c.lineWidth, e + E(b.lineWidthPlus, c.lineWidthPlus, 0)), a = b.fillColor || c.fillColor || a, h = b.lineColor || c.lineColor || h); + return {stroke: h, "stroke-width": e, fill: a} + }, + destroy: function () { + var a = this, b = a.chart, c = /AppleWebKit\/533/.test(w.navigator.userAgent), e, f = a.data || [], k, n, m; + p(a, "destroy"); + z(a); + q(a.axisTypes || [], function (b) { + (m = a[b]) && m.series && (d(m.series, a), m.isDirty = m.forceRedraw = !0) + }); + a.legendItem && a.chart.legend.destroyItem(a); + for (e = f.length; e--;)(k = + f[e]) && k.destroy && k.destroy(); + a.points = null; + clearTimeout(a.animationTimeout); + for (n in a)a[n] instanceof x && !a[n].survive && (e = c && "group" === n ? "hide" : "destroy", a[n][e]()); + b.hoverSeries === a && (b.hoverSeries = null); + d(b.series, a); + b.orderSeries(); + for (n in a)delete a[n] + }, + getGraphPath: function (a, b, c) { + var e = this, d = e.options, h = d.step, f, n = [], m = [], g; + a = a || e.points; + (f = a.reversed) && a.reverse(); + (h = {right: 1, center: 2}[h] || h && 3) && f && (h = 4 - h); + !d.connectNulls || b || c || (a = this.getValidPoints(a)); + q(a, function (f, k) { + var p = f.plotX, + q = f.plotY, t = a[k - 1]; + (f.leftCliff || t && t.rightCliff) && !c && (g = !0); + f.isNull && !l(b) && 0 < k ? g = !d.connectNulls : f.isNull && !b ? g = !0 : (0 === k || g ? k = ["M", f.plotX, f.plotY] : e.getPointSpline ? k = e.getPointSpline(a, f, k) : h ? (k = 1 === h ? ["L", t.plotX, q] : 2 === h ? ["L", (t.plotX + p) / 2, t.plotY, "L", (t.plotX + p) / 2, q] : ["L", p, t.plotY], k.push("L", p, q)) : k = ["L", p, q], m.push(f.x), h && m.push(f.x), n.push.apply(n, k), g = !1) + }); + n.xMap = m; + return e.graphPath = n + }, + drawGraph: function () { + var a = this, b = this.options, c = (this.gappedPath || this.getGraphPath).call(this), + e = [["graph", "highcharts-graph", b.lineColor || this.color, b.dashStyle]]; + q(this.zones, function (c, d) { + e.push(["zone-graph-" + d, "highcharts-graph highcharts-zone-graph-" + d + " " + (c.className || ""), c.color || a.color, c.dashStyle || b.dashStyle]) + }); + q(e, function (e, d) { + var h = e[0], f = a[h]; + f ? (f.endX = c.xMap, f.animate({d: c})) : c.length && (a[h] = a.chart.renderer.path(c).addClass(e[1]).attr({zIndex: 1}).add(a.group), f = { + stroke: e[2], + "stroke-width": b.lineWidth, + fill: a.fillGraph && a.color || "none" + }, e[3] ? f.dashstyle = e[3] : "square" !== b.linecap && + (f["stroke-linecap"] = f["stroke-linejoin"] = "round"), f = a[h].attr(f).shadow(2 > d && b.shadow)); + f && (f.startX = c.xMap, f.isArea = c.isArea) + }) + }, + applyZones: function () { + var a = this, b = this.chart, c = b.renderer, e = this.zones, d, f, n = this.clips || [], m, g = this.graph, p = this.area, l = Math.max(b.chartWidth, b.chartHeight), t = this[(this.zoneAxis || "y") + "Axis"], w, x, r = b.inverted, z, F, u, C, A = !1; + e.length && (g || p) && t && void 0 !== t.min && (x = t.reversed, z = t.horiz, g && g.hide(), p && p.hide(), w = t.getExtremes(), q(e, function (e, h) { + d = x ? z ? b.plotWidth : 0 : z ? 0 : + t.toPixels(w.min); + d = Math.min(Math.max(E(f, d), 0), l); + f = Math.min(Math.max(Math.round(t.toPixels(E(e.value, w.max), !0)), 0), l); + A && (d = f = t.toPixels(w.max)); + F = Math.abs(d - f); + u = Math.min(d, f); + C = Math.max(d, f); + t.isXAxis ? (m = { + x: r ? C : u, + y: 0, + width: F, + height: l + }, z || (m.x = b.plotHeight - m.x)) : (m = { + x: 0, + y: r ? C : u, + width: l, + height: F + }, z && (m.y = b.plotWidth - m.y)); + r && c.isVML && (m = t.isXAxis ? { + x: 0, + y: x ? u : C, + height: m.width, + width: b.chartWidth + } : {x: m.y - b.plotLeft - b.spacingBox.x, y: 0, width: m.height, height: b.chartHeight}); + n[h] ? n[h].animate(m) : (n[h] = + c.clipRect(m), g && a["zone-graph-" + h].clip(n[h]), p && a["zone-area-" + h].clip(n[h])); + A = e.value > w.max + }), this.clips = n) + }, + invertGroups: function (a) { + function b() { + q(["group", "markerGroup"], function (b) { + c[b] && (c[b].width = c.yAxis.len, c[b].height = c.xAxis.len, c[b].invert(a)) + }) + } + + var c = this, e; + c.xAxis && (e = B(c.chart, "resize", b), B(c, "destroy", e), b(a), c.invertGroups = b) + }, + plotGroup: function (a, b, c, e, d) { + var h = this[a], f = !h; + f && (this[a] = h = this.chart.renderer.g(b).attr({zIndex: e || .1}).add(d), h.addClass("highcharts-series-" + this.index + + " highcharts-" + this.type + "-series highcharts-color-" + this.colorIndex + " " + (this.options.className || ""))); + h.attr({visibility: c})[f ? "attr" : "animate"](this.getPlotBox()); + return h + }, + getPlotBox: function () { + var a = this.chart, b = this.xAxis, c = this.yAxis; + a.inverted && (b = c, c = this.xAxis); + return { + translateX: b ? b.left : a.plotLeft, + translateY: c ? c.top : a.plotTop, + scaleX: 1, + scaleY: 1 + } + }, + render: function () { + var a = this, b = a.chart, c, e = a.options, d = !!a.animate && b.renderer.isSVG && A(e.animation).duration, f = a.visible ? "inherit" : "hidden", n = + e.zIndex, m = a.hasRendered, g = b.seriesGroup, p = b.inverted; + c = a.plotGroup("group", "series", f, n, g); + a.markerGroup = a.plotGroup("markerGroup", "markers", f, n, g); + d && a.animate(!0); + c.inverted = a.isCartesian ? p : !1; + a.drawGraph && (a.drawGraph(), a.applyZones()); + a.drawDataLabels && a.drawDataLabels(); + a.visible && a.drawPoints(); + a.drawTracker && !1 !== a.options.enableMouseTracking && a.drawTracker(); + a.invertGroups(p); + !1 === e.clip || a.sharedClipKey || m || c.clip(b.clipRect); + d && a.animate(); + m || (a.animationTimeout = F(function () { + a.afterAnimate() + }, + d)); + a.isDirty = !1; + a.hasRendered = !0 + }, + redraw: function () { + var a = this.chart, b = this.isDirty || this.isDirtyData, c = this.group, e = this.xAxis, d = this.yAxis; + c && (a.inverted && c.attr({ + width: a.plotWidth, + height: a.plotHeight + }), c.animate({translateX: E(e && e.left, a.plotLeft), translateY: E(d && d.top, a.plotTop)})); + this.translate(); + this.render(); + b && delete this.kdTree + }, + kdDimensions: 1, + kdAxisArray: ["clientX", "plotY"], + searchPoint: function (a, b) { + var c = this.xAxis, e = this.yAxis, d = this.chart.inverted; + return this.searchKDTree({ + clientX: d ? + c.len - a.chartY + c.pos : a.chartX - c.pos, + plotY: d ? e.len - a.chartX + e.pos : a.chartY - e.pos + }, b) + }, + buildKDTree: function () { + function a(c, e, d) { + var h, f; + if (f = c && c.length)return h = b.kdAxisArray[e % d], c.sort(function (a, b) { + return a[h] - b[h] + }), f = Math.floor(f / 2), { + point: c[f], + left: a(c.slice(0, f), e + 1, d), + right: a(c.slice(f + 1), e + 1, d) + } + } + + this.buildingKdTree = !0; + var b = this, c = b.kdDimensions; + delete b.kdTree; + F(function () { + b.kdTree = a(b.getValidPoints(null, !b.directTouch), c, c); + b.buildingKdTree = !1 + }, b.options.kdNow ? 0 : 1) + }, + searchKDTree: function (a, + b) { + function c(a, b, k, n) { + var m = b.point, g = e.kdAxisArray[k % n], p, t, q = m; + t = l(a[d]) && l(m[d]) ? Math.pow(a[d] - m[d], 2) : null; + p = l(a[h]) && l(m[h]) ? Math.pow(a[h] - m[h], 2) : null; + p = (t || 0) + (p || 0); + m.dist = l(p) ? Math.sqrt(p) : Number.MAX_VALUE; + m.distX = l(t) ? Math.sqrt(t) : Number.MAX_VALUE; + g = a[g] - m[g]; + p = 0 > g ? "left" : "right"; + t = 0 > g ? "right" : "left"; + b[p] && (p = c(a, b[p], k + 1, n), q = p[f] < q[f] ? p : m); + b[t] && Math.sqrt(g * g) < q[f] && (a = c(a, b[t], k + 1, n), q = a[f] < q[f] ? a : q); + return q + } + + var e = this, d = this.kdAxisArray[0], h = this.kdAxisArray[1], f = b ? "distX" : "dist"; + this.kdTree || this.buildingKdTree || this.buildKDTree(); + if (this.kdTree)return c(a, this.kdTree, this.kdDimensions, this.kdDimensions) + } + }) + })(L); + (function (a) { + function B(a, d, b, f, g) { + var p = a.chart.inverted; + this.axis = a; + this.isNegative = b; + this.options = d; + this.x = f; + this.total = null; + this.points = {}; + this.stack = g; + this.rightCliff = this.leftCliff = 0; + this.alignOptions = { + align: d.align || (p ? b ? "left" : "right" : "center"), + verticalAlign: d.verticalAlign || (p ? "middle" : b ? "bottom" : "top"), + y: l(d.y, p ? 4 : b ? 14 : -6), + x: l(d.x, p ? b ? -6 : 6 : 0) + }; + this.textAlign = + d.textAlign || (p ? b ? "right" : "left" : "center") + } + + var A = a.Axis, H = a.Chart, G = a.correctFloat, r = a.defined, g = a.destroyObjectProperties, f = a.each, u = a.format, l = a.pick; + a = a.Series; + B.prototype = { + destroy: function () { + g(this, this.axis) + }, render: function (a) { + var d = this.options, b = d.format, b = b ? u(b, this) : d.formatter.call(this); + this.label ? this.label.attr({ + text: b, + visibility: "hidden" + }) : this.label = this.axis.chart.renderer.text(b, null, null, d.useHTML).css(d.style).attr({ + align: this.textAlign, + rotation: d.rotation, + visibility: "hidden" + }).add(a) + }, + setOffset: function (a, d) { + var b = this.axis, f = b.chart, g = f.inverted, l = b.reversed, l = this.isNegative && !l || !this.isNegative && l, m = b.translate(b.usePercentage ? 100 : this.total, 0, 0, 0, 1), b = b.translate(0), b = Math.abs(m - b); + a = f.xAxis[0].translate(this.x) + a; + var c = f.plotHeight, g = { + x: g ? l ? m : m - b : a, + y: g ? c - a - d : l ? c - m - b : c - m, + width: g ? b : d, + height: g ? d : b + }; + if (d = this.label)d.align(this.alignOptions, null, g), g = d.alignAttr, d[!1 === this.options.crop || f.isInsidePlot(g.x, g.y) ? "show" : "hide"](!0) + } + }; + H.prototype.getStacks = function () { + var a = this; + f(a.yAxis, function (a) { + a.stacks && a.hasVisibleSeries && (a.oldStacks = a.stacks) + }); + f(a.series, function (d) { + !d.options.stacking || !0 !== d.visible && !1 !== a.options.chart.ignoreHiddenSeries || (d.stackKey = d.type + l(d.options.stack, "")) + }) + }; + A.prototype.buildStacks = function () { + var a = this.series, d, b = l(this.options.reversedStacks, !0), f = a.length, g; + if (!this.isXAxis) { + this.usePercentage = !1; + for (g = f; g--;)a[b ? g : f - g - 1].setStackedPoints(); + for (g = f; g--;)d = a[b ? g : f - g - 1], d.setStackCliffs && d.setStackCliffs(); + if (this.usePercentage)for (g = + 0; g < f; g++)a[g].setPercentStacks() + } + }; + A.prototype.renderStackTotals = function () { + var a = this.chart, d = a.renderer, b = this.stacks, f, g, l = this.stackTotalGroup; + l || (this.stackTotalGroup = l = d.g("stack-labels").attr({visibility: "visible", zIndex: 6}).add()); + l.translate(a.plotLeft, a.plotTop); + for (f in b)for (g in a = b[f], a)a[g].render(l) + }; + A.prototype.resetStacks = function () { + var a = this.stacks, d, b; + if (!this.isXAxis)for (d in a)for (b in a[d])a[d][b].touched < this.stacksTouched ? (a[d][b].destroy(), delete a[d][b]) : (a[d][b].total = + null, a[d][b].cum = null) + }; + A.prototype.cleanStacks = function () { + var a, d, b; + if (!this.isXAxis)for (d in this.oldStacks && (a = this.stacks = this.oldStacks), a)for (b in a[d])a[d][b].cum = a[d][b].total + }; + a.prototype.setStackedPoints = function () { + if (this.options.stacking && (!0 === this.visible || !1 === this.chart.options.chart.ignoreHiddenSeries)) { + var a = this.processedXData, d = this.processedYData, b = [], f = d.length, g = this.options, t = g.threshold, m = g.startFromThreshold ? t : 0, c = g.stack, g = g.stacking, n = this.stackKey, u = "-" + n, z = this.negStacks, + e = this.yAxis, x = e.stacks, F = e.oldStacks, w, h, y, A, K, I, k; + e.stacksTouched += 1; + for (K = 0; K < f; K++)I = a[K], k = d[K], w = this.getStackIndicator(w, I, this.index), A = w.key, y = (h = z && k < (m ? 0 : t)) ? u : n, x[y] || (x[y] = {}), x[y][I] || (F[y] && F[y][I] ? (x[y][I] = F[y][I], x[y][I].total = null) : x[y][I] = new B(e, e.options.stackLabels, h, I, c)), y = x[y][I], null !== k && (y.points[A] = y.points[this.index] = [l(y.cum, m)], r(y.cum) || (y.base = A), y.touched = e.stacksTouched, 0 < w.index && !1 === this.singleStacks && (y.points[A][0] = y.points[this.index + "," + I + ",0"][0])), "percent" === + g ? (h = h ? n : u, z && x[h] && x[h][I] ? (h = x[h][I], y.total = h.total = Math.max(h.total, y.total) + Math.abs(k) || 0) : y.total = G(y.total + (Math.abs(k) || 0))) : y.total = G(y.total + (k || 0)), y.cum = l(y.cum, m) + (k || 0), null !== k && (y.points[A].push(y.cum), b[K] = y.cum); + "percent" === g && (e.usePercentage = !0); + this.stackedYData = b; + e.oldStacks = {} + } + }; + a.prototype.setPercentStacks = function () { + var a = this, d = a.stackKey, b = a.yAxis.stacks, g = a.processedXData, l; + f([d, "-" + d], function (d) { + for (var f = g.length, c, n; f--;)if (c = g[f], l = a.getStackIndicator(l, c, a.index, + d), c = (n = b[d] && b[d][c]) && n.points[l.key])n = n.total ? 100 / n.total : 0, c[0] = G(c[0] * n), c[1] = G(c[1] * n), a.stackedYData[f] = c[1] + }) + }; + a.prototype.getStackIndicator = function (a, d, b, f) { + !r(a) || a.x !== d || f && a.key !== f ? a = {x: d, index: 0, key: f} : a.index++; + a.key = [b, d, a.index].join(); + return a + } + })(L); + (function (a) { + var B = a.addEvent, A = a.animate, H = a.Axis, G = a.createElement, r = a.css, g = a.defined, f = a.each, u = a.erase, l = a.extend, q = a.fireEvent, d = a.inArray, b = a.isNumber, p = a.isObject, C = a.merge, t = a.pick, m = a.Point, c = a.Series, n = a.seriesTypes, E = a.setAnimation, + z = a.splat; + l(a.Chart.prototype, { + addSeries: function (a, b, c) { + var e, d = this; + a && (b = t(b, !0), q(d, "addSeries", {options: a}, function () { + e = d.initSeries(a); + d.isDirtyLegend = !0; + d.linkSeries(); + b && d.redraw(c) + })); + return e + }, + addAxis: function (a, b, c, d) { + var e = b ? "xAxis" : "yAxis", f = this.options; + a = C(a, {index: this[e].length, isX: b}); + new H(this, a); + f[e] = z(f[e] || {}); + f[e].push(a); + t(c, !0) && this.redraw(d) + }, + showLoading: function (a) { + var b = this, c = b.options, e = b.loadingDiv, d = c.loading, f = function () { + e && r(e, { + left: b.plotLeft + "px", top: b.plotTop + + "px", width: b.plotWidth + "px", height: b.plotHeight + "px" + }) + }; + e || (b.loadingDiv = e = G("div", {className: "highcharts-loading highcharts-loading-hidden"}, null, b.container), b.loadingSpan = G("span", {className: "highcharts-loading-inner"}, null, e), B(b, "redraw", f)); + e.className = "highcharts-loading"; + b.loadingSpan.innerHTML = a || c.lang.loading; + r(e, l(d.style, {zIndex: 10})); + r(b.loadingSpan, d.labelStyle); + b.loadingShown || (r(e, { + opacity: 0, + display: "" + }), A(e, {opacity: d.style.opacity || .5}, {duration: d.showDuration || 0})); + b.loadingShown = !0; + f() + }, + hideLoading: function () { + var a = this.options, b = this.loadingDiv; + b && (b.className = "highcharts-loading highcharts-loading-hidden", A(b, {opacity: 0}, { + duration: a.loading.hideDuration || 100, + complete: function () { + r(b, {display: "none"}) + } + })); + this.loadingShown = !1 + }, + propsRequireDirtyBox: "backgroundColor borderColor borderWidth margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "), + propsRequireUpdateSeries: "chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions".split(" "), + update: function (a, c) { + var e, n = {credits: "addCredits", title: "setTitle", subtitle: "setSubtitle"}, h = a.chart, m, p; + if (h) { + C(!0, this.options.chart, h); + "className" in h && this.setClassName(h.className); + if ("inverted" in h || "polar" in h)this.propFromSeries(), m = !0; + for (e in h)h.hasOwnProperty(e) && (-1 !== d("chart." + e, this.propsRequireUpdateSeries) && (p = !0), -1 !== d(e, this.propsRequireDirtyBox) && (this.isDirtyBox = !0)); + "style" in h && this.renderer.setStyle(h.style) + } + for (e in a) { + if (this[e] && "function" === typeof this[e].update)this[e].update(a[e], !1); else if ("function" === typeof this[n[e]])this[n[e]](a[e]); + "chart" !== e && -1 !== d(e, this.propsRequireUpdateSeries) && (p = !0) + } + a.colors && (this.options.colors = a.colors); + a.plotOptions && C(!0, this.options.plotOptions, a.plotOptions); + f(["xAxis", "yAxis", "series"], function (b) { + a[b] && f(z(a[b]), function (a, c) { + (c = g(a.id) && this.get(a.id) || this[b][c]) && c.coll === b && c.update(a, !1) + }, this) + }, this); + m && f(this.axes, function (a) { + a.update({}, !1) + }); + p && f(this.series, function (a) { + a.update({}, !1) + }); + a.loading && C(!0, this.options.loading, a.loading); + e = h && h.width; + h = h && h.height; + b(e) && e !== this.chartWidth || b(h) && h !== this.chartHeight ? this.setSize(e, h) : t(c, !0) && this.redraw() + }, + setSubtitle: function (a) { + this.setTitle(void 0, a) + } + }); + l(m.prototype, { + update: function (a, b, c, d) { + function e() { + f.applyOptions(a); + null === f.y && n && (f.graphic = n.destroy()); + p(a, !0) && (n && n.element && a && a.marker && a.marker.symbol && (f.graphic = n.destroy()), + a && a.dataLabels && f.dataLabel && (f.dataLabel = f.dataLabel.destroy())); + m = f.index; + g.updateParallelArrays(f, m); + l.data[m] = p(l.data[m], !0) ? f.options : a; + g.isDirty = g.isDirtyData = !0; + !g.fixedBox && g.hasCartesianSeries && (k.isDirtyBox = !0); + "point" === l.legendType && (k.isDirtyLegend = !0); + b && k.redraw(c) + } + + var f = this, g = f.series, n = f.graphic, m, k = g.chart, l = g.options; + b = t(b, !0); + !1 === d ? e() : f.firePointEvent("update", {options: a}, e) + }, remove: function (a, b) { + this.series.removePoint(d(this, this.series.data), a, b) + } + }); + l(c.prototype, { + addPoint: function (a, + b, c, d) { + var e = this.options, f = this.data, g = this.chart, n = this.xAxis, n = n && n.hasNames && n.names, m = e.data, k, p, l = this.xData, q, w; + b = t(b, !0); + k = {series: this}; + this.pointClass.prototype.applyOptions.apply(k, [a]); + w = k.x; + q = l.length; + if (this.requireSorting && w < l[q - 1])for (p = !0; q && l[q - 1] > w;)q--; + this.updateParallelArrays(k, "splice", q, 0, 0); + this.updateParallelArrays(k, q); + n && k.name && (n[w] = k.name); + m.splice(q, 0, a); + p && (this.data.splice(q, 0, null), this.processData()); + "point" === e.legendType && this.generatePoints(); + c && (f[0] && f[0].remove ? + f[0].remove(!1) : (f.shift(), this.updateParallelArrays(k, "shift"), m.shift())); + this.isDirtyData = this.isDirty = !0; + b && g.redraw(d) + }, removePoint: function (a, b, c) { + var e = this, d = e.data, f = d[a], g = e.points, n = e.chart, m = function () { + g && g.length === d.length && g.splice(a, 1); + d.splice(a, 1); + e.options.data.splice(a, 1); + e.updateParallelArrays(f || {series: e}, "splice", a, 1); + f && f.destroy(); + e.isDirty = !0; + e.isDirtyData = !0; + b && n.redraw() + }; + E(c, n); + b = t(b, !0); + f ? f.firePointEvent("remove", null, m) : m() + }, remove: function (a, b, c) { + function e() { + d.destroy(); + f.isDirtyLegend = f.isDirtyBox = !0; + f.linkSeries(); + t(a, !0) && f.redraw(b) + } + + var d = this, f = d.chart; + !1 !== c ? q(d, "remove", null, e) : e() + }, update: function (a, b) { + var c = this, e = this.chart, d = this.userOptions, g = this.type, m = a.type || d.type || e.options.chart.type, p = n[g].prototype, q = ["group", "markerGroup", "dataLabelsGroup"], k; + if (m && m !== g || void 0 !== a.zIndex)q.length = 0; + f(q, function (a) { + q[a] = c[a]; + delete c[a] + }); + a = C(d, {animation: !1, index: this.index, pointStart: this.xData[0]}, {data: this.options.data}, a); + this.remove(!1, null, !1); + for (k in p)this[k] = void 0; + l(this, n[m || g].prototype); + f(q, function (a) { + c[a] = q[a] + }); + this.init(e, a); + e.linkSeries(); + t(b, !0) && e.redraw(!1) + } + }); + l(H.prototype, { + update: function (a, b) { + var c = this.chart; + a = c.options[this.coll][this.options.index] = C(this.userOptions, a); + this.destroy(!0); + this.init(c, l(a, {events: void 0})); + c.isDirtyBox = !0; + t(b, !0) && c.redraw() + }, remove: function (a) { + for (var b = this.chart, c = this.coll, e = this.series, d = e.length; d--;)e[d] && e[d].remove(!1); + u(b.axes, this); + u(b[c], this); + b.options[c].splice(this.options.index, 1); + f(b[c], + function (a, b) { + a.options.index = b + }); + this.destroy(); + b.isDirtyBox = !0; + t(a, !0) && b.redraw() + }, setTitle: function (a, b) { + this.update({title: a}, b) + }, setCategories: function (a, b) { + this.update({categories: a}, b) + } + }) + })(L); + (function (a) { + var B = a.color, A = a.each, H = a.map, G = a.pick, r = a.Series, g = a.seriesType; + g("area", "line", {softThreshold: !1, threshold: 0}, { + singleStacks: !1, getStackPoints: function () { + var a = [], g = [], l = this.xAxis, q = this.yAxis, d = q.stacks[this.stackKey], b = {}, p = this.points, r = this.index, t = q.series, m = t.length, c, n = G(q.options.reversedStacks, + !0) ? 1 : -1, E, z; + if (this.options.stacking) { + for (E = 0; E < p.length; E++)b[p[E].x] = p[E]; + for (z in d)null !== d[z].total && g.push(z); + g.sort(function (a, b) { + return a - b + }); + c = H(t, function () { + return this.visible + }); + A(g, function (e, f) { + var p = 0, t, h; + if (b[e] && !b[e].isNull)a.push(b[e]), A([-1, 1], function (a) { + var p = 1 === a ? "rightNull" : "leftNull", l = 0, q = d[g[f + a]]; + if (q)for (E = r; 0 <= E && E < m;)t = q.points[E], t || (E === r ? b[e][p] = !0 : c[E] && (h = d[e].points[E]) && (l -= h[1] - h[0])), E += n; + b[e][1 === a ? "rightCliff" : "leftCliff"] = l + }); else { + for (E = r; 0 <= E && E < m;) { + if (t = + d[e].points[E]) { + p = t[1]; + break + } + E += n + } + p = q.toPixels(p, !0); + a.push({isNull: !0, plotX: l.toPixels(e, !0), plotY: p, yBottom: p}) + } + }) + } + return a + }, getGraphPath: function (a) { + var f = r.prototype.getGraphPath, g = this.options, q = g.stacking, d = this.yAxis, b, p, C = [], t = [], m = this.index, c, n = d.stacks[this.stackKey], E = g.threshold, z = d.getThreshold(g.threshold), e, g = g.connectNulls || "percent" === q, x = function (b, e, f) { + var h = a[b]; + b = q && n[h.x].points[m]; + var g = h[f + "Null"] || 0; + f = h[f + "Cliff"] || 0; + var p, l, h = !0; + f || g ? (p = (g ? b[0] : b[1]) + f, l = b[0] + f, h = !!g) : !q && + a[e] && a[e].isNull && (p = l = E); + void 0 !== p && (t.push({ + plotX: c, + plotY: null === p ? z : d.getThreshold(p), + isNull: h + }), C.push({plotX: c, plotY: null === l ? z : d.getThreshold(l), doCurve: !1})) + }; + a = a || this.points; + q && (a = this.getStackPoints()); + for (b = 0; b < a.length; b++)if (p = a[b].isNull, c = G(a[b].rectPlotX, a[b].plotX), e = G(a[b].yBottom, z), !p || g)g || x(b, b - 1, "left"), p && !q && g || (t.push(a[b]), C.push({ + x: b, + plotX: c, + plotY: e + })), g || x(b, b + 1, "right"); + b = f.call(this, t, !0, !0); + C.reversed = !0; + p = f.call(this, C, !0, !0); + p.length && (p[0] = "L"); + p = b.concat(p); + f = + f.call(this, t, !1, g); + p.xMap = b.xMap; + this.areaPath = p; + return f + }, drawGraph: function () { + this.areaPath = []; + r.prototype.drawGraph.apply(this); + var a = this, g = this.areaPath, l = this.options, q = [["area", "highcharts-area", this.color, l.fillColor]]; + A(this.zones, function (d, b) { + q.push(["zone-area-" + b, "highcharts-area highcharts-zone-area-" + b + " " + d.className, d.color || a.color, d.fillColor || l.fillColor]) + }); + A(q, function (d) { + var b = d[0], f = a[b]; + f ? (f.endX = g.xMap, f.animate({d: g})) : (f = a[b] = a.chart.renderer.path(g).addClass(d[1]).attr({ + fill: G(d[3], + B(d[2]).setOpacity(G(l.fillOpacity, .75)).get()), zIndex: 0 + }).add(a.group), f.isArea = !0); + f.startX = g.xMap; + f.shiftUnit = l.step ? 2 : 1 + }) + }, drawLegendSymbol: a.LegendSymbolMixin.drawRectangle + }) + })(L); + (function (a) { + var B = a.pick; + a = a.seriesType; + a("spline", "line", {}, { + getPointSpline: function (a, H, G) { + var r = H.plotX, g = H.plotY, f = a[G - 1]; + G = a[G + 1]; + var u, l, q, d; + if (f && !f.isNull && !1 !== f.doCurve && G && !G.isNull && !1 !== G.doCurve) { + a = f.plotY; + q = G.plotX; + G = G.plotY; + var b = 0; + u = (1.5 * r + f.plotX) / 2.5; + l = (1.5 * g + a) / 2.5; + q = (1.5 * r + q) / 2.5; + d = (1.5 * g + G) / 2.5; + q !== u && (b = (d - l) * (q - r) / (q - u) + g - d); + l += b; + d += b; + l > a && l > g ? (l = Math.max(a, g), d = 2 * g - l) : l < a && l < g && (l = Math.min(a, g), d = 2 * g - l); + d > G && d > g ? (d = Math.max(G, g), l = 2 * g - d) : d < G && d < g && (d = Math.min(G, g), l = 2 * g - d); + H.rightContX = q; + H.rightContY = d + } + H = ["C", B(f.rightContX, f.plotX), B(f.rightContY, f.plotY), B(u, r), B(l, g), r, g]; + f.rightContX = f.rightContY = null; + return H + } + }) + })(L); + (function (a) { + var B = a.seriesTypes.area.prototype, A = a.seriesType; + A("areaspline", "spline", a.defaultPlotOptions.area, { + getStackPoints: B.getStackPoints, + getGraphPath: B.getGraphPath, + setStackCliffs: B.setStackCliffs, + drawGraph: B.drawGraph, + drawLegendSymbol: a.LegendSymbolMixin.drawRectangle + }) + })(L); + (function (a) { + var B = a.animObject, A = a.color, H = a.each, G = a.extend, r = a.isNumber, g = a.merge, f = a.pick, u = a.Series, l = a.seriesType, q = a.svg; + l("column", "line", { + borderRadius: 0, + groupPadding: .2, + marker: null, + pointPadding: .1, + minPointLength: 0, + cropThreshold: 50, + pointRange: null, + states: { + hover: {halo: !1, brightness: .1, shadow: !1}, + select: {color: "#cccccc", borderColor: "#000000", shadow: !1} + }, + dataLabels: { + align: null, verticalAlign: null, + y: null + }, + softThreshold: !1, + startFromThreshold: !0, + stickyTracking: !1, + tooltip: {distance: 6}, + threshold: 0, + borderColor: "#ffffff" + }, { + cropShoulder: 0, + directTouch: !0, + trackerGroups: ["group", "dataLabelsGroup"], + negStacks: !0, + init: function () { + u.prototype.init.apply(this, arguments); + var a = this, b = a.chart; + b.hasRendered && H(b.series, function (b) { + b.type === a.type && (b.isDirty = !0) + }) + }, + getColumnMetrics: function () { + var a = this, b = a.options, g = a.xAxis, l = a.yAxis, t = g.reversed, m, c = {}, n = 0; + !1 === b.grouping ? n = 1 : H(a.chart.series, function (b) { + var e = + b.options, d = b.yAxis, f; + b.type === a.type && b.visible && l.len === d.len && l.pos === d.pos && (e.stacking ? (m = b.stackKey, void 0 === c[m] && (c[m] = n++), f = c[m]) : !1 !== e.grouping && (f = n++), b.columnIndex = f) + }); + var q = Math.min(Math.abs(g.transA) * (g.ordinalSlope || b.pointRange || g.closestPointRange || g.tickInterval || 1), g.len), r = q * b.groupPadding, e = (q - 2 * r) / (n || 1), b = Math.min(b.maxPointWidth || g.len, f(b.pointWidth, e * (1 - 2 * b.pointPadding))); + a.columnMetrics = { + width: b, + offset: (e - b) / 2 + (r + ((a.columnIndex || 0) + (t ? 1 : 0)) * e - q / 2) * (t ? -1 : 1) + }; + return a.columnMetrics + }, + crispCol: function (a, b, f, g) { + var d = this.chart, m = this.borderWidth, c = -(m % 2 ? .5 : 0), m = m % 2 ? .5 : 1; + d.inverted && d.renderer.isVML && (m += 1); + f = Math.round(a + f) + c; + a = Math.round(a) + c; + g = Math.round(b + g) + m; + c = .5 >= Math.abs(b) && .5 < g; + b = Math.round(b) + m; + g -= b; + c && g && (--b, g += 1); + return {x: a, y: b, width: f - a, height: g} + }, + translate: function () { + var a = this, b = a.chart, g = a.options, l = a.dense = 2 > a.closestPointRange * a.xAxis.transA, l = a.borderWidth = f(g.borderWidth, l ? 0 : 1), t = a.yAxis, m = a.translatedThreshold = t.getThreshold(g.threshold), c = f(g.minPointLength, + 5), n = a.getColumnMetrics(), q = n.width, r = a.barW = Math.max(q, 1 + 2 * l), e = a.pointXOffset = n.offset; + b.inverted && (m -= .5); + g.pointPadding && (r = Math.ceil(r)); + u.prototype.translate.apply(a); + H(a.points, function (d) { + var g = f(d.yBottom, m), n = 999 + Math.abs(g), n = Math.min(Math.max(-n, d.plotY), t.len + n), h = d.plotX + e, l = r, p = Math.min(n, g), z, x = Math.max(n, g) - p; + Math.abs(x) < c && c && (x = c, z = !t.reversed && !d.negative || t.reversed && d.negative, p = Math.abs(p - m) > c ? g - c : m - (z ? c : 0)); + d.barX = h; + d.pointWidth = q; + d.tooltipPos = b.inverted ? [t.len + t.pos - b.plotLeft - + n, a.xAxis.len - h - l / 2, x] : [h + l / 2, n + t.pos - b.plotTop, x]; + d.shapeType = "rect"; + d.shapeArgs = a.crispCol.apply(a, d.isNull ? [d.plotX, t.len / 2, 0, 0] : [h, p, l, x]) + }) + }, + getSymbol: a.noop, + drawLegendSymbol: a.LegendSymbolMixin.drawRectangle, + drawGraph: function () { + this.group[this.dense ? "addClass" : "removeClass"]("highcharts-dense-data") + }, + pointAttribs: function (a, b) { + var d = this.options, f, g = this.pointAttrToOptions || {}; + f = g.stroke || "borderColor"; + var m = g["stroke-width"] || "borderWidth", c = a && a.color || this.color, n = a[f] || d[f] || this.color || + c, l = a[m] || d[m] || this[m] || 0, g = d.dashStyle; + a && this.zones.length && (c = (c = a.getZone()) && c.color || a.options.color || this.color); + b && (a = d.states[b], b = a.brightness, c = a.color || void 0 !== b && A(c).brighten(a.brightness).get() || c, n = a[f] || n, l = a[m] || l, g = a.dashStyle || g); + f = {fill: c, stroke: n, "stroke-width": l}; + d.borderRadius && (f.r = d.borderRadius); + g && (f.dashstyle = g); + return f + }, + drawPoints: function () { + var a = this, b = this.chart, f = a.options, l = b.renderer, t = f.animationLimit || 250, m; + H(a.points, function (c) { + var d = c.graphic; + if (r(c.plotY) && + null !== c.y) { + m = c.shapeArgs; + if (d)d[b.pointCount < t ? "animate" : "attr"](g(m)); else c.graphic = d = l[c.shapeType](m).attr({"class": c.getClassName()}).add(c.group || a.group); + d.attr(a.pointAttribs(c, c.selected && "select")).shadow(f.shadow, null, f.stacking && !f.borderRadius) + } else d && (c.graphic = d.destroy()) + }) + }, + animate: function (a) { + var b = this, d = this.yAxis, f = b.options, g = this.chart.inverted, m = {}; + q && (a ? (m.scaleY = .001, a = Math.min(d.pos + d.len, Math.max(d.pos, d.toPixels(f.threshold))), g ? m.translateX = a - d.len : m.translateY = a, b.group.attr(m)) : + (m[g ? "translateX" : "translateY"] = d.pos, b.group.animate(m, G(B(b.options.animation), { + step: function (a, d) { + b.group.attr({scaleY: Math.max(.001, d.pos)}) + } + })), b.animate = null)) + }, + remove: function () { + var a = this, b = a.chart; + b.hasRendered && H(b.series, function (b) { + b.type === a.type && (b.isDirty = !0) + }); + u.prototype.remove.apply(a, arguments) + } + }) + })(L); + (function (a) { + a = a.seriesType; + a("bar", "column", null, {inverted: !0}) + })(L); + (function (a) { + var B = a.Series; + a = a.seriesType; + a("scatter", "line", { + lineWidth: 0, marker: {enabled: !0}, tooltip: { + headerFormat: '\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e \x3cspan style\x3d"font-size: 0.85em"\x3e {series.name}\x3c/span\x3e\x3cbr/\x3e', + pointFormat: "x: \x3cb\x3e{point.x}\x3c/b\x3e\x3cbr/\x3ey: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3e" + } + }, { + sorted: !1, + requireSorting: !1, + noSharedTooltip: !0, + trackerGroups: ["group", "markerGroup", "dataLabelsGroup"], + takeOrdinalPosition: !1, + kdDimensions: 2, + drawGraph: function () { + this.options.lineWidth && B.prototype.drawGraph.call(this) + } + }) + })(L); + (function (a) { + var B = a.pick, A = a.relativeLength; + a.CenteredSeriesMixin = { + getCenter: function () { + var a = this.options, G = this.chart, r = 2 * (a.slicedOffset || 0), g = G.plotWidth - 2 * r, G = G.plotHeight - + 2 * r, f = a.center, f = [B(f[0], "50%"), B(f[1], "50%"), a.size || "100%", a.innerSize || 0], u = Math.min(g, G), l, q; + for (l = 0; 4 > l; ++l)q = f[l], a = 2 > l || 2 === l && /%$/.test(q), f[l] = A(q, [g, G, u, f[2]][l]) + (a ? r : 0); + f[3] > f[2] && (f[3] = f[2]); + return f + } + } + })(L); + (function (a) { + var B = a.addEvent, A = a.defined, H = a.each, G = a.extend, r = a.inArray, g = a.noop, f = a.pick, u = a.Point, l = a.Series, q = a.seriesType, d = a.setAnimation; + q("pie", "line", { + center: [null, null], + clip: !1, + colorByPoint: !0, + dataLabels: { + distance: 30, enabled: !0, formatter: function () { + return null === this.y ? + void 0 : this.point.name + }, x: 0 + }, + ignoreHiddenPoint: !0, + legendType: "point", + marker: null, + size: null, + showInLegend: !1, + slicedOffset: 10, + stickyTracking: !1, + tooltip: {followPointer: !0}, + borderColor: "#ffffff", + borderWidth: 1, + states: {hover: {brightness: .1, shadow: !1}} + }, { + isCartesian: !1, + requireSorting: !1, + directTouch: !0, + noSharedTooltip: !0, + trackerGroups: ["group", "dataLabelsGroup"], + axisTypes: [], + pointAttribs: a.seriesTypes.column.prototype.pointAttribs, + animate: function (a) { + var b = this, d = b.points, f = b.startAngleRad; + a || (H(d, function (a) { + var c = + a.graphic, d = a.shapeArgs; + c && (c.attr({r: a.startR || b.center[3] / 2, start: f, end: f}), c.animate({ + r: d.r, + start: d.start, + end: d.end + }, b.options.animation)) + }), b.animate = null) + }, + updateTotals: function () { + var a, d = 0, f = this.points, g = f.length, m, c = this.options.ignoreHiddenPoint; + for (a = 0; a < g; a++)m = f[a], 0 > m.y && (m.y = null), d += c && !m.visible ? 0 : m.y; + this.total = d; + for (a = 0; a < g; a++)m = f[a], m.percentage = 0 < d && (m.visible || !c) ? m.y / d * 100 : 0, m.total = d + }, + generatePoints: function () { + l.prototype.generatePoints.call(this); + this.updateTotals() + }, + translate: function (a) { + this.generatePoints(); + var b = 0, d = this.options, g = d.slicedOffset, m = g + (d.borderWidth || 0), c, n, l, q = d.startAngle || 0, e = this.startAngleRad = Math.PI / 180 * (q - 90), q = (this.endAngleRad = Math.PI / 180 * (f(d.endAngle, q + 360) - 90)) - e, r = this.points, u = d.dataLabels.distance, d = d.ignoreHiddenPoint, w, h = r.length, y; + a || (this.center = a = this.getCenter()); + this.getX = function (b, c) { + l = Math.asin(Math.min((b - a[1]) / (a[2] / 2 + u), 1)); + return a[0] + (c ? -1 : 1) * Math.cos(l) * (a[2] / 2 + u) + }; + for (w = 0; w < h; w++) { + y = r[w]; + c = e + b * q; + if (!d || y.visible)b += y.percentage / 100; + n = e + b * q; + y.shapeType = + "arc"; + y.shapeArgs = { + x: a[0], + y: a[1], + r: a[2] / 2, + innerR: a[3] / 2, + start: Math.round(1E3 * c) / 1E3, + end: Math.round(1E3 * n) / 1E3 + }; + l = (n + c) / 2; + l > 1.5 * Math.PI ? l -= 2 * Math.PI : l < -Math.PI / 2 && (l += 2 * Math.PI); + y.slicedTranslation = { + translateX: Math.round(Math.cos(l) * g), + translateY: Math.round(Math.sin(l) * g) + }; + c = Math.cos(l) * a[2] / 2; + n = Math.sin(l) * a[2] / 2; + y.tooltipPos = [a[0] + .7 * c, a[1] + .7 * n]; + y.half = l < -Math.PI / 2 || l > Math.PI / 2 ? 1 : 0; + y.angle = l; + m = Math.min(m, u / 5); + y.labelPos = [a[0] + c + Math.cos(l) * u, a[1] + n + Math.sin(l) * u, a[0] + c + Math.cos(l) * m, a[1] + n + Math.sin(l) * + m, a[0] + c, a[1] + n, 0 > u ? "center" : y.half ? "right" : "left", l] + } + }, + drawGraph: null, + drawPoints: function () { + var a = this, d = a.chart.renderer, f, g, m, c, n = a.options.shadow; + n && !a.shadowGroup && (a.shadowGroup = d.g("shadow").add(a.group)); + H(a.points, function (b) { + if (null !== b.y) { + g = b.graphic; + c = b.shapeArgs; + f = b.sliced ? b.slicedTranslation : {}; + var l = b.shadowGroup; + n && !l && (l = b.shadowGroup = d.g("shadow").add(a.shadowGroup)); + l && l.attr(f); + m = a.pointAttribs(b, b.selected && "select"); + g ? g.setRadialReference(a.center).attr(m).animate(G(c, f)) : (b.graphic = + g = d[b.shapeType](c).addClass(b.getClassName()).setRadialReference(a.center).attr(f).add(a.group), b.visible || g.attr({visibility: "hidden"}), g.attr(m).attr({"stroke-linejoin": "round"}).shadow(n, l)) + } + }) + }, + searchPoint: g, + sortByAngle: function (a, d) { + a.sort(function (a, b) { + return void 0 !== a.angle && (b.angle - a.angle) * d + }) + }, + drawLegendSymbol: a.LegendSymbolMixin.drawRectangle, + getCenter: a.CenteredSeriesMixin.getCenter, + getSymbol: g + }, { + init: function () { + u.prototype.init.apply(this, arguments); + var a = this, d; + a.name = f(a.name, "Slice"); + d = function (b) { + a.slice("select" === b.type) + }; + B(a, "select", d); + B(a, "unselect", d); + return a + }, setVisible: function (a, d) { + var b = this, g = b.series, m = g.chart, c = g.options.ignoreHiddenPoint; + d = f(d, c); + a !== b.visible && (b.visible = b.options.visible = a = void 0 === a ? !b.visible : a, g.options.data[r(b, g.data)] = b.options, H(["graphic", "dataLabel", "connector", "shadowGroup"], function (c) { + if (b[c])b[c][a ? "show" : "hide"](!0) + }), b.legendItem && m.legend.colorizeItem(b, a), a || "hover" !== b.state || b.setState(""), c && (g.isDirty = !0), d && m.redraw()) + }, + slice: function (a, g, l) { + var b = this.series; + d(l, b.chart); + f(g, !0); + this.sliced = this.options.sliced = a = A(a) ? a : !this.sliced; + b.options.data[r(this, b.data)] = this.options; + a = a ? this.slicedTranslation : {translateX: 0, translateY: 0}; + this.graphic.animate(a); + this.shadowGroup && this.shadowGroup.animate(a) + }, haloPath: function (a) { + var b = this.shapeArgs; + return this.sliced || !this.visible ? [] : this.series.chart.renderer.symbols.arc(b.x, b.y, b.r + a, b.r + a, { + innerR: this.shapeArgs.r, + start: b.start, + end: b.end + }) + } + }) + })(L); + (function (a) { + var B = + a.addEvent, A = a.arrayMax, H = a.defined, G = a.each, r = a.extend, g = a.format, f = a.map, u = a.merge, l = a.noop, q = a.pick, d = a.relativeLength, b = a.Series, p = a.seriesTypes, C = a.stableSort; + a.distribute = function (a, b) { + function c(a, b) { + return a.target - b.target + } + + var d, g = !0, m = a, e = [], l; + l = 0; + for (d = a.length; d--;)l += a[d].size; + if (l > b) { + C(a, function (a, b) { + return (b.rank || 0) - (a.rank || 0) + }); + for (l = d = 0; l <= b;)l += a[d].size, d++; + e = a.splice(d - 1, a.length) + } + C(a, c); + for (a = f(a, function (a) { + return {size: a.size, targets: [a.target]} + }); g;) { + for (d = a.length; d--;)g = + a[d], l = (Math.min.apply(0, g.targets) + Math.max.apply(0, g.targets)) / 2, g.pos = Math.min(Math.max(0, l - g.size / 2), b - g.size); + d = a.length; + for (g = !1; d--;)0 < d && a[d - 1].pos + a[d - 1].size > a[d].pos && (a[d - 1].size += a[d].size, a[d - 1].targets = a[d - 1].targets.concat(a[d].targets), a[d - 1].pos + a[d - 1].size > b && (a[d - 1].pos = b - a[d - 1].size), a.splice(d, 1), g = !0) + } + d = 0; + G(a, function (a) { + var b = 0; + G(a.targets, function () { + m[d].pos = a.pos + b; + b += m[d].size; + d++ + }) + }); + m.push.apply(m, e); + C(m, c) + }; + b.prototype.drawDataLabels = function () { + var a = this, b = a.options, + c = b.dataLabels, d = a.points, f, l, e = a.hasRendered || 0, p, r, w = q(c.defer, !0), h = a.chart.renderer; + if (c.enabled || a._hasPointLabels)a.dlProcessOptions && a.dlProcessOptions(c), r = a.plotGroup("dataLabelsGroup", "data-labels", w && !e ? "hidden" : "visible", c.zIndex || 6), w && (r.attr({opacity: +e}), e || B(a, "afterAnimate", function () { + a.visible && r.show(!0); + r[b.animation ? "animate" : "attr"]({opacity: 1}, {duration: 200}) + })), l = c, G(d, function (e) { + var d, m = e.dataLabel, n, k, t, z = e.connector, w = !m, x; + f = e.dlOptions || e.options && e.options.dataLabels; + if (d = q(f && f.enabled, l.enabled) && null !== e.y)for (k in c = u(l, f), n = e.getLabelConfig(), p = c.format ? g(c.format, n) : c.formatter.call(n, c), x = c.style, t = c.rotation, x.color = q(c.color, x.color, a.color, "#000000"), "contrast" === x.color && (x.color = c.inside || 0 > c.distance || b.stacking ? h.getContrast(e.color || a.color) : "#000000"), b.cursor && (x.cursor = b.cursor), n = { + fill: c.backgroundColor, + stroke: c.borderColor, + "stroke-width": c.borderWidth, + r: c.borderRadius || 0, + rotation: t, + padding: c.padding, + zIndex: 1 + }, n)void 0 === n[k] && delete n[k]; + !m || + d && H(p) ? d && H(p) && (m ? n.text = p : (m = e.dataLabel = h[t ? "text" : "label"](p, 0, -9999, c.shape, null, null, c.useHTML, null, "data-label"), m.addClass("highcharts-data-label-color-" + e.colorIndex + " " + (c.className || "") + (c.useHTML ? "highcharts-tracker" : ""))), m.attr(n), m.css(x).shadow(c.shadow), m.added || m.add(r), a.alignDataLabel(e, m, c, null, w)) : (e.dataLabel = m.destroy(), z && (e.connector = z.destroy())) + }) + }; + b.prototype.alignDataLabel = function (a, b, c, d, f) { + var g = this.chart, e = g.inverted, m = q(a.plotX, -9999), n = q(a.plotY, -9999), l = b.getBBox(), + h, p = c.rotation, t = c.align, u = this.visible && (a.series.forceDL || g.isInsidePlot(m, Math.round(n), e) || d && g.isInsidePlot(m, e ? d.x + 1 : d.y + d.height - 1, e)), E = "justify" === q(c.overflow, "justify"); + u && (h = c.style.fontSize, h = g.renderer.fontMetrics(h, b).b, d = r({ + x: e ? g.plotWidth - n : m, + y: Math.round(e ? g.plotHeight - m : n), + width: 0, + height: 0 + }, d), r(c, { + width: l.width, + height: l.height + }), p ? (E = !1, e = g.renderer.rotCorr(h, p), e = { + x: d.x + c.x + d.width / 2 + e.x, + y: d.y + c.y + {top: 0, middle: .5, bottom: 1}[c.verticalAlign] * d.height + }, b[f ? "attr" : "animate"](e).attr({align: t}), + m = (p + 720) % 360, m = 180 < m && 360 > m, "left" === t ? e.y -= m ? l.height : 0 : "center" === t ? (e.x -= l.width / 2, e.y -= l.height / 2) : "right" === t && (e.x -= l.width, e.y -= m ? 0 : l.height)) : (b.align(c, null, d), e = b.alignAttr), E ? this.justifyDataLabel(b, c, e, l, d, f) : q(c.crop, !0) && (u = g.isInsidePlot(e.x, e.y) && g.isInsidePlot(e.x + l.width, e.y + l.height)), c.shape && !p && b.attr({ + anchorX: a.plotX, + anchorY: a.plotY + })); + u || (b.attr({y: -9999}), b.placed = !1) + }; + b.prototype.justifyDataLabel = function (a, b, c, d, f, g) { + var e = this.chart, m = b.align, n = b.verticalAlign, l, h, p = a.box ? + 0 : a.padding || 0; + l = c.x + p; + 0 > l && ("right" === m ? b.align = "left" : b.x = -l, h = !0); + l = c.x + d.width - p; + l > e.plotWidth && ("left" === m ? b.align = "right" : b.x = e.plotWidth - l, h = !0); + l = c.y + p; + 0 > l && ("bottom" === n ? b.verticalAlign = "top" : b.y = -l, h = !0); + l = c.y + d.height - p; + l > e.plotHeight && ("top" === n ? b.verticalAlign = "bottom" : b.y = e.plotHeight - l, h = !0); + h && (a.placed = !g, a.align(b, null, f)) + }; + p.pie && (p.pie.prototype.drawDataLabels = function () { + var d = this, g = d.data, c, l = d.chart, p = d.options.dataLabels, r = q(p.connectorPadding, 10), e = q(p.connectorWidth, 1), u = + l.plotWidth, F = l.plotHeight, w, h = p.distance, y = d.center, C = y[2] / 2, B = y[1], H = 0 < h, k, D, L, N, S = [[], []], O, v, M, Q, R = [0, 0, 0, 0]; + d.visible && (p.enabled || d._hasPointLabels) && (b.prototype.drawDataLabels.apply(d), G(g, function (a) { + a.dataLabel && a.visible && (S[a.half].push(a), a.dataLabel._pos = null) + }), G(S, function (b, e) { + var g, m, n = b.length, q, t, z; + if (n)for (d.sortByAngle(b, e - .5), 0 < h && (g = Math.max(0, B - C - h), m = Math.min(B + C + h, l.plotHeight), q = f(b, function (a) { + if (a.dataLabel)return z = a.dataLabel.getBBox().height || 21, { + target: a.labelPos[1] - + g + z / 2, size: z, rank: a.y + } + }), a.distribute(q, m + z - g)), Q = 0; Q < n; Q++)c = b[Q], L = c.labelPos, k = c.dataLabel, M = !1 === c.visible ? "hidden" : "inherit", t = L[1], q ? void 0 === q[Q].pos ? M = "hidden" : (N = q[Q].size, v = g + q[Q].pos) : v = t, O = p.justify ? y[0] + (e ? -1 : 1) * (C + h) : d.getX(v < g + 2 || v > m - 2 ? t : v, e), k._attr = { + visibility: M, + align: L[6] + }, k._pos = { + x: O + p.x + ({left: r, right: -r}[L[6]] || 0), + y: v + p.y - 10 + }, L.x = O, L.y = v, null === d.options.size && (D = k.width, O - D < r ? R[3] = Math.max(Math.round(D - O + r), R[3]) : O + D > u - r && (R[1] = Math.max(Math.round(O + D - u + r), R[1])), 0 > v - N / 2 ? R[0] = + Math.max(Math.round(-v + N / 2), R[0]) : v + N / 2 > F && (R[2] = Math.max(Math.round(v + N / 2 - F), R[2]))) + }), 0 === A(R) || this.verifyDataLabelOverflow(R)) && (this.placeDataLabels(), H && e && G(this.points, function (a) { + var b; + w = a.connector; + if ((k = a.dataLabel) && k._pos && a.visible) { + M = k._attr.visibility; + if (b = !w)a.connector = w = l.renderer.path().addClass("highcharts-data-label-connector highcharts-color-" + a.colorIndex).add(d.dataLabelsGroup), w.attr({ + "stroke-width": e, + stroke: p.connectorColor || a.color || "#666666" + }); + w[b ? "attr" : "animate"]({d: d.connectorPath(a.labelPos)}); + w.attr("visibility", M) + } else w && (a.connector = w.destroy()) + })) + }, p.pie.prototype.connectorPath = function (a) { + var b = a.x, c = a.y; + return q(this.options.dataLabels.softConnector, !0) ? ["M", b + ("left" === a[6] ? 5 : -5), c, "C", b, c, 2 * a[2] - a[4], 2 * a[3] - a[5], a[2], a[3], "L", a[4], a[5]] : ["M", b + ("left" === a[6] ? 5 : -5), c, "L", a[2], a[3], "L", a[4], a[5]] + }, p.pie.prototype.placeDataLabels = function () { + G(this.points, function (a) { + var b = a.dataLabel; + b && a.visible && ((a = b._pos) ? (b.attr(b._attr), b[b.moved ? "animate" : "attr"](a), b.moved = !0) : b && b.attr({y: -9999})) + }) + }, + p.pie.prototype.alignDataLabel = l, p.pie.prototype.verifyDataLabelOverflow = function (a) { + var b = this.center, c = this.options, f = c.center, g = c.minSize || 80, l, e; + null !== f[0] ? l = Math.max(b[2] - Math.max(a[1], a[3]), g) : (l = Math.max(b[2] - a[1] - a[3], g), b[0] += (a[3] - a[1]) / 2); + null !== f[1] ? l = Math.max(Math.min(l, b[2] - Math.max(a[0], a[2])), g) : (l = Math.max(Math.min(l, b[2] - a[0] - a[2]), g), b[1] += (a[0] - a[2]) / 2); + l < b[2] ? (b[2] = l, b[3] = Math.min(d(c.innerSize || 0, l), l), this.translate(b), this.drawDataLabels && this.drawDataLabels()) : e = !0; + return e + }); + p.column && (p.column.prototype.alignDataLabel = function (a, d, c, f, g) { + var l = this.chart.inverted, e = a.series, m = a.dlBox || a.shapeArgs, n = q(a.below, a.plotY > q(this.translatedThreshold, e.yAxis.len)), p = q(c.inside, !!this.options.stacking); + m && (f = u(m), 0 > f.y && (f.height += f.y, f.y = 0), m = f.y + f.height - e.yAxis.len, 0 < m && (f.height -= m), l && (f = { + x: e.yAxis.len - f.y - f.height, + y: e.xAxis.len - f.x - f.width, + width: f.height, + height: f.width + }), p || (l ? (f.x += n ? 0 : f.width, f.width = 0) : (f.y += n ? f.height : 0, f.height = 0))); + c.align = q(c.align, !l || p ? "center" : + n ? "right" : "left"); + c.verticalAlign = q(c.verticalAlign, l || p ? "middle" : n ? "top" : "bottom"); + b.prototype.alignDataLabel.call(this, a, d, c, f, g) + }) + })(L); + (function (a) { + var B = a.Chart, A = a.each, H = a.pick, G = a.addEvent; + B.prototype.callbacks.push(function (a) { + function g() { + var f = []; + A(a.series, function (a) { + var g = a.options.dataLabels, q = a.dataLabelCollections || ["dataLabel"]; + (g.enabled || a._hasPointLabels) && !g.allowOverlap && a.visible && A(q, function (d) { + A(a.points, function (a) { + a[d] && (a[d].labelrank = H(a.labelrank, a.shapeArgs && a.shapeArgs.height), + f.push(a[d])) + }) + }) + }); + a.hideOverlappingLabels(f) + } + + g(); + G(a, "redraw", g) + }); + B.prototype.hideOverlappingLabels = function (a) { + var g = a.length, f, r, l, q, d, b, p, C, t, m = function (a, b, d, f, e, g, l, m) { + return !(e > a + d || e + l < a || g > b + f || g + m < b) + }; + for (r = 0; r < g; r++)if (f = a[r])f.oldOpacity = f.opacity, f.newOpacity = 1; + a.sort(function (a, b) { + return (b.labelrank || 0) - (a.labelrank || 0) + }); + for (r = 0; r < g; r++)for (l = a[r], f = r + 1; f < g; ++f)if (q = a[f], l && q && l.placed && q.placed && 0 !== l.newOpacity && 0 !== q.newOpacity && (d = l.alignAttr, b = q.alignAttr, p = l.parentGroup, C = q.parentGroup, + t = 2 * (l.box ? 0 : l.padding), d = m(d.x + p.translateX, d.y + p.translateY, l.width - t, l.height - t, b.x + C.translateX, b.y + C.translateY, q.width - t, q.height - t)))(l.labelrank < q.labelrank ? l : q).newOpacity = 0; + A(a, function (a) { + var b, c; + a && (c = a.newOpacity, a.oldOpacity !== c && a.placed && (c ? a.show(!0) : b = function () { + a.hide() + }, a.alignAttr.opacity = c, a[a.isOld ? "animate" : "attr"](a.alignAttr, null, b)), a.isOld = !0) + }) + } + })(L); + (function (a) { + var B = a.addEvent, A = a.Chart, H = a.createElement, G = a.css, r = a.defaultOptions, g = a.defaultPlotOptions, f = a.each, u = + a.extend, l = a.fireEvent, q = a.hasTouch, d = a.inArray, b = a.isObject, p = a.Legend, C = a.merge, t = a.pick, m = a.Point, c = a.Series, n = a.seriesTypes, E = a.svg; + a = a.TrackerMixin = { + drawTrackerPoint: function () { + var a = this, b = a.chart, c = b.pointer, d = function (a) { + for (var c = a.target, e; c && !e;)e = c.point, c = c.parentNode; + if (void 0 !== e && e !== b.hoverPoint)e.onMouseOver(a) + }; + f(a.points, function (a) { + a.graphic && (a.graphic.element.point = a); + a.dataLabel && (a.dataLabel.div ? a.dataLabel.div.point = a : a.dataLabel.element.point = a) + }); + a._hasTracking || (f(a.trackerGroups, + function (b) { + if (a[b]) { + a[b].addClass("highcharts-tracker").on("mouseover", d).on("mouseout", function (a) { + c.onTrackerMouseOut(a) + }); + if (q)a[b].on("touchstart", d); + a.options.cursor && a[b].css(G).css({cursor: a.options.cursor}) + } + }), a._hasTracking = !0) + }, drawTrackerGraph: function () { + var a = this, b = a.options, c = b.trackByArea, d = [].concat(c ? a.areaPath : a.graphPath), g = d.length, h = a.chart, l = h.pointer, m = h.renderer, n = h.options.tooltip.snap, p = a.tracker, k, r = function () { + if (h.hoverSeries !== a)a.onMouseOver() + }, t = "rgba(192,192,192," + + (E ? .0001 : .002) + ")"; + if (g && !c)for (k = g + 1; k--;)"M" === d[k] && d.splice(k + 1, 0, d[k + 1] - n, d[k + 2], "L"), (k && "M" === d[k] || k === g) && d.splice(k, 0, "L", d[k - 2] + n, d[k - 1]); + p ? p.attr({d: d}) : a.graph && (a.tracker = m.path(d).attr({ + "stroke-linejoin": "round", + visibility: a.visible ? "visible" : "hidden", + stroke: t, + fill: c ? t : "none", + "stroke-width": a.graph.strokeWidth() + (c ? 0 : 2 * n), + zIndex: 2 + }).add(a.group), f([a.tracker, a.markerGroup], function (a) { + a.addClass("highcharts-tracker").on("mouseover", r).on("mouseout", function (a) { + l.onTrackerMouseOut(a) + }); + b.cursor && a.css({cursor: b.cursor}); + if (q)a.on("touchstart", r) + })) + } + }; + n.column && (n.column.prototype.drawTracker = a.drawTrackerPoint); + n.pie && (n.pie.prototype.drawTracker = a.drawTrackerPoint); + n.scatter && (n.scatter.prototype.drawTracker = a.drawTrackerPoint); + u(p.prototype, { + setItemEvents: function (a, b, c) { + var e = this, d = e.chart, f = "highcharts-legend-" + (a.series ? "point" : "series") + "-active"; + (c ? b : a.legendGroup).on("mouseover", function () { + a.setState("hover"); + d.seriesGroup.addClass(f); + b.css(e.options.itemHoverStyle) + }).on("mouseout", + function () { + b.css(a.visible ? e.itemStyle : e.itemHiddenStyle); + d.seriesGroup.removeClass(f); + a.setState() + }).on("click", function (b) { + var c = function () { + a.setVisible && a.setVisible() + }; + b = {browserEvent: b}; + a.firePointEvent ? a.firePointEvent("legendItemClick", b, c) : l(a, "legendItemClick", b, c) + }) + }, createCheckboxForItem: function (a) { + a.checkbox = H("input", { + type: "checkbox", + checked: a.selected, + defaultChecked: a.selected + }, this.options.itemCheckboxStyle, this.chart.container); + B(a.checkbox, "click", function (b) { + l(a.series || a, "checkboxClick", + {checked: b.target.checked, item: a}, function () { + a.select() + }) + }) + } + }); + r.legend.itemStyle.cursor = "pointer"; + u(A.prototype, { + showResetZoom: function () { + var a = this, b = r.lang, c = a.options.chart.resetZoomButton, d = c.theme, f = d.states, g = "chart" === c.relativeTo ? null : "plotBox"; + this.resetZoomButton = a.renderer.button(b.resetZoom, null, null, function () { + a.zoomOut() + }, d, f && f.hover).attr({ + align: c.position.align, + title: b.resetZoomTitle + }).addClass("highcharts-reset-zoom").add().align(c.position, !1, g) + }, zoomOut: function () { + var a = this; + l(a, "selection", {resetSelection: !0}, function () { + a.zoom() + }) + }, zoom: function (a) { + var c, d = this.pointer, g = !1, l; + !a || a.resetSelection ? f(this.axes, function (a) { + c = a.zoom() + }) : f(a.xAxis.concat(a.yAxis), function (a) { + var b = a.axis; + d[b.isXAxis ? "zoomX" : "zoomY"] && (c = b.zoom(a.min, a.max), b.displayBtn && (g = !0)) + }); + l = this.resetZoomButton; + g && !l ? this.showResetZoom() : !g && b(l) && (this.resetZoomButton = l.destroy()); + c && this.redraw(t(this.options.chart.animation, a && a.animation, 100 > this.pointCount)) + }, pan: function (a, b) { + var c = this, d = c.hoverPoints, + e; + d && f(d, function (a) { + a.setState() + }); + f("xy" === b ? [1, 0] : [1], function (b) { + b = c[b ? "xAxis" : "yAxis"][0]; + var d = b.horiz, f = a[d ? "chartX" : "chartY"], d = d ? "mouseDownX" : "mouseDownY", g = c[d], h = (b.pointRange || 0) / 2, k = b.getExtremes(), l = b.toValue(g - f, !0) + h, h = b.toValue(g + b.len - f, !0) - h, m = h < l, g = m ? h : l, l = m ? l : h, h = Math.min(k.dataMin, k.min) - g, k = l - Math.max(k.dataMax, k.max); + b.series.length && 0 > h && 0 > k && (b.setExtremes(g, l, !1, !1, {trigger: "pan"}), e = !0); + c[d] = f + }); + e && c.redraw(!1); + G(c.container, {cursor: "move"}) + } + }); + u(m.prototype, { + select: function (a, + b) { + var c = this, e = c.series, g = e.chart; + a = t(a, !c.selected); + c.firePointEvent(a ? "select" : "unselect", {accumulate: b}, function () { + c.selected = c.options.selected = a; + e.options.data[d(c, e.data)] = c.options; + c.setState(a && "select"); + b || f(g.getSelectedPoints(), function (a) { + a.selected && a !== c && (a.selected = a.options.selected = !1, e.options.data[d(a, e.data)] = a.options, a.setState(""), a.firePointEvent("unselect")) + }) + }) + }, onMouseOver: function (a, b) { + var c = this.series, d = c.chart, e = d.tooltip, f = d.hoverPoint; + if (this.series) { + if (!b) { + if (f && + f !== this)f.onMouseOut(); + if (d.hoverSeries !== c)c.onMouseOver(); + d.hoverPoint = this + } + !e || e.shared && !c.noSharedTooltip ? e || this.setState("hover") : (this.setState("hover"), e.refresh(this, a)); + this.firePointEvent("mouseOver") + } + }, onMouseOut: function () { + var a = this.series.chart, b = a.hoverPoints; + this.firePointEvent("mouseOut"); + b && -1 !== d(this, b) || (this.setState(), a.hoverPoint = null) + }, importEvents: function () { + if (!this.hasImportedEvents) { + var a = C(this.series.options.point, this.options).events, b; + this.events = a; + for (b in a)B(this, + b, a[b]); + this.hasImportedEvents = !0 + } + }, setState: function (a, b) { + var c = Math.floor(this.plotX), d = this.plotY, e = this.series, f = e.options.states[a] || {}, l = g[e.type].marker && e.options.marker, m = l && !1 === l.enabled, n = l && l.states && l.states[a] || {}, p = !1 === n.enabled, k = e.stateMarkerGraphic, q = this.marker || {}, r = e.chart, z = e.halo, C, A = l && e.markerAttribs; + a = a || ""; + if (!(a === this.state && !b || this.selected && "select" !== a || !1 === f.enabled || a && (p || m && !1 === n.enabled) || a && q.states && q.states[a] && !1 === q.states[a].enabled)) { + A && (C = e.markerAttribs(this, + a)); + if (this.graphic)this.state && this.graphic.removeClass("highcharts-point-" + this.state), a && this.graphic.addClass("highcharts-point-" + a), this.graphic.attr(e.pointAttribs(this, a)), C && this.graphic.animate(C, t(r.options.chart.animation, n.animation, l.animation)), k && k.hide(); else { + if (a && n) { + l = q.symbol || e.symbol; + k && k.currentSymbol !== l && (k = k.destroy()); + if (k)k[b ? "animate" : "attr"]({ + x: C.x, + y: C.y + }); else l && (e.stateMarkerGraphic = k = r.renderer.symbol(l, C.x, C.y, C.width, C.height).add(e.markerGroup), k.currentSymbol = + l); + k && k.attr(e.pointAttribs(this, a)) + } + k && (k[a && r.isInsidePlot(c, d, r.inverted) ? "show" : "hide"](), k.element.point = this) + } + (c = f.halo) && c.size ? (z || (e.halo = z = r.renderer.path().add(A ? e.markerGroup : e.group)), z[b ? "animate" : "attr"]({d: this.haloPath(c.size)}), z.attr({"class": "highcharts-halo highcharts-color-" + t(this.colorIndex, e.colorIndex)}), z.point = this, z.attr(u({ + fill: this.color || e.color, + "fill-opacity": c.opacity, + zIndex: -1 + }, c.attributes))) : z && z.point && z.point.haloPath && z.animate({d: z.point.haloPath(0)}); + this.state = + a + } + }, haloPath: function (a) { + return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX) - a, this.plotY - a, 2 * a, 2 * a) + } + }); + u(c.prototype, { + onMouseOver: function () { + var a = this.chart, b = a.hoverSeries; + if (b && b !== this)b.onMouseOut(); + this.options.events.mouseOver && l(this, "mouseOver"); + this.setState("hover"); + a.hoverSeries = this + }, onMouseOut: function () { + var a = this.options, b = this.chart, c = b.tooltip, d = b.hoverPoint; + b.hoverSeries = null; + if (d)d.onMouseOut(); + this && a.events.mouseOut && l(this, "mouseOut"); + !c || a.stickyTracking || + c.shared && !this.noSharedTooltip || c.hide(); + this.setState() + }, setState: function (a) { + var b = this, c = b.options, d = b.graph, g = c.states, h = c.lineWidth, c = 0; + a = a || ""; + if (b.state !== a && (f([b.group, b.markerGroup], function (c) { + c && (b.state && c.removeClass("highcharts-series-" + b.state), a && c.addClass("highcharts-series-" + a)) + }), b.state = a, !g[a] || !1 !== g[a].enabled) && (a && (h = g[a].lineWidth || h + (g[a].lineWidthPlus || 0)), d && !d.dashstyle))for (g = {"stroke-width": h}, d.attr(g); b["zone-graph-" + c];)b["zone-graph-" + c].attr(g), c += 1 + }, setVisible: function (a, + b) { + var c = this, d = c.chart, e = c.legendItem, g, m = d.options.chart.ignoreHiddenSeries, n = c.visible; + g = (c.visible = a = c.options.visible = c.userOptions.visible = void 0 === a ? !n : a) ? "show" : "hide"; + f(["group", "dataLabelsGroup", "markerGroup", "tracker", "tt"], function (a) { + if (c[a])c[a][g]() + }); + if (d.hoverSeries === c || (d.hoverPoint && d.hoverPoint.series) === c)c.onMouseOut(); + e && d.legend.colorizeItem(c, a); + c.isDirty = !0; + c.options.stacking && f(d.series, function (a) { + a.options.stacking && a.visible && (a.isDirty = !0) + }); + f(c.linkedSeries, function (b) { + b.setVisible(a, + !1) + }); + m && (d.isDirtyBox = !0); + !1 !== b && d.redraw(); + l(c, g) + }, show: function () { + this.setVisible(!0) + }, hide: function () { + this.setVisible(!1) + }, select: function (a) { + this.selected = a = void 0 === a ? !this.selected : a; + this.checkbox && (this.checkbox.checked = a); + l(this, a ? "select" : "unselect") + }, drawTracker: a.drawTrackerGraph + }) + })(L); + (function (a) { + var B = a.Chart, A = a.each, H = a.inArray, G = a.isObject, r = a.pick, g = a.splat; + B.prototype.setResponsive = function (a) { + var f = this.options.responsive; + f && f.rules && A(f.rules, function (f) { + this.matchResponsiveRule(f, + a) + }, this) + }; + B.prototype.matchResponsiveRule = function (f, g) { + var l = this.respRules, q = f.condition, d; + d = q.callback || function () { + return this.chartWidth <= r(q.maxWidth, Number.MAX_VALUE) && this.chartHeight <= r(q.maxHeight, Number.MAX_VALUE) && this.chartWidth >= r(q.minWidth, 0) && this.chartHeight >= r(q.minHeight, 0) + }; + void 0 === f._id && (f._id = a.uniqueKey()); + d = d.call(this); + !l[f._id] && d ? f.chartOptions && (l[f._id] = this.currentOptions(f.chartOptions), this.update(f.chartOptions, g)) : l[f._id] && !d && (this.update(l[f._id], g), delete l[f._id]) + }; + B.prototype.currentOptions = function (a) { + function f(a, d, b, l) { + var p, q; + for (p in a)if (!l && -1 < H(p, ["series", "xAxis", "yAxis"]))for (a[p] = g(a[p]), b[p] = [], q = 0; q < a[p].length; q++)b[p][q] = {}, f(a[p][q], d[p][q], b[p][q], l + 1); else G(a[p]) ? (b[p] = {}, f(a[p], d[p] || {}, b[p], l + 1)) : b[p] = d[p] || null + } + + var l = {}; + f(a, this.options, l, 0); + return l + } + })(L); + return L +}); diff --git a/Yangcai365_web/manage/zinc/css/base.css b/Yangcai365_web/manage/zinc/css/base.css new file mode 100644 index 0000000..5c23b32 --- /dev/null +++ b/Yangcai365_web/manage/zinc/css/base.css @@ -0,0 +1,39 @@ +.reg-box{width:100%; height:100%; background: url(../../ztmpl/zhiqim_manager/index_bg_00.jpg) no-repeat top center;background-size:auto 100%;} +a,a:visited{color:#333;text-decoration:none;cursor:pointer;} +a:active,a:hover{color:#1e7eec;text-decoration:none;} +.clear:after{content:'';display:block;clear:both;height:0;overflow:hidden;visibility:hidden;} +.clear{zoom:1;} + +/****注册 ****/ +.header{width:100%;background:rgba(255,255,255,.3); filter:alpha(opacity=30); height:40px; line-height:40px; padding:0 0 0 10px; color:#fff; font-size:14px;} +.reg-footer{position:fixed;bottom:0px; width:100%;height:40px;background:rgba(255,255,255,0.2);line-height:40px;text-align:center;color:#fff;} +.reg-login{width:825px; background:rgba(255,255,255,.3); filter:alpha(opacity=30); border-radius:12px; position: absolute; right:7%; top:50%; margin:-260px 0 0 0;} +.p-login{ margin:-210px 0 0 0;} +input{background:#fff;color:#86BFE9; width:300px; font-size:14px;border:1px solid #3b8edc;border-radius:5px;height:45px;line-height:45px;text-indent:10px;} + .design-logo{float:left; padding:170px 40px 0 40px;} + .p-int{ padding:120px 40px 0 40px;} + input::-webkit-input-placeholder{color:#86BFE9;} + .input-code{ width:192px;} + .reg-h{ font-size:20px; color:#fff; padding:0 0 10px 0;} + .reg{ float:left; width:450px; border-left:1px solid #fff; padding:0 0 0 50px; margin:30px 0;} + .reg-list{ float:left; margin:20px 0 0 0; width:100%;} + .reg-list button{ width:100px; float:right; margin:0 12px 0 0; background:#427ae1; border:none; line-height:42px; border-radius:5px; color:#fff; font-size:14px;} + .reg-list span{ width:86px; float:left; color:#fff; font-size:14px; line-height:45px;} + .reg-btn{ float:left; background:#427ae1; color:#fff; width:180px; line-height:40px; margin:10px 0 0 110px; border:none; border-radius:5px; font-size:14px;} + .p-btn{ margin:30px 0 0 110px;} + .agree-popup{position: fixed; top:50%; left:50%; width:60%; height:600px; margin:-300px 0 0 -30%; background:#fff; display:none; } + .agree-title{ font-size:16px; line-height:48px; border-bottom:1px solid #dfdfdf; color:#666; padding:0 0 0 20px;} + .agree-content{ overflow-y:scroll; height:552px;} + .agree-title span{float:right; line-height:44px; padding:0 20px; font-size:20px; color:#999; cursor:pointer;} + .z-checkbox{ border:2px solid #fff; border-radius:16px; width:18px; height:18px; } +.z-checkbox:hover{ border:2px solid #2fb6d4!important;} +.z-checkbox.z-active{ background-color:#2fb6d4!important; border:#2fb6d4!important; background-position: 0 -191px;} +.reg-check{ text-align:center; font-size:14px; line-height:40px; float:left; width:100%; margin:20px 0 0 0; color:#fff;} +.reg-check a{color:#2fb6d4;} +.reg-title{ font-size:14px; color:#fff; position: absolute; top:34px; right:30px;} +.reg-title a{color:#ffd200;} +.agree-content{padding:20px;} +.agree-content h2{font-size:18px;} +.agree-content p{ font-size:14px; color:#666; line-height:36px;} + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/css/design_2018102301.css b/Yangcai365_web/manage/zinc/css/design_2018102301.css new file mode 100644 index 0000000..c63f55f --- /dev/null +++ b/Yangcai365_web/manage/zinc/css/design_2018102301.css @@ -0,0 +1,124 @@ +/*瀑布*/ +.srcFileList{ + /* + -moz-column-count:5; + -webkit-column-count:5; + column-count:5; + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + */ + overflow:hidden; +} +.srcFileList:before,.srcFileList:after{content:"";display:table;} +.srcFileList:after{clear:both;} + +/*一个内容层*/ +.item{ + padding: 1em; + position:relative; + /* + -moz-page-break-inside: avoid; + -webkit-column-break-inside: avoid; + break-inside: avoid; + */ + width:20%; + float:left; + overflow:hidden; +} + +.item>div{ + padding: 10px; + background-color: #fff; + width:100%; + height:100%; + overflow:hidden; + position:relative; +} +.item>div:hover{ + -webkit-box-shadow: #666 0px 0px 10px; + -moz-box-shadow: #666 0px 0px 10px; + box-shadow: #666 0px 0px 10px; + behavior: url(/PIE.htc); +} +.item>div>img{ + width: 100%; +} + +.z-tabnav-main>nav span.z-cover{height:35px;line-height:1;} +.z-tabnav-main>nav span.z-cover li{height:auto;} + +/** 申请精品 **/ +.applyEssenceBtn{width:40px;height:130px;right:20px;top:50%;margin-top:-50px;font-size:16px;text-align:center;line-height:20px;background:#1299ec;color:#fff;box-shadow:0 0 10px 0 rgba(0,0,0,.3);border-radius:5px;cursor:pointer;z-index:999;overflow:hidden;} +.applyEssenceBtn:hover{background:#28a3ef} +.applyEssenceBtn>span{display:block;} +.applyEssenceBtn>span{padding:12px 10px 18px;} +.applyEssenceBtn>span:last-child:hover{background:#0b85d0} +.applyEssenceBtn>span:first-child,.applyEssenceBtn.active>span:last-child{display:block;} +.applyEssenceBtn>span:last-child,.applyEssenceBtn.active>span:first-child{display:none;} +.item>.checkBox{display:none;left:0;top:0;background:rgba(255,255,255,.8);background-clip:content-box;padding:1em;} +/** +.item.selectedItem>.checkBox{display:block;} +.item.selectedItem>.checkBox::before{content:"\f00d";font-family:"z-font" !important;font-style:normal;-webkit-font-smoothing:antialiased;-webkit-text-stroke-width:0.2px;-moz-osx-font-smoothing:grayscale; + font-size:30px;position: absolute;left:50%;top:50%;width:30px;height:16px;margin-top:-8px;margin-left:-15px;color:#006400;} +**/ +.item>.checkBox>input{visibility: hidden;} + +/** 悬浮操作按钮 **/ +.item>div.z-bg-white.z-pointer:hover .itemCtrBar{display:block;} +.itemCtrBar{top:0;right:0;bottom:0;left:0;padding:10px;display:none;background:rgba(0,0,0,.3);background-origin:content-box;background-clip:content-box;pointer-events:none;} +.itemCtrBar>button,.itemCtrBar>.itemCtrBar-item{pointer-events:auto;} +.itemCtrBar>.itemCtrBar-item{width:30px;height:30px;margin:15px;text-align:center;line-height:26px;border-radius:50%;background:#fff;opacity:.9;} +.itemCtrBar>.itemCtrBar-item-delete,.selectedItem .itemCtrBar>.itemCtrBar-item-success{display:none;} +.selectedItem .itemCtrBar>.itemCtrBar-item-delete{display:block;} + +.selectedItemBar{content:"精品";border-color:transparent transparent #f55 #f55;} + +/** 显示 **/ +.allItem-info::before{position:absolute;font-size:12px;white-space:nowrap;color:#fff;text-indent:-20px;line-height:15px;bottom:0;border-width:16px 22px;border-style:solid;width:0;height:0;} +.allItem-info{width:100%;height:32px;line-height:35px;left:0;bottom:0;color:#fff;background:rgba(0,0,0,.3);text-indent:35px} + +/** 精品显示 **/ +.bestItem .allItem-info::before{content:"精品";left:0;border-color:transparent transparent #f55 #f55} + +/** 模板显示 **/ +.modelItem .allItem-info::before{content:"模板";left:0;border-color:transparent transparent #00a2eb #00a2eb;} + +/** 订单显示 **/ +.orderItem .allItem-info::before{content:"定稿";left:0;border-color:transparent transparent #9e70ca #9e70ca;} + +/** 临时显示 **/ +.temporaryItem .allItem-info::before{content:"临时";left:0;border-color:transparent transparent #fb53cf #fb53cf;} + +/**我的显示**/ +.myItem .allItem-info::before{content:"我的";left:0;border-color:transparent transparent #fb53cf #fb53cf;} + + + +/** 已选显示 **/ +.selectedItemBar{right:0;top:0;text-indent:-4px;line-height:15px;border-color:#008b8b #008b8b transparent transparent;display:none;} +.selectedItemBar::before{content:"已选";position:relative;top:-14px;} +.selectedItem .selectedItemBar{display:block;} + +/** 浮动选择框 **/ +.fixedDialog{transition:right .6s;} +.fixedDialog.z-active{right:0 !important;} +.fixedDialog-title{width:36px;padding:10px 3px;font-size:16px;color:#fff;background-clip:padding-box;cursor:pointer;text-align:center;border-top-left-radius:5px;border-bottom-left-radius:5px;border-width:5px 0 5px 5px;border-style:solid;border-color:rgba(0,0,0,.1);} +.fixedDialog-content{height:100%;position:relative;background:#fff;border:1px solid #ccc;} +.fixedDialog-content ul{width:100%;height:100%;} +.fixedDialog-confirm{width:100%;position:absolute;bottom:8px;text-align:center;} +.fixedDialog-hiddenBtn{bottom:0;background:#ccc;width:36px;padding:5px 0;text-align:center;color:#fff;cursor:pointer;} + +#fixedDialog_1{height:400px;right:-210px;bottom:100px;} +#fixedDialog_content_1{width:220px;padding:5px 5px 45px 5px;} +#fixedDialog_content_1 li{float:left;position:relative;width:50%;height:25%;padding:10px;text-align:center;border:1px solid #f5f5f5;} +#fixedDialog_content_1 li::before{content:"";display:inline-block;width:0;height:100%;vertical-align:middle;} +#fixedDialog_content_1 li>img{} +#fixedDialog_content_1 li>.z-delete{position:absolute;width:100%;height:100%;left:0;top:0;padding-top:35px;background:rgba(255,255,255,.5);cursor:pointer;text-align:center;font-size:25px;display:none;} +#fixedDialog_content_1 li.z-active:hover>.z-delete{display:block;} + +/** 浮动框订单信息 **/ +#fixedDialog_2{height:200px;right:-400px;bottom:630px;} +#fixedDialog_content_2{width:410px;padding:10px;} +#fixedDialog_content_2>ul{overflow:auto;} +#fixedDialog_content_2 li{line-height:20px;padding:3px 2px;border-bottom:1px solid #f5f5f5;} diff --git a/Yangcai365_web/manage/zinc/css/dome.css b/Yangcai365_web/manage/zinc/css/dome.css new file mode 100644 index 0000000..2cb238b --- /dev/null +++ b/Yangcai365_web/manage/zinc/css/dome.css @@ -0,0 +1,104 @@ +.bos{ + width: 478px; + height: 125px; + float: left; + position: relative; + border: 1px solid #dcdcdc; + border-radius: 2px; + color: #666; + background-color: #f6f6f6; + margin-bottom: 15px; +} +.bos_son span{ + display:inline-block +} +.bos_two{ + width: 478px; + height: 680px; +} +.bos_two_one{ + width: 100%; + height: 155px; + margin-bottom: 20px; +} +.my-textarea{ + width: 100%; + height: 100%; +} +.text{ + margin-bottom: 10px; + padding-left: 5px; +} +.my_text{ + display: inline-block; +} +.btn{ + display: inline-block; + margin-left: 242px; + +} +.my_bos_two_one{ + margin-top: 35px; +} +.my_btn{ + position: absolute; + top: 45%; + left: 30.5%; + line-height: 24px; + font-size: 16px; +} +.boxs{ + float: left; + width: 515px; +} +.boxs_two{ + float: right; + /*margin-left: 100px;*/ + width: 1048px; + position: absolute; + top: 20px; + right: 65px; +} +.boxs_two ul li{ + width:159px; + height:100%; + text-align: center; + line-height: 45px !important; +} +.boxs_sons{ + width: 100%; + height:100%; + border-radius: 2px; + color: #666; + /* border: 1px solid #dcdcdc;*/ + border: none; + background-color: #ffffff +} +.my_z-float-right{ + width: 116px; + height: 48px !important; +} +.mystyle{ + height: 100% !important; + margin-bottom: 6px; +} +.mystyle_svg{ + /* height:945px;*/ + width: 100%; + height:100%; +} +.boxs_svg{ + width:1050px; + height:950px; +} +.mybtn_style_one{ + position: absolute; + top:5px; + right:10px; +} +.mybtn_style_two{ + position: absolute; + top:5px; + right:115px; +} + diff --git a/Yangcai365_web/manage/zinc/css/plugin.css b/Yangcai365_web/manage/zinc/css/plugin.css new file mode 100644 index 0000000..441659e --- /dev/null +++ b/Yangcai365_web/manage/zinc/css/plugin.css @@ -0,0 +1,46 @@ +.min-width{min-width:450px;} + +.main{position: relative;} +.main .box{padding: 10px 0 0 10px; float: left;} +.main .box .pic{padding: 5px; border: 1px solid #CCCCCC;border-radius: 5px; box-shadow: 0 0 5px #ccc;cursor:pointer} +.main .box .pic >img{width: 150px; height: auto;} +.main .box .pic .cont{width: 150px; height: auto; word-wrap:break-word;} +.main .box .pic .z-content{width:auto !important;} + +/*列表*/ +.list-file{overflow:hidden;} +.list-file:before,.list-file:after{content:"";display:table;} +.list-file:after{clear:both;} + +/*内容项*/ +.list-file .item{ + padding: 5px; + position:relative; + width:33.3%; + float:left; + overflow:hidden; +} + +.list-file .item>div{ + padding: 3px; + background-color: #fff; + width:100%; + height:100%; + overflow:hidden; + position:relative; + border: 1px solid #CCCCCC; + border-radius: 5px; + box-shadow: 0 0 5px #ccc; + cursor:pointer; +} + +.list-file .item>div:hover{ + -webkit-box-shadow: #666 0px 0px 10px; + -moz-box-shadow: #666 0px 0px 10px; + box-shadow: #666 0px 0px 10px; + behavior: url(/PIE.htc); +} + +.list-file .item>div>img{width: 100%;} + +.list-file .z-content{width:auto !important;} diff --git a/Yangcai365_web/manage/zinc/css/sweetalert2.min.css b/Yangcai365_web/manage/zinc/css/sweetalert2.min.css new file mode 100644 index 0000000..cbe0ba4 --- /dev/null +++ b/Yangcai365_web/manage/zinc/css/sweetalert2.min.css @@ -0,0 +1 @@ +@-webkit-keyframes swal2-show{0%{-webkit-transform:scale(.7);transform:scale(.7)}45%{-webkit-transform:scale(1.05);transform:scale(1.05)}80%{-webkit-transform:scale(.95);transform:scale(.95)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes swal2-show{0%{-webkit-transform:scale(.7);transform:scale(.7)}45%{-webkit-transform:scale(1.05);transform:scale(1.05)}80%{-webkit-transform:scale(.95);transform:scale(.95)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(.5);transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(.5);transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.875em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.875em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}5%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}12%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}100%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}5%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}12%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}100%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}50%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}80%{margin-top:-.375em;-webkit-transform:scale(1.15);transform:scale(1.15)}100%{margin-top:0;-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}50%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}80%{margin-top:-.375em;-webkit-transform:scale(1.15);transform:scale(1.15)}100%{margin-top:0;-webkit-transform:scale(1);transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{-webkit-transform:rotateX(100deg);transform:rotateX(100deg);opacity:0}100%{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{-webkit-transform:rotateX(100deg);transform:rotateX(100deg);opacity:0}100%{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}}body.swal2-toast-shown .swal2-container{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-shown{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}body.swal2-toast-column .swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-column .swal2-toast .swal2-actions{flex:1;align-self:stretch;height:2.2em;margin-top:.3125em}body.swal2-toast-column .swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-column .swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-column .swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast{flex-direction:row;align-items:center;width:auto;padding:.625em;box-shadow:0 0 .625em #d9d9d9;overflow-y:hidden}.swal2-popup.swal2-toast .swal2-header{flex-direction:row}.swal2-popup.swal2-toast .swal2-title{flex-grow:1;justify-content:flex-start;margin:0 .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{position:initial;width:.8em;height:.8em;line-height:.8}.swal2-popup.swal2-toast .swal2-content{justify-content:flex-start;font-size:1em}.swal2-popup.swal2-toast .swal2-icon{width:2em;min-width:2em;height:2em;margin:0}.swal2-popup.swal2-toast .swal2-icon-text{font-size:2em;font-weight:700;line-height:1em}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{height:auto;margin:0 .3125em}.swal2-popup.swal2-toast .swal2-styled{margin:0 .3125em;padding:.3125em .625em;font-size:1em}.swal2-popup.swal2-toast .swal2-styled:focus{box-shadow:0 0 0 .0625em #fff,0 0 0 .125em rgba(50,100,150,.4)}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:2em;height:2.8125em;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.25em;left:-.9375em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:2em 2em;transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;-webkit-transform-origin:0 2em;transform-origin:0 2em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:showSweetToast .5s;animation:showSweetToast .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:hideSweetToast .2s forwards;animation:hideSweetToast .2s forwards}.swal2-popup.swal2-toast .swal2-animate-success-icon .swal2-success-line-tip{-webkit-animation:animate-toast-success-tip .75s;animation:animate-toast-success-tip .75s}.swal2-popup.swal2-toast .swal2-animate-success-icon .swal2-success-line-long{-webkit-animation:animate-toast-success-long .75s;animation:animate-toast-success-long .75s}@-webkit-keyframes showSweetToast{0%{-webkit-transform:translateY(-.625em) rotateZ(2deg);transform:translateY(-.625em) rotateZ(2deg);opacity:0}33%{-webkit-transform:translateY(0) rotateZ(-2deg);transform:translateY(0) rotateZ(-2deg);opacity:.5}66%{-webkit-transform:translateY(.3125em) rotateZ(2deg);transform:translateY(.3125em) rotateZ(2deg);opacity:.7}100%{-webkit-transform:translateY(0) rotateZ(0);transform:translateY(0) rotateZ(0);opacity:1}}@keyframes showSweetToast{0%{-webkit-transform:translateY(-.625em) rotateZ(2deg);transform:translateY(-.625em) rotateZ(2deg);opacity:0}33%{-webkit-transform:translateY(0) rotateZ(-2deg);transform:translateY(0) rotateZ(-2deg);opacity:.5}66%{-webkit-transform:translateY(.3125em) rotateZ(2deg);transform:translateY(.3125em) rotateZ(2deg);opacity:.7}100%{-webkit-transform:translateY(0) rotateZ(0);transform:translateY(0) rotateZ(0);opacity:1}}@-webkit-keyframes hideSweetToast{0%{opacity:1}33%{opacity:.5}100%{-webkit-transform:rotateZ(1deg);transform:rotateZ(1deg);opacity:0}}@keyframes hideSweetToast{0%{opacity:1}33%{opacity:.5}100%{-webkit-transform:rotateZ(1deg);transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes animate-toast-success-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes animate-toast-success-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes animate-toast-success-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes animate-toast-success-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-shown{top:auto;right:auto;bottom:auto;left:auto;background-color:transparent}body.swal2-no-backdrop .swal2-shown>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-shown.swal2-top{top:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-top-left,body.swal2-no-backdrop .swal2-shown.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-shown.swal2-top-end,body.swal2-no-backdrop .swal2-shown.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-shown.swal2-center{top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-shown.swal2-center-left,body.swal2-no-backdrop .swal2-shown.swal2-center-start{top:50%;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-center-end,body.swal2-no-backdrop .swal2-shown.swal2-center-right{top:50%;right:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-bottom{bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-bottom-left,body.swal2-no-backdrop .swal2-shown.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-shown.swal2-bottom-end,body.swal2-no-backdrop .swal2-shown.swal2-bottom-right{right:0;bottom:0}.swal2-container{display:flex;position:fixed;top:0;right:0;bottom:0;left:0;flex-direction:row;align-items:center;justify-content:center;padding:10px;background-color:transparent;z-index:106000000;overflow-x:hidden;-webkit-overflow-scrolling:touch}.swal2-container.swal2-top{align-items:flex-start}.swal2-container.swal2-top-left,.swal2-container.swal2-top-start{align-items:flex-start;justify-content:flex-start}.swal2-container.swal2-top-end,.swal2-container.swal2-top-right{align-items:flex-start;justify-content:flex-end}.swal2-container.swal2-center{align-items:center}.swal2-container.swal2-center-left,.swal2-container.swal2-center-start{align-items:center;justify-content:flex-start}.swal2-container.swal2-center-end,.swal2-container.swal2-center-right{align-items:center;justify-content:flex-end}.swal2-container.swal2-bottom{align-items:flex-end}.swal2-container.swal2-bottom-left,.swal2-container.swal2-bottom-start{align-items:flex-end;justify-content:flex-start}.swal2-container.swal2-bottom-end,.swal2-container.swal2-bottom-right{align-items:flex-end;justify-content:flex-end}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-container.swal2-fade{transition:background-color .1s}.swal2-container.swal2-shown{background-color:rgba(0,0,0,.4)}.swal2-popup{display:none;position:relative;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem;box-sizing:border-box}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-popup .swal2-header{display:flex;flex-direction:column;align-items:center}.swal2-popup .swal2-title{display:block;position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-popup .swal2-actions{flex-wrap:wrap;align-items:center;justify-content:center;margin:1.25em auto 0;z-index:1}.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-popup .swal2-actions.swal2-loading .swal2-styled.swal2-confirm{width:2.5em;height:2.5em;margin:.46875em;padding:0;border:.25em solid transparent;border-radius:100%;border-color:transparent;background-color:transparent!important;color:transparent;cursor:default;box-sizing:border-box;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-popup .swal2-actions.swal2-loading .swal2-styled.swal2-cancel{margin-right:30px;margin-left:30px}.swal2-popup .swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after{display:inline-block;width:15px;height:15px;margin-left:5px;border:3px solid #999;border-radius:50%;border-right-color:transparent;box-shadow:1px 1px 1px #fff;content:'';-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal}.swal2-popup .swal2-styled{margin:.3125em;padding:.625em 2em;font-weight:500;box-shadow:none}.swal2-popup .swal2-styled:not([disabled]){cursor:pointer}.swal2-popup .swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-popup .swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-popup .swal2-styled:focus{outline:0;box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(50,100,150,.4)}.swal2-popup .swal2-styled::-moz-focus-inner{border:0}.swal2-popup .swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-popup .swal2-image{max-width:100%;margin:1.25em auto}.swal2-popup .swal2-close{position:absolute;top:0;right:0;justify-content:center;width:1.2em;height:1.2em;padding:0;transition:color .1s ease-out;border:none;border-radius:0;outline:initial;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer;overflow:hidden}.swal2-popup .swal2-close:hover{-webkit-transform:none;transform:none;color:#f27474}.swal2-popup>.swal2-checkbox,.swal2-popup>.swal2-file,.swal2-popup>.swal2-input,.swal2-popup>.swal2-radio,.swal2-popup>.swal2-select,.swal2-popup>.swal2-textarea{display:none}.swal2-popup .swal2-content{justify-content:center;margin:0;padding:0;color:#545454;font-size:1.125em;font-weight:300;line-height:normal;z-index:1;word-wrap:break-word}.swal2-popup #swal2-content{text-align:center}.swal2-popup .swal2-checkbox,.swal2-popup .swal2-file,.swal2-popup .swal2-input,.swal2-popup .swal2-radio,.swal2-popup .swal2-select,.swal2-popup .swal2-textarea{margin:1em auto}.swal2-popup .swal2-file,.swal2-popup .swal2-input,.swal2-popup .swal2-textarea{width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;font-size:1.125em;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);box-sizing:border-box}.swal2-popup .swal2-file.swal2-inputerror,.swal2-popup .swal2-input.swal2-inputerror,.swal2-popup .swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-popup .swal2-file:focus,.swal2-popup .swal2-input:focus,.swal2-popup .swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-popup .swal2-file::-webkit-input-placeholder,.swal2-popup .swal2-input::-webkit-input-placeholder,.swal2-popup .swal2-textarea::-webkit-input-placeholder{color:#ccc}.swal2-popup .swal2-file:-ms-input-placeholder,.swal2-popup .swal2-input:-ms-input-placeholder,.swal2-popup .swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-popup .swal2-file::-ms-input-placeholder,.swal2-popup .swal2-input::-ms-input-placeholder,.swal2-popup .swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-popup .swal2-file::placeholder,.swal2-popup .swal2-input::placeholder,.swal2-popup .swal2-textarea::placeholder{color:#ccc}.swal2-popup .swal2-range input{width:80%}.swal2-popup .swal2-range output{width:20%;font-weight:600;text-align:center}.swal2-popup .swal2-range input,.swal2-popup .swal2-range output{height:2.625em;margin:1em auto;padding:0;font-size:1.125em;line-height:2.625em}.swal2-popup .swal2-input{height:2.625em;padding:0 .75em}.swal2-popup .swal2-input[type=number]{max-width:10em}.swal2-popup .swal2-file{font-size:1.125em}.swal2-popup .swal2-textarea{height:6.75em;padding:.75em}.swal2-popup .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;color:#545454;font-size:1.125em}.swal2-popup .swal2-checkbox,.swal2-popup .swal2-radio{align-items:center;justify-content:center}.swal2-popup .swal2-checkbox label,.swal2-popup .swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-popup .swal2-checkbox input,.swal2-popup .swal2-radio input{margin:0 .4em}.swal2-popup .swal2-validation-message{display:none;align-items:center;justify-content:center;padding:.625em;background:#f0f0f0;color:#666;font-size:1em;font-weight:300;overflow:hidden}.swal2-popup .swal2-validation-message::before{display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center;content:'!';zoom:normal}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}.swal2-icon{position:relative;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;line-height:5em;cursor:default;box-sizing:content-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;zoom:normal}.swal2-icon-text{font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-success{border-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:3.75em 3.75em;transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:0 3.75em;transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;top:-.25em;left:-.25em;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%;z-index:2;box-sizing:content-box}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;top:.5em;left:1.625em;width:.4375em;height:5.625em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);z-index:1}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;height:.3125em;border-radius:.125em;background-color:#a5dc86;z-index:2}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.875em;width:1.5625em;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-progresssteps{align-items:center;margin:0 0 1.25em;padding:0;font-weight:600}.swal2-progresssteps li{display:inline-block;position:relative}.swal2-progresssteps .swal2-progresscircle{width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center;z-index:20}.swal2-progresssteps .swal2-progresscircle:first-child{margin-left:0}.swal2-progresssteps .swal2-progresscircle:last-child{margin-right:0}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep{background:#3085d6}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep~.swal2-progresscircle{background:#add8e6}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep~.swal2-progressline{background:#add8e6}.swal2-progresssteps .swal2-progressline{width:2.5em;height:.4em;margin:0 -1px;background:#3085d6;z-index:10}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-show.swal2-noanimation{-webkit-animation:none;animation:none}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-hide.swal2-noanimation{-webkit-animation:none;animation:none}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-animate-success-icon .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-animate-success-icon .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-animate-success-icon .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-animate-error-icon{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-animate-error-icon .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}@-webkit-keyframes swal2-rotate-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:initial!important}} \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/css/yangcai_question_main_v1.4.0R2018031701.css b/Yangcai365_web/manage/zinc/css/yangcai_question_main_v1.4.0R2018031701.css new file mode 100644 index 0000000..72b108e --- /dev/null +++ b/Yangcai365_web/manage/zinc/css/yangcai_question_main_v1.4.0R2018031701.css @@ -0,0 +1,112 @@ +/**************************************************************************************/ +/* 布局(全局、导航、脚注) */ +/**************************************************************************************/ + +/** [全局定义] */ +html{overflow-x:auto;} +body{background:#f5f5f5;} +body,table,td,div{font-size:14px;line-height:120%;} +a,a:visited{color:#333;text-decoration:none;cursor:pointer;} +a:active,a:hover{color:#2173b2;text-decoration:none;} + +/* [主导航] */ +.mainnav{position:fixed;top:0px;width:100%;height:76px;border-bottom:1px solid #dadada;background-color:#fff;z-index:9999;} +.mainnav .mainnav-wrap{margin:0px auto;max-width:1200px;min-width:1000px;height:75px;} +.mainnav .logo{float:left;width:290px;margin-top:8px;} +.mainnav .logo-text{float:right;font-size:18px;font-weight:bold;line-height:58px;} +.mainnav .menu{float:left; font-size:16px;height:75px;text-align:center;margin:10px 5px 0px 30px;} +.mainnav .menu li{float:left; width:80px; line-height:30px; margin:12px 10px;} +.mainnav .menu li:hover{border-bottom:2px solid #4bacc6;color:#4bacc6;cursor:pointer;} +.mainnav .menu li.active{border-bottom:2px solid #4bacc6;color:#4bacc6;} + +@media screen and (max-width: 1071px) { + .mainnav .menu li{margin:12px 5px;} +} + +.mainnav .help{float:right;line-height:75px;color:#2173b2;} +.mainnav .help a{background-color:#a4132a; color:#ffffff;font-size:16px;border-radius:20px; padding:6px 15px;margin-left:15px;} + +/* [导航固定96px] */ +.navmargin{position:relative;width:100%;height:96px;} + +.scrolltotop{position:fixed;right:20px;bottom:20px;display:none;z-index:99999;border:1px solid #d3d3d3;padding:10px;cursor:pointer;} +.scrolltotop:hover{background-color:#333;} + +/* [脚注] */ +.footer {position:relative;width:100%;min-width:1200px;z-index:0;display:block;border-top:1px solid #e6e6e6;overflow:hidden;background:#fff;} +.footer-wrap {margin:10px auto;height:160px;width:1200px;text-align:center;color:#333;font-size:14px;} +.footer li {float:left;height:130px;margin:10px 20px 10px 0;text-align:left;line-height:30px;color:#888;} +.footer li a {margin:10px;color:#888;} +.footer li a:hover {color:#4bacc6;} +.footer li.fproduct{width:180px;margin-left:30px;} +.footer li.fhelp{width:222px;} +.footer li.fabout{width:190px;} +.footer li.abountus {width:300px;} +.footer li.fproduct,.footer li.fhelp,.footer li.fabout{border-right:1px dashed #ccc;} + +@media screen and (max-width: 1071px) { + .footer li.fproduct{width:140px;} + .footer li.fhelp{width:180px;} + .footer li.fabout{width:150px;} + .footer li.abountus {width:280px;} +} + +.footer-cp {position:relative;width:100%;min-width:1200px;height:85px;line-height:85px;background-color:#eee;overflow:hidden;} +.footer-cp-wrap{position:relative;margin:0 auto;width:1200px;height:85px;z-index:0;display:block;overflow:hidden;} +.footer-cp .footer-text{width:1200px;height:85px;line-height:85px;text-align:center;} +@media screen and (max-width: 1071px) { + .footer-cp-wrap{width:1000px;} + .footer-cp .footer-text{width:1000px;margin-left:-100px;} +} + + +/**************************************************************************************/ +/* 容器内容 */ +/**************************************************************************************/ + +/** [容器定义] */ +.container {position:relative;margin:0 auto;padding-bottom:20px;height:auto !important;min-height:1200px;width:1200px;overflow:hidden;z-index:0;} + +/* [左导航] */ +.sidebar {position:relative;float:left;height:100%;padding-bottom:30px;overflow:hidden;width:220px;background:#fff;border:1px solid #e5e5e5;border-radius:3px;} +.sidebar main {position:relative;display:block;width:100%;height:98px;line-height:98px;font-size:16px;text-align:center;color:#333;cursor:pointer;border-bottom:1px solid #f5f5f5;} +.sidebar main.selected{color:#007d7e;border:1px solid #e6e6e6;background-color:#eee;} + +.sidebar p{position:relative;padding:0 40px;height:40px;line-height:40px;font-size:16px;color:#333;cursor:pointer;border-bottom:1px solid #eee;} +.sidebar p .z-font{position:absolute;font-size:14px;left:15px;bottom:0;} +.sidebar ul{position:relative;height:auto;overflow:hidden;line-height:40px;background:#f9f9f9;} +.sidebar ul li{display:block;padding:0 40px;line-height:38px;cursor:pointer;font-size:14px;color:#777;border:1px solid transparent;} +.sidebar ul li:hover{color:#2173b2;text-decoration:none;} +.sidebar p.z-selected,.sidebar ul li.z-selected{color:#fff; background-color:#2173b2;} + +/* [主体部分] */ +.mainbody{position:relative;float:right;width:960px;background:#fff;border:1px solid #e5e5e5;border-radius:3px;} +/* [搜索框]*/ +.mainsearch{text-align:center;padding:30px 10px;border-bottom:1px solid #f5f5f5;} +.mainsearch .z-input{width:600px;font-size:14px;border-color:#2173b2;} +.mainsearch .z-button{width:60px;height:38px;margin-left:-1px;font-family:"z-font";font-size:20px;background:#2173b2;border-color:#2173b2;box-shadow:none;color:#fff;} +/* [问题显示主体] */ +.questionbody{padding:20px 40px 80px;} +/*文章列表*/ +.article-list dd{margin:0;font-size:15px;line-height:38px;} +/*文章内容*/ +.article {} +.article,.article div{line-height:30px;font-size:15px;} +.article h1{font-weight:normal;} + +/* [搜索结果] */ +.search-resultBar {border-bottom:1px solid #fcfcfc;} +.search-resultBar span{display:inline-block;max-width:300px;overflow:hidden;white-space:nowrap;text-overflow: ellipsis;vertical-align:top;color:#a4132a;} +.search-resultList {} +.search-resultList dt{margin:30px 0 10px;} +.search-resultList dt a{display:inline-block;font-size:15px;color:#2173b2;line-height:30px;} +.search-resultList dt a:hover{text-decoration:underline;color:#a4132a;} +.search-resultList dd{margin:0;color:#666;line-height:20px;} + +/**************************************************************************************/ +/* Mobile配置 */ +/**************************************************************************************/ + +/* [脚注](Mobile) */ +.m-footer {position:relative;width:100%;border-top:1px solid #e6e6e6;background-color:#eee;padding:4% 0px;} +.m-footer-wrap {width:100%;height:100%;color:#333;text-align:center;font-size:12px;height:28px;line-height:28px;} diff --git a/Yangcai365_web/manage/zinc/css/zhiqim_search_auto_list_v1.4.0R2018031701.js b/Yangcai365_web/manage/zinc/css/zhiqim_search_auto_list_v1.4.0R2018031701.js new file mode 100644 index 0000000..064bf7a --- /dev/null +++ b/Yangcai365_web/manage/zinc/css/zhiqim_search_auto_list_v1.4.0R2018031701.js @@ -0,0 +1,286 @@ ++(function(Z) +{ +//BEGIN + +Z.SearchAutoList = Z.Class.newInstance(); +Z.SearchAutoList.prototype = +{ + defaults: + { + elem: null, //输入框/输入框盒子ID + className: null, //Ajax调用的类名 + methodName: null, //Ajax调用的类方法 + history: true, //历史记录显示 + callback: null //选中后的回调函数 + }, + + execute: function() + { + this.$elem = Z.$elem(this.elem, "Z.SearchAutoList"); + this.id = this.$elem.attr("id") || "FSearchAutoList"; + + this.width = this.$elem.offsetWidth(); + var height = this.$elem.offsetHeight(); + var fontSize = this.$elem.css("fontSize"); + this.pdLeft = this.$elem.css("paddingLeft"); + this.pdRight = this.$elem.css("paddingRight"); + this.lHeight = this.$elem.css("lineHeight"); + + this.$cover = Z.$cover(this.$elem); + this.$list = Z('
    ') + .css({width: this.width, left: 0, top: height-1, fontSize: fontSize, zIndex: 99}) + .appendTo(this.$cover); + + //事件绑定 + this.$elem.on("focus", this.onFocus, this); + this.$elem.on("input", this.onInput, this); + this.$elem.keydown(this.onKeyDown, this); + Z(document).click(this.onDocClick, this); + }, + + onFocus: function(e) + {//获取焦点事件 + this.value = Z.S.trim(this.$elem.val()); + if (Z.V.isEmptyBlank(this.value)) + { + this.doHistoryList(); + return; + } + + if (this.beforeValue == this.value) + {//内容不改变 + if (this.$list.html() != "") + this.$list.show(); + } + else + {//内容已改变 + this.beforeValue = this.value; + this.$list.show(); + this.doAjax(); + } + }, + + onInput: function(e) + {//input事件 + this.value = Z.S.trim(this.$elem.val()); + if (Z.V.isEmptyBlank(this.value)) + { + this.doHistoryList(); + return; + } + + if (this.beforeValue != this.value) + {//调用查询 + this.beforeValue = this.value; + this.$list.show(); + this.doAjax(); + } + }, + + //ajax调用,生成列表 + doAjax: function() + { + this.ajax = new Z.Ajax(); + this.ajax._this = this; + this.ajax.setClassName(this.className); + this.ajax.setMethodName(this.methodName); + this.ajax.addParam(this.value); + this.ajax.setCallback(function() + { + var _this = this._this; + var titleList = Z.J.toObject(this.responseText); + if (titleList.length == 0) + { + _this.$list.html("").hide(); + return; + } + + var html = '
      '; + Z.eachof(_this, titleList, function(item){ + html += '
    • ' + item + "
    • "; + }); + html += "
    "; + + _this.$list.html(html); + _this.lis = _this.$list.find("li"); + _this.lis.click(_this.doSelect, _this); + _this.lis.mouseenter(_this.onMouseEnter, _this); + _this.lis.mouseleave(_this.onMouseLeave, _this); + }); + this.ajax.execute(); + }, + + doSelect: function(e) + {//鼠标选中 + Z.E.forbidden(e); + + this.beforeValue = this.value; + this.value = Z(Z.E.target(e)).text(); + this.$elem.val(this.value); + + this.$list.hide(); + this.doAjax(); + + this.saveHistory(e); + this.doCallback(e); + }, + + onDocClick: function(e) + {//空白处点击,隐藏列表 + var target = Z.E.target(e); + if (target == this.$elem[0]) + return; + + this.$list.hide(); + if (this.beforeValue != this.value) + {//静默调用 + this.beforeValue = this.value; + this.doAjax(); + } + }, + + onKeyDown: function(e) + {//键盘 “上” “下” “回车”按键监听 + var keyVal = Z.E.key(e); + if (keyVal != Z.E.KEY.UP && keyVal != Z.E.KEY.DOWN && keyVal != Z.E.KEY.ENTER) + return; + + Z.E.forbidden(e); + if (this.lis) + {//有选择列表的搜索框 + var liSetLength = this.lis.length; + var liActive = this.$list.find(".z-bg-gray"); + var liActiveIndex = -1; + var toIndex = null; + if (liActive.length != 0) + liActiveIndex = Z.EL.parentIndex(liActive[0]); + + switch (keyVal) + { + case Z.E.KEY.UP://上 + toIndex = liActiveIndex - 1; + if (toIndex <= -1) + toIndex = liSetLength - 1; + break; + case Z.E.KEY.DOWN://下 + toIndex = liActiveIndex + 1; + if (toIndex == liSetLength) + toIndex = 0; + break; + case Z.E.KEY.ENTER://回车选中 + this.$elem[0].blur(); + this.$list.hide(); + this.value = Z.S.trim(this.$elem.val()); + this.beforeValue = this.value; + this.doAjax(); + this.saveHistory(e); + this.doCallback(e); + return; + } + toIndex++; + this.lis.removeClass("z-bg-gray"); + var toLi = this.$list.find("li:nth-child(" + toIndex +")").addClass("z-bg-gray"); + this.value = toLi.html(); + this.$elem.val(toLi.html()); + } + else if (keyVal == Z.E.KEY.ENTER) + {//直接在输入框回车搜索 + this.value = Z.S.trim(this.$elem.val()); + this.beforeValue = this.value; + this.doAjax(); + this.saveHistory(e); + this.doCallback(e); + } + }, + + //选中后的回掉函数 + doCallback: function(e) + { + if(!this.callback) + return; + this.callback(e); + }, + + //历史记录列表展示 + doHistoryList: function(e) + { + if (!this.history) + return; + + this.$list.html("").hide(); + if (!localStorage.getItem(this.id)) + return; + + var htmlStr = '
      '; + var hisArr = localStorage.getItem(this.id).split(";"); + for (var i = 0;i < hisArr.length;i++) + { + htmlStr += '
    • ' + + hisArr[i] + "
    • "; + } + htmlStr += "
    "; + Z(htmlStr).appendTo(this.$list.show()); + var hisBar = '
    ' + + '清空历史' + + '
    '; + Z(hisBar).appendTo(this.$list.show()); + //绑定事件 + this.lis = this.$list.find("li"); + this.lis.click(this.doSelect,this); + this.lis.mouseenter(this.onMouseEnter,this); + this.lis.mouseleave(this.onMouseLeave,this); + //绑定删除事件 + var $delBtn = this.$list.find(".z-deleteBtn"); + $delBtn.click(this.emptyHistory,this); + }, + + emptyHistory: function(e) + { + localStorage.removeItem(this.id); + }, + + //输入完成,存储历史记录 + saveHistory: function(e) + { + if (!this.history) + return; + + var hisStr = localStorage.getItem(this.id); + if (!hisStr) + return localStorage.setItem(this.id, this.value); + + var hisArr = hisStr.split(";"); + hisArr.unshift(this.value); + + //去重 + var resultArr = []; + for(var i = 0; i < hisArr.length; i++) + { + if(!Z.AR.contains(resultArr, hisArr[i])) + resultArr.push(hisArr[i]); + } + + //限制个数 + if (resultArr.length > 10) + resultArr.length = 10; + + hisStr = resultArr.join(";"); + localStorage.setItem(this.id, hisStr); + }, + + //鼠标悬浮,背景颜色变化 + onMouseEnter: function(e) + { + var $thisLi = Z(Z.E.target(e)); + $thisLi.addClass("z-bg-gray"); + }, + + onMouseLeave: function(e) + { + var $thisLi = Z(Z.E.target(e)); + $thisLi.removeClass("z-bg-gray"); + } +} + +//END +})(zhiqim) \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/images/VXQRcode.png b/Yangcai365_web/manage/zinc/images/VXQRcode.png new file mode 100644 index 0000000..e83c444 Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/VXQRcode.png differ diff --git a/Yangcai365_web/manage/zinc/images/cli.png b/Yangcai365_web/manage/zinc/images/cli.png new file mode 100644 index 0000000..54b4d54 Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/cli.png differ diff --git a/Yangcai365_web/manage/zinc/images/copy.png b/Yangcai365_web/manage/zinc/images/copy.png new file mode 100644 index 0000000..d08db08 Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/copy.png differ diff --git a/Yangcai365_web/manage/zinc/images/dropDown.png b/Yangcai365_web/manage/zinc/images/dropDown.png new file mode 100644 index 0000000..907c3d8 Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/dropDown.png differ diff --git a/Yangcai365_web/manage/zinc/images/fire.png b/Yangcai365_web/manage/zinc/images/fire.png new file mode 100644 index 0000000..f74b154 Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/fire.png differ diff --git a/Yangcai365_web/manage/zinc/images/logout.png b/Yangcai365_web/manage/zinc/images/logout.png new file mode 100644 index 0000000..1d3ab7b Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/logout.png differ diff --git a/Yangcai365_web/manage/zinc/images/message.png b/Yangcai365_web/manage/zinc/images/message.png new file mode 100644 index 0000000..ce463a0 Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/message.png differ diff --git a/Yangcai365_web/manage/zinc/images/nopic.png b/Yangcai365_web/manage/zinc/images/nopic.png new file mode 100644 index 0000000..3b7e9ec Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/nopic.png differ diff --git a/Yangcai365_web/manage/zinc/images/notice2.png b/Yangcai365_web/manage/zinc/images/notice2.png new file mode 100644 index 0000000..73d3b72 Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/notice2.png differ diff --git a/Yangcai365_web/manage/zinc/images/orderDispatch.jpg b/Yangcai365_web/manage/zinc/images/orderDispatch.jpg new file mode 100644 index 0000000..432d7dd Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/orderDispatch.jpg differ diff --git a/Yangcai365_web/manage/zinc/images/qiantu.png b/Yangcai365_web/manage/zinc/images/qiantu.png new file mode 100644 index 0000000..cbe0520 Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/qiantu.png differ diff --git a/Yangcai365_web/manage/zinc/images/qq.png b/Yangcai365_web/manage/zinc/images/qq.png new file mode 100644 index 0000000..b2f8b88 Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/qq.png differ diff --git a/Yangcai365_web/manage/zinc/images/qrcode.png b/Yangcai365_web/manage/zinc/images/qrcode.png new file mode 100644 index 0000000..76f7eef Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/qrcode.png differ diff --git a/Yangcai365_web/manage/zinc/images/red_exclamation_mark.png b/Yangcai365_web/manage/zinc/images/red_exclamation_mark.png new file mode 100644 index 0000000..2117c31 Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/red_exclamation_mark.png differ diff --git a/Yangcai365_web/manage/zinc/images/refresh.png b/Yangcai365_web/manage/zinc/images/refresh.png new file mode 100644 index 0000000..4eec73e Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/refresh.png differ diff --git a/Yangcai365_web/manage/zinc/images/wangwang.png b/Yangcai365_web/manage/zinc/images/wangwang.png new file mode 100644 index 0000000..6a7033d Binary files /dev/null and b/Yangcai365_web/manage/zinc/images/wangwang.png differ diff --git a/Yangcai365_web/manage/zinc/js/design_2018102301.js b/Yangcai365_web/manage/zinc/js/design_2018102301.js new file mode 100644 index 0000000..ee4e573 --- /dev/null +++ b/Yangcai365_web/manage/zinc/js/design_2018102301.js @@ -0,0 +1,72 @@ ++(function(Z) +{ +//BEGIN + +var Design = window.Design = {}; + +Z.onload(function() +{ + +}) + +Design.doWorksShow = function (value,urlParam) +{//展示弹窗页,全铺满 + var ajax = new Z.Ajax(); + ajax.setClassName("WorksPresenter"); + ajax.setMethodName("doWorksBrowse"); + ajax.addParam(value) + ajax.execute(); + + var dialog = new Z.Dialog(); + dialog.shadow = true; + dialog.title = "作品详情"; + dialog.fixed = true; + + dialog.url = "worksShow.htm?worksId="+value; + dialog.width = Z.D.clientWidth(); + dialog.height =Z.D.clientHeight()-40; + dialog.execute(); +} + +Design.doTemplateShow = function (value,urlParam) +{//展示弹窗页,全铺满 + + var keywordName = Z("#searchinput").val(); + if (keywordName == null) + keywordName = ""; + + var ajax = new Z.Ajax(); + ajax.setClassName("TemplatePresenter"); + ajax.setMethodName("doTemplateBrowse"); + ajax.addParam("mediaId", value) + ajax.execute(); + + var dialog = new Z.Dialog(); + dialog.shadow = true; + dialog.title = "模板详情"; + dialog.fixed = true; + + dialog.url = "templateShow.htm?mediaId=" + value + "&keywordName=" + keywordName + "&urlParam=" + urlParam; + dialog.width = Z.D.clientWidth() -30; + dialog.height =Z.D.clientHeight() - 65; + dialog.execute(); +} + +Design.openWangWang = function(buyerNick) +{//打开旺旺 + Z("#openFrm").attr("src","http://amos.alicdn.com/msg.aw?v=2&uid="+buyerNick+"&site=cntaobao&s=2&charset=utf-8"); +}; + +Design.openQQ = function(userQq) +{//打开QQ + if (!Z.V.isInteger(userQq)) + { + Z.alert("客户未提供QQ号,请旺旺联系"); + return; + } + + Z("#openFrm").attr("src","tencent://message/?uin="+userQq); +}; + +//END +})(zhiqim); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/js/designer_2021031501.js b/Yangcai365_web/manage/zinc/js/designer_2021031501.js new file mode 100644 index 0000000..7be4b4a --- /dev/null +++ b/Yangcai365_web/manage/zinc/js/designer_2021031501.js @@ -0,0 +1,88 @@ ++(function(Z) +{ +//BEGIN + +/*****************************************************************************/ +//定义设计师工作初始化 +/*****************************************************************************/ +//启动websocket +Z.onload(function() +{ + //1.检查上下班状态 + if (Z("#startWork").text() == "正在接单") + { + Z("#stopWork").click(Designer.stopWork); + } + else + { + Z("#startWork").click(Designer.startWork); + } +}); + +/*****************************************************************************/ +//定义设计师工作对象 +/*****************************************************************************/ +var Designer = window.Designer = {}; + +Designer.startWork = function() +{//设计师开始接单 + var ajax = new Z.Ajax(); + ajax.setClassName("DesignerWorkPresenter"); + ajax.setMethodName("startWork"); + ajax.setFailureAlert(); + ajax.setFailure(function(){ + if(this.responseText == "1"){ + Z.alert("接单前请前往个人中心完善个人简介~", function(){ + Z("a[onclick*='profile.htm']").click(); + }); + return; + } + Z.alert(this.responseText); + }) + ajax.setSuccess(function() + { + Z("#startWork").addClass("z-forbidden").addClass("z-bg-gray-deep").removeClass("z-pointer").text("正在接单"); + Z("#startWork").offclick(Designer.startWork); + Z("#stopWork").addClass("z-pointer").addClass("z-bg-red-deep").removeClass("z-forbidden").removeClass("z-bg-gray-deep"); + Z("#stopWork").click(Designer.stopWork); + }); + ajax.execute(); +}; + +Designer.stopWork = function() +{//设计师停止接单 + + //1.查询未完成订单数 + var ajax = new Z.Ajax(); + ajax.setSync(); + ajax.setClassName("DesignerWorkPresenter"); + ajax.setMethodName("getOrderNumber"); + ajax.execute(); + + if (ajax.responseStatus != 0) + { + Z.alert("抱歉请求处理失败,请重试!"); + return; + } + + //2.提醒下班 + var confirm = "确认现在停止接单吗?" + ((ajax.responseText != "0")?"您还有" + ajax.responseText + "个订单未完成!":""); + Z.confirm(confirm, function() + { + var _ajax = new Z.Ajax(); + _ajax.setClassName("DesignerWorkPresenter"); + _ajax.setMethodName("stopWork"); + _ajax.setFailureAlert(); + _ajax.setSuccess(function() + { + Z("#startWork").addClass("z-pointer").removeClass("z-forbidden").removeClass("z-bg-gray-deep").text("开始接单"); + Z("#startWork").click(Designer.startWork); + Z("#stopWork").addClass("z-forbidden").addClass("z-bg-gray-deep").removeClass("z-pointer").removeClass("z-bg-red-deep"); + Z("#stopWork").offclick(Designer.stopWork); + }); + _ajax.execute(); + }); +}; + +//END +})(zhiqim); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/js/global_2019010801.js b/Yangcai365_web/manage/zinc/js/global_2019010801.js new file mode 100644 index 0000000..2192088 --- /dev/null +++ b/Yangcai365_web/manage/zinc/js/global_2019010801.js @@ -0,0 +1,80 @@ ++(function(Z) +{ +//BEGIN + +var Global = window.Global = {}; + +/**************************************************************************************/ +//打开旺旺&打开QQ +/**************************************************************************************/ + +Global.contectWangWang = function() +{//打开旺旺 + var designId = Z.FM.getChecked("designId"); + var buyerNick = Z("#buyerNick_" + designId).val(); + Z("#openFrm").attr("src","http://amos.alicdn.com/msg.aw?v=2&uid="+buyerNick+"&site=cntaobao&s=2&charset=utf-8"); +}; + +Global.contectQQ = function() +{//打开QQ + var designId = Z.FM.getChecked("designId") + var userQq = Z("#userQq_" + designId).val(); + if (!Z.V.isInteger(userQq)) + { + Z.alert("客户未提供QQ号,请旺旺联系"); + return; + } + + Z("#openFrm").attr("src","tencent://message/?uin="+userQq); +}; + +Global.openWangWang = function(elemId, attrName) +{//打开旺旺 + if (!elemId && !attrName) + { + Global.contectWangWang(); + } + else + { + var nick = Z("#"+elemId).attr(Z.V.isEmptyBlank(attrName) ? "data-ww" : attrName); + Global.openWangWangParam(nick); + } + +}; + +Global.openQQ = function(elemId, attrName) +{//打开QQ + if (!elemId && !attrName) + { + Global.contectQQ(); + } + else + { + var nick = Z("#"+elemId).attr(Z.V.isEmptyBlank(attrName) ? "data-qq" : attrName); + Global.openQQParam(nick); + } + +}; + +Global.openWangWangParam = function(buyerNick) +{//打开旺旺 + if (Z.V.isEmptyBlank(buyerNick)) + { + Z.failure("客户未提供该联系方式"); + return; + } + Z("#openFrm").attr("src","http://amos.alicdn.com/msg.aw?v=2&uid="+buyerNick+"&site=cntaobao&s=2&charset=utf-8"); +} + +Global.openQQParam = function(userQq) +{//打开QQ + if (!Z.V.isInteger(userQq)) + { + Z.failure("客户未提供该联系方式"); + return; + } + Z("#openFrm").attr("src","tencent://message/?uin="+userQq); +} + +//END +})(zhiqim); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/js/globalcomplain_2019010801.js b/Yangcai365_web/manage/zinc/js/globalcomplain_2019010801.js new file mode 100644 index 0000000..eba7e16 --- /dev/null +++ b/Yangcai365_web/manage/zinc/js/globalcomplain_2019010801.js @@ -0,0 +1,80 @@ ++(function(Z) +{ +//BEGIN + +var Global = window.Global = {}; + +/**************************************************************************************/ +//打开旺旺&打开QQ +/**************************************************************************************/ + +Global.contectWangWang = function() +{//打开旺旺complainId + var complainId = Z.FM.getChecked("complainId"); + var buyerNick = Z("#buyerNick_" + complainId).val(); + Z("#openFrm").attr("src","http://amos.alicdn.com/msg.aw?v=2&uid="+buyerNick+"&site=cntaobao&s=2&charset=utf-8"); +}; + +Global.contectQQ = function() +{//打开QQ + var complainId = Z.FM.getChecked("complainId") + var userQq = Z("#userQq_" + complainId).val(); + if (!Z.V.isInteger(userQq)) + { + Z.alert("客户未提供QQ号,请旺旺联系"); + return; + } + + Z("#openFrm").attr("src","tencent://message/?uin="+userQq); +}; + +Global.openWangWang = function(elemId, attrName) +{//打开旺旺 + if (!elemId && !attrName) + { + Global.contectWangWang(); + } + else + { + var nick = Z("#"+elemId).attr(Z.V.isEmptyBlank(attrName) ? "data-ww" : attrName); + Global.openWangWangParam(nick); + } + +}; + +Global.openQQ = function(elemId, attrName) +{//打开QQ + if (!elemId && !attrName) + { + Global.contectQQ(); + } + else + { + var nick = Z("#"+elemId).attr(Z.V.isEmptyBlank(attrName) ? "data-qq" : attrName); + Global.openQQParam(nick); + } + +}; + +Global.openWangWangParam = function(buyerNick) +{//打开旺旺 + if (Z.V.isEmptyBlank(buyerNick)) + { + Z.failure("客户未提供该联系方式"); + return; + } + Z("#openFrm").attr("src","http://amos.alicdn.com/msg.aw?v=2&uid="+buyerNick+"&site=cntaobao&s=2&charset=utf-8"); +} + +Global.openQQParam = function(userQq) +{//打开QQ + if (!Z.V.isInteger(userQq)) + { + Z.failure("客户未提供该联系方式"); + return; + } + Z("#openFrm").attr("src","tencent://message/?uin="+userQq); +} + +//END +})(zhiqim); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/js/jquery-1.11.1.min.js b/Yangcai365_web/manage/zinc/js/jquery-1.11.1.min.js new file mode 100644 index 0000000..ab28a24 --- /dev/null +++ b/Yangcai365_web/manage/zinc/js/jquery-1.11.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
    ",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="
    ","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; +if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
    a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/\s*$/g,rb={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:k.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("',"",""].join(""));return l.ie&&l.ie<8?c.removeClass("layui-hide").addClass(o):(d[0]&&d.remove(),s.call(a,m,c[0],y),c.addClass("layui-hide").after(m),a.index)},c.prototype.getContent=function(t){var e=u(t);if(e[0])return d(e[0].document.body.innerHTML)},c.prototype.getText=function(t){var i=u(t);if(i[0])return e(i[0].document.body).text()},c.prototype.setContent=function(t,i,a){var l=u(t);l[0]&&(a?e(l[0].document.body).append(i):e(l[0].document.body).html(i),layedit.sync(t))},c.prototype.sync=function(t){var i=u(t);if(i[0]){var a=e("#"+i[1].attr("textarea"));a.val(d(i[0].document.body.innerHTML))}},c.prototype.getSelection=function(t){var e=u(t);if(e[0]){var i=m(e[0].document);return document.selection?i.text:i.toString()}};var s=function(t,i,a){var l=this,n=t.find("iframe");n.css({height:a.height}).on("load",function(){var o=n.contents(),r=n.prop("contentWindow"),c=o.find("head"),s=e([""].join("")),u=o.find("body");c.append(s),u.attr("contenteditable","true").css({"min-height":a.height}).html(i.value||""),y.apply(l,[r,n,i,a]),g.call(l,r,t,a)})},u=function(t){var i=e("#LAY_layedit_"+t),a=i.prop("contentWindow");return[a,i]},d=function(t){return 8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),t},y=function(t,a,n,o){var r=t.document,c=e(r.body);c.on("keydown",function(t){var e=t.keyCode;if(13===e){var a=m(r),l=p(a),n=l.parentNode;if("pre"===n.tagName.toLowerCase()){if(t.shiftKey)return;return i.msg("请暂时用shift+enter"),!1}r.execCommand("formatBlock",!1,"

    ")}}),e(n).parents("form").on("submit",function(){var t=c.html();8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),n.value=t}),c.on("paste",function(e){r.execCommand("formatBlock",!1,"

    "),setTimeout(function(){f.call(t,c),n.value=c.html()},100)})},f=function(t){var i=this;i.document;t.find("*[style]").each(function(){var t=this.style.textAlign;this.removeAttribute("style"),e(this).css({"text-align":t||""})}),t.find("table").addClass("layui-table"),t.find("script,link").remove()},m=function(t){return t.selection?t.selection.createRange():t.getSelection().getRangeAt(0)},p=function(t){return t.endContainer||t.parentElement().childNodes[0]},v=function(t,i,a){var l=this.document,n=document.createElement(t);for(var o in i)n.setAttribute(o,i[o]);if(n.removeAttribute("text"),l.selection){var r=a.text||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.pasteHTML(e(n).prop("outerHTML")),a.select()}else{var r=a.toString()||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.deleteContents(),a.insertNode(n)}},h=function(t,i){var a=this.document,l="layedit-tool-active",n=p(m(a)),o=function(e){return t.find(".layedit-tool-"+e)};i&&i[i.hasClass(l)?"removeClass":"addClass"](l),t.find(">i").removeClass(l),o("unlink").addClass(r),e(n).parents().each(function(){var t=this.tagName.toLowerCase(),e=this.style.textAlign;"b"!==t&&"strong"!==t||o("b").addClass(l),"i"!==t&&"em"!==t||o("i").addClass(l),"u"===t&&o("u").addClass(l),"strike"===t&&o("d").addClass(l),"p"===t&&("center"===e?o("center").addClass(l):"right"===e?o("right").addClass(l):o("left").addClass(l)),"a"===t&&(o("link").addClass(l),o("unlink").removeClass(r))})},g=function(t,a,l){var n=t.document,o=e(n.body),c={link:function(i){var a=p(i),l=e(a).parent();b.call(o,{href:l.attr("href"),target:l.attr("target")},function(e){var a=l[0];"A"===a.tagName?a.href=e.url:v.call(t,"a",{target:e.target,href:e.url,text:e.url},i)})},unlink:function(t){n.execCommand("unlink")},face:function(e){x.call(this,function(i){v.call(t,"img",{src:i.src,alt:i.alt},e)})},image:function(a){var n=this;layui.use("upload",function(o){var r=l.uploadImage||{};o.render({url:r.url,method:r.type,elem:e(n).find("input")[0],done:function(e){0==e.code?(e.data=e.data||{},v.call(t,"img",{src:e.data.src,alt:e.data.title},a)):i.msg(e.msg||"上传失败")}})})},code:function(e){k.call(o,function(i){v.call(t,"pre",{text:i.code,"lay-lang":i.lang},e)})},help:function(){i.open({type:2,title:"帮助",area:["600px","380px"],shadeClose:!0,shade:.1,skin:"layui-layer-msg",content:["http://www.layui.com/about/layedit/help.html","no"]})}},s=a.find(".layui-layedit-tool"),u=function(){var i=e(this),a=i.attr("layedit-event"),l=i.attr("lay-command");if(!i.hasClass(r)){o.focus();var u=m(n);u.commonAncestorContainer;l?(n.execCommand(l),/justifyLeft|justifyCenter|justifyRight/.test(l)&&n.execCommand("formatBlock",!1,"

    "),setTimeout(function(){o.focus()},10)):c[a]&&c[a].call(this,u),h.call(t,s,i)}},d=/image/;s.find(">i").on("mousedown",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)||u.call(this)}).on("click",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)&&u.call(this)}),o.on("click",function(){h.call(t,s),i.close(x.index)})},b=function(t,e){var l=this,n=i.open({type:1,id:"LAY_layedit_link",area:"350px",shade:.05,shadeClose:!0,moveType:1,title:"超链接",skin:"layui-layer-msg",content:['

      ','
    • ','','
      ','',"
      ","
    • ",'
    • ','','
      ','",'","
      ","
    • ",'
    • ','','',"
    • ","
    "].join(""),success:function(t,n){var o="submit(layedit-link-yes)";a.render("radio"),t.find(".layui-btn-primary").on("click",function(){i.close(n),l.focus()}),a.on(o,function(t){i.close(b.index),e&&e(t.field)})}});b.index=n},x=function(t){var a=function(){var t=["[微笑]","[嘻嘻]","[哈哈]","[可爱]","[可怜]","[挖鼻]","[吃惊]","[害羞]","[挤眼]","[闭嘴]","[鄙视]","[爱你]","[泪]","[偷笑]","[亲亲]","[生病]","[太开心]","[白眼]","[右哼哼]","[左哼哼]","[嘘]","[衰]","[委屈]","[吐]","[哈欠]","[抱抱]","[怒]","[疑问]","[馋嘴]","[拜拜]","[思考]","[汗]","[困]","[睡]","[钱]","[失望]","[酷]","[色]","[哼]","[鼓掌]","[晕]","[悲伤]","[抓狂]","[黑线]","[阴险]","[怒骂]","[互粉]","[心]","[伤心]","[猪头]","[熊猫]","[兔子]","[ok]","[耶]","[good]","[NO]","[赞]","[来]","[弱]","[草泥马]","[神马]","[囧]","[浮云]","[给力]","[围观]","[威武]","[奥特曼]","[礼物]","[钟]","[话筒]","[蜡烛]","[蛋糕]"],e={};return layui.each(t,function(t,i){e[i]=layui.cache.dir+"images/face/"+t+".gif"}),e}();return x.hide=x.hide||function(t){"face"!==e(t.target).attr("layedit-event")&&i.close(x.index)},x.index=i.tips(function(){var t=[];return layui.each(a,function(e,i){t.push('
  • '+e+'
  • ')}),'
      '+t.join("")+"
    "}(),this,{tips:1,time:0,skin:"layui-box layui-util-face",maxWidth:500,success:function(l,n){l.css({marginTop:-4,marginLeft:-10}).find(".layui-clear>li").on("click",function(){t&&t({src:a[this.title],alt:this.title}),i.close(n)}),e(document).off("click",x.hide).on("click",x.hide)}})},k=function(t){var e=this,l=i.open({type:1,id:"LAY_layedit_code",area:"550px",shade:.05,shadeClose:!0,moveType:1,title:"插入代码",skin:"layui-layer-msg",content:['
      ','
    • ','','
      ','","
      ","
    • ",'
    • ','','
      ','',"
      ","
    • ",'
    • ','','',"
    • ","
    "].join(""),success:function(l,n){var o="submit(layedit-code-yes)";a.render("select"),l.find(".layui-btn-primary").on("click",function(){i.close(n),e.focus()}),a.on(o,function(e){i.close(k.index),t&&t(e.field)})}});k.index=l},C={html:'',strong:'',italic:'',underline:'',del:'',"|":'',left:'',center:'',right:'',link:'',unlink:'',face:'',image:'',code:'',help:''},w=new c;t(n,w)}); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/lay/modules/layer.js b/Yangcai365_web/manage/zinc/layui/lay/modules/layer.js new file mode 100644 index 0000000..3220857 --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/lay/modules/layer.js @@ -0,0 +1,2 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ + ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
    '+(f?r.title[0]:r.title)+"
    ":"";return r.zIndex=s,t([r.shade?'
    ':"",'
    '+(e&&2!=r.type?"":u)+'
    '+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
    '+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t'+r.btn[t]+"";return'
    '+e+"
    "}():"")+(r.resize?'':"")+"
    "],u,i('
    ')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(t){s=t.find(".layui-layer-input"),s.val(e.value||"").focus(),"function"==typeof f&&f(t)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:'
      '+function(){var e=t.length,i=1,a="";if(e>0)for(a='
    • '+(t[0].content||"no content")+"
    • ";i'+(t[i].content||"no content")+"";return a}()+"
    ",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(u[d].alt||
    '+(u.length>1?'':"")+'
    '+(u[d].alt||"")+""+s.imgIndex+"/"+u.length+"
    ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
    是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/lay/modules/laypage.js b/Yangcai365_web/manage/zinc/layui/lay/modules/laypage.js new file mode 100644 index 0000000..0ddc3cb --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/lay/modules/laypage.js @@ -0,0 +1,2 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ + ;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),refresh:['','',""].join(""),skip:function(){return['到第','','页',""].join("")}()};return['
    ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
    "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/lay/modules/laytpl.js b/Yangcai365_web/manage/zinc/layui/lay/modules/laytpl.js new file mode 100644 index 0000000..7590e08 --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/lay/modules/laytpl.js @@ -0,0 +1,2 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ + ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)}); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/lay/modules/mobile.js b/Yangcai365_web/manage/zinc/layui/lay/modules/mobile.js new file mode 100644 index 0000000..4b3e7ae --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/lay/modules/mobile.js @@ -0,0 +1,2 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ + ;layui.define(function(i){i("layui.mobile",layui.v)});layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});layui.define(function(e){"use strict";var t=(window,document),i="querySelectorAll",n="getElementsByClassName",a=function(e){return t[i](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var i in e)t[i]=e[i];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var o=0,r=["layui-m-layer"],d=function(e){var t=this;t.config=l.extend(e),t.view()};d.prototype.view=function(){var e=this,i=e.config,s=t.createElement("div");e.id=s.id=r[0]+o,s.setAttribute("class",r[0]+" "+r[0]+(i.type||0)),s.setAttribute("index",o);var l=function(){var e="object"==typeof i.title;return i.title?'

    '+(e?i.title[0]:i.title)+"

    ":""}(),d=function(){"string"==typeof i.btn&&(i.btn=[i.btn]);var e,t=(i.btn||[]).length;return 0!==t&&i.btn?(e=''+i.btn[0]+"",2===t&&(e=''+i.btn[1]+""+e),'
    '+e+"
    "):""}();if(i.fixed||(i.top=i.hasOwnProperty("top")?i.top:100,i.style=i.style||"",i.style+=" top:"+(t.body.scrollTop+i.top)+"px"),2===i.type&&(i.content='

    '+(i.content||"")+"

    "),i.skin&&(i.anim="up"),"msg"===i.skin&&(i.shade=!1),s.innerHTML=(i.shade?"
    ':"")+'
    "+l+'
    '+i.content+"
    "+d+"
    ",!i.type||2===i.type){var y=t[n](r[0]+i.type),u=y.length;u>=1&&c.close(y[0].getAttribute("index"))}document.body.appendChild(s);var m=e.elem=a("#"+e.id)[0];i.success&&i.success(m),e.index=o++,e.action(i,m)},d.prototype.action=function(e,t){var i=this;e.time&&(l.timer[i.index]=setTimeout(function(){c.close(i.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),c.close(i.index)):e.yes?e.yes(i.index):c.close(i.index)};if(e.btn)for(var s=t[n]("layui-m-layerbtn")[0].children,o=s.length,r=0;r0&&e-1 in t)}function s(t){return A.call(t,function(t){return null!=t})}function u(t){return t.length>0?T.fn.concat.apply([],t):t}function c(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(t){return t in F?F[t]:F[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||k[c(t)]?e:e+"px"}function h(t){var e,n;return $[t]||(e=L.createElement(t),L.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),$[t]=n),$[t]}function p(t){return"children"in t?D.call(t.children):T.map(t.childNodes,function(t){if(1==t.nodeType)return t})}function d(t,e){var n,r=t?t.length:0;for(n=0;n]*>/,R=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Z=/^(?:body|html)$/i,q=/([A-Z])/g,H=["val","css","html","text","data","width","height","offset"],I=["after","prepend","before","append"],V=L.createElement("table"),_=L.createElement("tr"),B={tr:L.createElement("tbody"),tbody:V,thead:V,tfoot:V,td:_,th:_,"*":L.createElement("div")},U=/complete|loaded|interactive/,X=/^[\w-]*$/,J={},W=J.toString,Y={},G=L.createElement("div"),K={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Q=Array.isArray||function(t){return t instanceof Array};return Y.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var r,i=t.parentNode,o=!i;return o&&(i=G).appendChild(t),r=~Y.qsa(i,e).indexOf(t),o&&G.removeChild(t),r},C=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},N=function(t){return A.call(t,function(e,n){return t.indexOf(e)==n})},Y.fragment=function(t,e,n){var r,i,a;return R.test(t)&&(r=T(L.createElement(RegExp.$1))),r||(t.replace&&(t=t.replace(z,"<$1>")),e===E&&(e=M.test(t)&&RegExp.$1),e in B||(e="*"),a=B[e],a.innerHTML=""+t,r=T.each(D.call(a.childNodes),function(){a.removeChild(this)})),o(n)&&(i=T(r),T.each(n,function(t,e){H.indexOf(t)>-1?i[t](e):i.attr(t,e)})),r},Y.Z=function(t,e){return new d(t,e)},Y.isZ=function(t){return t instanceof Y.Z},Y.init=function(t,n){var r;if(!t)return Y.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&M.test(t))r=Y.fragment(t,RegExp.$1,n),t=null;else{if(n!==E)return T(n).find(t);r=Y.qsa(L,t)}else{if(e(t))return T(L).ready(t);if(Y.isZ(t))return t;if(Q(t))r=s(t);else if(i(t))r=[t],t=null;else if(M.test(t))r=Y.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==E)return T(n).find(t);r=Y.qsa(L,t)}}return Y.Z(r,t)},T=function(t,e){return Y.init(t,e)},T.extend=function(t){var e,n=D.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){m(t,n,e)}),t},Y.qsa=function(t,e){var n,r="#"==e[0],i=!r&&"."==e[0],o=r||i?e.slice(1):e,a=X.test(o);return t.getElementById&&a&&r?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:D.call(a&&!r&&t.getElementsByClassName?i?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},T.contains=L.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},T.type=t,T.isFunction=e,T.isWindow=n,T.isArray=Q,T.isPlainObject=o,T.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},T.isNumeric=function(t){var e=Number(t),n=typeof t;return null!=t&&"boolean"!=n&&("string"!=n||t.length)&&!isNaN(e)&&isFinite(e)||!1},T.inArray=function(t,e,n){return O.indexOf.call(e,t,n)},T.camelCase=C,T.trim=function(t){return null==t?"":String.prototype.trim.call(t)},T.uuid=0,T.support={},T.expr={},T.noop=function(){},T.map=function(t,e){var n,r,i,o=[];if(a(t))for(r=0;r=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return O.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):T(A.call(this,function(e){return Y.matches(e,t)}))},add:function(t,e){return T(N(this.concat(T(t,e))))},is:function(t){return this.length>0&&Y.matches(this[0],t)},not:function(t){var n=[];if(e(t)&&t.call!==E)this.each(function(e){t.call(this,e)||n.push(this)});else{var r="string"==typeof t?this.filter(t):a(t)&&e(t.item)?D.call(t):T(t);this.forEach(function(t){r.indexOf(t)<0&&n.push(t)})}return T(n)},has:function(t){return this.filter(function(){return i(t)?T.contains(this,t):T(this).find(t).size()})},eq:function(t){return t===-1?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!i(t)?t:T(t)},last:function(){var t=this[this.length-1];return t&&!i(t)?t:T(t)},find:function(t){var e,n=this;return e=t?"object"==typeof t?T(t).filter(function(){var t=this;return O.some.call(n,function(e){return T.contains(e,t)})}):1==this.length?T(Y.qsa(this[0],t)):this.map(function(){return Y.qsa(this,t)}):T()},closest:function(t,e){var n=[],i="object"==typeof t&&T(t);return this.each(function(o,a){for(;a&&!(i?i.indexOf(a)>=0:Y.matches(a,t));)a=a!==e&&!r(a)&&a.parentNode;a&&n.indexOf(a)<0&&n.push(a)}),T(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=T.map(n,function(t){if((t=t.parentNode)&&!r(t)&&e.indexOf(t)<0)return e.push(t),t});return v(e,t)},parent:function(t){return v(N(this.pluck("parentNode")),t)},children:function(t){return v(this.map(function(){return p(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||D.call(this.childNodes)})},siblings:function(t){return v(this.map(function(t,e){return A.call(p(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return T.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=h(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var n=e(t);if(this[0]&&!n)var r=T(t).get(0),i=r.parentNode||this.length>1;return this.each(function(e){T(this).wrapAll(n?t.call(this,e):i?r.cloneNode(!0):r)})},wrapAll:function(t){if(this[0]){T(this[0]).before(t=T(t));for(var e;(e=t.children()).length;)t=e.first();T(t).append(this)}return this},wrapInner:function(t){var n=e(t);return this.each(function(e){var r=T(this),i=r.contents(),o=n?t.call(this,e):t;i.length?i.wrapAll(o):r.append(o)})},unwrap:function(){return this.parent().each(function(){T(this).replaceWith(T(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=T(this);(t===E?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return T(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return T(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;T(this).empty().append(g(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=g(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this.pluck("textContent").join(""):null},attr:function(t,e){var n;return"string"!=typeof t||1 in arguments?this.each(function(n){if(1===this.nodeType)if(i(t))for(j in t)y(this,j,t[j]);else y(this,t,g(this,e,n,this.getAttribute(t)))}):0 in this&&1==this[0].nodeType&&null!=(n=this[0].getAttribute(t))?n:E},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){y(this,t)},this)})},prop:function(t,e){return t=K[t]||t,1 in arguments?this.each(function(n){this[t]=g(this,e,n,this[t])}):this[0]&&this[0][t]},removeProp:function(t){return t=K[t]||t,this.each(function(){delete this[t]})},data:function(t,e){var n="data-"+t.replace(q,"-$1").toLowerCase(),r=1 in arguments?this.attr(n,e):this.attr(n);return null!==r?b(r):E},val:function(t){return 0 in arguments?(null==t&&(t=""),this.each(function(e){this.value=g(this,t,e,this.value)})):this[0]&&(this[0].multiple?T(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var n=T(this),r=g(this,t,e,n.offset()),i=n.offsetParent().offset(),o={top:r.top-i.top,left:r.left-i.left};"static"==n.css("position")&&(o.position="relative"),n.css(o)});if(!this.length)return null;if(L.documentElement!==this[0]&&!T.contains(L.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,n){if(arguments.length<2){var r=this[0];if("string"==typeof e){if(!r)return;return r.style[C(e)]||getComputedStyle(r,"").getPropertyValue(e)}if(Q(e)){if(!r)return;var i={},o=getComputedStyle(r,"");return T.each(e,function(t,e){i[e]=r.style[C(e)]||o.getPropertyValue(e)}),i}}var a="";if("string"==t(e))n||0===n?a=c(e)+":"+f(e,n):this.each(function(){this.style.removeProperty(c(e))});else for(j in e)e[j]||0===e[j]?a+=c(j)+":"+f(j,e[j])+";":this.each(function(){this.style.removeProperty(c(j))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(T(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return!!t&&O.some.call(this,function(t){return this.test(x(t))},l(t))},addClass:function(t){return t?this.each(function(e){if("className"in this){S=[];var n=x(this),r=g(this,t,e,n);r.split(/\s+/g).forEach(function(t){T(this).hasClass(t)||S.push(t)},this),S.length&&x(this,n+(n?" ":"")+S.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===E)return x(this,"");S=x(this),g(this,t,e,S).split(/\s+/g).forEach(function(t){S=S.replace(l(t)," ")}),x(this,S.trim())}})},toggleClass:function(t,e){return t?this.each(function(n){var r=T(this),i=g(this,t,n,x(this));i.split(/\s+/g).forEach(function(t){(e===E?!r.hasClass(t):e)?r.addClass(t):r.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===E?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===E?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),r=Z.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(T(t).css("margin-top"))||0,n.left-=parseFloat(T(t).css("margin-left"))||0,r.top+=parseFloat(T(e[0]).css("border-top-width"))||0,r.left+=parseFloat(T(e[0]).css("border-left-width"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||L.body;t&&!Z.test(t.nodeName)&&"static"==T(t).css("position");)t=t.offsetParent;return t})}},T.fn.detach=T.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});T.fn[t]=function(i){var o,a=this[0];return i===E?n(a)?a["inner"+e]:r(a)?a.documentElement["scroll"+e]:(o=this.offset())&&o[t]:this.each(function(e){a=T(this),a.css(t,g(this,i,e,a[t]()))})}}),I.forEach(function(e,n){var r=n%2;T.fn[e]=function(){var e,i,o=T.map(arguments,function(n){var r=[];return e=t(n),"array"==e?(n.forEach(function(t){return t.nodeType!==E?r.push(t):T.zepto.isZ(t)?r=r.concat(t.get()):void(r=r.concat(Y.fragment(t)))}),r):"object"==e||null==n?n:Y.fragment(n)}),a=this.length>1;return o.length<1?this:this.each(function(t,e){i=r?e:e.parentNode,e=0==n?e.nextSibling:1==n?e.firstChild:2==n?e:null;var s=T.contains(L.documentElement,i);o.forEach(function(t){if(a)t=t.cloneNode(!0);else if(!i)return T(t).remove();i.insertBefore(t,e),s&&w(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var e=t.ownerDocument?t.ownerDocument.defaultView:window;e.eval.call(e,t.innerHTML)}})})})},T.fn[r?e+"To":"insert"+(n?"Before":"After")]=function(t){return T(t)[e](this),this}}),Y.Z.prototype=d.prototype=T.fn,Y.uniq=N,Y.deserializeValue=b,T.zepto=Y,T}();!function(t){function e(t){return t._zid||(t._zid=h++)}function n(t,n,o,a){if(n=r(n),n.ns)var s=i(n.ns);return(v[e(t)]||[]).filter(function(t){return t&&(!n.e||t.e==n.e)&&(!n.ns||s.test(t.ns))&&(!o||e(t.fn)===e(o))&&(!a||t.sel==a)})}function r(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function i(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function o(t,e){return t.del&&!y&&t.e in x||!!e}function a(t){return b[t]||y&&x[t]||t}function s(n,i,s,u,l,h,p){var d=e(n),m=v[d]||(v[d]=[]);i.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var i=r(e);i.fn=s,i.sel=l,i.e in b&&(s=function(e){var n=e.relatedTarget;if(!n||n!==this&&!t.contains(this,n))return i.fn.apply(this,arguments)}),i.del=h;var d=h||s;i.proxy=function(t){if(t=c(t),!t.isImmediatePropagationStopped()){t.data=u;var e=d.apply(n,t._args==f?[t]:[t].concat(t._args));return e===!1&&(t.preventDefault(),t.stopPropagation()),e}},i.i=m.length,m.push(i),"addEventListener"in n&&n.addEventListener(a(i.e),i.proxy,o(i,p))})}function u(t,r,i,s,u){var c=e(t);(r||"").split(/\s/).forEach(function(e){n(t,e,i,s).forEach(function(e){delete v[c][e.i],"removeEventListener"in t&&t.removeEventListener(a(e.e),e.proxy,o(e,u))})})}function c(e,n){return!n&&e.isDefaultPrevented||(n||(n=e),t.each(T,function(t,r){var i=n[t];e[t]=function(){return this[r]=w,i&&i.apply(n,arguments)},e[r]=E}),e.timeStamp||(e.timeStamp=Date.now()),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(e.isDefaultPrevented=w)),e}function l(t){var e,n={originalEvent:t};for(e in t)j.test(e)||t[e]===f||(n[e]=t[e]);return c(n,t)}var f,h=1,p=Array.prototype.slice,d=t.isFunction,m=function(t){return"string"==typeof t},v={},g={},y="onfocusin"in window,x={focus:"focusin",blur:"focusout"},b={mouseenter:"mouseover",mouseleave:"mouseout"};g.click=g.mousedown=g.mouseup=g.mousemove="MouseEvents",t.event={add:s,remove:u},t.proxy=function(n,r){var i=2 in arguments&&p.call(arguments,2);if(d(n)){var o=function(){return n.apply(r,i?i.concat(p.call(arguments)):arguments)};return o._zid=e(n),o}if(m(r))return i?(i.unshift(n[r],n),t.proxy.apply(null,i)):t.proxy(n[r],n);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,r){return this.on(t,e,n,r,1)};var w=function(){return!0},E=function(){return!1},j=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,T={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,n,r,i,o){var a,c,h=this;return e&&!m(e)?(t.each(e,function(t,e){h.on(t,n,r,e,o)}),h):(m(n)||d(i)||i===!1||(i=r,r=n,n=f),i!==f&&r!==!1||(i=r,r=f),i===!1&&(i=E),h.each(function(f,h){o&&(a=function(t){return u(h,t.type,i),i.apply(this,arguments)}),n&&(c=function(e){var r,o=t(e.target).closest(n,h).get(0);if(o&&o!==h)return r=t.extend(l(e),{currentTarget:o,liveFired:h}),(a||i).apply(o,[r].concat(p.call(arguments,1)))}),s(h,e,i,r,n,c||a)}))},t.fn.off=function(e,n,r){var i=this;return e&&!m(e)?(t.each(e,function(t,e){i.off(t,n,e)}),i):(m(n)||d(r)||r===!1||(r=n,n=f),r===!1&&(r=E),i.each(function(){u(this,e,r,n)}))},t.fn.trigger=function(e,n){return e=m(e)||t.isPlainObject(e)?t.Event(e):c(e),e._args=n,this.each(function(){e.type in x&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,r){var i,o;return this.each(function(a,s){i=l(m(e)?t.Event(e):e),i._args=r,i.target=s,t.each(n(s,e.type||e),function(t,e){if(o=e.proxy(i),i.isImmediatePropagationStopped())return!1})}),o},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){m(t)||(e=t,t=e.type);var n=document.createEvent(g[t]||"Events"),r=!0;if(e)for(var i in e)"bubbles"==i?r=!!e[i]:n[i]=e[i];return n.initEvent(t,r,!0),c(n)}}(e),function(t){function e(e,n,r){var i=t.Event(n);return t(e).trigger(i,r),!i.isDefaultPrevented()}function n(t,n,r,i){if(t.global)return e(n||x,r,i)}function r(e){e.global&&0===t.active++&&n(e,null,"ajaxStart")}function i(e){e.global&&!--t.active&&n(e,null,"ajaxStop")}function o(t,e){var r=e.context;return e.beforeSend.call(r,t,e)!==!1&&n(e,r,"ajaxBeforeSend",[t,e])!==!1&&void n(e,r,"ajaxSend",[t,e])}function a(t,e,r,i){var o=r.context,a="success";r.success.call(o,t,a,e),i&&i.resolveWith(o,[t,a,e]),n(r,o,"ajaxSuccess",[e,r,t]),u(a,e,r)}function s(t,e,r,i,o){var a=i.context;i.error.call(a,r,e,t),o&&o.rejectWith(a,[r,e,t]),n(i,a,"ajaxError",[r,i,t||e]),u(e,r,i)}function u(t,e,r){var o=r.context;r.complete.call(o,e,t),n(r,o,"ajaxComplete",[e,r]),i(r)}function c(t,e,n){if(n.dataFilter==l)return t;var r=n.context;return n.dataFilter.call(r,t,e)}function l(){}function f(t){return t&&(t=t.split(";",2)[0]),t&&(t==T?"html":t==j?"json":w.test(t)?"script":E.test(t)&&"xml")||"text"}function h(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function p(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()&&"jsonp"!=e.dataType||(e.url=h(e.url,e.data),e.data=void 0)}function d(e,n,r,i){return t.isFunction(n)&&(i=r,r=n,n=void 0),t.isFunction(r)||(i=r,r=void 0),{url:e,data:n,success:r,dataType:i}}function m(e,n,r,i){var o,a=t.isArray(n),s=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),i&&(n=r?i:i+"["+(s||"object"==o||"array"==o?n:"")+"]"),!i&&a?e.add(u.name,u.value):"array"==o||!r&&"object"==o?m(e,u,r,n):e.add(n,u)})}var v,g,y=+new Date,x=window.document,b=/)<[^<]*)*<\/script>/gi,w=/^(?:text|application)\/javascript/i,E=/^(?:text|application)\/xml/i,j="application/json",T="text/html",S=/^\s*$/,C=x.createElement("a");C.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,n){if(!("type"in e))return t.ajax(e);var r,i,u=e.jsonpCallback,c=(t.isFunction(u)?u():u)||"Zepto"+y++,l=x.createElement("script"),f=window[c],h=function(e){t(l).triggerHandler("error",e||"abort")},p={abort:h};return n&&n.promise(p),t(l).on("load error",function(o,u){clearTimeout(i),t(l).off().remove(),"error"!=o.type&&r?a(r[0],p,e,n):s(null,u||"error",p,e,n),window[c]=f,r&&t.isFunction(f)&&f(r[0]),f=r=void 0}),o(p,e)===!1?(h("abort"),p):(window[c]=function(){r=arguments},l.src=e.url.replace(/\?(.+)=\?/,"?$1="+c),x.head.appendChild(l),e.timeout>0&&(i=setTimeout(function(){h("timeout")},e.timeout)),p)},t.ajaxSettings={type:"GET",beforeSend:l,success:l,error:l,complete:l,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:j,xml:"application/xml, text/xml",html:T,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:l},t.ajax=function(e){var n,i,u=t.extend({},e||{}),d=t.Deferred&&t.Deferred();for(v in t.ajaxSettings)void 0===u[v]&&(u[v]=t.ajaxSettings[v]);r(u),u.crossDomain||(n=x.createElement("a"),n.href=u.url,n.href=n.href,u.crossDomain=C.protocol+"//"+C.host!=n.protocol+"//"+n.host),u.url||(u.url=window.location.toString()),(i=u.url.indexOf("#"))>-1&&(u.url=u.url.slice(0,i)),p(u);var m=u.dataType,y=/\?.+=\?/.test(u.url);if(y&&(m="jsonp"),u.cache!==!1&&(e&&e.cache===!0||"script"!=m&&"jsonp"!=m)||(u.url=h(u.url,"_="+Date.now())),"jsonp"==m)return y||(u.url=h(u.url,u.jsonp?u.jsonp+"=?":u.jsonp===!1?"":"callback=?")),t.ajaxJSONP(u,d);var b,w=u.accepts[m],E={},j=function(t,e){E[t.toLowerCase()]=[t,e]},T=/^([\w-]+:)\/\//.test(u.url)?RegExp.$1:window.location.protocol,N=u.xhr(),O=N.setRequestHeader;if(d&&d.promise(N),u.crossDomain||j("X-Requested-With","XMLHttpRequest"),j("Accept",w||"*/*"),(w=u.mimeType||w)&&(w.indexOf(",")>-1&&(w=w.split(",",2)[0]),N.overrideMimeType&&N.overrideMimeType(w)),(u.contentType||u.contentType!==!1&&u.data&&"GET"!=u.type.toUpperCase())&&j("Content-Type",u.contentType||"application/x-www-form-urlencoded"),u.headers)for(g in u.headers)j(g,u.headers[g]);if(N.setRequestHeader=j,N.onreadystatechange=function(){if(4==N.readyState){N.onreadystatechange=l,clearTimeout(b);var e,n=!1;if(N.status>=200&&N.status<300||304==N.status||0==N.status&&"file:"==T){if(m=m||f(u.mimeType||N.getResponseHeader("content-type")),"arraybuffer"==N.responseType||"blob"==N.responseType)e=N.response;else{e=N.responseText;try{e=c(e,m,u),"script"==m?(0,eval)(e):"xml"==m?e=N.responseXML:"json"==m&&(e=S.test(e)?null:t.parseJSON(e))}catch(r){n=r}if(n)return s(n,"parsererror",N,u,d)}a(e,N,u,d)}else s(N.statusText||null,N.status?"error":"abort",N,u,d)}},o(N,u)===!1)return N.abort(),s(null,"abort",N,u,d),N;var P=!("async"in u)||u.async;if(N.open(u.type,u.url,P,u.username,u.password),u.xhrFields)for(g in u.xhrFields)N[g]=u.xhrFields[g];for(g in E)O.apply(N,E[g]);return u.timeout>0&&(b=setTimeout(function(){N.onreadystatechange=l,N.abort(),s(null,"timeout",N,u,d)},u.timeout)),N.send(u.data?u.data:null),N},t.get=function(){return t.ajax(d.apply(null,arguments))},t.post=function(){var e=d.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=d.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,n,r){if(!this.length)return this;var i,o=this,a=e.split(/\s/),s=d(e,n,r),u=s.success;return a.length>1&&(s.url=a[0],i=a[1]),s.success=function(e){o.html(i?t("
    ").html(e.replace(b,"")).find(i):e),u&&u.apply(o,arguments)},t.ajax(s),this};var N=encodeURIComponent;t.param=function(e,n){var r=[];return r.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(N(e)+"="+N(n))},m(r,e,n),r.join("&").replace(/%20/g,"+")}}(e),function(t){t.fn.serializeArray=function(){var e,n,r=[],i=function(t){return t.forEach?t.forEach(i):void r.push({name:e,value:t})};return this[0]&&t.each(this[0].elements,function(r,o){n=o.type,e=o.name,e&&"fieldset"!=o.nodeName.toLowerCase()&&!o.disabled&&"submit"!=n&&"reset"!=n&&"button"!=n&&"file"!=n&&("radio"!=n&&"checkbox"!=n||o.checked)&&i(t(o).val())}),r},t.fn.serialize=function(){var t=[];return this.serializeArray().forEach(function(e){t.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}),t.join("&")},t.fn.submit=function(e){if(0 in arguments)this.bind("submit",e);else if(this.length){var n=t.Event("submit");this.eq(0).trigger(n),n.isDefaultPrevented()||this.get(0).submit()}return this}}(e),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t,n){try{return e(t,n)}catch(r){return null}}}}(),t("zepto",e)});layui.define(["layer-mobile","zepto"],function(e){"use strict";var t=layui.zepto,a=layui["layer-mobile"],i=(layui.device(),"layui-upload-enter"),n="layui-upload-iframe",r={icon:2,shift:6},o={file:"文件",video:"视频",audio:"音频"};a.msg=function(e){return a.open({content:e||"",skin:"msg",time:2})};var s=function(e){this.options=e};s.prototype.init=function(){var e=this,a=e.options,r=t("body"),s=t(a.elem||".layui-upload-file"),u=t('');return t("#"+n)[0]||r.append(u),s.each(function(r,s){s=t(s);var u='
    ',l=s.attr("lay-type")||a.type;a.unwrap||(u='
    '+u+''+(s.attr("lay-title")||a.title||"上传"+(o[l]||"图片"))+"
    "),u=t(u),a.unwrap||u.on("dragover",function(e){e.preventDefault(),t(this).addClass(i)}).on("dragleave",function(){t(this).removeClass(i)}).on("drop",function(){t(this).removeClass(i)}),s.parent("form").attr("target")===n&&(a.unwrap?s.unwrap():(s.parent().next().remove(),s.unwrap().unwrap())),s.wrap(u),s.off("change").on("change",function(){e.action(this,l)})})},s.prototype.action=function(e,i){var o=this,s=o.options,u=e.value,l=t(e),p=l.attr("lay-ext")||s.ext||"";if(u){switch(i){case"file":if(p&&!RegExp("\\w\\.("+p+")$","i").test(escape(u)))return a.msg("不支持该文件格式",r),e.value="";break;case"video":if(!RegExp("\\w\\.("+(p||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(u)))return a.msg("不支持该视频格式",r),e.value="";break;case"audio":if(!RegExp("\\w\\.("+(p||"mp3|wav|mid")+")$","i").test(escape(u)))return a.msg("不支持该音频格式",r),e.value="";break;default:if(!RegExp("\\w\\.("+(p||"jpg|png|gif|bmp|jpeg")+")$","i").test(escape(u)))return a.msg("不支持该图片格式",r),e.value=""}s.before&&s.before(e),l.parent().submit();var c=t("#"+n),f=setInterval(function(){var t;try{t=c.contents().find("body").text()}catch(i){a.msg("上传接口存在跨域",r),clearInterval(f)}if(t){clearInterval(f),c.contents().find("body").html("");try{t=JSON.parse(t)}catch(i){return t={},a.msg("请对上传接口返回JSON字符",r)}"function"==typeof s.success&&s.success(t,e)}},30);e.value=""}},e("upload-mobile",function(e){var t=new s(e=e||{});t.init()})});layui.define(function(i){i("layim-mobile",layui.v)});layui["layui.mobile"]||layui.config({base:layui.cache.dir+"lay/modules/mobile/"}).extend({"layer-mobile":"layer-mobile",zepto:"zepto","upload-mobile":"upload-mobile","layim-mobile":"layim-mobile"}),layui.define(["layer-mobile","zepto","layim-mobile"],function(l){l("mobile",{layer:layui["layer-mobile"],layim:layui["layim-mobile"]})}); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/lay/modules/rate.js b/Yangcai365_web/manage/zinc/layui/lay/modules/rate.js new file mode 100644 index 0000000..7ba3f14 --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/lay/modules/rate.js @@ -0,0 +1,2 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ + ;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='
      ",u=1;u<=i.length;u++){var r='
    • ";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'
    • ":n+=r}n+="
    "+(i.text?''+i.value+"星":"")+"";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)}); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/lay/modules/slider.js b/Yangcai365_web/manage/zinc/layui/lay/modules/slider.js new file mode 100644 index 0000000..54d6d00 --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/lay/modules/slider.js @@ -0,0 +1,2 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ + ;layui.define("jquery",function(e){"use strict";var i=layui.jquery,t={config:{},index:layui.slider?layui.slider.index+1e4:0,set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,n,e,i)}},a=function(){var e=this,i=e.config;return{setValue:function(i,t){return e.slide("set",i,t||0)},config:i}},n="slider",l="layui-disabled",s="layui-slider",r="layui-slider-bar",o="layui-slider-wrap",u="layui-slider-wrap-btn",d="layui-slider-tips",v="layui-slider-input",c="layui-slider-input-txt",m="layui-slider-input-btn",p="layui-slider-hover",f=function(e){var a=this;a.index=++t.index,a.config=i.extend({},a.config,t.config,e),a.render()};f.prototype.config={type:"default",min:0,max:100,value:0,step:1,showstep:!1,tips:!0,input:!1,range:!1,height:200,disabled:!1,theme:"#009688"},f.prototype.render=function(){var e=this,t=e.config;if(t.step<1&&(t.step=1),t.maxt.min?a:t.min,t.value[1]=n>t.min?n:t.min,t.value[0]=t.value[0]>t.max?t.max:t.value[0],t.value[1]=t.value[1]>t.max?t.max:t.value[1];var r=Math.floor((t.value[0]-t.min)/(t.max-t.min)*100),v=Math.floor((t.value[1]-t.min)/(t.max-t.min)*100),m=v-r+"%";r+="%",v+="%"}else{"object"==typeof t.value&&(t.value=Math.min.apply(null,t.value)),t.valuet.max&&(t.value=t.max);var m=Math.floor((t.value-t.min)/(t.max-t.min)*100)+"%"}var p=t.disabled?"#c2c2c2":t.theme,f='
    '+(t.tips?'
    ':"")+'
    '+(t.range?'
    ':"")+"
    ",h=i(t.elem),y=h.next("."+s);if(y[0]&&y.remove(),e.elemTemp=i(f),t.range?(e.elemTemp.find("."+o).eq(0).data("value",t.value[0]),e.elemTemp.find("."+o).eq(1).data("value",t.value[1])):e.elemTemp.find("."+o).data("value",t.value),h.html(e.elemTemp),"vertical"===t.type&&e.elemTemp.height(t.height+"px"),t.showstep){for(var g=(t.max-t.min)/t.step,b="",x=1;x
    ')}e.elemTemp.append(b)}if(t.input&&!t.range){var w=i('
    ');h.css("position","relative"),h.append(w),h.find("."+c).children("input").val(t.value),"vertical"===t.type?w.css({left:0,top:-48}):e.elemTemp.css("margin-right",w.outerWidth()+15)}t.disabled?(e.elemTemp.addClass(l),e.elemTemp.find("."+u).addClass(l)):e.slide(),e.elemTemp.find("."+u).on("mouseover",function(){var a="vertical"===t.type?t.height:e.elemTemp[0].offsetWidth,n=e.elemTemp.find("."+o),l="vertical"===t.type?a-i(this).parent()[0].offsetTop-n.height():i(this).parent()[0].offsetLeft,s=l/a*100,r=i(this).parent().data("value"),u=t.setTips?t.setTips(r):r;e.elemTemp.find("."+d).html(u),"vertical"===t.type?e.elemTemp.find("."+d).css({bottom:s+"%","margin-bottom":"20px",display:"inline-block"}):e.elemTemp.find("."+d).css({left:s+"%",display:"inline-block"})}).on("mouseout",function(){e.elemTemp.find("."+d).css("display","none")})},f.prototype.slide=function(e,t,a){var n=this,l=n.config,s=n.elemTemp,f=function(){return"vertical"===l.type?l.height:s[0].offsetWidth},h=s.find("."+o),y=s.next("."+v),g=y.children("."+c).children("input").val(),b=100/((l.max-l.min)/Math.ceil(l.step)),x=function(e,i){e=Math.ceil(e)*b>100?Math.ceil(e)*b:Math.round(e)*b,e=e>100?100:e,h.eq(i).css("vertical"===l.type?"bottom":"left",e+"%");var t=T(h[0].offsetLeft),a=l.range?T(h[1].offsetLeft):0;"vertical"===l.type?(s.find("."+d).css({bottom:e+"%","margin-bottom":"20px"}),t=T(f()-h[0].offsetTop-h.height()),a=l.range?T(f()-h[1].offsetTop-h.height()):0):s.find("."+d).css("left",e+"%"),t=t>100?100:t,a=a>100?100:a;var n=Math.min(t,a),o=Math.abs(t-a);"vertical"===l.type?s.find("."+r).css({height:o+"%",bottom:n+"%"}):s.find("."+r).css({width:o+"%",left:n+"%"});var u=l.min+Math.round((l.max-l.min)*e/100);if(g=u,y.children("."+c).children("input").val(g),h.eq(i).data("value",u),u=l.setTips?l.setTips(u):u,s.find("."+d).html(u),l.range){var v=[h.eq(0).data("value"),h.eq(1).data("value")];v[0]>v[1]&&v.reverse()}l.change&&l.change(l.range?v:u)},T=function(e){var i=e/f()*100/b,t=Math.round(i)*b;return e==f()&&(t=Math.ceil(i)*b),t},w=i(['
    f()&&(r=f());var o=r/f()*100/b;x(o,e),t.addClass(p),s.find("."+d).show(),i.preventDefault()},o=function(){t.removeClass(p),s.find("."+d).hide()};M(r,o)})}),s.on("click",function(e){var t=i("."+u);if(!t.is(event.target)&&0===t.has(event.target).length&&t.length){var a,n="vertical"===l.type?f()-e.clientY+i(this).offset().top:e.clientX-i(this).offset().left;n<0&&(n=0),n>f()&&(n=f());var s=n/f()*100/b;a=l.range?"vertical"===l.type?Math.abs(n-parseInt(i(h[0]).css("bottom")))>Math.abs(n-parseInt(i(h[1]).css("bottom")))?1:0:Math.abs(n-h[0].offsetLeft)>Math.abs(n-h[1].offsetLeft)?1:0:0,x(s,a),e.preventDefault()}}),y.hover(function(){var e=i(this);e.children("."+m).fadeIn("fast")},function(){var e=i(this);e.children("."+m).fadeOut("fast")}),y.children("."+m).children("i").each(function(e){i(this).on("click",function(){g=1==e?g-l.stepl.max?l.max:Number(g)+l.step;var i=(g-l.min)/(l.max-l.min)*100/b;x(i,0)})});var q=function(){var e=this.value;e=isNaN(e)?0:e,e=el.max?l.max:e,this.value=e;var i=(e-l.min)/(l.max-l.min)*100/b;x(i,0)};y.children("."+c).children("input").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),q.call(this))}).on("change",q)},f.prototype.events=function(){var e=this;e.config},t.render=function(e){var i=new f(e);return a.call(i)},e(n,t)}); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/lay/modules/table.js b/Yangcai365_web/manage/zinc/layui/lay/modules/table.js new file mode 100644 index 0000000..11e4d44 --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/lay/modules/table.js @@ -0,0 +1,2 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ + ;layui.define(["laytpl","laypage","layer","form","util"],function(e){"use strict";var t=layui.$,i=layui.laytpl,a=layui.laypage,l=layui.layer,n=layui.form,o=(layui.util,layui.hint()),r=layui.device(),d={config:{checkName:"LAY_CHECKED",indexName:"LAY_TABLE_INDEX"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,y,e,t)}},c=function(){var e=this,t=e.config,i=t.id||t.index;return i&&(c.that[i]=e,c.config[i]=t),{config:t,reload:function(t){e.reload.call(e,t)},setColsWidth:function(){e.setColsWidth.call(e)},resize:function(){e.resize.call(e)}}},s=function(e){var t=c.config[e];return t||o.error("The ID option was not found in the table instance"),t||null},u=function(e,a,l,n){var o=e.templet?function(){return"function"==typeof e.templet?e.templet(l):i(t(e.templet).html()||String(a)).render(l)}():a;return n?t("
    "+o+"
    ").text():o},y="table",h=".layui-table",f="layui-hide",p="layui-none",v="layui-table-view",m=".layui-table-tool",g=".layui-table-box",b=".layui-table-init",x=".layui-table-header",k=".layui-table-body",C=".layui-table-main",w=".layui-table-fixed",T=".layui-table-fixed-l",A=".layui-table-fixed-r",L=".layui-table-total",N=".layui-table-page",S=".layui-table-sort",W="layui-table-edit",_="layui-table-hover",E=function(e){var t='{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';return e=e||{},['
    ',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',function(){return e.fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':""}(),"{{# var isSort = !(item2.colGroup) && item2.sort; }}",'",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
    ','
    ','{{# if(item2.type === "checkbox"){ }}','',"{{# } else { }}",'{{item2.title||""}}',"{{# if(isSort){ }}",'',"{{# } }}","{{# } }}","
    ","
    "].join("")},z=['',"","
    "].join(""),H=['
    ',"{{# if(d.data.toolbar){ }}",'
    ','
    ','
    ',"
    ","{{# } }}",'
    ',"{{# if(d.data.loading){ }}",'
    ','',"
    ","{{# } }}","{{# var left, right; }}",'
    ',E(),"
    ",'
    ',z,"
    ","{{# if(left){ }}",'
    ','
    ',E({fixed:!0}),"
    ",'
    ',z,"
    ","
    ","{{# }; }}","{{# if(right){ }}",'
    ','
    ',E({fixed:"right"}),'
    ',"
    ",'
    ',z,"
    ","
    ","{{# }; }}","
    ","{{# if(d.data.totalRow){ }}",'
    ','','',"
    ","
    ","{{# } }}","{{# if(d.data.page){ }}",'
    ','
    ',"
    ","{{# } }}","","
    "].join(""),R=t(window),F=t(document),I=function(e){var i=this;i.index=++d.index,i.config=t.extend({},i.config,d.config,e),i.render()};I.prototype.config={limit:10,loading:!0,cellMinWidth:60,defaultToolbar:["filter","exports","print"],autoSort:!0,text:{none:"无数据"}},I.prototype.render=function(){var e=this,a=e.config;if(a.elem=t(a.elem),a.where=a.where||{},a.id=a.id||a.elem.attr("id")||e.index,a.request=t.extend({pageName:"page",limitName:"limit"},a.request),a.response=t.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",countName:"count"},a.response),"object"==typeof a.page&&(a.limit=a.page.limit||a.limit,a.limits=a.page.limits||a.limits,e.page=a.page.curr=a.page.curr||1,delete a.page.elem,delete a.page.jump),!a.elem[0])return e;a.height&&/^full-\d+$/.test(a.height)&&(e.fullHeightGap=a.height.split("-")[1],a.height=R.height()-e.fullHeightGap),e.setInit();var l=a.elem,n=l.next("."+v),o=e.elem=t(i(H).render({VIEW_CLASS:v,data:a,index:e.index}));if(a.index=e.index,e.key=a.id||a.index,n[0]&&n.remove(),l.after(o),e.layTool=o.find(m),e.layBox=o.find(g),e.layHeader=o.find(x),e.layMain=o.find(C),e.layBody=o.find(k),e.layFixed=o.find(w),e.layFixLeft=o.find(T),e.layFixRight=o.find(A),e.layTotal=o.find(L),e.layPage=o.find(N),e.renderToolbar(),e.fullSize(),a.cols.length>1){var r=e.layFixed.find(x).find("th");r.height(e.layHeader.height()-1-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom")))}e.pullData(e.page),e.events()},I.prototype.initOpts=function(e){var t=this,i=(t.config,{checkbox:48,radio:48,space:15,numbers:40});e.checkbox&&(e.type="checkbox"),e.space&&(e.type="space"),e.type||(e.type="normal"),"normal"!==e.type&&(e.unresize=!0,e.width=e.width||i[e.type])},I.prototype.setInit=function(e){var t=this,i=t.config;return i.clientWidth=i.width||function(){var e=function(t){var a,l;t=t||i.elem.parent(),a=t.width();try{l="none"===t.css("display")}catch(n){}return!t[0]||a&&!l?a:e(t.parent())};return e()}(),"width"===e?i.clientWidth:void layui.each(i.cols,function(e,a){layui.each(a,function(l,n){if(!n)return void a.splice(l,1);if(n.key=e+"-"+l,n.hide=n.hide||!1,n.colGroup||n.colspan>1){var o=0;layui.each(i.cols[e+1],function(t,i){i.HAS_PARENT||o>1&&o==n.colspan||(i.HAS_PARENT=!0,i.parentKey=e+"-"+l,o+=parseInt(i.colspan>1?i.colspan:1))}),n.colGroup=!0}t.initOpts(n)})})},I.prototype.renderToolbar=function(){var e=this,a=e.config,l=['
    ','
    ','
    '].join(""),n=e.layTool.find(".layui-table-tool-temp");if("default"===a.toolbar)n.html(l);else if("string"==typeof a.toolbar){var o=t(a.toolbar).html()||"";o&&n.html(i(o).render(a))}var r={filter:{title:"筛选列",layEvent:"LAYTABLE_COLS",icon:"layui-icon-cols"},exports:{title:"导出",layEvent:"LAYTABLE_EXPORT",icon:"layui-icon-export"},print:{title:"打印",layEvent:"LAYTABLE_PRINT",icon:"layui-icon-print"}},d=[];"object"==typeof a.defaultToolbar&&layui.each(a.defaultToolbar,function(e,t){var i=r[t];i&&d.push('
    ')}),e.layTool.find(".layui-table-tool-self").html(d.join(""))},I.prototype.setParentCol=function(e,t){var i=this,a=i.config,l=i.layHeader.find('th[data-key="'+a.index+"-"+t+'"]'),n=parseInt(l.attr("colspan"))||0;if(l[0]){var o=t.split("-"),r=a.cols[o[0]][o[1]];e?n--:n++,l.attr("colspan",n),l[n<1?"addClass":"removeClass"](f),r.colspan=n,r.hide=n<1;var d=l.data("parentkey");d&&i.setParentCol(e,d)}},I.prototype.setColsPatch=function(){var e=this,t=e.config;layui.each(t.cols,function(t,i){layui.each(i,function(t,i){i.hide&&e.setParentCol(i.hide,i.parentKey)})})},I.prototype.setColsWidth=function(){var e=this,t=e.config,i=0,a=0,l=0,n=0,o=e.setInit("width");e.eachCols(function(e,t){t.hide||i++}),o=o-function(){return"line"===t.skin||"nob"===t.skin?2:i+1}()-e.getScrollWidth(e.layMain[0])-1;var r=function(e){layui.each(t.cols,function(i,r){layui.each(r,function(i,d){var c=0,s=d.minWidth||t.cellMinWidth;return d?void(d.colGroup||d.hide||(e?l&&ln&&a&&(l=(o-n)/a)};r(),r(!0),e.autoColNums=a,e.eachCols(function(i,a){var n=a.minWidth||t.cellMinWidth;a.colGroup||a.hide||(0===a.width?e.getCssRule(t.index+"-"+a.key,function(e){e.style.width=Math.floor(l>=n?l:n)+"px"}):/\d+%$/.test(a.width)&&e.getCssRule(t.index+"-"+a.key,function(e){e.style.width=Math.floor(parseFloat(a.width)/100*o)+"px"}))});var d=e.layMain.width()-e.getScrollWidth(e.layMain[0])-e.layMain.children("table").outerWidth();if(e.autoColNums&&d>=-i&&d<=i){var c=function(t){var i;return t=t||e.layHeader.eq(0).find("thead th:last-child"),i=t.data("field"),!i&&t.prev()[0]?c(t.prev()):t},s=c(),u=s.data("key");e.getCssRule(u,function(t){var i=t.style.width||s.outerWidth();t.style.width=parseFloat(i)+d+"px",e.layMain.height()-e.layMain.prop("clientHeight")>0&&(t.style.width=parseFloat(t.style.width)-1+"px")})}e.loading(!0)},I.prototype.resize=function(){var e=this;e.fullSize(),e.setColsWidth(),e.scrollPatch()},I.prototype.reload=function(e){var i=this;e=e||{},delete i.haveInit,e.data&&e.data.constructor===Array&&delete i.config.data,i.config=t.extend(!0,{},i.config,e),i.render()},I.prototype.errorView=function(e){var i=this,a=i.layMain.find("."+p),l=t('
    '+(e||"Error")+"
    ");a[0]&&(i.layNone.remove(),a.remove()),i.layFixed.addClass(f),i.layMain.find("tbody").html(""),i.layMain.append(i.layNone=l),d.cache[i.key]=[]},I.prototype.page=1,I.prototype.pullData=function(e){var i=this,a=i.config,l=a.request,n=a.response,o=function(){"object"==typeof a.initSort&&i.sort(a.initSort.field,a.initSort.type)};if(i.startTime=(new Date).getTime(),a.url){var r={};r[l.pageName]=e,r[l.limitName]=a.limit;var d=t.extend(r,a.where);a.contentType&&0==a.contentType.indexOf("application/json")&&(d=JSON.stringify(d)),i.loading(),t.ajax({type:a.method||"get",url:a.url,contentType:a.contentType,data:d,dataType:"json",headers:a.headers||{},success:function(t){"function"==typeof a.parseData&&(t=a.parseData(t)||t),t[n.statusName]!=n.statusCode?(i.renderForm(),i.errorView(t[n.msgName]||'返回的数据不符合规范,正确的成功状态码应为:"'+n.statusName+'": '+n.statusCode)):(i.renderData(t,e,t[n.countName]),o(),a.time=(new Date).getTime()-i.startTime+" ms"),i.setColsWidth(),"function"==typeof a.done&&a.done(t,e,t[n.countName])},error:function(e,t){reqErrorHandling(e, t);i.errorView("数据接口请求异常:"+t),i.renderForm(),i.setColsWidth()}})}else if(a.data&&a.data.constructor===Array){var c={},s=e*a.limit-a.limit;c[n.dataName]=a.data.concat().splice(s,a.limit),c[n.countName]=a.data.length,i.renderData(c,e,c[n.countName]),o(),i.setColsWidth(),"function"==typeof a.done&&a.done(c,e,c[n.countName])}},I.prototype.eachCols=function(e){var t=this;return d.eachCols(null,e,t.config.cols),t},I.prototype.renderData=function(e,n,o,r){var c=this,s=c.config,y=e[s.response.dataName]||[],h=[],v=[],m=[],g=function(){var e;return!r&&c.sortKey?c.sort(c.sortKey.field,c.sortKey.sort,!0):(layui.each(y,function(a,l){var o=[],y=[],p=[],g=a+s.limit*(n-1)+1;0!==l.length&&(r||(l[d.config.indexName]=a),c.eachCols(function(n,r){var c=r.field||n,h=s.index+"-"+r.key,v=l[c];if(void 0!==v&&null!==v||(v=""),!r.colGroup){var m=['','
    '+function(){var n=t.extend(!0,{LAY_INDEX:g},l),o=d.config.checkName;switch(r.type){case"checkbox":return'";case"radio":return n[o]&&(e=a),'';case"numbers":return g}return r.toolbar?i(t(r.toolbar).html()||"").render(n):u(r,v,n)}(),"
    "].join("");o.push(m),r.fixed&&"right"!==r.fixed&&y.push(m),"right"===r.fixed&&p.push(m)}}),h.push(''+o.join("")+""),v.push(''+y.join("")+""),m.push(''+p.join("")+""))}),c.layBody.scrollTop(0),c.layMain.find("."+p).remove(),c.layMain.find("tbody").html(h.join("")),c.layFixLeft.find("tbody").html(v.join("")),c.layFixRight.find("tbody").html(m.join("")),c.renderForm(),"number"==typeof e&&c.setThisRowChecked(e),c.syncCheckAll(),c.haveInit?c.scrollPatch():setTimeout(function(){c.scrollPatch()},50),c.haveInit=!0,l.close(c.tipsIndex),s.HAS_SET_COLS_PATCH||c.setColsPatch(),void(s.HAS_SET_COLS_PATCH=!0))};return d.cache[c.key]=y,c.layPage[0==o||0===y.length&&1==n?"addClass":"removeClass"](f),r?g():0===y.length?(c.renderForm(),c.errorView(s.text.none)):(c.layFixed.removeClass(f),g(),c.renderTotal(y),void(s.page&&(s.page=t.extend({elem:"layui-table-page"+s.index,count:o,limit:s.limit,limits:s.limits||[10,20,30,40,50,60,70,80,90],groups:3,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(c.page=e.curr,s.limit=e.limit,c.pullData(e.curr))}},s.page),s.page.count=o,a.render(s.page))))},I.prototype.renderTotal=function(e){var t=this,i=t.config,a={};if(i.totalRow){layui.each(e,function(e,i){0!==i.length&&t.eachCols(function(e,t){var l=t.field||e,n=i[l];t.totalRow&&(a[l]=(a[l]||0)+(parseFloat(n)||0))})});var l=[];t.eachCols(function(e,t){var n=t.field||e,o=['','
    '+function(){var e=t.totalRowText||"";return t.totalRow?parseFloat(a[n]).toFixed(2)||e:e}(),"
    "].join("");l.push(o)}),t.layTotal.find("tbody").html(""+l.join("")+"")}},I.prototype.getColElem=function(e,t){var i=this,a=i.config;return e.eq(0).find(".laytable-cell-"+(a.index+"-"+t)+":eq(0)")},I.prototype.renderForm=function(e){n.render(e,"LAY-table-"+this.index)},I.prototype.setThisRowChecked=function(e){var t=this,i=(t.config,"layui-table-click"),a=t.layBody.find('tr[data-index="'+e+'"]');a.addClass(i).siblings("tr").removeClass(i)},I.prototype.sort=function(e,i,a,l){var n,r,c=this,s={},u=c.config,h=u.elem.attr("lay-filter"),f=d.cache[c.key];"string"==typeof e&&c.layHeader.find("th").each(function(i,a){var l=t(this),o=l.data("field");if(o===e)return e=l,n=o,!1});try{var n=n||e.data("field"),p=e.data("key");if(c.sortKey&&!a&&n===c.sortKey.field&&i===c.sortKey.sort)return;var v=c.layHeader.find("th .laytable-cell-"+p).find(S);c.layHeader.find("th").find(S).removeAttr("lay-sort"),v.attr("lay-sort",i||null),c.layFixed.find("th")}catch(m){return o.error("Table modules: Did not match to field")}c.sortKey={field:n,sort:i},u.autoSort&&("asc"===i?r=layui.sort(f,n):"desc"===i?r=layui.sort(f,n,!0):(r=layui.sort(f,d.config.indexName),delete c.sortKey)),s[u.response.dataName]=r||f,c.renderData(s,c.page,c.count,!0),l&&layui.event.call(e,y,"sort("+h+")",{field:n,type:i})},I.prototype.loading=function(e){var i=this,a=i.config;a.loading&&(e?(i.layInit&&i.layInit.remove(),delete i.layInit,i.layBox.find(b).remove()):(i.layInit=t(['
    ','',"
    "].join("")),i.layBox.append(i.layInit)))},I.prototype.setCheckData=function(e,t){var i=this,a=i.config,l=d.cache[i.key];l[e]&&l[e].constructor!==Array&&(l[e][a.checkName]=t)},I.prototype.syncCheckAll=function(){var e=this,t=e.config,i=e.layHeader.find('input[name="layTableCheckbox"]'),a=function(i){return e.eachCols(function(e,a){"checkbox"===a.type&&(a[t.checkName]=i)}),i};i[0]&&(d.checkStatus(e.key).isAll?(i[0].checked||(i.prop("checked",!0),e.renderForm("checkbox")),a(!0)):(i[0].checked&&(i.prop("checked",!1),e.renderForm("checkbox")),a(!1)))},I.prototype.getCssRule=function(e,t){var i=this,a=i.elem.find("style")[0],l=a.sheet||a.styleSheet||{},n=l.cssRules||l.rules;layui.each(n,function(i,a){if(a.selectorText===".laytable-cell-"+e)return t(a),!0})},I.prototype.fullSize=function(){var e,t=this,i=t.config,a=i.height;t.fullHeightGap&&(a=R.height()-t.fullHeightGap,a<135&&(a=135),t.elem.css("height",a)),a&&(e=parseFloat(a)-(t.layHeader.outerHeight()||38),i.toolbar&&(e-=t.layTool.outerHeight()||50),i.totalRow&&(e-=t.layTotal.outerHeight()||40),i.page&&(e-=t.layPage.outerHeight()||41),t.layMain.css("height",e-2))},I.prototype.getScrollWidth=function(e){var t=0;return e?t=e.offsetWidth-e.clientWidth:(e=document.createElement("div"),e.style.width="100px",e.style.height="100px",e.style.overflowY="scroll",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),t},I.prototype.scrollPatch=function(){var e=this,i=e.layMain.children("table"),a=e.layMain.width()-e.layMain.prop("clientWidth"),l=e.layMain.height()-e.layMain.prop("clientHeight"),n=(e.getScrollWidth(e.layMain[0]),i.outerWidth()-e.layMain.width()),o=function(e){if(a&&l){if(e=e.eq(0),!e.find(".layui-table-patch")[0]){var i=t('
    ');i.find("div").css({width:a}),e.find("tr").append(i)}}else e.find(".layui-table-patch").remove()};o(e.layHeader),o(e.layTotal);var r=e.layMain.height(),d=r-l;e.layFixed.find(k).css("height",i.height()>=d?d:"auto"),e.layFixRight[n>0?"removeClass":"addClass"](f),e.layFixRight.css("right",a-1)},I.prototype.events=function(){var e,a=this,o=a.config,c=t("body"),s={},u=a.layHeader.find("th"),h=".layui-table-cell",p=o.elem.attr("lay-filter");a.layTool.on("click","*[lay-event]",function(e){var i=t(this),c=i.attr("lay-event"),s=function(e){var l=t(e.list),n=t('
      ');n.html(l),o.height&&n.css("max-height",o.height-(a.layTool.outerHeight()||50)),i.find(".layui-table-tool-panel")[0]||i.append(n),a.renderForm(),n.on("click",function(e){layui.stope(e)}),e.done&&e.done(n,l)};switch(layui.stope(e),F.trigger("table.tool.panel.remove"),l.close(a.tipsIndex),c){case"LAYTABLE_COLS":s({list:function(){var e=[];return a.eachCols(function(t,i){i.field&&"normal"==i.type&&e.push('
    • ')}),e.join("")}(),done:function(){n.on("checkbox(LAY_TABLE_TOOL_COLS)",function(e){var i=t(e.elem),l=this.checked,n=i.data("key"),r=i.data("parentkey");layui.each(o.cols,function(e,t){layui.each(t,function(t,i){if(e+"-"+t===n){var d=i.hide;i.hide=!l,a.elem.find('*[data-key="'+o.index+"-"+n+'"]')[l?"removeClass":"addClass"](f),d!=i.hide&&a.setParentCol(!l,r),a.resize()}})})})}});break;case"LAYTABLE_EXPORT":r.ie?l.tips("导出功能不支持 IE,请用 Chrome 等高级浏览器导出",this,{tips:3}):s({list:function(){return['
    • 导出到 Csv 文件
    • ','
    • 导出到 Excel 文件
    • '].join("")}(),done:function(e,i){i.on("click",function(){var e=t(this).data("type");d.exportFile(o.id,null,e)})}});break;case"LAYTABLE_PRINT":var u=window.open("打印窗口","_blank"),h=[""].join(""),v=t(a.layHeader.html());v.append(a.layMain.find("table").html()),v.append(a.layTotal.find("table").html()),v.find("th.layui-table-patch").remove(),v.find(".layui-table-col-special").remove(),u.document.write(h+v.prop("outerHTML")),u.document.close(),u.print(),u.close()}layui.event.call(this,y,"toolbar("+p+")",t.extend({event:c,config:o},{}))}),u.on("mousemove",function(e){var i=t(this),a=i.offset().left,l=e.clientX-a;i.data("unresize")||s.resizeStart||(s.allowResize=i.width()-l<=10,c.css("cursor",s.allowResize?"col-resize":""))}).on("mouseleave",function(){t(this);s.resizeStart||c.css("cursor","")}).on("mousedown",function(e){var i=t(this);if(s.allowResize){var l=i.data("key");e.preventDefault(),s.resizeStart=!0,s.offset=[e.clientX,e.clientY],a.getCssRule(l,function(e){var t=e.style.width||i.outerWidth();s.rule=e,s.ruleWidth=parseFloat(t),s.minWidth=i.data("minwidth")||o.cellMinWidth})}}),F.on("mousemove",function(t){if(s.resizeStart){if(t.preventDefault(),s.rule){var i=s.ruleWidth+t.clientX-s.offset[0];i');return n[0].value=i.data("content")||l.text(),i.find("."+W)[0]||i.append(n),n.focus(),void layui.stope(e)}}).on("mouseenter","td",function(){b.call(this)}).on("mouseleave","td",function(){b.call(this,"hide")});var g="layui-table-grid-down",b=function(e){var i=t(this),a=i.children(h);if(!i.data("off"))if(e)i.find(".layui-table-grid-down").remove();else if(a.prop("scrollWidth")>a.outerWidth()){if(a.find("."+g)[0])return;i.append('
      ')}};a.layBody.on("click","."+g,function(e){var i=t(this),n=i.parent(),d=n.children(h);a.tipsIndex=l.tips(['
      ',d.html(),"
      ",''].join(""),d[0],{tips:[3,""],time:-1,anim:-1,maxWidth:r.ios||r.android?300:a.elem.width()/2,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){l.close(t)})}}),layui.stope(e)}),a.layBody.on("click","*[lay-event]",function(){var e=t(this),i=e.parents("tr").eq(0).data("index");layui.event.call(this,y,"tool("+p+")",v.call(this,{event:e.attr("lay-event")})),a.setThisRowChecked(i)}),a.layMain.on("scroll",function(){var e=t(this),i=e.scrollLeft(),n=e.scrollTop();a.layHeader.scrollLeft(i),a.layTotal.scrollLeft(i),a.layFixed.find(k).scrollTop(n),l.close(a.tipsIndex)}),F.on("click",function(){F.trigger("table.remove.tool.panel")}),F.on("table.remove.tool.panel",function(){t(".layui-table-tool-panel").remove()}),R.on("resize",function(){a.resize()})},d.init=function(e,i){i=i||{};var a=this,l=t(e?'table[lay-filter="'+e+'"]':h+"[lay-data]"),n="Table element property lay-data configuration item has a syntax error: ";return l.each(function(){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){o.error(n+l)}var c=[],s=t.extend({elem:this,cols:[],data:[],skin:a.attr("lay-skin"),size:a.attr("lay-size"),even:"string"==typeof a.attr("lay-even")},d.config,i,l);e&&a.hide(),a.find("thead>tr").each(function(e){s.cols[e]=[],t(this).children().each(function(i){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){return o.error(n+l)}var d=t.extend({title:a.text(),colspan:a.attr("colspan")||0,rowspan:a.attr("rowspan")||0},l);d.colspan<2&&c.push(d),s.cols[e].push(d)})}),a.find("tbody>tr").each(function(e){var i=t(this),a={};i.children("td").each(function(e,i){var l=t(this),n=l.data("field");if(n)return a[n]=l.html()}),layui.each(c,function(e,t){var l=i.children("td").eq(e);a[t.field]=l.html()}),s.data[e]=a}),d.render(s)}),a},c.that={},c.config={},d.eachCols=function(e,i,a){var l=c.config[e]||{},n=[],o=0;a=t.extend(!0,[],a||l.cols),layui.each(a,function(e,t){layui.each(t,function(t,i){if(i.colGroup){var l=0;o++,i.CHILD_COLS=[],layui.each(a[e+1],function(e,t){t.PARENT_COL_INDEX||l>1&&l==i.colspan||(t.PARENT_COL_INDEX=o,i.CHILD_COLS.push(t),l+=parseInt(t.colspan>1?t.colspan:1))})}i.PARENT_COL_INDEX||n.push(i)})});var r=function(e){layui.each(e||n,function(e,t){return t.CHILD_COLS?r(t.CHILD_COLS):void("function"==typeof i&&i(e,t))})};r()},d.checkStatus=function(e){var t=0,i=0,a=[],l=d.cache[e]||[];return layui.each(l,function(e,l){return l.constructor===Array?void i++:void(l[d.config.checkName]&&(t++,a.push(d.clearCacheKey(l))))}),{data:a,isAll:!!l.length&&t===l.length-i}},d.exportFile=function(e,t,i){t=t||d.clearCacheKey(d.cache[e]),i=i||"csv";var a=c.config[e]||{},l={csv:"text/csv",xls:"application/vnd.ms-excel"}[i],n=document.createElement("a");return r.ie?o.error("IE_NOT_SUPPORT_EXPORTS"):(n.href="data:"+l+";charset=utf-8,\ufeff"+encodeURIComponent(function(){var i=[],a=[];return layui.each(t,function(t,l){var n=[];"object"==typeof e?(layui.each(e,function(e,a){0==t&&i.push(a||"")}),layui.each(d.clearCacheKey(l),function(e,t){n.push('"'+(t||"")+'"')})):d.eachCols(e,function(e,a){a.field&&"normal"==a.type&&!a.hide&&(0==t&&i.push(a.title||""),n.push('"'+u(a,l[a.field],l,"text")+'"'))}),a.push(n.join(","))}),i.join(",")+"\r\n"+a.join("\r\n")}()),n.download=(a.title||"table_"+(a.index||""))+"."+i,document.body.appendChild(n),n.click(),void document.body.removeChild(n))},d.resize=function(e){if(e){var t=s(e);if(!t)return;c.that[e].resize()}else layui.each(c.that,function(){this.resize()})},d.reload=function(e,t){var i=s(e);if(i){var a=c.that[e];return a.reload(t),c.call(a)}},d.render=function(e){var t=new I(e);return c.call(t)},d.clearCacheKey=function(e){return e=t.extend({},e),delete e[d.config.checkName],delete e[d.config.indexName],e},d.init(),e(y,d)}); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/lay/modules/transfer.js b/Yangcai365_web/manage/zinc/layui/lay/modules/transfer.js new file mode 100644 index 0000000..3d19012 --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/lay/modules/transfer.js @@ -0,0 +1,2 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ + ;layui.define(["laytpl","form"],function(e){"use strict";var a=layui.$,t=layui.laytpl,n=layui.form,i="transfer",l={config:{},index:layui[i]?layui[i].index+1e4:0,set:function(e){var t=this;return t.config=a.extend({},t.config,e),t},on:function(e,a){return layui.onevent.call(this,i,e,a)}},r=function(){var e=this,a=e.config,t=a.id||e.index;return r.that[t]=e,r.config[t]=a,{config:a,reload:function(a){e.reload.call(e,a)},getData:function(){return e.getData.call(e)}}},c="layui-hide",o="layui-btn-disabled",d="layui-none",s="layui-transfer-box",u="layui-transfer-header",h="layui-transfer-search",f="layui-transfer-active",y="layui-transfer-data",p=function(e){return e=e||{},['
      ','
      ','","
      ","{{# if(d.data.showSearch){ }}",'","{{# } }}",'
        ',"
        "].join("")},v=['
        ',p({index:0,checkAllName:"layTransferLeftCheckAll"}),'
        ','",'","
        ",p({index:1,checkAllName:"layTransferRightCheckAll"}),"
        "].join(""),x=function(e){var t=this;t.index=++l.index,t.config=a.extend({},t.config,l.config,e),t.render()};x.prototype.config={title:["列表一","列表二"],width:200,height:360,data:[],value:[],showSearch:!1,id:"",text:{none:"无数据",searchNone:"无匹配数据"}},x.prototype.reload=function(e){var t=this;layui.each(e,function(e,a){a.constructor===Array&&delete t.config[e]}),t.config=a.extend(!0,{},t.config,e),t.render()},x.prototype.render=function(){var e=this,n=e.config,i=e.elem=a(t(v).render({data:n,index:e.index})),l=n.elem=a(n.elem);l[0]&&(n.data=n.data||[],n.value=n.value||[],e.key=n.id||e.index,l.html(e.elem),e.layBox=e.elem.find("."+s),e.layHeader=e.elem.find("."+u),e.laySearch=e.elem.find("."+h),e.layData=i.find("."+y),e.layBtn=i.find("."+f+" .layui-btn"),e.layBox.css({width:n.width,height:n.height}),e.layData.css({height:function(){return n.height-e.layHeader.outerHeight()-e.laySearch.outerHeight()-2}()}),e.renderData(),e.events())},x.prototype.renderData=function(){var e=this,a=(e.config,[{checkName:"layTransferLeftCheck",views:[]},{checkName:"layTransferRightCheck",views:[]}]);e.parseData(function(e){var t=e.selected?1:0,n=["
      • ",'',"
      • "].join("");a[t].views.push(n),delete e.selected}),e.layData.eq(0).html(a[0].views.join("")),e.layData.eq(1).html(a[1].views.join("")),e.renderCheckBtn()},x.prototype.renderForm=function(e){n.render(e,"LAY-transfer-"+this.index)},x.prototype.renderCheckBtn=function(e){var t=this,n=t.config;e=e||{},t.layBox.each(function(i){var l=a(this),r=l.find("."+y),d=l.find("."+u).find('input[type="checkbox"]'),s=r.find('input[type="checkbox"]'),h=0,f=!1;if(s.each(function(){var e=a(this).data("hide");(this.checked||this.disabled||e)&&h++,this.checked&&!e&&(f=!0)}),d.prop("checked",f&&h===s.length),t.layBtn.eq(i)[f?"removeClass":"addClass"](o),!e.stopNone){var p=r.children("li:not(."+c+")").length;t.noneView(r,p?"":n.text.none)}}),t.renderForm("checkbox")},x.prototype.noneView=function(e,t){var n=a('

        '+(t||"")+"

        ");e.find("."+d)[0]&&e.find("."+d).remove(),t.replace(/\s/g,"")&&e.append(n)},x.prototype.setValue=function(){var e=this,t=e.config,n=[];return e.layBox.eq(1).find("."+y+' input[type="checkbox"]').each(function(){var e=a(this).data("hide");e||n.push(this.value)}),t.value=n,e},x.prototype.parseData=function(e){var t=this,n=t.config,i=[];return layui.each(n.data,function(t,l){l=("function"==typeof n.parseData?n.parseData(l):l)||l,i.push(l=a.extend({},l)),layui.each(n.value,function(e,a){a==l.value&&(l.selected=!0)}),e&&e(l)}),n.data=i,t},x.prototype.getData=function(e){var a=this,t=a.config,n=[];return layui.each(e||t.value,function(e,a){layui.each(t.data,function(e,t){delete t.selected,a==t.value&&n.push(t)})}),n},x.prototype.events=function(){var e=this,t=e.config;e.elem.on("click",'input[lay-filter="layTransferCheckbox"]+',function(){var t=a(this).prev(),n=t[0].checked,i=t.parents("."+s).eq(0).find("."+y);t[0].disabled||("all"===t.attr("lay-type")&&i.find('input[type="checkbox"]').each(function(){this.disabled||(this.checked=n)}),e.renderCheckBtn({stopNone:!0}))}),e.layBtn.on("click",function(){var n=a(this),i=n.data("index"),l=e.layBox.eq(i),r=[];if(!n.hasClass(o)){e.layBox.eq(i).each(function(t){var n=a(this),i=n.find("."+y);i.children("li").each(function(){var t=a(this),n=t.find('input[type="checkbox"]'),i=n.data("hide");n[0].checked&&!i&&(n[0].checked=!1,l.siblings("."+s).find("."+y).append(t.clone()),t.remove(),r.push(n[0].value)),e.setValue()})}),e.renderCheckBtn();var c=l.siblings("."+s).find("."+h+" input");""===c.val()||c.trigger("keyup"),t.onchange&&t.onchange(e.getData(r),i)}}),e.laySearch.find("input").on("keyup",function(){var n=this.value,i=a(this).parents("."+h).eq(0).siblings("."+y),l=i.children("li");l.each(function(){var e=a(this),t=e.find('input[type="checkbox"]'),i=t[0].title.indexOf(n)!==-1;e[i?"removeClass":"addClass"](c),t.data("hide",!i)}),e.renderCheckBtn();var r=l.length===i.children("li."+c).length;e.noneView(i,r?t.text.searchNone:"")})},r.that={},r.config={},l.reload=function(e,a){var t=r.that[e];return t.reload(a),r.call(t)},l.getData=function(e){var a=r.that[e];return a.getData()},l.render=function(e){var a=new x(e);return r.call(a)},e(i,l)}); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/lay/modules/tree.js b/Yangcai365_web/manage/zinc/layui/lay/modules/tree.js new file mode 100644 index 0000000..07d3a9f --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/lay/modules/tree.js @@ -0,0 +1,2 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ + ;layui.define("form",function(e){"use strict";var i=layui.$,a=layui.form,n="tree",r={config:{},index:layui[n]?layui[n].index+1e4:0,set:function(e){var a=this;return a.config=i.extend({},a.config,e),a},on:function(e,i){return layui.onevent.call(this,n,e,i)}},l=function(){var e=this,i=e.config,a=i.id||e.index;return l.that[a]=e,l.config[a]=i,{config:i,reload:function(i){e.reload.call(e,i)},getChecked:function(){return e.getChecked.call(e)},setChecked:function(i){return e.setChecked.call(e,i)}}},t="layui-hide",d="layui-disabled",s="layui-tree-set",c="layui-tree-iconClick",o="layui-icon-addition",h="layui-icon-subtraction",u="layui-tree-entry",f="layui-tree-main",p="layui-tree-txt",y="layui-tree-pack",v="layui-tree-spread",C="layui-tree-setLineShort",m="layui-tree-showLine",k="layui-tree-lineExtend",g=function(e){var a=this;a.index=++r.index,a.config=i.extend({},a.config,r.config,e),a.render()};g.prototype.config={data:[],showCheckbox:!1,showLine:!0,accordion:!1,onlyIconControl:!1,isJump:!1,edit:!1,text:{defaultNodeName:"未命名",none:"无数据"}},g.prototype.reload=function(e){var a=this;layui.each(e,function(e,i){i.constructor===Array&&delete a.config[e]}),a.config=i.extend(!0,{},a.config,e),a.render()},g.prototype.render=function(){var e=this,a=e.config,n=i('
        ');e.tree(n);var r=a.elem=i(a.elem);if(r[0]){if(a.showSearch&&n.prepend(''),e.key=a.id||e.index,e.elem=n,e.elemNone=i('
        '+a.text.none+"
        "),r.html(e.elem),0==e.elem.find(".layui-tree-set").length)return e.elem.append(e.elemNone);a.drag&&e.drag(),a.showCheckbox&&e.renderForm("checkbox"),e.elem.find(".layui-tree-set").each(function(){var e=i(this);e.parent(".layui-tree-pack")[0]||e.addClass("layui-tree-setHide"),!e.next()[0]&&e.parents(".layui-tree-pack").eq(1).hasClass("layui-tree-lineExtend")&&e.addClass(C),e.next()[0]||e.parents(".layui-tree-set").eq(0).next()[0]||e.addClass(C)}),e.events()}},g.prototype.renderForm=function(e){a.render(e,"LAY-tree-"+this.index)},g.prototype.tree=function(e,a){var n=this,r=n.config,l=a||r.data;layui.each(l,function(a,l){var c=l.children&&l.children.length>0,o=i('
        '),h=i(['
        ',"
        ','
        ',function(){return r.showLine?c?'':'':''}(),function(){return r.showCheckbox?'':""}(),function(){return r.isJump&&l.href?''+(l.title||l.label||r.text.defaultNodeName)+"":''+(l.title||l.label||r.text.defaultNodeName)+""}(),"
        ",function(){if(!r.edit)return"";var e={add:'',update:'',del:''},i=['
        '];return r.edit===!0&&(r.edit=["update","del"]),"object"==typeof r.edit?(layui.each(r.edit,function(a,n){i.push(e[n]||"")}),i.join("")+"
        "):void 0}(),"
        "].join(""));c&&(h.append(o),n.tree(o,l.children)),e.append(h),h.prev("."+s)[0]&&h.prev().children(".layui-tree-pack").addClass("layui-tree-showLine"),c||h.parent(".layui-tree-pack").addClass("layui-tree-lineExtend"),n.spread(h,l),r.showCheckbox&&n.checkClick(h,l),r.edit&&n.operate(h,l)})},g.prototype.spread=function(e,a){var n=this,r=n.config,l=e.children("."+u),t=l.children("."+f),C=l.find("."+c),m=l.find("."+p),k=r.onlyIconControl?C:t,g="";k.on("click",function(i){var a=e.children("."+y),n=k.children(".layui-icon")[0]?k.children(".layui-icon"):k.find(".layui-tree-icon").children(".layui-icon");if(a[0]){if(e.hasClass(v))e.removeClass(v),a.slideUp(200),n.removeClass(h).addClass(o);else if(e.addClass(v),a.slideDown(200),n.addClass(h).removeClass(o),r.accordion){var l=e.siblings("."+s);l.removeClass(v),l.children("."+y).slideUp(200),l.find(".layui-tree-icon").children(".layui-icon").removeClass(h).addClass(o)}}else g="normal"}),m.on("click",function(){var n=i(this);n.hasClass(d)||(g=e.hasClass(v)?r.onlyIconControl?"open":"close":r.onlyIconControl?"close":"open",r.click&&r.click({elem:e,state:g,data:a}))})},g.prototype.setCheckbox=function(e,i,a){var n=this,r=(n.config,a.prop("checked"));if("object"==typeof i.children||e.find("."+y)[0]){var l=e.find("."+y).find('input[name="layuiTreeCheck"]');l.each(function(){this.disabled||(this.checked=r)})}var t=function(e){if(e.parents("."+s)[0]){var i,a=e.parent("."+y),n=a.parent(),l=a.prev().find('input[name="layuiTreeCheck"]');r?l.prop("checked",r):(a.find('input[name="layuiTreeCheck"]').each(function(){this.checked&&(i=!0)}),i||l.prop("checked",!1)),t(n)}};t(e),n.renderForm("checkbox")},g.prototype.checkClick=function(e,a){var n=this,r=n.config,l=e.children("."+u),t=l.children("."+f);t.on("click",'input[name="layuiTreeCheck"]+',function(l){layui.stope(l);var t=i(this).prev(),d=t.prop("checked");t.prop("disabled")||(n.setCheckbox(e,a,t),r.oncheck&&r.oncheck({elem:e,checked:d,data:a}))})},g.prototype.operate=function(e,a){var n=this,r=n.config,l=e.children("."+u),d=l.children("."+f);l.children(".layui-tree-btnGroup").on("click",".layui-icon",function(l){layui.stope(l);var f=i(this).data("type"),g=e.children("."+y),x={data:a,type:f,elem:e};if("add"==f){g[0]||(r.showLine?(d.find("."+c).addClass("layui-tree-icon"),d.find("."+c).children(".layui-icon").addClass(o).removeClass("layui-icon-file")):d.find(".layui-tree-iconArrow").removeClass(t),e.append('
        '));var b=r.operate&&r.operate(x),w={};if(w.title=r.text.defaultNodeName,w.id=b,n.tree(e.children("."+y),[w]),r.showLine)if(g[0])g.hasClass(k)||g.addClass(k),e.find("."+y).each(function(){i(this).children("."+s).last().addClass(C)}),g.children("."+s).last().prev().hasClass(C)?g.children("."+s).last().prev().removeClass(C):g.children("."+s).last().removeClass(C),!e.parent("."+y)[0]&&e.next()[0]&&g.children("."+s).last().removeClass(C);else{var T=e.siblings("."+s),L=1,N=e.parent("."+y);layui.each(T,function(e,a){i(a).children("."+y)[0]||(L=0)}),1==L?(T.children("."+y).addClass(m),T.children("."+y).children("."+s).removeClass(C),e.children("."+y).addClass(m),N.removeClass(k),N.children("."+s).last().children("."+y).children("."+s).last().addClass(C)):e.children("."+y).children("."+s).addClass(C)}if(!r.showCheckbox)return;if(d.find('input[name="layuiTreeCheck"]')[0].checked){var A=e.children("."+y).children("."+s).last();A.find('input[name="layuiTreeCheck"]')[0].checked=!0}n.renderForm("checkbox")}else if("update"==f){var q=d.children("."+p).html();d.children("."+p).html(""),d.append(''),d.children(".layui-tree-editInput").val(q).focus();var F=function(e){var i=e.val().trim();i=i?i:r.text.defaultNodeName,e.remove(),d.children("."+p).html(i),x.data.title=i,r.operate&&r.operate(x)};d.children(".layui-tree-editInput").blur(function(){F(i(this))}),d.children(".layui-tree-editInput").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),F(i(this)))})}else{if(r.operate&&r.operate(x),x.status="remove",!e.prev("."+s)[0]&&!e.next("."+s)[0]&&!e.parent("."+y)[0])return e.remove(),void n.elem.append(n.elemNone);if(e.siblings("."+s).children("."+u)[0]){if(r.showCheckbox){var I=function(e){if(e.parents("."+s)[0]){var a=e.siblings("."+s).children("."+u),r=e.parent("."+y).prev(),l=r.find('input[name="layuiTreeCheck"]')[0],t=1,d=0;0==l.checked&&(a.each(function(e,a){var n=i(a).find('input[name="layuiTreeCheck"]')[0];0!=n.checked||n.disabled||(t=0),n.disabled||(d=1)}),1==t&&1==d&&(l.checked=!0,n.renderForm("checkbox"),I(r.parent("."+s))))}};I(e)}if(r.showLine){var T=e.siblings("."+s),L=1,N=e.parent("."+y);layui.each(T,function(e,a){i(a).children("."+y)[0]||(L=0)}),1==L?(g[0]||(N.removeClass(k),T.children("."+y).addClass(m),T.children("."+y).children("."+s).removeClass(C)),e.next()[0]?N.children("."+s).last().children("."+y).children("."+s).last().addClass(C):e.prev().children("."+y).children("."+s).last().addClass(C),e.next()[0]||e.parents("."+s)[1]||e.parents("."+s).eq(0).next()[0]||e.prev("."+s).addClass(C)):!e.next()[0]&&e.hasClass(C)&&e.prev().addClass(C)}}else{var H=e.parent("."+y).prev();if(r.showLine){H.find("."+c).removeClass("layui-tree-icon"),H.find("."+c).children(".layui-icon").removeClass(h).addClass("layui-icon-file");var S=H.parents("."+y).eq(0);S.addClass(k),S.children("."+s).each(function(){i(this).children("."+y).children("."+s).last().addClass(C)})}else H.find(".layui-tree-iconArrow").addClass(t);e.parents("."+s).eq(0).removeClass(v),e.parent("."+y).remove()}e.remove()}})},g.prototype.drag=function(){var e=this,a=e.config;e.elem.on("dragstart","."+u,function(){var e=i(this).parent("."+s),n=e.parents("."+s)[0]?e.parents("."+s).eq(0):"未找到父节点";a.dragstart&&a.dragstart(e,n)}),e.elem.on("dragend","."+u,function(n){var n=n||event,r=n.clientY,l=i(this),d=l.parent("."+s),f=d.height(),p=d.offset().top,g=e.elem.find("."+s),x=e.elem.height(),b=e.elem.offset().top,w=x+b-13,T=d.parents("."+s)[0],L=d.next()[0];if(T)var N=d.parent("."+y),A=d.parents("."+s).eq(0),q=A.parent("."+y),F=A.offset().top,I=d.siblings(),H=A.children("."+y).children("."+s).length;var S=function(n){if(T||L||e.elem.children("."+s).last().children("."+y).children("."+s).last().addClass(C),!T)return void d.removeClass("layui-tree-setHide");if(1==H)a.showLine?(n.find("."+c).removeClass("layui-tree-icon"),n.find("."+c).children(".layui-icon").removeClass(h).addClass("layui-icon-file"),q.addClass(k),q.children("."+s).children("."+y).each(function(){i(this).children("."+s).last().addClass(C)})):n.find(".layui-tree-iconArrow").addClass(t),n.children("."+y).remove(),n.removeClass(v);else{if(a.showLine){var r=1;layui.each(I,function(e,a){i(a).children("."+y)[0]||(r=0)}),1==r?(d.children("."+y)[0]||(N.removeClass(k),I.children("."+y).addClass(m),I.children("."+y).children("."+s).removeClass(C)),N.children("."+s).last().children("."+y).children("."+s).last().addClass(C),L||n.parents("."+s)[0]||n.next()[0]||N.children("."+s).last().addClass(C)):!L&&d.hasClass(C)&&N.children("."+s).last().addClass(C)}if(a.showCheckbox){var l=function(a){if(a){if(!a.parents("."+s)[0])return}else if(!n[0])return;var r=a?a.siblings().children("."+u):I.children("."+u),t=a?a.parent("."+y).prev():N.prev(),d=t.find('input[name="layuiTreeCheck"]')[0],c=1,o=0;0==d.checked&&(r.each(function(e,a){var n=i(a).find('input[name="layuiTreeCheck"]')[0];0!=n.checked||n.disabled||(c=0),n.disabled||(o=1)}),1==c&&1==o&&(d.checked=!0,e.renderForm("checkbox"),l(t.parent("."+s)||n)))};l()}}};g.each(function(){if(0!=i(this).height()){if(r>p&&rF&&rn&&r')),i(this).children("."+y).append(d),S(A),a.showLine){var l=i(this).children("."+y).children("."+s);if(d.children("."+y).children("."+s).last().addClass(C),1==l.length){var h=i(this).siblings("."+s),v=1,g=i(this).parent("."+y);layui.each(h,function(e,a){i(a).children("."+y)[0]||(v=0)}),1==v?(h.children("."+y).addClass(m),h.children("."+y).children("."+s).removeClass(C),i(this).children("."+y).addClass(m),g.removeClass(k),g.children("."+s).last().children("."+y).children("."+s).last().addClass(C).removeClass("layui-tree-setHide")):i(this).children("."+y).children("."+s).addClass(C).removeClass("layui-tree-setHide")}else d.prev("."+s).hasClass(C)?(d.prev("."+s).removeClass(C),d.addClass(C)):(d.removeClass("layui-tree-setLineShort layui-tree-setHide"),d.children("."+y)[0]?d.prev("."+s).children("."+y).children("."+s).last().removeClass(C):d.siblings("."+s).find("."+y).each(function(){i(this).children("."+s).last().addClass(C)})),i(this).next()[0]||d.addClass(C)}if(a.showCheckbox&&i(this).children("."+u).find('input[name="layuiTreeCheck"]')[0].checked){var x=d.children("."+u);x.find('input[name="layuiTreeCheck"]+').click()}return a.dragend&&a.dragend("drag success",d,i(this)),!1}if(rw)return e.elem.children("."+s).last().children("."+y).addClass(m),e.elem.append(d),S(A),d.prev().children("."+y).children("."+s).last().removeClass(C),d.addClass("layui-tree-setHide"),d.children("."+y).children("."+s).last().addClass(C),a.dragend&&a.dragend("拖拽成功,插入最外层节点",d,e.elem),!1}})})},g.prototype.events=function(){var e=this,a=e.config,n=e.elem.find(".layui-tree-checkedFirst");layui.each(n,function(e,a){i(a).children("."+u).find('input[name="layuiTreeCheck"]+').trigger("click")}),e.elem.find(".layui-tree-search").on("keyup",function(){var n=i(this),r=n.val(),l=n.nextAll(),d=[];l.find("."+p).each(function(){var e=i(this).parents("."+u);if(i(this).html().indexOf(r)!=-1){d.push(i(this).parent());var a=function(e){e.addClass("layui-tree-searchShow"),e.parent("."+y)[0]&&a(e.parent("."+y).parent("."+s))};a(e.parent("."+s))}}),l.find("."+u).each(function(){var e=i(this).parent("."+s);e.hasClass("layui-tree-searchShow")||e.addClass(t)}),0==l.find(".layui-tree-searchShow").length&&e.elem.append(e.elemNone),a.onsearch&&a.onsearch({elem:d})}),e.elem.find(".layui-tree-search").on("keydown",function(){i(this).nextAll().find("."+u).each(function(){var e=i(this).parent("."+s);e.removeClass("layui-tree-searchShow "+t)}),i(".layui-tree-emptyText")[0]&&i(".layui-tree-emptyText").remove()})},g.prototype.getChecked=function(){var e=this,a=e.config,n=[],r=[];e.elem.find(".layui-form-checked").each(function(){n.push(i(this).prev()[0].value)});var l=function(e,a){layui.each(e,function(e,r){layui.each(n,function(e,n){if(r.id==n){var t=i.extend({},r);return delete t.children,a.push(t),r.children&&(t.children=[],l(r.children,t.children)),!0}})})};return l(i.extend({},a.data),r),r},g.prototype.setChecked=function(e){var a=this;a.config;a.elem.find("."+s).each(function(a,n){var r=i(this).data("id"),l=i(n).children("."+u).find('input[name="layuiTreeCheck"]'),t=l.next();if("number"==typeof e){if(r==e)return l[0].checked||t.click(),!1}else i.inArray(r,e)!=-1&&(l[0].checked||t.click())})},l.that={},l.config={},r.reload=function(e,i){var a=l.that[e];return a.reload(i),l.call(a)},r.getChecked=function(e){var i=l.that[e];return i.getChecked()},r.setChecked=function(e,i){var a=l.that[e];return a.setChecked(i)},r.render=function(e){var i=new g(e);return l.call(i)},e(n,r)}); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/lay/modules/upload.js b/Yangcai365_web/manage/zinc/layui/lay/modules/upload.js new file mode 100644 index 0000000..e5aecbb --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/lay/modules/upload.js @@ -0,0 +1,2 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ +;layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,n=layui.hint(),a=layui.device(),o={config:{},set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,r,e,t)}},l=function(){var e=this;return{upload:function(t){e.upload.call(e,t)},reload:function(t){e.reload.call(e,t)},config:e.config}},r="upload",u="layui-upload-file",c="layui-upload-form",f="layui-upload-iframe",s="layui-upload-choose",p=function(e){var i=this;i.config=t.extend({},i.config,o.config,e),i.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",field:"file",acceptMime:"",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1,defaultMsg:""},p.prototype.render=function(e){var i=this,e=i.config;e.elem=t(e.elem),e.bindAction=t(e.bindAction),i.file(),i.events()},p.prototype.file=function(){var e=this,i=e.config,n=e.elemFile=t(['"].join("")),o=i.elem.next();(o.hasClass(u)||o.hasClass(c))&&o.remove(),a.ie&&a.ie<10&&i.elem.wrap('
        '),e.isFile()?(e.elemFile=i.elem,i.field=i.elem[0].name):i.elem.after(n),a.ie&&a.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,i=e.config,n=t(''),a=t(['
        ',"
        "].join(""));t("#"+f)[0]||t("body").append(n),i.elem.next().hasClass(c)||(e.elemFile.wrap(a),i.elem.next("."+c).append(function(){var e=[];return layui.each(i.data,function(t,i){i="function"==typeof i?i():i,e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return i.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e){return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type}},p.prototype.preview=function(e){var t=this;window.FileReader&&layui.each(t.chooseFiles,function(t,i){var n=new FileReader;n.readAsDataURL(i),n.onload=function(){e&&e(t,i,this.result)}})},p.prototype.upload=function(e,i){var n,o=this,l=o.config,r=o.elemFile[0],u=function(){var i=0,n=0,a=e||o.files||o.chooseFiles||r.files,u=function(){l.multiple&&i+n===o.fileLength&&"function"==typeof l.allDone&&l.allDone({total:o.fileLength,successful:i,aborted:n})};layui.each(a,function(e,a){var r=new FormData;r.append(l.field,a),layui.each(l.data,function(e,t){t="function"==typeof t?t():t,r.append(e,t)}),t.ajax({url:l.url,type:"post",data:r,contentType:!1,processData:!1,dataType:"json",headers:l.headers||{},success:function(t){i++,d(e,t),u()},error:function(){n++,m(e),u()}})})},c=function(){var e=t("#"+f);o.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var t,i=e.contents().find("body");try{t=i.text()}catch(n){o.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}t&&(clearInterval(p.timer),i.html(""),d(0,t))},30)},d=function(e,t){if(o.elemFile.next("."+s).remove(),r.value="","object"!=typeof t){try{t=JSON.parse(t)}catch(i){return t={},o.msg("请对上传接口返回有效JSON")}}"function"==typeof l.done&&l.done(t,e||0,function(e){o.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){o.upload(e)})},h=l.exts,v=function(){var t=[];return layui.each(e||o.chooseFiles,function(e,i){t.push(i.name)}),t}(),g={preview:function(e){o.preview(e)},upload:function(e,t){var i={};i[e]=t,o.upload(i)},pushFile:function(){return o.files=o.files||{},layui.each(o.chooseFiles,function(e,t){o.files[e]=t}),o.files},resetFile:function(e,t,i){var n=new File([t],i);o.files=o.files||{},o.files[e]=n}},y=function(){if("choose"!==i&&!l.auto||(l.choose&&l.choose(g),"choose"!==i)){return l.before&&l.before(g),a.ie?a.ie>9?u():c():void u()}};if(v=0===v.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(l.accept){case"file":if(h&&!RegExp("\\w\\.("+h+")$","i").test(escape(v))){return l.defaultMsg?o.msg(l.defaultMsg):o.msg("选择的文件中包含不支持的格式"),r.value=""}break;case"video":if(!RegExp("\\w\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(v))){return o.msg("选择的视频中包含不支持的格式"),r.value=""}break;case"audio":if(!RegExp("\\w\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(v))){return o.msg("选择的音频中包含不支持的格式"),r.value=""}break;default:if(layui.each(v,function(e,t){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(t))||(n=!0)}),n){return o.msg("选择的图片中包含不支持的格式"),r.value=""}}if(o.fileLength=function(){var t=0,i=e||o.files||o.chooseFiles||r.files;return layui.each(i,function(){t++}),t}(),l.number&&o.fileLength>l.number){return o.msg("同时最多只能上传的数量为:"+l.number)}if(l.size>0&&!(a.ie&&a.ie<10)){var F;if(layui.each(o.chooseFiles,function(e,t){if(t.size>1024*l.size){var i=l.size/1024;i=i>=1?i.toFixed(2)+"MB":l.size+"KB",r.value="",F=i}}),F){return o.msg("文件不能超过"+F)}}y()}},p.prototype.reload=function(e){e=e||{},delete e.elem,delete e.bindAction;var i=this,e=i.config=t.extend({},i.config,o.config,e),n=e.elem.next();n.attr({name:e.name,accept:e.acceptMime,multiple:e.multiple})},p.prototype.events=function(){var e=this,i=e.config,o=function(t){e.chooseFiles={},layui.each(t,function(t,i){var n=(new Date).getTime();e.chooseFiles[n+"-"+t]=i})},l=function(t,n){var a=e.elemFile,o=t.length>1?t.length+"个文件":(t[0]||{}).name||a[0].value.match(/[^\/\\]+\..+/g)||[]||"";a.next().hasClass(s)&&a.next().remove(),e.upload(null,"choose"),e.isFile()||i.choose||a.after(''+o+"")};i.elem.off("upload.start").on("upload.start",function(){var a=t(this),o=a.attr("lay-data");if(o){try{o=new Function("return "+o)(),e.config=t.extend({},i,o)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+o)}}e.config.item=a,e.elemFile[0].click()}),a.ie&&a.ie<10||i.elem.off("upload.over").on("upload.over",function(){var e=t(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=t(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,a){var r=t(this),u=a.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),o(u),i.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var t=this.files||[];o(t),i.auto?e.upload():l(t)}),i.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),i.elem.data("haveEvents")||(e.elemFile.on("change",function(){t(this).trigger("upload.change")}),i.elem.on("click",function(){e.isFile()||t(this).trigger("upload.start")}),i.drag&&i.elem.on("dragover",function(e){e.preventDefault(),t(this).trigger("upload.over")}).on("dragleave",function(e){t(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),t(this).trigger("upload.drop",e)}),i.bindAction.on("click",function(){t(this).trigger("upload.action")}),i.elem.data("haveEvents",!0))},o.render=function(e){var t=new p(e);return l.call(t)},e(r,o)}); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/lay/modules/util.js b/Yangcai365_web/manage/zinc/layui/lay/modules/util.js new file mode 100644 index 0000000..4148c2c --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/lay/modules/util.js @@ -0,0 +1,2 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ + ;layui.define("jquery",function(t){"use strict";var e=layui.$,i={fixbar:function(t){var i,n,a="layui-fixbar",o="layui-fixbar-top",r=e(document),l=e("body");t=e.extend({showHeight:200},t),t.bar1=t.bar1===!0?"":t.bar1,t.bar2=t.bar2===!0?"":t.bar2,t.bgcolor=t.bgcolor?"background-color:"+t.bgcolor:"";var c=[t.bar1,t.bar2,""],g=e(['
          ',t.bar1?'
        • '+c[0]+"
        • ":"",t.bar2?'
        • '+c[1]+"
        • ":"",'
        • '+c[2]+"
        • ","
        "].join("")),s=g.find("."+o),u=function(){var e=r.scrollTop();e>=t.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};e("."+a)[0]||("object"==typeof t.css&&g.css(t.css),l.append(g),u(),g.find("li").on("click",function(){var i=e(this),n=i.attr("lay-type");"top"===n&&e("html,body").animate({scrollTop:0},200),t.click&&t.click.call(this,n)}),r.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){u()},100)}))},countdown:function(t,e,i){var n=this,a="function"==typeof e,o=new Date(t).getTime(),r=new Date(!e||a?(new Date).getTime():e).getTime(),l=o-r,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=e);var g=setTimeout(function(){n.countdown(t,r+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],e,g),l<=0&&clearTimeout(g),g},timeAgo:function(t,e){var i=this,n=[[],[]],a=(new Date).getTime()-new Date(t).getTime();return a>6912e5?(a=new Date(t),n[0][0]=i.digit(a.getFullYear(),4),n[0][1]=i.digit(a.getMonth()+1),n[0][2]=i.digit(a.getDate()),e||(n[1][0]=i.digit(a.getHours()),n[1][1]=i.digit(a.getMinutes()),n[1][2]=i.digit(a.getSeconds())),n[0].join("-")+" "+n[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(t,e){var i="";t=String(t),e=e||2;for(var n=t.length;n/g,">").replace(/'/g,"'").replace(/"/g,""")},event:function(t,n,a){n=i.event[t]=e.extend(!0,i.event[t],n)||{},e("body").on(a||"click","*["+t+"]",function(){var i=e(this),a=i.attr(t);n[a]&&n[a].call(this,i)})}};!function(t,e,i){"$:nomunge";function n(){a=e[l](function(){o.each(function(){var e=t(this),i=e.width(),n=e.height(),a=t.data(this,g);(i!==a.w||n!==a.h)&&e.trigger(c,[a.w=i,a.h=n])}),n()},r[s])}var a,o=t([]),r=t.resize=t.extend(t.resize,{}),l="setTimeout",c="resize",g=c+"-special-event",s="delay",u="throttleWindow";r[s]=250,r[u]=!0,t.event.special[c]={setup:function(){if(!r[u]&&this[l])return!1;var e=t(this);o=o.add(e),t.data(this,g,{w:e.width(),h:e.height()}),1===o.length&&n()},teardown:function(){if(!r[u]&&this[l])return!1;var e=t(this);o=o.not(e),e.removeData(g),o.length||clearTimeout(a)},add:function(e){function n(e,n,o){var r=t(this),l=t.data(this,g)||{};l.w=n!==i?n:r.width(),l.h=o!==i?o:r.height(),a.apply(this,arguments)}if(!r[u]&&this[l])return!1;var a;return t.isFunction(e)?(a=e,n):(a=e.handler,void(e.handler=n))}}}(e,window),t("util",i)}); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/layui.all.js b/Yangcai365_web/manage/zinc/layui/layui.all.js new file mode 100644 index 0000000..49eb673 --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/layui.all.js @@ -0,0 +1,5 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ + ;!function(e){"use strict";var t=document,o={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.5.4"},r=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,o=t.scripts,n=o.length-1,r=n;r>0;r--)if("interactive"===o[r].readyState){e=o[r].src;break}return e||o[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),i=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},a="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",transfer:"modules/transfer",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",colorpicker:"modules/colorpicker",slider:"modules/slider",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};n.prototype.cache=o,n.prototype.define=function(e,t){var n=this,r="function"==typeof e,i=function(){var e=function(e,t){layui[e]=t,o.status[e]=!0};return"function"==typeof t&&t(function(n,r){e(n,r),o.callback[n]=function(){t(e)}}),this};return r&&(t=e,e=[]),!layui["layui.all"]&&layui["layui.mobile"]?i.call(n):(n.use(e,i),n)},n.prototype.use=function(e,n,l){function s(e,t){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||n.test((e.currentTarget||e.srcElement).readyState))&&(o.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void(o.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),n,l):"function"==typeof n&&n.apply(layui,l)}var y=this,p=o.dir=o.dir?o.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,o){"jquery"===o&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],o.host=o.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(o.modules[f])!function g(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void("string"==typeof o.modules[f]&&o.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":/^\{\/\}/.test(y.modules[f])?"":o.base||"")+(y.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=o.version===!0?o.v||(new Date).getTime():o.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||a?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),o.modules[f]=h}return y},n.prototype.getStyle=function(t,o){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](o)},n.prototype.link=function(e,n,r){var a=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof n&&(r=n);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(o.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof n?a:(function p(){return++y>1e3*o.timeout/100?i(e+" timeout"):void(1989===parseInt(a.getStyle(t.getElementById(c),"width"))?function(){n()}():setTimeout(p,100))}(),a)},o.callback={},n.prototype.factory=function(e){if(layui[e])return"function"==typeof o.callback[e]?o.callback[e]:null},n.prototype.addcss=function(e,t,n){return layui.link(o.dir+"css/"+e,t,n)},n.prototype.img=function(e,t,o){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,"function"==typeof t&&t(n)},void(n.onerror=function(e){n.onerror=null,"function"==typeof o&&o(e)}))},n.prototype.config=function(e){e=e||{};for(var t in e)o[t]=e[t];return this},n.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),n.prototype.extend=function(e){var t=this;e=e||{};for(var o in e)t[o]||t.modules[o]?i("模块名 "+o+" 已被占用"):t.modules[o]=e[o];return t},n.prototype.router=function(e){var t=this,e=e||location.hash,o={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),o.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),o.search[t[0]]=t[1]}():o.path.push(t)}),o):o},n.prototype.data=function(t,o,n){if(t=t||"layui",n=n||localStorage,e.JSON&&e.JSON.parse){if(null===o)return delete n[t];o="object"==typeof o?o:{key:o};try{var r=JSON.parse(n[t])}catch(i){var r={}}return"value"in o&&(r[o.key]=o.value),o.remove&&delete r[o.key],n[t]=JSON.stringify(r),o.key?r[o.key]:r}},n.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},n.prototype.device=function(t){var o=navigator.userAgent.toLowerCase(),n=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(o.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(o)?"windows":/linux/.test(o)?"linux":/iphone|ipod|ipad|ios/.test(o)?"ios":/mac/.test(o)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((o.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:n("micromessenger")};return t&&!r[t]&&(r[t]=n(t)),r.android=/android/.test(o),r.ios="ios"===r.os,r},n.prototype.hint=function(){return{error:i}},n.prototype.each=function(e,t){var o,n=this;if("function"!=typeof t)return n;if(e=e||[],e.constructor===Object){for(o in e)if(t.call(e[o],o,e[o]))break}else for(o=0;oi?1:r/g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),refresh:['','',""].join(""),skip:function(){return['到第','','页',""].join("")}()};return['
        ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
        "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});!function(){"use strict";var e=window.layui&&layui.define,t={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,n=t.length-1,a=n;a>0;a--)if("interactive"===t[a].readyState){e=t[a].src;break}return e||t[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),getStyle:function(e,t){var n=e.currentStyle?e.currentStyle:window.getComputedStyle(e,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](t)},link:function(e,a,i){if(n.path){var r=document.getElementsByTagName("head")[0],o=document.createElement("link");"string"==typeof a&&(i=a);var s=(i||e).replace(/\.|\//g,""),l="layuicss-"+s,d=0;o.rel="stylesheet",o.href=n.path+e,o.id=l,document.getElementById(l)||r.appendChild(o),"function"==typeof a&&!function c(){return++d>80?window.console&&console.error("laydate.css: Invalid"):void(1989===parseInt(t.getStyle(document.getElementById(l),"width"))?a():setTimeout(c,100))}()}}},n={v:"5.0.9",config:{},index:window.laydate&&window.laydate.v?1e5:0,path:t.getPath,set:function(e){var t=this;return t.config=w.extend({},t.config,e),t},ready:function(a){var i="laydate",r="",o=(e?"modules/laydate/":"theme/")+"default/laydate.css?v="+n.v+r;return e?layui.addcss(o,a,i):t.link(o,a,i),this}},a=function(){var e=this;return{hint:function(t){e.hint.call(e,t)},config:e.config}},i="laydate",r=".layui-laydate",o="layui-this",s="laydate-disabled",l="开始日期超出了结束日期
        建议重新选择",d=[100,2e5],c="layui-laydate-static",m="layui-laydate-list",u="laydate-selected",h="layui-laydate-hint",y="laydate-day-prev",f="laydate-day-next",p="layui-laydate-footer",g=".laydate-btns-confirm",v="laydate-time-text",D=".laydate-btns-time",T=function(e){var t=this;t.index=++n.index,t.config=w.extend({},t.config,n.config,e),n.ready(function(){t.init()})},w=function(e){return new C(e)},C=function(e){for(var t=0,n="object"==typeof e?[e]:(this.selector=e,document.querySelectorAll(e||null));t0)return n[0].getAttribute(e)}():n.each(function(n,a){a.setAttribute(e,t)})},C.prototype.removeAttr=function(e){return this.each(function(t,n){n.removeAttribute(e)})},C.prototype.html=function(e){return this.each(function(t,n){n.innerHTML=e})},C.prototype.val=function(e){return this.each(function(t,n){n.value=e})},C.prototype.append=function(e){return this.each(function(t,n){"object"==typeof e?n.appendChild(e):n.innerHTML=n.innerHTML+e})},C.prototype.remove=function(e){return this.each(function(t,n){e?n.removeChild(e):n.parentNode.removeChild(n)})},C.prototype.on=function(e,t){return this.each(function(n,a){a.attachEvent?a.attachEvent("on"+e,function(e){e.target=e.srcElement,t.call(a,e)}):a.addEventListener(e,t,!1)})},C.prototype.off=function(e,t){return this.each(function(n,a){a.detachEvent?a.detachEvent("on"+e,t):a.removeEventListener(e,t,!1)})},T.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},T.prototype.config={type:"date",range:!1,format:"yyyy-MM-dd",value:null,isInitValue:!0,min:"1900-1-1",max:"2099-12-31",trigger:"focus",show:!1,showBottom:!0,btns:["clear","now","confirm"],lang:"cn",theme:"default",position:null,calendar:!1,mark:{},zIndex:null,done:null,change:null},T.prototype.lang=function(){var e=this,t=e.config,n={cn:{weeks:["日","一","二","三","四","五","六"],time:["时","分","秒"],timeTips:"选择时间",startTime:"开始时间",endTime:"结束时间",dateTips:"返回日期",month:["一","二","三","四","五","六","七","八","九","十","十一","十二"],tools:{confirm:"确定",clear:"清空",now:"现在"}},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now"}}};return n[t.lang]||n.cn},T.prototype.init=function(){var e=this,t=e.config,n="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s",a="static"===t.position,i={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};t.elem=w(t.elem),t.eventElem=w(t.eventElem),t.elem[0]&&(t.range===!0&&(t.range="-"),t.format===i.date&&(t.format=i[t.type]),e.format=t.format.match(new RegExp(n+"|.","g"))||[],e.EXP_IF="",e.EXP_SPLIT="",w.each(e.format,function(t,a){var i=new RegExp(n).test(a)?"\\d{"+function(){return new RegExp(n).test(e.format[0===t?t+1:t-1]||"")?/^yyyy|y$/.test(a)?4:a.length:/^yyyy$/.test(a)?"1,4":/^y$/.test(a)?"1,308":"1,2"}()+"}":"\\"+a;e.EXP_IF=e.EXP_IF+i,e.EXP_SPLIT=e.EXP_SPLIT+"("+i+")"}),e.EXP_IF=new RegExp("^"+(t.range?e.EXP_IF+"\\s\\"+t.range+"\\s"+e.EXP_IF:e.EXP_IF)+"$"),e.EXP_SPLIT=new RegExp("^"+e.EXP_SPLIT+"$",""),e.isInput(t.elem[0])||"focus"===t.trigger&&(t.trigger="click"),t.elem.attr("lay-key")||(t.elem.attr("lay-key",e.index),t.eventElem.attr("lay-key",e.index)),t.mark=w.extend({},t.calendar&&"cn"===t.lang?{"0-1-1":"元旦","0-2-14":"情人","0-3-8":"妇女","0-3-12":"植树","0-4-1":"愚人","0-5-1":"劳动","0-5-4":"青年","0-6-1":"儿童","0-9-10":"教师","0-9-18":"国耻","0-10-1":"国庆","0-12-25":"圣诞"}:{},t.mark),w.each(["min","max"],function(e,n){var a=[],i=[];if("number"==typeof t[n]){var r=t[n],o=(new Date).getTime(),s=864e5,l=new Date(r?r0)return!0;var a=w.elem("div",{"class":"layui-laydate-header"}),i=[function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-y"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-m"});return e.innerHTML="",e}(),function(){var e=w.elem("div",{"class":"laydate-set-ym"}),t=w.elem("span"),n=w.elem("span");return e.appendChild(t),e.appendChild(n),e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-m"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-y"});return e.innerHTML="",e}()],d=w.elem("div",{"class":"layui-laydate-content"}),c=w.elem("table"),m=w.elem("thead"),u=w.elem("tr");w.each(i,function(e,t){a.appendChild(t)}),m.appendChild(u),w.each(new Array(6),function(e){var t=c.insertRow(0);w.each(new Array(7),function(a){if(0===e){var i=w.elem("th");i.innerHTML=n.weeks[a],u.appendChild(i)}t.insertCell(a)})}),c.insertBefore(m,c.children[0]),d.appendChild(c),r[e]=w.elem("div",{"class":"layui-laydate-main laydate-main-list-"+e}),r[e].appendChild(a),r[e].appendChild(d),o.push(i),s.push(d),l.push(c)}),w(d).html(function(){var e=[],i=[];return"datetime"===t.type&&e.push(''+n.timeTips+""),w.each(t.btns,function(e,r){var o=n.tools[r]||"btn";t.range&&"now"===r||(a&&"clear"===r&&(o="cn"===t.lang?"重置":"Reset"),i.push(''+o+""))}),e.push('"),e.join("")}()),w.each(r,function(e,t){i.appendChild(t)}),t.showBottom&&i.appendChild(d),/^#/.test(t.theme)){var m=w.elem("style"),u=["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,e.elemID).replace(/{{theme}}/g,t.theme);"styleSheet"in m?(m.setAttribute("type","text/css"),m.styleSheet.cssText=u):m.innerHTML=u,w(i).addClass("laydate-theme-molv"),i.appendChild(m)}e.remove(T.thisElemDate),a?t.elem.append(i):(document.body.appendChild(i),e.position()),e.checkDate().calendar(),e.changeEvent(),T.thisElemDate=e.elemID,"function"==typeof t.ready&&t.ready(w.extend({},t.dateTime,{month:t.dateTime.month+1}))},T.prototype.remove=function(e){var t=this,n=(t.config,w("#"+(e||t.elemID)));return n.hasClass(c)||t.checkDate(function(){n.remove()}),t},T.prototype.position=function(){var e=this,t=e.config,n=e.bindElem||t.elem[0],a=n.getBoundingClientRect(),i=e.elem.offsetWidth,r=e.elem.offsetHeight,o=function(e){return e=e?"scrollLeft":"scrollTop",document.body[e]|document.documentElement[e]},s=function(e){return document.documentElement[e?"clientWidth":"clientHeight"]},l=5,d=a.left,c=a.bottom;d+i+l>s("width")&&(d=s("width")-i-l),c+r+l>s()&&(c=a.top>r?a.top-r:s()-r,c-=2*l),t.position&&(e.elem.style.position=t.position),e.elem.style.left=d+("fixed"===t.position?0:o(1))+"px",e.elem.style.top=c+("fixed"===t.position?0:o())+"px"},T.prototype.hint=function(e){var t=this,n=(t.config,w.elem("div",{"class":h}));t.elem&&(n.innerHTML=e||"",w(t.elem).find("."+h).remove(),t.elem.appendChild(n),clearTimeout(t.hinTimer),t.hinTimer=setTimeout(function(){w(t.elem).find("."+h).remove()},3e3))},T.prototype.getAsYM=function(e,t,n){return n?t--:t++,t<0&&(t=11,e--),t>11&&(t=0,e++),[e,t]},T.prototype.systemDate=function(e){var t=e||new Date;return{year:t.getFullYear(),month:t.getMonth(),date:t.getDate(),hours:e?e.getHours():0,minutes:e?e.getMinutes():0,seconds:e?e.getSeconds():0}},T.prototype.checkDate=function(e){var t,a,i=this,r=(new Date,i.config),o=r.dateTime=r.dateTime||i.systemDate(),s=i.bindElem||r.elem[0],l=(i.isInput(s)?"val":"html",i.isInput(s)?s.value:"static"===r.position?"":s.innerHTML),c=function(e){e.year>d[1]&&(e.year=d[1],a=!0),e.month>11&&(e.month=11,a=!0),e.hours>23&&(e.hours=0,a=!0),e.minutes>59&&(e.minutes=0,e.hours++,a=!0),e.seconds>59&&(e.seconds=0,e.minutes++,a=!0),t=n.getEndDate(e.month+1,e.year),e.date>t&&(e.date=t,a=!0)},m=function(e,t,n){var o=["startTime","endTime"];t=(t.match(i.EXP_SPLIT)||[]).slice(1),n=n||0,r.range&&(i[o[n]]=i[o[n]]||{}),w.each(i.format,function(s,l){var c=parseFloat(t[s]);t[s].length必须遵循下述格式:
        "+(r.range?r.format+" "+r.range+" "+r.format:r.format)+"
        已为你重置"),a=!0):l&&l.constructor===Date?r.dateTime=i.systemDate(l):(r.dateTime=i.systemDate(),delete i.startState,delete i.endState,delete i.startDate,delete i.endDate,delete i.startTime,delete i.endTime),c(o),a&&l&&i.setValue(r.range?i.endDate?i.parse():"":i.parse()),e&&e(),i)},T.prototype.mark=function(e,t){var n,a=this,i=a.config;return w.each(i.mark,function(e,a){var i=e.split("-");i[0]!=t[0]&&0!=i[0]||i[1]!=t[1]&&0!=i[1]||i[2]!=t[2]||(n=a||t[2])}),n&&e.html(''+n+""),a},T.prototype.limit=function(e,t,n,a){var i,r=this,o=r.config,l={},d=o[n>41?"endDate":"dateTime"],c=w.extend({},d,t||{});return w.each({now:c,min:o.min,max:o.max},function(e,t){l[e]=r.newDate(w.extend({year:t.year,month:t.month,date:t.date},function(){var e={};return w.each(a,function(n,a){e[a]=t[a]}),e}())).getTime()}),i=l.nowl.max,e&&e[i?"addClass":"removeClass"](s),i},T.prototype.calendar=function(e){var t,a,i,r=this,s=r.config,l=e||s.dateTime,c=new Date,m=r.lang(),u="date"!==s.type&&"datetime"!==s.type,h=e?1:0,y=w(r.table[h]).find("td"),f=w(r.elemHeader[h][2]).find("span");if(l.yeard[1]&&(l.year=d[1],r.hint("最高只能支持到公元"+d[1]+"年")),r.firstDate||(r.firstDate=w.extend({},l)),c.setFullYear(l.year,l.month,1),t=c.getDay(),a=n.getEndDate(l.month||12,l.year),i=n.getEndDate(l.month+1,l.year),w.each(y,function(e,n){var d=[l.year,l.month],c=0;n=w(n),n.removeAttr("class"),e=t&&e=n.firstDate.year&&(r.month=a.max.month,r.date=a.max.date),n.limit(w(i),r,t),M++}),w(u[f?0:1]).attr("lay-ym",M-8+"-"+T[1]).html(b+p+" - "+(M-1+p))}else if("month"===e)w.each(new Array(12),function(e){var i=w.elem("li",{"lay-ym":e}),s={year:T[0],month:e};e+1==T[1]&&w(i).addClass(o),i.innerHTML=r.month[e]+(f?"月":""),d.appendChild(i),T[0]=n.firstDate.year&&(s.date=a.max.date),n.limit(w(i),s,t)}),w(u[f?0:1]).attr("lay-ym",T[0]+"-"+T[1]).html(T[0]+p);else if("time"===e){var E=function(){w(d).find("ol").each(function(e,a){w(a).find("li").each(function(a,i){n.limit(w(i),[{hours:a},{hours:n[x].hours,minutes:a},{hours:n[x].hours,minutes:n[x].minutes,seconds:a}][e],t,[["hours"],["hours","minutes"],["hours","minutes","seconds"]][e])})}),a.range||n.limit(w(n.footer).find(g),n[x],0,["hours","minutes","seconds"])};a.range?n[x]||(n[x]={hours:0,minutes:0,seconds:0}):n[x]=i,w.each([24,60,60],function(e,t){var a=w.elem("li"),i=["

        "+r.time[e]+"

          "];w.each(new Array(t),function(t){i.push(""+w.digit(t,2)+"")}),a.innerHTML=i.join("")+"
        ",d.appendChild(a)}),E()}if(y&&h.removeChild(y),h.appendChild(d),"year"===e||"month"===e)w(n.elemMain[t]).addClass("laydate-ym-show"),w(d).find("li").on("click",function(){var r=0|w(this).attr("lay-ym");if(!w(this).hasClass(s)){if(0===t)i[e]=r,l&&(n.startDate[e]=r),n.limit(w(n.footer).find(g),null,0);else if(l)n.endDate[e]=r;else{var c="year"===e?n.getAsYM(r,T[1]-1,"sub"):n.getAsYM(T[0],r,"sub");w.extend(i,{year:c[0],month:c[1]})}"year"===a.type||"month"===a.type?(w(d).find("."+o).removeClass(o),w(this).addClass(o),"month"===a.type&&"year"===e&&(n.listYM[t][0]=r,l&&(n[["startDate","endDate"][t]].year=r),n.list("month",t))):(n.checkDate("limit").calendar(),n.closeList()),n.setBtnStatus(),a.range||n.done(null,"change"),w(n.footer).find(D).removeClass(s)}});else{var S=w.elem("span",{"class":v}),k=function(){w(d).find("ol").each(function(e){var t=this,a=w(t).find("li");t.scrollTop=30*(n[x][C[e]]-2),t.scrollTop<=0&&a.each(function(e,n){if(!w(this).hasClass(s))return t.scrollTop=30*(e-2),!0})})},H=w(c[2]).find("."+v);k(),S.innerHTML=a.range?[r.startTime,r.endTime][t]:r.timeTips,w(n.elemMain[t]).addClass("laydate-time-show"),H[0]&&H.remove(),c[2].appendChild(S),w(d).find("ol").each(function(e){var t=this;w(t).find("li").on("click",function(){var r=0|this.innerHTML;w(this).hasClass(s)||(a.range?n[x][C[e]]=r:i[C[e]]=r,w(t).find("."+o).removeClass(o),w(this).addClass(o),E(),k(),(n.endDate||"time"===a.type)&&n.done(null,"change"),n.setBtnStatus())})})}return n},T.prototype.listYM=[],T.prototype.closeList=function(){var e=this;e.config;w.each(e.elemCont,function(t,n){w(this).find("."+m).remove(),w(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show")}),w(e.elem).find("."+v).remove()},T.prototype.setBtnStatus=function(e,t,n){var a,i=this,r=i.config,o=w(i.footer).find(g),d=r.range&&"date"!==r.type&&"time"!==r.type;d&&(t=t||i.startDate,n=n||i.endDate,a=i.newDate(t).getTime()>i.newDate(n).getTime(),i.limit(null,t)||i.limit(null,n)?o.addClass(s):o[a?"addClass":"removeClass"](s),e&&a&&i.hint("string"==typeof e?l.replace(/日期/g,e):l))},T.prototype.parse=function(e,t){var n=this,a=n.config,i=t||(e?w.extend({},n.endDate,n.endTime):a.range?w.extend({},n.startDate,n.startTime):a.dateTime),r=n.format.concat();return w.each(r,function(e,t){/yyyy|y/.test(t)?r[e]=w.digit(i.year,t.length):/MM|M/.test(t)?r[e]=w.digit(i.month+1,t.length):/dd|d/.test(t)?r[e]=w.digit(i.date,t.length):/HH|H/.test(t)?r[e]=w.digit(i.hours,t.length):/mm|m/.test(t)?r[e]=w.digit(i.minutes,t.length):/ss|s/.test(t)&&(r[e]=w.digit(i.seconds,t.length))}),a.range&&!e?r.join("")+" "+a.range+" "+n.parse(1):r.join("")},T.prototype.newDate=function(e){return e=e||{},new Date(e.year||1,e.month||0,e.date||1,e.hours||0,e.minutes||0,e.seconds||0)},T.prototype.setValue=function(e){var t=this,n=t.config,a=t.bindElem||n.elem[0],i=t.isInput(a)?"val":"html";return"static"===n.position||w(a)[i](e||""),this},T.prototype.stampRange=function(){var e,t,n=this,a=n.config,i=w(n.elem).find("td");if(a.range&&!n.endDate&&w(n.footer).find(g).addClass(s),n.endDate)return e=n.newDate({year:n.startDate.year,month:n.startDate.month,date:n.startDate.date}).getTime(),t=n.newDate({year:n.endDate.year,month:n.endDate.month,date:n.endDate.date}).getTime(),e>t?n.hint(l):void w.each(i,function(a,i){var r=w(i).attr("lay-ymd").split("-"),s=n.newDate({year:r[0],month:r[1]-1,date:r[2]}).getTime();w(i).removeClass(u+" "+o),s!==e&&s!==t||w(i).addClass(w(i).hasClass(y)||w(i).hasClass(f)?u:o),s>e&&s0&&t-1 in e)}function r(e,t,n){if(pe.isFunction(t))return pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return pe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Ce.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,function(e){return pe.inArray(e,t)>-1!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(De)||[],function(e,n){t[n]=!0}),t}function a(){re.addEventListener?(re.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s)):(re.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(re.addEventListener||"load"===e.event.type||"complete"===re.readyState)&&(a(),pe.ready())}function u(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(_e,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:qe.test(n)?pe.parseJSON(n):n)}catch(i){}pe.data(e,t,n)}else n=void 0}return n}function l(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(He(e)){var i,o,a=pe.expando,s=e.nodeType,u=s?pe.cache:e,l=s?e[a]:e[a]&&a;if(l&&u[l]&&(r||u[l].data)||void 0!==n||"string"!=typeof t)return l||(l=s?e[a]=ne.pop()||pe.guid++:a),u[l]||(u[l]=s?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(r?u[l]=pe.extend(u[l],t):u[l].data=pe.extend(u[l].data,t)),o=u[l],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[pe.camelCase(t)])):i=o,i}}function f(e,t,n){if(He(e)){var r,i,o=e.nodeType,a=o?pe.cache:e,s=o?e[pe.expando]:pe.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){pe.isArray(t)?t=t.concat(pe.map(t,pe.camelCase)):t in r?t=[t]:(t=pe.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!l(r):!pe.isEmptyObject(r))return}(n||(delete a[s].data,l(a[s])))&&(o?pe.cleanData([e],!0):fe.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function d(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},u=s(),l=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==l&&+u)&&Me.exec(pe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,pe.style(e,t,c+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function p(e){var t=ze.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||pe.nodeName(r,t)?o.push(r):pe.merge(o,h(r,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function g(e,t){for(var n,r=0;null!=(n=e[r]);r++)pe._data(n,"globalEval",!t||pe._data(t[r],"globalEval"))}function m(e){Be.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t,n,r,i){for(var o,a,s,u,l,c,f,d=e.length,y=p(t),v=[],x=0;x"!==f[1]||Ve.test(a)?0:u:u.firstChild,o=a&&a.childNodes.length;o--;)pe.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(pe.merge(v,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=y.lastChild}else v.push(t.createTextNode(a));for(u&&y.removeChild(u),fe.appendChecked||pe.grep(h(v,"input"),m),x=0;a=v[x++];)if(r&&pe.inArray(a,r)>-1)i&&i.push(a);else if(s=pe.contains(a.ownerDocument,a),u=h(y.appendChild(a),"script"),s&&g(u),n)for(o=0;a=u[o++];)Ie.test(a.type||"")&&n.push(a);return u=null,y}function v(){return!0}function x(){return!1}function b(){try{return re.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=x;else if(!i)return e;return 1===o&&(a=i,i=function(e){return pe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function T(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function C(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function E(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function N(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,r,i,o=pe._data(e),a=pe._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;r1&&"string"==typeof p&&!fe.checkClone&&rt.test(p))return e.each(function(i){var o=e.eq(i);g&&(t[0]=p.call(this,i,o.html())),S(o,t,n,r)});if(f&&(l=y(t,e[0].ownerDocument,!1,e,r),i=l.firstChild,1===l.childNodes.length&&(l=i),i||r)){for(s=pe.map(h(l,"script"),C),a=s.length;c")).appendTo(t.documentElement),t=(ut[0].contentWindow||ut[0].contentDocument).document,t.write(),t.close(),n=D(e,t),ut.detach()),lt[e]=n),n}function L(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function H(e){if(e in Et)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=Ct.length;n--;)if(e=Ct[n]+t,e in Et)return e}function q(e,t){for(var n,r,i,o=[],a=0,s=e.length;a=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==pe.type(e)||e.nodeType||pe.isWindow(e))return!1;try{if(e.constructor&&!ce.call(e,"constructor")&&!ce.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(!fe.ownFirst)for(t in e)return ce.call(e,t);for(t in e);return void 0===t||ce.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ue[le.call(e)]||"object":typeof e},globalEval:function(t){t&&pe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ge,"ms-").replace(me,ye)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;iT.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[P]=!0,e}function i(e){var t=H.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function d(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,n,r){for(var i=0,o=n.length;i-1&&(r[l]=!(a[l]=f))}}else x=m(x===a?x.splice(h,x.length):x),o?o(null,a,x,u):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=T.relative[e[0].type],a=o||T.relative[" "],s=o?1:0,u=p(function(e){return e===t},a,!0),l=p(function(e){return ee(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s1&&h(c),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s0,o=e.length>0,a=function(r,a,s,u,l){var c,f,d,p=0,h="0",g=r&&[],y=[],v=A,x=r||o&&T.find.TAG("*",l),b=W+=null==v?1:Math.random()||.1,w=x.length;for(l&&(A=a===H||a||l);h!==w&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===H||(L(c),s=!_);d=e[f++];)if(d(c,a||H,s)){u.push(c);break}l&&(W=b)}i&&((c=!d&&c)&&p--,r&&g.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,y,a,s);if(r){if(p>0)for(;h--;)g[h]||y[h]||(y[h]=G.call(u));y=m(y)}Q.apply(u,y),l&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(u)}return l&&(W=b,A=v),g};return i?r(a):a}var b,w,T,C,E,N,k,S,A,D,j,L,H,q,_,F,M,O,R,P="sizzle"+1*new Date,B=e.document,W=0,I=0,$=n(),z=n(),X=n(),U=function(e,t){return e===t&&(j=!0),0},V=1<<31,Y={}.hasOwnProperty,J=[],G=J.pop,K=J.push,Q=J.push,Z=J.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),ce=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,xe=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Te=function(){L()};try{Q.apply(J=Z.call(B.childNodes),B.childNodes),J[B.childNodes.length].nodeType}catch(Ce){Q={apply:J.length?function(e,t){K.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},E=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},L=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:B;return r!==H&&9===r.nodeType&&r.documentElement?(H=r,q=H.documentElement,_=!E(H),(n=H.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),w.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=i(function(e){return e.appendChild(H.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(H.getElementsByClassName),w.getById=i(function(e){return q.appendChild(e).id=P,!H.getElementsByName||!H.getElementsByName(P).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&_){var n=t.getElementById(e);return n?[n]:[]}},T.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},T.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&_)return t.getElementsByClassName(e)},M=[],F=[],(w.qsa=me.test(H.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&F.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||F.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+P+"-]").length||F.push("~="),e.querySelectorAll(":checked").length||F.push(":checked"),e.querySelectorAll("a#"+P+"+*").length||F.push(".#.+[+~]")}),i(function(e){var t=H.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&F.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||F.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),F.push(",.*:")})),(w.matchesSelector=me.test(O=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){w.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),M.push("!=",oe)}),F=F.length&&new RegExp(F.join("|")),M=M.length&&new RegExp(M.join("|")),t=me.test(q.compareDocumentPosition),R=t||me.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return j=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===H||e.ownerDocument===B&&R(B,e)?-1:t===H||t.ownerDocument===B&&R(B,t)?1:D?ee(D,e)-ee(D,t):0:4&n?-1:1)}:function(e,t){if(e===t)return j=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===H?-1:t===H?1:i?-1:o?1:D?ee(D,e)-ee(D,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===B?-1:u[r]===B?1:0},H):H},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==H&&L(e),n=n.replace(ce,"='$1']"),w.matchesSelector&&_&&!X[n+" "]&&(!M||!M.test(n))&&(!F||!F.test(n)))try{var r=O.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,H,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==H&&L(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==H&&L(e);var n=T.attrHandle[t.toLowerCase()],r=n&&Y.call(T.attrHandle,t.toLowerCase())?n(e,t,!_):void 0;return void 0!==r?r:w.attributes||!_?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!w.detectDuplicates,D=!w.sortStable&&e.slice(0),e.sort(U),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return D=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(d=m,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}), +l=c[e]||[],p=l[0]===W&&l[1],x=p&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[W,p,x];break}}else if(v&&(d=t,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===W&&l[1],x=p),x===!1)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++x||(v&&(f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[W,x]),d!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[P]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(se,"$1"));return i[P]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=_?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&_&&T.relative[o[1].type]){if(t=(T.find.ID(a.matches[0].replace(be,we),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!T.relative[s=a.type]);)if((u=T.find[s])&&(r=u(a.matches[0].replace(be,we),ve.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Q.apply(n,r),n;break}}return(l||k(e,f))(r,t,!_,n,!t||ve.test(e)&&c(t.parentNode)||t),n},w.sortStable=P.split("").sort(U).join("")===P,w.detectDuplicates=!!j,L(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(H.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);pe.find=ve,pe.expr=ve.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=ve.uniqueSort,pe.text=ve.getText,pe.isXMLDoc=ve.isXML,pe.contains=ve.contains;var xe=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&pe(e).is(n))break;r.push(e)}return r},be=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},we=pe.expr.match.needsContext,Te=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Ce=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?pe.find.matchesSelector(r,e)?[r]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t1?pe.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&we.test(e)?pe(e):e||[],!1).length}});var Ee,Ne=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ke=pe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Ee,"string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Ne.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:re,!0)),Te.test(r[1])&&pe.isPlainObject(t))for(r in t)pe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(i=re.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return Ee.find(e);this.length=1,this[0]=i}return this.context=re,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):pe.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(pe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),pe.makeArray(e,this))};ke.prototype=pe.fn,Ee=pe(re);var Se=/^(?:parents|prev(?:Until|All))/,Ae={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t,n=pe(e,this),r=n.length;return this.filter(function(){for(t=0;t-1:1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?pe.inArray(this[0],pe(e)):pe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xe(e,"parentNode")},parentsUntil:function(e,t,n){return xe(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return xe(e,"nextSibling")},prevAll:function(e){return xe(e,"previousSibling")},nextUntil:function(e,t,n){return xe(e,"nextSibling",n)},prevUntil:function(e,t,n){return xe(e,"previousSibling",n)},siblings:function(e){return be((e.parentNode||{}).firstChild,e)},children:function(e){return be(e.firstChild)},contents:function(e){return pe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:pe.merge([],e.childNodes)}},function(e,t){pe.fn[e]=function(n,r){var i=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=pe.filter(r,i)),this.length>1&&(Ae[e]||(i=pe.uniqueSort(i)),Se.test(e)&&(i=i.reverse())),this.pushStack(i)}});var De=/\S+/g;pe.Callbacks=function(e){e="string"==typeof e?o(e):pe.extend({},e);var t,n,r,i,a=[],s=[],u=-1,l=function(){for(i=e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(e){return e?pe.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=!0,n||c.disable(),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},pe.extend({Deferred:function(e){var t=[["resolve","done",pe.Callbacks("once memory"),"resolved"],["reject","fail",pe.Callbacks("once memory"),"rejected"],["notify","progress",pe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return pe.Deferred(function(n){pe.each(t,function(t,o){var a=pe.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?pe.extend(e,r):r}},i={};return r.pipe=r.then,pe.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=ie.call(arguments),a=o.length,s=1!==a||e&&pe.isFunction(e.promise)?a:0,u=1===s?e:pe.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?ie.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);i0||(je.resolveWith(re,[pe]),pe.fn.triggerHandler&&(pe(re).triggerHandler("ready"),pe(re).off("ready"))))}}),pe.ready.promise=function(t){if(!je)if(je=pe.Deferred(),"complete"===re.readyState||"loading"!==re.readyState&&!re.documentElement.doScroll)e.setTimeout(pe.ready);else if(re.addEventListener)re.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s);else{re.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&re.documentElement}catch(r){}n&&n.doScroll&&!function i(){if(!pe.isReady){try{n.doScroll("left")}catch(t){return e.setTimeout(i,50)}a(),pe.ready()}}()}return je.promise(t)},pe.ready.promise();var Le;for(Le in pe(fe))break;fe.ownFirst="0"===Le,fe.inlineBlockNeedsLayout=!1,pe(function(){var e,t,n,r;n=re.getElementsByTagName("body")[0],n&&n.style&&(t=re.createElement("div"),r=re.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),"undefined"!=typeof t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",fe.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=re.createElement("div");fe.deleteExpando=!0;try{delete e.test}catch(t){fe.deleteExpando=!1}e=null}();var He=function(e){var t=pe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)},qe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;pe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?pe.cache[e[pe.expando]]:e[pe.expando],!!e&&!l(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),pe.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=pe.data(o),1===o.nodeType&&!pe._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=pe.camelCase(r.slice(5)),u(o,r,i[r])));pe._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){pe.data(this,e)}):arguments.length>1?this.each(function(){pe.data(this,e,t)}):o?u(o,e,pe.data(o,e)):void 0},removeData:function(e){return this.each(function(){pe.removeData(this,e)})}}),pe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=pe._data(e,t),n&&(!r||pe.isArray(n)?r=pe._data(e,t,pe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),r=n.length,i=n.shift(),o=pe._queueHooks(e,t),a=function(){pe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return pe._data(e,n)||pe._data(e,n,{empty:pe.Callbacks("once memory").add(function(){pe._removeData(e,t+"queue"),pe._removeData(e,n)})})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
        a",fe.leadingWhitespace=3===e.firstChild.nodeType,fe.tbody=!e.getElementsByTagName("tbody").length,fe.htmlSerialize=!!e.getElementsByTagName("link").length,fe.html5Clone="<:nav>"!==re.createElement("nav").cloneNode(!0).outerHTML,n.type="checkbox",n.checked=!0,t.appendChild(n),fe.appendChecked=n.checked,e.innerHTML="",fe.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,t.appendChild(e),n=re.createElement("input"),n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),fe.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.noCloneEvent=!!e.addEventListener,e[pe.expando]=1,fe.attributes=!e.getAttribute(pe.expando)}();var Xe={option:[1,""],legend:[1,"
        ","
        "],area:[1,"",""],param:[1,"",""],thead:[1,"","
        "],tr:[2,"","
        "],col:[2,"","
        "],td:[3,"","
        "],_default:fe.htmlSerialize?[0,"",""]:[1,"X
        ","
        "]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Ue=/<|&#?\w+;/,Ve=/-1&&(h=p.split("."),p=h.shift(),h.sort()),a=p.indexOf(":")<0&&"on"+p,t=t[pe.expando]?t:new pe.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:pe.makeArray(n,[t]),l=pe.event.special[p]||{},i||!l.trigger||l.trigger.apply(r,n)!==!1)){if(!i&&!l.noBubble&&!pe.isWindow(r)){for(u=l.delegateType||p,Ke.test(u+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),c=s;c===(r.ownerDocument||re)&&d.push(c.defaultView||c.parentWindow||e)}for(f=0;(s=d[f++])&&!t.isPropagationStopped();)t.type=f>1?u:l.bindType||p,o=(pe._data(s,"events")||{})[t.type]&&pe._data(s,"handle"),o&&o.apply(s,n),o=a&&s[a],o&&o.apply&&He(s)&&(t.result=o.apply(s,n),t.result===!1&&t.preventDefault());if(t.type=p,!i&&!t.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&He(r)&&a&&r[p]&&!pe.isWindow(r)){c=r[a],c&&(r[a]=null),pe.event.triggered=p;try{r[p]()}catch(g){}pe.event.triggered=void 0,c&&(r[a]=c)}return t.result}},dispatch:function(e){e=pe.event.fix(e);var t,n,r,i,o,a=[],s=ie.call(arguments),u=(pe._data(this,"events")||{})[e.type]||[],l=pe.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){for(a=pe.event.handlers.call(this,e,u),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,r=((pe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n-1:pe.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&a.push({elem:u,handlers:r})}return s]","i"),tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,nt=/\s*$/g,at=p(re),st=at.appendChild(re.createElement("div"));pe.extend({htmlPrefilter:function(e){return e.replace(tt,"<$1>")},clone:function(e,t,n){var r,i,o,a,s,u=pe.contains(e.ownerDocument,e);if(fe.html5Clone||pe.isXMLDoc(e)||!et.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(st.innerHTML=e.outerHTML,st.removeChild(o=st.firstChild)),!(fe.noCloneEvent&&fe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(r=h(o),s=h(e),a=0;null!=(i=s[a]);++a)r[a]&&k(i,r[a]);if(t)if(n)for(s=s||h(e),r=r||h(o),a=0;null!=(i=s[a]);a++)N(i,r[a]);else N(e,o);return r=h(o,"script"),r.length>0&&g(r,!u&&h(e,"script")),r=s=i=null,o},cleanData:function(e,t){for(var n,r,i,o,a=0,s=pe.expando,u=pe.cache,l=fe.attributes,c=pe.event.special;null!=(n=e[a]);a++)if((t||He(n))&&(i=n[s],o=i&&u[i])){if(o.events)for(r in o.events)c[r]?pe.event.remove(n,r):pe.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=void 0:n.removeAttribute(s),ne.push(i))}}}),pe.fn.extend({domManip:S,detach:function(e){return A(this,e,!0)},remove:function(e){return A(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?pe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||re).createTextNode(e))},null,e,arguments.length)},append:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.appendChild(e)}})},prepend:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&pe.cleanData(h(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&pe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Ze,""):void 0;if("string"==typeof e&&!nt.test(e)&&(fe.htmlSerialize||!et.test(e))&&(fe.leadingWhitespace||!$e.test(e))&&!Xe[(We.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;nt",t=l.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===t[0].offsetHeight,o&&(t[0].style.display="",t[1].style.display="none",o=0===t[0].offsetHeight)),f.removeChild(u)}var n,r,i,o,a,s,u=re.createElement("div"),l=re.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",fe.opacity="0.5"===l.style.opacity,fe.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",fe.clearCloneStyle="content-box"===l.style.backgroundClip,u=re.createElement("div"),u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",u.appendChild(l),fe.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,pe.extend(fe,{reliableHiddenOffsets:function(){return null==n&&t(),o},boxSizingReliable:function(){return null==n&&t(),i},pixelMarginRight:function(){return null==n&&t(),r},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),a},reliableMarginLeft:function(){return null==n&&t(),s}}))}();var ht,gt,mt=/^(top|right|bottom|left)$/;e.getComputedStyle?(ht=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n.getPropertyValue(t)||n[t]:void 0,""!==a&&void 0!==a||pe.contains(e.ownerDocument,e)||(a=pe.style(e,t)),n&&!fe.pixelMarginRight()&&ft.test(a)&&ct.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o),void 0===a?a:a+""}):pt.currentStyle&&(ht=function(e){return e.currentStyle},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),ft.test(a)&&!mt.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"});var yt=/alpha\([^)]*\)/i,vt=/opacity\s*=\s*([^)]*)/i,xt=/^(none|table(?!-c[ea]).+)/,bt=new RegExp("^("+Fe+")(.*)$","i"),wt={position:"absolute",visibility:"hidden",display:"block"},Tt={letterSpacing:"0",fontWeight:"400"},Ct=["Webkit","O","Moz","ms"],Et=re.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=gt(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":fe.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=pe.camelCase(t),u=e.style;if(t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];if(o=typeof n,"string"===o&&(i=Me.exec(n))&&i[1]&&(n=d(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(pe.cssNumber[s]?"":"px")),fe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{u[t]=n}catch(l){}}},css:function(e,t,n,r){var i,o,a,s=pe.camelCase(t);return t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=gt(e,t,r)),"normal"===o&&t in Tt&&(o=Tt[t]),""===n||n?(i=parseFloat(o),n===!0||isFinite(i)?i||0:o):o}}),pe.each(["height","width"],function(e,t){pe.cssHooks[t]={get:function(e,n,r){if(n)return xt.test(pe.css(e,"display"))&&0===e.offsetWidth?dt(e,wt,function(){return M(e,t,r)}):M(e,t,r)},set:function(e,n,r){var i=r&&ht(e);return _(e,n,r?F(e,t,r,fe.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,i),i):0)}}}),fe.opacity||(pe.cssHooks.opacity={get:function(e,t){return vt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=pe.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===pe.trim(o.replace(yt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=yt.test(o)?o.replace(yt,i):o+" "+i)}}),pe.cssHooks.marginRight=L(fe.reliableMarginRight,function(e,t){if(t)return dt(e,{display:"inline-block"},gt,[e,"marginRight"])}),pe.cssHooks.marginLeft=L(fe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(gt(e,"marginLeft"))||(pe.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-dt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}):0))+"px"}),pe.each({margin:"",padding:"",border:"Width"},function(e,t){pe.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Oe[r]+t]=o[r]||o[r-2]||o[0];return i}},ct.test(e)||(pe.cssHooks[e+t].set=_)}),pe.fn.extend({css:function(e,t){return Pe(this,function(e,t,n){var r,i,o={},a=0;if(pe.isArray(t)){for(r=ht(e),i=t.length;a1)},show:function(){return q(this,!0)},hide:function(){return q(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Re(this)?pe(this).show():pe(this).hide()})}}),pe.Tween=O,O.prototype={constructor:O,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=O.propHooks[this.prop];return e&&e.get?e.get(this):O.propHooks._default.get(this)},run:function(e){var t,n=O.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=O.prototype.init,pe.fx.step={};var Nt,kt,St=/^(?:toggle|show|hide)$/,At=/queueHooks$/;pe.Animation=pe.extend($,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return d(n.elem,e,Me.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(De);for(var n,r=0,i=e.length;r
        a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),e=n.getElementsByTagName("a")[0],e.style.cssText="top:1px",fe.getSetAttribute="t"!==n.className,fe.style=/top/.test(e.getAttribute("style")),fe.hrefNormalized="/a"===e.getAttribute("href"),fe.checkOn=!!t.value,fe.optSelected=i.selected,fe.enctype=!!re.createElement("form").enctype,r.disabled=!0,fe.optDisabled=!i.disabled,t=re.createElement("input"),t.setAttribute("value",""),fe.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),fe.radioValue="t"===t.value}();var Dt=/\r/g,jt=/[\x20\t\r\n\f]+/g;pe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=pe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,pe(this).val()):e,null==i?i="":"number"==typeof i?i+="":pe.isArray(i)&&(i=pe.map(i,function(e){return null==e?"":e+""})),t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=pe.valHooks[i.type]||pe.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Dt,""):null==n?"":n)}}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:pe.trim(pe.text(e)).replace(jt," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,a=o?null:[],s=o?i+1:r.length,u=i<0?s:o?i:0;u-1)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=pe.inArray(pe(e).val(),t)>-1}},fe.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Lt,Ht,qt=pe.expr.attrHandle,_t=/^(?:checked|selected)$/i,Ft=fe.getSetAttribute,Mt=fe.input;pe.fn.extend({attr:function(e,t){return Pe(this,pe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(t=t.toLowerCase(),i=pe.attrHooks[t]||(pe.expr.match.bool.test(t)?Ht:Lt)),void 0!==n?null===n?void pe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=pe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!fe.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(De);if(o&&1===e.nodeType)for(;n=o[i++];)r=pe.propFix[n]||n,pe.expr.match.bool.test(n)?Mt&&Ft||!_t.test(n)?e[r]=!1:e[pe.camelCase("default-"+n)]=e[r]=!1:pe.attr(e,n,""),e.removeAttribute(Ft?n:r)}}),Ht={set:function(e,t,n){return t===!1?pe.removeAttr(e,n):Mt&&Ft||!_t.test(n)?e.setAttribute(!Ft&&pe.propFix[n]||n,n):e[pe.camelCase("default-"+n)]=e[n]=!0,n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=qt[t]||pe.find.attr;Mt&&Ft||!_t.test(t)?qt[t]=function(e,t,r){var i,o;return r||(o=qt[t],qt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,qt[t]=o),i}:qt[t]=function(e,t,n){if(!n)return e[pe.camelCase("default-"+t)]?t.toLowerCase():null}}),Mt&&Ft||(pe.attrHooks.value={set:function(e,t,n){return pe.nodeName(e,"input")?void(e.defaultValue=t):Lt&&Lt.set(e,t,n)}}),Ft||(Lt={set:function(e,t,n){var r=e.getAttributeNode(n);if(r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n))return t}},qt.id=qt.name=qt.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},pe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:Lt.set},pe.attrHooks.contenteditable={set:function(e,t,n){Lt.set(e,""!==t&&t,n)}},pe.each(["width","height"],function(e,t){pe.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),fe.style||(pe.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Ot=/^(?:input|select|textarea|button|object)$/i,Rt=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return Pe(this,pe.prop,e,t,arguments.length>1)},removeProp:function(e){return e=pe.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),pe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,i=pe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):Ot.test(e.nodeName)||Rt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),fe.hrefNormalized||pe.each(["href","src"],function(e,t){pe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),fe.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),fe.enctype||(pe.propFix.enctype="encoding");var Pt=/[\t\r\n\f]/g;pe.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).addClass(e.call(this,t,z(this)))});if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).removeClass(e.call(this,t,z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):pe.isFunction(e)?this.each(function(n){pe(this).toggleClass(e.call(this,n,z(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=pe(this),o=e.match(De)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=z(this),t&&pe._data(this,"__className__",t),pe.attr(this,"class",t||e===!1?"":pe._data(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+z(n)+" ").replace(Pt," ").indexOf(t)>-1)return!0;return!1}}),pe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var Bt=e.location,Wt=pe.now(),It=/\?/,$t=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=pe.trim(t+"");return i&&!pe.trim(i.replace($t,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():pe.error("Invalid JSON: "+t)},pe.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(r=new e.DOMParser,n=r.parseFromString(t,"text/xml")):(n=new e.ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(i){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var zt=/#.*$/,Xt=/([?&])_=[^&]*/,Ut=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Vt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Yt=/^(?:GET|HEAD)$/,Jt=/^\/\//,Gt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Kt={},Qt={},Zt="*/".concat("*"),en=Bt.href,tn=Gt.exec(en.toLowerCase())||[];pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:en,type:"GET",isLocal:Vt.test(tn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":pe.parseJSON,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?V(V(e,pe.ajaxSettings),t):V(pe.ajaxSettings,e)},ajaxPrefilter:X(Kt),ajaxTransport:X(Qt),ajax:function(t,n){function r(t,n,r,i){var o,f,v,x,w,C=n;2!==b&&(b=2,u&&e.clearTimeout(u),c=void 0,s=i||"",T.readyState=t>0?4:0,o=t>=200&&t<300||304===t,r&&(x=Y(d,T,r)),x=J(d,x,T,o),o?(d.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(pe.lastModified[a]=w),w=T.getResponseHeader("etag"),w&&(pe.etag[a]=w)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=x.state,f=x.data,v=x.error,o=!v)):(v=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",o?g.resolveWith(p,[f,C,T]):g.rejectWith(p,[T,C,v]),T.statusCode(y),y=void 0,l&&h.trigger(o?"ajaxSuccess":"ajaxError",[T,d,o?f:v]),m.fireWith(p,[T,C]),l&&(h.trigger("ajaxComplete",[T,d]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,d=pe.ajaxSetup({},n),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?pe(p):pe.event,g=pe.Deferred(),m=pe.Callbacks("once memory"),y=d.statusCode||{},v={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!f)for(f={};t=Ut.exec(s);)f[t[1].toLowerCase()]=t[2];t=f[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)y[t]=[y[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return c&&c.abort(t),r(0,t),this}};if(g.promise(T).complete=m.add,T.success=T.done,T.error=T.fail,d.url=((t||d.url||en)+"").replace(zt,"").replace(Jt,tn[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=pe.trim(d.dataType||"*").toLowerCase().match(De)||[""],null==d.crossDomain&&(i=Gt.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===tn[1]&&i[2]===tn[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(tn[3]||("http:"===tn[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=pe.param(d.data,d.traditional)),U(Kt,d,n,T),2===b)return T;l=pe.event&&d.global,l&&0===pe.active++&&pe.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Yt.test(d.type),a=d.url,d.hasContent||(d.data&&(a=d.url+=(It.test(a)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Xt.test(a)?a.replace(Xt,"$1_="+Wt++):a+(It.test(a)?"&":"?")+"_="+Wt++)),d.ifModified&&(pe.lastModified[a]&&T.setRequestHeader("If-Modified-Since",pe.lastModified[a]),pe.etag[a]&&T.setRequestHeader("If-None-Match",pe.etag[a])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Zt+"; q=0.01":""):d.accepts["*"]);for(o in d.headers)T.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(d.beforeSend.call(p,T,d)===!1||2===b))return T.abort();w="abort";for(o in{success:1,error:1,complete:1})T[o](d[o]);if(c=U(Qt,d,n,T)){if(T.readyState=1,l&&h.trigger("ajaxSend",[T,d]),2===b)return T;d.async&&d.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},d.timeout));try{b=1,c.send(v,r)}catch(C){if(!(b<2))throw C;r(-1,C)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],function(e,t){pe[t]=function(e,n,r,i){return pe.isFunction(n)&&(i=i||r,r=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:i,data:n,success:r},pe.isPlainObject(e)&&e))}}),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},pe.fn.extend({wrapAll:function(e){if(pe.isFunction(e))return this.each(function(t){pe(this).wrapAll(e.call(this,t))});if(this[0]){var t=pe(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return pe.isFunction(e)?this.each(function(t){pe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=pe.isFunction(e);return this.each(function(n){pe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){pe.nodeName(this,"body")||pe(this).replaceWith(this.childNodes)}).end()}}),pe.expr.filters.hidden=function(e){return fe.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:K(e)},pe.expr.filters.visible=function(e){return!pe.expr.filters.hidden(e)};var nn=/%20/g,rn=/\[\]$/,on=/\r?\n/g,an=/^(?:submit|button|image|reset|file)$/i,sn=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,r=[],i=function(e,t){t=pe.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=pe.ajaxSettings&&pe.ajaxSettings.traditional),pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){i(this.name,this.value)});else for(n in e)Q(n,e[n],t,i);return r.join("&").replace(nn,"+")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&sn.test(this.nodeName)&&!an.test(e)&&(this.checked||!Be.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),pe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?ee():re.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||ee()}:Z;var un=0,ln={},cn=pe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in ln)ln[e](void 0,!0)}),fe.cors=!!cn&&"withCredentials"in cn,cn=fe.ajax=!!cn,cn&&pe.ajaxTransport(function(t){if(!t.crossDomain||fe.cors){var n;return{send:function(r,i){var o,a=t.xhr(),s=++un;if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)void 0!==r[o]&&a.setRequestHeader(o,r[o]+"");a.send(t.hasContent&&t.data||null),n=function(e,r){var o,u,l;if(n&&(r||4===a.readyState))if(delete ln[s],n=void 0,a.onreadystatechange=pe.noop,r)4!==a.readyState&&a.abort();else{l={},o=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{u=a.statusText}catch(c){u=""}o||!t.isLocal||t.crossDomain?1223===o&&(o=204):o=l.text?200:404}l&&i(o,u,l,a.getAllResponseHeaders())},t.async?4===a.readyState?e.setTimeout(n):a.onreadystatechange=ln[s]=n:n()},abort:function(){n&&n(void 0,!0)}}}}),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),pe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=re.head||pe("head")[0]||re.documentElement;return{send:function(r,i){t=re.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var fn=[],dn=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=fn.pop()||pe.expando+"_"+Wt++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=pe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||pe.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?pe(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,fn.push(i)),a&&pe.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),pe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||re;var r=Te.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=y([e],t,i),i&&i.length&&pe(i).remove(),pe.merge([],r.childNodes))};var pn=pe.fn.load;return pe.fn.load=function(e,t,n){if("string"!=typeof e&&pn)return pn.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=pe.trim(e.slice(s,e.length)),e=e.slice(0,s)),pe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&pe.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?pe("
        ").append(pe.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){pe.fn[t]=function(e){return this.on(t,e)}}),pe.expr.filters.animated=function(e){return pe.grep(pe.timers,function(t){return e===t.elem}).length},pe.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=pe.css(e,"position"),f=pe(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=pe.css(e,"top"),u=pe.css(e,"left"),l=("absolute"===c||"fixed"===c)&&pe.inArray("auto",[o,u])>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),pe.isFunction(t)&&(t=t.call(e,n,pe.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},pe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){pe.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o)return t=o.documentElement,pe.contains(t,i)?("undefined"!=typeof i.getBoundingClientRect&&(r=i.getBoundingClientRect()),n=te(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===pe.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),pe.nodeName(e[0],"html")||(n=e.offset()),n.top+=pe.css(e[0],"borderTopWidth",!0),n.left+=pe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-pe.css(r,"marginTop",!0),left:t.left-n.left-pe.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){ +for(var e=this.offsetParent;e&&!pe.nodeName(e,"html")&&"static"===pe.css(e,"position");)e=e.offsetParent;return e||pt})}}),pe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);pe.fn[e]=function(r){return Pe(this,function(e,r,i){var o=te(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?pe(o).scrollLeft():i,n?i:pe(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),pe.each(["top","left"],function(e,t){pe.cssHooks[t]=L(fe.pixelPosition,function(e,n){if(n)return n=gt(e,t),ft.test(n)?pe(e).position()[t]+"px":n})}),pe.each({Height:"height",Width:"width"},function(e,t){pe.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){pe.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return Pe(this,function(t,n,r){var i;return pe.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?pe.css(t,n,a):pe.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),pe.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),pe.fn.size=function(){return this.length},pe.fn.andSelf=pe.fn.addBack,layui.define(function(e){layui.$=pe,e("jquery",pe)}),pe});!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
        '+(f?r.title[0]:r.title)+"
        ":"";return r.zIndex=s,t([r.shade?'
        ':"",'
        '+(e&&2!=r.type?"":u)+'
        '+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
        '+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t'+r.btn[t]+"";return'
        '+e+"
        "}():"")+(r.resize?'':"")+"
        "],u,i('
        ')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(t){s=t.find(".layui-layer-input"),s.val(e.value||"").focus(),"function"==typeof f&&f(t)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:'
          '+function(){var e=t.length,i=1,a="";if(e>0)for(a='
        • '+(t[0].content||"no content")+"
        • ";i'+(t[i].content||"no content")+"";return a}()+"
        ",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(u[d].alt||
        '+(u.length>1?'':"")+'
        '+(u[d].alt||"")+""+s.imgIndex+"/"+u.length+"
        ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
        是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);layui.define("jquery",function(t){"use strict";var a=layui.$,i=(layui.hint(),layui.device()),e="element",l="layui-this",n="layui-show",s=function(){this.config={}};s.prototype.set=function(t){var i=this;return a.extend(!0,i.config,t),i},s.prototype.on=function(t,a){return layui.onevent.call(this,e,t,a)},s.prototype.tabAdd=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.children(".layui-tab-bar"),o=l.children(".layui-tab-content"),r='
      • "+(i.title||"unnaming")+"
      • ";return s[0]?s.before(r):n.append(r),o.append('
        '+(i.content||"")+"
        "),f.hideTabMore(!0),f.tabAuto(),this},s.prototype.tabDelete=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+i+'"]');return f.tabDelete(null,s),this},s.prototype.tabChange=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+i+'"]');return f.tabClick.call(s[0],null,null,s),this},s.prototype.tab=function(t){t=t||{},b.on("click",t.headerElem,function(i){var e=a(this).index();f.tabClick.call(this,i,e,null,t)})},s.prototype.progress=function(t,i){var e="layui-progress",l=a("."+e+"[lay-filter="+t+"]"),n=l.find("."+e+"-bar"),s=n.find("."+e+"-text");return n.css("width",i),s.text(i),this};var o=".layui-nav",r="layui-nav-item",c="layui-nav-bar",u="layui-nav-tree",d="layui-nav-child",y="layui-nav-more",h="layui-anim layui-anim-upbit",f={tabClick:function(t,i,s,o){o=o||{};var r=s||a(this),i=i||r.parent().children("li").index(r),c=o.headerElem?r.parent():r.parents(".layui-tab").eq(0),u=o.bodyElem?a(o.bodyElem):c.children(".layui-tab-content").children(".layui-tab-item"),d=r.find("a"),y=c.attr("lay-filter");"javascript:;"!==d.attr("href")&&"_blank"===d.attr("target")||(r.addClass(l).siblings().removeClass(l),u.eq(i).addClass(n).siblings().removeClass(n)),layui.event.call(this,e,"tab("+y+")",{elem:c,index:i})},tabDelete:function(t,i){var n=i||a(this).parent(),s=n.index(),o=n.parents(".layui-tab").eq(0),r=o.children(".layui-tab-content").children(".layui-tab-item"),c=o.attr("lay-filter");n.hasClass(l)&&(n.next()[0]?f.tabClick.call(n.next()[0],null,s+1):n.prev()[0]&&f.tabClick.call(n.prev()[0],null,s-1)),n.remove(),r.eq(s).remove(),setTimeout(function(){f.tabAuto()},50),layui.event.call(this,e,"tabDelete("+c+")",{elem:o,index:s})},tabAuto:function(){var t="layui-tab-more",e="layui-tab-bar",l="layui-tab-close",n=this;a(".layui-tab").each(function(){var s=a(this),o=s.children(".layui-tab-title"),r=(s.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),c=a('');if(n===window&&8!=i.ie&&f.hideTabMore(!0),s.attr("lay-allowClose")&&o.find("li").each(function(){var t=a(this);if(!t.find("."+l)[0]){var i=a('');i.on("click",f.tabDelete),t.append(i)}}),"string"!=typeof s.attr("lay-unauto"))if(o.prop("scrollWidth")>o.outerWidth()+1){if(o.find("."+e)[0])return;o.append(c),s.attr("overflow",""),c.on("click",function(a){o[this.title?"removeClass":"addClass"](t),this.title=this.title?"":"收缩"})}else o.find("."+e).remove(),s.removeAttr("overflow")})},hideTabMore:function(t){var i=a(".layui-tab-title");t!==!0&&"tabmore"===a(t.target).attr("lay-stope")||(i.removeClass("layui-tab-more"),i.find(".layui-tab-bar").attr("title",""))},clickThis:function(){var t=a(this),i=t.parents(o),n=i.attr("lay-filter"),s=t.parent(),c=t.siblings("."+d),y="string"==typeof s.attr("lay-unselect");"javascript:;"!==t.attr("href")&&"_blank"===t.attr("target")||y||c[0]||(i.find("."+l).removeClass(l),s.addClass(l)),i.hasClass(u)&&(c.removeClass(h),c[0]&&(s["none"===c.css("display")?"addClass":"removeClass"](r+"ed"),"all"===i.attr("lay-shrink")&&s.siblings().removeClass(r+"ed"))),layui.event.call(this,e,"nav("+n+")",t)},collapse:function(){var t=a(this),i=t.find(".layui-colla-icon"),l=t.siblings(".layui-colla-content"),s=t.parents(".layui-collapse").eq(0),o=s.attr("lay-filter"),r="none"===l.css("display");if("string"==typeof s.attr("lay-accordion")){var c=s.children(".layui-colla-item").children("."+n);c.siblings(".layui-colla-title").children(".layui-colla-icon").html(""),c.removeClass(n)}l[r?"addClass":"removeClass"](n),i.html(r?"":""),layui.event.call(this,e,"collapse("+o+")",{title:t,content:l,show:r})}};s.prototype.init=function(t,e){var l=function(){return e?'[lay-filter="'+e+'"]':""}(),s={tab:function(){f.tabAuto.call({})},nav:function(){var t=200,e={},s={},p={},b=function(l,o,r){var c=a(this),f=c.find("."+d);o.hasClass(u)?l.css({top:c.position().top,height:c.children("a").outerHeight(),opacity:1}):(f.addClass(h),l.css({left:c.position().left+parseFloat(c.css("marginLeft")),top:c.position().top+c.height()-l.height()}),e[r]=setTimeout(function(){l.css({width:c.width(),opacity:1})},i.ie&&i.ie<10?0:t),clearTimeout(p[r]),"block"===f.css("display")&&clearTimeout(s[r]),s[r]=setTimeout(function(){f.addClass(n),c.find("."+y).addClass(y+"d")},300))};a(o+l).each(function(i){var l=a(this),o=a(''),h=l.find("."+r);l.find("."+c)[0]||(l.append(o),h.on("mouseenter",function(){b.call(this,o,l,i)}).on("mouseleave",function(){l.hasClass(u)||(clearTimeout(s[i]),s[i]=setTimeout(function(){l.find("."+d).removeClass(n),l.find("."+y).removeClass(y+"d")},300))}),l.on("mouseleave",function(){clearTimeout(e[i]),p[i]=setTimeout(function(){l.hasClass(u)?o.css({height:0,top:o.position().top+o.height()/2,opacity:0}):o.css({width:0,left:o.position().left+o.width()/2,opacity:0})},t)})),h.find("a").each(function(){var t=a(this),i=(t.parent(),t.siblings("."+d));i[0]&&!t.children("."+y)[0]&&t.append(''),t.off("click",f.clickThis).on("click",f.clickThis)})})},breadcrumb:function(){var t=".layui-breadcrumb";a(t+l).each(function(){var t=a(this),i="lay-separator",e=t.attr(i)||"/",l=t.find("a");l.next("span["+i+"]")[0]||(l.each(function(t){t!==l.length-1&&a(this).after(""+e+"")}),t.css("visibility","visible"))})},progress:function(){var t="layui-progress";a("."+t+l).each(function(){var i=a(this),e=i.find(".layui-progress-bar"),l=e.attr("lay-percent");e.css("width",function(){return/^.+\/.+$/.test(l)?100*new Function("return "+l)()+"%":l}()),i.attr("lay-showPercent")&&setTimeout(function(){e.html(''+l+"")},350)})},collapse:function(){var t="layui-collapse";a("."+t+l).each(function(){var t=a(this).find(".layui-colla-item");t.each(function(){var t=a(this),i=t.find(".layui-colla-title"),e=t.find(".layui-colla-content"),l="none"===e.css("display");i.find(".layui-colla-icon").remove(),i.append(''+(l?"":"")+""),i.off("click",f.collapse).on("click",f.collapse)})})}};return s[t]?s[t]():layui.each(s,function(t,a){a()})},s.prototype.render=s.prototype.init;var p=new s,b=a(document);p.render();var v=".layui-tab-title li";b.on("click",v,f.tabClick),b.on("click",f.hideTabMore),a(window).on("resize",f.tabAuto),t(e,p)});layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,n=layui.hint(),a=layui.device(),o={config:{},set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,r,e,t)}},l=function(){var e=this;return{upload:function(t){e.upload.call(e,t)},reload:function(t){e.reload.call(e,t)},config:e.config}},r="upload",u="layui-upload-file",c="layui-upload-form",f="layui-upload-iframe",s="layui-upload-choose",p=function(e){var i=this;i.config=t.extend({},i.config,o.config,e),i.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",field:"file",acceptMime:"",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1},p.prototype.render=function(e){var i=this,e=i.config;e.elem=t(e.elem),e.bindAction=t(e.bindAction),i.file(),i.events()},p.prototype.file=function(){var e=this,i=e.config,n=e.elemFile=t(['"].join("")),o=i.elem.next();(o.hasClass(u)||o.hasClass(c))&&o.remove(),a.ie&&a.ie<10&&i.elem.wrap('
        '),e.isFile()?(e.elemFile=i.elem,i.field=i.elem[0].name):i.elem.after(n),a.ie&&a.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,i=e.config,n=t(''),a=t(['
        ',"
        "].join(""));t("#"+f)[0]||t("body").append(n),i.elem.next().hasClass(c)||(e.elemFile.wrap(a),i.elem.next("."+c).append(function(){var e=[];return layui.each(i.data,function(t,i){i="function"==typeof i?i():i,e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return i.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var t=this;window.FileReader&&layui.each(t.chooseFiles,function(t,i){var n=new FileReader;n.readAsDataURL(i),n.onload=function(){e&&e(t,i,this.result)}})},p.prototype.upload=function(e,i){var n,o=this,l=o.config,r=o.elemFile[0],u=function(){var i=0,n=0,a=e||o.files||o.chooseFiles||r.files,u=function(){l.multiple&&i+n===o.fileLength&&"function"==typeof l.allDone&&l.allDone({total:o.fileLength,successful:i,aborted:n})};layui.each(a,function(e,a){var r=new FormData;r.append(l.field,a),layui.each(l.data,function(e,t){t="function"==typeof t?t():t,r.append(e,t)}),t.ajax({url:l.url,type:"post",data:r,contentType:!1,processData:!1,dataType:"json",headers:l.headers||{},success:function(t){i++,d(e,t),u()},error:function(){n++,m(e),u()}})})},c=function(){var e=t("#"+f);o.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var t,i=e.contents().find("body");try{t=i.text()}catch(n){o.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}t&&(clearInterval(p.timer),i.html(""),d(0,t))},30)},d=function(e,t){if(o.elemFile.next("."+s).remove(),r.value="","object"!=typeof t)try{t=JSON.parse(t)}catch(i){return t={},o.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(t,e||0,function(e){o.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){o.upload(e)})},h=l.exts,v=function(){var t=[];return layui.each(e||o.chooseFiles,function(e,i){t.push(i.name)}),t}(),g={preview:function(e){o.preview(e)},upload:function(e,t){var i={};i[e]=t,o.upload(i)},pushFile:function(){return o.files=o.files||{},layui.each(o.chooseFiles,function(e,t){o.files[e]=t}),o.files},resetFile:function(e,t,i){var n=new File([t],i);o.files=o.files||{},o.files[e]=n}},y=function(){if("choose"!==i&&!l.auto||(l.choose&&l.choose(g),"choose"!==i))return l.before&&l.before(g),a.ie?a.ie>9?u():c():void u()};if(v=0===v.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(l.accept){case"file":if(h&&!RegExp("\\w\\.("+h+")$","i").test(escape(v)))return o.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(v)))return o.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(v)))return o.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(v,function(e,t){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(t))||(n=!0)}),n)return o.msg("选择的图片中包含不支持的格式"),r.value=""}if(o.fileLength=function(){var t=0,i=e||o.files||o.chooseFiles||r.files;return layui.each(i,function(){t++}),t}(),l.number&&o.fileLength>l.number)return o.msg("同时最多只能上传的数量为:"+l.number);if(l.size>0&&!(a.ie&&a.ie<10)){var F;if(layui.each(o.chooseFiles,function(e,t){if(t.size>1024*l.size){var i=l.size/1024;i=i>=1?i.toFixed(2)+"MB":l.size+"KB",r.value="",F=i}}),F)return o.msg("文件不能超过"+F)}y()}},p.prototype.reload=function(e){e=e||{},delete e.elem,delete e.bindAction;var i=this,e=i.config=t.extend({},i.config,o.config,e),n=e.elem.next();n.attr({name:e.name,accept:e.acceptMime,multiple:e.multiple})},p.prototype.events=function(){var e=this,i=e.config,o=function(t){e.chooseFiles={},layui.each(t,function(t,i){var n=(new Date).getTime();e.chooseFiles[n+"-"+t]=i})},l=function(t,n){var a=e.elemFile,o=t.length>1?t.length+"个文件":(t[0]||{}).name||a[0].value.match(/[^\/\\]+\..+/g)||[]||"";a.next().hasClass(s)&&a.next().remove(),e.upload(null,"choose"),e.isFile()||i.choose||a.after(''+o+"")};i.elem.off("upload.start").on("upload.start",function(){var a=t(this),o=a.attr("lay-data");if(o)try{o=new Function("return "+o)(),e.config=t.extend({},i,o)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+o)}e.config.item=a,e.elemFile[0].click()}),a.ie&&a.ie<10||i.elem.off("upload.over").on("upload.over",function(){var e=t(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=t(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,a){var r=t(this),u=a.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),o(u),i.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var t=this.files||[];o(t),i.auto?e.upload():l(t)}),i.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),i.elem.data("haveEvents")||(e.elemFile.on("change",function(){t(this).trigger("upload.change")}),i.elem.on("click",function(){e.isFile()||t(this).trigger("upload.start")}),i.drag&&i.elem.on("dragover",function(e){e.preventDefault(),t(this).trigger("upload.over")}).on("dragleave",function(e){t(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),t(this).trigger("upload.drop",e)}),i.bindAction.on("click",function(){t(this).trigger("upload.action")}),i.elem.data("haveEvents",!0))},o.render=function(e){var t=new p(e);return l.call(t)},e(r,o)});layui.define("jquery",function(e){"use strict";var i=layui.jquery,t={config:{},index:layui.slider?layui.slider.index+1e4:0,set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,n,e,i)}},a=function(){var e=this,i=e.config;return{setValue:function(i,t){return e.slide("set",i,t||0)},config:i}},n="slider",l="layui-disabled",s="layui-slider",r="layui-slider-bar",o="layui-slider-wrap",u="layui-slider-wrap-btn",d="layui-slider-tips",v="layui-slider-input",c="layui-slider-input-txt",m="layui-slider-input-btn",p="layui-slider-hover",f=function(e){var a=this;a.index=++t.index,a.config=i.extend({},a.config,t.config,e),a.render()};f.prototype.config={type:"default",min:0,max:100,value:0,step:1,showstep:!1,tips:!0,input:!1,range:!1,height:200,disabled:!1,theme:"#009688"},f.prototype.render=function(){var e=this,t=e.config;if(t.step<1&&(t.step=1),t.maxt.min?a:t.min,t.value[1]=n>t.min?n:t.min,t.value[0]=t.value[0]>t.max?t.max:t.value[0],t.value[1]=t.value[1]>t.max?t.max:t.value[1];var r=Math.floor((t.value[0]-t.min)/(t.max-t.min)*100),v=Math.floor((t.value[1]-t.min)/(t.max-t.min)*100),m=v-r+"%";r+="%",v+="%"}else{"object"==typeof t.value&&(t.value=Math.min.apply(null,t.value)),t.valuet.max&&(t.value=t.max);var m=Math.floor((t.value-t.min)/(t.max-t.min)*100)+"%"}var p=t.disabled?"#c2c2c2":t.theme,f='
        '+(t.tips?'
        ':"")+'
        '+(t.range?'
        ':"")+"
        ",h=i(t.elem),y=h.next("."+s);if(y[0]&&y.remove(),e.elemTemp=i(f),t.range?(e.elemTemp.find("."+o).eq(0).data("value",t.value[0]),e.elemTemp.find("."+o).eq(1).data("value",t.value[1])):e.elemTemp.find("."+o).data("value",t.value),h.html(e.elemTemp),"vertical"===t.type&&e.elemTemp.height(t.height+"px"),t.showstep){for(var g=(t.max-t.min)/t.step,b="",x=1;x')}e.elemTemp.append(b)}if(t.input&&!t.range){var w=i('
        ');h.css("position","relative"),h.append(w),h.find("."+c).children("input").val(t.value),"vertical"===t.type?w.css({left:0,top:-48}):e.elemTemp.css("margin-right",w.outerWidth()+15)}t.disabled?(e.elemTemp.addClass(l),e.elemTemp.find("."+u).addClass(l)):e.slide(),e.elemTemp.find("."+u).on("mouseover",function(){var a="vertical"===t.type?t.height:e.elemTemp[0].offsetWidth,n=e.elemTemp.find("."+o),l="vertical"===t.type?a-i(this).parent()[0].offsetTop-n.height():i(this).parent()[0].offsetLeft,s=l/a*100,r=i(this).parent().data("value"),u=t.setTips?t.setTips(r):r;e.elemTemp.find("."+d).html(u),"vertical"===t.type?e.elemTemp.find("."+d).css({bottom:s+"%","margin-bottom":"20px",display:"inline-block"}):e.elemTemp.find("."+d).css({left:s+"%",display:"inline-block"})}).on("mouseout",function(){e.elemTemp.find("."+d).css("display","none")})},f.prototype.slide=function(e,t,a){var n=this,l=n.config,s=n.elemTemp,f=function(){return"vertical"===l.type?l.height:s[0].offsetWidth},h=s.find("."+o),y=s.next("."+v),g=y.children("."+c).children("input").val(),b=100/((l.max-l.min)/Math.ceil(l.step)),x=function(e,i){e=Math.ceil(e)*b>100?Math.ceil(e)*b:Math.round(e)*b,e=e>100?100:e,h.eq(i).css("vertical"===l.type?"bottom":"left",e+"%");var t=T(h[0].offsetLeft),a=l.range?T(h[1].offsetLeft):0;"vertical"===l.type?(s.find("."+d).css({bottom:e+"%","margin-bottom":"20px"}),t=T(f()-h[0].offsetTop-h.height()),a=l.range?T(f()-h[1].offsetTop-h.height()):0):s.find("."+d).css("left",e+"%"),t=t>100?100:t,a=a>100?100:a;var n=Math.min(t,a),o=Math.abs(t-a);"vertical"===l.type?s.find("."+r).css({height:o+"%",bottom:n+"%"}):s.find("."+r).css({width:o+"%",left:n+"%"});var u=l.min+Math.round((l.max-l.min)*e/100);if(g=u,y.children("."+c).children("input").val(g),h.eq(i).data("value",u),u=l.setTips?l.setTips(u):u,s.find("."+d).html(u),l.range){var v=[h.eq(0).data("value"),h.eq(1).data("value")];v[0]>v[1]&&v.reverse()}l.change&&l.change(l.range?v:u)},T=function(e){var i=e/f()*100/b,t=Math.round(i)*b;return e==f()&&(t=Math.ceil(i)*b),t},w=i(['
        f()&&(r=f());var o=r/f()*100/b;x(o,e),t.addClass(p),s.find("."+d).show(),i.preventDefault()},o=function(){t.removeClass(p),s.find("."+d).hide()};M(r,o)})}),s.on("click",function(e){var t=i("."+u);if(!t.is(event.target)&&0===t.has(event.target).length&&t.length){var a,n="vertical"===l.type?f()-e.clientY+i(this).offset().top:e.clientX-i(this).offset().left;n<0&&(n=0),n>f()&&(n=f());var s=n/f()*100/b;a=l.range?"vertical"===l.type?Math.abs(n-parseInt(i(h[0]).css("bottom")))>Math.abs(n-parseInt(i(h[1]).css("bottom")))?1:0:Math.abs(n-h[0].offsetLeft)>Math.abs(n-h[1].offsetLeft)?1:0:0,x(s,a),e.preventDefault()}}),y.hover(function(){var e=i(this);e.children("."+m).fadeIn("fast")},function(){var e=i(this);e.children("."+m).fadeOut("fast")}),y.children("."+m).children("i").each(function(e){i(this).on("click",function(){g=1==e?g-l.stepl.max?l.max:Number(g)+l.step;var i=(g-l.min)/(l.max-l.min)*100/b;x(i,0)})});var q=function(){var e=this.value;e=isNaN(e)?0:e,e=el.max?l.max:e,this.value=e;var i=(e-l.min)/(l.max-l.min)*100/b;x(i,0)};y.children("."+c).children("input").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),q.call(this))}).on("change",q)},f.prototype.events=function(){var e=this;e.config},t.render=function(e){var i=new f(e);return a.call(i)},e(n,t)});layui.define("jquery",function(e){"use strict";var i=layui.jquery,o={config:{},index:layui.colorpicker?layui.colorpicker.index+1e4:0,set:function(e){var o=this;return o.config=i.extend({},o.config,e),o},on:function(e,i){return layui.onevent.call(this,"colorpicker",e,i)}},r=function(){var e=this,i=e.config;return{config:i}},t="colorpicker",n="layui-show",l="layui-colorpicker",c=".layui-colorpicker-main",a="layui-icon-down",s="layui-icon-close",f="layui-colorpicker-trigger-span",d="layui-colorpicker-trigger-i",u="layui-colorpicker-side",p="layui-colorpicker-side-slider",g="layui-colorpicker-basis",v="layui-colorpicker-alpha-bgcolor",h="layui-colorpicker-alpha-slider",m="layui-colorpicker-basis-cursor",b="layui-colorpicker-main-input",k=function(e){var i={h:0,s:0,b:0},o=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b),t=r-o;return i.b=r,i.s=0!=r?255*t/r:0,0!=i.s?e.r==r?i.h=(e.g-e.b)/t:e.g==r?i.h=2+(e.b-e.r)/t:i.h=4+(e.r-e.g)/t:i.h=-1,r==o&&(i.h=0),i.h*=60,i.h<0&&(i.h+=360),i.s*=100/255,i.b*=100/255,i},y=function(e){var e=e.indexOf("#")>-1?e.substring(1):e;if(3==e.length){var i=e.split("");e=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]}e=parseInt(e,16);var o={r:e>>16,g:(65280&e)>>8,b:255&e};return k(o)},x=function(e){var i={},o=e.h,r=255*e.s/100,t=255*e.b/100;if(0==r)i.r=i.g=i.b=t;else{var n=t,l=(255-r)*t/255,c=(n-l)*(o%60)/60;360==o&&(o=0),o<60?(i.r=n,i.b=l,i.g=l+c):o<120?(i.g=n,i.b=l,i.r=n-c):o<180?(i.g=n,i.r=l,i.b=l+c):o<240?(i.b=n,i.r=l,i.g=n-c):o<300?(i.b=n,i.g=l,i.r=l+c):o<360?(i.r=n,i.g=l,i.b=n-c):(i.r=0,i.g=0,i.b=0)}return{r:Math.round(i.r),g:Math.round(i.g),b:Math.round(i.b)}},C=function(e){var o=x(e),r=[o.r.toString(16),o.g.toString(16),o.b.toString(16)];return i.each(r,function(e,i){1==i.length&&(r[e]="0"+i)}),r.join("")},P=function(e){var i=/[0-9]{1,3}/g,o=e.match(i)||[];return{r:o[0],g:o[1],b:o[2]}},B=i(window),w=i(document),D=function(e){var r=this;r.index=++o.index,r.config=i.extend({},r.config,o.config,e),r.render()};D.prototype.config={color:"",size:null,alpha:!1,format:"hex",predefine:!1,colors:["#009688","#5FB878","#1E9FFF","#FF5722","#FFB800","#01AAED","#999","#c00","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgb(0, 186, 189)","rgb(255, 120, 0)","rgb(250, 212, 0)","#393D49","rgba(0,0,0,.5)","rgba(255, 69, 0, 0.68)","rgba(144, 240, 144, 0.5)","rgba(31, 147, 255, 0.73)"]},D.prototype.render=function(){var e=this,o=e.config,r=i(['
        ',"",'3&&(o.alpha&&"rgb"==o.format||(e="#"+C(k(P(o.color))))),"background: "+e):e}()+'">','',"","","
        "].join("")),t=i(o.elem);o.size&&r.addClass("layui-colorpicker-"+o.size),t.addClass("layui-inline").html(e.elemColorBox=r),e.color=e.elemColorBox.find("."+f)[0].style.background,e.events()},D.prototype.renderPicker=function(){var e=this,o=e.config,r=e.elemColorBox[0],t=e.elemPicker=i(['
        ','
        ','
        ','
        ','
        ','
        ',"
        ",'
        ','
        ',"
        ","
        ",'
        ','
        ','
        ',"
        ","
        ",function(){if(o.predefine){var e=['
        '];return layui.each(o.colors,function(i,o){e.push(['
        ','
        ',"
        "].join(""))}),e.push("
        "),e.join("")}return""}(),'
        ','
        ','',"
        ",'
        ','','',"","
        "].join(""));e.elemColorBox.find("."+f)[0];i(c)[0]&&i(c).data("index")==e.index?e.removePicker(D.thisElemInd):(e.removePicker(D.thisElemInd),i("body").append(t)),D.thisElemInd=e.index,D.thisColor=r.style.background,e.position(),e.pickerEvents()},D.prototype.removePicker=function(e){var o=this;o.config;return i("#layui-colorpicker"+(e||o.index)).remove(),o},D.prototype.position=function(){var e=this,i=e.config,o=e.bindElem||e.elemColorBox[0],r=e.elemPicker[0],t=o.getBoundingClientRect(),n=r.offsetWidth,l=r.offsetHeight,c=function(e){return e=e?"scrollLeft":"scrollTop",document.body[e]|document.documentElement[e]},a=function(e){return document.documentElement[e?"clientWidth":"clientHeight"]},s=5,f=t.left,d=t.bottom;f-=(n-o.offsetWidth)/2,d+=s,f+n+s>a("width")?f=a("width")-n-s:fa()&&(d=t.top>l?t.top-l:a()-l,d-=2*s),i.position&&(r.style.position=i.position),r.style.left=f+("fixed"===i.position?0:c(1))+"px",r.style.top=d+("fixed"===i.position?0:c())+"px"},D.prototype.val=function(){var e=this,i=(e.config,e.elemColorBox.find("."+f)),o=e.elemPicker.find("."+b),r=i[0],t=r.style.backgroundColor;if(t){var n=k(P(t)),l=i.attr("lay-type");if(e.select(n.h,n.s,n.b),"torgb"===l&&o.find("input").val(t),"rgba"===l){var c=P(t);if(3==(t.match(/[0-9]{1,3}/g)||[]).length)o.find("input").val("rgba("+c.r+", "+c.g+", "+c.b+", 1)"),e.elemPicker.find("."+h).css("left",280);else{o.find("input").val(t);var a=280*t.slice(t.lastIndexOf(",")+1,t.length-1);e.elemPicker.find("."+h).css("left",a)}e.elemPicker.find("."+v)[0].style.background="linear-gradient(to right, rgba("+c.r+", "+c.g+", "+c.b+", 0), rgb("+c.r+", "+c.g+", "+c.b+"))"}}else e.select(0,100,100),o.find("input").val(""),e.elemPicker.find("."+v)[0].style.background="",e.elemPicker.find("."+h).css("left",280)},D.prototype.side=function(){var e=this,o=e.config,r=e.elemColorBox.find("."+f),t=r.attr("lay-type"),n=e.elemPicker.find("."+u),l=e.elemPicker.find("."+p),c=e.elemPicker.find("."+g),y=e.elemPicker.find("."+m),C=e.elemPicker.find("."+v),w=e.elemPicker.find("."+h),D=l[0].offsetTop/180*360,E=100-(y[0].offsetTop+3)/180*100,H=(y[0].offsetLeft+3)/260*100,W=Math.round(w[0].offsetLeft/280*100)/100,j=e.elemColorBox.find("."+d),F=e.elemPicker.find(".layui-colorpicker-pre").children("div"),L=function(i,n,l,c){e.select(i,n,l);var f=x({h:i,s:n,b:l});if(j.addClass(a).removeClass(s),r[0].style.background="rgb("+f.r+", "+f.g+", "+f.b+")","torgb"===t&&e.elemPicker.find("."+b).find("input").val("rgb("+f.r+", "+f.g+", "+f.b+")"),"rgba"===t){var d=0;d=280*c,w.css("left",d),e.elemPicker.find("."+b).find("input").val("rgba("+f.r+", "+f.g+", "+f.b+", "+c+")"),r[0].style.background="rgba("+f.r+", "+f.g+", "+f.b+", "+c+")",C[0].style.background="linear-gradient(to right, rgba("+f.r+", "+f.g+", "+f.b+", 0), rgb("+f.r+", "+f.g+", "+f.b+"))"}o.change&&o.change(e.elemPicker.find("."+b).find("input").val())},M=i(['
        t&&(r=t);var l=r/180*360;D=l,L(l,H,E,W),e.preventDefault()};Y(r),e.preventDefault()}),n.on("click",function(e){var o=e.clientY-i(this).offset().top;o<0&&(o=0),o>this.offsetHeight&&(o=this.offsetHeight);var r=o/180*360;D=r,L(r,H,E,W),e.preventDefault()}),y.on("mousedown",function(e){var i=this.offsetTop,o=this.offsetLeft,r=e.clientY,t=e.clientX,n=function(e){var n=i+(e.clientY-r),l=o+(e.clientX-t),a=c[0].offsetHeight-3,s=c[0].offsetWidth-3;n<-3&&(n=-3),n>a&&(n=a),l<-3&&(l=-3),l>s&&(l=s);var f=(l+3)/260*100,d=100-(n+3)/180*100;E=d,H=f,L(D,f,d,W),e.preventDefault()};layui.stope(e),Y(n),e.preventDefault()}),c.on("mousedown",function(e){var o=e.clientY-i(this).offset().top-3+B.scrollTop(),r=e.clientX-i(this).offset().left-3+B.scrollLeft();o<-3&&(o=-3),o>this.offsetHeight-3&&(o=this.offsetHeight-3),r<-3&&(r=-3),r>this.offsetWidth-3&&(r=this.offsetWidth-3);var t=(r+3)/260*100,n=100-(o+3)/180*100;E=n,H=t,L(D,t,n,W),e.preventDefault(),y.trigger(e,"mousedown")}),w.on("mousedown",function(e){var i=this.offsetLeft,o=e.clientX,r=function(e){var r=i+(e.clientX-o),t=C[0].offsetWidth;r<0&&(r=0),r>t&&(r=t);var n=Math.round(r/280*100)/100;W=n,L(D,H,E,n),e.preventDefault()};Y(r),e.preventDefault()}),C.on("click",function(e){var o=e.clientX-i(this).offset().left;o<0&&(o=0),o>this.offsetWidth&&(o=this.offsetWidth);var r=Math.round(o/280*100)/100;W=r,L(D,H,E,r),e.preventDefault()}),F.each(function(){i(this).on("click",function(){i(this).parent(".layui-colorpicker-pre").addClass("selected").siblings().removeClass("selected");var e,o=this.style.backgroundColor,r=k(P(o)),t=o.slice(o.lastIndexOf(",")+1,o.length-1);D=r.h,H=r.s,E=r.b,3==(o.match(/[0-9]{1,3}/g)||[]).length&&(t=1),W=t,e=280*t,L(r.h,r.s,r.b,t)})})},D.prototype.select=function(e,i,o,r){var t=this,n=(t.config,C({h:e,s:100,b:100})),l=C({h:e,s:i,b:o}),c=e/360*180,a=180-o/100*180-3,s=i/100*260-3;t.elemPicker.find("."+p).css("top",c),t.elemPicker.find("."+g)[0].style.background="#"+n,t.elemPicker.find("."+m).css({top:a,left:s}),"change"!==r&&t.elemPicker.find("."+b).find("input").val("#"+l)},D.prototype.pickerEvents=function(){var e=this,o=e.config,r=e.elemColorBox.find("."+f),t=e.elemPicker.find("."+b+" input"),n={clear:function(i){r[0].style.background="",e.elemColorBox.find("."+d).removeClass(a).addClass(s),e.color="",o.done&&o.done(""),e.removePicker()},confirm:function(i,n){var l=t.val(),c=l,f={};if(l.indexOf(",")>-1){if(f=k(P(l)),e.select(f.h,f.s,f.b),r[0].style.background=c="#"+C(f),(l.match(/[0-9]{1,3}/g)||[]).length>3&&"rgba"===r.attr("lay-type")){var u=280*l.slice(l.lastIndexOf(",")+1,l.length-1);e.elemPicker.find("."+h).css("left",u),r[0].style.background=l,c=l}}else f=y(l),r[0].style.background=c="#"+C(f),e.elemColorBox.find("."+d).removeClass(s).addClass(a);return"change"===n?(e.select(f.h,f.s,f.b,n),void(o.change&&o.change(c))):(e.color=l,o.done&&o.done(l),void e.removePicker())}};e.elemPicker.on("click","*[colorpicker-events]",function(){var e=i(this),o=e.attr("colorpicker-events");n[o]&&n[o].call(this,e)}),t.on("keyup",function(e){var o=i(this);n.confirm.call(this,o,13===e.keyCode?null:"change")})},D.prototype.events=function(){var e=this,o=e.config,r=e.elemColorBox.find("."+f);e.elemColorBox.on("click",function(){e.renderPicker(),i(c)[0]&&(e.val(),e.side())}),o.elem[0]&&!e.elemColorBox[0].eventHandler&&(w.on("click",function(o){if(!i(o.target).hasClass(l)&&!i(o.target).parents("."+l)[0]&&!i(o.target).hasClass(c.replace(/\./g,""))&&!i(o.target).parents(c)[0]&&e.elemPicker){if(e.color){var t=k(P(e.color));e.select(t.h,t.s,t.b)}else e.elemColorBox.find("."+d).removeClass(a).addClass(s);r[0].style.background=e.color||"",e.removePicker()}}),B.on("resize",function(){return!(!e.elemPicker||!i(c)[0])&&void e.position()}),e.elemColorBox[0].eventHandler=!0)},o.render=function(e){var i=new D(e);return r.call(i)},e(t,o)});layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,a=layui.hint(),n=layui.device(),l="form",r=".layui-form",s="layui-this",o="layui-hide",c="layui-disabled",u=function(){this.config={verify:{required:[/[\S]+/,"必填项不能为空"],phone:[/^1\d{10}$/,"请输入正确的手机号"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"邮箱格式不正确"],url:[/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,"链接格式不正确"],number:function(e){if(!e||isNaN(e))return"只能填写数字"},date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"日期格式不正确"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"请输入正确的身份证号"]}}};u.prototype.set=function(e){var i=this;return t.extend(!0,i.config,e),i},u.prototype.verify=function(e){var i=this;return t.extend(!0,i.config.verify,e),i},u.prototype.on=function(e,t){return layui.onevent.call(this,l,e,t)},u.prototype.val=function(e,i){var a=t(r+'[lay-filter="'+e+'"]');a.each(function(e,a){var n=t(this);layui.each(i,function(e,t){var i,a=n.find('[name="'+e+'"]');a[0]&&(i=a[0].type,"checkbox"===i?a[0].checked=t:"radio"===i?a.each(function(){this.value==t&&(this.checked=!0)}):a.val(t))})}),f.render(null,e)},u.prototype.render=function(e,i){var n=this,u=t(r+function(){return i?'[lay-filter="'+i+'"]':""}()),d={select:function(){var e,i="请选择",a="layui-form-select",n="layui-select-title",r="layui-select-none",d="",f=u.find("select"),v=function(i,l){t(i.target).parent().hasClass(n)&&!l||(t("."+a).removeClass(a+"ed "+a+"up"),e&&d&&e.val(d)),e=null},y=function(i,u,f){var y,p=t(this),m=i.find("."+n),k=m.find("input"),x=i.find("dl"),g=x.children("dd"),b=this.selectedIndex;if(!u){var C=function(){var e=i.offset().top+i.outerHeight()+5-h.scrollTop(),t=x.outerHeight();b=p[0].selectedIndex,i.addClass(a+"ed"),g.removeClass(o),y=null,g.eq(b).addClass(s).siblings().removeClass(s),e+t>h.height()&&e>=t&&i.addClass(a+"up"),T()},w=function(e){i.removeClass(a+"ed "+a+"up"),k.blur(),y=null,e||$(k.val(),function(e){var i=p[0].selectedIndex;e&&(d=t(p[0].options[i]).html(),0===i&&d===k.attr("placeholder")&&(d=""),k.val(d||""))})},T=function(){var e=x.children("dd."+s);if(e[0]){var t=e.position().top,i=x.height(),a=e.height();t>i&&x.scrollTop(t+x.scrollTop()-i+a-5),t<0&&x.scrollTop(t+x.scrollTop()-5)}};m.on("click",function(e){i.hasClass(a+"ed")?w():(v(e,!0),C()),x.find("."+r).remove()}),m.find(".layui-edge").on("click",function(){k.focus()}),k.on("keyup",function(e){var t=e.keyCode;9===t&&C()}).on("keydown",function(e){var t=e.keyCode;9===t&&w();var i=function(t,a){var n,l;e.preventDefault();var r=function(){var e=x.children("dd."+s);if(x.children("dd."+o)[0]&&"next"===t){var i=x.children("dd:not(."+o+",."+c+")"),n=i.eq(0).index();if(n>=0&&n无匹配项

        '):x.find("."+r).remove()},"keyup"),""===t&&x.find("."+r).remove(),void T())};f&&k.on("keyup",q).on("blur",function(i){var a=p[0].selectedIndex;e=k,d=t(p[0].options[a]).html(),0===a&&d===k.attr("placeholder")&&(d=""),setTimeout(function(){$(k.val(),function(e){d||k.val("")},"blur")},200)}),g.on("click",function(){var e=t(this),a=e.attr("lay-value"),n=p.attr("lay-filter");return!e.hasClass(c)&&(e.hasClass("layui-select-tips")?k.val(""):(k.val(e.text()),e.addClass(s)),e.siblings().removeClass(s),p.val(a).removeClass("layui-form-danger"),layui.event.call(this,l,"select("+n+")",{elem:p[0],value:a,othis:i}),w(!0),!1)}),i.find("dl>dt").on("click",function(e){return!1}),t(document).off("click",v).on("click",v)}};f.each(function(e,l){var r=t(this),o=r.next("."+a),u=this.disabled,d=l.value,f=t(l.options[l.selectedIndex]),v=l.options[0];if("string"==typeof r.attr("lay-ignore"))return r.show();var h="string"==typeof r.attr("lay-search"),p=v?v.value?i:v.innerHTML||i:i,m=t(['
        ','
        ','','
        ','
        ',function(e){var t=[];return layui.each(e,function(e,a){0!==e||a.value?"optgroup"===a.tagName.toLowerCase()?t.push("
        "+a.label+"
        "):t.push('
        '+a.innerHTML+"
        "):t.push('
        '+(a.innerHTML||i)+"
        ")}),0===t.length&&t.push('
        没有选项
        '),t.join("")}(r.find("*"))+"
        ","
        "].join(""));o[0]&&o.remove(),r.after(m),y.call(this,m,u,h)})},checkbox:function(){var e={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},i=u.find("input[type=checkbox]"),a=function(e,i){var a=t(this);e.on("click",function(){var t=a.attr("lay-filter"),n=(a.attr("lay-text")||"").split("|");a[0].disabled||(a[0].checked?(a[0].checked=!1,e.removeClass(i[1]).find("em").text(n[1])):(a[0].checked=!0,e.addClass(i[1]).find("em").text(n[0])),layui.event.call(a[0],l,i[2]+"("+t+")",{elem:a[0],value:a[0].value,othis:e}))})};i.each(function(i,n){var l=t(this),r=l.attr("lay-skin"),s=(l.attr("lay-text")||"").split("|"),o=this.disabled;"switch"===r&&(r="_"+r);var u=e[r]||e.checkbox;if("string"==typeof l.attr("lay-ignore"))return l.show();var d=l.next("."+u[0]),f=t(['
        ",function(){var e=n.title.replace(/\s/g,""),t={checkbox:[e?""+n.title+"":"",''].join(""),_switch:""+((n.checked?s[0]:s[1])||"")+""};return t[r]||t.checkbox}(),"
        "].join(""));d[0]&&d.remove(),l.after(f),a.call(this,f,u)})},radio:function(){var e="layui-form-radio",i=["",""],a=u.find("input[type=radio]"),n=function(a){var n=t(this),s="layui-anim-scaleSpring";a.on("click",function(){var o=n[0].name,c=n.parents(r),u=n.attr("lay-filter"),d=c.find("input[name="+o.replace(/(\.|#|\[|\])/g,"\\$1")+"]");n[0].disabled||(layui.each(d,function(){var a=t(this).next("."+e);this.checked=!1,a.removeClass(e+"ed"),a.find(".layui-icon").removeClass(s).html(i[1])}),n[0].checked=!0,a.addClass(e+"ed"),a.find(".layui-icon").addClass(s).html(i[0]),layui.event.call(n[0],l,"radio("+u+")",{elem:n[0],value:n[0].value,othis:a}))})};a.each(function(a,l){var r=t(this),s=r.next("."+e),o=this.disabled;if("string"==typeof r.attr("lay-ignore"))return r.show();s[0]&&s.remove();var u=t(['
        ',''+i[l.checked?0:1]+"","
        "+function(){var e=l.title||"";return"string"==typeof r.next().attr("lay-radio")&&(e=r.next().html(),r.next().remove()),e}()+"
        ","
        "].join(""));r.after(u),n.call(this,u)})}};return e?d[e]?d[e]():a.error("不支持的"+e+"表单渲染"):layui.each(d,function(e,t){t()}),n};var d=function(){var e=t(this),a=f.config.verify,s=null,o="layui-form-danger",c={},u=e.parents(r),d=u.find("*[lay-verify]"),v=e.parents("form")[0],h=u.find("input,select,textarea"),y=e.attr("lay-filter");if(layui.each(d,function(e,l){var r=t(this),c=r.attr("lay-verify").split("|"),u=r.attr("lay-verType"),d=r.val();if(r.removeClass(o),layui.each(c,function(e,t){var c,f="",v="function"==typeof a[t];if(a[t]){var c=v?f=a[t](d,l):!a[t][0].test(d);if(f=f||a[t][1],"required"===t&&(f=r.attr("lay-reqText")||f),c)return"tips"===u?i.tips(f,function(){return"string"==typeof r.attr("lay-ignore")||"select"!==l.tagName.toLowerCase()&&!/^checkbox|radio$/.test(l.type)?r:r.next()}(),{tips:1}):"alert"===u?i.alert(f,{title:"提示",shadeClose:!0}):i.msg(f,{icon:5,shift:6}),n.android||n.ios||setTimeout(function(){l.focus()},7),r.addClass(o),s=!0}}),s)return s}),s)return!1;var p={};return layui.each(h,function(e,t){if(t.name=(t.name||"").replace(/^\s*|\s*&/,""),t.name){if(/^.*\[\]$/.test(t.name)){var i=t.name.match(/^(.*)\[\]$/g)[0];p[i]=0|p[i],t.name=t.name.replace(/^(.*)\[\]$/,"$1["+p[i]++ +"]")}/^checkbox|radio$/.test(t.type)&&!t.checked||(c[t.name]=t.value)}}),layui.event.call(this,l,"submit("+y+")",{elem:this,form:v,field:c})},f=new u,v=t(document),h=t(window);f.render(),v.on("reset",r,function(){var e=t(this).attr("lay-filter");setTimeout(function(){f.render(null,e)},50)}),v.on("submit",r,d).on("click","*[lay-submit]",d),e(l,f)});layui.define("form",function(e){"use strict";var i=layui.$,a=layui.form,n="tree",r={config:{},index:layui[n]?layui[n].index+1e4:0,set:function(e){var a=this;return a.config=i.extend({},a.config,e),a},on:function(e,i){return layui.onevent.call(this,n,e,i)}},l=function(){var e=this,i=e.config,a=i.id||e.index;return l.that[a]=e,l.config[a]=i,{config:i,reload:function(i){e.reload.call(e,i)},getChecked:function(){return e.getChecked.call(e)},setChecked:function(i){return e.setChecked.call(e,i)}}},t="layui-hide",d="layui-disabled",s="layui-tree-set",c="layui-tree-iconClick",o="layui-icon-addition",h="layui-icon-subtraction",u="layui-tree-entry",f="layui-tree-main",p="layui-tree-txt",y="layui-tree-pack",v="layui-tree-spread",C="layui-tree-setLineShort",m="layui-tree-showLine",k="layui-tree-lineExtend",g=function(e){var a=this;a.index=++r.index,a.config=i.extend({},a.config,r.config,e),a.render()};g.prototype.config={data:[],showCheckbox:!1,showLine:!0,accordion:!1,onlyIconControl:!1,isJump:!1,edit:!1,text:{defaultNodeName:"未命名",none:"无数据"}},g.prototype.reload=function(e){var a=this;layui.each(e,function(e,i){i.constructor===Array&&delete a.config[e]}),a.config=i.extend(!0,{},a.config,e),a.render()},g.prototype.render=function(){var e=this,a=e.config,n=i('
        ');e.tree(n);var r=a.elem=i(a.elem);if(r[0]){if(a.showSearch&&n.prepend(''),e.key=a.id||e.index,e.elem=n,e.elemNone=i('
        '+a.text.none+"
        "),r.html(e.elem),0==e.elem.find(".layui-tree-set").length)return e.elem.append(e.elemNone);a.drag&&e.drag(),a.showCheckbox&&e.renderForm("checkbox"),e.elem.find(".layui-tree-set").each(function(){var e=i(this);e.parent(".layui-tree-pack")[0]||e.addClass("layui-tree-setHide"),!e.next()[0]&&e.parents(".layui-tree-pack").eq(1).hasClass("layui-tree-lineExtend")&&e.addClass(C),e.next()[0]||e.parents(".layui-tree-set").eq(0).next()[0]||e.addClass(C)}),e.events()}},g.prototype.renderForm=function(e){a.render(e,"LAY-tree-"+this.index)},g.prototype.tree=function(e,a){var n=this,r=n.config,l=a||r.data;layui.each(l,function(a,l){var c=l.children&&l.children.length>0,o=i('
        '),h=i(['
        ',"
        ','
        ',function(){return r.showLine?c?'':'':''}(),function(){return r.showCheckbox?'':""}(),function(){return r.isJump&&l.href?''+(l.title||l.label||r.text.defaultNodeName)+"":''+(l.title||l.label||r.text.defaultNodeName)+""}(),"
        ",function(){if(!r.edit)return"";var e={add:'',update:'',del:''},i=['
        '];return r.edit===!0&&(r.edit=["update","del"]),"object"==typeof r.edit?(layui.each(r.edit,function(a,n){i.push(e[n]||"")}),i.join("")+"
        "):void 0}(),"
        "].join(""));c&&(h.append(o),n.tree(o,l.children)),e.append(h),h.prev("."+s)[0]&&h.prev().children(".layui-tree-pack").addClass("layui-tree-showLine"),c||h.parent(".layui-tree-pack").addClass("layui-tree-lineExtend"),n.spread(h,l),r.showCheckbox&&n.checkClick(h,l),r.edit&&n.operate(h,l)})},g.prototype.spread=function(e,a){var n=this,r=n.config,l=e.children("."+u),t=l.children("."+f),C=l.find("."+c),m=l.find("."+p),k=r.onlyIconControl?C:t,g="";k.on("click",function(i){var a=e.children("."+y),n=k.children(".layui-icon")[0]?k.children(".layui-icon"):k.find(".layui-tree-icon").children(".layui-icon");if(a[0]){if(e.hasClass(v))e.removeClass(v),a.slideUp(200),n.removeClass(h).addClass(o);else if(e.addClass(v),a.slideDown(200),n.addClass(h).removeClass(o),r.accordion){var l=e.siblings("."+s);l.removeClass(v),l.children("."+y).slideUp(200),l.find(".layui-tree-icon").children(".layui-icon").removeClass(h).addClass(o)}}else g="normal"}),m.on("click",function(){var n=i(this);n.hasClass(d)||(g=e.hasClass(v)?r.onlyIconControl?"open":"close":r.onlyIconControl?"close":"open",r.click&&r.click({elem:e,state:g,data:a}))})},g.prototype.setCheckbox=function(e,i,a){var n=this,r=(n.config,a.prop("checked"));if("object"==typeof i.children||e.find("."+y)[0]){var l=e.find("."+y).find('input[name="layuiTreeCheck"]');l.each(function(){this.disabled||(this.checked=r)})}var t=function(e){if(e.parents("."+s)[0]){var i,a=e.parent("."+y),n=a.parent(),l=a.prev().find('input[name="layuiTreeCheck"]');r?l.prop("checked",r):(a.find('input[name="layuiTreeCheck"]').each(function(){this.checked&&(i=!0)}),i||l.prop("checked",!1)),t(n)}};t(e),n.renderForm("checkbox")},g.prototype.checkClick=function(e,a){var n=this,r=n.config,l=e.children("."+u),t=l.children("."+f);t.on("click",'input[name="layuiTreeCheck"]+',function(l){layui.stope(l);var t=i(this).prev(),d=t.prop("checked");t.prop("disabled")||(n.setCheckbox(e,a,t),r.oncheck&&r.oncheck({elem:e,checked:d,data:a}))})},g.prototype.operate=function(e,a){var n=this,r=n.config,l=e.children("."+u),d=l.children("."+f);l.children(".layui-tree-btnGroup").on("click",".layui-icon",function(l){layui.stope(l);var f=i(this).data("type"),g=e.children("."+y),x={data:a,type:f,elem:e};if("add"==f){g[0]||(r.showLine?(d.find("."+c).addClass("layui-tree-icon"),d.find("."+c).children(".layui-icon").addClass(o).removeClass("layui-icon-file")):d.find(".layui-tree-iconArrow").removeClass(t),e.append('
        '));var b=r.operate&&r.operate(x),w={};if(w.title=r.text.defaultNodeName,w.id=b,n.tree(e.children("."+y),[w]),r.showLine)if(g[0])g.hasClass(k)||g.addClass(k),e.find("."+y).each(function(){i(this).children("."+s).last().addClass(C)}),g.children("."+s).last().prev().hasClass(C)?g.children("."+s).last().prev().removeClass(C):g.children("."+s).last().removeClass(C),!e.parent("."+y)[0]&&e.next()[0]&&g.children("."+s).last().removeClass(C);else{var T=e.siblings("."+s),L=1,N=e.parent("."+y);layui.each(T,function(e,a){i(a).children("."+y)[0]||(L=0)}),1==L?(T.children("."+y).addClass(m),T.children("."+y).children("."+s).removeClass(C),e.children("."+y).addClass(m),N.removeClass(k),N.children("."+s).last().children("."+y).children("."+s).last().addClass(C)):e.children("."+y).children("."+s).addClass(C)}if(!r.showCheckbox)return;if(d.find('input[name="layuiTreeCheck"]')[0].checked){var A=e.children("."+y).children("."+s).last();A.find('input[name="layuiTreeCheck"]')[0].checked=!0}n.renderForm("checkbox")}else if("update"==f){var q=d.children("."+p).html();d.children("."+p).html(""),d.append(''),d.children(".layui-tree-editInput").val(q).focus();var F=function(e){var i=e.val().trim();i=i?i:r.text.defaultNodeName,e.remove(),d.children("."+p).html(i),x.data.title=i,r.operate&&r.operate(x)};d.children(".layui-tree-editInput").blur(function(){F(i(this))}),d.children(".layui-tree-editInput").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),F(i(this)))})}else{if(r.operate&&r.operate(x),x.status="remove",!e.prev("."+s)[0]&&!e.next("."+s)[0]&&!e.parent("."+y)[0])return e.remove(),void n.elem.append(n.elemNone);if(e.siblings("."+s).children("."+u)[0]){if(r.showCheckbox){var I=function(e){if(e.parents("."+s)[0]){var a=e.siblings("."+s).children("."+u),r=e.parent("."+y).prev(),l=r.find('input[name="layuiTreeCheck"]')[0],t=1,d=0;0==l.checked&&(a.each(function(e,a){var n=i(a).find('input[name="layuiTreeCheck"]')[0];0!=n.checked||n.disabled||(t=0),n.disabled||(d=1)}),1==t&&1==d&&(l.checked=!0,n.renderForm("checkbox"),I(r.parent("."+s))))}};I(e)}if(r.showLine){var T=e.siblings("."+s),L=1,N=e.parent("."+y);layui.each(T,function(e,a){i(a).children("."+y)[0]||(L=0)}),1==L?(g[0]||(N.removeClass(k),T.children("."+y).addClass(m),T.children("."+y).children("."+s).removeClass(C)),e.next()[0]?N.children("."+s).last().children("."+y).children("."+s).last().addClass(C):e.prev().children("."+y).children("."+s).last().addClass(C),e.next()[0]||e.parents("."+s)[1]||e.parents("."+s).eq(0).next()[0]||e.prev("."+s).addClass(C)):!e.next()[0]&&e.hasClass(C)&&e.prev().addClass(C)}}else{var H=e.parent("."+y).prev();if(r.showLine){H.find("."+c).removeClass("layui-tree-icon"),H.find("."+c).children(".layui-icon").removeClass(h).addClass("layui-icon-file");var S=H.parents("."+y).eq(0);S.addClass(k),S.children("."+s).each(function(){i(this).children("."+y).children("."+s).last().addClass(C)})}else H.find(".layui-tree-iconArrow").addClass(t);e.parents("."+s).eq(0).removeClass(v),e.parent("."+y).remove()}e.remove()}})},g.prototype.drag=function(){var e=this,a=e.config;e.elem.on("dragstart","."+u,function(){var e=i(this).parent("."+s),n=e.parents("."+s)[0]?e.parents("."+s).eq(0):"未找到父节点";a.dragstart&&a.dragstart(e,n)}),e.elem.on("dragend","."+u,function(n){var n=n||event,r=n.clientY,l=i(this),d=l.parent("."+s),f=d.height(),p=d.offset().top,g=e.elem.find("."+s),x=e.elem.height(),b=e.elem.offset().top,w=x+b-13,T=d.parents("."+s)[0],L=d.next()[0];if(T)var N=d.parent("."+y),A=d.parents("."+s).eq(0),q=A.parent("."+y),F=A.offset().top,I=d.siblings(),H=A.children("."+y).children("."+s).length;var S=function(n){if(T||L||e.elem.children("."+s).last().children("."+y).children("."+s).last().addClass(C),!T)return void d.removeClass("layui-tree-setHide");if(1==H)a.showLine?(n.find("."+c).removeClass("layui-tree-icon"),n.find("."+c).children(".layui-icon").removeClass(h).addClass("layui-icon-file"),q.addClass(k),q.children("."+s).children("."+y).each(function(){i(this).children("."+s).last().addClass(C)})):n.find(".layui-tree-iconArrow").addClass(t),n.children("."+y).remove(),n.removeClass(v);else{if(a.showLine){var r=1;layui.each(I,function(e,a){i(a).children("."+y)[0]||(r=0)}),1==r?(d.children("."+y)[0]||(N.removeClass(k),I.children("."+y).addClass(m),I.children("."+y).children("."+s).removeClass(C)),N.children("."+s).last().children("."+y).children("."+s).last().addClass(C),L||n.parents("."+s)[0]||n.next()[0]||N.children("."+s).last().addClass(C)):!L&&d.hasClass(C)&&N.children("."+s).last().addClass(C)}if(a.showCheckbox){var l=function(a){if(a){if(!a.parents("."+s)[0])return}else if(!n[0])return;var r=a?a.siblings().children("."+u):I.children("."+u),t=a?a.parent("."+y).prev():N.prev(),d=t.find('input[name="layuiTreeCheck"]')[0],c=1,o=0;0==d.checked&&(r.each(function(e,a){var n=i(a).find('input[name="layuiTreeCheck"]')[0];0!=n.checked||n.disabled||(c=0),n.disabled||(o=1)}),1==c&&1==o&&(d.checked=!0,e.renderForm("checkbox"),l(t.parent("."+s)||n)))};l()}}};g.each(function(){if(0!=i(this).height()){if(r>p&&rF&&rn&&r
        ')),i(this).children("."+y).append(d),S(A),a.showLine){var l=i(this).children("."+y).children("."+s);if(d.children("."+y).children("."+s).last().addClass(C),1==l.length){var h=i(this).siblings("."+s),v=1,g=i(this).parent("."+y);layui.each(h,function(e,a){i(a).children("."+y)[0]||(v=0)}),1==v?(h.children("."+y).addClass(m),h.children("."+y).children("."+s).removeClass(C),i(this).children("."+y).addClass(m),g.removeClass(k),g.children("."+s).last().children("."+y).children("."+s).last().addClass(C).removeClass("layui-tree-setHide")):i(this).children("."+y).children("."+s).addClass(C).removeClass("layui-tree-setHide")}else d.prev("."+s).hasClass(C)?(d.prev("."+s).removeClass(C),d.addClass(C)):(d.removeClass("layui-tree-setLineShort layui-tree-setHide"),d.children("."+y)[0]?d.prev("."+s).children("."+y).children("."+s).last().removeClass(C):d.siblings("."+s).find("."+y).each(function(){i(this).children("."+s).last().addClass(C)})),i(this).next()[0]||d.addClass(C)}if(a.showCheckbox&&i(this).children("."+u).find('input[name="layuiTreeCheck"]')[0].checked){var x=d.children("."+u);x.find('input[name="layuiTreeCheck"]+').click()}return a.dragend&&a.dragend("drag success",d,i(this)),!1}if(rw)return e.elem.children("."+s).last().children("."+y).addClass(m),e.elem.append(d),S(A),d.prev().children("."+y).children("."+s).last().removeClass(C),d.addClass("layui-tree-setHide"),d.children("."+y).children("."+s).last().addClass(C),a.dragend&&a.dragend("拖拽成功,插入最外层节点",d,e.elem),!1}})})},g.prototype.events=function(){var e=this,a=e.config,n=e.elem.find(".layui-tree-checkedFirst");layui.each(n,function(e,a){i(a).children("."+u).find('input[name="layuiTreeCheck"]+').trigger("click")}),e.elem.find(".layui-tree-search").on("keyup",function(){var n=i(this),r=n.val(),l=n.nextAll(),d=[];l.find("."+p).each(function(){var e=i(this).parents("."+u);if(i(this).html().indexOf(r)!=-1){d.push(i(this).parent());var a=function(e){e.addClass("layui-tree-searchShow"),e.parent("."+y)[0]&&a(e.parent("."+y).parent("."+s))};a(e.parent("."+s))}}),l.find("."+u).each(function(){var e=i(this).parent("."+s);e.hasClass("layui-tree-searchShow")||e.addClass(t)}),0==l.find(".layui-tree-searchShow").length&&e.elem.append(e.elemNone),a.onsearch&&a.onsearch({elem:d})}),e.elem.find(".layui-tree-search").on("keydown",function(){i(this).nextAll().find("."+u).each(function(){var e=i(this).parent("."+s);e.removeClass("layui-tree-searchShow "+t)}),i(".layui-tree-emptyText")[0]&&i(".layui-tree-emptyText").remove()})},g.prototype.getChecked=function(){var e=this,a=e.config,n=[],r=[];e.elem.find(".layui-form-checked").each(function(){n.push(i(this).prev()[0].value)});var l=function(e,a){layui.each(e,function(e,r){layui.each(n,function(e,n){if(r.id==n){var t=i.extend({},r);return delete t.children,a.push(t),r.children&&(t.children=[],l(r.children,t.children)),!0}})})};return l(i.extend({},a.data),r),r},g.prototype.setChecked=function(e){var a=this;a.config;a.elem.find("."+s).each(function(a,n){var r=i(this).data("id"),l=i(n).children("."+u).find('input[name="layuiTreeCheck"]'),t=l.next();if("number"==typeof e){if(r==e)return l[0].checked||t.click(),!1}else i.inArray(r,e)!=-1&&(l[0].checked||t.click())})},l.that={},l.config={},r.reload=function(e,i){var a=l.that[e];return a.reload(i),l.call(a)},r.getChecked=function(e){var i=l.that[e];return i.getChecked()},r.setChecked=function(e,i){var a=l.that[e];return a.setChecked(i)},r.render=function(e){var i=new g(e);return l.call(i)},e(n,r)});layui.define(["laytpl","form"],function(e){"use strict";var a=layui.$,t=layui.laytpl,n=layui.form,i="transfer",l={config:{},index:layui[i]?layui[i].index+1e4:0,set:function(e){var t=this;return t.config=a.extend({},t.config,e),t},on:function(e,a){return layui.onevent.call(this,i,e,a)}},r=function(){var e=this,a=e.config,t=a.id||e.index;return r.that[t]=e,r.config[t]=a,{config:a,reload:function(a){e.reload.call(e,a)},getData:function(){return e.getData.call(e)}}},c="layui-hide",o="layui-btn-disabled",d="layui-none",s="layui-transfer-box",u="layui-transfer-header",h="layui-transfer-search",f="layui-transfer-active",y="layui-transfer-data",p=function(e){return e=e||{},['
        ','
        ','","
        ","{{# if(d.data.showSearch){ }}",'","{{# } }}",'
          ',"
          "].join("")},v=['
          ',p({index:0,checkAllName:"layTransferLeftCheckAll"}),'
          ','",'","
          ",p({index:1,checkAllName:"layTransferRightCheckAll"}),"
          "].join(""),x=function(e){var t=this;t.index=++l.index,t.config=a.extend({},t.config,l.config,e),t.render()};x.prototype.config={title:["列表一","列表二"],width:200,height:360,data:[],value:[],showSearch:!1,id:"",text:{none:"无数据",searchNone:"无匹配数据"}},x.prototype.reload=function(e){var t=this;layui.each(e,function(e,a){a.constructor===Array&&delete t.config[e]}),t.config=a.extend(!0,{},t.config,e),t.render()},x.prototype.render=function(){var e=this,n=e.config,i=e.elem=a(t(v).render({data:n,index:e.index})),l=n.elem=a(n.elem);l[0]&&(n.data=n.data||[],n.value=n.value||[],e.key=n.id||e.index,l.html(e.elem),e.layBox=e.elem.find("."+s),e.layHeader=e.elem.find("."+u),e.laySearch=e.elem.find("."+h),e.layData=i.find("."+y),e.layBtn=i.find("."+f+" .layui-btn"),e.layBox.css({width:n.width,height:n.height}),e.layData.css({height:function(){return n.height-e.layHeader.outerHeight()-e.laySearch.outerHeight()-2}()}),e.renderData(),e.events())},x.prototype.renderData=function(){var e=this,a=(e.config,[{checkName:"layTransferLeftCheck",views:[]},{checkName:"layTransferRightCheck",views:[]}]);e.parseData(function(e){var t=e.selected?1:0,n=["
        • ",'',"
        • "].join("");a[t].views.push(n),delete e.selected}),e.layData.eq(0).html(a[0].views.join("")),e.layData.eq(1).html(a[1].views.join("")),e.renderCheckBtn()},x.prototype.renderForm=function(e){n.render(e,"LAY-transfer-"+this.index)},x.prototype.renderCheckBtn=function(e){var t=this,n=t.config;e=e||{},t.layBox.each(function(i){var l=a(this),r=l.find("."+y),d=l.find("."+u).find('input[type="checkbox"]'),s=r.find('input[type="checkbox"]'),h=0,f=!1;if(s.each(function(){var e=a(this).data("hide");(this.checked||this.disabled||e)&&h++,this.checked&&!e&&(f=!0)}),d.prop("checked",f&&h===s.length),t.layBtn.eq(i)[f?"removeClass":"addClass"](o),!e.stopNone){var p=r.children("li:not(."+c+")").length;t.noneView(r,p?"":n.text.none)}}),t.renderForm("checkbox")},x.prototype.noneView=function(e,t){var n=a('

          '+(t||"")+"

          ");e.find("."+d)[0]&&e.find("."+d).remove(),t.replace(/\s/g,"")&&e.append(n)},x.prototype.setValue=function(){var e=this,t=e.config,n=[];return e.layBox.eq(1).find("."+y+' input[type="checkbox"]').each(function(){var e=a(this).data("hide");e||n.push(this.value)}),t.value=n,e},x.prototype.parseData=function(e){var t=this,n=t.config,i=[];return layui.each(n.data,function(t,l){l=("function"==typeof n.parseData?n.parseData(l):l)||l,i.push(l=a.extend({},l)),layui.each(n.value,function(e,a){a==l.value&&(l.selected=!0)}),e&&e(l)}),n.data=i,t},x.prototype.getData=function(e){var a=this,t=a.config,n=[];return layui.each(e||t.value,function(e,a){layui.each(t.data,function(e,t){delete t.selected,a==t.value&&n.push(t)})}),n},x.prototype.events=function(){var e=this,t=e.config;e.elem.on("click",'input[lay-filter="layTransferCheckbox"]+',function(){var t=a(this).prev(),n=t[0].checked,i=t.parents("."+s).eq(0).find("."+y);t[0].disabled||("all"===t.attr("lay-type")&&i.find('input[type="checkbox"]').each(function(){this.disabled||(this.checked=n)}),e.renderCheckBtn({stopNone:!0}))}),e.layBtn.on("click",function(){var n=a(this),i=n.data("index"),l=e.layBox.eq(i),r=[];if(!n.hasClass(o)){e.layBox.eq(i).each(function(t){var n=a(this),i=n.find("."+y);i.children("li").each(function(){var t=a(this),n=t.find('input[type="checkbox"]'),i=n.data("hide");n[0].checked&&!i&&(n[0].checked=!1,l.siblings("."+s).find("."+y).append(t.clone()),t.remove(),r.push(n[0].value)),e.setValue()})}),e.renderCheckBtn();var c=l.siblings("."+s).find("."+h+" input");""===c.val()||c.trigger("keyup"),t.onchange&&t.onchange(e.getData(r),i)}}),e.laySearch.find("input").on("keyup",function(){var n=this.value,i=a(this).parents("."+h).eq(0).siblings("."+y),l=i.children("li");l.each(function(){var e=a(this),t=e.find('input[type="checkbox"]'),i=t[0].title.indexOf(n)!==-1;e[i?"removeClass":"addClass"](c),t.data("hide",!i)}),e.renderCheckBtn();var r=l.length===i.children("li."+c).length;e.noneView(i,r?t.text.searchNone:"")})},r.that={},r.config={},l.reload=function(e,a){var t=r.that[e];return t.reload(a),r.call(t)},l.getData=function(e){var a=r.that[e];return a.getData()},l.render=function(e){var a=new x(e);return r.call(a)},e(i,l)});layui.define(["laytpl","laypage","layer","form","util"],function(e){"use strict";var t=layui.$,i=layui.laytpl,a=layui.laypage,l=layui.layer,n=layui.form,o=(layui.util,layui.hint()),r=layui.device(),d={config:{checkName:"LAY_CHECKED",indexName:"LAY_TABLE_INDEX"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,y,e,t)}},c=function(){var e=this,t=e.config,i=t.id||t.index;return i&&(c.that[i]=e,c.config[i]=t),{config:t,reload:function(t){e.reload.call(e,t)},setColsWidth:function(){e.setColsWidth.call(e)},resize:function(){e.resize.call(e)}}},s=function(e){var t=c.config[e];return t||o.error("The ID option was not found in the table instance"),t||null},u=function(e,a,l,n){var o=e.templet?function(){return"function"==typeof e.templet?e.templet(l):i(t(e.templet).html()||String(a)).render(l)}():a;return n?t("
          "+o+"
          ").text():o},y="table",h=".layui-table",f="layui-hide",p="layui-none",v="layui-table-view",m=".layui-table-tool",g=".layui-table-box",b=".layui-table-init",x=".layui-table-header",k=".layui-table-body",C=".layui-table-main",w=".layui-table-fixed",T=".layui-table-fixed-l",A=".layui-table-fixed-r",L=".layui-table-total",N=".layui-table-page",S=".layui-table-sort",W="layui-table-edit",_="layui-table-hover",E=function(e){var t='{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';return e=e||{},['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',function(){return e.fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':""}(),"{{# var isSort = !(item2.colGroup) && item2.sort; }}",'",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
          ','
          ','{{# if(item2.type === "checkbox"){ }}','',"{{# } else { }}",'{{item2.title||""}}',"{{# if(isSort){ }}",'',"{{# } }}","{{# } }}","
          ","
          "].join("")},z=['',"","
          "].join(""),H=['
          ',"{{# if(d.data.toolbar){ }}",'
          ','
          ','
          ',"
          ","{{# } }}",'
          ',"{{# if(d.data.loading){ }}",'
          ','',"
          ","{{# } }}","{{# var left, right; }}",'
          ',E(),"
          ",'
          ',z,"
          ","{{# if(left){ }}",'
          ','
          ',E({fixed:!0}),"
          ",'
          ',z,"
          ","
          ","{{# }; }}","{{# if(right){ }}",'
          ','
          ',E({fixed:"right"}),'
          ',"
          ",'
          ',z,"
          ","
          ","{{# }; }}","
          ","{{# if(d.data.totalRow){ }}",'
          ','','',"
          ","
          ","{{# } }}","{{# if(d.data.page){ }}",'
          ','
          ',"
          ","{{# } }}","","
          "].join(""),R=t(window),F=t(document),I=function(e){var i=this;i.index=++d.index,i.config=t.extend({},i.config,d.config,e),i.render()};I.prototype.config={limit:10,loading:!0,cellMinWidth:60,defaultToolbar:["filter","exports","print"],autoSort:!0,text:{none:"无数据"}},I.prototype.render=function(){var e=this,a=e.config;if(a.elem=t(a.elem),a.where=a.where||{},a.id=a.id||a.elem.attr("id")||e.index,a.request=t.extend({pageName:"page",limitName:"limit"},a.request),a.response=t.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",countName:"count"},a.response),"object"==typeof a.page&&(a.limit=a.page.limit||a.limit,a.limits=a.page.limits||a.limits,e.page=a.page.curr=a.page.curr||1,delete a.page.elem,delete a.page.jump),!a.elem[0])return e;a.height&&/^full-\d+$/.test(a.height)&&(e.fullHeightGap=a.height.split("-")[1],a.height=R.height()-e.fullHeightGap),e.setInit();var l=a.elem,n=l.next("."+v),o=e.elem=t(i(H).render({VIEW_CLASS:v,data:a,index:e.index}));if(a.index=e.index,e.key=a.id||a.index,n[0]&&n.remove(),l.after(o),e.layTool=o.find(m),e.layBox=o.find(g),e.layHeader=o.find(x),e.layMain=o.find(C),e.layBody=o.find(k),e.layFixed=o.find(w),e.layFixLeft=o.find(T),e.layFixRight=o.find(A),e.layTotal=o.find(L),e.layPage=o.find(N),e.renderToolbar(),e.fullSize(),a.cols.length>1){var r=e.layFixed.find(x).find("th");r.height(e.layHeader.height()-1-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom")))}e.pullData(e.page),e.events()},I.prototype.initOpts=function(e){var t=this,i=(t.config,{checkbox:48,radio:48,space:15,numbers:40});e.checkbox&&(e.type="checkbox"),e.space&&(e.type="space"),e.type||(e.type="normal"),"normal"!==e.type&&(e.unresize=!0,e.width=e.width||i[e.type])},I.prototype.setInit=function(e){var t=this,i=t.config;return i.clientWidth=i.width||function(){var e=function(t){var a,l;t=t||i.elem.parent(),a=t.width();try{l="none"===t.css("display")}catch(n){}return!t[0]||a&&!l?a:e(t.parent())};return e()}(),"width"===e?i.clientWidth:void layui.each(i.cols,function(e,a){layui.each(a,function(l,n){if(!n)return void a.splice(l,1);if(n.key=e+"-"+l,n.hide=n.hide||!1,n.colGroup||n.colspan>1){var o=0;layui.each(i.cols[e+1],function(t,i){i.HAS_PARENT||o>1&&o==n.colspan||(i.HAS_PARENT=!0,i.parentKey=e+"-"+l,o+=parseInt(i.colspan>1?i.colspan:1))}),n.colGroup=!0}t.initOpts(n)})})},I.prototype.renderToolbar=function(){var e=this,a=e.config,l=['
          ','
          ','
          '].join(""),n=e.layTool.find(".layui-table-tool-temp");if("default"===a.toolbar)n.html(l);else if("string"==typeof a.toolbar){var o=t(a.toolbar).html()||"";o&&n.html(i(o).render(a))}var r={filter:{title:"筛选列",layEvent:"LAYTABLE_COLS",icon:"layui-icon-cols"},exports:{title:"导出",layEvent:"LAYTABLE_EXPORT",icon:"layui-icon-export"},print:{title:"打印",layEvent:"LAYTABLE_PRINT",icon:"layui-icon-print"}},d=[];"object"==typeof a.defaultToolbar&&layui.each(a.defaultToolbar,function(e,t){var i=r[t];i&&d.push('
          ')}),e.layTool.find(".layui-table-tool-self").html(d.join(""))},I.prototype.setParentCol=function(e,t){var i=this,a=i.config,l=i.layHeader.find('th[data-key="'+a.index+"-"+t+'"]'),n=parseInt(l.attr("colspan"))||0;if(l[0]){var o=t.split("-"),r=a.cols[o[0]][o[1]];e?n--:n++,l.attr("colspan",n),l[n<1?"addClass":"removeClass"](f),r.colspan=n,r.hide=n<1;var d=l.data("parentkey");d&&i.setParentCol(e,d)}},I.prototype.setColsPatch=function(){var e=this,t=e.config;layui.each(t.cols,function(t,i){layui.each(i,function(t,i){i.hide&&e.setParentCol(i.hide,i.parentKey)})})},I.prototype.setColsWidth=function(){var e=this,t=e.config,i=0,a=0,l=0,n=0,o=e.setInit("width");e.eachCols(function(e,t){t.hide||i++}),o=o-function(){return"line"===t.skin||"nob"===t.skin?2:i+1}()-e.getScrollWidth(e.layMain[0])-1;var r=function(e){layui.each(t.cols,function(i,r){layui.each(r,function(i,d){var c=0,s=d.minWidth||t.cellMinWidth;return d?void(d.colGroup||d.hide||(e?l&&ln&&a&&(l=(o-n)/a)};r(),r(!0),e.autoColNums=a,e.eachCols(function(i,a){var n=a.minWidth||t.cellMinWidth;a.colGroup||a.hide||(0===a.width?e.getCssRule(t.index+"-"+a.key,function(e){e.style.width=Math.floor(l>=n?l:n)+"px"}):/\d+%$/.test(a.width)&&e.getCssRule(t.index+"-"+a.key,function(e){e.style.width=Math.floor(parseFloat(a.width)/100*o)+"px"}))});var d=e.layMain.width()-e.getScrollWidth(e.layMain[0])-e.layMain.children("table").outerWidth();if(e.autoColNums&&d>=-i&&d<=i){var c=function(t){var i;return t=t||e.layHeader.eq(0).find("thead th:last-child"),i=t.data("field"),!i&&t.prev()[0]?c(t.prev()):t},s=c(),u=s.data("key");e.getCssRule(u,function(t){var i=t.style.width||s.outerWidth();t.style.width=parseFloat(i)+d+"px",e.layMain.height()-e.layMain.prop("clientHeight")>0&&(t.style.width=parseFloat(t.style.width)-1+"px")})}e.loading(!0)},I.prototype.resize=function(){var e=this;e.fullSize(),e.setColsWidth(),e.scrollPatch()},I.prototype.reload=function(e){var i=this;e=e||{},delete i.haveInit,e.data&&e.data.constructor===Array&&delete i.config.data,i.config=t.extend(!0,{},i.config,e),i.render()},I.prototype.errorView=function(e){var i=this,a=i.layMain.find("."+p),l=t('
          '+(e||"Error")+"
          ");a[0]&&(i.layNone.remove(),a.remove()),i.layFixed.addClass(f),i.layMain.find("tbody").html(""),i.layMain.append(i.layNone=l),d.cache[i.key]=[]},I.prototype.page=1,I.prototype.pullData=function(e){var i=this,a=i.config,l=a.request,n=a.response,o=function(){"object"==typeof a.initSort&&i.sort(a.initSort.field,a.initSort.type)};if(i.startTime=(new Date).getTime(),a.url){var r={};r[l.pageName]=e,r[l.limitName]=a.limit;var d=t.extend(r,a.where);a.contentType&&0==a.contentType.indexOf("application/json")&&(d=JSON.stringify(d)),i.loading(),t.ajax({type:a.method||"get",url:a.url,contentType:a.contentType,data:d,dataType:"json",headers:a.headers||{},success:function(t){"function"==typeof a.parseData&&(t=a.parseData(t)||t),t[n.statusName]!=n.statusCode?(i.renderForm(),i.errorView(t[n.msgName]||'返回的数据不符合规范,正确的成功状态码应为:"'+n.statusName+'": '+n.statusCode)):(i.renderData(t,e,t[n.countName]),o(),a.time=(new Date).getTime()-i.startTime+" ms"),i.setColsWidth(),"function"==typeof a.done&&a.done(t,e,t[n.countName])},error:function(e,t){i.errorView("数据接口请求异常:"+t),i.renderForm(),i.setColsWidth()}})}else if(a.data&&a.data.constructor===Array){var c={},s=e*a.limit-a.limit;c[n.dataName]=a.data.concat().splice(s,a.limit),c[n.countName]=a.data.length,i.renderData(c,e,c[n.countName]),o(),i.setColsWidth(),"function"==typeof a.done&&a.done(c,e,c[n.countName])}},I.prototype.eachCols=function(e){var t=this;return d.eachCols(null,e,t.config.cols),t},I.prototype.renderData=function(e,n,o,r){var c=this,s=c.config,y=e[s.response.dataName]||[],h=[],v=[],m=[],g=function(){var e;return!r&&c.sortKey?c.sort(c.sortKey.field,c.sortKey.sort,!0):(layui.each(y,function(a,l){var o=[],y=[],p=[],g=a+s.limit*(n-1)+1;0!==l.length&&(r||(l[d.config.indexName]=a),c.eachCols(function(n,r){var c=r.field||n,h=s.index+"-"+r.key,v=l[c];if(void 0!==v&&null!==v||(v=""),!r.colGroup){var m=['','
          '+function(){var n=t.extend(!0,{LAY_INDEX:g},l),o=d.config.checkName;switch(r.type){case"checkbox":return'";case"radio":return n[o]&&(e=a),'';case"numbers":return g}return r.toolbar?i(t(r.toolbar).html()||"").render(n):u(r,v,n)}(),"
          "].join("");o.push(m),r.fixed&&"right"!==r.fixed&&y.push(m),"right"===r.fixed&&p.push(m)}}),h.push(''+o.join("")+""),v.push(''+y.join("")+""),m.push(''+p.join("")+""))}),c.layBody.scrollTop(0),c.layMain.find("."+p).remove(),c.layMain.find("tbody").html(h.join("")),c.layFixLeft.find("tbody").html(v.join("")),c.layFixRight.find("tbody").html(m.join("")),c.renderForm(),"number"==typeof e&&c.setThisRowChecked(e),c.syncCheckAll(),c.haveInit?c.scrollPatch():setTimeout(function(){c.scrollPatch()},50),c.haveInit=!0,l.close(c.tipsIndex),s.HAS_SET_COLS_PATCH||c.setColsPatch(),void(s.HAS_SET_COLS_PATCH=!0))};return d.cache[c.key]=y,c.layPage[0==o||0===y.length&&1==n?"addClass":"removeClass"](f),r?g():0===y.length?(c.renderForm(),c.errorView(s.text.none)):(c.layFixed.removeClass(f),g(),c.renderTotal(y),void(s.page&&(s.page=t.extend({elem:"layui-table-page"+s.index,count:o,limit:s.limit,limits:s.limits||[10,20,30,40,50,60,70,80,90],groups:3,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(c.page=e.curr,s.limit=e.limit,c.pullData(e.curr))}},s.page),s.page.count=o,a.render(s.page))))},I.prototype.renderTotal=function(e){var t=this,i=t.config,a={};if(i.totalRow){layui.each(e,function(e,i){0!==i.length&&t.eachCols(function(e,t){var l=t.field||e,n=i[l];t.totalRow&&(a[l]=(a[l]||0)+(parseFloat(n)||0))})});var l=[];t.eachCols(function(e,t){var n=t.field||e,o=['','
          '+function(){var e=t.totalRowText||"";return t.totalRow?parseFloat(a[n]).toFixed(2)||e:e}(),"
          "].join("");l.push(o)}),t.layTotal.find("tbody").html(""+l.join("")+"")}},I.prototype.getColElem=function(e,t){var i=this,a=i.config;return e.eq(0).find(".laytable-cell-"+(a.index+"-"+t)+":eq(0)")},I.prototype.renderForm=function(e){n.render(e,"LAY-table-"+this.index)},I.prototype.setThisRowChecked=function(e){var t=this,i=(t.config,"layui-table-click"),a=t.layBody.find('tr[data-index="'+e+'"]');a.addClass(i).siblings("tr").removeClass(i)},I.prototype.sort=function(e,i,a,l){var n,r,c=this,s={},u=c.config,h=u.elem.attr("lay-filter"),f=d.cache[c.key];"string"==typeof e&&c.layHeader.find("th").each(function(i,a){var l=t(this),o=l.data("field");if(o===e)return e=l,n=o,!1});try{var n=n||e.data("field"),p=e.data("key");if(c.sortKey&&!a&&n===c.sortKey.field&&i===c.sortKey.sort)return;var v=c.layHeader.find("th .laytable-cell-"+p).find(S);c.layHeader.find("th").find(S).removeAttr("lay-sort"),v.attr("lay-sort",i||null),c.layFixed.find("th")}catch(m){return o.error("Table modules: Did not match to field")}c.sortKey={field:n,sort:i},u.autoSort&&("asc"===i?r=layui.sort(f,n):"desc"===i?r=layui.sort(f,n,!0):(r=layui.sort(f,d.config.indexName),delete c.sortKey)),s[u.response.dataName]=r||f,c.renderData(s,c.page,c.count,!0),l&&layui.event.call(e,y,"sort("+h+")",{field:n,type:i})},I.prototype.loading=function(e){var i=this,a=i.config;a.loading&&(e?(i.layInit&&i.layInit.remove(),delete i.layInit,i.layBox.find(b).remove()):(i.layInit=t(['
          ','',"
          "].join("")),i.layBox.append(i.layInit)))},I.prototype.setCheckData=function(e,t){var i=this,a=i.config,l=d.cache[i.key];l[e]&&l[e].constructor!==Array&&(l[e][a.checkName]=t)},I.prototype.syncCheckAll=function(){var e=this,t=e.config,i=e.layHeader.find('input[name="layTableCheckbox"]'),a=function(i){return e.eachCols(function(e,a){"checkbox"===a.type&&(a[t.checkName]=i)}),i};i[0]&&(d.checkStatus(e.key).isAll?(i[0].checked||(i.prop("checked",!0),e.renderForm("checkbox")),a(!0)):(i[0].checked&&(i.prop("checked",!1),e.renderForm("checkbox")),a(!1)))},I.prototype.getCssRule=function(e,t){var i=this,a=i.elem.find("style")[0],l=a.sheet||a.styleSheet||{},n=l.cssRules||l.rules;layui.each(n,function(i,a){if(a.selectorText===".laytable-cell-"+e)return t(a),!0})},I.prototype.fullSize=function(){var e,t=this,i=t.config,a=i.height;t.fullHeightGap&&(a=R.height()-t.fullHeightGap,a<135&&(a=135),t.elem.css("height",a)),a&&(e=parseFloat(a)-(t.layHeader.outerHeight()||38),i.toolbar&&(e-=t.layTool.outerHeight()||50),i.totalRow&&(e-=t.layTotal.outerHeight()||40),i.page&&(e-=t.layPage.outerHeight()||41),t.layMain.css("height",e-2))},I.prototype.getScrollWidth=function(e){var t=0;return e?t=e.offsetWidth-e.clientWidth:(e=document.createElement("div"),e.style.width="100px",e.style.height="100px",e.style.overflowY="scroll",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),t},I.prototype.scrollPatch=function(){var e=this,i=e.layMain.children("table"),a=e.layMain.width()-e.layMain.prop("clientWidth"),l=e.layMain.height()-e.layMain.prop("clientHeight"),n=(e.getScrollWidth(e.layMain[0]),i.outerWidth()-e.layMain.width()),o=function(e){if(a&&l){if(e=e.eq(0),!e.find(".layui-table-patch")[0]){var i=t('
          ');i.find("div").css({width:a}),e.find("tr").append(i)}}else e.find(".layui-table-patch").remove()};o(e.layHeader),o(e.layTotal);var r=e.layMain.height(),d=r-l;e.layFixed.find(k).css("height",i.height()>=d?d:"auto"),e.layFixRight[n>0?"removeClass":"addClass"](f),e.layFixRight.css("right",a-1)},I.prototype.events=function(){var e,a=this,o=a.config,c=t("body"),s={},u=a.layHeader.find("th"),h=".layui-table-cell",p=o.elem.attr("lay-filter");a.layTool.on("click","*[lay-event]",function(e){var i=t(this),c=i.attr("lay-event"),s=function(e){var l=t(e.list),n=t('
            ');n.html(l),o.height&&n.css("max-height",o.height-(a.layTool.outerHeight()||50)),i.find(".layui-table-tool-panel")[0]||i.append(n),a.renderForm(),n.on("click",function(e){layui.stope(e)}),e.done&&e.done(n,l)};switch(layui.stope(e),F.trigger("table.tool.panel.remove"),l.close(a.tipsIndex),c){case"LAYTABLE_COLS":s({list:function(){var e=[];return a.eachCols(function(t,i){i.field&&"normal"==i.type&&e.push('
          • ')}),e.join("")}(),done:function(){n.on("checkbox(LAY_TABLE_TOOL_COLS)",function(e){var i=t(e.elem),l=this.checked,n=i.data("key"),r=i.data("parentkey");layui.each(o.cols,function(e,t){layui.each(t,function(t,i){if(e+"-"+t===n){var d=i.hide;i.hide=!l,a.elem.find('*[data-key="'+o.index+"-"+n+'"]')[l?"removeClass":"addClass"](f),d!=i.hide&&a.setParentCol(!l,r),a.resize()}})})})}});break;case"LAYTABLE_EXPORT":r.ie?l.tips("导出功能不支持 IE,请用 Chrome 等高级浏览器导出",this,{tips:3}):s({list:function(){return['
          • 导出到 Csv 文件
          • ','
          • 导出到 Excel 文件
          • '].join("")}(),done:function(e,i){i.on("click",function(){var e=t(this).data("type");d.exportFile(o.id,null,e)})}});break;case"LAYTABLE_PRINT":var u=window.open("打印窗口","_blank"),h=[""].join(""),v=t(a.layHeader.html());v.append(a.layMain.find("table").html()),v.append(a.layTotal.find("table").html()),v.find("th.layui-table-patch").remove(),v.find(".layui-table-col-special").remove(),u.document.write(h+v.prop("outerHTML")),u.document.close(),u.print(),u.close()}layui.event.call(this,y,"toolbar("+p+")",t.extend({event:c,config:o},{}))}),u.on("mousemove",function(e){var i=t(this),a=i.offset().left,l=e.clientX-a;i.data("unresize")||s.resizeStart||(s.allowResize=i.width()-l<=10,c.css("cursor",s.allowResize?"col-resize":""))}).on("mouseleave",function(){t(this);s.resizeStart||c.css("cursor","")}).on("mousedown",function(e){var i=t(this);if(s.allowResize){var l=i.data("key");e.preventDefault(),s.resizeStart=!0,s.offset=[e.clientX,e.clientY],a.getCssRule(l,function(e){var t=e.style.width||i.outerWidth();s.rule=e,s.ruleWidth=parseFloat(t),s.minWidth=i.data("minwidth")||o.cellMinWidth})}}),F.on("mousemove",function(t){if(s.resizeStart){if(t.preventDefault(),s.rule){var i=s.ruleWidth+t.clientX-s.offset[0];i');return n[0].value=i.data("content")||l.text(),i.find("."+W)[0]||i.append(n),n.focus(),void layui.stope(e)}}).on("mouseenter","td",function(){b.call(this)}).on("mouseleave","td",function(){b.call(this,"hide")});var g="layui-table-grid-down",b=function(e){var i=t(this),a=i.children(h);if(!i.data("off"))if(e)i.find(".layui-table-grid-down").remove();else if(a.prop("scrollWidth")>a.outerWidth()){if(a.find("."+g)[0])return;i.append('
            ')}};a.layBody.on("click","."+g,function(e){var i=t(this),n=i.parent(),d=n.children(h);a.tipsIndex=l.tips(['
            ',d.html(),"
            ",''].join(""),d[0],{tips:[3,""],time:-1,anim:-1,maxWidth:r.ios||r.android?300:a.elem.width()/2,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){l.close(t)})}}),layui.stope(e)}),a.layBody.on("click","*[lay-event]",function(){var e=t(this),i=e.parents("tr").eq(0).data("index");layui.event.call(this,y,"tool("+p+")",v.call(this,{event:e.attr("lay-event")})),a.setThisRowChecked(i)}),a.layMain.on("scroll",function(){var e=t(this),i=e.scrollLeft(),n=e.scrollTop();a.layHeader.scrollLeft(i),a.layTotal.scrollLeft(i),a.layFixed.find(k).scrollTop(n),l.close(a.tipsIndex)}),F.on("click",function(){F.trigger("table.remove.tool.panel")}),F.on("table.remove.tool.panel",function(){t(".layui-table-tool-panel").remove()}),R.on("resize",function(){a.resize()})},d.init=function(e,i){i=i||{};var a=this,l=t(e?'table[lay-filter="'+e+'"]':h+"[lay-data]"),n="Table element property lay-data configuration item has a syntax error: ";return l.each(function(){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){o.error(n+l)}var c=[],s=t.extend({elem:this,cols:[],data:[],skin:a.attr("lay-skin"),size:a.attr("lay-size"),even:"string"==typeof a.attr("lay-even")},d.config,i,l);e&&a.hide(),a.find("thead>tr").each(function(e){s.cols[e]=[],t(this).children().each(function(i){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){return o.error(n+l)}var d=t.extend({title:a.text(),colspan:a.attr("colspan")||0,rowspan:a.attr("rowspan")||0},l);d.colspan<2&&c.push(d),s.cols[e].push(d)})}),a.find("tbody>tr").each(function(e){var i=t(this),a={};i.children("td").each(function(e,i){var l=t(this),n=l.data("field");if(n)return a[n]=l.html()}),layui.each(c,function(e,t){var l=i.children("td").eq(e);a[t.field]=l.html()}),s.data[e]=a}),d.render(s)}),a},c.that={},c.config={},d.eachCols=function(e,i,a){var l=c.config[e]||{},n=[],o=0;a=t.extend(!0,[],a||l.cols),layui.each(a,function(e,t){layui.each(t,function(t,i){if(i.colGroup){var l=0;o++,i.CHILD_COLS=[],layui.each(a[e+1],function(e,t){t.PARENT_COL_INDEX||l>1&&l==i.colspan||(t.PARENT_COL_INDEX=o,i.CHILD_COLS.push(t),l+=parseInt(t.colspan>1?t.colspan:1))})}i.PARENT_COL_INDEX||n.push(i)})});var r=function(e){layui.each(e||n,function(e,t){return t.CHILD_COLS?r(t.CHILD_COLS):void("function"==typeof i&&i(e,t))})};r()},d.checkStatus=function(e){var t=0,i=0,a=[],l=d.cache[e]||[];return layui.each(l,function(e,l){return l.constructor===Array?void i++:void(l[d.config.checkName]&&(t++,a.push(d.clearCacheKey(l))))}),{data:a,isAll:!!l.length&&t===l.length-i}},d.exportFile=function(e,t,i){t=t||d.clearCacheKey(d.cache[e]),i=i||"csv";var a=c.config[e]||{},l={csv:"text/csv",xls:"application/vnd.ms-excel"}[i],n=document.createElement("a");return r.ie?o.error("IE_NOT_SUPPORT_EXPORTS"):(n.href="data:"+l+";charset=utf-8,\ufeff"+encodeURIComponent(function(){var i=[],a=[];return layui.each(t,function(t,l){var n=[];"object"==typeof e?(layui.each(e,function(e,a){0==t&&i.push(a||"")}),layui.each(d.clearCacheKey(l),function(e,t){n.push('"'+(t||"")+'"')})):d.eachCols(e,function(e,a){a.field&&"normal"==a.type&&!a.hide&&(0==t&&i.push(a.title||""),n.push('"'+u(a,l[a.field],l,"text")+'"'))}),a.push(n.join(","))}),i.join(",")+"\r\n"+a.join("\r\n")}()),n.download=(a.title||"table_"+(a.index||""))+"."+i,document.body.appendChild(n),n.click(),void document.body.removeChild(n))},d.resize=function(e){if(e){var t=s(e);if(!t)return;c.that[e].resize()}else layui.each(c.that,function(){this.resize()})},d.reload=function(e,t){var i=s(e);if(i){var a=c.that[e];return a.reload(t),c.call(a)}},d.render=function(e){var t=new I(e);return c.call(t)},d.clearCacheKey=function(e){return e=t.extend({},e),delete e[d.config.checkName],delete e[d.config.indexName],e},d.init(),e(y,d)});layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
              ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
            "].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a",u=1;u<=i.length;u++){var r='
          • ";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'
          • ":n+=r}n+=""+(i.text?''+i.value+"星":"")+"";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)});layui.define("jquery",function(t){"use strict";var e=layui.$,i={fixbar:function(t){var i,n,a="layui-fixbar",o="layui-fixbar-top",r=e(document),l=e("body");t=e.extend({showHeight:200},t),t.bar1=t.bar1===!0?"":t.bar1,t.bar2=t.bar2===!0?"":t.bar2,t.bgcolor=t.bgcolor?"background-color:"+t.bgcolor:"";var c=[t.bar1,t.bar2,""],g=e(['
              ',t.bar1?'
            • '+c[0]+"
            • ":"",t.bar2?'
            • '+c[1]+"
            • ":"",'
            • '+c[2]+"
            • ","
            "].join("")),s=g.find("."+o),u=function(){var e=r.scrollTop();e>=t.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};e("."+a)[0]||("object"==typeof t.css&&g.css(t.css),l.append(g),u(),g.find("li").on("click",function(){var i=e(this),n=i.attr("lay-type");"top"===n&&e("html,body").animate({scrollTop:0},200),t.click&&t.click.call(this,n)}),r.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){u()},100)}))},countdown:function(t,e,i){var n=this,a="function"==typeof e,o=new Date(t).getTime(),r=new Date(!e||a?(new Date).getTime():e).getTime(),l=o-r,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=e);var g=setTimeout(function(){n.countdown(t,r+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],e,g),l<=0&&clearTimeout(g),g},timeAgo:function(t,e){var i=this,n=[[],[]],a=(new Date).getTime()-new Date(t).getTime();return a>6912e5?(a=new Date(t),n[0][0]=i.digit(a.getFullYear(),4),n[0][1]=i.digit(a.getMonth()+1),n[0][2]=i.digit(a.getDate()),e||(n[1][0]=i.digit(a.getHours()),n[1][1]=i.digit(a.getMinutes()),n[1][2]=i.digit(a.getSeconds())),n[0].join("-")+" "+n[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(t,e){var i="";t=String(t),e=e||2;for(var n=t.length;n/g,">").replace(/'/g,"'").replace(/"/g,""")},event:function(t,n,a){n=i.event[t]=e.extend(!0,i.event[t],n)||{},e("body").on(a||"click","*["+t+"]",function(){var i=e(this),a=i.attr(t);n[a]&&n[a].call(this,i)})}};!function(t,e,i){"$:nomunge";function n(){a=e[l](function(){o.each(function(){var e=t(this),i=e.width(),n=e.height(),a=t.data(this,g);(i!==a.w||n!==a.h)&&e.trigger(c,[a.w=i,a.h=n])}),n()},r[s])}var a,o=t([]),r=t.resize=t.extend(t.resize,{}),l="setTimeout",c="resize",g=c+"-special-event",s="delay",u="throttleWindow";r[s]=250,r[u]=!0,t.event.special[c]={setup:function(){if(!r[u]&&this[l])return!1;var e=t(this);o=o.add(e),t.data(this,g,{w:e.width(),h:e.height()}),1===o.length&&n()},teardown:function(){if(!r[u]&&this[l])return!1;var e=t(this);o=o.not(e),e.removeData(g),o.length||clearTimeout(a)},add:function(e){function n(e,n,o){var r=t(this),l=t.data(this,g)||{};l.w=n!==i?n:r.width(),l.h=o!==i?o:r.height(),a.apply(this,arguments)}if(!r[u]&&this[l])return!1;var a;return t.isFunction(e)?(a=e,n):(a=e.handler,void(e.handler=n))}}}(e,window),t("util",i)});layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)});layui.define(["layer","form"],function(t){"use strict";var e=layui.$,i=layui.layer,a=layui.form,l=(layui.hint(),layui.device()),n="layedit",o="layui-show",r="layui-disabled",c=function(){var t=this;t.index=0,t.config={tool:["strong","italic","underline","del","|","left","center","right","|","link","unlink","face","image"],hideTool:[],height:280}};c.prototype.set=function(t){var i=this;return e.extend(!0,i.config,t),i},c.prototype.on=function(t,e){return layui.onevent(n,t,e)},c.prototype.build=function(t,i){i=i||{};var a=this,n=a.config,r="layui-layedit",c=e("string"==typeof t?"#"+t:t),u="LAY_layedit_"+ ++a.index,d=c.next("."+r),y=e.extend({},n,i),f=function(){var t=[],e={};return layui.each(y.hideTool,function(t,i){e[i]=!0}),layui.each(y.tool,function(i,a){C[a]&&!e[a]&&t.push(C[a])}),t.join("")}(),m=e(['
            ','
            '+f+"
            ",'
            ','',"
            ","
            "].join(""));return l.ie&&l.ie<8?c.removeClass("layui-hide").addClass(o):(d[0]&&d.remove(),s.call(a,m,c[0],y),c.addClass("layui-hide").after(m),a.index)},c.prototype.getContent=function(t){var e=u(t);if(e[0])return d(e[0].document.body.innerHTML)},c.prototype.getText=function(t){var i=u(t);if(i[0])return e(i[0].document.body).text()},c.prototype.setContent=function(t,i,a){var l=u(t);l[0]&&(a?e(l[0].document.body).append(i):e(l[0].document.body).html(i),layedit.sync(t))},c.prototype.sync=function(t){var i=u(t);if(i[0]){var a=e("#"+i[1].attr("textarea"));a.val(d(i[0].document.body.innerHTML))}},c.prototype.getSelection=function(t){var e=u(t);if(e[0]){var i=m(e[0].document);return document.selection?i.text:i.toString()}};var s=function(t,i,a){var l=this,n=t.find("iframe");n.css({height:a.height}).on("load",function(){var o=n.contents(),r=n.prop("contentWindow"),c=o.find("head"),s=e([""].join("")),u=o.find("body");c.append(s),u.attr("contenteditable","true").css({"min-height":a.height}).html(i.value||""),y.apply(l,[r,n,i,a]),g.call(l,r,t,a)})},u=function(t){var i=e("#LAY_layedit_"+t),a=i.prop("contentWindow");return[a,i]},d=function(t){return 8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),t},y=function(t,a,n,o){var r=t.document,c=e(r.body);c.on("keydown",function(t){var e=t.keyCode;if(13===e){var a=m(r),l=p(a),n=l.parentNode;if("pre"===n.tagName.toLowerCase()){if(t.shiftKey)return;return i.msg("请暂时用shift+enter"),!1}r.execCommand("formatBlock",!1,"

            ")}}),e(n).parents("form").on("submit",function(){var t=c.html();8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),n.value=t}),c.on("paste",function(e){r.execCommand("formatBlock",!1,"

            "),setTimeout(function(){f.call(t,c),n.value=c.html()},100)})},f=function(t){var i=this;i.document;t.find("*[style]").each(function(){var t=this.style.textAlign;this.removeAttribute("style"),e(this).css({"text-align":t||""})}),t.find("table").addClass("layui-table"),t.find("script,link").remove()},m=function(t){return t.selection?t.selection.createRange():t.getSelection().getRangeAt(0)},p=function(t){return t.endContainer||t.parentElement().childNodes[0]},v=function(t,i,a){var l=this.document,n=document.createElement(t);for(var o in i)n.setAttribute(o,i[o]);if(n.removeAttribute("text"),l.selection){var r=a.text||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.pasteHTML(e(n).prop("outerHTML")),a.select()}else{var r=a.toString()||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.deleteContents(),a.insertNode(n)}},h=function(t,i){var a=this.document,l="layedit-tool-active",n=p(m(a)),o=function(e){return t.find(".layedit-tool-"+e)};i&&i[i.hasClass(l)?"removeClass":"addClass"](l),t.find(">i").removeClass(l),o("unlink").addClass(r),e(n).parents().each(function(){var t=this.tagName.toLowerCase(),e=this.style.textAlign;"b"!==t&&"strong"!==t||o("b").addClass(l),"i"!==t&&"em"!==t||o("i").addClass(l),"u"===t&&o("u").addClass(l),"strike"===t&&o("d").addClass(l),"p"===t&&("center"===e?o("center").addClass(l):"right"===e?o("right").addClass(l):o("left").addClass(l)),"a"===t&&(o("link").addClass(l),o("unlink").removeClass(r))})},g=function(t,a,l){var n=t.document,o=e(n.body),c={link:function(i){var a=p(i),l=e(a).parent();b.call(o,{href:l.attr("href"),target:l.attr("target")},function(e){var a=l[0];"A"===a.tagName?a.href=e.url:v.call(t,"a",{target:e.target,href:e.url,text:e.url},i)})},unlink:function(t){n.execCommand("unlink")},face:function(e){x.call(this,function(i){v.call(t,"img",{src:i.src,alt:i.alt},e)})},image:function(a){var n=this;layui.use("upload",function(o){var r=l.uploadImage||{};o.render({url:r.url,method:r.type,elem:e(n).find("input")[0],done:function(e){0==e.code?(e.data=e.data||{},v.call(t,"img",{src:e.data.src,alt:e.data.title},a)):i.msg(e.msg||"上传失败")}})})},code:function(e){k.call(o,function(i){v.call(t,"pre",{text:i.code,"lay-lang":i.lang},e)})},help:function(){i.open({type:2,title:"帮助",area:["600px","380px"],shadeClose:!0,shade:.1,skin:"layui-layer-msg",content:["http://www.layui.com/about/layedit/help.html","no"]})}},s=a.find(".layui-layedit-tool"),u=function(){var i=e(this),a=i.attr("layedit-event"),l=i.attr("lay-command");if(!i.hasClass(r)){o.focus();var u=m(n);u.commonAncestorContainer;l?(n.execCommand(l),/justifyLeft|justifyCenter|justifyRight/.test(l)&&n.execCommand("formatBlock",!1,"

            "),setTimeout(function(){o.focus()},10)):c[a]&&c[a].call(this,u),h.call(t,s,i)}},d=/image/;s.find(">i").on("mousedown",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)||u.call(this)}).on("click",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)&&u.call(this)}),o.on("click",function(){h.call(t,s),i.close(x.index)})},b=function(t,e){var l=this,n=i.open({type:1,id:"LAY_layedit_link",area:"350px",shade:.05,shadeClose:!0,moveType:1,title:"超链接",skin:"layui-layer-msg",content:['

              ','
            • ','','
              ','',"
              ","
            • ",'
            • ','','
              ','",'","
              ","
            • ",'
            • ','','',"
            • ","
            "].join(""),success:function(t,n){var o="submit(layedit-link-yes)";a.render("radio"),t.find(".layui-btn-primary").on("click",function(){i.close(n),l.focus()}),a.on(o,function(t){i.close(b.index),e&&e(t.field)})}});b.index=n},x=function(t){var a=function(){var t=["[微笑]","[嘻嘻]","[哈哈]","[可爱]","[可怜]","[挖鼻]","[吃惊]","[害羞]","[挤眼]","[闭嘴]","[鄙视]","[爱你]","[泪]","[偷笑]","[亲亲]","[生病]","[太开心]","[白眼]","[右哼哼]","[左哼哼]","[嘘]","[衰]","[委屈]","[吐]","[哈欠]","[抱抱]","[怒]","[疑问]","[馋嘴]","[拜拜]","[思考]","[汗]","[困]","[睡]","[钱]","[失望]","[酷]","[色]","[哼]","[鼓掌]","[晕]","[悲伤]","[抓狂]","[黑线]","[阴险]","[怒骂]","[互粉]","[心]","[伤心]","[猪头]","[熊猫]","[兔子]","[ok]","[耶]","[good]","[NO]","[赞]","[来]","[弱]","[草泥马]","[神马]","[囧]","[浮云]","[给力]","[围观]","[威武]","[奥特曼]","[礼物]","[钟]","[话筒]","[蜡烛]","[蛋糕]"],e={};return layui.each(t,function(t,i){e[i]=layui.cache.dir+"images/face/"+t+".gif"}),e}();return x.hide=x.hide||function(t){"face"!==e(t.target).attr("layedit-event")&&i.close(x.index)},x.index=i.tips(function(){var t=[];return layui.each(a,function(e,i){t.push('
          • '+e+'
          • ')}),'
              '+t.join("")+"
            "}(),this,{tips:1,time:0,skin:"layui-box layui-util-face",maxWidth:500,success:function(l,n){l.css({marginTop:-4,marginLeft:-10}).find(".layui-clear>li").on("click",function(){t&&t({src:a[this.title],alt:this.title}),i.close(n)}),e(document).off("click",x.hide).on("click",x.hide)}})},k=function(t){var e=this,l=i.open({type:1,id:"LAY_layedit_code",area:"550px",shade:.05,shadeClose:!0,moveType:1,title:"插入代码",skin:"layui-layer-msg",content:['
              ','
            • ','','
              ','","
              ","
            • ",'
            • ','','
              ','',"
              ","
            • ",'
            • ','','',"
            • ","
            "].join(""),success:function(l,n){var o="submit(layedit-code-yes)";a.render("select"),l.find(".layui-btn-primary").on("click",function(){i.close(n),e.focus()}),a.on(o,function(e){i.close(k.index),t&&t(e.field)})}});k.index=l},C={html:'',strong:'',italic:'',underline:'',del:'',"|":'',left:'',center:'',right:'',link:'',unlink:'',face:'',image:'',code:'',help:''},w=new c;t(n,w)});layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
            1. '+o.replace(/[\r\t\n]+/g,"
            2. ")+"
            "),c.find(">.layui-code-h3")[0]||c.prepend('

            '+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

            ");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/layui/layui.js b/Yangcai365_web/manage/zinc/layui/layui.js new file mode 100644 index 0000000..b6c4c49 --- /dev/null +++ b/Yangcai365_web/manage/zinc/layui/layui.js @@ -0,0 +1,2 @@ +/** layui-v2.5.4 MIT License By https://www.layui.com */ + ;!function(e){"use strict";var t=document,o={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.5.4"},r=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,o=t.scripts,n=o.length-1,r=n;r>0;r--)if("interactive"===o[r].readyState){e=o[r].src;break}return e||o[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),i=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},a="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",transfer:"modules/transfer",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",colorpicker:"modules/colorpicker",slider:"modules/slider",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};n.prototype.cache=o,n.prototype.define=function(e,t){var n=this,r="function"==typeof e,i=function(){var e=function(e,t){layui[e]=t,o.status[e]=!0};return"function"==typeof t&&t(function(n,r){e(n,r),o.callback[n]=function(){t(e)}}),this};return r&&(t=e,e=[]),!layui["layui.all"]&&layui["layui.mobile"]?i.call(n):(n.use(e,i),n)},n.prototype.use=function(e,n,l){function s(e,t){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||n.test((e.currentTarget||e.srcElement).readyState))&&(o.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void(o.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),n,l):"function"==typeof n&&n.apply(layui,l)}var y=this,p=o.dir=o.dir?o.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,o){"jquery"===o&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],o.host=o.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(o.modules[f])!function g(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void("string"==typeof o.modules[f]&&o.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":/^\{\/\}/.test(y.modules[f])?"":o.base||"")+(y.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=o.version===!0?o.v||(new Date).getTime():o.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||a?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),o.modules[f]=h}return y},n.prototype.getStyle=function(t,o){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](o)},n.prototype.link=function(e,n,r){var a=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof n&&(r=n);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(o.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof n?a:(function p(){return++y>1e3*o.timeout/100?i(e+" timeout"):void(1989===parseInt(a.getStyle(t.getElementById(c),"width"))?function(){n()}():setTimeout(p,100))}(),a)},o.callback={},n.prototype.factory=function(e){if(layui[e])return"function"==typeof o.callback[e]?o.callback[e]:null},n.prototype.addcss=function(e,t,n){return layui.link(o.dir+"css/"+e,t,n)},n.prototype.img=function(e,t,o){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,"function"==typeof t&&t(n)},void(n.onerror=function(e){n.onerror=null,"function"==typeof o&&o(e)}))},n.prototype.config=function(e){e=e||{};for(var t in e)o[t]=e[t];return this},n.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),n.prototype.extend=function(e){var t=this;e=e||{};for(var o in e)t[o]||t.modules[o]?i("模块名 "+o+" 已被占用"):t.modules[o]=e[o];return t},n.prototype.router=function(e){var t=this,e=e||location.hash,o={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),o.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),o.search[t[0]]=t[1]}():o.path.push(t)}),o):o},n.prototype.data=function(t,o,n){if(t=t||"layui",n=n||localStorage,e.JSON&&e.JSON.parse){if(null===o)return delete n[t];o="object"==typeof o?o:{key:o};try{var r=JSON.parse(n[t])}catch(i){var r={}}return"value"in o&&(r[o.key]=o.value),o.remove&&delete r[o.key],n[t]=JSON.stringify(r),o.key?r[o.key]:r}},n.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},n.prototype.device=function(t){var o=navigator.userAgent.toLowerCase(),n=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(o.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(o)?"windows":/linux/.test(o)?"linux":/iphone|ipod|ipad|ios/.test(o)?"ios":/mac/.test(o)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((o.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:n("micromessenger")};return t&&!r[t]&&(r[t]=n(t)),r.android=/android/.test(o),r.ios="ios"===r.os,r},n.prototype.hint=function(){return{error:i}},n.prototype.each=function(e,t){var o,n=this;if("function"!=typeof t)return n;if(e=e||[],e.constructor===Object){for(o in e)if(t.call(e[o],o,e[o]))break}else for(o=0;oi?1:rli{display:inline-block;padding-right:5px;padding-left:5px}.mui-clearfix:after,.mui-clearfix:before{display:table;content:' '}.mui-clearfix:after{clear:both}.mui-bg-primary{background-color:#007aff}.mui-bg-positive{background-color:#4cd964}.mui-bg-negative{background-color:#dd524d}.mui-error{margin:88px 35px;padding:10px;border-radius:6px;background-color:#bbb}.mui-subtitle{font-size:15px}h1,h2,h3,h4,h5,h6{line-height:1;margin-top:5px;margin-bottom:5px}.mui-h1,h1{font-size:36px}.mui-h2,h2{font-size:30px}.mui-h3,h3{font-size:24px}.mui-h4,h4{font-size:18px}.mui-h5,h5{font-size:14px;font-weight:400;color:#8f8f94}.mui-h6,h6{font-size:12px;font-weight:400;color:#8f8f94}p{font-size:14px;margin-top:0;margin-bottom:10px;color:#8f8f94}.mui-row:after,.mui-row:before{display:table;content:' '}.mui-row:after{clear:both}.mui-col-sm-1,.mui-col-sm-10,.mui-col-sm-11,.mui-col-sm-12,.mui-col-sm-2,.mui-col-sm-3,.mui-col-sm-4,.mui-col-sm-5,.mui-col-sm-6,.mui-col-sm-7,.mui-col-sm-8,.mui-col-sm-9,.mui-col-xs-1,.mui-col-xs-10,.mui-col-xs-11,.mui-col-xs-12,.mui-col-xs-2,.mui-col-xs-3,.mui-col-xs-4,.mui-col-xs-5,.mui-col-xs-6,.mui-col-xs-7,.mui-col-xs-8,.mui-col-xs-9{position:relative;min-height:1px}.mui-row>[class*=mui-col-]{float:left}.mui-col-xs-12{width:100%}.mui-col-xs-11{width:91.66666667%}.mui-col-xs-10{width:83.33333333%}.mui-col-xs-9{width:75%}.mui-col-xs-8{width:66.66666667%}.mui-col-xs-7{width:58.33333333%}.mui-col-xs-6{width:50%}.mui-col-xs-5{width:41.66666667%}.mui-col-xs-4{width:33.33333333%}.mui-col-xs-3{width:25%}.mui-col-xs-2{width:16.66666667%}.mui-col-xs-1{width:8.33333333%}@media (min-width:400px){.mui-col-sm-12{width:100%}.mui-col-sm-11{width:91.66666667%}.mui-col-sm-10{width:83.33333333%}.mui-col-sm-9{width:75%}.mui-col-sm-8{width:66.66666667%}.mui-col-sm-7{width:58.33333333%}.mui-col-sm-6{width:50%}.mui-col-sm-5{width:41.66666667%}.mui-col-sm-4{width:33.33333333%}.mui-col-sm-3{width:25%}.mui-col-sm-2{width:16.66666667%}.mui-col-sm-1{width:8.33333333%}}.mui-scroll-wrapper{position:absolute;z-index:2;top:0;bottom:0;left:0;overflow:hidden;width:100%}.mui-scroll{position:absolute;z-index:1;width:100%}.mui-scrollbar{position:absolute;z-index:9998;overflow:hidden;-webkit-transition:500ms;transition:500ms;transform:translateZ(0px);pointer-events:none;opacity:0}.mui-scrollbar-vertical{top:0;right:1px;bottom:2px;width:4px}.mui-scrollbar-vertical .mui-scrollbar-indicator{width:100%}.mui-scrollbar-horizontal{right:2px;bottom:0;left:2px;height:4px}.mui-scrollbar-horizontal .mui-scrollbar-indicator{height:100%}.mui-scrollbar-indicator{position:absolute;display:block;box-sizing:border-box;-webkit-transition:.01s cubic-bezier(.1,.57,.1,1);transition:.01s cubic-bezier(.1,.57,.1,1);transform:translate(0px,0) translateZ(0px);border:1px solid rgba(255,255,255,.80196);border-radius:2px;background:rgba(0,0,0,.39804)}.mui-plus-pullrefresh .mui-fullscreen .mui-scroll-wrapper .mui-scroll-wrapper,.mui-plus-pullrefresh .mui-fullscreen .mui-slider-group .mui-scroll-wrapper{position:absolute;top:0;bottom:0;left:0;overflow:hidden;width:100%}.mui-plus-pullrefresh .mui-fullscreen .mui-scroll-wrapper .mui-scroll,.mui-plus-pullrefresh .mui-fullscreen .mui-slider-group .mui-scroll{position:absolute;width:100%}.mui-plus-pullrefresh .mui-scroll-wrapper,.mui-plus-pullrefresh .mui-slider-group{position:static;top:auto;bottom:auto;left:auto;overflow:auto;width:auto}.mui-plus-pullrefresh .mui-slider-group{overflow:visible}.mui-plus-pullrefresh .mui-scroll{position:static;width:auto}.mui-off-canvas-wrap .mui-bar{position:absolute!important;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-box-shadow:none;box-shadow:none}.mui-off-canvas-wrap{position:relative;z-index:1;overflow:hidden;width:100%;height:100%}.mui-off-canvas-wrap .mui-inner-wrap{position:relative;z-index:1;width:100%;height:100%}.mui-off-canvas-wrap .mui-inner-wrap.mui-transitioning{-webkit-transition:-webkit-transform 350ms;transition:transform 350ms cubic-bezier(.165,.84,.44,1)}.mui-off-canvas-wrap .mui-inner-wrap .mui-off-canvas-left{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.mui-off-canvas-wrap .mui-inner-wrap .mui-off-canvas-right{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.mui-off-canvas-wrap.mui-active{overflow:hidden;height:100%}.mui-off-canvas-wrap.mui-active .mui-off-canvas-backdrop{position:absolute;z-index:998;top:0;right:0;bottom:0;left:0;display:block;transition:background 350ms cubic-bezier(.165,.84,.44,1);background:rgba(0,0,0,.4);box-shadow:-4px 0 4px rgba(0,0,0,.5),4px 0 4px rgba(0,0,0,.5);-webkit-tap-highlight-color:transparent}.mui-off-canvas-wrap.mui-slide-in .mui-off-canvas-right{z-index:10000!important;-webkit-transform:translate3d(100%,0,0)}.mui-off-canvas-wrap.mui-slide-in .mui-off-canvas-left{z-index:10000!important;-webkit-transform:translate3d(-100%,0,0)}.mui-off-canvas-left,.mui-off-canvas-right{position:absolute;z-index:-1;top:0;bottom:0;visibility:hidden;box-sizing:content-box;width:70%;min-height:100%;background:#333;-webkit-overflow-scrolling:touch}.mui-off-canvas-left.mui-transitioning,.mui-off-canvas-right.mui-transitioning{-webkit-transition:-webkit-transform 350ms cubic-bezier(.165,.84,.44,1);transition:transform 350ms cubic-bezier(.165,.84,.44,1)}.mui-off-canvas-left{left:0}.mui-off-canvas-right{right:0}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable{background-color:#333}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable>.mui-off-canvas-left,.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable>.mui-off-canvas-right{width:80%;-webkit-transform:scale(.8);transform:scale(.8);opacity:.1}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable>.mui-off-canvas-left.mui-transitioning,.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable>.mui-off-canvas-right.mui-transitioning{-webkit-transition:-webkit-transform 350ms cubic-bezier(.165,.84,.44,1),opacity 350ms cubic-bezier(.165,.84,.44,1);transition:transform 350ms cubic-bezier(.165,.84,.44,1),opacity 350ms cubic-bezier(.165,.84,.44,1)}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable>.mui-off-canvas-left{-webkit-transform-origin:-100%;transform-origin:-100%}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable>.mui-off-canvas-right{-webkit-transform-origin:200%;transform-origin:200%}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable.mui-active>.mui-inner-wrap{-webkit-transform:scale(.8);transform:scale(.8)}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable.mui-active>.mui-off-canvas-left,.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable.mui-active>.mui-off-canvas-right{-webkit-transform:scale(1);transform:scale(1);opacity:1}.mui-loading .mui-spinner{display:block;margin:0 auto}.mui-spinner{display:inline-block;width:24px;height:24px;-webkit-transform-origin:50%;transform-origin:50%;-webkit-animation:spinner-spin 1s step-end infinite;animation:spinner-spin 1s step-end infinite}.mui-spinner:after{display:block;width:100%;height:100%;content:'';background-image:url('data:image/svg+xml;charset=utf-8,');background-repeat:no-repeat;background-position:50%;background-size:100%}.mui-spinner-white:after{background-image:url('data:image/svg+xml;charset=utf-8,')}@-webkit-keyframes spinner-spin{0%{-webkit-transform:rotate(0deg)}8.33333333%{-webkit-transform:rotate(30deg)}16.66666667%{-webkit-transform:rotate(60deg)}25%{-webkit-transform:rotate(90deg)}33.33333333%{-webkit-transform:rotate(120deg)}41.66666667%{-webkit-transform:rotate(150deg)}50%{-webkit-transform:rotate(180deg)}58.33333333%{-webkit-transform:rotate(210deg)}66.66666667%{-webkit-transform:rotate(240deg)}75%{-webkit-transform:rotate(270deg)}83.33333333%{-webkit-transform:rotate(300deg)}91.66666667%{-webkit-transform:rotate(330deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spinner-spin{0%{transform:rotate(0deg)}8.33333333%{transform:rotate(30deg)}16.66666667%{transform:rotate(60deg)}25%{transform:rotate(90deg)}33.33333333%{transform:rotate(120deg)}41.66666667%{transform:rotate(150deg)}50%{transform:rotate(180deg)}58.33333333%{transform:rotate(210deg)}66.66666667%{transform:rotate(240deg)}75%{transform:rotate(270deg)}83.33333333%{transform:rotate(300deg)}91.66666667%{transform:rotate(330deg)}100%{transform:rotate(360deg)}}.mui-btn,button,input[type=button],input[type=reset],input[type=submit]{font-size:14px;font-weight:400;line-height:1.42;position:relative;display:inline-block;margin-bottom:0;padding:6px 12px;cursor:pointer;-webkit-transition:all;transition:all;-webkit-transition-timing-function:linear;transition-timing-function:linear;-webkit-transition-duration:.2s;transition-duration:.2s;text-align:center;vertical-align:top;white-space:nowrap;color:#333;border:1px solid #ccc;border-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:#fff;background-clip:padding-box}.mui-btn.mui-active:enabled,.mui-btn:enabled:active,button.mui-active:enabled,button:enabled:active,input[type=button].mui-active:enabled,input[type=button]:enabled:active,input[type=reset].mui-active:enabled,input[type=reset]:enabled:active,input[type=submit].mui-active:enabled,input[type=submit]:enabled:active{color:#fff;background-color:#929292}.mui-btn.mui-disabled,.mui-btn:disabled,button.mui-disabled,button:disabled,input[type=button].mui-disabled,input[type=button]:disabled,input[type=reset].mui-disabled,input[type=reset]:disabled,input[type=submit].mui-disabled,input[type=submit]:disabled{opacity:.6}.mui-btn-blue,.mui-btn-primary,input[type=submit]{color:#fff;border:1px solid #007aff;background-color:#007aff}.mui-btn-blue.mui-active:enabled,.mui-btn-blue:enabled:active,.mui-btn-primary.mui-active:enabled,.mui-btn-primary:enabled:active,input[type=submit].mui-active:enabled,input[type=submit]:enabled:active{color:#fff;border:1px solid #0062cc;background-color:#0062cc}.mui-btn-green,.mui-btn-positive,.mui-btn-success{color:#fff;border:1px solid #4cd964;background-color:#4cd964}.mui-btn-green.mui-active:enabled,.mui-btn-green:enabled:active,.mui-btn-positive.mui-active:enabled,.mui-btn-positive:enabled:active,.mui-btn-success.mui-active:enabled,.mui-btn-success:enabled:active{color:#fff;border:1px solid #2ac845;background-color:#2ac845}.mui-btn-warning,.mui-btn-yellow{color:#fff;border:1px solid #f0ad4e;background-color:#f0ad4e}.mui-btn-warning.mui-active:enabled,.mui-btn-warning:enabled:active,.mui-btn-yellow.mui-active:enabled,.mui-btn-yellow:enabled:active{color:#fff;border:1px solid #ec971f;background-color:#ec971f}.mui-btn-danger,.mui-btn-negative,.mui-btn-red{color:#fff;border:1px solid #dd524d;background-color:#dd524d}.mui-btn-danger.mui-active:enabled,.mui-btn-danger:enabled:active,.mui-btn-negative.mui-active:enabled,.mui-btn-negative:enabled:active,.mui-btn-red.mui-active:enabled,.mui-btn-red:enabled:active{color:#fff;border:1px solid #cf2d28;background-color:#cf2d28}.mui-btn-purple,.mui-btn-royal{color:#fff;border:1px solid #8a6de9;background-color:#8a6de9}.mui-btn-purple.mui-active:enabled,.mui-btn-purple:enabled:active,.mui-btn-royal.mui-active:enabled,.mui-btn-royal:enabled:active{color:#fff;border:1px solid #6641e2;background-color:#6641e2}.mui-btn-grey{color:#fff;border:1px solid #c7c7cc;background-color:#c7c7cc}.mui-btn-grey.mui-active:enabled,.mui-btn-grey:enabled:active{color:#fff;border:1px solid #acacb4;background-color:#acacb4}.mui-btn-outlined{background-color:transparent}.mui-btn-outlined.mui-btn-blue,.mui-btn-outlined.mui-btn-primary{color:#007aff}.mui-btn-outlined.mui-btn-green,.mui-btn-outlined.mui-btn-positive,.mui-btn-outlined.mui-btn-success{color:#4cd964}.mui-btn-outlined.mui-btn-warning,.mui-btn-outlined.mui-btn-yellow{color:#f0ad4e}.mui-btn-outlined.mui-btn-danger,.mui-btn-outlined.mui-btn-negative,.mui-btn-outlined.mui-btn-red{color:#dd524d}.mui-btn-outlined.mui-btn-purple,.mui-btn-outlined.mui-btn-royal{color:#8a6de9}.mui-btn-outlined.mui-btn-blue:enabled:active,.mui-btn-outlined.mui-btn-danger:enabled:active,.mui-btn-outlined.mui-btn-green:enabled:active,.mui-btn-outlined.mui-btn-negative:enabled:active,.mui-btn-outlined.mui-btn-positive:enabled:active,.mui-btn-outlined.mui-btn-primary:enabled:active,.mui-btn-outlined.mui-btn-purple:enabled:active,.mui-btn-outlined.mui-btn-red:enabled:active,.mui-btn-outlined.mui-btn-royal:enabled:active,.mui-btn-outlined.mui-btn-success:enabled:active,.mui-btn-outlined.mui-btn-warning:enabled:active,.mui-btn-outlined.mui-btn-yellow:enabled:active{color:#fff}.mui-btn-link{padding-top:6px;padding-bottom:6px;color:#007aff;border:0;background-color:transparent}.mui-btn-link.mui-active:enabled,.mui-btn-link:enabled:active{color:#0062cc;background-color:transparent}.mui-btn-block{font-size:18px;display:block;width:100%;margin-bottom:10px;padding:15px 0}.mui-btn .mui-badge{font-size:14px;margin:-2px -4px -2px 4px;background-color:rgba(0,0,0,.15)}.mui-btn .mui-badge-inverted,.mui-btn:enabled:active .mui-badge-inverted{background-color:transparent}.mui-btn-negative:enabled:active .mui-badge-inverted,.mui-btn-positive:enabled:active .mui-badge-inverted,.mui-btn-primary:enabled:active .mui-badge-inverted{color:#fff}.mui-btn-block .mui-badge{position:absolute;right:0;margin-right:10px}.mui-btn .mui-icon{font-size:inherit}.mui-btn.mui-icon{font-size:14px;line-height:1.42}.mui-btn.mui-fab{width:56px;height:56px;padding:16px;border-radius:50%;outline:0}.mui-btn.mui-fab.mui-btn-mini{width:40px;height:40px;padding:8px}.mui-btn.mui-fab .mui-icon{font-size:24px;line-height:24px;width:24px;height:24px}.mui-btn .mui-spinner{width:14px;height:14px;vertical-align:text-bottom}.mui-btn-block .mui-spinner{width:22px;height:22px}.mui-bar{position:fixed;z-index:10;right:0;left:0;height:44px;padding-right:10px;padding-left:10px;border-bottom:0;background-color:#f7f7f7;-webkit-box-shadow:0 0 1px rgba(0,0,0,.85);box-shadow:0 0 1px rgba(0,0,0,.85);-webkit-backface-visibility:hidden;backface-visibility:hidden}.mui-bar .mui-title{right:40px;left:40px;display:inline-block;overflow:hidden;width:auto;margin:0;text-overflow:ellipsis}.mui-bar .mui-backdrop{background:0 0}.mui-bar-header-secondary{top:44px}.mui-bar-footer{bottom:0}.mui-bar-footer-secondary{bottom:44px}.mui-bar-footer-secondary-tab{bottom:50px}.mui-bar-footer,.mui-bar-footer-secondary,.mui-bar-footer-secondary-tab{border-top:0}.mui-bar-transparent{top:0;background-color:rgba(247,247,247,0);-webkit-box-shadow:none;box-shadow:none}.mui-bar-nav{top:0;-webkit-box-shadow:0 1px 6px #ccc;box-shadow:0 1px 6px #ccc}.mui-bar-nav~.mui-content .mui-anchor{display:block;visibility:hidden;height:45px;margin-top:-45px}.mui-bar-nav.mui-bar .mui-icon{margin-right:-10px;margin-left:-10px;padding-right:10px;padding-left:10px}.mui-title{font-size:17px;font-weight:500;line-height:44px;position:absolute;display:block;width:100%;margin:0 -10px;padding:0;text-align:center;white-space:nowrap;color:#000}.mui-title a{color:inherit}.mui-bar-tab{bottom:0;display:table;width:100%;height:50px;padding:0;table-layout:fixed;border-top:0;border-bottom:0;-webkit-touch-callout:none}.mui-bar-tab .mui-tab-item{display:table-cell;overflow:hidden;width:1%;height:50px;text-align:center;vertical-align:middle;white-space:nowrap;text-overflow:ellipsis;color:#929292}.mui-bar-tab .mui-tab-item.mui-active{color:#007aff}.mui-bar-tab .mui-tab-item .mui-icon{top:3px;width:24px;height:24px;padding-top:0;padding-bottom:0}.mui-bar-tab .mui-tab-item .mui-icon~.mui-tab-label{font-size:11px;display:block;overflow:hidden;text-overflow:ellipsis}.mui-bar-tab .mui-tab-item .mui-icon:active{background:0 0}.mui-focusin>.mui-bar-header-secondary,.mui-focusin>.mui-bar-nav{position:absolute}.mui-focusin>.mui-bar~.mui-content{padding-bottom:0}.mui-bar .mui-btn{font-weight:400;position:relative;z-index:20;top:7px;margin-top:0;padding:6px 12px 7px}.mui-bar .mui-btn.mui-pull-right{margin-left:10px}.mui-bar .mui-btn.mui-pull-left{margin-right:10px}.mui-bar .mui-btn-link{font-size:16px;line-height:44px;top:0;padding:0;color:#007aff;border:0}.mui-bar .mui-btn-link.mui-active,.mui-bar .mui-btn-link:active{color:#0062cc}.mui-bar .mui-btn-block{font-size:16px;top:6px;margin-bottom:0;padding:5px 0}.mui-bar .mui-btn-nav.mui-pull-left{margin-left:-5px}.mui-bar .mui-btn-nav.mui-pull-left .mui-icon-left-nav{margin-right:-3px}.mui-bar .mui-btn-nav.mui-pull-right{margin-right:-5px}.mui-bar .mui-btn-nav.mui-pull-right .mui-icon-right-nav{margin-left:-3px}.mui-bar .mui-btn-nav:active{opacity:.3}.mui-bar .mui-icon{font-size:24px;position:relative;z-index:20;padding-top:10px;padding-bottom:10px}.mui-bar .mui-icon:active{opacity:.3}.mui-bar .mui-btn .mui-icon{top:1px;margin:0;padding:0}.mui-bar .mui-title .mui-icon{margin:0;padding:0}.mui-bar .mui-title .mui-icon.mui-icon-caret{top:4px;margin-left:-5px}.mui-bar input[type=search]{height:29px;margin:6px 0}.mui-bar .mui-input-row .mui-btn{padding:12px 10px}.mui-bar .mui-search:before{margin-top:-10px}.mui-bar .mui-input-row .mui-input-clear~.mui-icon-clear,.mui-bar .mui-input-row .mui-input-speech~.mui-icon-speech{top:0;right:12px}.mui-bar.mui-bar-header-secondary .mui-input-row .mui-input-clear~.mui-icon-clear,.mui-bar.mui-bar-header-secondary .mui-input-row .mui-input-speech~.mui-icon-speech{top:0;right:0}.mui-bar .mui-segmented-control{top:7px;width:auto;margin:0 auto}.mui-bar.mui-bar-header-secondary .mui-segmented-control{top:0}.mui-badge{font-size:12px;line-height:1;display:inline-block;padding:3px 6px;color:#333;border-radius:100px;background-color:rgba(0,0,0,.15)}.mui-badge.mui-badge-inverted{padding:0 5px 0 0;color:#929292;background-color:transparent}.mui-badge-blue,.mui-badge-primary{color:#fff;background-color:#007aff}.mui-badge-blue.mui-badge-inverted,.mui-badge-primary.mui-badge-inverted{color:#007aff;background-color:transparent}.mui-badge-green,.mui-badge-success{color:#fff;background-color:#4cd964}.mui-badge-green.mui-badge-inverted,.mui-badge-success.mui-badge-inverted{color:#4cd964;background-color:transparent}.mui-badge-warning,.mui-badge-yellow{color:#fff;background-color:#f0ad4e}.mui-badge-warning.mui-badge-inverted,.mui-badge-yellow.mui-badge-inverted{color:#f0ad4e;background-color:transparent}.mui-badge-danger,.mui-badge-red{color:#fff;background-color:#dd524d}.mui-badge-danger.mui-badge-inverted,.mui-badge-red.mui-badge-inverted{color:#dd524d;background-color:transparent}.mui-badge-purple,.mui-badge-royal{color:#fff;background-color:#8a6de9}.mui-badge-purple.mui-badge-inverted,.mui-badge-royal.mui-badge-inverted{color:#8a6de9;background-color:transparent}.mui-icon .mui-badge{font-size:10px;line-height:1.4;position:absolute;top:-2px;left:100%;margin-left:-10px;padding:1px 5px;color:#fff;background:red}.mui-card{font-size:14px;position:relative;overflow:hidden;margin:10px;border-radius:2px;background-color:#fff;background-clip:padding-box;box-shadow:0 1px 2px rgba(0,0,0,.3)}.mui-content>.mui-card:first-child{margin-top:15px}.mui-card .mui-input-group .mui-input-row:last-child:after,.mui-card .mui-input-group .mui-input-row:last-child:before,.mui-card .mui-input-group:after,.mui-card .mui-input-group:before{height:0}.mui-card .mui-table-view{margin-bottom:0;border-top:0;border-bottom:0;border-radius:6px}.mui-card .mui-table-view .mui-table-view-cell:first-child,.mui-card .mui-table-view .mui-table-view-divider:first-child{top:0;border-top-left-radius:6px;border-top-right-radius:6px}.mui-card .mui-table-view .mui-table-view-cell:last-child,.mui-card .mui-table-view .mui-table-view-divider:last-child{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.mui-card .mui-table-view:after,.mui-card .mui-table-view:before,.mui-card>.mui-table-view>.mui-table-view-cell:last-child:after,.mui-card>.mui-table-view>.mui-table-view-cell:last-child:before{height:0}.mui-card-footer,.mui-card-header{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;min-height:44px;padding:10px 15px;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.mui-card-footer .mui-card-link,.mui-card-header .mui-card-link{line-height:44px;position:relative;display:-webkit-box;display:-webkit-flex;display:flex;height:44px;margin-top:-10px;margin-bottom:-10px;-webkit-transition-duration:.3s;transition-duration:.3s;text-decoration:none;-webkit-box-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.mui-card-footer:before,.mui-card-header:after{position:absolute;top:0;right:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-card-header{font-size:17px;border-radius:2px 2px 0 0}.mui-card-header:after{top:auto;bottom:0}.mui-card-header>img:first-child{font-size:0;line-height:0;float:left;width:34px;height:34px}.mui-card-footer{color:#6d6d72;border-radius:0 0 2px 2px}.mui-card-content{font-size:14px;position:relative}.mui-card-content-inner{position:relative;padding:15px}.mui-card-media{vertical-align:bottom;color:#fff;background-position:center;background-size:cover}.mui-card-header.mui-card-media{display:block;padding:10px}.mui-card-header.mui-card-media .mui-media-body{font-size:14px;font-weight:500;line-height:17px;margin-bottom:0;margin-left:44px;color:#333}.mui-card-header.mui-card-media .mui-media-body p{font-size:13px;margin-bottom:0}.mui-table-view{position:relative;margin-top:0;margin-bottom:0;padding-left:0;list-style:none;background-color:#fff}.mui-table-view:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view:before{position:absolute;right:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc;top:-1px}.mui-table-view-icon .mui-table-view-cell .mui-navigate-right .mui-icon{font-size:20px;margin-top:-1px;margin-right:5px;margin-left:-5px}.mui-table-view-icon .mui-table-view-cell:after{left:40px}.mui-table-view-chevron .mui-table-view-cell{padding-right:65px}.mui-table-view-chevron .mui-table-view-cell>a:not(.mui-btn){margin-right:-65px}.mui-table-view-radio .mui-table-view-cell{padding-right:65px}.mui-table-view-radio .mui-table-view-cell>a:not(.mui-btn){margin-right:-65px}.mui-table-view-radio .mui-table-view-cell .mui-navigate-right:after{font-size:30px;font-weight:600;right:9px;content:'';color:#007aff}.mui-table-view-radio .mui-table-view-cell.mui-selected .mui-navigate-right:after{content:'\e472'}.mui-table-view-inverted{color:#fff;background:#333}.mui-table-view-inverted:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#222}.mui-table-view-inverted:before{position:absolute;top:0;right:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#222}.mui-table-view-inverted .mui-table-view-cell:after{position:absolute;right:0;bottom:0;left:15px;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#222}.mui-table-view-inverted .mui-table-view-cell.mui-active,.mui-table-view-inverted .mui-table-view-cell>a:not(.mui-btn).mui-active{background-color:#242424}.mui-table-view-cell{position:relative;overflow:hidden;padding:11px 15px;-webkit-touch-callout:none}.mui-table-view-cell:after{position:absolute;right:0;bottom:0;left:15px;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view-cell.mui-checkbox input[type=checkbox],.mui-table-view-cell.mui-radio input[type=radio]{top:8px}.mui-table-view-cell.mui-checkbox.mui-left,.mui-table-view-cell.mui-radio.mui-left{padding-left:58px}.mui-table-view-cell.mui-active{background-color:#eee}.mui-table-view-cell:last-child:after,.mui-table-view-cell:last-child:before{height:0}.mui-table-view-cell>a:not(.mui-btn){position:relative;display:block;overflow:hidden;margin:-11px -15px;padding:inherit;white-space:nowrap;text-overflow:ellipsis;color:inherit}.mui-table-view-cell>a:not(.mui-btn).mui-active{background-color:#eee}.mui-table-view-cell p{margin-bottom:0}.mui-table-view-cell.mui-transitioning>.mui-slider-handle,.mui-table-view-cell.mui-transitioning>.mui-slider-left .mui-btn,.mui-table-view-cell.mui-transitioning>.mui-slider-right .mui-btn{-webkit-transition:-webkit-transform 300ms ease;transition:transform 300ms ease}.mui-table-view-cell.mui-active>.mui-slider-handle{background-color:#eee}.mui-table-view-cell>.mui-slider-handle{position:relative;background-color:#fff}.mui-table-view-cell>.mui-slider-handle .mui-navigate-right:after,.mui-table-view-cell>.mui-slider-handle.mui-navigate-right:after{right:0}.mui-table-view-cell>.mui-slider-handle,.mui-table-view-cell>.mui-slider-left .mui-btn,.mui-table-view-cell>.mui-slider-right .mui-btn{-webkit-transition:-webkit-transform 0ms ease;transition:transform 0ms ease}.mui-table-view-cell>.mui-slider-left,.mui-table-view-cell>.mui-slider-right{position:absolute;top:0;display:-webkit-box;display:-webkit-flex;display:flex;height:100%}.mui-table-view-cell>.mui-slider-left>.mui-btn,.mui-table-view-cell>.mui-slider-right>.mui-btn{position:relative;left:0;display:-webkit-box;display:-webkit-flex;display:flex;padding:0 30px;color:#fff;border:0;border-radius:0;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.mui-table-view-cell>.mui-slider-left>.mui-btn:after,.mui-table-view-cell>.mui-slider-right>.mui-btn:after{position:absolute;z-index:-1;top:0;width:600%;height:100%;content:'';background:inherit}.mui-table-view-cell>.mui-slider-left>.mui-btn.mui-icon,.mui-table-view-cell>.mui-slider-right>.mui-btn.mui-icon{font-size:30px}.mui-table-view-cell>.mui-slider-right{right:0;-webkit-transition:-webkit-transform 0ms ease;transition:transform 0ms ease;-webkit-transform:translateX(100%);transform:translateX(100%)}.mui-table-view-cell>.mui-slider-left{left:0;-webkit-transition:-webkit-transform 0ms ease;transition:transform 0ms ease;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.mui-table-view-cell>.mui-slider-left>.mui-btn:after{right:100%;margin-right:-1px}.mui-table-view-divider{font-weight:500;position:relative;margin-top:-1px;margin-left:0;padding-top:6px;padding-bottom:6px;padding-left:15px;color:#999;background-color:#fafafa}.mui-table-view-divider:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view-divider:before{position:absolute;top:0;right:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view .mui-media,.mui-table-view .mui-media-body{overflow:hidden}.mui-table-view .mui-media-large .mui-media-object{line-height:80px;max-width:80px;height:80px}.mui-table-view .mui-media .mui-subtitle{color:#000}.mui-table-view .mui-media-object{line-height:42px;max-width:42px;height:42px}.mui-table-view .mui-media-object.mui-pull-left{margin-right:10px}.mui-table-view .mui-media-object.mui-pull-right{margin-left:10px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object{line-height:29px;max-width:29px;height:29px;margin:-4px 0}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object img{line-height:29px;max-width:29px;height:29px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object.mui-pull-left{margin-right:10px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object .mui-icon{font-size:29px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-body:after{position:absolute;right:0;bottom:0;left:55px;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view .mui-table-view-cell.mui-media-icon:after{height:0!important}.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view{display:block}.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view:after,.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view:before{height:0!important}.mui-table-view.mui-unfold .mui-table-view-cell.mui-media-icon.mui-collapse .mui-media-body:after{position:absolute;right:0;bottom:0;left:70px;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view-cell>.mui-badge,.mui-table-view-cell>.mui-btn,.mui-table-view-cell>.mui-switch,.mui-table-view-cell>a>.mui-badge,.mui-table-view-cell>a>.mui-btn,.mui-table-view-cell>a>.mui-switch{position:absolute;top:50%;right:15px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.mui-table-view-cell .mui-navigate-right>.mui-badge,.mui-table-view-cell .mui-navigate-right>.mui-btn,.mui-table-view-cell .mui-navigate-right>.mui-switch,.mui-table-view-cell .mui-push-left>.mui-badge,.mui-table-view-cell .mui-push-left>.mui-btn,.mui-table-view-cell .mui-push-left>.mui-switch,.mui-table-view-cell .mui-push-right>.mui-badge,.mui-table-view-cell .mui-push-right>.mui-btn,.mui-table-view-cell .mui-push-right>.mui-switch,.mui-table-view-cell>a .mui-navigate-right>.mui-badge,.mui-table-view-cell>a .mui-navigate-right>.mui-btn,.mui-table-view-cell>a .mui-navigate-right>.mui-switch,.mui-table-view-cell>a .mui-push-left>.mui-badge,.mui-table-view-cell>a .mui-push-left>.mui-btn,.mui-table-view-cell>a .mui-push-left>.mui-switch,.mui-table-view-cell>a .mui-push-right>.mui-badge,.mui-table-view-cell>a .mui-push-right>.mui-btn,.mui-table-view-cell>a .mui-push-right>.mui-switch{right:35px}.mui-content>.mui-table-view:first-child{margin-top:15px}.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell:last-child:after,.mui-table-view-cell.mui-collapse .mui-table-view:after,.mui-table-view-cell.mui-collapse .mui-table-view:before{height:0}.mui-table-view-cell.mui-collapse>.mui-navigate-right:after,.mui-table-view-cell.mui-collapse>.mui-push-right:after{content:'\e581'}.mui-table-view-cell.mui-collapse.mui-active{margin-top:-1px}.mui-table-view-cell.mui-collapse.mui-active .mui-collapse-content,.mui-table-view-cell.mui-collapse.mui-active .mui-table-view{display:block}.mui-table-view-cell.mui-collapse.mui-active>.mui-navigate-right:after,.mui-table-view-cell.mui-collapse.mui-active>.mui-push-right:after{content:'\e580'}.mui-table-view-cell.mui-collapse.mui-active .mui-table-view-cell>a:not(.mui-btn).mui-active{margin-left:-31px;padding-left:47px}.mui-table-view-cell.mui-collapse .mui-collapse-content{position:relative;display:none;overflow:hidden;margin:11px -15px -11px;padding:8px 15px;-webkit-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease;background:#fff}.mui-table-view-cell.mui-collapse .mui-collapse-content>.mui-input-group,.mui-table-view-cell.mui-collapse .mui-collapse-content>.mui-slider{width:auto;height:auto;margin:-8px -15px}.mui-table-view-cell.mui-collapse .mui-collapse-content>.mui-slider{margin:-8px -16px}.mui-table-view-cell.mui-collapse .mui-table-view{display:none;margin-top:11px;margin-right:-15px;margin-bottom:-11px;margin-left:-15px;border:0}.mui-table-view-cell.mui-collapse .mui-table-view.mui-table-view-chevron{margin-right:-65px}.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell{padding-left:31px;background-position:31px 100%}.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell:after{position:absolute;right:0;bottom:0;left:30px;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view.mui-grid-view{font-size:0;display:block;width:100%;padding:0 10px 10px 0;white-space:normal}.mui-table-view.mui-grid-view .mui-table-view-cell{font-size:17px;display:inline-block;margin-right:-4px;padding:10px 0 0 14px;text-align:center;vertical-align:middle;background:0 0}.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-object{width:100%;max-width:100%;height:auto}.mui-table-view.mui-grid-view .mui-table-view-cell>a:not(.mui-btn){margin:-10px 0 0 -14px}.mui-table-view.mui-grid-view .mui-table-view-cell>a:not(.mui-btn).mui-active,.mui-table-view.mui-grid-view .mui-table-view-cell>a:not(.mui-btn):active{background:0 0}.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body{font-size:15px;line-height:15px;display:block;width:100%;height:15px;margin-top:8px;text-overflow:ellipsis;color:#333}.mui-table-view.mui-grid-view .mui-table-view-cell:after,.mui-table-view.mui-grid-view .mui-table-view-cell:before{height:0}.mui-grid-view.mui-grid-9{margin:0;padding:0;border-top:1px solid #eee;border-left:1px solid #eee;background-color:#f2f2f2}.mui-grid-view.mui-grid-9:after,.mui-grid-view.mui-grid-9:before{display:table;content:' '}.mui-grid-view.mui-grid-9:after{clear:both;position:static}.mui-grid-view.mui-grid-9 .mui-table-view-cell{margin:0;padding:11px 15px;vertical-align:top;border-right:1px solid #eee;border-bottom:1px solid #eee}.mui-grid-view.mui-grid-9 .mui-table-view-cell.mui-active{background-color:#eee}.mui-grid-view.mui-grid-9 .mui-table-view-cell>a:not(.mui-btn){margin:0;padding:10px 0}.mui-grid-view.mui-grid-9:before{height:0}.mui-grid-view.mui-grid-9 .mui-media{color:#797979}.mui-grid-view.mui-grid-9 .mui-media .mui-icon{font-size:2.4em;position:relative}.mui-slider-cell{position:relative}.mui-slider-cell>.mui-slider-handle{z-index:1}.mui-slider-cell>.mui-slider-left,.mui-slider-cell>.mui-slider-right{position:absolute;z-index:0;top:0;bottom:0}.mui-slider-cell>.mui-slider-left{left:0}.mui-slider-cell>.mui-slider-right{right:0}input,select,textarea{font-family:'Helvetica Neue',Helvetica,sans-serif;font-size:17px;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:transparent}input:focus,select:focus,textarea:focus{-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:transparent;-webkit-user-modify:read-write-plaintext-only}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{line-height:21px;width:100%;height:40px;margin-bottom:15px;padding:10px 15px;-webkit-user-select:text;border:1px solid rgba(0,0,0,.2);border-radius:3px;outline:0;background-color:#fff;-webkit-appearance:none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}input[type=search]{font-size:16px;-webkit-box-sizing:border-box;box-sizing:border-box;height:34px;text-align:center;border:0;border-radius:6px;background-color:rgba(0,0,0,.1)}input[type=search]:focus{text-align:left}textarea{height:auto;resize:none}select{font-size:14px;height:auto;margin-top:1px;border:0!important;background-color:#fff}select:focus{-webkit-user-modify:read-only}.mui-input-group{position:relative;padding:0;border:0;background-color:#fff}.mui-input-group:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-input-group:before{position:absolute;top:0;right:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-input-group input,.mui-input-group textarea{margin-bottom:0;border:0;border-radius:0;background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.mui-input-group input[type=search]{background:0 0}.mui-input-group input:last-child{background-image:none}.mui-input-row{clear:left;overflow:hidden}.mui-input-row select{font-size:17px;height:37px;padding:0}.mui-input-row .mui-btn+input,.mui-input-row label+input,.mui-input-row:last-child{background:0 0}.mui-input-group .mui-input-row{height:40px}.mui-input-group .mui-input-row:after{position:absolute;right:0;bottom:0;left:15px;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-input-row label{font-family:'Helvetica Neue',Helvetica,sans-serif;line-height:1.1;float:left;width:35%;padding:11px 15px}.mui-input-row label~input,.mui-input-row label~select,.mui-input-row label~textarea{float:right;width:65%;margin-bottom:0;padding-left:0;border:0}.mui-input-row .mui-btn{line-height:1.1;float:right;width:15%;padding:10px 15px}.mui-input-row .mui-btn~input,.mui-input-row .mui-btn~select,.mui-input-row .mui-btn~textarea{float:left;width:85%;margin-bottom:0;padding-left:0;border:0}.mui-button-row{position:relative;padding-top:5px;text-align:center}.mui-input-group .mui-button-row{height:45px}.mui-input-row{position:relative}.mui-input-row.mui-input-range{overflow:visible;padding-right:20px}.mui-input-row .mui-inline{padding:8px 0}.mui-input-row .mui-input-clear~.mui-icon-clear,.mui-input-row .mui-input-password~.mui-icon-eye,.mui-input-row .mui-input-speech~.mui-icon-speech{font-size:20px;position:absolute;z-index:1;top:10px;right:0;width:38px;height:38px;text-align:center;color:#999}.mui-input-row .mui-input-clear~.mui-icon-clear.mui-active,.mui-input-row .mui-input-password~.mui-icon-eye.mui-active,.mui-input-row .mui-input-speech~.mui-icon-speech.mui-active{color:#007aff}.mui-input-row .mui-input-speech~.mui-icon-speech{font-size:24px;top:8px}.mui-input-row .mui-input-clear~.mui-icon-clear~.mui-icon-speech{display:none}.mui-input-row .mui-input-clear~.mui-icon-clear.mui-hidden~.mui-icon-speech{display:inline-block}.mui-input-row .mui-icon-speech~.mui-placeholder{right:38px}.mui-input-row.mui-search .mui-icon-clear{top:7px}.mui-input-row.mui-search .mui-icon-speech{top:5px}.mui-checkbox,.mui-radio{position:relative}.mui-checkbox label,.mui-radio label{display:inline-block;float:none;width:100%;padding-right:58px}.mui-checkbox.mui-left input[type=checkbox],.mui-radio.mui-left input[type=radio]{left:20px}.mui-checkbox.mui-left label,.mui-radio.mui-left label{padding-right:15px;padding-left:58px}.mui-checkbox input[type=checkbox],.mui-radio input[type=radio]{position:absolute;top:4px;right:20px;display:inline-block;width:28px;height:26px;border:0;outline:0!important;background-color:transparent;-webkit-appearance:none}.mui-checkbox input[type=checkbox][disabled]:before,.mui-radio input[type=radio][disabled]:before{opacity:.3}.mui-checkbox input[type=checkbox]:before,.mui-radio input[type=radio]:before{font-family:Muiicons;font-size:28px;font-weight:400;line-height:1;text-decoration:none;color:#aaa;border-radius:0;background:0 0;-webkit-font-smoothing:antialiased}.mui-checkbox input[type=checkbox]:checked:before,.mui-radio input[type=radio]:checked:before{color:#007aff}.mui-checkbox label.mui-disabled,.mui-checkbox.mui-disabled label,.mui-radio label.mui-disabled,.mui-radio.mui-disabled label{opacity:.4}.mui-radio input[type=radio]:before{content:'\e411'}.mui-radio input[type=radio]:checked:before{content:'\e441'}.mui-checkbox input[type=checkbox]:before{content:'\e411'}.mui-checkbox input[type=checkbox]:checked:before{content:'\e442'}.mui-select{position:relative}.mui-select:before{font-family:Muiicons;position:absolute;top:8px;right:21px;content:'\e581';color:rgba(170,170,170,.6)}.mui-input-row .mui-switch{float:right;margin-top:5px;margin-right:20px}.mui-input-range input[type=range]{position:relative;width:100%;height:2px;margin:17px 0;padding:0;cursor:pointer;border:0;border-radius:3px;outline:0;background-color:#999;-webkit-appearance:none!important}.mui-input-range input[type=range]::-webkit-slider-thumb{width:28px;height:28px;border-color:#0062cc;border-radius:50%;background-color:#007aff;background-clip:padding-box;-webkit-appearance:none!important}.mui-input-range label~input[type=range]{width:65%}.mui-input-range .mui-tooltip{font-size:36px;line-height:64px;position:absolute;z-index:1;top:-70px;width:64px;height:64px;text-align:center;opacity:.8;color:#333;border:1px solid #ddd;border-radius:6px;background-color:#fff;text-shadow:0 1px 0 #f3f3f3}.mui-search{position:relative}.mui-search input[type=search]{padding-left:30px}.mui-search .mui-placeholder{font-size:16px;line-height:34px;position:absolute;z-index:1;top:0;right:0;bottom:0;left:0;display:inline-block;height:34px;text-align:center;color:#999;border:0;border-radius:6px;background:0 0}.mui-search .mui-placeholder .mui-icon{font-size:20px;color:#333}.mui-search:before{font-family:Muiicons;font-size:20px;font-weight:400;position:absolute;top:50%;right:50%;display:none;margin-top:-18px;margin-right:31px;content:'\e466'}.mui-search.mui-active:before{font-size:20px;right:auto;left:5px;display:block;margin-right:0}.mui-search.mui-active input[type=search]{text-align:left}.mui-search.mui-active .mui-placeholder{display:none}.mui-segmented-control{font-size:15px;font-weight:400;position:relative;display:table;overflow:hidden;width:100%;table-layout:fixed;border:1px solid #007aff;border-radius:3px;background-color:transparent;-webkit-touch-callout:none}.mui-segmented-control.mui-segmented-control-vertical{border-collapse:collapse;border-width:0;border-radius:0}.mui-segmented-control.mui-segmented-control-vertical .mui-control-item{display:block;border-bottom:1px solid #c8c7cc;border-left-width:0}.mui-segmented-control.mui-scroll-wrapper{height:38px}.mui-segmented-control.mui-scroll-wrapper .mui-scroll{width:auto;height:40px;white-space:nowrap}.mui-segmented-control.mui-scroll-wrapper .mui-control-item{display:inline-block;width:auto;padding:0 20px;border:0}.mui-segmented-control .mui-control-item{line-height:38px;display:table-cell;overflow:hidden;width:1%;-webkit-transition:background-color .1s linear;transition:background-color .1s linear;text-align:center;white-space:nowrap;text-overflow:ellipsis;color:#007aff;border-color:#007aff;border-left:1px solid #007aff}.mui-segmented-control .mui-control-item:first-child{border-left-width:0}.mui-segmented-control .mui-control-item.mui-active{color:#fff;background-color:#007aff}.mui-segmented-control.mui-segmented-control-inverted{width:100%;border:0;border-radius:0}.mui-segmented-control.mui-segmented-control-inverted.mui-segmented-control-vertical .mui-control-item,.mui-segmented-control.mui-segmented-control-inverted.mui-segmented-control-vertical .mui-control-item.mui-active{border-bottom:1px solid #c8c7cc}.mui-segmented-control.mui-segmented-control-inverted .mui-control-item{color:inherit;border:0}.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{color:#007aff;border-bottom:2px solid #007aff;background:0 0}.mui-segmented-control.mui-segmented-control-inverted~.mui-slider-progress-bar{background-color:#007aff}.mui-segmented-control-positive{border:1px solid #4cd964}.mui-segmented-control-positive .mui-control-item{color:#4cd964;border-color:inherit}.mui-segmented-control-positive .mui-control-item.mui-active{color:#fff;background-color:#4cd964}.mui-segmented-control-positive.mui-segmented-control-inverted .mui-control-item.mui-active{color:#4cd964;border-bottom:2px solid #4cd964;background:0 0}.mui-segmented-control-positive.mui-segmented-control-inverted~.mui-slider-progress-bar{background-color:#4cd964}.mui-segmented-control-negative{border:1px solid #dd524d}.mui-segmented-control-negative .mui-control-item{color:#dd524d;border-color:inherit}.mui-segmented-control-negative .mui-control-item.mui-active{color:#fff;background-color:#dd524d}.mui-segmented-control-negative.mui-segmented-control-inverted .mui-control-item.mui-active{color:#dd524d;border-bottom:2px solid #dd524d;background:0 0}.mui-segmented-control-negative.mui-segmented-control-inverted~.mui-slider-progress-bar{background-color:#dd524d}.mui-control-content{position:relative;display:none}.mui-control-content.mui-active{display:block}.mui-popover{position:absolute;z-index:999;display:none;width:280px;-webkit-transition:opacity .3s;transition:opacity .3s;-webkit-transition-property:opacity;transition-property:opacity;-webkit-transform:none;transform:none;opacity:0;border-radius:7px;background-color:#f7f7f7;-webkit-box-shadow:0 0 15px rgba(0,0,0,.1);box-shadow:0 0 15px rgba(0,0,0,.1)}.mui-popover .mui-popover-arrow{position:absolute;z-index:1000;top:-25px;left:0;overflow:hidden;width:26px;height:26px}.mui-popover .mui-popover-arrow:after{position:absolute;top:19px;left:0;width:26px;height:26px;content:' ';-webkit-transform:rotate(45deg);transform:rotate(45deg);border-radius:3px;background:#f7f7f7}.mui-popover .mui-popover-arrow.mui-bottom{top:100%;left:-26px;margin-top:-1px}.mui-popover .mui-popover-arrow.mui-bottom:after{top:-19px;left:0}.mui-popover.mui-popover-action{bottom:0;width:100%;-webkit-transition:-webkit-transform .3s,opacity .3s;transition:transform .3s,opacity .3s;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);border-radius:0;background:0 0;-webkit-box-shadow:none;box-shadow:none}.mui-popover.mui-popover-action .mui-popover-arrow{display:none}.mui-popover.mui-popover-action.mui-popover-bottom{position:fixed}.mui-popover.mui-popover-action.mui-active{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.mui-popover.mui-popover-action .mui-table-view{margin:8px;text-align:center;color:#007aff;border-radius:4px}.mui-popover.mui-popover-action .mui-table-view .mui-table-view-cell:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-popover.mui-popover-action .mui-table-view small{font-weight:400;line-height:1.3;display:block}.mui-popover.mui-active{display:block;opacity:1}.mui-popover .mui-bar~.mui-table-view{padding-top:44px}.mui-backdrop{position:fixed;z-index:998;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.3)}.mui-bar-backdrop.mui-backdrop{bottom:50px;background:0 0}.mui-backdrop-action.mui-backdrop{background-color:rgba(0,0,0,.3)}.mui-backdrop-action.mui-backdrop,.mui-bar-backdrop.mui-backdrop{opacity:0}.mui-backdrop-action.mui-backdrop.mui-active,.mui-bar-backdrop.mui-backdrop.mui-active{-webkit-transition:all .4s ease;transition:all .4s ease;opacity:1}.mui-popover .mui-btn-block{margin-bottom:5px}.mui-popover .mui-btn-block:last-child{margin-bottom:0}.mui-popover .mui-bar{-webkit-box-shadow:none;box-shadow:none}.mui-popover .mui-bar-nav{border-bottom:1px solid rgba(0,0,0,.15);border-top-left-radius:12px;border-top-right-radius:12px;-webkit-box-shadow:none;box-shadow:none}.mui-popover .mui-scroll-wrapper{margin:7px 0;border-radius:7px;background-clip:padding-box}.mui-popover .mui-scroll .mui-table-view{max-height:none}.mui-popover .mui-table-view{overflow:auto;max-height:300px;margin-bottom:0;border-radius:7px;background-color:#f7f7f7;background-image:none;-webkit-overflow-scrolling:touch}.mui-popover .mui-table-view:after,.mui-popover .mui-table-view:before{height:0}.mui-popover .mui-table-view .mui-table-view-cell:first-child,.mui-popover .mui-table-view .mui-table-view-cell:first-child>a:not(.mui-btn){border-top-left-radius:12px;border-top-right-radius:12px}.mui-popover .mui-table-view .mui-table-view-cell:last-child,.mui-popover .mui-table-view .mui-table-view-cell:last-child>a:not(.mui-btn){border-bottom-right-radius:12px;border-bottom-left-radius:12px}.mui-popover.mui-bar-popover .mui-table-view{width:106px}.mui-popover.mui-bar-popover .mui-table-view .mui-table-view-cell{padding:11px 15px;background-position:0 100%}.mui-popover.mui-bar-popover .mui-table-view .mui-table-view-cell>a:not(.mui-btn){margin:-11px -15px -11px -15px}.mui-popup-backdrop{position:fixed;z-index:998;top:0;right:0;bottom:0;left:0;-webkit-transition-duration:400ms;transition-duration:400ms;opacity:0;background:rgba(0,0,0,.4)}.mui-popup-backdrop.mui-active{opacity:1}.mui-popup{position:fixed;z-index:10000;top:50%;left:50%;display:none;overflow:hidden;width:270px;-webkit-transition-property:-webkit-transform,opacity;transition-property:transform,opacity;-webkit-transform:translate3d(-50%,-50%,0) scale(1.185);transform:translate3d(-50%,-50%,0) scale(1.185);text-align:center;opacity:0;color:#000;border-radius:13px}.mui-popup.mui-popup-in{display:block;-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(-50%,-50%,0) scale(1);transform:translate3d(-50%,-50%,0) scale(1);opacity:1}.mui-popup.mui-popup-out{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(-50%,-50%,0) scale(1);transform:translate3d(-50%,-50%,0) scale(1);opacity:0}.mui-popup-inner{position:relative;padding:15px;border-radius:13px 13px 0 0;background:rgba(255,255,255,.95)}.mui-popup-inner:after{position:absolute;z-index:15;top:auto;right:auto;bottom:0;left:0;display:block;width:100%;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;background-color:rgba(0,0,0,.2)}.mui-popup-title{font-size:18px;font-weight:500;text-align:center}.mui-popup-title+.mui-popup-text{font-family:inherit;font-size:14px;margin:5px 0 0}.mui-popup-buttons{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;height:44px;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.mui-popup-button{font-size:17px;line-height:44px;position:relative;display:block;overflow:hidden;box-sizing:border-box;width:100%;height:44px;padding:0 5px;cursor:pointer;text-align:center;white-space:nowrap;text-overflow:ellipsis;color:#007aff;background:rgba(255,255,255,.95);-webkit-box-flex:1}.mui-popup-button:after{position:absolute;z-index:15;top:0;right:0;bottom:auto;left:auto;display:block;width:1px;height:100%;content:'';-webkit-transform:scaleX(.5);transform:scaleX(.5);-webkit-transform-origin:100% 50%;transform-origin:100% 50%;background-color:rgba(0,0,0,.2)}.mui-popup-button:first-child{border-radius:0 0 0 13px}.mui-popup-button:first-child:last-child{border-radius:0 0 13px 13px}.mui-popup-button:last-child{border-radius:0 0 13px}.mui-popup-button:last-child:after{display:none}.mui-popup-button.mui-popup-button-bold{font-weight:600}.mui-popup-input input{font-size:14px;width:100%;height:26px;margin:15px 0 0;padding:0 5px;border:1px solid rgba(0,0,0,.3);border-radius:0;background:#fff}.mui-plus.mui-android .mui-popup-backdrop{-webkit-transition-duration:1ms;transition-duration:1ms}.mui-plus.mui-android .mui-popup{-webkit-transition-duration:1ms;transition-duration:1ms;-webkit-transform:translate3d(-50%,-50%,0) scale(1);transform:translate3d(-50%,-50%,0) scale(1)}.mui-progressbar{position:relative;display:block;overflow:hidden;width:100%;height:2px;-webkit-transform-origin:center top;transform-origin:center top;vertical-align:middle;border-radius:2px;background:#b6b6b6;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.mui-progressbar span{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-transition:150ms;transition:150ms;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);background:#007aff}.mui-progressbar.mui-progressbar-infinite:before{position:absolute;top:0;left:0;width:100%;height:100%;content:'';-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transform-origin:left center;transform-origin:left center;-webkit-animation:mui-progressbar-infinite 1s linear infinite;animation:mui-progressbar-infinite 1s linear infinite;background:#007aff}body>.mui-progressbar{position:absolute;z-index:10000;top:44px;left:0;border-radius:0}.mui-progressbar-in{-webkit-animation:mui-progressbar-in 300ms forwards;animation:mui-progressbar-in 300ms forwards}.mui-progressbar-out{-webkit-animation:mui-progressbar-out 300ms forwards;animation:mui-progressbar-out 300ms forwards}@-webkit-keyframes mui-progressbar-in{from{-webkit-transform:scaleY(0);opacity:0}to{-webkit-transform:scaleY(1);opacity:1}}@keyframes mui-progressbar-in{from{transform:scaleY(0);opacity:0}to{transform:scaleY(1);opacity:1}}@-webkit-keyframes mui-progressbar-out{from{-webkit-transform:scaleY(1);opacity:1}to{-webkit-transform:scaleY(0);opacity:0}}@keyframes mui-progressbar-out{from{transform:scaleY(1);opacity:1}to{transform:scaleY(0);opacity:0}}@-webkit-keyframes mui-progressbar-infinite{0%{-webkit-transform:translate3d(-50%,0,0) scaleX(.5)}100%{-webkit-transform:translate3d(100%,0,0) scaleX(.5)}}@keyframes mui-progressbar-infinite{0%{transform:translate3d(-50%,0,0) scaleX(.5)}100%{transform:translate3d(100%,0,0) scaleX(.5)}}.mui-pagination{display:inline-block;margin:0 auto;padding-left:0;border-radius:6px}.mui-pagination>li{display:inline}.mui-pagination>li>a,.mui-pagination>li>span{line-height:1.428571429;position:relative;float:left;margin-left:-1px;padding:6px 12px;text-decoration:none;color:#007aff;border:1px solid #ddd;background-color:#fff}.mui-pagination>li:first-child>a,.mui-pagination>li:first-child>span{margin-left:0;border-top-left-radius:6px;border-bottom-left-radius:6px;background-clip:padding-box}.mui-pagination>li:last-child>a,.mui-pagination>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px;background-clip:padding-box}.mui-pagination>li.mui-active>a,.mui-pagination>li.mui-active>a:active,.mui-pagination>li.mui-active>span,.mui-pagination>li.mui-active>span:active,.mui-pagination>li:active>a,.mui-pagination>li:active>a:active,.mui-pagination>li:active>span,.mui-pagination>li:active>span:active{z-index:2;cursor:default;color:#fff;border-color:#007aff;background-color:#007aff}.mui-pagination>li.mui-disabled>a,.mui-pagination>li.mui-disabled>a:active,.mui-pagination>li.mui-disabled>span,.mui-pagination>li.mui-disabled>span:active{opacity:.6;color:#777;border:1px solid #ddd;background-color:#fff}.mui-pagination-lg>li>a,.mui-pagination-lg>li>span{font-size:18px;padding:10px 16px}.mui-pagination-sm>li>a,.mui-pagination-sm>li>span{font-size:12px;padding:5px 10px}.mui-pager{padding-left:0;list-style:none;text-align:center}.mui-pager:after,.mui-pager:before{display:table;content:' '}.mui-pager:after{clear:both}.mui-pager li{display:inline}.mui-pager li>a,.mui-pager li>span{display:inline-block;padding:5px 14px;border:1px solid #ddd;border-radius:6px;background-color:#fff;background-clip:padding-box}.mui-pager li.mui-active>a,.mui-pager li.mui-active>span,.mui-pager li:active>a,.mui-pager li:active>span{cursor:default;text-decoration:none;color:#fff;border-color:#007aff;background-color:#007aff}.mui-pager .mui-next>a,.mui-pager .mui-next>span{float:right}.mui-pager .mui-previous>a,.mui-pager .mui-previous>span{float:left}.mui-pager .mui-disabled>a,.mui-pager .mui-disabled>a:active,.mui-pager .mui-disabled>span,.mui-pager .mui-disabled>span:active{opacity:.6;color:#777;border:1px solid #ddd;background-color:#fff}.mui-modal{position:fixed;z-index:999;top:0;overflow:hidden;width:100%;min-height:100%;-webkit-transition:-webkit-transform .25s,opacity 1ms .25s;transition:transform .25s,opacity 1ms .25s;-webkit-transition-timing-function:cubic-bezier(.1,.5,.1,1);transition-timing-function:cubic-bezier(.1,.5,.1,1);-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);opacity:0;background-color:#fff}.mui-modal.mui-active{height:100%;-webkit-transition:-webkit-transform .25s;transition:transform .25s;-webkit-transition-timing-function:cubic-bezier(.1,.5,.1,1);transition-timing-function:cubic-bezier(.1,.5,.1,1);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.mui-android .mui-modal .mui-bar{position:static}.mui-android .mui-modal .mui-bar-nav~.mui-content{padding-top:0}.mui-slider{position:relative;z-index:1;overflow:hidden;width:100%}.mui-slider .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{border-bottom:0}.mui-slider .mui-segmented-control.mui-segmented-control-inverted~.mui-slider-group .mui-slider-item{border-top:1px solid #c8c7cc;border-bottom:1px solid #c8c7cc}.mui-slider .mui-slider-group{font-size:0;position:relative;-webkit-transition:all 0s linear;transition:all 0s linear;white-space:nowrap}.mui-slider .mui-slider-group .mui-slider-item{font-size:14px;position:relative;display:inline-block;width:100%;height:100%;vertical-align:top;white-space:normal}.mui-slider .mui-slider-group .mui-slider-item>a:not(.mui-control-item){line-height:0;position:relative;display:block}.mui-slider .mui-slider-group .mui-slider-item img{width:100%}.mui-slider .mui-slider-group .mui-slider-item .mui-table-view:after,.mui-slider .mui-slider-group .mui-slider-item .mui-table-view:before{height:0}.mui-slider .mui-slider-group.mui-slider-loop{-webkit-transform:translate(-100%,0);transform:translate(-100%,0)}.mui-slider-title{line-height:30px;position:absolute;bottom:0;left:0;width:100%;height:30px;margin:0;text-align:left;text-indent:12px;opacity:.8;background-color:#000}.mui-slider-indicator{position:absolute;bottom:8px;width:100%;text-align:center;background:0 0}.mui-slider-indicator.mui-segmented-control{position:relative;bottom:auto}.mui-slider-indicator .mui-indicator{display:inline-block;width:6px;height:6px;margin:1px 6px;cursor:pointer;border-radius:50%;background:#aaa;-webkit-box-shadow:0 0 1px 1px rgba(130,130,130,.7);box-shadow:0 0 1px 1px rgba(130,130,130,.7)}.mui-slider-indicator .mui-active.mui-indicator{background:#fff}.mui-slider-indicator .mui-icon{font-size:20px;line-height:30px;width:40px;height:30px;margin:3px;text-align:center;border:1px solid #ddd}.mui-slider-indicator .mui-number{line-height:32px;display:inline-block;width:58px}.mui-slider-indicator .mui-number span{color:#ff5053}.mui-slider-progress-bar{z-index:1;height:2px;-webkit-transform:translateZ(0);transform:translateZ(0)}.mui-switch{position:relative;display:block;width:74px;height:30px;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:background-color,border;transition-property:background-color,border;border:2px solid #ddd;border-radius:20px;background-color:#fff;background-clip:padding-box}.mui-switch.mui-disabled{opacity:.3}.mui-switch .mui-switch-handle{position:absolute;z-index:1;top:-1px;left:-1px;width:28px;height:28px;-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out;-webkit-transition-property:-webkit-transform,width,left;transition-property:transform,width,left;border-radius:16px;background-color:#fff;background-clip:padding-box;-webkit-box-shadow:0 2px 5px rgba(0,0,0,.4);box-shadow:0 2px 5px rgba(0,0,0,.4)}.mui-switch:before{font-size:13px;position:absolute;top:3px;right:11px;content:'Off';text-transform:uppercase;color:#999}.mui-switch.mui-dragging{border-color:#f7f7f7;background-color:#f7f7f7}.mui-switch.mui-dragging .mui-switch-handle{width:38px}.mui-switch.mui-dragging.mui-active .mui-switch-handle{left:-11px;width:38px}.mui-switch.mui-active{border-color:#4cd964;background-color:#4cd964}.mui-switch.mui-active .mui-switch-handle{-webkit-transform:translate(43px,0);transform:translate(43px,0)}.mui-switch.mui-active:before{right:auto;left:15px;content:'On';color:#fff}.mui-switch input[type=checkbox]{display:none}.mui-switch-mini{width:47px}.mui-switch-mini:before{display:none}.mui-switch-mini.mui-active .mui-switch-handle{-webkit-transform:translate(16px,0);transform:translate(16px,0)}.mui-switch-blue.mui-active{border:2px solid #007aff;background-color:#007aff}.mui-content.mui-fade{left:0;opacity:0}.mui-content.mui-fade.mui-in{opacity:1}.mui-content.mui-sliding{z-index:2;-webkit-transition:-webkit-transform .4s;transition:transform .4s;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.mui-content.mui-sliding.mui-left{z-index:1;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.mui-content.mui-sliding.mui-right{z-index:3;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.mui-navigate-right:after,.mui-push-left:after,.mui-push-right:after{font-family:Muiicons;font-size:inherit;line-height:1;position:absolute;top:50%;display:inline-block;-webkit-transform:translateY(-50%);transform:translateY(-50%);text-decoration:none;color:#bbb;-webkit-font-smoothing:antialiased}.mui-push-left:after{left:15px;content:'\e582'}.mui-navigate-right:after,.mui-push-right:after{right:15px;content:'\e583'}.mui-pull-bottom-pocket,.mui-pull-top-pocket{position:absolute;left:0;display:block;visibility:hidden;overflow:hidden;width:100%;height:50px}.mui-plus-pullrefresh .mui-pull-bottom-pocket,.mui-plus-pullrefresh .mui-pull-top-pocket{display:none;visibility:visible}.mui-pull-top-pocket{top:0}.mui-bar-nav~.mui-content .mui-pull-top-pocket{top:44px}.mui-bar-nav~.mui-bar-header-secondary~.mui-content .mui-pull-top-pocket{top:88px}.mui-pull-bottom-pocket{position:relative;bottom:0;height:40px}.mui-pull-bottom-pocket .mui-pull-loading{visibility:hidden}.mui-pull-bottom-pocket .mui-pull-loading.mui-in{display:inline-block}.mui-pull{font-weight:700;position:absolute;right:0;bottom:10px;left:0;text-align:center;color:#777}.mui-pull-loading{margin-right:10px;-webkit-transition:-webkit-transform .4s;transition:transform .4s;-webkit-transition-duration:400ms;transition-duration:400ms;vertical-align:middle}.mui-pull-loading.mui-reverse{-webkit-transform:rotate(180deg) translateZ(0);transform:rotate(180deg) translateZ(0)}.mui-pull-caption{font-size:15px;line-height:24px;position:relative;display:inline-block;overflow:visible;margin-top:0;vertical-align:middle}.mui-pull-caption span{display:none}.mui-pull-caption span.mui-in{display:inline}.mui-toast-container{line-height:17px;position:fixed;z-index:9999;bottom:50px;left:50%;-webkit-transition:opacity .3s;transition:opacity .3s;-webkit-transform:translate(-50%,0);transform:translate(-50%,0);opacity:0}.mui-toast-container.mui-active{opacity:.9}.mui-toast-message{font-size:14px;padding:10px 25px;text-align:center;color:#fff;border-radius:6px;background-color:#323232}.mui-numbox{position:relative;display:inline-block;overflow:hidden;width:120px;height:35px;padding:0 40px;vertical-align:top;vertical-align:middle;border:solid 1px #bbb;border-radius:3px;background-color:#efeff4}.mui-numbox [class*=btn-numbox],.mui-numbox [class*=numbox-btn]{font-size:18px;font-weight:400;line-height:100%;position:absolute;top:0;overflow:hidden;width:40px;height:100%;padding:0;color:#555;border:none;border-radius:0;background-color:#f9f9f9}.mui-numbox [class*=btn-numbox]:active,.mui-numbox [class*=numbox-btn]:active{background-color:#ccc}.mui-numbox [class*=btn-numbox][disabled],.mui-numbox [class*=numbox-btn][disabled]{color:silver}.mui-numbox .mui-btn-numbox-plus,.mui-numbox .mui-numbox-btn-plus{right:0;border-top-right-radius:3px;border-bottom-right-radius:3px}.mui-numbox .mui-btn-numbox-minus,.mui-numbox .mui-numbox-btn-minus{left:0;border-top-left-radius:3px;border-bottom-left-radius:3px}.mui-numbox .mui-input-numbox,.mui-numbox .mui-numbox-input{display:inline-block;overflow:hidden;width:100%!important;height:100%;margin:0;padding:0 3px!important;text-align:center;text-overflow:ellipsis;word-break:normal;border:none!important;border-right:solid 1px #ccc!important;border-left:solid 1px #ccc!important;border-radius:0!important}.mui-input-row .mui-numbox{float:right;margin:2px 8px}@font-face{font-family:Muiicons;font-weight:400;font-style:normal;src:url(../fonts/mui.ttf) format('truetype')}.mui-icon{font-family:Muiicons;font-size:24px;font-weight:400;font-style:normal;line-height:1;display:inline-block;text-decoration:none;-webkit-font-smoothing:antialiased}.mui-icon.mui-active{color:#007aff}.mui-icon.mui-right:before{float:right;padding-left:.2em}.mui-icon-contact:before{content:'\e100'}.mui-icon-person:before{content:'\e101'}.mui-icon-personadd:before{content:'\e102'}.mui-icon-contact-filled:before{content:'\e130'}.mui-icon-person-filled:before{content:'\e131'}.mui-icon-personadd-filled:before{content:'\e132'}.mui-icon-phone:before{content:'\e200'}.mui-icon-email:before{content:'\e201'}.mui-icon-chatbubble:before{content:'\e202'}.mui-icon-chatboxes:before{content:'\e203'}.mui-icon-phone-filled:before{content:'\e230'}.mui-icon-email-filled:before{content:'\e231'}.mui-icon-chatbubble-filled:before{content:'\e232'}.mui-icon-chatboxes-filled:before{content:'\e233'}.mui-icon-weibo:before{content:'\e260'}.mui-icon-weixin:before{content:'\e261'}.mui-icon-pengyouquan:before{content:'\e262'}.mui-icon-chat:before{content:'\e263'}.mui-icon-qq:before{content:'\e264'}.mui-icon-videocam:before{content:'\e300'}.mui-icon-camera:before{content:'\e301'}.mui-icon-mic:before{content:'\e302'}.mui-icon-location:before{content:'\e303'}.mui-icon-mic-filled:before,.mui-icon-speech:before{content:'\e332'}.mui-icon-location-filled:before{content:'\e333'}.mui-icon-micoff:before{content:'\e360'}.mui-icon-image:before{content:'\e363'}.mui-icon-map:before{content:'\e364'}.mui-icon-compose:before{content:'\e400'}.mui-icon-trash:before{content:'\e401'}.mui-icon-upload:before{content:'\e402'}.mui-icon-download:before{content:'\e403'}.mui-icon-close:before{content:'\e404'}.mui-icon-redo:before{content:'\e405'}.mui-icon-undo:before{content:'\e406'}.mui-icon-refresh:before{content:'\e407'}.mui-icon-star:before{content:'\e408'}.mui-icon-plus:before{content:'\e409'}.mui-icon-minus:before{content:'\e410'}.mui-icon-checkbox:before,.mui-icon-circle:before{content:'\e411'}.mui-icon-clear:before,.mui-icon-close-filled:before{content:'\e434'}.mui-icon-refresh-filled:before{content:'\e437'}.mui-icon-star-filled:before{content:'\e438'}.mui-icon-plus-filled:before{content:'\e439'}.mui-icon-minus-filled:before{content:'\e440'}.mui-icon-circle-filled:before{content:'\e441'}.mui-icon-checkbox-filled:before{content:'\e442'}.mui-icon-closeempty:before{content:'\e460'}.mui-icon-refreshempty:before{content:'\e461'}.mui-icon-reload:before{content:'\e462'}.mui-icon-starhalf:before{content:'\e463'}.mui-icon-spinner:before{content:'\e464'}.mui-icon-spinner-cycle:before{content:'\e465'}.mui-icon-search:before{content:'\e466'}.mui-icon-plusempty:before{content:'\e468'}.mui-icon-forward:before{content:'\e470'}.mui-icon-back:before,.mui-icon-left-nav:before{content:'\e471'}.mui-icon-checkmarkempty:before{content:'\e472'}.mui-icon-home:before{content:'\e500'}.mui-icon-navigate:before{content:'\e501'}.mui-icon-gear:before{content:'\e502'}.mui-icon-paperplane:before{content:'\e503'}.mui-icon-info:before{content:'\e504'}.mui-icon-help:before{content:'\e505'}.mui-icon-locked:before{content:'\e506'}.mui-icon-more:before{content:'\e507'}.mui-icon-flag:before{content:'\e508'}.mui-icon-home-filled:before{content:'\e530'}.mui-icon-gear-filled:before{content:'\e532'}.mui-icon-info-filled:before{content:'\e534'}.mui-icon-help-filled:before{content:'\e535'}.mui-icon-more-filled:before{content:'\e537'}.mui-icon-settings:before{content:'\e560'}.mui-icon-list:before{content:'\e562'}.mui-icon-bars:before{content:'\e563'}.mui-icon-loop:before{content:'\e565'}.mui-icon-paperclip:before{content:'\e567'}.mui-icon-eye:before{content:'\e568'}.mui-icon-arrowup:before{content:'\e580'}.mui-icon-arrowdown:before{content:'\e581'}.mui-icon-arrowleft:before{content:'\e582'}.mui-icon-arrowright:before{content:'\e583'}.mui-icon-arrowthinup:before{content:'\e584'}.mui-icon-arrowthindown:before{content:'\e585'}.mui-icon-arrowthinleft:before{content:'\e586'}.mui-icon-arrowthinright:before{content:'\e587'}.mui-icon-pulldown:before{content:'\e588'}.mui-fullscreen{position:absolute;top:0;right:0;bottom:0;left:0}.mui-fullscreen.mui-slider .mui-slider-group{height:100%}.mui-fullscreen .mui-segmented-control~.mui-slider-group{position:absolute;top:40px;bottom:0;width:100%;height:auto}.mui-fullscreen.mui-slider .mui-slider-item>a{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.mui-fullscreen .mui-off-canvas-wrap .mui-slider-item>a{top:auto;-webkit-transform:none;transform:none}.mui-bar-nav~.mui-content .mui-slider.mui-fullscreen{top:44px}.mui-bar-tab~.mui-content .mui-slider.mui-fullscreen .mui-segmented-control~.mui-slider-group{bottom:50px}.mui-android.mui-android-4-0 input:focus,.mui-android.mui-android-4-0 textarea:focus{-webkit-user-modify:inherit}.mui-android.mui-android-4-2 input,.mui-android.mui-android-4-2 textarea,.mui-android.mui-android-4-3 input,.mui-android.mui-android-4-3 textarea{-webkit-user-select:text}.mui-ios .mui-table-view-cell{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.mui-plus-visible,.mui-wechat-visible{display:none!important}.mui-plus-hidden,.mui-wechat-hidden{display:block!important}.mui-tab-item.mui-plus-hidden,.mui-tab-item.mui-wechat-hidden{display:table-cell!important}.mui-plus .mui-plus-visible,.mui-wechat .mui-wechat-visible{display:block!important}.mui-plus .mui-tab-item.mui-plus-visible,.mui-wechat .mui-tab-item.mui-wechat-visible{display:table-cell!important}.mui-plus .mui-plus-hidden,.mui-wechat .mui-wechat-hidden{display:none!important}.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-nav{height:64px;padding-top:20px}.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-nav~.mui-content{padding-top:64px}.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-header-secondary,.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-nav~.mui-content .mui-pull-top-pocket{top:64px}.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-header-secondary~.mui-content{padding-top:94px}.mui-iframe-wrapper{position:absolute;right:0;left:0;-webkit-overflow-scrolling:touch}.mui-iframe-wrapper iframe{width:100%;height:100%;border:0} \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/mobileWorks/css/mui.picker.css b/Yangcai365_web/manage/zinc/mobileWorks/css/mui.picker.css new file mode 100644 index 0000000..015723d --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/css/mui.picker.css @@ -0,0 +1,85 @@ +/** + * 选择列表插件 + * varstion 2.0.0 + * by Houfeng + * Houfeng@DCloud.io + */ + +.mui-picker { + background-color: #ddd; + position: relative; + height: 200px; + overflow: hidden; + border: solid 1px rgba(0, 0, 0, 0.1); + -webkit-user-select: none; + user-select: none; + box-sizing: border-box; +} +.mui-picker-inner { + box-sizing: border-box; + position: relative; + width: 100%; + height: 100%; + overflow: hidden; + -webkit-mask-box-image: -webkit-linear-gradient(bottom, transparent, transparent 5%, #fff 20%, #fff 80%, transparent 95%, transparent); + -webkit-mask-box-image: linear-gradient(top, transparent, transparent 5%, #fff 20%, #fff 80%, transparent 95%, transparent); +} +.mui-pciker-list, +.mui-pciker-rule { + box-sizing: border-box; + padding: 0px; + margin: 0px; + width: 100%; + height: 36px; + line-height: 36px; + position: absolute; + left: 0px; + top: 50%; + margin-top: -18px; +} +.mui-pciker-rule-bg { + z-index: 0; + /*background-color: #cfd5da;*/ +} +.mui-pciker-rule-ft { + z-index: 2; + border-top: solid 1px rgba(0, 0, 0, 0.1); + border-bottom: solid 1px rgba(0, 0, 0, 0.1); + /*-webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);*/ + /*box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);*/ +} +.mui-pciker-list { + z-index: 1; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + -webkit-transform: perspective(1000px) rotateY(0deg) rotateX(0deg); + transform: perspective(1000px) rotateY(0deg) rotateX(0deg); +} +.mui-pciker-list li { + width: 100%; + height: 100%; + position: absolute; + text-align: center; + vertical-align: middle; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + overflow: hidden; + box-sizing: border-box; + font-size: 16px; + font-family: "Helvetica Neue", "Helvetica", "Arial", "sans-serif"; + color: #888; + padding: 0px 8px; + white-space: nowrap; + -webkit-text-overflow: ellipsis; + text-overflow: ellipsis; + overflow: hidden; + cursor: default; + visibility: hidden; +} +.mui-pciker-list li.highlight, +.mui-pciker-list li.visible { + visibility: visible; +} +.mui-pciker-list li.highlight { + color: #222; +} \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/mobileWorks/css/mui.poppicker.css b/Yangcai365_web/manage/zinc/mobileWorks/css/mui.poppicker.css new file mode 100644 index 0000000..a96c8a5 --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/css/mui.poppicker.css @@ -0,0 +1,64 @@ +.mui-poppicker { + position: fixed; + left: 0px; + width: 100%; + z-index: 999; + background-color: #eee; + border-top: solid 1px #ccc; + box-shadow: 0px -5px 7px 0px rgba(0, 0, 0, 0.1); + -webkit-transition: .3s; + bottom: 0px; + -webkit-transform: translateY(300px); +} +.mui-poppicker.mui-active { + -webkit-transform: translateY(0px); +} +.mui-android-5-1 .mui-poppicker { + bottom: -300px; + -webkit-transition-property: bottom; + -webkit-transform: none; +} +.mui-android-5-1 .mui-poppicker.mui-active { + bottom: 0px; + -webkit-transition-property: bottom; + -webkit-transform: none; +} +.mui-poppicker-header { + padding: 6px; + font-size: 14px; + color: #888; +} +.mui-poppicker-header .mui-btn { + font-size: 12px; + padding: 5px 10px; +} +.mui-poppicker-btn-cancel { + float: left; +} +.mui-poppicker-btn-ok { + float: right; +} +.mui-poppicker-clear { + clear: both; + height: 0px; + line-height: 0px; + font-size: 0px; + overflow: hidden; +} +.mui-poppicker-body { + position: relative; + width: 100%; + height: 200px; + border-top: solid 1px #ddd; + /*-webkit-perspective: 1200px; + perspective: 1200px; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d;*/ +} +.mui-poppicker-body .mui-picker { + width: 100%; + height: 100%; + margin: 0px; + border: none; + float: left; +} \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/mobileWorks/css/pagination.css b/Yangcai365_web/manage/zinc/mobileWorks/css/pagination.css new file mode 100644 index 0000000..eeafeae --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/css/pagination.css @@ -0,0 +1,201 @@ +/* +*{ + margin: 0px; + padding: 0px; +} +*/ + +.ht-page-hide { + display:none; +} + +.ht-page { + padding: 30px; + text-align: center +} + +.ht-page span { + vertical-align: middle +} + +.ht-page a { + text-decoration: none; + color: #555; + outline: 0 +} + +.ht-page .pagebtn { + width: 52px; + height: 30px; + background: #1875f0; + border: 0; + border-radius: 4px; + color: #fff; + font-size: 14px; + cursor: pointer +} + +.ht-page .pagebtn:hover { + background: #1875f0 +} + +.ht-page .previous { + display: inline-block; + height: 30px; + line-height: 30px; + border: 1px solid #e9e9e9; + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; + background: url(../images/page-left.png) no-repeat center +} + +.ht-page .previous.disable { + display: inline-block; + padding: 0 15px; + background: url(../images/page-disabled.png) no-repeat center; + cursor: default +} + +.ht-page .previous.disable:hover { + background: url(../images/page-disabled-hover.png) no-repeat center +} + +.ht-page .previous:hover { + background: url(../images/page-left-hover.png) no-repeat center +} + +.ht-page .previous a { + display: inline-block; + height: 30px; + line-height: 30px; + padding: 0 15px +} + +.ht-page .next { + display: inline-block; + height: 30px; + line-height: 30px; + border: 1px solid #e9e9e9; + border-left: 0; + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; + background: url(../images/page-right.png) no-repeat center +} + +.ht-page .next:hover { + background: url(../images/page-right-hover.png) no-repeat center +} + +.ht-page .next.disable { + display: inline-block; + padding: 0 15px; + cursor: default; + background: url(../images/page-disabled.png) no-repeat center +} + +.ht-page .next.disable:hover { + background: url(../images/page-disabled-hover.png) no-repeat center +} + +.ht-page .next a { + display: inline-block; + height: 30px; + line-height: 30px; + padding: 0 15px +} + +.ht-page .num { + display: inline-block; + height: 30px; + line-height: 30px; + border: 1px solid #e9e9e9; + border-left: 0 +} + +.ht-page .num.current { + padding: 0 15px; + background: #f1f1f1 +} + +.ht-page .num a { + display: inline-block; + height: 30px; + line-height: 30px; + padding: 0 15px +} + +.ht-page .num a:hover { + color: #555; + background: #f1f1f1 +} + +.ht-page .dots { + display: inline-block; + height: 30px; + line-height: 30px; + border: 1px solid #e9e9e9; + border-left: 0; + padding: 0 15px +} + +.ht-page .total { + margin-left: 20px; + margin-right: 10px +} + +.ht-page .total.total_page { + margin-left: 5px; + margin-right: 5px +} + +.ht-page .page_jump { + margin: 0 10px +} + +.ht-page .pageInput { + width: 60px; + height: 30px; + border: 1px solid #e9e9e9; + outline: 0; + border-radius: 4px; + text-align: center +} + +.ht-page .pageInput:focus { + border: 1px solid #1875f0 +} + +@media screen and (max-width: 799px) { + .ht-page { + padding:10px 0 + } + + .ht-page .num,.ht-page .dots,.ht-page .total { + display: none + } + + .ht-page .num.current { + display: inline-block; + padding: 0 10px + } + + .ht-page .total.total_page { + display: inline-block + } + + /* + .ht-page .pageInput,.ht-page .pagebtn { + width: 40px + } + */ + + /* + .ht-page .pagebtn { + display: none + } + */ + + .ht-page .page_jump { + margin: 0 5px + } +} diff --git a/Yangcai365_web/manage/zinc/mobileWorks/fonts/mui.ttf b/Yangcai365_web/manage/zinc/mobileWorks/fonts/mui.ttf new file mode 100644 index 0000000..45d3b04 Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/fonts/mui.ttf differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/images/degree-gray.png b/Yangcai365_web/manage/zinc/mobileWorks/images/degree-gray.png new file mode 100644 index 0000000..96c0b36 Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/images/degree-gray.png differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/images/degree-red.png b/Yangcai365_web/manage/zinc/mobileWorks/images/degree-red.png new file mode 100644 index 0000000..487aac9 Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/images/degree-red.png differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/images/icons.png b/Yangcai365_web/manage/zinc/mobileWorks/images/icons.png new file mode 100644 index 0000000..90e2a7c Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/images/icons.png differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/images/page-disabled-hover.png b/Yangcai365_web/manage/zinc/mobileWorks/images/page-disabled-hover.png new file mode 100644 index 0000000..3ffbfd8 Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/images/page-disabled-hover.png differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/images/page-disabled.png b/Yangcai365_web/manage/zinc/mobileWorks/images/page-disabled.png new file mode 100644 index 0000000..795fb00 Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/images/page-disabled.png differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/images/page-left-hover.png b/Yangcai365_web/manage/zinc/mobileWorks/images/page-left-hover.png new file mode 100644 index 0000000..7450000 Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/images/page-left-hover.png differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/images/page-left.png b/Yangcai365_web/manage/zinc/mobileWorks/images/page-left.png new file mode 100644 index 0000000..d1920af Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/images/page-left.png differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/images/page-right-hover.png b/Yangcai365_web/manage/zinc/mobileWorks/images/page-right-hover.png new file mode 100644 index 0000000..aaf6387 Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/images/page-right-hover.png differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/images/page-right.png b/Yangcai365_web/manage/zinc/mobileWorks/images/page-right.png new file mode 100644 index 0000000..ebdc8f2 Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/images/page-right.png differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/images/search.png b/Yangcai365_web/manage/zinc/mobileWorks/images/search.png new file mode 100644 index 0000000..0b6c111 Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/images/search.png differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/images/tx.png b/Yangcai365_web/manage/zinc/mobileWorks/images/tx.png new file mode 100644 index 0000000..538e723 Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/images/tx.png differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/images/xjt.png b/Yangcai365_web/manage/zinc/mobileWorks/images/xjt.png new file mode 100644 index 0000000..743639e Binary files /dev/null and b/Yangcai365_web/manage/zinc/mobileWorks/images/xjt.png differ diff --git a/Yangcai365_web/manage/zinc/mobileWorks/js/mobileWorkDetail.js b/Yangcai365_web/manage/zinc/mobileWorks/js/mobileWorkDetail.js new file mode 100644 index 0000000..999f21f --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/js/mobileWorkDetail.js @@ -0,0 +1,44 @@ +$(function(){ +// 点击复制 +$(".btn-copy").on('tap',function(){ + var flag=false + // 创建元素用于复制 + var aux = document.createElement("input"); + // 获取复制内容 + var content = document.querySelector(".val").innerHTML; + console.log(content) + // 解决在移动端进行复制时产生的白屏抖动问题 + aux.setAttribute('readonly', 'readonly') + // 设置元素内容 + aux.setAttribute("value", content); + // 将元素插入页面进行调用 + document.body.appendChild(aux); + // 复制内容 + aux.select(); + // 将内容复制到剪贴板 + document.execCommand("copy"); + // 删除创建元素 + document.body.removeChild(aux); + flag=true + if(flag){ + mui.alert('复制成功', '提示', '确定', '', 'div') + }else{ + mui.alert('复制失败,请重试', '提示', '确定', '', 'div') + } +}) +//显示图片预览数量 +document.querySelector('.mui-slider').addEventListener('slide', function(event) { + console.log(event) + //注意slideNumber是从0开始的; + document.querySelector(".swiper-pagination-current").innerHTML = event.detail.slideNumber+1; +}) +//点击返回至作品库首页 +$(".my-btn-back-works-home").on('tap',function(){ + location.href='./mobileWorksHome.htm' +}) + +//点击返回至模板库首页 +$(".my-btn-back-template-home").on('tap',function(){ + location.href='./mobileTemplateHome.htm' +}) +}) diff --git a/Yangcai365_web/manage/zinc/mobileWorks/js/mobileWorksHome.js b/Yangcai365_web/manage/zinc/mobileWorks/js/mobileWorksHome.js new file mode 100644 index 0000000..1c3fb37 --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/js/mobileWorksHome.js @@ -0,0 +1,118 @@ +$(function(){ + //默认遮罩层 隐藏 + $(".mui-backdrop").addClass('none'); + // 默认选中第一个行业 全部 + $(".my-style").children().first().addClass('actives') + $(".select").children().first().addClass('actives') + + // tab栏切换 + $(".header-cater-left").on('click',function(){ + $(".header-cater-rigth").css("border-bottom", "none;") + $(this).css("border-bottom", "2px solid #54708c;") + $(".dom-arrow").css("display","block") + }) + + $(".header-cater-rigth").on('click',function(){ + $(".header-cater-left").css("border-bottom", "none;") + $(this).css("border-bottom", "2px solid #54708c;") + $(".dom-arrow").css("display","none") + }) + // 更多模板显示和隐藏 + $(".dom-arrow").on('click',function(){ + $(".mui-backdrop").toggleClass('none');//toggleClass() 对设置或移除被选元素的一个或多个类进行切换。 + }) + // 更多模板选中添加样式 + $(".select").on("click",".text-value",function(){ + $(this).addClass('active').siblings().removeClass('active') + $(".mui-backdrop").addClass('none'); + }) + //点击分类显示 + $(".classify").on('tap',function(){ + $(".cates-box").css("display","block") + }) + + // 选择行业 + $(".my-style").on("click",".catres-value",function(){ + $(this).addClass('actives').siblings().removeClass('actives') + }) + $(".select").on("click",".text-value",function(){ + $(this).addClass('actives').siblings().removeClass('actives') + }) + // 确定之后隐藏 + $(".my-style-btn").on("click",function(){ + // 获取右侧遮盖层选中行业数据 + var elem = $(".catres-value.actives"); + var elemId = elem[0].id; + + // 判断页面元素id是否为[全部]的id,否则根据行业id查询作品列表 + if(elemId != "clazz_ind_all"){ + var idStrs = elemId.split("clazz_ind_"); + // 根据行业id查询作品 + doWorksSearchByIndustryId(idStrs[1]); + } else { + // 查询全部 + doWorksSearchByIndustryId(); + } + + $(".cates-box").css("display","none") + }) + $(".box-showdom").on("tap",function(){ + $(".cates-box").css("display","none") + }) + + // 模板库首页-行业选中-确定之后隐藏 + $(".my-style-btn-template-home").on("click",function(){ + // 获取右侧遮盖层选中行业数据 + var elem = $(".catres-value.actives"); + var elemId = elem[0].id; + + // 判断页面元素id是否为[全部]的id,否则根据行业id查询作品列表 + if(elemId != "clazz_ind_all"){ + var idStrs = elemId.split("clazz_ind_"); + // 根据行业id查询作品 + doTemplateSearchByIndustryId(idStrs[1]); + } else { + // 查询全部 + doTemplateSearchByIndustryId(); + } + + $(".cates-box").css("display","none") + }) + $(".box-showdom").on("tap",function(){ + $(".cates-box").css("display","none") + }) + + //显示出返回顶部 + $(window).scrollTop(); + // 被卷去的头部 scrollTop() / 被卷去的左侧 scrollLeft() + // 页面滚动事件 + // .son-box 改为 .commodity-box + var boxTop = $(".commodity-box").offset().top; + $(window).scroll(function() { + // console.log(11); + // console.log($(window).scrollTop()); + if ($(window).scrollTop() >= boxTop) { + $(".top").show(); + } else { + $(".top").hide(); + } + }); + // 返回顶部 + $(".top").click(function() { + clickHandler() + }) + // 动画返回 + function clickHandler() { +     var currentScroll = document.documentElement.scrollTop || document.body.scrollTop; +     if (currentScroll > 0) { +         window.requestAnimationFrame(clickHandler);//专门用于请求动画的API requestAnimationFrame,顾名思义就是请求动画帧。 +         window.scrollTo(0, currentScroll - (currentScroll / 6)); +     } + } + + //搜索之后显示的 + $(".my-classify").on('tap',function(){ + $(".serch-show").show() + $(".header-cater").hide() + }) +}) \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/mobileWorks/js/mui.min.js b/Yangcai365_web/manage/zinc/mobileWorks/js/mui.min.js new file mode 100644 index 0000000..56ed8de --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/js/mui.min.js @@ -0,0 +1,6 @@ +/*! + * ===================================================== + * Mui v3.7.3 (http://dev.dcloud.net.cn/mui) + * ===================================================== + */ +var mui=function(a,b){var c=/complete|loaded|interactive/,d=/^#([\w-]+)$/,e=/^\.([\w-]+)$/,f=/^[\w-]+$/,g=/translate(?:3d)?\((.+?)\)/,h=/matrix(3d)?\((.+?)\)/,i=function(b,c){if(c=c||a,!b)return j();if("object"==typeof b)return i.isArrayLike(b)?j(i.slice.call(b),null):j([b],null);if("function"==typeof b)return i.ready(b);if("string"==typeof b)try{if(b=b.trim(),d.test(b)){var e=a.getElementById(RegExp.$1);return j(e?[e]:[])}return j(i.qsa(b,c),b)}catch(a){}return j()},j=function(a,b){return a=a||[],Object.setPrototypeOf(a,i.fn),a.selector=b||"",a};i.uuid=0,i.data={},i.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},j=1,k=arguments.length,l=!1;for("boolean"==typeof h&&(l=h,h=arguments[j]||{},j++),"object"==typeof h||i.isFunction(h)||(h={}),j===k&&(h=this,j--);j0&&b-1 in a)},i.isWindow=function(a){return null!=a&&a===a.window},i.isObject=function(a){return"object"===i.type(a)},i.isPlainObject=function(a){return i.isObject(a)&&!i.isWindow(a)&&Object.getPrototypeOf(a)===Object.prototype},i.isEmptyObject=function(a){for(var c in a)if(c!==b)return!1;return!0},i.isFunction=function(a){return"function"===i.type(a)},i.qsa=function(b,c){return c=c||a,i.slice.call(e.test(b)?c.getElementsByClassName(RegExp.$1):f.test(b)?c.getElementsByTagName(b):c.querySelectorAll(b))},i.ready=function(b){return c.test(a.readyState)?b(i):a.addEventListener("DOMContentLoaded",function(){b(i)},!1),this},i.buffer=function(a,b,c){function d(){e&&(e.cancel(),e=0),f=i.now(),a.apply(c||this,arguments),g=i.now()}var e,f=0,g=0,b=b||150;return i.extend(function(){!f||g>=f&&i.now()-g>b||g8*b?d.apply(this,arguments):(e&&e.cancel(),e=i.later(d,b,null,i.slice.call(arguments)))},{stop:function(){e&&(e.cancel(),e=0)}})},i.each=function(a,b,c){if(!a)return this;if("number"==typeof a.length)[].every.call(a,function(a,c){return!1!==b.call(a,c,a)});else for(var d in a)if(c){if(a.hasOwnProperty(d)&&!1===b.call(a[d],d,a[d]))return a}else if(!1===b.call(a[d],d,a[d]))return a;return this},i.focus=function(a){i.os.ios?setTimeout(function(){a.focus()},10):a.focus()},i.trigger=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,cancelable:!0})),this},i.getStyles=function(a,b){var c=a.ownerDocument.defaultView.getComputedStyle(a,null);return b?c.getPropertyValue(b)||c[b]:c},i.parseTranslate=function(a,b){var c=a.match(g||"");return c&&c[1]||(c=["","0,0,0"]),c=c[1].split(","),c={x:parseFloat(c[0]),y:parseFloat(c[1]),z:parseFloat(c[2])},b&&c.hasOwnProperty(b)?c[b]:c},i.parseTranslateMatrix=function(a,b){var c=a.match(h),d=c&&c[1];c?(c=c[2].split(","),"3d"===d?c=c.slice(12,15):(c.push(0),c=c.slice(4,7))):c=[0,0,0];var e={x:parseFloat(c[0]),y:parseFloat(c[1]),z:parseFloat(c[2])};return b&&e.hasOwnProperty(b)?e[b]:e},i.hooks={},i.addAction=function(a,b){var c=i.hooks[a];return c||(c=[]),b.index=b.index||1e3,c.push(b),c.sort(function(a,b){return a.index-b.index}),i.hooks[a]=c,i.hooks[a]},i.doAction=function(a,b){i.isFunction(b)?i.each(i.hooks[a],b):i.each(i.hooks[a],function(a,b){return!b.handle()})},i.later=function(a,b,c,d){b=b||0;var e,f,g=a,h=d;return"string"==typeof a&&(g=c[a]),e=function(){g.apply(c,i.isArray(h)?h:[h])},f=setTimeout(e,b),{id:f,cancel:function(){clearTimeout(f)}}},i.now=Date.now||function(){return+new Date};var k={};return i.each(["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error"],function(a,b){k["[object "+b+"]"]=b.toLowerCase()}),window.JSON&&(i.parseJSON=JSON.parse),i.fn={each:function(a){return[].every.call(this,function(b,c){return!1!==a.call(b,c,b)}),this}},"function"==typeof define&&define.amd&&define("mui",[],function(){return i}),i}(document);!function(a,b){function c(c){this.os={};var d=[function(){var a=c.match(/(MicroMessenger)\/([\d\.]+)/i);return a&&(this.os.wechat={version:a[2].replace(/_/g,".")}),!1},function(){var a=c.match(/(Android);?[\s\/]+([\d.]+)?/);return a&&(this.os.android=!0,this.os.version=a[2],this.os.isBadAndroid=!/Chrome\/\d/.test(b.navigator.appVersion)),!0===this.os.android},function(){var a=c.match(/(iPhone\sOS)\s([\d_]+)/);if(a)this.os.ios=this.os.iphone=!0,this.os.version=a[2].replace(/_/g,".");else{var b=c.match(/(iPad).*OS\s([\d_]+)/);b&&(this.os.ios=this.os.ipad=!0,this.os.version=b[2].replace(/_/g,"."))}return!0===this.os.ios}];[].every.call(d,function(b){return!b.call(a)})}c.call(a,navigator.userAgent)}(mui,window),function(a,b){function c(c){this.os=this.os||{},c.match(/Html5Plus/i)&&(this.os.plus=!0,a(function(){b.body.classList.add("mui-plus")}),c.match(/StreamApp/i)&&(this.os.stream=!0,a(function(){b.body.classList.add("mui-plus-stream")})))}c.call(a,navigator.userAgent)}(mui,document),function(a){"ontouchstart"in window?(a.isTouchable=!0,a.EVENT_START="touchstart",a.EVENT_MOVE="touchmove",a.EVENT_END="touchend"):(a.isTouchable=!1,a.EVENT_START="mousedown",a.EVENT_MOVE="mousemove",a.EVENT_END="mouseup"),a.EVENT_CANCEL="touchcancel",a.EVENT_CLICK="click";var b=1,c={},d={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"},e=function(){return!0},f=function(){return!1},g=function(b,c){return b.detail?b.detail.currentTarget=c:b.detail={currentTarget:c},a.each(d,function(a,c){var d=b[a];b[a]=function(){return this[c]=e,d&&d.apply(b,arguments)},b[c]=f},!0),b},h=function(a){return a&&(a._mid||(a._mid=b++))},i={},j=function(b,d,e,f){return function(e){for(var f=c[b._mid][d],h=[],i=e.target,j={};i&&i!==document&&i!==b&&(!~["click","tap","doubletap","longtap","hold"].indexOf(d)||!i.disabled&&!i.classList.contains("mui-disabled"));i=i.parentNode){var k={};a.each(f,function(c,d){j[c]||(j[c]=a.qsa(c,b)),j[c]&&~j[c].indexOf(i)&&(k[c]||(k[c]=d))},!0),a.isEmptyObject(k)||h.push({element:i,handlers:k})}j=null,e=g(e),a.each(h,function(b,c){i=c.element;var f=i.tagName;if("tap"===d&&"INPUT"!==f&&"TEXTAREA"!==f&&"SELECT"!==f&&(e.preventDefault(),e.detail&&e.detail.gesture&&e.detail.gesture.preventDefault()),a.each(c.handlers,function(b,c){a.each(c,function(a,b){!1===b.call(i,e)&&(e.preventDefault(),e.stopPropagation())},!0)},!0),e.isPropagationStopped())return!1},!0)}},k=function(a,b){var c=i[h(a)],d=[];if(c){if(d=[],b){var e=function(a){return a.type===b};return c.filter(e)}d=c}return d},l=/^(INPUT|TEXTAREA|BUTTON|SELECT)$/;a.fn.on=function(b,d,e){return this.each(function(){var f=this;h(f),h(e);var g=!1,k=c[f._mid]||(c[f._mid]={}),m=k[b]||(k[b]={});if(a.isEmptyObject(m)&&(g=!0),(m[d]||(m[d]=[])).push(e),g){var n=i[h(f)];n||(n=[]);var o=j(f,b,d,e);n.push(o),o.i=n.length-1,o.type=b,i[h(f)]=n,f.addEventListener(b,o),"tap"===b&&f.addEventListener("click",function(a){if(a.target){var b=a.target.tagName;if(!l.test(b))if("A"===b){var c=a.target.href;c&&~c.indexOf("tel:")||a.preventDefault()}else a.preventDefault()}})}})},a.fn.off=function(b,d,e){return this.each(function(){var f=h(this);if(b)if(d)if(e){var g=c[f]&&c[f][b]&&c[f][b][d];a.each(g,function(a,b){if(h(b)===h(e))return g.splice(a,1),!1},!0)}else c[f]&&c[f][b]&&delete c[f][b][d];else c[f]&&delete c[f][b];else c[f]&&delete c[f];c[f]?c[f][b]&&!a.isEmptyObject(c[f][b])||k(this,b).forEach(function(a){this.removeEventListener(a.type,a),delete i[f][a.i]}.bind(this)):k(this).forEach(function(a){this.removeEventListener(a.type,a),delete i[f][a.i]}.bind(this))})}}(mui),function(a,b,c){a.targets={},a.targetHandles=[],a.registerTarget=function(b){return b.index=b.index||1e3,a.targetHandles.push(b),a.targetHandles.sort(function(a,b){return a.index-b.index}),a.targetHandles},b.addEventListener(a.EVENT_START,function(b){for(var d=b.target,e={};d&&d!==c;d=d.parentNode){var f=!1;if(a.each(a.targetHandles,function(c,g){var h=g.name;f||e[h]||!g.hasOwnProperty("handle")?e[h]||!1!==g.isReset&&(a.targets[h]=!1):(a.targets[h]=g.handle(b,d),a.targets[h]&&(e[h]=!0,!0!==g.isContinue&&(f=!0)))}),f)break}}),b.addEventListener("click",function(b){for(var d=b.target,e=!1;d&&d!==c&&("A"!==d.tagName||(a.each(a.targetHandles,function(a,c){c.name;if(c.hasOwnProperty("handle")&&c.handle(b,d))return e=!0,b.preventDefault(),!1}),!e));d=d.parentNode);})}(mui,window,document),function(a){String.prototype.trim===a&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Object.setPrototypeOf=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a}}(),function(){function a(a,b){b=b||{bubbles:!1,cancelable:!1,detail:void 0};var c=document.createEvent("Events"),d=!0;for(var e in b)"bubbles"===e?d=!!b[e]:c[e]=b[e];return c.initEvent(a,d,!0),c}void 0===window.CustomEvent&&(a.prototype=window.Event.prototype,window.CustomEvent=a)}(),Function.prototype.bind=Function.prototype.bind||function(a){var b=Array.prototype.splice.call(arguments,1),c=this,d=function(){var e=b.concat(Array.prototype.splice.call(arguments,0));if(!(this instanceof d))return c.apply(a,e);c.apply(this,e)};return d.prototype=c.prototype,d},function(a){"classList"in a.documentElement||!Object.defineProperty||"undefined"==typeof HTMLElement||Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){function a(a){return function(c){var d=b.className.split(/\s+/),e=d.indexOf(c);a(d,e,c),b.className=d.join(" ")}}var b=this,c={add:a(function(a,b,c){~b||a.push(c)}),remove:a(function(a,b){~b&&a.splice(b,1)}),toggle:a(function(a,b,c){~b?a.splice(b,1):a.push(c)}),contains:function(a){return!!~b.className.split(/\s+/).indexOf(a)},item:function(a){return b.className.split(/\s+/)[a]||null}};return Object.defineProperty(c,"length",{get:function(){return b.className.split(/\s+/).length}}),c}})}(document),function(a){if(!a.requestAnimationFrame){var b=0;a.requestAnimationFrame=a.webkitRequestAnimationFrame||function(c,d){var e=(new Date).getTime(),f=Math.max(0,16.7-(e-b)),g=a.setTimeout(function(){c(e+f)},f);return b=e+f,g},a.cancelAnimationFrame=a.webkitCancelAnimationFrame||a.webkitCancelRequestAnimationFrame||function(a){clearTimeout(a)}}}(window),function(a,b,c){if((a.os.android||a.os.ios)&&!b.FastClick){var d=function(a,b){return"LABEL"===b.tagName&&b.parentNode&&(b=b.parentNode.querySelector("input")),!(!b||"radio"!==b.type&&"checkbox"!==b.type||b.disabled)&&b};a.registerTarget({name:c,index:40,handle:d,target:!1});var e=function(c){var d=a.targets.click;if(d){var e,f;document.activeElement&&document.activeElement!==d&&document.activeElement.blur(),f=c.detail.gesture.changedTouches[0],e=document.createEvent("MouseEvents"),e.initMouseEvent("click",!0,!0,b,1,f.screenX,f.screenY,f.clientX,f.clientY,!1,!1,!1,!1,0,null),e.forwardedTouchEvent=!0,d.dispatchEvent(e),c.detail&&c.detail.gesture.preventDefault()}};b.addEventListener("tap",e),b.addEventListener("doubletap",e),b.addEventListener("click",function(b){if(a.targets.click&&!b.forwardedTouchEvent)return b.stopImmediatePropagation?b.stopImmediatePropagation():b.propagationStopped=!0,b.stopPropagation(),b.preventDefault(),!1},!0)}}(mui,window,"click"),function(a,b){a(function(){if(a.os.ios){var c="mui-focusin";b.addEventListener("focusin",function(d){if(!(a.os.plus&&window.plus&&plus.webview.currentWebview().children().length>0)){var e=d.target;if(e.tagName&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName&&("text"===e.type||"search"===e.type||"number"===e.type))){if(e.disabled||e.readOnly)return;b.body.classList.add(c);for(var f=!1;e&&e!==b;e=e.parentNode){var g=e.classList;if(g&&g.contains("mui-bar-tab")||g.contains("mui-bar-footer")||g.contains("mui-bar-footer-secondary")||g.contains("mui-bar-footer-secondary-tab")){f=!0;break}}if(f){var h=b.body.scrollHeight,i=b.body.scrollLeft;setTimeout(function(){window.scrollTo(i,h)},20)}}}}),b.addEventListener("focusout",function(a){var d=b.body.classList;d.contains(c)&&(d.remove(c),setTimeout(function(){window.scrollTo(b.body.scrollLeft,b.body.scrollTop)},20))})}})}(mui,document),function(a){a.namespace="mui",a.classNamePrefix=a.namespace+"-",a.classSelectorPrefix="."+a.classNamePrefix,a.className=function(b){return a.classNamePrefix+b},a.classSelector=function(b){return b.replace(/\./g,a.classSelectorPrefix)},a.eventName=function(b,c){return b+(a.namespace?"."+a.namespace:"")+(c?"."+c:"")}}(mui),function(a,b){a.gestures={session:{}},a.preventDefault=function(a){a.preventDefault()},a.stopPropagation=function(a){a.stopPropagation()},a.addGesture=function(b){return a.addAction("gestures",b)};var c=Math.round,d=Math.abs,e=Math.sqrt,f=(Math.atan,Math.atan2),g=function(a,b,c){c||(c=["x","y"]);var d=b[c[0]]-a[c[0]],f=b[c[1]]-a[c[1]];return e(d*d+f*f)},h=function(a,b){if(a.length>=2&&b.length>=2){var c=["pageX","pageY"];return g(b[1],b[0],c)/g(a[1],a[0],c)}return 1},i=function(a,b,c){c||(c=["x","y"]);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*f(e,d)/Math.PI},j=function(a,b){return a===b?"":d(a)>=d(b)?a>0?"left":"right":b>0?"up":"down"},k=function(a,b){var c=["pageX","pageY"];return i(b[1],b[0],c)-i(a[1],a[0],c)},l=function(a,b,c){return{x:b/a||0,y:c/a||0}},m=function(b,c){a.gestures.stoped||a.doAction("gestures",function(d,e){a.gestures.stoped||!1!==a.options.gestureConfig[e.name]&&e.handle(b,c)})},n=function(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1},o=function(a,b,c){for(var d=[],e=[],f=0;fc[b]}):d.sort()),d},p=function(a){var b=a.length;if(1===b)return{x:c(a[0].pageX),y:c(a[0].pageY)};for(var d=0,e=0,f=0;f1&&!c.firstMultiTouch?c.firstMultiTouch=r(b):1===e&&(c.firstMultiTouch=!1);var f=c.firstTouch,l=c.firstMultiTouch,m=l?l.center:f.center,n=b.center=p(d);b.timestamp=a.now(),b.deltaTime=b.timestamp-f.timestamp,b.angle=i(m,n),b.distance=g(m,n),s(b),b.offsetDirection=j(b.deltaX,b.deltaY),b.scale=l?h(l.touches,d):1,b.rotation=l?k(l.touches,d):0,v(b)},u=25,v=function(b){var c,e,f,g,h=a.gestures.session,i=h.lastInterval||b,k=b.timestamp-i.timestamp;if(b.gesture.type!=a.EVENT_CANCEL&&(k>u||void 0===i.velocity)){var m=i.deltaX-b.deltaX,n=i.deltaY-b.deltaY,o=l(k,m,n);e=o.x,f=o.y,c=d(o.x)>d(o.y)?o.x:o.y,g=j(m,n)||i.direction,h.lastInterval=b}else c=i.velocity,e=i.velocityX,f=i.velocityY,g=i.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g},w={},x=function(a){for(var b=0;b300&&(c=h,f.flickStart=e.center);break;case a.EVENT_END:case a.EVENT_CANCEL:e.flick=!1,f.flickStart&&g.flickMaxTime>h-c&&e.distance>g.flickMinDistince&&(e.flick=!0,e.flickTime=h-c,e.flickDistanceX=e.center.x-f.flickStart.x,e.flickDistanceY=e.center.y-f.flickStart.y,a.trigger(f.target,b,e),a.trigger(f.target,b+e.direction,e))}};a.addGesture({name:b,index:5,handle:d,options:{flickMaxTime:200,flickMinDistince:10}})}(mui,"flick"),function(a,b){var c=function(c,d){var e=a.gestures.session;if(c.type===a.EVENT_END||c.type===a.EVENT_CANCEL){var f=this.options;d.swipe=!1,d.direction&&f.swipeMaxTime>d.deltaTime&&d.distance>f.swipeMinDistince&&(d.swipe=!0,a.trigger(e.target,b,d),a.trigger(e.target,b+d.direction,d))}};a.addGesture({name:b,index:10,handle:c,options:{swipeMaxTime:300,swipeMinDistince:18}})}(mui,"swipe"),function(a,b){var c=function(c,d){var e=a.gestures.session;switch(c.type){case a.EVENT_START:break;case a.EVENT_MOVE:if(!d.direction||!e.target)return;e.lockDirection&&e.startDirection&&e.startDirection&&e.startDirection!==d.direction&&("up"===e.startDirection||"down"===e.startDirection?d.direction=d.deltaY<0?"up":"down":d.direction=d.deltaX<0?"left":"right"),e.drag||(e.drag=!0,a.trigger(e.target,b+"start",d)),a.trigger(e.target,b,d),a.trigger(e.target,b+d.direction,d);break;case a.EVENT_END:case a.EVENT_CANCEL:e.drag&&d.isFinal&&a.trigger(e.target,b+"end",d)}};a.addGesture({name:b,index:20,handle:c,options:{fingers:1}})}(mui,"drag"),function(a,b){var c,d,e=function(e,f){var g=a.gestures.session,h=this.options;switch(e.type){case a.EVENT_END:if(!f.isFinal)return;var i=g.target;if(!i||i.disabled||i.classList&&i.classList.contains("mui-disabled"))return;if(f.distanceg.holdThreshold&&clearTimeout(c);break;case a.EVENT_END:case a.EVENT_CANCEL:clearTimeout(c)}};a.addGesture({name:b,index:10,handle:d,options:{fingers:1,holdTimeout:500,holdThreshold:2}})}(mui,"longtap"),function(a,b){var c,d=function(d,e){var f=a.gestures.session,g=this.options;switch(d.type){case a.EVENT_START:a.options.gestureConfig.hold&&(c&&clearTimeout(c),c=setTimeout(function(){e.hold=!0,a.trigger(f.target,b,e)},g.holdTimeout));break;case a.EVENT_MOVE:break;case a.EVENT_END:case a.EVENT_CANCEL:c&&(clearTimeout(c)&&(c=null),a.trigger(f.target,"release",e))}};a.addGesture({name:b,index:10,handle:d,options:{fingers:1,holdTimeout:0}})}(mui,"hold"),function(a,b){var c=function(c,d){var e=this.options,f=a.gestures.session;switch(c.type){case a.EVENT_START:break;case a.EVENT_MOVE:if(a.options.gestureConfig.pinch){if(d.touches.length<2)return;f.pinch||(f.pinch=!0,a.trigger(f.target,b+"start",d)),a.trigger(f.target,b,d);var g=d.scale,h=d.rotation,i=void 0===d.lastScale?1:d.lastScale,j=1e-12;g>i?(i=g-j,a.trigger(f.target,b+"out",d)):ge.minRotationAngle&&a.trigger(f.target,"rotate",d)}break;case a.EVENT_END:case a.EVENT_CANCEL:a.options.gestureConfig.pinch&&f.pinch&&2===d.touches.length&&(f.pinch=!1,a.trigger(f.target,b+"end",d))}};a.addGesture({name:b,index:10,handle:c,options:{minRotationAngle:0}})}(mui,"pinch"),function(a){function b(a,b){var c="MUI_SCROLL_POSITION_"+document.location.href+"_"+b.src,d=parseFloat(localStorage.getItem(c))||0;d&&function(a){b.onload=function(){window.scrollTo(0,a)}}(d),setInterval(function(){var a=window.scrollY;d!==a&&(localStorage.setItem(c,a+""),d=a)},100)}a.global=a.options={gestureConfig:{tap:!0,doubletap:!1,longtap:!1,hold:!1,flick:!0,swipe:!0,drag:!0,pinch:!1}},a.initGlobal=function(b){return a.options=a.extend(!0,a.global,b),this};var c={};a.init=function(b){return a.options=a.extend(!0,a.global,b||{}),a.ready(function(){a.doAction("inits",function(b,d){!(c[d.name]&&!d.repeat)&&(d.handle.call(a),c[d.name]=!0)})}),this},a.addInit=function(b){return a.addAction("inits",b)},a.addInit({name:"iframe",index:100,handle:function(){var b=a.options,c=b.subpages||[];!a.os.plus&&c.length&&d(c[0])}});var d=function(c){var d=document.createElement("div");d.className="mui-iframe-wrapper";var e=c.styles||{};"string"!=typeof e.top&&(e.top="0px"),"string"!=typeof e.bottom&&(e.bottom="0px"),d.style.top=e.top,d.style.bottom=e.bottom;var f=document.createElement("iframe");f.src=c.url,f.id=c.id||c.url,f.name=f.id,d.appendChild(f),document.body.appendChild(d),a.os.wechat&&b(d,f)};a(function(){var b=document.body.classList,c=[];a.os.ios?(c.push({os:"ios",version:a.os.version}),b.add("mui-ios")):a.os.android&&(c.push({os:"android",version:a.os.version}),b.add("mui-android")),a.os.wechat&&(c.push({os:"wechat",version:a.os.wechat.version}),b.add("mui-wechat")),c.length&&a.each(c,function(c,d){var e="";d.version&&a.each(d.version.split("."),function(c,f){e=e+(e?"-":"")+f,b.add(a.className(d.os+"-"+e))})})})}(mui),function(a){var b={swipeBack:!1,preloadPages:[],preloadLimit:10,keyEventBind:{backbutton:!0,menubutton:!0},titleConfig:{height:"44px",backgroundColor:"#f7f7f7",bottomBorderColor:"#cccccc",title:{text:"",position:{top:0,left:0,width:"100%",height:"100%"},styles:{color:"#000000",align:"center",family:"'Helvetica Neue',Helvetica,sans-serif",size:"17px",style:"normal",weight:"normal",fontSrc:""}},back:{image:{base64Data:"",imgSrc:"",sprite:{top:"0px",left:"0px",width:"100%",height:"100%"},position:{top:"10px",left:"10px",width:"24px",height:"24px"}}}}},c={event:"titleUpdate",autoShow:!0,duration:300,aniShow:"slide-in-right",extras:{}};a.options.show&&(c=a.extend(!0,c,a.options.show)),a.currentWebview=null,a.extend(!0,a.global,b),a.extend(!0,a.options,b),a.waitingOptions=function(b){return a.extend(!0,{},{autoShow:!0,title:"",modal:!1},b)},a.showOptions=function(b){return a.extend(!0,{},c,b)},a.windowOptions=function(b){return a.extend({scalable:!1,bounce:""},b)},a.plusReady=function(a){return window.plus?setTimeout(function(){a()},0):document.addEventListener("plusready",function(){a()},!1),this},a.fire=function(b,c,d){if(b){if(void 0===d)d="";else{if("boolean"==typeof d||"number"==typeof d)return void b.evalJS("typeof mui!=='undefined'&&mui.receive('"+c+"',"+d+")");(a.isPlainObject(d)||a.isArray(d))&&(d=JSON.stringify(d||{}).replace(/\'/g,"\\u0027").replace(/\\/g,"\\u005c"))}b.evalJS("typeof mui!=='undefined'&&mui.receive('"+c+"','"+d+"')")}},a.receive=function(b,c){if(b){try{c&&"string"==typeof c&&(c=JSON.parse(c))}catch(a){}a.trigger(document,b,c)}};var d=function(b){if(!b.preloaded){a.fire(b,"preload");for(var c=b.children(),d=0;dt.left&&ca.options.preloadLimit){var h=a.data.preloads.shift(),i=a.webviews[h];i&&i.webview&&a.closeAll(i.webview),delete a.webviews[h]}}else!1!==c&&(d=plus.webview.create(b.url,e,a.windowOptions(b.styles),b.extras),b.subpages&&a.each(b.subpages,function(b,c){var e=c.id||c.url,f=plus.webview.getWebviewById(e);f||(f=plus.webview.create(c.url,e,a.windowOptions(c.styles),c.extras)),d.append(f)}));return d}},a.preload=function(b){return b.preload||(b.preload=!0),a.createWindow(b)},a.closeOpened=function(b){var c=b.opened();if(c)for(var d=0,e=c.length;d0?(a.closeOpened(f),f.close("none")):f.parent()!==b&&f.close("none")}},a.closeAll=function(b,c){a.closeOpened(b),c?b.close(c):b.close()},a.createWindows=function(b){a.each(b,function(b,c){a.createWindow(c,!1)})},a.appendWebview=function(b){if(window.plus){var c,d=b.id||b.url;return a.webviews[d]||(plus.webview.getWebviewById(d)||(c=plus.webview.create(b.url,d,b.styles,b.extras)),plus.webview.currentWebview().append(c),a.webviews[d]=b),c}},a.webviews={},a.data.preloads=[],a.plusReady(function(){a.currentWebview=plus.webview.currentWebview()}),a.addInit({name:"5+",index:100,handle:function(){var b=a.options,c=b.subpages||[];a.os.plus&&a.plusReady(function(){a.each(c,function(b,c){a.appendWebview(c)}),plus.webview.currentWebview()===plus.webview.getWebviewById(plus.runtime.appid)&&setTimeout(function(){d(plus.webview.currentWebview())},300),a.os.ios&&a.options.statusBarBackground&&plus.navigator.setStatusBarBackground(a.options.statusBarBackground),a.os.android&&parseFloat(a.os.version)<4.4&&null==plus.webview.currentWebview().parent()&&document.addEventListener("resume",function(){var a=document.body;a.style.display="none",setTimeout(function(){a.style.display=""},10)})})}}),window.addEventListener("preload",function(){var b=a.options.preloadPages||[];a.plusReady(function(){a.each(b,function(b,c){a.createWindow(a.extend(c,{preload:!0}))})})}),a.supportStatusbarOffset=function(){return a.os.plus&&a.os.ios&&parseFloat(a.os.version)>=7},a.ready(function(){a.supportStatusbarOffset()&&document.body.classList.add("mui-statusbar")})}(mui),function(a,b){a.addBack=function(b){return a.addAction("backs",b)},a.addBack({name:"browser",index:100,handle:function(){return b.history.length>1&&(b.history.back(),!0)}}),a.back=function(){"function"==typeof a.options.beforeback&&!1===a.options.beforeback()||a.doAction("backs")},b.addEventListener("tap",function(b){var c=a.targets.action;c&&c.classList.contains("mui-action-back")&&(a.back(),a.targets.action=!1)}),b.addEventListener("swiperight",function(b){var c=b.detail;!0===a.options.swipeBack&&Math.abs(c.angle)<3&&a.back()})}(mui,window),function(a,b){a.os.plus&&a.os.android&&a.addBack({name:"mui",index:5,handle:function(){if(a.targets._popover&&a.targets._popover.classList.contains("mui-active"))return a(a.targets._popover).popover("hide"),!0;var b=document.querySelector(".mui-off-canvas-wrap.mui-active");if(b)return a(b).offCanvas("close"),!0;var c=a.isFunction(a.getPreviewImage)&&a.getPreviewImage();return c&&c.isShown()?(c.close(),!0):a.closePopup()}}),a.__back__first=null,a.addBack({name:"5+",index:10,handle:function(){if(!b.plus)return!1;var c=plus.webview.currentWebview(),d=c.parent();return d?d.evalJS("mui&&mui.back();"):c.canBack(function(d){d.canBack?b.history.back():c.id===plus.runtime.appid?a.__back__first?(new Date).getTime()-a.__back__first<2e3&&plus.runtime.quit():(a.__back__first=(new Date).getTime(),mui.toast("再按一次退出应用"),setTimeout(function(){a.__back__first=null},2e3)):c.preload?c.hide("auto"):a.closeAll(c)}),!0}}),a.menu=function(){var c=document.querySelector(".mui-action-menu");if(c)a.trigger(c,a.EVENT_START),a.trigger(c,"tap");else if(b.plus){var d=a.currentWebview,e=d.parent();e&&e.evalJS("mui&&mui.menu();")}};var c=function(){a.back()},d=function(){a.menu()};a.plusReady(function(){a.options.keyEventBind.backbutton&&plus.key.addEventListener("backbutton",c,!1),a.options.keyEventBind.menubutton&&plus.key.addEventListener("menubutton",d,!1)}),a.addInit({name:"keyEventBind",index:1e3,handle:function(){a.plusReady(function(){a.options.keyEventBind.backbutton||plus.key.removeEventListener("backbutton",c),a.options.keyEventBind.menubutton||plus.key.removeEventListener("menubutton",d)})}})}(mui,window),function(a){a.addInit({name:"pullrefresh",index:1e3,handle:function(){var b=a.options,c=b.pullRefresh||{},d=c.down&&c.down.hasOwnProperty("callback"),e=c.up&&c.up.hasOwnProperty("callback");if(d||e){var f=c.container;if(f){var g=a(f);1===g.length&&(a.os.plus?d&&"circle"==c.down.style?a.plusReady(function(){a.fn.pullRefresh=a.fn.pullRefresh_native,g.pullRefresh(c)}):a.os.android?a.plusReady(function(){a.fn.pullRefresh=a.fn.pullRefresh_native;var b=plus.webview.currentWebview();if(!1===window.__NWin_Enable__)g.pullRefresh(c);else{if(e){var f={};f.up=c.up,f.webviewId=b.id||b.getURL(),g.pullRefresh(f)}if(d){var h=b.parent(),i=b.id||b.getURL();if(h){e||g.pullRefresh({webviewId:i});var j={webviewId:i};j.down=a.extend({},c.down),j.down.callback="_CALLBACK",h.evalJS("mui.fn.pullRefresh=mui.fn.pullRefresh_native"),h.evalJS("mui&&mui(document.querySelector('.mui-content')).pullRefresh('"+JSON.stringify(j)+"')")}}}}):g.pullRefresh(c):g.pullRefresh(c))}}}})}(mui),function(a,b,c){var d="application/json",e="text/html",f=/)<[^<]*)*<\/script>/gi,g=/^(?:text|application)\/javascript/i,h=/^(?:text|application)\/xml/i,i=/^\s*$/;a.ajaxSettings={type:"GET",beforeSend:a.noop,success:a.noop,error:a.noop,complete:a.noop,context:null,xhr:function(a){return new b.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:d,xml:"application/xml, text/xml",html:e,text:"text/plain"},timeout:0,processData:!0,cache:!0};var j=function(a,b){var c=b.context;if(!1===b.beforeSend.call(c,a,b))return!1},k=function(a,b,c){c.success.call(c.context,a,"success",b),m("success",b,c)},l=function(a,b,c,d){d.error.call(d.context,c,b,a),m(b,c,d)},m=function(a,b,c){c.complete.call(c.context,b,a)},n=function(b,c,d,e){var f,g=a.isArray(c),h=a.isPlainObject(c);a.each(c,function(c,i){f=a.type(i),e&&(c=d?e:e+"["+(h||"object"===f||"array"===f?c:"")+"]"),!e&&g?b.add(i.name,i.value):"array"===f||!d&&"object"===f?n(b,i,d,c):b.add(c,i)})},o=function(b){if(b.processData&&b.data&&"string"!=typeof b.data){var e=b.contentType;!e&&b.headers&&(e=b.headers["Content-Type"]),e&&~e.indexOf(d)?b.data=JSON.stringify(b.data):b.data=a.param(b.data,b.traditional)}!b.data||b.type&&"GET"!==b.type.toUpperCase()||(b.url=p(b.url,b.data),b.data=c)},p=function(a,b){return""===b?a:(a+"&"+b).replace(/[&?]{1,2}/,"?")},q=function(a){return a&&(a=a.split(";",2)[0]),a&&(a===e?"html":a===d?"json":g.test(a)?"script":h.test(a)&&"xml")||"text"},r=function(b,d,e,f){return a.isFunction(d)&&(f=e,e=d,d=c),a.isFunction(e)||(f=e,e=c),{url:b,data:d,success:e,dataType:f}};a.ajax=function(d,e){"object"==typeof d&&(e=d,d=c);var f=e||{};f.url=d||f.url;for(var g in a.ajaxSettings)f[g]===c&&(f[g]=a.ajaxSettings[g]);o(f);var h=f.dataType;!1!==f.cache&&(e&&!0===e.cache||"script"!==h)||(f.url=p(f.url,"_="+a.now()));var m=f.accepts[h&&h.toLowerCase()],n={},r=function(a,b){n[a.toLowerCase()]=[a,b]},s=/^([\w-]+:)\/\//.test(f.url)?RegExp.$1:b.location.protocol,t=f.xhr(f);"file:"===location.protocol&&a.os.ios&&b.webkit&&b.webkit.messageHandlers&&!(t instanceof plus.net.XMLHttpRequest)&&console.error("当前运行环境为WKWebview,需在plusReady事件触发后再调用mui.ajax,否则可能会执行失败或报Script error的错误");var u,v=t.setRequestHeader;if(r("X-Requested-With","XMLHttpRequest"),r("Accept",m||"*/*"),(m=f.mimeType||m)&&(m.indexOf(",")>-1&&(m=m.split(",",2)[0]),t.overrideMimeType&&t.overrideMimeType(m)),(f.contentType||!1!==f.contentType&&f.data&&"GET"!==f.type.toUpperCase())&&r("Content-Type",f.contentType||"application/x-www-form-urlencoded"),f.headers)for(var w in f.headers)r(w,f.headers[w]);if(t.setRequestHeader=r,t.onreadystatechange=function(){if(4===t.readyState){t.onreadystatechange=a.noop,clearTimeout(u);var b,c=!1,d="file:"===s;if(t.status>=200&&t.status<300||304===t.status||0===t.status&&d&&t.responseText){h=h||q(f.mimeType||t.getResponseHeader("content-type")),b=t.responseText;try{"script"===h?(0,eval)(b):"xml"===h?b=t.responseXML:"json"===h&&(b=i.test(b)?null:a.parseJSON(b))}catch(a){c=a}c?l(c,"parsererror",t,f):k(b,t,f)}else{var e=t.status?"error":"abort",g=t.statusText||null;d&&(e="error",g="404"),l(g,e,t,f)}}},!1===j(t,f))return t.abort(),l(null,"abort",t,f),t;if(f.xhrFields)for(var w in f.xhrFields)t[w]=f.xhrFields[w];var x=!("async"in f)||f.async;t.open(f.type.toUpperCase(),f.url,x,f.username,f.password);for(var w in n)n.hasOwnProperty(w)&&v.apply(t,n[w]);return f.timeout>0&&(u=setTimeout(function(){t.onreadystatechange=a.noop,t.abort(),l(null,"timeout",t,f)},f.timeout)),t.send(f.data?f.data:null),t},a.param=function(a,b){var c=[];return c.add=function(a,b){this.push(encodeURIComponent(a)+"="+encodeURIComponent(b))},n(c,a,b),c.join("&").replace(/%20/g,"+")},a.get=function(){return a.ajax(r.apply(null,arguments))},a.post=function(){var b=r.apply(null,arguments);return b.type="POST",a.ajax(b)},a.getJSON=function(){var b=r.apply(null,arguments);return b.dataType="json",a.ajax(b)},a.fn.load=function(b,c,d){if(!this.length)return this;var e,g=this,h=b.split(/\s/),i=r(b,c,d),j=i.success;return h.length>1&&(i.url=h[0],e=h[1]),i.success=function(a){if(e){var b=document.createElement("div");b.innerHTML=a.replace(f,"");var c=document.createElement("div"),d=b.querySelectorAll(e);if(d&&d.length>0)for(var h=0,i=d.length;h','
            ','
            {contentrefresh}
            ',"
            "].join(""),v={init:function(b,c){this._super(b,a.extend(!0,{scrollY:!0,scrollX:!1,indicators:!0,deceleration:.003,down:{height:50,contentinit:"下拉可以刷新",contentdown:"下拉可以刷新",contentover:"释放立即刷新",contentrefresh:"正在刷新..."},up:{height:50,auto:!1,contentinit:"上拉显示更多",contentdown:"上拉显示更多",contentrefresh:"正在加载...",contentnomore:"没有更多数据了",duration:300}},c))},_init:function(){this._super(),this._initPocket()},_initPulldownRefresh:function(){this.pulldown=!0,this.topPocket&&(this.pullPocket=this.topPocket,this.pullPocket.classList.add(o),this.pullPocket.classList.add(q),this.pullCaption=this.topCaption,this.pullLoading=this.topLoading)},_initPullupRefresh:function(){this.pulldown=!1,this.bottomPocket&&(this.pullPocket=this.bottomPocket,this.pullPocket.classList.add(o),this.pullPocket.classList.add(q),this.pullCaption=this.bottomCaption,this.pullLoading=this.bottomLoading)},_initPocket:function(){var a=this.options;a.down&&a.down.hasOwnProperty("callback")&&(this.topPocket=this.scroller.querySelector("."+d),this.topPocket||(this.topPocket=this._createPocket(d,a.down,s),this.wrapper.insertBefore(this.topPocket,this.wrapper.firstChild)),this.topLoading=this.topPocket.querySelector("."+g),this.topCaption=this.topPocket.querySelector("."+h)),a.up&&a.up.hasOwnProperty("callback")&&(this.bottomPocket=this.scroller.querySelector("."+e),this.bottomPocket||(this.bottomPocket=this._createPocket(e,a.up,t),this.scroller.appendChild(this.bottomPocket)),this.bottomLoading=this.bottomPocket.querySelector("."+g),this.bottomCaption=this.bottomPocket.querySelector("."+h),this.wrapper.addEventListener("scrollbottom",this))},_createPocket:function(a,c,d){var e=b.createElement("div");return e.className=a,e.innerHTML=u.replace("{contentrefresh}",c.contentinit).replace("{icon}",d),e},_resetPullDownLoading:function(){var a=this.pullLoading;a&&(this.pullCaption.innerHTML=this.options.down.contentdown,a.style.webkitTransition="",a.style.webkitTransform="",a.style.webkitAnimation="",a.className=s)},_setCaptionClass:function(a,b,c){if(!a)switch(c){case this.options.up.contentdown:b.className=h+" "+i;break;case this.options.up.contentrefresh:b.className=h+" "+j;break;case this.options.up.contentnomore:b.className=h+" "+k}},_setCaption:function(a,b){if(!this.loading){var c=this.options,d=this.pullPocket,e=this.pullCaption,f=this.pullLoading,g=this.pulldown,h=this;d&&(b?setTimeout(function(){e.innerHTML=h.lastTitle=a,g?f.className=s:(h._setCaptionClass(!1,e,a),f.className=t),f.style.webkitAnimation="",f.style.webkitTransition="",f.style.webkitTransform=""},100):a!==this.lastTitle&&(e.innerHTML=a,g?a===c.down.contentrefresh?(f.className=t,f.style.webkitAnimation="spinner-spin 1s step-end infinite"):a===c.down.contentover?(f.className=r,f.style.webkitTransition="-webkit-transform 0.3s ease-in",f.style.webkitTransform="rotate(180deg)"):a===c.down.contentdown&&(f.className=s,f.style.webkitTransition="-webkit-transform 0.3s ease-in",f.style.webkitTransform="rotate(0deg)"):(a===c.up.contentrefresh?f.className=t+" "+q:f.className=t+" "+p,h._setCaptionClass(!1,e,a)),this.lastTitle=a))}}};a.PullRefresh=v}(mui,document),function(a,b,c,d){var e="mui-scroll",f="mui-scrollbar",g="mui-scrollbar-indicator",h=f+"-vertical",i=f+"-horizontal",j="mui-active",k={quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(a){return a*(2-a)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(a){return Math.sqrt(1- --a*a)}},outCirc:{style:"cubic-bezier(0.075, 0.82, 0.165, 1)"},outCubic:{style:"cubic-bezier(0.165, 0.84, 0.44, 1)"}},l=a.Class.extend({init:function(b,c){this.wrapper=this.element=b,this.scroller=this.wrapper.children[0],this.scrollerStyle=this.scroller&&this.scroller.style,this.stopped=!1,this.options=a.extend(!0,{scrollY:!0,scrollX:!1,startX:0,startY:0,indicators:!0,stopPropagation:!1,hardwareAccelerated:!0,fixedBadAndorid:!1,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT|VIDEO)$/},momentum:!0,snapX:.5,snap:!1,bounce:!0,bounceTime:500,bounceEasing:k.outCirc,scrollTime:500,scrollEasing:k.outCubic,directionLockThreshold:5,parallaxElement:!1,parallaxRatio:.5},c),this.x=0,this.y=0,this.translateZ=this.options.hardwareAccelerated?" translateZ(0)":"",this._init(),this.scroller&&(this.refresh(),this.scrollTo(this.options.startX,this.options.startY))},_init:function(){this._initParallax(),this._initIndicators(),this._initEvent()},_initParallax:function(){this.options.parallaxElement&&(this.parallaxElement=c.querySelector(this.options.parallaxElement),this.parallaxStyle=this.parallaxElement.style,this.parallaxHeight=this.parallaxElement.offsetHeight,this.parallaxImgStyle=this.parallaxElement.querySelector("img").style)},_initIndicators:function(){var a=this;if(a.indicators=[],this.options.indicators){var b,c=[];a.options.scrollY&&(b={el:this._createScrollBar(h),listenX:!1},this.wrapper.appendChild(b.el),c.push(b)),this.options.scrollX&&(b={el:this._createScrollBar(i),listenY:!1},this.wrapper.appendChild(b.el),c.push(b));for(var d=c.length;d--;)this.indicators.push(new m(this,c[d]))}},_initSnap:function(){this.currentPage={},this.pages=[];for(var a=this.snaps,b=a.length,c=0,d=-1,e=0,f=0,g=0,h=0,i=0;i=this.maxScrollX&&c++}this.options.startX=this.currentPage.x||0},_getSnapX:function(a){return Math.max(Math.min(0,-a+this.wrapperWidth/2),this.maxScrollX)},_gotoPage:function(a){this.currentPage=this.pages[Math.min(a,this.pages.length-1)][0];for(var b=0,c=this.snaps.length;b0?a=0:a=("left"===this.direction?this.pages[b][0].leftX:this.pages[b][0].rightX))return this.pages[b][0]}return{x:0,pageX:0}},_initEvent:function(c){var d=c?"removeEventListener":"addEventListener";b[d]("orientationchange",this),b[d]("resize",this),this.scroller[d]("webkitTransitionEnd",this),this.wrapper[d](a.EVENT_START,this),this.wrapper[d](a.EVENT_CANCEL,this),this.wrapper[d](a.EVENT_END,this),this.wrapper[d]("drag",this),this.wrapper[d]("dragend",this),this.wrapper[d]("flick",this),this.wrapper[d]("scrollend",this),this.options.scrollX&&this.wrapper[d]("swiperight",this);var e=this.wrapper.querySelector(".mui-segmented-control");e&&mui(e)[c?"off":"on"]("click","a",a.preventDefault),this.wrapper[d]("scrollstart",this),this.wrapper[d]("refresh",this)},_handleIndicatorScrollend:function(){this.indicators.map(function(a){a.fade()})},_handleIndicatorScrollstart:function(){this.indicators.map(function(a){a.fade(1)})},_handleIndicatorRefresh:function(){this.indicators.map(function(a){a.refresh()})},handleEvent:function(b){if(this.stopped)return void this.resetPosition();switch(b.type){case a.EVENT_START:this._start(b);break;case"drag":this.options.stopPropagation&&b.stopPropagation(),this._drag(b);break;case"dragend":case"flick":this.options.stopPropagation&&b.stopPropagation(),this._flick(b);break;case a.EVENT_CANCEL:case a.EVENT_END:this._end(b);break;case"webkitTransitionEnd":this.transitionTimer&&this.transitionTimer.cancel(),this._transitionEnd(b);break;case"scrollstart":this._handleIndicatorScrollstart(b);break;case"scrollend":this._handleIndicatorScrollend(b),this._scrollend(b),b.stopPropagation();break;case"orientationchange":case"resize":this._resize();break;case"swiperight":b.stopPropagation();break;case"refresh":this._handleIndicatorRefresh(b)}},_start:function(b){if(this.moved=this.needReset=!1,this._transitionTime(),this.isInTransition){this.needReset=!0,this.isInTransition=!1;var c=a.parseTranslateMatrix(a.getStyles(this.scroller,"webkitTransform"));this.setTranslate(Math.round(c.x),Math.round(c.y)),a.trigger(this.scroller,"scrollend",this),b.preventDefault()}this.reLayout(),a.trigger(this.scroller,"beforescrollstart",this)},_getDirectionByAngle:function(a){return a<-80&&a>-100?"up":a>=80&&a<100?"down":a>=170||a<=-170?"left":a>=-35&&a<=10?"right":null},_drag:function(c){var d=c.detail;if((this.options.scrollY||"up"===d.direction||"down"===d.direction)&&a.os.ios&&parseFloat(a.os.version)>=8){var e=d.gesture.touches[0].clientY;if(e+10>b.innerHeight||e<10)return void this.resetPosition(this.options.bounceTime)}var f=isReturn=!1;this._getDirectionByAngle(d.angle);if("left"===d.direction||"right"===d.direction?this.options.scrollX?(f=!0,this.moved||(a.gestures.session.lockDirection=!0,a.gestures.session.startDirection=d.direction)):this.options.scrollY&&!this.moved&&(isReturn=!0):"up"===d.direction||"down"===d.direction?this.options.scrollY?(f=!0,this.moved||(a.gestures.session.lockDirection=!0,a.gestures.session.startDirection=d.direction)):this.options.scrollX&&!this.moved&&(isReturn=!0):isReturn=!0,(this.moved||f)&&(c.stopPropagation(),d.gesture&&d.gesture.preventDefault()),!isReturn){this.moved?c.stopPropagation():a.trigger(this.scroller,"scrollstart",this);var g=0,h=0;this.moved?(g=d.deltaX-a.gestures.session.prevTouch.deltaX,h=d.deltaY-a.gestures.session.prevTouch.deltaY):(g=d.deltaX,h=d.deltaY);var i=Math.abs(d.deltaX),j=Math.abs(d.deltaY);i>j+this.options.directionLockThreshold?h=0:j>=i+this.options.directionLockThreshold&&(g=0),g=this.hasHorizontalScroll?g:0,h=this.hasVerticalScroll?h:0;var k=this.x+g,l=this.y+h;(k>0||k0?0:this.maxScrollX),(l>0||l0?0:this.maxScrollY),this.requestAnimationFrame||this._updateTranslate(),this.direction=d.deltaX>0?"right":"left",this.moved=!0,this.x=k,this.y=l,a.trigger(this.scroller,"scroll",this)}},_flick:function(b){if(this.moved){b.stopPropagation();var c=b.detail;if(this._clearRequestAnimationFrame(),"dragend"!==b.type||!c.flick){var d=Math.round(this.x),e=Math.round(this.y);if(this.isInTransition=!1,!this.resetPosition(this.options.bounceTime)){if(this.scrollTo(d,e),"dragend"===b.type)return void a.trigger(this.scroller,"scrollend",this);var f=0,g="";if(this.options.momentum&&c.flickTime<300&&(momentumX=this.hasHorizontalScroll?this._momentum(this.x,c.flickDistanceX,c.flickTime,this.maxScrollX,this.options.bounce?this.wrapperWidth:0,this.options.deceleration):{destination:d,duration:0},momentumY=this.hasVerticalScroll?this._momentum(this.y,c.flickDistanceY,c.flickTime,this.maxScrollY,this.options.bounce?this.wrapperHeight:0,this.options.deceleration):{destination:e,duration:0},d=momentumX.destination,e=momentumY.destination,f=Math.max(momentumX.duration,momentumY.duration),this.isInTransition=!0),d!=this.x||e!=this.y)return(d>0||d0||e0&&this.y<=this.maxScrollY)&&a.trigger(this.scroller,"scrollbottom",this)},_resize:function(){var a=this;clearTimeout(a.resizeTimeout),a.resizeTimeout=setTimeout(function(){a.refresh()},a.options.resizePolling)},_transitionTime:function(b){if(b=b||0,this.scrollerStyle.webkitTransitionDuration=b+"ms",this.parallaxElement&&this.options.scrollY&&(this.parallaxStyle.webkitTransitionDuration=b+"ms"),this.options.fixedBadAndorid&&!b&&a.os.isBadAndroid&&(this.scrollerStyle.webkitTransitionDuration="0.001s",this.parallaxElement&&this.options.scrollY&&(this.parallaxStyle.webkitTransitionDuration="0.001s")),this.indicators)for(var c=this.indicators.length;c--;)this.indicators[c].transitionTime(b);b&&(this.transitionTimer&&this.transitionTimer.cancel(),this.transitionTimer=a.later(function(){a.trigger(this.scroller,"webkitTransitionEnd")},b+100,this))},_transitionTimingFunction:function(a){if(this.scrollerStyle.webkitTransitionTimingFunction=a,this.parallaxElement&&this.options.scrollY&&(this.parallaxStyle.webkitTransitionDuration=a),this.indicators)for(var b=this.indicators.length;b--;)this.indicators[b].transitionTimingFunction(a)},_translate:function(a,b){this.x=a,this.y=b},_clearRequestAnimationFrame:function(){this.requestAnimationFrame&&(cancelAnimationFrame(this.requestAnimationFrame),this.requestAnimationFrame=null)},_updateTranslate:function(){var a=this;a.x===a.lastX&&a.y===a.lastY||a.setTranslate(a.x,a.y),a.requestAnimationFrame=requestAnimationFrame(function(){a._updateTranslate()})},_createScrollBar:function(a){var b=c.createElement("div"),d=c.createElement("div");return b.className=f+" "+a,d.className=g,b.appendChild(d),a===h?(this.scrollbarY=b,this.scrollbarIndicatorY=d):a===i&&(this.scrollbarX=b,this.scrollbarIndicatorX=d),this.wrapper.appendChild(b),b},_preventDefaultException:function(a,b){for(var c in b)if(b[c].test(a[c]))return!0;return!1},_reLayout:function(){if(this.hasHorizontalScroll||(this.maxScrollX=0,this.scrollerWidth=this.wrapperWidth),this.hasVerticalScroll||(this.maxScrollY=0,this.scrollerHeight=this.wrapperHeight),this.indicators.map(function(a){a.refresh()}),this.options.snap&&"string"==typeof this.options.snap){var a=this.scroller.querySelectorAll(this.options.snap);this.itemLength=0,this.snaps=[];for(var b=0,c=a.length;b0&&(h=f?f/2.5*(j/8):0,b=Math.abs(a)+h,i=b/j),{destination:Math.round(h),duration:i}},_getTranslateStr:function(a,b){return this.options.hardwareAccelerated?"translate3d("+a+"px,"+b+"px,0px) "+this.translateZ:"translate("+a+"px,"+b+"px) "},setStopped:function(a){a?(this.disablePullupToRefresh(),this.disablePulldownToRefresh()):(this.enablePullupToRefresh(),this.enablePulldownToRefresh())},setTranslate:function(b,c){if(this.x=b,this.y=c,this.scrollerStyle.webkitTransform=this._getTranslateStr(b,c),this.parallaxElement&&this.options.scrollY){var d=c*this.options.parallaxRatio,e=1+d/((this.parallaxHeight-d)/2);e>1?(this.parallaxImgStyle.opacity=1-d/100*this.options.parallaxRatio,this.parallaxStyle.webkitTransform=this._getTranslateStr(0,-d)+" scale("+e+","+e+")"):(this.parallaxImgStyle.opacity=1,this.parallaxStyle.webkitTransform=this._getTranslateStr(0,-1)+" scale(1,1)")}if(this.indicators)for(var f=this.indicators.length;f--;)this.indicators[f].updatePosition();this.lastX=this.x,this.lastY=this.y,a.trigger(this.scroller,"scroll",this)},reLayout:function(){this.wrapper.offsetHeight;var b=parseFloat(a.getStyles(this.wrapper,"padding-left"))||0,c=parseFloat(a.getStyles(this.wrapper,"padding-right"))||0,d=parseFloat(a.getStyles(this.wrapper,"padding-top"))||0,e=parseFloat(a.getStyles(this.wrapper,"padding-bottom"))||0,f=this.wrapper.clientWidth,g=this.wrapper.clientHeight;this.scrollerWidth=this.scroller.offsetWidth,this.scrollerHeight=this.scroller.offsetHeight,this.wrapperWidth=f-b-c,this.wrapperHeight=g-d-e,this.maxScrollX=Math.min(this.wrapperWidth-this.scrollerWidth,0),this.maxScrollY=Math.min(this.wrapperHeight-this.scrollerHeight,0),this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollX<0,this.hasVerticalScroll=this.options.scrollY&&this.maxScrollY<0,this._reLayout()},resetPosition:function(a){var b=this.x,c=this.y;return a=a||0,!this.hasHorizontalScroll||this.x>0?b=0:this.x0?c=0:this.y0,this.isInTransition?(this._clearRequestAnimationFrame(),this._transitionTimingFunction(d.style),this._transitionTime(c),this.setTranslate(a,b)):this.setTranslate(a,b)},scrollToBottom:function(a,b){a=a||this.options.scrollTime,this.scrollTo(0,this.maxScrollY,a,b)},gotoPage:function(a){this._gotoPage(a)},destroy:function(){this._initEvent(!0),delete a.data[this.wrapper.getAttribute("data-scroll")],this.wrapper.setAttribute("data-scroll","")}}),m=function(b,d){this.wrapper="string"==typeof d.el?c.querySelector(d.el):d.el,this.wrapperStyle=this.wrapper.style,this.indicator=this.wrapper.children[0],this.indicatorStyle=this.indicator.style,this.scroller=b,this.options=a.extend({listenX:!0,listenY:!0,fade:!1,speedRatioX:0,speedRatioY:0},d),this.sizeRatioX=1,this.sizeRatioY=1,this.maxPosX=0,this.maxPosY=0,this.options.fade&&(this.wrapperStyle.webkitTransform=this.scroller.translateZ,this.wrapperStyle.webkitTransitionDuration=this.options.fixedBadAndorid&&a.os.isBadAndroid?"0.001s":"0ms",this.wrapperStyle.opacity="0")};m.prototype={handleEvent:function(a){},transitionTime:function(b){b=b||0,this.indicatorStyle.webkitTransitionDuration=b+"ms",this.scroller.options.fixedBadAndorid&&!b&&a.os.isBadAndroid&&(this.indicatorStyle.webkitTransitionDuration="0.001s")},transitionTimingFunction:function(a){this.indicatorStyle.webkitTransitionTimingFunction=a},refresh:function(){this.transitionTime(),this.options.listenX&&!this.options.listenY?this.indicatorStyle.display=this.scroller.hasHorizontalScroll?"block":"none":this.options.listenY&&!this.options.listenX?this.indicatorStyle.display=this.scroller.hasVerticalScroll?"block":"none":this.indicatorStyle.display=this.scroller.hasHorizontalScroll||this.scroller.hasVerticalScroll?"block":"none",this.wrapper.offsetHeight,this.options.listenX&&(this.wrapperWidth=this.wrapper.clientWidth,this.indicatorWidth=Math.max(Math.round(this.wrapperWidth*this.wrapperWidth/(this.scroller.scrollerWidth||this.wrapperWidth||1)),8),this.indicatorStyle.width=this.indicatorWidth+"px",this.maxPosX=this.wrapperWidth-this.indicatorWidth,this.minBoundaryX=0,this.maxBoundaryX=this.maxPosX,this.sizeRatioX=this.options.speedRatioX||this.scroller.maxScrollX&&this.maxPosX/this.scroller.maxScrollX),this.options.listenY&&(this.wrapperHeight=this.wrapper.clientHeight,this.indicatorHeight=Math.max(Math.round(this.wrapperHeight*this.wrapperHeight/(this.scroller.scrollerHeight||this.wrapperHeight||1)),8),this.indicatorStyle.height=this.indicatorHeight+"px",this.maxPosY=this.wrapperHeight-this.indicatorHeight,this.minBoundaryY=0,this.maxBoundaryY=this.maxPosY,this.sizeRatioY=this.options.speedRatioY||this.scroller.maxScrollY&&this.maxPosY/this.scroller.maxScrollY),this.updatePosition()},updatePosition:function(){var a=this.options.listenX&&Math.round(this.sizeRatioX*this.scroller.x)||0,b=this.options.listenY&&Math.round(this.sizeRatioY*this.scroller.y)||0;athis.maxBoundaryX?(this.width=Math.max(this.indicatorWidth-(a-this.maxPosX),8),this.indicatorStyle.width=this.width+"px",a=this.maxPosX+this.indicatorWidth-this.width):this.width!=this.indicatorWidth&&(this.width=this.indicatorWidth,this.indicatorStyle.width=this.width+"px"),bthis.maxBoundaryY?(this.height=Math.max(this.indicatorHeight-3*(b-this.maxPosY),8),this.indicatorStyle.height=this.height+"px",b=this.maxPosY+this.indicatorHeight-this.height):this.height!=this.indicatorHeight&&(this.height=this.indicatorHeight,this.indicatorStyle.height=this.height+"px"),this.x=a,this.y=b,this.indicatorStyle.webkitTransform=this.scroller._getTranslateStr(a,b)},fade:function(a,b){if(!b||this.visible){clearTimeout(this.fadeTimeout),this.fadeTimeout=null;var c=a?250:500,d=a?0:300;a=a?"1":"0",this.wrapperStyle.webkitTransitionDuration=c+"ms",this.fadeTimeout=setTimeout(function(a){this.wrapperStyle.opacity=a,this.visible=+a}.bind(this,a),d)}}},a.Scroll=l,a.fn.scroll=function(b){var c=[];return this.each(function(){var d=null,e=this,f=e.getAttribute("data-scroll");if(f)d=a.data[f];else{f=++a.uuid;var g=a.extend({},b);e.classList.contains("mui-segmented-control")&&(g=a.extend(g,{scrollY:!1,scrollX:!0,indicators:!1,snap:".mui-control-item"})),a.data[f]=d=new l(e,g),e.setAttribute("data-scroll",f)}c.push(d)}),1===c.length?c[0]:c}}(mui,window,document),function(a,b,c,d){var e="mui-visibility",f="mui-hidden",g=a.Scroll.extend(a.extend({handleEvent:function(a){this._super(a),"scrollbottom"===a.type&&a.target===this.scroller&&this._scrollbottom()},_scrollbottom:function(){this.pulldown||this.loading||(this.pulldown=!1,this._initPullupRefresh(),this.pullupLoading())},_start:function(a){a.touches&&a.touches.length&&a.touches[0].clientX>30&&a.target&&!this._preventDefaultException(a.target,this.options.preventDefaultException)&&a.preventDefault(),this.loading||(this.pulldown=this.pullPocket=this.pullCaption=this.pullLoading=!1),this._super(a)},_drag:function(a){this.y>=0&&this.disablePulldown&&"down"===a.detail.direction||(this._super(a),!this.pulldown&&!this.loading&&this.topPocket&&"down"===a.detail.direction&&this.y>=0&&this._initPulldownRefresh(),this.pulldown&&this._setCaption(this.y>this.options.down.height?this.options.down.contentover:this.options.down.contentdown))},_reLayout:function(){this.hasVerticalScroll=!0,this._super()},resetPosition:function(a){if(this.pulldown&&!this.disablePulldown){if(this.y>=this.options.down.height)return this.pulldownLoading(d,a||0),!0;!this.loading&&this.topPocket.classList.remove(e)}return this._super(a)},pulldownLoading:function(a,b){if(void 0===a&&(a=this.options.down.height),this.scrollTo(0,a,b,this.options.bounceEasing),!this.loading){this._initPulldownRefresh(),this._setCaption(this.options.down.contentrefresh),this.loading=!0,this.indicators.map(function(a){a.fade(0)});var c=this.options.down.callback;c&&c.call(this)}},endPulldownToRefresh:function(){var a=this;a.topPocket&&a.loading&&this.pulldown&&(a.scrollTo(0,0,a.options.bounceTime,a.options.bounceEasing),a.loading=!1,a._setCaption(a.options.down.contentdown,!0),setTimeout(function(){a.loading||a.topPocket.classList.remove(e)},350))},pullupLoading:function(a,b,c){b=b||0,this.scrollTo(b,this.maxScrollY,c,this.options.bounceEasing),this.loading||(this._initPullupRefresh(),this._setCaption(this.options.up.contentrefresh),this.indicators.map(function(a){a.fade(0)}),this.loading=!0,(a=a||this.options.up.callback)&&a.call(this))},endPullupToRefresh:function(a){var b=this;b.bottomPocket&&(b.loading=!1,a?(this.finished=!0,b._setCaption(b.options.up.contentnomore),b.wrapper.removeEventListener("scrollbottom",b)):(b._setCaption(b.options.up.contentdown),b.loading||b.bottomPocket.classList.remove(e)))},disablePullupToRefresh:function(){this._initPullupRefresh(),this.bottomPocket.className="mui-pull-bottom-pocket "+f,this.wrapper.removeEventListener("scrollbottom",this)},disablePulldownToRefresh:function(){this._initPulldownRefresh(),this.topPocket.className="mui-pull-top-pocket "+f,this.disablePulldown=!0},enablePulldownToRefresh:function(){this._initPulldownRefresh(),this.topPocket.classList.remove(f),this._setCaption(this.options.down.contentdown),this.disablePulldown=!1},enablePullupToRefresh:function(){this._initPullupRefresh(),this.bottomPocket.classList.remove(f),this._setCaption(this.options.up.contentdown),this.wrapper.addEventListener("scrollbottom",this)},refresh:function(a){a&&this.finished&&(this.enablePullupToRefresh(),this.finished=!1),this._super()}},a.PullRefresh));a.fn.pullRefresh=function(b){if(1===this.length){var c=this[0],d=null,e=c.getAttribute("data-pullrefresh");return!(!e&&void 0===b)&&(b=b||{},e?d=a.data[e]:(e=++a.uuid,a.data[e]=d=new g(c,b),c.setAttribute("data-pullrefresh",e)),b.down&&b.down.auto?d.pulldownLoading(b.down.autoY):b.up&&b.up.auto&&d.pullupLoading(),d)}}}(mui,window,document),function(a,b){var c="mui-slider",d="mui-slider-group",e="mui-slider-loop",f="mui-action-previous",g="mui-action-next",h="mui-slider-item",i="mui-active",j="."+h,k=".mui-slider-progress-bar",l=a.Slider=a.Scroll.extend({init:function(b,c){this._super(b,a.extend(!0,{fingers:1,interval:0,scrollY:!1,scrollX:!0,indicators:!1,scrollTime:1e3,startX:!1,slideTime:0,snap:j},c)),this.options.startX},_init:function(){this._reInit(),this.scroller&&(this.scrollerStyle=this.scroller.style,this.progressBar=this.wrapper.querySelector(k),this.progressBar&&(this.progressBarWidth=this.progressBar.offsetWidth,this.progressBarStyle=this.progressBar.style),this._super(),this._initTimer())},_triggerSlide:function(){var b=this;b.isInTransition=!1;b.currentPage;b.slideNumber=b._fixedSlideNumber(),b.loop&&(0===b.slideNumber?b.setTranslate(b.pages[1][0].x,0):b.slideNumber===b.itemLength-3&&b.setTranslate(b.pages[b.itemLength-2][0].x,0)),b.lastSlideNumber!=b.slideNumber&&(b.lastSlideNumber=b.slideNumber,b.lastPage=b.currentPage,a.trigger(b.wrapper,"slide",{slideNumber:b.slideNumber})),b._initTimer()},_handleSlide:function(b){var c=this;if(b.target===c.wrapper){var d=b.detail;d.slideNumber=d.slideNumber||0;for(var e=c.scroller.querySelectorAll(j),f=[],g=0,h=e.length;g0)for(var g=0,h=n.length;gthis.itemLength-(b?2:3)?(a=1,time=0):a<(b?-1:0)?(a=this.itemLength-2,time=0):a+=1:(b||(a>this.itemLength-1?(a=0,time=0):a<0&&(a=this.itemLength-1,time=0)),a=Math.min(Math.max(0,a),this.itemLength-1)),this.pages[a][0]},_gotoItem:function(b,c){this.currentPage=this._getPage(b,!0),this.scrollTo(this.currentPage.x,0,c,this.options.scrollEasing),0===c&&a.trigger(this.wrapper,"scrollend",this)},setTranslate:function(a,b){this._super(a,b),this.progressBar&&(this.progressBarStyle.webkitTransform=this._getTranslateStr(-a*(this.progressBarWidth/this.wrapperWidth),0))},resetPosition:function(a){return a=a||0,this.x>0?this.x=0:this.x=b.documentElement.scrollHeight&&(a.isScroll=!1,a.bottomPocket&&a.pullupLoading())},100)},_initPulldownRefreshEvent:function(){var b=this;a.plusReady(function(){if("circle"==b.options.down.style)b.options.webview=plus.webview.currentWebview(),b.options.webview.setPullToRefresh({support:!0,color:b.options.down.color||"#2BD009",height:b.options.down.height||"50px",range:b.options.down.range||"100px",style:"circle",offset:b.options.down.offset||"0px"},function(){b.options.down.callback()});else if(b.topPocket&&b.options.webviewId){var a=plus.webview.getWebviewById(b.options.webviewId);if(!a)return;b.options.webview=a;var c=b.options.down,d=c.height;a.addEventListener("close",function(){var a=b.options.webviewId&&b.options.webviewId.replace(/\//g,"_");b.element.removeAttribute("data-pullrefresh-plus-"+a)}),a.addEventListener("dragBounce",function(d){switch(b.pulldown?b.pullPocket.classList.add(e):b._initPulldownRefresh(),d.status){case"beforeChangeOffset":b._setCaption(c.contentdown);break;case"afterChangeOffset":b._setCaption(c.contentover);break;case"dragEndAfterChangeOffset":a.evalJS("window.mui&&mui.options.pullRefresh.down.callback()"),b._setCaption(c.contentrefresh)}},!1),a.setBounce({position:{top:2*d+"px"},changeoffset:{top:d+"px"}})}})},handleEvent:function(a){var b=this;b.stopped||(b.isScroll=!1,"dragup"!==a.type&&"plusscrollbottom"!==a.type||(b.isScroll=!0,setTimeout(function(){b.isScroll=!1},1e3)))}}).extend(a.extend({setStopped:function(a){this.stopped=!!a,this.stopped?(this.disablePullupToRefresh(),this.disablePulldownToRefresh()):(this.enablePullupToRefresh(),this.enablePulldownToRefresh())},beginPulldown:function(){var b=this;a.plusReady(function(){setTimeout(function(){if("circle"==b.options.down.style)plus.webview.currentWebview().beginPullToRefresh();else{var a=b.options.webview;a&&a.setBounce({offset:{top:b.options.down.height+"px"}})}},15)}.bind(this))},pulldownLoading:function(){this.beginPulldown()},_pulldownLoading:function(){var b=this;a.plusReady(function(){var a=plus.webview.getWebviewById(b.options.webviewId);a&&a.setBounce({offset:{top:b.options.down.height+"px"}})})},endPulldown:function(){var a=plus.webview.currentWebview();a.parent()&&"circle"!==this.options.down.style?a.parent().evalJS("mui&&mui(document.querySelector('.mui-content')).pullRefresh('"+JSON.stringify({webviewId:a.id})+"')._endPulldownToRefresh()"):a.endPullToRefresh()},endPulldownToRefresh:function(){this.endPulldown()},_endPulldownToRefresh:function(){var a=this;a.topPocket&&a.options.webview&&(a.options.webview.endPullToRefresh(),a.loading=!1,a._setCaption(a.options.down.contentdown,!0),setTimeout(function(){a.loading||a.topPocket.classList.remove(e)},350))},beginPullup:function(a){var b=this;b.isLoading||(b.isLoading=!0,!1!==b.pulldown?b._initPullupRefresh():this.pullPocket.classList.add(e),setTimeout(function(){b.pullLoading.classList.add(c),b.pullLoading.classList.remove(d),b.pullCaption.innerHTML="",b.pullCaption.className=f+" "+h,b.pullCaption.innerHTML=b.options.up.contentrefresh,(a=a||b.options.up.callback)&&a.call(b)},300))},pullupLoading:function(a){this.beginPullup(a)},endPullup:function(a){var e=this;e.pullLoading&&(e.pullLoading.classList.remove(c),e.pullLoading.classList.add(d),e.isLoading=!1,a?(e.finished=!0,e.pullCaption.className=f+" "+i,e.pullCaption.innerHTML=e.options.up.contentnomore,b.removeEventListener("plusscrollbottom",e),window.removeEventListener("dragup",e)):(e.pullCaption.className=f+" "+g,e.pullCaption.innerHTML=e.options.up.contentdown))},endPullupToRefresh:function(a){this.endPullup(a)},disablePulldownToRefresh:function(){var a=plus.webview.currentWebview();this.options.down.style&&"circle"==this.options.down.style?this.options.webview.setPullToRefresh({support:!1,style:"circle"}):(a.setStyle({bounce:"none"}),a.setBounce({position:{top:"none"}}))},enablePulldownToRefresh:function(){var a=this,b=plus.webview.currentWebview(),c=this.options.down.height;this.options.down.style&&"circle"==this.options.down.style?b.setPullToRefresh({support:!0,height:c||"50px",range:a.options.down.range||"100px",style:"circle",offset:a.options.down.offset||"0px"}):(b.setStyle({bounce:"vertical"}),b.setBounce({position:{top:2*c+"px"},changeoffset:{top:c+"px"}}))},disablePullupToRefresh:function(){this._initPullupRefresh(),this.bottomPocket.className="mui-pull-bottom-pocket "+d,window.removeEventListener("dragup",this)},enablePullupToRefresh:function(){this._initPullupRefresh(),this.bottomPocket.classList.remove(d),this.pullCaption.className=f+" "+g,this.pullCaption.innerHTML=this.options.up.contentdown,b.addEventListener("plusscrollbottom",this),window.addEventListener("dragup",this)},scrollTo:function(b,c,d){a.scrollTo(c,d)},scrollToBottom:function(c){a.scrollTo(b.documentElement.scrollHeight,c)},refresh:function(a){a&&this.finished&&(this.enablePullupToRefresh(),this.finished=!1)}},a.PullRefresh));a.fn.pullRefresh_native=function(c){var d;0===this.length?(d=b.createElement("div"),d.className="mui-content",b.body.appendChild(d)):d=this[0];var e=c;c=c||{},"string"==typeof c&&(c=a.parseJSON(c)),!c.webviewId&&(c.webviewId=plus.webview.currentWebview().id||plus.webview.currentWebview().getURL());var f=null,g=c.webviewId&&c.webviewId.replace(/\//g,"_"),h=d.getAttribute("data-pullrefresh-plus-"+g);return!(!h&&void 0===e)&&(h?f=a.data[h]:(h=++a.uuid,d.setAttribute("data-pullrefresh-plus-"+g,h),b.body.classList.add("mui-plus-pullrefresh"),a.data[h]=f=new j(d,c)),c.down&&c.down.auto?f.beginPulldown():c.up&&c.up.auto&&f.beginPullup(),f)}}})}(mui,document),function(a,b,c,d){var e="mui-off-canvas-left",f="mui-off-canvas-right",g="mui-off-canvas-backdrop",h="mui-off-canvas-wrap",i="mui-slide-in",j="mui-active",k="mui-transitioning",l=".mui-inner-wrap",m=a.Class.extend({init:function(b,d){this.wrapper=this.element=b,this.scroller=this.wrapper.querySelector(l),this.classList=this.wrapper.classList,this.scroller&&(this.options=a.extend(!0,{dragThresholdX:10,scale:.8,opacity:.1,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT|VIDEO)$/}},d),c.body.classList.add("mui-fullscreen"),this.refresh(),this.initEvent())},_preventDefaultException:function(a,b){for(var c in b)if(b[c].test(a[c]))return!0;return!1},refresh:function(a){this.slideIn=this.classList.contains(i),this.scalable=this.classList.contains("mui-scalable")&&!this.slideIn,this.scroller=this.wrapper.querySelector(l),this.offCanvasLefts=this.wrapper.querySelectorAll("."+e),this.offCanvasRights=this.wrapper.querySelectorAll("."+f),a?a.classList.contains(e)?this.offCanvasLeft=a:a.classList.contains(f)&&(this.offCanvasRight=a):(this.offCanvasRight=this.wrapper.querySelector("."+f),this.offCanvasLeft=this.wrapper.querySelector("."+e)),this.offCanvasRightWidth=this.offCanvasLeftWidth=0,this.offCanvasLeftSlideIn=this.offCanvasRightSlideIn=!1,this.offCanvasRight&&(this.offCanvasRightWidth=this.offCanvasRight.offsetWidth,this.offCanvasRightSlideIn=this.slideIn&&this.offCanvasRight.parentNode===this.wrapper),this.offCanvasLeft&&(this.offCanvasLeftWidth=this.offCanvasLeft.offsetWidth,this.offCanvasLeftSlideIn=this.slideIn&&this.offCanvasLeft.parentNode===this.wrapper),this.backdrop=this.scroller.querySelector("."+g),this.options.dragThresholdX=this.options.dragThresholdX||10,this.visible=!1,this.startX=null,this.lastX=null,this.offsetX=null,this.lastTranslateX=null},handleEvent:function(b){switch(b.type){case a.EVENT_START:b.target&&!this._preventDefaultException(b.target,this.options.preventDefaultException)&&b.preventDefault();break;case"webkitTransitionEnd":b.target===this.scroller&&this._dispatchEvent();break;case"drag":var c=b.detail;this.startX?this.lastX=c.center.x:(this.startX=c.center.x,this.lastX=this.startX),!this.isDragging&&Math.abs(this.lastX-this.startX)>this.options.dragThresholdX&&("left"===c.direction||"right"===c.direction)&&(this.slideIn?(this.scroller=this.wrapper.querySelector(l),this.classList.contains(j)?this.offCanvasRight&&this.offCanvasRight.classList.contains(j)?(this.offCanvas=this.offCanvasRight,this.offCanvasWidth=this.offCanvasRightWidth):(this.offCanvas=this.offCanvasLeft,this.offCanvasWidth=this.offCanvasLeftWidth):"left"===c.direction&&this.offCanvasRight?(this.offCanvas=this.offCanvasRight,this.offCanvasWidth=this.offCanvasRightWidth):"right"===c.direction&&this.offCanvasLeft?(this.offCanvas=this.offCanvasLeft,this.offCanvasWidth=this.offCanvasLeftWidth):this.scroller=null):this.classList.contains(j)?"left"===c.direction?(this.offCanvas=this.offCanvasLeft,this.offCanvasWidth=this.offCanvasLeftWidth):(this.offCanvas=this.offCanvasRight,this.offCanvasWidth=this.offCanvasRightWidth):"right"===c.direction?(this.offCanvas=this.offCanvasLeft,this.offCanvasWidth=this.offCanvasLeftWidth):(this.offCanvas=this.offCanvasRight,this.offCanvasWidth=this.offCanvasRightWidth),this.offCanvas&&this.scroller&&(this.startX=this.lastX,this.isDragging=!0,a.gestures.session.lockDirection=!0,a.gestures.session.startDirection=c.direction,this.offCanvas.classList.remove(k),this.scroller.classList.remove(k),this.offsetX=this.getTranslateX(),this._initOffCanvasVisible())),this.isDragging&&(this.updateTranslate(this.offsetX+(this.lastX-this.startX)),c.gesture.preventDefault(),b.stopPropagation());break;case"dragend":if(this.isDragging){var c=b.detail,d=c.direction;this.isDragging=!1,this.offCanvas.classList.add(k),this.scroller.classList.add(k);var e=0,f=this.getTranslateX();if(this.slideIn){if(e=f>=0?this.offCanvasRightWidth&&f/this.offCanvasRightWidth||0:this.offCanvasLeftWidth&&f/this.offCanvasLeftWidth||0,"right"===d&&e<=0&&(e>=-.5||c.swipe)?this.openPercentage(100):"right"===d&&e>0&&(e>=.5||c.swipe)?this.openPercentage(0):"right"===d&&e<=-.5?this.openPercentage(0):"right"===d&&e>0&&e<=.5?this.openPercentage(-100):"left"===d&&e>=0&&(e<=.5||c.swipe)?this.openPercentage(-100):"left"===d&&e<0&&(e<=-.5||c.swipe)?this.openPercentage(0):"left"===d&&e>=.5?this.openPercentage(0):"left"===d&&e>=-.5&&e<0?this.openPercentage(100):this.openPercentage(0),1===e||-1===e||0===e)return void this._dispatchEvent()}else{if(0===(e=f>=0?this.offCanvasLeftWidth&&f/this.offCanvasLeftWidth||0:this.offCanvasRightWidth&&f/this.offCanvasRightWidth||0))return this.openPercentage(0),void this._dispatchEvent();"right"===d&&e>=0&&(e>=.5||c.swipe)?this.openPercentage(100):"right"===d&&e<0&&(e>-.5||c.swipe)?this.openPercentage(0):"right"===d&&e>0&&e<.5?this.openPercentage(0):"right"===d&&e<.5?this.openPercentage(-100):"left"===d&&e<=0&&(e<=-.5||c.swipe)?this.openPercentage(-100):"left"===d&&e>0&&(e<=.5||c.swipe)?this.openPercentage(0):"left"===d&&e<0&&e>=-.5?this.openPercentage(0):"left"===d&&e>.5?this.openPercentage(100):this.openPercentage(0),1!==e&&-1!==e||this._dispatchEvent()}}}},_dispatchEvent:function(){this.classList.contains(j)?a.trigger(this.wrapper,"shown",this):a.trigger(this.wrapper,"hidden",this)},_initOffCanvasVisible:function(){this.visible||(this.visible=!0,this.offCanvasLeft&&(this.offCanvasLeft.style.visibility="visible"),this.offCanvasRight&&(this.offCanvasRight.style.visibility="visible"))},initEvent:function(){var b=this;b.backdrop&&b.backdrop.addEventListener("tap",function(a){b.close(),a.detail.gesture.preventDefault()}),this.classList.contains("mui-draggable")&&(this.wrapper.addEventListener(a.EVENT_START,this),this.wrapper.addEventListener("drag",this),this.wrapper.addEventListener("dragend",this)),this.wrapper.addEventListener("webkitTransitionEnd",this)},openPercentage:function(a){var b=a/100;this.slideIn?(this.offCanvasLeft&&a>=0?(b=0===b?-1:0,this.updateTranslate(this.offCanvasLeftWidth*b),this.offCanvasLeft.classList[0!==a?"add":"remove"](j)):this.offCanvasRight&&a<=0&&(b=0===b?1:0,this.updateTranslate(this.offCanvasRightWidth*b),this.offCanvasRight.classList[0!==a?"add":"remove"](j)),this.classList[0!==a?"add":"remove"](j)):(this.offCanvasLeft&&a>=0?(this.updateTranslate(this.offCanvasLeftWidth*b),this.offCanvasLeft.classList[0!==b?"add":"remove"](j)):this.offCanvasRight&&a<=0&&(this.updateTranslate(this.offCanvasRightWidth*b),this.offCanvasRight.classList[0!==b?"add":"remove"](j)),this.classList[0!==b?"add":"remove"](j))},updateTranslate:function(b){if(b!==this.lastTranslateX){if(this.slideIn){if(this.offCanvas.classList.contains(f)){if(b<0)return void this.setTranslateX(0);if(b>this.offCanvasRightWidth)return void this.setTranslateX(this.offCanvasRightWidth)}else{if(b>0)return void this.setTranslateX(0);if(b<-this.offCanvasLeftWidth)return void this.setTranslateX(-this.offCanvasLeftWidth)}this.setTranslateX(b)}else{if(!this.offCanvasLeft&&b>0||!this.offCanvasRight&&b<0)return void this.setTranslateX(0);if(this.leftShowing&&b>this.offCanvasLeftWidth)return void this.setTranslateX(this.offCanvasLeftWidth);if(this.rightShowing&&b<-this.offCanvasRightWidth)return void this.setTranslateX(-this.offCanvasRightWidth);this.setTranslateX(b),b>=0?(this.leftShowing=!0,this.rightShowing=!1,b>0&&(this.offCanvasLeft&&a.each(this.offCanvasLefts,function(a,b){b===this.offCanvasLeft?this.offCanvasLeft.style.zIndex=0:b.style.zIndex=-1}.bind(this)),this.offCanvasRight&&(this.offCanvasRight.style.zIndex=-1))):(this.rightShowing=!0,this.leftShowing=!1,this.offCanvasRight&&a.each(this.offCanvasRights,function(a,b){b===this.offCanvasRight?b.style.zIndex=0:b.style.zIndex=-1}.bind(this)),this.offCanvasLeft&&(this.offCanvasLeft.style.zIndex=-1))}this.lastTranslateX=b}},setTranslateX:a.animationFrame(function(a){if(this.scroller)if(this.scalable&&this.offCanvas.parentNode===this.wrapper){var b=Math.abs(a)/this.offCanvasWidth,c=1-(1-this.options.scale)*b,d=this.options.scale+(1-this.options.scale)*b,f=(this.options.opacity,this.options.opacity+(1-this.options.opacity)*b);this.offCanvas.classList.contains(e)?(this.offCanvas.style.webkitTransformOrigin="-100%",this.scroller.style.webkitTransformOrigin="left"):(this.offCanvas.style.webkitTransformOrigin="200%",this.scroller.style.webkitTransformOrigin="right"),this.offCanvas.style.opacity=f,this.offCanvas.style.webkitTransform="translate3d(0,0,0) scale("+d+")",this.scroller.style.webkitTransform="translate3d("+a+"px,0,0) scale("+c+")"}else this.slideIn?this.offCanvas.style.webkitTransform="translate3d("+a+"px,0,0)":this.scroller.style.webkitTransform="translate3d("+a+"px,0,0)"}),getTranslateX:function(){if(this.offCanvas){var b=this.slideIn?this.offCanvas:this.scroller,c=a.parseTranslateMatrix(a.getStyles(b,"webkitTransform"));return c&&c.x||0}return 0},isShown:function(a){var b=!1;if(this.slideIn)b="left"===a?this.classList.contains(j)&&this.wrapper.querySelector("."+e+"."+j):"right"===a?this.classList.contains(j)&&this.wrapper.querySelector("."+f+"."+j):this.classList.contains(j)&&(this.wrapper.querySelector("."+e+"."+j)||this.wrapper.querySelector("."+f+"."+j));else{var c=this.getTranslateX();b="right"===a?this.classList.contains(j)&&c<0:"left"===a?this.classList.contains(j)&&c>0:this.classList.contains(j)&&0!==c}return b},close:function(){this._initOffCanvasVisible(),this.offCanvas=this.wrapper.querySelector("."+f+"."+j)||this.wrapper.querySelector("."+e+"."+j),this.offCanvasWidth=this.offCanvas.offsetWidth,this.scroller&&(this.offCanvas.offsetHeight,this.offCanvas.classList.add(k),this.scroller.classList.add(k),this.openPercentage(0))},show:function(a){return this._initOffCanvasVisible(),!this.isShown(a)&&(a||(a=this.wrapper.querySelector("."+f)?"right":"left"),"right"===a?(this.offCanvas=this.offCanvasRight,this.offCanvasWidth=this.offCanvasRightWidth):(this.offCanvas=this.offCanvasLeft,this.offCanvasWidth=this.offCanvasLeftWidth),this.scroller&&(this.offCanvas.offsetHeight,this.offCanvas.classList.add(k),this.scroller.classList.add(k),this.openPercentage("left"===a?100:-100)),!0)},toggle:function(a){var b=a;a&&a.classList&&(b=a.classList.contains(e)?"left":"right",this.refresh(a)),this.show(b)||this.close()}}),n=function(a){if(parentNode=a.parentNode,parentNode){if(parentNode.classList.contains(h))return parentNode;if(parentNode=parentNode.parentNode,parentNode.classList.contains(h))return parentNode}},o=function(b,d){if("A"===d.tagName&&d.hash){var e=c.getElementById(d.hash.replace("#",""));if(e){var f=n(e);if(f)return a.targets._container=f,e}}return!1};a.registerTarget({name:d,index:60,handle:o,target:!1,isReset:!1,isContinue:!0}),b.addEventListener("tap",function(b){if(a.targets.offcanvas)for(var d=b.target;d&&d!==c;d=d.parentNode)if("A"===d.tagName&&d.hash&&d.hash==="#"+a.targets.offcanvas.id){b.detail&&b.detail.gesture&&b.detail.gesture.preventDefault(),a(a.targets._container).offCanvas().toggle(a.targets.offcanvas),a.targets.offcanvas=a.targets._container=null;break}}),a.fn.offCanvas=function(b){var c=[];return this.each(function(){var d=null,e=this;e.classList.contains(h)||(e=n(e));var f=e.getAttribute("data-offCanvas");f?d=a.data[f]:(f=++a.uuid,a.data[f]=d=new m(e,b),e.setAttribute("data-offCanvas",f)),"show"!==b&&"close"!==b&&"toggle"!==b||d.toggle(),c.push(d)}),1===c.length?c[0]:c},a.ready(function(){a(".mui-off-canvas-wrap").offCanvas()})}(mui,window,document,"offcanvas"),function(a,b){var c="mui-action",d=function(a,b){var d=b.className||"";return"string"!=typeof d&&(d=""),!(!d||!~d.indexOf(c))&&(b.classList.contains("mui-action-back")&&a.preventDefault(),b)};a.registerTarget({name:b,index:50,handle:d,target:!1,isContinue:!0})}(mui,"action"),function(a,b,c,d){var e="mui-modal",f=function(a,b){if("A"===b.tagName&&b.hash){var d=c.getElementById(b.hash.replace("#",""));if(d&&d.classList.contains(e))return d}return!1};a.registerTarget({name:d,index:50,handle:f,target:!1,isReset:!1,isContinue:!0}),b.addEventListener("tap",function(b){a.targets.modal&&(b.detail.gesture.preventDefault(),a.targets.modal.classList.toggle("mui-active"))})}(mui,window,document,"modal"),function(a,b,c,d){var e="mui-popover",f="mui-popover-arrow",g="mui-popover-action",h="mui-backdrop",i="mui-bar-popover",j="mui-bar-backdrop",k="mui-backdrop-action",l="mui-active",m="mui-bottom",n=function(b,d){if("A"===d.tagName&&d.hash){if(a.targets._popover=c.getElementById(d.hash.replace("#","")),a.targets._popover&&a.targets._popover.classList.contains(e))return d;a.targets._popover=null}return!1};a.registerTarget({name:d,index:60,handle:n,target:!1,isReset:!1,isContinue:!0});var o,p=function(b){this.removeEventListener("webkitTransitionEnd",p),this.addEventListener(a.EVENT_MOVE,a.preventDefault),a.trigger(this,"shown",this)},q=function(b){u(this,"none"),this.removeEventListener("webkitTransitionEnd",q),this.removeEventListener(a.EVENT_MOVE,a.preventDefault),a.trigger(this,"hidden",this)},r=function(){var b=c.createElement("div");return b.classList.add(h),b.addEventListener(a.EVENT_MOVE,a.preventDefault),b.addEventListener("tap",function(b){var c=a.targets._popover;c&&(c.addEventListener("webkitTransitionEnd",q),c.classList.remove(l),s(c))}),b}(),s=function(b){r.setAttribute("style","opacity:0"),a.targets.popover=a.targets._popover=null,o=a.later(function(){!b.classList.contains(l)&&r.parentNode&&r.parentNode===c.body&&c.body.removeChild(r)},350)};b.addEventListener("tap",function(b){if(a.targets.popover){for(var d=!1,e=b.target;e&&e!==c;e=e.parentNode)e===a.targets.popover&&(d=!0);d&&(b.detail.gesture.preventDefault(),t(a.targets._popover,a.targets.popover))}});var t=function(a,b,d){if(!("show"===d&&a.classList.contains(l)||"hide"===d&&!a.classList.contains(l))){o&&o.cancel(),a.removeEventListener("webkitTransitionEnd",p),a.removeEventListener("webkitTransitionEnd",q),r.classList.remove(j),r.classList.remove(k);var e=c.querySelector(".mui-popover.mui-active");if(e&&(e.addEventListener("webkitTransitionEnd",q),e.classList.remove(l),a===e))return void s(e);var f=!1;(a.classList.contains(i)||a.classList.contains(g))&&(a.classList.contains(g)?(f=!0,r.classList.add(k)):r.classList.add(j)),u(a,"block"),a.offsetHeight,a.classList.add(l),r.setAttribute("style",""),c.body.appendChild(r),v(a,b,f),r.classList.add(l),a.addEventListener("webkitTransitionEnd",p)}},u=function(a,b,c,d){var e=a.style;void 0!==b&&(e.display=b),void 0!==c&&(e.top=c+"px"),void 0!==d&&(e.left=d+"px")},v=function(d,e,h){if(d&&e){if(h)return void u(d,"block");var i=b.innerWidth,j=b.innerHeight,k=d.offsetWidth,l=d.offsetHeight,n=e.offsetWidth,o=e.offsetHeight,p=a.offset(e),q=d.querySelector("."+f);q||(q=c.createElement("div"),q.className=f,d.appendChild(q));var r=q&&q.offsetWidth/2||0,s=0,t=0,v=0,w=0,x=d.classList.contains(g)?0:5,y="top";l+ri&&(t=i-k-x),q&&("top"===y?q.classList.add(m):q.classList.remove(m),v-=t,w=k/2-r/2+v,w=Math.max(Math.min(w,k-2*r-6),6),q.setAttribute("style","left:"+w+"px"))):"middle"===y&&q.setAttribute("style","display:none"),u(d,"block",s,t)}};a.createMask=function(b){var d=c.createElement("div");d.classList.add(h),d.addEventListener(a.EVENT_MOVE,a.preventDefault),d.addEventListener("tap",function(){e.close()});var e=[d];return e._show=!1,e.show=function(){return e._show=!0,d.setAttribute("style","opacity:1"),c.body.appendChild(d),e},e._remove=function(){return e._show&&(e._show=!1,d.setAttribute("style","opacity:0"),a.later(function(){var a=c.body;d.parentNode===a&&a.removeChild(d)},350)),e},e.close=function(){b?!1!==b()&&e._remove():e._remove()},e},a.fn.popover=function(){var b=arguments;this.each(function(){a.targets._popover=this,"show"!==b[0]&&"hide"!==b[0]&&"toggle"!==b[0]||t(this,b[1],b[0])})}}(mui,window,document,"popover"),function(a,b,c,d,e){var f="mui-control-item",g="mui-segmented-control-vertical",h="mui-control-content",i="mui-tab-item",j=function(a,b){return!(!b.classList||!b.classList.contains(f)&&!b.classList.contains(i))&&(b.parentNode&&b.parentNode.classList&&b.parentNode.classList.contains(g)||a.preventDefault(),b)};a.registerTarget({name:d,index:80,handle:j,target:!1}),b.addEventListener("tap",function(b){var e=a.targets.tab;if(e){for(var g,j,k,l="mui-active",m="."+l,n=e.parentNode;n&&n!==c;n=n.parentNode){if(n.classList.contains("mui-segmented-control")){g=n.querySelector(m+"."+f);break}n.classList.contains("mui-bar-tab")&&(g=n.querySelector(m+"."+i))}g&&g.classList.remove(l);var o=e===g;if(e&&e.classList.add(l),e.hash&&(k=c.getElementById(e.hash.replace("#","")))){if(!k.classList.contains(h))return void e.classList[o?"remove":"add"](l);if(!o){var p=k.parentNode;j=p.querySelectorAll("."+h+m);for(var q=0;qthis.handleX/2||!this.initialState&&a>this.handleX/2)&&(b=!0),this.lastChanged!==b&&(b?(this.handle.style.webkitTransform="translate("+(this.initialState?0:this.handleX)+"px,0)",this.classList[this.initialState?"remove":"add"](f)):(this.handle.style.webkitTransform="translate("+(this.initialState?this.handleX:0)+"px,0)",this.classList[this.initialState?"add":"remove"](f)),this.lastChanged=b)}}),a.fn.switch=function(b){var c=[];return this.each(function(){var b=null,d=this.getAttribute("data-switch");d?b=a.data[d]:(d=++a.uuid,a.data[d]=new k(this),this.setAttribute("data-switch",d)),c.push(b)}),c.length>1?c:c[0]},a.ready(function(){a("."+d).switch()})}(mui,window,"toggle"),function(a,b,c){function d(a,b){var c=b?"removeEventListener":"addEventListener";a[c]("drag",F),a[c]("dragend",F),a[c]("swiperight",F),a[c]("swipeleft",F),a[c]("flick",F)}var e,f,g="mui-active",h="mui-selected",i="mui-grid-view",j="mui-table-view-radio",k="mui-table-view-cell",l="mui-collapse-content",m="mui-disabled",n="mui-switch",o="mui-btn",p="mui-slider-handle",q="mui-slider-left",r="mui-slider-right",s="mui-transitioning",t="."+p,u="."+q,v="."+r,w="."+h,x="."+o,y=.8,z=isOpened=openedActions=progress=!1,A=sliderActionLeft=sliderActionRight=buttonsLeft=buttonsRight=sliderDirection=sliderRequestAnimationFrame=!1,B=translateX=lastTranslateX=sliderActionLeftWidth=sliderActionRightWidth=0,C=function(a){a?f?f.classList.add(g):e&&e.classList.add(g):(B&&B.cancel(),f?f.classList.remove(g):e&&e.classList.remove(g))},D=function(){if(translateX!==lastTranslateX){if(buttonsRight&&buttonsRight.length>0){progress=translateX/sliderActionRightWidth,translateX<-sliderActionRightWidth&&(translateX=-sliderActionRightWidth-Math.pow(-translateX-sliderActionRightWidth,y));for(var a=0,b=buttonsRight.length;a0){progress=translateX/sliderActionLeftWidth,translateX>sliderActionLeftWidth&&(translateX=sliderActionLeftWidth+Math.pow(translateX-sliderActionLeftWidth,y));for(var a=0,b=buttonsLeft.length;a1&&(d.style.zIndex=buttonsLeft.length-a),E(d,translateX+buttonOffset*(1-Math.min(progress,1)))}}E(A,translateX),lastTranslateX=translateX}sliderRequestAnimationFrame=requestAnimationFrame(function(){D()})},E=function(a,b){a&&(a.style.webkitTransform="translate("+b+"px,0)")};b.addEventListener(a.EVENT_START,function(b){e&&C(!1),e=f=!1,z=isOpened=openedActions=!1;for(var g=b.target,h=!1;g&&g!==c;g=g.parentNode)if(g.classList){var p=g.classList;if(("INPUT"===g.tagName&&"radio"!==g.type&&"checkbox"!==g.type||"BUTTON"===g.tagName||p.contains(n)||p.contains(o)||p.contains(m))&&(h=!0),p.contains(l))break;if(p.contains(k)){e=g;var q=e.parentNode.querySelector(w);if(!e.parentNode.classList.contains(j)&&q&&q!==e)return a.swipeoutClose(q),void(e=h=!1);if(!e.parentNode.classList.contains(i)){var r=e.querySelector("a");r&&r.parentNode===e&&(f=r)}var s=e.querySelector(t);s&&(d(e),b.stopPropagation()),h||(s?(B&&B.cancel(),B=a.later(function(){C(!0)},100)):C(!0));break}}}),b.addEventListener(a.EVENT_MOVE,function(a){C(!1)});var F={handleEvent:function(a){switch(a.type){case"drag":this.drag(a);break;case"dragend":this.dragend(a);break;case"flick":this.flick(a);break;case"swiperight":this.swiperight(a);break;case"swipeleft":this.swipeleft(a)}},drag:function(a){if(e){z||(A=sliderActionLeft=sliderActionRight=buttonsLeft=buttonsRight=sliderDirection=sliderRequestAnimationFrame=!1,(A=e.querySelector(t))&&(sliderActionLeft=e.querySelector(u),sliderActionRight=e.querySelector(v),sliderActionLeft&&(sliderActionLeftWidth=sliderActionLeft.offsetWidth,buttonsLeft=sliderActionLeft.querySelectorAll(x)),sliderActionRight&&(sliderActionRightWidth=sliderActionRight.offsetWidth,buttonsRight=sliderActionRight.querySelectorAll(x)),e.classList.remove(s),isOpened=e.classList.contains(h),isOpened&&(openedActions=e.querySelector(u+w)?"left":"right")));var b=a.detail,c=b.direction,d=b.angle;if("left"===c&&(d>150||d<-150)?(buttonsRight||buttonsLeft&&isOpened)&&(z=!0):"right"===c&&d>-30&&d<30&&(buttonsLeft||buttonsRight&&isOpened)&&(z=!0),z){a.stopPropagation(),a.detail.gesture.preventDefault();var f=a.detail.deltaX;if(isOpened&&("right"===openedActions?f-=sliderActionRightWidth:f+=sliderActionLeftWidth),f>0&&!buttonsLeft||f<0&&!buttonsRight){if(!isOpened)return;f=0}f<0?sliderDirection="toLeft":f>0?sliderDirection="toRight":sliderDirection||(sliderDirection="toLeft"),sliderRequestAnimationFrame||D(),translateX=f}}},flick:function(a){z&&a.stopPropagation()},swipeleft:function(a){z&&a.stopPropagation()},swiperight:function(a){z&&a.stopPropagation()},dragend:function(b){if(z){b.stopPropagation(),sliderRequestAnimationFrame&&(cancelAnimationFrame(sliderRequestAnimationFrame),sliderRequestAnimationFrame=null);var c=b.detail;z=!1;var d="close",f="toLeft"===sliderDirection?sliderActionRightWidth:sliderActionLeftWidth;(c.swipe||Math.abs(translateX)>f/2)&&(isOpened?"left"===c.direction&&"right"===openedActions?d="open":"right"===c.direction&&"left"===openedActions&&(d="open"):d="open"),e.classList.add(s);var g;if("open"===d){var i="toLeft"===sliderDirection?-f:f;if(E(A,i),void 0!==(g="toLeft"===sliderDirection?buttonsRight:buttonsLeft)){for(var j=null,k=0;k0&&buttonsLeft!==g)for(var k=0,m=buttonsLeft.length;k0&&buttonsRight!==g)for(var k=0,m=buttonsRight.length;k0?d.duration:e.short:duration=e[d.duration],duration||(duration=e.short);var f=document.createElement("div");return f.classList.add("mui-toast-container"),f.innerHTML='
            '+b+"
            ",f.addEventListener("webkitTransitionEnd",function(){f.classList.contains(c)||(f.parentNode.removeChild(f),f=null)}),f.addEventListener("click",function(){f.parentNode.removeChild(f),f=null}),document.body.appendChild(f),f.offsetHeight,f.classList.add(c),setTimeout(function(){f&&f.classList.remove(c)},duration),{isVisible:function(){return!!f}}}a.plusReady(function(){plus.nativeUI.toast(b,{verticalAlign:"bottom",duration:d.duration})})}}(mui,window),function(a,b,c){var d="mui-popup",e="mui-popup-backdrop",f="mui-popup-in",g="mui-popup-out",h="mui-popup-inner",i="mui-popup-title",j="mui-popup-text",k="mui-popup-input",l="mui-popup-buttons",m="mui-popup-button",n="mui-popup-button-bold",e="mui-popup-backdrop",o="mui-active",p=[],q=function(){var b=c.createElement("div");return b.classList.add(e),b.addEventListener(a.EVENT_MOVE,a.preventDefault),b.addEventListener("webkitTransitionEnd",function(){this.classList.contains(o)||b.parentNode&&b.parentNode.removeChild(b)}),b}(),r=function(a){return'
            '},s=function(a,b,c){return'
            '+b+'
            '+a.replace(/\r\n/g,"
            ").replace(/\n/g,"
            ")+"
            "+(c||"")+"
            "},t=function(a){for(var b=a.length,c=[],d=0;d'+a[d]+"");return'
            '+c.join("")+"
            "},u=function(b,e){var h=c.createElement("div");h.className=d,h.innerHTML=b;var i=function(){h.parentNode&&h.parentNode.removeChild(h),h=null};h.addEventListener(a.EVENT_MOVE,a.preventDefault),h.addEventListener("webkitTransitionEnd",function(a){h&&a.target===h&&h.classList.contains(g)&&i()}),h.style.display="block",c.body.appendChild(h),h.offsetHeight,h.classList.add(f),q.classList.contains(o)||(q.style.display="block",c.body.appendChild(q),q.offsetHeight,q.classList.add(o));var j=a.qsa("."+m,h),l=h.querySelector("."+k+" input"),n={element:h,close:function(a,b){if(h){if(!1===(e&&e({index:a||0,value:l&&l.value||""})))return;!1!==b?(h.classList.remove(f),h.classList.add(g)):i(),p.pop(),p.length?p[p.length-1].show(b):q.classList.remove(o)}}},r=function(a){n.close(j.indexOf(a.target))};return a(h).on("tap","."+m,r),p.length&&p[p.length-1].hide(),p.push({close:n.close,show:function(a){h.style.display="block",h.offsetHeight,h.classList.add(f)},hide:function(){h.style.display="none",h.classList.remove(f)}}),n},v=function(b,c,d,e,f){if(void 0!==b)return"function"==typeof c?(e=c,f=d,c=null,d=null):"function"==typeof d&&(f=e,e=d,d=null),a.os.plus&&"div"!==f?plus.nativeUI.alert(b,e,c||"提示",d||"确定"):u(s(b,c||"提示")+t([d||"确定"]),e)},w=function(b,c,d,e,f){if(void 0!==b)return"function"==typeof c?(e=c,f=d,c=null,d=null):"function"==typeof d&&(f=e,e=d,d=null),a.os.plus&&"div"!==f?plus.nativeUI.confirm(b,e,c,d||["取消","确认"]):u(s(b,c||"提示")+t(d||["取消","确认"]),e)},x=function(b,c,d,e,f,g){if(void 0!==b)return"function"==typeof c?(f=c,g=d,c=null,d=null,e=null):"function"==typeof d?(f=d,g=e,d=null,e=null):"function"==typeof e&&(g=f,f=e,e=null),a.os.plus&&"div"!==g?plus.nativeUI.prompt(b,f,d||"提示",c,e||["取消","确认"]):u(s(b,d||"提示",r(c))+t(e||["取消","确认"]),f)},y=function(){return!!p.length&&(p[p.length-1].close(),!0)},z=function(){for(;p.length;)p[p.length-1].close()};a.closePopup=y,a.closePopups=z,a.alert=v,a.confirm=w,a.prompt=x}(mui,window,document),function(a,b){var c="mui-progressbar",d="mui-progressbar-in",e="mui-progressbar-out",f="mui-progressbar-infinite",g=".mui-progressbar",h=function(b){if(b=a(b||"body"),0!==b.length){if(b=b[0],b.classList.contains(c))return b;var d=b.querySelectorAll(g);if(d)for(var e=0,f=d.length;e"),h.appendChild(l))}return i&&k(h,i),l}},j=function(a){var b=h(a);if(b){var c=b.classList;c.contains(d)&&!c.contains(e)&&(c.remove(d),c.add(e),b.addEventListener("webkitAnimationEnd",function(){b.parentNode&&b.parentNode.removeChild(b),b=null}))}},k=function(a,b,c){"number"==typeof a&&(c=b,b=a,a=!1);var d=h(a);if(d&&!d.classList.contains(f)){b&&(b=Math.min(Math.max(b,0),100)),d.offsetHeight;var e=d.querySelector("span");if(e){var g=e.style;g.webkitTransform="translate3d("+(-100+b)+"%,0,0)",g.webkitTransitionDuration=void 0!==c?c+"ms":""}return d}};a.fn.progressbar=function(a){var b=[];return a=a||{},this.each(function(){var c=this,d=c.mui_plugin_progressbar;d?a&&d.setOptions(a):c.mui_plugin_progressbar=d={options:a,setOptions:function(a){this.options=a},show:function(){return i(c,this.options.progress,this.options.color)},setProgress:function(a){return k(c,a)},hide:function(){return j(c)}},b.push(d)}),1===b.length?b[0]:b}}(mui,document),function(a,b,c){var d="mui-icon",e="mui-icon-clear",f="mui-icon-speech",g="mui-icon-eye",h="mui-input-row",i="mui-placeholder",j="mui-tooltip",k="mui-hidden",l="mui-focusin",m="."+e,n="."+f,o="."+g,p="."+i,q="."+j,r=function(a){for(;a&&a!==c;a=a.parentNode)if(a.classList&&a.classList.contains(h))return a;return null},s=function(a,b){this.element=a,this.options=b||{actions:"clear"},~this.options.actions.indexOf("slider")?(this.sliderActionClass=j+" "+k,this.sliderActionSelector=q):(~this.options.actions.indexOf("clear")&&(this.clearActionClass=d+" "+e+" "+k,this.clearActionSelector=m),~this.options.actions.indexOf("speech")&&(this.speechActionClass=d+" "+f,this.speechActionSelector=n),~this.options.actions.indexOf("search")&&(this.searchActionClass=i,this.searchActionSelector=p),~this.options.actions.indexOf("password")&&(this.passwordActionClass=d+" "+g,this.passwordActionSelector=o)),this.init()};s.prototype.init=function(){this.initAction(),this.initElementEvent()},s.prototype.initAction=function(){var b=this,c=b.element.parentNode;c&&(b.sliderActionClass?b.sliderAction=b.createAction(c,b.sliderActionClass,b.sliderActionSelector):(b.searchActionClass&&(b.searchAction=b.createAction(c,b.searchActionClass,b.searchActionSelector),b.searchAction.addEventListener("tap",function(c){a.focus(b.element),c.stopPropagation()})),b.speechActionClass&&(b.speechAction=b.createAction(c,b.speechActionClass,b.speechActionSelector),b.speechAction.addEventListener("click",a.stopPropagation),b.speechAction.addEventListener("tap",function(a){b.speechActionClick(a)})),b.clearActionClass&&(b.clearAction=b.createAction(c,b.clearActionClass,b.clearActionSelector),b.clearAction.addEventListener("tap",function(a){b.clearActionClick(a)})),b.passwordActionClass&&(b.passwordAction=b.createAction(c,b.passwordActionClass,b.passwordActionSelector),b.passwordAction.addEventListener("tap",function(a){b.passwordActionClick(a)}))))},s.prototype.createAction=function(a,b,e){var f=a.querySelector(e);if(!f){var f=c.createElement("span");f.className=b,b===this.searchActionClass&&(f.innerHTML=''+this.element.getAttribute("placeholder")+"",this.element.setAttribute("placeholder",""),this.element.value.trim()&&a.classList.add("mui-active")),a.insertBefore(f,this.element.nextSibling)}return f},s.prototype.initElementEvent=function(){var b=this.element;if(this.sliderActionClass){var c=this.sliderAction,d=null,e=function(){c.classList.remove(k);var a=b.offsetLeft,e=b.offsetWidth-28,f=c.offsetWidth,g=Math.abs(b.max-b.min),h=e/g*Math.abs(b.value-b.min);c.style.left=14+a+h-f/2+"px",c.innerText=b.value,d&&clearTimeout(d),d=setTimeout(function(){c.classList.add(k)},1e3)};b.addEventListener("input",e),b.addEventListener("tap",e),b.addEventListener(a.EVENT_MOVE,function(a){a.stopPropagation()})}else{if(this.clearActionClass){var f=this.clearAction;if(!f)return;a.each(["keyup","change","input","focus","cut","paste"],function(a,c){!function(a){b.addEventListener(a,function(){f.classList[b.value.trim()?"remove":"add"](k)})}(c)}),b.addEventListener("blur",function(){f.classList.add(k)})}this.searchActionClass&&(b.addEventListener("focus",function(){b.parentNode.classList.add("mui-active")}),b.addEventListener("blur",function(){b.value.trim()||b.parentNode.classList.remove("mui-active")}))}},s.prototype.setPlaceholder=function(a){if(this.searchActionClass){var b=this.element.parentNode.querySelector(p);b&&(b.getElementsByTagName("span")[1].innerText=a)}else this.element.setAttribute("placeholder",a)},s.prototype.passwordActionClick=function(a){"text"===this.element.type?this.element.type="password":this.element.type="text",this.passwordAction.classList.toggle("mui-active"),a.preventDefault()},s.prototype.clearActionClick=function(b){var c=this;c.element.value="",a.focus(c.element),c.clearAction.classList.add(k),b.preventDefault()},s.prototype.speechActionClick=function(d){if(b.plus){var e=this,f=e.element.value;e.element.value="",c.body.classList.add(l),plus.speech.startRecognize({engine:"iFly"},function(b){e.element.value+=b,a.focus(e.element),plus.speech.stopRecognize(),a.trigger(e.element,"recognized",{value:e.element.value}),f!==e.element.value&&(a.trigger(e.element,"change"),a.trigger(e.element,"input"))},function(a){c.body.classList.remove(l)})}else alert("only for 5+");d.preventDefault()},a.fn.input=function(b){var c=[];return this.each(function(){var b=null,d=[],e=r(this.parentNode);if("range"===this.type&&e.classList.contains("mui-input-range"))d.push("slider");else{var f=this.classList;f.contains("mui-input-clear")&&d.push("clear"),a.os.android&&a.os.stream||!f.contains("mui-input-speech")||d.push("speech"),f.contains("mui-input-password")&&d.push("password"),"search"===this.type&&e.classList.contains("mui-search")&&d.push("search")}var g=this.getAttribute("data-input-"+d[0]);if(g)b=a.data[g];else{g=++a.uuid,b=a.data[g]=new s(this,{actions:d.join(",")});for(var h=0,i=d.length;hthis._A?this.element.classList.add(c):this.element.classList.remove(c),this.lastOpacity!==f&&(a.trigger(this.element,"alpha",{alpha:f}),this.lastOpacity=f)},f.prototype.destory=function(){this.scrollByElem.removeEventListener("scroll",this._bufferFn),this.scrollByElem.removeEventListener(a.EVENT_MOVE,this._bufferFn),this.element.style.backgroundColor=this._bgColor,this.element.mui_plugin_transparent=null},a.fn.transparent=function(a){a=a||{};var c=[];return this.each(function(){var d=this.mui_plugin_transparent;if(!d){var e=this.getAttribute("data-top"),g=this.getAttribute("data-offset"),h=this.getAttribute("data-duration"),i=this.getAttribute("data-scrollby");null!==e&&void 0===a.top&&(a.top=e),null!==g&&void 0===a.offset&&(a.offset=g),null!==h&&void 0===a.duration&&(a.duration=h),null!==i&&void 0===a.scrollby&&(a.scrollby=document.querySelector(i)||b),d=this.mui_plugin_transparent=new f(this,a)}c.push(d)}),1===c.length?c[0]:c},a.ready(function(){a(".mui-bar-transparent").transparent()})}(mui,window),function(a){var b="ontouchstart"in document,c=b?"tap":"click",d="change",e=".mui-btn-numbox-plus,.mui-numbox-btn-plus",f=".mui-btn-numbox-minus,.mui-numbox-btn-minus",g=".mui-input-numbox,.mui-numbox-input",h=a.Numbox=a.Class.extend({init:function(b,c){var d=this;if(!b)throw"构造 numbox 时缺少容器元素";d.holder=b,c=c||{},c.step=parseInt(c.step||1),d.options=c,d.input=a.qsa(g,d.holder)[0],d.plus=a.qsa(e,d.holder)[0],d.minus=a.qsa(f,d.holder)[0],d.checkValue(),d.initEvent()},initEvent:function(){var b=this;b.plus.addEventListener(c,function(c){var e=parseInt(b.input.value)+b.options.step;b.input.value=e.toString(),a.trigger(b.input,d,null)}),b.minus.addEventListener(c,function(c){var e=parseInt(b.input.value)-b.options.step;b.input.value=e.toString(),a.trigger(b.input,d,null)}),b.input.addEventListener(d,function(c){b.checkValue();var e=parseInt(b.input.value);a.trigger(b.holder,d,{value:e})})},getValue:function(){var a=this;return parseInt(a.input.value)},checkValue:function(){var a=this,b=a.input.value;if(null==b||""==b||isNaN(b))a.input.value=a.options.min||0,a.minus.disabled=null!=a.options.min;else{var b=parseInt(b);null!=a.options.max&&!isNaN(a.options.max)&&b>=parseInt(a.options.max)?(b=a.options.max,a.plus.disabled=!0):a.plus.disabled=!1,null!=a.options.min&&!isNaN(a.options.min)&&b<=parseInt(a.options.min)?(b=a.options.min,a.minus.disabled=!0):a.minus.disabled=!1,a.input.value=b}},setOption:function(a,b){this.options[a]=b},setValue:function(a){this.input.value=a,this.checkValue()}});a.fn.numbox=function(a){return this.each(function(a,b){if(!b.numbox)if(d)b.numbox=new h(b,d);else{var c=b.getAttribute("data-numbox-options"),d=c?JSON.parse(c):{};d.step=b.getAttribute("data-numbox-step")||d.step,d.min=b.getAttribute("data-numbox-min")||d.min,d.max=b.getAttribute("data-numbox-max")||d.max,b.numbox=new h(b,d)}}),this[0]?this[0].numbox:null},a.ready(function(){a(".mui-numbox").numbox()})}(mui),function(a,b,c){var d="mui-disabled",e="reset",f="loading",g={loadingText:"Loading...",loadingIcon:"mui-spinner mui-spinner-white",loadingIconPosition:"left"},h=function(b,c){this.element=b,this.options=a.extend({},g,c),this.options.loadingText||(this.options.loadingText=g.loadingText),null===this.options.loadingIcon&&(this.options.loadingIcon="mui-spinner","rgb(255, 255, 255)"===a.getStyles(this.element,"color")&&(this.options.loadingIcon+=" mui-spinner-white")),this.isInput="INPUT"===this.element.tagName,this.resetHTML=this.isInput?this.element.value:this.element.innerHTML,this.state=""};h.prototype.loading=function(){this.setState(f)},h.prototype.reset=function(){this.setState(e)},h.prototype.setState=function(a){if(this.state===a)return!1;if(this.state=a,a===e)this.element.disabled=!1,this.element.classList.remove(d),this.setHtml(this.resetHTML);else if(a===f){this.element.disabled=!0,this.element.classList.add(d);var b=this.isInput?this.options.loadingText:""+this.options.loadingText+"";this.options.loadingIcon&&!this.isInput&&("right"===this.options.loadingIconPosition?b+=' ':b=' '+b),this.setHtml(b)}},h.prototype.setHtml=function(a){this.isInput?this.element.value=a:this.element.innerHTML=a},a.fn.button=function(a){var b=[];return this.each(function(){var c=this.mui_plugin_button;if(!c){var d=this.getAttribute("data-loading-text"),g=this.getAttribute("data-loading-icon"),i=this.getAttribute("data-loading-icon-position");this.mui_plugin_button=c=new h(this,{loadingText:d,loadingIcon:g,loadingIconPosition:i})}a!==f&&a!==e||c.setState(a),b.push(c)}),1===b.length?b[0]:b}}(mui,window,document); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/mobileWorks/js/mui.picker.js b/Yangcai365_web/manage/zinc/mobileWorks/js/mui.picker.js new file mode 100644 index 0000000..6dc78ae --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/js/mui.picker.js @@ -0,0 +1,389 @@ +/** + * 选择列表插件 + * varstion 2.0.0 + * by Houfeng + * Houfeng@DCloud.io + */ + +(function($, window, document, undefined) { + + var MAX_EXCEED = 30; + var VISIBLE_RANGE = 90; + var DEFAULT_ITEM_HEIGHT = 40; + var BLUR_WIDTH = 10; + + var rad2deg = $.rad2deg = function(rad) { + return rad / (Math.PI / 180); + }; + + var deg2rad = $.deg2rad = function(deg) { + return deg * (Math.PI / 180); + }; + + var platform = navigator.platform.toLowerCase(); + var userAgent = navigator.userAgent.toLowerCase(); + var isIos = (userAgent.indexOf('iphone') > -1 || + userAgent.indexOf('ipad') > -1 || + userAgent.indexOf('ipod') > -1) && + (platform.indexOf('iphone') > -1 || + platform.indexOf('ipad') > -1 || + platform.indexOf('ipod') > -1); + //alert(isIos); + + var Picker = $.Picker = function(holder, options) { + var self = this; + self.holder = holder; + self.options = options || {}; + self.init(); + self.initInertiaParams(); + self.calcElementItemPostion(true); + self.bindEvent(); + }; + + Picker.prototype.findElementItems = function() { + var self = this; + self.elementItems = [].slice.call(self.holder.querySelectorAll('li')); + return self.elementItems; + }; + + Picker.prototype.init = function() { + var self = this; + self.list = self.holder.querySelector('ul'); + self.findElementItems(); + self.height = self.holder.offsetHeight; + self.r = self.height / 2 - BLUR_WIDTH; + self.d = self.r * 2; + self.itemHeight = self.elementItems.length > 0 ? self.elementItems[0].offsetHeight : DEFAULT_ITEM_HEIGHT; + self.itemAngle = parseInt(self.calcAngle(self.itemHeight * 0.8)); + self.hightlightRange = self.itemAngle / 2; + self.visibleRange = VISIBLE_RANGE; + self.beginAngle = 0; + self.beginExceed = self.beginAngle - MAX_EXCEED; + self.list.angle = self.beginAngle; + if (isIos) { + self.list.style.webkitTransformOrigin = "center center " + self.r + "px"; + } + }; + + Picker.prototype.calcElementItemPostion = function(andGenerateItms) { + var self = this; + if (andGenerateItms) { + self.items = []; + } + self.elementItems.forEach(function(item) { + var index = self.elementItems.indexOf(item); + self.endAngle = self.itemAngle * index; + item.angle = self.endAngle; + item.style.webkitTransformOrigin = "center center -" + self.r + "px"; + item.style.webkitTransform = "translateZ(" + self.r + "px) rotateX(" + (-self.endAngle) + "deg)"; + if (andGenerateItms) { + var dataItem = {}; + dataItem.text = item.innerHTML || ''; + dataItem.value = item.getAttribute('data-value') || dataItem.text; + self.items.push(dataItem); + } + }); + self.endExceed = self.endAngle + MAX_EXCEED; + self.calcElementItemVisibility(self.beginAngle); + }; + + Picker.prototype.calcAngle = function(c) { + var self = this; + var a = b = parseFloat(self.r); + //直径的整倍数部分直接乘以 180 + c = Math.abs(c); //只算角度不关心正否值 + var intDeg = parseInt(c / self.d) * 180; + c = c % self.d; + //余弦 + var cosC = (a * a + b * b - c * c) / (2 * a * b); + var angleC = intDeg + rad2deg(Math.acos(cosC)); + return angleC; + }; + + Picker.prototype.calcElementItemVisibility = function(angle) { + var self = this; + self.elementItems.forEach(function(item) { + var difference = Math.abs(item.angle - angle); + if (difference < self.hightlightRange) { + item.classList.add('highlight'); + } else if (difference < self.visibleRange) { + item.classList.add('visible'); + item.classList.remove('highlight'); + } else { + item.classList.remove('highlight'); + item.classList.remove('visible'); + } + }); + }; + + Picker.prototype.setAngle = function(angle) { + var self = this; + self.list.angle = angle; + self.list.style.webkitTransform = "perspective(1000px) rotateY(0deg) rotateX(" + angle + "deg)"; + self.calcElementItemVisibility(angle); + }; + + Picker.prototype.bindEvent = function() { + var self = this; + var lastAngle = 0; + var startY = null; + var isPicking = false; + self.holder.addEventListener($.EVENT_START, function(event) { + isPicking = true; + event.preventDefault(); + self.list.style.webkitTransition = ''; + startY = (event.changedTouches ? event.changedTouches[0] : event).pageY; + lastAngle = self.list.angle; + self.updateInertiaParams(event, true); + }, false); + self.holder.addEventListener($.EVENT_END, function(event) { + isPicking = false; + event.preventDefault(); + self.startInertiaScroll(event); + }, false); + self.holder.addEventListener($.EVENT_CANCEL, function(event) { + isPicking = false; + event.preventDefault(); + self.startInertiaScroll(event); + }, false); + self.holder.addEventListener($.EVENT_MOVE, function(event) { + if (!isPicking) { + return; + } + event.preventDefault(); + var endY = (event.changedTouches ? event.changedTouches[0] : event).pageY; + var dragRange = endY - startY; + var dragAngle = self.calcAngle(dragRange); + var newAngle = dragRange > 0 ? lastAngle - dragAngle : lastAngle + dragAngle; + if (newAngle > self.endExceed) { + newAngle = self.endExceed + } + if (newAngle < self.beginExceed) { + newAngle = self.beginExceed + } + self.setAngle(newAngle); + self.updateInertiaParams(event); + }, false); + //-- + self.list.addEventListener('tap', function(event) { + elementItem = event.target; + if (elementItem.tagName == 'LI') { + self.setSelectedIndex(self.elementItems.indexOf(elementItem), 200); + } + }, false); + }; + + Picker.prototype.initInertiaParams = function() { + var self = this; + self.lastMoveTime = 0; + self.lastMoveStart = 0; + self.stopInertiaMove = false; + }; + + Picker.prototype.updateInertiaParams = function(event, isStart) { + var self = this; + var point = event.changedTouches ? event.changedTouches[0] : event; + if (isStart) { + self.lastMoveStart = point.pageY; + self.lastMoveTime = event.timeStamp || Date.now(); + self.startAngle = self.list.angle; + } else { + var nowTime = event.timeStamp || Date.now(); + if (nowTime - self.lastMoveTime > 300) { + self.lastMoveTime = nowTime; + self.lastMoveStart = point.pageY; + } + } + self.stopInertiaMove = true; + }; + + Picker.prototype.startInertiaScroll = function(event) { + var self = this; + var point = event.changedTouches ? event.changedTouches[0] : event; + /** + * 缓动代码 + */ + var nowTime = event.timeStamp || Date.now(); + var v = (point.pageY - self.lastMoveStart) / (nowTime - self.lastMoveTime); //最后一段时间手指划动速度 + var dir = v > 0 ? -1 : 1; //加速度方向 + var deceleration = dir * 0.0006 * -1; + var duration = Math.abs(v / deceleration); // 速度消减至0所需时间 + var dist = v * duration / 2; //最终移动多少 + var startAngle = self.list.angle; + var distAngle = self.calcAngle(dist) * dir; + //---- + var srcDistAngle = distAngle; + if (startAngle + distAngle < self.beginExceed) { + distAngle = self.beginExceed - startAngle; + duration = duration * (distAngle / srcDistAngle) * 0.6; + } + if (startAngle + distAngle > self.endExceed) { + distAngle = self.endExceed - startAngle; + duration = duration * (distAngle / srcDistAngle) * 0.6; + } + //---- + if (distAngle == 0) { + self.endScroll(); + return; + } + self.scrollDistAngle(nowTime, startAngle, distAngle, duration); + }; + + Picker.prototype.scrollDistAngle = function(nowTime, startAngle, distAngle, duration) { + var self = this; + self.stopInertiaMove = false; + (function(nowTime, startAngle, distAngle, duration) { + var frameInterval = 13; + var stepCount = duration / frameInterval; + var stepIndex = 0; + (function inertiaMove() { + if (self.stopInertiaMove) return; + var newAngle = self.quartEaseOut(stepIndex, startAngle, distAngle, stepCount); + self.setAngle(newAngle); + stepIndex++; + if (stepIndex > stepCount - 1 || newAngle < self.beginExceed || newAngle > self.endExceed) { + self.endScroll(); + return; + } + setTimeout(inertiaMove, frameInterval); + })(); + })(nowTime, startAngle, distAngle, duration); + }; + + Picker.prototype.quartEaseOut = function(t, b, c, d) { + return -c * ((t = t / d - 1) * t * t * t - 1) + b; + }; + + Picker.prototype.endScroll = function() { + var self = this; + if (self.list.angle < self.beginAngle) { + self.list.style.webkitTransition = "150ms ease-out"; + self.setAngle(self.beginAngle); + } else if (self.list.angle > self.endAngle) { + self.list.style.webkitTransition = "150ms ease-out"; + self.setAngle(self.endAngle); + } else { + var index = parseInt((self.list.angle / self.itemAngle).toFixed(0)); + self.list.style.webkitTransition = "100ms ease-out"; + self.setAngle(self.itemAngle * index); + } + self.triggerChange(); + }; + + Picker.prototype.triggerChange = function(force) { + var self = this; + setTimeout(function() { + var index = self.getSelectedIndex(); + var item = self.items[index]; + if ($.trigger && (index != self.lastIndex || force === true)) { + $.trigger(self.holder, 'change', { + "index": index, + "item": item + }); + //console.log('change:' + index); + } + self.lastIndex = index; + typeof force === 'function' && force(); + }, 0); + }; + + Picker.prototype.correctAngle = function(angle) { + var self = this; + if (angle < self.beginAngle) { + return self.beginAngle; + } else if (angle > self.endAngle) { + return self.endAngle; + } else { + return angle; + } + }; + + Picker.prototype.setItems = function(items) { + var self = this; + self.items = items || []; + var buffer = []; + self.items.forEach(function(item) { + if (item !== null && item !== undefined) { + buffer.push('
          • ' + (item.text || item) + '
          • '); + } + }); + self.list.innerHTML = buffer.join(''); + self.findElementItems(); + self.calcElementItemPostion(); + self.setAngle(self.correctAngle(self.list.angle)); + self.triggerChange(true); + }; + + Picker.prototype.getItems = function() { + var self = this; + return self.items; + }; + + Picker.prototype.getSelectedIndex = function() { + var self = this; + return parseInt((self.list.angle / self.itemAngle).toFixed(0)); + }; + + Picker.prototype.setSelectedIndex = function(index, duration, callback) { + var self = this; + self.list.style.webkitTransition = ''; + var angle = self.correctAngle(self.itemAngle * index); + if (duration && duration > 0) { + var distAngle = angle - self.list.angle; + self.scrollDistAngle(Date.now(), self.list.angle, distAngle, duration); + } else { + self.setAngle(angle); + } + self.triggerChange(callback); + }; + + Picker.prototype.getSelectedItem = function() { + var self = this; + return self.items[self.getSelectedIndex()]; + }; + + Picker.prototype.getSelectedValue = function() { + var self = this; + return (self.items[self.getSelectedIndex()] || {}).value; + }; + + Picker.prototype.getSelectedText = function() { + var self = this; + return (self.items[self.getSelectedIndex()] || {}).text; + }; + + Picker.prototype.setSelectedValue = function(value, duration, callback) { + var self = this; + for (var index in self.items) { + var item = self.items[index]; + if (item.value == value) { + self.setSelectedIndex(index, duration, callback); + return; + } + } + }; + + if ($.fn) { + $.fn.picker = function(options) { + //遍历选择的元素 + this.each(function(i, element) { + if (element.picker) return; + if (options) { + element.picker = new Picker(element, options); + } else { + var optionsText = element.getAttribute('data-picker-options'); + var _options = optionsText ? JSON.parse(optionsText) : {}; + element.picker = new Picker(element, _options); + } + }); + return this[0] ? this[0].picker : null; + }; + + //自动初始化 + $.ready(function() { + $('.mui-picker').picker(); + }); + } + +})(window.mui || window, window, document, undefined); +//end \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/mobileWorks/js/mui.poppicker.js b/Yangcai365_web/manage/zinc/mobileWorks/js/mui.poppicker.js new file mode 100644 index 0000000..4c4ce1e --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/js/mui.poppicker.js @@ -0,0 +1,160 @@ +/** + * 弹出选择列表插件 + * 此组件依赖 listpcker ,请在页面中先引入 mui.picker.css + mui.picker.js + * varstion 1.0.1 + * by Houfeng + * Houfeng@DCloud.io + */ + +(function($, document) { + + //创建 DOM + $.dom = function(str) { + if (typeof(str) !== 'string') { + if ((str instanceof Array) || (str[0] && str.length)) { + return [].slice.call(str); + } else { + return [str]; + } + } + if (!$.__create_dom_div__) { + $.__create_dom_div__ = document.createElement('div'); + } + $.__create_dom_div__.innerHTML = str; + return [].slice.call($.__create_dom_div__.childNodes); + }; + + var panelBuffer = '
            \ +
            \ + \ + \ +
            \ +
            \ +
            \ +
            \ +
            '; + + var pickerBuffer = '
            \ +
            \ +
            \ +
              \ +
            \ +
            \ +
            \ +
            '; + + //定义弹出选择器类 + var PopPicker = $.PopPicker = $.Class.extend({ + //构造函数 + init: function(options) { + var self = this; + self.options = options || {}; + self.options.buttons = self.options.buttons || ['取消', '确定']; + self.panel = $.dom(panelBuffer)[0]; + document.body.appendChild(self.panel); + self.ok = self.panel.querySelector('.mui-poppicker-btn-ok'); + self.cancel = self.panel.querySelector('.mui-poppicker-btn-cancel'); + self.body = self.panel.querySelector('.mui-poppicker-body'); + self.mask = $.createMask(); + self.cancel.innerText = self.options.buttons[0]; + self.ok.innerText = self.options.buttons[1]; + self.cancel.addEventListener('tap', function(event) { + self.hide(); + }, false); + self.ok.addEventListener('tap', function(event) { + if (self.callback) { + var rs = self.callback(self.getSelectedItems()); + if (rs !== false) { + self.hide(); + } + } + }, false); + self.mask[0].addEventListener('tap', function() { + self.hide(); + }, false); + self._createPicker(); + //防止滚动穿透 + self.panel.addEventListener($.EVENT_START, function(event) { + event.preventDefault(); + }, false); + self.panel.addEventListener($.EVENT_MOVE, function(event) { + event.preventDefault(); + }, false); + }, + _createPicker: function() { + var self = this; + var layer = self.options.layer || 1; + var width = (100 / layer) + '%'; + self.pickers = []; + for (var i = 1; i <= layer; i++) { + var pickerElement = $.dom(pickerBuffer)[0]; + pickerElement.style.width = width; + self.body.appendChild(pickerElement); + var picker = $(pickerElement).picker(); + self.pickers.push(picker); + pickerElement.addEventListener('change', function(event) { + var nextPickerElement = this.nextSibling; + if (nextPickerElement && nextPickerElement.picker) { + var eventData = event.detail || {}; + var preItem = eventData.item || {}; + nextPickerElement.picker.setItems(preItem.children); + } + }, false); + } + }, + //填充数据 + setData: function(data) { + var self = this; + data = data || []; + self.pickers[0].setItems(data); + }, + //获取选中的项(数组) + getSelectedItems: function() { + var self = this; + var items = []; + for (var i in self.pickers) { + if(self.pickers.hasOwnProperty(i)) { // 修复for in会访问继承属性造成items报错情况 + var picker = self.pickers[i]; + items.push(picker.getSelectedItem() || {}); + } + } + return items; + }, + //显示 + show: function(callback) { + var self = this; + self.callback = callback; + self.mask.show(); + document.body.classList.add($.className('poppicker-active-for-page')); + self.panel.classList.add($.className('active')); + //处理物理返回键 + self.__back = $.back; + $.back = function() { + self.hide(); + }; + }, + //隐藏 + hide: function() { + var self = this; + if (self.disposed) return; + self.panel.classList.remove($.className('active')); + self.mask.close(); + document.body.classList.remove($.className('poppicker-active-for-page')); + //处理物理返回键 + $.back=self.__back; + }, + dispose: function() { + var self = this; + self.hide(); + setTimeout(function() { + self.panel.parentNode.removeChild(self.panel); + for (var name in self) { + self[name] = null; + delete self[name]; + }; + self.disposed = true; + }, 300); + } + }); + +})(mui, document); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/mobileWorks/js/mui.pullToRefresh.js b/Yangcai365_web/manage/zinc/mobileWorks/js/mui.pullToRefresh.js new file mode 100644 index 0000000..8e76e35 --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/js/mui.pullToRefresh.js @@ -0,0 +1,407 @@ +(function($, window, document) { + var STATE_BEFORECHANGEOFFSET = 'beforeChangeOffset'; + var STATE_AFTERCHANGEOFFSET = 'afterChangeOffset'; + + var EVENT_PULLSTART = 'pullstart'; + var EVENT_PULLING = 'pulling'; + var EVENT_BEFORECHANGEOFFSET = STATE_BEFORECHANGEOFFSET; + var EVENT_AFTERCHANGEOFFSET = STATE_AFTERCHANGEOFFSET; + var EVENT_DRAGENDAFTERCHANGEOFFSET = 'dragEndAfterChangeOffset'; + + var CLASS_TRANSITIONING = $.className('transitioning'); + var CLASS_PULL_TOP_TIPS = $.className('pull-top-tips'); + var CLASS_PULL_BOTTOM_TIPS = $.className('pull-bottom-tips'); + var CLASS_PULL_LOADING = $.className('pull-loading'); + var CLASS_SCROLL = $.className('scroll'); + + var CLASS_PULL_TOP_ARROW = $.className('pull-loading') + ' ' + $.className('icon') + ' ' + $.className('icon-pulldown'); + var CLASS_PULL_TOP_ARROW_REVERSE = CLASS_PULL_TOP_ARROW + ' ' + $.className('reverse'); + var CLASS_PULL_TOP_SPINNER = $.className('pull-loading') + ' ' + $.className('spinner'); + var CLASS_HIDDEN = $.className('hidden'); + + var SELECTOR_PULL_LOADING = '.' + CLASS_PULL_LOADING; + $.PullToRefresh = $.Class.extend({ + init: function(element, options) { + this.element = element; + this.options = $.extend(true, { + down: { + height: 75, + callback: false, + }, + up: { + auto: false, + offset: 100, //距离底部高度(到达该高度即触发) + show: true, + contentinit: '上拉显示更多', + contentdown: '上拉显示更多', + contentrefresh: '正在加载...', + contentnomore: '没有更多数据了', + callback: false + }, + preventDefaultException: { + tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ + } + }, options); + this.stopped = this.isNeedRefresh = this.isDragging = false; + this.state = STATE_BEFORECHANGEOFFSET; + this.isInScroll = this.element.classList.contains(CLASS_SCROLL); + this.initPullUpTips(); + + this.initEvent(); + }, + _preventDefaultException: function(el, exceptions) { + for (var i in exceptions) { + if (exceptions[i].test(el[i])) { + return true; + } + } + return false; + }, + initEvent: function() { + if ($.isFunction(this.options.down.callback)) { + this.element.addEventListener($.EVENT_START, this); + this.element.addEventListener('drag', this); + this.element.addEventListener('dragend', this); + } + if (this.pullUpTips) { + this.element.addEventListener('dragup', this); + if (this.isInScroll) { + this.element.addEventListener('scrollbottom', this); + } else { + window.addEventListener('scroll', this); + } + } + }, + handleEvent: function(e) { + switch (e.type) { + case $.EVENT_START: + this.isInScroll && this._canPullDown() && e.target && !this._preventDefaultException(e.target, this.options.preventDefaultException) && e.preventDefault(); + break; + case 'drag': + this._drag(e); + break; + case 'dragend': + this._dragend(e); + break; + case 'webkitTransitionEnd': + this._transitionEnd(e); + break; + case 'dragup': + case 'scroll': + this._dragup(e); + break; + case 'scrollbottom': + if (e.target === this.element) { + this.pullUpLoading(e); + } + break; + } + }, + initPullDownTips: function() { + var self = this; + if ($.isFunction(self.options.down.callback)) { + self.pullDownTips = (function() { + var element = document.querySelector('.' + CLASS_PULL_TOP_TIPS); + if (element) { + element.parentNode.removeChild(element); + } + if (!element) { + element = document.createElement('div'); + element.classList.add(CLASS_PULL_TOP_TIPS); + element.innerHTML = '
            '; + element.addEventListener('webkitTransitionEnd', self); + } + self.pullDownTipsIcon = element.querySelector(SELECTOR_PULL_LOADING); + document.body.appendChild(element); + return element; + }()); + } + }, + initPullUpTips: function() { + var self = this; + if ($.isFunction(self.options.up.callback)) { + self.pullUpTips = (function() { + var element = self.element.querySelector('.' + CLASS_PULL_BOTTOM_TIPS); + if (!element) { + element = document.createElement('div'); + element.classList.add(CLASS_PULL_BOTTOM_TIPS); + if (!self.options.up.show) { + element.classList.add(CLASS_HIDDEN); + } + element.innerHTML = '
            ' + self.options.up.contentinit + '
            '; + self.element.appendChild(element); + } + self.pullUpTipsIcon = element.querySelector(SELECTOR_PULL_LOADING); + return element; + }()); + } + }, + _transitionEnd: function(e) { + if (e.target === this.pullDownTips && this.removing) { + this.removePullDownTips(); + } + }, + _dragup: function(e) { + var self = this; + if (self.loading) { + return; + } + if (e && e.detail && $.gestures.session.drag) { + self.isDraggingUp = true; + } else { + if (!self.isDraggingUp) { //scroll event + return; + } + } + if (!self.isDragging) { + if (self._canPullUp()) { + self.pullUpLoading(e); + } + } + }, + _canPullUp: function() { + if (this.removing) { + return false; + } + if (this.isInScroll) { + var scrollId = this.element.parentNode.getAttribute('data-scroll'); + if (scrollId) { + var scrollApi = $.data[scrollId]; + return scrollApi.y === scrollApi.maxScrollY; + } + } + return window.pageYOffset + window.innerHeight + this.options.up.offset >= document.documentElement.scrollHeight; + }, + _canPullDown: function() { + if (this.removing) { + return false; + } + if (this.isInScroll) { + var scrollId = this.element.parentNode.getAttribute('data-scroll'); + if (scrollId) { + var scrollApi = $.data[scrollId]; + return scrollApi.y === 0; + } + } + return document.body.scrollTop === 0; + }, + _drag: function(e) { + if (this.loading || this.stopped) { + e.stopPropagation(); + e.detail.gesture.preventDefault(); + return; + } + var detail = e.detail; + if (!this.isDragging) { + if (detail.direction === 'down' && this._canPullDown()) { + if (document.querySelector('.' + CLASS_PULL_TOP_TIPS)) { + e.stopPropagation(); + e.detail.gesture.preventDefault(); + return; + } + this.isDragging = true; + this.removing = false; + this.startDeltaY = detail.deltaY; + $.gestures.session.lockDirection = true; //锁定方向 + $.gestures.session.startDirection = detail.direction; + this._pullStart(this.startDeltaY); + } + } + if (this.isDragging) { + e.stopPropagation(); + e.detail.gesture.preventDefault(); + var deltaY = detail.deltaY - this.startDeltaY; + deltaY = Math.min(deltaY, 1.5 * this.options.down.height); + this.deltaY = deltaY; + this._pulling(deltaY); + var state = deltaY > this.options.down.height ? STATE_AFTERCHANGEOFFSET : STATE_BEFORECHANGEOFFSET; + if (this.state !== state) { + this.state = state; + if (this.state === STATE_AFTERCHANGEOFFSET) { + this.removing = false; + this.isNeedRefresh = true; + } else { + this.removing = true; + this.isNeedRefresh = false; + } + this['_' + state](deltaY); + } + if ($.os.ios && parseFloat($.os.version) >= 8) { + var clientY = detail.gesture.touches[0].clientY; + if ((clientY + 10) > window.innerHeight || clientY < 10) { + this._dragend(e); + return; + } + } + } + }, + _dragend: function(e) { + var self = this; + if (self.isDragging) { + self.isDragging = false; + self._dragEndAfterChangeOffset(self.isNeedRefresh); + } + if (self.isPullingUp) { + if (self.pullingUpTimeout) { + clearTimeout(self.pullingUpTimeout); + } + self.pullingUpTimeout = setTimeout(function() { + self.isPullingUp = false; + }, 1000); + } + }, + _pullStart: function(startDeltaY) { + this.pullStart(startDeltaY); + $.trigger(this.element, EVENT_PULLSTART, { + api: this, + startDeltaY: startDeltaY + }); + }, + _pulling: function(deltaY) { + this.pulling(deltaY); + $.trigger(this.element, EVENT_PULLING, { + api: this, + deltaY: deltaY + }); + }, + _beforeChangeOffset: function(deltaY) { + this.beforeChangeOffset(deltaY); + $.trigger(this.element, EVENT_BEFORECHANGEOFFSET, { + api: this, + deltaY: deltaY + }); + }, + _afterChangeOffset: function(deltaY) { + this.afterChangeOffset(deltaY); + $.trigger(this.element, EVENT_AFTERCHANGEOFFSET, { + api: this, + deltaY: deltaY + }); + }, + _dragEndAfterChangeOffset: function(isNeedRefresh) { + this.dragEndAfterChangeOffset(isNeedRefresh); + $.trigger(this.element, EVENT_DRAGENDAFTERCHANGEOFFSET, { + api: this, + isNeedRefresh: isNeedRefresh + }); + }, + removePullDownTips: function() { + if (this.pullDownTips) { + try { + this.pullDownTips.parentNode && this.pullDownTips.parentNode.removeChild(this.pullDownTips); + this.pullDownTips = null; + this.removing = false; + } catch (e) {} + } + }, + pullStart: function(startDeltaY) { + this.initPullDownTips(startDeltaY); + }, + pulling: function(deltaY) { + this.pullDownTips.style.webkitTransform = 'translate3d(0,' + deltaY + 'px,0)'; + }, + beforeChangeOffset: function(deltaY) { + this.pullDownTipsIcon.className = CLASS_PULL_TOP_ARROW; + }, + afterChangeOffset: function(deltaY) { + this.pullDownTipsIcon.className = CLASS_PULL_TOP_ARROW_REVERSE; + }, + dragEndAfterChangeOffset: function(isNeedRefresh) { + if (isNeedRefresh) { + this.pullDownTipsIcon.className = CLASS_PULL_TOP_SPINNER; + this.pullDownLoading(); + } else { + this.pullDownTipsIcon.className = CLASS_PULL_TOP_ARROW; + this.endPullDownToRefresh(); + } + }, + pullDownLoading: function() { + if (this.loading) { + return; + } + if (!this.pullDownTips) { + this.initPullDownTips(); + this.dragEndAfterChangeOffset(true); + return; + } + this.loading = true; + this.pullDownTips.classList.add(CLASS_TRANSITIONING); + this.pullDownTips.style.webkitTransform = 'translate3d(0,' + this.options.down.height + 'px,0)'; + this.options.down.callback.apply(this); + }, + pullUpLoading: function(e) { + if (this.loading || this.finished) { + return; + } + this.loading = true; + this.isDraggingUp = false; + this.pullUpTips.classList.remove(CLASS_HIDDEN); + e && e.detail && e.detail.gesture && e.detail.gesture.preventDefault(); + this.pullUpTipsIcon.innerHTML = this.options.up.contentrefresh; + this.options.up.callback.apply(this); + }, + endPullDownToRefresh: function() { + this.loading = false; + this.pullUpTips && this.pullUpTips.classList.remove(CLASS_HIDDEN); + this.pullDownTips.classList.add(CLASS_TRANSITIONING); + this.pullDownTips.style.webkitTransform = 'translate3d(0,0,0)'; + if (this.deltaY <= 0) { + this.removePullDownTips(); + } else { + this.removing = true; + } + if (this.isInScroll) { + $(this.element.parentNode).scroll().refresh(); + } + }, + endPullUpToRefresh: function(finished) { + if (finished) { + this.finished = true; + this.pullUpTipsIcon.innerHTML = this.options.up.contentnomore; + this.element.removeEventListener('dragup', this); + window.removeEventListener('scroll', this); + } else { + this.pullUpTipsIcon.innerHTML = this.options.up.contentdown; + } + this.loading = false; + if (this.isInScroll) { + $(this.element.parentNode).scroll().refresh(); + } + }, + setStopped: function(stopped) { + if (stopped != this.stopped) { + this.stopped = stopped; + this.pullUpTips && this.pullUpTips.classList[stopped ? 'add' : 'remove'](CLASS_HIDDEN); + } + }, + refresh: function(isReset) { + if (isReset && this.finished && this.pullUpTipsIcon) { + this.pullUpTipsIcon.innerHTML = this.options.up.contentdown; + this.element.addEventListener('dragup', this); + window.addEventListener('scroll', this); + this.finished = false; + } + } + }); + $.fn.pullToRefresh = function(options) { + var pullRefreshApis = []; + options = options || {}; + this.each(function() { + var self = this; + var pullRefreshApi = null; + var id = self.getAttribute('data-pullToRefresh'); + if (!id) { + id = ++$.uuid; + $.data[id] = pullRefreshApi = new $.PullToRefresh(self, options); + self.setAttribute('data-pullToRefresh', id); + } else { + pullRefreshApi = $.data[id]; + } + if (options.up && options.up.auto) { //如果设置了auto,则自动上拉一次 + pullRefreshApi.pullUpLoading(); + } + pullRefreshApis.push(pullRefreshApi); + }); + return pullRefreshApis.length === 1 ? pullRefreshApis[0] : pullRefreshApis; + } +})(mui, window, document); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/mobileWorks/js/mui.pullToRefresh.material.js b/Yangcai365_web/manage/zinc/mobileWorks/js/mui.pullToRefresh.material.js new file mode 100644 index 0000000..af16c9e --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/js/mui.pullToRefresh.material.js @@ -0,0 +1,352 @@ +(function($) { + var CLASS_PULL_TOP_TIPS = $.className('pull-top-tips'); + + $.PullToRefresh = $.PullToRefresh.extend({ + init: function(element, options) { + this._super(element, options); + this.options = $.extend(true, { + down: { + tips: { + colors: ['008000', 'd8ad44', 'd00324', 'dc00b8', '017efc'], + size: 200, //width=height=size;x=y=size/2;radius=size/4 + lineWidth: 15, + duration: 1000, + tail_duration: 1000 * 2.5 + } + } + }, this.options); + this.options.down.tips.color = this.options.down.tips.colors[0]; + this.options.down.tips.colors = this.options.down.tips.colors.map(function(color) { + return { + r: parseInt(color.substring(0, 2), 16), + g: parseInt(color.substring(2, 4), 16), + b: parseInt(color.substring(4, 6), 16) + }; + }); + }, + initPullDownTips: function() { + var self = this; + if ($.isFunction(self.options.down.callback)) { + self.pullDownTips = (function() { + var element = document.querySelector('.' + CLASS_PULL_TOP_TIPS); + if (element) { + element.parentNode.removeChild(element); + } + if (!element) { + element = document.createElement('div'); + element.classList.add(CLASS_PULL_TOP_TIPS); + element.innerHTML = '
            '; + element.addEventListener('webkitTransitionEnd', self); + document.body.appendChild(element); + } + self.pullDownCanvas = document.getElementById("pullDownTips"); + self.pullDownCanvasCtx = self.pullDownCanvas.getContext('2d'); + self.canvasUtils.init(self.pullDownCanvas, self.options.down.tips); + return element; + }()); + } + }, + removePullDownTips: function() { + this._super(); + this.canvasUtils.stopSpin(); + }, + pulling: function(deltaY) { + var ratio = Math.min(deltaY / (this.options.down.height * 1.5), 1); + var ratioPI = Math.min(1, ratio * 2); + this.pullDownTips.style.webkitTransform = 'translate3d(0,' + (deltaY < 0 ? 0 : deltaY) + 'px,0)'; + this.pullDownCanvas.style.opacity = ratioPI; + this.pullDownCanvas.style.webkitTransform = 'rotate(' + 300 * ratio + 'deg)'; + var canvas = this.pullDownCanvas; + var ctx = this.pullDownCanvasCtx; + var size = this.options.down.tips.size; + ctx.lineWidth = this.options.down.tips.lineWidth; + ctx.fillStyle = '#' + this.options.down.tips.color; + ctx.strokeStyle = '#' + this.options.down.tips.color; + ctx.stroke(); + ctx.clearRect(0, 0, size, size); + //fixed android 4.1.x + canvas.style.display = 'none'; // Detach from DOM + canvas.offsetHeight; // Force the detach + canvas.style.display = 'inherit'; // Reattach to DOM + this.canvasUtils.drawArcedArrow(ctx, size / 2 + 0.5, size / 2, size / 4, 0 * Math.PI, 5 / 3 * Math.PI * ratioPI, false, 1, 2, 0.7853981633974483, 25, this.options.down.tips.lineWidth, this.options.down.tips.lineWidth); + }, + + beforeChangeOffset: function(deltaY) {}, + afterChangeOffset: function(deltaY) {}, + dragEndAfterChangeOffset: function(isNeedRefresh) { + if (isNeedRefresh) { + this.canvasUtils.startSpin(); + this.pullDownLoading(); + } else { + this.canvasUtils.stopSpin(); + this.endPullDownToRefresh(); + } + }, + canvasUtils: (function() { + var canvasObj = null, + ctx = null, + size = 200, + lineWidth = 15, + tick = 0, + startTime = 0, + frameTime = 0, + timeLast = 0, + oldStep = 0, + acc = 0, + head = 0, + tail = 180, + rad = Math.PI / 180, + duration = 1000, + tail_duration = 1000 * 2.5, + colors = ['35ad0e', 'd8ad44', 'd00324', 'dc00b8', '017efc'], + rAF = null; + + function easeLinear(currentIteration, startValue, changeInValue, totalIterations) { + return changeInValue * currentIteration / totalIterations + startValue; + } + + function easeInOutQuad(currentIteration, startValue, changeInValue, totalIterations) { + if ((currentIteration /= totalIterations / 2) < 1) { + return changeInValue / 2 * currentIteration * currentIteration + startValue; + } + return -changeInValue / 2 * ((--currentIteration) * (currentIteration - 2) - 1) + startValue; + } + + function minmax(value, v0, v1) { + var min = Math.min(v0, v1); + var max = Math.max(v0, v1); + if (value < min) + return min; + if (value > max) + return min; + return value; + } + var drawHead = function(ctx, x0, y0, x1, y1, x2, y2, style) { + 'use strict'; + if (typeof(x0) == 'string') x0 = parseInt(x0); + if (typeof(y0) == 'string') y0 = parseInt(y0); + if (typeof(x1) == 'string') x1 = parseInt(x1); + if (typeof(y1) == 'string') y1 = parseInt(y1); + if (typeof(x2) == 'string') x2 = parseInt(x2); + if (typeof(y2) == 'string') y2 = parseInt(y2); + var radius = 3; + var twoPI = 2 * Math.PI; + ctx.save(); + ctx.beginPath(); + ctx.moveTo(x0, y0); + ctx.lineTo(x1, y1); + ctx.lineTo(x2, y2); + switch (style) { + case 0: + var backdist = Math.sqrt(((x2 - x0) * (x2 - x0)) + ((y2 - y0) * (y2 - y0))); + ctx.arcTo(x1, y1, x0, y0, .55 * backdist); + ctx.fill(); + break; + case 1: + ctx.beginPath(); + ctx.moveTo(x0, y0); + ctx.lineTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.lineTo(x0, y0); + ctx.fill(); + break; + case 2: + ctx.stroke(); + break; + case 3: + var cpx = (x0 + x1 + x2) / 3; + var cpy = (y0 + y1 + y2) / 3; + ctx.quadraticCurveTo(cpx, cpy, x0, y0); + ctx.fill(); + break; + case 4: + var cp1x, cp1y, cp2x, cp2y, backdist; + var shiftamt = 5; + if (x2 == x0) { + backdist = y2 - y0; + cp1x = (x1 + x0) / 2; + cp2x = (x1 + x0) / 2; + cp1y = y1 + backdist / shiftamt; + cp2y = y1 - backdist / shiftamt; + } else { + backdist = Math.sqrt(((x2 - x0) * (x2 - x0)) + ((y2 - y0) * (y2 - y0))); + var xback = (x0 + x2) / 2; + var yback = (y0 + y2) / 2; + var xmid = (xback + x1) / 2; + var ymid = (yback + y1) / 2; + var m = (y2 - y0) / (x2 - x0); + var dx = (backdist / (2 * Math.sqrt(m * m + 1))) / shiftamt; + var dy = m * dx; + cp1x = xmid - dx; + cp1y = ymid - dy; + cp2x = xmid + dx; + cp2y = ymid + dy; + } + ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x0, y0); + ctx.fill(); + break; + } + ctx.restore(); + }; + var drawArcedArrow = function(ctx, x, y, r, startangle, endangle, anticlockwise, style, which, angle, d, lineWidth, lineRatio) { + 'use strict'; + style = typeof(style) != 'undefined' ? style : 3; + which = typeof(which) != 'undefined' ? which : 1; + angle = typeof(angle) != 'undefined' ? angle : Math.PI / 8; + lineWidth = lineWidth || 1; + lineRatio = lineRatio || 10; + d = typeof(d) != 'undefined' ? d : 10; + ctx.save(); + ctx.lineWidth = lineWidth; + ctx.beginPath(); + ctx.arc(x, y, r, startangle, endangle, anticlockwise); + ctx.stroke(); + var sx, sy, lineangle, destx, desty; + if (which & 1) { + sx = Math.cos(startangle) * r + x; + sy = Math.sin(startangle) * r + y; + lineangle = Math.atan2(x - sx, sy - y); + if (anticlockwise) { + destx = sx + 10 * Math.cos(lineangle); + desty = sy + 10 * Math.sin(lineangle); + } else { + destx = sx - 10 * Math.cos(lineangle); + desty = sy - 10 * Math.sin(lineangle); + } + drawArrow(ctx, sx, sy, destx, desty, style, 2, angle, d); + } + if (which & 2) { + sx = Math.cos(endangle) * r + x; + sy = Math.sin(endangle) * r + y; + lineangle = Math.atan2(x - sx, sy - y); + if (anticlockwise) { + destx = sx - 10 * Math.cos(lineangle); + desty = sy - 10 * Math.sin(lineangle); + } else { + destx = sx + 10 * Math.cos(lineangle); + desty = sy + 10 * Math.sin(lineangle); + } + drawArrow(ctx, sx - lineRatio * Math.sin(endangle), sy + lineRatio * Math.cos(endangle), destx - lineRatio * Math.sin(endangle), desty + lineRatio * Math.cos(endangle), style, 2, angle, d) + } + ctx.restore(); + } + var drawArrow = function(ctx, x1, y1, x2, y2, style, which, angle, d) { + 'use strict'; + if (typeof(x1) == 'string') x1 = parseInt(x1); + if (typeof(y1) == 'string') y1 = parseInt(y1); + if (typeof(x2) == 'string') x2 = parseInt(x2); + if (typeof(y2) == 'string') y2 = parseInt(y2); + style = typeof(style) != 'undefined' ? style : 3; + which = typeof(which) != 'undefined' ? which : 1; + angle = typeof(angle) != 'undefined' ? angle : Math.PI / 8; + d = typeof(d) != 'undefined' ? d : 10; + var toDrawHead = typeof(style) != 'function' ? drawHead : style; + var dist = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); + var ratio = (dist - d / 3) / dist; + var tox, toy, fromx, fromy; + if (which & 1) { + tox = Math.round(x1 + (x2 - x1) * ratio); + toy = Math.round(y1 + (y2 - y1) * ratio); + } else { + tox = x2; + toy = y2; + } + if (which & 2) { + fromx = x1 + (x2 - x1) * (1 - ratio); + fromy = y1 + (y2 - y1) * (1 - ratio); + } else { + fromx = x1; + fromy = y1; + } + ctx.beginPath(); + ctx.moveTo(fromx, fromy); + ctx.lineTo(tox, toy); + ctx.stroke(); + var lineangle = Math.atan2(y2 - y1, x2 - x1); + var h = Math.abs(d / Math.cos(angle)); + if (which & 1) { + var angle1 = lineangle + Math.PI + angle; + var topx = x2 + Math.cos(angle1) * h; + var topy = y2 + Math.sin(angle1) * h; + var angle2 = lineangle + Math.PI - angle; + var botx = x2 + Math.cos(angle2) * h; + var boty = y2 + Math.sin(angle2) * h; + toDrawHead(ctx, topx, topy, x2, y2, botx, boty, style); + } + if (which & 2) { + var angle1 = lineangle + angle; + var topx = x1 + Math.cos(angle1) * h; + var topy = y1 + Math.sin(angle1) * h; + var angle2 = lineangle - angle; + var botx = x1 + Math.cos(angle2) * h; + var boty = y1 + Math.sin(angle2) * h; + toDrawHead(ctx, topx, topy, x1, y1, botx, boty, style); + } + }; + + var spinColors = function(currentIteration, totalIterations) { + var step = currentIteration % totalIterations; + if (step < oldStep) + colors.push(colors.shift()); + var c0 = colors[0], + c1 = colors[1], + r = minmax(easeLinear(step, c0.r, c1.r - c0.r, totalIterations), c0.r, c1.r), + g = minmax(easeLinear(step, c0.g, c1.g - c0.g, totalIterations), c0.g, c1.g), + b = minmax(easeLinear(step, c0.b, c1.b - c0.b, totalIterations), c0.b, c1.b); + + oldStep = step; + return "rgb(" + parseInt(r) + "," + parseInt(g) + "," + parseInt(b) + ")"; + } + + var spin = function(t) { + var timeCurrent = t || (new Date).getTime(); + if (!startTime) { + startTime = timeCurrent; + } + tick = timeCurrent - startTime; + acc = easeInOutQuad((tick + tail_duration / 2) % tail_duration, 0, duration, tail_duration); + head = easeLinear((tick + acc) % duration, 0, 360, duration); + tail = 20 + Math.abs(easeLinear((tick + tail_duration / 2) % tail_duration, -300, 600, tail_duration)); + + ctx.lineWidth = lineWidth; + ctx.lineCap = "round"; + + ctx.strokeStyle = spinColors(tick, duration); + ctx.clearRect(0, 0, size, size); + //fixed android 4.1.x + canvasObj.style.display = 'none'; // Detach from DOM + canvasObj.offsetHeight; // Force the detach + canvasObj.style.display = 'inherit'; // Reattach to DOM + ctx.beginPath(); + ctx.arc(size / 2, size / 2, size / 4, parseInt(head - tail) % 360 * rad, parseInt(head) % 360 * rad, false); + ctx.stroke(); + + rAF = requestAnimationFrame(spin); + }; + var startSpin = function() { + startTime = 0; + oldStep = 0; + rAF = requestAnimationFrame(spin); + }; + var stopSpin = function() { + rAF && cancelAnimationFrame(rAF); + } + var init = function(canvas, options) { + canvasObj = canvas; + ctx = canvasObj.getContext('2d'); + var options = $.extend(true, {}, options); + colors = options.colors; + duration = options.duration; + tail_duration = options.tail_duration; + size = options.size; + lineWidth = options.lineWidth; + }; + return { + init: init, + drawArcedArrow: drawArcedArrow, + startSpin: startSpin, + stopSpin: stopSpin + }; + })() + }); +})(mui); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/mobileWorks/js/mui.view.js b/Yangcai365_web/manage/zinc/mobileWorks/js/mui.view.js new file mode 100644 index 0000000..65ae4e0 --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/js/mui.view.js @@ -0,0 +1,628 @@ +/** + *
            +
            +
            +
            +
            +
            +
            +
            + * @param {Object} $ + * @param {Object} window + */ +(function($, window) { + var CLASS_LEFT = $.className('left'); + var CLASS_CENTER = $.className('center'); + var CLASS_RIGHT = $.className('right'); + var CLASS_PAGE = $.className('page'); + var CLASS_PAGE_LEFT = $.className('page-left'); + var CLASS_PAGE_CENTER = $.className('page-center'); + var CLASS_NAVBAR_LEFT = $.className('navbar-left'); + var CLASS_NAVBAR_CENTER = $.className('navbar-center'); + var CLASS_PAGE_SHADOW = $.className('page-shadow'); + + var CLASS_TRANSITIONING = $.className('transitioning'); + + var SELECTOR_LEFT = '.' + CLASS_LEFT; + var SELECTOR_CENTER = '.' + CLASS_CENTER; + var SELECTOR_RIGHT = '.' + CLASS_RIGHT; + + var SELECTOR_ICON = $.classSelector('.icon'); + var SELECTOR_NAVBAR = $.classSelector('.navbar'); + var SELECTOR_NAVBAR_INNER = $.classSelector('.navbar-inner'); + var SELECTOR_PAGES = $.classSelector('.pages'); + var SELECTOR_BTN_NAV = $.classSelector('.btn-nav'); + var SELECTOR_PAGE_LEFT = '.' + CLASS_PAGE_LEFT; + var SELECTOR_PAGE_CENTER = '.' + CLASS_PAGE_CENTER; + var SELECTOR_NAVBAR_LEFT = '.' + CLASS_NAVBAR_LEFT; + var SELECTOR_NAVBAR_CENTER = '.' + CLASS_NAVBAR_CENTER; + + var View = $.Class.extend({ + init: function(element, options) { + this.view = this.element = element; + this.options = $.extend({ + animateNavbar: 'ios', //ios + swipeBackPageActiveArea: 30, + hardwareAccelerated: true + }, options); + this.navbars = this.view.querySelector(SELECTOR_NAVBAR); + this.pages = this.view.querySelector(SELECTOR_PAGES); + + this.history = []; //history + + this.maxScrollX = this.view.offsetWidth; + this.x = this.y = 0; + this.translateZ = this.options.hardwareAccelerated ? ' translateZ(0)' : ''; + this.ratio = 0; + this.isBack = true; + this.moved = this.dragging = false; + + this.activeNavbar = this.previousNavbar = null; + this.activePage = this.previousPage = null; + + this._initPageEventMethod(); + + this._initDefaultPage(); + + this.navbars && this._initNavBar(); + + this.initEvent(); + }, + _initPageEventMethod: function() { + var self = this; + $.each(['onPageBeforeShow', 'onPageShow', 'onPageBeforeBack', 'onPageBack'], function(index, event) { + self[event + 'Callbacks'] = {}; + self[event] = function(page, callback) { + var eventCallbacks = event + 'Callbacks'; + if (!self[eventCallbacks].hasOwnProperty(page)) { + self[eventCallbacks][page] = [callback]; + } else { + self[eventCallbacks][page].push(callback); + } + }; + }); + }, + _initDefaultPage: function() { + var defaultPage = document.querySelector(this.options.defaultPage); + if (defaultPage) { + this._appendPage(defaultPage); + } else { + throw new Error('defaultPage[' + this.options.defaultPage + '] does not exist'); + } + }, + initEvent: function() { + this.view.addEventListener('click', this); + this.view.addEventListener('tap', this); + this.pages.addEventListener('drag', this); + this.pages.addEventListener('dragend', this); + this.pages.addEventListener('webkitTransitionEnd', this); + }, + handleEvent: function(event) { + switch (event.type) { + case 'click': + this._click(event); + break; + case 'tap': + this._tap(event); + break; + case 'drag': + this._drag(event); + break; + case 'dragend': + this._dragend(event); + break; + case 'webkitTransitionEnd': + this._webkitTransitionEnd(event); + break; + } + }, + shadow: function() { + var shadow = document.createElement('div'); + shadow.className = CLASS_PAGE_SHADOW; + return shadow; + }(), + _removePage: function(page, navbar) { + navbar && this._removeNavbar(page, navbar); + document.body.appendChild(page); + this._cleanPageClass(page); + }, + _prependPage: function(page) { + var navbar = page.querySelector(SELECTOR_NAVBAR_INNER); + navbar && this._prependNavbar(navbar); + page.classList.add(CLASS_PAGE_LEFT); + this.pages.insertBefore(page, this.pages.firstElementChild); + }, + _appendPage: function(page) { + var navbar = page.querySelector(SELECTOR_NAVBAR_INNER); + navbar && this._appendNavbar(navbar); + page.classList.add(CLASS_PAGE_CENTER); + this.pages.appendChild(page); + }, + _removeNavbar: function(page, navbar) { + page.insertBefore(navbar, page.firstElementChild); + this._cleanNavbarClass(navbar); + }, + _prependNavbar: function(navbar) { + navbar.classList.add(CLASS_NAVBAR_LEFT); + this.navbars.insertBefore(navbar, this.navbars.firstElementChild); + }, + _appendNavbar: function(navbar) { + navbar.classList.add(CLASS_NAVBAR_CENTER); + this.navbars.appendChild(navbar); + }, + _cleanPageClass: function(page) { + page.classList.remove(CLASS_PAGE_CENTER); + page.classList.remove(CLASS_PAGE_LEFT); + }, + _cleanNavbarClass: function(navbar) { + navbar.classList.remove(CLASS_NAVBAR_CENTER); + navbar.classList.remove(CLASS_NAVBAR_LEFT); + }, + _tap: function(event) { + var target = event.target; + for (; target && target !== document; target = target.parentNode) { + if (target.tagName === 'A' && target.hash) { + var page = document.getElementById(target.hash.replace('#', '')); + if (page && page.classList.contains(CLASS_PAGE)) { + event.stopPropagation(); + event.detail.gesture.preventDefault(); + this.go(target.hash); + break; + } + } + } + }, + _click: function(event) { + var target = event.target; + for (; target && target !== document; target = target.parentNode) { + if (target.tagName === 'A' && target.hash) { + var page = document.getElementById(target.hash.replace('#', '')); + if (page && page.classList.contains(CLASS_PAGE)) { + event.preventDefault(); + break; + } + } + } + }, + _cleanStyle: function(el) { + if (el) { + el.style.webkitTransform = ''; + el.style.opacity = ''; + } + }, + _isAnimateNavbarIOS: function() { + return !$.os.android && this.options.animateNavbar === 'ios'; + }, + _webkitTransitionEnd: function(event) { + this.dragging = this.moved = false; + if (this.activePage !== event.target) { + return; + } + + this.isInTransition = false; + + this.shadow.parentNode === this.activePage && this.activePage.removeChild(this.shadow); + this.previousPageClassList.remove(CLASS_TRANSITIONING); + this.activePageClassList.remove(CLASS_TRANSITIONING); + + var self = this; + if (this._isAnimateNavbarIOS() && this.previousNavElements && this.activeNavElements) { + var isBack = this.isBack; + $.each(this.previousNavElements, function(i, el) { + el.classList.remove(CLASS_TRANSITIONING); + isBack && self._cleanStyle(el); + }); + $.each(this.activeNavElements, function(i, el) { + el.classList.remove(CLASS_TRANSITIONING); + self._cleanStyle(el); + }); + if (this.previousNavBackIcon) { + this.previousNavBackIcon.classList.remove(CLASS_TRANSITIONING); + isBack && this._cleanStyle(this.previousNavBackIcon); + } + if (this.activeNavBackIcon) { + this.activeNavBackIcon.classList.remove(CLASS_TRANSITIONING); + this._cleanStyle(this.activeNavBackIcon); + } + } else { + this.previousNavbar && this.previousNavbar.classList.remove(CLASS_TRANSITIONING); + this.activeNavbar && this.activeNavbar.classList.remove(CLASS_TRANSITIONING); + this._cleanStyle(this.previousNavbar); + this._cleanStyle(this.activeNavbar); + } + + this._cleanStyle(this.previousPage); + this._cleanStyle(this.activePage); + + if (this.ratio <= 0.5) { + return; + } + if (this.isBack) { + this._removePage(this.activePage, this.activeNavbar); + this.previousPageClassList.remove(CLASS_PAGE_LEFT); + this.previousPageClassList.add(CLASS_PAGE_CENTER); + if (this.previousNavbar) { + this.previousNavbar.classList.remove(CLASS_NAVBAR_LEFT); + this.previousNavbar.classList.add(CLASS_NAVBAR_CENTER); + } + if (this.history.length > 0) { + this._prependPage(this.history.pop()); + } + this.navbars && this._initNavBar(); + this._trigger('pageBack', this.activePage); + this._trigger('pageShow', this.previousPage); + } else { + this.previousPageClassList.add(CLASS_PAGE_LEFT); + this.activePageClassList.add(CLASS_PAGE_CENTER); + this._trigger('pageShow', this.activePage); + } + + + }, + _trigger: function(eventType, page) { + var eventCallbacks = 'on' + eventType.charAt(0).toUpperCase() + eventType.slice(1) + 'Callbacks'; + if (this[eventCallbacks].hasOwnProperty(page.id)) { + var callbacks = this[eventCallbacks][page.id]; + var event = new CustomEvent(eventType, { + detail: { + page: page + }, + bubbles: true, + cancelable: true + }); + for (var len = callbacks.length; len--;) { + callbacks[len].call(this, event); + } + } + $.trigger(this.view, eventType, { + page: page + }); + }, + _initPageTransform: function() { + this.previousPage = this.pages.querySelector(SELECTOR_PAGE_LEFT); + this.activePage = this.pages.querySelector(SELECTOR_PAGE_CENTER); + if (this.previousPage && this.activePage) { + this.activePage.appendChild(this.shadow); + this.previousPageClassList = this.previousPage.classList; + this.activePageClassList = this.activePage.classList; + + this.previousPageStyle = this.previousPage.style; + this.activePageStyle = this.activePage.style; + + this.previousPageClassList.remove(CLASS_TRANSITIONING); + this.activePageClassList.remove(CLASS_TRANSITIONING); + + if (this.navbars) { + this.previousNavbar = this.navbars.querySelector(SELECTOR_NAVBAR_LEFT); + this.activeNavbar = this.navbars.querySelector(SELECTOR_NAVBAR_CENTER); + if (this._isAnimateNavbarIOS() && this.previousNavbar && this.activeNavbar) { + this.previousNavElements = this.previousNavbar.querySelectorAll(SELECTOR_LEFT + ',' + SELECTOR_CENTER + ',' + SELECTOR_RIGHT); + this.activeNavElements = this.activeNavbar.querySelectorAll(SELECTOR_LEFT + ',' + SELECTOR_CENTER + ',' + SELECTOR_RIGHT); + this.previousNavBackIcon = this.previousNavbar.querySelector(SELECTOR_LEFT + SELECTOR_BTN_NAV + ' ' + SELECTOR_ICON); + this.activeNavBackIcon = this.activeNavbar.querySelector(SELECTOR_LEFT + SELECTOR_BTN_NAV + ' ' + SELECTOR_ICON); + } + } + this.x = 0; + this.dragging = true; + return true; + } + return false; + }, + _initNavBar: function() { + if (this._isAnimateNavbarIOS() && this.navbars) { + var inners = this.navbars.querySelectorAll(SELECTOR_NAVBAR_INNER); + var inner, left, right, center, leftWidth, rightWidth, centerWidth, noLeft, onRight, currLeft, diff, navbarWidth; + for (var i = 0, len = inners.length; i < len; i++) { + inner = inners[i]; + left = inner.querySelector(SELECTOR_LEFT); + right = inner.querySelector(SELECTOR_RIGHT); + center = inner.querySelector(SELECTOR_CENTER); + noLeft = !left; + noRight = !right; + leftWidth = noLeft ? 0 : left.offsetWidth; + rightWidth = noRight ? 0 : right.offsetWidth; + centerWidth = center ? center.offsetWidth : 0; + navbarWidth = this.maxScrollX; + onLeft = inner.classList.contains('navbar-left'); + if (noRight) { + currLeft = navbarWidth - centerWidth; + } + if (noLeft) { + currLeft = 0; + } + if (!noLeft && !noRight) { + currLeft = (navbarWidth - rightWidth - centerWidth + leftWidth) / 2; + } + var requiredLeft = (navbarWidth - centerWidth) / 2; + if (navbarWidth - leftWidth - rightWidth > centerWidth) { + if (requiredLeft < leftWidth) { + requiredLeft = leftWidth; + } + if (requiredLeft + centerWidth > navbarWidth - rightWidth) { + requiredLeft = navbarWidth - rightWidth - centerWidth; + } + diff = requiredLeft - currLeft; + } else { + diff = 0; + } + + var centerLeft = diff; + if (center) { + center.style.marginLeft = -leftWidth + 'px'; + center.mNavbarLeftOffset = -(currLeft + diff) + 30; //这个30是测出来的。后续要实际计算一下 + center.mNavbarRightOffset = navbarWidth - currLeft - diff - centerWidth; + } + + if (onLeft) center.style.webkitTransform = ('translate3d(' + center.mNavbarLeftOffset + 'px, 0, 0)'); + + if (!noLeft) { + left.mNavbarLeftOffset = -leftWidth; + left.mNavbarRightOffset = (navbarWidth - leftWidth) / 2; + if (onLeft) left.style.webkitTransform = ('translate3d(' + left[0].mNavbarLeftOffset + 'px, 0, 0)'); + } + + if (!noRight) { + right.mNavbarLeftOffset = -(navbarWidth - rightWidth) / 2; + right.mNavbarRightOffset = rightWidth; + if (onLeft) right.style.webkitTransform = ('translate3d(' + right[0].mNavbarLeftOffset + 'px, 0, 0)'); + } + + } + } + }, + _drag: function(event) { + if (this.isInTransition) { + return; + } + var detail = event.detail; + if (!this.dragging) { + if (($.gestures.session.firstTouch.center.x - this.view.offsetLeft) < this.options.swipeBackPageActiveArea) { + this.isBack = true; + this._initPageTransform(); + } + } + if (this.dragging) { + var deltaX = 0; + if (!this.moved) { //start + deltaX = detail.deltaX; + $.gestures.session.lockDirection = true; //锁定方向 + $.gestures.session.startDirection = detail.direction; + } else { //move + deltaX = detail.deltaX - ($.gestures.session.prevTouch && $.gestures.session.prevTouch.deltaX || 0); + } + var newX = this.x + deltaX; + if (newX < 0 || newX > this.maxScrollX) { + newX = newX < 0 ? 0 : this.maxScrollX; + } + + event.stopPropagation(); + detail.gesture.preventDefault(); + + if (!this.requestAnimationFrame) { + this._updateTranslate(); + } + + this.moved = true; + this.x = newX; + this.y = 0; + } + }, + _dragend: function(event) { + if (!this.moved) { + return; + } + + event.stopPropagation(); + + var detail = event.detail; + + this._clearRequestAnimationFrame(); + + this._prepareTransition(); + + this.ratio = this.x / this.maxScrollX; + if (this.ratio === 1 || this.ratio === 0) { + $.trigger(this.activePage, 'webkitTransitionEnd'); + return; + } + if (this.ratio > 0.5) { + this.setTranslate(this.maxScrollX, 0); + } else { + this._cleanStyle(this.previousPage); + this._cleanStyle(this.activePage); + } + }, + _prepareTransition: function() { + this.isInTransition = true; + this.previousPageClassList.add(CLASS_TRANSITIONING); + this.activePageClassList.add(CLASS_TRANSITIONING); + var self = this; + if (this.previousNavbar && this.activeNavbar) { + this.previousNavbar.classList.add(CLASS_TRANSITIONING); + this.activeNavbar.classList.add(CLASS_TRANSITIONING); + if (this._isAnimateNavbarIOS() && this.previousNavElements && this.activeNavElements) { + $.each(this.previousNavElements, function(i, el) { + el.classList.add(CLASS_TRANSITIONING); + self._cleanStyle(el); + }); + $.each(this.activeNavElements, function(i, el) { + el.classList.add(CLASS_TRANSITIONING); + self._cleanStyle(el); + }); + if (this.previousNavBackIcon) { + this._cleanStyle(this.previousNavBackIcon); + this.previousNavBackIcon.classList.add(CLASS_TRANSITIONING); + } + if (this.activeNavBackIcon) { + this._cleanStyle(this.activeNavBackIcon); + this.activeNavBackIcon.classList.add(CLASS_TRANSITIONING); + } + } + } + }, + _clearRequestAnimationFrame: function() { + if (this.requestAnimationFrame) { + cancelAnimationFrame(this.requestAnimationFrame); + this.requestAnimationFrame = null; + } + }, + _getTranslateStr: function(x, y) { + if (this.options.hardwareAccelerated) { + return 'translate3d(' + x + 'px,' + y + 'px,0px) ' + this.translateZ; + } + return 'translate(' + x + 'px,' + y + 'px) '; + }, + + _updateTranslate: function() { + var self = this; + if (self.x !== self.lastX || self.y !== self.lastY) { + self.setTranslate(self.x, self.y); + } + self.requestAnimationFrame = requestAnimationFrame(function() { + self._updateTranslate(); + }); + }, + _setNavbarTranslate: function(x, y) { + var percentage = x / this.maxScrollX; + //only for ios + if (this._isAnimateNavbarIOS()) { + if (this.previousNavElements && this.activeNavElements) { + this.animateNavbarByIOS(percentage); + } + } else { //pop-in + this.activeNavbar.style.opacity = 1 - percentage * 1.3; + this.previousNavbar.style.opacity = percentage * 1.3 - 0.3; + } + }, + animateNavbarByIOS: function(percentage) { + var i, len, style, el; + for (i = 0, len = this.activeNavElements.length; i < len; i++) { + el = this.activeNavElements[i]; + style = el.style; + style.opacity = (1 - percentage * (el.classList.contains(CLASS_LEFT) ? 3.5 : 1.3)); + if (!el.classList.contains(CLASS_RIGHT)) { + var activeNavTranslate = percentage * el.mNavbarRightOffset; + el.style.webkitTransform = ('translate3d(' + activeNavTranslate + 'px,0,0)'); + if (el.classList.contains(CLASS_LEFT) && this.activeNavBackIcon) { + this.activeNavBackIcon.style.webkitTransform = ('translate3d(' + -activeNavTranslate + 'px,0,0)'); + } + } + } + for (i = 0, len = this.previousNavElements.length; i < len; i++) { + el = this.previousNavElements[i]; + style = el.style; + style.opacity = percentage * 1.3 - 0.3; + if (!el.classList.contains(CLASS_RIGHT)) { + var previousNavTranslate = el.mNavbarLeftOffset * (1 - percentage); + el.style.webkitTransform = ('translate3d(' + previousNavTranslate + 'px,0,0)'); + if (el.classList.contains(CLASS_LEFT) && this.previousNavBackIcon) { + this.previousNavBackIcon.style.webkitTransform = ('translate3d(' + -previousNavTranslate + 'px,0,0)'); + } + } + } + }, + setTranslate: function(x, y) { + this.x = x; + this.y = y; + this.previousPage.style.opacity = 0.9 + 0.1 * x / this.maxScrollX; + this.previousPage.style['webkitTransform'] = this._getTranslateStr((x / 6 - this.maxScrollX / 6), y); + this.activePage.style['webkitTransform'] = this._getTranslateStr(x, y); + + this.navbars && this._setNavbarTranslate(x, y); + this.lastX = this.x; + this.lastY = this.y; + }, + canBack: function() { + return this.pages.querySelector(SELECTOR_PAGE_LEFT); + }, + back: function() { + if (this.isInTransition) { + return; + } + this.isBack = true; + this.ratio = 1; + if (this._initPageTransform()) { + this._trigger('pageBeforeBack', this.activePage); + this._trigger('pageBeforeShow', this.previousPage); + this._prepareTransition(); + this.previousPage.offsetHeight; + this.activePage.offsetHeight; + this.setTranslate(this.maxScrollX, 0); + } + }, + go: function(pageSelector) { + if (this.isInTransition) { + return; + } + var nextPage = document.querySelector(pageSelector); + + if (nextPage) { + var previousPage = this.pages.querySelector(SELECTOR_PAGE_LEFT); + var activePage = this.pages.querySelector(SELECTOR_PAGE_CENTER); + var previousNavbar; + var activeNavbar; + if (this.navbars) { + previousNavbar = this.navbars.querySelector(SELECTOR_NAVBAR_LEFT); + activeNavbar = this.navbars.querySelector(SELECTOR_NAVBAR_CENTER); + } + if (activeNavbar) { + activeNavbar.classList.remove(CLASS_NAVBAR_CENTER); + activeNavbar.classList.add(CLASS_NAVBAR_LEFT); + } + + if (previousPage) { + this._removePage(previousPage, previousNavbar); + this.history.push(previousPage); //add to history + } + + if (activePage) { + activePage.classList.remove(CLASS_PAGE_CENTER); + activePage.style.webkitTransform = 'translate3d(0,0,0)'; + activePage.classList.add(CLASS_PAGE_LEFT); + } + + + nextPage.style.webkitTransform = 'translate3d(100%,0,0)'; + this._appendPage(nextPage); + nextPage.appendChild(this.shadow); //shadow + nextPage.offsetHeight; //force + this.isBack = false; + this.ratio = 1; + + this._initPageTransform(); + + this.navbars && this._initNavBar(); + + this.navbars && this._setNavbarTranslate(this.maxScrollX, 0); + //force + this.previousPage.offsetHeight; + this.activePage.offsetHeight; + + if (this.navbars) { + this.previousNavbar.offsetHeight; + this.activeNavbar.offsetHeight; + } + + this._trigger('pageBeforeShow', this.activePage); + this._prepareTransition(); + this.setTranslate(0, 0); + } + } + + }); + + + $.fn.view = function(options) { + var self = this[0]; + var viewApi = null; + var id = self.getAttribute('data-view'); + if (!id) { + id = ++$.uuid; + $.data[id] = viewApi = new View(self, options); + self.setAttribute('data-view', id); + } else { + viewApi = $.data[id]; + } + return viewApi; + } +})(mui, window); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/mobileWorks/js/pagination.js b/Yangcai365_web/manage/zinc/mobileWorks/js/pagination.js new file mode 100644 index 0000000..b21a4b7 --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/js/pagination.js @@ -0,0 +1,213 @@ +/*分页插件*/ +var Pagination = { + + showPageCount: 7, + + init: function (obj, callback,topFlag) { + this.bindListener(obj, callback,topFlag); + }, + createHtml: function (pageIndex, recordCount, pageSize) { + + var pageCount = Math.ceil(recordCount / pageSize); //总页数 + var showPageCount = this.showPageCount; + var MaxCount = 10000000000; + var HalfPageCount = (showPageCount + 1) / 2; + var html = []; + + if (pageCount > MaxCount) { + pageCount = MaxCount; + } + if (pageIndex > pageCount - 1) { + pageIndex = pageCount - 1; + } + html.push("共" + recordCount + "条"); + if (pageIndex > 0) { + html.push(""); + } + else { + html.push(""); + } + if (pageCount <= showPageCount) { + for (var i = 0; i < pageCount; i++) { + if (pageIndex == i) { + html.push("" + (i + 1) + ""); + } + else { + html.push("" + (i + 1) + ""); + } + } + } + else if (pageIndex < HalfPageCount) { + for (var i = 0; i < showPageCount - 1; i++) { + if (pageIndex == i) { + html.push("" + (i + 1) + ""); + } + else { + html.push("" + (i + 1) + ""); + } + } + + html.push("..."); + html.push("" + pageCount + ""); + } + else if (pageIndex >= pageCount - HalfPageCount - 1) { + html.push("" + 1 + ""); + html.push("..."); + for (var i = pageCount - showPageCount + 1; i < pageCount; i++) { + if (pageIndex == i) { + html.push("" + (i + 1) + ""); + } + else { + html.push("" + (i + 1) + ""); + } + } + } + else { + html.push("" + 1 + ""); + html.push("..."); + + for (var i = pageIndex - HalfPageCount / 2; i <= pageIndex + HalfPageCount / 2; i++) { + if (pageIndex == i) { + html.push("" + (i + 1) + ""); + } + else { + html.push("" + (i + 1) + ""); + } + } + html.push("..."); + html.push("" + pageCount + ""); + } + + if (pageIndex < pageCount - 1) { + html.push(""); + } + else { + html.push(""); + } + + // html.push("每页" + pageSize + "条"); + html.push("共" + pageCount + "页"); + html.push(""); + + // html.push(""); + return html.join(""); + }, + + bindListener: function (obj, callback,topFlag) { + var topFlag = topFlag || true; + obj.on("click", "a", function () { + if (typeof callback === "function") { + var index = $(this).attr("page"); + callback(parseInt(index)); + } + if(topFlag){ + $(window).scrollTop(0); + } + return false; + }); + obj.on("click", "button", function () { + var pageInput = obj.find('input'); + if (typeof callback === "function") { + var index = pageInput.val(); + if (index == '') { + pageInput.focus(); + return false; + // index = 1; + } + callback(parseInt(index) - 1); + } + return false; + }); + + // var pageButton = $("#pageButton"); + + obj.on("keyup", "input", function (e) { + + switch (e.keyCode) { + case 37: + break; + case 38: + break; + case 39: + break; + case 40: + break; + case 13: + changePage(); + break; + case 8: + $(e.target).attr('oldpage', $(e.target).val()); + break; + case 46: + $(e.target).attr('oldpage', $(e.target).val()); + break; + default : + validPage(); + } + return false; + }); + + //分页 + function changePage() { + var pageInput = obj.find('input'); + var page = pageInput.val(); + var maxPage = parseInt(obj.find(".total_page").html().substring(1)); + var pattern = new RegExp("^[1-9]\\d{0," + maxPage.toString().length + "}$"); + if (page.trim() == "") { + pageInput.focus(); + return; + } + if (pattern.test(page)) { + page = parseInt(page); + maxPage = parseInt(maxPage); + if (page > maxPage || page < 0) { + pageInput.val("").focus(); + return; + } + } else { + + pageInput.val("").focus(); + return; + } + callback(parseInt(page) - 1); + } + + //页码校验v2 + function validPage() { + var pageInput = obj.find('input'); + + var totalPageHtml = obj.find(".total_page").html(); + var maxPage = parseInt(totalPageHtml.substring(1, totalPageHtml.length - 1)); + + var page = pageInput.val(); + var pattern = /^[0-9]+$/; + var oldpage = pageInput.attr("oldpage") || ''; + if (page.trim() == "") { + pageInput.val(""); + return; + } + if (!pattern.test(page)) { + pageInput.val(oldpage); + return; + } + var pageInt = parseInt(page); + if (page.substr(0, 1) == '0') { + pageInput.val(pageInt); + } + if (pageInt == 0) { + pageInput.val(''); + return; + } + if (pageInt > parseInt(maxPage)) { + pageInput.val(page.substr(0, page.length - 1)); + return; + } + pageInput.attr('oldpage', pageInput.val()); + } + }, + Page: function (obj, pageIndex, recordCount, pageSize) { + obj.empty(); + obj.html(this.createHtml(pageIndex, recordCount, pageSize)); + } + +}; diff --git a/Yangcai365_web/manage/zinc/mobileWorks/zepto/zepto.min.js b/Yangcai365_web/manage/zinc/mobileWorks/zepto/zepto.min.js new file mode 100644 index 0000000..4821a1c --- /dev/null +++ b/Yangcai365_web/manage/zinc/mobileWorks/zepto/zepto.min.js @@ -0,0 +1,2 @@ +/* Zepto v1.2.0 - zepto event ajax form ie - zeptojs.com/license */ +!function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t)}):e(t)}(this,function(t){var e=function(){function $(t){return null==t?String(t):S[C.call(t)]||"object"}function F(t){return"function"==$(t)}function k(t){return null!=t&&t==t.window}function M(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function R(t){return"object"==$(t)}function Z(t){return R(t)&&!k(t)&&Object.getPrototypeOf(t)==Object.prototype}function z(t){var e=!!t&&"length"in t&&t.length,n=r.type(t);return"function"!=n&&!k(t)&&("array"==n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function q(t){return a.call(t,function(t){return null!=t})}function H(t){return t.length>0?r.fn.concat.apply([],t):t}function I(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function V(t){return t in l?l[t]:l[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function _(t,e){return"number"!=typeof e||h[I(t)]?e:e+"px"}function B(t){var e,n;return c[t]||(e=f.createElement(t),f.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),c[t]=n),c[t]}function U(t){return"children"in t?u.call(t.children):r.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function X(t,e){var n,r=t?t.length:0;for(n=0;r>n;n++)this[n]=t[n];this.length=r,this.selector=e||""}function J(t,r,i){for(n in r)i&&(Z(r[n])||L(r[n]))?(Z(r[n])&&!Z(t[n])&&(t[n]={}),L(r[n])&&!L(t[n])&&(t[n]=[]),J(t[n],r[n],i)):r[n]!==e&&(t[n]=r[n])}function W(t,e){return null==e?r(t):r(t).filter(e)}function Y(t,e,n,r){return F(e)?e.call(t,n,r):e}function G(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function K(t,n){var r=t.className||"",i=r&&r.baseVal!==e;return n===e?i?r.baseVal:r:void(i?r.baseVal=n:t.className=n)}function Q(t){try{return t?"true"==t||("false"==t?!1:"null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?r.parseJSON(t):t):t}catch(e){return t}}function tt(t,e){e(t);for(var n=0,r=t.childNodes.length;r>n;n++)tt(t.childNodes[n],e)}var e,n,r,i,O,P,o=[],s=o.concat,a=o.filter,u=o.slice,f=t.document,c={},l={},h={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},p=/^\s*<(\w+|!)[^>]*>/,d=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,m=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,g=/^(?:body|html)$/i,v=/([A-Z])/g,y=["val","css","html","text","data","width","height","offset"],x=["after","prepend","before","append"],b=f.createElement("table"),E=f.createElement("tr"),j={tr:f.createElement("tbody"),tbody:b,thead:b,tfoot:b,td:E,th:E,"*":f.createElement("div")},w=/complete|loaded|interactive/,T=/^[\w-]*$/,S={},C=S.toString,N={},A=f.createElement("div"),D={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},L=Array.isArray||function(t){return t instanceof Array};return N.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var r,i=t.parentNode,o=!i;return o&&(i=A).appendChild(t),r=~N.qsa(i,e).indexOf(t),o&&A.removeChild(t),r},O=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},P=function(t){return a.call(t,function(e,n){return t.indexOf(e)==n})},N.fragment=function(t,n,i){var o,s,a;return d.test(t)&&(o=r(f.createElement(RegExp.$1))),o||(t.replace&&(t=t.replace(m,"<$1>")),n===e&&(n=p.test(t)&&RegExp.$1),n in j||(n="*"),a=j[n],a.innerHTML=""+t,o=r.each(u.call(a.childNodes),function(){a.removeChild(this)})),Z(i)&&(s=r(o),r.each(i,function(t,e){y.indexOf(t)>-1?s[t](e):s.attr(t,e)})),o},N.Z=function(t,e){return new X(t,e)},N.isZ=function(t){return t instanceof N.Z},N.init=function(t,n){var i;if(!t)return N.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&p.test(t))i=N.fragment(t,RegExp.$1,n),t=null;else{if(n!==e)return r(n).find(t);i=N.qsa(f,t)}else{if(F(t))return r(f).ready(t);if(N.isZ(t))return t;if(L(t))i=q(t);else if(R(t))i=[t],t=null;else if(p.test(t))i=N.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==e)return r(n).find(t);i=N.qsa(f,t)}}return N.Z(i,t)},r=function(t,e){return N.init(t,e)},r.extend=function(t){var e,n=u.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){J(t,n,e)}),t},N.qsa=function(t,e){var n,r="#"==e[0],i=!r&&"."==e[0],o=r||i?e.slice(1):e,s=T.test(o);return t.getElementById&&s&&r?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:u.call(s&&!r&&t.getElementsByClassName?i?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},r.contains=f.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},r.type=$,r.isFunction=F,r.isWindow=k,r.isArray=L,r.isPlainObject=Z,r.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},r.isNumeric=function(t){var e=Number(t),n=typeof t;return null!=t&&"boolean"!=n&&("string"!=n||t.length)&&!isNaN(e)&&isFinite(e)||!1},r.inArray=function(t,e,n){return o.indexOf.call(e,t,n)},r.camelCase=O,r.trim=function(t){return null==t?"":String.prototype.trim.call(t)},r.uuid=0,r.support={},r.expr={},r.noop=function(){},r.map=function(t,e){var n,i,o,r=[];if(z(t))for(i=0;i=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return o.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return F(t)?this.not(this.not(t)):r(a.call(this,function(e){return N.matches(e,t)}))},add:function(t,e){return r(P(this.concat(r(t,e))))},is:function(t){return this.length>0&&N.matches(this[0],t)},not:function(t){var n=[];if(F(t)&&t.call!==e)this.each(function(e){t.call(this,e)||n.push(this)});else{var i="string"==typeof t?this.filter(t):z(t)&&F(t.item)?u.call(t):r(t);this.forEach(function(t){i.indexOf(t)<0&&n.push(t)})}return r(n)},has:function(t){return this.filter(function(){return R(t)?r.contains(this,t):r(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!R(t)?t:r(t)},last:function(){var t=this[this.length-1];return t&&!R(t)?t:r(t)},find:function(t){var e,n=this;return e=t?"object"==typeof t?r(t).filter(function(){var t=this;return o.some.call(n,function(e){return r.contains(e,t)})}):1==this.length?r(N.qsa(this[0],t)):this.map(function(){return N.qsa(this,t)}):r()},closest:function(t,e){var n=[],i="object"==typeof t&&r(t);return this.each(function(r,o){for(;o&&!(i?i.indexOf(o)>=0:N.matches(o,t));)o=o!==e&&!M(o)&&o.parentNode;o&&n.indexOf(o)<0&&n.push(o)}),r(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=r.map(n,function(t){return(t=t.parentNode)&&!M(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return W(e,t)},parent:function(t){return W(P(this.pluck("parentNode")),t)},children:function(t){return W(this.map(function(){return U(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||u.call(this.childNodes)})},siblings:function(t){return W(this.map(function(t,e){return a.call(U(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return r.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=B(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var e=F(t);if(this[0]&&!e)var n=r(t).get(0),i=n.parentNode||this.length>1;return this.each(function(o){r(this).wrapAll(e?t.call(this,o):i?n.cloneNode(!0):n)})},wrapAll:function(t){if(this[0]){r(this[0]).before(t=r(t));for(var e;(e=t.children()).length;)t=e.first();r(t).append(this)}return this},wrapInner:function(t){var e=F(t);return this.each(function(n){var i=r(this),o=i.contents(),s=e?t.call(this,n):t;o.length?o.wrapAll(s):i.append(s)})},unwrap:function(){return this.parent().each(function(){r(this).replaceWith(r(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var n=r(this);(t===e?"none"==n.css("display"):t)?n.show():n.hide()})},prev:function(t){return r(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return r(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;r(this).empty().append(Y(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=Y(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this.pluck("textContent").join(""):null},attr:function(t,r){var i;return"string"!=typeof t||1 in arguments?this.each(function(e){if(1===this.nodeType)if(R(t))for(n in t)G(this,n,t[n]);else G(this,t,Y(this,r,e,this.getAttribute(t)))}):0 in this&&1==this[0].nodeType&&null!=(i=this[0].getAttribute(t))?i:e},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){G(this,t)},this)})},prop:function(t,e){return t=D[t]||t,1 in arguments?this.each(function(n){this[t]=Y(this,e,n,this[t])}):this[0]&&this[0][t]},removeProp:function(t){return t=D[t]||t,this.each(function(){delete this[t]})},data:function(t,n){var r="data-"+t.replace(v,"-$1").toLowerCase(),i=1 in arguments?this.attr(r,n):this.attr(r);return null!==i?Q(i):e},val:function(t){return 0 in arguments?(null==t&&(t=""),this.each(function(e){this.value=Y(this,t,e,this.value)})):this[0]&&(this[0].multiple?r(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(e){if(e)return this.each(function(t){var n=r(this),i=Y(this,e,t,n.offset()),o=n.offsetParent().offset(),s={top:i.top-o.top,left:i.left-o.left};"static"==n.css("position")&&(s.position="relative"),n.css(s)});if(!this.length)return null;if(f.documentElement!==this[0]&&!r.contains(f.documentElement,this[0]))return{top:0,left:0};var n=this[0].getBoundingClientRect();return{left:n.left+t.pageXOffset,top:n.top+t.pageYOffset,width:Math.round(n.width),height:Math.round(n.height)}},css:function(t,e){if(arguments.length<2){var i=this[0];if("string"==typeof t){if(!i)return;return i.style[O(t)]||getComputedStyle(i,"").getPropertyValue(t)}if(L(t)){if(!i)return;var o={},s=getComputedStyle(i,"");return r.each(t,function(t,e){o[e]=i.style[O(e)]||s.getPropertyValue(e)}),o}}var a="";if("string"==$(t))e||0===e?a=I(t)+":"+_(t,e):this.each(function(){this.style.removeProperty(I(t))});else for(n in t)t[n]||0===t[n]?a+=I(n)+":"+_(n,t[n])+";":this.each(function(){this.style.removeProperty(I(n))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(r(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?o.some.call(this,function(t){return this.test(K(t))},V(t)):!1},addClass:function(t){return t?this.each(function(e){if("className"in this){i=[];var n=K(this),o=Y(this,t,e,n);o.split(/\s+/g).forEach(function(t){r(this).hasClass(t)||i.push(t)},this),i.length&&K(this,n+(n?" ":"")+i.join(" "))}}):this},removeClass:function(t){return this.each(function(n){if("className"in this){if(t===e)return K(this,"");i=K(this),Y(this,t,n,i).split(/\s+/g).forEach(function(t){i=i.replace(V(t)," ")}),K(this,i.trim())}})},toggleClass:function(t,n){return t?this.each(function(i){var o=r(this),s=Y(this,t,i,K(this));s.split(/\s+/g).forEach(function(t){(n===e?!o.hasClass(t):n)?o.addClass(t):o.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var n="scrollTop"in this[0];return t===e?n?this[0].scrollTop:this[0].pageYOffset:this.each(n?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var n="scrollLeft"in this[0];return t===e?n?this[0].scrollLeft:this[0].pageXOffset:this.each(n?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),i=g.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(r(t).css("margin-top"))||0,n.left-=parseFloat(r(t).css("margin-left"))||0,i.top+=parseFloat(r(e[0]).css("border-top-width"))||0,i.left+=parseFloat(r(e[0]).css("border-left-width"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||f.body;t&&!g.test(t.nodeName)&&"static"==r(t).css("position");)t=t.offsetParent;return t})}},r.fn.detach=r.fn.remove,["width","height"].forEach(function(t){var n=t.replace(/./,function(t){return t[0].toUpperCase()});r.fn[t]=function(i){var o,s=this[0];return i===e?k(s)?s["inner"+n]:M(s)?s.documentElement["scroll"+n]:(o=this.offset())&&o[t]:this.each(function(e){s=r(this),s.css(t,Y(this,i,e,s[t]()))})}}),x.forEach(function(n,i){var o=i%2;r.fn[n]=function(){var n,a,s=r.map(arguments,function(t){var i=[];return n=$(t),"array"==n?(t.forEach(function(t){return t.nodeType!==e?i.push(t):r.zepto.isZ(t)?i=i.concat(t.get()):void(i=i.concat(N.fragment(t)))}),i):"object"==n||null==t?t:N.fragment(t)}),u=this.length>1;return s.length<1?this:this.each(function(e,n){a=o?n:n.parentNode,n=0==i?n.nextSibling:1==i?n.firstChild:2==i?n:null;var c=r.contains(f.documentElement,a);s.forEach(function(e){if(u)e=e.cloneNode(!0);else if(!a)return r(e).remove();a.insertBefore(e,n),c&&tt(e,function(e){if(!(null==e.nodeName||"SCRIPT"!==e.nodeName.toUpperCase()||e.type&&"text/javascript"!==e.type||e.src)){var n=e.ownerDocument?e.ownerDocument.defaultView:t;n.eval.call(n,e.innerHTML)}})})})},r.fn[o?n+"To":"insert"+(i?"Before":"After")]=function(t){return r(t)[n](this),this}}),N.Z.prototype=X.prototype=r.fn,N.uniq=P,N.deserializeValue=Q,r.zepto=N,r}();return t.Zepto=e,void 0===t.$&&(t.$=e),function(e){function h(t){return t._zid||(t._zid=n++)}function p(t,e,n,r){if(e=d(e),e.ns)var i=m(e.ns);return(a[h(t)]||[]).filter(function(t){return t&&(!e.e||t.e==e.e)&&(!e.ns||i.test(t.ns))&&(!n||h(t.fn)===h(n))&&(!r||t.sel==r)})}function d(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function m(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function g(t,e){return t.del&&!f&&t.e in c||!!e}function v(t){return l[t]||f&&c[t]||t}function y(t,n,i,o,s,u,f){var c=h(t),p=a[c]||(a[c]=[]);n.split(/\s/).forEach(function(n){if("ready"==n)return e(document).ready(i);var a=d(n);a.fn=i,a.sel=s,a.e in l&&(i=function(t){var n=t.relatedTarget;return!n||n!==this&&!e.contains(this,n)?a.fn.apply(this,arguments):void 0}),a.del=u;var c=u||i;a.proxy=function(e){if(e=T(e),!e.isImmediatePropagationStopped()){e.data=o;var n=c.apply(t,e._args==r?[e]:[e].concat(e._args));return n===!1&&(e.preventDefault(),e.stopPropagation()),n}},a.i=p.length,p.push(a),"addEventListener"in t&&t.addEventListener(v(a.e),a.proxy,g(a,f))})}function x(t,e,n,r,i){var o=h(t);(e||"").split(/\s/).forEach(function(e){p(t,e,n,r).forEach(function(e){delete a[o][e.i],"removeEventListener"in t&&t.removeEventListener(v(e.e),e.proxy,g(e,i))})})}function T(t,n){return(n||!t.isDefaultPrevented)&&(n||(n=t),e.each(w,function(e,r){var i=n[e];t[e]=function(){return this[r]=b,i&&i.apply(n,arguments)},t[r]=E}),t.timeStamp||(t.timeStamp=Date.now()),(n.defaultPrevented!==r?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(t.isDefaultPrevented=b)),t}function S(t){var e,n={originalEvent:t};for(e in t)j.test(e)||t[e]===r||(n[e]=t[e]);return T(n,t)}var r,n=1,i=Array.prototype.slice,o=e.isFunction,s=function(t){return"string"==typeof t},a={},u={},f="onfocusin"in t,c={focus:"focusin",blur:"focusout"},l={mouseenter:"mouseover",mouseleave:"mouseout"};u.click=u.mousedown=u.mouseup=u.mousemove="MouseEvents",e.event={add:y,remove:x},e.proxy=function(t,n){var r=2 in arguments&&i.call(arguments,2);if(o(t)){var a=function(){return t.apply(n,r?r.concat(i.call(arguments)):arguments)};return a._zid=h(t),a}if(s(n))return r?(r.unshift(t[n],t),e.proxy.apply(null,r)):e.proxy(t[n],t);throw new TypeError("expected function")},e.fn.bind=function(t,e,n){return this.on(t,e,n)},e.fn.unbind=function(t,e){return this.off(t,e)},e.fn.one=function(t,e,n,r){return this.on(t,e,n,r,1)};var b=function(){return!0},E=function(){return!1},j=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,w={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};e.fn.delegate=function(t,e,n){return this.on(e,t,n)},e.fn.undelegate=function(t,e,n){return this.off(e,t,n)},e.fn.live=function(t,n){return e(document.body).delegate(this.selector,t,n),this},e.fn.die=function(t,n){return e(document.body).undelegate(this.selector,t,n),this},e.fn.on=function(t,n,a,u,f){var c,l,h=this;return t&&!s(t)?(e.each(t,function(t,e){h.on(t,n,a,e,f)}),h):(s(n)||o(u)||u===!1||(u=a,a=n,n=r),(u===r||a===!1)&&(u=a,a=r),u===!1&&(u=E),h.each(function(r,o){f&&(c=function(t){return x(o,t.type,u),u.apply(this,arguments)}),n&&(l=function(t){var r,s=e(t.target).closest(n,o).get(0);return s&&s!==o?(r=e.extend(S(t),{currentTarget:s,liveFired:o}),(c||u).apply(s,[r].concat(i.call(arguments,1)))):void 0}),y(o,t,u,a,n,l||c)}))},e.fn.off=function(t,n,i){var a=this;return t&&!s(t)?(e.each(t,function(t,e){a.off(t,n,e)}),a):(s(n)||o(i)||i===!1||(i=n,n=r),i===!1&&(i=E),a.each(function(){x(this,t,i,n)}))},e.fn.trigger=function(t,n){return t=s(t)||e.isPlainObject(t)?e.Event(t):T(t),t._args=n,this.each(function(){t.type in c&&"function"==typeof this[t.type]?this[t.type]():"dispatchEvent"in this?this.dispatchEvent(t):e(this).triggerHandler(t,n)})},e.fn.triggerHandler=function(t,n){var r,i;return this.each(function(o,a){r=S(s(t)?e.Event(t):t),r._args=n,r.target=a,e.each(p(a,t.type||t),function(t,e){return i=e.proxy(r),r.isImmediatePropagationStopped()?!1:void 0})}),i},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(t){e.fn[t]=function(e){return 0 in arguments?this.bind(t,e):this.trigger(t)}}),e.Event=function(t,e){s(t)||(e=t,t=e.type);var n=document.createEvent(u[t]||"Events"),r=!0;if(e)for(var i in e)"bubbles"==i?r=!!e[i]:n[i]=e[i];return n.initEvent(t,r,!0),T(n)}}(e),function(e){function p(t,n,r){var i=e.Event(n);return e(t).trigger(i,r),!i.isDefaultPrevented()}function d(t,e,n,i){return t.global?p(e||r,n,i):void 0}function m(t){t.global&&0===e.active++&&d(t,null,"ajaxStart")}function g(t){t.global&&!--e.active&&d(t,null,"ajaxStop")}function v(t,e){var n=e.context;return e.beforeSend.call(n,t,e)===!1||d(e,n,"ajaxBeforeSend",[t,e])===!1?!1:void d(e,n,"ajaxSend",[t,e])}function y(t,e,n,r){var i=n.context,o="success";n.success.call(i,t,o,e),r&&r.resolveWith(i,[t,o,e]),d(n,i,"ajaxSuccess",[e,n,t]),b(o,e,n)}function x(t,e,n,r,i){var o=r.context;r.error.call(o,n,e,t),i&&i.rejectWith(o,[n,e,t]),d(r,o,"ajaxError",[n,r,t||e]),b(e,n,r)}function b(t,e,n){var r=n.context;n.complete.call(r,e,t),d(n,r,"ajaxComplete",[e,n]),g(n)}function E(t,e,n){if(n.dataFilter==j)return t;var r=n.context;return n.dataFilter.call(r,t,e)}function j(){}function w(t){return t&&(t=t.split(";",2)[0]),t&&(t==c?"html":t==f?"json":a.test(t)?"script":u.test(t)&&"xml")||"text"}function T(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function S(t){t.processData&&t.data&&"string"!=e.type(t.data)&&(t.data=e.param(t.data,t.traditional)),!t.data||t.type&&"GET"!=t.type.toUpperCase()&&"jsonp"!=t.dataType||(t.url=T(t.url,t.data),t.data=void 0)}function C(t,n,r,i){return e.isFunction(n)&&(i=r,r=n,n=void 0),e.isFunction(r)||(i=r,r=void 0),{url:t,data:n,success:r,dataType:i}}function O(t,n,r,i){var o,s=e.isArray(n),a=e.isPlainObject(n);e.each(n,function(n,u){o=e.type(u),i&&(n=r?i:i+"["+(a||"object"==o||"array"==o?n:"")+"]"),!i&&s?t.add(u.name,u.value):"array"==o||!r&&"object"==o?O(t,u,r,n):t.add(n,u)})}var i,o,n=+new Date,r=t.document,s=/)<[^<]*)*<\/script>/gi,a=/^(?:text|application)\/javascript/i,u=/^(?:text|application)\/xml/i,f="application/json",c="text/html",l=/^\s*$/,h=r.createElement("a");h.href=t.location.href,e.active=0,e.ajaxJSONP=function(i,o){if(!("type"in i))return e.ajax(i);var c,p,s=i.jsonpCallback,a=(e.isFunction(s)?s():s)||"Zepto"+n++,u=r.createElement("script"),f=t[a],l=function(t){e(u).triggerHandler("error",t||"abort")},h={abort:l};return o&&o.promise(h),e(u).on("load error",function(n,r){clearTimeout(p),e(u).off().remove(),"error"!=n.type&&c?y(c[0],h,i,o):x(null,r||"error",h,i,o),t[a]=f,c&&e.isFunction(f)&&f(c[0]),f=c=void 0}),v(h,i)===!1?(l("abort"),h):(t[a]=function(){c=arguments},u.src=i.url.replace(/\?(.+)=\?/,"?$1="+a),r.head.appendChild(u),i.timeout>0&&(p=setTimeout(function(){l("timeout")},i.timeout)),h)},e.ajaxSettings={type:"GET",beforeSend:j,success:j,error:j,complete:j,context:null,global:!0,xhr:function(){return new t.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:f,xml:"application/xml, text/xml",html:c,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:j},e.ajax=function(n){var u,f,s=e.extend({},n||{}),a=e.Deferred&&e.Deferred();for(i in e.ajaxSettings)void 0===s[i]&&(s[i]=e.ajaxSettings[i]);m(s),s.crossDomain||(u=r.createElement("a"),u.href=s.url,u.href=u.href,s.crossDomain=h.protocol+"//"+h.host!=u.protocol+"//"+u.host),s.url||(s.url=t.location.toString()),(f=s.url.indexOf("#"))>-1&&(s.url=s.url.slice(0,f)),S(s);var c=s.dataType,p=/\?.+=\?/.test(s.url);if(p&&(c="jsonp"),s.cache!==!1&&(n&&n.cache===!0||"script"!=c&&"jsonp"!=c)||(s.url=T(s.url,"_="+Date.now())),"jsonp"==c)return p||(s.url=T(s.url,s.jsonp?s.jsonp+"=?":s.jsonp===!1?"":"callback=?")),e.ajaxJSONP(s,a);var P,d=s.accepts[c],g={},b=function(t,e){g[t.toLowerCase()]=[t,e]},C=/^([\w-]+:)\/\//.test(s.url)?RegExp.$1:t.location.protocol,N=s.xhr(),O=N.setRequestHeader;if(a&&a.promise(N),s.crossDomain||b("X-Requested-With","XMLHttpRequest"),b("Accept",d||"*/*"),(d=s.mimeType||d)&&(d.indexOf(",")>-1&&(d=d.split(",",2)[0]),N.overrideMimeType&&N.overrideMimeType(d)),(s.contentType||s.contentType!==!1&&s.data&&"GET"!=s.type.toUpperCase())&&b("Content-Type",s.contentType||"application/x-www-form-urlencoded"),s.headers)for(o in s.headers)b(o,s.headers[o]);if(N.setRequestHeader=b,N.onreadystatechange=function(){if(4==N.readyState){N.onreadystatechange=j,clearTimeout(P);var t,n=!1;if(N.status>=200&&N.status<300||304==N.status||0==N.status&&"file:"==C){if(c=c||w(s.mimeType||N.getResponseHeader("content-type")),"arraybuffer"==N.responseType||"blob"==N.responseType)t=N.response;else{t=N.responseText;try{t=E(t,c,s),"script"==c?(1,eval)(t):"xml"==c?t=N.responseXML:"json"==c&&(t=l.test(t)?null:e.parseJSON(t))}catch(r){n=r}if(n)return x(n,"parsererror",N,s,a)}y(t,N,s,a)}else x(N.statusText||null,N.status?"error":"abort",N,s,a)}},v(N,s)===!1)return N.abort(),x(null,"abort",N,s,a),N;var A="async"in s?s.async:!0;if(N.open(s.type,s.url,A,s.username,s.password),s.xhrFields)for(o in s.xhrFields)N[o]=s.xhrFields[o];for(o in g)O.apply(N,g[o]);return s.timeout>0&&(P=setTimeout(function(){N.onreadystatechange=j,N.abort(),x(null,"timeout",N,s,a)},s.timeout)),N.send(s.data?s.data:null),N},e.get=function(){return e.ajax(C.apply(null,arguments))},e.post=function(){var t=C.apply(null,arguments);return t.type="POST",e.ajax(t)},e.getJSON=function(){var t=C.apply(null,arguments);return t.dataType="json",e.ajax(t)},e.fn.load=function(t,n,r){if(!this.length)return this;var a,i=this,o=t.split(/\s/),u=C(t,n,r),f=u.success;return o.length>1&&(u.url=o[0],a=o[1]),u.success=function(t){i.html(a?e("
            ").html(t.replace(s,"")).find(a):t),f&&f.apply(i,arguments)},e.ajax(u),this};var N=encodeURIComponent;e.param=function(t,n){var r=[];return r.add=function(t,n){e.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(N(t)+"="+N(n))},O(r,t,n),r.join("&").replace(/%20/g,"+")}}(e),function(t){t.fn.serializeArray=function(){var e,n,r=[],i=function(t){return t.forEach?t.forEach(i):void r.push({name:e,value:t})};return this[0]&&t.each(this[0].elements,function(r,o){n=o.type,e=o.name,e&&"fieldset"!=o.nodeName.toLowerCase()&&!o.disabled&&"submit"!=n&&"reset"!=n&&"button"!=n&&"file"!=n&&("radio"!=n&&"checkbox"!=n||o.checked)&&i(t(o).val())}),r},t.fn.serialize=function(){var t=[];return this.serializeArray().forEach(function(e){t.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}),t.join("&")},t.fn.submit=function(e){if(0 in arguments)this.bind("submit",e);else if(this.length){var n=t.Event("submit");this.eq(0).trigger(n),n.isDefaultPrevented()||this.get(0).submit()}return this}}(e),function(){try{getComputedStyle(void 0)}catch(e){var n=getComputedStyle;t.getComputedStyle=function(t,e){try{return n(t,e)}catch(r){return null}}}}(),e}); \ No newline at end of file diff --git a/Yangcai365_web/manage/zinc/module/xmSelect/xm-select.js b/Yangcai365_web/manage/zinc/module/xmSelect/xm-select.js new file mode 100644 index 0000000..c8257a9 --- /dev/null +++ b/Yangcai365_web/manage/zinc/module/xmSelect/xm-select.js @@ -0,0 +1,8 @@ +/*! + * @Title: xm-select + * @Version: 1.1.9 + * @Description:基于layui的多选解决方案 + * @Site: https://gitee.com/maplemei/xm-select + * @Author: maplemei + * @License:Apache License 2.0 + */!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./",n(n.s=213)}({104:function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var r,i=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")}))}},213:function(e,t,n){"use strict";n.r(t),function(e){n(215),n(216),n(218);var t=n(65);window.addEventListener("click",(function(){Object.keys(t.b).forEach((function(e){var n=t.b[e];n&&n.closed&&n.closed()}))})),"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?e.exports=t.c:"function"==typeof define&&n(220)?define(xmSelect):window.layui&&layui.define&&layui.define((function(e){e("xmSelect",t.c)})),window.xmSelect=t.c}.call(this,n(214)(e))},214:function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},215:function(e,t){Array.prototype.map||(Array.prototype.map=function(e,t){var n,o,r,i=Object(this),l=i.length>>>0;for(t&&(n=t),o=new Array(l),r=0;r>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(n=t),o=0;o>>0;if("function"!=typeof e)throw new TypeError;for(var o=[],r=arguments[1],i=0;i>>0,r=arguments[1],i=0;i .xm-tips {\n color: #999999;\n padding: 0 10px;\n position: absolute;\n display: flex;\n height: 100%;\n align-items: center;\n}\nxm-select > .xm-icon {\n display: inline-block;\n overflow: hidden;\n position: absolute;\n width: 0;\n height: 0;\n right: 10px;\n top: 50%;\n margin-top: -3px;\n cursor: pointer;\n border: 6px dashed transparent;\n border-top-color: #C2C2C2;\n border-top-style: solid;\n transition: all 0.3s;\n -webkit-transition: all 0.3s;\n}\nxm-select > .xm-icon-expand {\n margin-top: -9px;\n transform: rotate(180deg);\n}\nxm-select > .xm-label.single-row {\n position: absolute;\n top: 0;\n bottom: 0px;\n left: 0px;\n right: 30px;\n overflow: auto hidden;\n}\nxm-select > .xm-label.single-row .scroll {\n overflow-y: hidden;\n}\nxm-select > .xm-label.single-row .label-content {\n flex-wrap: nowrap;\n}\nxm-select > .xm-label.auto-row .label-content {\n flex-wrap: wrap;\n}\nxm-select > .xm-label.auto-row .xm-label-block > span {\n white-space: unset;\n height: 100%;\n}\nxm-select > .xm-label .scroll .label-content {\n display: flex;\n padding: 3px 30px 3px 10px;\n}\nxm-select > .xm-label .xm-label-block {\n display: flex;\n position: relative;\n padding: 0px 5px;\n margin: 2px 5px 2px 0;\n border-radius: 3px;\n align-items: baseline;\n color: #FFF;\n}\nxm-select > .xm-label .xm-label-block > span {\n display: flex;\n color: #FFF;\n white-space: nowrap;\n}\nxm-select > .xm-label .xm-label-block > i {\n color: #FFF;\n margin-left: 8px;\n font-size: 12px;\n cursor: pointer;\n display: flex;\n}\nxm-select > .xm-label .xm-label-block.disabled {\n background-color: #C2C2C2 !important;\n cursor: no-drop !important;\n}\nxm-select > .xm-label .xm-label-block.disabled > i {\n cursor: no-drop !important;\n}\nxm-select > .xm-body {\n position: absolute;\n left: 0;\n top: 42px;\n padding: 5px 0;\n z-index: 999;\n width: 100%;\n min-width: fit-content;\n border: 1px solid #E6E6E6;\n background-color: #fff;\n border-radius: 2px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);\n animation-name: xm-upbit;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n}\nxm-select > .xm-body .scroll-body {\n overflow-x: hidden;\n overflow-y: auto;\n}\nxm-select > .xm-body .scroll-body::-webkit-scrollbar {\n width: 8px;\n}\nxm-select > .xm-body .scroll-body::-webkit-scrollbar-track {\n -webkit-border-radius: 2em;\n -moz-border-radius: 2em;\n -ms-border-radius: 2em;\n border-radius: 2em;\n background-color: #FFF;\n}\nxm-select > .xm-body .scroll-body::-webkit-scrollbar-thumb {\n -webkit-border-radius: 2em;\n -moz-border-radius: 2em;\n -ms-border-radius: 2em;\n border-radius: 2em;\n background-color: #C2C2C2;\n}\nxm-select > .xm-body.up {\n top: auto;\n bottom: 42px;\n}\nxm-select > .xm-body.relative {\n position: relative;\n display: block !important;\n top: 0;\n box-shadow: none;\n border: none;\n animation-name: none;\n animation-duration: 0;\n min-width: 100%;\n}\nxm-select > .xm-body .xm-group {\n cursor: default;\n}\nxm-select > .xm-body .xm-group-item {\n display: inline-block;\n cursor: pointer;\n padding: 0 10px;\n color: #999;\n font-size: 12px;\n}\nxm-select > .xm-body .xm-option {\n display: flex;\n align-items: center;\n position: relative;\n padding: 0 10px;\n cursor: pointer;\n}\nxm-select > .xm-body .xm-option-icon {\n color: transparent;\n display: flex;\n border: 1px solid #E6E6E6;\n border-radius: 3px;\n justify-content: center;\n align-items: center;\n}\nxm-select > .xm-body .xm-option-icon.xm-icon-danx {\n border-radius: 100%;\n}\nxm-select > .xm-body .xm-option-content {\n display: flex;\n position: relative;\n padding-left: 15px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: #666;\n width: calc(100% - 20px);\n}\nxm-select > .xm-body .xm-option.hide-icon .xm-option-content {\n padding-left: 0;\n}\nxm-select > .xm-body .xm-option.selected.hide-icon .xm-option-content {\n color: #FFF !important;\n}\nxm-select > .xm-body .xm-option .loader {\n width: 0.8em;\n height: 0.8em;\n margin-right: 6px;\n color: #C2C2C2;\n}\nxm-select > .xm-body .xm-select-empty {\n text-align: center;\n color: #999;\n}\nxm-select > .xm-body .disabled {\n cursor: no-drop;\n}\nxm-select > .xm-body .disabled:hover {\n background-color: #FFF;\n}\nxm-select > .xm-body .disabled .xm-option-icon {\n border-color: #C2C2C2 !important;\n}\nxm-select > .xm-body .disabled .xm-option-content {\n color: #C2C2C2 !important;\n}\nxm-select > .xm-body .disabled.selected > .xm-option-icon {\n color: #C2C2C2 !important;\n}\nxm-select > .xm-body .xm-search {\n background-color: #FFF !important;\n position: relative;\n padding: 0 10px;\n margin-bottom: 5px;\n cursor: pointer;\n}\nxm-select > .xm-body .xm-search > i {\n position: absolute;\n color: #666;\n}\nxm-select > .xm-body .xm-search-input {\n border: none;\n border-bottom: 1px solid #E6E6E6;\n padding-left: 27px;\n cursor: text;\n}\nxm-select > .xm-body .xm-paging {\n padding: 0 10px;\n display: flex;\n margin-top: 5px;\n}\nxm-select > .xm-body .xm-paging > span:first-child {\n border-radius: 2px 0 0 2px;\n}\nxm-select > .xm-body .xm-paging > span:last-child {\n border-radius: 0 2px 2px 0;\n}\nxm-select > .xm-body .xm-paging > span {\n display: flex;\n flex: auto;\n justify-content: center;\n vertical-align: middle;\n margin: 0 -1px 0 0;\n background-color: #fff;\n color: #333;\n font-size: 12px;\n border: 1px solid #e2e2e2;\n flex-wrap: nowrap;\n width: 100%;\n overflow: hidden;\n min-width: 50px;\n}\nxm-select > .xm-body .xm-toolbar {\n padding: 0 10px;\n display: flex;\n margin: -3px 0;\n cursor: default;\n}\nxm-select > .xm-body .xm-toolbar .toolbar-tag {\n cursor: pointer;\n display: flex;\n margin-right: 20px;\n color: #666;\n align-items: baseline;\n}\nxm-select > .xm-body .xm-toolbar .toolbar-tag:hover {\n opacity: 0.8;\n}\nxm-select > .xm-body .xm-toolbar .toolbar-tag:active {\n opacity: 1;\n}\nxm-select > .xm-body .xm-toolbar .toolbar-tag > i {\n margin-right: 2px;\n font-size: 14px;\n}\nxm-select > .xm-body .xm-toolbar .toolbar-tag:last-child {\n margin-right: 0;\n}\nxm-select > .xm-body .xm-body-custom {\n line-height: initial;\n cursor: default;\n}\nxm-select > .xm-body .xm-body-custom * {\n box-sizing: initial;\n}\nxm-select > .xm-body .xm-tree {\n position: relative;\n}\nxm-select > .xm-body .xm-tree-icon {\n display: inline-block;\n margin-right: 3px;\n cursor: pointer;\n border: 6px dashed transparent;\n border-left-color: #C2C2C2;\n border-left-style: solid;\n transition: all 0.3s;\n -webkit-transition: all 0.3s;\n z-index: 2;\n visibility: hidden;\n}\nxm-select > .xm-body .xm-tree-icon.expand {\n margin-top: 3px;\n margin-right: 5px;\n margin-left: -2px;\n transform: rotate(90deg);\n}\nxm-select > .xm-body .xm-tree-icon.xm-visible {\n visibility: visible;\n}\nxm-select > .xm-body .xm-tree .left-line {\n position: absolute;\n left: 13px;\n width: 0;\n z-index: 1;\n border-left: 1px dotted #c0c4cc !important;\n}\nxm-select > .xm-body .xm-tree .top-line {\n position: absolute;\n left: 13px;\n height: 0;\n z-index: 1;\n border-top: 1px dotted #c0c4cc !important;\n}\nxm-select > .xm-body .xm-tree .xm-tree-icon + .top-line {\n margin-left: 1px;\n}\nxm-select > .xm-body .scroll-body > .xm-tree > .xm-option > .top-line,\nxm-select > .xm-body .scroll-body > .xm-option > .top-line {\n width: 0 !important;\n}\nxm-select > .xm-body .xm-cascader-box {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n padding: 5px 0;\n border: 1px solid #E6E6E6;\n background-color: #fff;\n border-radius: 2px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);\n margin: -1px;\n}\nxm-select > .xm-body .xm-cascader-box::before {\n content: ' ';\n position: absolute;\n width: 0;\n height: 0;\n border: 6px solid transparent;\n border-right-color: #E6E6E6;\n top: 10px;\n left: -12px;\n}\nxm-select > .xm-body .xm-cascader-box::after {\n content: ' ';\n position: absolute;\n width: 0;\n height: 0;\n border: 6px solid transparent;\n border-right-color: #fff;\n top: 10px;\n left: -11px;\n}\nxm-select > .xm-body .xm-cascader-scroll {\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n}\nxm-select > .xm-body.cascader {\n width: unset;\n min-width: unset;\n}\nxm-select > .xm-body.cascader .xm-option-content {\n padding-left: 8px;\n}\nxm-select > .xm-body.cascader .disabled .xm-right-arrow {\n color: #C2C2C2 !important;\n}\nxm-select .xm-input {\n cursor: pointer;\n border-radius: 2px;\n border-width: 1px;\n border-style: solid;\n border-color: #E6E6E6;\n display: block;\n width: 100%;\n box-sizing: border-box;\n background-color: #FFF;\n line-height: 1.3;\n padding-left: 10px;\n outline: 0;\n user-select: text;\n -ms-user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n}\nxm-select .dis {\n display: none;\n}\nxm-select .loading {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(255, 255, 255, 0.6);\n display: flex;\n align-items: center;\n justify-content: center;\n}\nxm-select .loader {\n border: 0.2em dotted currentcolor;\n border-radius: 50%;\n -webkit-animation: 1s loader linear infinite;\n animation: 1s loader linear infinite;\n display: inline-block;\n width: 1em;\n height: 1em;\n color: inherit;\n vertical-align: middle;\n pointer-events: none;\n}\nxm-select .xm-select-default {\n position: absolute;\n width: 100%;\n height: 100%;\n border: none;\n visibility: hidden;\n}\nxm-select .xm-select-disabled {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n cursor: no-drop;\n z-index: 2;\n opacity: 0.3;\n background-color: #FFF;\n}\nxm-select .item--divided {\n border-top: 1px solid #ebeef5;\n width: calc(100% - 20px);\n cursor: initial;\n}\nxm-select .xm-right-arrow {\n position: absolute;\n color: #666;\n right: 5px;\n top: -1px;\n font-weight: 700;\n transform: scale(0.6, 1);\n}\nxm-select .xm-right-arrow::after {\n content: '>';\n}\nxm-select[size='large'] {\n min-height: 40px;\n line-height: 40px;\n}\nxm-select[size='large'] .xm-input {\n height: 40px;\n}\nxm-select[size='large'] .xm-label .scroll .label-content {\n line-height: 34px;\n}\nxm-select[size='large'] .xm-label .xm-label-block {\n height: 30px;\n line-height: 30px;\n}\nxm-select[size='large'] .xm-body .xm-option .xm-option-icon {\n height: 20px;\n width: 20px;\n font-size: 20px;\n}\nxm-select[size='large'] .xm-paging > span {\n height: 34px;\n line-height: 34px;\n}\nxm-select[size='large'] .xm-tree .left-line {\n height: 100%;\n bottom: 20px;\n}\nxm-select[size='large'] .xm-tree .left-line-group {\n height: calc(100% - 40px);\n}\nxm-select[size='large'] .xm-tree .xm-tree-icon.xm-hidden + .top-line {\n top: 19px;\n}\nxm-select[size='large'] .item--divided {\n margin: 10px;\n}\nxm-select {\n min-height: 36px;\n line-height: 36px;\n}\nxm-select .xm-input {\n height: 36px;\n}\nxm-select .xm-label .scroll .label-content {\n line-height: 30px;\n}\nxm-select .xm-label .xm-label-block {\n height: 26px;\n line-height: 26px;\n}\nxm-select .xm-body .xm-option .xm-option-icon {\n height: 18px;\n width: 18px;\n font-size: 18px;\n}\nxm-select .xm-paging > span {\n height: 30px;\n line-height: 30px;\n}\nxm-select .xm-tree .left-line {\n height: 100%;\n bottom: 18px;\n}\nxm-select .xm-tree .left-line-group {\n height: calc(100% - 36px);\n}\nxm-select .xm-tree .xm-tree-icon.xm-hidden + .top-line {\n top: 17px;\n}\nxm-select .item--divided {\n margin: 9px;\n}\nxm-select[size='small'] {\n min-height: 32px;\n line-height: 32px;\n}\nxm-select[size='small'] .xm-input {\n height: 32px;\n}\nxm-select[size='small'] .xm-label .scroll .label-content {\n line-height: 26px;\n}\nxm-select[size='small'] .xm-label .xm-label-block {\n height: 22px;\n line-height: 22px;\n}\nxm-select[size='small'] .xm-body .xm-option .xm-option-icon {\n height: 16px;\n width: 16px;\n font-size: 16px;\n}\nxm-select[size='small'] .xm-paging > span {\n height: 26px;\n line-height: 26px;\n}\nxm-select[size='small'] .xm-tree .left-line {\n height: 100%;\n bottom: 16px;\n}\nxm-select[size='small'] .xm-tree .left-line-group {\n height: calc(100% - 32px);\n}\nxm-select[size='small'] .xm-tree .xm-tree-icon.xm-hidden + .top-line {\n top: 15px;\n}\nxm-select[size='small'] .item--divided {\n margin: 8px;\n}\nxm-select[size='mini'] {\n min-height: 28px;\n line-height: 28px;\n}\nxm-select[size='mini'] .xm-input {\n height: 28px;\n}\nxm-select[size='mini'] .xm-label .scroll .label-content {\n line-height: 22px;\n}\nxm-select[size='mini'] .xm-label .xm-label-block {\n height: 18px;\n line-height: 18px;\n}\nxm-select[size='mini'] .xm-body .xm-option .xm-option-icon {\n height: 14px;\n width: 14px;\n font-size: 14px;\n}\nxm-select[size='mini'] .xm-paging > span {\n height: 22px;\n line-height: 22px;\n}\nxm-select[size='mini'] .xm-tree .left-line {\n height: 100%;\n bottom: 14px;\n}\nxm-select[size='mini'] .xm-tree .left-line-group {\n height: calc(100% - 28px);\n}\nxm-select[size='mini'] .xm-tree .xm-tree-icon.xm-hidden + .top-line {\n top: 13px;\n}\nxm-select[size='mini'] .item--divided {\n margin: 7px;\n}\n.layui-form-pane xm-select {\n margin: -1px -1px -1px 0;\n}\n",""])},218:function(e,t,n){var o=n(219);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(27)(o,r);o.locals&&(e.exports=o.locals)},219:function(e,t,n){(e.exports=n(26)(!1)).push([e.i,'@font-face {\n font-family: "xm-iconfont";\n src: url(\'//at.alicdn.com/t/font_792691_ptvyboo0bno.eot?t=1574048839056\');\n /* IE9 */\n src: url(\'//at.alicdn.com/t/font_792691_ptvyboo0bno.eot?t=1574048839056#iefix\') format(\'embedded-opentype\'), /* IE6-IE8 */ url(\'data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAksAAsAAAAAEYAAAAjeAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCEUgqTXI8lATYCJAM0CxwABCAFhG0HgTwbZQ4jEbaCkVIj+4sD3sS6BFAp9ka91ulVG4leTC/+h+3V+zyRYCTyREKkcZ+D5/u137lPdveLGJBMunoiNPOQPBMq0/FQtEKIkMRDZng69d+hOiQumAr7bJdBOEzMTU77s78mhbI58aCg7ebCs4LBTgCk+cD/4ZqWUHebipp7al3tyKOjwCV/hVyw9PdzaktxI7IMQs26/1N8gV4DI0bVut3UhCaflGGgwM3oTXg1IfRMbCsmrEnriJVeYM2eXHII4KdMMzL4OoACHgZBCTasITcReDUBE8kWPLMTCGoQaDV+eKpUPQI49r8vP6BTPIDCaiBSml3oOQX0voNPebv/u2P0AUfP1w0s5EADzYBZsNdByylo2eVq/NtRdgFpovQR5x2CIwmIZeik6/u0T/m/A7RJP00sCmmyksj/kwc+LC5BFBqDEMDDjwPiANDB9MpJTXwHmsO3YyBwWDA4OFwwJLRcRgAOBUYMDg0mHRwGTAYozsV0AgWYruDwwExDHfzwKWf4OurQ9jzQDtoF+wpistfBfluQ5bQiiJa4ZQoKhShLiMayBbyg05AIkYBoIBJEEApQy/FwYv4HchADIUBXl61dW6mpwIgyp7p8PrHddieSjhY9oqTxyPB/FGNYDklpfYh8VtaoqSgb0bKoGB17CuVUp9Ll2nS2UpNGMSw9hyirA7C6+QLyByIQS0sSSmxvArC5odZmYZMxZSiBR5OkQl0uiufxMH5eL8t3u0d4XKyuq6EMdcpNe2+oXA8p9yPa+4T1PM7+A54tc7tpl2vcAHAftnhZj2chy1CyaCRFsyMqQ5nkNnskEt2yxxZinPsOZjFm4+XWvKqLkfCGS1k4MNP82isxSMf7ZsGYvQVCNAeSSVtzWCxRdXGxyZlA2CvCEevuO7y9M2z2NWH8icydzq/qAJSp1lGvDWFp6Nw3xChJowPD+76nU+upQk6Kw9jI0Rgym9Ct8VlxMI3CSIaDCZja5tDYt0/EYra4tn0Kp3v8Rdezk8svcy1mKhoSvNcZz3LKlUe777Gmval0s7bzAc0k13LGk896V9DuvNn34N0ebKgItkQgOomuJtgQPChNI4cwa7CEWCvfk5QjJFlem6i3SfVShWi5LTFRG+JwdCNpSqbpRFwrtb1TbcRkJi/AbJJQOmfCdnswLNGVM7qqSRO1zO0Q0j5Vr3cYQ07HB0MX6KoIZhx+D9Djs2C5bXtVwvbgJHtSCIL7hjFJme4sZDdS5IlJdKUO1Qt8opn0trBafz3AX933kmCRgyMEWGZjMAkRKhwmIHJGR4ruwFCdWKYzrap2R/mvd2UKajzRAZu88pGAD90Y+02kTFCKrBSXwGGJ3wRcPCdIppTxSmHOfESRwIli0S5J/8AYDCxTGh4XZua4xvfvGx320rDK2qA8g5FlS7pWNLx71+BwgA/KZ5I0aeKmNeCNoNPl8qNHu8uHHzqaKc86fHi4vPuRI4ny+I/vjxw+clh4HXVCFvVnVFx07EHZwVhSRliTTMWSEi0h6YuS6DxCRmiin0B3L4ry6cvR0ijYexFdBL3wGQM0YOrUAZCBkLOBBtQ+xdk7omfgUv+u++admyUeXduyxLM+r/+49rPfhgEZor6GymToNYksNsZyC7ntwAH0928UpgMpxpF0ydNlsMMBw7QsxTCmu0Hf3F+/+vb99Yumhb+e9R0LBNm+4O+hu7lQ5bGjI9j5G88qQ5SLFyuEC7cwd25xoYo2j4eA4bhpM7TZhPtmc+uhVEVSMYXLWh0bfjI8dvUpvDUocPZmU4kwwOfc83wB5wPehrpD3waApbwW+fgRrZXcxw+mB/3woZT+8JFMYwRMIy2k/18qhqcKpjYeYSnIACaUoRDu0e3kQFh98R5fiI8oJqwwGZSJDSbehLzZs7zIeWTQ4UGOIs2c4j2/Q/tn7n7j9juO33On6WhURCT/wO6Y3QdmWFY0Ef6JUeGRggO7ZbtaZlh5RYKWXbLPBLc3l/5h4A0mu3ZXTZ+u6t6VHMAzZhxak50T+24NnRuaOmehRkXlqVR5lIpuwezUUDUdCuJysv8Z/0/8uNE1s7jIJIubFWnI/x7g4nAZx79yYpFoAOU3a9iwT1O/GxUxPY0ljVPv9EukI3qNrl/So2YfzasqHCroNjS0+w0tlPlsYfC6v/01ixquizJH1Kd/VK+OS3iS3rTJWmqsMPdU3B3oFyC9RSumWE/0gG36IjTysfH51IJ/5oOgNYu6p4yb5Fdufhr/Kjtu0oSyYP/WJQrz35aNFnMhtFcwb55NlNnH8Wdu1b+XZA9zqlZrhdPo/V3uBhiUlQ66h0LhbAmFYIncdFOpVMh6Fl7peqy5Z2ZdQBITO2x1Asj1dRFjIBMC3hbuUh8Ooc4W03EjAdo8UL/t0oUfyU8630bmMcw/vqDNAsC9BQD4OqCgH+ljy0UhJB8AAJA+8EmArxk5gnRLik90AElf8rBm+IMvBTWnucb3+0o0ARk+r0ZBv8sU01nnSmP45/H8Dp8C8X+iE9e+ZvXymK/sQJ5/DuqhYKebPnKmPqLYuDcIMWS2/Rjxp2s8Do821LVn6A/xMK1RKvBLK5gyDsZ5uQ6bYusmx2yqLFe4lECHDPcFhojmckuAbnCI6Cn308RI6AAJdtCICQLQyBHKhSgX5YowN6BBPIEB8VxuSfNncpAuutzPnCSiDHDEo+DsKQBPoJi4MpRktepIs2zjO5h84IEMM3ffECKSZU1ZHxfewEI4h494MuuUNNOBjuw18QKHAzEXaAcylS3m3baq9MpnKenYmfEUgCdbXTHEtTVKsvruNGv9/DuYfOAhcuKu9TeEiA9nNJTUDOUbbVkn3sv2eDJrEnVrpvcHOjJeqRsOcpYYLuxoBzKVtCOm3ZaKbtJcurw+e/zN6c7Pd6r4gqUo0WLEiiOueOITvwQkKCEJM9nO3F60y5HkqLhdqUyXZtK3lqwReQ+G40O92UhOt0x/KmKM+u7LTPMzoEBOCYtiUPfSjODiuFXjSDm2idzAoc4Tj9bs2eJYDOU7HQA=\') format(\'woff2\'), url(\'//at.alicdn.com/t/font_792691_ptvyboo0bno.woff?t=1574048839056\') format(\'woff\'), url(\'//at.alicdn.com/t/font_792691_ptvyboo0bno.ttf?t=1574048839056\') format(\'truetype\'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ url(\'//at.alicdn.com/t/font_792691_ptvyboo0bno.svg?t=1574048839056#iconfont\') format(\'svg\');\n /* iOS 4.1- */\n}\n.xm-iconfont {\n font-family: "xm-iconfont" !important;\n font-size: 16px;\n font-style: normal;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n.xm-icon-quanxuan:before {\n content: "\\e62c";\n}\n.xm-icon-caidan:before {\n content: "\\e610";\n}\n.xm-icon-fanxuan:before {\n content: "\\e837";\n}\n.xm-icon-pifu:before {\n content: "\\e668";\n}\n.xm-icon-qingkong:before {\n content: "\\e63e";\n}\n.xm-icon-sousuo:before {\n content: "\\e600";\n}\n.xm-icon-danx:before {\n content: "\\e62b";\n}\n.xm-icon-duox:before {\n content: "\\e613";\n}\n.xm-icon-close:before {\n content: "\\e601";\n}\n.xm-icon-expand:before {\n content: "\\e641";\n}\n.xm-icon-banxuan:before {\n content: "\\e60d";\n}\n',""])},220:function(e,t){(function(t){e.exports=t}).call(this,{})},26:function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=function(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(n," */")}(o),i=o.sources.map((function(e){return"/*# sourceURL=".concat(o.sourceRoot).concat(e," */")}));return[n].concat(i).concat([r]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2],"{").concat(n,"}"):n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r=0&&p.splice(t,1)}function x(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return y(t,e.attrs),m(e,t),t}function y(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function v(e,t){var n,o,r,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var l=u++;n=c||(c=x(t)),o=w.bind(null,n,l,!1),r=w.bind(null,n,l,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),m(e,t),t}(t),o=C.bind(null,n,t),r=function(){b(n),n.href&&URL.revokeObjectURL(n.href)}):(n=x(t),o=k.bind(null,n),r=function(){b(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=l()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return f(n,t),function(e){for(var o=[],r=0;r3)for(n=[n],o=3;or?n-r:r,l=this.labelRef.scrollLeft+e.deltaY;l<0&&(l=0),l>i&&(l=i),this.labelRef.scrollLeft=l}}},{key:"componentDidMount",value:function(){this.labelRef.addEventListener&&this.labelRef.addEventListener("DOMMouseScroll",this.scrollFunc.bind(this),!1),this.labelRef.attachEvent&&this.labelRef.attachEvent("onmousewheel",this.scrollFunc.bind(this)),this.labelRef.onmousewheel=this.scrollFunc.bind(this)}},{key:"render",value:function(e){var t=this,n=e.data,o=e.prop,r=e.theme,i=e.model,l=e.sels,a=e.autoRow,s=e.tree,c=o.name,p=o.disabled,d=i.label,h=d.type,m=d[h],b=l;s.show&&s.strict&&s.simple&&f(n,l,b=[],o);var x="",y=!0,v=b.map((function(e){return e[c]})).join(",");if("text"===h)x=b.map((function(e){return"".concat(m.left).concat(e[c]).concat(m.right)})).join(m.separator);else if("block"===h){y=!1;var g=Y(b),_={backgroundColor:r.color},w=m.showCount<=0?g.length:m.showCount;x=g.splice(0,w).map((function(e){var n={width:m.showIcon?"calc(100% - 20px)":"100%"};return O("div",{class:["xm-label-block",e[p]?"disabled":""].join(" "),style:_},m.template&&u(m.template)?O("span",{style:n,dangerouslySetInnerHTML:{__html:m.template(e,g)}}):O("span",{style:n},e[c]),m.showIcon&&O("i",{class:"xm-iconfont xm-icon-close",onClick:t.iconClick.bind(t,e,!0,e[p])}))})),g.length&&x.push(O("div",{class:"xm-label-block",style:_},"+ ",g.length))}else x=b.length&&m&&m.template?m.template(n,b):b.map((function(e){return e[c]})).join(",");return O("div",{class:["xm-label",a?"auto-row":"single-row"].join(" ")},O("div",{class:"scroll",ref:function(e){return t.labelRef=e}},y?O("div",{class:"label-content",dangerouslySetInnerHTML:{__html:x}}):O("div",{class:"label-content",title:v},x)))}}])&&Z(n.prototype,o),r&&Z(n,r),t}(E);function X(e){return(X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function te(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:this.size;var e=this.state.pageIndex;e<=1||(this.changePageIndex(e-1),this.props.pageRemote&&this.postData(e-1,!0))}},{key:"pageNextClick",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.size,t=this.state.pageIndex;t>=e||(this.changePageIndex(t+1),this.props.pageRemote&&this.postData(t+1,!0))}},{key:"changePageIndex",value:function(e){this.setState({pageIndex:e})}},{key:"searchInput",value:function(e){var t=this,n=e.target.value;n!==this.__value&&(clearTimeout(this.searchCid),this.inputOver&&(this.__value=n,this.searchCid=setTimeout((function(){t.callback=!0,t.setState({filterValue:t.__value,remote:!0,pageIndex:1})}),this.props.delay)))}},{key:"focus",value:function(){this.searchInputRef&&this.searchInputRef.focus()}},{key:"blur",value:function(){this.searchInputRef&&this.searchInputRef.blur()}},{key:"handleComposition",value:function(e){var t=e.type;"compositionstart"===t?(this.inputOver=!1,clearTimeout(this.searchCid)):"compositionend"===t&&(this.inputOver=!0,this.searchInput(e))}},{key:"postData",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.pageIndex,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(this.state.remote||n)&&(this.callback=!1,this.setState({loading:!0,remote:!1}),this.blur(),this.props.remoteMethod(this.state.filterValue,(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;setTimeout((function(){e.focus(),e.callback=!0,e.setState({loading:!1,totalSize:n}),e.props.onReset(t,"data")}),10)}),this.props.show,t))}},{key:"keydown",value:function(e,t){var n=this,o=t.keyCode;"div"===e&&(27===o||9===o?this.props.onReset(!1,"close"):37===o?this.pagePrevClick():39===o&&this.pageNextClick());var r=this.props.prop,i=r.value,l=r.optgroup,a=r.disabled,s=this.tempData.filter((function(e){return!e[l]&&!e[a]})),c=s.length-1;if(-1!==c){var u=s.findIndex((function(e){return e[i]===n.state.val}));if(38===o){u<=0?u=c:u>0&&(u-=1);var p=s[u][i];this.setState({val:p})}else if(40===o){-1===u||u===c?u=0:uM&&(T=M),M>0&&T<=0&&(T=1),!v){var z=(T-1)*e.pageSize,L=z+e.pageSize;j=j.slice(z,L)}var V={cursor:"no-drop",color:"#d2d2d2"},F={},U={};T<=1&&(F=V),T==M&&(U=V),this.state.pageIndex!==T&&this.changePageIndex(T),this.size=M,D=O("div",{class:"xm-paging"},O("span",{style:F,onClick:this.pagePrevClick.bind(this,M)},"上一页"),O("span",null,this.state.pageIndex," / ",M),O("span",{style:U,onClick:this.pageNextClick.bind(this,M)},"下一页"))}else e.showCount>0&&(j=j.slice(0,e.showCount));var B,N=[],H={__tmp:!0};H[S]=!0,j.forEach((function(e){var t=I[e[w]];B&&!t&&(t=H),t!=B&&(B=t,t&&N.push(B)),N.push(e)})),j=N,t&&(t=y(this.state.filterValue,p([],j)))&&j.splice(0,0,function(e){for(var t=1;t0?l.length>=g?l:d(r.slice(0,g-l.length),l,i):d(r,c,i),n.props.onReset(a,"sels")}}:"CLEAR"===t?{icon:"xm-iconfont xm-icon-qingkong",name:r,method:function(e){n.props.onReset(c.filter((function(e){return e[i.disabled]})),"sels")}}:"REVERSE"===t?{icon:"xm-iconfont xm-icon-fanxuan",name:r,method:function(e){var t=i.optgroup,o=i.disabled,r=e.filter((function(e){return!e[t]})).filter((function(e){return!e[o]})),l=[];c.forEach((function(e){var t=r.findIndex((function(t){return t[w]===e[w]}));-1==t?l.push(e):r.splice(t,1)}));var a=l.filter((function(e){return e[i.disabled]})),u=[];u=s?a.length?a:r.slice(0,1):g>0?a.length>=g?a:d(r.slice(0,g-a.length),a,i):d(r,l,i),n.props.onReset(u,"sels")}}:t;var l=function(e){"mouseenter"===e.type&&(e.target.style.color=a.color),"mouseleave"===e.type&&(e.target.style.color="")};return O("div",{class:"toolbar-tag",style:{},onClick:function(){u(o.method)&&o.method(K),n.focus()},onMouseEnter:l,onMouseLeave:l},e.toolbar.showIcon&&O("i",{class:o.icon}),O("span",null,o.name))})).filter((function(e){return e}))),Y="hidden"!=e.model.icon;return(j=j.map((function(e){return e[S]?e.__tmp?O("div",{class:"item--divided"}):O("div",{class:"xm-group"},O("div",{class:"xm-group-item",onClick:n.groupClick.bind(n,e)},e[_])):function(e){var t=!!c.find((function(t){return t[w]==e[w]})),r=t?{color:a.color,border:"none"}:{borderColor:a.color},i={};e[w]===n.state.val&&(i.backgroundColor=a.hover),!Y&&t&&(i.backgroundColor=a.color,e[k]&&(i.backgroundColor="#C2C2C2"));var u=["xm-option",e[k]?" disabled":"",t?" selected":"",Y?"show-icon":"hide-icon"].join(" "),p=["xm-option-icon xm-iconfont",s?"xm-icon-danx":"xm-icon-duox"].join(" "),d=function(t){"mouseenter"===t.type&&(e[k]||n.setState({val:e[w]}))};return O("div",{class:u,style:i,value:e[w],onClick:n.optionClick.bind(n,e,t,e[k]),onMouseEnter:d,onMouseLeave:d},Y&&O("i",{class:p,style:r}),O("div",{class:"xm-option-content",dangerouslySetInnerHTML:{__html:l({data:o,item:e,arr:c,name:e[_],value:e[w]})}}))}(e)}))).length||(!e.pageEmptyShow&&(D=""),j.push(O("div",{class:"xm-select-empty"},f))),O("div",{onClick:this.blockClick,tabindex:"1",style:"outline: none;"},O("div",null,e.toolbar.show&&q,P,O("div",{class:"scroll-body",style:{maxHeight:e.height}},j),e.paging&&D),this.state.loading&&O("div",{class:"loading"},O("span",{class:"loader"})))}},{key:"componentDidMount",value:function(){var e=this.base.querySelector(".xm-search-input");e&&(e.addEventListener("compositionstart",this.handleComposition.bind(this)),e.addEventListener("compositionupdate",this.handleComposition.bind(this)),e.addEventListener("compositionend",this.handleComposition.bind(this)),e.addEventListener("input",this.searchInput.bind(this)),this.searchInputRef=e),this.base.addEventListener("keydown",this.keydown.bind(this,"div"))}},{key:"componentDidUpdate",value:function(){if(this.callback){this.callback=!1;var e=this.props.filterDone;u(e)&&e(this.state.filterValue,this.tempData||[])}}}])&&te(n.prototype,o),r&&te(n,r),t}(E);function ae(e){return(ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function se(e,t){for(var n=0;n0||f.lazy&&!1!==e.__node.loading)?"xm-visible":"xm-hidden"].join(" "),k=[];f.showFolderIcon&&(k.push(O("i",{class:_})),f.showLine&&(o&&k.push(O("i",{class:"left-line",style:{left:t-f.indent+3+"px"}})),k.push(O("i",{class:"top-line",style:{left:t-f.indent+3+"px",width:f.indent+(0===o?10:-2)+"px"}}))));var C=function(t){"mouseenter"===t.type&&(e[v]||n.setState({val:e[y]}))};return O("div",{class:m,style:h,value:e[y],onClick:n.optionClick.bind(n,e,r,e[v],"line"),onMouseEnter:C,onMouseLeave:C},k,e.__node.loading&&O("span",{class:"loader"}),w&&O("i",{class:b,style:d,onClick:n.optionClick.bind(n,e,r,e[v],"checkbox")}),O("div",{class:"xm-option-content",dangerouslySetInnerHTML:{__html:s({data:c,item:e,arr:i,name:e[x],value:e[y]})}}))};h&&(m?this.postData():this.filterData(c,this.state.filterValue));var C=p([],c),S=p([],i);this.tempData=C;var j=c.map((function(e){return function e(t,o){if(!t.__node.hidn){var r=t[g];if(o+=f.indent,r){var i=-1!==n.state.expandedKeys.findIndex((function(e){return t[y]===e}));return 0===r.length&&(i=!1),O("div",{class:"xm-tree"},f.showFolderIcon&&f.showLine&&i&&r.length>0&&O("i",{class:"left-line left-line-group",style:{left:o+3+"px"}}),k(t,o,0===r.length&&(!f.lazy||f.lazy&&!1===t.__node.loading)?0:i),i&&O("div",{class:"xm-tree-box"},r.map((function(t){return e(t,o)}))))}return k(t,o,0)}}(e,10-f.indent)})).filter((function(e){return e}));function E(e,t){t.forEach((function(t){return t[_]?(!f.strict&&e.push(t),E(e,t[g])):e.push(t)}))}var A=O("div",{class:"xm-toolbar"},e.toolbar.list.map((function(t){var r,s=e.languageProp.toolbar[t];r="ALL"===t?{icon:"xm-iconfont xm-icon-quanxuan",name:s,method:function(e){var t=[];E(t,e),t=t.filter((function(e){return!e[v]})),n.props.onReset(a?t.slice(0,1):d(t,i,o),"treeData")}}:"CLEAR"===t?{icon:"xm-iconfont xm-icon-qingkong",name:s,method:function(e){n.props.onReset(i.filter((function(e){return e[o.disabled]})),"treeData")}}:"REVERSE"===t?{icon:"xm-iconfont xm-icon-fanxuan",name:s,method:function(e){var t=[];E(t,e),t=t.filter((function(e){return!e[v]}));var r=[];i.forEach((function(e){var n=t.findIndex((function(t){return t[y]===e[y]}));-1==n?r.push(e):t.splice(n,1)})),n.props.onReset(a?r.slice(0,1):d(t,r,o),"treeData")}}:t;var c=function(e){"mouseenter"===e.type&&(e.target.style.color=l.color),"mouseleave"===e.type&&(e.target.style.color="")};return O("div",{class:"toolbar-tag",onClick:function(){u(r.method)&&r.method(C,S)},onMouseEnter:c,onMouseLeave:c},e.toolbar.showIcon&&O("i",{class:r.icon}),O("span",null,r.name))})).filter((function(e){return e}))),R=O("div",{class:h?"xm-search":"xm-search dis"},O("i",{class:"xm-iconfont xm-icon-sousuo"}),O("input",{class:"xm-input xm-search-input",placeholder:b}));return j.length||j.push(O("div",{class:"xm-select-empty"},r)),O("div",{onClick:this.blockClick,class:"xm-body-tree"},e.toolbar.show&&A,R,O("div",{class:"scroll-body",style:{maxHeight:e.height}},j),this.state.loading&&O("div",{class:"loading"},O("span",{class:"loader"})))}},{key:"componentDidMount",value:function(){var e=this.base.querySelector(".xm-search-input");e&&(e.addEventListener("compositionstart",this.handleComposition.bind(this)),e.addEventListener("compositionupdate",this.handleComposition.bind(this)),e.addEventListener("compositionend",this.handleComposition.bind(this)),e.addEventListener("input",this.searchInput.bind(this)),this.searchInputRef=e)}},{key:"componentDidUpdate",value:function(){if(this.callback){this.callback=!1;var e=this.props.filterDone;u(e)&&e(this.state.filterValue,this.tempData||[])}}}])&&he(n.prototype,o),r&&he(n,r),t}(E);function ge(e){return(ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _e(e,t){for(var n=0;n1&&(n=n.slice(0,1)),this.setState({sels:n,dataObj:a,flatData:s})}return this.setState({data:o}),n}},{key:"exchangeValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state.dataObj,o=e.map((function(e){return"object"===Re(e)?Ee({},e,{__node:{}}):n[e]})).filter((function(e){return e})),r=!0,i=this.props.tree;return i.show&&!1===i.strict&&(r=!1),r&&(o=o.filter((function(e){return!0!==e[t.props.prop.optgroup]}))),o}},{key:"value",value:function(e,t,n){!1!==t&&!0!==t&&(t=this.state.show);var o=this.props,r=o.prop,i=o.tree,l=this.exchangeValue(e);if(i.show&&i.strict){var a=this.state.data;this.clearAndReset(a,l),l=this.init({data:a,prop:r},!0)}this.resetSelectValue(l,l,!0,n),this.setState({show:t})}},{key:"clearAndReset",value:function(e,t){var n=this,o=this.props.prop,r=o.selected,i=o.children,l=o.value;e.forEach((function(e){e[r]=-1!=t.findIndex((function(t){return t[l]===e[l]}));var o=e[i];o&&c(o)&&n.clearAndReset(o,t)}))}},{key:"load",value:function(e,t,n,o){var r=this,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=this.props,a=l.prop,s=l.tree,u=a.children,p=a.optgroup,d=a.value,f=a.selected,h=a.disabled;e.forEach((function(e){e.__node={parent:o,level:i,loading:e.__node&&e.__node.loading},t[e[d]]=e,n.push(e);var l=e[u];if(l&&c(l)){var a=l.length;if(a>0){r.load(l,t,n,e,i+1),e[p]=!0,s.strict&&(!0===e[f]&&(delete e[f],l.forEach((function(e){return e[f]=!0}))),!0===e[h]&&(delete e[h],l.forEach((function(e){return e[h]=!0}))));var m=l.filter((function(e){return!0===e[f]||!0===e.__node.selected})).length;e.__node.selected=m===a,e.__node.half=m>0&&m0,e.__node.disabled=l.filter((function(e){return!0===e[h]||!0===e.__node.disabled})).length===a}}}))}},{key:"resetSelectValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=this.props.on;if(u(r)&&this.prepare&&o){var i=r({arr:e,change:t,isAdd:n});if(c(i))return this.value(i,null,!1)}this.setState({sels:e})}},{key:"updateBorderColor",value:function(e){this.setState({tmpColor:e})}},{key:"treeHandler",value:function(e,t,n,o){var r=this,i=this.props.prop,l=i.value,a=(i.selected,i.disabled),s=i.children,c=i.optgroup,u=t[s];u.filter((function(e){return!(e[a]||e.__node.disabled)})).forEach((function(t){if(t[c])r.treeHandler(e,t,n,o);else{var i=e.findIndex((function(e){return e[l]==t[l]}));"del"===o?-1!=i&&(e.splice(i,1),n.push(t)):"half"!==o&&"add"!==o||-1==i&&(e.push(t),n.push(t))}}));var p=u.length,d=u.filter((function(t){return-1!==e.findIndex((function(e){return e[l]===t[l]}))||!0===t.__node.selected})).length;t.__node.selected=d===p,t.__node.half=d>0&&d0&&h.length>=g)return this.updateBorderColor(i.maxColor),void(d&&u(d)&&d(h,e));h=a?[e]:[].concat(Se(h),[e]),this.resetSelectValue(h,[e],!t)}else{var _=h.findIndex((function(t){return t[m]==e[m]}));-1!=_&&(h.splice(_,1),this.resetSelectValue(h,[e],!t))}var w,k=e.__node.parent;if(k){for(;k;){var C=k[b],O=C.length,S=C.filter((function(e){return-1!==h.findIndex((function(t){return t[m]===e[m]}))||!0===e.__node.selected})).length;k.__node.selected=S===O,k.__node.half=S>0&&S0,k=k.__node.parent}this.setState({data:this.state.data})}c&&!o&&this.onClick()}}},{key:"onClick",value:function(e){var t=this;if("relative"!==this.props.model.type)if(this.props.disabled)!1!==this.state.show&&this.setState({show:!1});else{var n=!this.state.show;if(n){if(this.props.show&&0==this.props.show())return;Object.keys(He).filter((function(e){return e!=t.props.el})).forEach((function(e){return He[e].closed()}))}else{if(this.props.hide&&0==this.props.hide())return;this.bodyView.scroll&&this.bodyView.scroll(0,0)}this.setState({show:n}),e&&e.stopPropagation()}}},{key:"onReset",value:function(e,t){var n=this;if("data"===t){var o=e.filter((function(e){return!0===e[n.props.prop.selected]}));this.resetSelectValue(d(o,this.state.sels,this.props.prop),o,!0);var r=[];this.load(e,{},r),this.setState({data:e,flatData:r})}else"sels"===t?this.resetSelectValue(e,e,!0):"append"===t?this.append(e):"delete"===t?this.del(e):"auto"===t?this.auto(e):"treeData"===t?this.value(e,null,!0):"close"===t?this.onClick():"class"===t&&this.setState({bodyClass:e})}},{key:"append",value:function(e){var t=this.exchangeValue(e);this.resetSelectValue(d(t,this.state.sels,this.props.prop),t,!0)}},{key:"del",value:function(e){var t=this.props.prop.value,n=this.state.sels;(e=this.exchangeValue(e)).forEach((function(e){var o=n.findIndex((function(n){return n[t]===e[t]}));-1!=o&&n.splice(o,1)})),this.resetSelectValue(n,e,!1)}},{key:"auto",value:function(e){var t=this,n=this.props.prop.value;e.filter((function(e){return-1!=t.state.sels.findIndex((function(t){return t[n]===e[n]}))})).length==e.length?this.del(e):this.append(e)}},{key:"componentWillReceiveProps",value:function(e){this.init(e,e.updateData)}},{key:"componentWillMount",value:function(){this.init(this.props,!0)}},{key:"render",value:function(e,t){var n=this,o=e.theme,r=e.prop,i=(e.radio,e.repeat,e.clickClose,e.on,e.max,e.maxMethod,e.content),l=e.disabled,a=e.tree,s={borderColor:o.color},c=t.data,u=t.dataObj,p=t.flatData,d=t.sels,f=t.show,h=t.tmpColor,m=t.bodyClass;l&&(f=!1);var b={style:Ee({},e.style,{},f?s:{}),onClick:this.onClick.bind(this),ua:-1!=navigator.userAgent.indexOf("Mac OS")?"mac":"win",size:e.size,tabindex:1};h&&(b.style.borderColor=h,setTimeout((function(){b.style.borderColor="",n.updateBorderColor("")}),300)),r.value;var x=Ee({},e,{data:c,sels:d,ck:this.itemClick.bind(this),title:d.map((function(e){return e[r.name]})).join(",")}),y=Ee({},e,{data:c,dataObj:u,flatData:p,sels:d,ck:this.itemClick.bind(this),show:f,onReset:this.onReset.bind(this)}),v=i?O(de,y):a.show?O(ve,y):e.cascader.show?O(Oe,y):O(le,y);return O("xm-select",b,O("input",{class:"xm-select-default","lay-verify":e.layVerify,"lay-verType":e.layVerType,name:e.name,value:d.map((function(e){return e[r.value]})).join(",")}),O("i",{class:f?"xm-icon xm-icon-expand":"xm-icon"}),0===d.length&&O("div",{class:"xm-tips"},e.tips),O(G,x),O("div",{class:["xm-body",m,e.model.type,f?"":"dis"].join(" "),ref:function(e){return n.bodyView=e}},v),l&&O("div",{class:"xm-select-disabled"}))}},{key:"componentDidMount",value:function(){var e=this;this.prepare=!0,this.base.addEventListener("keydown",(function(t){13===t.keyCode&&e.onClick()})),this.input=this.base.querySelector(".xm-select-default");var t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;t&&new t((function(t){t.forEach((function(t){"attributes"==t.type&&"class"===t.attributeName&&-1!==e.input.className.indexOf("layui-form-danger")&&(e.input.className="xm-select-default",e.base.style.borderColor=e.props.theme.maxColor)}))})).observe(this.input,{attributes:!0});for(var n=this.base;n;){if("FORM"===n.tagName){var o=n.querySelector('button[type="reset"]');o&&o.addEventListener("click",(function(t){e.init(e.props,!0)}));break}n=n.parentElement}}},{key:"componentDidUpdate",value:function(){var e=this.props,t=e.direction;if("relative"!==e.model.type){var n=this.base.getBoundingClientRect();if("auto"===t){this.bodyView.style.display="block",this.bodyView.style.visibility="hidden";var o=this.bodyView.getBoundingClientRect().height;this.bodyView.style.display="",this.bodyView.style.visibility="";var r=n.y||n.top||0,i=document.documentElement.clientHeight-r-n.height-20;t=i>o||r0&&void 0!==arguments[0]?arguments[0]:"zn",t=Le[e]||ze;return{language:e,languageProp:t,data:[],content:"",name:"select",layVerify:"",layVerType:"",size:"medium",disabled:!1,initValue:null,create:null,tips:t.tips,empty:t.empty,delay:500,searchTips:t.searchTips,filterable:!1,filterMethod:function(e,t,n,o){return!e||-1!=t[o.name].indexOf(e)},remoteSearch:!1,remoteMethod:function(e,t){t([])},direction:"auto",style:{},height:"200px",autoRow:!1,paging:!1,pageSize:10,pageEmptyShow:!0,pageRemote:!1,radio:!1,repeat:!1,clickClose:!1,max:0,maxMethod:function(e,t){},showCount:0,toolbar:{show:!1,showIcon:!0,list:["ALL","CLEAR"]},tree:{show:!1,showFolderIcon:!0,showLine:!0,indent:20,expandedKeys:[],strict:!0,lazy:!1,load:null,simple:!1},cascader:{show:!1,indent:100,strict:!0},prop:{name:"name",value:"value",selected:"selected",disabled:"disabled",children:"children",optgroup:"optgroup",click:"click"},theme:{color:"#009688",maxColor:"#e54d42",hover:"#f2f2f2"},model:{label:{type:"block",text:{left:"",right:"",separator:", "},block:{showCount:0,showIcon:!0,template:null},count:{template:function(e,t){return"已选中 ".concat(t.length," 项, 共 ").concat(e.length," 项")}}},icon:"show",type:"absolute"},show:function(){},hide:function(){},template:function(e){e.item,e.sels;var t=e.name;return e.value,t},on:function(e){e.arr,e.item,e.selected}}}(e.language),this.update(e)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!!e.data;this.options=p(this.options,e);var n=this.options.dom;if(n){var o=this.options.data||[];if("function"==typeof o&&(o=o(),this.options.data=o),c(o))return K(O(Te,Ve({},this.options,{updateData:t})),n),this;s("data数据必须为数组类型, 不能是".concat("undefined"==typeof data?"undefined":Fe(data),"类型"))}else s("没有找到渲染对象: ".concat(e.el,", 请检查"))}},{key:"reset",value:function(){var e=this.options.el;return this.init(Ke[e]),qe[e].init(this.options,!0),this}},{key:"opened",value:function(){var e=qe[this.options.el];return!e.state.show&&e.onClick(),this}},{key:"closed",value:function(){var e=qe[this.options.el];return e.state.show&&e.onClick(),this}},{key:"getValue",value:function(e){var t=this,n=this.options,o=n.tree,r=n.prop,i=n.data,l=qe[this.options.el].state.sels,a=l;o.show&&o.strict&&o.simple&&f(i,l,a=[],r);var s=h(a,r.children,["__node"]);return"name"===e?s.map((function(e){return e[t.options.prop.name]})):"nameStr"===e?s.map((function(e){return e[t.options.prop.name]})).join(","):"value"===e?s.map((function(e){return e[t.options.prop.value]})):"valueStr"===e?s.map((function(e){return e[t.options.prop.value]})).join(","):s}},{key:"setValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(c(e))return qe[this.options.el].value(this.options.radio?e.slice(0,1):e,t,n),this;s("请传入数组结构...")}},{key:"append",value:function(e){if(c(e))return qe[this.options.el].append(e),this;s("请传入数组结构...")}},{key:"delete",value:function(e){if(c(e))return qe[this.options.el].del(e),this;s("请传入数组结构...")}},{key:"warning",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e||this.options.theme.maxColor;return!0===t?qe[this.options.el].base.style.borderColor=n:qe[this.options.el].updateBorderColor(n),this}}])&&Ue(t.prototype,n),o&&Ue(t,o),e}();function Ne(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +${Scripts.src(zhiqim_iframenav.js)} +${Styles.htmlOverflowHidden()} + + + + + +
            + +
            +
            + ${zhiqim_manager_topnav_left_defined()} +
            +
            + ${zhiqim_manager_topnav_right_defined()} + <#if sessionUser.getOperatorType() lt 2> + + + + +
            +
            + + +
            + + + + + +
            +
            +
            +
              +
            • 首页
            • +
            +
            +
            +
            +
            关闭操作
            +
            +
              +
            • 定位当前选项卡
            • +
            +
              +
            • 关闭全部选项卡
            • +
            • 关闭其他选项卡
            • +
            +
            +
            +
            + + +
            +
            + +
            +
            + + +
            +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/empty.htm b/Yangcai365_web/manage/ztmpl/zhiqim_manager/empty.htm new file mode 100644 index 0000000..47f77b8 --- /dev/null +++ b/Yangcai365_web/manage/ztmpl/zhiqim_manager/empty.htm @@ -0,0 +1 @@ +<#include include/> \ No newline at end of file diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/index.htm b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index.htm new file mode 100644 index 0000000..f653768 --- /dev/null +++ b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index.htm @@ -0,0 +1,177 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Scripts.src(jsencrypt.js)} +${Styles.htmlOverflowHidden()} + + + + + +${Htmls.toCallFrame()} +
            +
            欢迎登录  [ ${context.getContextName()} ]!
            +
            +
            + + + + diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_bg_00.jpg b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_bg_00.jpg new file mode 100644 index 0000000..f93d7c0 Binary files /dev/null and b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_bg_00.jpg differ diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_bg_01.jpg b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_bg_01.jpg new file mode 100644 index 0000000..d4d1f84 Binary files /dev/null and b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_bg_01.jpg differ diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_logo_00.png b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_logo_00.png new file mode 100644 index 0000000..63148c8 Binary files /dev/null and b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_logo_00.png differ diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_logo_01.png b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_logo_01.png new file mode 100644 index 0000000..db4d23f Binary files /dev/null and b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_logo_01.png differ diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_slogan_00.png b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_slogan_00.png new file mode 100644 index 0000000..e3e56c9 Binary files /dev/null and b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_slogan_00.png differ diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_slogan_01.png b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_slogan_01.png new file mode 100644 index 0000000..ef24743 Binary files /dev/null and b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_slogan_01.png differ diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_slogan_02.png b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_slogan_02.png new file mode 100644 index 0000000..3f5254a Binary files /dev/null and b/Yangcai365_web/manage/ztmpl/zhiqim_manager/index_slogan_02.png differ diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/inner.htm b/Yangcai365_web/manage/ztmpl/zhiqim_manager/inner.htm new file mode 100644 index 0000000..e027409 --- /dev/null +++ b/Yangcai365_web/manage/ztmpl/zhiqim_manager/inner.htm @@ -0,0 +1,17 @@ +<#-- 主题变量和函数定义 --> +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} + + + +<#include include/> + + \ No newline at end of file diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/jsencrypt.js b/Yangcai365_web/manage/ztmpl/zhiqim_manager/jsencrypt.js new file mode 100644 index 0000000..cc4ed72 --- /dev/null +++ b/Yangcai365_web/manage/ztmpl/zhiqim_manager/jsencrypt.js @@ -0,0 +1,3 @@ +/*! JSEncrypt v2.3.1 | https://npmcdn.com/jsencrypt@2.3.1/LICENSE.txt */ +(function(a,b){if(typeof define==="function"&&define.amd){define(["exports"],b)}else{if(typeof exports==="object"&&typeof exports.nodeName!=="string"){b(module.exports)}else{b(a)}}})(this,function(ap){var bE;var n=244837814094590;var aV=((n&16777215)==15715070);function bf(z,t,L){if(z!=null){if("number"==typeof z){this.fromNumber(z,t,L)}else{if(t==null&&"string"!=typeof z){this.fromString(z,256)}else{this.fromString(z,t)}}}}function bm(){return new bf(null)}function a7(bX,t,z,bW,bZ,bY){while(--bY>=0){var L=t*this[bX++]+z[bW]+bZ;bZ=Math.floor(L/67108864);z[bW++]=L&67108863}return bZ}function a6(bX,b2,b3,bW,b0,t){var bZ=b2&32767,b1=b2>>15;while(--t>=0){var L=this[bX]&32767;var bY=this[bX++]>>15;var z=b1*L+bY*bZ;L=bZ*L+((z&32767)<<15)+b3[bW]+(b0&1073741823);b0=(L>>>30)+(z>>>15)+b1*bY+(b0>>>30);b3[bW++]=L&1073741823}return b0}function a5(bX,b2,b3,bW,b0,t){var bZ=b2&16383,b1=b2>>14;while(--t>=0){var L=this[bX]&16383;var bY=this[bX++]>>14;var z=b1*L+bY*bZ;L=bZ*L+((z&16383)<<14)+b3[bW]+b0;b0=(L>>28)+(z>>14)+b1*bY;b3[bW++]=L&268435455}return b0}if(aV&&(navigator.appName=="Microsoft Internet Explorer")){bf.prototype.am=a6;bE=30}else{if(aV&&(navigator.appName!="Netscape")){bf.prototype.am=a7;bE=26}else{bf.prototype.am=a5;bE=28}}bf.prototype.DB=bE;bf.prototype.DM=((1<=0;--t){z[t]=this[t]}z.t=this.t;z.s=this.s}function h(t){this.t=1;this.s=(t<0)?-1:0;if(t>0){this[0]=t}else{if(t<-1){this[0]=t+this.DV}else{this.t=0}}}function bi(t){var z=bm();z.fromInt(t);return z}function bI(bZ,z){var bW;if(z==16){bW=4}else{if(z==8){bW=3}else{if(z==256){bW=8}else{if(z==2){bW=1}else{if(z==32){bW=5}else{if(z==4){bW=2}else{this.fromRadix(bZ,z);return}}}}}}this.t=0;this.s=0;var bY=bZ.length,L=false,bX=0;while(--bY>=0){var t=(bW==8)?bZ[bY]&255:aX(bZ,bY);if(t<0){if(bZ.charAt(bY)=="-"){L=true}continue}L=false;if(bX==0){this[this.t++]=t}else{if(bX+bW>this.DB){this[this.t-1]|=(t&((1<<(this.DB-bX))-1))<>(this.DB-bX))}else{this[this.t-1]|=t<=this.DB){bX-=this.DB}}if(bW==8&&(bZ[0]&128)!=0){this.s=-1;if(bX>0){this[this.t-1]|=((1<<(this.DB-bX))-1)<0&&this[this.t-1]==t){--this.t}}function u(z){if(this.s<0){return"-"+this.negate().toString(z)}var L;if(z==16){L=4}else{if(z==8){L=3}else{if(z==2){L=1}else{if(z==32){L=5}else{if(z==4){L=2}else{return this.toRadix(z)}}}}}var bX=(1<0){if(bZ>bZ)>0){t=true;bY=Y(b0)}while(bW>=0){if(bZ>(bZ+=this.DB-L)}else{b0=(this[bW]>>(bZ-=L))&bX;if(bZ<=0){bZ+=this.DB;--bW}}if(b0>0){t=true}if(t){bY+=Y(b0)}}}return t?bY:"0"}function bC(){var t=bm();bf.ZERO.subTo(this,t);return t}function bB(){return(this.s<0)?this.negate():this}function bN(t){var L=this.s-t.s;if(L!=0){return L}var z=this.t;L=z-t.t;if(L!=0){return(this.s<0)?-L:L}while(--z>=0){if((L=this[z]-t[z])!=0){return L}}return 0}function q(z){var bW=1,L;if((L=z>>>16)!=0){z=L;bW+=16}if((L=z>>8)!=0){z=L;bW+=8}if((L=z>>4)!=0){z=L;bW+=4}if((L=z>>2)!=0){z=L;bW+=2}if((L=z>>1)!=0){z=L;bW+=1}return bW}function bt(){if(this.t<=0){return 0}return this.DB*(this.t-1)+q(this[this.t-1]^(this.s&this.DM))}function bv(L,z){var t;for(t=this.t-1;t>=0;--t){z[t+L]=this[t]}for(t=L-1;t>=0;--t){z[t]=0}z.t=this.t+L;z.s=this.s}function a2(L,z){for(var t=L;t=0;--L){bW[L+bX+1]=(this[L]>>t)|bZ;bZ=(this[L]&bY)<=0;--L){bW[L]=0}bW[bX]=bZ;bW.t=this.t+bX+1;bW.s=this.s;bW.clamp()}function bT(bZ,bW){bW.s=this.s;var bX=Math.floor(bZ/this.DB);if(bX>=this.t){bW.t=0;return}var z=bZ%this.DB;var t=this.DB-z;var bY=(1<>z;for(var L=bX+1;L>z}if(z>0){bW[this.t-bX-1]|=(this.s&bY)<>=this.DB}if(z.t>=this.DB}bX+=this.s}else{bX+=this.s;while(L>=this.DB}bX-=z.s}bW.s=(bX<0)?-1:0;if(bX<-1){bW[L++]=this.DV+bX}else{if(bX>0){bW[L++]=bX}}bW.t=L;bW.clamp()}function bJ(z,bW){var t=this.abs(),bX=z.abs();var L=t.t;bW.t=L+bX.t;while(--L>=0){bW[L]=0}for(L=0;L=0){L[z]=0}for(z=0;z=t.DV){L[z+t.t]-=t.DV;L[z+t.t+1]=1}}if(L.t>0){L[L.t-1]+=t.am(z,t[z],L,2*z,0,1)}L.s=0;L.clamp()}function a9(b3,b0,bZ){var b9=b3.abs();if(b9.t<=0){return}var b1=this.abs();if(b1.t0){b9.lShiftTo(b8,bX);b1.lShiftTo(b8,bZ)}else{b9.copyTo(bX);b1.copyTo(bZ)}var b5=bX.t;var L=bX[b5-1];if(L==0){return}var b4=L*(1<1)?bX[b5-2]>>this.F2:0);var cc=this.FV/b4,cb=(1<=0){bZ[bZ.t++]=1;bZ.subTo(bY,bZ)}bf.ONE.dlShiftTo(b5,bY);bY.subTo(bX,bX);while(bX.t=0){var bW=(bZ[--b7]==L)?this.DM:Math.floor(bZ[b7]*cc+(bZ[b7-1]+ca)*cb);if((bZ[b7]+=bX.am(0,bW,bZ,b6,0,b5))0){bZ.rShiftTo(b8,bZ)}if(z<0){bf.ZERO.subTo(bZ,bZ)}}function bh(t){var z=bm();this.abs().divRemTo(t,null,z);if(this.s<0&&z.compareTo(bf.ZERO)>0){t.subTo(z,z)}return z}function aT(t){this.m=t}function aI(t){if(t.s<0||t.compareTo(this.m)>=0){return t.mod(this.m)}else{return t}}function c(t){return t}function V(t){t.divRemTo(this.m,null,t)}function p(t,L,z){t.multiplyTo(L,z);this.reduce(z)}function aF(t,z){t.squareTo(z);this.reduce(z)}aT.prototype.convert=aI;aT.prototype.revert=c;aT.prototype.reduce=V;aT.prototype.mulTo=p;aT.prototype.sqrTo=aF;function ab(){if(this.t<1){return 0}var t=this[0];if((t&1)==0){return 0}var z=t&3;z=(z*(2-(t&15)*z))&15;z=(z*(2-(t&255)*z))&255;z=(z*(2-(((t&65535)*z)&65535)))&65535;z=(z*(2-t*z%this.DV))%this.DV;return(z>0)?this.DV-z:-z}function K(t){this.m=t;this.mp=t.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<(t.DB-15))-1;this.mt2=2*t.t}function by(t){var z=bm();t.abs().dlShiftTo(this.m.t,z);z.divRemTo(this.m,null,z);if(t.s<0&&z.compareTo(bf.ZERO)>0){this.m.subTo(z,z)}return z}function bl(t){var z=bm();t.copyTo(z);this.reduce(z);return z}function bV(t){while(t.t<=this.mt2){t[t.t++]=0}for(var L=0;L>15)*this.mpl)&this.um)<<15))&t.DM;z=L+this.m.t;t[z]+=this.m.am(0,bW,t,L,0,this.m.t);while(t[z]>=t.DV){t[z]-=t.DV;t[++z]++}}t.clamp();t.drShiftTo(this.m.t,t);if(t.compareTo(this.m)>=0){t.subTo(this.m,t)}}function ac(t,z){t.squareTo(z);this.reduce(z)}function bz(t,L,z){t.multiplyTo(L,z);this.reduce(z)}K.prototype.convert=by;K.prototype.revert=bl;K.prototype.reduce=bV;K.prototype.mulTo=bz;K.prototype.sqrTo=ac;function ad(){return((this.t>0)?(this[0]&1):this.s)==0}function am(b0,b1){if(b0>4294967295||b0<1){return bf.ONE}var bZ=bm(),L=bm(),bY=b1.convert(this),bX=q(b0)-1;bY.copyTo(bZ);while(--bX>=0){b1.sqrTo(bZ,L);if((b0&(1<0){b1.mulTo(L,bY,bZ)}else{var bW=bZ;bZ=L;L=bW}}return b1.revert(bZ)}function aG(L,t){var bW;if(L<256||t.isEven()){bW=new aT(t)}else{bW=new K(t)}return this.exp(L,bW)}bf.prototype.copyTo=d;bf.prototype.fromInt=h;bf.prototype.fromString=bI;bf.prototype.clamp=bA;bf.prototype.dlShiftTo=bv;bf.prototype.drShiftTo=a2;bf.prototype.lShiftTo=s;bf.prototype.rShiftTo=bT;bf.prototype.subTo=bs;bf.prototype.multiplyTo=bJ;bf.prototype.squareTo=au;bf.prototype.divRemTo=a9;bf.prototype.invDigit=ab;bf.prototype.isEven=ad;bf.prototype.exp=am;bf.prototype.toString=u;bf.prototype.negate=bC;bf.prototype.abs=bB;bf.prototype.compareTo=bN;bf.prototype.bitLength=bt;bf.prototype.mod=bh;bf.prototype.modPowInt=aG;bf.ZERO=bi(0);bf.ONE=bi(1);function f(){var t=bm();this.copyTo(t);return t}function b(){if(this.s<0){if(this.t==1){return this[0]-this.DV}else{if(this.t==0){return -1}}}else{if(this.t==1){return this[0]}else{if(this.t==0){return 0}}}return((this[1]&((1<<(32-this.DB))-1))<>24}function ag(){return(this.t==0)?this.s:(this[0]<<16)>>16}function aU(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function aZ(){if(this.s<0){return -1}else{if(this.t<=0||(this.t==1&&this[0]<=0)){return 0}else{return 1}}}function I(t){if(t==null){t=10}if(this.signum()==0||t<2||t>36){return"0"}var bW=this.chunkSize(t);var L=Math.pow(t,bW);var bZ=bi(L),b0=bm(),bY=bm(),bX="";this.divRemTo(bZ,b0,bY);while(b0.signum()>0){bX=(L+bY.intValue()).toString(t).substr(1)+bX;b0.divRemTo(bZ,b0,bY)}return bY.intValue().toString(t)+bX}function av(b1,bY){this.fromInt(0);if(bY==null){bY=10}var bW=this.chunkSize(bY);var bX=Math.pow(bY,bW),L=false,t=0,b0=0;for(var z=0;z=bW){this.dMultiply(bX);this.dAddOffset(b0,0);t=0;b0=0}}if(t>0){this.dMultiply(Math.pow(bY,t));this.dAddOffset(b0,0)}if(L){bf.ZERO.subTo(this,this)}}function aP(bW,L,bY){if("number"==typeof L){if(bW<2){this.fromInt(1)}else{this.fromNumber(bW,bY);if(!this.testBit(bW-1)){this.bitwiseTo(bf.ONE.shiftLeft(bW-1),ak,this)}if(this.isEven()){this.dAddOffset(1,0)}while(!this.isProbablePrime(L)){this.dAddOffset(2,0);if(this.bitLength()>bW){this.subTo(bf.ONE.shiftLeft(bW-1),this)}}}}else{var z=new Array(),bX=bW&7;z.length=(bW>>3)+1;L.nextBytes(z);if(bX>0){z[0]&=((1<0){if(bW>bW)!=(this.s&this.DM)>>bW){L[t++]=bX|(this.s<<(this.DB-bW))}while(z>=0){if(bW<8){bX=(this[z]&((1<>(bW+=this.DB-8)}else{bX=(this[z]>>(bW-=8))&255;if(bW<=0){bW+=this.DB;--z}}if((bX&128)!=0){bX|=-256}if(t==0&&(this.s&128)!=(bX&128)){++t}if(t>0||bX!=this.s){L[t++]=bX}}}return L}function bG(t){return(this.compareTo(t)==0)}function W(t){return(this.compareTo(t)<0)?this:t}function bu(t){return(this.compareTo(t)>0)?this:t}function aJ(z,bY,bW){var L,bX,t=Math.min(z.t,this.t);for(L=0;L>=16;z+=16}if((t&255)==0){t>>=8;z+=8}if((t&15)==0){t>>=4;z+=4}if((t&3)==0){t>>=2;z+=2}if((t&1)==0){++z}return z}function aq(){for(var t=0;t=this.t){return(this.s!=0)}return((this[t]&(1<<(z%this.DB)))!=0)}function U(L,z){var t=bf.ONE.shiftLeft(L);this.bitwiseTo(t,z,t);return t}function a1(t){return this.changeBit(t,ak)}function ah(t){return this.changeBit(t,i)}function aO(t){return this.changeBit(t,aa)}function S(z,bW){var L=0,bX=0,t=Math.min(z.t,this.t);while(L>=this.DB}if(z.t>=this.DB}bX+=this.s}else{bX+=this.s;while(L>=this.DB}bX+=z.s}bW.s=(bX<0)?-1:0;if(bX>0){bW[L++]=bX}else{if(bX<-1){bW[L++]=this.DV+bX}}bW.t=L;bW.clamp()}function bg(t){var z=bm();this.addTo(t,z);return z}function aA(t){var z=bm();this.subTo(t,z);return z}function bH(t){var z=bm();this.multiplyTo(t,z);return z}function bU(){var t=bm();this.squareTo(t);return t}function bd(t){var z=bm();this.divRemTo(t,z,null);return z}function bP(t){var z=bm();this.divRemTo(t,null,z);return z}function bk(t){var L=bm(),z=bm();this.divRemTo(t,L,z);return new Array(L,z)}function e(t){this[this.t]=this.am(0,t-1,this,0,0,this.t);++this.t;this.clamp()}function aR(z,t){if(z==0){return}while(this.t<=t){this[this.t++]=0}this[t]+=z;while(this[t]>=this.DV){this[t]-=this.DV;if(++t>=this.t){this[this.t++]=0}++this[t]}}function Z(){}function bw(t){return t}function bK(t,L,z){t.multiplyTo(L,z)}function ai(t,z){t.squareTo(z)}Z.prototype.convert=bw;Z.prototype.revert=bw;Z.prototype.mulTo=bK;Z.prototype.sqrTo=ai;function Q(t){return this.exp(t,new Z())}function aQ(t,bX,bW){var L=Math.min(this.t+t.t,bX);bW.s=0;bW.t=L;while(L>0){bW[--L]=0}var z;for(z=bW.t-this.t;L=0){L[z]=0}for(z=Math.max(bW-this.t,0);z2*this.m.t){return t.mod(this.m)}else{if(t.compareTo(this.m)<0){return t}else{var z=bm();t.copyTo(z);this.reduce(z);return z}}}function bM(t){return t}function D(t){t.drShiftTo(this.m.t-1,this.r2);if(t.t>this.m.t+1){t.t=this.m.t+1;t.clamp()}this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(t.compareTo(this.r2)<0){t.dAddOffset(1,this.m.t+1)}t.subTo(this.r2,t);while(t.compareTo(this.m)>=0){t.subTo(this.m,t)}}function aM(t,z){t.squareTo(z);this.reduce(z)}function x(t,L,z){t.multiplyTo(L,z);this.reduce(z)}bR.prototype.convert=H;bR.prototype.revert=bM;bR.prototype.reduce=D;bR.prototype.mulTo=x;bR.prototype.sqrTo=aM;function N(b4,bZ){var b2=b4.bitLength(),b0,bW=bi(1),b7;if(b2<=0){return bW}else{if(b2<18){b0=1}else{if(b2<48){b0=3}else{if(b2<144){b0=4}else{if(b2<768){b0=5}else{b0=6}}}}}if(b2<8){b7=new aT(bZ)}else{if(bZ.isEven()){b7=new bR(bZ)}else{b7=new K(bZ)}}var b3=new Array(),bY=3,b5=b0-1,L=(1<1){var ca=bm();b7.sqrTo(b3[1],ca);while(bY<=L){b3[bY]=bm();b7.mulTo(ca,b3[bY-2],b3[bY]);bY+=2}}var b1=b4.t-1,b8,b6=true,bX=bm(),b9;b2=q(b4[b1])-1;while(b1>=0){if(b2>=b5){b8=(b4[b1]>>(b2-b5))&L}else{b8=(b4[b1]&((1<<(b2+1))-1))<<(b5-b2);if(b1>0){b8|=b4[b1-1]>>(this.DB+b2-b5)}}bY=b0;while((b8&1)==0){b8>>=1;--bY}if((b2-=bY)<0){b2+=this.DB;--b1}if(b6){b3[b8].copyTo(bW);b6=false}else{while(bY>1){b7.sqrTo(bW,bX);b7.sqrTo(bX,bW);bY-=2}if(bY>0){b7.sqrTo(bW,bX)}else{b9=bW;bW=bX;bX=b9}b7.mulTo(bX,b3[b8],bW)}while(b1>=0&&(b4[b1]&(1<0){z.rShiftTo(bY,z);bZ.rShiftTo(bY,bZ)}while(z.signum()>0){if((bW=z.getLowestSetBit())>0){z.rShiftTo(bW,z)}if((bW=bZ.getLowestSetBit())>0){bZ.rShiftTo(bW,bZ)}if(z.compareTo(bZ)>=0){z.subTo(bZ,z);z.rShiftTo(1,z)}else{bZ.subTo(z,bZ);bZ.rShiftTo(1,bZ)}}if(bY>0){bZ.lShiftTo(bY,bZ)}return bZ}function aj(bW){if(bW<=0){return 0}var L=this.DV%bW,z=(this.s<0)?bW-1:0;if(this.t>0){if(L==0){z=this[0]%bW}else{for(var t=this.t-1;t>=0;--t){z=(L*z+this[t])%bW}}}return z}function bS(z){var bY=z.isEven();if((this.isEven()&&bY)||z.signum()==0){return bf.ZERO}var bX=z.clone(),bW=this.clone();var L=bi(1),t=bi(0),b0=bi(0),bZ=bi(1);while(bX.signum()!=0){while(bX.isEven()){bX.rShiftTo(1,bX);if(bY){if(!L.isEven()||!t.isEven()){L.addTo(this,L);t.subTo(z,t)}L.rShiftTo(1,L)}else{if(!t.isEven()){t.subTo(z,t)}}t.rShiftTo(1,t)}while(bW.isEven()){bW.rShiftTo(1,bW);if(bY){if(!b0.isEven()||!bZ.isEven()){b0.addTo(this,b0);bZ.subTo(z,bZ)}b0.rShiftTo(1,b0)}else{if(!bZ.isEven()){bZ.subTo(z,bZ)}}bZ.rShiftTo(1,bZ)}if(bX.compareTo(bW)>=0){bX.subTo(bW,bX);if(bY){L.subTo(b0,L)}t.subTo(bZ,t)}else{bW.subTo(bX,bW);if(bY){b0.subTo(L,b0)}bZ.subTo(t,bZ)}}if(bW.compareTo(bf.ONE)!=0){return bf.ZERO}if(bZ.compareTo(z)>=0){return bZ.subtract(z)}if(bZ.signum()<0){bZ.addTo(z,bZ)}else{return bZ}if(bZ.signum()<0){return bZ.add(z)}else{return bZ}}var az=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];var k=(1<<26)/az[az.length-1];function bL(bY){var bX,L=this.abs();if(L.t==1&&L[0]<=az[az.length-1]){for(bX=0;bX>1;if(bY>az.length){bY=az.length}var z=bm();for(var bX=0;bX=256||C>=y){if(window.removeEventListener){window.removeEventListener("mousemove",F,false)}else{if(window.detachEvent){window.detachEvent("onmousemove",F)}}return}try{var t=z.x+z.y;l[C++]=t&255;this.count+=1}catch(L){}};if(window.addEventListener){window.addEventListener("mousemove",F,false)}else{if(window.attachEvent){window.attachEvent("onmousemove",F)}}}function bb(){if(j==null){j=P();while(C=0&&bZ>0){var bX=bW.charCodeAt(L--);if(bX<128){bY[--bZ]=bX}else{if((bX>127)&&(bX<2048)){bY[--bZ]=(bX&63)|128;bY[--bZ]=(bX>>6)|192}else{bY[--bZ]=(bX&63)|128;bY[--bZ]=((bX>>6)&63)|128;bY[--bZ]=(bX>>12)|224}}}bY[--bZ]=0;var z=new G();var t=new Array();while(bZ>2){t[0]=0;while(t[0]==0){z.nextBytes(t)}bY[--bZ]=t[0]}bY[--bZ]=2;bY[--bZ]=0;return new bf(bY)}function A(){this.n=null;this.e=0;this.d=null;this.p=null;this.q=null;this.dmp1=null;this.dmq1=null;this.coeff=null}function an(z,t){if(z!=null&&t!=null&&z.length>0&&t.length>0){this.n=w(z,16);this.e=parseInt(t,16)}else{console.error("Invalid RSA public key")}}function bq(t){return t.modPowInt(this.e,this.n)}function al(L){var t=bD(L,(this.n.bitLength()+7)>>3);if(t==null){return null}var bW=this.doPublic(t);if(bW==null){return null}var z=bW.toString(16);if((z.length&1)==0){return z}else{return"0"+z}}A.prototype.doPublic=bq;A.prototype.setPublic=an;A.prototype.encrypt=al;function bo(bW,bY){var t=bW.toByteArray();var L=0;while(L=t.length){return null}}var z="";while(++L191)&&(bX<224)){z+=String.fromCharCode(((bX&31)<<6)|(t[L+1]&63));++L}else{z+=String.fromCharCode(((bX&15)<<12)|((t[L+1]&63)<<6)|(t[L+2]&63));L+=2}}}return z}function aC(L,t,z){if(L!=null&&t!=null&&L.length>0&&t.length>0){this.n=w(L,16);this.e=parseInt(t,16);this.d=w(z,16)}else{console.error("Invalid RSA private key")}}function O(bZ,bW,bX,L,z,t,b0,bY){if(bZ!=null&&bW!=null&&bZ.length>0&&bW.length>0){this.n=w(bZ,16);this.e=parseInt(bW,16);this.d=w(bX,16);this.p=w(L,16);this.q=w(z,16);this.dmp1=w(t,16);this.dmq1=w(b0,16);this.coeff=w(bY,16)}else{console.error("Invalid RSA private key")}}function ax(L,b2){var z=new G();var bZ=L>>1;this.e=parseInt(b2,16);var bW=new bf(b2,16);for(;;){for(;;){this.p=new bf(L-bZ,1,z);if(this.p.subtract(bf.ONE).gcd(bW).compareTo(bf.ONE)==0&&this.p.isProbablePrime(10)){break}}for(;;){this.q=new bf(bZ,1,z);if(this.q.subtract(bf.ONE).gcd(bW).compareTo(bf.ONE)==0&&this.q.isProbablePrime(10)){break}}if(this.p.compareTo(this.q)<=0){var b1=this.p;this.p=this.q;this.q=b1}var b0=this.p.subtract(bf.ONE);var bX=this.q.subtract(bf.ONE);var bY=b0.multiply(bX);if(bY.gcd(bW).compareTo(bf.ONE)==0){this.n=this.p.multiply(this.q);this.d=bW.modInverse(bY);this.dmp1=this.d.mod(b0);this.dmq1=this.d.mod(bX);this.coeff=this.q.modInverse(this.p);break}}}function ay(t){if(this.p==null||this.q==null){return t.modPow(this.d,this.n)}var L=t.mod(this.p).modPow(this.dmp1,this.p);var z=t.mod(this.q).modPow(this.dmq1,this.q);while(L.compareTo(z)<0){L=L.add(this.p)}return L.subtract(z).multiply(this.coeff).mod(this.p).multiply(this.q).add(z)}function r(z){var L=w(z,16);var t=this.doPrivate(L);if(t==null){return null}return bo(t,(this.n.bitLength()+7)>>3)}A.prototype.doPrivate=ay;A.prototype.setPrivate=aC;A.prototype.setPrivateEx=O;A.prototype.generate=ax;A.prototype.decrypt=r;(function(){var z=function(b3,b1,b2){var bZ=new G();var bW=b3>>1;this.e=parseInt(b1,16);var bY=new bf(b1,16);var b0=this;var bX=function(){var b5=function(){if(b0.p.compareTo(b0.q)<=0){var b8=b0.p;b0.p=b0.q;b0.q=b8}var ca=b0.p.subtract(bf.ONE);var b7=b0.q.subtract(bf.ONE);var b9=ca.multiply(b7);if(b9.gcd(bY).compareTo(bf.ONE)==0){b0.n=b0.p.multiply(b0.q);b0.d=bY.modInverse(b9);b0.dmp1=b0.d.mod(ca);b0.dmq1=b0.d.mod(b7);b0.coeff=b0.q.modInverse(b0.p);setTimeout(function(){b2()},0)}else{setTimeout(bX,0)}};var b6=function(){b0.q=bm();b0.q.fromNumberAsync(bW,1,bZ,function(){b0.q.subtract(bf.ONE).gcda(bY,function(b7){if(b7.compareTo(bf.ONE)==0&&b0.q.isProbablePrime(10)){setTimeout(b5,0)}else{setTimeout(b6,0)}})})};var b4=function(){b0.p=bm();b0.p.fromNumberAsync(b3-bW,1,bZ,function(){b0.p.subtract(bf.ONE).gcda(bY,function(b7){if(b7.compareTo(bf.ONE)==0&&b0.p.isProbablePrime(10)){setTimeout(b6,0)}else{setTimeout(b4,0)}})})};setTimeout(b4,0)};setTimeout(bX,0)};A.prototype.generateAsync=z;var t=function(bX,b3){var bW=(this.s<0)?this.negate():this.clone();var b2=(bX.s<0)?bX.negate():bX.clone();if(bW.compareTo(b2)<0){var bZ=bW;bW=b2;b2=bZ}var bY=bW.getLowestSetBit(),b0=b2.getLowestSetBit();if(b0<0){b3(bW);return}if(bY0){bW.rShiftTo(b0,bW);b2.rShiftTo(b0,b2)}var b1=function(){if((bY=bW.getLowestSetBit())>0){bW.rShiftTo(bY,bW)}if((bY=b2.getLowestSetBit())>0){b2.rShiftTo(bY,b2)}if(bW.compareTo(b2)>=0){bW.subTo(b2,bW);bW.rShiftTo(1,bW)}else{b2.subTo(bW,b2);b2.rShiftTo(1,b2)}if(!(bW.signum()>0)){if(b0>0){b2.lShiftTo(b0,b2)}setTimeout(function(){b3(b2)},0)}else{setTimeout(b1,0)}};setTimeout(b1,10)};bf.prototype.gcda=t;var L=function(b0,bX,b3,b2){if("number"==typeof bX){if(b0<2){this.fromInt(1)}else{this.fromNumber(b0,b3);if(!this.testBit(b0-1)){this.bitwiseTo(bf.ONE.shiftLeft(b0-1),ak,this)}if(this.isEven()){this.dAddOffset(1,0)}var bZ=this;var bY=function(){bZ.dAddOffset(2,0);if(bZ.bitLength()>b0){bZ.subTo(bf.ONE.shiftLeft(b0-1),bZ)}if(bZ.isProbablePrime(bX)){setTimeout(function(){b2()},0)}else{setTimeout(bY,0)}};setTimeout(bY,0)}}else{var bW=new Array(),b1=b0&7;bW.length=(b0>>3)+1;bX.nextBytes(bW);if(b1>0){bW[0]&=((1<>6)+a4.charAt(bW&63)}if(z+1==L.length){bW=parseInt(L.substring(z,z+1),16);t+=a4.charAt(bW<<2)}else{if(z+2==L.length){bW=parseInt(L.substring(z,z+2),16);t+=a4.charAt(bW>>2)+a4.charAt((bW&3)<<4)}}while((t.length&3)>0){t+=J}return t}function aW(bX){var L="";var bW;var t=0;var z;for(bW=0;bW>2);z=v&3;t=1}else{if(t==1){L+=Y((z<<2)|(v>>4));z=v&15;t=2}else{if(t==2){L+=Y(z);L+=Y(v>>2);z=v&3;t=3}else{L+=Y((z<<2)|(v>>4));L+=Y(v&15);t=0}}}}if(t==1){L+=Y(z<<2)}return L}function M(bW){var L=aW(bW);var z;var t=new Array();for(z=0;2*z15){throw"ASN.1 length too long to represent by 8x: n = "+b1.toString(16)}var bY=128+bZ;return bY.toString(16)+b0}};this.getEncodedHex=function(){if(this.hTLV==null||this.isModified){this.hV=this.getFreshValueHex();this.hL=this.getLengthHexFromValue();this.hTLV=this.hT+this.hL+this.hV;this.isModified=false}return this.hTLV};this.getValueHex=function(){this.getEncodedHex();return this.hV};this.getFreshValueHex=function(){return""}};KJUR.asn1.DERAbstractString=function(L){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);var z=null;var t=null;this.getString=function(){return this.s};this.setString=function(bW){this.hTLV=null;this.isModified=true;this.s=bW;this.hV=stohex(this.s)};this.setStringHex=function(bW){this.hTLV=null;this.isModified=true;this.s=null;this.hV=bW};this.getFreshValueHex=function(){return this.hV};if(typeof L!="undefined"){if(typeof L.str!="undefined"){this.setString(L.str)}else{if(typeof L.hex!="undefined"){this.setStringHex(L.hex)}}}};at.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object);KJUR.asn1.DERAbstractTime=function(L){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);var z=null;var t=null;this.localDateToUTC=function(bX){utc=bX.getTime()+(bX.getTimezoneOffset()*60000);var bW=new Date(utc);return bW};this.formatDate=function(b1,b3){var bW=this.zeroPadding;var b2=this.localDateToUTC(b1);var b4=String(b2.getFullYear());if(b3=="utc"){b4=b4.substr(2,2)}var b0=bW(String(b2.getMonth()+1),2);var b5=bW(String(b2.getDate()),2);var bX=bW(String(b2.getHours()),2);var bY=bW(String(b2.getMinutes()),2);var bZ=bW(String(b2.getSeconds()),2);return b4+b0+b5+bX+bY+bZ+"Z"};this.zeroPadding=function(bX,bW){if(bX.length>=bW){return bX}return new Array(bW-bX.length+1).join("0")+bX};this.getString=function(){return this.s};this.setString=function(bW){this.hTLV=null;this.isModified=true;this.s=bW;this.hV=stohex(this.s)};this.setByDateValue=function(b0,b2,bX,bW,bY,bZ){var b1=new Date(Date.UTC(b0,b2-1,bX,bW,bY,bZ,0));this.setByDate(b1)};this.getFreshValueHex=function(){return this.hV}};at.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object);KJUR.asn1.DERAbstractStructured=function(z){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);var t=null;this.setByASN1ObjectArray=function(L){this.hTLV=null;this.isModified=true;this.asn1Array=L};this.appendASN1Object=function(L){this.hTLV=null;this.isModified=true;this.asn1Array.push(L)};this.asn1Array=new Array();if(typeof z!="undefined"){if(typeof z.array!="undefined"){this.asn1Array=z.array}}};at.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object);KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff"};at.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(t){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(z){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(z)};this.setByInteger=function(L){var z=new bf(String(L),10);this.setByBigInteger(z)};this.setValueHex=function(z){this.hV=z};this.getFreshValueHex=function(){return this.hV};if(typeof t!="undefined"){if(typeof t.bigint!="undefined"){this.setByBigInteger(t.bigint)}else{if(typeof t["int"]!="undefined"){this.setByInteger(t["int"])}else{if(typeof t.hex!="undefined"){this.setValueHex(t.hex)}}}}};at.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object);KJUR.asn1.DERBitString=function(t){KJUR.asn1.DERBitString.superclass.constructor.call(this);this.hT="03";this.setHexValueIncludingUnusedBits=function(z){this.hTLV=null;this.isModified=true;this.hV=z};this.setUnusedBitsAndHexValue=function(z,bW){if(z<0||7=2){bX[bX.length]=b0;b0=0;b2=0}else{b0<<=4}}if(b2){throw"Hex encoding incomplete: 4 bits missing"}return bX};window.Hex=t})();(function(z){var t={},L;t.decode=function(bW){var bZ;if(L===z){var bY="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b3="= \f\n\r\t\u00A0\u2028\u2029";L=[];for(bZ=0;bZ<64;++bZ){L[bY.charAt(bZ)]=bZ}for(bZ=0;bZ=4){bX[bX.length]=(b0>>16);bX[bX.length]=(b0>>8)&255;bX[bX.length]=b0&255;b0=0;b2=0}else{b0<<=6}}switch(b2){case 1:throw"Base64 encoding incomplete: at least 2 bits missing";case 2:bX[bX.length]=(b0>>10);break;case 3:bX[bX.length]=(b0>>16);bX[bX.length]=(b0>>8)&255;break}return bX};t.re=/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/;t.unarmor=function(bX){var bW=t.re.exec(bX);if(bW){if(bW[1]){bX=bW[1]}else{if(bW[2]){bX=bW[2]}else{throw"RegExp out of sync"}}}return t.decode(bX)};window.Base64=t})();(function(bY){var z=100,t="\u2026",L={tag:function(b0,b1){var bZ=document.createElement(b0);bZ.className=b1;return bZ},text:function(bZ){return document.createTextNode(bZ)}};function bX(bZ,b0){if(bZ instanceof bX){this.enc=bZ.enc;this.pos=bZ.pos}else{this.enc=bZ;this.pos=b0}}bX.prototype.get=function(bZ){if(bZ===bY){bZ=this.pos++}if(bZ>=this.enc.length){throw"Requesting byte offset "+bZ+" on a stream of length "+this.enc.length}return this.enc[bZ]};bX.prototype.hexDigits="0123456789ABCDEF";bX.prototype.hexByte=function(bZ){return this.hexDigits.charAt((bZ>>4)&15)+this.hexDigits.charAt(bZ&15)};bX.prototype.hexDump=function(b3,bZ,b0){var b2="";for(var b1=b3;b1191)&&(b2<224)){b1+=String.fromCharCode(((b2&31)<<6)|(this.get(b0++)&63))}else{b1+=String.fromCharCode(((b2&15)<<12)|((this.get(b0++)&63)<<6)|(this.get(b0++)&63))}}}return b1};bX.prototype.parseStringBMP=function(b4,b0){var b3="";for(var b2=b4;b24){bZ<<=3;var b2=this.get(b4);if(b2===0){bZ-=8}else{while(b2<128){b2<<=1;--bZ}}return"("+bZ+" bit)"}var b3=0;for(var b1=b4;b1bZ;--b3){var b5=this.get(b3);for(var b1=b6;b1<8;++b1){b7+=(b5>>b1)&1?"1":"0"}b6=0}}return b7};bX.prototype.parseOctetString=function(b3,b0){var bZ=b0-b3,b2="("+bZ+" byte) ";if(bZ>z){b0=b3+z}for(var b1=b3;b1z){b2+=t}return b2};bX.prototype.parseOID=function(b6,b0){var b3="",b5=0,b4=0;for(var b2=b6;b2=31)?"bigint":b5)}b5=b4=0}}return b3};function bW(b2,b3,b1,bZ,b0){this.stream=b2;this.header=b3;this.length=b1;this.tag=bZ;this.sub=b0}bW.prototype.typeName=function(){if(this.tag===bY){return"unknown"}var b1=this.tag>>6,bZ=(this.tag>>5)&1,b0=this.tag&31;switch(b1){case 0:switch(b0){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString";default:return"Universal_"+b0.toString(16)}case 1:return"Application_"+b0.toString(16);case 2:return"["+b0+"]";case 3:return"Private_"+b0.toString(16)}};bW.prototype.reSeemsASCII=/^[ -~]+$/;bW.prototype.content=function(){if(this.tag===bY){return null}var b3=this.tag>>6,b0=this.tag&31,b2=this.posContent(),bZ=Math.abs(this.length);if(b3!==0){if(this.sub!==null){return"("+this.sub.length+" elem)"}var b1=this.stream.parseStringISO(b2,b2+Math.min(bZ,z));if(this.reSeemsASCII.test(b1)){return b1.substring(0,2*z)+((b1.length>2*z)?t:"")}else{return this.stream.parseOctetString(b2,b2+bZ)}}switch(b0){case 1:return(this.stream.get(b2)===0)?"false":"true";case 2:return this.stream.parseInteger(b2,b2+bZ);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(b2,b2+bZ);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(b2,b2+bZ);case 6:return this.stream.parseOID(b2,b2+bZ);case 16:case 17:return"("+this.sub.length+" elem)";case 12:return this.stream.parseStringUTF(b2,b2+bZ);case 18:case 19:case 20:case 21:case 22:case 26:return this.stream.parseStringISO(b2,b2+bZ);case 30:return this.stream.parseStringBMP(b2,b2+bZ);case 23:case 24:return this.stream.parseTime(b2,b2+bZ)}return null};bW.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+((this.sub===null)?"null":this.sub.length)+"]"};bW.prototype.print=function(b0){if(b0===bY){b0=""}document.writeln(b0+this);if(this.sub!==null){b0+=" ";for(var b1=0,bZ=this.sub.length;b1=0){b2+="+"}b2+=this.length;if(this.tag&32){b2+=" (constructed)"}else{if(((this.tag==3)||(this.tag==4))&&(this.sub!==null)){b2+=" (encapsulates)"}}b2+="\n";if(this.sub!==null){b0+=" ";for(var b1=0,bZ=this.sub.length;b1";b8+="Length: "+this.header+"+";if(this.length>=0){b8+=this.length}else{b8+=(-this.length)+" (undefined)"}if(this.tag&32){b8+="
            (constructed)"}else{if(((this.tag==3)||(this.tag==4))&&(this.sub!==null)){b8+="
            (encapsulates)"}}if(b4!==null){b8+="
            Value:
            "+b4+"";if((typeof oids==="object")&&(this.tag==6)){var b1=oids[b4];if(b1){if(b1.d){b8+="
            "+b1.d}if(b1.c){b8+="
            "+b1.c}if(b1.w){b8+="
            (warning!)"}}}}b7.innerHTML=b8;b0.appendChild(b7);var bZ=L.tag("div","sub");if(this.sub!==null){for(var b2=0,b5=this.sub.length;b2=bZ){return}var b0=L.tag("span",b1);b0.appendChild(L.text(b3.hexDump(b4,bZ)));b2.appendChild(b0)};bW.prototype.toHexDOM=function(b0){var b3=L.tag("span","hex");if(b0===bY){b0=b3}this.head.hexNode=b3;this.head.onmouseover=function(){this.hexNode.className="hexCurrent"};this.head.onmouseout=function(){this.hexNode.className="hex"};b3.asn1=this;b3.onmouseover=function(){var b5=!b0.selected;if(b5){b0.selected=this.asn1;this.className="hexCurrent"}this.asn1.fakeHover(b5)};b3.onmouseout=function(){var b5=(b0.selected==this.asn1);this.asn1.fakeOut(b5);if(b5){b0.selected=null;this.className="hex"}};this.toHexDOM_sub(b3,"tag",this.stream,this.posStart(),this.posStart()+1);this.toHexDOM_sub(b3,(this.length>=0)?"dlen":"ulen",this.stream,this.posStart()+1,this.posContent());if(this.sub===null){b3.appendChild(L.text(this.stream.hexDump(this.posContent(),this.posEnd())))}else{if(this.sub.length>0){var b4=this.sub[0];var b2=this.sub[this.sub.length-1];this.toHexDOM_sub(b3,"intro",this.stream,this.posContent(),b4.posStart());for(var b1=0,bZ=this.sub.length;b13){throw"Length over 24 bits not supported at position "+(b2.pos-1)}if(bZ===0){return -1}b0=0;for(var b1=0;b14)){return false}var b4=new bX(b5);if(b0==3){b4.get()}var b3=b4.get();if((b3>>6)&1){return false}try{var b2=bW.decodeLength(b4);return((b4.pos-b5.pos)+b2==bZ)}catch(b1){return false}};bW.decode=function(b6){if(!(b6 instanceof bX)){b6=new bX(b6,0)}var b5=new bX(b6),b8=b6.get(),b3=bW.decodeLength(b6),b2=b6.pos-b5.pos,bZ=null;if(bW.hasContent(b8,b3,b6)){var b0=b6.pos;if(b8==3){b6.get()}bZ=[];if(b3>=0){var b1=b0+b3;while(b6.pos +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + +${context.getContextName()} + + + + ${Scripts.src(zhiqim.js)} + + + <#include include/> + + \ No newline at end of file diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/norm.htm b/Yangcai365_web/manage/ztmpl/zhiqim_manager/norm.htm new file mode 100644 index 0000000..dc50f5f --- /dev/null +++ b/Yangcai365_web/manage/ztmpl/zhiqim_manager/norm.htm @@ -0,0 +1,15 @@ +<#-- 主题变量和函数定义 --> +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + +${context.getContextName()} + + +${Scripts.src(zhiqim.js)} + + + +<#include include/> + + \ No newline at end of file diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/template.htm b/Yangcai365_web/manage/ztmpl/zhiqim_manager/template.htm new file mode 100644 index 0000000..78b04ff --- /dev/null +++ b/Yangcai365_web/manage/ztmpl/zhiqim_manager/template.htm @@ -0,0 +1,12 @@ +<#-- 主题变量和函数定义 --> +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> +<#-- 判断是否启用了iframe --> +<#if !ZmrParamDao.isThemeFrame(context)> + <#include "/ztmpl/zhiqim_manager/"+themeMain+"/alone.htm"/> +<#else> + <#if request.getPathInContext() == "/"+zhiqim_manager+"/main.htm"> + <#include "/ztmpl/zhiqim_manager/"+themeMain+"/iframeMain.htm"/> + <#else> + <#include "/ztmpl/zhiqim_manager/"+themeMain+"/iframeInner.htm"/> + + \ No newline at end of file diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/three.js b/Yangcai365_web/manage/ztmpl/zhiqim_manager/three.js new file mode 100644 index 0000000..4b20d21 --- /dev/null +++ b/Yangcai365_web/manage/ztmpl/zhiqim_manager/three.js @@ -0,0 +1,827 @@ +// threejs.org/license +'use strict';var THREE={REVISION:"68"};"object"===typeof module&&(module.exports=THREE);THREE.CullFaceNone=0;THREE.CullFaceBack=1;THREE.CullFaceFront=2;THREE.CullFaceFrontBack=3;THREE.FrontFaceDirectionCW=0;THREE.FrontFaceDirectionCCW=1;THREE.BasicShadowMap=0;THREE.PCFShadowMap=1;THREE.PCFSoftShadowMap=2;THREE.FrontSide=0;THREE.BackSide=1;THREE.DoubleSide=2;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NoBlending=0; +THREE.NormalBlending=1;THREE.AdditiveBlending=2;THREE.SubtractiveBlending=3;THREE.MultiplyBlending=4;THREE.CustomBlending=5;THREE.AddEquation=100;THREE.SubtractEquation=101;THREE.ReverseSubtractEquation=102;THREE.ZeroFactor=200;THREE.OneFactor=201;THREE.SrcColorFactor=202;THREE.OneMinusSrcColorFactor=203;THREE.SrcAlphaFactor=204;THREE.OneMinusSrcAlphaFactor=205;THREE.DstAlphaFactor=206;THREE.OneMinusDstAlphaFactor=207;THREE.DstColorFactor=208;THREE.OneMinusDstColorFactor=209; +THREE.SrcAlphaSaturateFactor=210;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.AddOperation=2;THREE.UVMapping=function(){};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.RepeatWrapping=1E3;THREE.ClampToEdgeWrapping=1001;THREE.MirroredRepeatWrapping=1002;THREE.NearestFilter=1003;THREE.NearestMipMapNearestFilter=1004;THREE.NearestMipMapLinearFilter=1005; +THREE.LinearFilter=1006;THREE.LinearMipMapNearestFilter=1007;THREE.LinearMipMapLinearFilter=1008;THREE.UnsignedByteType=1009;THREE.ByteType=1010;THREE.ShortType=1011;THREE.UnsignedShortType=1012;THREE.IntType=1013;THREE.UnsignedIntType=1014;THREE.FloatType=1015;THREE.UnsignedShort4444Type=1016;THREE.UnsignedShort5551Type=1017;THREE.UnsignedShort565Type=1018;THREE.AlphaFormat=1019;THREE.RGBFormat=1020;THREE.RGBAFormat=1021;THREE.LuminanceFormat=1022;THREE.LuminanceAlphaFormat=1023; +THREE.RGB_S3TC_DXT1_Format=2001;THREE.RGBA_S3TC_DXT1_Format=2002;THREE.RGBA_S3TC_DXT3_Format=2003;THREE.RGBA_S3TC_DXT5_Format=2004;THREE.Color=function(a){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(a)}; +THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(a){a instanceof THREE.Color?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(a,b,c){if(0===b)this.r=this.g=this.b=c;else{var d=function(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a};b=0.5>=c?c*(1+b):c+b-c*b;c=2*c-b;this.r=d(c,b,a+1/3);this.g=d(c,b,a);this.b=d(c,b,a-1/3)}return this},setStyle:function(a){if(/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(a))return a=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(a),this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,this;if(/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(a))return a=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(a),this.r= +Math.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,this;if(/^\#([0-9a-f]{6})$/i.test(a))return a=/^\#([0-9a-f]{6})$/i.exec(a),this.setHex(parseInt(a[1],16)),this;if(/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(a))return a=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a),this.setHex(parseInt(a[1]+a[1]+a[2]+a[2]+a[3]+a[3],16)),this;if(/^(\w+)$/i.test(a))return this.setHex(THREE.ColorKeywords[a]),this},copy:function(a){this.r=a.r;this.g= +a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);this.b=Math.sqrt(this.b);return this},getHex:function(){return 255*this.r<<16^255*this.g<< +8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){a=a||{h:0,s:0,l:0};var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h=(f+e)/2;if(f===e)f=g=0;else{var k=e-f,f=0.5>=h?k/(e+f):k/(2-e-f);switch(e){case b:g=(c-d)/k+(cf&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=0.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y= +0.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=0.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*= +-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this}, +multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,l=b._w;this._x=c*l+f*g+d*k-e*h;this._y=d*l+f*h+e*g-c*k;this._z=e*l+f*k+c*h-d*g;this._w=f*l-c*g-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."); +return a.applyQuaternion(this)},slerp:function(a,b){var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),k=Math.sqrt(1-g*g);if(0.001>Math.abs(k))return this._w=0.5*(f+this._w),this._x=0.5*(c+this._x),this._y=0.5*(d+this._y),this._z=0.5*(e+this._z),this;g=Math.sin((1-b)*h)/k;h=Math.sin(b*h)/k;this._w=f*g+this._w*h;this._x= +c*g+this._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];this._w=a[3];this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._w]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y, +this._z,this._w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; +THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a, +b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this}, +subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2);a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this}, +roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b= +this.x-a.x;a=this.y-a.y;return b*b+a*a},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a){this.x=a[0];this.y=a[1];return this},toArray:function(){return[this.x,this.y]},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; +THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+ +a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), +this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y= +a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a;return function(b){!1===b instanceof THREE.Euler&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.");void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromEuler(b));return this}}(),applyAxisAngle:function(){var a;return function(b,c){void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromAxisAngle(b,c));return this}}(),applyMatrix3:function(a){var b=this.x, +c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12];this.y=a[1]*b+a[5]*c+a[9]*d+a[13];this.z=a[2]*b+a[6]*c+a[10]*d+a[14];return this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z= +(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,l=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-l*-f;this.y=k*a+b*-f+l*-e-h*-g;this.z=l*a+b*-g+h*-f-k*-e;return this},transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x; +this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z= +b.z);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3);a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x= +0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+ +Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},cross:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y= +e*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;this.x=d*h-e*g;this.y=e*f-c*h;this.z=c*g-d*f;return this},projectOnVector:function(){var a,b;return function(c){void 0===a&&(a=new THREE.Vector3);a.copy(c).normalize();b=this.dot(a);return this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a;return function(b){void 0=== +a&&(a=new THREE.Vector3);return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/(this.length()*a.length());return Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},setEulerFromRotationMatrix:function(a,b){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")}, +setEulerFromQuaternion:function(a,b){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(a){console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a, +b){console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(a,b)},setFromMatrixPosition:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z= +a;return this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;this.x=d[c];this.y=d[c+1];this.z=d[c+2];return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];return this},toArray:function(){return[this.x,this.y,this.z]},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}; +THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x; +case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this}, +addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b= +this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a):(this.z=this.y=this.x=0,this.w=1);return this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this}, +setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var l=a[10];if(0.01>Math.abs(d-g)&&0.01>Math.abs(f-c)&&0.01>Math.abs(k-b)){if(0.1>Math.abs(d+g)&&0.1>Math.abs(f+c)&&0.1>Math.abs(k+b)&&0.1>Math.abs(e+h+l-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;l=(l+1)/2;d=(d+g)/4;f=(f+c)/4;k=(k+b)/4;e>h&&e>l?0.01>e?(b=0,d=c=0.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>l?0.01>h?(b=0.707106781,c=0,d=0.707106781):(c= +Math.sqrt(h),b=d/c,d=k/c):0.01>l?(c=b=0.707106781,d=0):(d=Math.sqrt(l),b=f/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(f-c)*(f-c)+(g-d)*(g-d));0.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(f-c)/a;this.z=(g-d)/a;this.w=Math.acos((e+h+l-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z=b.z);this.wb.w&&(this.w=b.w);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z); +this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w): +Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())}, +setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3];return this},toArray:function(){return[this.x,this.y,this.z,this.w]},clone:function(){return new THREE.Vector4(this.x,this.y,this.z, +this.w)}};THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ"; +THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x= +a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[1],k=d[5],l=d[9],n=d[2],q=d[6],d=d[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(c(g,-1,1)),0.99999>Math.abs(g)?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-f,e)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-c(l,-1,1)),0.99999>Math.abs(l)?(this._y=Math.atan2(g,d),this._z=Math.atan2(h,k)): +(this._y=Math.atan2(-n,e),this._z=0)):"ZXY"===b?(this._x=Math.asin(c(q,-1,1)),0.99999>Math.abs(q)?(this._y=Math.atan2(-n,d),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,e))):"ZYX"===b?(this._y=Math.asin(-c(n,-1,1)),0.99999>Math.abs(n)?(this._x=Math.atan2(q,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(c(h,-1,1)),0.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-n,e)):(this._x=0,this._y=Math.atan2(g,d))):"XZY"===b?(this._z= +Math.asin(-c(f,-1,1)),0.99999>Math.abs(f)?(this._x=Math.atan2(q,k),this._y=Math.atan2(g,e)):(this._x=Math.atan2(-l,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;this.onChangeCallback();return this},setFromQuaternion:function(a,b,c){var d=THREE.Math.clamp,e=a.x*a.x,f=a.y*a.y,g=a.z*a.z,h=a.w*a.w;b=b||this._order;"XYZ"===b?(this._x=Math.atan2(2*(a.x*a.w-a.y*a.z),h-e-f+g),this._y=Math.asin(d(2*(a.x*a.z+a.y*a.w),-1,1)),this._z=Math.atan2(2* +(a.z*a.w-a.x*a.y),h+e-f-g)):"YXZ"===b?(this._x=Math.asin(d(2*(a.x*a.w-a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h-e-f+g),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h-e+f-g)):"ZXY"===b?(this._x=Math.asin(d(2*(a.x*a.w+a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.y*a.w-a.z*a.x),h-e-f+g),this._z=Math.atan2(2*(a.z*a.w-a.x*a.y),h-e+f-g)):"ZYX"===b?(this._x=Math.atan2(2*(a.x*a.w+a.z*a.y),h-e-f+g),this._y=Math.asin(d(2*(a.y*a.w-a.x*a.z),-1,1)),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h+e-f-g)):"YZX"=== +b?(this._x=Math.atan2(2*(a.x*a.w-a.z*a.y),h-e+f-g),this._y=Math.atan2(2*(a.y*a.w-a.x*a.z),h+e-f-g),this._z=Math.asin(d(2*(a.x*a.y+a.z*a.w),-1,1))):"XZY"===b?(this._x=Math.atan2(2*(a.x*a.w+a.y*a.z),h-e+f-g),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h+e-f-g),this._z=Math.asin(d(2*(a.z*a.w-a.x*a.y),-1,1))):console.warn("THREE.Euler: .setFromQuaternion() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this); +this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._order]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}}; +THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3}; +THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(0.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a, +b){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);var e=b.dot(b),e=b.dot(a)/e;d&&(e=THREE.Math.clamp(e,0,1));return e}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);c=c||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a); +this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}};THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector2(-Infinity,-Infinity)}; +THREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.y +this.max.y?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&& +a.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}};THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector3(-Infinity,-Infinity,-Infinity)}; +THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y|| +a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y|| +a.max.zthis.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new THREE.Vector3;return function(b){b=b||new THREE.Sphere;b.center=this.center();b.radius=0.5*this.size(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this}, +union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b); +a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.makeEmpty();this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}}; +THREE.Matrix3=function(a,b,c,d,e,f,g,h,k){var l=this.elements=new Float32Array(9);l[0]=void 0!==a?a:1;l[3]=b||0;l[6]=c||0;l[1]=d||0;l[4]=void 0!==e?e:1;l[7]=f||0;l[2]=g||0;l[5]=h||0;l[8]=void 0!==k?k:1}; +THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,f,g,h,k){var l=this.elements;l[0]=a;l[3]=b;l[6]=c;l[1]=d;l[4]=e;l[7]=f;l[2]=g;l[5]=h;l[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)}, +multiplyVector3Array:function(a){console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;ethis.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.elements.set(this.elements);c=1/g;var f=1/h,l=1/k;b.elements[0]*=c;b.elements[1]*= +c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=l;b.elements[9]*=l;b.elements[10]*=l;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(0.5*a)); +var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,k=c-d,l=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/k;g[9]=0;g[13]=-((c+d)/k);g[2]=0;g[6]=0;g[10]=-2/l;g[14]=-((f+e)/l);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){var a= +this.elements;return new THREE.Matrix4(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15])}};THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3}; +THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin); +var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(a,b,c,d){var e=a.clone().add(b).multiplyScalar(0.5),f=b.clone().sub(a).normalize(),g=0.5*a.distanceTo(b), +h=this.origin.clone().sub(e);a=-this.direction.dot(f);b=h.dot(this.direction);var k=-h.dot(f),l=h.lengthSq(),n=Math.abs(1-a*a),q,r;0<=n?(h=a*k-b,q=a*b-k,r=g*n,0<=h?q>=-r?q<=r?(g=1/n,h*=g,q*=g,a=h*(h+a*q+2*b)+q*(a*h+q+2*k)+l):(q=g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l):(q=-g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l):q<=-r?(h=Math.max(0,-(-a*g+b)),q=0f)return null;f=Math.sqrt(f-e);e=d-f; +d+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3; +return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(fg||e>d)return null;if(e>c||c!== +c)c=e;if(gd?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));if(0>g||e+g>f)return null; +e=-h*a.dot(d);return 0>e?null:this.at(e/f,k)}}(),applyMatrix4:function(a){this.direction.add(this.origin).applyMatrix4(a);this.origin.applyMatrix4(a);this.direction.sub(this.origin);this.direction.normalize();return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}};THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3;this.radius=void 0!==b?b:0}; +THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,f=0,g=b.length;f=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<= +this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius); +return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}}; +THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]}; +THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],n=c[8],q=c[9],r=c[10],t=c[11],s=c[12],p=c[13],v=c[14],c=c[15];b[0].setComponents(f-a,l-g,t-n,c-s).normalize();b[1].setComponents(f+ +a,l+g,t+n,c+s).normalize();b[2].setComponents(f+d,l+h,t+q,c+p).normalize();b[3].setComponents(f-d,l-h,t-q,c-p).normalize();b[4].setComponents(f-e,l-k,t-r,c-v).normalize();b[5].setComponents(f+e,l+k,t+r,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes, +c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)e;e++){var f=d[e];a.x=0g&&0>f)return!1}return!0}}(), +containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0}; +THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d, +c);return this}}(),copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a, +b){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0a&&0f||1e;e++)8==e||13==e||18==e||23==e?b[e]="-":14==e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return ac?c:a},clampBottom:function(a,b){return a=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(0.5-Math.random())},sign:function(a){return 0>a?-1:0this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1: +f+2;l=this.points[c[0]];n=this.points[c[1]];q=this.points[c[2]];r=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,n.x,q.x,r.x,g,h,k);d.y=b(l.y,n.y,q.y,r.y,g,h,k);d.z=b(l.z,n.z,q.z,r.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a=b.x+b.y}}(); +THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return 0.5*a.cross(b).length()}}(),midpoint:function(a){return(a|| +new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}, +clone:function(){return(new THREE.Triangle).copy(this)}};THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}; +THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(), +a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){}; +THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&& +c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;ee&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},l=function(a, +b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;L[0]=a.positionScreen;L[1]=b.positionScreen;L[2]=c.positionScreen;return E.isIntersectionBox(Q.setFromPoints(L))},q=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){f=a;g=f.material;h.getNormalMatrix(f.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:l, +checkBackfaceCulling:q,pushVertex:function(b,c,d){n=a();n.position.set(b,c,d);k(n)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=r[a],e=r[b];u=c();u.id=f.id;u.v1.copy(d);u.v2.copy(e);u.z=(d.positionScreen.z+e.positionScreen.z)/2;u.material=f.material;K.elements.push(u)},pushTriangle:function(a,c,k){var n=r[a],p=r[c],t=r[k];if(!1!==l(n,p,t)&&(g.side===THREE.DoubleSide||!0===q(n,p,t))){s=b();s.id=f.id;s.v1.copy(n);s.v2.copy(p);s.v3.copy(t); +s.z=(n.positionScreen.z+p.positionScreen.z+t.positionScreen.z)/3;for(n=0;3>n;n++)p=3*arguments[n],t=s.vertexNormalsModel[n],t.set(d[p],d[p+1],d[p+2]),t.applyMatrix3(h).normalize(),p=2*arguments[n],s.uvs[n].set(e[p],e[p+1]);s.vertexNormalsLength=3;s.material=f.material;K.elements.push(s)}}}};this.projectScene=function(n,t,w,v){I=D=p=0;K.elements.length=0;!0===n.autoUpdate&&n.updateMatrixWorld();void 0===t.parent&&t.updateMatrixWorld();R.copy(t.matrixWorldInverse.getInverse(t.matrixWorld));B.multiplyMatrices(t.projectionMatrix, +R);H.setFromMatrix(B);h=0;K.objects.length=0;K.lights.length=0;n.traverseVisible(function(a){if(a instanceof THREE.Light)K.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===H.intersectsObject(a)){if(h===l){var b=new THREE.RenderableObject;k.push(b);l++;h++;g=b}else g=k[h++];g.id=a.id;g.object=a;null!==a.renderDepth?g.z=a.renderDepth:(O.setFromMatrixPosition(a.matrixWorld),O.applyProjection(B),g.z=O.z);K.objects.push(g)}}); +!0===w&&K.objects.sort(e);n=0;for(w=K.objects.length;nva;va++)s.uvs[va].copy(ua[va]); +s.color=ca.color;s.material=qa;s.z=(la.positionScreen.z+ja.positionScreen.z+Fa.positionScreen.z)/3;K.elements.push(s)}}}}}else if(A instanceof THREE.Line)if(x instanceof THREE.BufferGeometry){if(z=x.attributes,void 0!==z.position){G=z.position.array;x=0;for(y=G.length;x=J.z&&(C=d(),C.id=A.id,C.x=J.x*x,C.y=J.y*x,C.z=J.z,C.object=A,C.rotation=A.rotation,C.scale.x=A.scale.x*Math.abs(C.x-(J.x+t.projectionMatrix.elements[0])/(J.w+t.projectionMatrix.elements[12])),C.scale.y=A.scale.y*Math.abs(C.y-(J.y+t.projectionMatrix.elements[5])/ +(J.w+t.projectionMatrix.elements[13])),C.material=A.material,K.elements.push(C)))}!0===v&&K.elements.sort(e);return K}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0}; +THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.materialIndex=this.materialIndex;for(var b=0,c=this.vertexNormals.length;bb.max.x&&(b.max.x=e);fb.max.y&& +(b.max.y=f);gb.max.z&&(b.max.z=g)}}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')},computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&& +(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;eBa?-1:1;h[4*a]=Ea.x;h[4*a+1]=Ea.y;h[4*a+2]=Ea.z;h[4*a+3]=Pa}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent= +{itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;np;p++)s=a[3*c+p],-1==r[s]?(q[2*p]=s,q[2*p+1]=-1,n++):r[s]k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)p=q[n+1],-1n;n+=2)s=q[n],p=q[n+1],-1===p&&(p=g++),r[s]=p,t[p]=s,e[f++]=p-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},normalizeNormals:function(){for(var a=this.attributes.normal.array, +b,c,d,e=0,f=a.length;ed?-1:1,e.vertexTangents[c]=new THREE.Vector4(A.x,A.y,A.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;cd;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;cc&&(h[f].counter+=1,g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:f,vertices:0,numMorphTargets:l,numMorphNormals:n},this.geometryGroups[g]=k,this.geometryGroupsList.push(k))),this.geometryGroups[g].faces3.push(d),this.geometryGroups[g].vertices+=3}}(),clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;ca.opacity)h.transparent=a.transparent;void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);void 0!==a.vertexColors&&("face"=== +a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorAmbient&&(h.ambient=e(a.colorAmbient));a.colorEmissive&&(h.emissive=e(a.colorEmissive));a.transparency&&(h.opacity=a.transparency);a.specularCoef&&(h.shininess=a.specularCoef);a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap, +a.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&d(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy);a.mapAlpha&& +b&&d(h,"alphaMap",a.mapAlpha,a.mapAlphaRepeat,a.mapAlphaOffset,a.mapAlphaWrap,a.mapAlphaAnisotropy);a.mapBumpScale&&(h.bumpScale=a.mapBumpScale);a.mapNormal?(g=THREE.ShaderLib.normalmap,k=THREE.UniformsUtils.clone(g.uniforms),k.tNormal.value=h.normalMap,a.mapNormalFactor&&k.uNormalScale.value.set(a.mapNormalFactor,a.mapNormalFactor),h.map&&(k.tDiffuse.value=h.map,k.enableDiffuse.value=!0),h.specularMap&&(k.tSpecular.value=h.specularMap,k.enableSpecular.value=!0),h.lightMap&&(k.tAO.value=h.lightMap, +k.enableAO.value=!0),k.diffuse.value.setHex(h.color),k.specular.value.setHex(h.specular),k.ambient.value.setHex(h.ambient),k.shininess.value=h.shininess,void 0!==h.opacity&&(k.opacity.value=h.opacity),g=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:k,lights:!0,fog:!0}),h.transparent&&(g.transparent=!0)):g=new THREE[g](h);void 0!==a.DbgName&&(g.name=a.DbgName);return g}}; +THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;bg;g++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],t.normal.set(D[q++],D[q++],D[q]),p.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*u[k++],s=new THREE.Vector3(D[q++], +D[q++],D[q]),2!==d&&t.vertexNormals.push(s),0!==d&&p.vertexNormals.push(s);n&&(n=u[k++],n=A[n],t.color.setHex(n),p.color.setHex(n));if(b)for(d=0;4>d;d++)n=u[k++],n=A[n],2!==d&&t.vertexColors.push(new THREE.Color(n)),0!==d&&p.vertexColors.push(new THREE.Color(n));c.faces.push(t);c.faces.push(p)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;dg;g++)r=u[k++],w=v[2*r],r=v[2*r+1], +w=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],t.normal.set(D[q++],D[q++],D[q]));if(s)for(d=0;3>d;d++)q=3*u[k++],s=new THREE.Vector3(D[q++],D[q++],D[q]),t.vertexNormals.push(s);n&&(n=u[k++],t.color.setHex(A[n]));if(b)for(d=0;3>d;d++)n=u[k++],t.vertexColors.push(new THREE.Color(A[n]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;df)){var r=b.origin.distanceTo(l);rd.far||e.push({distance:r,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.type));THREE.Object3D.prototype.clone.call(this,a);return a}; +THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype); +THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0g.far||h.push({distance:C,point:x,indices:[n,q,r],face:null,faceIndex:null,object:this})}}}else for(p=n.position.array,s=k=0,A=p.length;kg.far||h.push({distance:C,point:x,indices:[n,q,r],face:null,faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,p=!0===s?this.material.materials:null,t=g.precision,v=k.vertices,w=0,u=k.faces.length;wg.far||h.push({distance:C,point:x,face:D,faceIndex:w,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype); +THREE.Bone.prototype.updateMatrixWorld=function(a){THREE.Object3D.prototype.updateMatrixWorld.call(this,a);this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0}; +THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256h.end&&(h.end=e);b||(b=g)}}a.firstAnimation=b}; +THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={});this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1E3,this.time=0):console.warn("animation["+a+"] undefined")}; +THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||0>this.time)this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)}else this.time%=this.duration,0>this.time&&(this.time+=this.duration);a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1);a!==this.currentKeyframe&& +(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a);b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b}; +THREE.MorphAnimMesh.prototype.interpolateTargets=function(a,b,c){for(var d=this.morphTargetInfluences,e=0,f=d.length;e=this.objects[d].distance)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;else break;for(;dthis.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.updateMatrix=function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0}; +THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Particle=THREE.Sprite;THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1;this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype); +THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)){this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}this.dispatchEvent({type:"objectAdded",object:a});a.dispatchEvent({type:"addedToScene",scene:this});for(b=0;bE&&O.clearRect(aa.min.x|0,aa.min.y|0,aa.max.x-aa.min.x|0,aa.max.y-aa.min.y|0),0$.positionScreen.z||1<$.positionScreen.z)continue;if(-1>X.positionScreen.z||1T.positionScreen.z||1=S||(S*=V.intensity,R.add(Za.multiplyScalar(S)))):V instanceof THREE.PointLight&&(da=Ga.setFromMatrixPosition(V.matrixWorld),S=ea.dot(Ga.subVectors(da,H).normalize()),0>=S||(S*=0==V.distance?1:1-Math.min(H.distanceTo(da)/V.distance,1),0!=S&&(S*=V.intensity,R.add(Za.multiplyScalar(S)))));G.multiply(Ba).add(Ya);!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(G)}else E instanceof THREE.MeshBasicMaterial||E instanceof THREE.MeshLambertMaterial||E instanceof +THREE.MeshPhongMaterial?null!==E.map?E.map.mapping instanceof THREE.UVMapping&&(ca=J.uvs,f(ya,Ea,Aa,za,Oa,Pa,ca[0].x,ca[0].y,ca[1].x,ca[1].y,ca[2].x,ca[2].y,E.map)):null!==E.envMap?E.envMap.mapping instanceof THREE.SphericalReflectionMapping?(ma.copy(J.vertexNormalsModel[0]).applyMatrix3(Ja),la=0.5*ma.x+0.5,qa=0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[1]).applyMatrix3(Ja),ua=0.5*ma.x+0.5,ja=0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[2]).applyMatrix3(Ja),Fa=0.5*ma.x+0.5,va=0.5*ma.y+0.5,f(ya,Ea,Aa,za, +Oa,Pa,la,qa,ua,ja,Fa,va,E.envMap)):E.envMap.mapping instanceof THREE.SphericalRefractionMapping&&(ma.copy(J.vertexNormalsModel[0]).applyMatrix3(Ja),la=-0.5*ma.x+0.5,qa=-0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[1]).applyMatrix3(Ja),ua=-0.5*ma.x+0.5,ja=-0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[2]).applyMatrix3(Ja),Fa=-0.5*ma.x+0.5,va=-0.5*ma.y+0.5,f(ya,Ea,Aa,za,Oa,Pa,la,qa,ua,ja,Fa,va,E.envMap)):(G.copy(E.color),E.vertexColors===THREE.FaceColors&&G.multiply(J.color),!0===E.wireframe?b(G,E.wireframeLinewidth, +E.wireframeLinecap,E.wireframeLinejoin):c(G)):(E instanceof THREE.MeshDepthMaterial?G.r=G.g=G.b=1-p(H.positionScreen.z*H.positionScreen.w,oa.near,oa.far):E instanceof THREE.MeshNormalMaterial?(ma.copy(J.normalModel).applyMatrix3(Ja),G.setRGB(ma.x,ma.y,ma.z).multiplyScalar(0.5).addScalar(0.5)):G.setRGB(1,1,1),!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(G))}}aa.union(ra)}}O.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={}; +THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n\tif ( gl_FragColor.a < ALPHATEST ) discard;\n\n#endif\n";THREE.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n\tvec3 dirVector = normalize( lDirection.xyz );\n\n\tfloat dotProduct = dot( transformedNormal, dirVector );\n\tvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t#endif\n\n\t#endif\n\n\t#ifdef WRAP_AROUND\n\n\t\tvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\tdirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tdirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n\t\t#endif\n\n\t#endif\n\n\tvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n\t#endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat lDistance = 1.0;\n\t\tif ( pointLightDistance[ i ] > 0.0 )\n\t\t\tlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\n\n\t\tlVector = normalize( lVector );\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\tpointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tpointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\tvLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\tfloat lDistance = 1.0;\n\t\t\tif ( spotLightDistance[ i ] > 0.0 )\n\t\t\t\tlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\n\n\t\t\tlVector = normalize( lVector );\n\n\t\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\t\t\tvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\t\tvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\t\tspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n\t\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\t\tspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvLightFront += spotLightColor[ i ] * spotLightWeighting * lDistance * spotEffect;\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvLightBack += spotLightColor[ i ] * spotLightWeightingBack * lDistance * spotEffect;\n\n\t\t\t#endif\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n\t\tvec3 lVector = normalize( lDirection.xyz );\n\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\tfloat hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n\t\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n\t\t#endif\n\n\t}\n\n#endif\n\nvLightFront = vLightFront * diffuse + ambient * ambientLightColor + emissive;\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vLightBack * diffuse + ambient * ambientLightColor + emissive;\n\n#endif"; +THREE.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif";THREE.ShaderChunk.default_vertex="vec4 mvPosition;\n\n#ifdef USE_SKINNING\n\n\tmvPosition = modelViewMatrix * skinned;\n\n#endif\n\n#if !defined( USE_SKINNING ) && defined( USE_MORPHTARGETS )\n\n\tmvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#endif\n\n#if !defined( USE_SKINNING ) && ! defined( USE_MORPHTARGETS )\n\n\tmvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;"; +THREE.ShaderChunk.map_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif";THREE.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\t#ifdef USE_MORPHNORMALS\n\n\tvec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n\t#else\n\n\tvec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n\t#endif\n\n#endif\n"; +THREE.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n\tuniform float logDepthBufFC;\n\n#endif";THREE.ShaderChunk.lightmap_pars_vertex="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\n#endif";THREE.ShaderChunk.lights_phong_fragment="vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef DOUBLE_SIDED\n\n\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n#endif\n\n#ifdef USE_NORMALMAP\n\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tvec3 pointDiffuse = vec3( 0.0 );\n\tvec3 pointSpecular = vec3( 0.0 );\n\n\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat lDistance = 1.0;\n\t\tif ( pointLightDistance[ i ] > 0.0 )\n\t\t\tlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\n\n\t\tlVector = normalize( lVector );\n\n\t\t\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat pointDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\tpointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * lDistance;\n\n\t\t\t\t// specular\n\n\t\tvec3 pointHalfVector = normalize( lVector + viewPosition );\n\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\tfloat pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\tpointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance * specularNormalization;\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tvec3 spotDiffuse = vec3( 0.0 );\n\tvec3 spotSpecular = vec3( 0.0 );\n\n\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat lDistance = 1.0;\n\t\tif ( spotLightDistance[ i ] > 0.0 )\n\t\t\tlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\n\n\t\tlVector = normalize( lVector );\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\t\t\t// diffuse\n\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n\t\t\t#else\n\n\t\t\t\tfloat spotDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t\t#endif\n\n\t\t\tspotDiffuse += diffuse * spotLightColor[ i ] * spotDiffuseWeight * lDistance * spotEffect;\n\n\t\t\t\t\t// specular\n\n\t\t\tvec3 spotHalfVector = normalize( lVector + viewPosition );\n\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\tfloat spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\tspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * specularNormalization * spotEffect;\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n\tvec3 dirDiffuse = vec3( 0.0 );\n\tvec3 dirSpecular = vec3( 0.0 );\n\n\tfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\t\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n\t\tvec3 dirVector = normalize( lDirection.xyz );\n\n\t\t\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, dirVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat dirDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\tdirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\n\n\t\t// specular\n\n\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\tfloat dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n\t\t/*\n\t\t// fresnel term from skin shader\n\t\tconst float F0 = 0.128;\n\n\t\tfloat base = 1.0 - dot( viewPosition, dirHalfVector );\n\t\tfloat exponential = pow( base, 5.0 );\n\n\t\tfloat fresnel = exponential + F0 * ( 1.0 - exponential );\n\t\t*/\n\n\t\t/*\n\t\t// fresnel term from fresnel shader\n\t\tconst float mFresnelBias = 0.08;\n\t\tconst float mFresnelScale = 0.3;\n\t\tconst float mFresnelPower = 5.0;\n\n\t\tfloat fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n\t\t*/\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t// \t\tdirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\tdirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tvec3 hemiDiffuse = vec3( 0.0 );\n\tvec3 hemiSpecular = vec3( 0.0 );\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n\t\tvec3 lVector = normalize( lDirection.xyz );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\themiDiffuse += diffuse * hemiColor;\n\n\t\t// specular (sky light)\n\n\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\tfloat hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n\t\t// specular (ground light)\n\n\t\tvec3 lVectorGround = -lVector;\n\n\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\tfloat hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\themiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n\t}\n\n#endif\n\nvec3 totalDiffuse = vec3( 0.0 );\nvec3 totalSpecular = vec3( 0.0 );\n\n#if MAX_DIR_LIGHTS > 0\n\n\ttotalDiffuse += dirDiffuse;\n\ttotalSpecular += dirSpecular;\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\ttotalDiffuse += hemiDiffuse;\n\ttotalSpecular += hemiSpecular;\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\ttotalDiffuse += pointDiffuse;\n\ttotalSpecular += pointSpecular;\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\ttotalDiffuse += spotDiffuse;\n\ttotalSpecular += spotSpecular;\n\n#endif\n\n#ifdef METAL\n\n\tgl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient + totalSpecular );\n\n#else\n\n\tgl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\n\n#endif"; +THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n\n#endif";THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n\tvec3 morphedNormal = vec3( 0.0 );\n\n\tmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n\tmorphedNormal += normal;\n\n#endif"; +THREE.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\tuniform samplerCube envMap;\n\tuniform float flipEnvMap;\n\tuniform int combine;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\n\t\tuniform bool useRefract;\n\t\tuniform float refractionRatio;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif"; +THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n\t\t\t// Per-Pixel Tangent Space Normal Mapping\n\t\t\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n"; +THREE.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n";THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\tuniform sampler2D lightMap;\n\n#endif";THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n\t}\n\n#endif"; +THREE.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif";THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\t#ifdef GAMMA_INPUT\n\n\t\ttexelColor.xyz *= texelColor.xyz;\n\n\t#endif\n\n\tgl_FragColor = gl_FragColor * texelColor;\n\n#endif";THREE.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n\tvUv2 = uv2;\n\n#endif"; +THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n\tgl_FragColor = gl_FragColor * texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) );\n\n#endif";THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n";THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n\t#ifdef GAMMA_INPUT\n\n\t\tvColor = color * color;\n\n\t#else\n\n\t\tvColor = color;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n\t#ifdef USE_MORPHTARGETS\n\n\tvec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n\n#endif\n"; +THREE.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\n\tvarying vec3 vReflect;\n\n\tuniform float refractionRatio;\n\tuniform bool useRefract;\n\n#endif\n";THREE.ShaderChunk.linear_to_gamma_fragment="#ifdef GAMMA_OUTPUT\n\n\tgl_FragColor.xyz = sqrt( gl_FragColor.xyz );\n\n#endif";THREE.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif";THREE.ShaderChunk.lights_lambert_pars_vertex="uniform vec3 ambient;\nuniform vec3 diffuse;\nuniform vec3 emissive;\n\nuniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n"; +THREE.ShaderChunk.map_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n\n#endif\n";THREE.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n\tvec3 reflectVec;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n\t\t// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\n\t\tvec3 worldNormal = normalize( vec3( vec4( normal, 0.0 ) * viewMatrix ) );\n\n\t\tif ( useRefract ) {\n\n\t\t\treflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t} else { \n\n\t\t\treflectVec = reflect( cameraToVertex, worldNormal );\n\n\t\t}\n\n\t#else\n\n\t\treflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t\tvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#else\n\n\t\tvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#endif\n\n\t#ifdef GAMMA_INPUT\n\n\t\tcubeColor.xyz *= cubeColor.xyz;\n\n\t#endif\n\n\tif ( combine == 1 ) {\n\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n\n\t} else if ( combine == 2 ) {\n\n\t\tgl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n\n\t} else {\n\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n\n\t}\n\n#endif"; +THREE.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif";THREE.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n\tgl_Position.z = log2(max(1e-6, gl_Position.w + 1.0)) * logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif"; +THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif";THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n\t#else\n\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\n\t#endif\n\n\t#ifdef FOG_EXP2\n\n\t\tconst float LOG2 = 1.442695;\n\t\tfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\n\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\n\t#endif\n\t\n\tgl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n\n#endif"; +THREE.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t\t\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n\t\t\t//\thttp://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n\t\t\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif"; +THREE.ShaderChunk.defaultnormal_vertex="vec3 objectNormal;\n\n#ifdef USE_SKINNING\n\n\tobjectNormal = skinnedNormal.xyz;\n\n#endif\n\n#if !defined( USE_SKINNING ) && defined( USE_MORPHNORMALS )\n\n\tobjectNormal = morphedNormal;\n\n#endif\n\n#if !defined( USE_SKINNING ) && ! defined( USE_MORPHNORMALS )\n\n\tobjectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n\tobjectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;"; +THREE.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;"; +THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif";THREE.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif"; +THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n\tgl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );\n\n#endif";THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif";THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n\tgl_FragColor = gl_FragColor * vec4( vColor, 1.0 );\n\n#endif";THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n\tvec3 morphed = vec3( 0.0 );\n\tmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\tmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\tmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\tmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\tmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\tmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\tmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\tmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n\tmorphed += position;\n\n#endif"; +THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\n\tvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\n\tworldNormal = normalize( worldNormal );\n\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\tif ( useRefract ) {\n\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t} else {\n\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t}\n\n#endif"; +THREE.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n\t#ifdef SHADOWMAP_DEBUG\n\n\t\tvec3 frustumColors[3];\n\t\tfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n\t\tfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n\t\tfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n\t#endif\n\n\t#ifdef SHADOWMAP_CASCADE\n\n\t\tint inFrustumCount = 0;\n\n\t#endif\n\n\tfloat fDepth;\n\tvec3 shadowColor = vec3( 1.0 );\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\t\t\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t\t\t// if ( all( something, something ) ) using this instead\n\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\n\t\t\t\t// don't shadow pixels outside of light frustum\n\t\t\t\t// use just first frustum (for cascades)\n\t\t\t\t// don't shadow pixels behind far plane of light frustum\n\n\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\tinFrustumCount += int( inFrustum );\n\t\t\tbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n\t\t#else\n\n\t\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\t#endif\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t/*\n\t\t\t\t\t\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n\t\t\t\t\t\t// must enroll loop manually\n\n\t\t\t\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\n\t\t\t\t\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n\t\t\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n\t\t\t\t\t\t\t\t// doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n\t\t\t\t\t\t\t\t//vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n\t\t\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\t\t\tif ( fDepth < shadowCoord.z )\n\t\t\t\t\t\t\tshadow += 1.0;\n\n\t\t\t\t}\n\n\t\t\t\tshadow /= 9.0;\n\n\t\t*/\n\n\t\t\t\tconst float shadowDelta = 1.0 / 9.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.25 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.25 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.25 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.25 * yPixelOffset;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.0 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.0 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.0 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.0 * yPixelOffset;\n\n\t\t\t\tmat3 shadowKernel;\n\t\t\t\tmat3 depthKernel;\n\n\t\t\t\tdepthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tdepthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tdepthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tdepthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tdepthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tdepthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tdepthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tdepthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tdepthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n\t\t\t\tvec3 shadowZ = vec3( shadowCoord.z );\n\t\t\t\tshadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n\t\t\t\tshadowKernel[0] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n\t\t\t\tshadowKernel[1] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n\t\t\t\tshadowKernel[2] *= vec3(0.25);\n\n\t\t\t\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n\t\t\t\tshadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n\t\t\t\tshadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n\t\t\t\tvec4 shadowValues;\n\t\t\t\tshadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n\t\t\t\tshadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n\t\t\t\tshadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n\t\t\t\tshadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n\t\t\t\tshadow = dot( shadowValues, vec4( 1.0 ) );\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#else\n\n\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\tif ( fDepth < shadowCoord.z )\n\n\t\t// spot with multiple shadows is darker\n\n\t\t\t\t\tshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n\t\t// spot with multiple shadows has the same color as single shadow spot\n\n\t\t// \t\t\t\t\tshadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n\t\t\t#endif\n\n\t\t}\n\n\n\t\t#ifdef SHADOWMAP_DEBUG\n\n\t\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\t\tif ( inFrustum && inFrustumCount == 1 ) gl_FragColor.xyz *= frustumColors[ i ];\n\n\t\t\t#else\n\n\t\t\t\tif ( inFrustum ) gl_FragColor.xyz *= frustumColors[ i ];\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t}\n\n\t#ifdef GAMMA_OUTPUT\n\n\t\tshadowColor *= shadowColor;\n\n\t#endif\n\n\tgl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\n\n#endif\n"; +THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n\t#ifdef USE_SKINNING\n\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\n\t#endif\n\n\t#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n\t#endif\n\n\t#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n#endif"; +THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n#endif"; +THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n"; +THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\t#extension GL_EXT_frag_depth : enable\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n\tgl_FragColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n";THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n"; +THREE.UniformsUtils={merge:function(a){var b,c,d,e={};for(b=0;b dashSize ) {\n\t\tdiscard;\n\t}\n\tgl_FragColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.fog_fragment, +"}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2E3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment, +"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvNormal = normalize( normalMatrix * normal );", +THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},normalmap:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{enableAO:{type:"i", +value:0},enableDiffuse:{type:"i",value:0},enableSpecular:{type:"i",value:0},enableReflection:{type:"i",value:0},enableDisplacement:{type:"i",value:0},tDisplacement:{type:"t",value:null},tDiffuse:{type:"t",value:null},tCube:{type:"t",value:null},tNormal:{type:"t",value:null},tSpecular:{type:"t",value:null},tAO:{type:"t",value:null},uNormalScale:{type:"v2",value:new THREE.Vector2(1,1)},uDisplacementBias:{type:"f",value:0},uDisplacementScale:{type:"f",value:1},diffuse:{type:"c",value:new THREE.Color(16777215)}, +specular:{type:"c",value:new THREE.Color(1118481)},ambient:{type:"c",value:new THREE.Color(16777215)},shininess:{type:"f",value:30},opacity:{type:"f",value:1},useRefract:{type:"i",value:0},refractionRatio:{type:"f",value:0.98},reflectivity:{type:"f",value:0.5},uOffset:{type:"v2",value:new THREE.Vector2(0,0)},uRepeat:{type:"v2",value:new THREE.Vector2(1,1)},wrapRGB:{type:"v3",value:new THREE.Vector3(1,1,1)}}]),fragmentShader:["uniform vec3 ambient;\nuniform vec3 diffuse;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\nuniform bool enableDiffuse;\nuniform bool enableSpecular;\nuniform bool enableAO;\nuniform bool enableReflection;\nuniform sampler2D tDiffuse;\nuniform sampler2D tNormal;\nuniform sampler2D tSpecular;\nuniform sampler2D tAO;\nuniform samplerCube tCube;\nuniform vec2 uNormalScale;\nuniform bool useRefract;\nuniform float refractionRatio;\nuniform float reflectivity;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nuniform vec3 ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_HEMI_LIGHTS > 0\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#endif\n#if MAX_SPOT_LIGHTS > 0\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n#endif\n#ifdef WRAP_AROUND\n\tuniform vec3 wrapRGB;\n#endif\nvarying vec3 vWorldPosition;\nvarying vec3 vViewPosition;", +THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\tgl_FragColor = vec4( vec3( 1.0 ), opacity );\n\tvec3 specularTex = vec3( 1.0 );\n\tvec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\n\tnormalTex.xy *= uNormalScale;\n\tnormalTex = normalize( normalTex );\n\tif( enableDiffuse ) {\n\t\t#ifdef GAMMA_INPUT\n\t\t\tvec4 texelColor = texture2D( tDiffuse, vUv );\n\t\t\ttexelColor.xyz *= texelColor.xyz;\n\t\t\tgl_FragColor = gl_FragColor * texelColor;\n\t\t#else\n\t\t\tgl_FragColor = gl_FragColor * texture2D( tDiffuse, vUv );\n\t\t#endif\n\t}\n\tif( enableAO ) {\n\t\t#ifdef GAMMA_INPUT\n\t\t\tvec4 aoColor = texture2D( tAO, vUv );\n\t\t\taoColor.xyz *= aoColor.xyz;\n\t\t\tgl_FragColor.xyz = gl_FragColor.xyz * aoColor.xyz;\n\t\t#else\n\t\t\tgl_FragColor.xyz = gl_FragColor.xyz * texture2D( tAO, vUv ).xyz;\n\t\t#endif\n\t}", +THREE.ShaderChunk.alphatest_fragment,"\tif( enableSpecular )\n\t\tspecularTex = texture2D( tSpecular, vUv ).xyz;\n\tmat3 tsb = mat3( normalize( vTangent ), normalize( vBinormal ), normalize( vNormal ) );\n\tvec3 finalNormal = tsb * normalTex;\n\t#ifdef FLIP_SIDED\n\t\tfinalNormal = -finalNormal;\n\t#endif\n\tvec3 normal = normalize( finalNormal );\n\tvec3 viewPosition = normalize( vViewPosition );\n\t#if MAX_POINT_LIGHTS > 0\n\t\tvec3 pointDiffuse = vec3( 0.0 );\n\t\tvec3 pointSpecular = vec3( 0.0 );\n\t\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\t\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\t\tvec3 pointVector = lPosition.xyz + vViewPosition.xyz;\n\t\t\tfloat pointDistance = 1.0;\n\t\t\tif ( pointLightDistance[ i ] > 0.0 )\n\t\t\t\tpointDistance = 1.0 - min( ( length( pointVector ) / pointLightDistance[ i ] ), 1.0 );\n\t\t\tpointVector = normalize( pointVector );\n\t\t\t#ifdef WRAP_AROUND\n\t\t\t\tfloat pointDiffuseWeightFull = max( dot( normal, pointVector ), 0.0 );\n\t\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dot( normal, pointVector ) + 0.5, 0.0 );\n\t\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\t\t\t#else\n\t\t\t\tfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\n\t\t\t#endif\n\t\t\tpointDiffuse += pointDistance * pointLightColor[ i ] * diffuse * pointDiffuseWeight;\n\t\t\tvec3 pointHalfVector = normalize( pointVector + viewPosition );\n\t\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\t\tfloat pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( pointVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\t\tpointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance * specularNormalization;\n\t\t}\n\t#endif\n\t#if MAX_SPOT_LIGHTS > 0\n\t\tvec3 spotDiffuse = vec3( 0.0 );\n\t\tvec3 spotSpecular = vec3( 0.0 );\n\t\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\t\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\t\tvec3 spotVector = lPosition.xyz + vViewPosition.xyz;\n\t\t\tfloat spotDistance = 1.0;\n\t\t\tif ( spotLightDistance[ i ] > 0.0 )\n\t\t\t\tspotDistance = 1.0 - min( ( length( spotVector ) / spotLightDistance[ i ] ), 1.0 );\n\t\t\tspotVector = normalize( spotVector );\n\t\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\t\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\t\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\t\t\t\t#ifdef WRAP_AROUND\n\t\t\t\t\tfloat spotDiffuseWeightFull = max( dot( normal, spotVector ), 0.0 );\n\t\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dot( normal, spotVector ) + 0.5, 0.0 );\n\t\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\t\t\t\t#else\n\t\t\t\t\tfloat spotDiffuseWeight = max( dot( normal, spotVector ), 0.0 );\n\t\t\t\t#endif\n\t\t\t\tspotDiffuse += spotDistance * spotLightColor[ i ] * diffuse * spotDiffuseWeight * spotEffect;\n\t\t\t\tvec3 spotHalfVector = normalize( spotVector + viewPosition );\n\t\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\t\tfloat spotSpecularWeight = specularTex.r * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\t\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( spotVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\t\tspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * spotDistance * specularNormalization * spotEffect;\n\t\t\t}\n\t\t}\n\t#endif\n\t#if MAX_DIR_LIGHTS > 0\n\t\tvec3 dirDiffuse = vec3( 0.0 );\n\t\tvec3 dirSpecular = vec3( 0.0 );\n\t\tfor( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\n\t\t\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n\t\t\tvec3 dirVector = normalize( lDirection.xyz );\n\t\t\t#ifdef WRAP_AROUND\n\t\t\t\tfloat directionalLightWeightingFull = max( dot( normal, dirVector ), 0.0 );\n\t\t\t\tfloat directionalLightWeightingHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );\n\t\t\t\tvec3 dirDiffuseWeight = mix( vec3( directionalLightWeightingFull ), vec3( directionalLightWeightingHalf ), wrapRGB );\n\t\t\t#else\n\t\t\t\tfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\n\t\t\t#endif\n\t\t\tdirDiffuse += directionalLightColor[ i ] * diffuse * dirDiffuseWeight;\n\t\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\t\tfloat dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\t\tdirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\t\t}\n\t#endif\n\t#if MAX_HEMI_LIGHTS > 0\n\t\tvec3 hemiDiffuse = vec3( 0.0 );\n\t\tvec3 hemiSpecular = vec3( 0.0 );\n\t\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\t\t\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n\t\t\tvec3 lVector = normalize( lDirection.xyz );\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\t\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\t\t\themiDiffuse += diffuse * hemiColor;\n\t\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\t\tfloat hemiSpecularWeightSky = specularTex.r * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\t\t\tvec3 lVectorGround = -lVector;\n\t\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\t\tfloat hemiSpecularWeightGround = specularTex.r * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\t\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\t\themiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\t\t}\n\t#endif\n\tvec3 totalDiffuse = vec3( 0.0 );\n\tvec3 totalSpecular = vec3( 0.0 );\n\t#if MAX_DIR_LIGHTS > 0\n\t\ttotalDiffuse += dirDiffuse;\n\t\ttotalSpecular += dirSpecular;\n\t#endif\n\t#if MAX_HEMI_LIGHTS > 0\n\t\ttotalDiffuse += hemiDiffuse;\n\t\ttotalSpecular += hemiSpecular;\n\t#endif\n\t#if MAX_POINT_LIGHTS > 0\n\t\ttotalDiffuse += pointDiffuse;\n\t\ttotalSpecular += pointSpecular;\n\t#endif\n\t#if MAX_SPOT_LIGHTS > 0\n\t\ttotalDiffuse += spotDiffuse;\n\t\ttotalSpecular += spotSpecular;\n\t#endif\n\t#ifdef METAL\n\t\tgl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient + totalSpecular );\n\t#else\n\t\tgl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\n\t#endif\n\tif ( enableReflection ) {\n\t\tvec3 vReflect;\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tif ( useRefract ) {\n\t\t\tvReflect = refract( cameraToVertex, normal, refractionRatio );\n\t\t} else {\n\t\t\tvReflect = reflect( cameraToVertex, normal );\n\t\t}\n\t\tvec4 cubeColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\n\t\t#ifdef GAMMA_INPUT\n\t\t\tcubeColor.xyz *= cubeColor.xyz;\n\t\t#endif\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularTex.r * reflectivity );\n\t}", +THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["attribute vec4 tangent;\nuniform vec2 uOffset;\nuniform vec2 uRepeat;\nuniform bool enableDisplacement;\n#ifdef VERTEX_TEXTURES\n\tuniform sampler2D tDisplacement;\n\tuniform float uDisplacementScale;\n\tuniform float uDisplacementBias;\n#endif\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 vViewPosition;", +THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,"\t#ifdef USE_SKINNING\n\t\tvNormal = normalize( normalMatrix * skinnedNormal.xyz );\n\t\tvec4 skinnedTangent = skinMatrix * vec4( tangent.xyz, 0.0 );\n\t\tvTangent = normalize( normalMatrix * skinnedTangent.xyz );\n\t#else\n\t\tvNormal = normalize( normalMatrix * normal );\n\t\tvTangent = normalize( normalMatrix * tangent.xyz );\n\t#endif\n\tvBinormal = normalize( cross( vNormal, vTangent ) * tangent.w );\n\tvUv = uv * uRepeat + uOffset;\n\tvec3 displacedPosition;\n\t#ifdef VERTEX_TEXTURES\n\t\tif ( enableDisplacement ) {\n\t\t\tvec3 dv = texture2D( tDisplacement, uv ).xyz;\n\t\t\tfloat df = uDisplacementScale * dv.x + uDisplacementBias;\n\t\t\tdisplacedPosition = position + normalize( normal ) * df;\n\t\t} else {\n\t\t\t#ifdef USE_SKINNING\n\t\t\t\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\t\t\t\tvec4 skinned = vec4( 0.0 );\n\t\t\t\tskinned += boneMatX * skinVertex * skinWeight.x;\n\t\t\t\tskinned += boneMatY * skinVertex * skinWeight.y;\n\t\t\t\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\t\t\t\tskinned += boneMatW * skinVertex * skinWeight.w;\n\t\t\t\tskinned = bindMatrixInverse * skinned;\n\t\t\t\tdisplacedPosition = skinned.xyz;\n\t\t\t#else\n\t\t\t\tdisplacedPosition = position;\n\t\t\t#endif\n\t\t}\n\t#else\n\t\t#ifdef USE_SKINNING\n\t\t\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\t\t\tvec4 skinned = vec4( 0.0 );\n\t\t\tskinned += boneMatX * skinVertex * skinWeight.x;\n\t\t\tskinned += boneMatY * skinVertex * skinWeight.y;\n\t\t\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\t\t\tskinned += boneMatW * skinVertex * skinWeight.w;\n\t\t\tskinned = bindMatrixInverse * skinned;\n\t\t\tdisplacedPosition = skinned.xyz;\n\t\t#else\n\t\t\tdisplacedPosition = position;\n\t\t#endif\n\t#endif\n\tvec4 mvPosition = modelViewMatrix * vec4( displacedPosition, 1.0 );\n\tvec4 worldPosition = modelMatrix * vec4( displacedPosition, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;", +THREE.ShaderChunk.logdepthbuf_vertex,"\tvWorldPosition = worldPosition.xyz;\n\tvViewPosition = -mvPosition.xyz;\n\t#ifdef USE_SHADOWMAP\n\t\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\t\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\t\t}\n\t#endif\n}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\tvWorldPosition = worldPosition.xyz;\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", +THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex, +"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {", +THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}}; +THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var e in d.attributes){var f=d.attributes[e];if(!f.__webglInitialized||f.createUniqueBuffers){f.__webglInitialized=!0;var g=1;"v2"===f.type?g=2:"v3"===f.type?g=3:"v4"===f.type?g=4:"c"===f.type&&(g=3);f.size=g;f.array=new Float32Array(c*g);f.buffer=m.createBuffer();f.buffer.belongsToAttribute=e;f.needsUpdate=!0}a.__webglCustomAttributesList.push(f)}}} +function c(a,b){var c=b.geometry,g=a.faces3,h=3*g.length,k=1*g.length,l=3*g.length,g=d(b,a),n=f(g),r=e(g),p=g.vertexColors?g.vertexColors:!1;a.__vertexArray=new Float32Array(3*h);r&&(a.__normalArray=new Float32Array(3*h));c.hasTangents&&(a.__tangentArray=new Float32Array(4*h));p&&(a.__colorArray=new Float32Array(3*h));n&&(0ja;ja++)Da=R[ja], +yb[gb]=Da.x,yb[gb+1]=Da.y,yb[gb+2]=Da.z,gb+=3;else for(ja=0;3>ja;ja++)yb[gb]=ba.x,yb[gb+1]=ba.y,yb[gb+2]=ba.z,gb+=3;m.bindBuffer(m.ARRAY_BUFFER,y.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,yb,I)}if(xb&&Hb&&Q){B=0;for(N=ka.length;Bja;ja++)Ga=V[ja],cb[Sa]=Ga.x,cb[Sa+1]=Ga.y,Sa+=2;0ja;ja++)Ya=za[ja],fb[Za]=Ya.x,fb[Za+1]=Ya.y,Za+=2;0c;c++)G.autoScaleCubemaps&&!U?(g=h,f=c,r=a.image[c],u=sc,r.width<=u&&r.height<=u||(v=Math.max(r.width,r.height),q=Math.floor(r.width*u/v),u=Math.floor(r.height*u/v),v=document.createElement("canvas"),v.width=q,v.height=u,v.getContext("2d").drawImage(r,0,0,r.width,r.height,0,0,q,u),r=v),g[f]=r):h[c]=a.image[c];c=h[0];g=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height); +f=B(a.format);r=B(a.type);E(m.TEXTURE_CUBE_MAP,a,g);for(c=0;6>c;c++)if(U)for(u=h[c].mipmaps,v=0,x=u.length;v=Qb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Qb);qa+=1;return a}function N(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)} +function ba(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function P(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function O(a){a!==xa&&(m.lineWidth(a),xa=a)}function J(a,b,c){Qa!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),Qa=a);!a||cb===b&&Ga===c||(m.polygonOffset(b,c),cb=b,Ga=c)}function E(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,B(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,B(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,B(b.magFilter)),m.texParameteri(a, +m.TEXTURE_MIN_FILTER,B(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,R(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,R(b.minFilter)));Ta&&b.type!==THREE.FloatType&&(1b;b++)m.deleteFramebuffer(a.__webglFramebuffer[b]),m.deleteRenderbuffer(a.__webglRenderbuffer[b]);else m.deleteFramebuffer(a.__webglFramebuffer),m.deleteRenderbuffer(a.__webglRenderbuffer); +G.info.memory.textures--},ic=function(a){a=a.target;a.removeEventListener("dispose",ic);Nb(a)},Tb=function(a){void 0!==a.__webglVertexBuffer&&m.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&m.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&m.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&m.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&m.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&m.deleteBuffer(a.__webglUV2Buffer); +void 0!==a.__webglSkinIndicesBuffer&&m.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&m.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&m.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&m.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&m.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)m.deleteBuffer(a.__webglCustomAttributesList[b].buffer); +G.info.memory.geometries--},Nb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Ba.length;ad.numSupportedMorphTargets?(h.sort(t),h.length=d.numSupportedMorphTargets):h.length>d.numSupportedMorphNormals?h.sort(t):0===h.length&&h.push([0,0]);for(p=0;pf;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer(); +m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);Q(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture), +E(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer): +Q(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=wb,a=sb,d=ma,e=Ja);b!==Za&&(m.bindFramebuffer(m.FRAMEBUFFER,b),m.viewport(d,e,c,a),Za=b);Hb=c;Ib=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin); +this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)}; +THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format: +THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null}; +THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps; +a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype); +THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,l=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var r="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?r="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(r="SHADOWMAP_TYPE_PCF_SOFT");var t,s;t=[];for(var p in g)s=g[p],!1!==s&&(s="#define "+p+" "+s,t.push(s)); +t=t.join("\n");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",t,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+ +e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND": +"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"), +b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",t,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG": +"",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP": +"",e.shadowMapEnabled?"#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));l=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+l);n=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+n);f.attachShader(g,l);f.attachShader(g,n);void 0!==q&&f.bindAttribLocation(g,0,q);f.linkProgram(g);!1===f.getProgramParameter(g,f.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."), +console.error("gl.VALIDATE_STATUS",f.getProgramParameter(g,f.VALIDATE_STATUS)),console.error("gl.getError()",f.getError()));""!==f.getProgramInfoLog(g)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f.getProgramInfoLog(g));f.deleteShader(l);f.deleteShader(n);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")): +q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var v in h)q.push(v);h=q;v={};q=0;for(b=h.length;qq-1?0:q-1,t=q+1>e-1?e-1:q+1,s=0>n-1?0:n-1,p=n+1>d-1?d-1:n+1,v=[],w=[0,0,h[4*(q*d+n)]/255*b];v.push([-1,0,h[4*(q*d+s)]/255*b]);v.push([-1,-1,h[4*(r*d+s)]/255*b]);v.push([0,-1,h[4*(r*d+n)]/255*b]);v.push([1,-1,h[4*(r*d+p)]/255*b]);v.push([1,0,h[4*(q*d+p)]/255*b]);v.push([1,1,h[4*(t*d+p)]/255*b]);v.push([0,1,h[4*(t*d+n)]/255* +b]);v.push([-1,1,h[4*(t*d+s)]/255*b]);r=[];s=v.length;for(t=0;te)return null;var f=[],g=[],h=[],k,l,n;if(0=q--){console.log("Warning, unable to triangulate polygon!");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var r;a:{var t=r=void 0,s=void 0,p=void 0,v=void 0,w=void 0,u=void 0,D=void 0,A= +void 0,t=a[g[k]].x,s=a[g[k]].y,p=a[g[l]].x,v=a[g[l]].y,w=a[g[n]].x,u=a[g[n]].y;if(1E-10>(p-t)*(u-s)-(v-s)*(w-t))r=!1;else{var x=void 0,C=void 0,I=void 0,z=void 0,y=void 0,K=void 0,N=void 0,ba=void 0,P=void 0,O=void 0,P=ba=N=A=D=void 0,x=w-p,C=u-v,I=t-w,z=s-u,y=p-t,K=v-s;for(r=0;rk)g=d+1;else if(0b&&(b=0);1=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]}; +THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;cb?b=h.x:h.xc?c=h.y:h.yd?d=h.z:h.zMath.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c}; +THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;cl&&(g=b[f],k=-k,h=b[e],l=-l),!(a.yh.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<= +h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;bz||z>I)return[];k=l*n-k*q;if(0>k||k>I)return[]}else{if(0d?[]:k==d?f?[]:[g]:a<=d?[g,h]: +[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1; +d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;cO){console.log("Infinite Loop! Holes left:"+ +l.length+", Probably Hole outside Shape!");break}for(q=K;qh;h++)l=k[h].x+":"+k[h].y, +l=n[l],void 0!==l&&(k[h]=l);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a, +b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()}; +THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)}; +THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype); +THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b}; +THREE.SplineCurve=function(a){this.points=void 0==a?[]:a};THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],d=this.points,e;e=(d.length-1)*a;a=Math.floor(e);e-=a;c[0]=0==a?a:a-1;c[1]=a;c[2]=a>d.length-2?d.length-1:a+1;c[3]=a>d.length-3?d.length-1:a+2;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);return b}; +THREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a;this.aY=b;this.xRadius=c;this.yRadius=d;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=g};THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype); +THREE.EllipseCurve.prototype.getPoint=function(a){var b;b=this.aEndAngle-this.aStartAngle;0>b&&(b+=2*Math.PI);b>2*Math.PI&&(b-=2*Math.PI);b=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b;a=this.aX+this.xRadius*Math.cos(b);b=this.aY+this.yRadius*Math.sin(b);return new THREE.Vector2(a,b)};THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)};THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype); +THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.subVectors(this.v2,this.v1);b.multiplyScalar(a);b.add(this.v1);return b});THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b,c;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);c=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);a=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(b,c,a)}); +THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b,c;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);c=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);a=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(b,c,a)}); +THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;a*=d.length-1;e=Math.floor(a);a-=e;c[0]=0==e?e:e-1;c[1]=e;c[2]=e>d.length-2?d.length-1:e+1;c[3]=e>d.length-3?d.length-1:e+2;e=d[c[0]];var f=d[c[1]],g=d[c[2]],c=d[c[3]];b.x=THREE.Curve.Utils.interpolate(e.x,f.x,g.x,c.x,a);b.y=THREE.Curve.Utils.interpolate(e.y,f.y,g.y,c.y,a);b.z=THREE.Curve.Utils.interpolate(e.z,f.z,g.z,c.z,a);return b}); +THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;e=(d.length-0)*a;a=Math.floor(e);e-=a;a+=0a.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time= +0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){d={};for(c=0;cd;d++){for(var e= +this.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.timef.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}}; +THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,r,t,s,p;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];s=a[c[2]];p=a[c[3]];c=e*e;r=e*c;d[0]=f(q[0],t[0],s[0],p[0],e,c,r);d[1]=f(q[1],t[1],s[1],p[1],e,c,r);d[2]=f(q[2],t[2],s[2],p[2],e,c,r);return d},f=function(a,b,c,d,e,f,r){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)* +r+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(!0===this.loop&&this.currentTime>f)this.currentTime%=f,this.reset();else if(!1===this.loop&&this.currentTime>f){this.stop();return}f=0;for(var h=this.hierarchy.length;fn;n++){var q=this.keyTypes[n],r=l.prevKey[q],t=l.nextKey[q];if(t.time<=this.currentTime){r=this.data.hierarchy[f].keys[0]; +for(t=this.getNextKeyWith(q,f,1);t.timer.index;)r=t,t=this.getNextKeyWith(q,f,t.index+1);l.prevKey[q]=r;l.nextKey[q]=t}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var s=(this.currentTime-r.time)/(t.time-r.time),p=r[q],v=t[q];0>s&&(s=0);1a&&(this.currentTime%=a);this.currentTime=Math.min(this.currentTime,a);a=0;for(var b=this.hierarchy.length;af.index;)f=g,g=e[f.index+1];d.prevKey= +f;d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.interpolate(g,g.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorldNeedsUpdate=!0}}}};THREE.KeyFrameAnimation.prototype.getNextKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c%=b.length;cthis.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);c=this.duration/this.frames;var d=Math.floor(this.currentTime/c);d!=b&&(this.mesh.morphTargetInfluences[a]=0,this.mesh.morphTargetInfluences[b]=1,this.mesh.morphTargetInfluences[d]= +0,a=b,b=d);this.mesh.morphTargetInfluences[d]=this.currentTime%c/c;this.mesh.morphTargetInfluences[a]=1-this.mesh.morphTargetInfluences[d]}}}()}; +THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,p){var v,w=h.widthSegments,u=h.heightSegments,D=e/2,A=f/2,x=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",u=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var C=w+1,I=u+1,z=e/w,y=f/u,K=new THREE.Vector3;K[v]=0=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else a=!1,1E-10e?-1E-10>g&& +(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(H=c.length;0<=--H;){e=H;f=H-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;gMath.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(l,1-g),new THREE.Vector2(q,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-f),new THREE.Vector2(n,1-g),new THREE.Vector2(r,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2; +THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;cc&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+0.5, +a.y));return a.clone()}THREE.Geometry.call(this);c=c||1;d=d||0;for(var k=this,l=0,n=a.length;lt&&(0.2>d&&(b[0].x+=1),0.2>a&&(b[1].x+=1),0.2>q&&(b[2].x+=1));l=0;for(n=this.vertices.length;lc.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}(); +THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=0.2*a);void 0===c&&(c=0.2*b);this.line.scale.set(1,a,1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)}; +THREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3));THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);void 0!==a&&this.update(a)};THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype); +THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.geometry.attributes.position.array;d[0]=b.x;d[1]=b.y;d[2]=b.z;d[3]=c.x;d[4]=b.y;d[5]=b.z;d[6]=c.x;d[7]=b.y;d[8]=b.z;d[9]=c.x;d[10]=c.y;d[11]=b.z;d[12]=c.x;d[13]=c.y;d[14]=b.z;d[15]=b.x;d[16]=c.y;d[17]=b.z;d[18]=b.x;d[19]=c.y;d[20]=b.z;d[21]=b.x;d[22]=b.y;d[23]=b.z;d[24]=b.x;d[25]=b.y;d[26]=c.z;d[27]=c.x;d[28]=b.y;d[29]=c.z;d[30]=c.x;d[31]=b.y; +d[32]=c.z;d[33]=c.x;d[34]=c.y;d[35]=c.z;d[36]=c.x;d[37]=c.y;d[38]=c.z;d[39]=b.x;d[40]=c.y;d[41]=c.z;d[42]=b.x;d[43]=c.y;d[44]=c.z;d[45]=b.x;d[46]=b.y;d[47]=c.z;d[48]=b.x;d[49]=b.y;d[50]=b.z;d[51]=b.x;d[52]=b.y;d[53]=c.z;d[54]=c.x;d[55]=b.y;d[56]=b.z;d[57]=c.x;d[58]=b.y;d[59]=c.z;d[60]=c.x;d[61]=c.y;d[62]=b.z;d[63]=c.x;d[64]=c.y;d[65]=c.z;d[66]=b.x;d[67]=c.y;d[68]=b.z;d[69]=b.x;d[70]=c.y;d[71]=c.z;this.geometry.attributes.position.needsUpdate=!0;this.geometry.computeBoundingSphere();this.matrixAutoUpdate= +!1;this.matrixWorld=a.matrixWorld};THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a;this.box=new THREE.Box3;THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)}; +THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3);d.colors.push(new THREE.Color(b));void 0===f[a]&&(f[a]=[]);f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b("n1","n2",16755200);b("n2","n4",16755200);b("n4","n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);b("n1","f1",16755200); +b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()}; +THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype); +THREE.CameraHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Camera,c=new THREE.Projector;return function(){function d(d,g,h,k){a.set(g,h,k);c.unprojectVector(a,b);d=e.pointMap[d];if(void 0!==d)for(g=0,h=d.length;gs;s++){d[0]=t[g[s]];d[1]=t[g[(s+1)%3]];d.sort(f);var p=d.toString();void 0===e[p]?(e[p]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},n++):e[p].face2=q}h.addAttribute("position",new THREE.Float32Attribute(6*n,3));d=h.attributes.position.array; +f=0;for(p in e)if(g=e[p],void 0===g.face2||0.9999>k[g.face1].normal.dot(k[g.face2].normal))n=l[g.vert1],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z,n=l[g.vert2],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z;THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype); +THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;cb;b++)a.faces[b].color=this.colors[4>b?0:1];b=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(a,b);this.add(this.lightSphere); +this.update()};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose();this.lightSphere.material.dispose()}; +THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=!0}}(); +THREE.PointLightHelper=function(a,b){this.light=a;this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrixWorld=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()}; +THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}; +THREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;cp;p++){d[0]=s[g[p]];d[1]=s[g[(p+1)%3]];d.sort(f);var v=d.toString();void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++)}d=new Float32Array(6*n);r=0;for(t=n;rp;p++)n= +k[q[2*r+p]],g=6*r+3*p,d[g+0]=n.x,d[g+1]=n.y,d[g+2]=n.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){for(var k=a.geometry.attributes.position.array,t=a.geometry.attributes.index.array,l=a.geometry.offsets,n=0,q=new Uint32Array(2*t.length),s=0,w=l.length;sp;p++)d[0]=g+t[r+p],d[1]=g+t[r+(p+1)%3],d.sort(f),v=d.toString(), +void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++);d=new Float32Array(6*n);r=0;for(t=n;rp;p++)g=6*r+3*p,n=3*q[2*r+p],d[g+0]=k[n],d[g+1]=k[n+1],d[g+2]=k[n+2]}else for(k=a.geometry.attributes.position.array,n=k.length/3,q=n/3,d=new Float32Array(6*n),r=0,t=q;rp;p++)g=18*r+6*p,q=9*r+3*p,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],n=9*r+(p+1)%3*3,d[g+3]=k[n],d[g+4]=k[n+1],d[g+5]=k[n+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}), +THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)}; +THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})}; +THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;ah.end&&(h.end=f);c||(c=k)}}for(k in d)h=d[k],this.createAnimation(k,h.start,h.end,a);this.firstAnimation=c}; +THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a])a.direction=1,a.directionBackwards=!1};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){if(a=this.animationsMap[a])a.direction=-1,a.directionBackwards=!0};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)}; +THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b}; +THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1}; +THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;bd.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight; +f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}}; +THREE.LensFlarePlugin=function(){function a(a,b){var d=c.createProgram(),e=c.createShader(c.FRAGMENT_SHADER),f=c.createShader(c.VERTEX_SHADER),g="precision "+b+" float;\n";c.shaderSource(e,g+a.fragmentShader);c.shaderSource(f,g+a.vertexShader);c.compileShader(e);c.compileShader(f);c.attachShader(d,e);c.attachShader(d,f);c.linkProgram(d);return d}var b=[],c,d,e,f,g,h,k,l,n,q,r,t,s;this.init=function(b){c=b.context;d=b;e=b.getPrecision();f=new Float32Array(16);g=new Uint16Array(6);b=0;f[b++]=-1;f[b++]= +-1;f[b++]=0;f[b++]=0;f[b++]=1;f[b++]=-1;f[b++]=1;f[b++]=0;f[b++]=1;f[b++]=1;f[b++]=1;f[b++]=1;f[b++]=-1;f[b++]=1;f[b++]=0;f[b++]=1;b=0;g[b++]=0;g[b++]=1;g[b++]=2;g[b++]=0;g[b++]=2;g[b++]=3;h=c.createBuffer();k=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,h);c.bufferData(c.ARRAY_BUFFER,f,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.bufferData(c.ELEMENT_ARRAY_BUFFER,g,c.STATIC_DRAW);l=c.createTexture();n=c.createTexture();c.bindTexture(c.TEXTURE_2D,l);c.texImage2D(c.TEXTURE_2D,0,c.RGB,16, +16,0,c.RGB,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);c.bindTexture(c.TEXTURE_2D,n);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,16,16,0,c.RGBA,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE); +c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);0>=c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(q=!1,r=a(THREE.ShaderFlares.lensFlare,e)):(q=!0,r=a(THREE.ShaderFlares.lensFlareVertexTexture,e));t={};s={};t.vertex=c.getAttribLocation(r,"position");t.uv=c.getAttribLocation(r,"uv");s.renderType=c.getUniformLocation(r,"renderType");s.map=c.getUniformLocation(r,"map");s.occlusionMap=c.getUniformLocation(r,"occlusionMap");s.opacity= +c.getUniformLocation(r,"opacity");s.color=c.getUniformLocation(r,"color");s.scale=c.getUniformLocation(r,"scale");s.rotation=c.getUniformLocation(r,"rotation");s.screenPosition=c.getUniformLocation(r,"screenPosition")};this.render=function(a,e,f,g){b.length=0;a.traverseVisible(function(a){a instanceof THREE.LensFlare&&b.push(a)});if(0!==b.length){a=new THREE.Vector3;var D=g/f,A=0.5*f,x=0.5*g,C=16/g,I=new THREE.Vector2(C*D,C),z=new THREE.Vector3(1,1,0),y=new THREE.Vector2(1,1),K=s,C=t;c.useProgram(r); +c.enableVertexAttribArray(t.vertex);c.enableVertexAttribArray(t.uv);c.uniform1i(K.occlusionMap,0);c.uniform1i(K.map,1);c.bindBuffer(c.ARRAY_BUFFER,h);c.vertexAttribPointer(C.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(C.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.disable(c.CULL_FACE);c.depthMask(!1);for(var N=0,ba=b.length;NK;K++)C[K]=new THREE.Vector3,A[K]=new THREE.Vector3;C=x.shadowCascadeNearZ[y];x=x.shadowCascadeFarZ[y];A[0].set(-1,-1,C);A[1].set(1,-1,C);A[2].set(-1,1,C);A[3].set(1,1,C);A[4].set(-1,-1,x);A[5].set(1,-1,x);A[6].set(-1,1,x);A[7].set(1,1,x);z.originalCamera=s;A=new THREE.Gyroscope; +A.position.copy(w.shadowCascadeOffset);A.add(z);A.add(z.target);s.add(A);w.shadowCascadeArray[D]=z;console.log("Created virtualLight",z)}y=w;C=D;x=y.shadowCascadeArray[C];x.position.copy(y.position);x.target.position.copy(y.target.position);x.lookAt(x.target);x.shadowCameraVisible=y.shadowCameraVisible;x.shadowDarkness=y.shadowDarkness;x.shadowBias=y.shadowCascadeBias[C];A=y.shadowCascadeNearZ[C];y=y.shadowCascadeFarZ[C];x=x.pointsFrustum;x[0].z=A;x[1].z=A;x[2].z=A;x[3].z=A;x[4].z=y;x[5].z=y;x[6].z= +y;x[7].z=y;I[u]=z;u++}else I[u]=w,u++;p=0;for(v=I.length;py;y++)C=x[y],C.copy(A[y]),THREE.ShadowMapPlugin.__projector.unprojectVector(C,D),C.applyMatrix4(u.matrixWorldInverse),C.xn.x&&(n.x=C.x),C.yn.y&&(n.y=C.y),C.zn.z&&(n.z=C.z);u.left=l.x;u.right=n.x;u.top=n.y;u.bottom=l.y;u.updateProjectionMatrix()}u=w.shadowMap;A=w.shadowMatrix; +D=w.shadowCamera;D.position.setFromMatrixPosition(w.matrixWorld);q.setFromMatrixPosition(w.target.matrixWorld);D.lookAt(q);D.updateMatrixWorld();D.matrixWorldInverse.getInverse(D.matrixWorld);w.cameraHelper&&(w.cameraHelper.visible=w.shadowCameraVisible);w.shadowCameraVisible&&w.cameraHelper.update();A.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);A.multiply(D.projectionMatrix);A.multiply(D.matrixWorldInverse);k.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse);h.setFromMatrix(k);c.setRenderTarget(u); +c.clear();r.length=0;a(t,t,D);w=0;for(u=r.length;w 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); +u.compileShader(x);u.compileShader(P);u.attachShader(w,x);u.attachShader(w,P);u.linkProgram(w);K=w;p=u.getAttribLocation(K,"position");v=u.getAttribLocation(K,"uv");a=u.getUniformLocation(K,"uvOffset");b=u.getUniformLocation(K,"uvScale");c=u.getUniformLocation(K,"rotation");d=u.getUniformLocation(K,"scale");e=u.getUniformLocation(K,"color");f=u.getUniformLocation(K,"map");g=u.getUniformLocation(K,"opacity");h=u.getUniformLocation(K,"modelViewMatrix");k=u.getUniformLocation(K,"projectionMatrix");l= +u.getUniformLocation(K,"fogType");n=u.getUniformLocation(K,"fogDensity");q=u.getUniformLocation(K,"fogNear");r=u.getUniformLocation(K,"fogFar");t=u.getUniformLocation(K,"fogColor");s=u.getUniformLocation(K,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;x=w.getContext("2d");x.fillStyle="white";x.fillRect(0,0,8,8);A=new THREE.Texture(w);A.needsUpdate=!0};this.render=function(C,I,P,O){x.length=0;C.traverseVisible(function(a){a instanceof THREE.Sprite&&x.push(a)});if(0!==x.length){u.useProgram(K); +u.enableVertexAttribArray(p);u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,z);u.vertexAttribPointer(p,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,y);u.uniformMatrix4fv(k,!1,I.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(f,0);O=P=0;var J=C.fog;J?(u.uniform3f(t,J.color.r,J.color.g,J.color.b),J instanceof THREE.Fog?(u.uniform1f(q,J.near),u.uniform1f(r,J.far),u.uniform1i(l,1), +O=P=1):J instanceof THREE.FogExp2&&(u.uniform1f(n,J.density),u.uniform1i(l,2),O=P=2)):(u.uniform1i(l,0),O=P=0);for(var J=0,E=x.length;J'+ clickText +'') + .appendTo($tabList); + $tab.on("click", Zin.selectIframeTabEvent); + $tab.find(".z-refresh").on("click", Zin.refreshIframeTabClick); + $tab.find(".z-error").on("click", Zin.closeIframeTabClick); + + $iframe = Z('
            ') + .appendTo(".iframenav-cont"); + + //3.选中自己,调整位置偏移,显示完整选项卡 + Zin.selectIframeTab(elemId); +}; + +/**************************************************/ +//3个iframenav的点击事件(其中刷新暂时没有添加) +/**************************************************/ + +Zin.selectIframeTabEvent = function(event) +{//点击选项卡标签页 + var $tab = Z.E.current(event); + var tabId = $tab.id; + Zin.selectIframeTab(tabId.replace("tab_", "")); +}; + +Zin.refreshIframeTabClick = function(event) +{//点击选项卡上的刷新按钮 + var $refresh = Z(Z.E.current(event)); + var tabId = $refresh.parent()[0].id; + Zin.refreshIframeTab(tabId.replace("tab_", "")); +}; + +Zin.closeIframeTabClick = function(event) +{//点击选项卡上的关闭按钮 + var $close = Z(Z.E.current(event)); + var tabId = $close.parent()[0].id; + Zin.closeIframeTab(tabId.replace("tab_", "")); +}; + +/**************************************************/ +//指定操作功能 +/**************************************************/ + +Zin.selectIframeTab = function(id) +{//选择指定的选项卡 + Z("#tab_"+id).addClass("active").siblings(".iframenav-tab-item").removeClass("active"); + Z("#iframe_"+id).addClass("active").siblings(".iframenav-cont-item").removeClass("active"); + Zin.setTranslateForShowActive(); + + var mainUrl = Z("#iframe_"+id+" iframe").attr("src"); + if (mainUrl) + {//切换选项卡同步到后端,关闭选项卡时为null不处理,整页刷新时依然使用关闭的URL + var $elem = Z("#" + id); + $elem.parent().parent().find("li").removeClass("active"); + $elem.addClass("active"); + + mainUrl = mainUrl.substring(location.origin.length); + Z.ajax().setContextPath(Zin.contextPath) + .setClassName("sessionUser").setMethodName("setMainUrl").addParam(mainUrl) + .execute(); + } +}; + +Zin.refreshIframeTab = function(id) +{//刷新指定框架 + Z("#iframe_" + id).find("iframe")[0].contentWindow.location.reload(true); +}; + +Zin.closeIframeTab = function(id) +{//关闭指定框架,并切换到前一个框架 + var $currTab = Z("#tab_" + id); + var $prevTab = Z($currTab[0].previousElementSibling || Z(".iframenav-tab-item:first-child")[0]); + + //删除当前框架,同时选中前一个为活动 + Zin.closeIframeTabOnly(id); + Zin.selectIframeTab($prevTab[0].id.replace("tab_", "")); +}; + +Zin.closeIframeTabOnly = function(id) +{//仅关闭指定框架 + Z("#tab_" + id).remove(); + Z("#iframe_" + id).remove(); +}; + +Zin.setTranslateForShowActive = function() +{//调整位置偏移,显示完整选项卡 + var $tabList = Z(".iframenav-tab-list"); + var $tabs = Z(".iframenav-tab-item"); + + //1.校准宽度 + var fillWidth = 0; + $tabs.each(function(item){ + fillWidth += item.getBoundingClientRect().width; + }); + fillWidth = Math.ceil(fillWidth); + + var wrapRect = Z(".iframenav-tab-wrap")[0].getBoundingClientRect(); + $tabList.css("width", fillWidth > wrapRect.width ? fillWidth : wrapRect.width); + if (fillWidth < wrapRect.width) + $tabList.css("transform", "translate(0,0)"); + + //2.当前标签、前后两个标签,宽度信息 + var $active = Z(".iframenav-tab-item.active"); + var activeRect = $active[0].getBoundingClientRect(); + var $prev = $active[0].previousElementSibling; + var prevWidth = !!$prev ? $prev.getBoundingClientRect().width : 0; + var $next = $active[0].nextElementSibling; + var nextWidth = !!$next ? $next.getBoundingClientRect().width : 0; + + //3.计算理论偏移量 + var mLeft = activeRect.left - prevWidth - wrapRect.left; + var mRight = activeRect.right + nextWidth - wrapRect.right; + var tabTransX = parseFloat($tabList.css("transform").replace(/^[^\d]+/,"") || 0); + tabTransX = tabTransX >= 0 ? tabTransX : 0; + if (mLeft < 0 && mRight > 0) + return; + + if (mLeft < 0) + tabTransX += mLeft; + + if (mRight > 0) + tabTransX += mRight; + + $tabList.css("transform", "translate(-" + tabTransX + "px,0)"); +}; + +/**************************************************/ +//外部调用 +/**************************************************/ + +Zin.toggleIframeCtrlWrap = function() +{//切换关闭操作界面 + Z(".iframenav-ctrl-wrap").toggle(); +}; + +Zin.selectIframeTabActive = function() +{//定位到当前选项卡 + var $active = Z(".iframenav-tab-item.active"); + var tabId = $active[0].id; + Zin.selectIframeTab(tabId.replace("tab_", "")); + + Zin.toggleIframeCtrlWrap(); +} + +Zin.closeIframeTabAll = function() +{//关闭所有选项卡 + var $tab = Z(".iframenav-tab-item:not(:first-child)"); + + var idList = []; + $tab.each(function(elem){idList.push(elem.id.replace("tab_", ""));}); + idList.forEach(Zin.closeIframeTabOnly); + + //选中首页 + var $index = Z(".iframenav-tab-item:first-child"); + Zin.selectIframeTab($index[0].id.replace("tab_", "")); + Zin.toggleIframeCtrlWrap(); +}; + +Zin.closeIframeTabOther = function() +{//关闭其他选项卡 + var $tab = Z(".iframenav-tab-item:not(:first-child)"); + var $active = Z(".iframenav-tab-item.active"); + + var idList = []; + $tab.each(function(elem){if ($active[0] !== elem){idList.push(elem.id.replace("tab_",""));}}); + idList.forEach(Zin.closeIframeTabOnly); + + Zin.setTranslateForShowActive(); + Zin.toggleIframeCtrlWrap(); +}; + +Zin.refreshIframeTabActive = function() +{//刷新当前选项卡 + var $active = Z(".iframenav-tab-item.active"); + Zin.refreshIframeTab($active[0].id.replace("tab_","")); +}; + +Zin.turnIframeTab = function(isNext) +{//向前向后翻页选项卡 + var wrapWidth = Z(".iframenav-tab-wrap")[0].getBoundingClientRect().width; + var $tabList = Z(".iframenav-tab-list"); + var tabTransX = parseFloat($tabList.css("transform").replace(/^[^\d]+/,"") || 0); + tabTransX = tabTransX >= 0 ? tabTransX : 0; + + var $tabs = Z(".iframenav-tab-item"); + var listWidth = 0, fillWidth = 0; + var fillArray=[]; + + for (var i=0;i<$tabs.length;i++) + { + var tab = $tabs[i]; + var tabWidth = tab.getBoundingClientRect().width; + listWidth += tabWidth; + if (isNext) + { + if (listWidth - tabTransX > wrapWidth) + { + tabTransX = listWidth - tabWidth; + break; + } + } + else + { + fillArray.unshift(tabWidth); + if (listWidth >= tabTransX) + { + while(fillWidth < wrapWidth) + { + fillWidth += fillArray[i++]; + } + tabTransX = listWidth - fillWidth; + break; + } + } + } + + $tabList.css("transform", "translate(-" + (tabTransX >= 0 ? tabTransX : 0) + "px,0)"); +} + +//END +})(zhiqim); \ No newline at end of file diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/zhiqim_image_clipper.js b/Yangcai365_web/manage/ztmpl/zhiqim_manager/zhiqim_image_clipper.js new file mode 100644 index 0000000..37b418d --- /dev/null +++ b/Yangcai365_web/manage/ztmpl/zhiqim_manager/zhiqim_image_clipper.js @@ -0,0 +1,208 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站进行实名登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/LICENSE.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ ++(function(Z) +{ +//BEGIN + +/** + * 图片裁切 +*/ +Z.ImageClipper = Z.Class.newInstance(); +Z.ImageClipper.prototype = +{ + defaults: + { + elem : null, + ratio: 1, + state : {}, + img: null, + clipWidth: [50, 100, 150], + save: null + }, + + execute: function() + { + this.$elem = Z.$elem(this.elem, "Z.ImageClipper"); + if (this.clipWidth == null || this.clipWidth.length == 0) + { + Z.alert("[Z.ImageClipper]没有设置clipWidth,或不是数组"); + return; + } + + this.id = Z.random(10); + var html = '
            ' + + '
            ' + + '
            ' + + '
            加载中...
            ' + + '
            ' + + '
            ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '
            ' + + '
            ' + + '
            '; + + this.$elem.html(html); + this.$imageBox = this.$elem.find("#ZImageClipper_image_"+this.id); + this.$square = this.$elem.find("#ZImageClipper_square_"+this.id); + this.$loading = this.$elem.find("#ZImageClipper_loading_"+this.id).show(); + + this.image = new Image(); + Z(this.image).load(function() + { + this.$loading.hide(); + this.setBackground(); + + this.$imageBox.mousedown(this.onMouseDown, this).mousemove(this.onMouseMove, this); + Z(window).mouseup(this.onMouseUp, this); + }, this); + this.image.src = this.img; + + Z("#ZImageClipper_zoomIn_"+this.id).click(this.onZoomIn, this); + Z("#ZImageClipper_zoomOut_"+this.id).click(this.onZoomOut, this); + + this.$file = Z(""); + this.$file.appendTo("body").change(function() + { + var file = this.$file[0].files[0]; + var reader = new FileReader(); + reader.onload = Z.bind(function(e) + { + this.img = e.target.result; + this.image.src = this.img; + }, this); + + reader.readAsDataURL(file); + }, this); + + Z("#ZImageClipper_upload_"+this.id).click(function(){this.$file[0].click();}, this); + Z("#ZImageClipper_clip_"+this.id).click(function() + { + var imgData = this.getDataURL(); + var imgDiv = ''; + Z.each(this.clipWidth, function(elem){ + imgDiv += '

            '+elem+' * '+elem+'
            ' + }); + Z("#ZImageClipper_clipped_"+this.id).html(imgDiv); + }, this); + + if (Z.T.isFunction(this.save)){ + Z("#ZImageClipper_save_"+this.id).click(this.save, this); + } + }, + + setBackground: function() + { + var w = parseInt(this.image.width) * this.ratio; + var h = parseInt(this.image.height) * this.ratio; + + var pw = (400 - w) / 2; + var ph = (400 - h) / 2; + + this.$imageBox.css({ + "background-image": "url(" + this.image.src + ")", + "background-size": w +"px " + h + "px", + "background-position": pw + "px " + ph + "px", + "background-repeat": "no-repeat"}); + }, + + onMouseDown: function(e) + { + Z.E.stop(e); + this.state.dragging = true; + this.state.mouseX = e.clientX; + this.state.mouseY = e.clientY; + }, + + onMouseMove: function(e) + { + Z.E.stop(e); + if (!this.state.dragging) + return; + + var x = e.clientX - this.state.mouseX; + var y = e.clientY - this.state.mouseY; + + var bg = this.$imageBox.css('background-position').split(' '); + + var bgX = x + parseInt(bg[0]); + var bgY = y + parseInt(bg[1]); + + this.$imageBox.css('background-position', bgX +'px ' + bgY + 'px'); + + this.state.mouseX = e.clientX; + this.state.mouseY = e.clientY; + }, + + onMouseUp: function(e) + { + Z.E.stop(e); + this.state.dragging = false; + }, + + onZoomIn: function() + { + this.ratio *= 1.1; + this.setBackground(); + }, + + onZoomOut: function() + { + this.ratio *= 0.9; + this.setBackground(); + }, + + getDataURL: function() + { + var width = this.$square.offsetWidth(), + height = this.$square.offsetHeight(), + canvas = document.createElement("canvas"), + dim = this.$imageBox.css('background-position').split(' '), + size = this.$imageBox.css('background-size').split(' '), + dx = parseInt(dim[0]) - this.$imageBox.offsetWidth()/2 + width/2, + dy = parseInt(dim[1]) - this.$imageBox.offsetHeight()/2 + height/2, + dw = parseInt(size[0]), + dh = parseInt(size[1]), + sh = parseInt(this.image.height), + sw = parseInt(this.image.width); + + canvas.width = width; + canvas.height = height; + var context = canvas.getContext("2d"); + context.drawImage(this.image, 0, 0, sw, sh, dx, dy, dw, dh); + var imageData = canvas.toDataURL('image/png'); + return imageData; + }, + + getBlob: function() + { + var imageData = this.getDataURL(); + var b64 = imageData.replace('data:image/png;base64,',''); + var binary = atob(b64); + var array = []; + for (var i = 0; i < binary.length; i++) { + array.push(binary.charCodeAt(i)); + } + return new Blob([new Uint8Array(array)], {type: 'image/png'}); + } +} + +//END +})(zhiqim); \ No newline at end of file diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/zhiqim_image_clipper_default.jpg b/Yangcai365_web/manage/ztmpl/zhiqim_manager/zhiqim_image_clipper_default.jpg new file mode 100644 index 0000000..7c69caa Binary files /dev/null and b/Yangcai365_web/manage/ztmpl/zhiqim_manager/zhiqim_image_clipper_default.jpg differ diff --git a/Yangcai365_web/manage/ztmpl/zhiqim_manager/zhiqim_webgl_three.js b/Yangcai365_web/manage/ztmpl/zhiqim_manager/zhiqim_webgl_three.js new file mode 100644 index 0000000..d8408e1 --- /dev/null +++ b/Yangcai365_web/manage/ztmpl/zhiqim_manager/zhiqim_webgl_three.js @@ -0,0 +1,265 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站进行实名登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/LICENSE.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ ++(function(Z) +{ +//BEGIN + +/** + * WebGL+three.js 3D动画,当前有波浪和光线球两种 +*/ +Z.WebGLThree = Z.Class.newInstance(); +Z.WebGLThree.prototype = +{ + defaults: + { + //常量 + SEPARATION: 125, + AMOUNTX: 35, + AMOUNTY: 35, + + //传入参数 + threePath: null, + elem: null, + + //内部对象 + camera: null, + scene: null, + renderer: null, + particles_ware: [], + particles_globe: [], + + //运行时 + count: 0, + mouseX: 0, + mouseY: 0, + windowHalfX: window.innerWidth / 2, + windowHalfY: window.innerHeight / 2, + rotation_speed: .002, + timeout: null + }, + + execute: function() + { + if (Z.B.mobile || Z.B.msieVer <= 9) + {//移动端和IE9以下不支持 + return; + } + + if (this.threePath == null || this.elem == null) + {//两个参数必须,未传不处理 + return; + } + + //先加载three.js,再初始化init + this.$elem = Z.$elem(this.elem, "Z.WebGLThree"); + Z.loads(this.threePath, Z.bind(this.initWebGL, this)); + }, + + initWebGL: function() + { + var animationType = Math.floor(2 * Math.random()); + if (animationType == 0) + {//波浪 + this.initWave(); + this.animateWave(); + } + else + {//光球 + this.initGlobe(); + this.animateGlobe(); + } + + //增加事件处理 + Z(document).mousemove(this.onDocumentMouseMove, this) + .on("touchstart", this.onDocumentTouchStart, this) + .on("touchmove", this.onDocumentTouchMove, this); + Z(window).resize(this.onWindowResize, this); + }, + + /******************************************************************************************/ + //光球 + /******************************************************************************************/ + initGlobe: function initGlobe() + { + this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 1e4), + this.camera.position.z = 500, + this.scene = new THREE.Scene; + + for (var t = 2 * Math.PI, i = function (e) {e.beginPath(), e.arc(0, 0, 25, 0, t, true), e.fill()}, t = 2 * Math.PI, n = 0; 500 > n; n++) + { + var o = new THREE.SpriteCanvasMaterial({color: 16777215, + transparent: true, + program: function (e) {e.beginPath(), e.arc(0, 0, .5, 0, t, true), e.fill()}}); + var particle = new THREE.Sprite(o); + particle.position.x = 2 * Math.random() - 1; + particle.position.y = 2 * Math.random() - 1; + particle.position.z = 2 * Math.random() - 1; + particle.position.normalize(); + particle.position.multiplyScalar(10 * Math.random() + 450); + particle.scale.multiplyScalar(4 + 2 * Math.random()); + particle.material.opacity = .1; + this.scene.add(particle); + this.particles_globe.push(particle); + } + for (var n = 0; 500 > n; n++) + { + var s = new THREE.Geometry; + var r = new THREE.Vector3(2 * Math.random() - 1, 2 * Math.random() - 1, 2 * Math.random() - 1); + r.normalize(); + r.multiplyScalar(450); + s.vertices.push(r); + + var a = r.clone(); + a.multiplyScalar(.3 * Math.random() + 1), s.vertices.push(a); + var l = new THREE.Line(s, new THREE.LineBasicMaterial({color: 16777215, opacity: .3})); + this.scene.add(l) + } + this.renderer = new THREE.CanvasRenderer({alpha: true}); + this.renderer.setClearColor(0, 0); + this.renderer.setSize(window.innerWidth, window.innerHeight); + this.$elem.append(this.renderer.domElement) + }, + + animateGlobe: function() + { + requestAnimationFrame(Z.bind(this.animateGlobe, this)); + this.renderGlobe(); + }, + + renderGlobe: function() + { + var e = Z("body:hover"), t = this.camera.position.x, i = this.camera.position.y, n = this.camera.position.z; + if (e.length != 0 && this.timeout != null) + { + this.camera.position.x += .05 * (this.mouseX - this.camera.position.x); + } + else + { + this.camera.position.x = t * Math.cos(this.rotation_speed) - n * Math.sin(this.rotation_speed); + this.camera.position.z = n * Math.cos(this.rotation_speed) + t * Math.sin(this.rotation_speed); + } + + this.camera.position.y += .05 * (-this.mouseY + 200 - this.camera.position.y); + this.camera.lookAt(this.scene.position); + + Z(document).mousemove(function () { + this.timeout !== null && clearTimeout(this.timeout), this.timeout = setTimeout(function () {this.timeout = null}, 600) + }); + + for (var o = 0; o < this.particles_globe.length; o++) + { + var particle = this.particles_globe[o++]; + temp = 50 * Math.sin(.3 * (o + this.count)) + .5 * Math.sin(.5 * (o + this.count)); + opacity = Math.abs(temp) / 50 + .1; + opacity > 1 && (opacity = 1); + particle.material.opacity = opacity; + } + + this.renderer.render(this.scene, this.camera); + this.count += .1; + }, + + /******************************************************************************************/ + //波浪 + /******************************************************************************************/ + initWave: function() + { + this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 1e4); + this.camera.position.z = 1e3; + this.camera.position.y = 100; + this.camera.position.y = 1e3; + + this.scene = new THREE.Scene; + for (var t = 2 * Math.PI, i = 0, n = 0; this.AMOUNTX > n; n++)for (var o = 0; this.AMOUNTY > o; o++) + { + var s = new THREE.SpriteCanvasMaterial({color: 16777215, + transparent: true, + program: function (e) {e.beginPath(), e.arc(0, 0, .5, 0, t, true), e.fill()}}); + + var particle = this.particles_ware[i++] = new THREE.Sprite(s); + particle.position.x = n * this.SEPARATION - this.AMOUNTX * this.SEPARATION / 2; + particle.position.z = o * this.SEPARATION - this.AMOUNTY * this.SEPARATION / 2; + this.scene.add(particle), particle.material.opacity = .4; + } + + this.renderer = new THREE.CanvasRenderer({alpha: true}); + this.renderer.setClearColor(0, 0); + this.renderer.setSize(window.innerWidth, window.innerHeight); + this.$elem.append(this.renderer.domElement); + }, + + animateWave: function() + { + requestAnimationFrame(Z.bind(this.animateWave, this)); + this.renderWave(); + }, + + renderWave: function() + { + this.camera.position.x += .01 * (this.mouseX - this.camera.position.x), + this.camera.position.y += .005 * (this.mouseY - this.camera.position.y), + this.camera.lookAt(this.scene.position); + + for (var e = 0, t = 0; this.AMOUNTX > t; t++) + { + for (var i = 0; this.AMOUNTY > i; i++) + { + var particle = this.particles_ware[e++]; + particle.position.y = 50 * Math.sin(.3 * (t + this.count)) + 50 * Math.sin(.5 * (i + this.count)); + particle.scale.x = particle.scale.y = 4 * (Math.sin(.3 * (t + this.count)) + 1) + 4 * (Math.sin(.5 * (i + this.count)) + 1); + opacity = Math.abs(particle.position.y) / 100; + opacity < .5 && (opacity = .5); + opacity > 1 && (opacity = 1); + particle.material.opacity = opacity; + } + } + + this.renderer.render(this.scene, this.camera); + this.count += .03 + }, + + /******************************************************************************************/ + //事件处理 + /******************************************************************************************/ + + onWindowResize: function() + {//缩放 + this.windowHalfX = window.innerWidth / 2, + this.windowHalfY = window.innerHeight / 2, + this.camera.aspect = window.innerWidth / window.innerHeight, + this.camera.updateProjectionMatrix(), + this.renderer.setSize(window.innerWidth, window.innerHeight); + }, + + onDocumentMouseMove: function(e) + {//鼠标移动 + this.mouseX = e.clientX - this.windowHalfX, this.mouseY = e.clientY + 150; + }, + + onDocumentTouchStart: function(e) + {//iOS触摸开始 + 1 === e.touches.length && (e.preventDefault(), this.mouseX = e.touches[0].pageX - this.windowHalfX, this.mouseY = -e.touches[0].pageY); + }, + + onDocumentTouchMove: function(e) + {//iOS触摸移动 + 1 === e.touches.length && (e.preventDefault(), this.mouseX = e.touches[0].pageX - this.windowHalfX, this.mouseY = -e.touches[0].pageY); + } +}; + +//END +})(zhiqim); \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/account/abnormalAudit.zml b/Yangcai365_web/manage/zview/account/abnormalAudit.zml new file mode 100644 index 0000000..5e11984 --- /dev/null +++ b/Yangcai365_web/manage/zview/account/abnormalAudit.zml @@ -0,0 +1,71 @@ + + +
            +
            异常稽核
            +
            设计师账户: ${operatorCode}
            +
            当前可用金额: ${usableMoney} 元
            +
            修改订单号:

            +
            操作金额:    元 +
            +
            操作类型:   + + +
            +
            操作备注:   
            +
            +<#-- 操作 --> +
            + + +
            +
            diff --git a/Yangcai365_web/manage/zview/account/freezeSalary.zml b/Yangcai365_web/manage/zview/account/freezeSalary.zml new file mode 100644 index 0000000..faa9311 --- /dev/null +++ b/Yangcai365_web/manage/zview/account/freezeSalary.zml @@ -0,0 +1,39 @@ + + +
            +
            冻结资金
            +
            设计师账户:${operatorCode}
            +
            当前可用金额: ${usableMoney} 元
            +
            冻结金额: 元
            +
            操作备注:
            +
            +<#-- 操作 --> +
            + + +
            +
            diff --git a/Yangcai365_web/manage/zview/account/sendSalary.zml b/Yangcai365_web/manage/zview/account/sendSalary.zml new file mode 100644 index 0000000..c2ca3e8 --- /dev/null +++ b/Yangcai365_web/manage/zview/account/sendSalary.zml @@ -0,0 +1,42 @@ + + +
            +
            发放工资
            +
            设计师账户: ${operatorCode}
            +
            当前可用金额: ${usableMoney} 元
            +
            发放金额: 元
            +
            操作备注:
            +
            +<#-- 操作 --> +
            + + +
            +
            diff --git a/Yangcai365_web/manage/zview/account/virtualAccount.zml b/Yangcai365_web/manage/zview/account/virtualAccount.zml new file mode 100644 index 0000000..12aa6e7 --- /dev/null +++ b/Yangcai365_web/manage/zview/account/virtualAccount.zml @@ -0,0 +1,270 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(400, 70)} + +${zhiqim_manager_content()} + + + +<#-- 导航 --> +
            + +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + +
             设计师: + + +   +   +
            +
            + +
            + <#-- 分页列表--> +
            + + + + + + + + + + <#if pageResult.size() == 0> + ${zhiqim_manager_no_record(26,"暂不存在资金账户列表")} + + <#for item : pageResult.list()> + + + + + + + + + +
            设计师账户账户状态总金额(元)冻结金额(元)可用金额(元)操作
            ${item.getOperatorCode()}
            + checked onclick='goSwitch(this,"${item.getOperatorCode()}");' class="switch" /> + +
            ${Amounts.toYuan(item.getSumMoney())}${Amounts.toYuan(item.getFreezeMoney())}${Amounts.toYuan(item.getUsableMoney())} + <#if ZmrPathRule.check(request, "/sendSalary.htm")> +      +      + + + <#else> + 暂无操作权限 + +
            +
            + ${zhiqim_manager_paging(pageResult, "/virtualAccount.htm")} +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/account/virtualAccountDetails.zml b/Yangcai365_web/manage/zview/account/virtualAccountDetails.zml new file mode 100644 index 0000000..8945e67 --- /dev/null +++ b/Yangcai365_web/manage/zview/account/virtualAccountDetails.zml @@ -0,0 +1,95 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(400, 70)} + +${zhiqim_manager_content()} + + +<#-- 导航栏 --> +
            + +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + +
             账户流水: + +  交易流水: + +  交易类型: + +  交易时间: + - + + +   + +
            +
            +
            + <#-- 分页列表--> +
            + + + + + + + + + + + + + + + + + <#if pageResult.size() == 0> + ${zhiqim_manager_no_record(26,"暂不存在账户明细")} + + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + +
            账户流水账户名称交易流水交易类型可提现增加(元)可提现减少(元)待结算增加(元)待结算减少(元)变动后可提现(元)变动后待结算(元)变动后总收入(元)交易时间备注
            ${item.getAccountBlotter()}${item.getOperatorCode()}${item.getTransactionBlotter()}${VirtualAccountConstants.getTransactionStatusListDesc(item.getTransactionStatus()+"")}<#if Amounts.toYuan(item.getUsableMoneyAdd())=0>0<#else>${Amounts.toYuan(item.getUsableMoneyAdd())}<#if Amounts.toYuan(item.getUsableMoneyDown())=0>0<#else>${Amounts.toYuan(item.getUsableMoneyDown())}<#if Amounts.toYuan(item.getFreezeMoneyAdd())=0>0<#else>${Amounts.toYuan(item.getFreezeMoneyAdd())}<#if Amounts.toYuan(item.getFreezeMoneyDown())=0>0<#else>${Amounts.toYuan(item.getFreezeMoneyDown())}<#if Amounts.toYuan(item.getUsableMoney())=0>0<#else>${Amounts.toYuan(item.getUsableMoney())}<#if Amounts.toYuan(item.getFreezeMoney())=0>0<#else>${Amounts.toYuan(item.getFreezeMoney())}<#if Amounts.toYuan(item.getSumMoney())=0>0<#else>${Amounts.toYuan(item.getSumMoney())}${Sqls.toDateTimeString(item.getOperatorTime())}${item.getOperatorRemark()}
            +
            + ${zhiqim_manager_paging(pageResult, "/virtualAccountDetails.htm")} +
            + +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/account/virtualAccountTransactionDetails.zml b/Yangcai365_web/manage/zview/account/virtualAccountTransactionDetails.zml new file mode 100644 index 0000000..9c5cab7 --- /dev/null +++ b/Yangcai365_web/manage/zview/account/virtualAccountTransactionDetails.zml @@ -0,0 +1,82 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(400, 70)} +${zhiqim_manager_content()} + + +<#-- 导航栏 --> +
            + +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + +
             交易流水: + +  订单号: + +  交易类型: + +  交易时间: + - + + +   + +
            +
            +
            + <#-- 分页列表--> +
            + + + + + + + + + + <#if pageResult.size() == 0> + ${zhiqim_manager_no_record(26,"暂不存在交易明细")} + + <#for item : pageResult.list()> + + + + + + + + + +
            交易流水订单号产品类型交易时间交易类型订单金额(元)
            ${item.getTransactionBlotter()}<#if item.getDesignId()=0>/<#else>${item.getDesignId()}<#if item.getOrderText()=null>/<#else>${item.getOrderText()}${Sqls.toDateTimeString(item.getTransactionTime())}${VirtualAccountConstants.getTransactionStatusListDesc(item.getTransactionStatus()+"")} + <#if status=999 && item.getTransactionStatus()==101>${Amounts.toYuan(-item.getOrderMoney())}<#else>${Amounts.toYuan(item.getOrderMoney())} +
            +
            + ${zhiqim_manager_paging(pageResult, "/virtualAccountTransactionDetails.htm")} +
            + +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/accounts/accountsManage.zml b/Yangcai365_web/manage/zview/accounts/accountsManage.zml new file mode 100644 index 0000000..d4c7a9b --- /dev/null +++ b/Yangcai365_web/manage/zview/accounts/accountsManage.zml @@ -0,0 +1,228 @@ + + +${zhiqim_manager_breadcrumb("设计师管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + + + + + + + + + + + + +
            订单号:产品类型: + + 审核完成时间: -  + +
            旺旺号:订单金额: + + 商户名称: +
            设计师: + + 设计等级: + + 订单状态: +
            erp单号: + + + + +
            +
            + +<#-- 操作功能 --> +
            + +
            + + <#-- 列表--> +
            + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 27, "暂时没有数据")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + + + + +
            选择设计师订单号文件名订单状态提现账号设计佣金 *审核完成时间
            ${item.getDesigner()}${item.getDesignId()} + <#if Validates.isNotEmpty(item.getCheckBackReason()) && item.getStatus() lt 55 > + + <#elseif Validates.isNotEmpty(item.getDraftBackReason()) && item.getStatus() lt 55 > + + <#elseif Validates.isNotEmpty(item.getEndBackReason()) && item.getStatus() lt 55 > + + + <#if item.isChange()> + + + <#if item.isBack()> + + + <#if item.getIsOldUser() gt 0> + + + ${item.getOrderText()}${StatusConstants.getStatus(item.getStatus())}${item.getReceiveAccount()}${Amounts.toYuanMustRadix(item.getDesignPrice())}${Sqls.toDateTimeString(item.getCheckTime())}
            +${zhiqim_manager_paging(pageResult, "/accountsManage.htm")} + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/after/afterBlameReturn.zml b/Yangcai365_web/manage/zview/after/afterBlameReturn.zml new file mode 100644 index 0000000..99b637b --- /dev/null +++ b/Yangcai365_web/manage/zview/after/afterBlameReturn.zml @@ -0,0 +1,641 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(340, 110)} + + +${zhiqim_manager_breadcrumb("售后申诉单列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + +
            售后单号:订 单 号 : + 创建时间: +  -  + +
            责 任 人 : + + 处理状态: + + +
            +
            + + <#-- 操作功能 --> +
            + <#if ZmrPathRule.check(request, "openWangWang")> + <#if ZmrPathRule.check(request, "/afterBlameReturnCheck.htm")> +
            + + <#-- 列表--> +
            + + + + + + + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 23, "暂时没有订单信息")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + + + + + + +
            选择售后单号责任组织设计单号商户处理状态售后原因产品店铺旺旺号特殊工艺订单金额创建时间设计师联系人对稿手机对稿微信新补单号
            ${item.getDesignAfsId()}${ZmrOrgDao.getOrgName(request, item.getPicOrgId())}${item.getDesignId()}${Global.get(DesignMerchantCache.class).getName(item.getMerchantId())}${AfterConstants.statusHtml(item.getAfterStatus())}${item.getProblemDesc()}${item.getOrderText()}${item.getShopNick()}${item.getBuyerNick()}${item.getPrintSpecial()}${Amounts.toYuanMustRadix(item.getAmount())}${Sqls.toDateTimeString(item.getAfterCreateTime())}${item.getDesigner()}${item.getUserContact()}${item.getUserMobile()}${item.getUserWx()}<#if item.getNewDesignId() gt 0>${item.getNewDesignId()}
            +
            + ${zhiqim_manager_paging(pageResult, "afterBlameReturn.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            产品信息:
            请选择订单
            问题描述:
            +
            +
            +
            + + 售后文件 + +
            +
            +
            +
            + + 设计文件 + +
            +
            +
            +
            + + 印刷文件 + +
            +
            +
            +
            +
            +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/after/designAfterOrder.zml b/Yangcai365_web/manage/zview/after/designAfterOrder.zml new file mode 100644 index 0000000..11bf2e8 --- /dev/null +++ b/Yangcai365_web/manage/zview/after/designAfterOrder.zml @@ -0,0 +1,561 @@ +${Styles.htmlOverflowHidden()} +${yangcai_calc_Left_width_height(340, 110)} + + +${zhiqim_manager_breadcrumb("售后单列表")} +${zhiqim_manager_content()} +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + +
            售后单号:订 单 号 : + 创建时间: +  -  + +
            设 计 师 : + + 处理状态: + + + +
            +
            + + <#-- 操作功能 --> +
            + <#if ZmrPathRule.check(request, "/designCopiesr.htm")> + + +
            + + <#-- 列表--> +
            + + + + + + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 21, "暂时没有订单信息")} + <#for item : pageResult.list()> + + + + + + + + + + + + + <#if item.getAfterCreateTime().getTime() gte lNowTime> + + <#else> + + + + + + + + + + + + + +
            选择售后单号订单号设计师创建时间处理状态损失金额赔付金额 *售后原因产品店铺旺旺号特殊工艺订单金额新补单号申诉拒绝原因申诉拒绝时间
            ${item.getDesignAfsId()}${item.getDesignId()}${item.getDesigner()}${Sqls.toDateTimeString(item.getAfterCreateTime())}${AfterConstants.statusHtml(item.getAfterStatus())}${item.getLossAmount()}${(item.getCompensateAmount())}${item.getLossAmount()}${item.getProblemDesc()}${item.getOrderText()}${item.getShopNick()}${item.getBuyerNick()}${item.getPrintSpecial()}${Amounts.toYuanMustRadix(item.getAmount())}<#if item.getNewDesignId() gt 0>${item.getNewDesignId()}${item.getAfterReturnNote()}${Sqls.toDateTimeString(item.getAfterBlameReturnTime())}
            +
            + ${zhiqim_manager_paging(pageResult, "designAfterOrder.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            产品信息:
            请选择订单
            问题描述:
            +
            +
            +
            + + 售后文件 + +
            +
            +
            +
            + + 设计文件 + +
            +
            +
            +
            + + 印刷文件 + +
            +
            +
            +
            +
            +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + diff --git a/Yangcai365_web/manage/zview/after/doEditDesignAfsId.zml b/Yangcai365_web/manage/zview/after/doEditDesignAfsId.zml new file mode 100644 index 0000000..9378c0a --- /dev/null +++ b/Yangcai365_web/manage/zview/after/doEditDesignAfsId.zml @@ -0,0 +1,60 @@ +${request.getValidateScript()} + + + + + + + + + + + + + + + + + + + + + + +
            售后单号:${designAfsId}
            订单号:${designId}
            损失金额:${lossAmount}
            赔付金额:${compensateAmount}
             *赔付比: + + %
            + 说明:填写1-100的数字,比如65就代表赔付损失金额的65% +
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/after/handledAfterOrder.zml b/Yangcai365_web/manage/zview/after/handledAfterOrder.zml new file mode 100644 index 0000000..f99be26 --- /dev/null +++ b/Yangcai365_web/manage/zview/after/handledAfterOrder.zml @@ -0,0 +1,533 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(340, 110)} + + +${zhiqim_manager_breadcrumb("我导致的售后单")} +${zhiqim_manager_content()} +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + +
            售后单号:订 单 号 : + 创建时间: +  -  + +
            责 任 人 : + +
            +
            + + <#-- 操作功能 --> +
            + <#if ZmrPathRule.check(request, "openWangWang")> +
            + + <#-- 列表--> +
            + + + + + + + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 19, "暂时没有订单信息")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + + + + + + +
            选择售后单号责任组织设计单号处理状态损失金额售后原因产品店铺旺旺号特殊工艺订单金额创建时间设计师联系人对稿手机对稿微信新补单号
            ${item.getDesignAfsId()}${ZmrOrgDao.getOrgName(request, item.getPicOrgId())}${item.getDesignId()}${AfterConstants.statusHtml(item.getAfterStatus())}${item.getLossAmount()}${item.getProblemDesc()}${item.getOrderText()}${item.getShopNick()}${item.getBuyerNick()}${item.getPrintSpecial()}${Amounts.toYuanMustRadix(item.getAmount())}${Sqls.toDateTimeString(item.getAfterCreateTime())}${item.getDesigner()}${item.getUserContact()}${item.getUserMobile()}${item.getUserWx()}<#if item.getNewDesignId() gt 0>${item.getNewDesignId()}
            +
            + ${zhiqim_manager_paging(pageResult, "designAfterOrder.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            产品信息:
            请选择订单
            问题描述:
            +
            +
            +
            + + 售后文件 + +
            +
            +
            +
            + + 设计文件 + +
            +
            +
            +
            + + 印刷文件 + +
            +
            +
            +
            +
            +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + diff --git a/Yangcai365_web/manage/zview/after/personalAfterOrder.zml b/Yangcai365_web/manage/zview/after/personalAfterOrder.zml new file mode 100644 index 0000000..fbb8bfe --- /dev/null +++ b/Yangcai365_web/manage/zview/after/personalAfterOrder.zml @@ -0,0 +1,337 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(340, 110)} + + +${zhiqim_manager_breadcrumb("售后单列表")} +${zhiqim_manager_content()} +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + + +
            售后单号:订 单 号 : + 创建时间: +  -  + +
            责 任 人 : + + 处理状态: + + +
            +
            + + <#-- 操作功能 --> +
            +
            + + <#-- 列表--> +
            + + + + + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 23, "暂时没有订单信息")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + + + + +
            选择售后单号责任组织设计单号处理状态售后原因产品旺旺号特殊工艺订单金额创建时间责任人联系人对稿手机对稿微信新补单号
            ${item.getDesignAfsId()}${ZmrOrgDao.getOrgName(request, item.getPicOrgId())}${item.getDesignId()}${AfterConstants.statusHtml(item.getAfterStatus())}${item.getProblemDesc()}${item.getOrderText()}${item.getBuyerNick()}${item.getPrintSpecial()}${Amounts.toYuanMustRadix(item.getAmount())}${Sqls.toDateTimeString(item.getAfterCreateTime())}${item.getAfterBlamer()}${item.getUserContact()}${item.getUserMobile()}${item.getUserWx()}<#if item.getNewDesignId() gt 0>${item.getNewDesignId()}
            +
            + ${zhiqim_manager_paging(pageResult, "personalAfterOrder.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            产品信息:
            请选择订单
            问题描述:
            +
            +
            +
            + + 售后文件 + +
            +
            +
            +
            + + 设计文件 + +
            +
            +
            +
            + + 印刷文件 + +
            +
            +
            +
            +
            +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + diff --git a/Yangcai365_web/manage/zview/after/waitHandleAfterOrder.zml b/Yangcai365_web/manage/zview/after/waitHandleAfterOrder.zml new file mode 100644 index 0000000..dd5dd0c --- /dev/null +++ b/Yangcai365_web/manage/zview/after/waitHandleAfterOrder.zml @@ -0,0 +1,628 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${Scripts.src(zhiqim_uploadlarge.js)} +${yangcai_calc_Left_width_height(340, 110)} + + +${zhiqim_manager_breadcrumb("我的售后")} +${zhiqim_manager_content()} + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + +
            订 单 号 : 旺 旺 号: + 创建时间: +  -  + +
            处理状态: + +
            +
            + + <#-- 操作功能 --> +
            + + +
            + + <#-- 列表--> +
            + + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 18, "暂时没有订单信息")} + <#for item : pageResult.list()> + + + + + + + + <#if item.getAfterCreateTime().getTime() gte lNowTime> + + <#else> + + + + + + + + + + + +
            选择订单号旺旺号处理状态损失金额赔付金额 *售后原因产品特殊工艺创建时间新补单号申诉拒绝原因申诉拒绝时间
            ${item.getDesignId()}${item.getBuyerNick()}${AfterConstants.statusHtml(item.getAfterStatus())}${item.getLossAmount()}${(item.getLossAmount()*Long.parseLong(ParamDao.getString("yangcai.web","AfterPayProportion")))/100}${item.getLossAmount()}${item.getProblemDesc()}${item.getOrderText()}${item.getPrintSpecial()}${Sqls.toDateTimeString(item.getAfterCreateTime())}<#if item.getNewDesignId() gt 0>${item.getNewDesignId()}${item.getAfterBlameReturnNote()}${Sqls.toDateTimeString(item.getAfterModifyTime())}
            +
            + ${zhiqim_manager_paging(pageResult, "waitHandleAfterOrder.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            产品信息:
            请选择订单
            问题描述:
            +
            +
            +
            + + 售后文件 + +
            +
            +
            +
            + + 设计文件 + +
            +
            +
            +
            + + 印刷文件 + +
            +
            +
            +
            +
            +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/article/article.zml b/Yangcai365_web/manage/zview/article/article.zml new file mode 100644 index 0000000..e111796 --- /dev/null +++ b/Yangcai365_web/manage/zview/article/article.zml @@ -0,0 +1,44 @@ + + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + +${zhiqim_manager_tr_no_record(articlePage, 5, "暂时没有文章信息")} +<#for item : articlePage.list()> + + + + + + + + +
            选择文章状态文章所属分类文章标题发表时间
            <#if item.getArticleStatus()==0>正常<#else>停用${item.getCategoryName()}${item.getArticleTitle()}${Sqls.toDateTimeString(item.getArticleTime())}
            +${zhiqim_manager_paging(articlePage, "article.htm")} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/article/articleAdd.zml b/Yangcai365_web/manage/zview/article/articleAdd.zml new file mode 100644 index 0000000..6526474 --- /dev/null +++ b/Yangcai365_web/manage/zview/article/articleAdd.zml @@ -0,0 +1,65 @@ +<#def designatedPath="/category.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history ("article.htm")} + +${zhiqim_manager_breadcrumb_parent ("article.htm", "知识库内容", "增加文章")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + +
            增加文章
            所属分类:(请选择) +  * +
            分类状态:(请选择) +  * +
            文章标题:(32位不定长字符) *
            +
            文章内容:(不能超过25000个字符) *
            +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} + + + + diff --git a/Yangcai365_web/manage/zview/article/articleModify.zml b/Yangcai365_web/manage/zview/article/articleModify.zml new file mode 100644 index 0000000..190f967 --- /dev/null +++ b/Yangcai365_web/manage/zview/article/articleModify.zml @@ -0,0 +1,61 @@ +<#def designatedPath="/category.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history ("article.htm")} + +${zhiqim_manager_breadcrumb_parent ("article.htm", "知识库内容", "修改文章")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + +
            修改文章
            所属分类:(请选择) +  * +
            分类状态:(请选择) +  * +
            文章标题:(32位不定长字符) *
            +
            文章内容:(不能超过25000个字符) *
            +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} + + + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/article/category.zml b/Yangcai365_web/manage/zview/article/category.zml new file mode 100644 index 0000000..98577e0 --- /dev/null +++ b/Yangcai365_web/manage/zview/article/category.zml @@ -0,0 +1,78 @@ +${zhiqim_manager_content()} +<#-- 显示子分类,并递归显示下级子分类 --> +<#function showChildCategory(self, parent)> + + + ${self.self().getCategoryId()} + + <#var level = self.self().getCategoryLevel()/> + <#if level == 0> + + <#else> + <#for i : 1..(level-1)> + <#if self.isLastNode(level-i)> + + <#else> + + + + <#if self.isLastNode()> + + <#else> + + + + + #{self.self().getCategoryName()} + + <#if self.self().getCategoryStatus() == 0>正常<#else>停用 + ${self.self().getCategoryLevel()} + +<#for child : self.children()> +${showChildCategory(child, self)} + + + +${zhiqim_manager_breadcrumb ("知识库分类")} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + +<#if size == 0> +${zhiqim_manager_no_record(5, "暂时没有分类信息")} +<#else> + + + + + + + +<#for child : tree.children()> +${showChildCategory(child, tree)} + + +
            选择分类编号分类名称分类状态分类级别
            ${tree.self().getCategoryId()}#{tree.self().getCategoryName()}<#if tree.self().getCategoryStatus() == 0>正常<#else>停用${tree.self().getCategoryLevel()}
            +${zhiqim_manager_list(size)} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/article/categoryAdd.zml b/Yangcai365_web/manage/zview/article/categoryAdd.zml new file mode 100644 index 0000000..b25eccd --- /dev/null +++ b/Yangcai365_web/manage/zview/article/categoryAdd.zml @@ -0,0 +1,37 @@ +<#def designatedPath="/category.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history ("category.htm")} + +${zhiqim_manager_breadcrumb_parent ("category.htm", "知识库分类", "增加分类")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + +
            增加分类
            上级分类:(32位不定长字符)${category.getCategoryName()}
            分类名称:(32位不定长字符) *
            分类状态:(请选择) +  * +
            分类排序数:(填整型) *
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/article/categoryModify.zml b/Yangcai365_web/manage/zview/article/categoryModify.zml new file mode 100644 index 0000000..1168534 --- /dev/null +++ b/Yangcai365_web/manage/zview/article/categoryModify.zml @@ -0,0 +1,41 @@ +<#def designatedPath="/category.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history ("category.htm")} + +${zhiqim_manager_breadcrumb_parent ("category.htm", "知识库分类", "修改分类")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + +
            修改分类
            分类编号:(自定义)${category.getCategoryId()}
            上级分类:(32位不定长字符)${parent.getCategoryName()}
            分类名称:(32位不定长字符) *
            分类状态:(请选择) +  * +
            分类排序数:(填整型) *
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/article/question.zml b/Yangcai365_web/manage/zview/article/question.zml new file mode 100644 index 0000000..2e704b1 --- /dev/null +++ b/Yangcai365_web/manage/zview/article/question.zml @@ -0,0 +1,125 @@ +<#def title = "扬彩帮助中心"/> +<#def keywords = "帮助中心"/> +<#def desc = "扬彩帮助中心"/> +<#--头部起始--> + + + +扬彩知识库 + + + + + + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(context.getRootPath("/zinc/css/yangcai_question_main_v1.4.0R2018031701.css"))} +${Scripts.src(context.getRootPath("/zinc/css/zhiqim_search_auto_list_v1.4.0R2018031701.js"))} + + +
            + +
            + + +<#--容器开始--> + + + + +
            + +
            + + + +
            +
            + + <#if articleStr != null> +
            + ${articleStr}
            +
            +
            + ${content} +
            + + <#elseif !articleList.isEmpty()> +
            + <#for article : articleList> +
            ${article.getArticleTitle()}${article.getArticleTime().toString().substring(0, article.getArticleTime().toString().length() - 2)}
            + +
            + <#else> +

            没有找到相关项目

            + +
            +
            + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/article/search.zml b/Yangcai365_web/manage/zview/article/search.zml new file mode 100644 index 0000000..b97f161 --- /dev/null +++ b/Yangcai365_web/manage/zview/article/search.zml @@ -0,0 +1,120 @@ +<#def title = "扬彩知识库"/> +<#def keywords = "知识库"/> +<#def desc = "扬彩知识库"/> +<#--头部起始--> + + + +扬彩知识库 + + + + + + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(context.getRootPath("/zinc/css/yangcai_question_main_v1.4.0R2018031701.css"))} +${Scripts.src(context.getRootPath("/zinc/css/zhiqim_search_auto_list_v1.4.0R2018031701.js"))} + + + +<#--容器开始--> +
            + + + + +
            + +
            + + + +
            +
            +
            搜索结果: + ${keyword}  共找到  + ${articleList.size()} 个结果 +
            +
            + <#for article : articleList> +
            ${article.getArticleTitle()}
            +
            ${contentList.get(articleList.indexOf(article))}
            + + <#if articleList.size()==0> +

            没有找到相关项目

            + +
            +
            +
            +
            + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/attaFileList.zml b/Yangcai365_web/manage/zview/attaFileList.zml new file mode 100644 index 0000000..07ad400 --- /dev/null +++ b/Yangcai365_web/manage/zview/attaFileList.zml @@ -0,0 +1,405 @@ +${Styles.htmlOverflowYAuto()} +${Scripts.src(zhiqim_uploadlarge.js)} + +${Htmls.toCallFrame()} + + +<#for item : attaList> +<#if item.getId() == "copy"> + + + + + + <#if Validates.isNotEmpty(order)> + + <#else> + + + + +<#if item.getId() == "userText" && Validates.isNotEmptyBlank(order.getUserText())> + + + + + + + + +<#if item.getId() == "userNotice" && Validates.isNotEmptyBlank(order.getUserNotice())> + + + + + + + + +<#if item.getType() == "file"> + + + + + + + + + +<#if item.getType() == "thumFile"> + + + + + + + + +<#if item.getType() == "firstThumFile"> + + + + + + + + + + + + +<#if Validates.isNotEmptyBlank(order.getServicesMessage())> + + + + + + + +
            产品信息: + + + + +
            ${order.getDesignId()}-${order.getBuyerNick()}-${order.getOrderText()}
            客户文本
            + +
            注意事项
            + +
            + ${item.getName()} + + <#if item.getId() == "EndFile" && endFileLink != null> + + + + + +
            +
            z-h100<#elseif item.getName()=="印刷文件">z-h50<#else>z-h60"> + <#for atta : fileList> + <#if Validates.isEqual(atta.getAttaModul(), item.getId())> +
            showThumImg('${atta.getAttaId()}', '${atta.getFileType()}')" title="${atta.getFileName()}"> + ${atta.getFileName()}
            +
            + + +
            +
            ${item.getName()}:
            +
            <#if Validates.isNotEmpty(item.getSavePath())>
            +
            ${item.getName()}
            + <#if order != null> +
            + +
            客服留言
            + +
            diff --git a/Yangcai365_web/manage/zview/complain/complainDeal.zml b/Yangcai365_web/manage/zview/complain/complainDeal.zml new file mode 100644 index 0000000..354deeb --- /dev/null +++ b/Yangcai365_web/manage/zview/complain/complainDeal.zml @@ -0,0 +1,173 @@ +${sweet_alert_reuse_method()} + +${zhiqim_manager_content()} + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            客户旺旺:${order.getBuyerNick()}产品名称:${order.getOrderText()}
            店铺名称:${order.getShopNick()}设 计 师:${order.getDesigner()}录单时间:${Sqls.toDateTimeString(order.getCreateTime())}
            责任部门:${order.getUndertakeDept()}投诉类型:${order.getComplainType()}店铺扣罚:${order.getShopPunishScore()} 分
            处理方案:${order.getDisposeProject()}责任人:${order.getUndertakePerson()} + +
            备注:${order.getComplainSpecificText()} +
            受理截图 +
            + +
            +
            跟进截图: + <#if order.getComplainStatus() != 20> + +
            +
            +
            +
            +${zhiqim_manager_content_end()} + +<#-- 操作 --> +
            +
            + + + + + +
            订单受理人:受理时间:
            +
            +
            + <#if order.getComplainStatus() != 20>   + +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/complain/complainDetail.zml b/Yangcai365_web/manage/zview/complain/complainDetail.zml new file mode 100644 index 0000000..d091d99 --- /dev/null +++ b/Yangcai365_web/manage/zview/complain/complainDetail.zml @@ -0,0 +1,90 @@ + +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            客户旺旺:${order.getBuyerNick()}产品名称:${order.getOrderText()}
            店铺名称:${order.getShopNick()}设 计 师:${order.getDesigner()}录单时间:${Sqls.toDateTimeString(order.getCreateTime())}
            责任部门:${order.getUndertakeDept()}投诉类型:${order.getComplainType()}店铺扣罚:${order.getShopPunishScore()} 分
            处理方案:${order.getDisposeProject()}责任人:${order.getUndertakePerson()} + +
            备注:${order.getComplainSpecificText()} +
            受理截图: +
            + +
            +
            跟进截图: + +
            +
            +${zhiqim_manager_content_end()} + +
            +
            + + + + + +
            订单受理人:受理时间:
            +
            +
            + +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/complain/complainFinishList.zml b/Yangcai365_web/manage/zview/complain/complainFinishList.zml new file mode 100644 index 0000000..de5d74f --- /dev/null +++ b/Yangcai365_web/manage/zview/complain/complainFinishList.zml @@ -0,0 +1,112 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("我导致的投诉")} +${zhiqim_manager_content()} + +<#-- 左侧功能 --> +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + +
            + 受理时间: - + +  组  织 + + 责 任 人: + + + +
            +
            + + +<#-- 列表 --> + + + +
            + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 7, "暂时没有数据")} + <#for item : pageResult.list()> + + + + + + + + + + + ${zhiqim_manager_paging(pageResult, "/complainFinishList.htm")} +
            订单编号投诉单号责任组织责任人受理状态受理时间操作
            ${item.getDesignId()}${item.getComplainId()}${ZmrOrgDao.getOrgName(request,item.getUndertakeOrg())}${item.getUndertakePerson()}${ComplainConstants.getStatus(item.getComplainStatus())}${Sqls.toDateTimeString(item.getComplainAddTime())}
            +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/complain/complainTotalOrderList.zml b/Yangcai365_web/manage/zview/complain/complainTotalOrderList.zml new file mode 100644 index 0000000..00cb7b4 --- /dev/null +++ b/Yangcai365_web/manage/zview/complain/complainTotalOrderList.zml @@ -0,0 +1,115 @@ + + + +${zhiqim_manager_breadcrumb("投诉单列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + +
            订单编号:投诉单号:责 任 人: + + 旺旺号:
            + 受理状态: + 店铺名称: + + 受理时间: - + +
            +
            + +<#-- 操作功能 --> +
            + +
            + +<#-- 列表 --> +
            + + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 17, "暂时没有投诉单")} + <#for item : pageResult.list()> + style="color:#8a8a8a;"<#elseif item.getComplainStatus()== "20">style="color:#000000;" ${zhiqim_manager_tr_onmouse()} ${zhiqim_manager_tr_click_radio()}> + + + + + + + + + + + + + + + +
            选择订单编号所属组织旺旺号店铺责任人责任组织受理状态受理时间产品订单金额投诉类型店铺扣分
            ${item.getDesignId()}

            style="color:#000000;"<#else>class="z-text-red">TS:${item.getComplainId()}

            ${ZmrOrgDao.getOrgName(request,item.getOrgId())}${item.getBuyerNick()}${item.getShopNick()}${item.getUndertakePerson()}${CalculationUtil.operatorGetOrgName(item.getUndertakePerson())}${ComplainConstants.getStatus(item.getComplainStatus())}${Sqls.toDateTimeString(item.getComplainAddTime())}${item.getOrderText()}${Amounts.toYuanMustRadix(item.getAmount())}${item.getComplainType()}${item.getShopPunishScore()}分
            +
            +${zhiqim_manager_paging(pageResult, "/complainTotalOrderList.htm")} +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/complain/complainWantDealList.zml b/Yangcai365_web/manage/zview/complain/complainWantDealList.zml new file mode 100644 index 0000000..55f0b0b --- /dev/null +++ b/Yangcai365_web/manage/zview/complain/complainWantDealList.zml @@ -0,0 +1,115 @@ +${Scripts.src("/zinc/js/globalcomplain_2019010801.js")} + + +${zhiqim_manager_breadcrumb("我的投诉")} +${zhiqim_manager_content()} + +<#-- 左侧功能 --> +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + +
            订单编号:投诉单号: + 受理状态: + 旺旺号:
            店铺名称: + + 受理时间: - + +
            +
            + +<#-- 操作功能 --> +
            + + +
            + +<#-- 列表 --> + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 17, "暂时没有待处理的投诉")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + ${zhiqim_manager_paging(pageResult, "/complainWantDealList.htm")} +
            选择订单编号旺旺号店铺受理状态受理时间产品订单金额投诉类型
            ${item.getDesignId()}

            TS:${item.getComplainId()}

            ${item.getBuyerNick()}${item.getShopNick()}${ComplainConstants.getStatus(item.getComplainStatus())}${Sqls.toDateTimeString(item.getComplainAddTime())}${item.getOrderText()}${Amounts.toYuanMustRadix(item.getAmount())}${item.getComplainType()}
            +${zhiqim_manager_content_end()} + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/des/inner/copyImage.zml b/Yangcai365_web/manage/zview/des/inner/copyImage.zml new file mode 100644 index 0000000..6e6a95a --- /dev/null +++ b/Yangcai365_web/manage/zview/des/inner/copyImage.zml @@ -0,0 +1,79 @@ + + + +${zhiqim_manager_content()} + +
            +
            +
            +     +   +
            +
            +

            +${zhiqim_manager_content_end()} + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/des/presenter/templateCustomerPreviewInfo.zml b/Yangcai365_web/manage/zview/des/presenter/templateCustomerPreviewInfo.zml new file mode 100644 index 0000000..df0a8d3 --- /dev/null +++ b/Yangcai365_web/manage/zview/des/presenter/templateCustomerPreviewInfo.zml @@ -0,0 +1,14 @@ + +
            + <#for key : svgMap.keySet()> + <#var item = svgMap.get(key)/> +
            + <#if item != null> + <#for bg : item.getBgList()> +
            ${bg.getSvgCode()}
            + + +
            ${item.getMediaId()}
            +
            + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/des/presenter/templatePreviewInfo.zml b/Yangcai365_web/manage/zview/des/presenter/templatePreviewInfo.zml new file mode 100644 index 0000000..8aef5f1 --- /dev/null +++ b/Yangcai365_web/manage/zview/des/presenter/templatePreviewInfo.zml @@ -0,0 +1,35 @@ +<#if svgMap.isEmpty()> +
            请选择模板
            +<#else> + +
            + <#for key : svgMap.keySet()> + <#var item = svgMap.get(key)/> +
            + <#if item != null> + <#for bg : item.getBgList()> +
            ${bg.getSvgCode()}
            + + + + + + +
            ${item.getMediaId()}
            +
            + +
            + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/des/presenter/templateQueryInfo.zml b/Yangcai365_web/manage/zview/des/presenter/templateQueryInfo.zml new file mode 100644 index 0000000..3447ab9 --- /dev/null +++ b/Yangcai365_web/manage/zview/des/presenter/templateQueryInfo.zml @@ -0,0 +1,70 @@ +<#if Validates.isEqual(queryType, "KEYWORD")> +
            +
            + + + + + +
            热词: + <#for item : subIndustryList> + ${item.getIndustrySubName()}  + +
            +
            +
            +<#elseif Validates.isEqual(queryType, "COLLECT")> +
            +
            + +
            +
            +<#else> +<#if pageResult.total() gt 0> +
            + 换一批 +
            + + + +
            + <#for item : pageResult.list()> + <#var key = item.getMediaId()/> + + +
            + +<#if pageResult.total()==0> +
            该关键词未查询到模板 请换其他关键词试试!
            + + +<#if Validates.isEqual(queryType, "KEYWORD") || Validates.isEqual(queryType, "COLLECT")> +
            + + + + +
            ${PagingGo.toHtmlClick(pageResult, "doKeywordQuery")}
            +
            + diff --git a/Yangcai365_web/manage/zview/des/templateCustomerPreview.zml b/Yangcai365_web/manage/zview/des/templateCustomerPreview.zml new file mode 100644 index 0000000..1059f17 --- /dev/null +++ b/Yangcai365_web/manage/zview/des/templateCustomerPreview.zml @@ -0,0 +1,63 @@ +${request.getValidateScript()} + + + + +
            diff --git a/Yangcai365_web/manage/zview/des/templatePreview.zml b/Yangcai365_web/manage/zview/des/templatePreview.zml new file mode 100644 index 0000000..58aff2c --- /dev/null +++ b/Yangcai365_web/manage/zview/des/templatePreview.zml @@ -0,0 +1,477 @@ +${request.getValidateScript()} +${Mydome()} + + + + +${zhiqim_manager_breadcrumb_parent("/designOrder.htm", "设计订单", "订单模板设计")} +
            +${Scripts.src("/zinc/js/global_2019010801.js")} +${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")} + +
            + +
            + +<#-- 导航栏 --> +
            +
            + +
            + +<#-- 替换参数 --> +
            + + + + + +
            + + +
            +

            客户文本

            + +
            + + + +
            + +

            文本识别

            +
            + + +    + +
            + +
            + + +
            +

            +

            文本分析

            +
            +    + +
            + +
            + + + + +
            +
            +
            + +<#-- 导航栏 --> +
            +
            +
            + + +
            +
            + +
            + +
            + +${zhiqim_manager_content_end()} +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/designer/designerCourseDetail.zml b/Yangcai365_web/manage/zview/designer/designerCourseDetail.zml new file mode 100644 index 0000000..3231533 --- /dev/null +++ b/Yangcai365_web/manage/zview/designer/designerCourseDetail.zml @@ -0,0 +1,125 @@ + + +
            +
            +
            设计师
            +
            ${designerCourse.getDesigner()}
            +
            设计师等级
            +
            ${designerLever}
            +
            +
            +
            工作年限
            +
            ${designerCourse.getWorkDuration()}
            +
            擅长设计
            +
            ${designerCourse.getDesignType()}
            +
            +
            +
            工作经历
            +
            ${designerCourse.getWorkExperience()}
            +
            在职情况
            +
            ${designerCourse.getWorkStatus()}
            +
            +
            +
            软件能力
            +
            ${designerCourse.getSkillScope()}
            +
            +
            +
            个人标签
            +
            + <#if Validates.isNotEmptyBlank(profile.getLabels())> + <#for item : profile.getLabels().split(",")> + ${item} + + +
            +
            +
            +
            个人作品
            +
            + <#for item : works> +
            +
            + + +
            +
            + +
            +
            +
            +
            + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/designer/designerManage.zml b/Yangcai365_web/manage/zview/designer/designerManage.zml new file mode 100644 index 0000000..7118154 --- /dev/null +++ b/Yangcai365_web/manage/zview/designer/designerManage.zml @@ -0,0 +1,221 @@ + + +${zhiqim_manager_breadcrumb("设计师管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + + +
             设 计 师  + +  手 机 号  + +  组     织  + + 工作年限  + 工作经历  +
            擅长设计  + 软件能力  + 在职情况  + 标签备注  +
            +
            + +<#-- 操作功能 --> +
            + + + + + +
            + +<#-- 列表 --> + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有设计师信息")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + +
            选择设计师手机号组织注册时间最后接单时间同时接单量标签备注提现账号提现方式
            ${item.getDesigner()}${item.getOperatorMobile()}${ZmrOrgDao.getOrgName(request, item.getOrgId())}${item.getOperatorCreated()}${Sqls.toDateTimeString(item.getLastOnlimeTime())}${item.getOperatorParam()}${item.getDesignerRemark()}${item.getReceiveAccount()}${item.getReceiveType()}
            +${zhiqim_manager_paging(pageResult, "/designerManage.htm")} + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/designer/teamDesignerManage.zml b/Yangcai365_web/manage/zview/designer/teamDesignerManage.zml new file mode 100644 index 0000000..043225b --- /dev/null +++ b/Yangcai365_web/manage/zview/designer/teamDesignerManage.zml @@ -0,0 +1,201 @@ + +${request.getValidateScript()} +${Scripts.src("/zinc/layui/layui.js")} + + + +${zhiqim_manager_breadcrumb("设计师管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + + +
             设 计 师  + +  手 机 号  + +  组     织  + + 工作年限  + 工作经历  +
            擅长设计  + 软件能力  + 在职情况  + 标签备注  +
            +
            + +<#-- 操作功能 --> +
            + + + +
            + +<#-- 列表 --> + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有设计师信息")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + +
            选择设计师手机号组织注册时间最后接单时间同时接单量标签备注提现账号提现方式
            ${item.getDesigner()}${item.getOperatorMobile()}${ZmrOrgDao.getOrgName(request, item.getOrgId())}${item.getOperatorCreated()}${Sqls.toDateTimeString(item.getLastOnlimeTime())}${item.getOperatorParam()}${item.getDesignerRemark()}${item.getReceiveAccount()}${item.getReceiveType()}
            +${zhiqim_manager_paging(pageResult, "/teamDesignerManage.htm")} + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/designerworks/checkApproved.zml b/Yangcai365_web/manage/zview/designerworks/checkApproved.zml new file mode 100644 index 0000000..d83677d --- /dev/null +++ b/Yangcai365_web/manage/zview/designerworks/checkApproved.zml @@ -0,0 +1,59 @@ + +
            + + +
            + + + + + + + + + +
            分配组织: + +
            接单规则: + +
            初始积分: + +
            +
            + +<#-- 操作 --> +
            + + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/designerworks/designerProfile.zml b/Yangcai365_web/manage/zview/designerworks/designerProfile.zml new file mode 100644 index 0000000..9f97e79 --- /dev/null +++ b/Yangcai365_web/manage/zview/designerworks/designerProfile.zml @@ -0,0 +1,67 @@ +${zhiqim_manager_breadcrumb("简介审核")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> +
            + +
            + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 39, "暂时没有介绍信息")} +<#for item : pageResult.list()> + + + + + + + +
            设计师审核内容提交时间操作
            ${item.getOperatorCode()}${item.getPersonalProfile()}${Sqls.toDateTimeString(item.getAddTime())} + + +
            +${zhiqim_manager_paging(pageResult, "/designerProfile.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/designerworks/designerReg.zml b/Yangcai365_web/manage/zview/designerworks/designerReg.zml new file mode 100644 index 0000000..2c74d43 --- /dev/null +++ b/Yangcai365_web/manage/zview/designerworks/designerReg.zml @@ -0,0 +1,209 @@ +${zhiqim_manager_breadcrumb("信息审核")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + +
            + + + + + + + +
             设 计 师  + +  手 机 号  + + 状态 + +
            +
            +<#-- 操作功能 --> +
            + +
            + + + + + + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 39, "暂时没有考试信息")} +<#for item : pageResult.list()> + + + + + + + + + + + + + +
            选择设计师手机号状态设计要求问卷成绩设计文件印刷文件设计完成时间操作
            ${item.getDesigner()}${item.getMobile()} + <#if item.getStatus() == 0> + 问卷考试中 + <#elseif item.getStatus() == 10> + 设计考试中 + <#elseif item.getStatus() == 20> + 等待审核 + <#else> + 审核拒绝 + + ${item.getDesignRequirements()} <#if item.getStatus() == 20> +

            查看

            +
            <#if item.getStatus() == 20> +

            下载

            +
            <#if item.getStatus() == 20> +

            下载

            +
            ${Sqls.toDateTimeString(item.getDesignEndTime())} + <#if item.getStatus() == 20> +    + + <#else> + ${item.getRemarks()} + +
            +${zhiqim_manager_paging(pageResult, "/designerReg.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/designerworks/designerWorks.zml b/Yangcai365_web/manage/zview/designerworks/designerWorks.zml new file mode 100644 index 0000000..cbfa47f --- /dev/null +++ b/Yangcai365_web/manage/zview/designerworks/designerWorks.zml @@ -0,0 +1,112 @@ +${zhiqim_manager_breadcrumb("作品审核")} +${zhiqim_manager_content()} + + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> +
            + +
            +<#-- 列表 --> +${zhiqim_manager_tr_no_record(pageResult, 39, "
            暂时没有作品信息
            ")} +
            +<#for item : pageResult.list()> +
            +
            + + + + + +
            + 设计师: ${item.getOperatorCode()} 时间:${Sqls.toDateTimeString(item.getAddTime())} +
            +
            +
            + +
            +${zhiqim_manager_paging(pageResult, "/designerWorks.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/designerworks/modifyOrderNum.zml b/Yangcai365_web/manage/zview/designerworks/modifyOrderNum.zml new file mode 100644 index 0000000..48ee53d --- /dev/null +++ b/Yangcai365_web/manage/zview/designerworks/modifyOrderNum.zml @@ -0,0 +1,31 @@ + +
            + 原数量:<#if operatorParam.isEmpty()>0<#else>${operatorParam} +
            +
            + 新数量: + * +
            +
            + + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/designerworks/profile.zml b/Yangcai365_web/manage/zview/designerworks/profile.zml new file mode 100644 index 0000000..1114794 --- /dev/null +++ b/Yangcai365_web/manage/zview/designerworks/profile.zml @@ -0,0 +1,427 @@ +${Scripts.src("/zinc/layui/layui.js")} + +${Scripts.src(zhiqim_uploadlarge.js)} + + +${zhiqim_manager_breadcrumb_name("个人中心")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + +
            账号信息
            + + 用户昵称:#{operator.getOperatorCode()}登录密码:********  修改
            手机号码:<#if Validates.isNotEmpty(operator.getOperatorMobile())>${operator.getOperatorMobile()}  修改<#else>点击绑定个人微信: + <#if Validates.isNotEmpty(operator.getOperatorWxcode())>${operator.getOperatorWxcode()}  修改<#else>点击绑定
            + + + + + + + + + + +
            接单配置
            最大同时接单量:<#if Validates.isNotEmpty(operator.getOperatorParam())>${operator.getOperatorParam()}<#else>0  + 修改 + + 说明:正在设计状态订单总数超过最大同时接单数时,系统将不会自动派单(大于0规则才会生效) +
            + + + + + + + + + + + + + + + + + + + + + +
            个人简介
            +
            *工作经历 
            +
            +
            *软件能力 
            +
            +
            *擅长设计 
            +
            + * + 工作年限  + + * + 在职情况  + + * + 收款方式  +
            + *收款账号  + +
            +
            + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/designerworks/regCheckBack.zml b/Yangcai365_web/manage/zview/designerworks/regCheckBack.zml new file mode 100644 index 0000000..e2d4f79 --- /dev/null +++ b/Yangcai365_web/manage/zview/designerworks/regCheckBack.zml @@ -0,0 +1,25 @@ + +
            + + 拒绝原因: + +
            +
            + + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/desOnlineTimeLog.zml b/Yangcai365_web/manage/zview/dispatch/desOnlineTimeLog.zml new file mode 100644 index 0000000..a01c7f2 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/desOnlineTimeLog.zml @@ -0,0 +1,49 @@ +${zhiqim_manager_breadcrumb("接单时长")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#for item : pageResult.list()> + + + + + + +
             接单时长列表
            日期设计师接单时长
            暂不存在日志信息
            ${item.getDayCode()}${item.getDesigner()}<#if item.getOnlineTime()/60 gt 0>${item.getOnlineTime()/60}小时${item.getOnlineTime()%60}分钟
            +${zhiqim_manager_paging(pageResult, "/desOnlineTimeLog.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/designerGroup.zml b/Yangcai365_web/manage/zview/dispatch/designerGroup.zml new file mode 100644 index 0000000..f836ea7 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/designerGroup.zml @@ -0,0 +1,133 @@ +${zhiqim_manager_breadcrumb("设计组师管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 10, "无数据")} +<#for item : pageResult.list()> + + + + + + + + + + + + + + +
            选择条件组名备注特殊标识接单金额稿件类型/产品最大接单量最大放弃次数操作时间操作人状态
            ${item.getDesignerGroupName()}${item.getRemark()} + <#if item.isHighQualityOrder()> + <#if item.isLargeAmount()> + <#if item.isUrgent()> + <#if item.isDesign()> 仅设计 + <#if item.isSpecial()> + + ${Amounts.toYuanMustRadix(item.getMinOrderAmount())}元 - ${Amounts.toYuanMustRadix(item.getMaxOrderAmount())}元 + + <#var designerGroupValue = ORM.get(ZTable.class).list(DesignerGroupValue.class, new Selector("designerGroupId", item.getDesignerGroupId()))/> + + + + + + + + + + + + + + + + + +
            标准自来稿: + <#for value : designerGroupValue> + <#if value.getRelatedType()==0>${typeMap.get(value.getRelatedValue())}, + +
            改稿自来稿: + <#for value : designerGroupValue> + <#if value.getRelatedType()==4>${typeMap.get(value.getRelatedValue())}, + +
            普通设计: + <#for value : designerGroupValue> + <#if value.getRelatedType()==1>${typeMap.get(value.getRelatedValue())}, + +
            资深设计: + <#for value : designerGroupValue> + <#if value.getRelatedType()==2>${typeMap.get(value.getRelatedValue())}, + +
            +
            + ${item.getMaxOrderNum()} + + ${item.getMaxWaiveNum()} + ${Sqls.toDateTimeString(item.getModifyTime())}${item.getModifyOperatorCode()} + <#if item.getStatus() == 1> + + <#else> + + +
            + +${zhiqim_manager_paging(pageResult, "designerGroup.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/designerGroupAdd.zml b/Yangcai365_web/manage/zview/dispatch/designerGroupAdd.zml new file mode 100644 index 0000000..e6a754b --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/designerGroupAdd.zml @@ -0,0 +1,228 @@ +${zhiqim_manager_history("designerGroup.htm")} +${request.getValidateScript()} +${Scripts.src("/zinc/layui/layui.js")} + + + + + +${zhiqim_manager_breadcrumb_parent("designerGroup.htm" "接单条件组管理" "增加接单条件组")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            增加接单条件组
            接单条件组名: +  * + 备注: + +
            关联渠道: +
            + 全选 +
            +
            + <#for item : merchantList> +
            + + ${item.getMerchantName()} +
            + +
            +
            特殊标识: +
            + + 优质订单 +
            +
            + + 大金额订单 +
            +
            + + 加急订单 +
            +
            + + 仅设计不印刷 +
            +
            + + 异形订单 +
            +
            + 订单金额范围: + +  -  + +
            +
            + 最大接单数量: +  * +
            +
            + 最大可放弃次数: +  * +
            +
            关联产品: +
            + +
            +
            +
            + +
            +
            +
            + +
            +
            +
            + +
            +
            +
            关联行业: +
            +
            +
            +
            支持后加工: +
            + checked data-class="z-blue"/>全选 +
            +
            + <#for item : afterList> +
            + + ${item} +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/designerGroupDispatch.zml b/Yangcai365_web/manage/zview/dispatch/designerGroupDispatch.zml new file mode 100644 index 0000000..f7f68b3 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/designerGroupDispatch.zml @@ -0,0 +1,293 @@ +${zhiqim_manager_breadcrumb("接单条件组接单管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有设计师配置")} +<#for item : pageResult.list()> + + + + + + + + + + + + + + + +
            选择设计师接单条件组独立特殊标识独立接单金额独立稿件类型独立最大接单量是否显示佣金是否显示抢单大厅操作时间操作人状态
            ${item.getOperatorCode()}${designerGroupMap.get(item.getDesignerGroupId())} + <#if item.isHighQualityOrder()> + <#if item.isLargeAmount()> + <#if item.isUrgent()> + <#if item.isDesign()> 仅设计 + <#if item.isSpecial()> + + <#if item.getMinOrderAmount() gt 0 || item.getMaxOrderAmount() gt 0> + ${Amounts.toYuanMustRadix(item.getMinOrderAmount())}元 - ${Amounts.toYuanMustRadix(item.getMaxOrderAmount())}元 + + + <#var designerGroupDispatchValue = ORM.get(ZTable.class).list(DesignerGroupDispatchValue.class, new Selector("operatorCode", item.getOperatorCode()))/> + + + + + + + + + + + + + + + + + +
            标准自来稿: + <#for value : designerGroupDispatchValue> + <#if value.getRelatedType()==0>${typeMap.get(value.getRelatedValue())}, + +
            改稿自来稿: + <#for value : designerGroupDispatchValue> + <#if value.getRelatedType()==4>${typeMap.get(value.getRelatedValue())}, + +
            普通设计: + <#for value : designerGroupDispatchValue> + <#if value.getRelatedType()==1>${typeMap.get(value.getRelatedValue())}, + +
            资深设计: + <#for value : designerGroupDispatchValue> + <#if value.getRelatedType()==2>${typeMap.get(value.getRelatedValue())}, + +
            +
            + <#if item.getMaxOrderNum() gt 0> + ${item.getMaxOrderNum()} + + + + + + + ${Sqls.toDateTimeString(item.getModifyTime())}${item.getModifyOperatorCode()} + <#if item.getStatus() == 1> + + <#else> + + +
            + +${zhiqim_manager_paging(pageResult, "designerGroupDispatch.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/designerGroupDispatch2.zml b/Yangcai365_web/manage/zview/dispatch/designerGroupDispatch2.zml new file mode 100644 index 0000000..0331eda --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/designerGroupDispatch2.zml @@ -0,0 +1,253 @@ +${zhiqim_manager_breadcrumb("接单条件组接单管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有设计师配置")} +<#for item : pageResult.list()> + + + + + + + + + + + + + + +
            选择设计师接单条件组独立特殊标识独立接单金额独立稿件类型独立最大接单量是否显示佣金操作时间操作人状态
            ${item.getOperatorCode()}${designerGroupMap.get(item.getDesignerGroupId())} + <#if item.isHighQualityOrder()> + <#if item.isLargeAmount()> + <#if item.isUrgent()> + <#if item.isDesign()> 仅设计 + <#if item.isSpecial()> + + <#if item.getMinOrderAmount() gt 0 || item.getMaxOrderAmount() gt 0> + ${Amounts.toYuanMustRadix(item.getMinOrderAmount())}元 - ${Amounts.toYuanMustRadix(item.getMaxOrderAmount())}元 + + + <#var designerGroupDispatchValue = ORM.get(ZTable.class).list(DesignerGroupDispatchValue.class, new Selector("operatorCode", item.getOperatorCode()))/> + + + + + + + + + + + + + + + + + +
            标准自来稿: + <#for value : designerGroupDispatchValue> + <#if value.getRelatedType()==0>${typeMap.get(value.getRelatedValue())}, + +
            改稿自来稿: + <#for value : designerGroupDispatchValue> + <#if value.getRelatedType()==4>${typeMap.get(value.getRelatedValue())}, + +
            普通设计: + <#for value : designerGroupDispatchValue> + <#if value.getRelatedType()==1>${typeMap.get(value.getRelatedValue())}, + +
            资深设计: + <#for value : designerGroupDispatchValue> + <#if value.getRelatedType()==2>${typeMap.get(value.getRelatedValue())}, + +
            +
            + <#if item.getMaxOrderNum() gt 0> + ${item.getMaxOrderNum()} + + + + + ${Sqls.toDateTimeString(item.getModifyTime())}${item.getModifyOperatorCode()} + <#if item.getStatus() == 1> + + <#else> + + +
            + +${zhiqim_manager_paging(pageResult, "designerGroupDispatch.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/designerGroupDispatchAdd.zml b/Yangcai365_web/manage/zview/dispatch/designerGroupDispatchAdd.zml new file mode 100644 index 0000000..07678b5 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/designerGroupDispatchAdd.zml @@ -0,0 +1,288 @@ +${zhiqim_manager_history("designerGroupDispatch.htm")} +${request.getValidateScript()} +${Scripts.src("/zinc/layui/layui.js")} + + + + + +${zhiqim_manager_breadcrumb_parent("designerGroupDispatch.htm" "接单配置" "增加设计师配置")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            增加设计师配置
            接单条件组: +
            + +
            +  * +
            设计师: +
            + +
            +  * +
            是否显示佣金: +
            + +
            +
            是否显示抢单大厅: +
            + +
            +
            独立关联渠道: +
            + 全选 +
            +
            + <#for item : merchantList> +
            + + ${item.getMerchantName()} +
            + +
            +
            独立特殊标识: +
            + + 优质订单 +
            +
            + + 大金额订单 +
            +
            + + 加急订单 +
            +
            + + 仅设计不印刷 +
            +
            + + 异形订单 +
            +
            + 订单金额范围: + +  -  + +
            +
            + 最大接单数量: + +
            +
            独立关联产品: +
            + +
            +
            +
            + +
            +
            +
            + +
            +
            +
            + +
            +
            +
            独立关联行业: +
            +
            +
            +
            独立支持后加工: +
            + 全选 +
            +
            + <#for item : afterList> +
            + + ${item} +
            + +
            +
            初/定稿免检产品: +
            + 全选 +
            +
            + <#for item : designTypeList> +
            + + ${item.getTypeName()} +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/designerGroupDispatchLog.zml b/Yangcai365_web/manage/zview/dispatch/designerGroupDispatchLog.zml new file mode 100644 index 0000000..aab0c74 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/designerGroupDispatchLog.zml @@ -0,0 +1,85 @@ +${zhiqim_manager_breadcrumb("商户分拣日志")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#for item : pageResult.list()> + + + + + + + +
             商户分拣日志列表
            订单号分拣时间分拣描述操作
            暂不存在商户分拣日志信息
            ${item.getDesignId()}${Sqls.toDateTimeString(item.getDesTime())}${item.getDisDesc()} + <#if Validates.isNotEmptyBlank(item.getAnalysisText())> + + + ${item.getAnalysisText()} +
            +${zhiqim_manager_paging(pageResult, "/merDispatchLog.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/designerGroupDispatchModify.zml b/Yangcai365_web/manage/zview/dispatch/designerGroupDispatchModify.zml new file mode 100644 index 0000000..34ba5d0 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/designerGroupDispatchModify.zml @@ -0,0 +1,303 @@ +${zhiqim_manager_history("designerGroupDispatch.htm")} +${request.getValidateScript()} +${Scripts.src("/zinc/layui/layui.js")} + + + + + +${zhiqim_manager_breadcrumb_parent("designerGroupDispatch.htm" "接单配置" "修改设计师配置")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            修改设计师配置
            接单条件组: +
            + +
            +  * +
            是否显示佣金: +
            + +
            +
            是否显示抢单大厅: +
            + +
            +
            设计师: + + ${designerGroupDispatch.getOperatorCode()} +
            独立关联渠道: +
            + checked data-class="z-blue"/>全选 +
            +
            + <#for item : merchantList> +
            + checked class="z-checkbox" value="${item.getMerchantId()}" data-role="z-checkbox" data-class="${zmr_color_class}"> + ${item.getMerchantName()} +
            + +
            +
            独立特殊标识: +
            + checked class="z-checkbox" value="1" data-role="z-checkbox" data-class="${zmr_color_class}"> + 优质订单 +
            +
            + checked class="z-checkbox" value="1" data-role="z-checkbox" data-class="${zmr_color_class}"> + 大金额订单 +
            +
            + checked class="z-checkbox" value="1" data-role="z-checkbox" data-class="${zmr_color_class}"> + 加急订单 +
            +
            + checked class="z-checkbox" value="1" data-role="z-checkbox" data-class="${zmr_color_class}"> + 仅设计不印刷 +
            +
            + checked class="z-checkbox" value="1" data-role="z-checkbox" data-class="${zmr_color_class}"> + 异形订单 +
            +
            + 订单金额范围: + +  -  + +
            +
            + 最大接单数量: + +
            +
            + +
            +
            独立关联产品: +
            + +
            +
            +
            + +
            +
            +
            + +
            +
            +
            + +
            +
            +
            独立关联行业: +
            +
            +
            +
            独立支持后加工: +
            + checked data-class="z-blue"/>全选 +
            +
            + <#for item : afterList> +
            + checked class="z-checkbox" value="${item}" data-role="z-checkbox" data-class="${zmr_color_class}"> + ${item} +
            + +
            +
            初/定稿免检产品: +
            + checked data-class="z-blue"/>全选 +
            +
            + <#for item : designTypeList> +
            + checked class="z-checkbox" value="${item.getTypeId()}" data-role="z-checkbox" data-class="${zmr_color_class}"> + ${item.getTypeName()} +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/designerGroupDispatchModify2.zml b/Yangcai365_web/manage/zview/dispatch/designerGroupDispatchModify2.zml new file mode 100644 index 0000000..cf5a2c9 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/designerGroupDispatchModify2.zml @@ -0,0 +1,109 @@ +${zhiqim_manager_history("designerGroupDispatch2.htm")} +${request.getValidateScript()} +${Scripts.src("/zinc/layui/layui.js")} + + + + + +${zhiqim_manager_breadcrumb_parent("designerGroupDispatch2.htm" "接单配置" "修改设计师配置")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + +
            修改设计师配置
            是否显示佣金: +
            + +
            +
            设计师: + + ${designerGroupDispatch.getOperatorCode()} +
            独立特殊标识: + +
            + 最大接单数量: + +
            +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/designerGroupModify.zml b/Yangcai365_web/manage/zview/dispatch/designerGroupModify.zml new file mode 100644 index 0000000..a89d035 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/designerGroupModify.zml @@ -0,0 +1,247 @@ +${zhiqim_manager_history("designerGroup.htm")} +${request.getValidateScript()} +${Scripts.src("/zinc/layui/layui.js")} + + + + + +${zhiqim_manager_breadcrumb_parent("designerGroup.htm" "接单条件组管理" "修改接单条件组")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            修改接单条件组
            接单条件组名: +  * + 备注: + +
            关联渠道: +
            + checked data-class="z-blue"/>全选 +
            +
            + <#for item : merchantList> +
            + checked class="z-checkbox" value="${item.getMerchantId()}" data-role="z-checkbox" data-class="${zmr_color_class}"> + ${item.getMerchantName()} +
            + +
            +
            特殊标识: +
            + checked class="z-checkbox" value="1" data-role="z-checkbox" data-class="${zmr_color_class}"> + 优质订单 +
            +
            + checked class="z-checkbox" value="1" data-role="z-checkbox" data-class="${zmr_color_class}"> + 大金额订单 +
            +
            + checked class="z-checkbox" value="1" data-role="z-checkbox" data-class="${zmr_color_class}"> + 加急订单 +
            +
            + checked class="z-checkbox" value="1" data-role="z-checkbox" data-class="${zmr_color_class}"> + 仅设计不印刷 +
            +
            + checked class="z-checkbox" value="1" data-role="z-checkbox" data-class="${zmr_color_class}"> + 异形订单 +
            +
            + 订单金额范围: + +  -  + +
            +
            + 最大接单数量: +  * +
            +
            + 最大可放弃订单次数: +  * +
            +
            关联产品: +
            + +
            +
            +
            + +
            +
            +
            + +
            +
            +
            + +
            +
            +
            关联行业: +
            +
            +
            +
            支持后加工: +
            + checked data-class="z-blue"/>全选 +
            +
            + <#for item : afterList> +
            + checked class="z-checkbox" value="${item}" data-role="z-checkbox" data-class="${zmr_color_class}"> + ${item} +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/dispatchLog.zml b/Yangcai365_web/manage/zview/dispatch/dispatchLog.zml new file mode 100644 index 0000000..f4a9362 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/dispatchLog.zml @@ -0,0 +1,94 @@ +${zhiqim_manager_breadcrumb("派单日志")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#var industryList = Global.get(DesignIndustryCache.class).getIndustryListAll()/> +<#for item : pageResult.list()> + + + + + + + + + + + +
             派单日志列表
            订单号设计师派单时间派单状态派单类型行业产品描述操作描述
            暂不存在派单日志信息
            ${item.getDesignId()}${item.getOperatorCode()}${Sqls.toDateTimeString(item.getDesTime())} + <#if item.getDisOrderStatus() ==0>订单完成 + <#if item.getDisOrderStatus() ==1>订单未完成 + <#if item.getDisOrderStatus() ==2>订单转让 + <#if item.getDisOrderStatus() ==3>订单退款 + <#if item.getDisOrderStatus() ==4>订单已暂停 + + <#if item.getDisType()== 0>自动派单 + <#if item.getDisType()== 1>手工指单 + <#if item.getDisType()== 2>手动领单 + + <#if Validates.isNotEmpty(industryList)> + <#for industry : industryList> + <#if item.getIndustryId()==industry.getIndustryId()> + ${industry.getIndustryName()} + + + + ${item.getOrderText()}${item.getDisDesc()}
            +${zhiqim_manager_paging(pageResult, "/dispatchLog.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/dispatchProperty.zml b/Yangcai365_web/manage/zview/dispatch/dispatchProperty.zml new file mode 100644 index 0000000..3df8b2b --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/dispatchProperty.zml @@ -0,0 +1,92 @@ +${zhiqim_manager_breadcrumb("派单属性")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +
            + + + +
            + + + + + + + + + + + + + + + + + +<#if pageResult.total() == 0> +${zhiqim_manager_no_record(13, "暂时没有设计师派单属性信息")} + + +<#for item : pageResult.list()> + + + + + + + + + + + + + + +
             派单属性列表
            选择设计师所属组织主类型副类型主行业副行业级别关联店铺创建时间更新时间
            ${item.getOperatorCode()}${ZmrOrgDao.getOrgName(request, item.getOrgId())}<#if typeMap.containsKey(item.getMajorType())>${typeMap.get(item.getMajorType()).getTypeName()} + <#if Validates.isNotEmpty(item.getSecondaryTypes())> + <#var typeList = Lists.toLongList(item.getSecondaryTypes())/> + <#for typeId : typeList> + <#if typeMap.containsKey(typeId)>${typeMap.get(typeId).getTypeName()} + <#if typeList.size() - 1 != typeId_index>- + + + <#if industryMap.containsKey(item.getMajorIndustry())>${industryMap.get(item.getMajorIndustry()).getIndustryName()} + <#if Validates.isNotEmpty(item.getSecondaryIndustrys())> + <#var industryList = Lists.toLongList(item.getSecondaryIndustrys())/> + <#for industry :industryList> + <#if industryMap.containsKey(industry)>${industryMap.get(industry).getIndustryName()} + <#if industryList.size() - 1 != industry_index>, + + + + <#if item.getDesignerLevel()==0>普通 + <#if item.getDesignerLevel()==1>高级 + ${item.getShopNick()}${item.getCreateTime()}${item.getUpdateTime()}
            +${zhiqim_manager_paging(pageResult, "/dispatchProperty.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/dispatchPropertyAdd.zml b/Yangcai365_web/manage/zview/dispatch/dispatchPropertyAdd.zml new file mode 100644 index 0000000..63d365c --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/dispatchPropertyAdd.zml @@ -0,0 +1,198 @@ + +${request.getValidateScript()} +${zhiqim_manager_history("/dispatchProperty.htm")} +${zhiqim_manager_breadcrumb_parent("/dispatchProperty.htm", "派单属性", "增加设计师派单属性")} +${zhiqim_manager_content()} + +${zhiqim_manager_title("新增设计师派单属性")} +
            + + + + + + + + + +<#var typeList = DesignTypeDao.list()/> + + + + + + + + + +<#var industryList = Global.get(DesignIndustryCache.class).getIndustryList()/> + + + + + + + + + + + + + + + + + + + + + +
            选择商户 + +  * +
            设计师 + + +  * +
            主产品类型: + <#if Validates.isNotEmpty(typeList)> + <#for item : typeList> +  ${item.getTypeName()}   + <#if (item_index + 1) % 5 == 0>

            + + +
            副产品类型(请选择): + <#if Validates.isNotEmpty(typeList)> + <#for item : typeList> +  ${item.getTypeName()}   + <#if (item_index + 1) % 5 == 0>

            + + +
            主行业:(请选择) + <#if Validates.isNotEmpty(industryList)> + <#for item : industryList> +  ${item.getIndustryName()}   + <#if (item_index + 1) % 5 == 0>

            + + +
            副行业:(请选择) + <#if Validates.isNotEmpty(industryList)> + <#for item : industryList> +  ${item.getIndustryName()}   + <#if (item_index + 1) % 5 == 0>

            + + +
            设计师级别:(请选择) +  * +
            支持店铺:(请选择) + <#for shop : shopList> +
            + + ${shop}
            + +
            支持产品类型: +
            + + 设计稿 +
            +
            + + 标准自来稿 +
            +
            + + 改稿自来稿 +
            +
            + + 优质客户订单 +
            +
            + + 加急订单 +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/dispatchPropertyModify.zml b/Yangcai365_web/manage/zview/dispatch/dispatchPropertyModify.zml new file mode 100644 index 0000000..9aa42f6 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/dispatchPropertyModify.zml @@ -0,0 +1,107 @@ +${zhiqim_manager_history("/dispatchProperty.htm")} +${zhiqim_manager_breadcrumb_parent("/dispatchProperty.htm", "设计师派单属性", "修改设计师派单属性")} +${zhiqim_manager_content()} + +${zhiqim_manager_title("修改设计师与行业关系")} +
            + + + + + + + +<#var typeList = DesignTypeDao.list()/> + + + + + + + + +<#var industryList = Global.get(DesignIndustryCache.class).getIndustryList()/> + + + + + + + + + + + + + + + + + + + + +
            设计师${dispatchProperty.getOperatorCode()}
            主产品类型: + <#if Validates.isNotEmpty(typeList)> + <#for item : typeList> + checked="checked" type="radio" value="${item.getTypeId()}">  ${item.getTypeName()}   + <#if (item_index + 1) % 5 == 0>

            + + +
            副产品类型(请选择): + <#if Validates.isNotEmpty(typeList)> + <#for item : typeList> + checked="checked" type="checkbox" value="${item.getTypeId()}">  ${item.getTypeName()}   + <#if (item_index + 1) % 5 == 0>

            + + +
            主行业:(请选择) + <#if Validates.isNotEmpty(industryList)> + <#for item : industryList> + checked="checked" type="radio" value="${item.getIndustryId()}">  ${item.getIndustryName()}   + <#if (item_index + 1) % 5 == 0>

            + + +
            副行业:(请选择) + <#if Validates.isNotEmpty(industryList)> + <#for item : industryList> + checked="checked" type="checkbox" value="${item.getIndustryId()}">  ${item.getIndustryName()}   + <#if (item_index + 1) % 5 == 0>

            + + +
            设计师级别:(请选择) +  * +
            支持店铺:(请选择) + <#for shop : shopList> +
            + checked value="${shop}" data-role="z-checkbox" data-class="${zmr_color_class}"> + ${shop}
            + +
            支持产品类型: +
            + checked value="true" data-role="z-checkbox" data-class="${zmr_color_class}"> + 设计稿 +
            +
            + checked value="true" data-role="z-checkbox" data-class="${zmr_color_class}"> + 标准自来稿 +
            +
            + checked value="true" data-role="z-checkbox" data-class="${zmr_color_class}"> + 改稿自来稿 +
            +
            + checked value="true" data-role="z-checkbox" data-class="${zmr_color_class}"> + 优质客户订单 +
            +
            + checked value="true" data-role="z-checkbox" data-class="${zmr_color_class}"> + 加急订单 +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/dispatchStat.zml b/Yangcai365_web/manage/zview/dispatch/dispatchStat.zml new file mode 100644 index 0000000..31542e8 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/dispatchStat.zml @@ -0,0 +1,122 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("分拣统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 分页列表--> + + + + + +
            + + + + + + + + + + + + + + + + + + + + + + + + + +
            派发类型单量百分比
            用户抢单${contendOrder}${Maths.division(contendOrder*100, sumCount, 1)}%
            自动派单${dispatchCount}${Maths.division(dispatchCount*100, sumCount, 1)}%
            手工指定${assignCount}${Maths.division(assignCount*100, sumCount, 1)}%
            总单量${sumCount}
            + + + + + + + + + + + + + <#for item : map.values()> + + + + + + + + + + + +
            组织名称单量百分比名片类名片彩页类彩页其他
            ${item.getOrgName()}${item.getOrderNum()}${Maths.division(item.getOrderNum()*100, sumCount, 1)}%${item.getCardNum()}${item.getOnlyCardNum()}${item.getColorPageNum()}${item.getOnlyColorPageNum()}${item.getOtherNum()}
            +
            + + +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/dispatch/dispatchWaitStat.zml b/Yangcai365_web/manage/zview/dispatch/dispatchWaitStat.zml new file mode 100644 index 0000000..90623ad --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/dispatchWaitStat.zml @@ -0,0 +1,94 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("待派统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 分页列表--> + + + + + +
            + + + + + + + + + + + + <#for item : map.values()> + + + + + + + + + + + + + + + +
            组织名称单量百分比名片类名片彩页类彩页其他
            ${item.getOrgName()}${item.getOrderNum()}${Maths.division(item.getOrderNum()*100, sumCount, 1)}%${item.getCardNum()}${item.getOnlyCardNum()}${item.getColorPageNum()}${item.getOnlyColorPageNum()}${item.getOtherNum()}
            总待派订单${sumCount}
            +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/dispatch/merDispatchLog.zml b/Yangcai365_web/manage/zview/dispatch/merDispatchLog.zml new file mode 100644 index 0000000..2f89a2f --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/merDispatchLog.zml @@ -0,0 +1,85 @@ +${zhiqim_manager_breadcrumb("商户分拣日志")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#for item : pageResult.list()> + + + + + + + +
             商户分拣日志列表
            订单号分拣时间分拣描述操作
            暂不存在商户分拣日志信息
            ${item.getDesignId()}${Sqls.toDateTimeString(item.getDesTime())}${item.getDisDesc()} + <#if Validates.isNotEmptyBlank(item.getAnalysisText())> + + + ${item.getAnalysisText()} +
            +${zhiqim_manager_paging(pageResult, "/merDispatchLog.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/onlineLog.zml b/Yangcai365_web/manage/zview/dispatch/onlineLog.zml new file mode 100644 index 0000000..cf640fd --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/onlineLog.zml @@ -0,0 +1,61 @@ +${zhiqim_manager_breadcrumb("在线设计师")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#for item : pageResult.list()> + + + + + + + + + + +
            组织设计师接单状态未完成订单数最近开启接单时间最近初稿类型最近初稿提交时间
            无数据
            ${ZmrOrgDao.getOrgName(request, item.getOrgId())}${item.getOperatorCode()} + <#if item.getOnlineStatus()== 0>停止接单 + <#if item.getOnlineStatus()== 1>正在接单 + ${item.getOrderNum()}${item.getSessionTime()}${typeMap.get(item.getLastDraftType()).getTypeName()}${item.getLastDraftTime()}
            +${zhiqim_manager_paging(pageResult, "/onlineLog.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/presenter/designerGroupAnalisysResult.zml b/Yangcai365_web/manage/zview/dispatch/presenter/designerGroupAnalisysResult.zml new file mode 100644 index 0000000..339c019 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/presenter/designerGroupAnalisysResult.zml @@ -0,0 +1,71 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> +
            +<#if analysisResult.isOldUser()> + + + + +
              +
            ${analysisResult.getDispatchMsg()}
            +
            +<#else> +<#for merResult : analysisResult.getMerAnalysisList()> + + + + + + + + + <#var resultList = merResult.getResultList()/> + <#if resultList != null> + <#for result : resultList> + + + + + + +
              +
            【${merResult.getOrgName()}】
            +
            分拣优先级:${merResult.getAnalysisMer().getMerLevel()}
            +
            分析时间:${merResult.getAnalysisTime()}
            +
            结果描述:<#if Validates.isNotEmptyBlank(merResult.getMerMsg())>${merResult.getMerMsg()}<#else>分拣失败
            +
            条件匹配条件匹配描述
            <#if result.isSuccess()>成功<#else>失败${result.getConditionMsg()}
            +<#if Validates.isNotEmpty(merResult.getDesignerScoreList())> +<#for designer : merResult.getDesignerScoreList()> + + + + + + + + + <#var resultList = designer.getResultList()/> + <#if resultList != null> + <#for result : resultList> + + + + + + +
              +
            【${merResult.getOrgName()}】【${designer.getOperatorCode()}】
            +
            分析结果:<#if designer.isSuccess() && designer.getOperatorCode().equals(analysisResult.getDesigner())>派单成功<#else>派单失败
            +
            条件匹配条件匹配描述
            <#if result.isSuccess()>成功<#else>失败${result.getConditionMsg()}
            + +<#else> + + + + +
              +
            设计师分析:商户${merResult.getOrgName()}暂无在线设计师
            +
            + + + +
            diff --git a/Yangcai365_web/manage/zview/dispatch/presenter/orderDispatchAnalisysResult.zml b/Yangcai365_web/manage/zview/dispatch/presenter/orderDispatchAnalisysResult.zml new file mode 100644 index 0000000..fe7ed36 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/presenter/orderDispatchAnalisysResult.zml @@ -0,0 +1,49 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> +
            +<#if Validates.isNotEmptyBlank(oldUser)> + + + + +
              +
            【${orgName}】
            +
            分析时间:${nowData}
            +
            分析结果:已通过老用户订单分析派送给设计师${oldUser}
            +
            +<#elseif Validates.isNotEmpty(designerList)> +<#for designer : designerList> + + + + + + + + + <#var resultList = designer.getResultList()/> + <#if resultList != null> + <#for result : resultList> + + + + + + +
              +
            【${designer.getOperatorCode()}】
            +
            分析时间:${nowData}
            +
            分析结果:<#if designer.isSuccess() && designer_index == 0>派单成功<#else>派单失败
            +
            条件匹配条件匹配描述
            <#if result.isSuccess()>成功<#else>失败${result.getConditionMsg()}
            + +<#else> + + + + +
              +
            【${orgName}】
            +
            分析时间:${nowData}
            +
            分析结果:商户${orgName}暂无在线设计师
            +
            + +
            diff --git a/Yangcai365_web/manage/zview/dispatch/presenter/orderMerAnalisysResult.zml b/Yangcai365_web/manage/zview/dispatch/presenter/orderMerAnalisysResult.zml new file mode 100644 index 0000000..b6a69bd --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/presenter/orderMerAnalisysResult.zml @@ -0,0 +1,28 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> +
            +<#for merResult : merAnalysisList> + + + + + + + + + <#var resultList = merResult.getResultList()/> + <#if resultList != null> + <#for result : resultList> + + + + + + +
              +
            【${merResult.getOrgName()}】
            +
            分拣优先级:${merResult.getAnalysisMer().getMerLevel()}
            +
            分析时间:${merResult.getAnalysisTime()}
            +
            结果描述:<#if Validates.isNotEmptyBlank(merResult.getMerMsg())>${merResult.getMerMsg()}<#else>分拣失败
            +
            条件匹配条件匹配描述
            <#if result.isSuccess()>成功<#else>失败${result.getConditionMsg()}
            + +
            diff --git a/Yangcai365_web/manage/zview/dispatch/waitDisDesignerGroupOrder.zml b/Yangcai365_web/manage/zview/dispatch/waitDisDesignerGroupOrder.zml new file mode 100644 index 0000000..2682ca7 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/waitDisDesignerGroupOrder.zml @@ -0,0 +1,114 @@ +${zhiqim_manager_breadcrumb("待派订单")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 操作功能 --> +
            + + +
            + + + + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#for item : pageResult.list()> + + + + + + + + + +
             待分拣订单列表
            选择订单号稿件类型产品名称状态录单时间
            暂不存在待派订单信息
            ${item.getDesignId()} + <#if item.getReDesignSrcId() gt 0> + <#if item.isUrgent()> + <#if item.isHighQualityOrder()> + <#if item.getIsOldUser() gt 0> + <#if !(item.getAmount() lt 30000)> + <#if item.getShowRedMark() == 1> + ${DraftConstants.get(item.getDraftType())}${item.getOrderText()}${StatusConstants.getStatus(item.getStatus())}${Sqls.toDateTimeString(item.getCreateTime())}
            +${zhiqim_manager_paging(pageResult, "/waitDisDesignerGroupOrder.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/waitDisMerOrder.zml b/Yangcai365_web/manage/zview/dispatch/waitDisMerOrder.zml new file mode 100644 index 0000000..3f73481 --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/waitDisMerOrder.zml @@ -0,0 +1,99 @@ +${zhiqim_manager_breadcrumb("待派订单")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 操作功能 --> +
            + +
            + + + + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#for item : pageResult.list()> + + + + + + + + + +
             待分拣订单列表
            选择订单号稿件类型产品名称状态录单时间
            暂不存在待派订单信息
            ${item.getDesignId()}${DraftConstants.get(item.getDraftType())}${item.getOrderText()}${StatusConstants.getStatus(item.getStatus())}${Sqls.toDateTimeString(item.getCreateTime())}
            +${zhiqim_manager_paging(pageResult, "/waitDisMerOrder.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/workSearchLog.zml b/Yangcai365_web/manage/zview/dispatch/workSearchLog.zml new file mode 100644 index 0000000..1abff5e --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/workSearchLog.zml @@ -0,0 +1,48 @@ +${zhiqim_manager_breadcrumb("派单日志")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#for item : pageResult.list()> + + + + + + +
             工作日志列表
            操作时间设计师操作描述
            暂不存在日志信息
            ${Sqls.toDateTimeString(item.getCreateTime())}${item.getOperatorCode()}${item.getOprDesc()}
            +${zhiqim_manager_paging(pageResult, "/workSearchLog.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/dispatch/workingStatus.zml b/Yangcai365_web/manage/zview/dispatch/workingStatus.zml new file mode 100644 index 0000000..fd8d12c --- /dev/null +++ b/Yangcai365_web/manage/zview/dispatch/workingStatus.zml @@ -0,0 +1,124 @@ + +${zhiqim_manager_breadcrumb("设计师工作状态")} +${zhiqim_manager_content()} +
            + + + + + +
             查询条件:
            + + + + + + + + + +
            设计师: 上班时间: +  -  + + 挂起时间: +  -  + +
                
            +
            +
            + + + + + + + + + + + + + + + + +<#if pageResult.total() == 0> +${zhiqim_manager_no_record(10, "暂时没有上班的设计师信息")} + +<#for item : pageResult.list()> + + + + + + + + <#var lastHangUpLog=designerPreHangUpMap.get(item.getOperatorCode())/> + + + + + +
             上班中的设计师信息
            设计师状态上班时间当前订单数量最近完成初稿类型上次初稿提交时间上次挂起时间上次挂起时长当天挂起时长
            ${item.getOperatorCode()} + <#if item.getStatus()== 0>下班 + <#if item.getStatus()== 1>上班中 + <#if item.getStatus()== 2>挂起 + ${Sqls.toDateTimeString(item.getOnDutyTime())}${item.getOrderNumber()} + <#if item.getLastDraftType().equals("card")>名片 + <#if item.getLastDraftType().equals("colorPage")>彩页 + <#if item.getLastDraftTime() != null>${Sqls.toDateTimeString(item.getLastDraftTime())}<#if lastHangUpLog != null>${Sqls.toDateTimeString(lastHangUpLog.getHangUpTime())} + + + + + +
            +${zhiqim_manager_paging(pageResult, "/workingStatus.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/editor/bindingType.zml b/Yangcai365_web/manage/zview/editor/bindingType.zml new file mode 100644 index 0000000..f20cb20 --- /dev/null +++ b/Yangcai365_web/manage/zview/editor/bindingType.zml @@ -0,0 +1,40 @@ +${request.getValidateScript()} + + + + + + + +
            产品类型: + +
            +<#-- 操作 --> +
            +   + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/editor/designPinLeiList.zml b/Yangcai365_web/manage/zview/editor/designPinLeiList.zml new file mode 100644 index 0000000..c01b87d --- /dev/null +++ b/Yangcai365_web/manage/zview/editor/designPinLeiList.zml @@ -0,0 +1,95 @@ +<#def designatedPath="/designTypeList.htm"/> + + +${zhiqim_manager_breadcrumb("设计类型")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +
            + + + + + + + + +
            品类ID:品类名称:类型ID:类型名称: + + +
            +
            + +<#-- 列表 --> + + + + + + + + +<#if Lists.size(pageResult.list()) == 0> +${zhiqim_manager_no_record(9, "无品类信息")} + +<#for item : pageResult.list()> + + + + + <#if item.getTypeId() == 0> + + <#else> + + + + + +
            选项品类ID品类名称类型ID类型名称
            ${item.getId()}${item.getName()}${item.getTypeId()}${item.getTypeName()}
            +${zhiqim_manager_paging(pageResult, "/designPinleiList.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/keyword/keywordIndustryTop.zml b/Yangcai365_web/manage/zview/keyword/keywordIndustryTop.zml new file mode 100644 index 0000000..7006d01 --- /dev/null +++ b/Yangcai365_web/manage/zview/keyword/keywordIndustryTop.zml @@ -0,0 +1,41 @@ + + +${zhiqim_manager_breadcrumb("关键词排行榜")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/keyword/keywordTop.zml b/Yangcai365_web/manage/zview/keyword/keywordTop.zml new file mode 100644 index 0000000..d06eda8 --- /dev/null +++ b/Yangcai365_web/manage/zview/keyword/keywordTop.zml @@ -0,0 +1,130 @@ +${zhiqim_manager_breadcrumb("关键词排行榜")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + +
            +
            +
            +

            今日搜索榜

            +
            +
            + <#for item : threeList> +
            +
            +
            +
            ${item.getKeywordName()}
            +
            ${item.getKeywordNum()}
            +
            + +
            +
            +
              +
            • +
              关键词
              +
              指数
              升降    
              +
            • + <#for item : restList> +
            • +
              ${item.getKeywordName()}
              +
              ${item.getKeywordNum()}
              +
            • + +
            • +
              +
            • +
            +
            +
            +
            +
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/keyword/presenter/keywordIndustryTopInfo.zml b/Yangcai365_web/manage/zview/keyword/presenter/keywordIndustryTopInfo.zml new file mode 100644 index 0000000..806f790 --- /dev/null +++ b/Yangcai365_web/manage/zview/keyword/presenter/keywordIndustryTopInfo.zml @@ -0,0 +1,36 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + +
            子行业: + <#for item : inSubList> + + +
            +
            + +
            +
            + + + + + + +<#for item : coreList> + + + + + + +
            排名关键词搜索次数
            ${item_index + 1}${item.getKeywordName()}${item.getKeywordNum()}
            +
            +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/labelAttribute.zml b/Yangcai365_web/manage/zview/label/labelAttribute.zml new file mode 100644 index 0000000..c6cce16 --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelAttribute.zml @@ -0,0 +1,64 @@ +${zhiqim_manager_breadcrumb("标签属性")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + +<#if pageResult.total() == 0> + ${zhiqim_manager_no_record(4 "暂时没有标签属性信息")} + +<#for item : pageResult.list()> + + + + + + + + +
             标签属性值列表
            选择行业名称属性名称属性值名称创建时间
            + <#for industry : industryList> + <#if item.getIndustryId() == industry.getIndustryId()>${industry.getIndustryName()} + + ${LabelPresenter.doAttributeCatName(item.getAttributeCatId())}${item.getAttributeName()}${Sqls.toDateTimeString(item.getCreateTime())}
            +${zhiqim_manager_paging(pageResult, "/labelAttribute.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/labelAttributeAdd.zml b/Yangcai365_web/manage/zview/label/labelAttributeAdd.zml new file mode 100644 index 0000000..af2e35c --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelAttributeAdd.zml @@ -0,0 +1,68 @@ + + +${zhiqim_manager_history("/labelAttribute.htm")} +${request.getValidateScript()} +${zhiqim_manager_breadcrumb_parent("/labelAttribute.htm", "标签属性值", "增加标签属性值")} +
            +${zhiqim_manager_title("新增标签属性值")} +
            + + + + + + + + + + + + + +
            标签行业:(请选择) +  * +
            属性:(请选择) +  * +
            属性值:(逗号隔开) *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/labelAttributeCat.zml b/Yangcai365_web/manage/zview/label/labelAttributeCat.zml new file mode 100644 index 0000000..cc8ea55 --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelAttributeCat.zml @@ -0,0 +1,61 @@ +${zhiqim_manager_breadcrumb("标签属性分类")} +${zhiqim_manager_content()} +<#-- 属性分类栏 --> +
            + +
            + + + + + + + + + + + +<#if pageResult.total() == 0> + ${zhiqim_manager_no_record(4 "暂时没有标签属性信息")} + +<#for item : pageResult.list()> + + + + + + + +
             标签属性列表
            选择行业名称属性名称创建时间
            + <#for industry : industryList> + <#if item.getIndustryId() == industry.getIndustryId()>${industry.getIndustryName()} + + ${item.getAttributeCatName()}${Sqls.toDateTimeString(item.getCreateTime())}
            +${zhiqim_manager_paging(pageResult, "/labelAttributeCat.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/labelAttributeCatAdd.zml b/Yangcai365_web/manage/zview/label/labelAttributeCatAdd.zml new file mode 100644 index 0000000..db33a57 --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelAttributeCatAdd.zml @@ -0,0 +1,25 @@ +${zhiqim_manager_history("/labelAttributeCat.htm")} +${request.getValidateScript()} +${zhiqim_manager_breadcrumb_parent("/labelAttributeCat.htm", "标签属性", "增加标签属性")} +
            +${zhiqim_manager_title("新增标签属性")} +
            + + + + + + + + + +
            标签行业:(请选择) +  * +
            标签属性名称:(64位不定长字符) *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/labelAttributeCatModify.zml b/Yangcai365_web/manage/zview/label/labelAttributeCatModify.zml new file mode 100644 index 0000000..6505765 --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelAttributeCatModify.zml @@ -0,0 +1,26 @@ +${zhiqim_manager_history("/labelAttributeCat.htm")} +${request.getValidateScript()} +${zhiqim_manager_breadcrumb_parent("/labelAttributeCat.htm", "标签属性", "修改标签属性")} +
            +${zhiqim_manager_title("修改标签属性")} +
            + + + + + + + + + + +
            标签行业:(请选择) +  * +
            标签属性名称:(64位不定长字符) *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/labelAttributeModify.zml b/Yangcai365_web/manage/zview/label/labelAttributeModify.zml new file mode 100644 index 0000000..b1bc38b --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelAttributeModify.zml @@ -0,0 +1,69 @@ + + +${zhiqim_manager_history("/labelAttribute.htm")} +${request.getValidateScript()} +${zhiqim_manager_breadcrumb_parent("/labelAttribute.htm", "标签属性值", "修改标签属性值")} +
            +${zhiqim_manager_title("修改标签属性值")} +
            + + + + + + + + + + + + + + +
            标签分类:(请选择) +  * +
            属性:(请选择) +  * +
            属性值名称:(64位不定长字符) *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/labelBrand.zml b/Yangcai365_web/manage/zview/label/labelBrand.zml new file mode 100644 index 0000000..98ac2d7 --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelBrand.zml @@ -0,0 +1,47 @@ +${zhiqim_manager_breadcrumb("标签品牌")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + + +<#if pageResult.total() == 0> + ${zhiqim_manager_no_record(6 "暂时没有标签品牌信息")} + +<#for item : pageResult.list()> + + + + + + + + + +
             标签品牌列表
            选择排序品牌ID品牌名称产品类型状态
            ${item.getBrandSeq()}${item.getBrandId()}${item.getBrandName()}${Global.get(ProductTypeCache.class).getName(item.getTypeId())}<#if item.getBrandStatus() == 0>有效<#else>已停用
            +${zhiqim_manager_paging(pageResult, "/labelBrand.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/labelBrandAdd.zml b/Yangcai365_web/manage/zview/label/labelBrandAdd.zml new file mode 100644 index 0000000..d99d096 --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelBrandAdd.zml @@ -0,0 +1,38 @@ +${zhiqim_manager_history("/labelBrand.htm")} +${request.getValidateScript()} +${zhiqim_manager_breadcrumb_parent("/labelBrand.htm", "标签品牌", "增加标签品牌")} +
            +${zhiqim_manager_title("新增标签品牌")} +
            + + + + + + + + + + + + + + + + + +
            标签分类:(请选择) +  * +
            标签品牌名称:(64位不定长字符) *
            序号:
            行业状态:(有效|停用) + +  *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/labelBrandModify.zml b/Yangcai365_web/manage/zview/label/labelBrandModify.zml new file mode 100644 index 0000000..154d215 --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelBrandModify.zml @@ -0,0 +1,39 @@ +${zhiqim_manager_history("/labelBrand.htm")} +${request.getValidateScript()} +${zhiqim_manager_breadcrumb_parent("/labelBrand.htm", "标签品牌", "修改标签品牌")} +
            +${zhiqim_manager_title("修改标签品牌")} +
            + + + + + + + + + + + + + + + + + + +
            标签分类:(请选择) +  * +
            标签品牌名称:(64位不定长字符) *
            序号:
            品牌状态:(有效|停用) +  * +
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/labelIndustry.zml b/Yangcai365_web/manage/zview/label/labelIndustry.zml new file mode 100644 index 0000000..fef7915 --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelIndustry.zml @@ -0,0 +1,56 @@ + + +${zhiqim_manager_breadcrumb("标签行业")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + +
            + + + <#for item : indList> + + + + +
            标签导航
            ${item.getIndustryName()}
            +
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/labelIndustryAdd.zml b/Yangcai365_web/manage/zview/label/labelIndustryAdd.zml new file mode 100644 index 0000000..4b80a94 --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelIndustryAdd.zml @@ -0,0 +1,25 @@ +${zhiqim_manager_history("/labelIndustry.htm")} +${request.getValidateScript()} +${zhiqim_manager_breadcrumb_parent("/labelIndustry.htm", "标签行业", "增加标签行业")} +
            +${zhiqim_manager_title("新增标签行业")} +
            + + + + + + + + + +
            标签行业:(请选择) +  * +
            子行业名称:(逗号隔开) *
            +${zhiqim_manager_submit()} +
            +
            diff --git a/Yangcai365_web/manage/zview/label/labelIndustryModify.zml b/Yangcai365_web/manage/zview/label/labelIndustryModify.zml new file mode 100644 index 0000000..4b7989e --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelIndustryModify.zml @@ -0,0 +1,26 @@ +${zhiqim_manager_history("/labelIndustry.htm")} +${request.getValidateScript()} +${zhiqim_manager_breadcrumb_parent("/labelIndustry.htm", "标签行业", "修改标签行业")} +
            +${zhiqim_manager_title("修改标签行业")} +
            + + + + + + + + + + +
            标签行业:(请选择) +  * +
            子行业名称:(5000位不定长字符) *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/labelRelation.zml b/Yangcai365_web/manage/zview/label/labelRelation.zml new file mode 100644 index 0000000..b49aed8 --- /dev/null +++ b/Yangcai365_web/manage/zview/label/labelRelation.zml @@ -0,0 +1,80 @@ + + +
            +${zhiqim_manager_title("关联标签行业")} + + + + + + + + + + + + + +
            产品类型: ${Global.get(ProductTypeCache.class).getName(works.getDesignType())}
            标签行业:${Global.get(DesignIndustryCache.class).getIndustryName(works.getIndustryId())}
            标签子行业: + <#for item : inSubList> + + +

            +${zhiqim_manager_title("关联标签属性")} + +<#for item : attrCatList> + + + + + +
            ${item.getAttributeCatName()}: + <#for aitem : map.get(item.getAttributeCatId())> + + +
            +
            + + +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/presenter/industrySubInfo.zml b/Yangcai365_web/manage/zview/label/presenter/industrySubInfo.zml new file mode 100644 index 0000000..e7f0e17 --- /dev/null +++ b/Yangcai365_web/manage/zview/label/presenter/industrySubInfo.zml @@ -0,0 +1,26 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + +<#for item : result> + + + + + + +<#if result.size() == 0> +${zhiqim_manager_no_record(4 "暂时没有相关信息")} + +
            [${Global.get(DesignIndustryCache.class).getIndustryName(industryId)}] 的子行业信息
            选择子行业名称创建时间
            ${item.getIndustrySubName()}${Sqls.toDateTimeString(item.getCreateTime())}
            + + + + +
            ${result.size()} 条数据
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/label/presenter/labelAttributeInfo.zml b/Yangcai365_web/manage/zview/label/presenter/labelAttributeInfo.zml new file mode 100644 index 0000000..d49af5b --- /dev/null +++ b/Yangcai365_web/manage/zview/label/presenter/labelAttributeInfo.zml @@ -0,0 +1,26 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + +<#for item : result> + + + + + + +<#if result.size() == 0> +${zhiqim_manager_no_record(3 "暂时没有相关信息")} + +
            标签分类 [${labelName}] 的属性信息
            选择属性名称排序号
            ${item.getLabelName()}${item.getLabelOrder()}
            + + + + +
            ${result.size()} 条数据
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/merits/designOrderMeritsInfo.zml b/Yangcai365_web/manage/zview/merits/designOrderMeritsInfo.zml new file mode 100644 index 0000000..ed286e4 --- /dev/null +++ b/Yangcai365_web/manage/zview/merits/designOrderMeritsInfo.zml @@ -0,0 +1,119 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + +<#if console> + + + +<#else> + + + + + + + + + + + + + + + + + +<#if result.size() == 0> + + + + +<#for item : result.list()> + + + + + + <#if item.getType() == 1> + + + + + + + <#if item.getType() == 2> + + + + + + + <#if item.getType() == 3> + + + + + + + <#if item.getType() == 4> + + + + + + + <#if item.getType() == 5> + + + + <#if item.getOldData() == 0> + + + <#if item.getOldData() == 1> + + + <#if item.getOldData() == 2> + + + <#if item.getOldData() == 3> + + + <#if item.getOldData() == 4> + + + <#if item.getNewData() == 0> + + + <#if item.getNewData() == 1> + + + <#if item.getNewData() == 2> + + + <#if item.getNewData() == 3> + + + <#if item.getNewData() == 4> + + + + + + + +
            + 定稿日期: + - + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]订单详情 
            订单号设计师设计类型产品修改类型修改前价格修改后价格初始值最新值修改人修改时间
            暂不存在绩效修改信息
            ${item.getDesignId()}${item.getDesigner()}${Global.get(DesignTypeCache.class).getName(item.getTypeId())}${item.getOrderText()} + 修改设计份数 + ${Amounts.toYuanMustRadix(item.getOldPrice())}${Amounts.toYuanMustRadix(item.getNewPrice())}${item.getOldData()}份${item.getNewData()}份 + 重置佣金 + ${Amounts.toYuanMustRadix(item.getOldPrice())}${Amounts.toYuanMustRadix(item.getNewPrice())}${item.getOldData()}${item.getNewData()} + 修改佣金 + ${Amounts.toYuanMustRadix(item.getOldPrice())}${Amounts.toYuanMustRadix(item.getNewPrice())}${item.getOldData()}${item.getNewData()} + 修改加急费 + ${Amounts.toYuanMustRadix(item.getOldPrice())}${Amounts.toYuanMustRadix(item.getNewPrice())}${item.getOldData()}${item.getNewData()} + 修改稿件类型 + ${Amounts.toYuanMustRadix(item.getOldPrice())}${Amounts.toYuanMustRadix(item.getNewPrice())}标准自来稿改稿自来稿普通设计资深设计现货标准自来稿改稿自来稿普通设计资深设计现货${item.getAddUser()}${Sqls.toDateTimeString(item.getAddTime())}
            +${zhiqim_manager_paging_jsMethod(result, "doQueryCompleteOrderInfo")} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/merits/meritsTotal.zml b/Yangcai365_web/manage/zview/merits/meritsTotal.zml new file mode 100644 index 0000000..36dd183 --- /dev/null +++ b/Yangcai365_web/manage/zview/merits/meritsTotal.zml @@ -0,0 +1,84 @@ + +${zhiqim_manager_breadcrumb("绩效修改统计")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件
            + + + + +
            定稿日期: + - + + +  设计师: +   + +
            +
            +
            + + + + + + + + + <#for item : pageModelList> + + + + + +
            绩效修改总数:${endCount} 
            设计师绩效修改次数
            ${item.getDesigner()}${item.getOrderEndCount()}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/mobileTemplate/mobileTemplateDetail.zml b/Yangcai365_web/manage/zview/mobileTemplate/mobileTemplateDetail.zml new file mode 100644 index 0000000..cfa0ad2 --- /dev/null +++ b/Yangcai365_web/manage/zview/mobileTemplate/mobileTemplateDetail.zml @@ -0,0 +1,33 @@ + + + + + + + 秒绘名片详情页 + + + + + + + + +
            +
            + + <#for path : Arrays.toStringArray(media.getMediaUrl())> +
            +
            + +
            +
            + +
            +
            1/${MobileTemplatePresenter.getTemplateDetailCount(media.getMediaUrl())}
            +
            + + 复制模板ID:${media.getMediaId()} +
            返回首页
            + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/mobileTemplate/mobileTemplateHome.zml b/Yangcai365_web/manage/zview/mobileTemplate/mobileTemplateHome.zml new file mode 100644 index 0000000..2d62749 --- /dev/null +++ b/Yangcai365_web/manage/zview/mobileTemplate/mobileTemplateHome.zml @@ -0,0 +1,682 @@ + + + + + + 秒绘设计模板库 + + + + + + + + + + + + + + + + + + +
            +
            +
            +
            +
            +
            +
            +
            + + + +
            + +
            +
            + + + +
            +
            + +
            +
            +
            +
            + <#for item : DesignTypeDao.list()> + <#if item.getTypeName() == "画册" || item.getTypeName() == "名片" || item.getTypeName() == "彩页" || item.getTypeName() == "优惠券" || item.getTypeName() == "透明PVC名片" || item.getTypeName() == "电子传单"> + + ${item.getTypeName()} + + + +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            + +
            + +
            +
            + +
            +
            + +

            模板详情

            +
            +
            +
            +
            +
            +
            +
            +
            +
            + +
            + +
            +
            +
            复制后发送设计师
            +
            +
            + + +
            +
            +
            +
            +
            + + + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/mobileWorks/mobileWorkDetail.zml b/Yangcai365_web/manage/zview/mobileWorks/mobileWorkDetail.zml new file mode 100644 index 0000000..06080e3 --- /dev/null +++ b/Yangcai365_web/manage/zview/mobileWorks/mobileWorkDetail.zml @@ -0,0 +1,33 @@ + + + + + + + 秒绘彩页详情页 + + + + + + + + +
            +
            + + <#for path : Arrays.toStringArray(works.getThumbImagePath())> +
            +
            + +
            +
            + +
            +
            1/${MobileWorksPresenter.getWorksDetailCount(works.getThumbImagePath())}
            +
            + + 复制模板ID:${works.getWorksId()} +
            返回首页
            + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/mobileWorks/mobileWorksHome.zml b/Yangcai365_web/manage/zview/mobileWorks/mobileWorksHome.zml new file mode 100644 index 0000000..831480f --- /dev/null +++ b/Yangcai365_web/manage/zview/mobileWorks/mobileWorksHome.zml @@ -0,0 +1,372 @@ + + + + + + + 秒绘彩页库 + + + + + + + + + ${Scripts.src(zhiqim.js)} + ${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")} + + + +
            + 分类 +
            + + +
            + 搜索 +
            + + +
            +
            精品推荐
            +
            更多模板 + + +
            +
            + +
            + +
            + +
            + + +
            +
              +
                +
            +
            + + +
            + +
            + +
            +

            行业

            +
            + 全部 + <#for item : indList> + ${item.getIndustryName()} + +
            +

            产品

            +
            + 彩页 + 名片 +
            + +
            +
            + + + + +

            顶部

            +
            + +
            + 检索结果 +
            + + + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/notice/noticeAdd.zml b/Yangcai365_web/manage/zview/notice/noticeAdd.zml new file mode 100644 index 0000000..3154c47 --- /dev/null +++ b/Yangcai365_web/manage/zview/notice/noticeAdd.zml @@ -0,0 +1,53 @@ +${request.getValidateScript()} +${zhiqim_manager_history ("noticeList.htm")} + +${zhiqim_manager_breadcrumb_parent ("noticeAdd.htm", "公告内容", "增加公告")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + +
            增加公告
            是否发布:(请选择) + 保存草稿: + 立即发布: +
            公告标题:(32位不定长字符) *
            +
            公告内容:(不能超过50000个字符) *
            +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} + + + + diff --git a/Yangcai365_web/manage/zview/notice/noticeHistory.zml b/Yangcai365_web/manage/zview/notice/noticeHistory.zml new file mode 100644 index 0000000..1eb6b20 --- /dev/null +++ b/Yangcai365_web/manage/zview/notice/noticeHistory.zml @@ -0,0 +1,41 @@ +${zhiqim_manager_breadcrumb("公告列表")} +${zhiqim_manager_content()} +${sweet_alert_reuse_method()} +<#-- 列表 --> + + + + + + + +<#for item : result.list()> + + + + + + + + +${zhiqim_manager_tr_no_record(result, 10, "暂时没有公告")} +
            公告标题公告内容发布人发布时间
            #{item.getTitle()}点击查看#{item.getFinshUser()}#{Sqls.toDateTimeString(item.getFinshTime())}
            + + + + +
            ${PagingGo.toHtmlLink(result)}
            +${zhiqim_manager_content_end()} + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/notice/noticeInfo.zml b/Yangcai365_web/manage/zview/notice/noticeInfo.zml new file mode 100644 index 0000000..49b1800 --- /dev/null +++ b/Yangcai365_web/manage/zview/notice/noticeInfo.zml @@ -0,0 +1,58 @@ +
            +
            +

            + +
            +
            +

            +
            +
            + + + + diff --git a/Yangcai365_web/manage/zview/notice/noticeList.zml b/Yangcai365_web/manage/zview/notice/noticeList.zml new file mode 100644 index 0000000..4ea2dec --- /dev/null +++ b/Yangcai365_web/manage/zview/notice/noticeList.zml @@ -0,0 +1,120 @@ +${zhiqim_manager_content()} +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + +${zhiqim_manager_tr_no_record(noticeList, 5, "暂时没有公告信息")} +<#for item :noticeList.list()> + + + + + + + + + + + +
            选择公告状态文章标题创建人创建时间发布人发布时间操作
            + <#if item.getStatus()==0>草稿 + <#if item.getStatus()==1>已发布 + <#if item.getStatus()==2>已下线 + ${item.getTitle()}${item.getAddUser()} + ${Sqls.toDateTimeString(item.getAddTime())} + ${item.getFinshUser()}${Sqls.toDateTimeString(item.getFinshTime())} + <#if item.getStatus()==0> + + + + + <#if item.getStatus()==1> + + + +
            +${zhiqim_manager_paging(noticeList, "noticeList.htm")} + + diff --git a/Yangcai365_web/manage/zview/notice/noticeModify.zml b/Yangcai365_web/manage/zview/notice/noticeModify.zml new file mode 100644 index 0000000..dacda98 --- /dev/null +++ b/Yangcai365_web/manage/zview/notice/noticeModify.zml @@ -0,0 +1,48 @@ +${request.getValidateScript()} +${zhiqim_manager_history ("noticeList.htm")} + +${zhiqim_manager_breadcrumb_parent ("noticeModify.htm", "公告内容", "修改公告")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + +
            修改公告
            是否发布:(请选择) + 保存草稿: + 立即发布: +
            公告标题:(32位不定长字符) *
            +
            公告内容:(不能超过50000个字符) *
            +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} + + + + diff --git a/Yangcai365_web/manage/zview/order/assignDesigner.zml b/Yangcai365_web/manage/zview/order/assignDesigner.zml new file mode 100644 index 0000000..f317238 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/assignDesigner.zml @@ -0,0 +1,56 @@ +${request.getValidateScript()} + + + + + + + + + + + + + + + +
            订单号:${order.getDesignId()}
            产品描述:${order.getOrderText()}
            设计师: + + value="1" checked<#else>value="0" onclick="this.value=this.checked?1:0;getAssignDesigner();">接单中 +
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/assignDesigners.zml b/Yangcai365_web/manage/zview/order/assignDesigners.zml new file mode 100644 index 0000000..168177b --- /dev/null +++ b/Yangcai365_web/manage/zview/order/assignDesigners.zml @@ -0,0 +1,61 @@ +${request.getValidateScript()} + + + + + + + + + + + + + + + + +
            订单号:${order.getAfterNames()}
            产品描述:${order.getOrderText()}
            设计师: +
            + + value="1" checked<#else>value="0" onclick="this.value=this.checked?1:0;getAssignDesigner();">接单中 +
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/assignOrg.zml b/Yangcai365_web/manage/zview/order/assignOrg.zml new file mode 100644 index 0000000..7fe5e21 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/assignOrg.zml @@ -0,0 +1,48 @@ +${request.getValidateScript()} + + + + + + + + + + + + + + + +
            设计师:${oper.getOperatorCode()}
            原组织:${ZmrOrgDao.getOrgName(request, oper.getOrgId())}
            新组织: + +  *
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/changeStatus.zml b/Yangcai365_web/manage/zview/order/changeStatus.zml new file mode 100644 index 0000000..b700fe7 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/changeStatus.zml @@ -0,0 +1,52 @@ +${request.getValidateScript()} + + + + + + + + + + + + + + + +
            订单号:${order.getDesignId()}
            产品描述:${order.getOrderText()}
            订单状态: + +
            +<#-- 操作 --> +
            +   + +
            + diff --git a/Yangcai365_web/manage/zview/order/chargeOrder.zml b/Yangcai365_web/manage/zview/order/chargeOrder.zml new file mode 100644 index 0000000..6e61753 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/chargeOrder.zml @@ -0,0 +1,184 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(414, 110)} + + +<#var data="data=copy,userText,CustomFile,TemplateFile,userNotice"/> +<#var addRule=""/> +<#var delRule=""/> +${zhiqim_manager_breadcrumb("主管审核")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 左侧功能 --> +
            + + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + +
            订单号:产品类型: + 行业分类: +
            旺旺号:
            +
            + + <#-- 操作功能--> +
            + <#if ZmrPathRule.check(request, "openWangWang")> + <#if ZmrPathRule.check(request, "openQQ")> + + + + +
            + + <#-- 分页列表--> +
            + + ${zhiqim_manager_tr_title(14, "主管审核订单列表")} + + + + + + + + + + + + + + + + + + + <#if pageResult.size() == 0> + ${zhiqim_manager_no_record(14, "暂不存在主管审核订单")} + + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + + + + + + +
            选择订单号设计类型旺旺号设计师领取时间设计时间订单状态进度备注产品行业付款金额对稿QQ对稿微信对稿手机申请原因
            ${item.getDesignId()}${DraftConstants.get(item.getDraftType())}${item.getBuyerNick()}${item.getDesigner()}${Sqls.toDateTimeString(item.getDesignReceiveTime())}${Sqls.toDateTimeString(item.getDesignBeginTime())}${StatusConstants.getStatus(item.getStatus())}${progressNoteMap.get(item.getDesignId())}${item.getOrderText()}${industryNameMap.get(item.getIndustryId())}${Amounts.toYuanMustRadix(item.getAmount())}${item.getUserQq()}${item.getUserWx()}${item.getUserMobile()}${item.getDesignRequestReason()}
            +
            + ${zhiqim_manager_paging(pageResult, "chargeOrder.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            + +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/chargeOrderAudit.zml b/Yangcai365_web/manage/zview/order/chargeOrderAudit.zml new file mode 100644 index 0000000..adc4186 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/chargeOrderAudit.zml @@ -0,0 +1,22 @@ +
            + + + + + + + + + +
            原设计师:
            指定新设计师: +  * +
            + + + +
            + diff --git a/Yangcai365_web/manage/zview/order/checkBackDetail.zml b/Yangcai365_web/manage/zview/order/checkBackDetail.zml new file mode 100644 index 0000000..11c7533 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/checkBackDetail.zml @@ -0,0 +1,38 @@ + + + +${zhiqim_manager_content()} +
            + ${orderCheckModel.getBackReason()}
            +
            +<#if Validates.isNotEmpty(orderCheckModel.getBackReasonPicUrl())> +
            + 审核退回图片 +
            + +

            + +<#-- 操作 --> +
            + +
            +${zhiqim_manager_content_end()} + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/complaintOrder.zml b/Yangcai365_web/manage/zview/order/complaintOrder.zml new file mode 100644 index 0000000..6fdfcd8 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/complaintOrder.zml @@ -0,0 +1,147 @@ +${Scripts.src("/zinc/js/global_2019010801.js")} + + +${zhiqim_manager_breadcrumb("申诉列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} + + + + + + + + + + + +
            订单号:设计师: + + 旺旺号:退款时间: -  + +
            + + + <#-- 操作功能 --> +
            + + + + +
            + + <#-- 列表 --> +
            + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 20, "暂时没有申诉订单")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + + +
            选择订单号所属组织商户旺旺号状态产品订单金额领单时间退款时间设计师申诉详情
            ${item.getDesignId()} <#if item.isUrgent()>${ZmrOrgDao.getOrgName(request, item.getOrgId())}${item.getShopNick()}${item.getBuyerNick()}${StatusConstants.getStatus(item.getStatus())}${item.getOrderText()}${Amounts.toYuanMustRadix(item.getAmount())}${Sqls.toDateTimeString(item.getDesignReceiveTime())}${item.getRefundTime()}${item.getDesigner()}
            +
            + ${zhiqim_manager_paging(pageResult, "complaintOrder.htm")} +
            +${zhiqim_manager_content_end()} + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/complaintView.zml b/Yangcai365_web/manage/zview/order/complaintView.zml new file mode 100644 index 0000000..c7c04cd --- /dev/null +++ b/Yangcai365_web/manage/zview/order/complaintView.zml @@ -0,0 +1,88 @@ + + + +${zhiqim_manager_content()} +
            + +
            +<#for item : attaList> +
            + 截图 +
            + +

            +
            +
            + +     +
            +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/configQuestionsAdd.zml b/Yangcai365_web/manage/zview/order/configQuestionsAdd.zml new file mode 100644 index 0000000..48cdc72 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/configQuestionsAdd.zml @@ -0,0 +1,62 @@ +${request.getValidateScript()} + + + + + + + + + + + + + + + +
            + 产品类型:    + 材质描述: +
            + 尺寸长(mm):    + 尺寸宽(mm): +
            + 单双面:        + 款数:       +
            + 其他需求: +
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/configQuestionsModify.zml b/Yangcai365_web/manage/zview/order/configQuestionsModify.zml new file mode 100644 index 0000000..cb7dd42 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/configQuestionsModify.zml @@ -0,0 +1,38 @@ +${request.getValidateScript()} + + +
            + + + + + + + +
            设计要求:
            +     +
            +<#-- 操作 --> +
            +   + +
            +
            diff --git a/Yangcai365_web/manage/zview/order/contendOrder.zml b/Yangcai365_web/manage/zview/order/contendOrder.zml new file mode 100644 index 0000000..f8f1bf0 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/contendOrder.zml @@ -0,0 +1,36 @@ + + +
            +
            接受订单
            +
            订单编号: ${designId}
            +
            产品类型: ${orderText}
            +
            确认接单,请按规定时效流程进行设计服务!(务必十分钟内联系客户,快速定稿有奖励,超时定稿有处罚)
            +
            +<#-- 操作 --> +
            + + +
            +
            diff --git a/Yangcai365_web/manage/zview/order/designCopiesr.zml b/Yangcai365_web/manage/zview/order/designCopiesr.zml new file mode 100644 index 0000000..10397ea --- /dev/null +++ b/Yangcai365_web/manage/zview/order/designCopiesr.zml @@ -0,0 +1,28 @@ +${request.getValidateScript()} + +
            +输入设计费份数: +
            +<#-- 操作 --> +
            +   + +
            + diff --git a/Yangcai365_web/manage/zview/order/designOrderAgreeRefund.zml b/Yangcai365_web/manage/zview/order/designOrderAgreeRefund.zml new file mode 100644 index 0000000..ce33a76 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/designOrderAgreeRefund.zml @@ -0,0 +1,80 @@ +${request.getValidateScript()} + + +
            + + +
            + 若选择设计师,则退款责任在于设计师,将会统计到设计师退款率中
            若选择用户,则退款责任在于用户,将不会纳入到设计师退款率中
            若选择售前,则退款责任在于售前,将不会统计到设计师退款率中
            + +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/designOrderQuestions.zml b/Yangcai365_web/manage/zview/order/designOrderQuestions.zml new file mode 100644 index 0000000..1c0a121 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/designOrderQuestions.zml @@ -0,0 +1,275 @@ +${zhiqim_manager_breadcrumb("考试题库")} +${Styles.htmlOverflowHidden()} +${Scripts.src(zhiqim_uploadlarge.js)} + + +${zhiqim_manager_breadcrumb("订单列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + +
             设计要求: + + +
            +
            + + <#-- 操作功能 --> +
            + + + +
            + + <#-- 列表 --> +
            + + + + + + + + <#if pageResult.total() == 0> + + ${zhiqim_manager_no_record(9 "暂时没有数据")} + + + <#for item : pageResult.list()> + + + + + + + +
            选择设计要求操作员最后修改时间
            ${item.getDesignRequirements()}${item.getUpdateOperator()}${Sqls.toDateTimeString(item.getModificationTime())}
            +
            + ${zhiqim_manager_paging(pageResult, "designOrderQuestions.htm")} +
            +${zhiqim_manager_content_end()} + +<#-- 右侧信息&客户素材--> +
            + + + + + + + +
            + 订单素材 + + + + +
            + <#--客户素材列表--> +
            +
            +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/designOrderRefundInfo.zml b/Yangcai365_web/manage/zview/order/designOrderRefundInfo.zml new file mode 100644 index 0000000..3c45bd9 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/designOrderRefundInfo.zml @@ -0,0 +1,149 @@ +${request.getValidateScript()} +${Styles.src(context.getRootPath("/zinc/layui/css/layui.css"))} +${Scripts.src(context.getRootPath("/zinc/layui/layui.js"))} + + +
            +     当前订单状态:请求退款 +
            +
            +
            + + ${order.getDesignId()} +
            +
            + + ${Global.get(DesignMerchantCache.class).getName(order.getMerchantId())} +
            +
            + + ${Global.get(OrgCache.class).name(order.getOrgId())} +
            +
            +
            +
            + + <#if order.getDraftType()==0> + 标准自来稿 + + <#if order.getDraftType()==1> + 改稿自来稿 + + <#if order.getDraftType()==2> + 普通设计 + + <#if order.getDraftType()==3> + 资深设计 + + <#if order.getDraftType()==4> + 现货 + +
            +
            + + ${order.getBuyerNick()} +
            +
            + + ${order.getDesigner()} +
            +
            +
            +
            + + ${order.getUserWx()} +
            +
            + + ${order.getShopNick()} +
            +
            + + ${Amounts.toYuanMustRadix(order.getAmount())} +
            +
            +
            +
            + + ${order.getUserMobile()} +
            +
            +
            +
            + + ${order.getOrderText()} +
            +
            +
            +
            + + ${order.getReceiverName()} +
            +
            + + ${order.getCreater()} +
            + +
            +
            +
            + + ${order.getReceiverAddress()} +
            +
            +
            + + ${Global.get(DesignOrderRefundReasonCache.class).getName(order.getRefundReason())}
            + +
            +<#-- 操作 --> +
            +
            + +
            +
            diff --git a/Yangcai365_web/manage/zview/order/designOrderRefundModify.zml b/Yangcai365_web/manage/zview/order/designOrderRefundModify.zml new file mode 100644 index 0000000..450cf0b --- /dev/null +++ b/Yangcai365_web/manage/zview/order/designOrderRefundModify.zml @@ -0,0 +1,34 @@ +${request.getValidateScript()} + + +
            + + +
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/designOrderRefundReason.zml b/Yangcai365_web/manage/zview/order/designOrderRefundReason.zml new file mode 100644 index 0000000..eb40fc2 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/designOrderRefundReason.zml @@ -0,0 +1,86 @@ +<#def designatedPath="/designOrderRefundReason.htm"/> +${zhiqim_manager_breadcrumb("设计师退款问题类型配置")} +${zhiqim_manager_content()} + + +<#-- 导航 --> +
            + +
            + + + + + + + + + +<#if pageResult.total() == 0> + ${zhiqim_manager_no_record(6 "暂时没有配置退款原因")} + +<#for item : pageResult.list()> + + + + + + +
            +
            + + + +
            +
            选择标题最后一次修改时间
            ${item.getTitle()}${Sqls.toDateTimeString(item.getUpdateTime())}
            +${zhiqim_manager_paging(pageResult, "/designOrderRefundReason.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/designOrderRefundReasonAdd.zml b/Yangcai365_web/manage/zview/order/designOrderRefundReasonAdd.zml new file mode 100644 index 0000000..a99695f --- /dev/null +++ b/Yangcai365_web/manage/zview/order/designOrderRefundReasonAdd.zml @@ -0,0 +1,33 @@ +${request.getValidateScript()} + + +
            + + +
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/doEditDesignOrder.zml b/Yangcai365_web/manage/zview/order/doEditDesignOrder.zml new file mode 100644 index 0000000..56df721 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/doEditDesignOrder.zml @@ -0,0 +1,124 @@ +${request.getValidateScript()} + + +<#-- 操作 --> +
            + + + + + + + + + + + + + + + + + + + + + +
            + + + (修改指定订单设计份数) +
            + + + (自动修改指定订单对应稿件类型所匹配的设计佣金) +
            + + + (修改指定订单的设计佣金) +
            + + + (修改指定订单的加急费用,未分拣订单设置加急费有30分钟加急时效,时效内未领取自动取消加急) +
            + + + (修改指定订单的稿件类型,会自动重新计算稿件类型所对应设计佣金,暂只支持普通设计和资深设计) +
            +
            diff --git a/Yangcai365_web/manage/zview/order/doEditDesignPrice.zml b/Yangcai365_web/manage/zview/order/doEditDesignPrice.zml new file mode 100644 index 0000000..e01b184 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/doEditDesignPrice.zml @@ -0,0 +1,44 @@ +${request.getValidateScript()} + + + + + + + + + + + + + + +
            订单号:${designId}
            产品描述:${orderText}
            设计佣金: + value="${Amounts.toYuanMustRadix(designPrice)}"<#else>value="${designPrice}" step="1" min="0" onkeyup="this.value= this.value.match(/\d+(\.\d{0,2})?/) ? this.value.match(/\d+(\.\d{0,2})?/)[0] : ''"> +
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/doEditDesignPriceDZ.zml b/Yangcai365_web/manage/zview/order/doEditDesignPriceDZ.zml new file mode 100644 index 0000000..563c9fa --- /dev/null +++ b/Yangcai365_web/manage/zview/order/doEditDesignPriceDZ.zml @@ -0,0 +1,62 @@ +${request.getValidateScript()} + + + + + + + + + + + +
            订单号:${designId}
            文件推送: + +
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/doEditDraftType.zml b/Yangcai365_web/manage/zview/order/doEditDraftType.zml new file mode 100644 index 0000000..1c15109 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/doEditDraftType.zml @@ -0,0 +1,48 @@ +${request.getValidateScript()} + + + + + + + + + + + + + + +
            订单号:${designId}
            产品描述:${orderText}
            稿件类型: + +
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/doEditStatus.zml b/Yangcai365_web/manage/zview/order/doEditStatus.zml new file mode 100644 index 0000000..f4b2bec --- /dev/null +++ b/Yangcai365_web/manage/zview/order/doEditStatus.zml @@ -0,0 +1,51 @@ +${request.getValidateScript()} + + + + + + + + + + + + + + +
            订单号:${designId}
            产品描述:${orderText}
            订单状态: + +
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/doEditUrgentPrice.zml b/Yangcai365_web/manage/zview/order/doEditUrgentPrice.zml new file mode 100644 index 0000000..435be6b --- /dev/null +++ b/Yangcai365_web/manage/zview/order/doEditUrgentPrice.zml @@ -0,0 +1,40 @@ +${request.getValidateScript()} + + + + + + + + + + + + + + +
            订单号:${designId}
            产品描述:${orderText}
            加急费: + value="${Amounts.toYuanMustRadix(urgentPrice)}"<#else>value="${urgentPrice}" onkeyup="this.value= this.value.match(/\d+(\.\d{0,2})?/) ? this.value.match(/\d+(\.\d{0,2})?/)[0] : ''"> +
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/modifyIndustry.zml b/Yangcai365_web/manage/zview/order/modifyIndustry.zml new file mode 100644 index 0000000..363e2ad --- /dev/null +++ b/Yangcai365_web/manage/zview/order/modifyIndustry.zml @@ -0,0 +1,50 @@ +${request.getValidateScript()} + + + + + + + + + + + + + + + +
            订单号:${order.getDesignId()}
            产品:${order.getOrderText()}
            行业: + +  *
            +<#-- 操作 --> +
            +   + +
            + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/myDesignOrder.zml b/Yangcai365_web/manage/zview/order/myDesignOrder.zml new file mode 100644 index 0000000..fd55b1c --- /dev/null +++ b/Yangcai365_web/manage/zview/order/myDesignOrder.zml @@ -0,0 +1,273 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(400, 70)} + + +<#var data="data=copy,userText,CustomFile,TemplateFile,userNotice"/> +<#var addRule=""/> +<#var delRule=""/> +${zhiqim_manager_breadcrumb("我的设计订单")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 左侧功能 --> +
            + + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + +
            订单号:产品类型: + 行业分类: +
            旺旺号:淘宝单号:
            +
            + + <#-- 操作功能--> +
            + <#if ZmrPathRule.check(request, "openWangWang")> + <#if ZmrPathRule.check(request, "openQQ")> + + + + + + + +
            + + <#-- 分页列表--> +
            + + ${zhiqim_manager_tr_title(18, "设计订单列表")} + + + + + + + + + + + + + + + + + + + + + + <#if pageResult.size() == 0> + ${zhiqim_manager_no_record(18, "暂不存在设计订单信息")} + + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + + + + + + + + + +
            选择订单号设计类型店铺旺旺号设计师领取时间设计时间订单状态产品行业付款金额进度备注对稿QQ对稿微信对稿手机暂停设计原因主管退回原因审核退回原因
            ${item.getDesignId()}${DraftConstants.get(item.getDraftType())}${Global.get(ShopCache.class).getName(item.getShopNick())}${item.getBuyerNick()}${item.getDesigner()}${Sqls.toDateTimeString(item.getDesignReceiveTime())}${Sqls.toDateTimeString(item.getDesignBeginTime())}${StatusConstants.getStatus(item.getStatus())}${item.getOrderText()}${Global.get(DesignIndustryCache.class).getIndustryName(item.getIndustryId())}${Amounts.toYuanMustRadix(item.getAmount())}${progressNoteMap.get(item.getDesignId())}${item.getUserQq()}${item.getUserWx()}${item.getUserMobile()}${item.getDesignPauseReason()}${item.getDesignRejectReason()}${item.getCheckRejectReason()}
            +
            + ${zhiqim_manager_paging(pageResult, "designOrder.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            + +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/notTimeoutCompleteOrderHistory.zml b/Yangcai365_web/manage/zview/order/notTimeoutCompleteOrderHistory.zml new file mode 100644 index 0000000..ee17338 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/notTimeoutCompleteOrderHistory.zml @@ -0,0 +1,115 @@ + + +<#def designatedPath="/timeoutOrderNear.htm"/> +${zhiqim_manager_breadcrumb("时效绩效")} +${zhiqim_manager_content()} + +<#-- 页面数据定义 --> +<#var typeMap = DesignTypeDao.mapAll()/> +<#var industryMap = Global.get(DesignIndustryCache.class).mapAll()/> + +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + +
            定稿时间: + - + + 产品类型: + +     
            +
            + +<#-- 分页列表 --> +
            + + + + + +
            + + + + + + + + <#for item : map.keySet()> + bgcolor="#f3fdfc" onclick="doQueryDesigner('${item}');"> + + + + + + + <#if map.values().isEmpty()> + ${zhiqim_manager_no_record(4, "暂时没有信息")} + +
            序号设计师订单数奖励金额
            ${item_index +1}${item}${map.get(item).getDesignOrderSum()}${Maths.division(map.get(item).getRewardAmountSum(),100,2)}
            +
            + + + + + + + + + + + + + <#for item : pageResult.list()> + <#var effectiveTime = 24*60/> + + + + + + + + + + + + + <#if pageResult.total() == 0> + ${zhiqim_manager_no_record(9, "暂时没有时效绩效信息")} + +
            订单ID订单信息旺旺名录单时间领单时间初稿时间定稿时间进度备注设计师
            ${item.getDesignId()}${item.getOrderText()}${item.getBuyerNick()}${Sqls.toDateTimeString(item.getCreateTime())}${Sqls.toDateTimeString(item.getDesignReceiveTime())}${Sqls.toDateTimeString(item.getDesignDraftTime())}${Sqls.toDateTimeString(item.getDesignEndTime())}${progressNoteMap.get(item.getDesignId())}${item.getDesigner()}
            + ${zhiqim_manager_paging(pageResult, "notTimeoutCompleteOrderHistory.htm")} +
            +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/orderBacklog.zml b/Yangcai365_web/manage/zview/order/orderBacklog.zml new file mode 100644 index 0000000..7013304 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/orderBacklog.zml @@ -0,0 +1,157 @@ + + +${zhiqim_manager_breadcrumb("设计师管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + + +
            订单号: + 商户名称: + 设计师: +
            + 订单状态: + 待办发送时间: -  + + + +
            +
            + +<#-- 操作功能 --> + + + <#-- 列表--> + + + + + + + + + +<#for item : result.list()> + + + + + + + + +${zhiqim_manager_tr_no_record(result, 10, "暂时没有公告")} +
            待办状态待办内容通知人待办创建时间操作
            + <#if item.getMessageType() == 1>待办事项 + <#if item.getMessageType() == 2>已办事项 + <#if item.getMessageType() == 3>已办事项 + #{item.getMessageBody()}#{item.getConsumerCode()}#{Sqls.toDateTimeString(item.getCreateTime())} + 增加积分 +
            +${zhiqim_manager_paging(pageResult, "/orderBacklog.htm")} + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/orderCheckBackList.zml b/Yangcai365_web/manage/zview/order/orderCheckBackList.zml new file mode 100644 index 0000000..6e6d118 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/orderCheckBackList.zml @@ -0,0 +1,190 @@ +${Scripts.src("/zinc/js/global_2019010801.js")} + + +${zhiqim_manager_breadcrumb("退回列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + +
            订 单 号 :旺旺号:设 计 师: + + + 退回时间: - + +
            +
            + +<#-- 操作功能 --> +
            + + + +
            + +<#-- 列表 --> + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 12, "暂时没有审核退回单")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + ${zhiqim_manager_paging(pageResult, "/orderCheckBackList.htm")} +
            选择订单号订单金额定稿时间退回时间退回人订单状态产品退回原因退回次数设计师
            ${item.getDesignId()}${Amounts.toYuanMustRadix(item.getAmount())}${Sqls.toDateTimeString(item.getDesignEndTime())}${Sqls.toDateTimeString(item.getCheckTime())}${item.getChecker()}${StatusConstants.getStatus(item.getStatus())}${item.getOrderText()} ${item.getCheckBackReason()}${backCountMap.get(item.getDesignId())}${item.getDesigner()}
            +${zhiqim_manager_content_end()} + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/orderCheckFinish.zml b/Yangcai365_web/manage/zview/order/orderCheckFinish.zml new file mode 100644 index 0000000..fb46bf8 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/orderCheckFinish.zml @@ -0,0 +1,101 @@ +<#def designatedPath="/orderCheckWait.htm"/> +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(400, 110)} +<#var data="data=copy,userText,CustomFile,EndFile,WorkFile,FristThumFile,TbzFile"/> +<#var addRule="addRule=CustomFile,EndFile,WorkFile,TbzFile"/> +<#var delRule="delRule=CustomFile,EndFile,WorkFile,TbzFile"/> + +${zhiqim_manager_breadcrumb("已审订单")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +
            + + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + +
            订单号:产品类型: + 审核时间: -  + +
            旺旺号:其他信息: + +
            +
            +
            + + <#-- 列表 --> +
            + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 20, "暂时没有订单信息")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + +
            选择订单号商户稿件类型订单金额产品类型审稿时间审稿人特殊工艺设计师
            ${item.getDesignId()}${Global.get(DesignMerchantCache.class).getName(item.getMerchantId())}${DraftConstants.get(item.getDraftType())}${Amounts.toYuanMustRadix(item.getAmount())}${Global.get(DesignTypeCache.class).getName(item.getTypeId())}${Sqls.toDateTimeString(item.getCheckTime())}${item.getChecker()}${item.getPrintSpecial()}${item.getDesigner()}
            +
            + ${zhiqim_manager_paging(pageResult, "orderCheckFinish.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            + +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/orderCheckWait.zml b/Yangcai365_web/manage/zview/order/orderCheckWait.zml new file mode 100644 index 0000000..a929c71 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/orderCheckWait.zml @@ -0,0 +1,273 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(400, 110)} + + +<#var data="data=copy,userText,CustomFile,DesginFile,EndFile,WorkFile,TbzFile"/> +<#var addRule="addRule=CustomFile,ThumFile,DesginFile,TbzFile"/> +<#var delRule="delRule=CustomFile,ThumFile,DesginFile,TbzFile"/> + +${zhiqim_manager_breadcrumb("待审订单")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + + + + + +
             订 单 号:产品类型: + + 稿件类型: +
             旺 旺 号:淘宝单号: + 是否后工: +
            + 商户名称: +  老系统订单号:
            +
            + + <#-- 操作功能 --> +
            + <#if ZmrPathRule.check(request, "/doCheckOrderPass.htm")> + <#if ZmrPathRule.check(request, "/doCheckOrderReback.htm")> + + +
            + + <#-- 列表 --> +
            + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有订单信息")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + + +
            选择订单号商户
            稿件类型
            订单金额佣金下单时间定稿时间状态特殊工艺产品描述退回原因
            + ${item.getDesignId()} + <#if item.getReDesignSrcId() gt 0> + <#if item.isUrgent()> + <#if item.isHighQualityOrder()> + <#if item.getIsOldUser() gt 0> + <#if !(item.getAmount() lt 30000)> + <#if item.getShowRedMark() == 1> + ${Global.get(DesignMerchantCache.class).getName(item.getMerchantId())}
            ${DraftConstants.get(item.getDraftType())}
            ${Amounts.toYuanMustRadix(item.getAmount())}${Amounts.toYuanMustRadix(item.getDesignPrice())}${Sqls.toDateTimeString(item.getCreateTime())}${Sqls.toDateTimeString(item.getDesignEndTime())}${StatusConstants.getStatus(item.getStatus())}${item.getPrintSpecial()}${item.getOrderText()} ${item.getCheckBackReason()}
            +
            + ${zhiqim_manager_paging(pageResult, "orderCheckWait.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            + +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/orderDraftCheckWait.zml b/Yangcai365_web/manage/zview/order/orderDraftCheckWait.zml new file mode 100644 index 0000000..d983ac1 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/orderDraftCheckWait.zml @@ -0,0 +1,172 @@ + +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(400, 110)} + + +<#var data="data=copy,userText,userNotice,CustomFile,DesginFile,FristThumFile,TbzFile"/> +<#var addRule="addRule=CustomFile,ThumFile,DesginFile,TbzFile"/> +<#var delRule="delRule=CustomFile,ThumFile,DesginFile,TbzFile"/> + +${zhiqim_manager_breadcrumb("初稿待审订单")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + + + + +
             订 单 号:产品类型: + + 稿件类型: +
             旺 旺 号:淘宝单号: + 是否后工: +
            + 商户名称: + + +
            +
            + + <#-- 操作功能 --> +
            + <#if ZmrPathRule.check(request, "/designOrderPass.htm")> + <#if ZmrPathRule.check(request, "/designOrderReback.htm")> +
            + + <#-- 列表 --> +
            + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有订单信息")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + +
            选择订单号商户
            设计等级
            设计类型
            产品类型
            订单金额下单时间初稿时间设计师状态特殊工艺产品描述退回原因
            + ${item.getDesignId()} + <#if item.getReDesignSrcId() gt 0> + <#if item.isUrgent()> + <#if item.isHighQualityOrder()> + <#if item.getIsOldUser() gt 0> + <#if !(item.getAmount() lt 30000)> + ${Global.get(DesignMerchantCache.class).getName(item.getMerchantId())}
            ${DraftConstants.get(item.getDraftType())}
            <#if item.isOnlyDesign()> + 仅设计 + <#else>印刷设计 +
            ${Global.get(DesignTypeCache.class).getName(item.getTypeId())} +
            ${Amounts.toYuanMustRadix(item.getAmount())}${Sqls.toDateTimeString(item.getCreateTime())}${Sqls.toDateTimeString(item.getDesignDraftTime())}${item.getDesigner()}${StatusConstants.getStatus(item.getStatus())}${item.getPrintSpecial()}${item.getOrderText()} ${item.getDraftBackReason()}
            +
            + ${zhiqim_manager_paging(pageResult, "orderDraftCheckWait.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/orderEndCheckWait.zml b/Yangcai365_web/manage/zview/order/orderEndCheckWait.zml new file mode 100644 index 0000000..d7d4b99 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/orderEndCheckWait.zml @@ -0,0 +1,242 @@ + +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(400, 110)} + + +<#var data="data=copy,userText,userNotice,CustomFile,DesginFile,EndFile,WorkFile,TbzFile"/> +<#var addRule="addRule=CustomFile,ThumFile,DesginFile,TbzFile"/> +<#var delRule="delRule=CustomFile,ThumFile,DesginFile,TbzFile"/> + +${zhiqim_manager_breadcrumb("待审订单")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + + + + +
             订 单 号:产品类型: + + 稿件类型: +
             旺 旺 号:淘宝单号: + 是否后工: +
            + 商户名称: + + +
            +
            + + <#-- 操作功能 --> +
            + <#if ZmrPathRule.check(request, "/designOrderPass.htm")> + <#if ZmrPathRule.check(request, "/designOrderReback.htm")> + +
            + + <#-- 列表 --> +
            + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有订单信息")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + +
            选择订单号商户
            设计等级
            设计类型
            产品类型
            订单金额下单时间设计师状态特殊工艺产品描述退回原因
            + ${item.getDesignId()} + <#if item.getReDesignSrcId() gt 0> + <#if item.isUrgent()> + <#if item.isHighQualityOrder()> + <#if item.getIsOldUser() gt 0> + <#if !(item.getAmount() lt 30000)> + <#if item.getShowRedMark() == 1> + ${Global.get(DesignMerchantCache.class).getName(item.getMerchantId())}
            ${DraftConstants.get(item.getDraftType())}
            <#if item.isOnlyDesign()> + 仅设计 + <#else>印刷设计 +
            ${Global.get(DesignTypeCache.class).getName(item.getTypeId())} +
            ${Amounts.toYuanMustRadix(item.getAmount())}${Sqls.toDateTimeString(item.getCreateTime())}${item.getDesigner()}${StatusConstants.getStatus(item.getStatus())}${item.getPrintSpecial()}${item.getOrderText()} ${item.getEndBackReason()}
            +
            + ${zhiqim_manager_paging(pageResult, "orderEndCheckWait.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            + +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/orderList.zml b/Yangcai365_web/manage/zview/order/orderList.zml new file mode 100644 index 0000000..ff11b46 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/orderList.zml @@ -0,0 +1,518 @@ + +${Scripts.src("/zinc/js/qrcode.min.js")} +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(414, 110)} + + +<#var data="data=copy,userText,userNotice,CustomFile,DesginFile,EndFile,WorkFile,TbzFile"/> +<#var addRule="addRule=CustomFile,DesginFile,EndFile,WorkFile,TbzFile"/> +<#var delRule="delRule=CustomFile,DesginFile,EndFile,WorkFile,TbzFile"/> +${zhiqim_manager_breadcrumb("订单列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + + + + + + + + + + + +
            订单号:产品类型: + + + 下单时间: -  + +
            旺旺号:订单金额: + + 商户名称: +
            设计师: + + 设计等级: + + 订单状态: +
            erp单号: + + + + +
            +
            + + <#-- 操作功能 --> +
            + <#if ZmrPathRule.check(request, "/assignDesigner.htm")> + + + + <#if ZmrPathRule.check(request, "/designCopiesr.htm")> + + + + + +
            + + <#-- 列表--> +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 27, "暂时没有数据")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            选择订单号备注erp订单号客户信息店铺名称旺旺号设计类型
            产品类型
            下单时间订单金额设计佣金 *设计师订单状态进度备注领单方式领单时间定稿时间审稿时间审稿人退单理由
            ${item.getDesignId()} + <#if Validates.isNotEmpty(item.getCheckBackReason()) && item.getStatus() lt 55 > + + <#elseif Validates.isNotEmpty(item.getDraftBackReason()) && item.getStatus() lt 55 > + + <#elseif Validates.isNotEmpty(item.getEndBackReason()) && item.getStatus() lt 55 > + + + <#if item.isChange()> + + + <#if item.isBack()> + + + <#if item.getIsOldUser() gt 0> + + + ${item.getOrderText()}${item.getTids()} + 查看 + ${item.getShopNick()}${item.getBuyerNick()}<#if item.isOnlyDesign()> + 仅设计 + <#else>印刷设计 +
            ${Global.get(DesignTypeCache.class).getName(item.getTypeId())} +
            ${Sqls.toDateTimeString(item.getCreateTime())}${Amounts.toYuanMustRadix(item.getAmount())}${Amounts.toYuanMustRadix(item.getDesignPrice())}${item.getDesigner()}${StatusConstants.getStatus(item.getStatus())}${progressNoteMap.get(item.getDesignId())} + <#if item.getReceiveType() == 0>抢单 + <#if item.getReceiveType() == 1>派单 + <#if item.getReceiveType() == 2>指定 + ${Sqls.toDateTimeString(item.getDesignReceiveTime())}${Sqls.toDateTimeString(item.getDesignEndTime())}${Sqls.toDateTimeString(item.getCheckTime())}${item.getChecker()}${item.getReturnReason()}
            +
            + ${zhiqim_manager_paging(pageResult, "/orderList.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> + <#--
            + +
            --> + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/orderLogList.zml b/Yangcai365_web/manage/zview/order/orderLogList.zml new file mode 100644 index 0000000..85d48a8 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/orderLogList.zml @@ -0,0 +1,64 @@ +<#def designatedPath="/orderList.htm"/> + + +${zhiqim_manager_breadcrumb("订单日志列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("订单日志查询")} +
            + + + + +
            + 订单号: + +
            +
            + +<#-- 列表 --> + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 6, "暂时没有订单日志信息")} +<#for item : pageResult.list()> + + + + + + + + +
            订单号状态操作员操作项操作时间
            ${item.getDesignId()}${StatusConstants.getStatus(item.getStatus())}${item.getOperatorCode()}${item.getOperateDesc()}${Sqls.toDateTimeString(item.getCreateTime())}
            +${zhiqim_manager_paging(pageResult, "orderLogList.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/orderRefundList.zml b/Yangcai365_web/manage/zview/order/orderRefundList.zml new file mode 100644 index 0000000..9ea6230 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/orderRefundList.zml @@ -0,0 +1,167 @@ +${Scripts.src("/zinc/js/global_2019010801.js")} +${zhiqim_manager_breadcrumb("订单列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + +
            订单号: + 商户名称: + + 稿件类型: + 产品类型: +
            旺旺号: + + + 退款原因: + + + +
            +
            + + <#-- 操作功能 --> +
            + + + + +
            + + <#-- 列表--> +
            + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有退款订单信息")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + +
            选择订单号商户旺旺号店铺产品付款金额特殊工艺退款原因申请时间
            ${item.getDesignId()}${Global.get(DesignMerchantCache.class).getName(item.getMerchantId())}
            ${DraftConstants.get(item.getDraftType())}
            ${item.getBuyerNick()}${item.getShopNick()}${item.getOrderText()}${Amounts.toYuanMustRadix(item.getAmount())}${item.getPrintSpecial()}${Global.get(DesignOrderRefundReasonCache.class).getName(item.getRefundReason())}${item.getRefundTime()}
            +
            + ${zhiqim_manager_paging(pageResult, "/orderRefundList.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/orderTagList.zml b/Yangcai365_web/manage/zview/order/orderTagList.zml new file mode 100644 index 0000000..55e42e6 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/orderTagList.zml @@ -0,0 +1,173 @@ +${Scripts.src("/zinc/js/global_2019010801.js")} +${Styles.htmlOverflowHidden()} +${yangcai_calc_Left_width_height(414, 110)} + + +${zhiqim_manager_breadcrumb("订单标签列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + + +
            订单号:产品类型: + + 设计师: + +
            旺旺号: + 录单时间: -  + + 行业类型: +
            + +
            +
            + + <#-- 操作功能 --> +
            + + + +
            + <#-- 列表--> +
            + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有订单标签数据")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + +
            选择订单号旺旺号手机号店铺行业子行业产品类型金额创建时间
            ${item.getDesignId()} + <#if item.getReDesignSrcId() gt 0> + <#if item.isUrgent()> + <#if item.getOrderFlag() gt 0> + <#if !(item.getAmount() lt 30000)> + <#if item.getShowRedMark() == 1> + ${item.getBuyerNick()}${item.getUserMobile()}${item.getShopNick()}${Global.get(DesignIndustryCache.class).getIndustryName(item.getIndustryId())}${map.get(item.getDesignId())}${item.getOrderText()}${Amounts.toYuanMustRadix(item.getAmount())}${Sqls.toDateTimeString(item.getCreateTime())}
            +
            + ${zhiqim_manager_paging(pageResult, "/orderTagList.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            + +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/presenter/assignDesigner.zml b/Yangcai365_web/manage/zview/order/presenter/assignDesigner.zml new file mode 100644 index 0000000..1233479 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/presenter/assignDesigner.zml @@ -0,0 +1,61 @@ +${request.getValidateScript()} + + + + + + + + + + + + + + + + + + + +
            订单号:${order.getDesignId()}
            多选订单号:${order.getAfterNames()}
            产品描述:${order.getOrderText()}
            设计师: + + value="1" checked<#else>value="0" onclick="this.value=this.checked?1:0;getAssignDesigner();">接单中 +
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/order/presenter/completeOrderInfo.zml b/Yangcai365_web/manage/zview/order/presenter/completeOrderInfo.zml new file mode 100644 index 0000000..7d3634c --- /dev/null +++ b/Yangcai365_web/manage/zview/order/presenter/completeOrderInfo.zml @@ -0,0 +1,10 @@ +<#if Validates.isEqual(text, "BLOCK")> +
            + 今日定稿目标数:${goalNum}单,已完成定稿数:${comNum}单 +
            + +<#if Validates.isEqual(text, "HIDDEN")> +
            + 今日未设置定稿目标数 +
            + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/presenter/historyBackDetails.zml b/Yangcai365_web/manage/zview/order/presenter/historyBackDetails.zml new file mode 100644 index 0000000..1820f64 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/presenter/historyBackDetails.zml @@ -0,0 +1,29 @@ + +<#-- 列表 --> + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 8, "没有历史退回记录")} + <#for item : models> + ${item.getOrderText()} + + + +
            订单号旺旺号订单金额退回时间产品描述退回原因
            ${item.getCheckBackReason()}
            + +
            +
            +
            + +
            diff --git a/Yangcai365_web/manage/zview/order/presenter/historyOrderTagLog.zml b/Yangcai365_web/manage/zview/order/presenter/historyOrderTagLog.zml new file mode 100644 index 0000000..96b04c0 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/presenter/historyOrderTagLog.zml @@ -0,0 +1,25 @@ + + <#for item : modelList> + + + + + + + + + + + + + + + + + + + + + + +
            主行业:${item.getMainIndustryName()}子行业:${item.getSonIndustryName()}应用场景:${item.getAppScenarios()}
            客户类型:${item.getCustomerType()}未匹配关键字:${item.getUnmatchKeyword()}设计风格:${item.getDesignStyle()}
            标签编辑人:${item.getOperatorCode()}标签编辑时间:${Sqls.toDateTimeString(item.getOperatorTime())}
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/presenter/orderCheckBackInfo.zml b/Yangcai365_web/manage/zview/order/presenter/orderCheckBackInfo.zml new file mode 100644 index 0000000..15f5b8b --- /dev/null +++ b/Yangcai365_web/manage/zview/order/presenter/orderCheckBackInfo.zml @@ -0,0 +1,185 @@ + + + +${zhiqim_manager_content()} +
            + 原因分类: + + + + 问题原因: + + + +
            +
            + +
            + +
            + +
            (ctrl+v)粘贴退回截图
            +
            +
            +
            +     + +
            +
            +

            +${zhiqim_manager_content_end()} + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/presenter/quickContact.zml b/Yangcai365_web/manage/zview/order/presenter/quickContact.zml new file mode 100644 index 0000000..6fffd37 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/presenter/quickContact.zml @@ -0,0 +1,115 @@ + + +
            +
            +
            订单【${order.getDesignId()}】快捷联系方式
            +
            +
            + +
            +
            + + <#if order.getMerchantId() == "2019491431057"> + <#if order.getShopNick() == "领淘"> +
            +
            + 售前客服:玉米 +
            +
            + 联系电话:15200463922 +
            +
            + 个人微信:15200463922 +
            +
            + <#else> +
            +
            + 售前客服:玲珑 +
            +
            + 联系电话:13667316513 +
            +
            + 个人微信:13667316513 +
            +
            + + + <#elseif order.getMerchantId() == "1920862616055"> +
            +
            + 售前客服:木易 +
            +
            + 联系电话:15874971979 +
            +
            + 个人微信:15874971979 +
            +
            + + <#elseif order.getMerchantId() == "2000922684001"> +
            +
            + 售前客服:崔崔 +
            +
            + 联系电话:13786298968 +
            +
            + 个人微信:13786298968 +
            +
            + <#else> +
            +
            + 售前客服:${createrDesigner.getOperatorCode()} +
            +
            + 联系电话:${createrDesigner.getOperatorMobile()} +
            +
            + 个人微信:${createrDesigner.getOperatorWxcode()} +
            +
            + +
            +
            + +
            +
            +
            +
            + <#if Validates.isNotEmptyBlank(order.getCustomerQrcodeUrl())> + 对稿沟通群服务二维码: + + <#else> + <#if order.getShopNick() == "领淘"> + 对稿沟通: 企业微信搜索:${order.getUserContact()}  ${order.getUserMobile()} + <#else> + 对稿沟通请联系售前客服 + + +
            +
            +
            +
            +<#-- 操作 --> +
            + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/progressNote.zml b/Yangcai365_web/manage/zview/order/progressNote.zml new file mode 100644 index 0000000..835b2df --- /dev/null +++ b/Yangcai365_web/manage/zview/order/progressNote.zml @@ -0,0 +1,52 @@ + + +
            + + + + +
            + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#for item : pageResult.list()> + + + + + + + +${zhiqim_manager_paging(pageResult, "progressNote.htm")} +
            订单号备注内容备注人备注时间
            暂不存在进度备注信息
            ${item.getDesignId()}${item.getOrdProgressNote()}${item.getOperateCode()}${Sqls.toDateTimeString(item.getCreateTime())}
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/qcApplyDetail.zml b/Yangcai365_web/manage/zview/order/qcApplyDetail.zml new file mode 100644 index 0000000..c28197e --- /dev/null +++ b/Yangcai365_web/manage/zview/order/qcApplyDetail.zml @@ -0,0 +1,120 @@ + + + +${zhiqim_manager_content()} +
            + +
            +
              + <#for item : awardedTypeList> +
            • + +
            +
            +
            +
            + +
            +
            + 凭证 +
            +

            +
            +
            + <#if !readonly> + +     + <#else> + + +
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/qcApplyScore.zml b/Yangcai365_web/manage/zview/order/qcApplyScore.zml new file mode 100644 index 0000000..b8c5771 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/qcApplyScore.zml @@ -0,0 +1,125 @@ + + + +${zhiqim_manager_content()} + + + + +
            +
              + <#for item : awardedTypeList> +
            • + +
            +
            + + + + +
            + +
            + +
            +<#-- 操作 --> +
            +    + +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/qcApplyScoreList.zml b/Yangcai365_web/manage/zview/order/qcApplyScoreList.zml new file mode 100644 index 0000000..534290b --- /dev/null +++ b/Yangcai365_web/manage/zview/order/qcApplyScoreList.zml @@ -0,0 +1,172 @@ + + + +${zhiqim_manager_breadcrumb("质检加分列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + +
            设计师: + + + 申请状态: + + 加分类型: + + + 申请时间: - + +
            审核人: + 审核时间: - + + + +
            +
            + +<#-- 操作功能 --> +
            + <#-- + --> +
            + +<#-- 列表 --> + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 20, "暂时没有申请")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + +
            选择设计师组织加分类型申请理由审核人审核时间质检加分申请时间申请状态操作
            ${item.getDesigner()}${ZmrOrgDao.getOrgName(request, item.getOrgId())}${AwardedTypeConstants.getAwardedTypeId(item.getQcTypeId())}${item.getApplyReason()}${item.getQcAwardedAuditor()}${Sqls.toDateTimeString(item.getQcAwardedAuditorTime())}${item.getScore()}${DateTimes.toDateTimeString(item.getApplyTime())} + <#if item.getApplyFlag()==0>申请中 + <#if item.getApplyFlag()==1>申请成功 + <#if item.getApplyFlag()==2>申请失败 +
            + ${zhiqim_manager_paging(pageResult, "/qcApplyScoreList.htm")} +${zhiqim_manager_content_end()} + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/qcJudge.zml b/Yangcai365_web/manage/zview/order/qcJudge.zml new file mode 100644 index 0000000..4d5d9c5 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/qcJudge.zml @@ -0,0 +1,138 @@ + + + +${zhiqim_manager_content()} + + + + + + + + + + + + + + + + + + + + + + + + +
            订 单 号 :${order.getDesignId()}组 织:${ZmrOrgDao.getOrgName(request, order.getOrgId())}设计师:${order.getDesigner()}
            店 铺 名 称 :${order.getShopNick()}旺旺号:${order.getBuyerNick()}
            质检违规原因: + +
            质检违规描述: + +
            +
            + +
            +
            +<#-- 操作 --> +
            +
            +    + +
            +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/qcOrderList.zml b/Yangcai365_web/manage/zview/order/qcOrderList.zml new file mode 100644 index 0000000..137a4fc --- /dev/null +++ b/Yangcai365_web/manage/zview/order/qcOrderList.zml @@ -0,0 +1,157 @@ +${Scripts.src("/zinc/js/global_2019010801.js")} + + +${zhiqim_manager_breadcrumb("质检订单列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + +
            订 单 号 :设计师: + + + 订单状态: + + 稿件类型: +
            + 质检状态: + + 录单时间: - + +
            +
            + +<#-- 操作功能 --> +
            + + + +
            + +<#-- 列表 --> + + + + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 20, "暂时没有质检订单")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + + + + + + + ${zhiqim_manager_paging(pageResult, "/qcOrderList.htm")} +
            选择订单号所属组织设计旺旺号店铺设计师状态产品进度备注订单金额领取时间设计时间初稿时间状态
            ${item.getDesignId()}${ZmrOrgDao.getOrgName(request, item.getOrgId())}${DraftConstants.get(item.getDraftType())}${item.getBuyerNick()}${item.getShopNick()}${item.getDesigner()}${StatusConstants.getStatus(item.getStatus())}${item.getOrderText()}${progressNoteMap.get(item.getDesignId())}${Amounts.toYuanMustRadix(item.getAmount())}${Sqls.toDateTimeString(item.getDesignReceiveTime())}${Sqls.toDateTimeString(item.getDesignBeginTime())}${Sqls.toDateTimeString(item.getDesignDraftTime())} + <#if item.getQcFlag()==0>未质检 + <#if item.getQcFlag()==1>质检正常 +
            +${zhiqim_manager_content_end()} + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/qcPersonal.zml b/Yangcai365_web/manage/zview/order/qcPersonal.zml new file mode 100644 index 0000000..d5f454c --- /dev/null +++ b/Yangcai365_web/manage/zview/order/qcPersonal.zml @@ -0,0 +1,181 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("我的质检")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + + + + + + + +
            + + + + + + + + + + + + <#for item : pageResult.list()> + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 20, "没有质检扣分订单")} +
            设计师[${designer}]质检扣分表
            违规单号违规原因违规扣分质检时间操作
            ${item.getDesignId()}${item.getReason()}-${item.getScore()}${item.getQcTime()}
            + ${zhiqim_manager_paging(pageResult, "/qcPersonal.htm")} + + + + + + + + + + + + + + + <#for item : result.list()> + + + + + + + + + + + ${zhiqim_manager_tr_no_record(result, 20, "没有申请加分")} +
            设计师[${designer}]质检加分表
            申请ID申请原因退回原因质检加分申请时间申请状态操作
            ${item.getApplyId()}${item.getApplyReason()}${item.getApplyBackReason()}+${item.getScore()}${item.getApplyTime()} + <#if item.getApplyFlag()==0>申请中 + <#if item.getApplyFlag()==1>申请成功 + <#if item.getApplyFlag()==2>申请失败 +
            + ${zhiqim_manager_paging(result, "/qcPersonal.htm")} +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/qcViolationsDetail.zml b/Yangcai365_web/manage/zview/order/qcViolationsDetail.zml new file mode 100644 index 0000000..b5ee1e6 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/qcViolationsDetail.zml @@ -0,0 +1,61 @@ + + + +${zhiqim_manager_content()} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            设计订单:${order.getDesignId()}组织:${ZmrOrgDao.getOrgName(request, order.getOrgId())}设计师:${order.getDesigner()}
            店铺名称:${order.getShopNick()}旺旺号:${order.getBuyerNick()}违规扣分:-${record.getScore()}
            产品信息:${order.getOrderText()}
            质检违规原因:${record.getReason()}
            质检违规描述:${record.getDescription()}
            +
            + 质检违规证据图 +
            +
            +
            + +
            +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/qcViolationsList.zml b/Yangcai365_web/manage/zview/order/qcViolationsList.zml new file mode 100644 index 0000000..8b26e58 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/qcViolationsList.zml @@ -0,0 +1,127 @@ + + +${zhiqim_manager_breadcrumb("质检违规列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 左侧功能 --> +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + +
            订单号:设计师: + + + 订单状态: + + 稿件类型: +
            + 录单时间: - + +
            +
            + +<#-- 操作功能 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 20, "暂时没有质检订单")} + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + + + + +
            选择订单号所属组织设计旺旺号店铺设计师状态产品订单金额录单时间对稿微信对稿手机操作
            ${item.getDesignId()}${ZmrOrgDao.getOrgName(request, item.getOrgId())}${DraftConstants.get(item.getDraftType())}${item.getBuyerNick()}${item.getShopNick()}${item.getDesigner()}${StatusConstants.getStatus(item.getStatus())}${item.getOrderText()}${Amounts.toYuanMustRadix(item.getAmount())}${Sqls.toDateTimeString(item.getCreateTime())}${item.getUserWx()}${item.getUserMobile()}
            +${zhiqim_manager_paging(pageResult, "/qcViolationsList.htm")} +${zhiqim_manager_content_end()} + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/receiveOrder.zml b/Yangcai365_web/manage/zview/order/receiveOrder.zml new file mode 100644 index 0000000..e49f8f8 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/receiveOrder.zml @@ -0,0 +1,100 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(0, 70)} + + + +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + +
             产品类型: + + +   + +
            +
            +
            + <#-- 分页列表--> +
            + + + + + + + + + + + + + <#if pageResult.size() == 0> + ${zhiqim_manager_no_record(8,"暂不存在抢单信息")} + + <#for item : pageResult.list()> + + + + + + + + + + + + +
            订单号产品信息产品类型特殊工艺设计佣金加急费设计等级下单时间操作
            ${item.getDesignId()} + <#if item.isUrgent()> + + ${item.getOrderText()}${Global.get(DesignTypeCache.class).getName(item.getTypeId())}${item.getPrintSpecial()}${Amounts.toYuanMustRadix(item.getDesignPrice())} + <#if item.getUrgentPrice() gt 0> + ${Amounts.toYuanMustRadix(item.getUrgentPrice())} + <#else> + + ${DraftConstants.get(item.getDraftType())}${Sqls.toDateTimeString(item.getCreateTime())}
            +
            + ${zhiqim_manager_paging(pageResult, "/receiveOrder.htm")} +
            +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/retentionDealOrderDetails.zml b/Yangcai365_web/manage/zview/order/retentionDealOrderDetails.zml new file mode 100644 index 0000000..0508a39 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/retentionDealOrderDetails.zml @@ -0,0 +1,95 @@ + + +
            +
            +
            订 单 号:${order.getDesignId()}
            +
            滞留时长:${retentDealTime}
            +
            +
            + + +
            +
            +
            + 旺旺号: + ${order.getBuyerNick()} +
            +
            + 产品类型: + ${order.getOrderText()} +
            +
            + 设计师: + ${order.getDesigner()} +
            +
            +
            +
            + 组织名称: + ${ZmrOrgDao.getOrgName(request, order.getOrgId())} +
            +
            + 订单金额: + ${Amounts.toYuan(order.getAmount())} +
            +
            + 店铺名称: + ${order.getShopNick()} +
            +
            +
            + +
            +
            处理方式: + + +
            +
            设计师跟进情况: + + + +
            +
            + +
            备注
            +
            + +
            +
            + + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/retentionFinishOrderDetails.zml b/Yangcai365_web/manage/zview/order/retentionFinishOrderDetails.zml new file mode 100644 index 0000000..8efdd26 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/retentionFinishOrderDetails.zml @@ -0,0 +1,59 @@ + +
            +
            +
            订 单 号:${order.getDesignId()}
            +
            滞留时长:${retentDealTime}
            +
            +
            + + +
            +
            +
            + 旺旺号: + ${order.getBuyerNick()} +
            +
            + 产品类型: + ${order.getOrderText()} +
            +
            + 设计师: + ${order.getDesigner()} +
            +
            +
            +
            + 组织名称: + ${ZmrOrgDao.getOrgName(request, order.getOrgId())} +
            +
            + 订单金额: + ${Amounts.toYuan(order.getAmount())} +
            +
            + 店铺名称: + ${order.getShopNick()} +
            +
            +
            +
            滞留单处理结果反馈
            +
            +
            处理方式: + + +
            +
            设计师跟进情况: + + + +
            +
            + +
            备注
            +
            + +
            +
            + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/selectRefundOrderImg.zml b/Yangcai365_web/manage/zview/order/selectRefundOrderImg.zml new file mode 100644 index 0000000..1bc3d16 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/selectRefundOrderImg.zml @@ -0,0 +1,27 @@ + + + +${zhiqim_manager_content()} +<#for item : attaList> +
            + 截图 +
            + +

            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/timelinessOrgStat.zml b/Yangcai365_web/manage/zview/order/timelinessOrgStat.zml new file mode 100644 index 0000000..fe0231e --- /dev/null +++ b/Yangcai365_web/manage/zview/order/timelinessOrgStat.zml @@ -0,0 +1,148 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("组织初稿时效")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + +
            录单时间: -  +     + 产品类型: + +
            +
            + +<#-- 分页列表--> + + + + + +
            + + + + + + + + + + + + + + + +
            当日总设计单:   ${designOrderSum}
            当日总初稿:  ${firstDraftSum}时效内:${timelinessSum}已超时:${exceedTimelinessSum}
            等待初稿:  ${sleepDraftSum}时效内:${sleepTimelinessSum}已超时:${exceedSleepTimelinessSum}
            + + + + + + + + + + + + + + + + <#for item : orgStatModelList> + + + + + + + + + + + + + + + + + + + + + + + +
            组织初稿时效统计表
            组织名称总单量已初稿时效内已超时等待初稿时效内已超时超时百分比
            ${item.getOrgName()}${item.getOrgOrderSum()}${item.getOrgFirstDraftSum()}${item.getOrgTimelinessSum()}${item.getOrgExceedTimelinessSum()}${item.getOrgSleepDraftSum()}${item.getOrgSleepTimelinessSum()}${item.getOrgExceedSleepTimelinessSum()}${item.getOrgExceedPrent()}%
            总计${designOrderSum}${firstDraftSum}${timelinessSum}${exceedTimelinessSum}${sleepDraftSum}${sleepTimelinessSum}${exceedSleepTimelinessSum}${prentSum}%
            +
            + +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/timeoutCompleteOrderHistory.zml b/Yangcai365_web/manage/zview/order/timeoutCompleteOrderHistory.zml new file mode 100644 index 0000000..36414a8 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/timeoutCompleteOrderHistory.zml @@ -0,0 +1,127 @@ + + +<#def designatedPath="/timeoutOrderNear.htm"/> +${zhiqim_manager_breadcrumb("定稿超时列表")} +${zhiqim_manager_content()} + +<#-- 页面数据定义 --> +<#var typeMap = DesignTypeDao.mapAll()/> +<#var industryMap = Global.get(DesignIndustryCache.class).mapAll()/> + +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + +
            录单时间: + - + + 是否定稿: + + 选择行业: + +     
            +
            + +<#-- 分页列表 --> +
            + + + + + +
            + + + + + + + <#for item : map.keySet()> + bgcolor="#f3fdfc" onclick="doQueryDesigner('${item}');"> + + + + + + <#if map.values().isEmpty()> + ${zhiqim_manager_no_record(3, "暂时没有信息")} + +
            序号设计师订单数
            ${item_index +1}${item}${map.get(item)}
            +
            + + + + + + + + + + + + + + <#for item : pageResult.list()> + <#var effectiveTime = 24*60/> + + + + + + + + + + + + + + <#if pageResult.total() == 0> + ${zhiqim_manager_no_record(10, "暂时没有定稿超时列表信息")} + +
            订单ID订单信息旺旺名录单时间初稿时间定稿时间进度备注超时时长设计师行业
            ${item.getDesignId()}${item.getOrderText()}${item.getBuyerNick()}${Sqls.toDateTimeString(item.getCreateTime())}${Sqls.toDateTimeString(item.getDesignDraftTime())}${Sqls.toDateTimeString(item.getDesignEndTime())}${progressNoteMap.get(item.getDesignId())}<#if Validates.isNotEmpty(item.getDesignEndTime())>${DateTimes.compareMinute(item.getDesignEndTime(), item.getCreateTime()) - effectiveTime}<#else>${DateTimes.compareMinute(Sqls.nowTimestamp(), item.getCreateTime()) - effectiveTime} 分钟${item.getDesigner()}<#if Validates.isNotEmpty(industryMap) && industryMap.containsKey(item.getIndustryId())>${industryMap.get(item.getIndustryId()).getIndustryName()}
            + ${zhiqim_manager_paging(pageResult, "timeoutCompleteOrderHistory.htm")} +
            +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/timeoutDispatchOrder.zml b/Yangcai365_web/manage/zview/order/timeoutDispatchOrder.zml new file mode 100644 index 0000000..e685dd4 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/timeoutDispatchOrder.zml @@ -0,0 +1,83 @@ +${zhiqim_manager_breadcrumb("派单超时")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件 此列表展示派单超时仍未派送订单(等待设计到正在设计)")} +
            + + + + + + + + +
            订单号: + + 旺旺号: + + 选择行业: + + 产品类型: +     
            +
            + +<#-- 分页列表 --> +
            + + + + + + + + + + + + +<#var typeMap = DesignTypeDao.mapAll()/> +<#for item : pageResult.list()> +<#var effectiveTime = Validates.isEmpty(typeMap) ? 0 : ( typeMap.containsKey(item.getTypeId()) ? typeMap.get(item.getTypeId()).getDispatchOrderEffectiveTime() : 0)/> +bgcolor="#f3fdfc"> + + + + + + + + + + + +<#if pageResult.total() == 0> +${zhiqim_manager_no_record(10, "暂时没有派单超时订单信息")} + +
            订单号旺旺名产品组织录单客服分拣时间进度备注行业超时时长
            ${item.getDesignId()}${item.getBuyerNick()}${item.getOrderText()}${ZmrOrgDao.getOrgName(request, item.getOrgId())}${item.getCreater()}${Sqls.toDateTimeString(item.getOrgReceiveTime())}${progressNoteMap.get(item.getDesignId())}${Global.get(DesignIndustryCache.class).getIndustryName(item.getIndustryId())}${CalculationUtil.dateTimeTran(DateTimes.compareMinute(Sqls.nowTimestamp(), item.getOrgReceiveTime()) - effectiveTime)}
            +
            +${zhiqim_manager_paging(pageResult, "timeoutDispatchOrder.htm")} +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/timeoutDraftOrder.zml b/Yangcai365_web/manage/zview/order/timeoutDraftOrder.zml new file mode 100644 index 0000000..638301a --- /dev/null +++ b/Yangcai365_web/manage/zview/order/timeoutDraftOrder.zml @@ -0,0 +1,121 @@ + + +${zhiqim_manager_breadcrumb("初稿超时")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件 此列表展示初稿超时订单")} +
            + + + + <#if isOrgRoot> + + +
            + 接单日期: - + + + 设计师: +     
            +
            +
            + + + + + + + + <#for item : pageResult.list()> + + + + + + + + <#if pageResult.list().size() == 0> + ${zhiqim_manager_no_record(4, "暂时没有初稿超时统计信息")} + <#else> + + + + + + + +
            设计师接单量超时量超时率
            ${item.getDesigner()}${item.getOrdCount()}${item.getTimeoutOrdCount()}${CalculationUtil.calculatePercent(item.getTimeoutOrdCount(),item.getOrdCount())}
            总计${ordSum}${timeoutOrdSum}${CalculationUtil.calculatePercent(timeoutOrdSum,ordSum)}
            + ${zhiqim_manager_paging(pageResult, "/timeoutDraftOrder.htm")} +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/timeoutMerDispatch.zml b/Yangcai365_web/manage/zview/order/timeoutMerDispatch.zml new file mode 100644 index 0000000..5adf086 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/timeoutMerDispatch.zml @@ -0,0 +1,99 @@ + + +${zhiqim_manager_breadcrumb("分拣超时")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件 此列表展示分拣超时订单")} +
            + + + + + + + + + +
            订单号: + + 旺旺号: + + 选择行业: + + 产品类型: + + 创建日期: - + +     
            +
            +
            + + + + + + + + + + + +
            订单量超时量超时率
            ${ordCount}${timeoutOrdCount}${CalculationUtil.calculatePercent(timeoutOrdCount,ordCount)}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/timeoutOrderHistory.zml b/Yangcai365_web/manage/zview/order/timeoutOrderHistory.zml new file mode 100644 index 0000000..32d4c71 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/timeoutOrderHistory.zml @@ -0,0 +1,142 @@ + + +<#def designatedPath="/timeoutOrderNear.htm"/> +${zhiqim_manager_breadcrumb("历史超时订单")} +${zhiqim_manager_content()} + +<#-- 页面数据定义 --> +<#var typeMap = DesignTypeDao.mapAll()/> +<#var industryMap = Global.get(DesignIndustryCache.class).mapAll()/> + +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + +
            录单时间: + - + + 订单状态: + + 是否初稿: + + 选择行业: + +
            产品类型: +     
            +
            + +<#-- 分页列表 --> +
            + + + + + +
            + + + + + + + <#for item : map.keySet()> + bgcolor="#f3fdfc" onclick="doQueryDesigner('${item}');"> + + + + + + <#if map.values().isEmpty()> + ${zhiqim_manager_no_record(3, "暂时没有信息")} + +
            序号设计师订单数
            ${item_index +1}${item}${map.get(item)}
            +
            + + + + + + + + + + + + + + + <#for item : pageResult.list()> + <#var effectiveTime = Validates.isEmpty(typeMap) ? 0 : (typeMap.containsKey(item.getTypeId()) ? typeMap.get(item.getTypeId()).getEffectiveTime() : 0)/> + + + + + + + + + + + + + + <#if pageResult.total() == 0> + ${zhiqim_manager_no_record(10, "暂时没有历史超时订单信息")} + +
            订单ID订单信息旺旺名录单时间领单时间初稿时间进度备注超时时长设计师行业
            ${item.getDesignId()}${item.getOrderText()}${item.getBuyerNick()}${Sqls.toDateTimeString(item.getCreateTime())}${Sqls.toDateTimeString(item.getDesignReceiveTime())}${Sqls.toDateTimeString(item.getDesignDraftTime())}${progressNoteMap.get(item.getDesignId())}<#if Validates.isNotEmpty(item.getDesignDraftTime())>${DateTimes.compareMinute(item.getDesignDraftTime(), item.getCreateTime()) - effectiveTime}<#else>${DateTimes.compareMinute(Sqls.nowTimestamp(), item.getCreateTime()) - effectiveTime} 分钟${item.getDesigner()}<#if Validates.isNotEmpty(industryMap) && industryMap.containsKey(item.getIndustryId())>${industryMap.get(item.getIndustryId()).getIndustryName()}
            + ${zhiqim_manager_paging(pageResult, "timeoutOrderHistory.htm")} +
            +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/timeoutOrderHistoryStat.zml b/Yangcai365_web/manage/zview/order/timeoutOrderHistoryStat.zml new file mode 100644 index 0000000..bafe866 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/timeoutOrderHistoryStat.zml @@ -0,0 +1,135 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/data.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("初稿超时折线图")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            +<#-- 左侧功能 --> +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + +
            录单时间: -  +     + 产品类型: + +
            +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/timeoutOrderNear.zml b/Yangcai365_web/manage/zview/order/timeoutOrderNear.zml new file mode 100644 index 0000000..5a553ac --- /dev/null +++ b/Yangcai365_web/manage/zview/order/timeoutOrderNear.zml @@ -0,0 +1,95 @@ +${zhiqim_manager_breadcrumb("快超时订单")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + +
            设计师名称: + + 订单状态: + + 选择行业: + + 产品类型: +     
            +
            + +<#-- 分页列表 --> +
            + + + + + + + + + + + + + +<#for item : pageResult.list()> +bgcolor="#f3fdfc"> + + + + + + + + + + + + +<#if pageResult.total() == 0> +${zhiqim_manager_no_record(10, "暂时没有快超时订单信息")} + +
            订单ID组织名称订单信息行业旺旺名录单时间领单时间进度备注倒计时设计师
            ${item.getDesignId()}${ZmrOrgDao.getOrgName(request, item.getOrgId())}${item.getOrderText()}${Global.get(DesignIndustryCache.class).getIndustryName(item.getIndustryId())}${item.getBuyerNick()}${Sqls.toDateTimeString(item.getCreateTime())}${Sqls.toDateTimeString(item.getDesignReceiveTime())}${progressNoteMap.get(item.getDesignId())}${item.getCountDown()} 分钟${item.getDesigner()}
            +
            +${zhiqim_manager_paging(pageResult, "timeoutOrderNear.htm")} +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/timeoutOrderToday.zml b/Yangcai365_web/manage/zview/order/timeoutOrderToday.zml new file mode 100644 index 0000000..d5e1e37 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/timeoutOrderToday.zml @@ -0,0 +1,96 @@ +<#def designatedPath="/timeoutOrderNear.htm"/> +${zhiqim_manager_breadcrumb("当日超时订单")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + +
            设计师名称: + + 订单状态: + + 选择行业: + + 产品类型: +     
            +
            + +<#-- 分页列表 --> +
            + + + + + + + + + + + + +<#var typeMap = DesignTypeDao.mapAll()/> +<#for item : pageResult.list()> +<#var effectiveTime = Validates.isEmpty(typeMap) ? 0 : ( typeMap.containsKey(item.getTypeId()) ? typeMap.get(item.getTypeId()).getEffectiveTime() : 0)/> +bgcolor="#f3fdfc"> + + + + + + + + + + + +<#if pageResult.total() == 0> +${zhiqim_manager_no_record(9, "暂时没有当日超时订单信息")} + +
            订单ID订单信息行业旺旺名录单时间领单时间进度备注超时时长设计师
            ${item.getDesignId()}${item.getOrderText()}${Global.get(DesignIndustryCache.class).getIndustryName(item.getIndustryId())}${item.getBuyerNick()}${Sqls.toDateTimeString(item.getCreateTime())}${Sqls.toDateTimeString(item.getDesignReceiveTime())}${progressNoteMap.get(item.getDesignId())}${DateTimes.compareMinute(Sqls.nowTimestamp(), item.getCreateTime()) - effectiveTime} 分钟${item.getDesigner()}
            +
            +${zhiqim_manager_paging(pageResult, "timeoutOrderToday.htm")} +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/order/uploadCustomCdrInfo.zml b/Yangcai365_web/manage/zview/order/uploadCustomCdrInfo.zml new file mode 100644 index 0000000..9260414 --- /dev/null +++ b/Yangcai365_web/manage/zview/order/uploadCustomCdrInfo.zml @@ -0,0 +1,88 @@ +<#-- 主题变量和函数定义 --> +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Styles.src(context.getRootPath("/zinc/layui/css/layui.css"))} +${Scripts.src(context.getRootPath("/zinc/layui/layui.js"))} + + + + + + + + + + + + +
            客户素材
            +
            + +

            点击上传或拖拽资料素材到此处

            +


            + 共上传:0个   + 成功:0个   + 失败:0个 +
            + +
            + +
            + + diff --git a/Yangcai365_web/manage/zview/order/uploadData.zml b/Yangcai365_web/manage/zview/order/uploadData.zml new file mode 100644 index 0000000..69a0dfa --- /dev/null +++ b/Yangcai365_web/manage/zview/order/uploadData.zml @@ -0,0 +1,161 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(400, 70)} + +<#var data="data=copy,userText,CustomFile,TemplateFile,DesginFile,EndFile,WorkFile,AftersaleFile,ThumFile,userNotice"/> +<#var addRule="addRule=DesginFile,EndFile,WorkFile,AftersaleFile"/> +<#var delRule="delRule=DesginFile,EndFile,WorkFile,AftersaleFile"/> +${zhiqim_manager_breadcrumb("资料上传")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + +<#-- 左侧功能 --> +
            + + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + + + + + + +
            订单号:产品类型: + 其他信息:
            旺旺号:淘宝单号:录单时间: -  + +
            + 稿件类型: + 是否印刷: + 添加行业: +
            +
            + + <#-- 操作功能 --> +
            + + <#if ZmrPathRule.check(request, "openWangWang")> + <#if ZmrPathRule.check(request, "openQQ")> +
            + + <#-- 分页列表--> +
            + + ${zhiqim_manager_tr_title(30, "订单列表")} + + + + + + + + + + + + + + + + + + + + + <#if pageResult.total() == 0> + ${zhiqim_manager_no_record(30, "暂时没有订单信息")} + + <#for item : pageResult.list()> + + + + + + + + + + + + + + + + + + + + + + + +
            选择订单号店铺设计旺旺号状态行业产品印刷金额特殊工艺录单时间完稿时间设计师审核人联系人对稿手机对稿QQ对稿微信
            ${item.getDesignId()}${item.getShopNick()}${DraftConstants.get(item.getDraftType())}${item.getBuyerNick()}${StatusConstants.getStatus(item.getStatus())}${Global.get(DesignIndustryCache.class).getIndustryName(item.getIndustryId())}${item.getOrderText()}${Amounts.toYuanMustRadix(item.getAmount())}${item.getPrintSpecial()}${Sqls.toDateTimeString(item.getCreateTime())}${Sqls.toDateTimeString(item.getDesignEndTime())}${item.getDesigner()}${item.getChecker()}${item.getUserContact()}${item.getUserMobile()}${item.getUserQq()}${item.getUserWx()}
            +
            + ${zhiqim_manager_paging(pageResult, "uploadData.htm")} +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            + +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/waiveOrder.zml b/Yangcai365_web/manage/zview/order/waiveOrder.zml new file mode 100644 index 0000000..16703ad --- /dev/null +++ b/Yangcai365_web/manage/zview/order/waiveOrder.zml @@ -0,0 +1,36 @@ + + +
            +
            放弃订单
            +
            订单编号: ${designId}
            +
            产品类型: ${typeName}
            +
            确认放弃订单,将扣除积分-10分
            本月仅剩(${waiveNum})次放弃次数
            +
            +<#-- 操作 --> +
            + + +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/order/wangwangOrder.zml b/Yangcai365_web/manage/zview/order/wangwangOrder.zml new file mode 100644 index 0000000..0a56e2b --- /dev/null +++ b/Yangcai365_web/manage/zview/order/wangwangOrder.zml @@ -0,0 +1,60 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/js/global_2019010801.js")} +${yangcai_calc_Left_width_height(400, 70)} + +<#var data="data=copy,userText,CustomFile,DesginFile,EndFile,WorkFile,AftersaleFile,ThumFile,userNotice,TbzFile"/> +<#var addRule="addRule=CustomFile,TemplateFile,DesginFile,EndFile,WorkFile,TbzFile"/> +<#var delRule="delRule=CustomFile,TemplateFile,DesginFile,EndFile,WorkFile,TbzFile"/> +${zhiqim_manager_breadcrumb("旺旺订单")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 左侧功能 --> +
            + <#-- 分页列表--> + + ${zhiqim_manager_tr_title(7, "旺旺订单列表")} + + + + + + + + + + + + + <#for item : orderList> + + + + + + + + + + + + + +
            选择订单号稿件类型设计师订单状态旺旺号产品类型特殊工艺收货人收件地址
            ${item.getDesignId()}${DraftConstants.get(item.getDraftType())}${item.getDesigner()}${StatusConstants.getStatus(item.getStatus())}${item.getBuyerNick()}${Global.get(DesignTypeCache.class).getName(item.getTypeId())}${item.getPrintSpecial()}${item.getReceiverName()}${item.getReceiverState()} ${item.getReceiverCity()} ${item.getReceiverDistrict()} ${item.getReceiverAddress()}
            +
            +${zhiqim_manager_content_end()} + +<#--右侧文件信息--> +
            + +
            diff --git a/Yangcai365_web/manage/zview/pdfQueue.zml b/Yangcai365_web/manage/zview/pdfQueue.zml new file mode 100644 index 0000000..b5b293b --- /dev/null +++ b/Yangcai365_web/manage/zview/pdfQueue.zml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + <#for item : theaderList> + + + + + + + +
            + 线程池状态(正在处理:${runNum} 休眠:${sleepNum}) +
            线程名当前状态上次休眠时间
            ${item.getThreadName()}${item.isActive() ? "正在处理" : "休眠"}${item.getIdleTimeString()}
            + + + + + + + + + + + + <#for item : waitQueue> + + + + + + + + +
            + 等待队列(${waitQueue.size()}) +
            队列ID队列状态模板ID完成时间
            ${item.getObj().getHandleId()} + <#if item.getObj().getHandleStatus()==0> + 等待处理 + <#elseif item.getObj().getHandleStatus()==1> + 处理中 + <#elseif item.getObj().getHandleStatus()==2> + 处理完成 + <#elseif item.getObj().getHandleStatus()==3> + 处理失败 + + ${item.getObj().getMediaId()}${DateTimes.toDateTimeString(item.getObj().getFinishTime())}
            + + + + + + + + + + + + <#for item : finishList> + + + + + + + + +
            + 已完成队列(${finishList.size()}) +
            队列ID队列状态模板ID完成时间
            ${item.getHandleId()} + <#if item.getHandleStatus()==0> + 等待处理 + <#elseif item.getHandleStatus()==1> + 处理中 + <#elseif item.getHandleStatus()==2> + 处理完成 + <#elseif item.getHandleStatus()==3> + 处理失败 + + ${item.getMediaId()}${DateTimes.toDateTimeString(item.getFinishTime())}
            diff --git a/Yangcai365_web/manage/zview/score/keywordScore.zml b/Yangcai365_web/manage/zview/score/keywordScore.zml new file mode 100644 index 0000000..dd63e03 --- /dev/null +++ b/Yangcai365_web/manage/zview/score/keywordScore.zml @@ -0,0 +1,97 @@ + + +${zhiqim_manager_breadcrumb("关键词分数权重")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 列表 --> + + + + + + +
            + + + + + + <#for item : scoreList> + + + + +
            序号类型名称
            ${item_index+1}${ScoreConstants.getKeywordScoreTypeDesc(item.getScoreType())}
            +
            + + + + + + + + + + + + <#for item : paramList> + + + + + + + + + +
              + <#if Validates.isNotEmpty(scoreType)>[${ScoreConstants.getKeywordScoreTypeDesc(scoreType)}]参数列表<#else>所有参数列表 +
            操作类型参数名称参数键参数值操作
            + <#if item.getParamType() == 0>加分 + <#if item.getParamType() == 1>减分 + ${KeywordScoreConstants.getKeywordParamDesc(item.getParamKey())}${item.getParamKey()}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/keywordScoreAdd.zml b/Yangcai365_web/manage/zview/score/keywordScoreAdd.zml new file mode 100644 index 0000000..41e1409 --- /dev/null +++ b/Yangcai365_web/manage/zview/score/keywordScoreAdd.zml @@ -0,0 +1,57 @@ +${zhiqim_manager_history("/keywordScore.htm")} +${zhiqim_manager_breadcrumb_parent("/keywordScore.htm", "关键词评分参数", "增加关键词评分参数")} +${request.getValidateScript()} + +
            +${zhiqim_manager_title("新增关键词评分参数")} +
            + + + + + + + + + + + + + + + + + + + + + +
            评分类型:(请选择) +  * +
            评分类型:(请选择) +  * +
            参数操作类型:(请选择) +  * +
            参数键:(32位不定长字符) +   * +
            参数值:(请输入) *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/keywordWeight.zml b/Yangcai365_web/manage/zview/score/keywordWeight.zml new file mode 100644 index 0000000..ca5e6bd --- /dev/null +++ b/Yangcai365_web/manage/zview/score/keywordWeight.zml @@ -0,0 +1,50 @@ +${zhiqim_manager_breadcrumb("关键词分数权重")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + + +<#if pageResult.total() == 0> + ${zhiqim_manager_no_record(6 "暂时没有关键词分数权重信息")} + +<#for item : pageResult.list()> + + + + + + + + + +
             关键词分数权重列表
            选择类型名称日期规则类型类型分值权重比例
            + <#if Validates.isEqual("TEMPLATE", item.getScoreName())>模板 + <#if Validates.isEqual("KEYWORD", item.getScoreName())>关键词 + ${item.getDayCode()}${ScoreConstants.getKeywordScoreTypeDesc(item.getScoreType())}<#if item.getScoreValue() gt 0> ${item.getScoreValue()}${Amounts.toYuanMustRadix(item.getScoreWeight())}
            +${zhiqim_manager_paging(pageResult, "/keywordWeight.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/keywordWeightAdd.zml b/Yangcai365_web/manage/zview/score/keywordWeightAdd.zml new file mode 100644 index 0000000..c4e5eec --- /dev/null +++ b/Yangcai365_web/manage/zview/score/keywordWeightAdd.zml @@ -0,0 +1,43 @@ +${zhiqim_manager_history("/templateWeight.htm")} +${zhiqim_manager_breadcrumb_parent("/templateWeight.htm", "关键词分数权重", "增加关键词分数权重")} +${request.getValidateScript()} + +
            +${zhiqim_manager_title("新增关键词分数权重")} +
            + + + + + + + + + + + + + + + + + + + + + +
            类型名称: +  * +
            权重类型:(请选择) +  * +
            日期:(请选择) *
            基础分:(请输入)
            权重值:(百分比,如50%,只需填写50)% *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/keywordWeightModify.zml b/Yangcai365_web/manage/zview/score/keywordWeightModify.zml new file mode 100644 index 0000000..b025a73 --- /dev/null +++ b/Yangcai365_web/manage/zview/score/keywordWeightModify.zml @@ -0,0 +1,37 @@ +${zhiqim_manager_history("/keywordWeight.htm")} +${zhiqim_manager_breadcrumb_parent("/keywordWeight.htm", "关键词分数权重", "修改关键词分数权重")} +${request.getValidateScript()} + +
            +${zhiqim_manager_title("修改关键词分数权重")} +
            + + + + + + + + + + + + + + + + + + + + + + + +
            类型名称: + <#if Validates.isEqual("TEMPLATE", weight.getScoreName())>模板 + <#if Validates.isEqual("KEYWORD", weight.getScoreName())>关键词 +
            权重类型:${ScoreConstants.getKeywordScoreTypeDesc(weight.getScoreType())}
            日期:(请选择) *
            基础分:(请输入)
            权重值:(百分比,如50%,只需填写50)% *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/scoreDesignerLever.zml b/Yangcai365_web/manage/zview/score/scoreDesignerLever.zml new file mode 100644 index 0000000..d8ada54 --- /dev/null +++ b/Yangcai365_web/manage/zview/score/scoreDesignerLever.zml @@ -0,0 +1,44 @@ +${zhiqim_manager_breadcrumb("设计师等级配置")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + +<#if pageResult.total() == 0> + ${zhiqim_manager_no_record(6 "暂时没有设计师等级配置信息")} + +<#for item : pageResult.list()> + + + + + + + + +
             设计师等级配置列表
            选择设计师等级积分分数操作人更新时间
            ${item.getDesignerLever()}${item.getMinScore()}至${item.getMaxScore()}${item.getLastOperatorCode()}${item.getModifyTime()}
            +${zhiqim_manager_paging(pageResult, "/scoreDesignerLever.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/scoreDesignerLeverAdd.zml b/Yangcai365_web/manage/zview/score/scoreDesignerLeverAdd.zml new file mode 100644 index 0000000..3344cae --- /dev/null +++ b/Yangcai365_web/manage/zview/score/scoreDesignerLeverAdd.zml @@ -0,0 +1,22 @@ +${zhiqim_manager_history("/scoreDesignerLever.htm")} +${zhiqim_manager_breadcrumb_parent("/scoreDesignerLever.htm", "设计师等级配置", "增加设计师等级配置")} +${request.getValidateScript()} + +
            +${zhiqim_manager_title("新增设计师等级配置")} +
            + + + + + + + + + +
            设计师等级: + +
            评分分数:-
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/scoreDesignerLeverModify.zml b/Yangcai365_web/manage/zview/score/scoreDesignerLeverModify.zml new file mode 100644 index 0000000..b214556 --- /dev/null +++ b/Yangcai365_web/manage/zview/score/scoreDesignerLeverModify.zml @@ -0,0 +1,24 @@ +${zhiqim_manager_history("/scoreDesignerLever.htm")} +${zhiqim_manager_breadcrumb_parent("/scoreDesignerLever.htm", "设计师等级配置", "修改设计师等级配置")} +${request.getValidateScript()} + +
            +${zhiqim_manager_title("修改设计师等级配置")} +
            + + + + + + + + + + + +
            设计师等级: + +
            评分分数:-
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/scoreDesignerRecord.zml b/Yangcai365_web/manage/zview/score/scoreDesignerRecord.zml new file mode 100644 index 0000000..df9091c --- /dev/null +++ b/Yangcai365_web/manage/zview/score/scoreDesignerRecord.zml @@ -0,0 +1,111 @@ + +${zhiqim_manager_breadcrumb("设计师积分列表")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + + + + + + +<#if pageResult.total() == 0> + ${zhiqim_manager_no_record(6 "暂时没有设计师积分信息")} + +<#for item : pageResult.list()> + + + + + + + + + + + + +
             设计师积分列表
            设计师当前积分当前等级状态最后更新积分值最后更新积分细则最后更新涉及订单最后更新时间操作
            ${item.getOperatorCode()}${item.getScore()} + <#for scoreDesignerLever : scoreDesignerLeverList> + <#if scoreDesignerLever.maxScore gte item.getScore() && item.getScore() gte scoreDesignerLever.minScore > + ${scoreDesignerLever.getDesignerLever()} + + + + <#if item.getState() == 1> +
            生效
            + <#else> +
            失效
            + +
            + <#if item.getLastModifyScore() !=0 > + ${item.getLastModifyScore()} + + ${item.getTypeName()} + <#if item.getOrderId() !=-1 && item.getOrderId() !=0> + ${item.getOrderId()} + + ${item.getLastModifyTime()} + + +
            +${zhiqim_manager_paging(pageResult, "/scoreDesignerRecord.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/scoreDesignerRecordAdd.zml b/Yangcai365_web/manage/zview/score/scoreDesignerRecordAdd.zml new file mode 100644 index 0000000..a7b1dbe --- /dev/null +++ b/Yangcai365_web/manage/zview/score/scoreDesignerRecordAdd.zml @@ -0,0 +1,27 @@ +${zhiqim_manager_history("/scoreDesignerRecord.htm")} +${zhiqim_manager_breadcrumb_parent("/scoreDesignerRecord.htm", "设计师积分", "人工修正")} +${request.getValidateScript()} + +
            +${zhiqim_manager_title("人工修正设计师积分")} +
            + + + + + + + + + + + + + + +
            积分(正数为增加,负数为减少): *
            备注: *
            涉及订单: + +
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/scoreDesignerRecordDetail.zml b/Yangcai365_web/manage/zview/score/scoreDesignerRecordDetail.zml new file mode 100644 index 0000000..47db1ed --- /dev/null +++ b/Yangcai365_web/manage/zview/score/scoreDesignerRecordDetail.zml @@ -0,0 +1,48 @@ +${zhiqim_manager_content()} + +
            +
            + + 项目类型: + + + 记录时间: +  -  + + +
            +
            + + + + + + + + + + +<#if pageResult.total() == 0> + ${zhiqim_manager_no_record(6 "暂时没有设计师积分详情")} + +<#for item : pageResult.list()> + + + + + + + + + +
            积分时间积分细则涉及订单备注操作人
            ${item.getScore()}${item.getModifyTime()}${item.getTypeName()} + <#if item.getOrderId() !=-1 && item.getOrderId() !=0> + ${item.getOrderId()} + + ${item.getRemark()}${item.getCreateOperator()}
            +${zhiqim_manager_paging(pageResult, "/scoreDesignerRecordDetail.htm")} +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/score/scoreType.zml b/Yangcai365_web/manage/zview/score/scoreType.zml new file mode 100644 index 0000000..b26bad9 --- /dev/null +++ b/Yangcai365_web/manage/zview/score/scoreType.zml @@ -0,0 +1,71 @@ + +${zhiqim_manager_breadcrumb("积分细则")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + + + +<#if pageResult.total() == 0> + ${zhiqim_manager_no_record(6 "暂时没有积分细则信息")} + +<#for item : pageResult.list()> + + + + + + + + + + +
             积分细则列表
            操作类型积分值状态备注操作人更新时间操作
            ${item.getTypeName()} + + + + ${item.getRemark()}${item.getLastOperatorCode()}${item.getModifyTime()}
            +${zhiqim_manager_paging(pageResult, "/scoreType.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/templateScore.zml b/Yangcai365_web/manage/zview/score/templateScore.zml new file mode 100644 index 0000000..18ddd2d --- /dev/null +++ b/Yangcai365_web/manage/zview/score/templateScore.zml @@ -0,0 +1,98 @@ + + +${zhiqim_manager_breadcrumb("模板评分参数")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 列表 --> + + + + + + +
            + + + + + + <#for item : scoreList> + + + + + +
            序号类型名称
            ${item_index+1}${ScoreConstants.getTemplateScoreTypeDesc(item.getScoreType())}
            +
            + + + + + + + + + + + + <#for item : paramList> + + + + + + + + + +
              + <#if Validates.isNotEmpty(scoreType)>[${ScoreConstants.getTemplateScoreTypeDesc(scoreType)}]参数列表<#else>所有参数列表 +
            操作类型参数名称参数键参数值操作
            + <#if item.getParamType() == 0>加分 + <#if item.getParamType() == 1>减分 + ${TemplateScoreConstants.getTemplateParamDesc(item.getParamKey())}${item.getParamKey()}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/templateScoreAdd.zml b/Yangcai365_web/manage/zview/score/templateScoreAdd.zml new file mode 100644 index 0000000..556647c --- /dev/null +++ b/Yangcai365_web/manage/zview/score/templateScoreAdd.zml @@ -0,0 +1,57 @@ +${zhiqim_manager_history("/templateScore.htm")} +${zhiqim_manager_breadcrumb_parent("/templateScore.htm", "模板评分参数", "增加模板评分参数")} +${request.getValidateScript()} + +
            +${zhiqim_manager_title("新增模板评分参数")} +
            + + + + + + + + + + + + + + + + + + + + + +
            评分类型:(请选择) +  * +
            评分类型:(请选择) +  * +
            参数操作类型:(请选择) +  * +
            参数键:(32位不定长字符) +   * +
            参数值:(请输入) *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/templateWeight.zml b/Yangcai365_web/manage/zview/score/templateWeight.zml new file mode 100644 index 0000000..a788f37 --- /dev/null +++ b/Yangcai365_web/manage/zview/score/templateWeight.zml @@ -0,0 +1,50 @@ +${zhiqim_manager_breadcrumb("模板分数权重")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + + +<#if pageResult.total() == 0> + ${zhiqim_manager_no_record(6 "暂时没有模板分数权重信息")} + +<#for item : pageResult.list()> + + + + + + + + + +
             模板分数权重列表
            选择类型名称日期规则类型类型分值权重比例
            + <#if Validates.isEqual("TEMPLATE", item.getScoreName())>模板 + <#if Validates.isEqual("KEYWORD", item.getScoreName())>关键词 + ${item.getDayCode()}${ScoreConstants.getTemplateScoreTypeDesc(item.getScoreType())}<#if item.getScoreValue() gt 0> ${item.getScoreValue()}${Amounts.toYuanMustRadix(item.getScoreWeight())}
            +${zhiqim_manager_paging(pageResult, "/templateWeight.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/templateWeightAdd.zml b/Yangcai365_web/manage/zview/score/templateWeightAdd.zml new file mode 100644 index 0000000..cf8ef43 --- /dev/null +++ b/Yangcai365_web/manage/zview/score/templateWeightAdd.zml @@ -0,0 +1,43 @@ +${zhiqim_manager_history("/templateWeight.htm")} +${zhiqim_manager_breadcrumb_parent("/templateWeight.htm", "模板分数权重", "增加模板分数权重")} +${request.getValidateScript()} + +
            +${zhiqim_manager_title("新增模板分数权重")} +
            + + + + + + + + + + + + + + + + + + + + + +
            类型名称: +  * +
            权重类型:(请选择) +  * +
            日期:(请选择) *
            基础分:(请输入)
            权重值:(百分比,如50%,只需填写50)% *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/score/templateWeightModify.zml b/Yangcai365_web/manage/zview/score/templateWeightModify.zml new file mode 100644 index 0000000..5b172f8 --- /dev/null +++ b/Yangcai365_web/manage/zview/score/templateWeightModify.zml @@ -0,0 +1,37 @@ +${zhiqim_manager_history("/templateWeight.htm")} +${zhiqim_manager_breadcrumb_parent("/templateWeight.htm", "模板分数权重", "修改模板分数权重")} +${request.getValidateScript()} + +
            +${zhiqim_manager_title("修改模板分数权重")} +
            + + + + + + + + + + + + + + + + + + + + + + + +
            类型名称: + <#if Validates.isEqual("TEMPLATE", weight.getScoreName())>模板 + <#if Validates.isEqual("KEYWORD", weight.getScoreName())>关键词 +
            权重类型:${ScoreConstants.getTemplateScoreTypeDesc(weight.getScoreType())}
            日期:(请选择) *
            基础分:(请输入)
            权重值:(百分比,如50%,只需填写50)% *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/scoreList.zml b/Yangcai365_web/manage/zview/scoreList.zml new file mode 100644 index 0000000..371dc9a --- /dev/null +++ b/Yangcai365_web/manage/zview/scoreList.zml @@ -0,0 +1,360 @@ + + + +设计组件 + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +

            今日关注上升榜

            +
            +
            +
            +
            上升154位
            +
            + +
            39110
            +
            +
            +
            上升154位
            +
            + +
            39110
            +
            +
            +
            上升154位
            +
            + +
            39110
            +
            +
            +
            +
              +
            • +
              关键词
              +
              指数
              升降    
              +
            • +
            • +
              4
              关键词
              +
              16582
              55    
              +
            • +
            • +
              5
              关键词
              +
              16582
              55    
              +
            • +
            • +
              6
              关键词
              +
              16582
              55    
              +
            • +
            • +
              7
              关键词
              +
              16582
              55    
              +
            • +
            • +
              8
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              10
              关键词
              +
              16582
              55    
              +
            • +
            • +
              +
            • +
            +
            +
            +
            +
            +

            一周关注热门榜

            +
            +
            +
            +
            16582
            +
            + +
            39110
            +
            +
            +
            16582
            +
            + +
            39110
            +
            +
            +
            16582
            +
            + +
            39110
            +
            +
            +
            +
              +
            • +
              关键词
              +
              指数
              升降    
              +
            • +
            • +
              4
              关键词
              +
              16582
              55    
              +
            • +
            • +
              5
              关键词
              +
              16582
              55    
              +
            • +
            • +
              6
              关键词
              +
              16582
              55    
              +
            • +
            • +
              7
              关键词
              +
              16582
              55    
              +
            • +
            • +
              8
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              10
              关键词
              +
              16582
              55    
              +
            • +
            • +
              +
            • +
            +
            +
            +
            +
            + +
            +
            +
            + + + + + + + + + + + + + + +
            +
            +
            + 标签一标签二标签三 +
            +
              +
            • +
              排名
              关键词
              +
              指数
              升降位数
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            • +
              9
              关键词
              +
              16582
              55    
              +
            • +
            +
            +
            +
            + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/showLargeImg.zml b/Yangcai365_web/manage/zview/showLargeImg.zml new file mode 100644 index 0000000..8c0f224 --- /dev/null +++ b/Yangcai365_web/manage/zview/showLargeImg.zml @@ -0,0 +1,45 @@ + + +
            +
            + +
            +
            diff --git a/Yangcai365_web/manage/zview/sms/smsSendLog.zml b/Yangcai365_web/manage/zview/sms/smsSendLog.zml new file mode 100644 index 0000000..0f083cb --- /dev/null +++ b/Yangcai365_web/manage/zview/sms/smsSendLog.zml @@ -0,0 +1,63 @@ +${zhiqim_manager_breadcrumb("短信日志")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#for item : pageResult.list()> + + + + + + + + + + +
             短信日志列表
            订单号手机号发送状态发送时间报告状态报告描述短信内容
            暂不存在短信日志信息
            ${item.getDesignId()}${item.getMobile()} + <#if item.getSendStatus() ==0>发送成功 + <#if item.getSendStatus() ==1>发送失败 + <#if item.getSendStatus() ==2>未发送 + ${item.getSendTime()}${item.getRetStatus()}${item.getRetDesc()}${item.getContent()}
            +${zhiqim_manager_paging(pageResult, "/smsSendLog.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/after/designAfterCreateStatistics.zml b/Yangcai365_web/manage/zview/stat/after/designAfterCreateStatistics.zml new file mode 100644 index 0000000..fe52f9d --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/after/designAfterCreateStatistics.zml @@ -0,0 +1,244 @@ +<#def designatedPath="/personalRefundRateStat.htm"/> + + +${zhiqim_manager_breadcrumb("售后统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件:
            + + + +
            查询日期: + + + +
            +
            +
            +
            + + + + + + + + + + + +
            责任人售后单数损失金额订单金额售后金额占比
            暂时没有数据信息
            +
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/after/designAfterOrgStatistics.zml b/Yangcai365_web/manage/zview/stat/after/designAfterOrgStatistics.zml new file mode 100644 index 0000000..83dd360 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/after/designAfterOrgStatistics.zml @@ -0,0 +1,365 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("售后统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            查询日期: + + + +
            +
            +
            + +<#-- 分页列表--> + + + + + +
            +
            + + + + + + + + + + + + + + + + + + + + + +
            售后组织总定稿量总定稿金额售后单量售后单损失金额售后单金额售后&总定稿金额占比售后&总定稿量占比
            总计00000
            +
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/after/designAfterReasonStatistics.zml b/Yangcai365_web/manage/zview/stat/after/designAfterReasonStatistics.zml new file mode 100644 index 0000000..ec680d3 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/after/designAfterReasonStatistics.zml @@ -0,0 +1,287 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("售后统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            售后日期: +  - + + +
            +
            +
            + +<#-- 分页列表--> + + + + + +
            +
            + + + + + + + + + + + + + + + + + +
            售后原因单量单量占比损失金额订单金额损失&订单金额占比
            总计00000
            +
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/after/designAfterStatistics.zml b/Yangcai365_web/manage/zview/stat/after/designAfterStatistics.zml new file mode 100644 index 0000000..1764654 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/after/designAfterStatistics.zml @@ -0,0 +1,283 @@ +<#def designatedPath="/personalRefundRateStat.htm"/> + + +${zhiqim_manager_breadcrumb("售后统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件:
            + + + + <#if Validates.isNotEmpty(orgList)> + + + +
            查询日期: + + +  组  织 + + + +
            +
            +
            +
            + + + + + + + + + +
            责任人售后单数损失金额
            暂时没有数据信息
            +
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/after/personalAfterStatistics.zml b/Yangcai365_web/manage/zview/stat/after/personalAfterStatistics.zml new file mode 100644 index 0000000..1346e2b --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/after/personalAfterStatistics.zml @@ -0,0 +1,252 @@ +<#def designatedPath="/personalRefundRateStat.htm"/> + + +${zhiqim_manager_breadcrumb("售后统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件:
            + + + +
            查询日期: + + + +
            +
            +
            +
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/back/beforecauseChart.zml b/Yangcai365_web/manage/zview/stat/back/beforecauseChart.zml new file mode 100644 index 0000000..cccf99d --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/back/beforecauseChart.zml @@ -0,0 +1,103 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("退回原因统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            退回时间: + - + + +
            +
            +
            + + +<#-- 分页列表--> + + + + + +
            + + + + + + + + + <#for item : modelList> + + + + + + + + + + + + + + + +
            退回原因退回单数退回单数占比退回单金额退回单金额占比
            ${item.getBackCause()}${item.getBackCount()}${CalculationUtil.calculatePercent(item.getBackCount(),backMergeCount)}${Amounts.toYuan(item.getBackMoney())}${CalculationUtil.calculatePercent(item.getBackMoney(),backMergeMoney)}
            总计${backMergeCount}100%${Amounts.toYuan(backMergeMoney)}100%
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/back/draftOrderBackStat.zml b/Yangcai365_web/manage/zview/stat/back/draftOrderBackStat.zml new file mode 100644 index 0000000..bac7adf --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/back/draftOrderBackStat.zml @@ -0,0 +1,93 @@ + + +${zhiqim_manager_breadcrumb("审稿退回统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件:
            + + + + +
            初稿日期: + - + +   设计师: + +    +
            +
            +
            + + + + + + + + + <#for item : pageResult.list()> + + + + + + + + + <#if pageResult.list() == 0> + ${zhiqim_manager_no_record(5, "暂时没有统计信息")} + +
            序号设计师初稿数通过数通过率
            ${item_index + 1}${item.getDesigner()}${item.getOrderCount()}${item.getOrderPassCount()}${item.getPassRatio()}%
            + ${zhiqim_manager_paging(pageResult, "/draftOrderBackStat.htm")} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/back/draftOrderBackStatInfo.zml b/Yangcai365_web/manage/zview/stat/back/draftOrderBackStatInfo.zml new file mode 100644 index 0000000..4f920d8 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/back/draftOrderBackStatInfo.zml @@ -0,0 +1,35 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + + + +<#if infoPageResult.size() == 0> + + + + +<#for item : infoPageResult.list()> + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]退回单详情
            订单号旺旺号设计师产品金额退回原因初稿时间退回时间
            无退回订单信息
            ${item.getDesignId()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()}${Amounts.toYuan(item.getAmount())}${item.getDraftBackReason()}${Sqls.toDateTimeString(item.getDesignDraftTime())}${Sqls.toDateTimeString(item.getDraftBackTime())}
            +${zhiqim_manager_paging_jsMethod(infoPageResult, "draftOrderBackStatInfo")} diff --git a/Yangcai365_web/manage/zview/stat/back/endOrderBackStat.zml b/Yangcai365_web/manage/zview/stat/back/endOrderBackStat.zml new file mode 100644 index 0000000..7cdcb8e --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/back/endOrderBackStat.zml @@ -0,0 +1,93 @@ + + +${zhiqim_manager_breadcrumb("审稿退回统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件:
            + + + + +
            定稿日期: + - + +   设计师: + +    +
            +
            +
            + + + + + + + + + <#for item : pageResult.list()> + + + + + + + + + <#if pageResult.list() == 0> + ${zhiqim_manager_no_record(3, "暂时没有退回统计信息")} + +
            序号设计师定稿数通过数通过率
            ${item_index + 1}${item.getDesigner()}${item.getOrderCount()}${item.getOrderPassCount()}${item.getPassRatio()}%
            + ${zhiqim_manager_paging(pageResult, "/endOrderBackStat.htm")} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/back/endOrderBackStatInfo.zml b/Yangcai365_web/manage/zview/stat/back/endOrderBackStatInfo.zml new file mode 100644 index 0000000..abd043e --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/back/endOrderBackStatInfo.zml @@ -0,0 +1,35 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + + + +<#if infoPageResult.size() == 0> + + + + +<#for item : infoPageResult.list()> + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]退回单详情
            订单号旺旺号设计师产品金额退回原因定稿时间退回时间
            暂不存在退回订单信息
            ${item.getDesignId()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()}${Amounts.toYuan(item.getAmount())}${item.getEndBackReason()}${Sqls.toDateTimeString(item.getDesignEndTime())}${Sqls.toDateTimeString(item.getEndBackTime())}
            +${zhiqim_manager_paging_jsMethod(infoPageResult, "endOrderBackStatInfo")} diff --git a/Yangcai365_web/manage/zview/stat/back/orderBackEffectStat.zml b/Yangcai365_web/manage/zview/stat/back/orderBackEffectStat.zml new file mode 100644 index 0000000..ee75498 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/back/orderBackEffectStat.zml @@ -0,0 +1,90 @@ + + +${zhiqim_manager_breadcrumb("审稿退回统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件:
            + + + + +
            退回日期: + - + +   设计师: + +    +
            +
            +
            + + + + + + + <#for item : pageResult.list()> + + + + + + + <#if pageResult.list() == 0> + ${zhiqim_manager_no_record(3, "暂时没有退回统计信息")} + +
            序号设计师退回次数
            ${item_index + 1}${item.getKey()}${item.getValue()}
            + ${zhiqim_manager_paging(pageResult, "/orderBackEffectStat.htm")} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/back/orderBackEffectStatInfo.zml b/Yangcai365_web/manage/zview/stat/back/orderBackEffectStatInfo.zml new file mode 100644 index 0000000..fd82266 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/back/orderBackEffectStatInfo.zml @@ -0,0 +1,35 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + + + +<#if infoPageResult.size() == 0> + + + + +<#for item : infoPageResult.list()> + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]退回单详情
            订单号旺旺号设计师产品金额退回原因定稿时间退回时间
            暂不存在退回订单信息
            ${item.getDesignId()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()}${Amounts.toYuan(item.getAmount())}${item.getCheckBackReason()}${Sqls.toDateTimeString(item.getDesignEndTime())}${Sqls.toDateTimeString(item.getCreateLogTime())}
            +${zhiqim_manager_paging_jsMethod(infoPageResult, "doOrderBackEffectStatInfo")} diff --git a/Yangcai365_web/manage/zview/stat/back/sectionFinalizeCompleteStat.zml b/Yangcai365_web/manage/zview/stat/back/sectionFinalizeCompleteStat.zml new file mode 100644 index 0000000..57fc13a --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/back/sectionFinalizeCompleteStat.zml @@ -0,0 +1,117 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("部门退回统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            查询日期: + + + +
            +
            +
            + +<#-- 分页列表--> + + + + + +
            + + + + + + + + + + + + <#for item : statList> + + + + + + + + + + + + + + + + + + + +
            部门名称定稿数退回单数退回次数退回率定稿占比退回单金额
            ${item.getDeptName()}${item.getDeptFinalizeCount()}${item.getDeptBackCount()}${item.getDeptBackSum()}${CalculationUtil.calculatePercent(item.getDeptBackSum(),item.getDeptFinalizeCount())}${CalculationUtil.orgOrderPercent(item.getDeptFinalizeCount(),passOrderSum)}${Amounts.toYuanMustRadix(item.getDeptBackMoney())}
            总计${passOrderSum}${backSum}${backRepeatSum}${CalculationUtil.calculatePercent(backRepeatSum,passOrderSum)}${CalculationUtil.calculatePercent(passOrderSum,passOrderSum)}${Amounts.toYuanMustRadix(backAmountSum)}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/completeDesignRateStat.zml b/Yangcai365_web/manage/zview/stat/design/completeDesignRateStat.zml new file mode 100644 index 0000000..a5c0618 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/completeDesignRateStat.zml @@ -0,0 +1,123 @@ + + +${zhiqim_manager_breadcrumb("设计师定稿率统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件:
            + + + +
            接单日期: + - + + <#if isOrgRoot>  设计师: + + +    + 组织: + + +    + +
            +
            +
            + + + + + + + + <#for item : modelList> + + + + + + + <#if modelList.size() == 0> + ${zhiqim_manager_no_record(4, "暂时没有设计师定稿率统计信息")} + +
            设计师接单量定稿量定稿率
            ${item.getDesigner()}${item.getOrderNum()}${item.getOrderEndNum()}${item.getEndProportion()}%
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/completeOrderTimeliness.zml b/Yangcai365_web/manage/zview/stat/design/completeOrderTimeliness.zml new file mode 100644 index 0000000..02ddc90 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/completeOrderTimeliness.zml @@ -0,0 +1,149 @@ +<#def designatedPath="/draftStatusOrderStat.htm"/> + +${zhiqim_manager_breadcrumb("定稿时效统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            定稿日期: + - + + +
            +
            +
            + +<#-- 分页列表--> + +${zhiqim_manager_tr_title(1 , "定稿时效统计详情")} + + + <#for type : typeList> + <#if type.getTypeSeq() lte 9> + + + + + + + + + +<#for item : pageResult.list()> +bgcolor="#f3fdfc"> + + <#for type : typeList> + <#if type.getTypeSeq() lte 9> + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +${zhiqim_manager_paging(pageResult, "completeOrderTimeliness.htm")} +
            操作员${type.getTypeName()}其他总数量总时长平均耗时
            ${item.getDesigner()} + <#var num = item.getNumberMap().get(type.getTypeName())/> + <#var time =item.getTimeMap().get(type.getTypeName())/> + <#if num gt 0 && time gt 0> + +
            (${num}单) +
            + +
            + <#var num = item.getNumberMap().get(type.getTypeName())/> + <#var time =item.getTimeMap().get(type.getTypeName())/> + <#if num gt 0 && time gt 0> +
            (${item.getNumberMap().get("其他")}单) + +
            ${item.getAllCount()}
            暂无定稿时效统计详情
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/completeOrderTypeTimeliness.zml b/Yangcai365_web/manage/zview/stat/design/completeOrderTypeTimeliness.zml new file mode 100644 index 0000000..4c34f93 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/completeOrderTypeTimeliness.zml @@ -0,0 +1,105 @@ + +${zhiqim_manager_breadcrumb("定稿产品时效统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            定稿日期: + - + + +
            +
            +
            + +<#-- 分页列表--> + +${zhiqim_manager_tr_title(4, "定稿产品时效统计详情")} + + + + + + + +<#var allcount = 0/> +<#var allTime = 0/> +<#var typeMap = DesignTypeDao.mapAll()/> +<#for item : timelinessList> +bgcolor="#f3fdfc"> + + + + + +<#var allcount = allcount + item.getCount()/> +<#var allTime = allTime + item.getTime()/> + + +<#if timelinessList.size() == 0> +${zhiqim_manager_no_record(4, "暂无定稿产品时效统计详情")} +<#else> + + + + + + + +
            产品类型数量总时长平均耗时
            <#if Validates.isNotEmpty(typeMap) && typeMap.containsKey(item.getTypeId())>${typeMap.get(item.getTypeId()).getTypeName(item.getTypeId())}${item.getCount()}
            总计${allcount}
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/completeOrgRateStat.zml b/Yangcai365_web/manage/zview/stat/design/completeOrgRateStat.zml new file mode 100644 index 0000000..998291c --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/completeOrgRateStat.zml @@ -0,0 +1,98 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("组织定稿率统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            创建日期: + - + + +
            +
            +
            + +<#-- 分页列表--> + + + + + +
            + + + + + + + + <#for item : modelList> + + + + + + + +
            组织名称接单量定稿量定稿率
            ${item.getOrgName()}${item.getOrgOrderNum()}${item.getOrgOrderEndNum()}${item.getOrgEndProportion()}%
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/designFinalizeOrgCase.zml b/Yangcai365_web/manage/zview/stat/design/designFinalizeOrgCase.zml new file mode 100644 index 0000000..6cbde34 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/designFinalizeOrgCase.zml @@ -0,0 +1,121 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("组织定稿统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            查询日期: + + + +
            +
            +
            + +<#-- 分页列表--> + + + + + +
            + + + + + + + + + + + <#for item : orgCaseList> + + + + + + + + + + + + + + + + + + + +
            组织名称定稿数退回单数退回次数退回率定稿占比退回单金额
            ${item.getOrgName()}${item.getPassOrderCount()}${item.getBackOrderCount()}${item.getBackOrderRepeatCount()}${CalculationUtil.calculatePercent(item.getBackOrderRepeatCount(),item.getPassOrderCount())}${CalculationUtil.orgOrderPercent(item.getPassOrderCount(),passOrderSum)}${Amounts.toYuanMustRadix(item.getBackOrderMoneySum())}
            总计${passOrderSum}${backOrderSum}${backRepeatSum}${CalculationUtil.calculatePercent(backRepeatSum,passOrderSum)}${CalculationUtil.calculatePercent(passOrderSum,passOrderSum)}${Amounts.toYuanMustRadix(backAmountSum)}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/designOrderCountStat.zml b/Yangcai365_web/manage/zview/stat/design/designOrderCountStat.zml new file mode 100644 index 0000000..d9ef9b1 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/designOrderCountStat.zml @@ -0,0 +1,69 @@ +${zhiqim_manager_breadcrumb("设计总订单数量统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + +
            录单时间: + - + + + + +
            +
            +<#var typeList = DesignTypeDao.listAll()/> + +${zhiqim_manager_tr_title(13, "设计总订单数量统计")} + + + + <#if Validates.isNotEmpty(typeList)> + <#for type : typeList> + <#if type_index lte 9> + + + + +${zhiqim_manager_tr_no_record(list, 13, "设计总订单数量统计暂无信息")} +<#for item : list> +<#var typeMap = item.getTypeMap()/> + + + + <#if Validates.isNotEmpty(typeList)> + <#for type : typeList> + <#if type_index lte 9> + + + + + +
            日期总设计订单${type.getPrdTypeName()}其他
            ${item.getDate()}${item.getSumCount()}${typeMap.get(type.getTypeId())}${item.getSumCount() - item.getElseCount()}
            +${zhiqim_manager_list(list.size())} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/designOrderTypeStat.zml b/Yangcai365_web/manage/zview/stat/design/designOrderTypeStat.zml new file mode 100644 index 0000000..270adda --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/designOrderTypeStat.zml @@ -0,0 +1,90 @@ +<#def designatedPath="/draftStatusOrderStat.htm"/> + +${zhiqim_manager_breadcrumb("订单类型统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            定稿日期: + - + + +
            +
            +
            + +<#-- 分页列表--> + +${zhiqim_manager_tr_title(20,"订单类型统计详情")} + + + + + + + + + + + + + + + + + + + <#if ZmrPathRule.check(request, "/designOrderTypeStat.htm")> + + +<#for item : pageResult.list()> + + + + + + + + + + + + + + + + + + + <#if ZmrPathRule.check(request, "/designOrderTypeStat.htm")> + + + +<#if pageResult.size() == 0> + ${zhiqim_manager_no_record(20, "暂时没有订单类型统计信息")} + +
            设计师3-5款6-8款9-11款12款以上常规后加工特殊后加工支援订单 大金额  (100-150) 大金额  (150-200) 大金额  (200-250) 大金额  (250-300) 大金额  (300-350) 大金额  (350-400) 大金额  (400-450) 大金额  (450-500) 大金额  (500以上)奖励金额
            ${item.getDesigner()}${item.getMultiple3_5()}${item.getMultiple6_8()}${item.getMultiple9_11()}${item.getMultiple12()}${item.getNormalProcessing()}${item.getSpecialProcessing()}${item.getApplyOrder()}${item.getAmount100_150()}${item.getAmount150_200()}${item.getAmount200_250()}${item.getAmount250_300()}${item.getAmount300_350()}${item.getAmount350_400()}${item.getAmount400_450()}${item.getAmount450_500()}${item.getAmount500()}${Amounts.toYuan(item.getAmount())}
            +${zhiqim_manager_paging(pageResult, "/designOrderTypeStat.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/designerPerformance.zml b/Yangcai365_web/manage/zview/stat/design/designerPerformance.zml new file mode 100644 index 0000000..1cc31b9 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/designerPerformance.zml @@ -0,0 +1,107 @@ + +${zhiqim_manager_breadcrumb("设计师绩效统计")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件
            + + + + +
            定稿日期: + - + + +  设计师: +   + 组织: + + +    + +
            +
            +
            + + + + + + + + + + <#for item : pageModelList> + + + + + + +
            定稿总数:${endCount} 绩效总金额:${Amounts.toYuan(performanceCount)}元
            设计师定稿单数绩效
            ${item.getDesigner()}${item.getOrderEndCount()}${Amounts.toYuan(item.getDesignPerformance())}元
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/draftOrderConvert.zml b/Yangcai365_web/manage/zview/stat/design/draftOrderConvert.zml new file mode 100644 index 0000000..6deaa2f --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/draftOrderConvert.zml @@ -0,0 +1,105 @@ +<#def designatedPath="/draftStatusOrderStat.htm"/> + + +${zhiqim_manager_breadcrumb("初稿统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件:
            + + + + <#if Validates.isNotEmpty(orgList)> + + + +
            初稿日期: + - + + +  组  织 + + + +
            +
            +
            + + + + + + + <#for item : draftList> + + + + + + + <#if draftList.size() == 0> + ${zhiqim_manager_no_record(3, "暂时没有统计信息")} + <#else> + + + + + +
            序号设计师初稿单数
            ${item_index + 1}${item.getDesignName()}${item.getDraftOrderCount()}
            汇总${allDraftOrderCount}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/draftOrderOrgTimeliness.zml b/Yangcai365_web/manage/zview/stat/design/draftOrderOrgTimeliness.zml new file mode 100644 index 0000000..82e0f4e --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/draftOrderOrgTimeliness.zml @@ -0,0 +1,133 @@ +<#def designatedPath="/draftStatusOrderStat.htm"/> + +${zhiqim_manager_breadcrumb("初稿时效统计(组织)")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            初稿日期: + - + + +
            +
            +
            + +<#-- 分页列表--> + +${zhiqim_manager_tr_title( 2 , "初稿时效统计详情(组织)")} + + + <#for type : showTypeList> + + + + + + +<#for item : pageResult.list()> +bgcolor="#f3fdfc"> + + <#for type : showTypeList> + + + + + + + +<#if pageResult.size() == 0> + + + + +${zhiqim_manager_paging(pageResult, "draftOrderOrgTimeliness.htm")} +
            组织${type.getTypeName()}其他总数量
            + ${item.getOrgName()} + + <#var num = item.getNumberMap().get(type.getTypeName())/> + <#var time =item.getTimeMap().get(type.getTypeName())/> + <#if num gt 0 && time gt 0> +
            (${num}单) + +
            + <#if item.getNumberMap().get("其他") gt 0 && item.getTimeMap().get("其他") gt 0> +
            (${item.getNumberMap().get("其他")}单) + +
            ${item.getAllCount()}
            暂无初稿时效统计详情
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/draftOrderTimeliness.zml b/Yangcai365_web/manage/zview/stat/design/draftOrderTimeliness.zml new file mode 100644 index 0000000..f923efb --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/draftOrderTimeliness.zml @@ -0,0 +1,141 @@ +<#def designatedPath="/draftStatusOrderStat.htm"/> + +${zhiqim_manager_breadcrumb("初稿时效统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            初稿日期: + - + + +
            +
            +
            + +<#-- 分页列表--> + +${zhiqim_manager_tr_title( 1 , "初稿时效统计详情")} + + + <#for type : showTypeList> + + + + + + +<#for item : pageResult.list()> +bgcolor="#f3fdfc"> + + <#for type : showTypeList> + + + + + + + + + +<#if pageResult.size() == 0> + + + + +${zhiqim_manager_paging(pageResult, "draftOrderTimeliness.htm")} +
            设计师${type.getTypeName()}其他总数量
            ${item.getDesigner()} + <#var num = item.getNumberMap().get(type.getTypeName())/> + <#var time =item.getTimeMap().get(type.getTypeName())/> + <#if num gt 0 && time gt 0> + +
            (${num}单) +
            + +
            + <#if item.getNumberMap().get("其他") gt 0 && item.getTimeMap().get("其他") gt 0> +
            (${item.getNumberMap().get("其他")}单) + +
            ${item.getAllCount()}
            暂无初稿时效统计详情
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/draftOrderTypeTimeliness.zml b/Yangcai365_web/manage/zview/stat/design/draftOrderTypeTimeliness.zml new file mode 100644 index 0000000..76c72b1 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/draftOrderTypeTimeliness.zml @@ -0,0 +1,106 @@ + +${zhiqim_manager_breadcrumb("初稿产品时效统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            初稿日期: + - + + +
            +
            +
            + +<#-- 分页列表--> + +${zhiqim_manager_tr_title(4 , "初稿产品时效统计详情")} + + + + + + + +<#var allcount = 0/> +<#var allTime = 0/> +<#var typeMap = DesignTypeDao.mapAll()/> +<#for item : timelinessList> +bgcolor="#f3fdfc"> + + + + + +<#var allcount = allcount + item.getCount()/> +<#var allTime = allTime + item.getTime()/> + + +<#if timelinessList.size() == 0> +${zhiqim_manager_no_record(4, "暂无初稿产品时效统计详情")} +<#else> + + + + + + + +
            产品类型数量总时长平均耗时
            <#if Validates.isNotEmpty(typeMap) && typeMap.containsKey(item.getTypeId())>${typeMap.get(item.getTypeId()).getTypeName(item.getTypeId())}${item.getCount()}
            总计${allcount}
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/draftStatusOrderStat.zml b/Yangcai365_web/manage/zview/stat/design/draftStatusOrderStat.zml new file mode 100644 index 0000000..7ad2f2d --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/draftStatusOrderStat.zml @@ -0,0 +1,38 @@ +${zhiqim_manager_breadcrumb("未完成订单统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + +${zhiqim_manager_tr_title(6, "未完成订单统计列表")} + + + + + + + + +${zhiqim_manager_tr_no_record(list, 6, "暂无数据")} +<#for item : list> + + + + + + + + + +
            设计师未完成总数量48小时内3-7天内8-30天内30天以上
            ${item.getDesigner()}${item.getSumCount()}${item.getDayCount()}${item.getWeekCount()}${item.getMonthCount()}${item.getOtherCount()}
            +${zhiqim_manager_list(list.size())} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/inner/completeDesignRateStatInfo.zml b/Yangcai365_web/manage/zview/stat/design/inner/completeDesignRateStatInfo.zml new file mode 100644 index 0000000..682488b --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/inner/completeDesignRateStatInfo.zml @@ -0,0 +1,35 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#for item : pageResult.list()> + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]未定稿订单详情
            订单号旺旺号设计师产品订单状态进度备注领单时间初稿时间
            暂不存在未定稿订单信息
            ${item.getDesignId()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()}${StatusConstants.getStatus(item.getStatus())}${progressNoteMap.get(item.getDesignId())}${Sqls.toDateTimeString(item.getDesignBeginTime())}${Sqls.toDateTimeString(item.getDesignDraftTime())}
            +${zhiqim_manager_paging_jsMethod(pageResult, "doQueryDesignNotCompleteOrderInfo")} diff --git a/Yangcai365_web/manage/zview/stat/design/inner/completeOrderDetailInfo.zml b/Yangcai365_web/manage/zview/stat/design/inner/completeOrderDetailInfo.zml new file mode 100644 index 0000000..12704f8 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/inner/completeOrderDetailInfo.zml @@ -0,0 +1,74 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + + + +<#if passResult.size() == 0> + + + + +<#for item : passResult.list()> + + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]定稿订单详情
            订单号旺旺号设计师产品设计费份数领单时间初稿时间定稿时间折算单数
            暂不存在定稿订单信息
            ${item.getDesignId()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()}${item.getDesignCopies()}${Sqls.toDateTimeString(item.getDesignReceiveTime())}${Sqls.toDateTimeString(item.getDesignDraftTime())}${Sqls.toDateTimeString(item.getDesignEndTime())}${orderConvertMap.get(item.getDesignId())}
            +${zhiqim_manager_paging_jsMethod(passResult, "doQueryCompleteOrderDetailInfo")} + + + + + + + + + + + + + + + + + +<#if backResult.size() == 0> + + + + +<#for item : backResult.list()> + + + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]定稿退回订单详情
            订单号旺旺号设计师产品设计费份数定稿时间退回时间退回次数退回原因分类折算单数
            暂不存在定稿退回订单信息
            ${item.getDesignId()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()}${item.getDesignCopies()}${Sqls.toDateTimeString(item.getDesignEndTime())}${Sqls.toDateTimeString(item.getCheckTime())}${item.getBackOrderCount()}${item.getCheckBackReason()}${orderConvertMap.get(item.getDesignId())}
            +${zhiqim_manager_paging_jsMethod(backResult, "doQueryCompleteOrderDetailInfo")} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/inner/completeOrderTimelinessInfo.zml b/Yangcai365_web/manage/zview/stat/design/inner/completeOrderTimelinessInfo.zml new file mode 100644 index 0000000..eb9b6ff --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/inner/completeOrderTimelinessInfo.zml @@ -0,0 +1,30 @@ + + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#for item : pageResult.list()> + + + + + + + + + + + +${zhiqim_manager_paging(pageResult, "completeOrderTimelinessInfo.htm")} +
            订单号店铺旺旺状态产品定稿耗时录单时间定稿时间
            暂不存在清单信息
            ${item.getDesignId()}${item.getShopNick()}${item.getBuyerNick()}${StatusConstants.getStatus(item.getStatus())}${item.getOrderText()}${DateTimes.compareMinute(item.getDesignEndTime(), item.getDesignDraftTime())} 分钟${Sqls.toDateTimeString(item.getDesignDraftTime())}${Sqls.toDateTimeString(item.getDesignEndTime())}
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/inner/designerCompleteOrderInfo.zml b/Yangcai365_web/manage/zview/stat/design/inner/designerCompleteOrderInfo.zml new file mode 100644 index 0000000..fec397c --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/inner/designerCompleteOrderInfo.zml @@ -0,0 +1,53 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + +<#if console> + + + +<#else> + + + + + + + + + + + + + + + + + +<#if result.size() == 0> +2023-0 + + + +<#for item : result.list()> + + + + + + + + + + + + + +
            + 定稿日期: + - + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]订单详情  + + +
            订单号旺旺号设计师店铺设计类型产品设计费份数领单时间定稿时间订单绩效
            暂不存在定稿订单信息
            ${item.getDesignId()}${item.getBuyerNick()}${item.getDesigner()}${item.getShopNick()}${DraftConstants.get(item.getDraftType())}${item.getOrderText()}${item.getDesignCopies()}${Sqls.toDateTimeString(item.getDesignReceiveTime())}${Sqls.toDateTimeString(item.getDesignEndTime())}${CalculationUtil.getDesignerOrderPerformance(item,designer)}
            +${zhiqim_manager_paging_jsMethod(result, "doQueryCompleteOrderInfo")} diff --git a/Yangcai365_web/manage/zview/stat/design/inner/draftOrderConvertInfo.zml b/Yangcai365_web/manage/zview/stat/design/inner/draftOrderConvertInfo.zml new file mode 100644 index 0000000..19df417 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/inner/draftOrderConvertInfo.zml @@ -0,0 +1,33 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + + +<#if result.size() == 0> + + + + +<#for item : result.list()> + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]初稿订单详情
            订单号旺旺号设计师产品设计份数领单时间初稿时间
            暂不存在初稿订单信息
            ${item.getDesignId()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()}${item.getDesignCopies()}${Sqls.toDateTimeString(item.getDesignBeginTime())}${Sqls.toDateTimeString(item.getDesignDraftTime())}
            +${zhiqim_manager_paging_jsMethod(result, "doQueryDraftOrderStatInfo")} diff --git a/Yangcai365_web/manage/zview/stat/design/inner/draftOrderOrgTimelinessInfo.zml b/Yangcai365_web/manage/zview/stat/design/inner/draftOrderOrgTimelinessInfo.zml new file mode 100644 index 0000000..64e21e3 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/inner/draftOrderOrgTimelinessInfo.zml @@ -0,0 +1,73 @@ + + + +<#-- 分页列表--> + + + + <#for type : showTypeList> + + + + + + +<#for item : pageResult.list()> +bgcolor="#f3fdfc"> + + <#for type : showTypeList> + + + + + + + +<#if pageResult.size() == 0> + + + + +${zhiqim_manager_paging(pageResult, "draftOrderOrgTimelinessInfo.htm")} +
            设计师${type.getTypeName()}其他总数量
            ${item.getDesigner()} + <#var num = item.getNumberMap().get(type.getTypeName())/> + <#var time =item.getTimeMap().get(type.getTypeName())/> + <#if num gt 0 && time gt 0> +
            (${num}单) + +
            + <#if item.getNumberMap().get("其他") gt 0 && item.getTimeMap().get("其他") gt 0> +
            (${item.getNumberMap().get("其他")}单) + +
            ${item.getAllCount()}
            暂无初稿时效统计详情
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/inner/draftOrderTimelinessInfo.zml b/Yangcai365_web/manage/zview/stat/design/inner/draftOrderTimelinessInfo.zml new file mode 100644 index 0000000..5694e97 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/inner/draftOrderTimelinessInfo.zml @@ -0,0 +1,32 @@ + + + + + + + + + + + + +<#if pageResult.size() == 0> + + + + +<#for item : pageResult.list()> + + + + + + + + + + + + +${zhiqim_manager_paging(pageResult, "draftOrderTimelinessInfo.htm")} +
            订单号店铺旺旺状态产品录单时间初稿耗时领单时间初稿时间
            暂不存在清单信息
            ${item.getDesignId()}${item.getShopNick()}${item.getBuyerNick()}${StatusConstants.getStatus(item.getStatus())}${item.getOrderText()}${Sqls.toDateTimeString(item.getCreateTime())}${DateTimes.compareMinute(item.getDesignDraftTime(), item.getDesignReceiveTime())} 分钟${Sqls.toDateTimeString(item.getDesignReceiveTime())}${Sqls.toDateTimeString(item.getDesignDraftTime())}
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/inner/timeoutDesignerCompleteInfo.zml b/Yangcai365_web/manage/zview/stat/design/inner/timeoutDesignerCompleteInfo.zml new file mode 100644 index 0000000..c104397 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/inner/timeoutDesignerCompleteInfo.zml @@ -0,0 +1,45 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + + +<#if result.size() == 0> + + + + +<#var typeMap = DesignTypeDao.mapAll()/> +<#for item : pageResult.list()> +<#var effectiveTime = Validates.isEmpty(typeMap) ? 0 : ( typeMap.containsKey(item.getTypeId()) ? typeMap.get(item.getTypeId()).getEffectiveEndTime() : 0)/> + + + + + + + + + + + + + + +
            订单号旺旺号产品组织设计师订单状态进度备注领单时间初稿时间定稿时间超时时效
            暂不存在定稿超时订单信息
            ${item.getDesignId()}${item.getBuyerNick()}${item.getOrderText()}${ZmrOrgDao.getOrgName(request, item.getOrgId())}${item.getDesigner()}${StatusConstants.getStatus(item.getStatus())}${progressNoteMap.get(item.getDesignId())}${Sqls.toDateTimeString(item.getDesignBeginTime())}${Sqls.toDateTimeString(item.getDesignDraftTime())}${Sqls.toDateTimeString(item.getDesignEndTime())} + <#if item.getStatus() gte "55" > + ${CalculationUtil.dateTimeTran(DateTimes.compareMinute(item.getDesignEndTime(), item.getDesignBeginTime()) - effectiveTime)} + <#else> + ${CalculationUtil.dateTimeTran(DateTimes.compareMinute(Sqls.nowTimestamp(), item.getDesignBeginTime()) - effectiveTime)} + +
            +${zhiqim_manager_paging_jsMethod(pageResult, "doQueryCompleteTimeoutOrderInfo")} diff --git a/Yangcai365_web/manage/zview/stat/design/inner/timeoutDraftOrderInfo.zml b/Yangcai365_web/manage/zview/stat/design/inner/timeoutDraftOrderInfo.zml new file mode 100644 index 0000000..b8411ce --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/inner/timeoutDraftOrderInfo.zml @@ -0,0 +1,42 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + + + + + +<#if pageResult.list().size() == 0> + + + + +<#var typeMap = DesignTypeDao.mapAll()/> +<#for item : pageResult.list()> +<#var beforeTime = Validates.isNotEmpty(item.getDesignDraftTime()) ? item.getDesignDraftTime() : Sqls.nowTimestamp()/> +<#var effectiveTime = Validates.isEmpty(typeMap) ? 0 : (typeMap.containsKey(item.getTypeId()) ? typeMap.get(item.getTypeId()).getEffectiveTime() : 0)/> + + + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]初稿超时订单详情
            订单号旺旺号产品组织设计师进度备注状态领单时间初稿时间超时时长
            暂不存在初稿超时订单
            ${item.getDesignId()}${item.getBuyerNick()}${item.getOrderText()}${ZmrOrgDao.getOrgName(request, item.getOrgId())}${item.getDesigner()}${progressNoteMap.get(item.getDesignId())}${StatusConstants.getStatus(item.getStatus())}${Sqls.toDateTimeString(item.getDesignBeginTime())}${Sqls.toDateTimeString(item.getDesignDraftTime())}${CalculationUtil.dateTimeTran(DateTimes.compareMinute(beforeTime, item.getDesignBeginTime()) - effectiveTime)}
            +${zhiqim_manager_paging_jsMethod(pageResult, "doQueryTimeoutDraftOrder")} diff --git a/Yangcai365_web/manage/zview/stat/design/inner/timeoutMerDispatchInfo.zml b/Yangcai365_web/manage/zview/stat/design/inner/timeoutMerDispatchInfo.zml new file mode 100644 index 0000000..ee24da1 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/inner/timeoutMerDispatchInfo.zml @@ -0,0 +1,38 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + + + +<#if pageResult.list().size() == 0> + + + + +<#var typeMap = DesignTypeDao.mapAll()/> +<#for item : pageResult.list()> +<#var beforeTime = Validates.isNotEmpty(item.getOrgReceiveTime()) ? item.getOrgReceiveTime() : Sqls.nowTimestamp()/> +<#var effectiveTime = Validates.isEmpty(typeMap) ? 0 : (typeMap.containsKey(item.getTypeId()) ? typeMap.get(item.getTypeId()).getMerDispatchEffectiveTime() : 0)/> + + + + + + + + + + + +
             分拣超时订单详情
            订单号旺旺号状态产品行业录单时间分拣时间超时时长
            暂不存在分拣超时订单
            ${item.getDesignId()}${item.getBuyerNick()}${StatusConstants.getStatus(item.getStatus())}${item.getOrderText()}${Global.get(DesignIndustryCache.class).getIndustryName(item.getIndustryId())}${Sqls.toDateTimeString(item.getCreateTime())}${Sqls.toDateTimeString(item.getOrgReceiveTime())}${CalculationUtil.dateTimeTran(DateTimes.compareMinute(beforeTime, item.getCreateTime()) - effectiveTime)}
            +${zhiqim_manager_paging_jsMethod(pageResult, "doQueryTimeoutMerDispatchOrder")} diff --git a/Yangcai365_web/manage/zview/stat/design/orderAnalysis.zml b/Yangcai365_web/manage/zview/stat/design/orderAnalysis.zml new file mode 100644 index 0000000..f9833e3 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/orderAnalysis.zml @@ -0,0 +1,129 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/data.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("订单分析")} +${zhiqim_manager_content()} +<#-- 左侧功能 --> +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            + + +
            +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/design/timeoutDesignerComplete.zml b/Yangcai365_web/manage/zview/stat/design/timeoutDesignerComplete.zml new file mode 100644 index 0000000..d5f7017 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/timeoutDesignerComplete.zml @@ -0,0 +1,126 @@ + + + +${zhiqim_manager_breadcrumb("设计师定稿超时")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} + + + + + + + + + +
            +
            + + + +
            下单日期: + - + + +
            +
            +
            + + + + + + + + + <#for item : timeoutMap.keySet()> + + + + + + + + + +
            超时订单列表
            设计师超时订单
            ${item}${timeoutMap.get(item)}
            总计${timeoutOrderNumSum}
            +
            diff --git a/Yangcai365_web/manage/zview/stat/design/timeoutOrgComplete.zml b/Yangcai365_web/manage/zview/stat/design/timeoutOrgComplete.zml new file mode 100644 index 0000000..cc6bb15 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/design/timeoutOrgComplete.zml @@ -0,0 +1,123 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("组织定稿超时统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + + + +
            录单时间: + - + + 产品类型: +
            +
            +
            + +<#-- 分页列表--> + + + + + +
            + + <#if ZmrOrgDao.getOrgRootId(request) == sessionUser.getSelectedOrgId()> + + + + + + + <#for item : statList> + + + + + + + + <#else> + + + + + + + + <#for item : statList> + + + + + + + + + +
            组织名称组织总接单组织总超时(设计超时数)超时率(该组织超时/该组织总接单数)
            ${String.valueOf(item.get("orgName"))}${String.valueOf(item.get("orgOrderNum"))}${String.valueOf(item.get("orgTimeoutNum"))}${CalculationUtil.calculatePercent(Integer.valueOf(String.valueOf(item.get("orgTimeoutNum"))),Integer.valueOf(String.valueOf(item.get("orgOrderNum"))))}
            组织名称总订单数未超时已超时超时比例(组织超时/总单量)
            ${String.valueOf(item.get("orgName"))}${String.valueOf(item.get("orgOrderNum"))}${Integer.valueOf(String.valueOf(item.get("orgOrderNum"))) - Integer.valueOf(String.valueOf(item.get("orgTimeoutNum")))}${String.valueOf(item.get("orgTimeoutNum"))}${String.valueOf(item.get("orgTimeoutProportion"))}%
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/performance/designGroupPerformanceStat.zml b/Yangcai365_web/manage/zview/stat/performance/designGroupPerformanceStat.zml new file mode 100644 index 0000000..a0c01fc --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/performance/designGroupPerformanceStat.zml @@ -0,0 +1,215 @@ +<#def designatedPath="/draftStatusOrderStat.htm"/> + + +${zhiqim_manager_breadcrumb("定稿统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             查询条件:
            + + + +
            + 设计组选择: + + 查询日期: + + + +
            +
            +
            + + + + + + + + + <#for groupModule : groupPerformanceMap.values()> + + + + + + + + + <#if groupPerformanceMap.size() == 0> + ${zhiqim_manager_no_record(10, "暂时没有定稿统计信息")} + <#else> + + + + +
            设计组总定稿单数平均定稿单数人数总设计绩效
            ${groupModule.getGroup().getGroupName()}${groupModule.getGroupCompleteSum()}${groupModule.getGroupCompleteAvgCount()}${groupModule.getMembers().size()+(groupModule.getGroupLeader() != null ? 1 : 0)}${Amounts.toYuanMustRadix(groupModule.getGroupPerformanceAmount())}
            ${groupPerformanceMap.size()}条数据
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/performance/designerPerformanceStat.zml b/Yangcai365_web/manage/zview/stat/performance/designerPerformanceStat.zml new file mode 100644 index 0000000..9d111df --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/performance/designerPerformanceStat.zml @@ -0,0 +1,96 @@ +<#def designatedPath="/personalPerformanceStat.htm"/> +${zhiqim_manager_breadcrumb("设计师绩效统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            + 设计师: + + 查询日期: + + + +
            +
            +
            + +<#-- 分页列表--> +
            + +${zhiqim_manager_tr_title(20,"设计师绩效统计")} + + + + + + + + + + + + + + + + +<#for item : pageResult.list()> + + + + + + + + + + + + + <#var groupAmount=groupMap.get(item.getDesigner())/> + <#if groupAmount != null> + + <#else> + + + <#var amount=amountMap.get(item.getDesigner())/> + + + + +<#if pageResult.size() == 0> + ${zhiqim_manager_no_record(20, "暂时没有设计师绩效")} + + +${zhiqim_manager_paging(pageResult, "designerPerformanceStat.htm")} +
            设计师设计单数设计绩效特殊订单单数特殊订单绩效退款率退款绩效质检分质检绩效售后单数售后扣罚小组绩效绩效总额
            ${item.getDesigner()}${item.getDesignCompleteSum()}${Amounts.toYuan(item.getDesignAmount())}${item.getOrderTypeSum()}${Amounts.toYuan(item.getOrderTypeAmount())}${Amounts.toYuan(item.getRefundRate())}%${Amounts.toYuan(item.getRefundAmount())}${item.getQcScore()}${Amounts.toYuan(item.getQcAmount())}${item.getAfterCount()}-${Amounts.toYuan(item.getAfterLossAmount())}${Amounts.toYuan(groupAmount)}0${Amounts.toYuan(amount)}
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/performance/personalPerformanceStat.zml b/Yangcai365_web/manage/zview/stat/performance/personalPerformanceStat.zml new file mode 100644 index 0000000..fc3918e --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/performance/personalPerformanceStat.zml @@ -0,0 +1,138 @@ +<#def designatedPath="/personalPerformanceStat.htm"/> +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("个人绩效统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            + 查询日期: + + + +
            +
            + +<#-- 分页列表--> + + + + + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <#if stat.getIsGroupLeader() ==1> + + + + + + + + + +
            个人绩效统计表
            类别数值金额     (单位/元)
            设计${stat.getDesignCompleteSum()}${Amounts.toYuan(stat.getDesignAmount())}
            疑难订单${stat.getOrderTypeSum()}${Amounts.toYuan(stat.getOrderTypeAmount())}
            退款率${Amounts.toYuan(stat.getRefundRate())}%${Amounts.toYuan(stat.getRefundAmount())}
            质检绩效${stat.getQcScore()}${Amounts.toYuan(stat.getQcAmount())}
            售后扣罚${stat.getAfterCount()}-${Amounts.toYuan(stat.getAfterLossAmount())}
            小组绩效${groupBringAmount}
            总金额${amountSum}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/qc/inner/qcDisposeOrderInfo.zml b/Yangcai365_web/manage/zview/stat/qc/inner/qcDisposeOrderInfo.zml new file mode 100644 index 0000000..72297c7 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/qc/inner/qcDisposeOrderInfo.zml @@ -0,0 +1,57 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + + + + + +<#if pageResult.total() == 0> + + + + +<#for item : pageResult.list()> + + + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]质检违规订单
            订单号店铺旺旺号设计师产品派单类型录单时间质检时间质检状态操作
            暂不存在退款订单
            ${item.getDesignId()}${item.getShopNick()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()} + <#if item.getReceiveType() == 0>手动领单 + <#if item.getReceiveType() == 1>自动派单 + <#if item.getReceiveType() == 2>指定派单 + ${Sqls.toDateTimeString(item.getCreateTime())}${Sqls.toDateTimeString(item.getQcTime())} + <#if item.getQcFlag()==0>未质检 + <#if item.getQcFlag()==1>质检正常 + <#if item.getQcFlag()==2>质检违规 + <#if item.getQcFlag() == 2>
            +${zhiqim_manager_paging_jsMethod(pageResult, "doQueryQcDisposeInfo")} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/qc/inner/qcViolationsOrderInfo.zml b/Yangcai365_web/manage/zview/stat/qc/inner/qcViolationsOrderInfo.zml new file mode 100644 index 0000000..86f3a68 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/qc/inner/qcViolationsOrderInfo.zml @@ -0,0 +1,56 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + + + + + +<#if pageResult.total() == 0> + + + + +<#for item : pageResult.list()> + + + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]质检订单列表
            订单号店铺旺旺号设计师产品派单类型录单时间质检时间质检状态操作
            暂不存在质检违规订单
            ${item.getDesignId()}${item.getShopNick()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()} + <#if item.getReceiveType() == 0>手动领单 + <#if item.getReceiveType() == 1>自动派单 + <#if item.getReceiveType() == 2>指定派单 + ${Sqls.toDateTimeString(item.getCreateTime())}${Sqls.toDateTimeString(item.getQcTime())} + <#if item.getQcFlag()==1>质检正常 + <#if item.getQcFlag()==2>质检违规 +
            +${zhiqim_manager_paging_jsMethod(pageResult, "doQueryQcOrderInfo")} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/qc/qcDesignerStat.zml b/Yangcai365_web/manage/zview/stat/qc/qcDesignerStat.zml new file mode 100644 index 0000000..b7d9355 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/qc/qcDesignerStat.zml @@ -0,0 +1,133 @@ +<#def designatedPath="/qcReasonStat.htm"/> + + +${zhiqim_manager_breadcrumb("设计师质检统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件:
            + + + +
            查询日期: + + + + +
            +
            +
            + + + + + + + + + <#for item : modelList> + + + + + + + + + <#if modelList.size() == 0> + ${zhiqim_manager_no_record(5, "暂时没有质检统计信息")} + <#else> + + + + + + + +
            序号设计师质检分数好评加分违规扣分
            ${item_index + 1}${item.getDesigner()}${item.getQcScore()}${item.getRewardScore()}-${item.getPunishScore()}
            总计
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/qc/qcDisposeStat.zml b/Yangcai365_web/manage/zview/stat/qc/qcDisposeStat.zml new file mode 100644 index 0000000..794a359 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/qc/qcDisposeStat.zml @@ -0,0 +1,121 @@ +<#def designatedPath="/qcReasonStat.htm"/> + + +${zhiqim_manager_breadcrumb("质检处理统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件:
            + + + +
            查询日期: + - + + + +
            +
            +
            + + + + + + + + + <#for item : modelList> + + + + + + + + + <#if modelList.size() == 0> + ${zhiqim_manager_no_record(5, "暂时没有质检统计信息")} + <#else> + + + + + + + +
            序号处理人处理单数违规单数违规占比
            ${item_index + 1}${item.getOperatorCode()}${item.getQcCount()}${item.getViolationsCount()}${Maths.division(item.getViolationsCount()*100, item.getQcCount(), 2)}%
            总计
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/qc/qcReasonStat.zml b/Yangcai365_web/manage/zview/stat/qc/qcReasonStat.zml new file mode 100644 index 0000000..575711e --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/qc/qcReasonStat.zml @@ -0,0 +1,90 @@ +${Styles.htmlOverflowHidden()} +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("质检原因统计")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + + + + + + + +
            + + + + + + <#for item : map.entrySet()> + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 20, "没有质检订单")} +
            违规原因违规单数
            ${item.getKey()}${item.getValue()}
            +
            +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/stat/refund/designOrderRefundRateStat.zml b/Yangcai365_web/manage/zview/stat/refund/designOrderRefundRateStat.zml new file mode 100644 index 0000000..198d97d --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/refund/designOrderRefundRateStat.zml @@ -0,0 +1,138 @@ +<#def designatedPath="/personalRefundRateStat.htm"/> + + +${zhiqim_manager_breadcrumb("退款率统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件:
            + + + +
            接单日期: + - + + <#if isOrgRoot>  设计师: +   + 组织: + + +    + + +
            +
            +
            + + + + + + + + + + + <#for item : designerStatList> + + + + + + + + + + + <#if completeList.size() == 0> + ${zhiqim_manager_no_record(5, "暂时没有退款率统计信息")} + <#else> + + + + + + + + + + + +
            设计师设计单数设计金额退款单数退款金额退款率退款金额比例
            ${item.getDesigner()}${item.getSumCount()}${Amounts.toYuan(item.getFinalizeMoneySum())}${item.getRefundCount()}${Amounts.toYuan(item.getRefundMoneySum())}${Amounts.toYuan(item.getRefundRate())}%${CalculationUtil.designerRefundCalculate(item.getFinalizeMoneySum(),item.getRefundMoneySum())}
            总计${sum}${refundSum}<#if sum gt 0>${Maths.division(refundSum*100, sum, 1)}%<#else>0.0%${CalculationUtil.designerRefundCalculate(finalizeMoneyMerge,refundMoneyMerge)}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/refund/designOrderRefundStat.zml b/Yangcai365_web/manage/zview/stat/refund/designOrderRefundStat.zml new file mode 100644 index 0000000..e1477e1 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/refund/designOrderRefundStat.zml @@ -0,0 +1,94 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("订单退款统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            录单时间: + - + + +
            +
            +
            + +<#-- 分页列表--> + + + + + +
            + + + + + + + <#for key : map.keySet()> + + + + + + + + + + +
            订单类型单量百分比
            ${key}${map.get(key)}<#if allCount gt 0>${Maths.division(map.get(key)*100, allCount, 1)}%<#else>0.0%
            总单量${allCount}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/refund/designRefundOrgTotalStatistics.zml b/Yangcai365_web/manage/zview/stat/refund/designRefundOrgTotalStatistics.zml new file mode 100644 index 0000000..d3b76c8 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/refund/designRefundOrgTotalStatistics.zml @@ -0,0 +1,116 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("组织退款统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            查询日期: + + + +
            +
            +
            + +<#-- 分页列表--> + + + + + +
            + + + + + + + + + + + <#for item : refundOrgList> + + + + + + + + + + + + + + + + + + + +
            组织名称总接单量退款单量退款率退款金额总订单金额组织金额退款比例
            ${item.getOrgName()}${item.getOrgOrderCount()}${item.getOrgRefundCount()}${CalculationUtil.designerRefundCalculate(item.getOrgOrderCount(),item.getOrgRefundCount())}${Amounts.toYuan(item.getOrgRefundMoneySum())}${Amounts.toYuan(item.getOrgOrderMoneySum())}${CalculationUtil.designerRefundCalculate(item.getOrgOrderMoneySum(),item.getOrgRefundMoneySum())}
            总计${orgOrderMergeCount}${refundOrgMergeCount}${CalculationUtil.designerRefundCalculate(orgOrderMergeCount,refundOrgMergeCount)}${Amounts.toYuan(refundOrgMoneySum)}${Amounts.toYuan(orgOrderMoneySum)}${CalculationUtil.designerRefundCalculate(orgOrderMoneySum / 100,refundOrgMoneySum / 100)}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/refund/designRefundPrdTypeStatistics.zml b/Yangcai365_web/manage/zview/stat/refund/designRefundPrdTypeStatistics.zml new file mode 100644 index 0000000..980afb0 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/refund/designRefundPrdTypeStatistics.zml @@ -0,0 +1,116 @@ +${Scripts.src("/zinc/chart/highcharts.js")} +${Scripts.src("/zinc/chart/exporting.js")} +${Scripts.src("/zinc/chart/highcharts-zh_CN.js")} + +${zhiqim_manager_breadcrumb("产品退款统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("查询条件")} +
            + + + + +
            查询日期: + + + +
            +
            +
            + +<#-- 分页列表--> + + + + + +
            + + + + + + + + + + + <#for item : refundPrdTypeList> + + + + + + + + + + + + + + + + + + + +
            产品名称总单量退款单量退款率退款金额总订单金额产品金额退款比例
            ${item.getPrdName()}${item.getPrdOrderCount()}${item.getPrdRefundCount()}${CalculationUtil.designerRefundCalculate(item.getPrdOrderCount(),item.getPrdRefundCount())}${Amounts.toYuan(item.getPrdRefundMoneySum())}${Amounts.toYuan(item.getPrdOrderMoneySum())}${CalculationUtil.designerRefundCalculate(item.getPrdOrderMoneySum(),item.getPrdRefundMoneySum())}
            总计${prdTypeOrderMergeCount}${refundPrdTypeMergeCount}${CalculationUtil.designerRefundCalculate(prdTypeOrderMergeCount,refundPrdTypeMergeCount)}${Amounts.toYuan(refundPrdTypeMoneySum)}${Amounts.toYuan(prdTypeOrderMoneySum)}${CalculationUtil.designerRefundCalculate(prdTypeOrderMoneySum / 100,refundPrdTypeMoneySum / 100)}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/refund/inner/designOrderRefundRateStatInfo.zml b/Yangcai365_web/manage/zview/stat/refund/inner/designOrderRefundRateStatInfo.zml new file mode 100644 index 0000000..63a36ef --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/refund/inner/designOrderRefundRateStatInfo.zml @@ -0,0 +1,74 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + + + + +<#if refundResult.total == 0> + + + + +<#for item : responsibleRefundResult.list()> + + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]有责退款订单
            订单号店铺旺旺号设计师产品订单金额领单时间退款时间退款原因
            暂不存在退款订单
            ${item.getDesignId()}${item.getShopNick()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()}${Amounts.toYuan(item.getAmount())}${Sqls.toDateTimeString(item.getDesignReceiveTime())}${item.getRefundTime()}${Global.get(DesignOrderRefundReasonCache.class).getName(item.getRefundReason())}
            +${zhiqim_manager_paging_jsMethod(responsibleRefundResult, "doQueryRefundOrderInfo")} + + + + + + + + + + + + + + + + +<#if refundResult.total == 0> + + + + +<#for item : noResponsibleRefundResult.list()> + + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]无责退款订单
            订单号店铺旺旺号设计师产品订单金额领单时间退款时间退款原因
            暂不存在退款订单
            ${item.getDesignId()}${item.getShopNick()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()}${Amounts.toYuan(item.getAmount())}${Sqls.toDateTimeString(item.getDesignReceiveTime())}${item.getRefundTime()}${Global.get(DesignOrderRefundReasonCache.class).getName(item.getRefundReason())}
            +${zhiqim_manager_paging_jsMethod(noResponsibleRefundResult, "doQueryRefundOrderInfo")} + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/refund/personalRefundComplaint.zml b/Yangcai365_web/manage/zview/stat/refund/personalRefundComplaint.zml new file mode 100644 index 0000000..2a25bad --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/refund/personalRefundComplaint.zml @@ -0,0 +1,84 @@ + + + +${zhiqim_manager_content()} +
            + +
            +
            +
            +
            +
            + +     +
            +
            +

            +${zhiqim_manager_content_end()} + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/refund/personalRefundRateStat.zml b/Yangcai365_web/manage/zview/stat/refund/personalRefundRateStat.zml new file mode 100644 index 0000000..f02ab41 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/refund/personalRefundRateStat.zml @@ -0,0 +1,172 @@ +<#def designatedPath="/personalRefundRateStat.htm"/> + + +${zhiqim_manager_breadcrumb("设计退款率统计")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +
            +
            + + + + +
             统计查询条件:
            + + + +
            查询日期: + - + + + +
            +
            +
            + + + + + + + + + <#if refundList.size() == 0> + ${zhiqim_manager_no_record(5, "暂时没有退款率统计信息")} + <#else> + + + + + + + + +
            设计师设计单数退款单数退款率奖罚金
            ${designer}${list.size()}${refundResult.total}<#if list.size() gt 0>${Maths.division(refundResult.total()*100, list.size(), 1)}%<#else>0.0%${Amounts.toYuan(amount)}
            +
            + + + + + + + + + + + + + + + + + + +<#if refundResult.size() == 0> + + + + +<#for item : refundResult.list()> + + + + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]退款订单
            订单号店铺旺旺号设计师产品派单类型领单时间退款时间申诉状态申诉退回原因操作
            暂不存在退款订单
            ${item.getDesignId()}${item.getShopNick()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()} + <#if item.getReceiveType() == 0>手动领单 + <#if item.getReceiveType() == 1>自动派单 + <#if item.getReceiveType() == 2>指定派单 + ${Sqls.toDateTimeString(item.getDesignReceiveTime())}${item.getRefundTime()} + <#if item.getComplaintFlag()==0>未申诉 + <#if item.getComplaintFlag()==1>申诉成功 + <#if item.getComplaintFlag()==2>申诉失败 + <#if item.getComplaintFlag()==3>申诉中 + ${item.getComplaintBackReason()}<#if item.getComplaintFlag() == 0 || item.getComplaintFlag() == 2>
            +${zhiqim_manager_paging(refundResult, "personalRefundRateStat.htm")} + + + + + + + + + + + + + + + + +<#if passResult.size() == 0> + + + + +<#for item : passResult.list()> + + + + + + + + + + + + +
             <#if Validates.isNotEmpty(designer)>[${designer}]退款申诉通过订单
            订单号店铺旺旺号设计师产品派单类型领单时间退款时间申诉状态
            暂不存在退款申诉通过订单
            ${item.getDesignId()}${item.getShopNick()}${item.getBuyerNick()}${item.getDesigner()}${item.getOrderText()} + <#if item.getReceiveType() == 0>手动领单 + <#if item.getReceiveType() == 1>自动派单 + <#if item.getReceiveType() == 2>指定派单 + ${Sqls.toDateTimeString(item.getDesignReceiveTime())}${item.getRefundTime()} + <#if item.getComplaintFlag()==0>未申诉 + <#if item.getComplaintFlag()==1>申诉成功 + <#if item.getComplaintFlag()==2>申诉失败 + <#if item.getComplaintFlag()==3>申诉中 +
            +${zhiqim_manager_paging(passResult)} + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/subscribe/subscribeStat.zml b/Yangcai365_web/manage/zview/stat/subscribe/subscribeStat.zml new file mode 100644 index 0000000..287aae9 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/subscribe/subscribeStat.zml @@ -0,0 +1,85 @@ + + +${zhiqim_manager_breadcrumb("订单预约统计")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 列表 --> + + + + +
            当前组织:${currentOrgName}          设计师总人数:${operatorNum}          设计师预约总人数:${subscribeOperatorNum}          预约总单量:${subscribeSum}          接单总单量:${finishSum}
            + + + + + + +
            + + + + + + + + + + + + + +<#for item : list> +<#if item_index % 7 == 0> + + + +<#if item_index % 7 == 6> + + + +
            选中日期:${selectedDay}
            周日周一周二周三周四周五周六
            style="background-color:#f5f5f5;" <#if item.getDutyTime() == selectedDay>style="border: 1px solid #00a2eb;"> +
            + ${item.getDay()}号 + <#if item.getDutyTime() == today> + + +
            +
            +
            + + + + + + + + + + <#for item : subscribeDesignerQuotaRecordList> + + + + + + + + + + +
            设计师名称预约单量接单数量定稿数量接单时长状态
            ${item.getOperatorCode()}${item.getSubscribeNum()}${item.getFinishedNum()}${item.getDingGaoSum()}<#if item.getJieDanOnlineTime()/60 gt 0>${item.getJieDanOnlineTime()/60}小时${item.getJieDanOnlineTime()%60}分钟<#if item.getSubscribeState() ==2 >已预约<#if item.getSubscribeState() !=2 >未预约
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/stat/subscribe/subscribeStatAll.zml b/Yangcai365_web/manage/zview/stat/subscribe/subscribeStatAll.zml new file mode 100644 index 0000000..a97d5f8 --- /dev/null +++ b/Yangcai365_web/manage/zview/stat/subscribe/subscribeStatAll.zml @@ -0,0 +1,90 @@ + + +${zhiqim_manager_breadcrumb("订单预约统计")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 列表 --> + + + + +
            组织数量:${zmrOrgModelList.size()}          设计师预约总人数:${allSubscribeOperatorNum}          预约总单量:${allSubscribeSum}          接单总单量:${allFinishSum}
            + + + + + + +
            + + + + + + + + + + + + + +<#for item : list> +<#if item_index % 7 == 0> + + + +<#if item_index % 7 == 6> + + + +
            选中日期:${selectedDay}
            周日周一周二周三周四周五周六
            style="background-color:#f5f5f5;" <#if item.getDutyTime() == selectedDay>style="border: 1px solid #00a2eb;"> +
            + ${item.getDay()}号 + <#if item.getDutyTime() == today> + + +
            +
            +
            + + + + + + + + + + <#for item : zmrOrgModelList> + + + + + + + + + + +
            组织名称设计师总人数设计师预约总人数预约总单量接单总单量进度
            ${item.getOrgName()}${item.getOperatorNum()}${item.getSubscribeOperatorNum()}${item.getSubscribeSum()}${item.getFinishSum()} +
            +
            +
            + +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/subscribe/designerSubscribe.zml b/Yangcai365_web/manage/zview/subscribe/designerSubscribe.zml new file mode 100644 index 0000000..fdfd58a --- /dev/null +++ b/Yangcai365_web/manage/zview/subscribe/designerSubscribe.zml @@ -0,0 +1,111 @@ + + +${zhiqim_manager_breadcrumb("订单预约")} +${zhiqim_manager_content()} +<#-- 列表 --> + + + + + +
            设计师:${operatorCode}           等级:${designerLever}           最大预约单量:${maxQuota}           近20次预约总接单:${sumFinishedNum20}           近20次预约平均接单量:${avgFinishedNum20}            近20次预约达成率:${okRate20} + + < + ${year}年 + > + < + ${month}月 + > +
            + +<#-- 列表 --> + + + + + + + + + + +<#for item : list> +<#if item_index % 7 == 0> + + + +<#if item_index % 7 == 6> + + + +
            周日周一周二周三周四周五周六
            style="background-color:#f5f5f5;"> + +
            + ${item.getDay()}号 ${item.getLunarDay()} + <#if item.getSubscribeState() == 1> + + <#elseif item.getSubscribeState() == 2 && (item.getFinishedNum() lt item.getSubscribeNum())> + + <#elseif item.getSubscribeState() == 2> + + <#else> + + +
            +
            + <#if item.getSubscribeState() == 1 && item.getDutyTime() lt today> +
            未预约

            + <#elseif item.getSubscribeState() == 1 && item.getDutyTime() == today && hour gt 7 > +
            未预约

            + <#elseif item.getSubscribeState() == 1 && item.getDutyTime() == today && hour lt 8 > +
            点击预约订单>>

            + <#elseif item.getSubscribeState() == 1 && item.getCanSubscribe()==1 > +
            点击预约订单>>

            + <#elseif item.getSubscribeState() == 2> + onclick="showToggle(${item.getDutyTime()},${item.getSubscribeNum()},'${item.getRecordId()}');" >预约单数:${item.getSubscribeNum()}单
            接单数:${item.getFinishedNum()}单 + +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/subscribe/menu.zml b/Yangcai365_web/manage/zview/subscribe/menu.zml new file mode 100644 index 0000000..63688cd --- /dev/null +++ b/Yangcai365_web/manage/zview/subscribe/menu.zml @@ -0,0 +1,62 @@ +<#def designatedPath="/zhiqimOrdermeal/ordermeal.htm"/> +${zhiqim_manager_breadcrumb("菜单信息")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + +${zhiqim_manager_tr_no_record(result, 5, "没有菜单信息")} +<#for item : result.list()> + + + + + + + + +
            选择点餐日期点餐星期点餐类型菜单
            ${item.getOrdermealMenuDate()}${DateTimes.getDateWeekString(item.getOrdermealMenuDate())} + <#if item.getOrdermealType() == 0>中餐 + <#if item.getOrdermealType() == 1>晚餐 + ${item.getOrdermealMenu()}
            +${zhiqim_manager_paging (result, "menu.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/subscribe/menuAdd.zml b/Yangcai365_web/manage/zview/subscribe/menuAdd.zml new file mode 100644 index 0000000..de066c4 --- /dev/null +++ b/Yangcai365_web/manage/zview/subscribe/menuAdd.zml @@ -0,0 +1,30 @@ +<#def designatedPath="/zhiqimOrdermeal/ordermeal.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("menu.htm")} + +${zhiqim_manager_breadcrumb_parent("menu.htm", "菜单信息", "增加菜单")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + +
            增加菜单
            日期:(请选择日期)
            点餐类型:(中餐|晚餐) +   中餐     +   晚餐     +
            菜单:(请填写菜单) *
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/subscribe/menuModify.zml b/Yangcai365_web/manage/zview/subscribe/menuModify.zml new file mode 100644 index 0000000..266c315 --- /dev/null +++ b/Yangcai365_web/manage/zview/subscribe/menuModify.zml @@ -0,0 +1,31 @@ +<#def designatedPath="/zhiqimOrdermeal/ordermeal.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("menu.htm")} + +${zhiqim_manager_breadcrumb_parent("menu.htm", "菜单信息", "修改菜单")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + +
            修改菜单
            日期:(请选择日期)
            点餐类型:(中餐|晚餐) + checked>  中餐     + checked>  晚餐     * +
            菜单:(请填写菜单) *
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/subscribe/subscribeOrgTempQuota.zml b/Yangcai365_web/manage/zview/subscribe/subscribeOrgTempQuota.zml new file mode 100644 index 0000000..7cc0102 --- /dev/null +++ b/Yangcai365_web/manage/zview/subscribe/subscribeOrgTempQuota.zml @@ -0,0 +1,70 @@ +${zhiqim_manager_breadcrumb("派单属性")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> + +
            + + + +
            + + + + + + + + + + +<#if pageResult.total() == 0> +${zhiqim_manager_no_record(13, "暂时没有临时额度配置信息")} + + +<#for item : pageResult.list()> + + + + + + + +
             临时额度配置
            选择组织名称临时额度操作
            + <#for org : orgList> + <#if item.getOrgId()==org.getOrgId()>${org.getOrgName()} + + ${item.getTempQuota()} + <#if item.getState() == 1> + + <#else> + + +
            + +${zhiqim_manager_paging(pageResult, "/subscribeOrgTempQuota.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/subscribe/subscribeOrgTempQuotaAdd.zml b/Yangcai365_web/manage/zview/subscribe/subscribeOrgTempQuotaAdd.zml new file mode 100644 index 0000000..d39f2ca --- /dev/null +++ b/Yangcai365_web/manage/zview/subscribe/subscribeOrgTempQuotaAdd.zml @@ -0,0 +1,38 @@ + +${request.getValidateScript()} +${zhiqim_manager_history("/subscribeOrgTempQuota.htm")} +${zhiqim_manager_breadcrumb_parent("/subscribeOrgTempQuota.htm", "临时额度配置", "增加临时额度配置")} +${zhiqim_manager_content()} + +${zhiqim_manager_title("新增临时额度配置")} +
            + + + + + + + + + +
            + 组织: + + +
            + 临时额度: + + +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/subscribe/subscribeOrgTempQuotaModify.zml b/Yangcai365_web/manage/zview/subscribe/subscribeOrgTempQuotaModify.zml new file mode 100644 index 0000000..6e80d24 --- /dev/null +++ b/Yangcai365_web/manage/zview/subscribe/subscribeOrgTempQuotaModify.zml @@ -0,0 +1,36 @@ + +${request.getValidateScript()} +${zhiqim_manager_history("/subscribeOrgTempQuota.htm")} +${zhiqim_manager_breadcrumb_parent("/subscribeOrgTempQuota.htm", "临时额度配置", "修改临时额度配置")} +${zhiqim_manager_content()} + +${zhiqim_manager_title("修改临时额度配置")} +
            + + + + + + + + + +
            + 组织: + + + ${org.getOrgName()} + +
            + 临时额度: + + +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/afterPicType.zml b/Yangcai365_web/manage/zview/sys/afterPicType.zml new file mode 100644 index 0000000..f23b5ae --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/afterPicType.zml @@ -0,0 +1,44 @@ +<#def designatedPath="/afterPicType.htm"/> + + +${zhiqim_manager_breadcrumb("售后参数管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + +<#if Lists.size(dataList) == 0> +${zhiqim_manager_no_record(6, "暂时没有数据信息")} + +<#for item : dataList> + + + + + + + +
            选项类型ID名称状态
            ${item.getPicType()}${item.getPicTypeName()}<#if item.getPicStatus() == 0>正常<#else>停用
            +${zhiqim_manager_list(dataList.size())} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/afterPicTypeAdd.zml b/Yangcai365_web/manage/zview/sys/afterPicTypeAdd.zml new file mode 100644 index 0000000..929441a --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/afterPicTypeAdd.zml @@ -0,0 +1,32 @@ +<#def designatedPath="/afterPicType.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("afterPicType.htm")} +${zhiqim_manager_breadcrumb_parent("afterPicType.htm", "售后责任类型", "增加责任类型")} +${zhiqim_manager_content()} + + + +
            + + + + + + + + + + + + +
            增加责任归属
            责任归属名称:(64位不定长字符) *
            状态:(请选择) +  * +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/afterPicTypeModify.zml b/Yangcai365_web/manage/zview/sys/afterPicTypeModify.zml new file mode 100644 index 0000000..13d7b43 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/afterPicTypeModify.zml @@ -0,0 +1,36 @@ +<#def designatedPath="/afterPicType.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("afterPicType.htm")} +${zhiqim_manager_breadcrumb_parent("afterPicType.htm", "售后责任类型", "修改责任类型")} +${zhiqim_manager_content()} + + + +
            + + + + + + + + + + + + +
            修改责任归属
            责任归属名称:(64位不定长字符) + + +  * +
            状态:(请选择) +  * +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/afterProblemType.zml b/Yangcai365_web/manage/zview/sys/afterProblemType.zml new file mode 100644 index 0000000..9236c7f --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/afterProblemType.zml @@ -0,0 +1,46 @@ +<#def designatedPath="/afterPicType.htm"/> + + +${zhiqim_manager_breadcrumb("售后参数管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + +<#if Lists.size(pageResult.list()) == 0> +${zhiqim_manager_no_record(6, "暂时没有数据信息")} + +<#for item : pageResult.list()> + + + + + + + + +
            选项类型ID名称责任类型状态
            ${item.getProblemType()}${item.getProblemName()}${picNameMap.get(item.getPicType())}<#if item.getProblemStatus() == 0>正常<#else>停用
            +${zhiqim_manager_paging(pageResult, "afterProblemType.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/afterProblemTypeAdd.zml b/Yangcai365_web/manage/zview/sys/afterProblemTypeAdd.zml new file mode 100644 index 0000000..95f7b72 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/afterProblemTypeAdd.zml @@ -0,0 +1,46 @@ +<#def designatedPath="/afterPicType.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("afterProblemType.htm")} +${zhiqim_manager_breadcrumb_parent("afterProblemType.htm", "售后问题类型", "增加问题类型")} +${zhiqim_manager_content()} + + + +
            + + + + + + + + + + + + + + + + +
            增加售后问题
            责任归属:(请选择) + + +
            售后问题名称:(64位不定长字符) *
            状态:(请选择) +  * +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/afterProblemTypeModify.zml b/Yangcai365_web/manage/zview/sys/afterProblemTypeModify.zml new file mode 100644 index 0000000..236d8be --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/afterProblemTypeModify.zml @@ -0,0 +1,48 @@ +<#def designatedPath="/afterPicType.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("afterProblemType.htm")} +${zhiqim_manager_breadcrumb_parent("afterProblemType.htm", "售后问题类型", "修改问题类型")} +${zhiqim_manager_content()} + + + +
            + + + + + + + + + + + + + + + + + +
            修改售后问题
            责任归属:(请选择) + + +
            售后问题名称:(64位不定长字符) *
            状态:(请选择) +  * +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/apiInvokeLog.zml b/Yangcai365_web/manage/zview/sys/apiInvokeLog.zml new file mode 100644 index 0000000..1339b25 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/apiInvokeLog.zml @@ -0,0 +1,151 @@ +<#def designatedPath="/orderMerchantList.htm"/> +${zhiqim_manager_breadcrumb("商家管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            +${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + +
            用户IP:用户名称:创建时间: -  + + 接口名称: +
            状态码:结果描述: + +
            +
            +<#-- 列表 --> + + + + + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有数据信息")} +<#for item : pageResult.list()> + + + + + + + + + + + + +
            选择用户名用户IP接口名错误编号调用结果结果描述/错误原因创建时间操作
            ${item.getRemoteUser()}${item.getRemoteIp()}${item.getApiName()}${item.getErrorId()}<#if item.getStatusCode() gt 0>失败<#else>成功 +
            + ${item.getInvokeMessage()} +
            +
            ${item.getCreateTime()} + <#if Validates.isNotEmptyBlank(item.getInvokeStackTrace())> + + <#var stackTrace= item.getInvokeStackTrace()/> + ${stackTrace} + + +
            +${zhiqim_manager_paging(pageResult, "apiInvokeLog.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/businessParam.zml b/Yangcai365_web/manage/zview/sys/businessParam.zml new file mode 100644 index 0000000..481618a --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/businessParam.zml @@ -0,0 +1,59 @@ +${sweet_alert_reuse_method()} +${zhiqim_manager_breadcrumb("公共参数")} +${zhiqim_manager_content()} + + + +<#-- 导航 --> +
            + +
            + +<#for group : ParamDao.doQueryBusinessParam().entrySet()> + +${zhiqim_manager_tr_title(4, "业务参数["+group.getKey()+"]列表")} + + + + + +${zhiqim_manager_tr_no_record(group.getValue(), 3, "暂时没有业务参数信息")} +
            业务配置描述业务配置值操作
            +<#for item : group.getValue().values()> +
            + + + + + + + + +
            ${item.getParamDesc()}
            +
            + + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/checkBackReasonList.zml b/Yangcai365_web/manage/zview/sys/checkBackReasonList.zml new file mode 100644 index 0000000..438ba65 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/checkBackReasonList.zml @@ -0,0 +1,256 @@ +${zhiqim_manager_breadcrumb("字段参数")} +${zhiqim_manager_content()} +${sweet_alert_reuse_method()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + +
            + + + + + + <#for item : catList> + style="background-color:#eaeaff;"> + + + + + <#if catList.size() == 0> + + + + +
            序号类型名称
            ${item_index+1}${item.getReasonText()}
            暂时没有数据信息
            +
            + + + + + + + <#for item : reasonList> + + + + + + <#if Validates.isEmpty(reasonList) || reasonList.size() == 0> + + + + +
            序号名称操作
            ${item_index+1}${item.getReasonText()} + + +
            暂时没有数据信息
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/deptOrg.zml b/Yangcai365_web/manage/zview/sys/deptOrg.zml new file mode 100644 index 0000000..6475090 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/deptOrg.zml @@ -0,0 +1,38 @@ +${request.getValidateScript()} + + + + + + + + + +
            选择组织: + +  *
            +<#-- 操作 --> +
            +   + +
            diff --git a/Yangcai365_web/manage/zview/sys/deptTeam.zml b/Yangcai365_web/manage/zview/sys/deptTeam.zml new file mode 100644 index 0000000..477621f --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/deptTeam.zml @@ -0,0 +1,59 @@ +${Styles.htmlOverflowHidden()} + + +<#-- 查询 --> +
            +
            + + + +
            +
            + +<#-- 列表 --> +
            + + + + + + + +${zhiqim_manager_tr_no_record(operatorList, 4, "没有可选择的操作员")} +<#for item : operatorList> + + + + + + + + + + +<#-- 操作 --> +
            + + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/designGroup.zml b/Yangcai365_web/manage/zview/sys/designGroup.zml new file mode 100644 index 0000000..a46b927 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/designGroup.zml @@ -0,0 +1,43 @@ +${zhiqim_manager_breadcrumb("设计组管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> +
            操作员头像操作员编码操作员姓名
            ${item.getOperatorCode()}${item.getOperatorName()}
            + + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有设计组")} +<#for item : pageResult.list()> + + + + + + + + + + +
            选择所属组织设计组名称当月组长下月组长创建时间排序
            ${ZmrOrgDao.getOrgName(request, item.getOrgId())}#{item.getGroupName()}${currLeaderMap.get(Strings.valueOf(item.getGroupId())).getUserCode()}${nextLeaderMap.get(Strings.valueOf(item.getGroupId())).getUserCode()}${Sqls.toDateString(item.getCreateTime())}${item.getGroupSeq()}
            +${zhiqim_manager_paging(pageResult, "designGroup.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/designGroupAdd.zml b/Yangcai365_web/manage/zview/sys/designGroupAdd.zml new file mode 100644 index 0000000..df465b6 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/designGroupAdd.zml @@ -0,0 +1,47 @@ +${zhiqim_manager_history("designGroup.htm")} +${request.getValidateScript()} + + +${zhiqim_manager_breadcrumb_parent("designGroup.htm" "设计组管理" "增加设计组")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + +
            增加设计组
            组织:${org.getOrgName()}
            组名称:(请填写) *
            组长:(正常|停用)
            组排序数:(必须是[0, 999999]范围的非负整数) *
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/designGroupModify.zml b/Yangcai365_web/manage/zview/sys/designGroupModify.zml new file mode 100644 index 0000000..9e036c3 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/designGroupModify.zml @@ -0,0 +1,47 @@ +${zhiqim_manager_history("designGroup.htm")} +${request.getValidateScript()} + + +${zhiqim_manager_breadcrumb_parent("designGroup.htm" "设计组管理" "修改设计组")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + +
            增加设计组
            组织:(请选择)${ZmrOrgDao.getOrgName(request, item.getOrgId())}
            组名称:(请填写) *
            组长:(正常|停用)
            组排序数:(必须是[0, 999999]范围的非负整数) *
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/designStandardDetails.zml b/Yangcai365_web/manage/zview/sys/designStandardDetails.zml new file mode 100644 index 0000000..01a7ed6 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/designStandardDetails.zml @@ -0,0 +1,102 @@ +<#def designatedPath="/designStandardDetails.htm"/> + + + + +${zhiqim_manager_breadcrumb("设计类型")} +${zhiqim_manager_content()} + +<#-- 导航 --> + +
            +
            + + + + + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/designStandardList.zml b/Yangcai365_web/manage/zview/sys/designStandardList.zml new file mode 100644 index 0000000..4bcd2a7 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/designStandardList.zml @@ -0,0 +1,292 @@ +${zhiqim_manager_breadcrumb("字段参数")} +${zhiqim_manager_content()} +${sweet_alert_reuse_method()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + +
            + + + + + + + <#for item : catList> + style="background-color:#eaeaff;"> + + + + + + <#if catList.size() == 0> + + + + +
            序号类型名称操作
            ${item_index+1}${item.getStandardTitle()} + +
            暂时没有数据信息
            +
            + + + + + + + + <#for item : reasonList> + + + + + + + + + <#if Validates.isEmpty(reasonList) || reasonList.size() == 0> + + + + +
            序号标题操作规范详情
            ${item_index+1}${item.getStandardTitle()} + + + 添加规范 +
            暂时没有数据信息
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/designTypeAdd.zml b/Yangcai365_web/manage/zview/sys/designTypeAdd.zml new file mode 100644 index 0000000..643e38f --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/designTypeAdd.zml @@ -0,0 +1,196 @@ +<#def designatedPath="/designTypeList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("designTypeList.htm")} +${zhiqim_manager_breadcrumb_parent("designTypeList.htm", "设计类型", "增加设计类型")} +${zhiqim_manager_content()} + + + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            增加产品类型
            类型名称:(100位不定长字符) *
            状态:(请选择) +  * +
            序号:(填数字,越小越靠前)
            计算模位尺寸/单位mm:(支持两位小数)(不含出血) + x + mm +
            产品出血mm:(单边出血)(支持两位小数) + mm +
            设计文件支持上传类型:(例如:png,jpg等) + +
            +
            + +
            +
            印刷文件支持上传类型:(例如:pdf,png等) + +
            +
            + +
            +
            分辨率:(单位:DPI)(支持两位小数) + +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/designTypeDetails.zml b/Yangcai365_web/manage/zview/sys/designTypeDetails.zml new file mode 100644 index 0000000..c5851da --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/designTypeDetails.zml @@ -0,0 +1,96 @@ +<#def designatedPath="/designTypeDetails.htm"/> + + + + +${zhiqim_manager_breadcrumb("设计类型")} +${zhiqim_manager_content()} + +<#-- 导航 --> + +
            +
            + + + + + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/designTypeList.zml b/Yangcai365_web/manage/zview/sys/designTypeList.zml new file mode 100644 index 0000000..e9a85d7 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/designTypeList.zml @@ -0,0 +1,101 @@ +<#def designatedPath="/designTypeList.htm"/> + + + +${zhiqim_manager_breadcrumb("设计类型")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + + +
            + + + + + + + +
            类型ID:产品名称:状态: + + + +
            +
            + +<#-- 列表 --> + + + + + + + + + + + + + + +<#if Lists.size(pageResult.list()) == 0> +${zhiqim_manager_no_record(9, "无设计产品信息")} + +<#for item : pageResult.list()> + + + + + + + + + + + + + + +
            选项排序类型ID产品名称单边出血(mm)模位尺寸(含出血)设计文件类型印刷文件类型分辨率(DPI)状态规范设置
            ${item.getTypeSeq()}${item.getTypeId()}${item.getTypeName()}${item.getBleeding()} + <#if item.getSizeMWidth() gt 0 || item.getSizeMHeight() gt 0>${item.getSizeMWidth()}x${item.getSizeMHeight()} + ${item.getDesignFileType()}${item.getPrintingFileType()}${item.getDpi()}<#if item.isEnabled()> +
            正常
            + <#else> +
            停用
            + +
            + 添加规范 +
            +${zhiqim_manager_paging(pageResult, "/designTypeList.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/designTypeModify.zml b/Yangcai365_web/manage/zview/sys/designTypeModify.zml new file mode 100644 index 0000000..443ac17 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/designTypeModify.zml @@ -0,0 +1,214 @@ +<#def designatedPath="/typeIdList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("designTypeList.htm")} +${zhiqim_manager_breadcrumb_parent("designTypeList.htm", "设计类型", "修改设计类型")} +${zhiqim_manager_content()} + + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            增加产品类型
            类型ID:(100位不定长字符)${type.getTypeId()}
            类型名称:(100位不定长字符) *
            状态:(请选择) +  * +
            序号:(填数字,越小越靠前)
            计算模位尺寸/单位mm:(支持两位小数)(不含出血) + x + mm +
            产品出血mm:(单边出血)(支持两位小数) + mm +
            设计文件支持上传类型:(例如:png,jpg等) + + <#for designFile : designFileType> + + + + +
            + +
            +
            + +
            +
            印刷文件支持上传类型:(例如:pdf,png等) + + <#for printingFile : printingFileType> + + + + +
            + +
            +
            + +
            +
            分辨率:(单位:DPI)(支持两位小数) + +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/dialog/membersSelector.zml b/Yangcai365_web/manage/zview/sys/dialog/membersSelector.zml new file mode 100644 index 0000000..b0b1a45 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/dialog/membersSelector.zml @@ -0,0 +1,56 @@ +${Styles.htmlOverflowHidden()} + + +<#-- 查询 --> +
            +
            + + +
            +
            + +<#-- 列表 --> +
            + + + + + + + +${zhiqim_manager_tr_no_record(list, 4, "没有可选择的操作员")} +<#for item : list> +${zhiqim_manager_tr_click_checkbox()}<#else>${zhiqim_manager_tr_click_radio()} > + + + + + + + + + +<#-- 操作 --> +
            + + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/groupMembers.zml b/Yangcai365_web/manage/zview/sys/groupMembers.zml new file mode 100644 index 0000000..77bb709 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/groupMembers.zml @@ -0,0 +1,124 @@ + +${zhiqim_manager_breadcrumb("设计组成员")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> +
            <#if multiSelect> 全选<#else>选择设计师头像设计师编码设计师姓名
            ${item.getOperatorCode()}${item.getOperatorName()}
            + + + + + +
            + + + <#for item : groupList> + + +
            设计组
            ${item.getGroupName()}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/industryAdd.zml b/Yangcai365_web/manage/zview/sys/industryAdd.zml new file mode 100644 index 0000000..536193b --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/industryAdd.zml @@ -0,0 +1,36 @@ +<#def designatedPath="/industryList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("industryList.htm")} + +${zhiqim_manager_breadcrumb_parent("industryList.htm", "行业管理", "增加行业")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + +
            增加行业
            行业名称:(20位不定长字符) *
            行业关键字:(逗号隔开)
            状态:(请选择) +  * +
            序号:(填数字)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/industryList.zml b/Yangcai365_web/manage/zview/sys/industryList.zml new file mode 100644 index 0000000..44137b8 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/industryList.zml @@ -0,0 +1,60 @@ +<#def designatedPath="/industryList.htm"/> +${zhiqim_manager_breadcrumb("行业管理")} +${zhiqim_manager_content()} +${sweet_alert_reuse_method()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + +<#if Lists.size(industryList) == 0> +${zhiqim_manager_no_record(6, "暂时没有行业信息")} + +<#for item : industryList> + + + + + + + + + +
            选择行业Id行业名称关键字关键字序号
            ${item.getIndustryId()}${item.getIndustryName()}${item.getIndustryKeywords()}<#if item.isEnabled()>正常<#else>停用${item.getIndustrySeq()}
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/industryModify.zml b/Yangcai365_web/manage/zview/sys/industryModify.zml new file mode 100644 index 0000000..70feeb9 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/industryModify.zml @@ -0,0 +1,37 @@ +<#def designatedPath="/industryList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("/industryList.htm")} + +${zhiqim_manager_breadcrumb_parent("/industryList.htm", "行业管理", "修改行业")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + +
            修改行业
            行业名称:(20位不定长字符) *
            行业关键字:(逗号隔开)
            状态:(请选择) +  * +
            序号:(填数字)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/orderConvertAdd.zml b/Yangcai365_web/manage/zview/sys/orderConvertAdd.zml new file mode 100644 index 0000000..a23dd55 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/orderConvertAdd.zml @@ -0,0 +1,134 @@ +<#def designatedPath="/orderConvertList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("orderConvertList.htm")} + +${zhiqim_manager_breadcrumb_parent("orderConvertList.htm", "订单折算参数", "增加订单折算参数")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + +
            增加订单折算参数
            产品类型:(请选择) + + +  * +
            折算类型:(请选择) + +  * +
            折算系数:(请填写) + +  * +
            折算参数: + + + + +
            + 折算模数: +   +   + 折算系数: +  * +
            +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/orderConvertList.zml b/Yangcai365_web/manage/zview/sys/orderConvertList.zml new file mode 100644 index 0000000..0ff5f42 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/orderConvertList.zml @@ -0,0 +1,49 @@ +${zhiqim_manager_breadcrumb("订单折算参数")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有订单折算参数")} +<#for item : pageResult.list()> + + + + + + +
            选择产品类型最后修改时间
            ${item.getPrdTypeName()}${Sqls.toDateTimeString(item.getModifyTime())}
            +${zhiqim_manager_paging(pageResult, "orderConvertList.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/orderConvertModify.zml b/Yangcai365_web/manage/zview/sys/orderConvertModify.zml new file mode 100644 index 0000000..ba6a4bc --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/orderConvertModify.zml @@ -0,0 +1,146 @@ +<#def designatedPath="/orderConvertList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("orderConvertList.htm")} + +${zhiqim_manager_breadcrumb_parent("orderConvertList.htm", "订单折算参数", "修改订单折算参数")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + +
            修改订单折算参数
            产品类型: + ${orderConvert.getPrdTypeName()} +
            折算类型:(请选择) + +  * +
            折算系数:(请填写) + + + +  * +
            折算参数: + + <#for modulu : convertModulus> + <#var index=modulu_index/> + + + + +
            + 折算模数: +   +   + 折算系数: +  * + <#if index != 0> + + +
            +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/orderMerchantAdd.zml b/Yangcai365_web/manage/zview/sys/orderMerchantAdd.zml new file mode 100644 index 0000000..2460d71 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/orderMerchantAdd.zml @@ -0,0 +1,37 @@ +<#def designatedPath="/orderMerchantList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("orderMerchantList.htm")} +${zhiqim_manager_breadcrumb_parent("orderMerchantList.htm", "商家管理", "增加商家")} +${zhiqim_manager_content()} + +
            + + + + + + + + + + + + + + + + +
            增加商家
            商家名称:(20位不定长字符) *
            商家状态:(请选择) +  * +
            商家秘钥: +
            +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/orderMerchantList.zml b/Yangcai365_web/manage/zview/sys/orderMerchantList.zml new file mode 100644 index 0000000..86d89b8 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/orderMerchantList.zml @@ -0,0 +1,41 @@ +<#def designatedPath="/orderMerchantList.htm"/> +${zhiqim_manager_breadcrumb("商家管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 4, "暂时没有商家信息")} +<#for item : merchantList> + + + + + + + + +
            选择商家ID商家名称商家秘钥状态
            ${item.getMerchantId()}${item.getMerchantName()}${item.getMerchantSecret()}<#if item.isEnabled()>正常<#else>停用
            +${zhiqim_manager_paging(pageResult, "/orderMerchantList.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/orderMerchantModify.zml b/Yangcai365_web/manage/zview/sys/orderMerchantModify.zml new file mode 100644 index 0000000..df1f082 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/orderMerchantModify.zml @@ -0,0 +1,35 @@ +<#def designatedPath="/orderMerchantList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("orderMerchantList.htm")} +${zhiqim_manager_breadcrumb_parent("orderMerchantList.htm", "商家管理", "修改商家")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + +
            修改商家
            商家名称:(20位不定长字符) *
            商家状态:(请选择) +  * +
            商家秘钥: +
            +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/performanceParameter.zml b/Yangcai365_web/manage/zview/sys/performanceParameter.zml new file mode 100644 index 0000000..2461956 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/performanceParameter.zml @@ -0,0 +1,86 @@ +${zhiqim_manager_breadcrumb("设计绩效参数")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + + + + +${zhiqim_manager_tr_no_record(count, 10, "暂时没有设计绩效参数")} +<#for entry : dataMap.entrySet()> + <#var list = entry.getValue()/> + <#for item : list> + id="tr${item.getOrgId()}" ${zhiqim_manager_tr_click_radio()} <#else> onclick="Z('#tr${item.getOrgId()}').click()" class="z-pointer onmounse${item.getOrgId()}" onmouseover="Z('tr.onmounse${item.getOrgId()}').css('background-color', '#f3fdfc')" onmouseout="Z('tr.onmounse${item.getOrgId()}').css('background-color', '#ffffff')"> + + <#if list.size() gt 1> + <#if item_index==0> + + + + <#else> + + + + + + + + + + + + + + + +
            选择组织角色试一级单价/单数试二级单价/单数正三级单价/单数正四级单价/单数正五级单价/单数正六级单价/单数操作
            ${ZmrOrgDao.getOrgName(request, item.getOrgId())}${ZmrOrgDao.getOrgName(request, item.getOrgId())}<#if item.getPriceType()==1>设计组<#else>设计师${Amounts.toYuan(item.getPriceLevel1())}<#if item.getLevel1MaxCount() gt 0>( 0-${item.getLevel1MaxCount()}单)${Amounts.toYuan(item.getPriceLevel2())}<#if item.getLevel2MaxCount() gt 0>(${item.getLevel1MaxCount()+1}-${item.getLevel2MaxCount()}单)${Amounts.toYuan(item.getPriceLevel3())}<#if item.getLevel3MaxCount() gt 0>(${item.getLevel2MaxCount()+1}-${item.getLevel3MaxCount()}单)${Amounts.toYuan(item.getPriceLevel4())}<#if item.getLevel4MaxCount() gt 0>(${item.getLevel3MaxCount()+1}-${item.getLevel4MaxCount()}单)${Amounts.toYuan(item.getPriceLevel5())}<#if item.getLevel5MaxCount() gt 0>(${item.getLevel4MaxCount()+1}-${item.getLevel5MaxCount()}单)${Amounts.toYuan(item.getPriceLevel6())}<#if item.getLevel6MaxCount() gt 0>(${item.getLevel5MaxCount()+1}-${item.getLevel6MaxCount()}单) + <#if DateTimes.compareDay(item.getValidDate(), DateTimes.getFirstMonthDay()) gte 0 > + + +
            +${zhiqim_manager_paging(pageResult, "performanceParameter.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/performanceParameterAdd.zml b/Yangcai365_web/manage/zview/sys/performanceParameterAdd.zml new file mode 100644 index 0000000..39e15f3 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/performanceParameterAdd.zml @@ -0,0 +1,78 @@ +<#def designatedPath="performanceParameter.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("performanceParameter.htm?page="+page)} + +${zhiqim_manager_breadcrumb_parent("performanceParameter.htm?page="+page, "设计绩效参数", "增加设计绩效参数")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            增加设计绩效参数
            组织:(请选择) + +
            单价类型:(请选择) + +
            试一级单价:(请输入数字,允许小数) + + +
            试二级单价:(请输入数字,允许小数) + + +
            正三级单价:(请输入数字,允许小数) + + +
            正四级单价:(请输入数字,允许小数) + + +
            正五级单价:(请输入数字,允许小数) + + +
            正六级单价:(请输入数字,允许小数) + + +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/performanceParameterModify.zml b/Yangcai365_web/manage/zview/sys/performanceParameterModify.zml new file mode 100644 index 0000000..66059a3 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/performanceParameterModify.zml @@ -0,0 +1,71 @@ +<#def designatedPath="performanceParameter.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("performanceParameter.htm?page="+page)} + +${zhiqim_manager_breadcrumb_parent("performanceParameter.htm?page="+page, "设计绩效参数", "修改设计绩效参数")} +${zhiqim_manager_content()} + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            增加设计绩效参数
            组织:${ZmrOrgDao.getOrgName(request, param.getOrgId())}
            单价类型:(请选择) + <#if param.getPriceType()==1>设计组<#else>设计师 +
            试一级单价:(请输入数字,允许小数) + + +
            试二级单价:(请输入数字,允许小数) + + +
            正三级单价:(请输入数字,允许小数) + + +
            正四级单价:(请输入数字,允许小数) + + +
            正五级单价:(请输入数字,允许小数) + + +
            正六级单价:(请输入数字,允许小数) + + +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/presenter/groupMembersInfo.zml b/Yangcai365_web/manage/zview/sys/presenter/groupMembersInfo.zml new file mode 100644 index 0000000..1e9ce7d --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/presenter/groupMembersInfo.zml @@ -0,0 +1,50 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + + + +${zhiqim_manager_tr_no_record(operatorList, 4, "暂时没有成员信息")} +<#for item : memberList> + + + + + + + + + +
            + [${group.getGroupName()}]成员 + + + + 年 + 月 +
            头像姓名任职加入日期离开日期操作
            + <#var opr=operatorMap.get(item.getUserCode())/> + + ${item.getUserCode()}<#if item.getIsGroupLeader() == 1>组长<#else>组员${item.getStartDate()}<#if Validates.isNotEmptyBlank(item.getEndDate())>${item.getEndDate()}<#else> -- + <#if ZmrPathRule.check(request, "/groupMemberAdd.htm") && item.getEndDate() == null && item.getIsGroupLeader() == 0> + + <#else> -- + +
            +${zhiqim_manager_list(memberList.size())} diff --git a/Yangcai365_web/manage/zview/sys/productConvert.zml b/Yangcai365_web/manage/zview/sys/productConvert.zml new file mode 100644 index 0000000..5aa3a5d --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/productConvert.zml @@ -0,0 +1,175 @@ +${zhiqim_manager_breadcrumb("产品单价")} +${zhiqim_manager_content()} + + + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有产品单价信息")} + +<#var prdTypeId = 0/> +<#var prdSizeWidth = 0/> +<#var prdSizeHeight = 0/> +<#var foldPrdTypeId = 1804102013509964/> +<#var prdPageName = ""/> +<#for item : pageResult.list()> +<#if item.getPrdTypeId() == foldPrdTypeId && item.getPrdPageName() == prdPageName> + + + + + + + + + + + +<#elseif (prdTypeId == item.getPrdTypeId() || foldPrdTypeId == item.getPrdTypeId()) && prdSizeWidth == item.getPrdSizeWidth() && prdSizeHeight == item.getPrdSizeHeight()> + <#var prdTypeId = item.getPrdTypeId()/> + <#var prdSizeWidth = item.getPrdSizeWidth()/> + <#var prdSizeHeight = item.getPrdSizeHeight()/> + <#var prdPageName = item.getPrdPageName()/> + <#continue/> +<#else> + + + + + + + + + + + + <#var prdTypeId = item.getPrdTypeId()/> + <#var prdSizeWidth = item.getPrdSizeWidth()/> + <#var prdSizeHeight = item.getPrdSizeHeight()/> + <#var prdPageName = item.getPrdPageName()/> + + +
            选择产品尺寸面数普通设计单价资深设计单价改稿单价最后修改时间操作人
            ${Global.get(DesignTypeCache.class).getName(item.getPrdTypeId())} + <#if item.getPrdSizeWidth() gt 0 && item.getPrdSizeHeight() gt 0> + ${item.getPrdSizeWidth()}X${item.getPrdSizeHeight()} + <#else>/ + <#if item.getAlias() != null && item.getAlias() != ""> + (${item.getAlias()}) + <#else> + <#if Validates.isNotEmpty(item.getPrdPageName())>${item.getPrdPageName()}<#else>/${Amounts.toYuan(item.getDraftCommonDesign())}${Amounts.toYuan(item.getSrDesign())}${Amounts.toYuan(item.getDraftTemplate())}${Sqls.toDateTimeString(item.getUpdateTime())}${item.getUpdateOperator()}
            ${Global.get(DesignTypeCache.class).getName(item.getPrdTypeId())} + <#if item.getPrdSizeWidth() gt 0 && item.getPrdSizeHeight() gt 0> + ${item.getPrdSizeWidth()}X${item.getPrdSizeHeight()} + <#else>/ + <#if item.getAlias() != null && item.getAlias() != ""> + (${item.getAlias()}) + <#else> + <#if Validates.isNotEmpty(item.getPrdPageName())>${item.getPrdPageName()}<#else>/${Amounts.toYuan(item.getDraftCommonDesign())}${Amounts.toYuan(item.getSrDesign())}${Amounts.toYuan(item.getDraftTemplate())}${Sqls.toDateTimeString(item.getUpdateTime())}${item.getUpdateOperator()}
            +${zhiqim_manager_paging(pageResult,"/productConvert.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/productConvertAdd.zml b/Yangcai365_web/manage/zview/sys/productConvertAdd.zml new file mode 100644 index 0000000..427ce93 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/productConvertAdd.zml @@ -0,0 +1,116 @@ +${request.getValidateScript()} +${zhiqim_manager_history("productConvert.htm")} + +${zhiqim_manager_breadcrumb_parent("productConvert.htm", "产品单价" , "增加产品单价")} +${zhiqim_manager_content()} + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            增加产品单价
            产品 + +  * +
            尺寸 +
            + 长:小于  宽:小于   + +     +
            + 别名:  +
            +
            面数 + +
            普通设计单价 +   +
            资深设计单价 +   +
            改稿单价 +   +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/productConvertModify.zml b/Yangcai365_web/manage/zview/sys/productConvertModify.zml new file mode 100644 index 0000000..bed60ca --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/productConvertModify.zml @@ -0,0 +1,491 @@ +${request.getValidateScript()} +${zhiqim_manager_history("productConvert.htm")} + +${zhiqim_manager_breadcrumb_parent("productConvert.htm", "产品单价" , "增加产品单价")} +${zhiqim_manager_content()} + + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            修改产品单价
            产品 + +  * +
            尺寸 +
            + 长:小于  宽:小于   + +     +
            + 别名:  +
            面数 + +
            普通设计单价 +
              +
            • + +
            • + <#for item : ProductDesignPriceView> + <#if item.getDraftType() == 2 && item.getStatus() == 1> +
            • + +   当前使用 +
            • + <#elseif item.getDraftType() == 2> +
            • +     +   +
            • + + +
            +
            资深设计单价 +
              +
            • + +
            • + <#for item : ProductDesignPriceView> + <#if item.getDraftType() == 3 && item.getStatus() == 1> +
            • + +   当前使用 +
            • + <#elseif item.getDraftType() == 3> +
            • +     +   +
            • + + +
            +
            改稿单价 +
              +
            • + +
            • + <#for item : ProductDesignPriceView> + <#if item.getDraftType() == 1 && item.getStatus() == 1> +
            • + +   当前使用 +
            • + <#elseif item.getDraftType() == 1> +
            • +     +   +
            • + + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/qcAwardedType.zml b/Yangcai365_web/manage/zview/sys/qcAwardedType.zml new file mode 100644 index 0000000..690e78d --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/qcAwardedType.zml @@ -0,0 +1,42 @@ +${zhiqim_manager_breadcrumb("质检加分管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有质检加分类型信息")} +<#for item : pageResult.list()> + + + + + + + +
            选择加分类型ID加分类型加分类型分数
            ${item.getQcTypeId()}${item.getQcAwardedName()}${item.getQcScore()}
            +${zhiqim_manager_paging(pageResult, "qcAwardedType.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/qcAwardedTypeAdd.zml b/Yangcai365_web/manage/zview/sys/qcAwardedTypeAdd.zml new file mode 100644 index 0000000..6ee8968 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/qcAwardedTypeAdd.zml @@ -0,0 +1,23 @@ +<#def designatedPath="/qcAwardedType.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("qcAwardedType.htm?page="+page)} + +${zhiqim_manager_breadcrumb_parent("qcAwardedType.htm?page="+page, "质检加分", "增加质检加分类型")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + +
            增加质检加分类型
            质检加分类型:(请填写)
            加分类型分数:(请输入数字,允许小数)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/qcAwardedTypeModify.zml b/Yangcai365_web/manage/zview/sys/qcAwardedTypeModify.zml new file mode 100644 index 0000000..0376ec9 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/qcAwardedTypeModify.zml @@ -0,0 +1,24 @@ +<#def designatedPath="/qcAwardedType.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("qcAwardedType.htm?page="+page)} + +${zhiqim_manager_breadcrumb_parent("qcAwardedType.htm?page="+page, "质检加分", "修改质检加分类型")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + +
            修改质检加分类型
            质检加分类型:(请填写)
            加分类型分数:(请输入数字,允许小数)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/qcParameter.zml b/Yangcai365_web/manage/zview/sys/qcParameter.zml new file mode 100644 index 0000000..fdb0cfa --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/qcParameter.zml @@ -0,0 +1,42 @@ +${zhiqim_manager_breadcrumb("质检参数")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有质检违规类型")} +<#for item : pageResult.list()> + + + + + + + +
            选择类型ID违规内容扣罚分数
            ${item.getParameterId()}${item.getContent()}${item.getScore()}
            +${zhiqim_manager_paging(pageResult, "qcParameter.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/qcParameterAdd.zml b/Yangcai365_web/manage/zview/sys/qcParameterAdd.zml new file mode 100644 index 0000000..c4aed11 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/qcParameterAdd.zml @@ -0,0 +1,23 @@ +<#def designatedPath="/qcParameter.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("qcParameter.htm?page="+page)} + +${zhiqim_manager_breadcrumb_parent("qcParameter.htm?page="+page, "质检参数", "增加质检违规类型")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + +
            增加质检违规类型
            违规内容:(请填写)
            扣罚分数:(请输入数字,允许小数)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/qcParameterModify.zml b/Yangcai365_web/manage/zview/sys/qcParameterModify.zml new file mode 100644 index 0000000..5975833 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/qcParameterModify.zml @@ -0,0 +1,24 @@ +<#def designatedPath="/qcParameter.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("qcParameter.htm?page="+page)} + +${zhiqim_manager_breadcrumb_parent("qcParameter.htm?page="+page, "质检参数", "修改质检违规类型")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + +
            修改质检违规类型
            违规内容:(请填写)
            扣罚分数:(请输入数字,允许小数)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/qcPerformanceParam.zml b/Yangcai365_web/manage/zview/sys/qcPerformanceParam.zml new file mode 100644 index 0000000..345d3b7 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/qcPerformanceParam.zml @@ -0,0 +1,53 @@ +${zhiqim_manager_breadcrumb("质检绩效参数")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 8, "暂时没有质检绩效")} +<#for item : pageResult.list()> + + + + + + + + + + + +
            选择标准质检分奖励分扣罚分奖励金额(单位/元)扣罚金额(单位/元)最大奖励金额(单位/元)最大扣罚金额(单位/元)
            ${Maths.division(item.getStandardQcScore(), 100, 2)}${Maths.division(item.getRewardScore(), 100, 2)}${Maths.division(item.getPunishScore(), 100, 2)}${Maths.division(item.getRewardAmount(), 100, 2)}${Maths.division(item.getPunishAmount(), 100, 2)}${Maths.division(item.getRewardAmountMax(), 100, 2)}${Maths.division(item.getPunishAmountMax(), 100, 2)}
            +${zhiqim_manager_paging(pageResult, "qcPerformanceParam.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/qcPerformanceParamAdd.zml b/Yangcai365_web/manage/zview/sys/qcPerformanceParamAdd.zml new file mode 100644 index 0000000..fceadd7 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/qcPerformanceParamAdd.zml @@ -0,0 +1,43 @@ +<#def designatedPath="/qcPerformanceParam.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("qcPerformanceParam.htm?page="+page)} + +${zhiqim_manager_breadcrumb_parent("qcPerformanceParam.htm?page="+page, "质检绩效参数", "增加质检绩效参数")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            增加质检绩效参数
            标准质检分:(请输入数字,允许小数)
            奖励分:(请输入数字,允许小数)
            扣罚分:(请输入数字,允许小数)
            奖励金额:(单位/元)
            扣罚金额:(单位/元)
            最大奖励金额:(单位/元)
            最大扣罚金额:(单位/元)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/qcPerformanceParamModify.zml b/Yangcai365_web/manage/zview/sys/qcPerformanceParamModify.zml new file mode 100644 index 0000000..5bb11bc --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/qcPerformanceParamModify.zml @@ -0,0 +1,44 @@ +<#def designatedPath="/qcPerformanceParam.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("qcPerformanceParam.htm?page="+page)} + +${zhiqim_manager_breadcrumb_parent("qcPerformanceParam.htm?page="+page, "质检绩效参数", "增加质检绩效参数")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            修改质检绩效参数
            标准质检分:(请输入数字,允许小数)
            奖励分:(请输入数字,允许小数)
            扣罚分:(请输入数字,允许小数)
            奖励金额:(单位/元)
            扣罚金额:(单位/元)
            最大奖励金额:(单位/元)
            最大扣罚金额:(单位/元)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/receiveMerAdd.zml b/Yangcai365_web/manage/zview/sys/receiveMerAdd.zml new file mode 100644 index 0000000..7111706 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/receiveMerAdd.zml @@ -0,0 +1,113 @@ +<#def designatedPath="/receiveMerManage.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("/receiveMerManage.htm")} +${zhiqim_manager_breadcrumb_parent("/receiveMerManage.htm", "接单商户管理", "添加接单商户")} +${zhiqim_manager_content()} + + +
            + + + + + + + + + + + + + + + + +
            添加接单组织
            选择接组织: + + 组织接单优先级:数字越小派单越前 + + * +
            接单状态: + + 组织状态: + +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/receiveMerManage.zml b/Yangcai365_web/manage/zview/sys/receiveMerManage.zml new file mode 100644 index 0000000..c83b1b9 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/receiveMerManage.zml @@ -0,0 +1,82 @@ +<#def designatedPath="/receiveMerManage.htm"/> +${zhiqim_manager_breadcrumb("组织接单管理")} +${zhiqim_manager_content()} + + + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 7, "无数据")} +<#for item : pageResult.list()> + + + + + + + + + + +
            选择组织名称优先级组织状态接单状态最后更新时间最后操作人
            ${ZmrOrgDao.getOrgName(request, item.getOrgId())}${item.getMerLevel()}<#if item.getMerStatus() == 1>停用<#else>正常<#if item.isPauseRecieive()>已暂停<#else>接单中${Sqls.toDateTimeString(item.getModifyTime())}${item.getModifyOperatorCode()}
            + ${zhiqim_manager_paging(pageResult, "/receiveMerManage.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/receiveMerModify.zml b/Yangcai365_web/manage/zview/sys/receiveMerModify.zml new file mode 100644 index 0000000..92699d0 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/receiveMerModify.zml @@ -0,0 +1,212 @@ +<#def designatedPath="/receiveMerManage.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("/receiveMerManage.htm")} + +${zhiqim_manager_breadcrumb_parent("/receiveMerManage.htm", "接单商户管理", "修改接单商户")} +${zhiqim_manager_content()} + + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + +
            修改接单商户
            选择接单商户: + + 商户排序优先级:数字越小排序越前 + + * +
            接单状态: + + 商户状态: + +
            个人同时最大接单量:个人正在设计订单总数(老用户订单派单除外) + + * + 个人非加急订单最大接单量:普通订单正在设计数量 + + * +
            支持店铺: +
            + checked data-class="z-blue"/>全选 +
            +
            + <#var merShop = Lists.toStringList(orgMer.getOrderShop())/> + <#for item : shopList> +
            + checked class="z-checkbox" value="${item}" data-role="z-checkbox" data-class="${zmr_color_class}"> + ${item} +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/receiveMerModifyInfo.zml b/Yangcai365_web/manage/zview/sys/receiveMerModifyInfo.zml new file mode 100644 index 0000000..6c0e3e0 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/receiveMerModifyInfo.zml @@ -0,0 +1,57 @@ + + +
            + + + + + + + + + + + + + +
            选择接单商户: + + 组织状态: + +
            接单状态: + + 接单优先级: + +
            + +<#-- 操作 --> +
            + + +
            +
            diff --git a/Yangcai365_web/manage/zview/sys/refundParameter.zml b/Yangcai365_web/manage/zview/sys/refundParameter.zml new file mode 100644 index 0000000..2220308 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/refundParameter.zml @@ -0,0 +1,57 @@ +${zhiqim_manager_breadcrumb("退款绩效参数")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有退款绩效")} +<#for item : pageResult.list()> + + + + + + + + + + + + + +
            选择标准退款率(%)标准退款率下限(%)标准退款率上限(%)奖励点(%)扣罚点(%)奖励金额(单位/元)扣罚金额(单位/元)最大奖励金额(单位/元)最大扣罚金额(单位/元)
            ${Maths.division(item.getStandardRefundRate(), 100, 2)}${Maths.division(item.getStandardRefundRateFloor(), 100, 2)}${Maths.division(item.getStandardRefundRateCeil(), 100, 2)}${Maths.division(item.getRewardDot(), 100, 2)}${Maths.division(item.getPunishDot(), 100, 2)}${Maths.division(item.getRewardAmount(), 100, 2)}${Maths.division(item.getPunishAmount(), 100, 2)}${Maths.division(item.getRewardAmountMax(), 100, 2)}${Maths.division(item.getPunishAmountMax(), 100, 2)}
            +${zhiqim_manager_paging(pageResult, "refundParameter.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/refundParameterAdd.zml b/Yangcai365_web/manage/zview/sys/refundParameterAdd.zml new file mode 100644 index 0000000..72d8529 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/refundParameterAdd.zml @@ -0,0 +1,52 @@ +<#def designatedPath="/refundParameter.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("refundParameter.htm?page="+page)} + +${zhiqim_manager_breadcrumb_parent("refundParameter.htm?page="+page, "退款绩效参数", "增加退款绩效参数")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            增加退款绩效参数
            标准退款率:(请输入数字,允许小数)%
            标准退款率下限:(请输入数字,允许小数)%
            标准退款率上限:(请输入数字,允许小数)%
            奖励点:(请输入数字,允许小数)%
            扣罚点:(请输入数字,允许小数)%
            奖励金额:(单位/元)
            扣罚金额:(单位/元)
            最大奖励金额:(单位/元)
            最大扣罚金额:(单位/元)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/refundParameterModify.zml b/Yangcai365_web/manage/zview/sys/refundParameterModify.zml new file mode 100644 index 0000000..d99b28e --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/refundParameterModify.zml @@ -0,0 +1,53 @@ +<#def designatedPath="/refundParameter.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("refundParameter.htm?page="+page)} + +${zhiqim_manager_breadcrumb_parent("refundParameter.htm?page="+page, "退款绩效参数", "修改退款绩效参数")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            修改退款绩效参数
            标准退款率:(请输入数字,允许小数)%
            标准退款率下限:(请输入数字,允许小数)%
            标准退款率上限:(请输入数字,允许小数)%
            奖励点:(请输入数字,允许小数)%
            扣罚点:(请输入数字,允许小数)%
            奖励金额:(单位/元)
            扣罚金额:(单位/元)
            最大奖励金额:(单位/元)
            最大扣罚金额:(单位/元)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/specialOrderTypeAdd.zml b/Yangcai365_web/manage/zview/sys/specialOrderTypeAdd.zml new file mode 100644 index 0000000..c0b0b43 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/specialOrderTypeAdd.zml @@ -0,0 +1,31 @@ +<#def designatedPath="/specialOrderTypeList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("specialOrderTypeList.htm")} + +${zhiqim_manager_breadcrumb_parent("specialOrderTypeList.htm", "特殊订单绩效参数", "增加订单绩效参数")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + +
            增加订单绩效参数
            特殊订单类型:(请填写) *
            特殊订单类型描述:(请填写) *
            奖励金额:(单位/元) + +  * +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/specialOrderTypeList.zml b/Yangcai365_web/manage/zview/sys/specialOrderTypeList.zml new file mode 100644 index 0000000..9f0bc84 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/specialOrderTypeList.zml @@ -0,0 +1,46 @@ +${zhiqim_manager_breadcrumb("特殊订单绩效参数")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有特殊订单类型")} +<#for item : pageResult.list()> + + + + + + + +
            选择特殊订单类型特殊订单描述特殊订单类型奖励金额
            ${item.getSpecialOrderType()}${item.getSpecialOrderDescribe()}${Maths.division(item.getSpecialOrderAmount(), 100, 2)}
            +${zhiqim_manager_paging(pageResult, "specialOrderTypeList.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/specialOrderTypeModify.zml b/Yangcai365_web/manage/zview/sys/specialOrderTypeModify.zml new file mode 100644 index 0000000..93fbf44 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/specialOrderTypeModify.zml @@ -0,0 +1,29 @@ +<#def designatedPath="/specialOrderTypeList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("specialOrderTypeList.htm?page="+page)} + +${zhiqim_manager_breadcrumb_parent("specialOrderTypeList.htm?page="+page, "特殊订单绩效参数", "修改订单绩效参数")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + +
            修改订单绩效参数
            特殊订单类型:
            特殊订单类型描述:
            奖励金额:(单位/元)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/teamManagement.zml b/Yangcai365_web/manage/zview/sys/teamManagement.zml new file mode 100644 index 0000000..31e1fce --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/teamManagement.zml @@ -0,0 +1,61 @@ +<#def designatedPath="/teamManagement.htm"/> +${zhiqim_manager_breadcrumb("团队管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 4, "暂时没有商家信息")} +<#for item : merchantList> + + + + + + + + + + + +
            选择团队ID商户名称团队成员状态团队主管指定组织团队名称
            ${item.getTeamId()}${item.getMerchantName()}${item.getTeamSecret()}<#if item.isEnabled()>正常<#else>停用${item.getDeptTeam()}${item.getDeptOrg()}${item.getTeamName()}
            +${zhiqim_manager_paging(pageResult, "/teamManagement.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/teamManagementAdd.zml b/Yangcai365_web/manage/zview/sys/teamManagementAdd.zml new file mode 100644 index 0000000..89a4b80 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/teamManagementAdd.zml @@ -0,0 +1,100 @@ +<#def designatedPath="/teamManagement.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("teamManagement.htm")} +${zhiqim_manager_breadcrumb_parent("teamManagement.htm", "商家管理", "增加商家")} +${zhiqim_manager_content()} + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            增加团队
            商户名称 +
            +
            +
            设计师团队 +
            +
            +
            商家状态:(请选择) +  * +
            团队主管:(请选择) *
            对应组织:(请选择) *
            团队名称:(请填写) *
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/teamManagementUpdate.zml b/Yangcai365_web/manage/zview/sys/teamManagementUpdate.zml new file mode 100644 index 0000000..2872fe0 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/teamManagementUpdate.zml @@ -0,0 +1,103 @@ +<#def designatedPath="/teamManagementUpdate.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("teamManagement.htm")} +${zhiqim_manager_breadcrumb_parent("teamManagement.htm", "商家管理", "修改商家")} +${zhiqim_manager_content()} + + + + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            修改团队
            商户名称 +
            +
            +
            设计师团队 +
            +
            +
            商家状态:(请选择) +  * +
            团队主管:(请选择) *
            对应组织:(请选择) *
            团队名称:(请填写) *
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/teamMerchantList.zml b/Yangcai365_web/manage/zview/sys/teamMerchantList.zml new file mode 100644 index 0000000..7816fa2 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/teamMerchantList.zml @@ -0,0 +1,56 @@ +<#def designatedPath="/orderMerchantList.htm"/> +${zhiqim_manager_breadcrumb("商家管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 4, "暂时没有商家信息")} +<#for item : merchantList> + + + + + + + + + +
            选择商家ID商家名称商家秘钥状态
            ${item.getMerchantId()}${item.getMerchantName()}${item.getMerchantSecret()}<#if item.isEnabled()>正常<#else>停用
            +${zhiqim_manager_paging(pageResult, "/orderMerchantList.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/timelinessParameterAdd.zml b/Yangcai365_web/manage/zview/sys/timelinessParameterAdd.zml new file mode 100644 index 0000000..aa5285c --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/timelinessParameterAdd.zml @@ -0,0 +1,34 @@ +<#def designatedPath="/timelinessParameterList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("timelinessParameterList.htm")} + +${zhiqim_manager_breadcrumb_parent("timelinessParameterList.htm", "时效绩效参数", "增加时效绩效参数")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + +
            增加时效绩效参数
            产品类型 + +  * +
            奖励金额:(单位/元) + +  * +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/timelinessParameterList.zml b/Yangcai365_web/manage/zview/sys/timelinessParameterList.zml new file mode 100644 index 0000000..7e6624d --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/timelinessParameterList.zml @@ -0,0 +1,43 @@ +${zhiqim_manager_breadcrumb("时效绩效参数")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 10, "暂时没有时效绩效参数")} +<#for item : pageResult.list()> + + + + + + +
            选择产品类型奖励金额
            ${prdTypeMap.get(item.getPrdTypeId()).getTypeName()}${Maths.division(item.getRewardAmount(), 100, 2)}
            +${zhiqim_manager_paging(pageResult, "timelinessParameterList.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/sys/timelinessParameterModify.zml b/Yangcai365_web/manage/zview/sys/timelinessParameterModify.zml new file mode 100644 index 0000000..006d706 --- /dev/null +++ b/Yangcai365_web/manage/zview/sys/timelinessParameterModify.zml @@ -0,0 +1,35 @@ +<#def designatedPath="/timelinessParameterList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("timelinessParameterList.htm?page="+page)} + +${zhiqim_manager_breadcrumb_parent("timelinessParameterList.htm?page="+page, "时效绩效参数", "修改时效绩效参数")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + +
            修改订单绩效参数
            产品类型 + +  * +
            奖励金额:(单位/元) + +  * +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/tagAttaInfoList.zml b/Yangcai365_web/manage/zview/tagAttaInfoList.zml new file mode 100644 index 0000000..082d483 --- /dev/null +++ b/Yangcai365_web/manage/zview/tagAttaInfoList.zml @@ -0,0 +1,259 @@ +${Styles.htmlOverflowYAuto()} +${sweet_alert_reuse_method()} + +${Htmls.toCallFrame()} + + + + + + + + <#if order.getDesignId() gt 0> + + <#else> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            产品信息: + + + + +
            ${order.getDesignId()}-${order.getBuyerNick()}-${order.getOrderText()} | ¥${Amounts.toYuan(order.getAmount())}元
            +
            + + +
            +
            行业:
            + <#for item : Global.get(DesignIndustryCache.class).getIndustryList()> + + +
            子行业:
            +
            设计风格:
            +
            应用场景:
            +
            客户类型: + <#for item : Global.get(CustomerTypeCache.class).getCustomerTypeCacheAll()> + + +
            +
            diff --git a/Yangcai365_web/manage/zview/template/addSysMaterial.zml b/Yangcai365_web/manage/zview/template/addSysMaterial.zml new file mode 100644 index 0000000..f686a08 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/addSysMaterial.zml @@ -0,0 +1,89 @@ + +
            +
            + + + + + + + + + + + + + + + + + +
            选择类型: + +
            选择分类: + +
            关键字:(多个逗号分隔) + + *
            序号: + + *
            +
            + +
            + + +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/allTemplate.zml b/Yangcai365_web/manage/zview/template/allTemplate.zml new file mode 100644 index 0000000..a5fea68 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/allTemplate.zml @@ -0,0 +1,166 @@ +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/design_2018102301.js")} +${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")} + + +${zhiqim_manager_breadcrumb_parent("/templateMy.htm", "我的模板", "所有模板")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 关键词搜索 --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            +
            + + + + + + + +
            +
            类型: + + <#for item : DesignTypeDao.listTemmplate()> + + +
            行业: + + <#for item : Global.get(DesignIndustryCache.class).getIndustryList()> + + +
            文件格式: + + + + + + +
            排序: + + + + + +
            + +
            + +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/template/bestTemplate.zml b/Yangcai365_web/manage/zview/template/bestTemplate.zml new file mode 100644 index 0000000..6d492f7 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/bestTemplate.zml @@ -0,0 +1,95 @@ +<#def designatedPath="/allTemplate.htm"/> + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/design_2018102301.js")} +${zhiqim_manager_breadcrumb_parent("/templateMy.htm", "我的模板", "精品模板")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +
            + + + +
            + + + + + + + + + + + + + + + + + +
            类型: + + <#for item : DesignTypeDao.list()> + + +
            行业: + + <#for item : Global.get(DesignIndustryCache.class).getIndustryList()> + + +
            文件格式: + + + + + +
            + +
            + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/desTemplateLogList.zml b/Yangcai365_web/manage/zview/template/desTemplateLogList.zml new file mode 100644 index 0000000..50038a3 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/desTemplateLogList.zml @@ -0,0 +1,85 @@ + + +${zhiqim_manager_breadcrumb("模版日志")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 查询条件 --> +${zhiqim_manager_title("模版日志查询")} +
            + + + + +
            + +   模版号: + +
            +
            + +<#-- 列表 --> + + + + + + + +${zhiqim_manager_tr_no_record(pageResult, 4, "暂时没有模版日志信息")} +<#for item : pageResult.list()> + + + + + + + +
            模版号审核人描述操作时间
            ${item.getMediaId()}${item.getOperatorCode()}${item.getLogDesc()}<#if queryType == 0>${Sqls.toDateTimeString(item.getCreateTime())}<#else>
            +${zhiqim_manager_paging(pageResult, "desTemplateLogList.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/externalDraftDownload.zml b/Yangcai365_web/manage/zview/template/externalDraftDownload.zml new file mode 100644 index 0000000..d663957 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/externalDraftDownload.zml @@ -0,0 +1,37 @@ +${Scripts.src(zhiqim_uploadlarge.js)} + + + + + + +
            请选择: +<#if Validates.isNotEmpty(urlMap.get("pdf"))> + + +<#if Validates.isNotEmpty(urlMap.get("cdr"))> + + +<#if Validates.isNotEmpty(urlMap.get("psd"))> + + +<#if Validates.isNotEmpty(urlMap.get("ai"))> + + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/externalDraftUpload.zml b/Yangcai365_web/manage/zview/template/externalDraftUpload.zml new file mode 100644 index 0000000..f48c8af --- /dev/null +++ b/Yangcai365_web/manage/zview/template/externalDraftUpload.zml @@ -0,0 +1,206 @@ +${Scripts.src(zhiqim_uploadlarge.js)} + +
            + + + + + + + + + + + + + +
            文件格式(默认CDR): + + + + +
            设计文件上传: +
            (最大150MB)
            缩略图上传(jpg、png格式): +
            (最大1MB)
            +
            + + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/inner/industrySelect.zml b/Yangcai365_web/manage/zview/template/inner/industrySelect.zml new file mode 100644 index 0000000..76371e2 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/inner/industrySelect.zml @@ -0,0 +1,57 @@ + +<#-- 查询 --> +
            +
            + +
            +
            +<#-- 列表 --> + + + +
            +
            + + + + + + +<#for item : searchIndustryList> + + + + + + + + +<#-- 操作 --> +
            + + +
            + diff --git a/Yangcai365_web/manage/zview/template/inner/newMyTemplate.zml b/Yangcai365_web/manage/zview/template/inner/newMyTemplate.zml new file mode 100644 index 0000000..a828227 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/inner/newMyTemplate.zml @@ -0,0 +1,327 @@ + +
            +
            + + + + + + + +
            选择行业名称
            ${item.getIndustryName()}
            + + + + + + + + + + + + +
            产品类型: + <#for item : DesignTypeDao.listTemmplate()> + + +
            设计面数: + + +
            设计尺寸: + + + + +  X  +  mm + +
            + + + + + +
            模板类型: + +
            + + +
            + + +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/presenter/checkTemplateInfo.zml b/Yangcai365_web/manage/zview/template/presenter/checkTemplateInfo.zml new file mode 100644 index 0000000..91fcf01 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/presenter/checkTemplateInfo.zml @@ -0,0 +1,47 @@ +<#if pageResult.total() != 0> +
            + <#for item : pageResult.list()> + <#if item_index!=0 && item_index%5==0>
            + <#if item_index%5==0>
            +
            +
            + + ${item.getMediaUrl()} + <#else> + <#for path : Arrays.toStringArray(item.getMediaUrl())> + <#if path_index lt 1> + ${path} + + + + + " onclick="Design.doTemplateShow('${item.getMediaId()}');" /> + ${item.getMediaId()} + + + + +
            +
            + <#if item_index == (pageResult.list().size() - 1)>
            + +
            +
            + + + + +
            ${PagingGo.toHtmlClick(pageResult, "doTemplateSearch")}
            +
            +<#else> +
            暂无模板信息
            + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/presenter/keywordSearchInfo.zml b/Yangcai365_web/manage/zview/template/presenter/keywordSearchInfo.zml new file mode 100644 index 0000000..4808c44 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/presenter/keywordSearchInfo.zml @@ -0,0 +1,41 @@ +<#if pageResult.total() != 0> +
            + <#for item : pageResult.list()> + <#if item_index!=0 && item_index%5==0>
            + <#if item_index%5==0>
            +
            +
            + + ${item.getMediaUrl()} + <#else> + <#for path : Arrays.toStringArray(item.getMediaUrl())> + <#if path_index lt 1> + ${path} + + + + + " onclick="Design.doTemplateShow('${item.getMediaId()}');" /> + ${item.getMediaId()} +
            +
            + <#if item_index == (pageResult.list().size() - 1)>
            + +
            + +
            + + + + +
            ${PagingGo.toHtmlClick(pageResult, "doSearchAjax")}
            +
            +<#else> +
            暂无模板信息,请重新搜索
            + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/presenter/orderTemplateInfo.zml b/Yangcai365_web/manage/zview/template/presenter/orderTemplateInfo.zml new file mode 100644 index 0000000..b3eebab --- /dev/null +++ b/Yangcai365_web/manage/zview/template/presenter/orderTemplateInfo.zml @@ -0,0 +1,28 @@ +<#if pageResult.total() != 0> +
            + <#for item : pageResult.list()> + <#if item_index!=0 && item_index%5==0>
            + <#if item_index%5==0>
            +
            +
            + + ${item.getDesignId()} +
            +
            + <#if item_index == (pageResult.list().size() - 1)>
            + +
            + +
            + + + + +
            ${PagingGo.toHtmlClick(pageResult, "doTemplateSearch")}
            +
            +<#else> +
            暂无模板信息
            + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/presenter/retentionDealOrderDetail.zml b/Yangcai365_web/manage/zview/template/presenter/retentionDealOrderDetail.zml new file mode 100644 index 0000000..e143549 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/presenter/retentionDealOrderDetail.zml @@ -0,0 +1,46 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + +<#-- 列表 --> + + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 12, "暂时没有滞留单")} + <#for item : pageResult.list()> + <#var isCountDown=CalculationUtil.retentDealCountDownCal(request,item.getDesignId())/> + + + z-text-red" ${zhiqim_manager_tr_onmouse()} ${zhiqim_manager_tr_click_radio()}> + + + + + + + + + + + + + + + +
            订单号订单类型所属组织旺旺号店铺设计师录单时间倒计时领单时间订单状态进度备注产品订单金额
            ${item.getDesignId()}${DraftConstants.get(item.getDraftType())}${ZmrOrgDao.getOrgName(request,item.getOrgId())}${item.getBuyerNick()}${item.getShopNick()}${item.getDesigner()}${Sqls.toDateTimeString(item.getCreateTime())} + <#var effectiveTime = typeMap.get(item.getTypeId()).getEffectiveTime()/> + + ${Sqls.toDateTimeString(item.getDesignReceiveTime())}${StatusConstants.getStatus(item.getStatus())}${progressNoteMap.get(item.getDesignId())}${item.getOrderText()}${Amounts.toYuanMustRadix(item.getAmount())}
            +${zhiqim_manager_paging_jsMethod(pageResult, "doQueryRetentionDealOrder")} diff --git a/Yangcai365_web/manage/zview/template/presenter/templateInfo.zml b/Yangcai365_web/manage/zview/template/presenter/templateInfo.zml new file mode 100644 index 0000000..c39d98d --- /dev/null +++ b/Yangcai365_web/manage/zview/template/presenter/templateInfo.zml @@ -0,0 +1,44 @@ +<#if pageResult.total() != 0> +
            + <#for item : pageResult.list()> + <#if item_index!=0 && item_index%5==0>
            + <#if item_index%5==0>
            +
            +
            + + ${item.getMediaUrl()} + <#else> + <#for path : Arrays.toStringArray(item.getMediaUrl())> + <#if path_index lt 1> + ${path} + + + + + " onclick="Design.doTemplateShow('${item.getMediaId()}','${urlParam}');" /> + ${item.getMediaId()} +
            +
            + <#if item_index == (pageResult.list().size() - 1)>
            + +
            + +
            + + + + +
            ${PagingGo.toHtmlClick(pageResult, "doTemplateSearch")}
            +
            +<#else> +
            暂无模板信息,请重新搜索
            + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/templateAudit.zml b/Yangcai365_web/manage/zview/template/templateAudit.zml new file mode 100644 index 0000000..61c0082 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/templateAudit.zml @@ -0,0 +1,139 @@ +<#def designatedPath="/allTemplate.htm"/> + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/design_2018102301.js")} +${zhiqim_manager_breadcrumb_parent("/templateMy.htm", "我的模板", "模板审核")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + + + + + + +
            类型:${typeId} + + <#for item : DesignTypeDao.list()> + + +
            行业: + + <#for item : Global.get(DesignIndustryCache.class).getIndustryList()> + + +
            审核类型: + + +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/templateBestAudit.zml b/Yangcai365_web/manage/zview/template/templateBestAudit.zml new file mode 100644 index 0000000..bb9e5d2 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/templateBestAudit.zml @@ -0,0 +1,98 @@ +<#def designatedPath="/allTemplate.htm"/> + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/design_2018102301.js")} +${zhiqim_manager_breadcrumb_parent("/templateMy.htm", "我的模板", "精品审核")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + +
            类型: + + <#for item : DesignTypeDao.list()> + + +
            行业: + + <#for item : Global.get(DesignIndustryCache.class).getIndustryList()> + + +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/templateCollect.zml b/Yangcai365_web/manage/zview/template/templateCollect.zml new file mode 100644 index 0000000..50cceb9 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/templateCollect.zml @@ -0,0 +1,73 @@ +<#def designatedPath="/allTemplate.htm"/> + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/design_2018102301.js")} +${zhiqim_manager_breadcrumb("我的模板")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + +
            类型:${typeId} + + <#for item : DesignTypeDao.listTemmplate()> + + +
            行业: + + <#for item : Global.get(DesignIndustryCache.class).getIndustryList()> + + +
            + +
            + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/templateDraftMy.zml b/Yangcai365_web/manage/zview/template/templateDraftMy.zml new file mode 100644 index 0000000..3cf0eec --- /dev/null +++ b/Yangcai365_web/manage/zview/template/templateDraftMy.zml @@ -0,0 +1,82 @@ +<#def designatedPath="/allTemplate.htm"/> + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/design_2018102301.js")} +${zhiqim_manager_breadcrumb_parent("/templateMy.htm", "我的模板", " 我的订单草稿")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 订单搜索 --> +
            + + + + + + +
            + + + + + + + + + + +
            类型: + + <#for item : DesignTypeDao.list()> + + +
            行业: + + <#for item : Global.get(DesignIndustryCache.class).getIndustryList()> + + +
            + +
            + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/templateLabel.zml b/Yangcai365_web/manage/zview/template/templateLabel.zml new file mode 100644 index 0000000..d47fdf4 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/templateLabel.zml @@ -0,0 +1,207 @@ + + +
            + + + + + + + + + + + + + +
            产品类型: ${DesignTypeDao.name(template.getTypeId())}
            行业:  
            子行业: + <#for item : inSubList> + + +

            +${zhiqim_manager_title("关联属性")} +
            + +<#for item : attrCatList> + + + + + +
            ${item.getAttributeCatName()}: + <#for aitem : map.get(item.getAttributeCatId())> + + +
            +
            +
            + + +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/templateMy.zml b/Yangcai365_web/manage/zview/template/templateMy.zml new file mode 100644 index 0000000..92a2faa --- /dev/null +++ b/Yangcai365_web/manage/zview/template/templateMy.zml @@ -0,0 +1,122 @@ +<#def designatedPath="/allTemplate.htm"/> + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/design_2018102301.js")} +${zhiqim_manager_breadcrumb("我的模板")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + + + + + + +
            类型:${typeId} + + <#for item : DesignTypeDao.listTemmplate()> + + +
            行业: + + <#for item : Global.get(DesignIndustryCache.class).getIndustryList()> + + +
            文件格式: + + + + + + +
            + +
            + + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/templateOrderMy.zml b/Yangcai365_web/manage/zview/template/templateOrderMy.zml new file mode 100644 index 0000000..ea50ed4 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/templateOrderMy.zml @@ -0,0 +1,88 @@ +<#def designatedPath="/allTemplate.htm"/> + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/design_2018102301.js")} +${zhiqim_manager_breadcrumb_parent("/templateMy.htm", "我的模板", " 我的订单模板")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 订单搜索 --> +
            + + + + + <#if ZmrPathRule.check(request, "/viewAllCompletedOrderTemplate.htm")> + + + + +
            + + + + + + + + + + +
            类型: + + <#for item : DesignTypeDao.list()> + + +
            行业: + + <#for item : Global.get(DesignIndustryCache.class).getIndustryList()> + + +
            + +
            + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/templateParam.zml b/Yangcai365_web/manage/zview/template/templateParam.zml new file mode 100644 index 0000000..e269c99 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/templateParam.zml @@ -0,0 +1,200 @@ + +
            +
            + + + + + + + +<#if ZmrPathRule.check(request, "/templateSizeModify.htm")> + +<#else> + + + + + + + + + +<#if Validates.isNotEmpty(paramStr)> + + + + + +<#else> + + + + + + + + + + + + + + + + + +
            产品类型:${Global.get(ProductTypeCache.class).getName(works.getDesignType())}
            设计尺寸: + + + 自定义   +  X  +  mm + +
            面数:${Global.get(PrdPageCache.class).getName(works.getPrdPageId())}
            成品尺寸:${Global.get(PrdSizeCache.class).getName(works.getPrdSizeId())}
            设计尺寸: + <#for item : strList> + checked>${item} + +
            +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/templateShare.zml b/Yangcai365_web/manage/zview/template/templateShare.zml new file mode 100644 index 0000000..eb34f86 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/templateShare.zml @@ -0,0 +1,73 @@ +<#def designatedPath="/allTemplate.htm"/> + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/design_2018102301.js")} +${zhiqim_manager_breadcrumb("我的模板")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + +
            类型:${typeId} + + <#for item : DesignTypeDao.listTemmplate()> + + +
            行业: + + <#for item : Global.get(DesignIndustryCache.class).getIndustryList()> + + +
            + +
            + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/template/templateShow.zml b/Yangcai365_web/manage/zview/template/templateShow.zml new file mode 100644 index 0000000..6d7ec7f --- /dev/null +++ b/Yangcai365_web/manage/zview/template/templateShow.zml @@ -0,0 +1,543 @@ +${Scripts.src(zhiqim_uploadlarge.js)} + + + +
            +
            +
              + <#if media.getMediaUrl().indexOf(",")==-1> +
            • + <#else> + <#for path : Arrays.toStringArray(media.getMediaUrl())> +
            • + +

            • + + +
            +
            +
            +
              +
            • + <#if media.getTemplateStatus() == 1> + <#if media.getTemplateType() = 100 && media.getTemplateStatus() == 0> + <#if media.getTemplateType() = 20 && media.getTemplateStatus() == 0> + <#if media.getTemplateType() = 10 && Validates.isEqual(media.getDesigner(), sessionUser.getOperatorCode())> + <#if ZmrPathRule.check(request, "/templateBestAudit.htm")> + <#if media.getTemplateType() = 100> + + <#elseif media.getTemplateType() = 110> + + + +
            • + <#if media.getTemplateType()!=0 && media.getTemplateType()!=80> + <#if Validates.isNotEmpty(fileTypeSet)> +
            • +

              模板下载(点击对应格式下载)

              + <#for fileType : fileTypeSet> + ${fileType.toUpperCase()} + +
            • + + +
            • + + + 浏览(${browseNum}) + 收藏(${collectNum}) +
            • +
            • +
              设计师:${media.getDesigner()}
              +
              热度:${score}
              +
            • +
            • +
              + + <#if Validates.isEmpty(media.getCreateChannel()) || "platform_design" == media.getCreateChannel()> +
              + + <#if media.getTemplateType() != 80> + <#if Validates.isEmpty(media.getCreateChannel()) || "platform_design" == media.getCreateChannel()> + <#if Validates.isEqual(media.getDesigner(), sessionUser.getOperatorCode()) || ZmrPathRule.check(request, "/templateBestAudit.htm")> +
              + + + <#if ZmrPathRule.check(request, "/templateDelete.htm")>
              + + <#if urlParam == "SHARE"> +
              + + <#if Validates.isEmpty(media.getCreateChannel()) || "out_draft" == media.getCreateChannel()> + <#if media.getTemplateType()!=0 && media.getTemplateType()!=80> +
              + + + <#if media.getTemplateType() == 80> +
              + +
              +
            • +
            • +
              + + <#if ZmrPathRule.check(request, "/templateBestAudit.htm")> + + <#elseif ZmrPathRule.check(request, "/templateAudit.htm") && media.getTemplateType() == 100> + + <#else> + <#if media.getTemplateType() lt 100> + + + + + + 行业属性 +
              +
                +
              • + ${DesignTypeDao.name(media.getTypeId())}  + ${Global.get(DesignIndustryCache.class).getIndustryName(media.getIndustryId())}  + <#for subsName : Arrays.toStringArray(media.getIndustrySubName())> + ${subsName}  + + <#for attar : Arrays.toStringArray(media.getAttributeName())> + ${attar}  + +
              • +
              +
            • +
            • +
              自定义标签
              +
              +
              + <#for keyword : DesignerPresenter.updateKeywordArr(media.getKeywordName(), "template", media.getMediaId())> + ${keyword} + +
              + + <#if ZmrPathRule.check(request, "/templateBestAudit.htm")> +
                
              + <#elseif ZmrPathRule.check(request, "/templateAudit.htm") && media.getTemplateType() == 100> +
                
              + <#else> + <#if media.getTemplateType() lt 100> +
                
              + + +
              +
            • +
            • +
              参数
              +
                +
              • 名称:${media.getMediaName()}
              • +
              • 类型:${DesignTypeDao.name(media.getTypeId())}
              • + <#if media.getTypeId()==3> +
              • P 数:${media.getPageValue()}P
              • + <#else> +
              • 面数:${media.getPageValue()}
              • + +
              • 版式:<#if oddEven == 0>横版<#elseif oddEven == 1>竖版
              • +
              • 大小(px):${media.getWidth()}X${media.getHeight()}
              • +
              • DPI:${media.getDpi()}
              • +
              • 模板ID:${media.getMediaId()}
              • +
              • 创建时间:${media.getCreateTime()}
              • +
              • 更新时间:${media.getUpdateTime()}
              • +
              +
            • +
            +
            +
            diff --git a/Yangcai365_web/manage/zview/template/userMaterialList.zml b/Yangcai365_web/manage/zview/template/userMaterialList.zml new file mode 100644 index 0000000..8f31bd6 --- /dev/null +++ b/Yangcai365_web/manage/zview/template/userMaterialList.zml @@ -0,0 +1,74 @@ +<#def designatedPath="/zhiqimMediaEditor/materialCatList.htm"/> + + +${zhiqim_manager_breadcrumb("用户素材列表")} + +
            +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + + +<#if pageResult.size() == 0> +${zhiqim_manager_no_record (10, "暂时没有素材资源信息")} + +<#for item : pageResult.list()> +${zmr_tr_odd_bgcolor}<#else>${zmr_tr_even_bgcolor} class="z-text-center z-h60"> + + + + + + + + + + +
            选择类型分类设计师序号关键字预览图代码
            ${MaterialConstants.getMaterialTypeName(item.getTypeCode())}${Global.get(MaterialCatCache.class).getName(item.getCatCode())}${item.getDesigner()}${item.getSvgSeq()}${item.getKeywords()}
            +${zhiqim_manager_paging (pageResult, "userMaterialList.htm")} +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/templateOrder/fillLabelInfo.zml b/Yangcai365_web/manage/zview/templateOrder/fillLabelInfo.zml new file mode 100644 index 0000000..c2995dd --- /dev/null +++ b/Yangcai365_web/manage/zview/templateOrder/fillLabelInfo.zml @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            行业关键词: + + +
            主行业: +
            +
            推荐行业: +
            +
            子行业: +
            +
            应用场景: +
            +
            设计风格: +
            +
            客户类型: +
            + <#for item : Global.get(CustomerTypeCache.class).getCustomerTypeCacheAll()> + + +
            +
            + + +<#-- 操作 --> +
            +    + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/templateOrder/templateOrder.zml b/Yangcai365_web/manage/zview/templateOrder/templateOrder.zml new file mode 100644 index 0000000..c6cda79 --- /dev/null +++ b/Yangcai365_web/manage/zview/templateOrder/templateOrder.zml @@ -0,0 +1,120 @@ +
            + +
            +
            +
            + <#if ZmrPathRule.check(request, "openWangWang")> + <#if ZmrPathRule.check(request, "openQQ")> +
            +
            订单号:${order.getDesignId()}
            +
            产品名:${order.getOrderText()}
            + +<#-- 客户素材 --> +
            + + + + + + + +<#for atta : attaList> + + + + +
            + +
            + +
            +
            + +
            +
            + +
            +
            +
            +
            客户素材
            ${atta.getFileName()}
            +
            + +<#-- 联系旺旺&联系QQ弹窗框 --> + +
            + + +
            +
            +
            + <#for key : svgMap.keySet()> + <#var item = svgMap.get(key)/> +
            +
            + <#for bg : item.getBgList()> + <#if bg_index lt 2> + ${bg.getSvgCode()} + + + <#if mediaId != item.getMediaId()> + <#if bg_index == 0> + 复制正面 + + <#if bg_index == 1> + 复制反面 + + + +
            + <#if mediaId != item.getMediaId()> + + 编辑 + 删除 + + +
            + +
            +
            +
            + +
            +
            + + + diff --git a/Yangcai365_web/manage/zview/templateOrder/templateOrderLabel.zml b/Yangcai365_web/manage/zview/templateOrder/templateOrderLabel.zml new file mode 100644 index 0000000..8096898 --- /dev/null +++ b/Yangcai365_web/manage/zview/templateOrder/templateOrderLabel.zml @@ -0,0 +1,65 @@ + + + +
            +

            客户类型

            +
            + <#for item : Global.get(CustomerTypeCache.class).getCustomerTypeCacheAll()> + + +
            +
            +
            +

            行业关键词

            +
            + +
            +
            +
            +

            主行业

            +
            +
            +
            +

            推荐行业

            +
            +
            +
            +

            子行业

            +
            +
            +
            +

            应用场景

            +
            +
            +
            +

            设计风格

            +
            +
            +
            + + +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/allWorks.zml b/Yangcai365_web/manage/zview/works/allWorks.zml new file mode 100644 index 0000000..ed07838 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/allWorks.zml @@ -0,0 +1,94 @@ + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/works_20171030.js")} +${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")} +${zhiqim_manager_breadcrumb_parent("/worksMy.htm", "我的作品", "所有作品")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 关键词搜索 --> +
            + + + + + + + +
            + + + + + + + + + + +
            类型: + + <#for item : prdList> + + +
            行业: + + <#for item : indList> + + +
            + +
            + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/bestWorks.zml b/Yangcai365_web/manage/zview/works/bestWorks.zml new file mode 100644 index 0000000..e151680 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/bestWorks.zml @@ -0,0 +1,127 @@ + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/works_20171030.js")} +${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")} +${zhiqim_manager_breadcrumb_parent("/worksMy.htm", "我的作品", "精品作品")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 关键词搜索 --> +
            + + + +
            + + + + + + + + + + +
            类型: + + <#for item : prdList> + + +
            行业: + + <#for item : indList> + + +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/groupWorks.zml b/Yangcai365_web/manage/zview/works/groupWorks.zml new file mode 100644 index 0000000..d7aab54 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/groupWorks.zml @@ -0,0 +1,81 @@ + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/works_20171030.js")} +${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")} +${zhiqim_manager_breadcrumb_parent("/worksMy.htm", "我的作品", "小组作品")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 关键词搜索 --> +
            + + + +
            + + + + + + + + + + +
            类型: + + <#for item : prdList> + + +
            行业: + + <#for item : indList> + + +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/labelRelation.zml b/Yangcai365_web/manage/zview/works/labelRelation.zml new file mode 100644 index 0000000..3e3ef7f --- /dev/null +++ b/Yangcai365_web/manage/zview/works/labelRelation.zml @@ -0,0 +1,209 @@ + + +
            +${zhiqim_manager_title("关联标签行业")} + + + + + + + + + + + + + +
            产品类型: ${Global.get(ProductTypeCache.class).getName(works.getPrdTypeId())}
            标签行业:  
            标签子行业: + <#for item : inSubList> + + +

            +${zhiqim_manager_title("关联标签属性")} +
            + +<#for item : attrCatList> + + + + + +
            ${item.getAttributeCatName()}: + <#for aitem : map.get(item.getAttributeCatId())> + + +
            +
            +
            + + +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/materialCatAdd.zml b/Yangcai365_web/manage/zview/works/materialCatAdd.zml new file mode 100644 index 0000000..44c6f55 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/materialCatAdd.zml @@ -0,0 +1,38 @@ +<#def designatedPath="/works/materialCatList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history ("/works/materialCatList.htm")} + +${zhiqim_manager_breadcrumb_parent ("/works/materialCatList.htm", "分类管理", "增加分类")} + +
            +${zhiqim_manager_title ("增加分类")} + +
            + + + + + + + + + + + + + +
            分类名称: + + *
            状态: + +
            序号: + + *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/materialCatList.zml b/Yangcai365_web/manage/zview/works/materialCatList.zml new file mode 100644 index 0000000..210a4e9 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/materialCatList.zml @@ -0,0 +1,42 @@ +<#def designatedPath="/works/materialCatList.htm"/> +${zhiqim_manager_breadcrumb ("分类管理")} + +
            +<#-- 导航栏 --> +
            + +
            + + + + + + + + + +<#if result.size() == 0> +${zhiqim_manager_no_record(5, "暂时没有分类信息")} + +<#for item : result> +${zmr_tr_odd_bgcolor}<#else>${zmr_tr_even_bgcolor} class="z-text-center z-h60"> + + + + + + + +
            选择分类编码名称状态序号
            ${item.getCatId()}${item.getCatName()}<#if item.getCatStatus() == 0>正常<#else>停用${item.getCatSeq()}
            +${zhiqim_manager_list(result.size())} +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/materialCatModify.zml b/Yangcai365_web/manage/zview/works/materialCatModify.zml new file mode 100644 index 0000000..679c6f8 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/materialCatModify.zml @@ -0,0 +1,41 @@ +<#def designatedPath="/works/materialCatList.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history ("/works/materialCatList.htm")} + +${zhiqim_manager_breadcrumb_parent ("/works/materialCatList.htm", "分类管理", "修改分类")} + +
            +${zhiqim_manager_title ("修改分类")} + +
            + + + + + + + + + + + + + + + + + + +
            分类编号:${item.getCatId()}
            状态: + +
            分类名称: + + *
            序号: + + *
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/materialContAdd.zml b/Yangcai365_web/manage/zview/works/materialContAdd.zml new file mode 100644 index 0000000..f81bcd7 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/materialContAdd.zml @@ -0,0 +1,140 @@ +${request.getValidateScript()} +${Scripts.src(zhiqim_uploadlarge.js)} + +
            + + + + + + + + + + + + + + + + + + + + + + +
            素材分类: + +  *
            素材状态: + +  *
            关键字(多个可空格分隔):
            选择素材(上传cdr时,请上传效果图): + +  *
            选择效果图: + +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/materialContList.zml b/Yangcai365_web/manage/zview/works/materialContList.zml new file mode 100644 index 0000000..5bdfca1 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/materialContList.zml @@ -0,0 +1,127 @@ +<#def designatedPath="/works/materialCatList.htm"/> + + +${zhiqim_manager_breadcrumb("素材列表")} + +
            +<#-- 导航栏 --> +
            + +
            + + + + + + + + + + + + + +<#if pageResult.size() == 0> +${zhiqim_manager_no_record (10, "暂时没有素材信息")} + +<#for item : pageResult.list()> +${zmr_tr_odd_bgcolor}<#else>${zmr_tr_even_bgcolor} class="z-text-center z-h60"> + + + + + + + + + + +
            选择分类状态序号关键字文件格式预览图操作
            ${Global.get(DesMaterialCatCache.class).name(item.getCatId())} + ${item.getMaterialSuffix()}<#if Validates.isNotEmpty(item.getThumbUrl())>
            +${zhiqim_manager_paging (pageResult, "/works/materialContList.htm")} +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/materialContModify.zml b/Yangcai365_web/manage/zview/works/materialContModify.zml new file mode 100644 index 0000000..b1e6c73 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/materialContModify.zml @@ -0,0 +1,40 @@ +<#def designatedPath="/works/materialCatList.htm"/> +${request.getValidateScript()} + +${zhiqim_manager_history ("/works/materialContList.htm")} + +${zhiqim_manager_breadcrumb_parent ("/works/materialContList.htm", "素材管理", "修改素材")} + +
            +${zhiqim_manager_title ("修改素材")} + +
            + + + + + + + + + + + + + + +
            素材状态: + +  *
            关键字(多个可空格分隔): + +  *
            序号: + +
            +${zhiqim_manager_submit()} +
            +
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/pcWorks.zml b/Yangcai365_web/manage/zview/works/pcWorks.zml new file mode 100644 index 0000000..58965dc --- /dev/null +++ b/Yangcai365_web/manage/zview/works/pcWorks.zml @@ -0,0 +1,100 @@ + + + + 秒绘设计模板库 + + + + + + + + + + + + +
            +
            + + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/works_20171030.js")} +${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")} +
            +<#-- 关键词搜索 --> +
            + + + +
            + + + + + + + + + + + + + + + + + + + + + +
            类型: + + <#for item : DesignTypeDao.listByPicture()> + <#if item.getTypeName() == "画册" || item.getTypeName() == "名片" || item.getTypeName() == "彩页" || item.getTypeName() == "优惠券" || item.getTypeName() == "透明PVC名片" || item.getTypeName() == "电子传单"> + + + +
            所属行业: + + <#for item : indList> + + +
            排序: + + + + + +
            + +
            +
            + +
            +
            + + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/presenter/pcWorksInfo.zml b/Yangcai365_web/manage/zview/works/presenter/pcWorksInfo.zml new file mode 100644 index 0000000..3af8479 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/presenter/pcWorksInfo.zml @@ -0,0 +1,39 @@ +
            +<#if pageResult.total()!= 0> +<#for item : pageResult.list()> +
            +
            + <#for path : Arrays.toStringArray(item.getMediaUrl())> + <#if path_index lt 1> + + + + +
            +
            +
            +

            ${item.getMediaName()}

            +

            <#if item.getTypeId()=3>P数:<#else>面数:${item.getPageValue()}


            +
            +
            +
            +

            ${item.getWidthMm()}X${item.getHeightMm()}mm

              +

            <#if item.getOddEven()=0>横版<#elseif item.getOddEven()=1>竖版

            +

            ID:${item.getMediaId()}

            +
            +
            +
            + +
            +
            + + + + +
            ${PagingGo.toHtmlClick(pageResult, "doWorksSearch")}
            +
            +<#else> +
            + 无作品数据 +
            + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/presenter/pcWorksSearchInfo.zml b/Yangcai365_web/manage/zview/works/presenter/pcWorksSearchInfo.zml new file mode 100644 index 0000000..b62e743 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/presenter/pcWorksSearchInfo.zml @@ -0,0 +1,33 @@ +
            +<#if pageResult.total()!= 0> +<#for item : pageResult.list()> +
            +
            + <#for path : Arrays.toStringArray(item.getThumbImagePath())> + <#if path_index lt 1> + + + +
            + + ID:${item.getWorksId()} +
            + +
            +
            + + + + +
            ${PagingGo.toHtmlClick(pageResult, "Works.doSearchAjaxForPC")}
            +
            + + + + +<#else> +
            + 无作品数据 +
            + + diff --git a/Yangcai365_web/manage/zview/works/presenter/worksInfo.zml b/Yangcai365_web/manage/zview/works/presenter/worksInfo.zml new file mode 100644 index 0000000..e3697ea --- /dev/null +++ b/Yangcai365_web/manage/zview/works/presenter/worksInfo.zml @@ -0,0 +1,41 @@ +
            +<#if pageResult.total()!= 0> +<#for item : pageResult.list()> +
            +
            + <#for path : Arrays.toStringArray(item.getThumbImagePath())> + <#if path_index lt 1> + + + + <#if item.getWorksType() == 3> + ${item.getTemplateId()} + + <#if Validates.isEqual(param, "AUDIT")> + + + + + +
            + ID:${item.getWorksId()} +
            + +
            +<#if Validates.isEqual(apple, "BEST")> + +
            +
            设计模板
            +
            取消选择
            + +
            + + +
            + + + + +
            ${PagingGo.toHtmlClick(pageResult, "doWorksSearch")}
            +
            + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/presenter/worksSearchInfo.zml b/Yangcai365_web/manage/zview/works/presenter/worksSearchInfo.zml new file mode 100644 index 0000000..ca0d145 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/presenter/worksSearchInfo.zml @@ -0,0 +1,40 @@ +
            +<#if pageResult.total()!= 0> +<#for item : pageResult.list()> +
            +
            + <#for path : Arrays.toStringArray(item.getThumbImagePath())> + <#if path_index lt 1> + + + + <#if item.getWorksType() == 3> + ${item.getTemplateId()} + +
            + ID:${item.getWorksId()} +
            + +
            +<#if Validates.isEqual(urlParam, "BEST")> + +
            +
            设计模板
            +
            取消选择
            + +
            + + +
            + + + + +
            ${PagingGo.toHtmlClick(pageResult, "Works.doSearchAjax")}
            +
            + + + + + + diff --git a/Yangcai365_web/manage/zview/works/worksAudit.zml b/Yangcai365_web/manage/zview/works/worksAudit.zml new file mode 100644 index 0000000..4d1eda0 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/worksAudit.zml @@ -0,0 +1,108 @@ + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/works_20171030.js")} +${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")} +${zhiqim_manager_breadcrumb("精品审核")} +${zhiqim_manager_content()} + + +<#-- 导航栏 --> +
            + +
            + +<#-- 关键词搜索 --> +
            + + + +
            + + + + + + + + + + +
            类型: + <#for item : prdList> + + +
            行业: + <#for item : indList> + + +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/worksBest.zml b/Yangcai365_web/manage/zview/works/worksBest.zml new file mode 100644 index 0000000..0bcd565 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/worksBest.zml @@ -0,0 +1,81 @@ + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/works_20171030.js")} +${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")} +${zhiqim_manager_breadcrumb_parent("/worksMy.htm", "我的作品", "我的精品")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 关键词搜索 --> +
            + + + +
            + + + + + + + + + + +
            类型: + + <#for item : prdList> + + +
            行业: + + <#for item : indList> + + +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/worksCollect.zml b/Yangcai365_web/manage/zview/works/worksCollect.zml new file mode 100644 index 0000000..dc45502 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/worksCollect.zml @@ -0,0 +1,83 @@ + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/works_20171030.js")} +${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")} +${zhiqim_manager_breadcrumb_parent("/worksMy.htm", "我的作品", "我收藏的")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 关键词搜索 --> +
            + + + +
            + + + + + + + + + + +
            类型: + + <#for item : prdList> + + +
            行业: + + <#for item : indList> + + +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/worksList.zml b/Yangcai365_web/manage/zview/works/worksList.zml new file mode 100644 index 0000000..00eda02 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/worksList.zml @@ -0,0 +1,81 @@ +${zhiqim_manager_breadcrumb("作品列表")} +${zhiqim_manager_content()} +${Scripts.src("/zinc/js/works_20171030.js")} + +<#-- 导航栏 --> +
            + +
            + +
            + + + + + + + + + +
            作品类型: + + 产品类型: + + 行业名称: + +
            +

            + + + + + + + + + + +<#if pageResult.total() == 0> + ${zhiqim_manager_no_record(3 "暂时没有作品列表信息")} + +<#for item : pageResult.list()> + + + + + + + +
             作品列表
            缩略图关联标签关联关键词操作
            + <#for path : Arrays.toStringArray(item.getThumbImagePath())> + <#if path_index lt 1> + + ${LabelPresenter.doWorksLabelName(item.getWorksId())}${item.getKeywordName()}
            +${zhiqim_manager_paging(pageResult, "/worksList.htm")} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/worksMy.zml b/Yangcai365_web/manage/zview/works/worksMy.zml new file mode 100644 index 0000000..057090e --- /dev/null +++ b/Yangcai365_web/manage/zview/works/worksMy.zml @@ -0,0 +1,94 @@ + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/works_20171030.js")} +${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")} +${zhiqim_manager_breadcrumb("我的作品")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 关键词搜索 --> +
            + + + +
            + + + + + + + + + + +
            类型: + + <#for item : prdList> + + +
            行业: + + <#for item : indList> + + +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/worksShare.zml b/Yangcai365_web/manage/zview/works/worksShare.zml new file mode 100644 index 0000000..64a9b56 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/worksShare.zml @@ -0,0 +1,82 @@ + + +${Styles.src("/zinc/css/design_2018102301.css")} +${Scripts.src("/zinc/js/works_20171030.js")} +${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")} +${zhiqim_manager_breadcrumb_parent("/worksMy.htm", "我的作品", "分享给我的")} +${zhiqim_manager_content()} + +<#-- 导航栏 --> +
            + +
            + +<#-- 关键词搜索 --> +
            + + + +
            + + + + + + + + + + +
            类型: + + <#for item : prdList> + + +
            行业: + + <#for item : indList> + + +
            + +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/works/worksShow.zml b/Yangcai365_web/manage/zview/works/worksShow.zml new file mode 100644 index 0000000..1b57d0d --- /dev/null +++ b/Yangcai365_web/manage/zview/works/worksShow.zml @@ -0,0 +1,303 @@ + + + +
            +
            +
              + <#for path : Arrays.toStringArray(works.getThumbImagePath())> +
            • + +
            +
            +
            +
              +
            • ID:${works.getWorksId()}
            • +
            • 创建时间:${works.getCreateTime()}
            • +
            • <#if works.getWorksName() != null>名称:${works.getWorksName()} | 设计师:${works.getDesigner()}
            • +
            • + 浏览(${browseNum}) + 收藏(${collectNum}) +
            • +
            • +
              + <#if works.getWorksType() == 0> + <#if works.getWorksType() == 1> + <#if works.getWorksType() == 2> +
              +
              +
            • +
            • +
              + + <#if ZmrPathRule.check(request, "/labelRelation.htm")> + + 行业属性 +
              +
                +
              • + ${Global.get(ProductTypeCache.class).getName(works.getPrdTypeId())}   + ${Global.get(DesignIndustryCache.class).getIndustryName(works.getIndustryId())}   + ${works.getIndustrySubName()}   + ${works.getAttributeName()}   +
              • +
              +
            • +
            • +
              关键词
              +
              +
              + <#for keyword : DesignerPresenter.updateKeywordArr(works.getKeywordName(), "work", works.getWorksId())> + ${keyword} + +
              +
              +
              +
            • + + <#if ZmrPathRule.check(request, "doWorksDelete")> +
            • +
              作品操作
              +
              + + +
              +
            • + + +
            +
            +
            diff --git a/Yangcai365_web/manage/zview/works/worksShowPC.zml b/Yangcai365_web/manage/zview/works/worksShowPC.zml new file mode 100644 index 0000000..fdb5ce2 --- /dev/null +++ b/Yangcai365_web/manage/zview/works/worksShowPC.zml @@ -0,0 +1,117 @@ + + + +
            +
            +
              + <#if media.getMediaUrl().indexOf(",")==-1> +
            • + <#else> + <#for path : Arrays.toStringArray(media.getMediaUrl())> +
            • + +

            • + + +
            +
            +
            +
              + + <#if media.getTypeId()!=3> +
            • + ID:${media.getMediaId()} + + + +
            • + <#else> +
            • +
              名称:${media.getMediaName()}

              + ID:${media.getMediaId()} + + +

              +
              P 数:${media.getPageValue()}P

              +
              版式:<#if media.getOddEven()=0>横版<#elseif media.getOddEven()=1>竖版${media.getWidthMm()}X${media.getHeightMm()}mm
              +
            • + +
            • 创建时间:${media.getCreateTime()}
            • +
            • +
              + 行业属性 +
              +
                +
              • + ${Global.get(ProductTypeCache.class).getName(media.getTypeId())}   + ${Global.get(DesignIndustryCache.class).getIndustryName(media.getIndustryId())}   + ${media.getIndustrySubName()}   + ${media.getAttributeName()}   +
              • +
              +
            • +
            • +
              关键词
              +
              +
              + <#for keyword : DesignerPresenter.updateKeywordArr(media.getKeywordName(), "work", media.getMediaId())> + ${keyword} + +
              +
              +
            • +
            +
            +
            diff --git a/Yangcai365_web/manage/zview/works/worksUpload.zml b/Yangcai365_web/manage/zview/works/worksUpload.zml new file mode 100644 index 0000000..0567f7f --- /dev/null +++ b/Yangcai365_web/manage/zview/works/worksUpload.zml @@ -0,0 +1,279 @@ +${Scripts.src(zhiqim_uploadlarge.js)} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            作品类型选择: + +
            作品行业选择: + <#for item : indList> + + +
            子行业选择: + <#for item : inSubList> + + +
            作品名称: + +
            作品关键字: +   用于作品搜索,多组关键字用空格隔开 +
            设计文件上传(默认不断点续传):  必须是cdr文件
            印刷文件上传(默认不断点续传):  必须是pdf文件
            \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/zhiqim_manager/attaFileMaterials.zml b/Yangcai365_web/manage/zview/zhiqim_manager/attaFileMaterials.zml new file mode 100644 index 0000000..47f63c7 --- /dev/null +++ b/Yangcai365_web/manage/zview/zhiqim_manager/attaFileMaterials.zml @@ -0,0 +1,406 @@ +${Styles.htmlOverflowYAuto()} +${Scripts.src(zhiqim_uploadlarge.js)} + +${Htmls.toCallFrame()} + + +<#for item : attaList> +<#if item.getId() == "copy"> + + + + + + <#if Validates.isNotEmpty(order)> + + <#else> + + + + +<#if item.getId() == "userText"> + + + + + + + + +<#if item.getType() == "file"> + + + + + + + + + +<#if item.getType() == "thumFile"> + + + + + + + + +<#if item.getType() == "firstThumFile"> + + + + + + + + +<#if item.getId() == "userNotice"> + + + + + + + + + + + + + + + + + +
            产品信息: + + + + +
            ${order.getDesignId()}-${order.getBuyerNick()}-${order.getOrderText()}
            客户文本:
            + +
            + ${item.getName()} + + <#if item.getId() == "EndFile" && endFileLink != null> + + + + + +
            +
            z-h100<#elseif item.getName()=="印刷文件">z-h50<#else>z-h60"> + <#for atta : fileList> + <#if Validates.isEqual(atta.getAttaModul(), item.getId())> +
            showThumImg('${atta.getAttaId()}', '${atta.getFileType()}')" title="${atta.getFileName()}"> + ${atta.getFileName()}
            +
            + + +
            +
            ${item.getName()}:
            +
            <#if Validates.isNotEmpty(item.getSavePath())>
            +
            ${item.getName()}:
            + <#if order != null> +
            + +
            注意事项:
            + +
            客服留言:
            + +
            diff --git a/Yangcai365_web/manage/zview/zhiqim_manager/backLogWork.zml b/Yangcai365_web/manage/zview/zhiqim_manager/backLogWork.zml new file mode 100644 index 0000000..efc10f5 --- /dev/null +++ b/Yangcai365_web/manage/zview/zhiqim_manager/backLogWork.zml @@ -0,0 +1,237 @@ +${Scripts.src("/zinc/js/global_2019010801.js")} + + +${zhiqim_manager_breadcrumb("待办事项")} +${zhiqim_manager_content()} +<#-- 导航栏 --> +
            + +
            + + + +<#-- 左侧功能 --> +
            + <#-- 查询条件 --> + ${zhiqim_manager_title("查询条件")} +
            + + + + + + + + + + + + + + + + +
            订单号:旺 旺 号: + 发出时间: -  + +
            + 接收人:  + + 处理状态: + + 催稿主题: +
            催稿号:
            +
            + + <#-- 操作功能 --> +
            + + + <#if ZmrPathRule.check(request, "/assignDesigner.htm")> + +
            + + <#-- 列表--> +
            + + + + + + + + + + + + + + + + + ${zhiqim_manager_tr_no_record(pageResult, 20, "暂时没有催稿信息")} + <#for item : pageResult.list()> + + + style="color:#AAAAAA"> + + + + + + + + + + + + + + + +
            选择催稿单号订单号旺旺号主题发送者发送时间消息内容接收者订单状态处理状态处理时间备注
            ${item.getId()}
            ${item.getDesignId()}
            + <#if ordMap.get(item.getDesignId()).getReDesignSrcId() gt 0> + <#if ordMap.get(item.getDesignId()).isUrgent()> + <#if ordMap.get(item.getDesignId()).isHighQualityOrder()> + <#if ordMap.get(item.getDesignId()).getIsOldUser() gt 0> + <#if !(ordMap.get(item.getDesignId()).getAmount() lt 30000)> + <#if ordMap.get(item.getDesignId()).getShowRedMark() == 1> +
            ${item.getBuyerNick()}${MessageThemeConstants.getName(item.getTopic())}${item.getProductionCode()}${Sqls.toDateTimeString(item.getProductionTime())}${item.getMessageBody()}${item.getConsumerCode()}${StatusConstants.getStatus(ordMap.get(item.getDesignId()).getStatus())} + <#if item.getConsumerState() == 0> + 未处理 + <#elseif item.getConsumerState() == 1> + 已处理 + <#else> + ${Sqls.toDateTimeString(item.getConsumerTime())}${item.getRemark()}
            +
            + ${zhiqim_manager_paging(pageResult, "/manager/backLogWork.htm")} +
            +${zhiqim_manager_content_end()} + +<#-- 联系旺旺&联系QQ弹窗框 --> + \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/zhiqim_manager/main.zml b/Yangcai365_web/manage/zview/zhiqim_manager/main.zml new file mode 100644 index 0000000..153fcd9 --- /dev/null +++ b/Yangcai365_web/manage/zview/zhiqim_manager/main.zml @@ -0,0 +1,484 @@ +${zhiqim_manager_content()} + + + + + + + + +
            +
            +
            +
            + 本月定稿率 +
            +
            +
            + 本月退款率 +
            +
            +
            +
            订单概述
            +
            +
            +
            + 今日接单量 +
            +
            + + +
            +
            +
            +
            + 今日定稿量 +
            +
            + + +
            +
            +
            +
            + 今日退款量 +
            +
            + + +
            +
            +
            +
            + 本月接单量 +
            +
            + + +
            +
            +
            +
            + 本月定稿量 + + +
            + +
            + + + +
            +
            +
            +
            + 本月退款量 +
            +
            + + +
            +
            +
            +
            + 上月接单量 +
            +
            + + +
            +
            +
            +
            + 上月定稿量 +
            +
            + + +
            +
            +
            +
            + 上月退款量 +
            +
            + + +
            +
            +
            +
            未完成订单
            +
            +
            +
            + 24小时内未完成 +
            +
            + + +
            +
            +
            +
            + 24-48小时未完成 +
            +
            + + +
            +
            +
            +
            + 48小时以上未完成 +
            +
            + + +
            +
            +
            +
            +
            +
            + +${zhiqim_manager_content_end()} diff --git a/Yangcai365_web/manage/zview/zhiqim_manager/notice.zml b/Yangcai365_web/manage/zview/zhiqim_manager/notice.zml new file mode 100644 index 0000000..4d51616 --- /dev/null +++ b/Yangcai365_web/manage/zview/zhiqim_manager/notice.zml @@ -0,0 +1,25 @@ +${zhiqim_manager_breadcrumb("公告列表")} +${zhiqim_manager_content()} +${sweet_alert_reuse_method()} +<#-- 列表 --> + + + + + + +<#for item : result.list()> + + + + + + +${zhiqim_manager_tr_no_record(result, 10, "暂时没有公告")} +
            公告标题公告内容发布时间
            #{item.getNoticeTitle()}#{item.getNoticeContent()}#{Sqls.toDateTimeString(item.getReleaseTime())}
            + + + + +
            ${PagingGo.toHtmlLink(result)}
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/zhiqim_manager/operatorModify.zml b/Yangcai365_web/manage/zview/zhiqim_manager/operatorModify.zml new file mode 100644 index 0000000..3db2070 --- /dev/null +++ b/Yangcai365_web/manage/zview/zhiqim_manager/operatorModify.zml @@ -0,0 +1,136 @@ +${zhiqim_manager_history("operator.htm")} +${request.getValidateScript()} + + + +${zhiqim_manager_breadcrumb_parent("operator.htm" "操作员管理" "修改操作员")} +${zhiqim_manager_content()} + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<#if ZmrSuperAdminRule.check(request)> + + + + +<#else> + + + + + +
            修改操作员
            操作员编码:${operator.getOperatorCode()}
            操作员名称:(64位不定长字符) *
            操作员密码:(为空表示不修改,如果修改请输入6-16位密码,大小写字母数字特殊字符必须四选三,特殊字符支持._-`~!@#$%  
            操作员状态:(停用或正常) + +  * +
            操作员手机号: *
            操作员个人微信号: *
            操作员类型:(管理员或操作员) + +  * +
            操作员类型: + + <#if operator.getOperatorType()=2>操作员 + <#if operator.getOperatorType()=1>管理员 + <#if operator.getOperatorType()=0>超级管理员 +
            + + + + + +
            返回上一页
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/Yangcai365_web/manage/zview/zhiqim_manager/reg.zml b/Yangcai365_web/manage/zview/zhiqim_manager/reg.zml new file mode 100644 index 0000000..560d79f --- /dev/null +++ b/Yangcai365_web/manage/zview/zhiqim_manager/reg.zml @@ -0,0 +1,222 @@ +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} + + + +
            +
            欢迎注册 [ ${context.getContextName()} ]!
            + + +
            + + + +
            +
            设计师注册协议x
            +
            +

            一、总则

            +

            1.1 秒绘设计平台网站的所有权和运营权归湖南秒绘科技有限公司所有。

            +

            1.2 用户在注册之前,应当仔细阅读本协议,并同意遵守本协议后方可成为注册用户。一旦注册成功,则用户与秒绘设计平台网站两者之间自动形成协议关系,用户应当受本协议的约束。用户在使用特殊的服务或产品时,应当同意接受相关协议后方能使用。

            +

            1.3 本协议则可由秒绘设计平台网站随时更新,用户应当及时关注并同意本站不承担通知义务。本站的通知、公告、声明或其它类似内容是本协议的一部分。

            +

            二、服务内容

            +

            2.1 秒绘设计平台网站的具体内容由本站根据实际情况提供。

            +

            2.2 本站仅提供相关的技术服务。

            +

            三、用户帐号

            +

            3.1 经本站注册系统完成注册程序并通过身份认证的用户即成为正式用户,可以获得本站规定用户所应享有的一切权限;秒绘设计平台网站有权对用户的权限设计进行变更。

            +

            3.2 用户只能按照注册要求注册。用户有义务保证密码和帐号的安全,用户利用该密码和帐号所进行的一切活动引起的任何损失或损害,由用户自行承担全部责任,本站不承担任何责任。如用户发现帐号遭到未授权的使用或发生其他任何安全问题,应立即修改帐号密码并妥善保管,如有必要,请通知本站。因黑客行为或用户的保管疏忽导致帐号非法使用,本站不承担任何责任。

            +

            四、使用规则

            +

            4.1 4.1 遵守中华人民共和国相关法律法规,包括但不限于《中华人民共和国计算机信息系统安全保护条例》、《计算机软件保护条例》、《最高人民法院关于审理涉及计算机网络著作权纠纷案件适用法律若干问题的解释(法释[2004]1号)》、《全国人大常委会关于维护互联网安全的决定》、《互联网电子公告服务管理规定》、《互联网新闻信息服务管理规定》、《互联网著作权行政保护办法》和《信息网络传播权保护条例》等有关计算机互联网规定和知识产权的法律和法规、实施办法。

            +

            4.2 用户对其自行发表、上传或传送的内容负全部责任,所有用户不得在本站任何页面发布、转载、传送含有下列内容之一的信息,否则本站有权自行处理并不通知用户: (1)违反宪法确定的基本原则的; (2)危害国家安全,泄漏国家机密,颠覆国家政权,破坏国家统一的; (3)损害国家荣誉和利益的; (4)煽动民族仇恨、民族歧视,破坏民族团结的; (5)破坏国家宗教政策,宣扬邪教和封建迷信的; (6)散布谣言,扰乱社会秩序,破坏社会稳定的; (7)散布淫秽、色情、赌博、暴力、恐怖或者教唆犯罪的; (8)侮辱或者诽谤他人,侵害他人合法权益的; (9)煽动非法集会、结社、游行、示威、聚众扰乱社会秩序的; (10)以非法民间组织名义活动的; (11)含有法律、行政法规禁止的其他内容的。

            +

            4.3用户承诺对其发表或者上传于本站的所有信息(即属于《中华人民共和国著作权法》规定的作品,包括但不限于文字、图片、音乐、电影、表演和录音录像制品和电脑程序等)均享有完整的知识产权,或者已经得到相关权利人的合法授权;如用户违反本条规定造成本站被第三人索赔的,用户应全额补偿本站一切费用(包括但不限于各种赔偿费、诉讼代理费及为此支出的其它合理费用);

            +

            4.4当第三方认为用户发表或者上传于本站的信息侵犯其权利,并根据《信息网络传播权保护条例》或者相关法律规定向本站发送权利通知书时,用户同意本站可以自行判断决定删除涉嫌侵权信息,除非用户提交书面证据材料排除侵权的可能性,本站将不会自动恢复上述删除的信息; (1)不得为任何非法目的而使用网络服务系统; (2)遵守所有与网络服务有关的网络协议、规定和程序; (3)不得利用本站进行任何可能对互联网的正常运转造成不利影响的行为; (4)不得利用本站进行任何不利于本站的行为。

            +

            4.5如用户在使用本站时违反上述任何规定,本站有权要求用户改正或直接采取一切必要的措施(包括但不限于删除用户张贴的内容、暂停或终止用户使用本站的权利)以减轻用户不当行为而造成的影响。

            +

            五、隐私保护

            +

            5.1 本站不对外公开或向第三方提供单个用户的注册资料及用户在使用网络服务时存储在本站的非公开内容,但下列情况除外: (1)事先获得用户的明确授权; (2)根据有关的法律法规要求; (3)按照相关政府主管部门的要求; (4)为维护社会公众的利益。

            +

            5.2 本站可能会与第三方合作向用户提供相关的网络服务,在此情况下,如该第三方同意承担与本站同等的保护用户隐私的责任,则本站有权将用户的注册资料等提供给该第三方。

            +

            5.3 在不透露单个用户隐私资料的前提下,本站有权对整个用户数据库进行分析并对用户数据库进行商业上的利用。

            +

            六、版权声明

            +

            6.1 本站的文字、图片、音频、视频等版权均归湖南秒绘科技有限公司享有或与作者共同享有,未经本站许可,不得任意转载。

            +

            6.2 本站特有的标识、版面设计、编排方式等版权均属湖南秒绘科技有限公司享有,未经本站许可,不得任意复制或转载。 

            +

            6.3 使用本站的任何内容均应注明“来源于秒绘设计平台网站”及署上作者姓名,按法律规定需要支付稿酬的,应当通知本站及作者及支付稿酬,并独立承担一切法律责任。

            +

            6.4 本站享有所有作品用于其它用途的优先权,包括但不限于网站、电子杂志、平面出版等,但在使用前会通知作者,并按同行业的标准支付稿酬。

            +

            6.5 本站所有内容仅代表作者自己的立场和观点,与本站无关,由作者本人承担一切法律责任。 

            +

            6.6 恶意转载本站内容的,本站保留将其诉诸法律的权利。

            +

            七、责任声明

            +

            7.1 用户明确同意其使用本站所存在的风险及一切后果将完全由用户本人承担,秒绘设计平台网站对此不承担任何责任。 

            +

            7.2 本站无法保证服务一定能满足用户的要求,也不保证服务的及时性、安全性、准确性。 

            +

            7.3 本站不保证为方便用户而设置的外部链接的准确性和完整性,同时,对于该等外部链接指向的不由本站实际控制的任何网页上的内容,本站不承担任何责任。

            +

            7.4 对于因不可抗力或本站不能控制的原因造成的服务中断或其它缺陷,本站不承担任何责任,但将尽力减少因此而给用户造成的损失和影响。

            +

            7.5 对于本站向用户提供的下列产品或者服务的质量缺陷本身及其引发的任何损失,本站无需承担任何责任: (1)本站向用户免费提供的各项服务; (2)本站向用户赠送的任何产品或者服务。

            +

            7.6 本站有权于任何时间暂时或永久修改或终止本服务(或其任何部分),而无论其通知与否,本站对用户和任何第三人均无需承担任何责任。

            +

            八、附则

            +

            8.1 本协议的订立、执行和解释及争议的解决均应适用中华人民共和国法律。 

            +

            8.2 如本协议中的任何条款无论因何种原因完全或部分无效或不具有执行力,本协议的其余条款仍应有效并且有约束力。

            +

            8.3 本协议解释权及修订权归湖南秒绘科技有限公司所有。

            +
            +
            + + diff --git a/Yangcai365_web/manage/zview/zhiqim_manager/resetPassword.zml b/Yangcai365_web/manage/zview/zhiqim_manager/resetPassword.zml new file mode 100644 index 0000000..6d5dbac --- /dev/null +++ b/Yangcai365_web/manage/zview/zhiqim_manager/resetPassword.zml @@ -0,0 +1,129 @@ +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} + + + +
            +
            欢迎注册 [ ${context.getContextName()} ]!
            + + +
            + diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/TestMain.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/TestMain.java new file mode 100644 index 0000000..6a4ea0b --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/TestMain.java @@ -0,0 +1,41 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.client; + +import org.zhiqim.kernel.util.Strings; + +import com.zhiqim.yangcai.design.client.order.update.DesignOrderUpdateInfoRequest; +import com.zhiqim.yangcai.design.client.order.update.DesignOrderUpdateInfoResponse; + +public class TestMain +{ + public static void main(String[] args) + { + String resetUrl = "http://127.0.0.1:10080/designRest.htm"; + YangcaiClientParam param = new YangcaiClientParam(); + param.setConnectTimeout(10); + param.setReadTimeout(3); + param.setRestUrl(resetUrl); + param.setAppKey(Strings.valueOf("1823193185001")); + param.setAppSecret("32B1CCF38368E42AD31413B90309F69A"); + + // 订单更新接口 + DesignOrderUpdateInfoRequest douiReq = new DesignOrderUpdateInfoRequest(); + douiReq.setMerchantId(Long.parseLong("1823193185001")); + douiReq.setDesignId(Long.parseLong("1907758060194")); + douiReq.setServicesMessage("123456"); + douiReq.setIndustryId(Long.parseLong("4690")); + DesignOrderUpdateInfoResponse douiResp = YangcaiClient.execute(douiReq, param); + System.out.println(douiResp.getErrorCode()); + System.out.println(douiResp.getErrorMsg()); + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiApi.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiApi.java new file mode 100644 index 0000000..6c2b38b --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiApi.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.client; + +/*** + * 扬彩设计平台接口常量类 + * + * @version v1.0.0 @author lgz 2018-12-18 新建与整理 + */ +public interface YangcaiApi +{ + /*** 创建订单接口 */ + public final static String ORDER_CREATE = "design.order.create"; + /*** 创建补单接口 */ + public final static String ORDER_RE_CREATE = "design.order.recreate"; + /** 修改订单规格 */ + public final static String ORDER_UPDATE_SPECIFICATION = "design.order.update.specification"; + /*** 订单同步接口 */ + public final static String ORDER_SYN = "design.order.syn"; + /** 更换客户文件资料 **/ + public final static String ORDER_UPDATE_CUSTOM_FILE = "design.order.update.custom.file"; + /** 修改订单文字资料 */ + public final static String ORDER_UPDATE_TEXT_INFO = "design.order.update.text.info"; + /** 订单信息修改 **/ + public final static String ORDER_UPDATE_INFO = "design.order.update.info"; + /*** 订单审核退回 */ + public final static String ORDER_CHECK_BACK = "design.order.check.back"; + /*** 订单退款 */ + public final static String ORDER_UPDATE_REFUND = "design.order.refund"; + + /******************************/ + // ****订单部分 + /******************************/ + /*** 售后创建接口 */ + public final static String AFTER_CREATE = "design.after.create"; + /*** 售后同步接口 */ + public final static String AFTER_SYN = "design.after.syn"; + /*** 售后取消接口 */ + public final static String AFTER_CANCEL = "design.after.cancel"; + /*** 申诉退回接口 */ + public final static String AFTER_COMPLAIN_RETURN = "design.after.complain.return"; + /*** 申诉通过信息同步接口 */ + public final static String AFTER_COMPLAIN_PERSON = "design.after.complain.person"; + + /******************************/ + // ****投诉单 + /******************************/ + /*** 投诉单同步接口 */ + public final static String COMPLAIN_SYN = "design.complain.syn"; +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiApiFile.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiApiFile.java new file mode 100644 index 0000000..04db704 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiApiFile.java @@ -0,0 +1,92 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client; + +import org.zhiqim.kernel.json.Jsons; + +/**** + * 文件对象 + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public class YangcaiApiFile +{ + private long designId; //1设计订单号 + private long attaId; //2附件编号 + private String attaModule; //3附件类型 + private String fileName; //4文件名,接口请求必须字段 + private String fileExt; //5文件后缀名 ,接口请求必须字段 + private long fileSize; //6文件大小,接口请求必须字段 + private String downUrl; //7下载地址,接口请求必须字段 + + public long getDesignId() + { + return designId; + } + public void setDesignId(long designId) + { + this.designId = designId; + } + public long getAttaId() + { + return attaId; + } + public void setAttaId(long attaId) + { + this.attaId = attaId; + } + public String getAttaModule() + { + return attaModule; + } + public void setAttaModule(String attaModule) + { + this.attaModule = attaModule; + } + public String getFileName() + { + return fileName; + } + public void setFileName(String fileName) + { + this.fileName = fileName; + } + public String getFileExt() + { + return fileExt; + } + public void setFileExt(String fileExt) + { + this.fileExt = fileExt; + } + public long getFileSize() + { + return fileSize; + } + public void setFileSize(long fileSize) + { + this.fileSize = fileSize; + } + public String getDownUrl() + { + return downUrl; + } + public void setDownUrl(String downUrl) + { + this.downUrl = downUrl; + } + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiClient.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiClient.java new file mode 100644 index 0000000..deab8d6 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiClient.java @@ -0,0 +1,52 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.client; + +import org.zhiqim.kernel.constants.HttpConstants; +import org.zhiqim.kernel.httpclient.HttpPost; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; + +public class YangcaiClient implements HttpConstants +{ + private static final Log log = LogFactory.getLog(YangcaiClient.class); + + public static T execute(YangcaiClientRequest req, YangcaiClientParam param) + { + if (param == null || !param.isValid()) + { + throw new RuntimeException("未配置接口参数或参数不正确不允许调用"); + } + + T resp = req.newResponse(); + req.buildSign(param.getAppKey(), param.getAppSecret()); + String queryString = req.buildQueryString(); + HttpPost conn = new HttpPost(param.getRestUrl()); + conn.setQueryString(queryString, _UTF_8_); + conn.setConnectTimeout(param.getConnectTimeout()); + conn.setReadTimeout(param.getReadTimeout()); + conn.execute(); + + int responseStatus = conn.getResponseStatus(); + String responseText = conn.getResponseText(); + if (responseStatus != 200) + {// 通信问题 + log.error("调用接口HTTP错误,错误码[" + responseStatus + "],请求:[" + req.toString() + "]"); + resp.buildResponseError(responseStatus, "HTTP响应错误码:" + responseStatus); + return resp; + } + + // 调用成功 + resp.buildResponseText(responseText); + return resp; + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiClientParam.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiClientParam.java new file mode 100644 index 0000000..65517da --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiClientParam.java @@ -0,0 +1,98 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client; + +import org.zhiqim.kernel.util.Validates; + +/*** + * 下单发货平台 接口参数 + * + * @version v1.0.0 @author Administrator 2018-12-2 新建与整理 + */ +public class YangcaiClientParam +{ + private String restUrl = null; // 应用API调用地址 + + private String appKey; //API调用用户昵称 或者 商户编号 + private String appSecret; // API调用用户密钥 + + private int connectTimeout = 10; // API调用时允许的连接超时时长 + private int readTimeout = 3*60; // API调用时允许的连接读取时长 默认3分钟 + + /** 简单判断是否传入了KEY和密钥 */ + public boolean isValid() + { + if (Validates.isEmptyBlank(restUrl) || Validates.isEmptyBlank(appSecret)) + return false; + + return true; + } + + /*****************************************/ + // 设置&获取属性 + /*****************************************/ + public String getRestUrl() + { + return restUrl; + } + + public void setRestUrl(String restUrl) + { + this.restUrl = restUrl; + } + + public String getAppSecret() + { + return appSecret; + } + + public void setAppSecret(String appSecret) + { + this.appSecret = appSecret; + } + + public int getConnectTimeout() + { + return connectTimeout; + } + + public void setConnectTimeout(int connectTimeout) + { + if (connectTimeout < 10 || connectTimeout > 60) + return; + + this.connectTimeout = connectTimeout; + } + + public int getReadTimeout() + { + return readTimeout; + } + + public void setReadTimeout(int readTimeout) + { + if (readTimeout < 10 || readTimeout > 30*60) + return; + + this.readTimeout = readTimeout; + } + + public String getAppKey() + { + return appKey; + } + + public void setAppKey(String appKey) + { + this.appKey = appKey; + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiClientRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiClientRequest.java new file mode 100644 index 0000000..9fa0a30 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiClientRequest.java @@ -0,0 +1,200 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client; + +import java.util.Map; +import java.util.TreeMap; + +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.MD5; + +public abstract class YangcaiClientRequest implements YangcaiApi +{ + private String method; + private String timestamp; + private String sign; + + private TreeMap paramMap = new TreeMap(); + public YangcaiClientRequest() + { + this.method = getMethod(); + this.timestamp = DateTimes.getDateTimeString(); + } + + /********************************************************/ + // 以下为子类必须实现方法 + /********************************************************/ + + /** + * 子类必须实现方法获取 + * + * @return 方法名称 + */ + public abstract String getMethod(); + + /** + * 子类必须实现响应对象的初始化 + * + * @return 响应对象 + */ + public abstract T newResponse(); + + /** + * 子类必须实现属性设置到MAP中,图片除外 + */ + protected abstract void buildQueryBody(); + + + /********************************************************/ + // 以下为父类提供的子类调用方法 + /********************************************************/ + + /** 增加INT参数 */ + protected void addParam(String key, int value) + { + if (value == -1) + return; + + paramMap.put(key, "" + value); + } + + /** 增加LONG参数 */ + protected void addParam(String key, long value) + { + if (value == -1) + return; + + paramMap.put(key, "" + value); + } + + /** 增加String参数 */ + protected void addParam(String key, String value) + { + if (Validates.isEmptyBlank(value)) + return; + + paramMap.put(key, Strings.trim(value)); + } + + /** 增加boolean参数 */ + protected void addParam(String key, boolean value) + { + paramMap.put(key, "" + value); + } + + /** 增加Object参数 */ + protected void addParam(String key, Object value) + { + if (Validates.isEmpty(value)) + return; + + paramMap.put(key, Jsons.toString(value)); + } + + /********************************************************/ + // 以下为提供的外部调用方法 + /********************************************************/ + /**request 另加参数时 调用 增加INT参数 */ + public void addOtherParam(String key, int value) + { + if (value == -1) + return; + + paramMap.put(key, "" + value); + } + + /**request 另加参数时 调用 增加LONG参数 */ + public void addOtherParam(String key, long value) + { + if (value == -1) + return; + + paramMap.put(key, "" + value); + } + /**request 另加参数时 调用 增加double参数 */ + public void addOtherParam(String key, double value) + { + if (value == -1) + return; + + paramMap.put(key, "" + value); + } + /** 增加String参数 */ + public void addOtherParam(String key, String value) + { + if (Validates.isEmptyBlank(value)) + return; + + paramMap.put(key, Strings.trim(value)); + } + + /**request 另加参数时 调用 增加boolean参数 */ + public void addOtherParam(String key, boolean value) + { + paramMap.put(key, "" + value); + } + + /**request 另加参数时 调用 增加Object参数 */ + public void addOtherParam(String key, Object value) + { + if (Validates.isEmpty(value)) + return; + + paramMap.put(key, Jsons.toString(value)); + } + + /** + * 生成签名,本方法需子类实现buildSignBody + * + * @param appSecret 传入密钥 + */ + public void buildSign(String appKey, String appSecret) + { + // 系统参数 + addParam("method", method); + addParam("timestamp", timestamp); + addParam("appKey", appKey); + + StringBuffer strb = new StringBuffer(); + strb.append(appSecret).append(method).append(timestamp).append(appKey).append(appSecret); + this.sign = MD5.encodeUTF8(strb.toString()); + } + + /** + * 生成请求QueryString,该方法必须在buildSign之后执行 + * http://order.redxyz.net/rest.htm?sign= + * 2B4B434E207025583B069F0D0A5EE91E×tamp + * =2011-07-01+13%3A52%3A03&v=2.0&nick=test&method=order.tid.get + * @return 返回如foo=1&abc=2之类的字符串 + */ + public String buildQueryString() + { + buildQueryBody(); + StringBuffer strb = new StringBuffer("sign=").append(sign); + for (Map.Entry entry : paramMap.entrySet()) + { + String value = Urls.encodeUTF8(entry.getValue()); + strb.append("&").append(entry.getKey()).append("=").append(value); + } + + return strb.toString(); + } + + public String toString() + { + return buildQueryString(); + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiClientResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiClientResponse.java new file mode 100644 index 0000000..193287a --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/YangcaiClientResponse.java @@ -0,0 +1,124 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client; + +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Validates; + +/*** + * 相应基类 + * @version v1.0.0 @author longguizhi 2018-12-2 新建与整理 + */ +public abstract class YangcaiClientResponse +{ + // 在基类加上统一的错误标识 + private YangcaiErrorResponse error; + private String responseText; + + /** + * 子类实现解析成功时的响应结果,默认失败时子类数据未初始化 + * + * @param json 由淘宝回传的字符串 + */ + protected abstract void buildResponse(String json); + + /** + * 基类解析自定义错误,在发送淘宝前或发送到淘宝时失败,淘宝未正常响应 + * + * @param code 主错误码 + * @param msg 主错误描述 + * @param subCode 子错误码 + * @param subMsg 子错误描述 + * @param args 参数信息 + */ + public void buildResponseError(int code, String msg) + { + error = new YangcaiErrorResponse(code, msg); + } + + /** + * 基类解析响应结果,先判断是否是错误,是错误由基类处理完即结束,如果是成功再由子类解析 + * + * @param responseText 由淘宝回传的字符串 + */ + public void buildResponseText(String responseText) + { + this.responseText = responseText; + + if (responseText.startsWith("{error:")) + { + String errorMsg = Jsons.getObject(responseText, "error"); + error = Jsons.toObject(errorMsg, YangcaiErrorResponse.class); + } + else if (responseText.startsWith(" apiFiles; + public long getDesignId() + { + return designId; + } + public void setDesignId(long designId) + { + this.designId = designId; + } + public long getDesignAfsId() + { + return designAfsId; + } + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + public int getAfterStatus() + { + return afterStatus; + } + public void setAfterStatus(int afterStatus) + { + this.afterStatus = afterStatus; + } + public long getProblemType() + { + return problemType; + } + public void setProblemType(long problemType) + { + this.problemType = problemType; + } + public String getProblemDesc() + { + return problemDesc; + } + public void setProblemDesc(String problemDesc) + { + this.problemDesc = problemDesc; + } + public Timestamp getCreateTime() + { + return createTime; + } + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + public Timestamp getModifyTime() + { + return modifyTime; + } + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + public long getMerchantId() + { + return merchantId; + } + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + public String getOutAfsId() + { + return outAfsId; + } + public void setOutAfsId(String outAfsId) + { + this.outAfsId = outAfsId; + } + public List getApiFiles() + { + return apiFiles; + } + public void setApiFiles(List apiFiles) + { + this.apiFiles = apiFiles; + } + public String getDesignerComplainReason() + { + return designerComplainReason; + } + public void setDesignerComplainReason(String designerComplainReason) + { + this.designerComplainReason = designerComplainReason; + } + + public String getDesignComplainCheckNote() + { + return designComplainCheckNote; + } + public void setDesignComplainCheckNote(String designComplainCheckNote) + { + this.designComplainCheckNote = designComplainCheckNote; + } + public String getAfterFinishNote() + { + return afterFinishNote; + } + public void setAfterFinishNote(String afterFinishNote) + { + this.afterFinishNote = afterFinishNote; + } + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterCancelRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterCancelRequest.java new file mode 100644 index 0000000..7f9665b --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterCancelRequest.java @@ -0,0 +1,74 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.after; + +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +/*** + * 售后同步请求 + * + * @version v1.0.0 @author lgz 2018-12-22 新建与整理 + */ +public class DesignAfterCancelRequest extends YangcaiClientRequest +{ + // 字段类型 接口字段 长度 是否必须 字段描述 + private long merchantId;// 是 商户标号 + private long designAfsId;// 64 是 第三方售后单号 + private String cancelNote;// 300 是 问题描述 + public String getMethod() + { + return AFTER_CANCEL; + } + + public DesignAfterCancelResponse newResponse() + { + return new DesignAfterCancelResponse(); + } + + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("designAfsId", designAfsId); + addParam("cancelNote", cancelNote); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignAfsId() + { + return designAfsId; + } + + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + + public String getCancelNote() + { + return cancelNote; + } + + public void setCancelNote(String cancelNote) + { + this.cancelNote = cancelNote; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterCancelResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterCancelResponse.java new file mode 100644 index 0000000..d2a8219 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterCancelResponse.java @@ -0,0 +1,40 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.after; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +/** + * 售后同步响应 + * + * @version v1.0.0 @author lgz 2018-12-22 新建与整理 + */ +public class DesignAfterCancelResponse extends YangcaiClientResponse +{ + //写参数字段 + private boolean isCanceled;// 是否已取消 + protected void buildResponse(String json) + { + setCanceled(Jsons.getBoolean(json, "isCanceled")); + } + public boolean isCanceled() + { + return isCanceled; + } + public void setCanceled(boolean isCanceled) + { + this.isCanceled = isCanceled; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterComplainPersonRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterComplainPersonRequest.java new file mode 100644 index 0000000..f0c0955 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterComplainPersonRequest.java @@ -0,0 +1,75 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignAfterComplainPassHandlerAlter.java + * 创建人 :高佳新 + * 创建时间:2019-5-29 + */ + +package com.zhiqim.yangcai.design.client.after; + +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +/** + * + * erp同步审核通过信息请求类 + * + * @version 1.0 @author 高佳新 2019-5-30 新建与整理 + */ +public class DesignAfterComplainPersonRequest extends YangcaiClientRequest +{ + // 字段类型 接口字段 长度 是否必须 字段描述 + private long merchantId;// 是 商户标号 + private long designAfsId;// 64 是 设计平台售后单号 + private String afsLosser;// 20 是 指定责任人 + + @Override + public String getMethod() + { + return AFTER_COMPLAIN_PERSON; + } + + @Override + public DesignAfterComplainPersonResponse newResponse() + { + return new DesignAfterComplainPersonResponse(); + } + + @Override + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("designAfsId", designAfsId); + addParam("afsLosser", afsLosser); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignAfsId() + { + return designAfsId; + } + + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + + public String getAfsLosser() + { + return afsLosser; + } + + public void setAfsLosser(String afsLosser) + { + this.afsLosser = afsLosser; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterComplainPersonResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterComplainPersonResponse.java new file mode 100644 index 0000000..b01379e --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterComplainPersonResponse.java @@ -0,0 +1,41 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignAfterComplainPassHandlerAlterResponse.java + * 创建人 :高佳新 + * 创建时间:2019-5-29 + */ + +package com.zhiqim.yangcai.design.client.after; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +/** + * + * erp申诉单通过设计平台信息同步响应 + * + * @version 1.0 @author 高佳新 2019-5-29 新建与整理 + */ +public class DesignAfterComplainPersonResponse extends YangcaiClientResponse +{ + + private boolean isHandlerAlter; // 信息是否修改成功 + + @Override + protected void buildResponse(String json) + { + setHandlerAlter(Jsons.getBoolean(json, "isHandlerAlter")); + } + + public boolean isHandlerAlter() + { + return isHandlerAlter; + } + + public void setHandlerAlter(boolean isHandlerAlter) + { + this.isHandlerAlter = isHandlerAlter; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterComplainReturnRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterComplainReturnRequest.java new file mode 100644 index 0000000..06451aa --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterComplainReturnRequest.java @@ -0,0 +1,74 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.after; + +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +/*** + * 售后同步请求 + * + * @version v1.0.0 @author lgz 2018-12-22 新建与整理 + */ +public class DesignAfterComplainReturnRequest extends YangcaiClientRequest +{ + // 字段类型 接口字段 长度 是否必须 字段描述 + private long merchantId;// 是 商户标号 + private long designAfsId;// 64 是 第三方售后单号 + private String returnNote;// 300 是 问题描述 + public String getMethod() + { + return AFTER_COMPLAIN_RETURN; + } + + public DesignAfterComplainReturnResponse newResponse() + { + return new DesignAfterComplainReturnResponse(); + } + + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("designAfsId", designAfsId); + addParam("returnNote", returnNote); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignAfsId() + { + return designAfsId; + } + + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + + public String getReturnNote() + { + return returnNote; + } + + public void setReturnNote(String returnNote) + { + this.returnNote = returnNote; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterComplainReturnResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterComplainReturnResponse.java new file mode 100644 index 0000000..0963acc --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterComplainReturnResponse.java @@ -0,0 +1,40 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.after; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +/** + * 售后同步响应 + * + * @version v1.0.0 @author lgz 2018-12-22 新建与整理 + */ +public class DesignAfterComplainReturnResponse extends YangcaiClientResponse +{ + //写参数字段 + private boolean isReturned;// 是否已取消 + protected void buildResponse(String json) + { + setReturned(Jsons.getBoolean(json, "isReturned")); + } + public boolean isReturned() + { + return isReturned; + } + public void setReturned(boolean isReturned) + { + this.isReturned = isReturned; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterCreateRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterCreateRequest.java new file mode 100644 index 0000000..8bf3edf --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterCreateRequest.java @@ -0,0 +1,179 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.after; + +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiApiFile; +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +/*** + * 售后同步请求 + * + * @version v1.0.0 @author lgz 2018-12-22 新建与整理 + */ +public class DesignAfterCreateRequest extends YangcaiClientRequest +{ + // 字段类型 接口字段 长度 是否必须 字段描述 + private long merchantId;// 是 商户标号 + private long designId;// 是 那条设计订单 出的售后 + private long newDesignId;// 是 那条设计订单 出的售后 + private String outAfsId;// 64 是 第三方售后单号 + private String problemDesc;// 300 是 问题描述 + private double lossAmount; + private List apiFiles;// 否 售后文件 + private Long picTypeId;// 否 售后原因 + private String afterBlamer;// 否 责任人 + private String afterHandler; // 否 处理人 (指派责任的人) + private String problemReason; // 是 售后问题原因 + + @Override + public String getMethod() + { + return AFTER_CREATE; + } + + @Override + public DesignAfterCreateResponse newResponse() + { + return new DesignAfterCreateResponse(); + } + + @Override + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("designId", designId); + addParam("outAfsId", outAfsId); + addParam("problemDesc", problemDesc); + addParam("newDesignId", newDesignId); + addParam("lossAmount", lossAmount); + addParam("aipFiles", Jsons.toString(apiFiles)); + addParam("picTypeId", picTypeId); + addParam("afterBlamer", afterBlamer); + addParam("afterHandler", afterHandler); + addParam("problemReason", problemReason); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public long getNewDesignId() + { + return newDesignId; + } + + public void setNewDesignId(long newDesignId) + { + this.newDesignId = newDesignId; + } + + public String getOutAfsId() + { + return outAfsId; + } + + public void setOutAfsId(String outAfsId) + { + this.outAfsId = outAfsId; + } + + public String getProblemDesc() + { + return problemDesc; + } + + public void setProblemDesc(String problemDesc) + { + this.problemDesc = problemDesc; + } + + public double getLossAmount() + { + return lossAmount; + } + + public void setLossAmount(double lossAmount) + { + this.lossAmount = lossAmount; + } + + public List getApiFiles() + { + return apiFiles; + } + + public void setApiFiles(List apiFiles) + { + this.apiFiles = apiFiles; + } + + public Long getPicTypeId() + { + return picTypeId; + } + + public void setPicTypeId(Long picTypeId) + { + this.picTypeId = picTypeId; + } + + public String getAfterBlamer() + { + return afterBlamer; + } + + public void setAfterBlamer(String afterBlamer) + { + this.afterBlamer = afterBlamer; + } + + public String getAfterHandler() + { + return afterHandler; + } + + public void setAfterHandler(String afterHandler) + { + this.afterHandler = afterHandler; + } + + public String getProblemReason() + { + return problemReason; + } + + public void setProblemReason(String problemReason) + { + this.problemReason = problemReason; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterCreateResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterCreateResponse.java new file mode 100644 index 0000000..bb37d26 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterCreateResponse.java @@ -0,0 +1,39 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.after; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +/** + * 售后同步响应 + * + * @version v1.0.0 @author lgz 2018-12-22 新建与整理 + */ +public class DesignAfterCreateResponse extends YangcaiClientResponse +{ + //写参数字段 + private long designAfsId;// 设计盘平台的售后单号 + protected void buildResponse(String json) + { + setDesignAfsId(Jsons.getLong(json, "designAfsId")); + } + public long getDesignAfsId() + { + return designAfsId; + } + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterSynRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterSynRequest.java new file mode 100644 index 0000000..27ff068 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterSynRequest.java @@ -0,0 +1,96 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.after; + +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +/*** + * 售后同步请求 + * + * @version v1.0.0 @author lgz 2018-12-29 新建与整理 + */ +public class DesignAfterSynRequest extends YangcaiClientRequest +{ + private long merchantId;// 是 订单商户编号 + private long designAfsId;// 否 设计订单号 平台 + private String outAfsId;// 否 外部系统售后单号 + private String startModifyTime;// 是 设计平台的订单开始变更时间,默认十分钟前 + private String endModifyTime;// 是 设计平台的订单结束时间,默认当前时间 + public String getMethod() + { + return AFTER_SYN; + } + + public DesignAfterSynResponse newResponse() + { + return new DesignAfterSynResponse(); + } + + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("designAfsId", designAfsId); + addParam("outAfsId", outAfsId); + addParam("startModifyTime", startModifyTime); + addParam("endModifyTime", endModifyTime); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignAfsId() + { + return designAfsId; + } + + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + + public String getOutAfsId() + { + return outAfsId; + } + + public void setOutAfsId(String outAfsId) + { + this.outAfsId = outAfsId; + } + + public String getStartModifyTime() + { + return startModifyTime; + } + + public void setStartModifyTime(String startModifyTime) + { + this.startModifyTime = startModifyTime; + } + + public String getEndModifyTime() + { + return endModifyTime; + } + + public void setEndModifyTime(String endModifyTime) + { + this.endModifyTime = endModifyTime; + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterSynResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterSynResponse.java new file mode 100644 index 0000000..9dcb224 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/after/DesignAfterSynResponse.java @@ -0,0 +1,60 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.after; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiApiFile; +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +/** + * 售后同步响应 + * + * @version v1.0.0 @author lgz 2018-12-29 新建与整理 + */ +public class DesignAfterSynResponse extends YangcaiClientResponse +{ + private List afterList; + protected void buildResponse(String json) + { + List list = new ArrayList();; + List orderJsons = Jsons.toList(Jsons.getString(json, "afterList"), String.class); + for (String orderJson : orderJsons) + { + DesignAfter order = Jsons.toObject(orderJson, DesignAfter.class); + List apiFiles = Jsons.toList(Jsons.getString(orderJson, "apiFiles"), YangcaiApiFile.class); + apiFiles = apiFiles != null ? apiFiles : new ArrayList(); + order.setApiFiles(apiFiles); + list.add(order); + } + + setAfterList(list); + } + + public List getAfterList() + { + return afterList; + } + + public void setAfterList(List afterList) + { + this.afterList = afterList; + } + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/complain/DesignComplainSynRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/complain/DesignComplainSynRequest.java new file mode 100644 index 0000000..4bf3e2f --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/complain/DesignComplainSynRequest.java @@ -0,0 +1,73 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignComplainSynRequest.java + * 创建人 :gjx + * 创建时间:2019-8-17 + */ + +package com.zhiqim.yangcai.design.client.complain; + +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +/** + * 投诉单同步状态请求 + * + * @version 1.0 @author gjx 2019-8-17 新建与整理 + */ +public class DesignComplainSynRequest extends YangcaiClientRequest +{ + private long merchantId;// 是 订单商户编号 + private String startModifyTime;// 是 设计平台的订单开始变更时间,默认十分钟前 + private String endModifyTime;// 是 设计平台的订单结束时间,默认当前时间 + + @Override + public String getMethod() + { + return COMPLAIN_SYN; + } + + @Override + public DesignComplainSynResponse newResponse() + { + return new DesignComplainSynResponse(); + } + + @Override + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("startModifyTime", startModifyTime); + addParam("endModifyTime", endModifyTime); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public String getStartModifyTime() + { + return startModifyTime; + } + + public void setStartModifyTime(String startModifyTime) + { + this.startModifyTime = startModifyTime; + } + + public String getEndModifyTime() + { + return endModifyTime; + } + + public void setEndModifyTime(String endModifyTime) + { + this.endModifyTime = endModifyTime; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/complain/DesignComplainSynResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/complain/DesignComplainSynResponse.java new file mode 100644 index 0000000..3fefe3c --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/complain/DesignComplainSynResponse.java @@ -0,0 +1,56 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignComplainSynResponse.java + * 创建人 :gjx + * 创建时间:2019-8-17 + */ + +package com.zhiqim.yangcai.design.client.complain; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +/** + * 投诉单同步响应 + * + * @version 1.0 @author gjx 2019-8-17 新建与整理 + */ +public class DesignComplainSynResponse extends YangcaiClientResponse +{ + private List complainList; + + @Override + protected void buildResponse(String json) + { + List list = new ArrayList<>(); + List orderJsons = Jsons.toList(Jsons.getString(json, "complainList"), String.class); + for (String orderJson : orderJsons) + { + DesignSynComplain order = Jsons.toObject(orderJson, DesignSynComplain.class); + list.add(order); + } + setComplainList(list); + + } + + public List getComplainList() + { + return complainList; + } + + public void setComplainList(List complainList) + { + this.complainList = complainList; + } + + @Override + public String toString() + { + return Jsons.toString(this); + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/complain/DesignSynComplain.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/complain/DesignSynComplain.java new file mode 100644 index 0000000..4da109a --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/complain/DesignSynComplain.java @@ -0,0 +1,147 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignSynComplain.java + * 创建人 :gjx + * 创建时间:2019-8-17 + */ + +package com.zhiqim.yangcai.design.client.complain; + +import org.zhiqim.kernel.json.Jsons; + +/** + * 设计平台 同步投诉单信息 响应 + * + * @version 1.0 @author gjx 2019-8-17 新建与整理 + */ +public class DesignSynComplain +{ + private long complainId; // 投诉单ID + private long designId; // 设计单号 + private String complainStatus; // 投诉状态 + private String finishImgPath; // 投诉单完结图片路径 + private String assistPerson; // 协助人 + private long assistOrg; // 协助组织 + private String undertakeOrgName; // 责任组织 + private String assistDeptManager; // 协助主管 + private String assistOrgName; // 协助组织名称 + private String undertakeDeptManager; // 责任主管 + private long undertakeOrg; // 责任组织 + + public long getComplainId() + { + return complainId; + } + + public void setComplainId(long complainId) + { + this.complainId = complainId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getComplainStatus() + { + return complainStatus; + } + + public void setComplainStatus(String complainStatus) + { + this.complainStatus = complainStatus; + } + + public String getFinishImgPath() + { + return finishImgPath; + } + + public void setFinishImgPath(String finishImgPath) + { + this.finishImgPath = finishImgPath; + } + + public String getAssistPerson() + { + return assistPerson; + } + + public void setAssistPerson(String assistPerson) + { + this.assistPerson = assistPerson; + } + + public String getAssistDeptManager() + { + return assistDeptManager; + } + + public void setAssistDeptManager(String assistDeptManager) + { + this.assistDeptManager = assistDeptManager; + } + + public long getAssistOrg() + { + return assistOrg; + } + + public void setAssistOrg(long assistOrg) + { + this.assistOrg = assistOrg; + } + + public String getAssistOrgName() + { + return assistOrgName; + } + + public void setAssistOrgName(String assistOrgName) + { + this.assistOrgName = assistOrgName; + } + + public String getUndertakeOrgName() + { + return undertakeOrgName; + } + + public void setUndertakeOrgName(String undertakeOrgName) + { + this.undertakeOrgName = undertakeOrgName; + } + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getUndertakeDeptManager() + { + return undertakeDeptManager; + } + + public void setUndertakeDeptManager(String undertakeDeptManager) + { + this.undertakeDeptManager = undertakeDeptManager; + } + + public long getUndertakeOrg() + { + return undertakeOrg; + } + + public void setUndertakeOrg(long undertakeOrg) + { + this.undertakeOrg = undertakeOrg; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrder.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrder.java new file mode 100644 index 0000000..55a59d9 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrder.java @@ -0,0 +1,448 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.client.order; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiApiFile; + +/**** + * 订单相应对象 + * + * @version v1.0.0 @author lgz 2018-12-18 新建与整理 + */ +public class DesignOrder +{ + private long merchantId; // 1.订单商户编号 + private long designId; // 2.设订单编号,设计平台独立编号 + private int status; // 3.订单状态 + private long industryId; // 4.所属行业 + private String designer; // 32.设计师 + private Timestamp designReceiveTime; // 33.设计师领单时间 + private Timestamp designBeginTime; // 34.设计师开始设计时间 + private Timestamp designDraftTime; // 35.设计师初稿时间 + private Timestamp designEndTime; // 36.设计师定稿时间 + private String designPauseReason; // 37.设计师暂停原因(新增字段) + private Timestamp designPauseTime; // 38.设计师暂停时间 + private String designExclude; // 39.设计师排除,多个逗号分隔 + private String designRequestReason; // 40.设计师请求主管支援原由 + private Timestamp requestTime; // 41.设计师请求主管支援 时间 + private String designRejectReason; // 42.主管支援拒绝原因 + private int designKeepDuration; // 43.设计师保留时长,单位分钟 + private int receiveType; // 44.订单领取类型,0手动领单, 1 自动派单,2 手工指定 + private String requestRefoundAcceptReason; // 45.请求退款原因 + private String canceler; // 46.取消人 + private Timestamp cancelTime; // 47.取消时间 + private String cancelReason; // 48.取消原因 + private Timestamp modifyTime; // 49.修改时间 + private String selfDraftDesigner;// 50.自来稿设计人 + private Timestamp selfDraftReceiveTime; // 51.自来稿领单时间 + private Timestamp selfDraftEndTime; // 52.自来稿设计提交时间 + private String selfDraftBacker; // 53.自来稿退回人 + private String selfDraftBackReason; // 54.自来稿退回原因 + private Timestamp selfDraftBackTime; // 55.自来稿退回时间 + private String checker; // 56.审核人员 + private Timestamp orgReceiveTime;// 57.组织分拣完成时间 + private List apiFiles = new ArrayList();// 相应的文件 + + // ***************************稳定后删除****************************** + private String endFileUrl;// 订单完成后 成品文件 下载路径 + private String endFileExt;// 订单完成后 成品扩展名 + private long endFileLength;// 订单完成后 文件大小 + + private String designFileUrl;// 订单完成后 设计文件 下载路径 + private String designFileExt;// 订单完成后 设计成品扩展名 + private long designFileLength;// 订单完成后 设计文件大小 + + // ********************************************************** + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public int getReceiveType() + { + return receiveType; + } + + public void setReceiveType(int receiveType) + { + this.receiveType = receiveType; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public Timestamp getDesignReceiveTime() + { + return designReceiveTime; + } + + public void setDesignReceiveTime(Timestamp designReceiveTime) + { + this.designReceiveTime = designReceiveTime; + } + + public Timestamp getDesignBeginTime() + { + return designBeginTime; + } + + public void setDesignBeginTime(Timestamp designBeginTime) + { + this.designBeginTime = designBeginTime; + } + + public Timestamp getDesignDraftTime() + { + return designDraftTime; + } + + public void setDesignDraftTime(Timestamp designDraftTime) + { + this.designDraftTime = designDraftTime; + } + + public Timestamp getDesignEndTime() + { + return designEndTime; + } + + public void setDesignEndTime(Timestamp designEndTime) + { + this.designEndTime = designEndTime; + } + + public String getDesignPauseReason() + { + return designPauseReason; + } + + public void setDesignPauseReason(String designPauseReason) + { + this.designPauseReason = designPauseReason; + } + + public Timestamp getDesignPauseTime() + { + return designPauseTime; + } + + public void setDesignPauseTime(Timestamp designPauseTime) + { + this.designPauseTime = designPauseTime; + } + + public String getDesignExclude() + { + return designExclude; + } + + public void setDesignExclude(String designExclude) + { + this.designExclude = designExclude; + } + + public String getDesignRequestReason() + { + return designRequestReason; + } + + public void setDesignRequestReason(String designRequestReason) + { + this.designRequestReason = designRequestReason; + } + + public Timestamp getRequestTime() + { + return requestTime; + } + + public void setRequestTime(Timestamp requestTime) + { + this.requestTime = requestTime; + } + + public String getDesignRejectReason() + { + return designRejectReason; + } + + public void setDesignRejectReason(String designRejectReason) + { + this.designRejectReason = designRejectReason; + } + + public int getDesignKeepDuration() + { + return designKeepDuration; + } + + public void setDesignKeepDuration(int designKeepDuration) + { + this.designKeepDuration = designKeepDuration; + } + + public String getRequestRefoundAcceptReason() + { + return requestRefoundAcceptReason; + } + + public void setRequestRefoundAcceptReason(String requestRefoundAcceptReason) + { + this.requestRefoundAcceptReason = requestRefoundAcceptReason; + } + + public String getCanceler() + { + return canceler; + } + + public void setCanceler(String canceler) + { + this.canceler = canceler; + } + + public Timestamp getCancelTime() + { + return cancelTime; + } + + public void setCancelTime(Timestamp cancelTime) + { + this.cancelTime = cancelTime; + } + + public String getCancelReason() + { + return cancelReason; + } + + public void setCancelReason(String cancelReason) + { + this.cancelReason = cancelReason; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + + public List getApiFiles() + { + return apiFiles; + } + + public void setApiFiles(List apiFiles) + { + this.apiFiles = apiFiles; + } + + public String getEndFileUrl() + { + return endFileUrl; + } + + public void setEndFileUrl(String endFileUrl) + { + this.endFileUrl = endFileUrl; + } + + public String getEndFileExt() + { + return endFileExt; + } + + public void setEndFileExt(String endFileExt) + { + this.endFileExt = endFileExt; + } + + public long getEndFileLength() + { + return endFileLength; + } + + public void setEndFileLength(long endFileLength) + { + this.endFileLength = endFileLength; + } + + public String getDesignFileUrl() + { + return designFileUrl; + } + + public void setDesignFileUrl(String designFileUrl) + { + this.designFileUrl = designFileUrl; + } + + public String getDesignFileExt() + { + return designFileExt; + } + + public void setDesignFileExt(String designFileExt) + { + this.designFileExt = designFileExt; + } + + public long getDesignFileLength() + { + return designFileLength; + } + + public void setDesignFileLength(long designFileLength) + { + this.designFileLength = designFileLength; + } + + public String getSelfDraftDesigner() + { + return selfDraftDesigner; + } + + public void setSelfDraftDesigner(String selfDraftDesigner) + { + this.selfDraftDesigner = selfDraftDesigner; + } + + public Timestamp getSelfDraftReceiveTime() + { + return selfDraftReceiveTime; + } + + public void setSelfDraftReceiveTime(Timestamp selfDraftReceiveTime) + { + this.selfDraftReceiveTime = selfDraftReceiveTime; + } + + public String getSelfDraftBacker() + { + return selfDraftBacker; + } + + public void setSelfDraftBacker(String selfDraftBacker) + { + this.selfDraftBacker = selfDraftBacker; + } + + public String getSelfDraftBackReason() + { + return selfDraftBackReason; + } + + public void setSelfDraftBackReason(String selfDraftBackReason) + { + this.selfDraftBackReason = selfDraftBackReason; + } + + public Timestamp getSelfDraftBackTime() + { + return selfDraftBackTime; + } + + public void setSelfDraftBackTime(Timestamp selfDraftBackTime) + { + this.selfDraftBackTime = selfDraftBackTime; + } + + public Timestamp getSelfDraftEndTime() + { + return selfDraftEndTime; + } + + public void setSelfDraftEndTime(Timestamp selfDraftEndTime) + { + this.selfDraftEndTime = selfDraftEndTime; + } + + public String getChecker() + { + return checker; + } + + public void setChecker(String checker) + { + this.checker = checker; + } + + public Timestamp getOrgReceiveTime() + { + return orgReceiveTime; + } + + public void setOrgReceiveTime(Timestamp orgReceiveTime) + { + this.orgReceiveTime = orgReceiveTime; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderCheckBackRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderCheckBackRequest.java new file mode 100644 index 0000000..7773952 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderCheckBackRequest.java @@ -0,0 +1,86 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.client.order; + +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +/**** + * 订单创建请求 + * @version v1.0.0 @author lgz 2019-1-12 新建与整理 + */ +public class DesignOrderCheckBackRequest extends YangcaiClientRequest +{ + // 数据类型 字段名 非空 数据长度 字段描述 + private long merchantId;// 是 订单商户编号 + private long designId;// 是 订单编号 + private String backReason;// 否 1000 退回原因 + private String imgUrl;// 否 500 退回截图路径 + + public String getMethod() + { + return ORDER_CHECK_BACK; + } + + public DesignOrderCheckBackResponse newResponse() + { + return new DesignOrderCheckBackResponse(); + } + + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("designId", designId); + addParam("backReason", backReason); + addParam("imgUrl", imgUrl); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getBackReason() + { + return backReason; + } + + public void setBackReason(String backReason) + { + this.backReason = backReason; + } + + public String getImgUrl() + { + return imgUrl; + } + + public void setImgUrl(String imgUrl) + { + this.imgUrl = imgUrl; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderCheckBackResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderCheckBackResponse.java new file mode 100644 index 0000000..c62b2e7 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderCheckBackResponse.java @@ -0,0 +1,46 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.client.order; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +/**** + * 订单审核退回响应 + * + * @version v1.0.0 @author lgz 2019-1-12 新建与整理 + */ +public class DesignOrderCheckBackResponse extends YangcaiClientResponse +{ + private boolean isSuccess; + + protected void buildResponse(String json) + { + setSuccess(Jsons.getBoolean(json, "isSuccess")); + } + + public boolean isSuccess() + { + return isSuccess; + } + + public void setSuccess(boolean isSuccess) + { + this.isSuccess = isSuccess; + } + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderCreateRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderCreateRequest.java new file mode 100644 index 0000000..1a5f83e --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderCreateRequest.java @@ -0,0 +1,588 @@ +package com.zhiqim.yangcai.design.client.order; + +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiApiFile; +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +/**** + * 订单创建请求 + * + * @version v1.0.0 @author lgz 2019-1-12 新建与整理 + */ +public class DesignOrderCreateRequest extends YangcaiClientRequest +{ + // 数据类型 字段名 是否为空 数据长度 字段描述 + private long merchantId;// 是 订单商户编号 + private String outId;// 是 外部系统单号 + private long designType;// 是 产品类型,由设计平台提供,业务方适配。 + private long industryId;// 是 行业编号,由设计平台提供,业务方适配。 + private int draftType;// 是 稿件类型,0:自来稿,1:改稿自来稿,2:普通设计,3:高级设计 + private int designPage;// 是 设计面数,单面为1,双面为2 + private int printKs;// 是 设计款数 + private int printMs;// 是 设计模数 + private double designWidth;// 是 设计宽度,单位mm,最多两位小数,含出血 + private double designHeight;// 是 设计高度,单位mm,最多两位小数,含出血 + private double designSide;// 否 设计侧面长度,单位mm,最多两位小数,含出血 + private double printWidth;// 否 特殊尺寸宽度,单位mm,最多两位小数, 不含出血(用户尺寸) + private double printHeight;// 否 特殊尺寸高度,单位mm,最多两位小数, 不含出血(用户尺寸) + private double amount;// 否 金额最多支持两位小数 + private boolean isUrgent;// 是 是否加急,。 + private String userContact;// 否 100 联系人 + private String userMobile;// 是 64 联系电话 + private String buyerNick;// 否 100 买家昵称 + private String userQq;// 否 64 买家联系QQ + private String userWx;// 否 64 买家联系微信号 + private String orderText;// 否 200 产品全称,最多200个字符 + private String afterNames;// 否 500 后加工 多个逗号隔开 + private String printSpecial;// 否 100 特殊工艺,最多100个字符 + private String userText;// 否 4000 客户文本,最多4000个字符 + private String userNotice;// 否 1000 设计注意事项,最多1000个字符 + private String shopNick;// 否 32 店铺名 最多32字符 + private String servicesMessage;// 否 500 店铺名 最多500字符 + private int designCopies;// 否 设计费份数 + private String receiverName; // 否 50 收货人的姓名 + private String receiverMobile;// 否 40 收货人的手机号码 + private String receiverState; // 否 20 收货人的所在省份 + private String receiverCity; // 否 20 收货人的所在城市 + private String receiverDistrict; // 否 20 收货人的所在区县 + private String receiverAddress; // 是 100 收货人的详细地址 + private String expressCode;// 否 20 物流code + private String creater;// 是 20 录单人 + private int orderSrc; // 是 订单来源 + private String tids; // 是 200 淘宝单号,多个逗号分隔 + private boolean isOnlyDesign; // 是否仅设计 + private boolean isHighQualityOrder; // 是否优质订单 + private String designer;// 设计师 + private List apiFiles;// 否 0 用户文件资料 + private int showRedMark; // 淘宝申请退款时显示红色感叹号[0-不显示,1-显示] + private String customerQrcodeUrl;// 否 服务群二维码 + private long designAmount;// 否 设计费用 + private long productAmount;// 否 产品费用 + + @Override + public String getMethod() + { + return ORDER_CREATE; + } + + @Override + public DesignOrderCreateResponse newResponse() + { + return new DesignOrderCreateResponse(); + } + + @Override + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("outId", outId); + addParam("designType", designType); + addParam("industryId", industryId); + addParam("draftType", draftType); + addParam("designPage", designPage); + addParam("printKs", printKs); + addParam("printMs", printMs); + addParam("designWidth", designWidth); + addParam("designHeight", designHeight); + addParam("designSide", designSide); + addParam("printWidth", printWidth); + addParam("printHeight", printHeight); + addParam("amount", amount); + addParam("isUrgent", isUrgent); + addParam("userContact", userContact); + addParam("userMobile", userMobile); + addParam("buyerNick", buyerNick); + addParam("userQq", userQq); + addParam("userWx", userWx); + addParam("orderText", orderText); + addParam("afterNames", afterNames); + addParam("printSpecial", printSpecial); + addParam("userText", userText); + addParam("userNotice", userNotice); + addParam("shopNick", shopNick); + addParam("servicesMessage", servicesMessage); + addParam("designCopies", designCopies); + addParam("receiverName", receiverName); + addParam("receiverMobile", receiverMobile); + addParam("receiverState", receiverState); + addParam("receiverCity", receiverCity); + addParam("receiverDistrict", receiverDistrict); + addParam("receiverAddress", receiverAddress); + addParam("expressCode", expressCode); + addParam("orderSrc", orderSrc); + addParam("creater", creater); + addParam("tids", tids); + addParam("isOnlyDesign", isOnlyDesign); + addParam("isHighQualityOrder", isHighQualityOrder); + addParam("designer", designer); + addParam("apiFiles", Jsons.toString(apiFiles)); + addParam("showRedMark", showRedMark); + addParam("customerQrcodeUrl", customerQrcodeUrl); + addParam("designAmount", designAmount); + addParam("productAmount", productAmount); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public String getOutId() + { + return outId; + } + + public void setOutId(String outId) + { + this.outId = outId; + } + + public long getDesignType() + { + return designType; + } + + public void setDesignType(long designType) + { + this.designType = designType; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public int getDraftType() + { + return draftType; + } + + public void setDraftType(int draftType) + { + this.draftType = draftType; + } + + public int getDesignPage() + { + return designPage; + } + + public void setDesignPage(int designPage) + { + this.designPage = designPage; + } + + public int getPrintKs() + { + return printKs; + } + + public void setPrintKs(int printKs) + { + this.printKs = printKs; + } + + public int getPrintMs() + { + return printMs; + } + + public void setPrintMs(int printMs) + { + this.printMs = printMs; + } + + public double getDesignWidth() + { + return designWidth; + } + + public void setDesignWidth(double designWidth) + { + this.designWidth = designWidth; + } + + public double getDesignHeight() + { + return designHeight; + } + + public void setDesignHeight(double designHeight) + { + this.designHeight = designHeight; + } + + public double getDesignSide() + { + return designSide; + } + + public void setDesignSide(double designSide) + { + this.designSide = designSide; + } + + public double getPrintWidth() + { + return printWidth; + } + + public void setPrintWidth(double printWidth) + { + this.printWidth = printWidth; + } + + public double getPrintHeight() + { + return printHeight; + } + + public void setPrintHeight(double printHeight) + { + this.printHeight = printHeight; + } + + public double getAmount() + { + return amount; + } + + public void setAmount(double amount) + { + this.amount = amount; + } + + public boolean isUrgent() + { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) + { + this.isUrgent = isUrgent; + } + + public String getUserContact() + { + return userContact; + } + + public void setUserContact(String userContact) + { + this.userContact = userContact; + } + + public String getUserMobile() + { + return userMobile; + } + + public void setUserMobile(String userMobile) + { + this.userMobile = userMobile; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public String getUserQq() + { + return userQq; + } + + public void setUserQq(String userQq) + { + this.userQq = userQq; + } + + public String getUserWx() + { + return userWx; + } + + public void setUserWx(String userWx) + { + this.userWx = userWx; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public String getAfterNames() + { + return afterNames; + } + + public void setAfterNames(String afterNames) + { + this.afterNames = afterNames; + } + + public String getPrintSpecial() + { + return printSpecial; + } + + public void setPrintSpecial(String printSpecial) + { + this.printSpecial = printSpecial; + } + + public String getUserText() + { + return userText; + } + + public void setUserText(String userText) + { + this.userText = userText; + } + + public String getUserNotice() + { + return userNotice; + } + + public void setUserNotice(String userNotice) + { + this.userNotice = userNotice; + } + + public String getShopNick() + { + return shopNick; + } + + public void setShopNick(String shopNick) + { + this.shopNick = shopNick; + } + + public String getServicesMessage() + { + return servicesMessage; + } + + public void setServicesMessage(String servicesMessage) + { + this.servicesMessage = servicesMessage; + } + + public int getDesignCopies() + { + return designCopies; + } + + public void setDesignCopies(int designCopies) + { + this.designCopies = designCopies; + } + + public String getReceiverName() + { + return receiverName; + } + + public void setReceiverName(String receiverName) + { + this.receiverName = receiverName; + } + + public String getReceiverState() + { + return receiverState; + } + + public void setReceiverState(String receiverState) + { + this.receiverState = receiverState; + } + + public String getReceiverCity() + { + return receiverCity; + } + + public void setReceiverCity(String receiverCity) + { + this.receiverCity = receiverCity; + } + + public String getReceiverDistrict() + { + return receiverDistrict; + } + + public void setReceiverDistrict(String receiverDistrict) + { + this.receiverDistrict = receiverDistrict; + } + + public String getReceiverAddress() + { + return receiverAddress; + } + + public void setReceiverAddress(String receiverAddress) + { + this.receiverAddress = receiverAddress; + } + + public List getApiFiles() + { + return apiFiles; + } + + public void setApiFiles(List apiFiles) + { + this.apiFiles = apiFiles; + } + + public String getReceiverMobile() + { + return receiverMobile; + } + + public void setReceiverMobile(String receiverMobile) + { + this.receiverMobile = receiverMobile; + } + + public String getExpressCode() + { + return expressCode; + } + + public void setExpressCode(String expressCode) + { + this.expressCode = expressCode; + } + + public String getCreater() + { + return creater; + } + + public void setCreater(String creater) + { + this.creater = creater; + } + + public int getOrderSrc() + { + return orderSrc; + } + + public void setOrderSrc(int orderSrc) + { + this.orderSrc = orderSrc; + } + + public String getTids() + { + return tids; + } + + public void setTids(String tids) + { + this.tids = tids; + } + + public boolean isOnlyDesign() + { + return isOnlyDesign; + } + + public void setOnlyDesign(boolean isOnlyDesign) + { + this.isOnlyDesign = isOnlyDesign; + } + + public boolean isHighQualityOrder() + { + return isHighQualityOrder; + } + + public void setHighQualityOrder(boolean isHighQualityOrder) + { + this.isHighQualityOrder = isHighQualityOrder; + } + + public int getShowRedMark() + { + return showRedMark; + } + + public void setShowRedMark(int showRedMark) + { + this.showRedMark = showRedMark; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getCustomerQrcodeUrl() + { + return customerQrcodeUrl; + } + + public void setCustomerQrcodeUrl(String customerQrcodeUrl) + { + this.customerQrcodeUrl = customerQrcodeUrl; + } + + public long getDesignAmount() + { + return designAmount; + } + + public void setDesignAmount(long designAmount) + { + this.designAmount = designAmount; + } + + public long getProductAmount() + { + return productAmount; + } + + public void setProductAmount(long productAmount) + { + this.productAmount = productAmount; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderCreateResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderCreateResponse.java new file mode 100644 index 0000000..3ee83c1 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderCreateResponse.java @@ -0,0 +1,56 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.order; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +/**** + * 订单创建响应 + * + * @version v1.0.0 @author lgz 2019-1-12 新建与整理 + */ +public class DesignOrderCreateResponse extends YangcaiClientResponse +{ + private long merchantId; + private long designId; + protected void buildResponse(String json) + { + setMerchantId(Jsons.getLong(json, "merchantId")); + setDesignId(Jsons.getLong(json, "designId")); + } + public long getMerchantId() + { + return merchantId; + } + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + public long getDesignId() + { + return designId; + } + + + public void setDesignId(long designId) + { + this.designId = designId; + } + + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderRecreateRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderRecreateRequest.java new file mode 100644 index 0000000..a05d8e7 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderRecreateRequest.java @@ -0,0 +1,86 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.order; + +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +/**** + * 订单创建请求 + * @version v1.0.0 @author lgz 2019-1-12 新建与整理 + */ +public class DesignOrderRecreateRequest extends YangcaiClientRequest +{ +// 数据类型 字段名 是否为空 数据长度 字段描述 + // 数据类型 字段名 是否为空 数据长度 字段描述 + private long merchantId;// 是 订单商户编号 + private long newOutId;// 是 第三方新订单号 + private long designSrcId;// 是 设计平台原订单号。 + private String redesignReason;// 否 300 重新设计原因 + + public String getMethod() + { + return ORDER_RE_CREATE; + } + + public DesignOrderRecreateResponse newResponse() + { + return new DesignOrderRecreateResponse(); + } + + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("newOutId", newOutId); + addParam("designSrcId", designSrcId); + addParam("redesignReason", redesignReason); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getNewOutId() + { + return newOutId; + } + + public void setNewOutId(long newOutId) + { + this.newOutId = newOutId; + } + + public long getDesignSrcId() + { + return designSrcId; + } + + public void setDesignSrcId(long designSrcId) + { + this.designSrcId = designSrcId; + } + + public String getRedesignReason() + { + return redesignReason; + } + + public void setRedesignReason(String redesignReason) + { + this.redesignReason = redesignReason; + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderRecreateResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderRecreateResponse.java new file mode 100644 index 0000000..9137989 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderRecreateResponse.java @@ -0,0 +1,53 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.order; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +/**** + * 创建补单响应 + * + * @version v1.0.0 @author lgz 2019-1-12 新建与整理 + */ +public class DesignOrderRecreateResponse extends YangcaiClientResponse +{ + private long merchantId; + private long newDesignId; + protected void buildResponse(String json) + { + setMerchantId(Jsons.getLong(json, "merchantId")); + setNewDesignId(Jsons.getLong(json, "newDesignId")); + } + + public long getMerchantId() + { + return merchantId; + } + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + public long getNewDesignId() + { + return newDesignId; + } + public void setNewDesignId(long newDesignId) + { + this.newDesignId = newDesignId; + } + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderRefundRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderRefundRequest.java new file mode 100644 index 0000000..01d35b1 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderRefundRequest.java @@ -0,0 +1,86 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.client.order; + +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +/**** + * 订单创建请求 + * @version v1.0.0 @author lgz 2019-1-12 新建与整理 + */ +public class DesignOrderRefundRequest extends YangcaiClientRequest +{ + // 数据类型 字段名 非空 数据长度 字段描述 + private long merchantId;// 是 订单商户编号 + private long designId;// 是 订单编号 + private String backReason;// 否 1000 退回原因 + private String imgUrl;// 否 500 退回截图路径 + + public String getMethod() + { + return ORDER_CHECK_BACK; + } + + public DesignOrderCheckBackResponse newResponse() + { + return new DesignOrderCheckBackResponse(); + } + + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("designId", designId); + addParam("backReason", backReason); + addParam("imgUrl", imgUrl); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getBackReason() + { + return backReason; + } + + public void setBackReason(String backReason) + { + this.backReason = backReason; + } + + public String getImgUrl() + { + return imgUrl; + } + + public void setImgUrl(String imgUrl) + { + this.imgUrl = imgUrl; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderSynRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderSynRequest.java new file mode 100644 index 0000000..2ac81a1 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderSynRequest.java @@ -0,0 +1,97 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.order; + +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +/*** + * 订单同步请求 + * + * @version v1.0.0 @author lgz 2018-12-22 新建与整理 + */ +public class DesignOrderSynRequest extends YangcaiClientRequest +{ + private long merchantId;// 是 订单商户编号 + private long designId;// 否 设计订单号 + private long outId;// 否 外部系统单号 + private String startModifyTime;// 否 设计平台的订单开始变更时间,默认十分钟前 + private String endModifyTime;// 否 设计平台的订单结束时间,默认当前时间 + public String getMethod() + { + return ORDER_SYN; + } + + public DesignOrderSynResponse newResponse() + { + return new DesignOrderSynResponse(); + } + + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("designId", designId); + addParam("outId", outId); + addParam("startModifyTime", startModifyTime); + addParam("endModifyTime", endModifyTime); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public long getOutId() + { + return outId; + } + + public void setOutId(long outId) + { + this.outId = outId; + } + + public String getStartModifyTime() + { + return startModifyTime; + } + + public void setStartModifyTime(String startModifyTime) + { + this.startModifyTime = startModifyTime; + } + + public String getEndModifyTime() + { + return endModifyTime; + } + + public void setEndModifyTime(String endModifyTime) + { + this.endModifyTime = endModifyTime; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderSynResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderSynResponse.java new file mode 100644 index 0000000..54c0973 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/DesignOrderSynResponse.java @@ -0,0 +1,61 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.order; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiApiFile; +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +/** + *订单同步响应 + * @version v1.0.0 @author lgz 2018-12-22 新建与整理 + */ +public class DesignOrderSynResponse extends YangcaiClientResponse +{ + private List orderList; + protected void buildResponse(String json) + { + List list = new ArrayList();; + List orderJsons = Jsons.toList(Jsons.getString(json, "orderList"), String.class); + for (String orderJson : orderJsons) + { + DesignOrder order = Jsons.toObject(orderJson, DesignOrder.class); + List apiFiles = Jsons.toList(Jsons.getString(orderJson, "apiFiles"), YangcaiApiFile.class); + apiFiles = apiFiles != null ? apiFiles : new ArrayList(); + + if (order != null) + order.setApiFiles(apiFiles); + + list.add(order); + } + + + setOrderList(list); + } + public List getOrderList() + { + return orderList; + } + public void setOrderList(List orderList) + { + this.orderList = orderList; + } + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateInfoRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateInfoRequest.java new file mode 100644 index 0000000..faee1bb --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateInfoRequest.java @@ -0,0 +1,194 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.order.update; + +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +public class DesignOrderUpdateInfoRequest extends YangcaiClientRequest { + // 数据类型 字段名 非空 数据长度 字段描述 + private long merchantId;// 是 + private long designId;// 是 + private long industryId;// 是 + private boolean isUrgent;// 是 + + private String userMobile;// 否 64 + private String userQq;// 否 64 + private String userWx;// 否 64 + private String printSpecial;// 否 100 + private String servicesMessage;// 否 500 + private String isHighQualityOrder;// 否 + private String customerQrcodeUrl;// 否 服务群二维码 + private String orderText;// 订单备注 + private String outId;// 订单id + private boolean isChange;// 是否改稿 + private boolean isBack;// 是否打回 + private String returnReason;// 打回理由 + + @Override + public String getMethod() { + return ORDER_UPDATE_INFO; + } + + @Override + public DesignOrderUpdateInfoResponse newResponse() { + return new DesignOrderUpdateInfoResponse(); + } + + @Override + protected void buildQueryBody() { + addParam("merchantId", merchantId); + addParam("designId", designId); + addParam("industryId", industryId); + addParam("isUrgent", isUrgent); + addParam("userMobile", userMobile); + addParam("userQq", userQq); + addParam("userWx", userWx); + addParam("printSpecial", printSpecial); + addParam("servicesMessage", servicesMessage); + addParam("isHighQualityOrder", isHighQualityOrder); + addParam("customerQrcodeUrl", customerQrcodeUrl); + addParam("orderText", orderText); + addParam("outId", outId); + addParam("isChange", isChange); + addParam("isBack", isBack); + addParam("returnReason", returnReason); + } + + public long getMerchantId() { + return merchantId; + } + + public void setMerchantId(long merchantId) { + this.merchantId = merchantId; + } + + public long getDesignId() { + return designId; + } + + public void setDesignId(long designId) { + this.designId = designId; + } + + public long getIndustryId() { + return industryId; + } + + public void setIndustryId(long industryId) { + this.industryId = industryId; + } + + public boolean isUrgent() { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) { + this.isUrgent = isUrgent; + } + + public String getUserMobile() { + return userMobile; + } + + public void setUserMobile(String userMobile) { + this.userMobile = userMobile; + } + + public String getUserQq() { + return userQq; + } + + public void setUserQq(String userQq) { + this.userQq = userQq; + } + + public String getUserWx() { + return userWx; + } + + public void setUserWx(String userWx) { + this.userWx = userWx; + } + + public String getPrintSpecial() { + return printSpecial; + } + + public void setPrintSpecial(String printSpecial) { + this.printSpecial = printSpecial; + } + + public String getServicesMessage() { + return servicesMessage; + } + + public void setServicesMessage(String servicesMessage) { + this.servicesMessage = servicesMessage; + } + + public String isHighQualityOrder() { + return isHighQualityOrder; + } + + public void setHighQualityOrder(String isHighQualityOrder) { + this.isHighQualityOrder = isHighQualityOrder; + } + + public String getCustomerQrcodeUrl() { + return customerQrcodeUrl; + } + + public void setCustomerQrcodeUrl(String customerQrcodeUrl) { + this.customerQrcodeUrl = customerQrcodeUrl; + } + + public String getOrderText() { + return orderText; + } + + public void setOrderText(String orderText) { + this.orderText = orderText; + } + + public boolean isChange() { + return isChange; + } + + public void setChange(boolean isChange) { + this.isChange = isChange; + } + + public boolean isBack() { + return isBack; + } + + public void setBack(boolean isBack) { + this.isBack = isBack; + } + + public String getOutId() { + return outId; + } + + public void setOutId(String outId) { + this.outId = outId; + } + + public String getReturnReason() { + return returnReason; + } + + public void setReturnReason(String returnReason) { + this.returnReason = returnReason; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateInfoResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateInfoResponse.java new file mode 100644 index 0000000..49d7e91 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateInfoResponse.java @@ -0,0 +1,37 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.order.update; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +public class DesignOrderUpdateInfoResponse extends YangcaiClientResponse +{ + private boolean isUpdated; + protected void buildResponse(String json) + { + setUpdated(Jsons.getBoolean(json, "isUpdated")); + } + public String toString() + { + return Jsons.toString(this); + } + public boolean isUpdated() + { + return isUpdated; + } + public void setUpdated(boolean isUpdated) + { + this.isUpdated = isUpdated; + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateSpecificationRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateSpecificationRequest.java new file mode 100644 index 0000000..c1c5adc --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateSpecificationRequest.java @@ -0,0 +1,358 @@ +package com.zhiqim.yangcai.design.client.order.update; + +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +/**** + * + * 订单规格修改 + * + * @version v1.0.0 @author lgz 2019-1-10 新建与整理 + */ +public class DesignOrderUpdateSpecificationRequest extends YangcaiClientRequest +{ + // 数据类型 字段名 是否为空 数据长度 字段描述 + + private long designId;// 是 设计订单编号 + private long merchantId;// 是 订单商户编号 + private long typeId; // 是 设计类型,名片、彩页、等等 + private String orderText;// 否 200 产品全称,最多200个字符 + private String afterNames;// 否 500 后加工 多个逗号隔开 + private String printSpecial;// 否 100 特殊工艺,最多100个字符 + private double amount;// 否 金额最多支持两位小数 + private boolean isUrgent;// 是 是否加急,。 + private int draftType;// 是 稿件类型,0:自来稿,1:改稿自来稿,2:普通设计,3:高级设计 + private long industryId;// 是 行业编号,由设计平台提供,业务方适配。 + private double designWidth;// 是 设计宽度,单位mm,最多两位小数,含出血 + private double designHeight;// 是 设计高度,单位mm,最多两位小数,含出血 + private int designPage;// 是 设计面数,单面为1,双面为2 + private double printWidth;// 否 特殊尺寸宽度,单位mm,最多两位小数, 不含出血(用户尺寸) + private double printHeight;// 否 特殊尺寸高度,单位mm,最多两位小数, 不含出血(用户尺寸) + private int printKs;// 是 设计款数 + private int printMs;// 是 设计模数 + private String userContact;// 否 30 联系人 + private String userMobile;// 是 20 联系电话 + private String buyerNick;// 否 100 买家昵称 + private String userQq;// 否 20 买家联系QQ + private String userWx;// 否 20 买家联系微信号 + private String servicesMessage;// 否 500 留言给设计师 + private String tids;// 是 淘宝单号 + private int designCopies;// 否 设计费份数 + private boolean isOnlyDesign; // 是否仅设计 + private boolean isHighQualityOrder; // 是否是优质订单 + + @Override + public String getMethod() + { + return ORDER_UPDATE_SPECIFICATION; + } + + @Override + public DesignOrderUpdateSpecificationResponse newResponse() + { + return new DesignOrderUpdateSpecificationResponse(); + } + + @Override + protected void buildQueryBody() + { + + addParam("designId", designId);// + addParam("merchantId", merchantId); + addParam("typeId", typeId); + addParam("orderText", orderText); + addParam("afterNames", afterNames); + addParam("printSpecial", printSpecial); + addParam("amount", amount); + addParam("isUrgent", isUrgent); + addParam("draftType", draftType); + addParam("industryId", industryId); + addParam("designWidth", designWidth); + addParam("designHeight", designHeight); + addParam("designPage", designPage); + addParam("printWidth", printWidth); + addParam("printHeight", printHeight); + addParam("printKs", printKs); + addParam("printMs", printMs); + addParam("userContact", userContact); + addParam("userMobile", userMobile); + addParam("buyerNick", buyerNick); + addParam("userQq", userQq); + addParam("userWx", userWx); + addParam("servicesMessage", servicesMessage); + addParam("tids", tids); + addParam("designCopies", designCopies); + addParam("isOnlyDesign", isOnlyDesign); + addParam("isHighQualityOrder", isHighQualityOrder); + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public String getAfterNames() + { + return afterNames; + } + + public void setAfterNames(String afterNames) + { + this.afterNames = afterNames; + } + + public String getPrintSpecial() + { + return printSpecial; + } + + public void setPrintSpecial(String printSpecial) + { + this.printSpecial = printSpecial; + } + + public double getAmount() + { + return amount; + } + + public void setAmount(double amount) + { + this.amount = amount; + } + + public boolean isUrgent() + { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) + { + this.isUrgent = isUrgent; + } + + public int getDraftType() + { + return draftType; + } + + public void setDraftType(int draftType) + { + this.draftType = draftType; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public double getDesignWidth() + { + return designWidth; + } + + public void setDesignWidth(double designWidth) + { + this.designWidth = designWidth; + } + + public double getDesignHeight() + { + return designHeight; + } + + public void setDesignHeight(double designHeight) + { + this.designHeight = designHeight; + } + + public int getDesignPage() + { + return designPage; + } + + public void setDesignPage(int designPage) + { + this.designPage = designPage; + } + + public double getPrintWidth() + { + return printWidth; + } + + public void setPrintWidth(double printWidth) + { + this.printWidth = printWidth; + } + + public double getPrintHeight() + { + return printHeight; + } + + public void setPrintHeight(double printHeight) + { + this.printHeight = printHeight; + } + + public int getPrintKs() + { + return printKs; + } + + public void setPrintKs(int printKs) + { + this.printKs = printKs; + } + + public int getPrintMs() + { + return printMs; + } + + public void setPrintMs(int printMs) + { + this.printMs = printMs; + } + + public String getUserContact() + { + return userContact; + } + + public void setUserContact(String userContact) + { + this.userContact = userContact; + } + + public String getUserMobile() + { + return userMobile; + } + + public void setUserMobile(String userMobile) + { + this.userMobile = userMobile; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public String getUserQq() + { + return userQq; + } + + public void setUserQq(String userQq) + { + this.userQq = userQq; + } + + public String getUserWx() + { + return userWx; + } + + public void setUserWx(String userWx) + { + this.userWx = userWx; + } + + public String getServicesMessage() + { + return servicesMessage; + } + + public void setServicesMessage(String servicesMessage) + { + this.servicesMessage = servicesMessage; + } + + public String getTids() + { + return tids; + } + + public void setTids(String tids) + { + this.tids = tids; + } + + public int getDesignCopies() + { + return designCopies; + } + + public void setDesignCopies(int designCopies) + { + this.designCopies = designCopies; + } + + public boolean isOnlyDesign() + { + return isOnlyDesign; + } + + public void setOnlyDesign(boolean isOnlyDesign) + { + this.isOnlyDesign = isOnlyDesign; + } + + public boolean isHighQualityOrder() + { + return isHighQualityOrder; + } + + public void setHighQualityOrder(boolean isHighQualityOrder) + { + this.isHighQualityOrder = isHighQualityOrder; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateSpecificationResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateSpecificationResponse.java new file mode 100644 index 0000000..be9a233 --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateSpecificationResponse.java @@ -0,0 +1,56 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.order.update; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +/*** + * TODO:类功能介绍 + * + * @version v1.0.0 @author lgz 2019-1-10 新建与整理 + */ +public class DesignOrderUpdateSpecificationResponse extends YangcaiClientResponse +{ + private long merchantId; + private long designId; + protected void buildResponse(String json) + { + setDesignId(Jsons.getLong(json, "designId")); + setMerchantId(Jsons.getLong(json, "merchantId")); + } + + public long getMerchantId() + { + return merchantId; + } + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateTextInfoRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateTextInfoRequest.java new file mode 100644 index 0000000..841946e --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateTextInfoRequest.java @@ -0,0 +1,117 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.order.update; + +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +public class DesignOrderUpdateTextInfoRequest extends YangcaiClientRequest +{ +// 数据类型 字段名 非空 数据长度 字段描述 + private long merchantId;// 是 + private long designId;// 是 + + private String userText;// 否 4000 + private String userNotice;// 否 1000 + private String userMobile;// 否 64 + private String userQq;// 否 64 + private String userWx;// 否 64 + public String getMethod() + { + return ORDER_UPDATE_TEXT_INFO; + } + + public DesignOrderUpdateTextInfoResponse newResponse() + { + return new DesignOrderUpdateTextInfoResponse(); + } + + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("designId", designId); + addParam("userText", userText); + addParam("userNotice", userNotice); + addParam("userMobile", userMobile); + addParam("userQq", userQq); + addParam("userWx", userWx); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getUserText() + { + return userText; + } + + public void setUserText(String userText) + { + this.userText = userText; + } + + public String getUserNotice() + { + return userNotice; + } + + public void setUserNotice(String userNotice) + { + this.userNotice = userNotice; + } + + public String getUserMobile() + { + return userMobile; + } + + public void setUserMobile(String userMobile) + { + this.userMobile = userMobile; + } + + public String getUserQq() + { + return userQq; + } + + public void setUserQq(String userQq) + { + this.userQq = userQq; + } + + public String getUserWx() + { + return userWx; + } + + public void setUserWx(String userWx) + { + this.userWx = userWx; + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateTextInfoResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateTextInfoResponse.java new file mode 100644 index 0000000..241c60f --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/DesignOrderUpdateTextInfoResponse.java @@ -0,0 +1,37 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.order.update; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +public class DesignOrderUpdateTextInfoResponse extends YangcaiClientResponse +{ + private boolean isUpdated; + protected void buildResponse(String json) + { + setUpdated(Jsons.getBoolean(json, "isUpdated")); + } + public String toString() + { + return Jsons.toString(this); + } + public boolean isUpdated() + { + return isUpdated; + } + public void setUpdated(boolean isUpdated) + { + this.isUpdated = isUpdated; + } +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/ReplaceCustomFileRequest.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/ReplaceCustomFileRequest.java new file mode 100644 index 0000000..7870e2a --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/ReplaceCustomFileRequest.java @@ -0,0 +1,69 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.order.update; + +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiApiFile; +import com.zhiqim.yangcai.design.client.YangcaiClientRequest; + +public class ReplaceCustomFileRequest extends YangcaiClientRequest +{ + private long merchantId; + private long designId; + private List apiFiles; + @Override + public String getMethod() + { + return ORDER_UPDATE_CUSTOM_FILE; + } + @Override + public ReplaceCustomFileResponse newResponse() + { + // TODO Auto-generated method stub + return new ReplaceCustomFileResponse(); + } + @Override + protected void buildQueryBody() + { + addParam("merchantId", merchantId); + addParam("designId", designId); + addParam("apiFiles", Jsons.toString(apiFiles)); + } + public long getMerchantId() + { + return merchantId; + } + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + public long getDesignId() + { + return designId; + } + public void setDesignId(long designId) + { + this.designId = designId; + } + public List getApiFiles() + { + return apiFiles; + } + public void setApiFiles(List apiFiles) + { + this.apiFiles = apiFiles; + } + +} diff --git a/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/ReplaceCustomFileResponse.java b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/ReplaceCustomFileResponse.java new file mode 100644 index 0000000..f434d8e --- /dev/null +++ b/Yangcai365_web/src/client/com/zhiqim/yangcai/design/client/order/update/ReplaceCustomFileResponse.java @@ -0,0 +1,40 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.client.order.update; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.client.YangcaiClientResponse; + +public class ReplaceCustomFileResponse extends YangcaiClientResponse +{ + private boolean isReplaced; + + protected void buildResponse(String json) + { + setReplaced(Jsons.getBoolean(json, "isReplaced")); + } + + public boolean isReplaced() + { + return isReplaced; + } + + public void setReplaced(boolean isReplaced) + { + this.isReplaced = isReplaced; + } + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesKeyword.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesKeyword.java new file mode 100644 index 0000000..3af8e72 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesKeyword.java @@ -0,0 +1,104 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 关键词表 对应表《DES_KEYWORD》 + */ +@AnAlias("DesKeyword") +@AnNew +@AnTable(table="DES_KEYWORD", key="KEYWORD_ID", type="InnoDB") +public class DesKeyword implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="CAT_ID", type="long", notNull=false) private long catId; //1.关键词分类ID + @AnTableField(column="KEYWORD_ID", type="long", notNull=true) private long keywordId; //2.关键词ID + @AnTableField(column="KEYWORD_NAME", type="string,5000", notNull=true) private String keywordName; //3.关键字名称 + @AnTableField(column="KEYWORD_TYPE", type="int", notNull=true) private int keywordType; //4.关键字类型 0:系统, 1:个人 + @AnTableField(column="OPERATOR_CODE", type="string,64", notNull=false) private String operatorCode; //5.操作人 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //6.创建时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getCatId() + { + return catId; + } + + public void setCatId(long catId) + { + this.catId = catId; + } + + public long getKeywordId() + { + return keywordId; + } + + public void setKeywordId(long keywordId) + { + this.keywordId = keywordId; + } + + public String getKeywordName() + { + return keywordName; + } + + public void setKeywordName(String keywordName) + { + this.keywordName = keywordName; + } + + public int getKeywordType() + { + return keywordType; + } + + public void setKeywordType(int keywordType) + { + this.keywordType = keywordType; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesKeywordCat.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesKeywordCat.java new file mode 100644 index 0000000..7ce7f68 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesKeywordCat.java @@ -0,0 +1,71 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 关键词分类 对应表《DES_KEYWORD_CAT》 + */ +@AnAlias("DesKeywordCat") +@AnNew +@AnTable(table="DES_KEYWORD_CAT", key="CAT_ID", type="InnoDB") +public class DesKeywordCat implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="CAT_ID", type="long", notNull=true) private long catId; //1.关键词分类ID + @AnTableField(column="CAT_NAME", type="string,64", notNull=true) private String catName; //2.关键词分类名称 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //3.创建时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getCatId() + { + return catId; + } + + public void setCatId(long catId) + { + this.catId = catId; + } + + public String getCatName() + { + return catName; + } + + public void setCatName(String catName) + { + this.catName = catName; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesKeywordLog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesKeywordLog.java new file mode 100644 index 0000000..2548b76 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesKeywordLog.java @@ -0,0 +1,82 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 关键词搜索日志表 对应表《DES_KEYWORD_LOG》 + */ +@AnAlias("DesKeywordLog") +@AnNew +@AnTable(table="DES_KEYWORD_LOG", key="LOG_ID", type="InnoDB") +public class DesKeywordLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="LOG_ID", type="long", notNull=true) private long logId; //1.日志ID + @AnTableField(column="KEYWORD_NAME", type="string,64", notNull=true) private String keywordName; //2.关键字名称 + @AnTableField(column="SEARCH_COUNT", type="int", notNull=true) private int searchCount; //3.搜索量 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //4.创建时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getLogId() + { + return logId; + } + + public void setLogId(long logId) + { + this.logId = logId; + } + + public String getKeywordName() + { + return keywordName; + } + + public void setKeywordName(String keywordName) + { + this.keywordName = keywordName; + } + + public int getSearchCount() + { + return searchCount; + } + + public void setSearchCount(int searchCount) + { + this.searchCount = searchCount; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesLabelAttribute.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesLabelAttribute.java new file mode 100644 index 0000000..1ef4964 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesLabelAttribute.java @@ -0,0 +1,93 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 标签属性表 对应表《DES_LABEL_ATTRIBUTE》 + */ +@AnAlias("DesLabelAttribute") +@AnNew +@AnTable(table="DES_LABEL_ATTRIBUTE", key="ATTRIBUTE_ID", type="InnoDB") +public class DesLabelAttribute implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ATTRIBUTE_ID", type="long", notNull=true) private long attributeId; //1.属性ID + @AnTableField(column="ATTRIBUTE_CAT_ID", type="long", notNull=true) private long attributeCatId; //2.属性分类ID + @AnTableField(column="INDUSTRY_ID", type="long", notNull=true) private long industryId; //3.行业ID + @AnTableField(column="ATTRIBUTE_NAME", type="string,5000", notNull=true) private String attributeName; //4.属性名称 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //5.创建时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getAttributeId() + { + return attributeId; + } + + public void setAttributeId(long attributeId) + { + this.attributeId = attributeId; + } + + public long getAttributeCatId() + { + return attributeCatId; + } + + public void setAttributeCatId(long attributeCatId) + { + this.attributeCatId = attributeCatId; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public String getAttributeName() + { + return attributeName; + } + + public void setAttributeName(String attributeName) + { + this.attributeName = attributeName; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesLabelAttributeCat.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesLabelAttributeCat.java new file mode 100644 index 0000000..0be3e38 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesLabelAttributeCat.java @@ -0,0 +1,82 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 标签属性分类表 对应表《DES_LABEL_ATTRIBUTE_CAT》 + */ +@AnAlias("DesLabelAttributeCat") +@AnNew +@AnTable(table="DES_LABEL_ATTRIBUTE_CAT", key="ATTRIBUTE_CAT_ID", type="InnoDB") +public class DesLabelAttributeCat implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ATTRIBUTE_CAT_ID", type="long", notNull=true) private long attributeCatId; //1.属性分类ID + @AnTableField(column="INDUSTRY_ID", type="long", notNull=true) private long industryId; //2.行业ID + @AnTableField(column="ATTRIBUTE_CAT_NAME", type="string,64", notNull=true) private String attributeCatName; //3.属性分类名称 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //4.创建时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getAttributeCatId() + { + return attributeCatId; + } + + public void setAttributeCatId(long attributeCatId) + { + this.attributeCatId = attributeCatId; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public String getAttributeCatName() + { + return attributeCatName; + } + + public void setAttributeCatName(String attributeCatName) + { + this.attributeCatName = attributeCatName; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesLabelIndustry.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesLabelIndustry.java new file mode 100644 index 0000000..2a3cde8 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/DesLabelIndustry.java @@ -0,0 +1,82 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 标签行业表 对应表《DES_LABEL_INDUSTRY》 + */ +@AnAlias("DesLabelIndustry") +@AnNew +@AnTable(table="DES_LABEL_INDUSTRY", key="INDUSTRY_SUB_ID", type="InnoDB") +public class DesLabelIndustry implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="INDUSTRY_ID", type="long", notNull=true) private long industryId; //1.行业ID + @AnTableField(column="INDUSTRY_SUB_ID", type="long", notNull=true) private long industrySubId; //2.子行业ID + @AnTableField(column="INDUSTRY_SUB_NAME", type="string,64", notNull=true) private String industrySubName; //3.子行业名称 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //4.创建时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public long getIndustrySubId() + { + return industrySubId; + } + + public void setIndustrySubId(long industrySubId) + { + this.industrySubId = industrySubId; + } + + public String getIndustrySubName() + { + return industrySubName; + } + + public void setIndustrySubName(String industrySubName) + { + this.industrySubName = industrySubName; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/YqArticle.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/YqArticle.java new file mode 100644 index 0000000..f0e9424 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/YqArticle.java @@ -0,0 +1,115 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 文章详情表 对应表《YQ_ARTICLE》 + */ +@AnAlias("YqArticle") +@AnNew +@AnTable(table="YQ_ARTICLE", key="ARTICLE_ID", type="InnoDB") +public class YqArticle implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="CATEGORY_ID", type="long", notNull=true) private long categoryId; //1.文章所属分类ID + @AnTableField(column="ARTICLE_ID", type="long", notNull=true) private long articleId; //2.文章ID + @AnTableField(column="ARTICLE_NUMBER", type="int", notNull=true) private int articleNumber; //3.文章点击次数 + @AnTableField(column="ARTICLE_TITLE", type="string,64", notNull=true) private String articleTitle; //4.文章标题 + @AnTableField(column="ARTICLE_STATUS", type="byte", notNull=true) private int articleStatus; //5.文章状态,0表示正常,1表示停用 + @AnTableField(column="ARTICLE_TIME", type="datetime", notNull=true) private Timestamp articleTime; //6.文章发布时间 + @AnTableField(column="ARTICLE_CONTENT", type="string,50000", notNull=true) private String articleContent; //7.文章内容 + + public String toString() + { + return Jsons.toString(this); + } + + public long getCategoryId() + { + return categoryId; + } + + public void setCategoryId(long categoryId) + { + this.categoryId = categoryId; + } + + public long getArticleId() + { + return articleId; + } + + public void setArticleId(long articleId) + { + this.articleId = articleId; + } + + public int getArticleNumber() + { + return articleNumber; + } + + public void setArticleNumber(int articleNumber) + { + this.articleNumber = articleNumber; + } + + public String getArticleTitle() + { + return articleTitle; + } + + public void setArticleTitle(String articleTitle) + { + this.articleTitle = articleTitle; + } + + public int getArticleStatus() + { + return articleStatus; + } + + public void setArticleStatus(int articleStatus) + { + this.articleStatus = articleStatus; + } + + public Timestamp getArticleTime() + { + return articleTime; + } + + public void setArticleTime(Timestamp articleTime) + { + this.articleTime = articleTime; + } + + public String getArticleContent() + { + return articleContent; + } + + public void setArticleContent(String articleContent) + { + this.articleContent = articleContent; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/YqArticleEx.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/YqArticleEx.java new file mode 100644 index 0000000..d838657 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/YqArticleEx.java @@ -0,0 +1,55 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * 文章详情扩展视图 对应视图《YQ_ARTICLE_EX》 + */ +@AnAlias("YqArticleEx") +@AnNew +@AnView("YQ_ARTICLE,YQ_CATEGORY") +@AnViewJoin( +{ + @AnViewJoinValue(type = "EQUAL", lTable = "YQ_ARTICLE", lColumn = "CATEGORY_ID", rTable = "YQ_CATEGORY", rColumn = "CATEGORY_ID") +}) +public class YqArticleEx extends YqArticle +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table = "YQ_CATEGORY", column = "CATEGORY_NAME") + private String categoryName; // 1.分类名称 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getCategoryName() + { + return categoryName; + } + + public void setCategoryName(String categoryName) + { + this.categoryName = categoryName; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/YqCategory.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/YqCategory.java new file mode 100644 index 0000000..49793c0 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/YqCategory.java @@ -0,0 +1,103 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 文章分类表 对应表《YQ_CATEGORY》 + */ +@AnAlias("YqCategory") +@AnNew +@AnTable(table="YQ_CATEGORY", key="CATEGORY_ID", type="InnoDB") +public class YqCategory implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="PARENT_ID", type="long", notNull=true) private long parentId; //1.分类父级ID + @AnTableField(column="CATEGORY_ID", type="long", notNull=true) private long categoryId; //2.分类ID + @AnTableField(column="CATEGORY_NAME", type="string,64", notNull=true) private String categoryName; //3.分类名称 + @AnTableField(column="CATEGORY_LEVEL", type="int", notNull=true) private int categoryLevel; //4.分类级别 + @AnTableField(column="CATEGORY_STATUS", type="byte", notNull=true) private int categoryStatus; //5.分类状态,0表示正常,1表示停用 + @AnTableField(column="CATEGORY_SEQ", type="int", notNull=true) private int categorySeq; //6.分类排序编号 + + public String toString() + { + return Jsons.toString(this); + } + + public long getParentId() + { + return parentId; + } + + public void setParentId(long parentId) + { + this.parentId = parentId; + } + + public long getCategoryId() + { + return categoryId; + } + + public void setCategoryId(long categoryId) + { + this.categoryId = categoryId; + } + + public String getCategoryName() + { + return categoryName; + } + + public void setCategoryName(String categoryName) + { + this.categoryName = categoryName; + } + + public int getCategoryLevel() + { + return categoryLevel; + } + + public void setCategoryLevel(int categoryLevel) + { + this.categoryLevel = categoryLevel; + } + + public int getCategoryStatus() + { + return categoryStatus; + } + + public void setCategoryStatus(int categoryStatus) + { + this.categoryStatus = categoryStatus; + } + + public int getCategorySeq() + { + return categorySeq; + } + + public void setCategorySeq(int categorySeq) + { + this.categorySeq = categorySeq; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualAccount.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualAccount.java new file mode 100644 index 0000000..03006bb --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualAccount.java @@ -0,0 +1,102 @@ +package com.zhiqim.yangcai.design.dbo.account; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师虚拟账户 对应表《virtual_account》 + * + * @version 1.0 @author hc 2021年6月17日 新建与整理 + */ +@AnAlias("VirtualAccount") +@AnNew +@AnTable(table = "virtual_account", key = "operator_code", type = "InnoDB") +public class VirtualAccount implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "operator_code", type = "string,32", notNull = true) + private String operatorCode; // 1.账户名 + @AnTableField(column = "operator_status", type = "int", notNull = true) + private int operatorStatus; // 2.账户状态 + @AnTableField(column = "usable_money", type = "long", notNull = true) + private long usableMoney; // 3.账户可用余额 + @AnTableField(column = "freeze_money", type = "long", notNull = true) + private long freezeMoney; // 4.账户冻结金额 + @AnTableField(column = "sum_money", type = "long", notNull = true) + private long sumMoney; // 5.总金额 (可用余额+冻结余额) + @AnTableField(column = "remark", type = "string,50", notNull = false) + private String remark; // 6.备注 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public int getOperatorStatus() + { + return operatorStatus; + } + + public void setOperatorStatus(int operatorStatus) + { + this.operatorStatus = operatorStatus; + } + + public long getUsableMoney() + { + return usableMoney; + } + + public void setUsableMoney(long usableMoney) + { + this.usableMoney = usableMoney; + } + + public long getFreezeMoney() + { + return freezeMoney; + } + + public void setFreezeMoney(long freezeMoney) + { + this.freezeMoney = freezeMoney; + } + + public long getSumMoney() + { + return sumMoney; + } + + public void setSumMoney(long sumMoney) + { + this.sumMoney = sumMoney; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualAccountDetails.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualAccountDetails.java new file mode 100644 index 0000000..f8ba8a0 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualAccountDetails.java @@ -0,0 +1,187 @@ +package com.zhiqim.yangcai.design.dbo.account; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师虚拟账户明细 对应表《virtual_account_details》 + * + * @version 1.0 @author hc 2021年6月17日 新建与整理 + */ +@AnAlias("VirtualAccountDetails") +@AnNew +@AnTable(table = "virtual_account_details", key = "account_blotter", type = "InnoDB") +public class VirtualAccountDetails implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "account_blotter", type = "long", notNull = true) + private long accountBlotter; // 1.账户流水 + @AnTableField(column = "operator_code", type = "string,32", notNull = true) + private String operatorCode; // 2.账户名 + @AnTableField(column = "transaction_blotter", type = "long", notNull = true) + private long transactionBlotter; // 3.交易流水 + @AnTableField(column = "transaction_status", type = "int", notNull = true) + private int transactionStatus; // 4.交易类型 0,订单量奖励 1,加急单奖励 2,时效奖励 3,老客户奖励 4,完成订单奖励 5,售后处理 6,订单退回 + @AnTableField(column = "usable_money_add", type = "long", notNull = true) + private long usableMoneyAdd; // 5.可用余额增加 + @AnTableField(column = "usable_money_down", type = "long", notNull = true) + private long usableMoneyDown; // 6.可用余额减少 + @AnTableField(column = "freeze_money_add", type = "long", notNull = true) + private long freezeMoneyAdd; // 7.冻结余额增加 + @AnTableField(column = "freeze_money_down", type = "long", notNull = true) + private long freezeMoneyDown; // 8.冻结余额减少 + @AnTableField(column = "operator_time", type = "datetime", notNull = false) + private Timestamp operatorTime; // 9.操作时间 + @AnTableField(column = "usable_money", type = "long", notNull = true) + private long usableMoney; // 10.账户可用余额 + @AnTableField(column = "freeze_money", type = "long", notNull = true) + private long freezeMoney; // 11.账户冻结金额 + @AnTableField(column = "sum_money", type = "long", notNull = true) + private long sumMoney; // 12.总金额 (可用余额+冻结余额) + @AnTableField(column = "operator_remark", type = "string,32", notNull = true) + private String operatorRemark; // 13.操作备注 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getAccountBlotter() + { + return accountBlotter; + } + + public void setAccountBlotter(long accountBlotter) + { + this.accountBlotter = accountBlotter; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getTransactionBlotter() + { + return transactionBlotter; + } + + public void setTransactionBlotter(long transactionBlotter) + { + this.transactionBlotter = transactionBlotter; + } + + public int getTransactionStatus() + { + return transactionStatus; + } + + public void setTransactionStatus(int transactionStatus) + { + this.transactionStatus = transactionStatus; + } + + public long getUsableMoneyAdd() + { + return usableMoneyAdd; + } + + public void setUsableMoneyAdd(long usableMoneyAdd) + { + this.usableMoneyAdd = usableMoneyAdd; + } + + public long getUsableMoneyDown() + { + return usableMoneyDown; + } + + public void setUsableMoneyDown(long usableMoneyDown) + { + this.usableMoneyDown = usableMoneyDown; + } + + public long getFreezeMoneyAdd() + { + return freezeMoneyAdd; + } + + public void setFreezeMoneyAdd(long freezeMoneyAdd) + { + this.freezeMoneyAdd = freezeMoneyAdd; + } + + public long getFreezeMoneyDown() + { + return freezeMoneyDown; + } + + public void setFreezeMoneyDown(long freezeMoneyDown) + { + this.freezeMoneyDown = freezeMoneyDown; + } + + public Timestamp getOperatorTime() + { + return operatorTime; + } + + public void setOperatorTime(Timestamp operatorTime) + { + this.operatorTime = operatorTime; + } + + public long getUsableMoney() + { + return usableMoney; + } + + public void setUsableMoney(long usableMoney) + { + this.usableMoney = usableMoney; + } + + public long getFreezeMoney() + { + return freezeMoney; + } + + public void setFreezeMoney(long freezeMoney) + { + this.freezeMoney = freezeMoney; + } + + public long getSumMoney() + { + return sumMoney; + } + + public void setSumMoney(long sumMoney) + { + this.sumMoney = sumMoney; + } + + public String getOperatorRemark() + { + return operatorRemark; + } + + public void setOperatorRemark(String operatorRemark) + { + this.operatorRemark = operatorRemark; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualAccountTransactionView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualAccountTransactionView.java new file mode 100644 index 0000000..6c0311c --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualAccountTransactionView.java @@ -0,0 +1,226 @@ +package com.zhiqim.yangcai.design.dbo.account; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * + * [简要描述]:设计师虚拟订单账户和交易流水
            + * [详细描述]:
            + * + * @version 1.0 @author hc 2021年6月17日 新建与整理 + */ +@AnAlias("VirtualAccountTransactionView") +@AnNew +@AnView("virtual_account_details,virtual_transaction_details") +@AnViewJoin( +{ + @AnViewJoinValue(type = "LEFT", lTable = "virtual_account_details", lColumn = "OPERATOR_CODE", rTable = "virtual_transaction_details", rColumn = "OPERATOR_CODE") +}) +public class VirtualAccountTransactionView implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table = "virtual_account_details", column = "account_blotter") + private long accountBlotter; // 1.账户流水 + @AnViewField(table = "virtual_account_details", column = "operator_code") + private String operatorCode; // 2.操作员名称 + @AnViewField(table = "virtual_account_details", column = "transaction_blotter") + private long accountTransactionBlotter; // 3.交易流水 + @AnViewField(table = "virtual_account_details", column = "transaction_status") + private int accountTransactionStatus; // 4.交易类型 0,订单量奖励 1,加急单奖励 2,时效奖励 3,老客户奖励 4,完成订单奖励 5,售后处理 + // 6,订单退回 + @AnViewField(table = "virtual_account_details", column = "usable_money_add") + private long usableMoneyAdd; // 5.可用余额增加 + @AnViewField(table = "virtual_account_details", column = "usable_money_down") + private long usableMoneyDown; // 6.可用余额减少 + @AnViewField(table = "virtual_account_details", column = "freeze_money_add") + private long freezeMoneyAdd; // 7.冻结余额增加 + @AnViewField(table = "virtual_account_details", column = "freeze_money_down") + private long freezeMoneyDown; // 8.冻结余额减少 + @AnViewField(table = "virtual_account_details", column = "operator_time") + private Timestamp operatorTime; // 9.操作时间 + + @AnViewField(table = "virtual_transaction_details", column = "transaction_blotter") + private long transactionBlotter; // 1.交易流水 + @AnViewField(table = "virtual_transaction_details", column = "design_id") + private long designId; // 2.订单号 + @AnViewField(table = "virtual_transaction_details", column = "ORDER_TEXT") + private String orderText; // 3.产品类型 + @AnViewField(table = "virtual_transaction_details", column = "RECEIVE_TIME") + private Timestamp receiveTime; // 4.设计师领单时间 + @AnViewField(table = "virtual_transaction_details", column = "END_TIME") + private Timestamp endTime; // 5.设计师定稿时间 + @AnViewField(table = "virtual_transaction_details", column = "transaction_status") + private int transactionStatus; // 6.交易类型 0,订单量奖励 1,加急单奖励 2,时效奖励 3,老客户奖励 4,完成订单奖励 5,售后处理 6,订单退回 + @AnViewField(table = "virtual_transaction_details", column = "order_money") + private long orderMoney; // 7.订单金额 + + public long getAccountBlotter() + { + return accountBlotter; + } + + public void setAccountBlotter(long accountBlotter) + { + this.accountBlotter = accountBlotter; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getAccountTransactionBlotter() + { + return accountTransactionBlotter; + } + + public void setAccountTransactionBlotter(long accountTransactionBlotter) + { + this.accountTransactionBlotter = accountTransactionBlotter; + } + + public int getAccountTransactionStatus() + { + return accountTransactionStatus; + } + + public void setAccountTransactionStatus(int accountTransactionStatus) + { + this.accountTransactionStatus = accountTransactionStatus; + } + + public long getUsableMoneyAdd() + { + return usableMoneyAdd; + } + + public void setUsableMoneyAdd(long usableMoneyAdd) + { + this.usableMoneyAdd = usableMoneyAdd; + } + + public long getUsableMoneyDown() + { + return usableMoneyDown; + } + + public void setUsableMoneyDown(long usableMoneyDown) + { + this.usableMoneyDown = usableMoneyDown; + } + + public long getFreezeMoneyAdd() + { + return freezeMoneyAdd; + } + + public void setFreezeMoneyAdd(long freezeMoneyAdd) + { + this.freezeMoneyAdd = freezeMoneyAdd; + } + + public long getFreezeMoneyDown() + { + return freezeMoneyDown; + } + + public void setFreezeMoneyDown(long freezeMoneyDown) + { + this.freezeMoneyDown = freezeMoneyDown; + } + + public Timestamp getOperatorTime() + { + return operatorTime; + } + + public void setOperatorTime(Timestamp operatorTime) + { + this.operatorTime = operatorTime; + } + + public long getTransactionBlotter() + { + return transactionBlotter; + } + + public void setTransactionBlotter(long transactionBlotter) + { + this.transactionBlotter = transactionBlotter; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public Timestamp getReceiveTime() + { + return receiveTime; + } + + public void setReceiveTime(Timestamp receiveTime) + { + this.receiveTime = receiveTime; + } + + public Timestamp getEndTime() + { + return endTime; + } + + public void setEndTime(Timestamp endTime) + { + this.endTime = endTime; + } + + public int getTransactionStatus() + { + return transactionStatus; + } + + public void setTransactionStatus(int transactionStatus) + { + this.transactionStatus = transactionStatus; + } + + public long getOrderMoney() + { + return orderMoney; + } + + public void setOrderMoney(long orderMoney) + { + this.orderMoney = orderMoney; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualAccountType.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualAccountType.java new file mode 100644 index 0000000..4439059 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualAccountType.java @@ -0,0 +1,86 @@ +package com.zhiqim.yangcai.design.dbo.account; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * + * [简要描述]:虚拟账户类型表
            + * [详细描述]:
            + * + * @version 1.0 @author hc 2021年6月19日 新建与整理 + */ +@AnAlias("VirtualAccountType") +@AnNew +@AnTable(table = "virtual_account_type", key = "type_id", type = "InnoDB") +public class VirtualAccountType implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "type_id", type = "int", notNull = true) + private int typeId; // 1.交易类型 + @AnTableField(column = "type_name", type = "string,32", notNull = true) + private String typeName; // 2.交易类型名 + @AnTableField(column = "last_operator_code", type = "string,32", notNull = false) + private String lastOperatorCode; // 3.最后操作员 + @AnTableField(column = "create_time", type = "datetime", notNull = false) + private Timestamp createTime; // 4.创建时间 + @AnTableField(column = "modify_time", type = "datetime", notNull = false) + private Timestamp modifyTime; // 5.修改时间 + + public int getTypeId() + { + return typeId; + } + + public void setTypeId(int typeId) + { + this.typeId = typeId; + } + + public String getTypeName() + { + return typeName; + } + + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getLastOperatorCode() + { + return lastOperatorCode; + } + + public void setLastOperatorCode(String lastOperatorCode) + { + this.lastOperatorCode = lastOperatorCode; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualTransactionDetails.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualTransactionDetails.java new file mode 100644 index 0000000..68515ff --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/account/VirtualTransactionDetails.java @@ -0,0 +1,127 @@ +package com.zhiqim.yangcai.design.dbo.account; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师虚拟交易明细 对应表《virtual_transaction_details》 + * + * @version 1.0 @author hc 2021年6月17日 新建与整理 + */ +@AnAlias("VirtualTransactionDetails") +@AnNew +@AnTable(table = "virtual_transaction_details", key = "transaction_blotter", type = "InnoDB") +public class VirtualTransactionDetails implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "operator_code", type = "string,32", notNull = true) + private String operatorCode; // 1.账户名 + @AnTableField(column = "transaction_blotter", type = "long", notNull = true) + private long transactionBlotter; // 2.交易流水 + @AnTableField(column = "design_id", type = "long", notNull = false) + private long designId; // 3.订单号 + @AnTableField(column = "ORDER_TEXT", type = "string,200", notNull = false) + private String orderText; // 4.产品类型 + @AnTableField(column = "END_TIME", type = "datetime", notNull = false) + private Timestamp endTime; // 5.设计师定稿时间 + @AnTableField(column = "transaction_time", type = "datetime", notNull = false) + private Timestamp transactionTime; // 6.操作时间 + @AnTableField(column = "transaction_status", type = "int", notNull = true) + private int transactionStatus; // 7.交易类型 0,订单量奖励 1,加急单奖励 2,时效奖励 3,老客户奖励 4,完成订单奖励 5,售后处理 6,订单退回 + @AnTableField(column = "order_money", type = "long", notNull = false) + private long orderMoney; // 8.订单金额 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getTransactionBlotter() + { + return transactionBlotter; + } + + public void setTransactionBlotter(long transactionBlotter) + { + this.transactionBlotter = transactionBlotter; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public Timestamp getEndTime() + { + return endTime; + } + + public void setEndTime(Timestamp endTime) + { + this.endTime = endTime; + } + + public Timestamp getTransactionTime() + { + return transactionTime; + } + + public void setTransactionTime(Timestamp transactionTime) + { + this.transactionTime = transactionTime; + } + + public int getTransactionStatus() + { + return transactionStatus; + } + + public void setTransactionStatus(int transactionStatus) + { + this.transactionStatus = transactionStatus; + } + + public long getOrderMoney() + { + return orderMoney; + } + + public void setOrderMoney(long orderMoney) + { + this.orderMoney = orderMoney; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/after/DesignAfterOrder.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/after/DesignAfterOrder.java new file mode 100644 index 0000000..e0165de --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/after/DesignAfterOrder.java @@ -0,0 +1,359 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.after; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnIndex; +import org.zhiqim.orm.annotation.AnIndexValue; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 售后订单总表 对应表《DESIGN_AFTER_ORDER》 + */ +@AnAlias("DesignAfterOrder") +@AnNew +@AnTable(table = "DESIGN_AFTER_ORDER", key = "DESIGN_AFS_ID", type = "InnoDB") +@AnIndex( +{ + @AnIndexValue(name = "IX_DESIGN_ID", column = "DESIGN_ID", unique = false), + @AnIndexValue(name = "IX_AFTER_CREATE_TIME", column = "AFTER_CREATE_TIME", unique = false) +}) +public class DesignAfterOrder implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGN_AFS_ID", type = "long", notNull = true) + private long designAfsId; // 1.设计师平台售后单号 + @AnTableField(column = "OUT_AFS_ID", type = "string,64", notNull = true) + private String outAfsId; // 2.外部售后单号 + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 3.订单号 + @AnTableField(column = "LOSS_AMOUNT", type = "decimal,6,2", notNull = true) + private double lossAmount; // 4.损失金额 + @AnTableField(column = "COMPENSATE_AMOUNT", type = "decimal,6,2", notNull = true) + private double compensateAmount; // 4.赔付金额 + @AnTableField(column = "AFTER_STATUS", type = "int", notNull = true) + private int afterStatus; // 5.售后单处理状态 + @AnTableField(column = "NEW_DESIGN_ID", type = "long", notNull = false) + private long newDesignId; // 6.补单号(新单号) + @AnTableField(column = "PIC_ORG_ID", type = "long", notNull = false) + private long picOrgId; // 7.责任组织 + @AnTableField(column = "PIC_TYPE", type = "long", notNull = false) + private long picType; // 8.责任类型 设计师责任,系统责任 等 + @AnTableField(column = "PROBLEM_TYPE", type = "long", notNull = false) + private long problemType; // 9.问题类型, 设计与成品不符 , 设计师态度,色差等 + @AnTableField(column = "PROBLEM_REASON", type = "string,30", notNull = false) + private String problemReason; // 10.问题原因 + @AnTableField(column = "PROBLEM_DESC", type = "string,6000", notNull = false) + private String problemDesc; // 10.问题详细描述 + @AnTableField(column = "AFTER_CREATE_TIME", type = "datetime", notNull = true) + private Timestamp afterCreateTime; // 11.创建时间 + @AnTableField(column = "AFTER_MODIFY_TIME", type = "datetime", notNull = true) + private Timestamp afterModifyTime; // 12.变更时间 + @AnTableField(column = "AFTER_BLAMER", type = "string,64", notNull = false) + private String afterBlamer; // 13.责任人 + @AnTableField(column = "AFTER_RETURN_NOTE", type = "string,600", notNull = false) + private String afterReturnNote; // 14.售后退回原因,(系统之间原因) + @AnTableField(column = "AFTER_BLAME_RETURN_NOTE", type = "string,600", notNull = false) + private String afterBlameReturnNote; // 15.申诉退回 原因 + @AnTableField(column = "AFTER_BLAME_RETURN_TIME", type = "datetime", notNull = false) + private Timestamp afterBlameReturnTime; // 16.申诉退回 时间 + @AnTableField(column = "AFTER_HANDLER", type = "string,64", notNull = false) + private String afterHandler; // 17.处理人 (指派责任的人) + @AnTableField(column = "AFTER_HANDEL_TIME", type = "datetime", notNull = false) + private Timestamp afterHandelTime; // 18.处理时间 (责任指派时间) + @AnTableField(column = "AFTER_FINISH_NOTE", type = "string,600", notNull = false) + private String afterFinishNote; // 19.处理完成描述,处理这处理完成时需添加 描述内容 + @AnTableField(column = "AFTER_FINISH_TIME", type = "datetime", notNull = false) + private Timestamp afterFinishTime; // 20.售后完成时间 + @AnTableField(column = "AFTER_CANCELER", type = "string,64", notNull = false) + private String afterCanceler; // 21.取消人 + @AnTableField(column = "AFTER_CANCEL_TIME", type = "datetime", notNull = false) + private Timestamp afterCancelTime; // 22.取消时间 + @AnTableField(column = "AFTER_CANCEL_NOTE", type = "string,400", notNull = false) + private String afterCancelNote; // 23.取消原因 + @AnTableField(column = "AFTER_COMPLAIN_CHECK_NOTE", type = "string,400", notNull = false) + private String afterComplainCheckNote; // 24.申诉审核备注 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getDesignAfsId() + { + return designAfsId; + } + + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + + public String getOutAfsId() + { + return outAfsId; + } + + public void setOutAfsId(String outAfsId) + { + this.outAfsId = outAfsId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public double getLossAmount() + { + return lossAmount; + } + + public void setLossAmount(double lossAmount) + { + this.lossAmount = lossAmount; + } + + public int getAfterStatus() + { + return afterStatus; + } + + public void setAfterStatus(int afterStatus) + { + this.afterStatus = afterStatus; + } + + public long getNewDesignId() + { + return newDesignId; + } + + public void setNewDesignId(long newDesignId) + { + this.newDesignId = newDesignId; + } + + public long getPicOrgId() + { + return picOrgId; + } + + public void setPicOrgId(long picOrgId) + { + this.picOrgId = picOrgId; + } + + public long getPicType() + { + return picType; + } + + public void setPicType(long picType) + { + this.picType = picType; + } + + public long getProblemType() + { + return problemType; + } + + public void setProblemType(long problemType) + { + this.problemType = problemType; + } + + public String getProblemReason() + { + return problemReason; + } + + public void setProblemReason(String problemReason) + { + this.problemReason = problemReason; + } + + public String getProblemDesc() + { + return problemDesc; + } + + public void setProblemDesc(String problemDesc) + { + this.problemDesc = problemDesc; + } + + public Timestamp getAfterCreateTime() + { + return afterCreateTime; + } + + public void setAfterCreateTime(Timestamp afterCreateTime) + { + this.afterCreateTime = afterCreateTime; + } + + public Timestamp getAfterModifyTime() + { + return afterModifyTime; + } + + public void setAfterModifyTime(Timestamp afterModifyTime) + { + this.afterModifyTime = afterModifyTime; + } + + public String getAfterBlamer() + { + return afterBlamer; + } + + public void setAfterBlamer(String afterBlamer) + { + this.afterBlamer = afterBlamer; + } + + public String getAfterReturnNote() + { + return afterReturnNote; + } + + public void setAfterReturnNote(String afterReturnNote) + { + this.afterReturnNote = afterReturnNote; + } + + public String getAfterBlameReturnNote() + { + return afterBlameReturnNote; + } + + public void setAfterBlameReturnNote(String afterBlameReturnNote) + { + this.afterBlameReturnNote = afterBlameReturnNote; + } + + public Timestamp getAfterBlameReturnTime() + { + return afterBlameReturnTime; + } + + public void setAfterBlameReturnTime(Timestamp afterBlameReturnTime) + { + this.afterBlameReturnTime = afterBlameReturnTime; + } + + public String getAfterHandler() + { + return afterHandler; + } + + public void setAfterHandler(String afterHandler) + { + this.afterHandler = afterHandler; + } + + public Timestamp getAfterHandelTime() + { + return afterHandelTime; + } + + public void setAfterHandelTime(Timestamp afterHandelTime) + { + this.afterHandelTime = afterHandelTime; + } + + public String getAfterFinishNote() + { + return afterFinishNote; + } + + public void setAfterFinishNote(String afterFinishNote) + { + this.afterFinishNote = afterFinishNote; + } + + public Timestamp getAfterFinishTime() + { + return afterFinishTime; + } + + public void setAfterFinishTime(Timestamp afterFinishTime) + { + this.afterFinishTime = afterFinishTime; + } + + public String getAfterCanceler() + { + return afterCanceler; + } + + public void setAfterCanceler(String afterCanceler) + { + this.afterCanceler = afterCanceler; + } + + public Timestamp getAfterCancelTime() + { + return afterCancelTime; + } + + public void setAfterCancelTime(Timestamp afterCancelTime) + { + this.afterCancelTime = afterCancelTime; + } + + public String getAfterCancelNote() + { + return afterCancelNote; + } + + public void setAfterCancelNote(String afterCancelNote) + { + this.afterCancelNote = afterCancelNote; + } + + public String getAfterComplainCheckNote() + { + return afterComplainCheckNote; + } + + public void setAfterComplainCheckNote(String afterComplainCheckNote) + { + this.afterComplainCheckNote = afterComplainCheckNote; + } + + public double getCompensateAmount() + { + return compensateAmount; + } + + public void setCompensateAmount(double compensateAmount) + { + this.compensateAmount = compensateAmount; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/after/DesignAfterOrderView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/after/DesignAfterOrderView.java new file mode 100644 index 0000000..4d9f913 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/after/DesignAfterOrderView.java @@ -0,0 +1,203 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.after; + +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrder; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 售后订单列表视图 对应视图《DESIGN_AFTER_ORDER_VIEW》 + */ +@AnAlias("DesignAfterOrderView") +@AnNew +@AnView("DESIGN_AFTER_ORDER,DESIGN_ORDER") +@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="DESIGN_AFTER_ORDER", lColumn="DESIGN_ID", rTable="DESIGN_ORDER", rColumn="DESIGN_ID")}) +public class DesignAfterOrderView extends DesignAfterOrder +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="DESIGN_ORDER", column="MERCHANT_ID") private long merchantId; //2.订单商户编号 + @AnViewField(table="DESIGN_ORDER", column="ORG_ID") private long orgId; //3.操作员组织编号 + @AnViewField(table="DESIGN_ORDER", column="OUT_ID") private long outId; //4.外部系统单号 + @AnViewField(table="DESIGN_ORDER", column="ORDER_TEXT") private String orderText; //5.订单描述 + @AnViewField(table="DESIGN_ORDER", column="AFTER_NAMES") private String afterNames; //6.后加工名称,多个逗号隔开 + @AnViewField(table="DESIGN_ORDER", column="AMOUNT") private long amount; //7.订单总金额 + @AnViewField(table="DESIGN_ORDER", column="PRINT_SPECIAL") private String printSpecial; //8.印刷特殊工艺 + @AnViewField(table="DESIGN_ORDER", column="TYPE_ID") private long typeId; //9.设计类型,名片、彩页、等等 + @AnViewField(table="DESIGN_ORDER", column="SHOP_NICK") private String shopNick; //10.店铺名称 + @AnViewField(table="DESIGN_ORDER", column="DESIGNER") private String designer; //11.设计师 + @AnViewField(table="DESIGN_ORDER", column="BUYER_NICK") private String buyerNick; //12.客户昵称 + @AnViewField(table="DESIGN_ORDER", column="USER_CONTACT") private String userContact; //13.联系人 + @AnViewField(table="DESIGN_ORDER", column="USER_MOBILE") private String userMobile; //14.用户手机 + @AnViewField(table="DESIGN_ORDER", column="USER_QQ") private String userQq; //15.用户QQ + @AnViewField(table="DESIGN_ORDER", column="USER_WX") private String userWx; //16.用户微信 + + public String toString() + { + return Jsons.toString(this); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public long getOutId() + { + return outId; + } + + public void setOutId(long outId) + { + this.outId = outId; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public String getAfterNames() + { + return afterNames; + } + + public void setAfterNames(String afterNames) + { + this.afterNames = afterNames; + } + + public long getAmount() + { + return amount; + } + + public void setAmount(long amount) + { + this.amount = amount; + } + + public String getPrintSpecial() + { + return printSpecial; + } + + public void setPrintSpecial(String printSpecial) + { + this.printSpecial = printSpecial; + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + public String getShopNick() + { + return shopNick; + } + + public void setShopNick(String shopNick) + { + this.shopNick = shopNick; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public String getUserContact() + { + return userContact; + } + + public void setUserContact(String userContact) + { + this.userContact = userContact; + } + + public String getUserMobile() + { + return userMobile; + } + + public void setUserMobile(String userMobile) + { + this.userMobile = userMobile; + } + + public String getUserQq() + { + return userQq; + } + + public void setUserQq(String userQq) + { + this.userQq = userQq; + } + + public String getUserWx() + { + return userWx; + } + + public void setUserWx(String userWx) + { + this.userWx = userWx; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/after/DesignAfterStatisticDetail.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/after/DesignAfterStatisticDetail.java new file mode 100644 index 0000000..022a960 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/after/DesignAfterStatisticDetail.java @@ -0,0 +1,540 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.after; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnIndex; +import org.zhiqim.orm.annotation.AnIndexValue; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 售后统计详情表 对应表《DESIGN_AFTER_STATISTIC_DETAIL》 + */ +@AnAlias("DesignAfterStatisticDetail") +@AnNew +@AnTable(table = "DESIGN_AFTER_STATISTIC_DETAIL", key = "START_DATE,DESIGN_AFS_ID", type = "InnoDB") +@AnIndex( +{ + @AnIndexValue(name = "IX_DESIGN_ID", column = "DESIGN_ID", unique = false), @AnIndexValue(name = "IX_ORG_ID", column = "ORG_ID", unique = false), + @AnIndexValue(name = "IX_AFTER_BLAMER", column = "AFTER_BLAMER", unique = false), + @AnIndexValue(name = "IX_AFTER_FINISH_TIME", column = "AFTER_FINISH_TIME", unique = false) +}) +public class DesignAfterStatisticDetail implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "START_DATE", type = "string,32", notNull = true) + private String startDate; // 1.统计日期 yyyy-MM + @AnTableField(column = "DESIGN_AFS_ID", type = "long", notNull = true) + private long designAfsId; // 2.设计师平台 独立售后单号 + @AnTableField(column = "OUT_AFS_ID", type = "string,64", notNull = true) + private String outAfsId; // 3.设计师平台 独立售后单号 + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 4.设计师平台的那条 订单售后 + @AnTableField(column = "LOSS_AMOUNT", type = "decimal,6,2", notNull = true) + private double lossAmount; // 5.损失金额 + @AnTableField(column = "AFTER_STATUS", type = "int", notNull = true) + private int afterStatus; // 6.售后单处理状态 + @AnTableField(column = "NEW_DESIGN_ID", type = "long", notNull = false) + private long newDesignId; // 7.补单号(新单号) + @AnTableField(column = "PIC_ORG_ID", type = "long", notNull = false) + private long picOrgId; // 8.责任组织 + @AnTableField(column = "PIC_TYPE", type = "long", notNull = false) + private long picType; // 9.责任类型 设计师责任,系统责任 等 + @AnTableField(column = "PROBLEM_TYPE", type = "long", notNull = false) + private long problemType; // 10.问题类型, 设计与成品不符 , 设计师态度,色差等 + @AnTableField(column = "PROBLEM_DESC", type = "string,6000", notNull = false) + private String problemDesc; // 11.问题描述 + @AnTableField(column = "AFTER_CREATE_TIME", type = "datetime", notNull = true) + private Timestamp afterCreateTime; // 12.创建时间 + @AnTableField(column = "AFTER_MODIFY_TIME", type = "datetime", notNull = true) + private Timestamp afterModifyTime; // 13.变更时间 + @AnTableField(column = "AFTER_BLAMER", type = "string,64", notNull = false) + private String afterBlamer; // 14.责任人 + @AnTableField(column = "AFTER_RETURN_NOTE", type = "string,600", notNull = false) + private String afterReturnNote; // 15.售后退回原因,(系统之间原因) + @AnTableField(column = "AFTER_BLAME_RETURN_NOTE", type = "string,600", notNull = false) + private String afterBlameReturnNote; // 16.申诉退回 原因 + @AnTableField(column = "AFTER_BLAME_RETURN_TIME", type = "datetime", notNull = false) + private Timestamp afterBlameReturnTime; // 17.申诉退回 时间 + @AnTableField(column = "AFTER_HANDLER", type = "string,64", notNull = false) + private String afterHandler; // 18.处理人 (指派责任的人) + @AnTableField(column = "AFTER_HANDEL_TIME", type = "datetime", notNull = false) + private Timestamp afterHandelTime; // 19.处理时间 (责任指派时间) + @AnTableField(column = "AFTER_FINISH_NOTE", type = "string,600", notNull = false) + private String afterFinishNote; // 20.处理完成描述,处理这处理完成时需添加 描述内容 + @AnTableField(column = "AFTER_FINISH_TIME", type = "datetime", notNull = false) + private Timestamp afterFinishTime; // 21.售后完成时间 + @AnTableField(column = "AFTER_CANCELER", type = "string,64", notNull = false) + private String afterCanceler; // 22.取消人 + @AnTableField(column = "AFTER_CANCEL_TIME", type = "datetime", notNull = false) + private Timestamp afterCancelTime; // 23.取消时间 + @AnTableField(column = "AFTER_CANCEL_NOTE", type = "string,400", notNull = false) + private String afterCancelNote; // 24.取消原因 + @AnTableField(column = "AFTER_COMPLAIN_CHECK_NOTE", type = "string,400", notNull = false) + private String afterComplainCheckNote; // 25.申诉审核备注 + @AnTableField(column = "MERCHANT_ID", type = "long", notNull = true) + private long merchantId; // 26.订单商户ID + @AnTableField(column = "ORG_ID", type = "long", notNull = true) + private long orgId; // 27.责任组织ID + @AnTableField(column = "OUT_ID", type = "long", notNull = true) + private long outId; // 28.外部系统订单号ID + @AnTableField(column = "ORDER_TEXT", type = "string,600", notNull = false) + private String orderText; // 29.订单信息 + @AnTableField(column = "AFTER_NAMES", type = "string,600", notNull = false) + private String afterNames; // 30.后加工名称 + @AnTableField(column = "AMOUNT", type = "long", notNull = true) + private long amount; // 31.设计订单金额 + @AnTableField(column = "PRINT_SPECIAL", type = "string,100", notNull = false) + private String printSpecial; // 32.特殊工艺 + @AnTableField(column = "TYPE_ID", type = "long", notNull = true) + private long typeId; // 33.设计类型,名片、彩页、等等 + @AnTableField(column = "SHOP_NICK", type = "string,100", notNull = false) + private String shopNick; // 34.店铺名 + @AnTableField(column = "DESIGNER", type = "string,64", notNull = false) + private String designer; // 35.订单设计师 + @AnTableField(column = "BUYER_NICK", type = "string,100", notNull = false) + private String buyerNick; // 36.订单买家昵称 + @AnTableField(column = "USER_CONTACT", type = "string,200", notNull = false) + private String userContact; // 37.订单买家联系人 + @AnTableField(column = "USER_MOBILE", type = "string,100", notNull = false) + private String userMobile; // 38.订单买家联系手机 + @AnTableField(column = "USER_QQ", type = "string,100", notNull = false) + private String userQq; // 39.订单买家联系QQ + @AnTableField(column = "USER_WX", type = "string,100", notNull = false) + private String userWx; // 40.订单买家联系WX + + private double compensateAmount;// 赔付总金额 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getStartDate() + { + return startDate; + } + + public void setStartDate(String startDate) + { + this.startDate = startDate; + } + + public long getDesignAfsId() + { + return designAfsId; + } + + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + + public String getOutAfsId() + { + return outAfsId; + } + + public void setOutAfsId(String outAfsId) + { + this.outAfsId = outAfsId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public double getLossAmount() + { + return lossAmount; + } + + public void setLossAmount(double lossAmount) + { + this.lossAmount = lossAmount; + } + + public int getAfterStatus() + { + return afterStatus; + } + + public void setAfterStatus(int afterStatus) + { + this.afterStatus = afterStatus; + } + + public long getNewDesignId() + { + return newDesignId; + } + + public void setNewDesignId(long newDesignId) + { + this.newDesignId = newDesignId; + } + + public long getPicOrgId() + { + return picOrgId; + } + + public void setPicOrgId(long picOrgId) + { + this.picOrgId = picOrgId; + } + + public long getPicType() + { + return picType; + } + + public void setPicType(long picType) + { + this.picType = picType; + } + + public long getProblemType() + { + return problemType; + } + + public void setProblemType(long problemType) + { + this.problemType = problemType; + } + + public String getProblemDesc() + { + return problemDesc; + } + + public void setProblemDesc(String problemDesc) + { + this.problemDesc = problemDesc; + } + + public Timestamp getAfterCreateTime() + { + return afterCreateTime; + } + + public void setAfterCreateTime(Timestamp afterCreateTime) + { + this.afterCreateTime = afterCreateTime; + } + + public Timestamp getAfterModifyTime() + { + return afterModifyTime; + } + + public void setAfterModifyTime(Timestamp afterModifyTime) + { + this.afterModifyTime = afterModifyTime; + } + + public String getAfterBlamer() + { + return afterBlamer; + } + + public void setAfterBlamer(String afterBlamer) + { + this.afterBlamer = afterBlamer; + } + + public String getAfterReturnNote() + { + return afterReturnNote; + } + + public void setAfterReturnNote(String afterReturnNote) + { + this.afterReturnNote = afterReturnNote; + } + + public String getAfterBlameReturnNote() + { + return afterBlameReturnNote; + } + + public void setAfterBlameReturnNote(String afterBlameReturnNote) + { + this.afterBlameReturnNote = afterBlameReturnNote; + } + + public Timestamp getAfterBlameReturnTime() + { + return afterBlameReturnTime; + } + + public void setAfterBlameReturnTime(Timestamp afterBlameReturnTime) + { + this.afterBlameReturnTime = afterBlameReturnTime; + } + + public String getAfterHandler() + { + return afterHandler; + } + + public void setAfterHandler(String afterHandler) + { + this.afterHandler = afterHandler; + } + + public Timestamp getAfterHandelTime() + { + return afterHandelTime; + } + + public void setAfterHandelTime(Timestamp afterHandelTime) + { + this.afterHandelTime = afterHandelTime; + } + + public String getAfterFinishNote() + { + return afterFinishNote; + } + + public void setAfterFinishNote(String afterFinishNote) + { + this.afterFinishNote = afterFinishNote; + } + + public Timestamp getAfterFinishTime() + { + return afterFinishTime; + } + + public void setAfterFinishTime(Timestamp afterFinishTime) + { + this.afterFinishTime = afterFinishTime; + } + + public String getAfterCanceler() + { + return afterCanceler; + } + + public void setAfterCanceler(String afterCanceler) + { + this.afterCanceler = afterCanceler; + } + + public Timestamp getAfterCancelTime() + { + return afterCancelTime; + } + + public void setAfterCancelTime(Timestamp afterCancelTime) + { + this.afterCancelTime = afterCancelTime; + } + + public String getAfterCancelNote() + { + return afterCancelNote; + } + + public void setAfterCancelNote(String afterCancelNote) + { + this.afterCancelNote = afterCancelNote; + } + + public String getAfterComplainCheckNote() + { + return afterComplainCheckNote; + } + + public void setAfterComplainCheckNote(String afterComplainCheckNote) + { + this.afterComplainCheckNote = afterComplainCheckNote; + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public long getOutId() + { + return outId; + } + + public void setOutId(long outId) + { + this.outId = outId; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public String getAfterNames() + { + return afterNames; + } + + public void setAfterNames(String afterNames) + { + this.afterNames = afterNames; + } + + public long getAmount() + { + return amount; + } + + public void setAmount(long amount) + { + this.amount = amount; + } + + public String getPrintSpecial() + { + return printSpecial; + } + + public void setPrintSpecial(String printSpecial) + { + this.printSpecial = printSpecial; + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + public String getShopNick() + { + return shopNick; + } + + public void setShopNick(String shopNick) + { + this.shopNick = shopNick; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public String getUserContact() + { + return userContact; + } + + public void setUserContact(String userContact) + { + this.userContact = userContact; + } + + public String getUserMobile() + { + return userMobile; + } + + public void setUserMobile(String userMobile) + { + this.userMobile = userMobile; + } + + public String getUserQq() + { + return userQq; + } + + public void setUserQq(String userQq) + { + this.userQq = userQq; + } + + public String getUserWx() + { + return userWx; + } + + public void setUserWx(String userWx) + { + this.userWx = userWx; + } + + public double getCompensateAmount() + { + return compensateAmount; + } + + public void setCompensateAmount(double compensateAmount) + { + this.compensateAmount = compensateAmount; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/api/ApiInvokeLog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/api/ApiInvokeLog.java new file mode 100644 index 0000000..28d895d --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/api/ApiInvokeLog.java @@ -0,0 +1,142 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.api; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 接口调用日志表 对应表《API_INVOKE_LOG》 + */ +@AnAlias("ApiInvokeLog") +@AnNew +@AnTable(table="API_INVOKE_LOG", key="INVOKE_LOG_ID", type="InnoDB") +@AnIndex({@AnIndexValue(name="IX_INVOCK_IP", column="REMOTE_IP", unique=false), + @AnIndexValue(name="IX_REMOTE_USER", column="REMOTE_USER", unique=false), + @AnIndexValue(name="IX_USER_STATUS_TIME", column="REMOTE_USER,STATUS_CODE,CREATE_TIME", unique=false), + @AnIndexValue(name="IX_API_NAME", column="API_NAME", unique=false), + @AnIndexValue(name="IX_STATUS_CODE", column="STATUS_CODE", unique=false)}) +public class ApiInvokeLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="INVOKE_LOG_ID", type="long", notNull=true) private long invokeLogId; //1.日志编号 + @AnTableField(column="REMOTE_IP", type="string,200", notNull=true) private String remoteIp; //2.用户IP地址 + @AnTableField(column="ERROR_ID", type="string,200", notNull=false) private String errorId; //3.错误订单号 -1或者null 表示该方法 订单号字段允许为空 + @AnTableField(column="STATUS_CODE", type="int", notNull=true) private int statusCode; //4.状态码 + @AnTableField(column="REMOTE_USER", type="string,200", notNull=true) private String remoteUser; //5.用户名 没有用户 名时填写IP地址 + @AnTableField(column="API_NAME", type="string,200", notNull=false) private String apiName; //6.调用接口名 + @AnTableField(column="INVOKE_MESSAGE", type="string,6000", notNull=false) private String invokeMessage; //7.调用接口结果描述 + @AnTableField(column="INVOKE_STACK_TRACE", type="string,4000", notNull=false) private String invokeStackTrace; //8.调用接口的堆栈信息 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //9.入库时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getInvokeLogId() + { + return invokeLogId; + } + + public void setInvokeLogId(long invokeLogId) + { + this.invokeLogId = invokeLogId; + } + + public String getRemoteIp() + { + return remoteIp; + } + + public void setRemoteIp(String remoteIp) + { + this.remoteIp = remoteIp; + } + + public String getErrorId() + { + return errorId; + } + + public void setErrorId(String errorId) + { + this.errorId = errorId; + } + + public int getStatusCode() + { + return statusCode; + } + + public void setStatusCode(int statusCode) + { + this.statusCode = statusCode; + } + + public String getRemoteUser() + { + return remoteUser; + } + + public void setRemoteUser(String remoteUser) + { + this.remoteUser = remoteUser; + } + + public String getApiName() + { + return apiName; + } + + public void setApiName(String apiName) + { + this.apiName = apiName; + } + + public String getInvokeMessage() + { + return invokeMessage; + } + + public void setInvokeMessage(String invokeMessage) + { + this.invokeMessage = invokeMessage; + } + + public String getInvokeStackTrace() + { + return invokeStackTrace; + } + + public void setInvokeStackTrace(String invokeStackTrace) + { + this.invokeStackTrace = invokeStackTrace; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/complain/DesignComplain.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/complain/DesignComplain.java new file mode 100644 index 0000000..bd80aec --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/complain/DesignComplain.java @@ -0,0 +1,295 @@ +/** + * 扬彩印刷设计 + * 文件名 :ComplainDetail.java + * 创建人 :gjx + * 创建时间:2019-8-14 + */ + +package com.zhiqim.yangcai.design.dbo.complain; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 投诉单详情表 + * + * @version 1.0 @author gjx 2019-8-14 新建与整理 + */ +@AnAlias("DesignComplain") +@AnNew +@AnTable(table = "DESIGN_COMPLAIN", key = "COMPLAIN_ID", type = "InnoDB") +public class DesignComplain implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "COMPLAIN_ID", type = "long", notNull = true) + private long complainId; // 1.投诉单ID + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 2.设计单号 + @AnTableField(column = "COMPLAIN_STATUS", type = "string,20", notNull = true) + private String complainStatus; // 3.投诉状态 + @AnTableField(column = "COMPLAIN_TYPE", type = "string,100", notNull = true) + private String complainType; // 4.投诉类型 + @AnTableField(column = "DISPOSE_PROJECT", type = "string,100", notNull = true) + private String disposeProject; // 5.处理方案 + @AnTableField(column = "SHOP_PUNISH_SCORE", type = "int", notNull = false) + private int shopPunishScore; // 6.店铺扣罚分数 + @AnTableField(column = "UNDERTAKE_DEPT", type = "string,100", notNull = true) + private String undertakeDept; // 7.责任部门 + @AnTableField(column = "UNDERTAKE_PERSON", type = "string,20", notNull = true) + private String undertakePerson; // 8.责任人 + @AnTableField(column = "IS_SATRAP_ASSIST", type = "boolean", notNull = false) + private boolean isSatrapAssist; // 9.是否需要主管协助,0不需要,1需要 + @AnTableField(column = "COMPLAIN_SPECIFIC_TEXT", type = "string,200", notNull = true) + private String complainSpecificText; // 10.投诉具体描述 + @AnTableField(column = "DISPOSE_IMG_PATH", type = "string,200", notNull = false) + private String disposeImgPath; // 11.投诉单处理图片路径 + @AnTableField(column = "FINISH_IMG_PATH", type = "string,200", notNull = false) + private String finishImgPath; // 12.投诉单完结图片路径 + @AnTableField(column = "COMPLAIN_ADD_NAME", type = "string,20", notNull = true) + private String complainAddName; // 13.投诉单受理人 + @AnTableField(column = "COMPLAIN_ADD_TIME", type = "datetime", notNull = true) + private Timestamp complainAddTime; // 14.投诉单受理时间 + @AnTableField(column = "COMPLAIN_MODIFY_TIME", type = "datetime", notNull = false) + private Timestamp complainModifyTime; // 15.修改时间 + @AnTableField(column = "ASSIST_PERSON", type = "string,20", notNull = false) + private String assistPerson; // 16.协助人 + @AnTableField(column = "ASSIST_ORG", type = "long", notNull = false) + private long assistOrg; // 17.协助组织 + @AnTableField(column = "UNDERTAKE_ORG_NAME", type = "string,20", notNull = false) + private String undertakeOrgName; // 18.责任组织名称 + @AnTableField(column = "ASSIST_DEPT_MANAGER", type = "string,20", notNull = false) + private String assistDeptManager; // 19.协助主管 + @AnTableField(column = "ASSIST_ORG_NAME", type = "string,20", notNull = false) + private String assistOrgName; // 20.协助组织名称 + @AnTableField(column = "UNDERTAKE_DEPT_MANAGER", type = "string,20", notNull = false) + private String undertakeDeptManager; // 21.责任主管 + @AnTableField(column = "UNDERTAKE_ORG", type = "long", notNull = false) + private long undertakeOrg; // 22.责任组织 + + public long getComplainId() + { + return complainId; + } + + public void setComplainId(long complainId) + { + this.complainId = complainId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getComplainStatus() + { + return complainStatus; + } + + public void setComplainStatus(String complainStatus) + { + this.complainStatus = complainStatus; + } + + public String getComplainType() + { + return complainType; + } + + public void setComplainType(String complainType) + { + this.complainType = complainType; + } + + public String getDisposeProject() + { + return disposeProject; + } + + public void setDisposeProject(String disposeProject) + { + this.disposeProject = disposeProject; + } + + public int getShopPunishScore() + { + return shopPunishScore; + } + + public void setShopPunishScore(int shopPunishScore) + { + this.shopPunishScore = shopPunishScore; + } + + public String getUndertakeDept() + { + return undertakeDept; + } + + public void setUndertakeDept(String undertakeDept) + { + this.undertakeDept = undertakeDept; + } + + public String getUndertakePerson() + { + return undertakePerson; + } + + public void setUndertakePerson(String undertakePerson) + { + this.undertakePerson = undertakePerson; + } + + public boolean isSatrapAssist() + { + return isSatrapAssist; + } + + public void setSatrapAssist(boolean isSatrapAssist) + { + this.isSatrapAssist = isSatrapAssist; + } + + public String getComplainSpecificText() + { + return complainSpecificText; + } + + public void setComplainSpecificText(String complainSpecificText) + { + this.complainSpecificText = complainSpecificText; + } + + public String getDisposeImgPath() + { + return disposeImgPath; + } + + public void setDisposeImgPath(String disposeImgPath) + { + this.disposeImgPath = disposeImgPath; + } + + public String getComplainAddName() + { + return complainAddName; + } + + public void setComplainAddName(String complainAddName) + { + this.complainAddName = complainAddName; + } + + public Timestamp getComplainAddTime() + { + return complainAddTime; + } + + public void setComplainAddTime(Timestamp complainAddTime) + { + this.complainAddTime = complainAddTime; + } + + public Timestamp getComplainModifyTime() + { + return complainModifyTime; + } + + public void setComplainModifyTime(Timestamp complainModifyTime) + { + this.complainModifyTime = complainModifyTime; + } + + public String getFinishImgPath() + { + return finishImgPath; + } + + public void setFinishImgPath(String finishImgPath) + { + this.finishImgPath = finishImgPath; + } + + public String getAssistPerson() + { + return assistPerson; + } + + public void setAssistPerson(String assistPerson) + { + this.assistPerson = assistPerson; + } + + public long getAssistOrg() + { + return assistOrg; + } + + public void setAssistOrg(long assistOrg) + { + this.assistOrg = assistOrg; + } + + public String getUndertakeOrgName() + { + return undertakeOrgName; + } + + public void setUndertakeOrgName(String undertakeOrgName) + { + this.undertakeOrgName = undertakeOrgName; + } + + public String getAssistDeptManager() + { + return assistDeptManager; + } + + public void setAssistDeptManager(String assistDeptManager) + { + this.assistDeptManager = assistDeptManager; + } + + public String getAssistOrgName() + { + return assistOrgName; + } + + public void setAssistOrgName(String assistOrgName) + { + this.assistOrgName = assistOrgName; + } + + public String getUndertakeDeptManager() + { + return undertakeDeptManager; + } + + public void setUndertakeDeptManager(String undertakeDeptManager) + { + this.undertakeDeptManager = undertakeDeptManager; + } + + public long getUndertakeOrg() + { + return undertakeOrg; + } + + public void setUndertakeOrg(long undertakeOrg) + { + this.undertakeOrg = undertakeOrg; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/complain/DesignComplainView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/complain/DesignComplainView.java new file mode 100644 index 0000000..0484241 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/complain/DesignComplainView.java @@ -0,0 +1,235 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignComplainView.java + * 创建人 :gjx + * 创建时间:2019-8-15 + */ + +package com.zhiqim.yangcai.design.dbo.complain; + +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * 投诉单视图 + * + * @version 1.0 @author gjx 2019-8-15 新建与整理 + */ +@AnAlias("DesignComplainView") +@AnNew +@AnView("DESIGN_COMPLAIN,DESIGN_ORDER") +@AnViewJoin( +{ + @AnViewJoinValue(type = "EQUAL", lTable = "DESIGN_COMPLAIN", lColumn = "DESIGN_ID", rTable = "DESIGN_ORDER", rColumn = "DESIGN_ID") +}) +public class DesignComplainView extends DesignComplain +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table = "DESIGN_ORDER", column = "MERCHANT_ID") + private long merchantId; // 2.订单商户编号 + @AnViewField(table = "DESIGN_ORDER", column = "ORG_ID") + private long orgId; // 3.操作员组织编号 + @AnViewField(table = "DESIGN_ORDER", column = "OUT_ID") + private long outId; // 4.外部系统单号 + @AnViewField(table = "DESIGN_ORDER", column = "ORDER_TEXT") + private String orderText; // 5.订单描述 + @AnViewField(table = "DESIGN_ORDER", column = "AFTER_NAMES") + private String afterNames; // 6.后加工名称,多个逗号隔开 + @AnViewField(table = "DESIGN_ORDER", column = "AMOUNT") + private long amount; // 7.订单总金额 + @AnViewField(table = "DESIGN_ORDER", column = "PRINT_SPECIAL") + private String printSpecial; // 8.印刷特殊工艺 + @AnViewField(table = "DESIGN_ORDER", column = "TYPE_ID") + private long typeId; // 9.设计类型,名片、彩页、等等 + @AnViewField(table = "DESIGN_ORDER", column = "SHOP_NICK") + private String shopNick; // 10.店铺名称 + @AnViewField(table = "DESIGN_ORDER", column = "DESIGNER") + private String designer; // 11.设计师 + @AnViewField(table = "DESIGN_ORDER", column = "BUYER_NICK") + private String buyerNick; // 12.客户昵称 + @AnViewField(table = "DESIGN_ORDER", column = "USER_CONTACT") + private String userContact; // 13.联系人 + @AnViewField(table = "DESIGN_ORDER", column = "USER_MOBILE") + private String userMobile; // 14.用户手机 + @AnViewField(table = "DESIGN_ORDER", column = "USER_QQ") + private String userQq; // 15.用户QQ + @AnViewField(table = "DESIGN_ORDER", column = "USER_WX") + private String userWx; // 16.用户微信 + @AnViewField(table = "DESIGN_ORDER", column = "CREATE_TIME") + private Timestamp createTime; // 17.创建时间 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public long getOutId() + { + return outId; + } + + public void setOutId(long outId) + { + this.outId = outId; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public String getAfterNames() + { + return afterNames; + } + + public void setAfterNames(String afterNames) + { + this.afterNames = afterNames; + } + + public long getAmount() + { + return amount; + } + + public void setAmount(long amount) + { + this.amount = amount; + } + + public String getPrintSpecial() + { + return printSpecial; + } + + public void setPrintSpecial(String printSpecial) + { + this.printSpecial = printSpecial; + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + public String getShopNick() + { + return shopNick; + } + + public void setShopNick(String shopNick) + { + this.shopNick = shopNick; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public String getUserContact() + { + return userContact; + } + + public void setUserContact(String userContact) + { + this.userContact = userContact; + } + + public String getUserMobile() + { + return userMobile; + } + + public void setUserMobile(String userMobile) + { + this.userMobile = userMobile; + } + + public String getUserQq() + { + return userQq; + } + + public void setUserQq(String userQq) + { + this.userQq = userQq; + } + + public String getUserWx() + { + return userWx; + } + + public void setUserWx(String userWx) + { + this.userWx = userWx; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/AfterPicType.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/AfterPicType.java new file mode 100644 index 0000000..f4f02dd --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/AfterPicType.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 责任类型 对应表《AFTER_PIC_TYPE》 + */ +@AnAlias("AfterPicType") +@AnNew +@AnTable(table="AFTER_PIC_TYPE", key="PIC_TYPE", type="InnoDB") +public class AfterPicType implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="PIC_TYPE", type="long", notNull=true) private long picType; //1.责任类型 + @AnTableField(column="PIC_TYPE_NAME", type="string,128", notNull=true) private String picTypeName; //2.责任类型名 + @AnTableField(column="PIC_STATUS", type="int", notNull=true) private int picStatus; //3.0 正常 : 1 停用 + + public String toString() + { + return Jsons.toString(this); + } + + public long getPicType() + { + return picType; + } + + public void setPicType(long picType) + { + this.picType = picType; + } + + public String getPicTypeName() + { + return picTypeName; + } + + public void setPicTypeName(String picTypeName) + { + this.picTypeName = picTypeName; + } + + public int getPicStatus() + { + return picStatus; + } + + public void setPicStatus(int picStatus) + { + this.picStatus = picStatus; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/AfterProblemType.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/AfterProblemType.java new file mode 100644 index 0000000..350476b --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/AfterProblemType.java @@ -0,0 +1,81 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 问题类型 对应表《AFTER_PROBLEM_TYPE》 + */ +@AnAlias("AfterProblemType") +@AnNew +@AnTable(table="AFTER_PROBLEM_TYPE", key="PROBLEM_TYPE", type="InnoDB") +public class AfterProblemType implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="PIC_TYPE", type="long", notNull=true) private long picType; //1.属于责任类型 + @AnTableField(column="PROBLEM_TYPE", type="long", notNull=true) private long problemType; //2.问题类型编号 + @AnTableField(column="PROBLEM_NAME", type="string,64", notNull=true) private String problemName; //3.问题类型名 + @AnTableField(column="PROBLEM_STATUS", type="int", notNull=true) private int problemStatus; //4.0 正常 : 1 停用 + + public String toString() + { + return Jsons.toString(this); + } + + public long getPicType() + { + return picType; + } + + public void setPicType(long picType) + { + this.picType = picType; + } + + public long getProblemType() + { + return problemType; + } + + public void setProblemType(long problemType) + { + this.problemType = problemType; + } + + public String getProblemName() + { + return problemName; + } + + public void setProblemName(String problemName) + { + this.problemName = problemName; + } + + public int getProblemStatus() + { + return problemStatus; + } + + public void setProblemStatus(int problemStatus) + { + this.problemStatus = problemStatus; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignIndustry.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignIndustry.java new file mode 100644 index 0000000..6906265 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignIndustry.java @@ -0,0 +1,88 @@ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计行业表 对应表《DESIGN_INDUSTRY》 + */ +@AnAlias("DesignIndustry") +@AnNew +@AnTable(table = "DESIGN_INDUSTRY", key = "INDUSTRY_ID", type = "InnoDB") +public class DesignIndustry implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "INDUSTRY_ID", type = "long", notNull = true) + private long industryId; // 1.行业编号 + @AnTableField(column = "INDUSTRY_NAME", type = "string,20", notNull = true) + private String industryName; // 2.行业名称 + @AnTableField(column = "INDUSTRY_KEYWORDS", type = "string,5000", notNull = false) + private String industryKeywords; // 3.行业关键词 + @AnTableField(column = "INDUSTRY_SEQ", type = "int", notNull = true) + private int industrySeq; // 4.序号 + @AnTableField(column = "IS_ENABLED", type = "boolean", notNull = true) + private boolean isEnabled; // 5.状态 true=正常、false=停用 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public String getIndustryName() + { + return industryName; + } + + public void setIndustryName(String industryName) + { + this.industryName = industryName; + } + + public String getIndustryKeywords() + { + return industryKeywords; + } + + public void setIndustryKeywords(String industryKeywords) + { + this.industryKeywords = industryKeywords; + } + + public int getIndustrySeq() + { + return industrySeq; + } + + public void setIndustrySeq(int industrySeq) + { + this.industrySeq = industrySeq; + } + + public boolean isEnabled() + { + return isEnabled; + } + + public void setEnabled(boolean isEnabled) + { + this.isEnabled = isEnabled; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignMerchant.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignMerchant.java new file mode 100644 index 0000000..b2acac9 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignMerchant.java @@ -0,0 +1,81 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 设计订单商户表 对应表《DESIGN_MERCHANT》 + */ +@AnAlias("DesignMerchant") +@AnNew +@AnTable(table="DESIGN_MERCHANT", key="MERCHANT_ID", type="InnoDB") +public class DesignMerchant implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="MERCHANT_ID", type="long", notNull=true) private long merchantId; //1.商户编号 + @AnTableField(column="MERCHANT_NAME", type="string,20", notNull=true) private String merchantName; //2.商户名 + @AnTableField(column="MERCHANT_SECRET", type="string,2048", notNull=true) private String merchantSecret; //3.商户秘钥 + @AnTableField(column="IS_ENABLED", type="boolean", notNull=true) private boolean isEnabled; //4.商户状态 =true 表示 正常 =false 停用 + + public String toString() + { + return Jsons.toString(this); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public String getMerchantName() + { + return merchantName; + } + + public void setMerchantName(String merchantName) + { + this.merchantName = merchantName; + } + + public String getMerchantSecret() + { + return merchantSecret; + } + + public void setMerchantSecret(String merchantSecret) + { + this.merchantSecret = merchantSecret; + } + + public boolean isEnabled() + { + return isEnabled; + } + + public void setEnabled(boolean isEnabled) + { + this.isEnabled = isEnabled; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignOrgMer.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignOrgMer.java new file mode 100644 index 0000000..883c096 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignOrgMer.java @@ -0,0 +1,329 @@ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 组织接单规则表 对应表《DESIGN_ORG_MER》 + */ +@AnAlias("DesignOrgMer") +@AnNew +@AnTable(table = "DESIGN_ORG_MER", key = "ORG_ID", type = "InnoDB") +public class DesignOrgMer implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "ORG_ID", type = "long", notNull = true) + private long orgId; // 1.组织编号 + @AnTableField(column = "MER_STATUS", type = "int", notNull = true) + private int merStatus; // 2.商户状态 0=正常 1=停用 + @AnTableField(column = "DESIGN_TYPE_IDS", type = "string,400", notNull = false) + private String designTypeIds; // 3.支持的产品类型ID 多个逗号隔开,为空表示默认全部支持,条件已弃用 + @AnTableField(column = "INDUSTRY_IDS", type = "string,400", notNull = false) + private String industryIds; // 4.支持的行业类型 多个逗号隔开,为空表示默认全部支持 条件已弃用 + @AnTableField(column = "MER_MAX_ORDER", type = "int", notNull = true) + private int merMaxOrder; // 5.商户当天最大派单量 条件已弃用 + @AnTableField(column = "MER_MAX_WAIT_ORDER", type = "int", notNull = true) + private int merMaxWaitOrder; // 6.最大未领单数 条件已弃用 + @AnTableField(column = "PERSONAL_MAX_ORDER", type = "int", notNull = true) + private int personalMaxOrder; // 7.商户个人最大同时接单量,条件已弃用 + @AnTableField(column = "MAX_ORDER_AMOUNT", type = "long", notNull = true) + private long maxOrderAmount; // 8.订单最大金额 条件已弃用 + @AnTableField(column = "MER_LEVEL", type = "int", notNull = true) + private int merLevel; // 9.商家派单优先级 + @AnTableField(column = "IS_URGENT", type = "boolean", notNull = true) + private boolean isUrgent; // 11.是否支持加急单 =false 默认不支持 条件已弃用 + @AnTableField(column = "IS_PAUSE_RECIEIVE", type = "boolean", notNull = true) + private boolean isPauseRecieive; // 12.是否暂停接单 + @AnTableField(column = "IS_SPECIAL", type = "boolean", notNull = true) + private boolean isSpecial; // 13.是否支持异型订单 条件已弃用 + @AnTableField(column = "RECIEIVE_TIME", type = "string,400", notNull = false) + private String recieiveTime; // 17.商户接单时间段 条件已弃用 + @AnTableField(column = "ORDER_SHOP", type = "string,400", notNull = false) + private String orderShop; // 18.商户接单店铺 条件已弃用 + @AnTableField(column = "AFTER_NAMES", type = "string,4000", notNull = false) + private String afterNames; // 19.后加工名称,多个逗号隔开 条件已弃用 + @AnTableField(column = "MIN_ORDER_AMOUNT", type = "long", notNull = true) + private long minOrderAmount; // 20.订单最小金额 条件已弃用 + @AnTableField(column = "IS_DESIGN_ORDER", type = "boolean", notNull = true) + private boolean isDesignOrder; // 21.是否接取普通设计订单 条件已弃用 + @AnTableField(column = "IS_SENIOR_DESIGN_ORDER", type = "boolean", notNull = true) + private boolean isSeniorDesignOrder; // 22.是否接取资深设计订单, 条件已弃用 + @AnTableField(column = "IS_NORM_DRAFT_ORDER", type = "boolean", notNull = true) + private boolean isNormDraftOrder; // 23.是否接取标准自来稿, 条件已弃用 + @AnTableField(column = "IS_DRAFT_ORDER", type = "boolean", notNull = true) + private boolean isDraftOrder; // 24.是否接取改稿自来稿, 条件已弃用 + @AnTableField(column = "IS_HIGH_QUALITY_ORDER", type = "boolean", notNull = false) + private boolean isHighQualityOrder; // 25.是否优质订单, 条件已弃用 + @AnTableField(column = "MER_MAX_ORDINARY_ORDER", type = "int", notNull = true) + private int merMaxOrdinaryOrder; // 26.商户普通订单最大未领单量, 条件已弃用 + @AnTableField(column = "PERSONAL_MAX_ORDINARY_ORDER", type = "int", notNull = true) + private int personalMaxOrdinaryOrder; // 27.个人普通订单最大同时接单量 条件已弃用 + @AnTableField(column = "MODIFY_OPERATOR_CODE", type = "string,32", notNull = false) + private String modifyOperatorCode; // 28.修改操作员 + @AnTableField(column = "MODIFY_TIME", type = "datetime", notNull = false) + private Timestamp modifyTime; // 29.修改时间 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public int getMerStatus() + { + return merStatus; + } + + public void setMerStatus(int merStatus) + { + this.merStatus = merStatus; + } + + public String getDesignTypeIds() + { + return designTypeIds; + } + + public void setDesignTypeIds(String designTypeIds) + { + this.designTypeIds = designTypeIds; + } + + public String getIndustryIds() + { + return industryIds; + } + + public void setIndustryIds(String industryIds) + { + this.industryIds = industryIds; + } + + public int getMerMaxOrder() + { + return merMaxOrder; + } + + public void setMerMaxOrder(int merMaxOrder) + { + this.merMaxOrder = merMaxOrder; + } + + public int getMerMaxWaitOrder() + { + return merMaxWaitOrder; + } + + public void setMerMaxWaitOrder(int merMaxWaitOrder) + { + this.merMaxWaitOrder = merMaxWaitOrder; + } + + public int getPersonalMaxOrder() + { + return personalMaxOrder; + } + + public void setPersonalMaxOrder(int personalMaxOrder) + { + this.personalMaxOrder = personalMaxOrder; + } + + public long getMaxOrderAmount() + { + return maxOrderAmount; + } + + public void setMaxOrderAmount(long maxOrderAmount) + { + this.maxOrderAmount = maxOrderAmount; + } + + public int getMerLevel() + { + return merLevel; + } + + public void setMerLevel(int merLevel) + { + this.merLevel = merLevel; + } + + public boolean isUrgent() + { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) + { + this.isUrgent = isUrgent; + } + + public boolean isPauseRecieive() + { + return isPauseRecieive; + } + + public void setPauseRecieive(boolean isPauseRecieive) + { + this.isPauseRecieive = isPauseRecieive; + } + + public boolean isSpecial() + { + return isSpecial; + } + + public void setSpecial(boolean isSpecial) + { + this.isSpecial = isSpecial; + } + + public String getRecieiveTime() + { + return recieiveTime; + } + + public void setRecieiveTime(String recieiveTime) + { + this.recieiveTime = recieiveTime; + } + + public String getOrderShop() + { + return orderShop; + } + + public void setOrderShop(String orderShop) + { + this.orderShop = orderShop; + } + + public String getAfterNames() + { + return afterNames; + } + + public void setAfterNames(String afterNames) + { + this.afterNames = afterNames; + } + + public long getMinOrderAmount() + { + return minOrderAmount; + } + + public void setMinOrderAmount(long minOrderAmount) + { + this.minOrderAmount = minOrderAmount; + } + + public boolean isDesignOrder() + { + return isDesignOrder; + } + + public void setDesignOrder(boolean isDesignOrder) + { + this.isDesignOrder = isDesignOrder; + } + + public boolean isSeniorDesignOrder() + { + return isSeniorDesignOrder; + } + + public void setSeniorDesignOrder(boolean isSeniorDesignOrder) + { + this.isSeniorDesignOrder = isSeniorDesignOrder; + } + + public boolean isNormDraftOrder() + { + return isNormDraftOrder; + } + + public void setNormDraftOrder(boolean isNormDraftOrder) + { + this.isNormDraftOrder = isNormDraftOrder; + } + + public boolean isDraftOrder() + { + return isDraftOrder; + } + + public void setDraftOrder(boolean isDraftOrder) + { + this.isDraftOrder = isDraftOrder; + } + + public boolean isHighQualityOrder() + { + return isHighQualityOrder; + } + + public void setHighQualityOrder(boolean isHighQualityOrder) + { + this.isHighQualityOrder = isHighQualityOrder; + } + + public int getMerMaxOrdinaryOrder() + { + return merMaxOrdinaryOrder; + } + + public void setMerMaxOrdinaryOrder(int merMaxOrdinaryOrder) + { + this.merMaxOrdinaryOrder = merMaxOrdinaryOrder; + } + + public int getPersonalMaxOrdinaryOrder() + { + return personalMaxOrdinaryOrder; + } + + public void setPersonalMaxOrdinaryOrder(int personalMaxOrdinaryOrder) + { + this.personalMaxOrdinaryOrder = personalMaxOrdinaryOrder; + } + + public String getModifyOperatorCode() + { + return modifyOperatorCode; + } + + public void setModifyOperatorCode(String modifyOperatorCode) + { + this.modifyOperatorCode = modifyOperatorCode; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignPrice.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignPrice.java new file mode 100644 index 0000000..08f706a --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignPrice.java @@ -0,0 +1,106 @@ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计单价表 对应表《design_price》 + */ +@AnAlias("DesignPrice") +@AnNew +@AnTable(table = "DESIGN_PRICE", key = "price_id", type = "InnoDB") +public class DesignPrice implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "price_id", type = "long", notNull = true) + private long priceId; // 设计单价ID + @AnTableField(column = "CONVERT_ID", type = "long", notNull = true) + private long convertId; // 产品单价id + @AnTableField(column = "PRD_TYPE_ID", type = "long", notNull = true) + private long prdTypeId; // 产品类型编号 + @AnTableField(column = "draft_type", type = "int", notNull = true) + private int draftType;// 稿件类型 1=改稿,2=普通设计,3=资深设计 + @AnTableField(column = "design_price_money", type = "long", notNull = true) + private long designPriceMoney;// 设计单价金额 + @AnTableField(column = "effect_time", type = "datetime", notNull = false) + private Timestamp effectTime;// 生效时间 + @AnTableField(column = "status", type = "int", notNull = true) + private int status;// 设计单价状态(0失效,1生效) + + public long getPriceId() + { + return priceId; + } + + public void setPriceId(long priceId) + { + this.priceId = priceId; + } + + public long getConvertId() + { + return convertId; + } + + public void setConvertId(long convertId) + { + this.convertId = convertId; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public int getDraftType() + { + return draftType; + } + + public void setDraftType(int draftType) + { + this.draftType = draftType; + } + + public long getDesignPriceMoney() + { + return designPriceMoney; + } + + public void setDesignPriceMoney(long designPriceMoney) + { + this.designPriceMoney = designPriceMoney; + } + + public Timestamp getEffectTime() + { + return effectTime; + } + + public void setEffectTime(Timestamp effectTime) + { + this.effectTime = effectTime; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignSize.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignSize.java new file mode 100644 index 0000000..fd01b4a --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignSize.java @@ -0,0 +1,125 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 设计尺寸表 对应表《DESIGN_SIZE》 + */ +@AnAlias("DesignSize") +@AnNew +@AnTable(table="DESIGN_SIZE", key="SIZE_ID", type="InnoDB") +public class DesignSize implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="TYPE_ID", type="long", notNull=true) private long typeId; //1.订单类型编号 + @AnTableField(column="SIZE_ID", type="long", notNull=true) private long sizeId; //2.尺寸编号 + @AnTableField(column="SIZE_STATUS", type="int", notNull=true) private int sizeStatus; //3.尺寸状态,0:正常,1:停用 + @AnTableField(column="SIZE_WIDTH", type="decimal,5,2", notNull=true) private double sizeWidth; //4.设计尺寸宽度,单位mm,最多支持两位小数 + @AnTableField(column="SIZE_HEIGHT", type="decimal,5,2", notNull=true) private double sizeHeight; //5.设计尺寸高度,单位mm,最多支持两位小数 + @AnTableField(column="SIZE_SIDE", type="decimal,5,2", notNull=false) private double sizeSide; //6.设计尺寸侧面长度,单位mm,最多支持两位小数,某些类型的产品需要填写 + @AnTableField(column="SIZE_BLEED", type="decimal,5,2", notNull=true) private double sizeBleed; //7.设计出血,单位mm,最多支持两位小数 + @AnTableField(column="SIZE_SEQ", type="int", notNull=true) private int sizeSeq; //8.序号 + + public String toString() + { + return Jsons.toString(this); + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + public long getSizeId() + { + return sizeId; + } + + public void setSizeId(long sizeId) + { + this.sizeId = sizeId; + } + + public int getSizeStatus() + { + return sizeStatus; + } + + public void setSizeStatus(int sizeStatus) + { + this.sizeStatus = sizeStatus; + } + + public double getSizeWidth() + { + return sizeWidth; + } + + public void setSizeWidth(double sizeWidth) + { + this.sizeWidth = sizeWidth; + } + + public double getSizeHeight() + { + return sizeHeight; + } + + public void setSizeHeight(double sizeHeight) + { + this.sizeHeight = sizeHeight; + } + + public double getSizeSide() + { + return sizeSide; + } + + public void setSizeSide(double sizeSide) + { + this.sizeSide = sizeSide; + } + + public double getSizeBleed() + { + return sizeBleed; + } + + public void setSizeBleed(double sizeBleed) + { + this.sizeBleed = sizeBleed; + } + + public int getSizeSeq() + { + return sizeSeq; + } + + public void setSizeSeq(int sizeSeq) + { + this.sizeSeq = sizeSeq; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignType.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignType.java new file mode 100644 index 0000000..bece944 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignType.java @@ -0,0 +1,218 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计订单类型表 对应表《DESIGN_TYPE》 + */ +@AnAlias("DesignType") +@AnNew +@AnTable(table = "DESIGN_TYPE", key = "TYPE_ID", type = "InnoDB") +public class DesignType implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "TYPE_ID", type = "long", notNull = true) + private long typeId; // 1.订单类型编号 + @AnTableField(column = "TYPE_NAME", type = "string,200", notNull = true) + private String typeName; // 2.订单类型名, 例如:名片、彩页、画册 + @AnTableField(column = "IS_ENABLED", type = "boolean", notNull = true) + private boolean isEnabled; // 3.状态 true=正常、false=停用 + @AnTableField(column = "MER_DISPATCH_EFFECTIVE_TIME", type = "int", notNull = true) + private int merDispatchEffectiveTime; // 4.分拣时效(分拣时间),单位分钟 + @AnTableField(column = "DISPATCH_ORDER_EFFECTIVE_TIME", type = "int", notNull = true) + private int dispatchOrderEffectiveTime; // 5.派单时效(派单时间),单位分钟 + @AnTableField(column = "EFFECTIVE_TIME", type = "int", notNull = true) + private int effectiveTime; // 6.初稿时效(初稿时间),单位分钟 + @AnTableField(column = "EFFECTIVE_END_TIME", type = "int", notNull = true) + private int effectiveEndTime; // 7.定稿时效(定稿时间),单位分钟 + @AnTableField(column = "TYPE_SEQ", type = "int", notNull = true) + private int typeSeq; // 8.排序 + @AnTableField(column = "SIZE_M_WIDTH", type = "decimal,5,2", notNull = true) + private double sizeMWidth; // 9.设计尺寸宽度,单位mm,最多支持两位小数 + @AnTableField(column = "SIZE_M_HEIGHT", type = "decimal,5,2", notNull = true) + private double sizeMHeight; // 10.设计尺寸高度,单位mm,最多支持两位小数 + @AnTableField(column = "DESIGN_FILE_TYPE", type = "string,100", notNull = true) + private String designFileType; // 11.设计文件上传类型 + @AnTableField(column = "PRINTING_FILE_TYPE", type = "string,100", notNull = true) + private String printingFileType; // 12.印刷文件上传类型 + @AnTableField(column = "BLEEDING", type = "decimal,5,2", notNull = true) + private double bleeding; // 13.产品出血 + @AnTableField(column = "DPI", type = "decimal,5,2", notNull = true) + private double dpi; // 14.产品分辨率 + @AnTableField(column = "CONTENT", type = "string,1000", notNull = false) + private String content; // 1.订单类型编号 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + public String getTypeName() + { + return typeName; + } + + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public boolean isEnabled() + { + return isEnabled; + } + + public void setEnabled(boolean isEnabled) + { + this.isEnabled = isEnabled; + } + + public int getMerDispatchEffectiveTime() + { + return merDispatchEffectiveTime; + } + + public void setMerDispatchEffectiveTime(int merDispatchEffectiveTime) + { + this.merDispatchEffectiveTime = merDispatchEffectiveTime; + } + + public int getDispatchOrderEffectiveTime() + { + return dispatchOrderEffectiveTime; + } + + public void setDispatchOrderEffectiveTime(int dispatchOrderEffectiveTime) + { + this.dispatchOrderEffectiveTime = dispatchOrderEffectiveTime; + } + + public int getEffectiveTime() + { + return effectiveTime; + } + + public void setEffectiveTime(int effectiveTime) + { + this.effectiveTime = effectiveTime; + } + + public int getEffectiveEndTime() + { + return effectiveEndTime; + } + + public void setEffectiveEndTime(int effectiveEndTime) + { + this.effectiveEndTime = effectiveEndTime; + } + + public int getTypeSeq() + { + return typeSeq; + } + + public void setTypeSeq(int typeSeq) + { + this.typeSeq = typeSeq; + } + + public double getSizeMWidth() + { + return sizeMWidth; + } + + public void setSizeMWidth(double sizeMWidth) + { + this.sizeMWidth = sizeMWidth; + } + + public double getSizeMHeight() + { + return sizeMHeight; + } + + public void setSizeMHeight(double sizeMHeight) + { + this.sizeMHeight = sizeMHeight; + } + + public String getDesignFileType() + { + return designFileType; + } + + public void setDesignFileType(String designFileType) + { + this.designFileType = designFileType; + } + + public String getPrintingFileType() + { + return printingFileType; + } + + public void setPrintingFileType(String printingFileType) + { + this.printingFileType = printingFileType; + } + + public double getBleeding() + { + return bleeding; + } + + public void setBleeding(double bleeding) + { + this.bleeding = bleeding; + } + + public double getDpi() + { + return dpi; + } + + public void setDpi(double dpi) + { + this.dpi = dpi; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignTypeContent.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignTypeContent.java new file mode 100644 index 0000000..fb64cf5 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignTypeContent.java @@ -0,0 +1,64 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计订单类型表 对应表《DESIGN_TYPE》 + */ +@AnAlias("DesignTypeContent") +@AnNew +@AnTable(table = "DESIGN_TYPE_CONTENT", key = "TYPE_ID", type = "InnoDB") +public class DesignTypeContent implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "TYPE_ID", type = "long", notNull = true) + private long typeId; // 1.订单类型编号 + @AnTableField(column = "CONTENT", type = "string,1000", notNull = false) + private String content; // 1.订单类型编号 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroup.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroup.java new file mode 100644 index 0000000..9510025 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroup.java @@ -0,0 +1,233 @@ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师接单规则组表 对应表《DesignerGroup》 + */ +@AnAlias("DesignerGroup") +@AnNew +@AnTable(table = "DESIGNER_GROUP", key = "DESIGNER_GROUP_ID", type = "InnoDB") +public class DesignerGroup implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGNER_GROUP_ID", type = "long", notNull = true) + private long designerGroupId; // 1.接单规则组id + @AnTableField(column = "DESIGNER_GROUP_NAME", type = "string,32", notNull = true) + private String designerGroupName; // 2.接单规则组名称 + @AnTableField(column = "MAX_ORDER_AMOUNT", type = "long", notNull = true) + private long maxOrderAmount; // 3.订单最大金额 + @AnTableField(column = "MIN_ORDER_AMOUNT", type = "long", notNull = false) + private long minOrderAmount; // 4.订单最小金额 + @AnTableField(column = "IS_HIGH_QUALITY_ORDER", type = "boolean", notNull = true) + private boolean isHighQualityOrder; // 5.是否优质订单 + @AnTableField(column = "IS_LARGE_AMOUNT", type = "boolean", notNull = true) + private boolean isLargeAmount; // 6.是否大金额订单 + @AnTableField(column = "IS_URGENT", type = "boolean", notNull = true) + private boolean isUrgent; // 7.是否支持加急单 =false 默认不支持 + @AnTableField(column = "IS_DESIGN", type = "boolean", notNull = true) + private boolean isDesign; // 8.是否支持只设计不印刷单 =false 默认不支持 + @AnTableField(column = "IS_SPECIAL", type = "boolean", notNull = true) + private boolean isSpecial; // 9.是否支持异型订单 + @AnTableField(column = "AFTER_NAMES", type = "string,4000", notNull = false) + private String afterNames; // 10.后加工名称,多个逗号隔开 + @AnTableField(column = "MERCHANT_IDS", type = "string,1000", notNull = false) + private String merchantIds; // 11.关联渠道ID,多个逗号隔开 + @AnTableField(column = "REMARK", type = "string,6000", notNull = false) + private String remark; // 12.备注 + @AnTableField(column = "STATUS", type = "int", notNull = true) + private int status; // 13.状态 + @AnTableField(column = "MAX_ORDER_NUM", type = "int", notNull = true) + private int maxOrderNum; // 14.最大接单量(老用户除外) + @AnTableField(column = "MODIFY_OPERATOR_CODE", type = "string,32", notNull = false) + private String modifyOperatorCode; // 15.修改操作员 + @AnTableField(column = "MODIFY_TIME", type = "datetime", notNull = false) + private Timestamp modifyTime; // 16.修改时间 + @AnTableField(column = "MAX_WAIVE_NUM", type = "int", notNull = true) + private int maxWaiveNum; // 17.订单最大放弃次数(月度) + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getDesignerGroupId() + { + return designerGroupId; + } + + public void setDesignerGroupId(long designerGroupId) + { + this.designerGroupId = designerGroupId; + } + + public String getDesignerGroupName() + { + return designerGroupName; + } + + public void setDesignerGroupName(String designerGroupName) + { + this.designerGroupName = designerGroupName; + } + + public long getMaxOrderAmount() + { + return maxOrderAmount; + } + + public void setMaxOrderAmount(long maxOrderAmount) + { + this.maxOrderAmount = maxOrderAmount; + } + + public long getMinOrderAmount() + { + return minOrderAmount; + } + + public void setMinOrderAmount(long minOrderAmount) + { + this.minOrderAmount = minOrderAmount; + } + + public boolean isHighQualityOrder() + { + return isHighQualityOrder; + } + + public void setHighQualityOrder(boolean isHighQualityOrder) + { + this.isHighQualityOrder = isHighQualityOrder; + } + + public boolean isLargeAmount() + { + return isLargeAmount; + } + + public void setLargeAmount(boolean isLargeAmount) + { + this.isLargeAmount = isLargeAmount; + } + + public boolean isUrgent() + { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) + { + this.isUrgent = isUrgent; + } + + public boolean isDesign() + { + return isDesign; + } + + public void setDesign(boolean isDesign) + { + this.isDesign = isDesign; + } + + public boolean isSpecial() + { + return isSpecial; + } + + public void setSpecial(boolean isSpecial) + { + this.isSpecial = isSpecial; + } + + public String getAfterNames() + { + return afterNames; + } + + public void setAfterNames(String afterNames) + { + this.afterNames = afterNames; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + public String getModifyOperatorCode() + { + return modifyOperatorCode; + } + + public void setModifyOperatorCode(String modifyOperatorCode) + { + this.modifyOperatorCode = modifyOperatorCode; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + + public int getMaxOrderNum() + { + return maxOrderNum; + } + + public void setMaxOrderNum(int maxOrderNum) + { + this.maxOrderNum = maxOrderNum; + } + + public int getMaxWaiveNum() + { + return maxWaiveNum; + } + + public void setMaxWaiveNum(int maxWaiveNum) + { + this.maxWaiveNum = maxWaiveNum; + } + + public String getMerchantIds() + { + return merchantIds; + } + + public void setMerchantIds(String merchantIds) + { + this.merchantIds = merchantIds; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroupDispatch.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroupDispatch.java new file mode 100644 index 0000000..b3263d1 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroupDispatch.java @@ -0,0 +1,253 @@ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师接单规则表 对应表《DesignerGroupDispatch》 + */ +@AnAlias("DesignerGroupDispatch") +@AnNew +@AnTable(table = "DESIGNER_GROUP_DISPATCH", key = "OPERATOR_CODE", type = "InnoDB") +public class DesignerGroupDispatch implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "OPERATOR_CODE", type = "string,32", notNull = true) + private String operatorCode; // 1.操作员编码 + @AnTableField(column = "ORG_ID", type = "long", notNull = true) + private long orgId; // 2.操作员组织编号 + @AnTableField(column = "DESIGNER_GROUP_ID", type = "long", notNull = true) + private long designerGroupId; // 2.接单规则组id + @AnTableField(column = "MAX_ORDER_AMOUNT", type = "long", notNull = true) + private long maxOrderAmount; // 3.订单最大金额 + @AnTableField(column = "MIN_ORDER_AMOUNT", type = "long", notNull = false) + private long minOrderAmount; // 4.订单最小金额 + @AnTableField(column = "IS_HIGH_QUALITY_ORDER", type = "boolean", notNull = true) + private boolean isHighQualityOrder; // 5.是否优质订单 + @AnTableField(column = "IS_LARGE_AMOUNT", type = "boolean", notNull = true) + private boolean isLargeAmount; // 6.是否大金额订单 + @AnTableField(column = "IS_URGENT", type = "boolean", notNull = true) + private boolean isUrgent; // 7.是否支持加急单 =false 默认不支持 + @AnTableField(column = "IS_DESIGN", type = "boolean", notNull = true) + private boolean isDesign; // 8.是否支持只设计不印刷单 =false 默认不支持 + @AnTableField(column = "IS_SPECIAL", type = "boolean", notNull = true) + private boolean isSpecial; // 9.是否支持异型订单 + @AnTableField(column = "AFTER_NAMES", type = "string,4000", notNull = false) + private String afterNames; // 10.后加工名称,多个逗号隔开 + @AnTableField(column = "MERCHANT_IDS", type = "string,1000", notNull = false) + private String merchantIds; // 11.关联渠道ID,多个逗号隔开 + @AnTableField(column = "STATUS", type = "int", notNull = true) + private int status; // 12.状态:0失效,1正常 + @AnTableField(column = "MODIFY_OPERATOR_CODE", type = "string,32", notNull = false) + private String modifyOperatorCode; // 13.修改操作员 + @AnTableField(column = "MODIFY_TIME", type = "datetime", notNull = false) + private Timestamp modifyTime; // 14.修改时间 + @AnTableField(column = "MAX_ORDER_NUM", type = "int", notNull = false) + private int maxOrderNum; // 15.最大接单量(老用户除外) + @AnTableField(column = "WAIVE_NUM", type = "int", notNull = false) + private int waiveNum; // 16.设计师当月可放弃订单数量 + @AnTableField(column = "IS_SHOW_COST", type = "int", notNull = true) + private int isShowCost; // 17.是否显示佣金:0不显示,1显示 + @AnTableField(column = "IS_SHOW_QDDT", type = "int", notNull = true) + private int isShowQddt; // 18.是否显示抢单大厅:0不显示,1显示 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getDesignerGroupId() + { + return designerGroupId; + } + + public void setDesignerGroupId(long designerGroupId) + { + this.designerGroupId = designerGroupId; + } + + public long getMaxOrderAmount() + { + return maxOrderAmount; + } + + public void setMaxOrderAmount(long maxOrderAmount) + { + this.maxOrderAmount = maxOrderAmount; + } + + public long getMinOrderAmount() + { + return minOrderAmount; + } + + public void setMinOrderAmount(long minOrderAmount) + { + this.minOrderAmount = minOrderAmount; + } + + public boolean isHighQualityOrder() + { + return isHighQualityOrder; + } + + public void setHighQualityOrder(boolean isHighQualityOrder) + { + this.isHighQualityOrder = isHighQualityOrder; + } + + public boolean isLargeAmount() + { + return isLargeAmount; + } + + public void setLargeAmount(boolean isLargeAmount) + { + this.isLargeAmount = isLargeAmount; + } + + public boolean isUrgent() + { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) + { + this.isUrgent = isUrgent; + } + + public boolean isDesign() + { + return isDesign; + } + + public void setDesign(boolean isDesign) + { + this.isDesign = isDesign; + } + + public boolean isSpecial() + { + return isSpecial; + } + + public void setSpecial(boolean isSpecial) + { + this.isSpecial = isSpecial; + } + + public String getAfterNames() + { + return afterNames; + } + + public void setAfterNames(String afterNames) + { + this.afterNames = afterNames; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + public String getModifyOperatorCode() + { + return modifyOperatorCode; + } + + public void setModifyOperatorCode(String modifyOperatorCode) + { + this.modifyOperatorCode = modifyOperatorCode; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public int getMaxOrderNum() + { + return maxOrderNum; + } + + public void setMaxOrderNum(int maxOrderNum) + { + this.maxOrderNum = maxOrderNum; + } + + public int getWaiveNum() + { + return waiveNum; + } + + public void setWaiveNum(int waiveNum) + { + this.waiveNum = waiveNum; + } + + public String getMerchantIds() + { + return merchantIds; + } + + public void setMerchantIds(String merchantIds) + { + this.merchantIds = merchantIds; + } + + public int getIsShowCost() { + return isShowCost; + } + + public void setIsShowCost(int isShowCost) { + this.isShowCost = isShowCost; + } + + public int getIsShowQddt() { + return isShowQddt; + } + + public void setIsShowQddt(int isShowQddt) { + this.isShowQddt = isShowQddt; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroupDispatchValue.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroupDispatchValue.java new file mode 100644 index 0000000..6ebc60c --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroupDispatchValue.java @@ -0,0 +1,76 @@ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师组关联设计师的属性值表 对应表《DesignerGroupDispatchValue》 + */ +@AnAlias("DesignerGroupDispatchValue") +@AnNew +@AnTable(table = "DESIGNER_GROUP_DISPATCH_VALUE", key = "DESIGNER_GROUP_DISPATCH_VALUE_ID", type = "InnoDB") +public class DesignerGroupDispatchValue implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGNER_GROUP_DISPATCH_VALUE_ID", type = "long", notNull = true) + private long designerGroupDispatchValueId; // 1.id + @AnTableField(column = "OPERATOR_CODE", type = "string,32", notNull = true) + private String operatorCode; // 2.操作员编码 + @AnTableField(column = "RELATED_TYPE", type = "int", notNull = true) + private int relatedType; // 3.关联类型:0标准自来稿,1普通设计,2资深设计,3行业,4改稿自来稿,5免检产品 + @AnTableField(column = "RELATED_VALUE", type = "long", notNull = true) + private long relatedValue; // 4.关联的值 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getDesignerGroupDispatchValueId() + { + return designerGroupDispatchValueId; + } + + public void setDesignerGroupDispatchValueId(long designerGroupDispatchValueId) + { + this.designerGroupDispatchValueId = designerGroupDispatchValueId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public int getRelatedType() + { + return relatedType; + } + + public void setRelatedType(int relatedType) + { + this.relatedType = relatedType; + } + + public long getRelatedValue() + { + return relatedValue; + } + + public void setRelatedValue(long relatedValue) + { + this.relatedValue = relatedValue; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroupValue.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroupValue.java new file mode 100644 index 0000000..e3db7f8 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroupValue.java @@ -0,0 +1,76 @@ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师组关联的属性值表 对应表《DesignerGroupValue》 + */ +@AnAlias("DesignerGroupValue") +@AnNew +@AnTable(table = "DESIGNER_GROUP_VALUE", key = "DESIGNER_GROUP_VALUE_ID", type = "InnoDB") +public class DesignerGroupValue implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGNER_GROUP_VALUE_ID", type = "long", notNull = true) + private long designerGroupValueId; // 1.id + @AnTableField(column = "DESIGNER_GROUP_ID", type = "long", notNull = true) + private long designerGroupId; // 2.设计师组id + @AnTableField(column = "RELATED_TYPE", type = "int", notNull = true) + private int relatedType; // 3.关联类型:0标准自来稿,1普通设计,2资深设计,3行业,4改稿自来稿 + @AnTableField(column = "RELATED_VALUE", type = "long", notNull = true) + private long relatedValue; // 4.关联的值 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getDesignerGroupValueId() + { + return designerGroupValueId; + } + + public void setDesignerGroupValueId(long designerGroupValueId) + { + this.designerGroupValueId = designerGroupValueId; + } + + public long getDesignerGroupId() + { + return designerGroupId; + } + + public void setDesignerGroupId(long designerGroupId) + { + this.designerGroupId = designerGroupId; + } + + public int getRelatedType() + { + return relatedType; + } + + public void setRelatedType(int relatedType) + { + this.relatedType = relatedType; + } + + public long getRelatedValue() + { + return relatedValue; + } + + public void setRelatedValue(long relatedValue) + { + this.relatedValue = relatedValue; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroupView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroupView.java new file mode 100644 index 0000000..3385f54 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/DesignerGroupView.java @@ -0,0 +1,361 @@ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * 设计师接单规则视图 + */ +@AnAlias("DesignerGroupView") +@AnNew +@AnView("DESIGNER_GROUP,DESIGNER_GROUP_DISPATCH") +@AnViewJoin( +{ + @AnViewJoinValue(type = "EQUAL", lTable = "DESIGNER_GROUP", lColumn = "DESIGNER_GROUP_ID", rTable = "DESIGNER_GROUP_DISPATCH", rColumn = "DESIGNER_GROUP_ID") +}) +public class DesignerGroupView implements Serializable +{ + private static final long serialVersionUID = 1L; + + // 接单规则组 + @AnViewField(table = "DESIGNER_GROUP", column = "DESIGNER_GROUP_NAME") + private String designerGroupName; // 1.接单规则组名称 + @AnViewField(table = "DESIGNER_GROUP", column = "MAX_ORDER_AMOUNT") + private long maxOrderAmount; // 2.订单最大金额 + @AnViewField(table = "DESIGNER_GROUP", column = "MIN_ORDER_AMOUNT") + private long minOrderAmount; // 3.订单最小金额 + @AnViewField(table = "DESIGNER_GROUP", column = "IS_HIGH_QUALITY_ORDER") + private boolean isHighQualityOrder; // 4.是否优质订单 + @AnViewField(table = "DESIGNER_GROUP", column = "IS_LARGE_AMOUNT") + private boolean isLargeAmount; // 5.是否大金额订单 + @AnViewField(table = "DESIGNER_GROUP", column = "IS_URGENT") + private boolean isUrgent; // 6.是否支持加急单 =false 默认不支持 + @AnViewField(table = "DESIGNER_GROUP", column = "IS_DESIGN") + private boolean isDesign; // 7.是否支持只设计不印刷单 =false 默认不支持 + @AnViewField(table = "DESIGNER_GROUP", column = "IS_SPECIAL") + private boolean isSpecial; // 8.是否支持异型订单 + @AnViewField(table = "DESIGNER_GROUP", column = "AFTER_NAMES") + private String afterNames; // 9.后加工名称,多个逗号隔开 + @AnViewField(table = "DESIGNER_GROUP", column = "MERCHANT_IDS") + private String merchantIds; // 10.关联渠道ID,多个逗号隔开 + @AnViewField(table = "DESIGNER_GROUP", column = "STATUS") + private int status; // 11.状态 + @AnViewField(table = "DESIGNER_GROUP", column = "MAX_ORDER_NUM") + private int maxOrderNum; // 12.最大接单量(老用户除外) + @AnViewField(table = "DESIGNER_GROUP", column = "MAX_WAIVE_NUM") + private int maxWaiveNum; // 13.订单最大放弃次数 + + // 设计师个人接单规则 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "OPERATOR_CODE") + private String operatorCode; // 1.操作员编码 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "ORG_ID") + private long designerOrgId; // 2.操作员组织编号 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "MAX_ORDER_AMOUNT") + private long designerMaxOrderAmount; // 3.订单最大金额 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "MIN_ORDER_AMOUNT") + private long designerMinOrderAmount; // 4.订单最小金额 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "IS_HIGH_QUALITY_ORDER") + private boolean isDesignerHighQualityOrder; // 5.是否优质订单 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "IS_LARGE_AMOUNT") + private boolean isDesignerLargeAmount; // 6.是否大金额订单 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "IS_URGENT") + private boolean isDesignerUrgent; // 7.是否支持加急单 =false 默认不支持 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "IS_DESIGN") + private boolean isDesignerDesign; // 8.是否支持只设计不印刷单 =false 默认不支持 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "IS_SPECIAL") + private boolean isDesignerSpecial; // 9.是否支持异型订单 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "AFTER_NAMES") + private String designerAfterNames; // 10.后加工名称,多个逗号隔开 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "MERCHANT_IDS") + private String designerMerchantIds; // 11.关联渠道ID,多个逗号隔开 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "STATUS") + private int designerStatus; // 11.状态:0失效,1正常 + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "MAX_ORDER_NUM") + private int designerMaxOrderNum; // 12.最大接单量(老用户除外) + @AnViewField(table = "DESIGNER_GROUP_DISPATCH", column = "WAIVE_NUM") + private int designerWaiveNum; // 13.订单可放弃当前数量 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getDesignerGroupName() + { + return designerGroupName; + } + + public void setDesignerGroupName(String designerGroupName) + { + this.designerGroupName = designerGroupName; + } + + public long getMaxOrderAmount() + { + return maxOrderAmount; + } + + public void setMaxOrderAmount(long maxOrderAmount) + { + this.maxOrderAmount = maxOrderAmount; + } + + public long getMinOrderAmount() + { + return minOrderAmount; + } + + public void setMinOrderAmount(long minOrderAmount) + { + this.minOrderAmount = minOrderAmount; + } + + public boolean isHighQualityOrder() + { + return isHighQualityOrder; + } + + public void setHighQualityOrder(boolean isHighQualityOrder) + { + this.isHighQualityOrder = isHighQualityOrder; + } + + public boolean isLargeAmount() + { + return isLargeAmount; + } + + public void setLargeAmount(boolean isLargeAmount) + { + this.isLargeAmount = isLargeAmount; + } + + public boolean isUrgent() + { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) + { + this.isUrgent = isUrgent; + } + + public boolean isDesign() + { + return isDesign; + } + + public void setDesign(boolean isDesign) + { + this.isDesign = isDesign; + } + + public boolean isSpecial() + { + return isSpecial; + } + + public void setSpecial(boolean isSpecial) + { + this.isSpecial = isSpecial; + } + + public String getAfterNames() + { + return afterNames; + } + + public void setAfterNames(String afterNames) + { + this.afterNames = afterNames; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + public int getMaxOrderNum() + { + return maxOrderNum; + } + + public void setMaxOrderNum(int maxOrderNum) + { + this.maxOrderNum = maxOrderNum; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getDesignerOrgId() + { + return designerOrgId; + } + + public void setDesignerOrgId(long designerOrgId) + { + this.designerOrgId = designerOrgId; + } + + public long getDesignerMaxOrderAmount() + { + return designerMaxOrderAmount; + } + + public void setDesignerMaxOrderAmount(long designerMaxOrderAmount) + { + this.designerMaxOrderAmount = designerMaxOrderAmount; + } + + public long getDesignerMinOrderAmount() + { + return designerMinOrderAmount; + } + + public void setDesignerMinOrderAmount(long designerMinOrderAmount) + { + this.designerMinOrderAmount = designerMinOrderAmount; + } + + public boolean isDesignerHighQualityOrder() + { + return isDesignerHighQualityOrder; + } + + public void setDesignerHighQualityOrder(boolean isDesignerHighQualityOrder) + { + this.isDesignerHighQualityOrder = isDesignerHighQualityOrder; + } + + public boolean isDesignerLargeAmount() + { + return isDesignerLargeAmount; + } + + public void setDesignerLargeAmount(boolean isDesignerLargeAmount) + { + this.isDesignerLargeAmount = isDesignerLargeAmount; + } + + public boolean isDesignerUrgent() + { + return isDesignerUrgent; + } + + public void setDesignerUrgent(boolean isDesignerUrgent) + { + this.isDesignerUrgent = isDesignerUrgent; + } + + public boolean isDesignerDesign() + { + return isDesignerDesign; + } + + public void setDesignerDesign(boolean isDesignerDesign) + { + this.isDesignerDesign = isDesignerDesign; + } + + public boolean isDesignerSpecial() + { + return isDesignerSpecial; + } + + public void setDesignerSpecial(boolean isDesignerSpecial) + { + this.isDesignerSpecial = isDesignerSpecial; + } + + public String getDesignerAfterNames() + { + return designerAfterNames; + } + + public void setDesignerAfterNames(String designerAfterNames) + { + this.designerAfterNames = designerAfterNames; + } + + public int getDesignerStatus() + { + return designerStatus; + } + + public void setDesignerStatus(int designerStatus) + { + this.designerStatus = designerStatus; + } + + public int getDesignerMaxOrderNum() + { + return designerMaxOrderNum; + } + + public void setDesignerMaxOrderNum(int designerMaxOrderNum) + { + this.designerMaxOrderNum = designerMaxOrderNum; + } + + public int getMaxWaiveNum() + { + return maxWaiveNum; + } + + public void setMaxWaiveNum(int maxWaiveNum) + { + this.maxWaiveNum = maxWaiveNum; + } + + public int getDesignerWaiveNum() + { + return designerWaiveNum; + } + + public void setDesignerWaiveNum(int designerWaiveNum) + { + this.designerWaiveNum = designerWaiveNum; + } + + public String getMerchantIds() + { + return merchantIds; + } + + public void setMerchantIds(String merchantIds) + { + this.merchantIds = merchantIds; + } + + public String getDesignerMerchantIds() + { + return designerMerchantIds; + } + + public void setDesignerMerchantIds(String designerMerchantIds) + { + this.designerMerchantIds = designerMerchantIds; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/ProductConvert.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/ProductConvert.java new file mode 100644 index 0000000..7c33211 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/ProductConvert.java @@ -0,0 +1,161 @@ +/** + * 扬彩印刷设计 + * 文件名 :ProductConvert.java + * 创建人 :gjx + * 创建时间:2021年3月3日 +*/ + +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 产品单价表 对应表《PRODUCT_CONVERT》 + */ +@AnAlias("ProductConvert") +@AnNew +@AnTable(table = "PRODUCT_CONVERT", key = "CONVERT_ID", type = "InnoDB") +public class ProductConvert implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "CONVERT_ID", type = "long", notNull = true) + private long convertId; // 产品单价id + @AnTableField(column = "PRD_TYPE_ID", type = "long", notNull = true) + private long prdTypeId; // 产品类型编号 + @AnTableField(column = "PRD_SIZE_WIDTH", type = "int", notNull = true) + private int prdSizeWidth;// 尺寸范围宽度 + @AnTableField(column = "PRD_SIZE_HEIGHT", type = "int", notNull = true) + private int prdSizeHeight;// 尺寸范围高度 + @AnTableField(column = "PRD_PAGE_NAME", type = "string,50", notNull = false) + private String prdPageName;// 面数名称 + @AnTableField(column = "ADD_OPERATOR", type = "string,20", notNull = false) + private String addOperator;// 添加人 + @AnTableField(column = "ADD_TIME", type = "datetime", notNull = true) + private Timestamp addTime;// 添加时间 + @AnTableField(column = "UPDATE_OPERATOR", type = "string,20", notNull = false) + private String updateOperator;// 更新人 + @AnTableField(column = "UPDATE_TIME", type = "datetime", notNull = false) + private Timestamp updateTime;// 更新时间 + @AnTableField(column = "SEQ", type = "int", notNull = true) + private int seq; + @AnTableField(column = "ALIAS", type = "string,100", notNull = false) + private String alias; + + public long getConvertId() + { + return convertId; + } + + public void setConvertId(long convertId) + { + this.convertId = convertId; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public int getPrdSizeWidth() + { + return prdSizeWidth; + } + + public void setPrdSizeWidth(int prdSizeWidth) + { + this.prdSizeWidth = prdSizeWidth; + } + + public int getPrdSizeHeight() + { + return prdSizeHeight; + } + + public void setPrdSizeHeight(int prdSizeHeight) + { + this.prdSizeHeight = prdSizeHeight; + } + + public String getPrdPageName() + { + return prdPageName; + } + + public void setPrdPageName(String prdPageName) + { + this.prdPageName = prdPageName; + } + + public String getAddOperator() + { + return addOperator; + } + + public void setAddOperator(String addOperator) + { + this.addOperator = addOperator; + } + + public Timestamp getAddTime() + { + return addTime; + } + + public void setAddTime(Timestamp addTime) + { + this.addTime = addTime; + } + + public String getUpdateOperator() + { + return updateOperator; + } + + public void setUpdateOperator(String updateOperator) + { + this.updateOperator = updateOperator; + } + + public Timestamp getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Timestamp updateTime) + { + this.updateTime = updateTime; + } + + public int getSeq() + { + return seq; + } + + public void setSeq(int seq) + { + this.seq = seq; + } + + public String getAlias() + { + return alias; + } + + public void setAlias(String alias) + { + this.alias = alias; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/ProductDesignPriceView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/ProductDesignPriceView.java new file mode 100644 index 0000000..d1fd5e7 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/ProductDesignPriceView.java @@ -0,0 +1,225 @@ +package com.zhiqim.yangcai.design.dbo.design; + +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +@AnAlias("ProductDesignPriceView") +@AnNew +@AnView("PRODUCT_CONVERT,DESIGN_PRICE") +@AnViewJoin( +{ + @AnViewJoinValue(type = "LEFT", lTable = "PRODUCT_CONVERT", lColumn = "CONVERT_ID", rTable = "DESIGN_PRICE", rColumn = "CONVERT_ID") +}) +public class ProductDesignPriceView extends ProductConvert +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table = "PRODUCT_CONVERT", column = "CONVERT_ID") + private long convertId; // 产品单价id + @AnViewField(table = "PRODUCT_CONVERT", column = "PRD_TYPE_ID") + private long prdTypeId; // 产品类型编号 + @AnViewField(table = "PRODUCT_CONVERT", column = "PRD_SIZE_WIDTH") + private int prdSizeWidth;// 尺寸范围宽度 + @AnViewField(table = "PRODUCT_CONVERT", column = "PRD_SIZE_HEIGHT") + private int prdSizeHeight;// 尺寸范围高度 + @AnViewField(table = "PRODUCT_CONVERT", column = "PRD_PAGE_NAME") + private String prdPageName;// 面数名称 + @AnViewField(table = "PRODUCT_CONVERT", column = "ADD_OPERATOR") + private String addOperator;// 添加人 + @AnViewField(table = "PRODUCT_CONVERT", column = "ADD_TIME") + private Timestamp addTime;// 添加时间 + @AnViewField(table = "PRODUCT_CONVERT", column = "UPDATE_OPERATOR") + private String updateOperator;// 更新人 + @AnViewField(table = "PRODUCT_CONVERT", column = "UPDATE_TIME") + private Timestamp updateTime;// 更新时间 + @AnViewField(table = "PRODUCT_CONVERT", column = "SEQ") + private int seq; + + @AnViewField(table = "DESIGN_PRICE", column = "price_id") + private long priceId; // 设计单价ID + @AnViewField(table = "DESIGN_PRICE", column = "draft_type") + private int draftType;// 稿件类型 + @AnViewField(table = "DESIGN_PRICE", column = "design_price_money") + private long designPriceMoney;// 设计单价金额 + @AnViewField(table = "DESIGN_PRICE", column = "effect_time") + private Timestamp effectTime;// 生效时间 + @AnViewField(table = "DESIGN_PRICE", column = "status") + private int status;// 设计单价状态(0失效,1生效) + + @Override + public long getConvertId() + { + return convertId; + } + + @Override + public void setConvertId(long convertId) + { + this.convertId = convertId; + } + + @Override + public long getPrdTypeId() + { + return prdTypeId; + } + + @Override + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + @Override + public int getPrdSizeWidth() + { + return prdSizeWidth; + } + + @Override + public void setPrdSizeWidth(int prdSizeWidth) + { + this.prdSizeWidth = prdSizeWidth; + } + + @Override + public int getPrdSizeHeight() + { + return prdSizeHeight; + } + + @Override + public void setPrdSizeHeight(int prdSizeHeight) + { + this.prdSizeHeight = prdSizeHeight; + } + + @Override + public String getPrdPageName() + { + return prdPageName; + } + + @Override + public void setPrdPageName(String prdPageName) + { + this.prdPageName = prdPageName; + } + + @Override + public String getAddOperator() + { + return addOperator; + } + + @Override + public void setAddOperator(String addOperator) + { + this.addOperator = addOperator; + } + + @Override + public Timestamp getAddTime() + { + return addTime; + } + + @Override + public void setAddTime(Timestamp addTime) + { + this.addTime = addTime; + } + + @Override + public String getUpdateOperator() + { + return updateOperator; + } + + @Override + public void setUpdateOperator(String updateOperator) + { + this.updateOperator = updateOperator; + } + + @Override + public Timestamp getUpdateTime() + { + return updateTime; + } + + @Override + public void setUpdateTime(Timestamp updateTime) + { + this.updateTime = updateTime; + } + + @Override + public int getSeq() + { + return seq; + } + + @Override + public void setSeq(int seq) + { + this.seq = seq; + } + + public long getPriceId() + { + return priceId; + } + + public void setPriceId(long priceId) + { + this.priceId = priceId; + } + + public int getDraftType() + { + return draftType; + } + + public void setDraftType(int draftType) + { + this.draftType = draftType; + } + + public long getDesignPriceMoney() + { + return designPriceMoney; + } + + public void setDesignPriceMoney(long designPriceMoney) + { + this.designPriceMoney = designPriceMoney; + } + + public Timestamp getEffectTime() + { + return effectTime; + } + + public void setEffectTime(Timestamp effectTime) + { + this.effectTime = effectTime; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/teamManagement.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/teamManagement.java new file mode 100644 index 0000000..3e3dce2 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/design/teamManagement.java @@ -0,0 +1,101 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.design; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 责任类型 对应表《TEAM_MANAGEMENT》 + */ +@AnAlias("Team_Management") +@AnNew +@AnTable(table="TEAM_MANAGEMENT", key="TEAM_ID", type="InnoDB") +public class teamManagement implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="TEAM_ID", type="long", notNull=true) private long teamId; //1.团队编号 + @AnTableField(column="MERCHANT_NAME", type="string,200", notNull=true) private String merchantName; //2.商户名 + @AnTableField(column="TEAM_SECRET", type="string,2048", notNull=true) private String teamSecret; //3.设计师 + @AnTableField(column="IS_ENABLED", type="boolean", notNull=true) private boolean isEnabled; //4.商户状态 =true 表示 正常 =false 停用 + @AnTableField(column="TEAM_NAME", type="string,20", notNull=true) private String teamName; //2.商户名 + @AnTableField(column="DEPT_TEAM", type="string,200", notNull=true) private String deptTeam; //2.团队主管 + @AnTableField(column="DEPT_ORG", type="string,200", notNull=true) private String deptOrg; //2.组织 + public String toString() + { + return Jsons.toString(this); + } + + public long getTeamId() { + return teamId; + } + + public void setTeamId(long teamId) { + this.teamId = teamId; + } + + public String getMerchantName() { + return merchantName; + } + + public void setMerchantName(String merchantName) { + this.merchantName = merchantName; + } + + public String getTeamSecret() { + return teamSecret; + } + + public void setTeamSecret(String teamSecret) { + this.teamSecret = teamSecret; + } + + public boolean isEnabled() { + return isEnabled; + } + + public String getDeptTeam() { + return deptTeam; + } + + public void setDeptTeam(String deptTeam) { + this.deptTeam = deptTeam; + } + + public void setEnabled(boolean isEnabled) { + this.isEnabled = isEnabled; + } + + public String getTeamName() { + return teamName; + } + + public void setTeamName(String teamName) { + this.teamName = teamName; + } + + public String getDeptOrg() { + return deptOrg; + } + + public void setDeptOrg(String deptOrg) { + this.deptOrg = deptOrg; + } + + + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesDispatchOrderLog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesDispatchOrderLog.java new file mode 100644 index 0000000..1742ba9 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesDispatchOrderLog.java @@ -0,0 +1,181 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dbo.dispatch; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 派单日志表 对应表《DES_DISPATCH_ORDER_LOG》 + */ +@AnAlias("DesDispatchOrderLog") +@AnNew +@AnTable(table = "DES_DISPATCH_ORDER_LOG", key = "DESIGN_ID,DES_TIME", type = "InnoDB") +public class DesDispatchOrderLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 1.订单ID + @AnTableField(column = "DES_TIME", type = "datetime", notNull = true) + private Timestamp desTime; // 2.派单时间 + @AnTableField(column = "DIS_TYPE", type = "byte", notNull = true) + private int disType; // 3.派单类型(0:自动派单,1:手工指单,2:手工领单) + @AnTableField(column = "DIS_ORDER_STATUS", type = "byte", notNull = true) + private int disOrderStatus; // 4.派单订单状态(0代表完成,1代表未完成,2代表转让,3代表退款,4代表已暂停) + @AnTableField(column = "OPERATOR_CODE", type = "string,32", notNull = true) + private String operatorCode; // 5.设计师编号(操作员) + @AnTableField(column = "ORG_ID", type = "long", notNull = true) + private long orgId; // 6.操作员组织编号 + @AnTableField(column = "INDUSTRY_ID", type = "long", notNull = true) + private long industryId; // 7.订单所属行业 + @AnTableField(column = "MONTH_CODE", type = "string,6", notNull = false) + private String monthCode; // 8.月份 + @AnTableField(column = "DAY_CODE", type = "string,10", notNull = false) + private String dayCode; // 9.日期 + @AnTableField(column = "ORDER_TEXT", type = "string,200", notNull = false) + private String orderText; // 10.订单产品说明 + @AnTableField(column = "DIS_DESC", type = "string,1000", notNull = false) + private String disDesc; // 11.派单描述 + @AnTableField(column = "DRAFT_TYPE", type = "int", notNull = true) + private int draftType; // 12.稿件类型,0:自来稿,1:改稿自来稿,2:普通设计,3:高级设计 + + public String toString() + { + return Jsons.toString(this); + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public Timestamp getDesTime() + { + return desTime; + } + + public void setDesTime(Timestamp desTime) + { + this.desTime = desTime; + } + + public int getDisType() + { + return disType; + } + + public void setDisType(int disType) + { + this.disType = disType; + } + + public int getDisOrderStatus() + { + return disOrderStatus; + } + + public void setDisOrderStatus(int disOrderStatus) + { + this.disOrderStatus = disOrderStatus; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public String getMonthCode() + { + return monthCode; + } + + public void setMonthCode(String monthCode) + { + this.monthCode = monthCode; + } + + public String getDayCode() + { + return dayCode; + } + + public void setDayCode(String dayCode) + { + this.dayCode = dayCode; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public String getDisDesc() + { + return disDesc; + } + + public void setDisDesc(String disDesc) + { + this.disDesc = disDesc; + } + + public int getDraftType() + { + return draftType; + } + + public void setDraftType(int draftType) + { + this.draftType = draftType; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesDispatchProperty.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesDispatchProperty.java new file mode 100644 index 0000000..9d46d8d --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesDispatchProperty.java @@ -0,0 +1,218 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dbo.dispatch; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师派单属性 对应表《DES_DISPATCH_PROPERTY》 目前已不再使用,使用新的规则表DESIGNER_GROUP_DISPATCH代替了 --caohong + */ +@AnAlias("DesDispatchProperty") +@AnNew +@AnTable(table = "DES_DISPATCH_PROPERTY", key = "OPERATOR_CODE", type = "InnoDB") +public class DesDispatchProperty implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "OPERATOR_CODE", type = "string,32", notNull = true) + private String operatorCode; // 1.设计师编码(设计师即操作员) + @AnTableField(column = "ORG_ID", type = "long", notNull = true) + private long orgId; // 2.操作员组织编号 + @AnTableField(column = "MAJOR_TYPE", type = "long", notNull = true) + private long majorType; // 3.主类型ID + @AnTableField(column = "SECONDARY_TYPES", type = "string,2000", notNull = false) + private String secondaryTypes; // 4.副类型ID,多个逗号分隔 + @AnTableField(column = "MAJOR_INDUSTRY", type = "long", notNull = true) + private long majorIndustry; // 5.主行业ID + @AnTableField(column = "SECONDARY_INDUSTRYS", type = "string,2000", notNull = false) + private String secondaryIndustrys; // 6.副行业ID + @AnTableField(column = "DESIGNER_LEVEL", type = "int", notNull = true) + private int designerLevel; // 8.0:普通, 1:高级 + @AnTableField(column = "SHOP_NICK", type = "string,300", notNull = false) + private String shopNick; // 11.店铺名,多个逗号隔开 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 12.创建时间 + @AnTableField(column = "UPDATE_TIME", type = "datetime", notNull = false) + private Timestamp updateTime; // 13.最后修改时间 + @AnTableField(column = "IS_DESIGN_ORDER", type = "boolean", notNull = true) + private boolean isDesignOrder; // 17.是否接取设计订单 + @AnTableField(column = "IS_NORM_DRAFT_ORDER", type = "boolean", notNull = true) + private boolean isNormDraftOrder; // 18.是否接取标准自来稿 + @AnTableField(column = "IS_DRAFT_ORDER", type = "boolean", notNull = true) + private boolean isDraftOrder; // 19.是否接取改稿自来稿 + @AnTableField(column = "IS_HIGH_QUALITY_ORDER", type = "boolean", notNull = false) + private boolean isHighQualityOrder; // 20.是否优质订单 + @AnTableField(column = "IS_URGENT", type = "boolean", notNull = false) + private boolean isUrgent; // 21.是否加急订单 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public long getMajorType() + { + return majorType; + } + + public void setMajorType(long majorType) + { + this.majorType = majorType; + } + + public String getSecondaryTypes() + { + return secondaryTypes; + } + + public void setSecondaryTypes(String secondaryTypes) + { + this.secondaryTypes = secondaryTypes; + } + + public long getMajorIndustry() + { + return majorIndustry; + } + + public void setMajorIndustry(long majorIndustry) + { + this.majorIndustry = majorIndustry; + } + + public String getSecondaryIndustrys() + { + return secondaryIndustrys; + } + + public void setSecondaryIndustrys(String secondaryIndustrys) + { + this.secondaryIndustrys = secondaryIndustrys; + } + + public int getDesignerLevel() + { + return designerLevel; + } + + public void setDesignerLevel(int designerLevel) + { + this.designerLevel = designerLevel; + } + + public String getShopNick() + { + return shopNick; + } + + public void setShopNick(String shopNick) + { + this.shopNick = shopNick; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Timestamp updateTime) + { + this.updateTime = updateTime; + } + + public boolean isDesignOrder() + { + return isDesignOrder; + } + + public void setDesignOrder(boolean isDesignOrder) + { + this.isDesignOrder = isDesignOrder; + } + + public boolean isNormDraftOrder() + { + return isNormDraftOrder; + } + + public void setNormDraftOrder(boolean isNormDraftOrder) + { + this.isNormDraftOrder = isNormDraftOrder; + } + + public boolean isDraftOrder() + { + return isDraftOrder; + } + + public void setDraftOrder(boolean isDraftOrder) + { + this.isDraftOrder = isDraftOrder; + } + + public boolean isHighQualityOrder() + { + return isHighQualityOrder; + } + + public void setHighQualityOrder(boolean isHighQualityOrder) + { + this.isHighQualityOrder = isHighQualityOrder; + } + + public boolean isUrgent() + { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) + { + this.isUrgent = isUrgent; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesMerDispatchLog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesMerDispatchLog.java new file mode 100644 index 0000000..8b907d6 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesMerDispatchLog.java @@ -0,0 +1,93 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.dispatch; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 商户分拣日志表 对应表《DES_MER_DISPATCH_LOG》 + */ +@AnAlias("DesMerDispatchLog") +@AnNew +@AnTable(table="DES_MER_DISPATCH_LOG", key="DESIGN_ID,DES_TIME", type="InnoDB") +public class DesMerDispatchLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ORG_ID", type="long", notNull=true) private long orgId; //1.组织编号 + @AnTableField(column="DESIGN_ID", type="long", notNull=true) private long designId; //2.订单ID + @AnTableField(column="DES_TIME", type="datetime", notNull=true) private Timestamp desTime; //3.分拣时间 + @AnTableField(column="DIS_DESC", type="string,1000", notNull=false) private String disDesc; //4.分拣描述 + @AnTableField(column="ANALYSIS_TEXT", type="string,20000", notNull=false) private String analysisText; //5.分拣分析 详情 + + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public Timestamp getDesTime() + { + return desTime; + } + + public void setDesTime(Timestamp desTime) + { + this.desTime = desTime; + } + + public String getDisDesc() + { + return disDesc; + } + + public void setDisDesc(String disDesc) + { + this.disDesc = disDesc; + } + + public String getAnalysisText() + { + return analysisText; + } + + public void setAnalysisText(String analysisText) + { + this.analysisText = analysisText; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesNoticeLog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesNoticeLog.java new file mode 100644 index 0000000..6c4d0fa --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesNoticeLog.java @@ -0,0 +1,82 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.dispatch; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 通知日志,暂用于检查任务通知日志记录 对应表《DES_NOTICE_LOG》 + */ +@AnAlias("DesNoticeLog") +@AnNew +@AnTable(table="DES_NOTICE_LOG", key="LOG_ID", type="InnoDB") +public class DesNoticeLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="LOG_ID", type="long", notNull=true) private long logId; //1.主键 + @AnTableField(column="NOTICE_TIME", type="datetime", notNull=true) private Timestamp noticeTime; //2.日志时间 + @AnTableField(column="NOTICE_CONTENT", type="string,1024", notNull=true) private String noticeContent; //3.通知内容 + @AnTableField(column="KEY_WORD", type="string,128", notNull=true) private String keyWord; //4.通知关键字 + + public String toString() + { + return Jsons.toString(this); + } + + public long getLogId() + { + return logId; + } + + public void setLogId(long logId) + { + this.logId = logId; + } + + public Timestamp getNoticeTime() + { + return noticeTime; + } + + public void setNoticeTime(Timestamp noticeTime) + { + this.noticeTime = noticeTime; + } + + public String getNoticeContent() + { + return noticeContent; + } + + public void setNoticeContent(String noticeContent) + { + this.noticeContent = noticeContent; + } + + public String getKeyWord() + { + return keyWord; + } + + public void setKeyWord(String keyWord) + { + this.keyWord = keyWord; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesOnline.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesOnline.java new file mode 100644 index 0000000..cadc9f9 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesOnline.java @@ -0,0 +1,160 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.dispatch; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师在线表 对应表《DES_ONLINE》 + */ +@AnAlias("DesOnline") +@AnNew +@AnTable(table = "DES_ONLINE", key = "OPERATOR_CODE", type = "InnoDB") +public class DesOnline implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "ORG_ID", type = "long", notNull = true) + private long orgId; // 1.操作员组织编号 + @AnTableField(column = "OPERATOR_CODE", type = "string,32", notNull = true) + private String operatorCode; // 2.设计师编号(操作员) + @AnTableField(column = "ONLINE_STATUS", type = "int", notNull = true) + private int onlineStatus; // 3.在线状态(0:停止接单, 1:正在接单) + @AnTableField(column = "ORDER_NUM", type = "int", notNull = true) + private int orderNum; // 4.设计师订单数 + @AnTableField(column = "SESSION_ID", type = "string,32", notNull = false) + private String sessionId; // 5.设计师SESSION_ID + @AnTableField(column = "SESSION_TIME", type = "datetime", notNull = false) + private Timestamp sessionTime; // 6.设计师上班时间 + @AnTableField(column = "LAST_DRAFT_TYPE", type = "long", notNull = true) + private long lastDraftType; // 7.最近初稿类型,对应产品类型ID + @AnTableField(column = "LAST_DRAFT_TIME", type = "datetime", notNull = false) + private Timestamp lastDraftTime; // 8.最近初稿提交时间 + @AnTableField(column = "DESIGNER_LEVEL", type = "int", notNull = false) + private int designerLevel; // 9.设计师级别 + @AnTableField(column = "LAST_UPDATE_TIME", type = "datetime", notNull = false) + private Timestamp lastUpdateTime; // 10.最近状态刷新时间 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public int getOnlineStatus() + { + return onlineStatus; + } + + public void setOnlineStatus(int onlineStatus) + { + this.onlineStatus = onlineStatus; + } + + public int getOrderNum() + { + return orderNum; + } + + public void setOrderNum(int orderNum) + { + this.orderNum = orderNum; + } + + public String getSessionId() + { + return sessionId; + } + + public void setSessionId(String sessionId) + { + this.sessionId = sessionId; + } + + public Timestamp getSessionTime() + { + return sessionTime; + } + + public void setSessionTime(Timestamp sessionTime) + { + this.sessionTime = sessionTime; + } + + public long getLastDraftType() + { + return lastDraftType; + } + + public void setLastDraftType(long lastDraftType) + { + this.lastDraftType = lastDraftType; + } + + public Timestamp getLastDraftTime() + { + return lastDraftTime; + } + + public void setLastDraftTime(Timestamp lastDraftTime) + { + this.lastDraftTime = lastDraftTime; + } + + public int getDesignerLevel() + { + return designerLevel; + } + + public void setDesignerLevel(int designerLevel) + { + this.designerLevel = designerLevel; + } + + public Timestamp getLastUpdateTime() + { + return lastUpdateTime; + } + + public void setLastUpdateTime(Timestamp lastUpdateTime) + { + this.lastUpdateTime = lastUpdateTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesOnlineTime.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesOnlineTime.java new file mode 100644 index 0000000..6783a25 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesOnlineTime.java @@ -0,0 +1,81 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.dispatch; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 设计师在线时长表 对应表《DES_ONLINE_TIME》 + */ +@AnAlias("DesOnlineTime") +@AnNew +@AnTable(table="DES_ONLINE_TIME", key="DAY_CODE,OPERATOR_CODE", type="InnoDB") +public class DesOnlineTime implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="DAY_CODE", type="string,10", notNull=true) private String dayCode; //1.日期 + @AnTableField(column="ORG_ID", type="long", notNull=true) private long orgId; //2.操作员 组织编号 + @AnTableField(column="OPERATOR_CODE", type="string,32", notNull=true) private String operatorCode; //3.设计师编号(操作员) + @AnTableField(column="ONLINE_TIME", type="int", notNull=true) private int onlineTime; //4.设计师在线时长 + + public String toString() + { + return Jsons.toString(this); + } + + public String getDayCode() + { + return dayCode; + } + + public void setDayCode(String dayCode) + { + this.dayCode = dayCode; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public int getOnlineTime() + { + return onlineTime; + } + + public void setOnlineTime(int onlineTime) + { + this.onlineTime = onlineTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesWorkSearchLog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesWorkSearchLog.java new file mode 100644 index 0000000..707bdea --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesWorkSearchLog.java @@ -0,0 +1,112 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.dispatch; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 工作日志查询表 对应表《DES_WORK_SEARCH_LOG》 + */ +@AnAlias("DesWorkSearchLog") +@AnNew +@AnTable(table = "DES_WORK_SEARCH_LOG", key = "LOG_ID", type = "InnoDB") +public class DesWorkSearchLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "LOG_ID", type = "long", notNull = true) + private long logId; // 1.日志ID + @AnTableField(column = "OPERATOR_CODE", type = "string,32", notNull = true) + private String operatorCode; // 2.操作员编号 + @AnTableField(column = "ORG_ID", type = "long", notNull = true) + private long orgId; // 3.操作员组织编号 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 4.操作时间 + @AnTableField(column = "OPR_DESC", type = "string,32", notNull = false) + private String oprDesc; // 5.操作日志描述 + @AnTableField(column = "LOG_TYPE", type = "int", notNull = false) + private int logType; // 6.操作日志类型 :1=正在接单,2 停止接单/退出浏览器 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getLogId() + { + return logId; + } + + public void setLogId(long logId) + { + this.logId = logId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public String getOprDesc() + { + return oprDesc; + } + + public void setOprDesc(String oprDesc) + { + this.oprDesc = oprDesc; + } + + public int getLogType() + { + return logType; + } + + public void setLogType(int logType) + { + this.logType = logType; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesignerGroupDispatchLog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesignerGroupDispatchLog.java new file mode 100644 index 0000000..7fc2ead --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dispatch/DesignerGroupDispatchLog.java @@ -0,0 +1,100 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.dispatch; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师组分拣日志表 对应表《DESIGNER_GROUP_DISPATCH_LOG》 + */ +@AnAlias("DesignerGroupDispatchLog") +@AnNew +@AnTable(table = "DESIGNER_GROUP_DISPATCH_LOG", key = "DESIGN_ID,DES_TIME", type = "InnoDB") +public class DesignerGroupDispatchLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "ORG_ID", type = "long", notNull = true) + private long orgId; // 1.组织编号 + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 2.订单ID + @AnTableField(column = "DES_TIME", type = "datetime", notNull = true) + private Timestamp desTime; // 3.分拣时间 + @AnTableField(column = "DIS_DESC", type = "string,1000", notNull = false) + private String disDesc; // 4.分拣描述 + @AnTableField(column = "ANALYSIS_TEXT", type = "string,20000", notNull = false) + private String analysisText; // 5.分拣分析 详情 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public Timestamp getDesTime() + { + return desTime; + } + + public void setDesTime(Timestamp desTime) + { + this.desTime = desTime; + } + + public String getDisDesc() + { + return disDesc; + } + + public void setDisDesc(String disDesc) + { + this.disDesc = disDesc; + } + + public String getAnalysisText() + { + return analysisText; + } + + public void setAnalysisText(String analysisText) + { + this.analysisText = analysisText; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dzmpsupport/DzmpDesignElement.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dzmpsupport/DzmpDesignElement.java new file mode 100644 index 0000000..ea1f643 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/dzmpsupport/DzmpDesignElement.java @@ -0,0 +1,108 @@ +package com.zhiqim.yangcai.design.dbo.dzmpsupport; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 电子名片:名片设计元素 对应表《DZMP_DESIGN_ELEMENT》 + * + * @author HuangZhiGao + * @date 2020年7月22日 上午11:06:19 + */ +@AnAlias("DzmpDesignElement") +@AnNew +@AnTable(table = "DZMP_DESIGN_ELEMENT", key = "ID", type = "InnoDB") +public class DzmpDesignElement implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** + * 名片设计元素对应id + */ + @AnTableField(column = "ID", type = "string,600", notNull = true) + private String id; + + /** + * 订单模板素材id + */ + @AnTableField(column = "MEDIA_ID", type = "long", notNull = true) + private long mediaId; + + /** + * 名片设计元素对应json字符串 + */ + @AnTableField(column = "ELE_JSON", type = "string,5000", notNull = true) + private String eleJson; + + /** + * 名片设计元素更新时间 + */ + @AnTableField(column = "MODIFY_TIME", type = "datetime", notNull = false) + private Timestamp modifyTime; + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public DzmpDesignElement() + { + } + + public DzmpDesignElement(String id, long mediaId, String eleJson, Timestamp modifyTime) + { + super(); + this.id = id; + this.mediaId = mediaId; + this.eleJson = eleJson; + this.modifyTime = modifyTime; + } + + public String getId() + { + return id; + } + + public void setId(String id) + { + this.id = id; + } + + public long getMediaId() + { + return mediaId; + } + + public void setMediaId(long mediaId) + { + this.mediaId = mediaId; + } + + public String getEleJson() + { + return eleJson; + } + + public void setEleJson(String eleJson) + { + this.eleJson = eleJson; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/editor/DesignPinlei.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/editor/DesignPinlei.java new file mode 100644 index 0000000..cd9c73d --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/editor/DesignPinlei.java @@ -0,0 +1,78 @@ +package com.zhiqim.yangcai.design.dbo.editor; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 订单表 对应表《DESIGN_ORDER》 + */ +@AnAlias("DesignPinlei") +@AnNew +@AnTable(table = "DESIGN_PINLEI", key = "ID", type = "InnoDB") +public class DesignPinlei implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "ID", type = "long", notNull = true) + private long id; // 1.品类id + @AnTableField(column = "NAME", type = "string,200", notNull = false) + private String name; // 2.名称 + @AnTableField(column = "CLASSIFY_ID", type = "long", notNull = false) + private long classifyId; // 3.品类跳转id + @AnTableField(column = "TYPE_ID", type = "long", notNull = false) + private long typeId; // 4.类型id + @AnTableField(column = "TYPE_NAME", type = "string,200", notNull = false) + private String typeName; // 5.类型名称 + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public long getTypeId() { + return typeId; + } + + public void setTypeId(long typeId) { + this.typeId = typeId; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public long getClassifyId() { + return classifyId; + } + + public void setClassifyId(long classifyId) { + this.classifyId = classifyId; + } + +} \ No newline at end of file diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordCore.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordCore.java new file mode 100644 index 0000000..e03c237 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordCore.java @@ -0,0 +1,81 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.keyword; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 关键词库表 对应表《DES_KEYWORD_CORE》 + */ +@AnAlias("DesKeywordCore") +@AnNew +@AnTable(table="DES_KEYWORD_CORE", key="", type="InnoDB") +public class DesKeywordCore implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="KEYWORD_NAME", type="string,1000", notNull=true) private String keywordName; //1.关键词名称 + @AnTableField(column="KEYWORD_HOT", type="int", notNull=true) private int keywordHot; //2.关键词热度(相似度50% + 1) + @AnTableField(column="KEYWORD_NUM", type="int", notNull=true) private int keywordNum; //3.关键词搜索次数 + @AnTableField(column="KEYWORD_SCORE", type="int", notNull=true) private int keywordScore; //4.关键词分数 + + public String toString() + { + return Jsons.toString(this); + } + + public String getKeywordName() + { + return keywordName; + } + + public void setKeywordName(String keywordName) + { + this.keywordName = keywordName; + } + + public int getKeywordHot() + { + return keywordHot; + } + + public void setKeywordHot(int keywordHot) + { + this.keywordHot = keywordHot; + } + + public int getKeywordNum() + { + return keywordNum; + } + + public void setKeywordNum(int keywordNum) + { + this.keywordNum = keywordNum; + } + + public int getKeywordScore() + { + return keywordScore; + } + + public void setKeywordScore(int keywordScore) + { + this.keywordScore = keywordScore; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordCoreLog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordCoreLog.java new file mode 100644 index 0000000..2190c38 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordCoreLog.java @@ -0,0 +1,103 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.keyword; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 关键词库日志表 对应表《DES_KEYWORD_CORE_LOG》 + */ +@AnAlias("DesKeywordCoreLog") +@AnNew +@AnTable(table="DES_KEYWORD_CORE_LOG", key="LOG_ID", type="InnoDB") +public class DesKeywordCoreLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="LOG_ID", type="long", notNull=true) private long logId; //1.日志ID + @AnTableField(column="DAY_CODE", type="string,10", notNull=true) private String dayCode; //2.日期 + @AnTableField(column="MONTH_CODE", type="string,10", notNull=true) private String monthCode; //3.月份 + @AnTableField(column="KEYWORD_NAME", type="string,5000", notNull=true) private String keywordName; //4.关键词名称 + @AnTableField(column="KEYWORD_HOT", type="int", notNull=false) private int keywordHot; //5.关键词热度(相似度50% + 1) + @AnTableField(column="KEYWORD_NUM", type="int", notNull=false) private int keywordNum; //6.关键词搜索次数 + + public String toString() + { + return Jsons.toString(this); + } + + public long getLogId() + { + return logId; + } + + public void setLogId(long logId) + { + this.logId = logId; + } + + public String getDayCode() + { + return dayCode; + } + + public void setDayCode(String dayCode) + { + this.dayCode = dayCode; + } + + public String getMonthCode() + { + return monthCode; + } + + public void setMonthCode(String monthCode) + { + this.monthCode = monthCode; + } + + public String getKeywordName() + { + return keywordName; + } + + public void setKeywordName(String keywordName) + { + this.keywordName = keywordName; + } + + public int getKeywordHot() + { + return keywordHot; + } + + public void setKeywordHot(int keywordHot) + { + this.keywordHot = keywordHot; + } + + public int getKeywordNum() + { + return keywordNum; + } + + public void setKeywordNum(int keywordNum) + { + this.keywordNum = keywordNum; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordCoreStat.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordCoreStat.java new file mode 100644 index 0000000..b5ec35b --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordCoreStat.java @@ -0,0 +1,114 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.keyword; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 关键词库统计表 对应表《DES_KEYWORD_CORE_STAT》 + */ +@AnAlias("DesKeywordCoreStat") +@AnNew +@AnTable(table="DES_KEYWORD_CORE_STAT", key="", type="InnoDB") +public class DesKeywordCoreStat implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="DAY_CODE", type="string,10", notNull=true) private String dayCode; //1.日期 + @AnTableField(column="KEYWORD_NAME", type="string,1000", notNull=true) private String keywordName; //2.关键词名称 + @AnTableField(column="MONTH_CODE", type="string,10", notNull=true) private String monthCode; //3.月份 + @AnTableField(column="KEYWORD_HOT", type="int", notNull=true) private int keywordHot; //4.关键词热度(相似度50% + 1) + @AnTableField(column="KEYWORD_NUM", type="int", notNull=true) private int keywordNum; //5.关键词搜索次数 + @AnTableField(column="KEYWORD_NUM_RANK", type="int", notNull=true) private int keywordNumRank; //6.关键词搜索排名 + @AnTableField(column="KEYWORD_HOT_RANK", type="int", notNull=true) private int keywordHotRank; //7.关键词热度排名 + + public String toString() + { + return Jsons.toString(this); + } + + public String getDayCode() + { + return dayCode; + } + + public void setDayCode(String dayCode) + { + this.dayCode = dayCode; + } + + public String getKeywordName() + { + return keywordName; + } + + public void setKeywordName(String keywordName) + { + this.keywordName = keywordName; + } + + public String getMonthCode() + { + return monthCode; + } + + public void setMonthCode(String monthCode) + { + this.monthCode = monthCode; + } + + public int getKeywordHot() + { + return keywordHot; + } + + public void setKeywordHot(int keywordHot) + { + this.keywordHot = keywordHot; + } + + public int getKeywordNum() + { + return keywordNum; + } + + public void setKeywordNum(int keywordNum) + { + this.keywordNum = keywordNum; + } + + public int getKeywordNumRank() + { + return keywordNumRank; + } + + public void setKeywordNumRank(int keywordNumRank) + { + this.keywordNumRank = keywordNumRank; + } + + public int getKeywordHotRank() + { + return keywordHotRank; + } + + public void setKeywordHotRank(int keywordHotRank) + { + this.keywordHotRank = keywordHotRank; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordIndex.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordIndex.java new file mode 100644 index 0000000..9a65b17 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordIndex.java @@ -0,0 +1,92 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.keyword; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 关键词索引表 对应表《DES_KEYWORD_INDEX》 + */ +@AnAlias("DesKeywordIndex") +@AnNew +@AnTable(table="DES_KEYWORD_INDEX", key="MEDIA_ID", type="InnoDB") +public class DesKeywordIndex implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="MEDIA_ID", type="long", notNull=true) private long mediaId; //1.媒体编号 + @AnTableField(column="LABEL_KEYWORD", type="string,5000", notNull=false) private String labelKeyword; //2.标签关键词 + @AnTableField(column="CUSTOM_LABEL_KEYWORD", type="string,5000", notNull=false) private String customLabelKeyword; //3.自定义标签关键词 + @AnTableField(column="LONG_TAIL_KEYWORD", type="string,5000", notNull=false) private String longTailKeyword; //4.长尾词关键词 + @AnTableField(column="MEDIA_SCORE", type="int", notNull=false) private int mediaScore; //5.模板指数 + + public String toString() + { + return Jsons.toString(this); + } + + public long getMediaId() + { + return mediaId; + } + + public void setMediaId(long mediaId) + { + this.mediaId = mediaId; + } + + public String getLabelKeyword() + { + return labelKeyword; + } + + public void setLabelKeyword(String labelKeyword) + { + this.labelKeyword = labelKeyword; + } + + public String getCustomLabelKeyword() + { + return customLabelKeyword; + } + + public void setCustomLabelKeyword(String customLabelKeyword) + { + this.customLabelKeyword = customLabelKeyword; + } + + public String getLongTailKeyword() + { + return longTailKeyword; + } + + public void setLongTailKeyword(String longTailKeyword) + { + this.longTailKeyword = longTailKeyword; + } + + public int getMediaScore() + { + return mediaScore; + } + + public void setMediaScore(int mediaScore) + { + this.mediaScore = mediaScore; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordIndustry.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordIndustry.java new file mode 100644 index 0000000..6f4d8c1 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/keyword/DesKeywordIndustry.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.keyword; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 行业关键词 对应表《DES_KEYWORD_INDUSTRY》 + */ +@AnAlias("DesKeywordIndustry") +@AnNew +@AnTable(table="DES_KEYWORD_INDUSTRY", key="", type="InnoDB") +public class DesKeywordIndustry implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="INDUSTRY_ID", type="long", notNull=true) private long industryId; //1.行业ID + @AnTableField(column="INDUSTRY_SUB_ID", type="string,1000", notNull=true) private String industrySubId; //2.子行业ID + @AnTableField(column="INDUSTRY_KEYWORD", type="string,5000", notNull=true) private String industryKeyword; //3.行业关键词 + + public String toString() + { + return Jsons.toString(this); + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public String getIndustrySubId() + { + return industrySubId; + } + + public void setIndustrySubId(String industrySubId) + { + this.industrySubId = industrySubId; + } + + public String getIndustryKeyword() + { + return industryKeyword; + } + + public void setIndustryKeyword(String industryKeyword) + { + this.industryKeyword = industryKeyword; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/notice/Notice.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/notice/Notice.java new file mode 100644 index 0000000..44a61e6 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/notice/Notice.java @@ -0,0 +1,151 @@ +/** + * 扬彩印刷设计 + * 文件名 :Notice.java + * 创建人 :gjx + * 创建时间:2021年6月29日 +*/ + +package com.zhiqim.yangcai.design.dbo.notice; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 关键词库表 对应表《DES_KEYWORD_CORE》 + */ +@AnAlias("Notice") +@AnNew +@AnTable(table = "design_notice", key = "id", type = "InnoDB") +public class Notice implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "id", type = "long", notNull = true) + private long id; // 1.id + @AnTableField(column = "title", type = "string,100", notNull = false) + private String title; // 2.公告标题 + @AnTableField(column = "content", type = "string,50000", notNull = false) + private String content; // 3.公告内容 + @AnTableField(column = "add_user", type = "string,30", notNull = false) + private String addUser; // 4.发布的用户 + @AnTableField(column = "add_time", type = "datetime", notNull = false) + private Timestamp addTime; // 5.添加时间 + @AnTableField(column = "update_user", type = "string,30", notNull = false) + private String updateUser; // 6.修改的用户 + @AnTableField(column = "update_time", type = "datetime", notNull = false) + private Timestamp updateTime; // 7.修改时间 + @AnTableField(column = "status", type = "int", notNull = false) + private int status; // 9.公告状态 草稿=0;已发布=1;下线=2; + + @AnTableField(column = "finsh_time", type = "datetime", notNull = false) + private Timestamp finshTime; // 7.发布时间 + + @AnTableField(column = "finsh_user", type = "string,30", notNull = false) + private String finshUser; // 7.发布人 + + public String getFinshUser() + { + return finshUser; + } + + public void setFinshUser(String finshUser) + { + this.finshUser = finshUser; + } + + public Timestamp getFinshTime() + { + return finshTime; + } + + public void setFinshTime(Timestamp finshTime) + { + this.finshTime = finshTime; + } + + public long getId() + { + return id; + } + + public void setId(long id) + { + this.id = id; + } + + public String getTitle() + { + return title; + } + + public void setTitle(String title) + { + this.title = title; + } + + public String getContent() + { + return content; + } + + public void setContent(String content) + { + this.content = content; + } + + public String getAddUser() + { + return addUser; + } + + public void setAddUser(String addUser) + { + this.addUser = addUser; + } + + public Timestamp getAddTime() + { + return addTime; + } + + public void setAddTime(Timestamp addTime) + { + this.addTime = addTime; + } + + public String getUpdateUser() + { + return updateUser; + } + + public void setUpdateUser(String updateUser) + { + this.updateUser = updateUser; + } + + public Timestamp getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Timestamp updateTime) + { + this.updateTime = updateTime; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/ConfigQuestions.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/ConfigQuestions.java new file mode 100644 index 0000000..a939709 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/ConfigQuestions.java @@ -0,0 +1,88 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.order; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 考试题库表 + */ +@AnAlias("ConfigQuestions") +@AnNew +@AnTable(table = "CONFIG_QUESTIONS", key = "QUESTIONS_ID", type = "InnoDB") +public class ConfigQuestions implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "QUESTIONS_ID", type = "long", notNull = true) + private long questionsId; // 1.题库编号 + @AnTableField(column = "DESIGN_REQUIREMENTS", type = "string,400", notNull = true) + private String designRequirements; // 2.设计要求 + @AnTableField(column = "UPDATE_OPERATOR", type = "string,50", notNull = true) + private String updateOperator; // 3.操作员 + @AnTableField(column = "MODIFICATION_TIME", type = "datetime", notNull = true) + private Timestamp modificationTime; // 4.最后修改时间 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getQuestionsId() + { + return questionsId; + } + + public void setQuestionsId(long questionsId) + { + this.questionsId = questionsId; + } + + public String getDesignRequirements() + { + return designRequirements; + } + + public void setDesignRequirements(String designRequirements) + { + this.designRequirements = designRequirements; + } + + public String getUpdateOperator() + { + return updateOperator; + } + + public void setUpdateOperator(String updateOperator) + { + this.updateOperator = updateOperator; + } + + public Timestamp getModificationTime() + { + return modificationTime; + } + + public void setModificationTime(Timestamp modificationTime) + { + this.modificationTime = modificationTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignAtta.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignAtta.java new file mode 100644 index 0000000..46ac966 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignAtta.java @@ -0,0 +1,208 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.order; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计资料附件表 对应表《DESIGN_ATTA》 + */ +@AnAlias("DesignAtta") +@AnNew +@AnTable(table = "DESIGN_ATTA", key = "ATTA_ID", type = "InnoDB") +public class DesignAtta implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "ATTA_ID", type = "long", notNull = true) + private long attaId; // 1.订单附件编号 + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 2.设计订单编号 + @AnTableField(column = "ATTA_MODUL", type = "string,100", notNull = true) + private String attaModul; // 3.附件标识 + @AnTableField(column = "FILE_NAME", type = "string,200", notNull = true) + private String fileName; // 4.文件名 + @AnTableField(column = "FILE_TYPE", type = "string,10", notNull = true) + private String fileType; // 5.文件类型。.pdf、.cdr、.jpg + @AnTableField(column = "SAVE_PATH", type = "string,2000", notNull = false) + private String savePath; // 6.文件存储路径 + @AnTableField(column = "OSS_TYPE", type = "int", notNull = true) + private int ossType; // 7.存储类型-1=无效数据(本地和oss都不存在),=0 本地文件(oss未上传) 1= OSS文件(本地文件已删除) + @AnTableField(column = "ATTA_FLAG", type = "int", notNull = true) + private int attaFlag; // 8.附件表示,0=用户登录系统上传的文件,1=用户通过接口传送的文件 + @AnTableField(column = "OSS_URL", type = "string,400", notNull = false) + private String ossUrl; // 9.OSS访问地址 + @AnTableField(column = "FILE_SIZE", type = "long", notNull = true) + private long fileSize; // 10.文件大小 字节 + @AnTableField(column = "FILEID", type = "string,64", notNull = false) + private String fileid; // 11.文件Hash值 + @AnTableField(column = "OPERATOR_CODE", type = "string,64", notNull = false) + private String operatorCode; // 12.上传人 + @AnTableField(column = "UPLOAD_TIME", type = "datetime", notNull = true) + private Timestamp uploadTime; // 13.上传时间 + @AnTableField(column = "NOT_EXISTS_LOCAL_FILE", type = "int", notNull = true) + private int notExistsLocalFile; // 14.是否存在本地文件 =0或者=null 未被标记,1=本地存在, =2 本地文件已被删除 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getAttaId() + { + return attaId; + } + + public void setAttaId(long attaId) + { + this.attaId = attaId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getAttaModul() + { + return attaModul; + } + + public void setAttaModul(String attaModul) + { + this.attaModul = attaModul; + } + + public String getFileName() + { + return fileName; + } + + public void setFileName(String fileName) + { + this.fileName = fileName; + } + + public String getFileType() + { + return fileType; + } + + public void setFileType(String fileType) + { + this.fileType = fileType; + } + + public String getSavePath() + { + return savePath; + } + + public void setSavePath(String savePath) + { + this.savePath = savePath; + } + + public int getOssType() + { + return ossType; + } + + public void setOssType(int ossType) + { + this.ossType = ossType; + } + + public int getAttaFlag() + { + return attaFlag; + } + + public void setAttaFlag(int attaFlag) + { + this.attaFlag = attaFlag; + } + + public String getOssUrl() + { + return ossUrl; + } + + public void setOssUrl(String ossUrl) + { + this.ossUrl = ossUrl; + } + + public long getFileSize() + { + return fileSize; + } + + public void setFileSize(long fileSize) + { + this.fileSize = fileSize; + } + + public String getFileid() + { + return fileid; + } + + public void setFileid(String fileid) + { + this.fileid = fileid; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public Timestamp getUploadTime() + { + return uploadTime; + } + + public void setUploadTime(Timestamp uploadTime) + { + this.uploadTime = uploadTime; + } + + public int getNotExistsLocalFile() + { + return notExistsLocalFile; + } + + public void setNotExistsLocalFile(int notExistsLocalFile) + { + this.notExistsLocalFile = notExistsLocalFile; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignAttaView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignAttaView.java new file mode 100644 index 0000000..a43ff8d --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignAttaView.java @@ -0,0 +1,171 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.order; + +import java.sql.Timestamp; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 设计订单附件视图 对应视图《DESIGN_ATTA_VIEW》 + */ +@AnAlias("DesignAttaView") +@AnNew +@AnView("DESIGN_ATTA,DESIGN_ORDER") +@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="DESIGN_ORDER", lColumn="DESIGN_ID", rTable="DESIGN_ATTA", rColumn="DESIGN_ID")}) +public class DesignAttaView extends DesignOrder +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="DESIGN_ATTA", column="ATTA_ID") private long attaId; //2.订单附件编号 + @AnViewField(table="DESIGN_ATTA", column="ATTA_MODUL") private String attaModul; //3.附件标识 + @AnViewField(table="DESIGN_ATTA", column="FILE_NAME") private String fileName; //4.文件名 + @AnViewField(table="DESIGN_ATTA", column="FILE_TYPE") private String fileType; //5.文件类型。.pdf、.cdr、.jpg + @AnViewField(table="DESIGN_ATTA", column="SAVE_PATH") private String savePath; //6.文件存储路径 + @AnViewField(table="DESIGN_ATTA", column="OSS_TYPE") private int ossType; //7.存储类型-1=无效数据(本地和oss都不存在),=0 本地文件(oss未上传) 1= OSS文件(本地文件已删除) + @AnViewField(table="DESIGN_ATTA", column="OSS_URL") private String ossUrl; //8.OSS访问地址 + @AnViewField(table="DESIGN_ATTA", column="FILE_SIZE") private long fileSize; //9.文件大小 字节 + @AnViewField(table="DESIGN_ATTA", column="FILEID") private String fileid; //10.文件Hash值 + @AnViewField(table="DESIGN_ATTA", column="OPERATOR_CODE") private String operatorCode; //11.上传人 + @AnViewField(table="DESIGN_ATTA", column="UPLOAD_TIME") private Timestamp uploadTime; //12.上传时间 + @AnViewField(table="DESIGN_ATTA", column="NOT_EXISTS_LOCAL_FILE") private int notExistsLocalFile; //13.是否存在本地文件 =0或者=null 未被标记,1=本地存在, =2 本地文件已被删除 + + public String toString() + { + return Jsons.toString(this); + } + + public long getAttaId() + { + return attaId; + } + + public void setAttaId(long attaId) + { + this.attaId = attaId; + } + + public String getAttaModul() + { + return attaModul; + } + + public void setAttaModul(String attaModul) + { + this.attaModul = attaModul; + } + + public String getFileName() + { + return fileName; + } + + public void setFileName(String fileName) + { + this.fileName = fileName; + } + + public String getFileType() + { + return fileType; + } + + public void setFileType(String fileType) + { + this.fileType = fileType; + } + + public String getSavePath() + { + return savePath; + } + + public void setSavePath(String savePath) + { + this.savePath = savePath; + } + + public int getOssType() + { + return ossType; + } + + public void setOssType(int ossType) + { + this.ossType = ossType; + } + + public String getOssUrl() + { + return ossUrl; + } + + public void setOssUrl(String ossUrl) + { + this.ossUrl = ossUrl; + } + + public long getFileSize() + { + return fileSize; + } + + public void setFileSize(long fileSize) + { + this.fileSize = fileSize; + } + + public String getFileid() + { + return fileid; + } + + public void setFileid(String fileid) + { + this.fileid = fileid; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public Timestamp getUploadTime() + { + return uploadTime; + } + + public void setUploadTime(Timestamp uploadTime) + { + this.uploadTime = uploadTime; + } + + public int getNotExistsLocalFile() + { + return notExistsLocalFile; + } + + public void setNotExistsLocalFile(int notExistsLocalFile) + { + this.notExistsLocalFile = notExistsLocalFile; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrdLogView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrdLogView.java new file mode 100644 index 0000000..987ef92 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrdLogView.java @@ -0,0 +1,80 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignOrdLogView.java + * 创建人 :gjx + * 创建时间:2019-9-19 + */ + +package com.zhiqim.yangcai.design.dbo.order; + +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * + * 订单日志关联表 + * + * @version 1.0 @author gjx 2019-9-19 新建与整理 + */ +@AnAlias("DesignOrdLogView") +@AnNew +@AnView("DESIGN_ORDER,ORD_OPR_LOG") +@AnViewJoin( +{ + @AnViewJoinValue(type = "EQUAL", lTable = "ORD_OPR_LOG", lColumn = "DESIGN_ID", rTable = "DESIGN_ORDER", rColumn = "DESIGN_ID") +}) +public class DesignOrdLogView extends DesignOrder +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table = "ORD_OPR_LOG", column = "OPERATE_DESC") + private String operateDesc; // 1.操作项,简述操作描述 + @AnViewField(table = "ORD_OPR_LOG", column = "EVENT_TYPE") + private int eventType; // 2.事件类型 + @AnViewField(table = "ORD_OPR_LOG", column = "CREATE_TIME") + private Timestamp createLogTime; // //3.日志创建时间 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getOperateDesc() + { + return operateDesc; + } + + public void setOperateDesc(String operateDesc) + { + this.operateDesc = operateDesc; + } + + public int getEventType() + { + return eventType; + } + + public void setEventType(int eventType) + { + this.eventType = eventType; + } + + public Timestamp getCreateLogTime() + { + return createLogTime; + } + + public void setCreateLogTime(Timestamp createLogTime) + { + this.createLogTime = createLogTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrdRetentView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrdRetentView.java new file mode 100644 index 0000000..2dbb62b --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrdRetentView.java @@ -0,0 +1,121 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignOrdRetentView.java + * 创建人 :高佳新 + * 创建时间:2019-7-22 + */ + +package com.zhiqim.yangcai.design.dbo.order; + +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * + * 订单与滞留信息关联视图 + * + * @version 1.0 @author gjx 2019-7-22 新建与整理 + */ +@AnAlias("DesignOrdRetentView") +@AnNew +@AnView("RETENTION_DETAILS,DESIGN_ORDER") +@AnViewJoin( +{ + @AnViewJoinValue(type = "EQUAL", lTable = "DESIGN_ORDER", lColumn = "DESIGN_ID", rTable = "RETENTION_DETAILS", rColumn = "DESIGN_ID") +}) +public class DesignOrdRetentView extends DesignOrder +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table = "RETENTION_DETAILS", column = "IS_RETENT_DEAL") + private int isRetentDeal; // 2.设计师是否处理过滞留单,0 没、1 处理过 + @AnViewField(table = "RETENTION_DETAILS", column = "RETENT_DEAL_TIME") + private Timestamp retentDealTime; // 3.滞留单自行处理时间 + @AnViewField(table = "RETENTION_DETAILS", column = "RETENT_DEAL_NAME") + private String retentDealName; // 4.滞留单处理人 + @AnViewField(table = "RETENTION_DETAILS", column = "RETENT_DEAL_WAY") + private int retentDealWay; // 5.滞留单处理方式 0:寄存、1:退款 + @AnViewField(table = "RETENTION_DETAILS", column = "RETENT_FOLLOW_FLAG") + private int retentFollowFlag; // 6.设计师跟进情况:0:较好、1:一般、2:差 + @AnViewField(table = "RETENTION_DETAILS", column = "RETENT_REMARK") + private String retentRemark; // 7.滞留单处理备注 + @AnViewField(table = "RETENTION_DETAILS", column = "RETENTION_END_TIME") + private Timestamp retentionEndTime; // 8.滞留单处理时间 + + public int getIsRetentDeal() + { + return isRetentDeal; + } + + public void setIsRetentDeal(int isRetentDeal) + { + this.isRetentDeal = isRetentDeal; + } + + public Timestamp getRetentDealTime() + { + return retentDealTime; + } + + public void setRetentDealTime(Timestamp retentDealTime) + { + this.retentDealTime = retentDealTime; + } + + public String getRetentDealName() + { + return retentDealName; + } + + public void setRetentDealName(String retentDealName) + { + this.retentDealName = retentDealName; + } + + public int getRetentDealWay() + { + return retentDealWay; + } + + public void setRetentDealWay(int retentDealWay) + { + this.retentDealWay = retentDealWay; + } + + public int getRetentFollowFlag() + { + return retentFollowFlag; + } + + public void setRetentFollowFlag(int retentFollowFlag) + { + this.retentFollowFlag = retentFollowFlag; + } + + public String getRetentRemark() + { + return retentRemark; + } + + public void setRetentRemark(String retentRemark) + { + this.retentRemark = retentRemark; + } + + public Timestamp getRetentionEndTime() + { + return retentionEndTime; + } + + public void setRetentionEndTime(Timestamp retentionEndTime) + { + this.retentionEndTime = retentionEndTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrder.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrder.java new file mode 100644 index 0000000..7c5127f --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrder.java @@ -0,0 +1,956 @@ +package com.zhiqim.yangcai.design.dbo.order; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 订单表 对应表《DESIGN_ORDER》 + */ +@AnAlias("DesignOrder") +@AnNew +@AnTable(table = "DESIGN_ORDER", key = "DESIGN_ID", type = "InnoDB") +public class DesignOrder implements Serializable { + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 1.设订单编号,设计平台独立编号 + @AnTableField(column = "MERCHANT_ID", type = "long", notNull = true) + private long merchantId; // 2.订单商户编号 + @AnTableField(column = "OUT_ID", type = "string,200", notNull = true) + private String outId; // 3.外部系统单号 + @AnTableField(column = "STATUS", type = "int", notNull = true) + private int status; // 4.订单状态 + @AnTableField(column = "ORDER_TEXT", type = "string,200", notNull = true) + private String orderText; // 5.订单描述 + @AnTableField(column = "AMOUNT", type = "long", notNull = true) + private long amount; // 6.订单总金额 + @AnTableField(column = "TYPE_ID", type = "long", notNull = true) + private long typeId; // 7.设计类型,名片、彩页、等等 + @AnTableField(column = "INDUSTRY_ID", type = "long", notNull = true) + private long industryId; // 8.所属行业 + @AnTableField(column = "DRAFT_TYPE", type = "int", notNull = true) + private int draftType; // 9.稿件类型,0:自来稿,1:改稿自来稿,2:普通设计,3:高级设计 + @AnTableField(column = "IS_URGENT", type = "boolean", notNull = true) + private boolean isUrgent; // 10.是否加急 + @AnTableField(column = "DESIGN_PAGE", type = "int", notNull = true) + private int designPage; // 11.设计面数 + @AnTableField(column = "DESIGN_WIDTH", type = "decimal,5,2", notNull = true) + private double designWidth; // 12.设计宽度 单位mm + @AnTableField(column = "DESIGN_HEIGHT", type = "decimal,5,2", notNull = true) + private double designHeight; // 13.设计高度 单位mm + @AnTableField(column = "PRINT_WIDTH", type = "decimal,5,2", notNull = true) + private double printWidth; // 14.印刷宽度,非常规尺寸使用(优先使用该尺寸) + @AnTableField(column = "PRINT_HEIGHT", type = "decimal,5,2", notNull = true) + private double printHeight; // 15.印刷高度,非常规尺寸使用(优先使用该尺寸) + @AnTableField(column = "PRINT_KS", type = "int", notNull = true) + private int printKs; // 16.印刷款数 + @AnTableField(column = "PRINT_MS", type = "int", notNull = true) + private int printMs; // 17.印刷模数 + @AnTableField(column = "USER_CONTACT", type = "string,100", notNull = true) + private String userContact; // 18.联系人 + @AnTableField(column = "USER_MOBILE", type = "string,64", notNull = true) + private String userMobile; // 19.用户手机 + @AnTableField(column = "AFTER_NAMES", type = "string,1000", notNull = false) + private String afterNames; // 20.后加工名称,多个逗号隔开 + @AnTableField(column = "PRINT_SPECIAL", type = "string,100", notNull = false) + private String printSpecial; // 21.印刷特殊工艺 + @AnTableField(column = "BUYER_NICK", type = "string,100", notNull = false) + private String buyerNick; // 22.客户昵称 + @AnTableField(column = "USER_TEXT", type = "string,4000", notNull = false) + private String userText; // 23.客户文本 + @AnTableField(column = "USER_NOTICE", type = "string,1000", notNull = false) + private String userNotice; // 24.客户注意事项 + @AnTableField(column = "USER_QQ", type = "string,64", notNull = false) + private String userQq; // 25.用户QQ + @AnTableField(column = "USER_WX", type = "string,64", notNull = false) + private String userWx; // 26.用户微信 + @AnTableField(column = "USER_TEXT_REPLACE", type = "string,4000", notNull = false) + private String userTextReplace; // 27.格式化后的客户文本 + @AnTableField(column = "REMINDER_NUM", type = "int", notNull = true) + private int reminderNum; // 28.催单次数 + @AnTableField(column = "SHOP_NICK", type = "string,32", notNull = false) + private String shopNick; // 29.店铺名称 + @AnTableField(column = "ORG_ID", type = "long", notNull = false) + private long orgId; // 30.操作员组织编号 + @AnTableField(column = "ORG_RECEIVE_TIME", type = "datetime", notNull = false) + private Timestamp orgReceiveTime; // 31.订单分拣至商户时间 + @AnTableField(column = "RECEIVE_TYPE", type = "int", notNull = false) + private int receiveType; // 32.订单领取类型,0手动领单, 1 自动派单,2 手工指定 + @AnTableField(column = "ORDER_FLAG", type = "int", notNull = true) + private int orderFlag; // 33.订单标记,0:正常订单,1:老用户订单(不计时效),2:新用户订单(计时效) + @AnTableField(column = "DESIGNER", type = "string,20", notNull = false) + private String designer; // 34.设计师 + @AnTableField(column = "DESIGN_RECEIVE_TIME", type = "datetime", notNull = false) + private Timestamp designReceiveTime; // 35.设计师领单时间 + @AnTableField(column = "DESIGN_BEGIN_TIME", type = "datetime", notNull = false) + private Timestamp designBeginTime; // 36.设计师开始设计时间 + @AnTableField(column = "DESIGN_DRAFT_TIME", type = "datetime", notNull = false) + private Timestamp designDraftTime; // 37.设计师初稿时间 + @AnTableField(column = "DESIGN_END_TIME", type = "datetime", notNull = false) + private Timestamp designEndTime; // 38.设计师定稿时间 + @AnTableField(column = "DESIGN_PAUSE_REASON", type = "string,200", notNull = false) + private String designPauseReason; // 39.设计师暂停原因(新增字段) + @AnTableField(column = "DESIGN_PAUSE_TIME", type = "datetime", notNull = false) + private Timestamp designPauseTime; // 40.设计师暂停时间 + @AnTableField(column = "DESIGN_EXCLUDE", type = "string,256", notNull = false) + private String designExclude; // 41.设计师排除,多个逗号分隔 + @AnTableField(column = "DESIGN_REQUEST_REASON", type = "string,256", notNull = false) + private String designRequestReason; // 42.设计师请求主管支援原由 + @AnTableField(column = "REQUEST_TIME", type = "datetime", notNull = false) + private Timestamp requestTime; // 43.设计师请求主管支援 时间 + @AnTableField(column = "DESIGN_REJECT_REASON", type = "string,1000", notNull = false) + private String designRejectReason; // 44.主管支援拒绝原因 + @AnTableField(column = "DESIGN_KEEP_DURATION", type = "int", notNull = true) + private int designKeepDuration; // 45.设计师保留时长,单位分钟 + @AnTableField(column = "REQUEST_REFOUND_ACCEPT_REASON", type = "string,200", notNull = false) + private String requestRefoundAcceptReason; // 46.请求退款通过原因 + @AnTableField(column = "REFUND_TIME", type = "string,19", notNull = false) + private String refundTime; // 47.退款时间 + @AnTableField(column = "CHECKER", type = "string,20", notNull = false) + private String checker; // 48.印前审核人员 + @AnTableField(column = "CHECK_TIME", type = "datetime", notNull = false) + private Timestamp checkTime; // 49.印前审核时间 + @AnTableField(column = "CHECK_BACK_REASON", type = "string,1200", notNull = false) + private String checkBackReason; // 50.印前审核退回原因 + @AnTableField(column = "CHECK_BACK_PICTURE_URL", type = "string,500", notNull = false) + private String checkBackPictureUrl; // 51.印前审核退回图片请求虚拟路径 + @AnTableField(column = "PREPRESS_BACK_REASON", type = "string,400", notNull = false) + private String prepressBackReason; // 52.印前工厂排产退回原因 + @AnTableField(column = "CANCELER", type = "string,20", notNull = false) + private String canceler; // 53.取消人 + @AnTableField(column = "CANCEL_TIME", type = "datetime", notNull = false) + private Timestamp cancelTime; // 54.取消时间 + @AnTableField(column = "CANCEL_REASON", type = "string,60", notNull = false) + private String cancelReason; // 55.取消原因 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 56.创建时间 + @AnTableField(column = "MODIFY_TIME", type = "datetime", notNull = true) + private Timestamp modifyTime; // 57.修改时间 + @AnTableField(column = "RE_DESIGN_SRC_ID", type = "long", notNull = false) + private long reDesignSrcId; // 58.重新设计来源订单(值大于0该单则是补单) + @AnTableField(column = "RE_DESIGN_CREATE_NOTE", type = "string,300", notNull = false) + private String reDesignCreateNote; // 59.重新设计原因, (售后创建重印的原因) + @AnTableField(column = "COMPLAINT_REASON", type = "string,500", notNull = false) + private String complaintReason; // 60.非设计师导致退款申诉原因 + @AnTableField(column = "COMPLAINT_FLAG", type = "int", notNull = false) + private int complaintFlag; // 61.0表示未申诉,1表示申诉成功,2表示申诉失败,3表示申诉中 + @AnTableField(column = "COMPLAINT_BACK_REASON", type = "string,200", notNull = false) + private String complaintBackReason; // 62.申诉退回原因 + @AnTableField(column = "SERVICES_MESSAGE", type = "string,500", notNull = false) + private String servicesMessage; // 63.客服留言 + @AnTableField(column = "QC_TIME", type = "datetime", notNull = false) + private Timestamp qcTime; // 64.质检时间 + @AnTableField(column = "QC_FLAG", type = "int", notNull = false) + private int qcFlag; // 65.质检标志,0表示未质检,1表示质检正常,2表示质检违规 + @AnTableField(column = "IS_OLD_USER", type = "int", notNull = false) + private int isOldUser; // 66.是否为老用户 1=是 ,0=否 + @AnTableField(column = "DESIGN_COPIES", type = "int", notNull = false) + private int designCopies; // 67.设计费份数 + @AnTableField(column = "RECEIVER_NAME", type = "string,50", notNull = true) + private String receiverName; // 68.收货人的姓名 + @AnTableField(column = "RECEIVER_MOBILE", type = "string,40", notNull = false) + private String receiverMobile; // 69.收货人的手机号码 + @AnTableField(column = "RECEIVER_STATE", type = "string,20", notNull = false) + private String receiverState; // 70.收货人的所在省份 + @AnTableField(column = "RECEIVER_CITY", type = "string,20", notNull = false) + private String receiverCity; // 71.收货人的所在城市 + @AnTableField(column = "RECEIVER_DISTRICT", type = "string,20", notNull = false) + private String receiverDistrict; // 72.收货人的所在区县 + @AnTableField(column = "RECEIVER_ADDRESS", type = "string,100", notNull = false) + private String receiverAddress; // 73.收货人的详细地址 + @AnTableField(column = "TYPESET_AUDITOR", type = "string,20", notNull = false) + private String typeSetAuditor; // 74.排版审核人 + @AnTableField(column = "GOTO_TYPESET_TIME", type = "datetime", notNull = false) + private Timestamp gotoTypeSetTime; // 75.提交选版时间 + @AnTableField(column = "SUBMIT_TYPESET_TIME", type = "datetime", notNull = false) + private Timestamp submitTypeSetTime; // 76.提交排版时间 + @AnTableField(column = "EXPRESS_CODE", type = "string,20", notNull = false) + private String expressCode; // 77.物流code + @AnTableField(column = "ORDER_SRC", type = "int", notNull = false) + private int orderSrc; // 78.订单来源,0:原订单,1:售后补单,2:售后赠单,3:微商单 + @AnTableField(column = "CREATER", type = "string,20", notNull = false) + private String creater; // 79.录单员 + @AnTableField(column = "TIDS", type = "string,200", notNull = false) + private String tids; // 80.淘宝单号,多个逗号分隔 + @AnTableField(column = "IS_ONLY_DESIGN", type = "boolean", notNull = true) + private boolean isOnlyDesign; // 81.是否仅设计,0印刷设计,1仅设计 + @AnTableField(column = "IS_TIME_OUT_REMIND", type = "boolean", notNull = true) + private boolean isTimeOutRemind; // 82.是否订单超时提醒 + @AnTableField(column = "SHOW_RED_MARK", type = "int", notNull = false) + private int showRedMark; // 83.淘宝申请退款时显示红色感叹号[0-不显示,1-显示] + @AnTableField(column = "IS_HIGH_QUALITY_ORDER", type = "boolean", notNull = false) + private boolean isHighQualityOrder; // 84.是否优质订单 + @AnTableField(column = "DESIGN_PRICE", type = "long", notNull = false) + private long designPrice; // 85.设计师佣金 + @AnTableField(column = "FILE_FAIL_MSG", type = "string,200", notNull = false) + private String fileFailMsg; // 86.文件错误原因 + @AnTableField(column = "RETURN_MSG", type = "string,200", notNull = false) + private String returnMsg; // 86.退货信息 + @AnTableField(column = "RETURN_MSG_TIME", type = "datetime", notNull = false) + private Timestamp returnMsgTime; // 88.退货信息时间 + @AnTableField(column = "RETURN_AFTER_STATUS", type = "int", notNull = true) + private int returnAfterStatus; // 4.订单状态 + @AnTableField(column = "IS_CHANGE", type = "boolean", notNull = true) + private boolean isChange; // 4.是否改稿 + @AnTableField(column = "IS_BACK", type = "boolean", notNull = true) + private boolean isBack; // 4.是否退回 + @AnTableField(column = "BACK_REASON", type = "string,250", notNull = true) + private String returnReason; + @AnTableField(column = "TID", type = "string,200", notNull = false) + private String tid; // 80.淘宝单号,多个逗号分隔 + @Override + public String toString() { + return Jsons.toString(this); + } + + public String getTid() { + return tid; + } + + public void setTid(String tid) { + this.tid = tid; + } + + public long getDesignId() { + return designId; + } + + public void setDesignId(long designId) { + this.designId = designId; + } + + public long getMerchantId() { + return merchantId; + } + + public void setMerchantId(long merchantId) { + this.merchantId = merchantId; + } + + public String getOutId() { + return outId; + } + + public void setOutId(String outId) { + this.outId = outId; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getOrderText() { + return orderText; + } + + public void setOrderText(String orderText) { + this.orderText = orderText; + } + + public long getAmount() { + return amount; + } + + public void setAmount(long amount) { + this.amount = amount; + } + + public long getTypeId() { + return typeId; + } + + public void setTypeId(long typeId) { + this.typeId = typeId; + } + + public long getIndustryId() { + return industryId; + } + + public void setIndustryId(long industryId) { + this.industryId = industryId; + } + + public int getDraftType() { + return draftType; + } + + public void setDraftType(int draftType) { + this.draftType = draftType; + } + + public boolean isUrgent() { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) { + this.isUrgent = isUrgent; + } + + public int getDesignPage() { + return designPage; + } + + public void setDesignPage(int designPage) { + this.designPage = designPage; + } + + public double getDesignWidth() { + return designWidth; + } + + public void setDesignWidth(double designWidth) { + this.designWidth = designWidth; + } + + public double getDesignHeight() { + return designHeight; + } + + public void setDesignHeight(double designHeight) { + this.designHeight = designHeight; + } + + public double getPrintWidth() { + return printWidth; + } + + public void setPrintWidth(double printWidth) { + this.printWidth = printWidth; + } + + public double getPrintHeight() { + return printHeight; + } + + public void setPrintHeight(double printHeight) { + this.printHeight = printHeight; + } + + public int getPrintKs() { + return printKs; + } + + public void setPrintKs(int printKs) { + this.printKs = printKs; + } + + public int getPrintMs() { + return printMs; + } + + public void setPrintMs(int printMs) { + this.printMs = printMs; + } + + public String getUserContact() { + return userContact; + } + + public void setUserContact(String userContact) { + this.userContact = userContact; + } + + public String getUserMobile() { + return userMobile; + } + + public void setUserMobile(String userMobile) { + this.userMobile = userMobile; + } + + public String getAfterNames() { + return afterNames; + } + + public void setAfterNames(String afterNames) { + this.afterNames = afterNames; + } + + public String getPrintSpecial() { + return printSpecial; + } + + public void setPrintSpecial(String printSpecial) { + this.printSpecial = printSpecial; + } + + public String getBuyerNick() { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) { + this.buyerNick = buyerNick; + } + + public String getUserText() { + return userText; + } + + public void setUserText(String userText) { + this.userText = userText; + } + + public String getUserNotice() { + return userNotice; + } + + public void setUserNotice(String userNotice) { + this.userNotice = userNotice; + } + + public String getUserQq() { + return userQq; + } + + public void setUserQq(String userQq) { + this.userQq = userQq; + } + + public String getUserWx() { + return userWx; + } + + public void setUserWx(String userWx) { + this.userWx = userWx; + } + + public String getUserTextReplace() { + return userTextReplace; + } + + public void setUserTextReplace(String userTextReplace) { + this.userTextReplace = userTextReplace; + } + + public int getReminderNum() { + return reminderNum; + } + + public void setReminderNum(int reminderNum) { + this.reminderNum = reminderNum; + } + + public String getShopNick() { + return shopNick; + } + + public void setShopNick(String shopNick) { + this.shopNick = shopNick; + } + + public long getOrgId() { + return orgId; + } + + public void setOrgId(long orgId) { + this.orgId = orgId; + } + + public Timestamp getOrgReceiveTime() { + return orgReceiveTime; + } + + public void setOrgReceiveTime(Timestamp orgReceiveTime) { + this.orgReceiveTime = orgReceiveTime; + } + + public int getReceiveType() { + return receiveType; + } + + public void setReceiveType(int receiveType) { + this.receiveType = receiveType; + } + + public int getOrderFlag() { + return orderFlag; + } + + public void setOrderFlag(int orderFlag) { + this.orderFlag = orderFlag; + } + + public String getDesigner() { + return designer; + } + + public void setDesigner(String designer) { + this.designer = designer; + } + + public Timestamp getDesignReceiveTime() { + return designReceiveTime; + } + + public void setDesignReceiveTime(Timestamp designReceiveTime) { + this.designReceiveTime = designReceiveTime; + } + + public Timestamp getDesignBeginTime() { + return designBeginTime; + } + + public void setDesignBeginTime(Timestamp designBeginTime) { + this.designBeginTime = designBeginTime; + } + + public Timestamp getDesignDraftTime() { + return designDraftTime; + } + + public void setDesignDraftTime(Timestamp designDraftTime) { + this.designDraftTime = designDraftTime; + } + + public Timestamp getDesignEndTime() { + return designEndTime; + } + + public void setDesignEndTime(Timestamp designEndTime) { + this.designEndTime = designEndTime; + } + + public String getDesignPauseReason() { + return designPauseReason; + } + + public void setDesignPauseReason(String designPauseReason) { + this.designPauseReason = designPauseReason; + } + + public Timestamp getDesignPauseTime() { + return designPauseTime; + } + + public void setDesignPauseTime(Timestamp designPauseTime) { + this.designPauseTime = designPauseTime; + } + + public String getDesignExclude() { + return designExclude; + } + + public void setDesignExclude(String designExclude) { + this.designExclude = designExclude; + } + + public String getDesignRequestReason() { + return designRequestReason; + } + + public void setDesignRequestReason(String designRequestReason) { + this.designRequestReason = designRequestReason; + } + + public Timestamp getRequestTime() { + return requestTime; + } + + public void setRequestTime(Timestamp requestTime) { + this.requestTime = requestTime; + } + + public String getDesignRejectReason() { + return designRejectReason; + } + + public void setDesignRejectReason(String designRejectReason) { + this.designRejectReason = designRejectReason; + } + + public int getDesignKeepDuration() { + return designKeepDuration; + } + + public void setDesignKeepDuration(int designKeepDuration) { + this.designKeepDuration = designKeepDuration; + } + + public String getRequestRefoundAcceptReason() { + return requestRefoundAcceptReason; + } + + public void setRequestRefoundAcceptReason(String requestRefoundAcceptReason) { + this.requestRefoundAcceptReason = requestRefoundAcceptReason; + } + + public String getRefundTime() { + return refundTime; + } + + public void setRefundTime(String refundTime) { + this.refundTime = refundTime; + } + + public String getChecker() { + return checker; + } + + public void setChecker(String checker) { + this.checker = checker; + } + + public Timestamp getCheckTime() { + return checkTime; + } + + public void setCheckTime(Timestamp checkTime) { + this.checkTime = checkTime; + } + + public String getCheckBackReason() { + return checkBackReason; + } + + public void setCheckBackReason(String checkBackReason) { + this.checkBackReason = checkBackReason; + } + + public String getCheckBackPictureUrl() { + return checkBackPictureUrl; + } + + public void setCheckBackPictureUrl(String checkBackPictureUrl) { + this.checkBackPictureUrl = checkBackPictureUrl; + } + + public String getPrepressBackReason() { + return prepressBackReason; + } + + public void setPrepressBackReason(String prepressBackReason) { + this.prepressBackReason = prepressBackReason; + } + + public String getCanceler() { + return canceler; + } + + public void setCanceler(String canceler) { + this.canceler = canceler; + } + + public Timestamp getCancelTime() { + return cancelTime; + } + + public void setCancelTime(Timestamp cancelTime) { + this.cancelTime = cancelTime; + } + + public String getCancelReason() { + return cancelReason; + } + + public void setCancelReason(String cancelReason) { + this.cancelReason = cancelReason; + } + + public Timestamp getCreateTime() { + return createTime; + } + + public void setCreateTime(Timestamp createTime) { + this.createTime = createTime; + } + + public Timestamp getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) { + this.modifyTime = modifyTime; + } + + public long getReDesignSrcId() { + return reDesignSrcId; + } + + public void setReDesignSrcId(long reDesignSrcId) { + this.reDesignSrcId = reDesignSrcId; + } + + public String getReDesignCreateNote() { + return reDesignCreateNote; + } + + public void setReDesignCreateNote(String reDesignCreateNote) { + this.reDesignCreateNote = reDesignCreateNote; + } + + public String getComplaintReason() { + return complaintReason; + } + + public void setComplaintReason(String complaintReason) { + this.complaintReason = complaintReason; + } + + public int getComplaintFlag() { + return complaintFlag; + } + + public void setComplaintFlag(int complaintFlag) { + this.complaintFlag = complaintFlag; + } + + public String getComplaintBackReason() { + return complaintBackReason; + } + + public void setComplaintBackReason(String complaintBackReason) { + this.complaintBackReason = complaintBackReason; + } + + public String getServicesMessage() { + return servicesMessage; + } + + public void setServicesMessage(String servicesMessage) { + this.servicesMessage = servicesMessage; + } + + public Timestamp getQcTime() { + return qcTime; + } + + public void setQcTime(Timestamp qcTime) { + this.qcTime = qcTime; + } + + public int getQcFlag() { + return qcFlag; + } + + public void setQcFlag(int qcFlag) { + this.qcFlag = qcFlag; + } + + public int getIsOldUser() { + return isOldUser; + } + + public void setIsOldUser(int isOldUser) { + this.isOldUser = isOldUser; + } + + public int getDesignCopies() { + return designCopies; + } + + public void setDesignCopies(int designCopies) { + this.designCopies = designCopies; + } + + public String getReceiverName() { + return receiverName; + } + + public void setReceiverName(String receiverName) { + this.receiverName = receiverName; + } + + public String getReceiverMobile() { + return receiverMobile; + } + + public void setReceiverMobile(String receiverMobile) { + this.receiverMobile = receiverMobile; + } + + public String getReceiverState() { + return receiverState; + } + + public void setReceiverState(String receiverState) { + this.receiverState = receiverState; + } + + public String getReceiverCity() { + return receiverCity; + } + + public void setReceiverCity(String receiverCity) { + this.receiverCity = receiverCity; + } + + public String getReceiverDistrict() { + return receiverDistrict; + } + + public void setReceiverDistrict(String receiverDistrict) { + this.receiverDistrict = receiverDistrict; + } + + public String getReceiverAddress() { + return receiverAddress; + } + + public void setReceiverAddress(String receiverAddress) { + this.receiverAddress = receiverAddress; + } + + public String getTypeSetAuditor() { + return typeSetAuditor; + } + + public void setTypeSetAuditor(String typeSetAuditor) { + this.typeSetAuditor = typeSetAuditor; + } + + public Timestamp getGotoTypeSetTime() { + return gotoTypeSetTime; + } + + public void setGotoTypeSetTime(Timestamp gotoTypeSetTime) { + this.gotoTypeSetTime = gotoTypeSetTime; + } + + public Timestamp getSubmitTypeSetTime() { + return submitTypeSetTime; + } + + public void setSubmitTypeSetTime(Timestamp submitTypeSetTime) { + this.submitTypeSetTime = submitTypeSetTime; + } + + public String getExpressCode() { + return expressCode; + } + + public void setExpressCode(String expressCode) { + this.expressCode = expressCode; + } + + public int getOrderSrc() { + return orderSrc; + } + + public void setOrderSrc(int orderSrc) { + this.orderSrc = orderSrc; + } + + public String getCreater() { + return creater; + } + + public void setCreater(String creater) { + this.creater = creater; + } + + public String getTids() { + return tids; + } + + public void setTids(String tids) { + this.tids = tids; + } + + public boolean isOnlyDesign() { + return isOnlyDesign; + } + + public void setOnlyDesign(boolean isOnlyDesign) { + this.isOnlyDesign = isOnlyDesign; + } + + public boolean isTimeOutRemind() { + return isTimeOutRemind; + } + + public void setTimeOutRemind(boolean isTimeOutRemind) { + this.isTimeOutRemind = isTimeOutRemind; + } + + public int getShowRedMark() { + return showRedMark; + } + + public void setShowRedMark(int showRedMark) { + this.showRedMark = showRedMark; + } + + public boolean isHighQualityOrder() { + return isHighQualityOrder; + } + + public void setHighQualityOrder(boolean isHighQualityOrder) { + this.isHighQualityOrder = isHighQualityOrder; + } + + public long getDesignPrice() { + return designPrice; + } + + public void setDesignPrice(long designPrice) { + this.designPrice = designPrice; + } + + public String getFileFailMsg() { + return fileFailMsg; + } + + public void setFileFailMsg(String fileFailMsg) { + this.fileFailMsg = fileFailMsg; + } + + public String getReturnMsg() { + return returnMsg; + } + + public void setReturnMsg(String returnMsg) { + this.returnMsg = returnMsg; + } + + public Timestamp getReturnMsgTime() { + return returnMsgTime; + } + + public void setReturnMsgTime(Timestamp returnMsgTime) { + this.returnMsgTime = returnMsgTime; + } + + public int getReturnAfterStatus() { + return returnAfterStatus; + } + + public void setReturnAfterStatus(int returnAfterStatus) { + this.returnAfterStatus = returnAfterStatus; + } + + public boolean isChange() { + return isChange; + } + + public void setChange(boolean isChange) { + this.isChange = isChange; + } + + public boolean isBack() { + return isBack; + } + + public void setBack(boolean isBack) { + this.isBack = isBack; + } + + public String getReturnReason() { + return returnReason; + } + + public void setReturnReason(String returnReason) { + this.returnReason = returnReason; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrderMerits.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrderMerits.java new file mode 100644 index 0000000..eb4d3aa --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrderMerits.java @@ -0,0 +1,157 @@ +package com.zhiqim.yangcai.design.dbo.order; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 订单修改绩效表 对应表《DESIGN_ORDER_MERITS》 + */ +@AnAlias("DesignOrderMerits") +@AnNew +@AnTable(table = "DESIGN_ORDER_MERITS", key = "MERITS_ID", type = "InnoDB") +public class DesignOrderMerits implements Serializable { + + private static final long serialVersionUID = 1L; + + @AnTableField(column = "MERITS_ID", type = "long", notNull = true) + private long meritsId; // 1.修改绩效编号 + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 2.订单编号 + @AnTableField(column = "TYPE", type = "string,32", notNull = true) + private String type; // 3.修改绩效类型 + @AnTableField(column = "OLD_DATA", type = "string,512", notNull = true) + private String oldData; // 4.老数据 + @AnTableField(column = "NEW_DATA", type = "string,512", notNull = false) + private String newData; // 5.新数据 + @AnTableField(column = "ADD_TIME", type = "datetime", notNull = true) + private Timestamp addTime; // 6.创建时间 + @AnTableField(column = "ADD_USER", type = "string,128", notNull = false) + private String addUser; // 7.添加者 + @AnTableField(column = "DESIGNER", type = "string,128", notNull = false) + private String designer; // 8.设计师 + @AnTableField(column = "TYPE_ID", type = "long", notNull = true) + private long typeId; // 7.设计类型,名片、彩页、等等 + @AnTableField(column = "STATUS", type = "int", notNull = true) + private int status; // 4.订单状态 + @AnTableField(column = "ORDER_TEXT", type = "string,200", notNull = true) + private String orderText; // 5.订单描述 + @AnTableField(column = "OLD_PRICE", type = "long", notNull = false) + private long oldPrice; // 85.设计师佣金 + @AnTableField(column = "NEW_PRICE", type = "long", notNull = false) + private long newPrice; // 85.设计师佣金 + + @Override + public String toString() { + return Jsons.toString(this); + } + + public long getMeritsId() { + return meritsId; + } + + public void setMeritsId(long meritsId) { + this.meritsId = meritsId; + } + + public long getDesignId() { + return designId; + } + + public void setDesignId(long designId) { + this.designId = designId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getOldData() { + return oldData; + } + + public void setOldData(String oldData) { + this.oldData = oldData; + } + + public String getNewData() { + return newData; + } + + public void setNewData(String newData) { + this.newData = newData; + } + + public Timestamp getAddTime() { + return addTime; + } + + public void setAddTime(Timestamp addTime) { + this.addTime = addTime; + } + + public String getAddUser() { + return addUser; + } + + public void setAddUser(String addUser) { + this.addUser = addUser; + } + + public String getDesigner() { + return designer; + } + + public void setDesigner(String designer) { + this.designer = designer; + } + + public long getTypeId() { + return typeId; + } + + public void setTypeId(long typeId) { + this.typeId = typeId; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getOrderText() { + return orderText; + } + + public void setOrderText(String orderText) { + this.orderText = orderText; + } + + public long getOldPrice() { + return oldPrice; + } + + public void setOldPrice(long oldPrice) { + this.oldPrice = oldPrice; + } + + public long getNewPrice() { + return newPrice; + } + + public void setNewPrice(long newPrice) { + this.newPrice = newPrice; + } +} \ No newline at end of file diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrderRefundReason.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrderRefundReason.java new file mode 100644 index 0000000..e16a7ea --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignOrderRefundReason.java @@ -0,0 +1,69 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.order; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 退款原因配置 对应表《design_order_refund_reason》 + */ +@AnAlias("DesignOrderRefundReason") +@AnNew +@AnTable(table = "design_order_refund_reason", key = "id", type = "InnoDB") +public class DesignOrderRefundReason implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "id", type = "long", notNull = true) + private long id; // 1.id + @AnTableField(column = "title", type = "string,100", notNull = true) + private String title; // 2.退款原因 + @AnTableField(column = "update_time", type = "datetime") + private Timestamp updateTime; // 3.修改时间 + + public long getId() + { + return id; + } + + public void setId(long id) + { + this.id = id; + } + + public String getTitle() + { + return title; + } + + public void setTitle(String title) + { + this.title = title; + } + + public Timestamp getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Timestamp updateTime) + { + this.updateTime = updateTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignSelfView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignSelfView.java new file mode 100644 index 0000000..e809757 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/DesignSelfView.java @@ -0,0 +1,198 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignSelfView.java + * 创建人 :gjx + * 创建时间:2019-11-5 + */ + +package com.zhiqim.yangcai.design.dbo.order; + +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTableField; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * 订单关联表 对应视图《Design_Self_View》 + * + * @version 1.0 @author gjx 2019-11-5 新建与整理 + */ + +@AnAlias("DesignSelfView") +@AnNew +@AnView("DESIGN_ORDER,SELF_ORDER") +@AnViewJoin({ + @AnViewJoinValue(type = "EQUAL", lTable = "SELF_ORDER", lColumn = "DESIGN_ID", rTable = "DESIGN_ORDER", rColumn = "DESIGN_ID")}) +public class DesignSelfView extends DesignOrder { + private static final long serialVersionUID = 1L; + + @AnViewField(table = "SELF_ORDER", column = "LABEL_IDS") + private String labelIds; // 1.标签id(逗号拼接) + @AnViewField(table = "SELF_ORDER", column = "CONSUMER_TYPE") + private int consumerType; // 2.客户类型 1:企业 2:渠道商 3:个体户 + @AnViewField(table = "SELF_ORDER", column = "DEFAULT_LABEL") + private boolean defaultLabel; // 3.是否选用了原订单行业标签 + @AnViewField(table = "SELF_ORDER", column = "KF_DRAFT_STANDARD") + private boolean kfDraftStandard; // 4.是否为客服负责的标准自来稿订单[0-否,1-是],默认为0 + @AnViewField(table = "SELF_ORDER", column = "CUSTOMER_QRCODE_URL") + private String customerQrcodeUrl; // 5.客户服务群二维码图片路径 + @AnViewField(table = "SELF_ORDER", column = "DESIGNER_REFUND_REASON") + private long refundReason; // 6.退款原因 + @AnViewField(table = "SELF_ORDER", column = "DRAFT_CHECKER") + private String draftChecker; // 7.初稿审核人 + @AnViewField(table = "SELF_ORDER", column = "DRAFT_BACK_REASON") + private String draftBackReason; // 8.初稿审核退回原因 + @AnViewField(table = "SELF_ORDER", column = "DRAFT_BACK_TIME") + private Timestamp draftBackTime; // 9.初稿审核退回时间 + @AnViewField(table = "SELF_ORDER", column = "END_CHECKER") + private String endChecker; // 10.定稿审核人 + @AnViewField(table = "SELF_ORDER", column = "END_BACK_REASON") + private String endBackReason; // 11.定稿审核退回原因 + @AnViewField(table = "SELF_ORDER", column = "END_BACK_TIME") + private Timestamp endBackTime; // 12.定稿审核退回时间 + @AnViewField(table = "SELF_ORDER", column = "DRAFT_BACK_REASON_PIC_URL") + private String draftBackReasonPicUrl; // 13.初稿审核退回原因截图 + @AnViewField(table = "SELF_ORDER", column = "END_BACK_REASON_PIC_URL") + private String endBackReasonPicUrl; // 14.定稿审核退回原因截图 + @AnViewField(table = "SELF_ORDER", column = "URGENT_PRICE") + private long urgentPrice; // 15.加急费 + @AnViewField(table = "SELF_ORDER", column = "design_cost") + private long designCost; // 16.设计费用(业务端收取费用) + public String getLabelIds() { + return labelIds; + } + + public void setLabelIds(String labelIds) { + this.labelIds = labelIds; + } + + public int getConsumerType() { + return consumerType; + } + + public void setConsumerType(int consumerType) { + this.consumerType = consumerType; + } + + public boolean isDefaultLabel() { + return defaultLabel; + } + + public void setDefaultLabel(boolean defaultLabel) { + this.defaultLabel = defaultLabel; + } + + public boolean isKfDraftStandard() { + return kfDraftStandard; + } + + public void setKfDraftStandard(boolean kfDraftStandard) { + this.kfDraftStandard = kfDraftStandard; + } + + public String getCustomerQrcodeUrl() { + return customerQrcodeUrl; + } + + public void setCustomerQrcodeUrl(String customerQrcodeUrl) { + this.customerQrcodeUrl = customerQrcodeUrl; + } + + public long getRefundReason() { + return refundReason; + } + + public void setRefundReason(long refundReason) { + this.refundReason = refundReason; + } + + public String getDraftChecker() { + return draftChecker; + } + + public void setDraftChecker(String draftChecker) { + this.draftChecker = draftChecker; + } + + public String getDraftBackReason() { + return draftBackReason; + } + + public void setDraftBackReason(String draftBackReason) { + this.draftBackReason = draftBackReason; + } + + public Timestamp getDraftBackTime() { + return draftBackTime; + } + + public void setDraftBackTime(Timestamp draftBackTime) { + this.draftBackTime = draftBackTime; + } + + public String getEndChecker() { + return endChecker; + } + + public void setEndChecker(String endChecker) { + this.endChecker = endChecker; + } + + public String getEndBackReason() { + return endBackReason; + } + + public void setEndBackReason(String endBackReason) { + this.endBackReason = endBackReason; + } + + public Timestamp getEndBackTime() { + return endBackTime; + } + + public void setEndBackTime(Timestamp endBackTime) { + this.endBackTime = endBackTime; + } + + public String getDraftBackReasonPicUrl() { + return draftBackReasonPicUrl; + } + + public void setDraftBackReasonPicUrl(String draftBackReasonPicUrl) { + this.draftBackReasonPicUrl = draftBackReasonPicUrl; + } + + public String getEndBackReasonPicUrl() { + return endBackReasonPicUrl; + } + + public void setEndBackReasonPicUrl(String endBackReasonPicUrl) { + this.endBackReasonPicUrl = endBackReasonPicUrl; + } + + public long getUrgentPrice() { + return urgentPrice; + } + + public void setUrgentPrice(long urgentPrice) { + this.urgentPrice = urgentPrice; + } + + public long getDesignCost() { + return designCost; + } + + public void setDesignCost(long designCost) { + this.designCost = designCost; + } + + + + + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrdOprLog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrdOprLog.java new file mode 100644 index 0000000..9590ef9 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrdOprLog.java @@ -0,0 +1,125 @@ +package com.zhiqim.yangcai.design.dbo.order; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 订单操作日志表 对应表《ORD_OPR_LOG》 + */ +@AnAlias("OrdOprLog") +@AnNew +@AnTable(table = "ORD_OPR_LOG", key = "LOG_ID", type = "InnoDB") +public class OrdOprLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "LOG_ID", type = "long", notNull = true) + private long logId; // 1.日志编号 + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 2.订单编号 + @AnTableField(column = "STATUS", type = "int", notNull = true) + private int status; // 3.订单状态 + @AnTableField(column = "OPERATOR_CODE", type = "string,64", notNull = true) + private String operatorCode; // 4.操作员信息 + @AnTableField(column = "OPERATE_DESC", type = "string,2048", notNull = false) + private String operateDesc; // 5.操作描述 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 6.创建时间 + @AnTableField(column = "EVENT_TYPE", type = "int", notNull = false) + private int eventType; // 7.事件类型 + @AnTableField(column = "DESIGNER", type = "string,64", notNull = false) + private String designer; // 8.设计师 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getLogId() + { + return logId; + } + + public void setLogId(long logId) + { + this.logId = logId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public String getOperateDesc() + { + return operateDesc; + } + + public void setOperateDesc(String operateDesc) + { + this.operateDesc = operateDesc; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public int getEventType() + { + return eventType; + } + + public void setEventType(int eventType) + { + this.eventType = eventType; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrdProgressNote.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrdProgressNote.java new file mode 100644 index 0000000..fc2cdb0 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrdProgressNote.java @@ -0,0 +1,82 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.order; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 订单进度备注表 对应表《ORD_PROGRESS_NOTE》 + */ +@AnAlias("OrdProgressNote") +@AnNew +@AnTable(table="ORD_PROGRESS_NOTE", key="", type="InnoDB") +public class OrdProgressNote implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="DESIGN_ID", type="long", notNull=false) private long designId; //1.订单号 + @AnTableField(column="ORD_PROGRESS_NOTE", type="string,300", notNull=true) private String ordProgressNote; //2.备注内容 + @AnTableField(column="OPERATE_CODE", type="string,32", notNull=true) private String operateCode; //3.备注人 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //4.备注时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getOrdProgressNote() + { + return ordProgressNote; + } + + public void setOrdProgressNote(String ordProgressNote) + { + this.ordProgressNote = ordProgressNote; + } + + public String getOperateCode() + { + return operateCode; + } + + public void setOperateCode(String operateCode) + { + this.operateCode = operateCode; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrderBacklog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrderBacklog.java new file mode 100644 index 0000000..3476623 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrderBacklog.java @@ -0,0 +1,187 @@ +/** + * 扬彩印刷设计 + * 文件名 :OrderReminder.java + * 创建人 :gjx + * 创建时间:2020年8月13日 +*/ +package com.zhiqim.yangcai.design.dbo.order; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * + * [简要描述]: 订单消息表
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年8月14日 新建与整理 + */ +@AnAlias("OrderBacklog") +@AnNew +@AnTable(table = "ORDER_BACKLOG", key = "ID", type = "InnoDB") +public class OrderBacklog implements Serializable +{ + private static final long serialVersionUID = 1L; + @AnTableField(column = "ID", type = "long", notNull = true) + private long id;// 业务主键 + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 订单号 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime;// 创建时间 + @AnTableField(column = "MESSAGE_TYPE", type = "int", notNull = true) + private int messageType;// 消息类型(0:催稿,1:订单审核、排产退回) + @AnTableField(column = "PRODUCTION_CODE", type = "string,64", notNull = true) + private String productionCode;// 跟单操作员 + @AnTableField(column = "PRODUCTION_TIME", type = "datetime", notNull = true) + private Timestamp productionTime;// 生产时间 + @AnTableField(column = "MESSAGE_BODY", type = "string,200", notNull = true) + private String messageBody;// 消息内容 + @AnTableField(column = "CONSUMER_CODE_TYPE", type = "int", notNull = true) + private int consumerCodeType;// 1: 已发送 2:已处理 + @AnTableField(column = "CONSUMER_CODE", type = "string,64", notNull = true) + private String consumerCode;// 处理人 + @AnTableField(column = "CONSUMER_STATE", type = "int", notNull = true) + private int consumerState;// 订单状态 + @AnTableField(column = "CONSUMER_TIME", type = "datetime", notNull = false) + private Timestamp consumerTime;// 处理时间 + @AnTableField(column = "REMARK", type = "string,400", notNull = false) + private String remark;// 备注 + + public String tosString() + { + return Jsons.toString(this); + } + + public long getId() + { + return id; + } + + public void setId(long id) + { + this.id = id; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public int getMessageType() + { + return messageType; + } + + public void setMessageType(int messageType) + { + this.messageType = messageType; + } + + + + public String getProductionCode() + { + return productionCode; + } + + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public Timestamp getProductionTime() + { + return productionTime; + } + + public void setProductionTime(Timestamp productionTime) + { + this.productionTime = productionTime; + } + + public String getMessageBody() + { + return messageBody; + } + + public void setMessageBody(String messageBody) + { + this.messageBody = messageBody; + } + + public int getConsumerCodeType() + { + return consumerCodeType; + } + + public void setConsumerCodeType(int consumerCodeType) + { + this.consumerCodeType = consumerCodeType; + } + + + + public String getConsumerCode() + { + return consumerCode; + } + + public void setConsumerCode(String consumerCode) + { + this.consumerCode = consumerCode; + } + + public int getConsumerState() + { + return consumerState; + } + + public void setConsumerState(int consumerState) + { + this.consumerState = consumerState; + } + + public Timestamp getConsumerTime() + { + return consumerTime; + } + + public void setConsumerTime(Timestamp consumerTime) + { + this.consumerTime = consumerTime; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrderMessage.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrderMessage.java new file mode 100644 index 0000000..a11db01 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrderMessage.java @@ -0,0 +1,217 @@ +/** + * 扬彩印刷设计 + * 文件名 :OrderReminder.java + * 创建人 :gjx + * 创建时间:2020年8月13日 +*/ +package com.zhiqim.yangcai.design.dbo.order; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * + * [简要描述]: 订单消息表
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年8月14日 新建与整理 + */ +@AnAlias("OrderMessage") +@AnNew +@AnTable(table = "ORDER_MESSAGE", key = "ID", type = "InnoDB") +public class OrderMessage implements Serializable +{ + private static final long serialVersionUID = 1L; + @AnTableField(column = "ID", type = "long", notNull = true) + private long id;// 业务主键 + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 订单号 + @AnTableField(column = "BUYER_NICK", type = "string,64", notNull = true) + private String buyerNick; // 旺旺号 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime;// 创建时间 + @AnTableField(column = "MESSAGE_TYPE", type = "int", notNull = true) + private int messageType;// 消息类型(0:催稿,1:订单审核、排产退回) + @AnTableField(column = "TOPIC", type = "string,50", notNull = true) + private String topic;// 主题,(催稿大类,orderReminder:订单催稿/定稿,changeDesigner:更换/指定设计师/订单加急) + @AnTableField(column = "PRODUCTION_CODE", type = "string,64", notNull = true) + private String productionCode;// 生产者code + @AnTableField(column = "PRODUCTION_TIME", type = "datetime", notNull = true) + private Timestamp productionTime;// 生产时间 + @AnTableField(column = "MESSAGE_BODY", type = "string,200", notNull = true) + private String messageBody;// 消息内容 + @AnTableField(column = "CONSUMER_CODE_TYPE", type = "int", notNull = true) + private int consumerCodeType;// 消费者类型(0:操作员 1:协调人)。默认为0 + @AnTableField(column = "CONSUMER_PLATFORM_TYPE", type = "string,20", notNull = true) + private String consumerPlatformType;// 消费平台:ERP,TYT,DESIGN,CONSIGNMENT,XCX,TBERP + @AnTableField(column = "CONSUMER_CODE", type = "string,64", notNull = true) + private String consumerCode;// 消费者code + @AnTableField(column = "CONSUMER_STATE", type = "int", notNull = true) + private int consumerState;// 消费状态,0:未消费,1:已消费 + @AnTableField(column = "CONSUMER_TIME", type = "datetime", notNull = false) + private Timestamp consumerTime;// 消费时间 + @AnTableField(column = "REMARK", type = "string,400", notNull = false) + private String remark;// 备注 + + public String tosString() + { + return Jsons.toString(this); + } + + public long getId() + { + return id; + } + + public void setId(long id) + { + this.id = id; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public int getMessageType() + { + return messageType; + } + + public void setMessageType(int messageType) + { + this.messageType = messageType; + } + + public String getTopic() + { + return topic; + } + + public void setTopic(String topic) + { + this.topic = topic; + } + + public String getProductionCode() + { + return productionCode; + } + + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public Timestamp getProductionTime() + { + return productionTime; + } + + public void setProductionTime(Timestamp productionTime) + { + this.productionTime = productionTime; + } + + public String getMessageBody() + { + return messageBody; + } + + public void setMessageBody(String messageBody) + { + this.messageBody = messageBody; + } + + public int getConsumerCodeType() + { + return consumerCodeType; + } + + public void setConsumerCodeType(int consumerCodeType) + { + this.consumerCodeType = consumerCodeType; + } + + public String getConsumerPlatformType() + { + return consumerPlatformType; + } + + public void setConsumerPlatformType(String consumerPlatformType) + { + this.consumerPlatformType = consumerPlatformType; + } + + public String getConsumerCode() + { + return consumerCode; + } + + public void setConsumerCode(String consumerCode) + { + this.consumerCode = consumerCode; + } + + public int getConsumerState() + { + return consumerState; + } + + public void setConsumerState(int consumerState) + { + this.consumerState = consumerState; + } + + public Timestamp getConsumerTime() + { + return consumerTime; + } + + public void setConsumerTime(Timestamp consumerTime) + { + this.consumerTime = consumerTime; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrderQuestions.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrderQuestions.java new file mode 100644 index 0000000..e9678b9 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/OrderQuestions.java @@ -0,0 +1,125 @@ +package com.zhiqim.yangcai.design.dbo.order; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师考试订单 对应表《ORDER_QUESTIONS》 + */ +@AnAlias("OrderQuestions") +@AnNew +@AnTable(table = "order_questions", key = "QUESTIONS_ID", type = "InnoDB") +public class OrderQuestions implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "QUESTIONS_ID", type = "long", notNull = true) + private long questionsId; // 1.考试订单编号 + @AnTableField(column = "DESIGN_REQUIREMENTS", type = "string,400", notNull = true) + private String designRequirements; // 2.设计要求 + @AnTableField(column = "STATUS", type = "int", notNull = true) + private int status; // 3.考试订单状态:0 理论考试 10 未提交 20 等待审核 30 审核通过 40 审核拒绝 + @AnTableField(column = "DESIGNER", type = "string,20", notNull = true) + private String designer; // 4.设计师 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 5.创建时间 + @AnTableField(column = "DESIGN_END_TIME", type = "datetime", notNull = false) + private Timestamp designEndTime; // 6.设计师定稿时间 + @AnTableField(column = "REMARKS", type = "string,200", notNull = false) + private String remarks; // 7.备注 + @AnTableField(column = "MOBILE", type = "string,15", notNull = false) + private String mobile; // 8.手机号 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getQuestionsId() + { + return questionsId; + } + + public void setQuestionsId(long questionsId) + { + this.questionsId = questionsId; + } + + public String getDesignRequirements() + { + return designRequirements; + } + + public void setDesignRequirements(String designRequirements) + { + this.designRequirements = designRequirements; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getDesignEndTime() + { + return designEndTime; + } + + public void setDesignEndTime(Timestamp designEndTime) + { + this.designEndTime = designEndTime; + } + + public String getRemarks() + { + return remarks; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getMobile() + { + return mobile; + } + + public void setMobile(String mobile) + { + this.mobile = mobile; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/QuestionsAtta.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/QuestionsAtta.java new file mode 100644 index 0000000..4fc5d80 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/QuestionsAtta.java @@ -0,0 +1,162 @@ +package com.zhiqim.yangcai.design.dbo.order; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 考试订单附件表 对应表《QUESTIONS_ATTA》 + */ +@AnAlias("QuestionsAtta") +@AnNew +@AnTable(table = "questions_atta", key = "ATTA_ID", type = "InnoDB") +public class QuestionsAtta implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "ATTA_ID", type = "long", notNull = true) + private long attaId; // 1.订单附件编号 + @AnTableField(column = "QUESTIONS_ID", type = "long", notNull = true) + private long questionsId; // 2.考试订单编号 + @AnTableField(column = "ATTA_MODUL", type = "string,20", notNull = true) + private String attaModul; // 3.附件标识:MaterialFile 素材文件,DesginFile 设计文件,EndFile 印刷文件,ExamVoucher + // 考试凭证 + @AnTableField(column = "FILE_NAME", type = "string,200", notNull = true) + private String fileName; // 4.文件名 + @AnTableField(column = "FILE_TYPE", type = "string,10", notNull = true) + private String fileType; // 5.文件类型。.pdf、.cdr、.jpg + @AnTableField(column = "SAVE_PATH", type = "string,200", notNull = false) + private String savePath; // 6.文件存储路径 + @AnTableField(column = "FILE_URL", type = "string,400", notNull = false) + private String fileUrl; // 7.访问地址 + @AnTableField(column = "FILE_SIZE", type = "long", notNull = true) + private long fileSize; // 8.文件大小 字节 + @AnTableField(column = "OPERATOR_CODE", type = "string,64", notNull = false) + private String operatorCode; // 9.上传人 + @AnTableField(column = "UPLOAD_TIME", type = "datetime", notNull = true) + private Timestamp uploadTime; // 10.上传时间 + @AnTableField(column = "FILEID", type = "string,64", notNull = false) + private String fileid; // 11.文件Hash值 + + public long getAttaId() + { + return attaId; + } + + public void setAttaId(long attaId) + { + this.attaId = attaId; + } + + public long getQuestionsId() + { + return questionsId; + } + + public void setQuestionsId(long questionsId) + { + this.questionsId = questionsId; + } + + public String getAttaModul() + { + return attaModul; + } + + public void setAttaModul(String attaModul) + { + this.attaModul = attaModul; + } + + public String getFileName() + { + return fileName; + } + + public void setFileName(String fileName) + { + this.fileName = fileName; + } + + public String getFileType() + { + return fileType; + } + + public void setFileType(String fileType) + { + this.fileType = fileType; + } + + public String getSavePath() + { + return savePath; + } + + public void setSavePath(String savePath) + { + this.savePath = savePath; + } + + public String getFileUrl() + { + return fileUrl; + } + + public void setFileUrl(String fileUrl) + { + this.fileUrl = fileUrl; + } + + public long getFileSize() + { + return fileSize; + } + + public void setFileSize(long fileSize) + { + this.fileSize = fileSize; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public Timestamp getUploadTime() + { + return uploadTime; + } + + public void setUploadTime(Timestamp uploadTime) + { + this.uploadTime = uploadTime; + } + + public String getFileid() + { + return fileid; + } + + public void setFileid(String fileid) + { + this.fileid = fileid; + } + + @Override + public String toString() + { + return Jsons.toString(this); + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/SelfOrder.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/SelfOrder.java new file mode 100644 index 0000000..c427023 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/SelfOrder.java @@ -0,0 +1,228 @@ +package com.zhiqim.yangcai.design.dbo.order; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 订单扩展表 对应表《SELF_ORDER》 + * + * @version 1.0 @author gjx 2019-11-5 新建与整理 + */ +@AnAlias("SelfOrder") +@AnNew +@AnTable(table = "SELF_ORDER", key = "DESIGN_ID", type = "InnoDB") +public class SelfOrder implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 1.设计订单编号 + @AnTableField(column = "LABEL_IDS", type = "string,300", notNull = false) + private String labelIds; // 2.标签id(逗号拼接) + @AnTableField(column = "CONSUMER_TYPE", type = "int", notNull = false) + private int consumerType; // 3.客户类型 1:企业 2:渠道商 3:个体户 + @AnTableField(column = "DEFAULT_LABEL", type = "boolean", notNull = true) + private boolean defaultLabel; // 4.是否默认原订单行业标签 默认为true + @AnTableField(column = "KF_DRAFT_STANDARD", type = "boolean", notNull = false) + private boolean kfDraftStandard; // 5.是否为客服负责的标准自来稿订单[0-否,1-是],默认为0 + @AnTableField(column = "CUSTOMER_QRCODE_URL", type = "string,300", notNull = false) + private String customerQrcodeUrl; // 6.客户服务群二维码图片路径 + @AnTableField(column = "DESIGNER_REFUND_REASON", type = "long", notNull = false) + private long refundReason; // 7.设计师退款原因 + @AnTableField(column = "DRAFT_CHECKER", type = "string,50", notNull = false) + private String draftChecker; // 8.初稿审核人 + @AnTableField(column = "DRAFT_BACK_REASON", type = "string,200", notNull = false) + private String draftBackReason; // 9.初稿审核退回原因 + @AnTableField(column = "DRAFT_BACK_REASON_PIC_URL", type = "string,200", notNull = false) + private String draftBackReasonPicUrl; // 10.初稿审核退回原因截图 + @AnTableField(column = "DRAFT_BACK_TIME", type = "datetime", notNull = false) + private Timestamp draftBackTime; // 11.初稿审核退回时间 + @AnTableField(column = "END_CHECKER", type = "string,50", notNull = false) + private String endChecker; // 12.定稿审核人 + @AnTableField(column = "END_BACK_REASON", type = "string,200", notNull = false) + private String endBackReason; // 13.定稿审核退回原因 + @AnTableField(column = "END_BACK_TIME", type = "datetime", notNull = false) + private Timestamp endBackTime; // 14.定稿审核退回时间 + @AnTableField(column = "END_BACK_REASON_PIC_URL", type = "string,200", notNull = false) + private String endBackReasonPicUrl; // 15.定稿审核退回原因截图 + @AnTableField(column = "URGENT_PRICE", type = "long", notNull = false) + private long urgentPrice; // 16.加急费 + @AnTableField(column = "DESIGN_COST", type = "long", notNull = false) + private long designCost; // 17.设计费用(业务端收取费用) + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getLabelIds() + { + return labelIds; + } + + public void setLabelIds(String labelIds) + { + this.labelIds = labelIds; + } + + public int getConsumerType() + { + return consumerType; + } + + public void setConsumerType(int consumerType) + { + this.consumerType = consumerType; + } + + public boolean isDefaultLabel() + { + return defaultLabel; + } + + public void setDefaultLabel(boolean defaultLabel) + { + this.defaultLabel = defaultLabel; + } + + public boolean isKfDraftStandard() + { + return kfDraftStandard; + } + + public void setKfDraftStandard(boolean kfDraftStandard) + { + this.kfDraftStandard = kfDraftStandard; + } + + public String getCustomerQrcodeUrl() + { + return customerQrcodeUrl; + } + + public void setCustomerQrcodeUrl(String customerQrcodeUrl) + { + this.customerQrcodeUrl = customerQrcodeUrl; + } + + public long getRefundReason() + { + return refundReason; + } + + public void setRefundReason(long refundReason) + { + this.refundReason = refundReason; + } + + public String getDraftChecker() + { + return draftChecker; + } + + public void setDraftChecker(String draftChecker) + { + this.draftChecker = draftChecker; + } + + public String getDraftBackReason() + { + return draftBackReason; + } + + public void setDraftBackReason(String draftBackReason) + { + this.draftBackReason = draftBackReason; + } + + public Timestamp getDraftBackTime() + { + return draftBackTime; + } + + public void setDraftBackTime(Timestamp draftBackTime) + { + this.draftBackTime = draftBackTime; + } + + public String getEndChecker() + { + return endChecker; + } + + public void setEndChecker(String endChecker) + { + this.endChecker = endChecker; + } + + public String getEndBackReason() + { + return endBackReason; + } + + public void setEndBackReason(String endBackReason) + { + this.endBackReason = endBackReason; + } + + public Timestamp getEndBackTime() + { + return endBackTime; + } + + public void setEndBackTime(Timestamp endBackTime) + { + this.endBackTime = endBackTime; + } + + public String getDraftBackReasonPicUrl() + { + return draftBackReasonPicUrl; + } + + public void setDraftBackReasonPicUrl(String draftBackReasonPicUrl) + { + this.draftBackReasonPicUrl = draftBackReasonPicUrl; + } + + public String getEndBackReasonPicUrl() + { + return endBackReasonPicUrl; + } + + public void setEndBackReasonPicUrl(String endBackReasonPicUrl) + { + this.endBackReasonPicUrl = endBackReasonPicUrl; + } + + public long getUrgentPrice() + { + return urgentPrice; + } + + public void setUrgentPrice(long urgentPrice) + { + this.urgentPrice = urgentPrice; + } + + public long getDesignCost() + { + return designCost; + } + + public void setDesignCost(long designCost) + { + this.designCost = designCost; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/accountsSelfView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/accountsSelfView.java new file mode 100644 index 0000000..a6fa22b --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/accountsSelfView.java @@ -0,0 +1,207 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignSelfView.java + * 创建人 :gjx + * 创建时间:2019-11-5 + */ + +package com.zhiqim.yangcai.design.dbo.order; + +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTableField; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * 订单关联表 对应视图《Design_Self_View》 + * + * @version 1.0 @author gjx 2019-11-5 新建与整理 + */ + +@AnAlias("accountsSelfView") +@AnNew +@AnView("DESIGN_ORDER,SELF_ORDER,DESIGNER_COURSE") +@AnViewJoin({ + @AnViewJoinValue(type = "EQUAL", lTable = "SELF_ORDER", lColumn = "DESIGN_ID", rTable = "DESIGN_ORDER", rColumn = "DESIGN_ID"), + @AnViewJoinValue(type = "EQUAL", lTable = "DESIGN_ORDER", lColumn = "DESIGNER",rTable = "DESIGNER_COURSE", rColumn = "DESIGNER")}) +public class accountsSelfView extends DesignOrder { + private static final long serialVersionUID = 1L; + + @AnViewField(table = "SELF_ORDER", column = "LABEL_IDS") + private String labelIds; // 1.标签id(逗号拼接) + @AnViewField(table = "SELF_ORDER", column = "CONSUMER_TYPE") + private int consumerType; // 2.客户类型 1:企业 2:渠道商 3:个体户 + @AnViewField(table = "SELF_ORDER", column = "DEFAULT_LABEL") + private boolean defaultLabel; // 3.是否选用了原订单行业标签 + @AnViewField(table = "SELF_ORDER", column = "KF_DRAFT_STANDARD") + private boolean kfDraftStandard; // 4.是否为客服负责的标准自来稿订单[0-否,1-是],默认为0 + @AnViewField(table = "SELF_ORDER", column = "CUSTOMER_QRCODE_URL") + private String customerQrcodeUrl; // 5.客户服务群二维码图片路径 + @AnViewField(table = "SELF_ORDER", column = "DESIGNER_REFUND_REASON") + private long refundReason; // 6.退款原因 + @AnViewField(table = "SELF_ORDER", column = "DRAFT_CHECKER") + private String draftChecker; // 7.初稿审核人 + @AnViewField(table = "SELF_ORDER", column = "DRAFT_BACK_REASON") + private String draftBackReason; // 8.初稿审核退回原因 + @AnViewField(table = "SELF_ORDER", column = "DRAFT_BACK_TIME") + private Timestamp draftBackTime; // 9.初稿审核退回时间 + @AnViewField(table = "SELF_ORDER", column = "END_CHECKER") + private String endChecker; // 10.定稿审核人 + @AnViewField(table = "SELF_ORDER", column = "END_BACK_REASON") + private String endBackReason; // 11.定稿审核退回原因 + @AnViewField(table = "SELF_ORDER", column = "END_BACK_TIME") + private Timestamp endBackTime; // 12.定稿审核退回时间 + @AnViewField(table = "SELF_ORDER", column = "DRAFT_BACK_REASON_PIC_URL") + private String draftBackReasonPicUrl; // 13.初稿审核退回原因截图 + @AnViewField(table = "SELF_ORDER", column = "END_BACK_REASON_PIC_URL") + private String endBackReasonPicUrl; // 14.定稿审核退回原因截图 + @AnViewField(table = "SELF_ORDER", column = "URGENT_PRICE") + private long urgentPrice; // 15.加急费 + @AnViewField(table = "SELF_ORDER", column = "design_cost") + private long designCost; // 16.设计费用(业务端收取费用) + @AnViewField(table = "DESIGNER_COURSE",column = "RECEIVE_ACCOUNT") + private String receiveAccount;// 收款账号、收款信息 + public String getLabelIds() { + return labelIds; + } + + public void setLabelIds(String labelIds) { + this.labelIds = labelIds; + } + + public int getConsumerType() { + return consumerType; + } + + public void setConsumerType(int consumerType) { + this.consumerType = consumerType; + } + + public boolean isDefaultLabel() { + return defaultLabel; + } + + public void setDefaultLabel(boolean defaultLabel) { + this.defaultLabel = defaultLabel; + } + + public boolean isKfDraftStandard() { + return kfDraftStandard; + } + + public void setKfDraftStandard(boolean kfDraftStandard) { + this.kfDraftStandard = kfDraftStandard; + } + + public String getCustomerQrcodeUrl() { + return customerQrcodeUrl; + } + + public void setCustomerQrcodeUrl(String customerQrcodeUrl) { + this.customerQrcodeUrl = customerQrcodeUrl; + } + + public long getRefundReason() { + return refundReason; + } + + public void setRefundReason(long refundReason) { + this.refundReason = refundReason; + } + + public String getDraftChecker() { + return draftChecker; + } + + public void setDraftChecker(String draftChecker) { + this.draftChecker = draftChecker; + } + + public String getDraftBackReason() { + return draftBackReason; + } + + public void setDraftBackReason(String draftBackReason) { + this.draftBackReason = draftBackReason; + } + + public Timestamp getDraftBackTime() { + return draftBackTime; + } + + public void setDraftBackTime(Timestamp draftBackTime) { + this.draftBackTime = draftBackTime; + } + + public String getEndChecker() { + return endChecker; + } + + public void setEndChecker(String endChecker) { + this.endChecker = endChecker; + } + + public String getEndBackReason() { + return endBackReason; + } + + public void setEndBackReason(String endBackReason) { + this.endBackReason = endBackReason; + } + + public Timestamp getEndBackTime() { + return endBackTime; + } + + public void setEndBackTime(Timestamp endBackTime) { + this.endBackTime = endBackTime; + } + + public String getDraftBackReasonPicUrl() { + return draftBackReasonPicUrl; + } + + public void setDraftBackReasonPicUrl(String draftBackReasonPicUrl) { + this.draftBackReasonPicUrl = draftBackReasonPicUrl; + } + + public String getEndBackReasonPicUrl() { + return endBackReasonPicUrl; + } + + public void setEndBackReasonPicUrl(String endBackReasonPicUrl) { + this.endBackReasonPicUrl = endBackReasonPicUrl; + } + + public long getUrgentPrice() { + return urgentPrice; + } + + public void setUrgentPrice(long urgentPrice) { + this.urgentPrice = urgentPrice; + } + + public long getDesignCost() { + return designCost; + } + + public void setDesignCost(long designCost) { + this.designCost = designCost; + } + + public String getReceiveAccount() { + return receiveAccount; + } + + public void setReceiveAccount(String receiveAccount) { + this.receiveAccount = receiveAccount; + } + + + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/backLogSelfView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/backLogSelfView.java new file mode 100644 index 0000000..e1d7909 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/order/backLogSelfView.java @@ -0,0 +1,52 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignSelfView.java + * 创建人 :gjx + * 创建时间:2019-11-5 + */ + +package com.zhiqim.yangcai.design.dbo.order; + +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTableField; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * 订单关联表 对应视图《Design_Self_View》 + * + * @version 1.0 @author gjx 2019-11-5 新建与整理 + */ + +@AnAlias("backLogSelfView") +@AnNew +@AnView("ORDER_BACKLOG,DESIGN_ORDER") +@AnViewJoin({ + @AnViewJoinValue(type = "EQUAL", lTable = "ORDER_BACKLOG", lColumn = "DESIGN_ID",rTable = "DESIGN_ORDER", rColumn = "DESIGN_ID")}) +public class backLogSelfView extends OrderBacklog { + private static final long serialVersionUID = 1L; + @AnViewField(table = "DESIGN_ORDER", column = "SHOP_NICK") + private String shopNick; // 1.标签id(逗号拼接) + @AnViewField(table = "DESIGN_ORDER", column = "STATUS") + private int status; // 1.标签id(逗号拼接) + public String getShopNick() { + return shopNick; + } + public void setShopNick(String shopNick) { + this.shopNick = shopNick; + } + public int getStatus() { + return status; + } + public void setStatus(int status) { + this.status = status; + } + + + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/profile/DesignerCourse.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/profile/DesignerCourse.java new file mode 100644 index 0000000..2f9885d --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/profile/DesignerCourse.java @@ -0,0 +1,224 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignerCourse.java + * 创建人 :gjx + * 创建时间:2021年3月13日 +*/ + +package com.zhiqim.yangcai.design.dbo.profile; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * + * [简要描述]: 设计师个人信息扩展 + * + * @version 1.0 @author gjx 2021年3月13日 新建与整理 + */ +@AnAlias("DesignerCourse") +@AnNew +@AnTable(table = "DESIGNER_COURSE", key = "DESIGNER", type = "InnoDB") +public class DesignerCourse implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGNER", type = "string,32", notNull = true) + private String designer;// 设计师 + @AnTableField(column = "WORK_EXPERIENCE", type = "string,300", notNull = true) + private String workExperience;// 工作经历 + @AnTableField(column = "SKILL_SCOPE", type = "string,300", notNull = true) + private String skillScope;// 软件能力 + @AnTableField(column = "DESIGN_TYPE", type = "string,300", notNull = true) + private String designType;// 擅长设计 + @AnTableField(column = "WORK_DURATION", type = "string,30", notNull = true) + private String workDuration;// 工作时长 + @AnTableField(column = "WORK_STATUS", type = "string,30", notNull = true) + private String workStatus;// 在职情况 + @AnTableField(column = "RECEIVE_TYPE", type = "string,10", notNull = true) + private String receiveType;// 收款方式 + @AnTableField(column = "RECEIVE_ACCOUNT", type = "string,100", notNull = true) + private String receiveAccount;// 收款账号、收款信息 + @AnTableField(column = "DESIGNER_REMARK", type = "string,400", notNull = false) + private String designerRemark;// 备注 + @AnTableField(column = "PREVIOUS_END_COUNT", type = "int", notNull = false) + private int previousEndCount;// 上月订单数量 + @AnTableField(column = "PREVIOUS_PERFORMANCE", type = "long", notNull = false) + private long previousPerformance;// 上月绩效 + @AnTableField(column = "LAST_ONLIME_TIME", type = "datetime", notNull = false) + private Timestamp lastOnlimeTime;// 最后接单时间 + @AnTableField(column = "ADD_OPERATOR", type = "string,20", notNull = true) + private String addOperator;// 添加人 + @AnTableField(column = "ADD_TIME", type = "datetime", notNull = true) + private Timestamp addTime;// 添加时间 + @AnTableField(column = "UPDATE_OPERATOR", type = "string,20", notNull = false) + private String updateOperator;// 更新人 + @AnTableField(column = "UPDATE_TIME", type = "datetime", notNull = false) + private Timestamp updateTime;// 更新时间 + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getWorkExperience() + { + return workExperience; + } + + public void setWorkExperience(String workExperience) + { + this.workExperience = workExperience; + } + + public String getSkillScope() + { + return skillScope; + } + + public void setSkillScope(String skillScope) + { + this.skillScope = skillScope; + } + + public String getDesignType() + { + return designType; + } + + public void setDesignType(String designType) + { + this.designType = designType; + } + + public String getWorkDuration() + { + return workDuration; + } + + public void setWorkDuration(String workDuration) + { + this.workDuration = workDuration; + } + + public String getWorkStatus() + { + return workStatus; + } + + public void setWorkStatus(String workStatus) + { + this.workStatus = workStatus; + } + + public String getReceiveType() + { + return receiveType; + } + + public void setReceiveType(String receiveType) + { + this.receiveType = receiveType; + } + + public String getReceiveAccount() + { + return receiveAccount; + } + + public void setReceiveAccount(String receiveAccount) + { + this.receiveAccount = receiveAccount; + } + + public String getDesignerRemark() + { + return designerRemark; + } + + public void setDesignerRemark(String designerRemark) + { + this.designerRemark = designerRemark; + } + + public int getPreviousEndCount() + { + return previousEndCount; + } + + public void setPreviousEndCount(int previousEndCount) + { + this.previousEndCount = previousEndCount; + } + + public long getPreviousPerformance() + { + return previousPerformance; + } + + public void setPreviousPerformance(long previousPerformance) + { + this.previousPerformance = previousPerformance; + } + + public Timestamp getLastOnlimeTime() + { + return lastOnlimeTime; + } + + public void setLastOnlimeTime(Timestamp lastOnlimeTime) + { + this.lastOnlimeTime = lastOnlimeTime; + } + + public String getAddOperator() + { + return addOperator; + } + + public void setAddOperator(String addOperator) + { + this.addOperator = addOperator; + } + + public Timestamp getAddTime() + { + return addTime; + } + + public void setAddTime(Timestamp addTime) + { + this.addTime = addTime; + } + + public String getUpdateOperator() + { + return updateOperator; + } + + public void setUpdateOperator(String updateOperator) + { + this.updateOperator = updateOperator; + } + + public Timestamp getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Timestamp updateTime) + { + this.updateTime = updateTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/profile/DesignerCourseView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/profile/DesignerCourseView.java new file mode 100644 index 0000000..023a555 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/profile/DesignerCourseView.java @@ -0,0 +1,271 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignerCourse.java + * 创建人 :gjx + * 创建时间:2021年3月13日 +*/ + +package com.zhiqim.yangcai.design.dbo.profile; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * + * [简要描述]: 设计师个人信息扩展视图 + * + * @version 1.0 @author caohong 2021-6-2 + */ +@AnAlias("DesignerCourseView") +@AnNew +@AnView("DESIGNER_COURSE,ZMR_OPERATOR") +@AnViewJoin( +{ + @AnViewJoinValue(type = "EQUAL", lTable = "DESIGNER_COURSE", lColumn = "DESIGNER", rTable = "ZMR_OPERATOR", rColumn = "OPERATOR_CODE") +}) +public class DesignerCourseView implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table = "DESIGNER_COURSE", column = "DESIGNER") + private String designer;// 设计师 + + @AnViewField(table = "DESIGNER_COURSE", column = "WORK_EXPERIENCE") + private String workExperience;// 工作经历 + + @AnViewField(table = "DESIGNER_COURSE", column = "SKILL_SCOPE") + private String skillScope;// 软件能力 + + @AnViewField(table = "DESIGNER_COURSE", column = "DESIGN_TYPE") + private String designType;// 擅长设计 + + @AnViewField(table = "DESIGNER_COURSE", column = "WORK_DURATION") + private String workDuration;// 工作时长 + + @AnViewField(table = "DESIGNER_COURSE", column = "WORK_STATUS") + private String workStatus;// 在职情况 + + @AnViewField(table = "DESIGNER_COURSE", column = "RECEIVE_TYPE") + private String receiveType;// 收款方式 + + @AnViewField(table = "DESIGNER_COURSE", column = "RECEIVE_ACCOUNT") + private String receiveAccount;// 收款账号、收款信息 + + @AnViewField(table = "DESIGNER_COURSE", column = "DESIGNER_REMARK") + private String designerRemark;// 备注 + + @AnViewField(table = "DESIGNER_COURSE", column = "PREVIOUS_END_COUNT") + private int previousEndCount;// 上月订单数量 + + @AnViewField(table = "DESIGNER_COURSE", column = "PREVIOUS_PERFORMANCE") + private long previousPerformance;// 上月绩效 + + @AnViewField(table = "DESIGNER_COURSE", column = "LAST_ONLIME_TIME") + private Timestamp lastOnlimeTime;// 最后接单时间 + + @AnViewField(table = "DESIGNER_COURSE", column = "ADD_TIME") + private Timestamp addTime;// 添加时间 + + @AnViewField(table = "ZMR_OPERATOR", column = "ORG_ID") + private long orgId; // 1.组织编号 + + @AnViewField(table = "ZMR_OPERATOR", column = "OPERATOR_MOBILE") + private String operatorMobile; // 2.操作员手机号 + + @AnViewField(table = "ZMR_OPERATOR", column = "OPERATOR_PARAM") + private String operatorParam; // 3.操作员参数,用于项目自定义设置 + + @AnViewField(table = "ZMR_OPERATOR", column = "OPERATOR_CREATED") + private String operatorCreated; // 4.操作员创建时间,格式:yyyy-MM-dd hh:mm:ss + + @AnViewField(table = "ZMR_OPERATOR", column = "OPERATOR_WXCODE") + private String operatorWxcode; // 5.个人微信 + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getWorkExperience() + { + return workExperience; + } + + public void setWorkExperience(String workExperience) + { + this.workExperience = workExperience; + } + + public String getSkillScope() + { + return skillScope; + } + + public void setSkillScope(String skillScope) + { + this.skillScope = skillScope; + } + + public String getDesignType() + { + return designType; + } + + public void setDesignType(String designType) + { + this.designType = designType; + } + + public String getWorkDuration() + { + return workDuration; + } + + public void setWorkDuration(String workDuration) + { + this.workDuration = workDuration; + } + + public String getWorkStatus() + { + return workStatus; + } + + public void setWorkStatus(String workStatus) + { + this.workStatus = workStatus; + } + + public String getReceiveType() + { + return receiveType; + } + + public void setReceiveType(String receiveType) + { + this.receiveType = receiveType; + } + + public String getReceiveAccount() + { + return receiveAccount; + } + + public void setReceiveAccount(String receiveAccount) + { + this.receiveAccount = receiveAccount; + } + + public String getDesignerRemark() + { + return designerRemark; + } + + public void setDesignerRemark(String designerRemark) + { + this.designerRemark = designerRemark; + } + + public int getPreviousEndCount() + { + return previousEndCount; + } + + public void setPreviousEndCount(int previousEndCount) + { + this.previousEndCount = previousEndCount; + } + + public long getPreviousPerformance() + { + return previousPerformance; + } + + public void setPreviousPerformance(long previousPerformance) + { + this.previousPerformance = previousPerformance; + } + + public Timestamp getLastOnlimeTime() + { + return lastOnlimeTime; + } + + public void setLastOnlimeTime(Timestamp lastOnlimeTime) + { + this.lastOnlimeTime = lastOnlimeTime; + } + + public Timestamp getAddTime() + { + return addTime; + } + + public void setAddTime(Timestamp addTime) + { + this.addTime = addTime; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getOperatorMobile() + { + return operatorMobile; + } + + public void setOperatorMobile(String operatorMobile) + { + this.operatorMobile = operatorMobile; + } + + public String getOperatorParam() + { + return operatorParam; + } + + public void setOperatorParam(String operatorParam) + { + this.operatorParam = operatorParam; + } + + public String getOperatorCreated() + { + return operatorCreated; + } + + public void setOperatorCreated(String operatorCreated) + { + this.operatorCreated = operatorCreated; + } + + public String getOperatorWxcode() + { + return operatorWxcode; + } + + public void setOperatorWxcode(String operatorWxcode) + { + this.operatorWxcode = operatorWxcode; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/profile/DesignerProfile.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/profile/DesignerProfile.java new file mode 100644 index 0000000..49dc59e --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/profile/DesignerProfile.java @@ -0,0 +1,89 @@ +package com.zhiqim.yangcai.design.dbo.profile; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师个人信息 对应表《DESIGNER_PROFILE》 + */ +@AnAlias("DesignerProfile") +@AnNew +@AnTable(table = "DESIGNER_PROFILE", key = "OPERATOR_CODE", type = "InnoDB") +public class DesignerProfile implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "OPERATOR_CODE", type = "string,32", notNull = true) + private String operatorCode; // 1.操作员 + @AnTableField(column = "PERSONAL_PROFILE", type = "string,350", notNull = false) + private String personalProfile; // 2.个人简介 + @AnTableField(column = "LABELS", type = "string,2000", notNull = false) + private String labels; // 3.标签 + @AnTableField(column = "STATE", type = "int", notNull = false) + private int state; // 4.状态: 0未审核 1审核通过 + @AnTableField(column = "ADD_TIME", type = "datetime", notNull = false) + private Timestamp addTime; // 5.提交时间 + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public String getPersonalProfile() + { + return personalProfile; + } + + public void setPersonalProfile(String personalProfile) + { + this.personalProfile = personalProfile; + } + + public String getLabels() + { + return labels; + } + + public void setLabels(String labels) + { + this.labels = labels; + } + + public int getState() + { + return state; + } + + public void setState(int state) + { + this.state = state; + } + + public Timestamp getAddTime() + { + return addTime; + } + + public void setAddTime(Timestamp addTime) + { + this.addTime = addTime; + } + + @Override + public String toString() + { + return Jsons.toString(this); + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/profile/DesignerWorks.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/profile/DesignerWorks.java new file mode 100644 index 0000000..b127e27 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/profile/DesignerWorks.java @@ -0,0 +1,101 @@ +package com.zhiqim.yangcai.design.dbo.profile; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师作品 对应表《DesignerWorks》 + */ +@AnAlias("DesignerWorks") +@AnNew +@AnTable(table = "DESIGNER_WORKS", key = "DESIGNER_WORKS_ID", type = "InnoDB") +public class DesignerWorks implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGNER_WORKS_ID", type = "long", notNull = true) + private long designerWorksId; // 1.作品id + @AnTableField(column = "OPERATOR_CODE", type = "string,32", notNull = true) + private String operatorCode; // 2.操作员 + @AnTableField(column = "IMG_PATH", type = "string,2000", notNull = false) + private String imgPath; // 3.图片地址 + @AnTableField(column = "IMG_KEY", type = "string,2000", notNull = false) + private String imgKey; // 4.OSS图片key + @AnTableField(column = "STATE", type = "int", notNull = false) + private int state; // 5.0未审核 1审核退回 2审核通过 + @AnTableField(column = "ADD_TIME", type = "datetime", notNull = false) + private Timestamp addTime; // 6.提交时间 + + public long getDesignerWorksId() + { + return designerWorksId; + } + + public void setDesignerWorksId(long designerWorksId) + { + this.designerWorksId = designerWorksId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public String getImgPath() + { + return imgPath; + } + + public void setImgPath(String imgPath) + { + this.imgPath = imgPath; + } + + public String getImgKey() + { + return imgKey; + } + + public void setImgKey(String imgKey) + { + this.imgKey = imgKey; + } + + public int getState() + { + return state; + } + + public void setState(int state) + { + this.state = state; + } + + public Timestamp getAddTime() + { + return addTime; + } + + public void setAddTime(Timestamp addTime) + { + this.addTime = addTime; + } + + @Override + public String toString() + { + return Jsons.toString(this); + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcApplyScore.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcApplyScore.java new file mode 100644 index 0000000..9ba8fbe --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcApplyScore.java @@ -0,0 +1,184 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dbo.qc; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 质检加分表 对应表《QC_APPLY_SCORE》 + */ +@AnAlias("QcApplyScore") +@AnNew +@AnTable(table = "QC_APPLY_SCORE", key = "APPLY_ID", type = "InnoDB") +public class QcApplyScore implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "APPLY_ID", type = "long", notNull = true) + private long applyId; // 1.申请编号 + @AnTableField(column = "DESIGNER", type = "string,64", notNull = true) + private String designer; // 2.设计师 + @AnTableField(column = "ORG_ID", type = "long", notNull = true) + private long orgId; // 3.组织编号 + @AnTableField(column = "APPLY_REASON", type = "string,500", notNull = true) + private String applyReason; // 4.申请原因 + @AnTableField(column = "APPLY_IMG_PATH", type = "string,500", notNull = true) + private String applyImgPath; // 5.申请凭证路径 + @AnTableField(column = "APPLY_TIME", type = "datetime", notNull = true) + private Timestamp applyTime; // 6.申请时间 + @AnTableField(column = "SCORE", type = "decimal,10,1", notNull = true) + private double score; // 7.申请分数 + @AnTableField(column = "APPLY_FLAG", type = "int", notNull = true) + private int applyFlag; // 8.0表示申请中,1表示申请成功,2表示申请失败 + @AnTableField(column = "APPLY_BACK_REASON", type = "string,500", notNull = false) + private String applyBackReason; // 9.申请打回原因 + @AnTableField(column = "QC_TYPE_ID", type = "long", notNull = false) + private long qcTypeId; // 10.加分类型外键 + @AnTableField(column = "QC_AWARDED_AUDITOR", type = "string,200", notNull = false) + private String qcAwardedAuditor; // 11.审核人 + @AnTableField(column = "QC_AWARDED_AUDITOR_TIME", type = "datetime", notNull = false) + private Timestamp qcAwardedAuditorTime; // 12.审核时间 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getApplyId() + { + return applyId; + } + + public void setApplyId(long applyId) + { + this.applyId = applyId; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getApplyReason() + { + return applyReason; + } + + public void setApplyReason(String applyReason) + { + this.applyReason = applyReason; + } + + public String getApplyImgPath() + { + return applyImgPath; + } + + public void setApplyImgPath(String applyImgPath) + { + this.applyImgPath = applyImgPath; + } + + public Timestamp getApplyTime() + { + return applyTime; + } + + public void setApplyTime(Timestamp applyTime) + { + this.applyTime = applyTime; + } + + public double getScore() + { + return score; + } + + public void setScore(double score) + { + this.score = score; + } + + public int getApplyFlag() + { + return applyFlag; + } + + public void setApplyFlag(int applyFlag) + { + this.applyFlag = applyFlag; + } + + public String getApplyBackReason() + { + return applyBackReason; + } + + public void setApplyBackReason(String applyBackReason) + { + this.applyBackReason = applyBackReason; + } + + public long getQcTypeId() + { + return qcTypeId; + } + + public void setQcTypeId(long qcTypeId) + { + this.qcTypeId = qcTypeId; + } + + public String getQcAwardedAuditor() + { + return qcAwardedAuditor; + } + + public void setQcAwardedAuditor(String qcAwardedAuditor) + { + this.qcAwardedAuditor = qcAwardedAuditor; + } + + public Timestamp getQcAwardedAuditorTime() + { + return qcAwardedAuditorTime; + } + + public void setQcAwardedAuditorTime(Timestamp qcAwardedAuditorTime) + { + this.qcAwardedAuditorTime = qcAwardedAuditorTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcAwardedType.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcAwardedType.java new file mode 100644 index 0000000..9e94ac4 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcAwardedType.java @@ -0,0 +1,71 @@ +/** + * 扬彩印刷设计 + * 文件名 :QcAwardedType.java + * 创建人 :高佳新 + * 创建时间:2019-5-20 + */ + +package com.zhiqim.yangcai.design.dbo.qc; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 质检加分类型表 对应表《QC_AWARDED_TYPE》 + */ +@AnAlias("QcAwardedType") +@AnNew +@AnTable(table = "QC_AWARDED_TYPE", key = "QC_TYPE_ID", type = "InnoDB") +public class QcAwardedType implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "QC_TYPE_ID", type = "long", notNull = true) + private long qcTypeId; // 1.质检加分类型id + @AnTableField(column = "QC_AWARDED_NAME", type = "string,64", notNull = true) + private String qcAwardedName; // 2.质检加分类型名称 + @AnTableField(column = "QC_SCORE", type = "decimal,10,1", notNull = true) + private double qcScore; // 3.质检加分类型对应分数 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getQcTypeId() + { + return qcTypeId; + } + + public void setQcTypeId(long qcTypeId) + { + this.qcTypeId = qcTypeId; + } + + public String getQcAwardedName() + { + return qcAwardedName; + } + + public void setQcAwardedName(String qcAwardedName) + { + this.qcAwardedName = qcAwardedName; + } + + public double getQcScore() + { + return qcScore; + } + + public void setQcScore(double qcScore) + { + this.qcScore = qcScore; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcOrderView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcOrderView.java new file mode 100644 index 0000000..69f1bd2 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcOrderView.java @@ -0,0 +1,82 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.qc; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 质检订单视图 对应视图《QC_ORDER_VIEW》 + */ +@AnAlias("QcOrderView") +@AnNew +@AnView("QC_RECORD,DESIGN_ORDER") +@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="QC_RECORD", lColumn="DESIGN_ID", rTable="DESIGN_ORDER", rColumn="DESIGN_ID")}) +public class QcOrderView extends DesignOrder +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="QC_RECORD", column="REASON") private String reason; //2.质检原因 + @AnViewField(table="QC_RECORD", column="SCORE") private double score; //3.质检分数 + @AnViewField(table="QC_RECORD", column="IMG_PATH") private String imgPath; //4.质检凭证路径 + @AnViewField(table="QC_RECORD", column="OPERATOR_CODE") private String operatorCode; //5.操作员 + + public String toString() + { + return Jsons.toString(this); + } + + public String getReason() + { + return reason; + } + + public void setReason(String reason) + { + this.reason = reason; + } + + public double getScore() + { + return score; + } + + public void setScore(double score) + { + this.score = score; + } + + public String getImgPath() + { + return imgPath; + } + + public void setImgPath(String imgPath) + { + this.imgPath = imgPath; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcParameter.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcParameter.java new file mode 100644 index 0000000..d4e7043 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcParameter.java @@ -0,0 +1,81 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.qc; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 质检参数表 对应表《QC_PARAMETER》 + */ +@AnAlias("QcParameter") +@AnNew +@AnTable(table="QC_PARAMETER", key="PARAMETER_ID", type="InnoDB") +public class QcParameter implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="PARAMETER_ID", type="long", notNull=true) private long parameterId; //1.参数编号 + @AnTableField(column="FLAG", type="byte", notNull=true) private int flag; //2.0表示加分,1表示减分 + @AnTableField(column="CONTENT", type="string,1000", notNull=true) private String content; //3.预录内容 + @AnTableField(column="SCORE", type="decimal,15,1", notNull=false) private double score; //4.内容对应分数 + + public String toString() + { + return Jsons.toString(this); + } + + public long getParameterId() + { + return parameterId; + } + + public void setParameterId(long parameterId) + { + this.parameterId = parameterId; + } + + public int getFlag() + { + return flag; + } + + public void setFlag(int flag) + { + this.flag = flag; + } + + public String getContent() + { + return content; + } + + public void setContent(String content) + { + this.content = content; + } + + public double getScore() + { + return score; + } + + public void setScore(double score) + { + this.score = score; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcRecord.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcRecord.java new file mode 100644 index 0000000..76bf435 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/qc/QcRecord.java @@ -0,0 +1,148 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.qc; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 质检记录表 对应表《QC_RECORD》 + */ +@AnAlias("QcRecord") +@AnNew +@AnTable(table="QC_RECORD", key="DESIGN_ID", type="InnoDB") +public class QcRecord implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="DESIGN_ID", type="long", notNull=true) private long designId; //1.订单号 + @AnTableField(column="ORG_ID", type="long", notNull=true) private long orgId; //2.组织编号 + @AnTableField(column="DESIGNER", type="string,64", notNull=true) private String designer; //3.设计师 + @AnTableField(column="REASON", type="string,1000", notNull=false) private String reason; //4.质检原因 + @AnTableField(column="DESCRIPTION", type="string,1000", notNull=false) private String description; //5.质检违规描述 + @AnTableField(column="SCORE", type="decimal,15,1", notNull=false) private double score; //6.质检分数 + @AnTableField(column="IMG_PATH", type="string,200", notNull=false) private String imgPath; //7.质检凭证路径 + @AnTableField(column="OPERATOR_CODE", type="string,64", notNull=true) private String operatorCode; //8.操作员 + @AnTableField(column="QC_TIME", type="datetime", notNull=true) private Timestamp qcTime; //9.质检时间 + @AnTableField(column="QC_FLAG", type="int", notNull=true) private int qcFlag; //10.质检标志,0表示未质检,1表示质检正常,2表示质检违规 + + public String toString() + { + return Jsons.toString(this); + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getReason() + { + return reason; + } + + public void setReason(String reason) + { + this.reason = reason; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public double getScore() + { + return score; + } + + public void setScore(double score) + { + this.score = score; + } + + public String getImgPath() + { + return imgPath; + } + + public void setImgPath(String imgPath) + { + this.imgPath = imgPath; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public Timestamp getQcTime() + { + return qcTime; + } + + public void setQcTime(Timestamp qcTime) + { + this.qcTime = qcTime; + } + + public int getQcFlag() + { + return qcFlag; + } + + public void setQcFlag(int qcFlag) + { + this.qcFlag = qcFlag; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/retention/RetentionDetails.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/retention/RetentionDetails.java new file mode 100644 index 0000000..255dd74 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/retention/RetentionDetails.java @@ -0,0 +1,128 @@ +/** + * 扬彩印刷设计 + * 文件名 :RetentionDetails.java + * 创建人 :高佳新 + * 创建时间:2019-7-22 + */ + +package com.zhiqim.yangcai.design.dbo.retention; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * + * 滞留单详情表 + * + * @version 1.0 @author gjx 2019-7-22 新建与整理 + */ +@AnAlias("RetentionDetails") +@AnNew +@AnTable(table = "RETENTION_DETAILS", key = "DESIGN_ID", type = "InnoDB") +public class RetentionDetails implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 1.设订单编号,设计平台独立编号 + @AnTableField(column = "IS_RETENT_DEAL", type = "int", notNull = false) + private int isRetentDeal; // 2.设计师是否处理过滞留单,0 没、1 处理过 + @AnTableField(column = "RETENT_DEAL_TIME", type = "datetime", notNull = false) + private Timestamp retentDealTime; // 3.滞留单自行处理时间 + @AnTableField(column = "RETENT_DEAL_NAME", type = "string,64", notNull = false) + private String retentDealName; // 4.滞留单处理人 + @AnTableField(column = "RETENT_DEAL_WAY", type = "int", notNull = false) + private int retentDealWay; // 5.滞留单处理方式 0:寄存、1:退款 + @AnTableField(column = "RETENT_FOLLOW_FLAG", type = "int", notNull = false) + private int retentFollowFlag; // 6.设计师跟进情况:0:较好、1:一般、2:差 + @AnTableField(column = "RETENT_REMARK", type = "string,1000", notNull = false) + private String retentRemark; // 7.滞留单处理备注 + @AnTableField(column = "RETENTION_END_TIME", type = "datetime", notNull = false) + private Timestamp retentionEndTime; // 8.滞留单处理时间 + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public int getIsRetentDeal() + { + return isRetentDeal; + } + + public void setIsRetentDeal(int isRetentDeal) + { + this.isRetentDeal = isRetentDeal; + } + + public Timestamp getRetentDealTime() + { + return retentDealTime; + } + + public void setRetentDealTime(Timestamp retentDealTime) + { + this.retentDealTime = retentDealTime; + } + + public String getRetentDealName() + { + return retentDealName; + } + + public void setRetentDealName(String retentDealName) + { + this.retentDealName = retentDealName; + } + + public int getRetentDealWay() + { + return retentDealWay; + } + + public void setRetentDealWay(int retentDealWay) + { + this.retentDealWay = retentDealWay; + } + + public int getRetentFollowFlag() + { + return retentFollowFlag; + } + + public void setRetentFollowFlag(int retentFollowFlag) + { + this.retentFollowFlag = retentFollowFlag; + } + + public String getRetentRemark() + { + return retentRemark; + } + + public void setRetentRemark(String retentRemark) + { + this.retentRemark = retentRemark; + } + + public Timestamp getRetentionEndTime() + { + return retentionEndTime; + } + + public void setRetentionEndTime(Timestamp retentionEndTime) + { + this.retentionEndTime = retentionEndTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/DesScoreParam.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/DesScoreParam.java new file mode 100644 index 0000000..9ccae49 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/DesScoreParam.java @@ -0,0 +1,103 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.score; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 评分参数表 对应表《DES_SCORE_PARAM》 + */ +@AnAlias("DesScoreParam") +@AnNew +@AnTable(table="DES_SCORE_PARAM", key="PARAM_ID", type="InnoDB") +public class DesScoreParam implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="PARAM_ID", type="long", notNull=true) private long paramId; //1.参数ID + @AnTableField(column="SCORE_NAME", type="string,32", notNull=false) private String scoreName; //2.规则名称(TEMPLATE,KEYWORD) + @AnTableField(column="SCORE_TYPE", type="string,32", notNull=true) private String scoreType; //3.评分规则类型(基础分:BASE_SCORE,动态分:FLOAT_SCORE,销售分:SALE_SCORE, 用户评分:USER_SCORE ) + @AnTableField(column="PARAM_TYPE", type="int", notNull=true) private int paramType; //4.参数类型(0代表加分,1代表减分) + @AnTableField(column="PARAM_KEY", type="string,32", notNull=true) private String paramKey; //5.参数键 + @AnTableField(column="PARAM_VALUE", type="int", notNull=true) private int paramValue; //6.参数值 + + public String toString() + { + return Jsons.toString(this); + } + + public long getParamId() + { + return paramId; + } + + public void setParamId(long paramId) + { + this.paramId = paramId; + } + + public String getScoreName() + { + return scoreName; + } + + public void setScoreName(String scoreName) + { + this.scoreName = scoreName; + } + + public String getScoreType() + { + return scoreType; + } + + public void setScoreType(String scoreType) + { + this.scoreType = scoreType; + } + + public int getParamType() + { + return paramType; + } + + public void setParamType(int paramType) + { + this.paramType = paramType; + } + + public String getParamKey() + { + return paramKey; + } + + public void setParamKey(String paramKey) + { + this.paramKey = paramKey; + } + + public int getParamValue() + { + return paramValue; + } + + public void setParamValue(int paramValue) + { + this.paramValue = paramValue; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/DesScoreWeight.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/DesScoreWeight.java new file mode 100644 index 0000000..bc2c09a --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/DesScoreWeight.java @@ -0,0 +1,103 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.score; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 评分权重表 对应表《DES_SCORE_WEIGHT》 + */ +@AnAlias("DesScoreWeight") +@AnNew +@AnTable(table="DES_SCORE_WEIGHT", key="SCORE_ID", type="InnoDB") +public class DesScoreWeight implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="SCORE_ID", type="long", notNull=true) private long scoreId; //1.评分ID + @AnTableField(column="SCORE_NAME", type="string,32", notNull=true) private String scoreName; //2.评分名称(TEMPLATE,KEYWORD) + @AnTableField(column="DAY_CODE", type="string,10", notNull=true) private String dayCode; //3.日期 + @AnTableField(column="SCORE_TYPE", type="string,32", notNull=true) private String scoreType; //4.评分类型(基础分:BASE_SCORE,动态分:FLOAT_SCORE,销售分:SALE_SCORE, 用户评分:USER_SCORE ) + @AnTableField(column="SCORE_WEIGHT", type="int", notNull=true) private int scoreWeight; //5.评分权重值 + @AnTableField(column="SCORE_VALUE", type="int", notNull=false) private int scoreValue; //6.评分分值 + + public String toString() + { + return Jsons.toString(this); + } + + public long getScoreId() + { + return scoreId; + } + + public void setScoreId(long scoreId) + { + this.scoreId = scoreId; + } + + public String getScoreName() + { + return scoreName; + } + + public void setScoreName(String scoreName) + { + this.scoreName = scoreName; + } + + public String getDayCode() + { + return dayCode; + } + + public void setDayCode(String dayCode) + { + this.dayCode = dayCode; + } + + public String getScoreType() + { + return scoreType; + } + + public void setScoreType(String scoreType) + { + this.scoreType = scoreType; + } + + public int getScoreWeight() + { + return scoreWeight; + } + + public void setScoreWeight(int scoreWeight) + { + this.scoreWeight = scoreWeight; + } + + public int getScoreValue() + { + return scoreValue; + } + + public void setScoreValue(int scoreValue) + { + this.scoreValue = scoreValue; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerLever.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerLever.java new file mode 100644 index 0000000..ee4be39 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerLever.java @@ -0,0 +1,137 @@ +package com.zhiqim.yangcai.design.dbo.score; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师积分等级配置 对应表《score_designer_lever》 + */ +@AnAlias("ScoreDesignerLever") +@AnNew +@AnTable(table = "score_designer_lever", key = "designer_lever_id", type = "InnoDB") +public class ScoreDesignerLever implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "designer_lever_id", type = "long", notNull = true) + private long designerLeverId; // 1.设计师等级id + @AnTableField(column = "designer_lever", type = "string,32", notNull = true) + private String designerLever; // 2.设计师等级名称 + @AnTableField(column = "min_score", type = "int", notNull = true) + private int minScore; // 3.分数下限 + @AnTableField(column = "max_score", type = "int", notNull = true) + private int maxScore; // 4.分数上限 + @AnTableField(column = "state", type = "int", notNull = true) + private int state; // 5.状态:0=失效;1=生效; + @AnTableField(column = "remark", type = "string,100", notNull = false) + private String remark; // 6.备注 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 56.创建时间 + @AnTableField(column = "MODIFY_TIME", type = "datetime", notNull = false) + private Timestamp modifyTime; // 57.修改时间 + @AnTableField(column = "LAST_OPERATOR_CODE", type = "string,64", notNull = true) + private String lastOperatorCode; // 58.操作人 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getDesignerLeverId() + { + return designerLeverId; + } + + public void setDesignerLeverId(long designerLeverId) + { + this.designerLeverId = designerLeverId; + } + + public String getDesignerLever() + { + return designerLever; + } + + public void setDesignerLever(String designerLever) + { + this.designerLever = designerLever; + } + + public int getMinScore() + { + return minScore; + } + + public void setMinScore(int minScore) + { + this.minScore = minScore; + } + + public int getMaxScore() + { + return maxScore; + } + + public void setMaxScore(int maxScore) + { + this.maxScore = maxScore; + } + + public int getState() + { + return state; + } + + public void setState(int state) + { + this.state = state; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + + public String getLastOperatorCode() + { + return lastOperatorCode; + } + + public void setLastOperatorCode(String lastOperatorCode) + { + this.lastOperatorCode = lastOperatorCode; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerRecord.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerRecord.java new file mode 100644 index 0000000..6e7b517 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerRecord.java @@ -0,0 +1,161 @@ +package com.zhiqim.yangcai.design.dbo.score; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师虚拟积分账户 对应表《score_designer_record》 + */ +@AnAlias("ScoreDesignerRecord") +@AnNew +@AnTable(table = "score_designer_record", key = "record_id", type = "InnoDB") +public class ScoreDesignerRecord implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "record_id", type = "long", notNull = true) + private long recordId; // 1.记录id + @AnTableField(column = "operator_code", type = "string,32", notNull = true) + private String operatorCode; // 2.设计师 + @AnTableField(column = "org_id", type = "long", notNull = false) + private long orgId; // 3.设计师所在组织id + @AnTableField(column = "state", type = "int", notNull = true) + private int state; // 4.状态:0=失效;1=生效; + @AnTableField(column = "score", type = "int", notNull = false) + private int score; // 5.得分 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 6.创建时间 + @AnTableField(column = "LAST_MODIFY_TIME", type = "datetime", notNull = false) + private Timestamp lastModifyTime; // 7.修改时间 + @AnTableField(column = "LAST_MODIFY_SCORE", type = "int", notNull = false) + private int lastModifyScore; // 8.最后更新积分 + @AnTableField(column = "LAST_SCORE_TYPE", type = "long", notNull = false) + private long lastScoreType; // 9.最后更新积分细则 + @AnTableField(column = "order_id", type = "long", notNull = false) + private long orderId; // 10.涉及订单 + @AnTableField(column = "remark", type = "string,3000", notNull = false) + private String remark; // 15.备注 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getRecordId() + { + return recordId; + } + + public void setRecordId(long recordId) + { + this.recordId = recordId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public int getState() + { + return state; + } + + public void setState(int state) + { + this.state = state; + } + + public int getScore() + { + return score; + } + + public void setScore(int score) + { + this.score = score; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getLastModifyTime() + { + return lastModifyTime; + } + + public void setLastModifyTime(Timestamp lastModifyTime) + { + this.lastModifyTime = lastModifyTime; + } + + public int getLastModifyScore() + { + return lastModifyScore; + } + + public void setLastModifyScore(int lastModifyScore) + { + this.lastModifyScore = lastModifyScore; + } + + public long getLastScoreType() + { + return lastScoreType; + } + + public void setLastScoreType(long lastScoreType) + { + this.lastScoreType = lastScoreType; + } + + public long getOrderId() + { + return orderId; + } + + public void setOrderId(long orderId) + { + this.orderId = orderId; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerRecordDetail.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerRecordDetail.java new file mode 100644 index 0000000..00df47b --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerRecordDetail.java @@ -0,0 +1,149 @@ +package com.zhiqim.yangcai.design.dbo.score; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 设计师积分交易流水详情 对应表《score_designer_record_detail》 + */ +@AnAlias("ScoreDesignerRecordDetail") +@AnNew +@AnTable(table = "score_designer_record_detail", key = "record_id", type = "InnoDB") +public class ScoreDesignerRecordDetail implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "record_id", type = "long", notNull = true) + private long recordId; // 1.记录id + @AnTableField(column = "operator_code", type = "string,32", notNull = true) + private String operatorCode; // 2.设计师 + @AnTableField(column = "state", type = "int", notNull = true) + private int state; // 4.状态:0=失效;1=生效; + @AnTableField(column = "score", type = "int", notNull = false) + private int score; // 5.得分 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 6.创建时间 + @AnTableField(column = "create_operator", type = "string,32", notNull = true) + private String createOperator; // 7.操作人 + @AnTableField(column = "MODIFY_TIME", type = "datetime", notNull = false) + private Timestamp modifyTime; // 7.修改时间 + @AnTableField(column = "SCORE_TYPE", type = "long", notNull = false) + private long scoreType; // 9.积分细则ID + @AnTableField(column = "order_id", type = "long", notNull = false) + private long orderId; // 10.涉及订单 + @AnTableField(column = "remark", type = "string,3000", notNull = false) + private String remark; // 15.备注 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getRecordId() + { + return recordId; + } + + public void setRecordId(long recordId) + { + this.recordId = recordId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public int getState() + { + return state; + } + + public void setState(int state) + { + this.state = state; + } + + public int getScore() + { + return score; + } + + public void setScore(int score) + { + this.score = score; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + + public long getScoreType() + { + return scoreType; + } + + public void setScoreType(long scoreType) + { + this.scoreType = scoreType; + } + + public long getOrderId() + { + return orderId; + } + + public void setOrderId(long orderId) + { + this.orderId = orderId; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + + public String getCreateOperator() + { + return createOperator; + } + + public void setCreateOperator(String createOperator) + { + this.createOperator = createOperator; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerRecordDetailView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerRecordDetailView.java new file mode 100644 index 0000000..d2f3af5 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerRecordDetailView.java @@ -0,0 +1,179 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.score; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * 设计师积分详情 对应表《score_designer_record_detail》 + */ +@AnAlias("ScoreDesignerRecordDetailView") +@AnNew +@AnView("score_designer_record_detail,score_type") +@AnViewJoin( +{ + @AnViewJoinValue(type = "LEFT", lTable = "score_designer_record_detail", lColumn = "score_Type", rTable = "score_type", rColumn = "type_id") +}) +public class ScoreDesignerRecordDetailView implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table = "score_designer_record_detail", column = "record_id") + private long recordId; // 1.记录id + @AnViewField(table = "score_designer_record_detail", column = "operator_code") + private String operatorCode; // 2.设计师 + @AnViewField(table = "score_designer_record_detail", column = "state") + private int state; // 4.状态:0=失效;1=生效; + @AnViewField(table = "score_designer_record_detail", column = "score") + private int score; // 5.得分 + @AnViewField(table = "score_designer_record_detail", column = "CREATE_TIME") + private Timestamp createTime; // 6.创建时间 + @AnViewField(table = "score_designer_record_detail", column = "MODIFY_TIME") + private Timestamp modifyTime; // 7.修改时间 + @AnViewField(table = "score_designer_record_detail", column = "SCORE_TYPE") + private long scoreType; // 9.积分细则ID + @AnViewField(table = "score_designer_record_detail", column = "order_id") + private long orderId; // 10.涉及订单 + @AnViewField(table = "score_designer_record_detail", column = "remark") + private String remark; // 15.备注 + @AnViewField(table = "score_designer_record_detail", column = "create_operator") + private String createOperator; // 2.操作人 + + @AnViewField(table = "score_type", column = "type_name") + private String typeName; // 2.积分细则名称 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getRecordId() + { + return recordId; + } + + public void setRecordId(long recordId) + { + this.recordId = recordId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public int getState() + { + return state; + } + + public void setState(int state) + { + this.state = state; + } + + public int getScore() + { + return score; + } + + public void setScore(int score) + { + this.score = score; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + + public long getScoreType() + { + return scoreType; + } + + public void setScoreType(long scoreType) + { + this.scoreType = scoreType; + } + + public long getOrderId() + { + return orderId; + } + + public void setOrderId(long orderId) + { + this.orderId = orderId; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + + public String getTypeName() + { + return typeName; + } + + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getCreateOperator() + { + return createOperator; + } + + public void setCreateOperator(String createOperator) + { + this.createOperator = createOperator; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerRecordView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerRecordView.java new file mode 100644 index 0000000..10f12c7 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreDesignerRecordView.java @@ -0,0 +1,191 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.score; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * 设计师积分总账 + */ +@AnAlias("ScoreDesignerRecordView") +@AnNew +@AnView("score_designer_record,score_type") +@AnViewJoin( +{ + @AnViewJoinValue(type = "LEFT", lTable = "score_designer_record", lColumn = "last_Score_Type", rTable = "score_type", rColumn = "type_id") +}) +public class ScoreDesignerRecordView implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table = "score_designer_record", column = "record_id") + private long recordId; // 1.记录id + @AnViewField(table = "score_designer_record", column = "operator_code") + private String operatorCode; // 2.设计师 + @AnViewField(table = "score_designer_record", column = "org_id") + private long orgId; // 3.设计师所在组织id + @AnViewField(table = "score_designer_record", column = "state") + private int state; // 4.状态:0=失效;1=生效; + @AnViewField(table = "score_designer_record", column = "score") + private int score; // 5.得分 + @AnViewField(table = "score_designer_record", column = "CREATE_TIME") + private Timestamp createTime; // 6.创建时间 + @AnViewField(table = "score_designer_record", column = "LAST_MODIFY_TIME") + private Timestamp lastModifyTime; // 7.修改时间 + @AnViewField(table = "score_designer_record", column = "LAST_MODIFY_SCORE") + private int lastModifyScore; // 8.最后更新积分 + @AnViewField(table = "score_designer_record", column = "LAST_SCORE_TYPE") + private long lastScoreType; // 9.最后更新积分细则 + @AnViewField(table = "score_designer_record", column = "order_id") + private long orderId; // 10.涉及订单 + @AnViewField(table = "score_designer_record", column = "remark") + private String remark; // 15.备注 + + @AnViewField(table = "score_type", column = "type_name") + private String typeName; // 2.积分细则名称 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getRecordId() + { + return recordId; + } + + public void setRecordId(long recordId) + { + this.recordId = recordId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public int getState() + { + return state; + } + + public void setState(int state) + { + this.state = state; + } + + public int getScore() + { + return score; + } + + public void setScore(int score) + { + this.score = score; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getLastModifyTime() + { + return lastModifyTime; + } + + public void setLastModifyTime(Timestamp lastModifyTime) + { + this.lastModifyTime = lastModifyTime; + } + + public int getLastModifyScore() + { + return lastModifyScore; + } + + public void setLastModifyScore(int lastModifyScore) + { + this.lastModifyScore = lastModifyScore; + } + + public long getLastScoreType() + { + return lastScoreType; + } + + public void setLastScoreType(long lastScoreType) + { + this.lastScoreType = lastScoreType; + } + + public long getOrderId() + { + return orderId; + } + + public void setOrderId(long orderId) + { + this.orderId = orderId; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + + public String getTypeName() + { + return typeName; + } + + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreType.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreType.java new file mode 100644 index 0000000..1b0fd51 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/score/ScoreType.java @@ -0,0 +1,136 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.score; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 评分细则 对应表《score_type》 + */ +@AnAlias("ScoreType") +@AnNew +@AnTable(table = "score_type", key = "type_id", type = "InnoDB") +public class ScoreType implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "type_id", type = "long", notNull = true) + private long typeId; // 1.类型id + @AnTableField(column = "type_name", type = "string,32", notNull = true) + private String typeName; // 2.类型名称 + @AnTableField(column = "value", type = "int", notNull = true) + private int value; // 3.积分值 + @AnTableField(column = "state", type = "int", notNull = true) + private int state; // 4.状态:0=失效;1=生效; + @AnTableField(column = "remark", type = "string,100", notNull = false) + private String remark; // 5.备注 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 56.创建时间 + @AnTableField(column = "MODIFY_TIME", type = "datetime", notNull = false) + private Timestamp modifyTime; // 57.修改时间 + @AnTableField(column = "LAST_OPERATOR_CODE", type = "string,64", notNull = true) + private String lastOperatorCode; // 58.操作人 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + public String getTypeName() + { + return typeName; + } + + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public int getValue() + { + return value; + } + + public void setValue(int value) + { + this.value = value; + } + + public int getState() + { + return state; + } + + public void setState(int state) + { + this.state = state; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + + public String getLastOperatorCode() + { + return lastOperatorCode; + } + + public void setLastOperatorCode(String lastOperatorCode) + { + this.lastOperatorCode = lastOperatorCode; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/sms/SmsLog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/sms/SmsLog.java new file mode 100644 index 0000000..a282ea4 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/sms/SmsLog.java @@ -0,0 +1,125 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.sms; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 短信发送日志表 对应表《SMS_LOG》 + */ +@AnAlias("SmsLog") +@AnNew +@AnTable(table="SMS_LOG", key="LOG_ID", type="InnoDB") +public class SmsLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="LOG_ID", type="long", notNull=true) private long logId; //1.编号 + @AnTableField(column="MOBILE", type="string,20", notNull=true) private String mobile; //2.手机号 + @AnTableField(column="CONTENT", type="string,200", notNull=true) private String content; //3.短信内容 + @AnTableField(column="SEND_TIME", type="string,19", notNull=true) private String sendTime; //4.发送时间 + @AnTableField(column="SEND_STATUS", type="int", notNull=true) private int sendStatus; //5.发送状态,0:成功,1:失败,2:未发送 + @AnTableField(column="DESIGN_ID", type="long", notNull=false) private long designId; //6.订单号 + @AnTableField(column="RET_STATUS", type="int", notNull=false) private int retStatus; //7.报告状态,0:成功,其它失败 + @AnTableField(column="RET_DESC", type="string,100", notNull=false) private String retDesc; //8.报告说明 + + public String toString() + { + return Jsons.toString(this); + } + + public long getLogId() + { + return logId; + } + + public void setLogId(long logId) + { + this.logId = logId; + } + + public String getMobile() + { + return mobile; + } + + public void setMobile(String mobile) + { + this.mobile = mobile; + } + + public String getContent() + { + return content; + } + + public void setContent(String content) + { + this.content = content; + } + + public String getSendTime() + { + return sendTime; + } + + public void setSendTime(String sendTime) + { + this.sendTime = sendTime; + } + + public int getSendStatus() + { + return sendStatus; + } + + public void setSendStatus(int sendStatus) + { + this.sendStatus = sendStatus; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public int getRetStatus() + { + return retStatus; + } + + public void setRetStatus(int retStatus) + { + this.retStatus = retStatus; + } + + public String getRetDesc() + { + return retDesc; + } + + public void setRetDesc(String retDesc) + { + this.retDesc = retDesc; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/CheckBackReason.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/CheckBackReason.java new file mode 100644 index 0000000..4bb5c52 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/CheckBackReason.java @@ -0,0 +1,77 @@ +/* + * 版权所有 (C) 2015 知启蒙(WWW.ZHIQIM.COM) 保留所有权利。 + * + * Download http://www.zhiqim.com/fadfox/ 欢迎加盟[凡狐]兴趣小组。 + * + * 由数据库字典自动生成的类文件,修改请使用数据库字典编辑器修改。 + */ +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 印前原因预录 对应表《CHECK_BACK_REASON》 + */ +@AnAlias("CheckBackReason") +@AnNew +@AnTable(table="CHECK_BACK_REASON", key="REASON_ID", type="InnoDB") +public class CheckBackReason implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="REASON_ID", type="long", notNull=true) private long reasonId; //1.原因编号 + @AnTableField(column="IS_REASON_TYPE", type="boolean", notNull=true) private boolean isReasonType; //2.1 原因分类 0具体原因项 + @AnTableField(column="REASON_PARENT", type="long", notNull=true) private long reasonParent; //3.具体原因项 所属分类 + @AnTableField(column="REASON_TEXT", type="string,200", notNull=true) private String reasonText; //4.原因内容 + + public String toString() + { + return Jsons.toString(this); + } + + public long getReasonId() + { + return reasonId; + } + + public void setReasonId(long reasonId) + { + this.reasonId = reasonId; + } + + public boolean isReasonType() + { + return isReasonType; + } + + public void setReasonType(boolean isReasonType) + { + this.isReasonType = isReasonType; + } + + public long getReasonParent() + { + return reasonParent; + } + + public void setReasonParent(long reasonParent) + { + this.reasonParent = reasonParent; + } + + public String getReasonText() + { + return reasonText; + } + + public void setReasonText(String reasonText) + { + this.reasonText = reasonText; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/CompleteOrderStat.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/CompleteOrderStat.java new file mode 100644 index 0000000..b5c7eba --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/CompleteOrderStat.java @@ -0,0 +1,135 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 定稿统计表 对应表《COMPLETE_ORDER_STAT》 + */ +@AnAlias("CompleteOrderStat") +@AnNew +@AnTable(table = "COMPLETE_ORDER_STAT", key = "DESIGNER,COMPLETE_DATE", type = "InnoDB") +public class CompleteOrderStat implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGNER", type = "string,64", notNull = true) + private String designer; // 1.设计师 + @AnTableField(column = "COMPLETE_DATE", type = "string,19", notNull = true) + private String completeDate; // 2.定稿日期 + @AnTableField(column = "ORDER_PASS_ID", type = "string,5000", notNull = false) + private String orderPassId; // 3.定稿审核通过编号,多个用逗号隔开 + @AnTableField(column = "ORDER_BACK_ID", type = "string,500", notNull = false) + private String orderBackId; // 4.定稿审核退回编号,多个用逗号隔开 + @AnTableField(column = "ORDER_PASS_SUM", type = "int", notNull = true) + private int orderPassSum; // 5.定稿审核通过总数(次数) + @AnTableField(column = "ORDER_BACK_SUM", type = "int", notNull = true) + private int orderBackSum; // 6.定稿审核退回总数(次数) + @AnTableField(column = "PASS_CONVERT_SUM", type = "decimal,15,1", notNull = true) + private double passConvertSum; // 7.定稿审核通过折算总数 + @AnTableField(column = "BACK_CONVERT_SUM", type = "decimal,15,1", notNull = true) + private double backConvertSum; // 8.定稿审核退回折算总数 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getCompleteDate() + { + return completeDate; + } + + public void setCompleteDate(String completeDate) + { + this.completeDate = completeDate; + } + + public String getOrderPassId() + { + return orderPassId; + } + + public void setOrderPassId(String orderPassId) + { + this.orderPassId = orderPassId; + } + + public String getOrderBackId() + { + return orderBackId; + } + + public void setOrderBackId(String orderBackId) + { + this.orderBackId = orderBackId; + } + + public int getOrderPassSum() + { + return orderPassSum; + } + + public void setOrderPassSum(int orderPassSum) + { + this.orderPassSum = orderPassSum; + } + + public int getOrderBackSum() + { + return orderBackSum; + } + + public void setOrderBackSum(int orderBackSum) + { + this.orderBackSum = orderBackSum; + } + + public double getPassConvertSum() + { + return passConvertSum; + } + + public void setPassConvertSum(double passConvertSum) + { + this.passConvertSum = passConvertSum; + } + + public double getBackConvertSum() + { + return backConvertSum; + } + + public void setBackConvertSum(double backConvertSum) + { + this.backConvertSum = backConvertSum; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/DesignGroup.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/DesignGroup.java new file mode 100644 index 0000000..465a536 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/DesignGroup.java @@ -0,0 +1,104 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 设计组表 对应表《DESIGN_GROUP》 + */ +@AnAlias("DesignGroup") +@AnNew +@AnTable(table="DESIGN_GROUP", key="GROUP_ID", type="InnoDB") +public class DesignGroup implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="GROUP_ID", type="long", notNull=true) private long groupId; //1.设计组编号 + @AnTableField(column="ORG_ID", type="long", notNull=true) private long orgId; //2.组织编号 + @AnTableField(column="GROUP_NAME", type="string,200", notNull=true) private String groupName; //3.设计组名称 + @AnTableField(column="GROUP_LEADER", type="string,64", notNull=true) private String groupLeader; //4.组长 + @AnTableField(column="GROUP_SEQ", type="int", notNull=true) private int groupSeq; //5.排序数 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //6.创建时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getGroupId() + { + return groupId; + } + + public void setGroupId(long groupId) + { + this.groupId = groupId; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getGroupName() + { + return groupName; + } + + public void setGroupName(String groupName) + { + this.groupName = groupName; + } + + public String getGroupLeader() + { + return groupLeader; + } + + public void setGroupLeader(String groupLeader) + { + this.groupLeader = groupLeader; + } + + public int getGroupSeq() + { + return groupSeq; + } + + public void setGroupSeq(int groupSeq) + { + this.groupSeq = groupSeq; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/DesignStandard.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/DesignStandard.java new file mode 100644 index 0000000..e7926fc --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/DesignStandard.java @@ -0,0 +1,92 @@ +/* + * 版权所有 (C) 2015 知启蒙(WWW.ZHIQIM.COM) 保留所有权利。 + * + * Download http://www.zhiqim.com/fadfox/ 欢迎加盟[凡狐]兴趣小组。 + * + * 由数据库字典自动生成的类文件,修改请使用数据库字典编辑器修改。 + */ +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 印前原因预录 对应表《CHECK_BACK_REASON》 + */ +@AnAlias("DesignStandard") +@AnNew +@AnTable(table="DESIGN_STANDRARD", key="STANDRARD_ID", type="InnoDB") +public class DesignStandard implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="STANDRARD_ID", type="long", notNull=true) private long standardId; //1.类型编号 + @AnTableField(column="IS_STANDRARD_TYPE", type="boolean", notNull=true) private boolean isStandardType; //类型 + @AnTableField(column="STANDRARD_PARENT", type="long", notNull=true) private long standardParent; //3.具体原因项 所属分类 + @AnTableField(column="STANDRARD_TITLE", type="string,200", notNull=true) private String standardTitle; //3.标题 + @AnTableField(column="STANDRARD_TEXT", type="string,200", notNull=true) private String standardText; //4.规范内容 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //6.创建时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getStandardId() { + return standardId; + } + + public void setStandardId(long standardId) { + this.standardId = standardId; + } + + + + public boolean isStandardType() { + return isStandardType; + } + + public void setStandardType(boolean isStandardType) { + this.isStandardType = isStandardType; + } + + public long getStandardParent() { + return standardParent; + } + + public void setStandardParent(long standardParent) { + this.standardParent = standardParent; + } + + public String getStandardTitle() { + return standardTitle; + } + + public void setStandardTitle(String standardTitle) { + this.standardTitle = standardTitle; + } + + public String getStandardText() { + return standardText; + } + + public void setStandardText(String standardText) { + this.standardText = standardText; + } + + public Timestamp getCreateTime() { + return createTime; + } + + public void setCreateTime(Timestamp createTime) { + this.createTime = createTime; + } + + + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/DesignerOrderPerformanceStat.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/DesignerOrderPerformanceStat.java new file mode 100644 index 0000000..aed6ab5 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/DesignerOrderPerformanceStat.java @@ -0,0 +1,190 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignerPerformanceStat.java + * 创建人 :gjx + * 创建时间:2021年3月8日 +*/ + +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * + * [简要描述]: 设计师订单绩效表
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年3月8日 新建与整理 + */ +@AnAlias("DesignerOrderPerformanceStat") +@AnNew +@AnTable(table = "DESIGNER_ORDER_PERFORMANCE_STAT", key = "DESIGN_ID", type = "InnoDB") +public class DesignerOrderPerformanceStat implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 订单编号 + @AnTableField(column = "DESIGNER", type = "string,20", notNull = true) + private String designer; // 设计师 + @AnTableField(column = "ORG_ID", type = "long", notNull = true) + private long orgId; // 组织编号 + @AnTableField(column = "PRINT_KS", type = "int", notNull = true) + private int printKs;// 款数 + @AnTableField(column = "TEMPLATE_DRAFT_FEE", type = "long", notNull = true) + private long templateDraftFee;// 改稿根据产品单价配置得出(改稿单价*款数) + @AnTableField(column = "PRD_CONVERT_FEE", type = "long", notNull = true) + private long prdConvertFee;// 产品单价 + @AnTableField(column = "MULTI_KS_FEE", type = "long", notNull = true) + private long multiKsFee;// 多款费用 + @AnTableField(column = "MULTI_MS_FEE", type = "long", notNull = true) + private long multiMsFee;// 多模费用 + @AnTableField(column = "DESIGN_COPIES", type = "int", notNull = true) + private int designCopies;// 设计份数 + @AnTableField(column = "ORDER_DESIGNER_FEE", type = "long", notNull = true) + private long orderDesignerFee;// 订单设计师费用 + @AnTableField(column = "DESIGN_END_TIME", type = "datetime", notNull = true) + private Timestamp designEndTime; // 设计师定稿时间 + @AnTableField(column = "ADD_TIME", type = "datetime", notNull = true) + private Timestamp addTime; // 添加时间 + + public DesignerOrderPerformanceStat() + { + + } + + public DesignerOrderPerformanceStat(long designId, String designer, long orgId) + { + super(); + this.designId = designId; + this.designer = designer; + this.orgId = orgId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public int getPrintKs() + { + return printKs; + } + + public void setPrintKs(int printKs) + { + this.printKs = printKs; + } + + public long getTemplateDraftFee() + { + return templateDraftFee; + } + + public void setTemplateDraftFee(long templateDraftFee) + { + this.templateDraftFee = templateDraftFee; + } + + public long getPrdConvertFee() + { + return prdConvertFee; + } + + public void setPrdConvertFee(long prdConvertFee) + { + this.prdConvertFee = prdConvertFee; + } + + public long getMultiKsFee() + { + return multiKsFee; + } + + public void setMultiKsFee(long multiKsFee) + { + this.multiKsFee = multiKsFee; + } + + public long getMultiMsFee() + { + return multiMsFee; + } + + public void setMultiMsFee(long multiMsFee) + { + this.multiMsFee = multiMsFee; + } + + public int getDesignCopies() + { + return designCopies; + } + + public void setDesignCopies(int designCopies) + { + this.designCopies = designCopies; + } + + public long getOrderDesignerFee() + { + return orderDesignerFee; + } + + public void setOrderDesignerFee(long orderDesignerFee) + { + this.orderDesignerFee = orderDesignerFee; + } + + public Timestamp getDesignEndTime() + { + return designEndTime; + } + + public void setDesignEndTime(Timestamp designEndTime) + { + this.designEndTime = designEndTime; + } + + public Timestamp getAddTime() + { + return addTime; + } + + public void setAddTime(Timestamp addTime) + { + this.addTime = addTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/GroupMembers.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/GroupMembers.java new file mode 100644 index 0000000..345a980 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/GroupMembers.java @@ -0,0 +1,94 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 人员调度表 对应表《GROUP_MEMBERS》 + */ +@AnAlias("GroupMembers") +@AnNew +@AnTable(table="GROUP_MEMBERS", key="START_DATE,USER_CODE", type="InnoDB") +@AnIndex({@AnIndexValue(name="IX_GROUP_ID", column="GROUP_ID", unique=false), + @AnIndexValue(name="IX_START_DATE_END_DATE", column="START_DATE,END_DATE", unique=false)}) +public class GroupMembers implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="START_DATE", type="string,64", notNull=true) private String startDate; //1.调控时期 + @AnTableField(column="USER_CODE", type="string,100", notNull=true) private String userCode; //2.操作员 + @AnTableField(column="END_DATE", type="string,32", notNull=false) private String endDate; //3.调控结束时间,格式yyyy-MM-dd + @AnTableField(column="GROUP_ID", type="long", notNull=true) private long groupId; //4.组编号 + @AnTableField(column="IS_GROUP_LEADER", type="int", notNull=true) private int isGroupLeader; //5.是否为组长 0=组员, 1=组长 + + public String toString() + { + return Jsons.toString(this); + } + + public String getStartDate() + { + return startDate; + } + + public void setStartDate(String startDate) + { + this.startDate = startDate; + } + + public String getUserCode() + { + return userCode; + } + + public void setUserCode(String userCode) + { + this.userCode = userCode; + } + + public String getEndDate() + { + return endDate; + } + + public void setEndDate(String endDate) + { + this.endDate = endDate; + } + + public long getGroupId() + { + return groupId; + } + + public void setGroupId(long groupId) + { + this.groupId = groupId; + } + + public int getIsGroupLeader() + { + return isGroupLeader; + } + + public void setIsGroupLeader(int isGroupLeader) + { + this.isGroupLeader = isGroupLeader; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/OrderConvert.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/OrderConvert.java new file mode 100644 index 0000000..e5df8ff --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/OrderConvert.java @@ -0,0 +1,126 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 订单折算配置表 对应表《ORDER_CONVERT》 + */ +@AnAlias("OrderConvert") +@AnNew +@AnTable(table="ORDER_CONVERT", key="CONVERT_ID", type="InnoDB") +public class OrderConvert implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="CONVERT_ID", type="long", notNull=true) private long convertId; //1.订单折算id + @AnTableField(column="CONVERT_TYPE", type="int", notNull=true) private int convertType; //2.订单折算类型,0不启用,1金额,2系数 + @AnTableField(column="CONVERT_NUM", type="decimal,10,2", notNull=true) private double convertNum; //3.订单折算系数 + @AnTableField(column="PRD_TYPE_ID", type="long", notNull=true) private long prdTypeId; //4.产品类型id + @AnTableField(column="PRD_TYPE_NAME", type="string,32", notNull=true) private String prdTypeName; //5.产品类型名称 + @AnTableField(column="CONVERT_MODULUS", type="string,500", notNull=true) private String convertModulus; //6.折算模数,最小为2模,模数唯一 + @AnTableField(column="CONVERT_MODULUS_NUM", type="string,500", notNull=true) private String convertModulusNum; //7.模数折算系数 + @AnTableField(column="MODIFY_TIME", type="datetime", notNull=true) private Timestamp modifyTime; //8.最后修改时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getConvertId() + { + return convertId; + } + + public void setConvertId(long convertId) + { + this.convertId = convertId; + } + + public int getConvertType() + { + return convertType; + } + + public void setConvertType(int convertType) + { + this.convertType = convertType; + } + + public double getConvertNum() + { + return convertNum; + } + + public void setConvertNum(double convertNum) + { + this.convertNum = convertNum; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public String getPrdTypeName() + { + return prdTypeName; + } + + public void setPrdTypeName(String prdTypeName) + { + this.prdTypeName = prdTypeName; + } + + public String getConvertModulus() + { + return convertModulus; + } + + public void setConvertModulus(String convertModulus) + { + this.convertModulus = convertModulus; + } + + public String getConvertModulusNum() + { + return convertModulusNum; + } + + public void setConvertModulusNum(String convertModulusNum) + { + this.convertModulusNum = convertModulusNum; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/OrderTypeStat.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/OrderTypeStat.java new file mode 100644 index 0000000..66ced49 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/OrderTypeStat.java @@ -0,0 +1,257 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 订单类型统计表 对应表《ORDER_TYPE_STAT》 + */ +@AnAlias("OrderTypeStat") +@AnNew +@AnTable(table="ORDER_TYPE_STAT", key="DESIGNER,DATE", type="InnoDB") +public class OrderTypeStat implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="DESIGNER", type="string,64", notNull=true) private String designer; //1.设计师 + @AnTableField(column="DATE", type="string,19", notNull=true) private String date; //2.统计日期 + @AnTableField(column="ORG_ID", type="long", notNull=true) private long orgId; //3.设计师所属组织,方便查询 + @AnTableField(column="ORDER_SUM", type="int", notNull=true) private int orderSum; //4.订单完成总数 + @AnTableField(column="MULTIPLE3_5", type="int", notNull=true) private int multiple35; //5.3-5款订单数量 + @AnTableField(column="MULTIPLE6_8", type="int", notNull=true) private int multiple68; //6.6-8款订单数量 + @AnTableField(column="MULTIPLE9_11", type="int", notNull=true) private int multiple911; //7.9-11款订单数量 + @AnTableField(column="MULTIPLE12", type="int", notNull=true) private int multiple12; //8.12款以上订单数量 + @AnTableField(column="NORMAL_PROCESSING", type="int", notNull=true) private int normalProcessing; //9.常规后加工订单数量 + @AnTableField(column="SPECIAL_PROCESSING", type="int", notNull=true) private int specialProcessing; //10.特殊后加工订单数量 + @AnTableField(column="APPLY_ORDER", type="int", notNull=true) private int applyOrder; //11.支援订单数量 + @AnTableField(column="AMOUNT100_150", type="int", notNull=true) private int amount100150; //12.大金额(100-150,左闭右开)订单数量 + @AnTableField(column="AMOUNT150_200", type="int", notNull=true) private int amount150200; //13.大金额(150-200,左闭右开)订单数量 + @AnTableField(column="AMOUNT200_250", type="int", notNull=true) private int amount200250; //14.大金额(200-250,左闭右开)订单数量 + @AnTableField(column="AMOUNT250_300", type="int", notNull=true) private int amount250300; //15.大金额(250_300,左闭右开)订单数量 + @AnTableField(column="AMOUNT300_350", type="int", notNull=true) private int amount300350; //16.大金额(300-350,左闭右开)订单数量 + @AnTableField(column="AMOUNT350_400", type="int", notNull=true) private int amount350400; //17.大金额(350-400,左闭右开)订单数量 + @AnTableField(column="AMOUNT400_450", type="int", notNull=true) private int amount400450; //18.大金额(400-450,左闭右开)订单数量 + @AnTableField(column="AMOUNT450_500", type="int", notNull=true) private int amount450500; //19.大金额(450-500,左闭右开)订单数量 + @AnTableField(column="AMOUNT500", type="int", notNull=true) private int amount500; //20.大金额(500以上)订单数量 + + public String toString() + { + return Jsons.toString(this); + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getDate() + { + return date; + } + + public void setDate(String date) + { + this.date = date; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public int getOrderSum() + { + return orderSum; + } + + public void setOrderSum(int orderSum) + { + this.orderSum = orderSum; + } + + public int getMultiple35() + { + return multiple35; + } + + public void setMultiple35(int multiple35) + { + this.multiple35 = multiple35; + } + + public int getMultiple68() + { + return multiple68; + } + + public void setMultiple68(int multiple68) + { + this.multiple68 = multiple68; + } + + public int getMultiple911() + { + return multiple911; + } + + public void setMultiple911(int multiple911) + { + this.multiple911 = multiple911; + } + + public int getMultiple12() + { + return multiple12; + } + + public void setMultiple12(int multiple12) + { + this.multiple12 = multiple12; + } + + public int getNormalProcessing() + { + return normalProcessing; + } + + public void setNormalProcessing(int normalProcessing) + { + this.normalProcessing = normalProcessing; + } + + public int getSpecialProcessing() + { + return specialProcessing; + } + + public void setSpecialProcessing(int specialProcessing) + { + this.specialProcessing = specialProcessing; + } + + public int getApplyOrder() + { + return applyOrder; + } + + public void setApplyOrder(int applyOrder) + { + this.applyOrder = applyOrder; + } + + public int getAmount100150() + { + return amount100150; + } + + public void setAmount100150(int amount100150) + { + this.amount100150 = amount100150; + } + + public int getAmount150200() + { + return amount150200; + } + + public void setAmount150200(int amount150200) + { + this.amount150200 = amount150200; + } + + public int getAmount200250() + { + return amount200250; + } + + public void setAmount200250(int amount200250) + { + this.amount200250 = amount200250; + } + + public int getAmount250300() + { + return amount250300; + } + + public void setAmount250300(int amount250300) + { + this.amount250300 = amount250300; + } + + public int getAmount300350() + { + return amount300350; + } + + public void setAmount300350(int amount300350) + { + this.amount300350 = amount300350; + } + + public int getAmount350400() + { + return amount350400; + } + + public void setAmount350400(int amount350400) + { + this.amount350400 = amount350400; + } + + public int getAmount400450() + { + return amount400450; + } + + public void setAmount400450(int amount400450) + { + this.amount400450 = amount400450; + } + + public int getAmount450500() + { + return amount450500; + } + + public void setAmount450500(int amount450500) + { + this.amount450500 = amount450500; + } + + public int getAmount500() + { + return amount500; + } + + public void setAmount500(int amount500) + { + this.amount500 = amount500; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/PerformanceParam.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/PerformanceParam.java new file mode 100644 index 0000000..caf1fe2 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/PerformanceParam.java @@ -0,0 +1,202 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 设计绩效参数表,上线日志表 对应表《PERFORMANCE_PARAM》 + */ +@AnAlias("PerformanceParam") +@AnNew +@AnTable(table="PERFORMANCE_PARAM", key="VALID_DATE,ORG_ID,PRICE_TYPE", type="InnoDB") +public class PerformanceParam implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="VALID_DATE", type="string,32", notNull=true) private String validDate; //1.数据生效日期,数据格式 yyyy-MM-dd + @AnTableField(column="ORG_ID", type="long", notNull=true) private long orgId; //2.组织编号 + @AnTableField(column="PRICE_TYPE", type="int", notNull=true) private int priceType; //3.单价类型0=设计师,1=设计组 + @AnTableField(column="PRICE_LEVEL_1", type="long", notNull=true) private long priceLevel1; //4.一级对应单价 + @AnTableField(column="PRICE_LEVEL_2", type="long", notNull=true) private long priceLevel2; //5.二级对应单价 + @AnTableField(column="PRICE_LEVEL_3", type="long", notNull=true) private long priceLevel3; //6.三级对应单价 + @AnTableField(column="PRICE_LEVEL_4", type="long", notNull=true) private long priceLevel4; //7.四级对应单价 + @AnTableField(column="PRICE_LEVEL_5", type="long", notNull=true) private long priceLevel5; //8.五级对应单价 + @AnTableField(column="PRICE_LEVEL_6", type="long", notNull=true) private long priceLevel6; //9.六级对应单价 + @AnTableField(column="LEVEL_1_MAX_COUNT", type="int", notNull=true) private int level1MaxCount; //10.一级单数上限 + @AnTableField(column="LEVEL_2_MAX_COUNT", type="int", notNull=true) private int level2MaxCount; //11.二级单数上限 + @AnTableField(column="LEVEL_3_MAX_COUNT", type="int", notNull=true) private int level3MaxCount; //12.三级单数上限 + @AnTableField(column="LEVEL_4_MAX_COUNT", type="int", notNull=true) private int level4MaxCount; //13.四级单数上限 + @AnTableField(column="LEVEL_5_MAX_COUNT", type="int", notNull=true) private int level5MaxCount; //14.五级单数上限 + @AnTableField(column="LEVEL_6_MAX_COUNT", type="int", notNull=true) private int level6MaxCount; //15.六级单数上限 + + public String toString() + { + return Jsons.toString(this); + } + + public String getValidDate() + { + return validDate; + } + + public void setValidDate(String validDate) + { + this.validDate = validDate; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public int getPriceType() + { + return priceType; + } + + public void setPriceType(int priceType) + { + this.priceType = priceType; + } + + public long getPriceLevel1() + { + return priceLevel1; + } + + public void setPriceLevel1(long priceLevel1) + { + this.priceLevel1 = priceLevel1; + } + + public long getPriceLevel2() + { + return priceLevel2; + } + + public void setPriceLevel2(long priceLevel2) + { + this.priceLevel2 = priceLevel2; + } + + public long getPriceLevel3() + { + return priceLevel3; + } + + public void setPriceLevel3(long priceLevel3) + { + this.priceLevel3 = priceLevel3; + } + + public long getPriceLevel4() + { + return priceLevel4; + } + + public void setPriceLevel4(long priceLevel4) + { + this.priceLevel4 = priceLevel4; + } + + public long getPriceLevel5() + { + return priceLevel5; + } + + public void setPriceLevel5(long priceLevel5) + { + this.priceLevel5 = priceLevel5; + } + + public long getPriceLevel6() + { + return priceLevel6; + } + + public void setPriceLevel6(long priceLevel6) + { + this.priceLevel6 = priceLevel6; + } + + public int getLevel1MaxCount() + { + return level1MaxCount; + } + + public void setLevel1MaxCount(int level1MaxCount) + { + this.level1MaxCount = level1MaxCount; + } + + public int getLevel2MaxCount() + { + return level2MaxCount; + } + + public void setLevel2MaxCount(int level2MaxCount) + { + this.level2MaxCount = level2MaxCount; + } + + public int getLevel3MaxCount() + { + return level3MaxCount; + } + + public void setLevel3MaxCount(int level3MaxCount) + { + this.level3MaxCount = level3MaxCount; + } + + public int getLevel4MaxCount() + { + return level4MaxCount; + } + + public void setLevel4MaxCount(int level4MaxCount) + { + this.level4MaxCount = level4MaxCount; + } + + public int getLevel5MaxCount() + { + return level5MaxCount; + } + + public void setLevel5MaxCount(int level5MaxCount) + { + this.level5MaxCount = level5MaxCount; + } + + public int getLevel6MaxCount() + { + return level6MaxCount; + } + + public void setLevel6MaxCount(int level6MaxCount) + { + this.level6MaxCount = level6MaxCount; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/PerformanceStatistics.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/PerformanceStatistics.java new file mode 100644 index 0000000..a12e6b4 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/PerformanceStatistics.java @@ -0,0 +1,231 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 绩效统计表 对应表《PERFORMANCE_STATISTICS》 + */ +@AnAlias("PerformanceStatistics") +@AnNew +@AnTable(table = "PERFORMANCE_STATISTICS", key = "STAT_DATE,DESIGNER", type = "InnoDB") +public class PerformanceStatistics implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "STAT_DATE", type = "string,12", notNull = true) + private String statDate; // 1.统计日期 + @AnTableField(column = "DESIGNER", type = "string,64", notNull = true) + private String designer; // 2.设计师 + @AnTableField(column = "IS_GROUP_LEADER", type = "byte", notNull = true) + private int isGroupLeader; // 3.0表示设计师,1表示设计组长 + @AnTableField(column = "DESIGN_COMPLETE_SUM", type = "decimal,15,1", notNull = true) + private double designCompleteSum; // 4.设计定稿折算单数 + @AnTableField(column = "DESIGN_AMOUNT", type = "long", notNull = true) + private long designAmount; // 5.设计绩效金额 + @AnTableField(column = "ORDER_TYPE_SUM", type = "int", notNull = true) + private int orderTypeSum; // 6.订单类型单数 + @AnTableField(column = "ORDER_TYPE_AMOUNT", type = "long", notNull = true) + private long orderTypeAmount; // 7.订单类型绩效金额 + @AnTableField(column = "REFUND_SUM", type = "int", notNull = true) + private int refundSum; // 8.退款单数 + @AnTableField(column = "DESIGN_COUNT", type = "int", notNull = true) + private int designCount; // 9.设计总单数 + @AnTableField(column = "REFUND_RATE", type = "long", notNull = true) + private long refundRate; // 10.退款率 + @AnTableField(column = "REFUND_AMOUNT", type = "long", notNull = true) + private long refundAmount; // 11.退款绩效统计 + @AnTableField(column = "AFTER_COUNT", type = "int", notNull = false) + private int afterCount; // 12.售后单数 + @AnTableField(column = "AFTER_LOSS_AMOUNT", type = "long", notNull = true) + private long afterLossAmount; // 13.售后损失总金额 + @AnTableField(column = "AFTER_LOSS_AMOUNT_CANCELED", type = "long", notNull = true) + private long afterLossAmountCanceled; // 14.售后取消&售后审核通过的售后损失金额 + @AnTableField(column = "QC_SCORE", type = "decimal,5,2", notNull = false) + private double qcScore; // 15.质检分数 + @AnTableField(column = "QC_AMOUNT", type = "long", notNull = false) + private long qcAmount; // 16.质检金额 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getStatDate() + { + return statDate; + } + + public void setStatDate(String statDate) + { + this.statDate = statDate; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public int getIsGroupLeader() + { + return isGroupLeader; + } + + public void setIsGroupLeader(int isGroupLeader) + { + this.isGroupLeader = isGroupLeader; + } + + public double getDesignCompleteSum() + { + return designCompleteSum; + } + + public void setDesignCompleteSum(double designCompleteSum) + { + this.designCompleteSum = designCompleteSum; + } + + public long getDesignAmount() + { + return designAmount; + } + + public void setDesignAmount(long designAmount) + { + this.designAmount = designAmount; + } + + public int getOrderTypeSum() + { + return orderTypeSum; + } + + public void setOrderTypeSum(int orderTypeSum) + { + this.orderTypeSum = orderTypeSum; + } + + public long getOrderTypeAmount() + { + return orderTypeAmount; + } + + public void setOrderTypeAmount(long orderTypeAmount) + { + this.orderTypeAmount = orderTypeAmount; + } + + public int getRefundSum() + { + return refundSum; + } + + public void setRefundSum(int refundSum) + { + this.refundSum = refundSum; + } + + public int getDesignCount() + { + return designCount; + } + + public void setDesignCount(int designCount) + { + this.designCount = designCount; + } + + public long getRefundRate() + { + return refundRate; + } + + public void setRefundRate(long refundRate) + { + this.refundRate = refundRate; + } + + public long getRefundAmount() + { + return refundAmount; + } + + public void setRefundAmount(long refundAmount) + { + this.refundAmount = refundAmount; + } + + public int getAfterCount() + { + return afterCount; + } + + public void setAfterCount(int afterCount) + { + this.afterCount = afterCount; + } + + public long getAfterLossAmount() + { + return afterLossAmount; + } + + public void setAfterLossAmount(long afterLossAmount) + { + this.afterLossAmount = afterLossAmount; + } + + public long getAfterLossAmountCanceled() + { + return afterLossAmountCanceled; + } + + public void setAfterLossAmountCanceled(long afterLossAmountCanceled) + { + this.afterLossAmountCanceled = afterLossAmountCanceled; + } + + public double getQcScore() + { + return qcScore; + } + + public void setQcScore(double qcScore) + { + this.qcScore = qcScore; + } + + public long getQcAmount() + { + return qcAmount; + } + + public void setQcAmount(long qcAmount) + { + this.qcAmount = qcAmount; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/PrdFeePercentage.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/PrdFeePercentage.java new file mode 100644 index 0000000..cc33193 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/PrdFeePercentage.java @@ -0,0 +1,112 @@ +package com.zhiqim.yangcai.design.dbo.stat; + +/** + * + * [简要描述]:提成系数Model
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-11-21 新建与整理 + */ +public class PrdFeePercentage +{ + private long deptId; // 1.部门ID + private long prdTypeId; // 2.产品类型 + private int feeValid; // 3.规定时间,单位分钟 + private int feeHigh; // 4.高提成,单位‰(千分制) + private int feeLow; // 5.低提成,单位‰(千分制) + private int feeDisabled; // 6.失效时间,单位分钟 + private int feeType; // 7.计费类型,0:按单量,1:按比例, + private long feeDiscountAmount; // 8.折算金额,单位分 + private int feeDiscountMethod; // 9.折算方式,0:不启用,1:金额,2:系数 + + public long getDeptId() + { + return deptId; + } + + public void setDeptId(long deptId) + { + this.deptId = deptId; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public int getFeeValid() + { + return feeValid; + } + + public void setFeeValid(int feeValid) + { + this.feeValid = feeValid; + } + + public int getFeeHigh() + { + return feeHigh; + } + + public void setFeeHigh(int feeHigh) + { + this.feeHigh = feeHigh; + } + + public int getFeeLow() + { + return feeLow; + } + + public void setFeeLow(int feeLow) + { + this.feeLow = feeLow; + } + + public int getFeeDisabled() + { + return feeDisabled; + } + + public void setFeeDisabled(int feeDisabled) + { + this.feeDisabled = feeDisabled; + } + + public int getFeeType() + { + return feeType; + } + + public void setFeeType(int feeType) + { + this.feeType = feeType; + } + + public long getFeeDiscountAmount() + { + return feeDiscountAmount; + } + + public void setFeeDiscountAmount(long feeDiscountAmount) + { + this.feeDiscountAmount = feeDiscountAmount; + } + + public int getFeeDiscountMethod() + { + return feeDiscountMethod; + } + + public void setFeeDiscountMethod(int feeDiscountMethod) + { + this.feeDiscountMethod = feeDiscountMethod; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/QcPerformanceParam.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/QcPerformanceParam.java new file mode 100644 index 0000000..c39ecc0 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/QcPerformanceParam.java @@ -0,0 +1,133 @@ +/** + * 扬彩印刷设计 + * 文件名 :QcPerformanceParam.java + * 创建人 :gjx + * 创建时间:2019-9-4 + */ + +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 质检绩效参数 + * + * @version 1.0 @author gjx 2019-9-4 新建与整理 + */ +@AnAlias("QcPerformanceParam") +@AnNew +@AnTable(table = "QC_PERFORMANCE_PARAM", key = "QC_PERFORMANCE_ID", type = "InnoDB") +public class QcPerformanceParam implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "QC_PERFORMANCE_ID", type = "long", notNull = true) + private long qcPerformanceId; // 1. 质检绩效参数编号 + @AnTableField(column = "STANDARD_QC_SCORE", type = "long", notNull = true) + private long standardQcScore; // 2. 标准质检分数 + @AnTableField(column = "REWARD_SCORE", type = "long", notNull = true) + private long rewardScore; // 3.奖励分 + @AnTableField(column = "PUNISH_SCORE", type = "long", notNull = true) + private long punishScore; // 4.扣罚分 + @AnTableField(column = "REWARD_AMOUNT", type = "long", notNull = true) + private long rewardAmount; // 5.奖励金额(单位元) + @AnTableField(column = "PUNISH_AMOUNT", type = "long", notNull = true) + private long punishAmount; // 6.扣罚金额(单位元) + @AnTableField(column = "REWARD_AMOUNT_MAX", type = "long", notNull = true) + private long rewardAmountMax; // 7.最大奖励金额(单位元) + @AnTableField(column = "PUNISH_AMOUNT_MAX", type = "long", notNull = true) + private long punishAmountMax; // 8.最大扣罚金额(单位元) + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getQcPerformanceId() + { + return qcPerformanceId; + } + + public void setQcPerformanceId(long qcPerformanceId) + { + this.qcPerformanceId = qcPerformanceId; + } + + public long getStandardQcScore() + { + return standardQcScore; + } + + public void setStandardQcScore(long standardQcScore) + { + this.standardQcScore = standardQcScore; + } + + public long getRewardScore() + { + return rewardScore; + } + + public void setRewardScore(long rewardScore) + { + this.rewardScore = rewardScore; + } + + public long getPunishScore() + { + return punishScore; + } + + public void setPunishScore(long punishScore) + { + this.punishScore = punishScore; + } + + public long getRewardAmount() + { + return rewardAmount; + } + + public void setRewardAmount(long rewardAmount) + { + this.rewardAmount = rewardAmount; + } + + public long getPunishAmount() + { + return punishAmount; + } + + public void setPunishAmount(long punishAmount) + { + this.punishAmount = punishAmount; + } + + public long getRewardAmountMax() + { + return rewardAmountMax; + } + + public void setRewardAmountMax(long rewardAmountMax) + { + this.rewardAmountMax = rewardAmountMax; + } + + public long getPunishAmountMax() + { + return punishAmountMax; + } + + public void setPunishAmountMax(long punishAmountMax) + { + this.punishAmountMax = punishAmountMax; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/RefundParameter.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/RefundParameter.java new file mode 100644 index 0000000..1772899 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/RefundParameter.java @@ -0,0 +1,147 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 退款参数表 对应表《REFUND_PARAMETER》 + */ +@AnAlias("RefundParameter") +@AnNew +@AnTable(table="REFUND_PARAMETER", key="REFUND_PARAMETER_ID", type="InnoDB") +public class RefundParameter implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="REFUND_PARAMETER_ID", type="long", notNull=true) private long refundParameterId; //1.退款参数编号 + @AnTableField(column="STANDARD_REFUND_RATE_FLOOR", type="long", notNull=true) private long standardRefundRateFloor; //2.标准退款率下限 + @AnTableField(column="STANDARD_REFUND_RATE", type="long", notNull=true) private long standardRefundRate; //3.标准退款率 + @AnTableField(column="STANDARD_REFUND_RATE_CEIL", type="long", notNull=true) private long standardRefundRateCeil; //4.标准退款率上限 + @AnTableField(column="REWARD_DOT", type="long", notNull=true) private long rewardDot; //5.奖励点 + @AnTableField(column="PUNISH_DOT", type="long", notNull=true) private long punishDot; //6.扣罚点 + @AnTableField(column="REWARD_AMOUNT", type="long", notNull=true) private long rewardAmount; //7.每下降一个点奖励金额 + @AnTableField(column="PUNISH_AMOUNT", type="long", notNull=true) private long punishAmount; //8.每上升一个点扣罚金额 + @AnTableField(column="REWARD_AMOUNT_MAX", type="long", notNull=true) private long rewardAmountMax; //9.奖励金额上限 + @AnTableField(column="PUNISH_AMOUNT_MAX", type="long", notNull=true) private long punishAmountMax; //10.扣罚金额上限 + + public String toString() + { + return Jsons.toString(this); + } + + public long getRefundParameterId() + { + return refundParameterId; + } + + public void setRefundParameterId(long refundParameterId) + { + this.refundParameterId = refundParameterId; + } + + public long getStandardRefundRateFloor() + { + return standardRefundRateFloor; + } + + public void setStandardRefundRateFloor(long standardRefundRateFloor) + { + this.standardRefundRateFloor = standardRefundRateFloor; + } + + public long getStandardRefundRate() + { + return standardRefundRate; + } + + public void setStandardRefundRate(long standardRefundRate) + { + this.standardRefundRate = standardRefundRate; + } + + public long getStandardRefundRateCeil() + { + return standardRefundRateCeil; + } + + public void setStandardRefundRateCeil(long standardRefundRateCeil) + { + this.standardRefundRateCeil = standardRefundRateCeil; + } + + public long getRewardDot() + { + return rewardDot; + } + + public void setRewardDot(long rewardDot) + { + this.rewardDot = rewardDot; + } + + public long getPunishDot() + { + return punishDot; + } + + public void setPunishDot(long punishDot) + { + this.punishDot = punishDot; + } + + public long getRewardAmount() + { + return rewardAmount; + } + + public void setRewardAmount(long rewardAmount) + { + this.rewardAmount = rewardAmount; + } + + public long getPunishAmount() + { + return punishAmount; + } + + public void setPunishAmount(long punishAmount) + { + this.punishAmount = punishAmount; + } + + public long getRewardAmountMax() + { + return rewardAmountMax; + } + + public void setRewardAmountMax(long rewardAmountMax) + { + this.rewardAmountMax = rewardAmountMax; + } + + public long getPunishAmountMax() + { + return punishAmountMax; + } + + public void setPunishAmountMax(long punishAmountMax) + { + this.punishAmountMax = punishAmountMax; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/SpecialOrderType.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/SpecialOrderType.java new file mode 100644 index 0000000..e30a684 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/SpecialOrderType.java @@ -0,0 +1,81 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 特殊订单类型表 对应表《SPECIAL_ORDER_TYPE》 + */ +@AnAlias("SpecialOrderType") +@AnNew +@AnTable(table="SPECIAL_ORDER_TYPE", key="SPECIAL_TYPE_ID", type="InnoDB") +public class SpecialOrderType implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="SPECIAL_TYPE_ID", type="long", notNull=true) private long specialTypeId; //1.特殊订单类型编号 + @AnTableField(column="SPECIAL_ORDER_DESCRIBE", type="string,200", notNull=true) private String specialOrderDescribe; //2.特殊订单描述 + @AnTableField(column="SPECIAL_ORDER_TYPE", type="string,200", notNull=true) private String specialOrderType; //3.特殊订单类型 + @AnTableField(column="SPECIAL_ORDER_AMOUNT", type="long", notNull=true) private long specialOrderAmount; //4.特殊订单类型每单奖励金额(单位分) + + public String toString() + { + return Jsons.toString(this); + } + + public long getSpecialTypeId() + { + return specialTypeId; + } + + public void setSpecialTypeId(long specialTypeId) + { + this.specialTypeId = specialTypeId; + } + + public String getSpecialOrderDescribe() + { + return specialOrderDescribe; + } + + public void setSpecialOrderDescribe(String specialOrderDescribe) + { + this.specialOrderDescribe = specialOrderDescribe; + } + + public String getSpecialOrderType() + { + return specialOrderType; + } + + public void setSpecialOrderType(String specialOrderType) + { + this.specialOrderType = specialOrderType; + } + + public long getSpecialOrderAmount() + { + return specialOrderAmount; + } + + public void setSpecialOrderAmount(long specialOrderAmount) + { + this.specialOrderAmount = specialOrderAmount; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/TimelinessParameter.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/TimelinessParameter.java new file mode 100644 index 0000000..086b509 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/stat/TimelinessParameter.java @@ -0,0 +1,57 @@ +package com.zhiqim.yangcai.design.dbo.stat; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 时效绩效参数表 对应表《TIMELINESS_PARAMETER》 + */ +@AnAlias("TimelinessParameter") +@AnNew +@AnTable(table = "TIMELINESS_PARAMETER", key = "TIMELINESS_PARAMETER_ID", type = "InnoDB") +public class TimelinessParameter implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "TIMELINESS_PARAMETER_ID", type = "long", notNull = true) + private long timelinessParameterId; // 1.时效参数编号 + @AnTableField(column = "PRD_TYPE_ID", type = "long", notNull = true) + private long prdTypeId; // 2.产品类型id + @AnTableField(column = "REWARD_AMOUNT", type = "long", notNull = true) + private long rewardAmount; // 3.奖励金额 + + public long getTimelinessParameterId() + { + return timelinessParameterId; + } + + public void setTimelinessParameterId(long timelinessParameterId) + { + this.timelinessParameterId = timelinessParameterId; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public long getRewardAmount() + { + return rewardAmount; + } + + public void setRewardAmount(long rewardAmount) + { + this.rewardAmount = rewardAmount; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/subscribe/SubscribeDesignerQuotaRecord.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/subscribe/SubscribeDesignerQuotaRecord.java new file mode 100644 index 0000000..8ad3b38 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/subscribe/SubscribeDesignerQuotaRecord.java @@ -0,0 +1,280 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.subscribe; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 预约-设计师预约记录 对应表《subscribe_designer_quota_record》 + */ +@AnAlias("SubscribeDesignerQuotaRecord") +@AnNew +@AnTable(table = "subscribe_designer_quota_record", key = "record_id", type = "InnoDB") +public class SubscribeDesignerQuotaRecord implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "record_id", type = "long", notNull = true) + private long recordId; // 1.预约记录id + @AnTableField(column = "operator_code", type = "string,32", notNull = true) + private String operatorCode; // 2.设计师 + @AnTableField(column = "designer_lever_id", type = "long", notNull = true) + private long designerLeverId; // 3.当时设计师等级id + @AnTableField(column = "designer_lever", type = "string,32", notNull = false) + private String designerLever; // 4.当时设计师等级 + @AnTableField(column = "min_quota", type = "int", notNull = false) + private int minQuota; // 5.当时预约额度下限 + @AnTableField(column = "max_quota", type = "int", notNull = false) + private int maxQuota; // 6.当时预约额度上限 + @AnTableField(column = "max_drafted", type = "int", notNull = false) + private int maxDrafted; // 7.当时未定稿额度上限 + @AnTableField(column = "org_id", type = "long", notNull = true) + private long orgId; // 8.所属组织id + @AnTableField(column = "duty_time", type = "int", notNull = true) + private int dutyTime; // 9.预约日期(格式20190101) + @AnTableField(column = "duty_id", type = "long", notNull = false) + private long dutyId; // 10.预约班次 + @AnTableField(column = "duty_name", type = "string,32", notNull = false) + private String dutyName; // 11.预约班次名称 + @AnTableField(column = "subscribe_state", type = "int", notNull = true) + private int subscribeState; // 12.预约状态:1=未预约;2=已预约; + @AnTableField(column = "subscribe_num", type = "int", notNull = false) + private int subscribeNum; // 13.预约数量 + @AnTableField(column = "finished_num", type = "int", notNull = false) + private int finishedNum; // 14.完成数量 + @AnTableField(column = "state", type = "int", notNull = true) + private int state; // 15.状态:0=失效;1=生效; + @AnTableField(column = "remark", type = "string,100", notNull = false) + private String remark; // 16.备注 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 56.创建时间 + @AnTableField(column = "MODIFY_TIME", type = "datetime", notNull = false) + private Timestamp modifyTime; // 57.修改时间 + + private int dingGaoSum; // 定稿数量 + + private int jieDanOnlineTime; // 接单时长 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getRecordId() + { + return recordId; + } + + public void setRecordId(long recordId) + { + this.recordId = recordId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getDesignerLeverId() + { + return designerLeverId; + } + + public void setDesignerLeverId(long designerLeverId) + { + this.designerLeverId = designerLeverId; + } + + public String getDesignerLever() + { + return designerLever; + } + + public void setDesignerLever(String designerLever) + { + this.designerLever = designerLever; + } + + public int getMinQuota() + { + return minQuota; + } + + public void setMinQuota(int minQuota) + { + this.minQuota = minQuota; + } + + public int getMaxQuota() + { + return maxQuota; + } + + public void setMaxQuota(int maxQuota) + { + this.maxQuota = maxQuota; + } + + public int getMaxDrafted() + { + return maxDrafted; + } + + public void setMaxDrafted(int maxDrafted) + { + this.maxDrafted = maxDrafted; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public int getDutyTime() + { + return dutyTime; + } + + public void setDutyTime(int dutyTime) + { + this.dutyTime = dutyTime; + } + + public long getDutyId() + { + return dutyId; + } + + public void setDutyId(long dutyId) + { + this.dutyId = dutyId; + } + + public String getDutyName() + { + return dutyName; + } + + public void setDutyName(String dutyName) + { + this.dutyName = dutyName; + } + + public int getSubscribeState() + { + return subscribeState; + } + + public void setSubscribeState(int subscribeState) + { + this.subscribeState = subscribeState; + } + + public int getSubscribeNum() + { + return subscribeNum; + } + + public void setSubscribeNum(int subscribeNum) + { + this.subscribeNum = subscribeNum; + } + + public int getFinishedNum() + { + return finishedNum; + } + + public void setFinishedNum(int finishedNum) + { + this.finishedNum = finishedNum; + } + + public int getState() + { + return state; + } + + public void setState(int state) + { + this.state = state; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + + public int getDingGaoSum() + { + return dingGaoSum; + } + + public void setDingGaoSum(int dingGaoSum) + { + this.dingGaoSum = dingGaoSum; + } + + public int getJieDanOnlineTime() + { + return jieDanOnlineTime; + } + + public void setJieDanOnlineTime(int jieDanOnlineTime) + { + this.jieDanOnlineTime = jieDanOnlineTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/subscribe/SubscribeOrgTempQuota.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/subscribe/SubscribeOrgTempQuota.java new file mode 100644 index 0000000..a0b5caa --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/subscribe/SubscribeOrgTempQuota.java @@ -0,0 +1,124 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.subscribe; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 预约-组织临时额度配置 对应表《subscribe_org_temp_quota》 + */ +@AnAlias("SubscribeOrgTempQuota") +@AnNew +@AnTable(table = "subscribe_org_temp_quota", key = "org_id", type = "InnoDB") +public class SubscribeOrgTempQuota implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "org_id", type = "long", notNull = true) + private long orgId; // 1.组织id + @AnTableField(column = "temp_quota", type = "int", notNull = true) + private int tempQuota; // 2.临时额度 + @AnTableField(column = "safe_line", type = "int", notNull = true) + private int safeLine; // 3.安全线(当前未分配订单数超安全线设置时自动使用临时额度) + @AnTableField(column = "state", type = "int", notNull = true) + private int state; // 4.状态:0=失效;1=生效; + @AnTableField(column = "remark", type = "string,100", notNull = false) + private String remark; // 5.备注 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 56.创建时间 + @AnTableField(column = "MODIFY_TIME", type = "datetime", notNull = false) + private Timestamp modifyTime; // 57.修改时间 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public int getTempQuota() + { + return tempQuota; + } + + public void setTempQuota(int tempQuota) + { + this.tempQuota = tempQuota; + } + + public int getSafeLine() + { + return safeLine; + } + + public void setSafeLine(int safeLine) + { + this.safeLine = safeLine; + } + + public int getState() + { + return state; + } + + public void setState(int state) + { + this.state = state; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/subscribe/ZoaOrdermeal.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/subscribe/ZoaOrdermeal.java new file mode 100644 index 0000000..a8fe137 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/subscribe/ZoaOrdermeal.java @@ -0,0 +1,123 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ +package com.zhiqim.yangcai.design.dbo.subscribe; + +import java.io.Serializable; +import java.sql.Timestamp; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +@AnAlias({"ZoaOrdermeal"}) +@AnNew +@AnTable(table="ZOA_ORDERMEAL", key="OPERATOR_CODE,ORDERMEAL_DATE,ORDERMEAL_TYPE", type="InnoDB") +public class ZoaOrdermeal + implements Serializable +{ + private static final long serialVersionUID = 1L; + @AnTableField(column="OPERATOR_CODE", type="string,32", notNull=true) + private String operatorCode; + @AnTableField(column="ORDERMEAL_DATE", type="int", notNull=true) + private int ordermealDate; + @AnTableField(column="ORDERMEAL_TYPE", type="byte", notNull=true) + private int ordermealType; + @AnTableField(column="ORDERMEAL_TIME", type="datetime", notNull=true) + private Timestamp ordermealTime; + @AnTableField(column="ORDERMEAL_CONFIRM", type="boolean", notNull=true) + private boolean ordermealConfirm; + @AnTableField(column="ORDERMEAL_CONFIRM_OPR", type="string,32", notNull=false) + private String ordermealConfirmOpr; + @AnTableField(column="ORDERMEAL_CONFIRM_TIME", type="datetime", notNull=false) + private Timestamp ordermealConfirmTime; + + public String toString() + { + return Jsons.toString(this); + } + + public String getOperatorCode() + { + return this.operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public int getOrdermealDate() + { + return this.ordermealDate; + } + + public void setOrdermealDate(int ordermealDate) + { + this.ordermealDate = ordermealDate; + } + + public int getOrdermealType() + { + return this.ordermealType; + } + + public void setOrdermealType(int ordermealType) + { + this.ordermealType = ordermealType; + } + + public Timestamp getOrdermealTime() + { + return this.ordermealTime; + } + + public void setOrdermealTime(Timestamp ordermealTime) + { + this.ordermealTime = ordermealTime; + } + + public boolean isOrdermealConfirm() + { + return this.ordermealConfirm; + } + + public void setOrdermealConfirm(boolean ordermealConfirm) + { + this.ordermealConfirm = ordermealConfirm; + } + + public String getOrdermealConfirmOpr() + { + return this.ordermealConfirmOpr; + } + + public void setOrdermealConfirmOpr(String ordermealConfirmOpr) + { + this.ordermealConfirmOpr = ordermealConfirmOpr; + } + + public Timestamp getOrdermealConfirmTime() + { + return this.ordermealConfirmTime; + } + + public void setOrdermealConfirmTime(Timestamp ordermealConfirmTime) + { + this.ordermealConfirmTime = ordermealConfirmTime; + } +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesErrorTemplate.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesErrorTemplate.java new file mode 100644 index 0000000..6cc76b9 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesErrorTemplate.java @@ -0,0 +1,81 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.template; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 错误模板 对应表《DES_ERROR_TEMPLATE》 + */ +@AnAlias("DesErrorTemplate") +@AnNew +@AnTable(table="DES_ERROR_TEMPLATE", key="MEDIA_ID", type="InnoDB") +public class DesErrorTemplate implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="MEDIA_ID", type="long", notNull=true) private long mediaId; //1.媒体编号 + @AnTableField(column="ERROR_TYPE", type="int", notNull=true) private int errorType; //2.0:背景图,1:素材图 + @AnTableField(column="ERROR_SITE", type="string,16", notNull=false) private String errorSite; //3.错误位置 + @AnTableField(column="ERROR_DESC", type="string,500", notNull=false) private String errorDesc; //4.描述 + + public String toString() + { + return Jsons.toString(this); + } + + public long getMediaId() + { + return mediaId; + } + + public void setMediaId(long mediaId) + { + this.mediaId = mediaId; + } + + public int getErrorType() + { + return errorType; + } + + public void setErrorType(int errorType) + { + this.errorType = errorType; + } + + public String getErrorSite() + { + return errorSite; + } + + public void setErrorSite(String errorSite) + { + this.errorSite = errorSite; + } + + public String getErrorDesc() + { + return errorDesc; + } + + public void setErrorDesc(String errorDesc) + { + this.errorDesc = errorDesc; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateEvent.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateEvent.java new file mode 100644 index 0000000..d3cb5a9 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateEvent.java @@ -0,0 +1,93 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.template; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 模板事件表 对应表《DES_TEMPLATE_EVENT》 + */ +@AnAlias("DesTemplateEvent") +@AnNew +@AnTable(table="DES_TEMPLATE_EVENT", key="EVENT_ID", type="InnoDB") +public class DesTemplateEvent implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="EVENT_ID", type="long", notNull=true) private long eventId; //1.事件ID + @AnTableField(column="MEDIA_ID", type="long", notNull=true) private long mediaId; //2.媒体编号 + @AnTableField(column="EVENT_TYPE", type="int", notNull=true) private int eventType; //3.事件类型(1代表浏览、2代表收藏,3代表给我分享的、4代表下载、5代表复制) + @AnTableField(column="OPERATOR_CODE", type="string,64", notNull=false) private String operatorCode; //4.操作人 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //5.创建时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getEventId() + { + return eventId; + } + + public void setEventId(long eventId) + { + this.eventId = eventId; + } + + public long getMediaId() + { + return mediaId; + } + + public void setMediaId(long mediaId) + { + this.mediaId = mediaId; + } + + public int getEventType() + { + return eventType; + } + + public void setEventType(int eventType) + { + this.eventType = eventType; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateEventView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateEventView.java new file mode 100644 index 0000000..1483ad2 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateEventView.java @@ -0,0 +1,138 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.template; + +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 模板事件关联表 对应视图《DES_TEMPLATE_EVENT_VIEW》 + */ +@AnAlias("DesTemplateEventView") +@AnNew +@AnView("MEDIA_TEMPLATE,MEDIA_CANVAS,DES_TEMPLATE_EVENT") +@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="MEDIA_TEMPLATE", lColumn="MEDIA_ID", rTable="MEDIA_CANVAS", rColumn="MEDIA_ID"), + @AnViewJoinValue(type="EQUAL", lTable="MEDIA_TEMPLATE", lColumn="MEDIA_ID", rTable="DES_TEMPLATE_EVENT", rColumn="MEDIA_ID")}) +public class DesTemplateEventView extends MediaTemplate +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="MEDIA_CANVAS", column="MEDIA_NAME") private String mediaName; //2.媒体名称 + @AnViewField(table="MEDIA_CANVAS", column="WIDTH") private double width; //3.画布宽度,单位像素 + @AnViewField(table="MEDIA_CANVAS", column="HEIGHT") private double height; //4.画布高度,单位像素 + @AnViewField(table="MEDIA_CANVAS", column="DPI") private int dpi; //5.分辨率 + @AnViewField(table="MEDIA_CANVAS", column="MEDIA_URL") private String mediaUrl; //6.媒体参考图片 + @AnViewField(table="MEDIA_CANVAS", column="CREATE_TIME") private String createTime; //7.创建时间 + @AnViewField(table="MEDIA_CANVAS", column="UPDATE_TIME") private String updateTime; //8.更新时间 + @AnViewField(table="DES_TEMPLATE_EVENT", column="EVENT_TYPE") private int eventType; //9.事件类型(1代表浏览、2代表收藏,3代表给我分享的、4代表下载、5代表复制) + @AnViewField(table="DES_TEMPLATE_EVENT", column="OPERATOR_CODE") private String operatorCode; //10.操作人 + + public String toString() + { + return Jsons.toString(this); + } + + public String getMediaName() + { + return mediaName; + } + + public void setMediaName(String mediaName) + { + this.mediaName = mediaName; + } + + public double getWidth() + { + return width; + } + + public void setWidth(double width) + { + this.width = width; + } + + public double getHeight() + { + return height; + } + + public void setHeight(double height) + { + this.height = height; + } + + public int getDpi() + { + return dpi; + } + + public void setDpi(int dpi) + { + this.dpi = dpi; + } + + public String getMediaUrl() + { + return mediaUrl; + } + + public void setMediaUrl(String mediaUrl) + { + this.mediaUrl = mediaUrl; + } + + public String getCreateTime() + { + return createTime; + } + + public void setCreateTime(String createTime) + { + this.createTime = createTime; + } + + public String getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(String updateTime) + { + this.updateTime = updateTime; + } + + public int getEventType() + { + return eventType; + } + + public void setEventType(int eventType) + { + this.eventType = eventType; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateIndexView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateIndexView.java new file mode 100644 index 0000000..5242bf5 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateIndexView.java @@ -0,0 +1,182 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.template; + +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 模板索引关联表 对应视图《DES_TEMPLATE_INDEX_VIEW》 + */ +@AnAlias("DesTemplateIndexView") +@AnNew +@AnView("MEDIA_TEMPLATE,DES_KEYWORD_INDEX,MEDIA_CANVAS") +@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="MEDIA_TEMPLATE", lColumn="MEDIA_ID", rTable="DES_KEYWORD_INDEX", rColumn="MEDIA_ID"), + @AnViewJoinValue(type="EQUAL", lTable="MEDIA_TEMPLATE", lColumn="MEDIA_ID", rTable="MEDIA_CANVAS", rColumn="MEDIA_ID")}) +public class DesTemplateIndexView extends MediaTemplate +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="MEDIA_CANVAS", column="MEDIA_NAME") private String mediaName; //2.媒体名称 + @AnViewField(table="MEDIA_CANVAS", column="WIDTH") private double width; //3.画布宽度,单位像素 + @AnViewField(table="MEDIA_CANVAS", column="HEIGHT") private double height; //4.画布高度,单位像素 + @AnViewField(table="MEDIA_CANVAS", column="WIDTH_MM") private double widthMm; //5.画布宽度,单位mm + @AnViewField(table="MEDIA_CANVAS", column="HEIGHT_MM") private double heightMm; //6.画布高度,单位mm + @AnViewField(table="MEDIA_CANVAS", column="DPI") private int dpi; //7.分辨率 + @AnViewField(table="MEDIA_CANVAS", column="MEDIA_URL") private String mediaUrl; //8.媒体参考图片 + @AnViewField(table="MEDIA_CANVAS", column="CREATE_TIME") private String createTime; //9.创建时间 + @AnViewField(table="MEDIA_CANVAS", column="UPDATE_TIME") private String updateTime; //10.更新时间 + @AnViewField(table="DES_KEYWORD_INDEX", column="LABEL_KEYWORD") private String labelKeyword; //11.标签关键词 + @AnViewField(table="DES_KEYWORD_INDEX", column="CUSTOM_LABEL_KEYWORD") private String customLabelKeyword; //12.自定义标签关键词 + @AnViewField(table="DES_KEYWORD_INDEX", column="LONG_TAIL_KEYWORD") private String longTailKeyword; //13.长尾词关键词 + @AnViewField(table="DES_KEYWORD_INDEX", column="MEDIA_SCORE") private int mediaScore; //14.模板指数 + + public String toString() + { + return Jsons.toString(this); + } + + public String getMediaName() + { + return mediaName; + } + + public void setMediaName(String mediaName) + { + this.mediaName = mediaName; + } + + public double getWidth() + { + return width; + } + + public void setWidth(double width) + { + this.width = width; + } + + public double getHeight() + { + return height; + } + + public void setHeight(double height) + { + this.height = height; + } + + public double getWidthMm() + { + return widthMm; + } + + public void setWidthMm(double widthMm) + { + this.widthMm = widthMm; + } + + public double getHeightMm() + { + return heightMm; + } + + public void setHeightMm(double heightMm) + { + this.heightMm = heightMm; + } + + public int getDpi() + { + return dpi; + } + + public void setDpi(int dpi) + { + this.dpi = dpi; + } + + public String getMediaUrl() + { + return mediaUrl; + } + + public void setMediaUrl(String mediaUrl) + { + this.mediaUrl = mediaUrl; + } + + public String getCreateTime() + { + return createTime; + } + + public void setCreateTime(String createTime) + { + this.createTime = createTime; + } + + public String getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(String updateTime) + { + this.updateTime = updateTime; + } + + public String getLabelKeyword() + { + return labelKeyword; + } + + public void setLabelKeyword(String labelKeyword) + { + this.labelKeyword = labelKeyword; + } + + public String getCustomLabelKeyword() + { + return customLabelKeyword; + } + + public void setCustomLabelKeyword(String customLabelKeyword) + { + this.customLabelKeyword = customLabelKeyword; + } + + public String getLongTailKeyword() + { + return longTailKeyword; + } + + public void setLongTailKeyword(String longTailKeyword) + { + this.longTailKeyword = longTailKeyword; + } + + public int getMediaScore() + { + return mediaScore; + } + + public void setMediaScore(int mediaScore) + { + this.mediaScore = mediaScore; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateLog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateLog.java new file mode 100644 index 0000000..5a7b541 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateLog.java @@ -0,0 +1,93 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.template; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 模板日志表 对应表《DES_TEMPLATE_LOG》 + */ +@AnAlias("DesTemplateLog") +@AnNew +@AnTable(table="DES_TEMPLATE_LOG", key="LOG_ID", type="InnoDB") +public class DesTemplateLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="LOG_ID", type="long", notNull=true) private long logId; //1.主键 + @AnTableField(column="MEDIA_ID", type="long", notNull=true) private long mediaId; //2.媒体编号 + @AnTableField(column="OPERATOR_CODE", type="string,64", notNull=true) private String operatorCode; //3.操作员 + @AnTableField(column="LOG_DESC", type="string,200", notNull=true) private String logDesc; //4.描述 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //5.创建时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getLogId() + { + return logId; + } + + public void setLogId(long logId) + { + this.logId = logId; + } + + public long getMediaId() + { + return mediaId; + } + + public void setMediaId(long mediaId) + { + this.mediaId = mediaId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public String getLogDesc() + { + return logDesc; + } + + public void setLogDesc(String logDesc) + { + this.logDesc = logDesc; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateOrder.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateOrder.java new file mode 100644 index 0000000..aab8d65 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateOrder.java @@ -0,0 +1,171 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dbo.template; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 订单模板参数表 对应表《DES_TEMPLATE_ORDER》 + */ +@AnAlias("DesTemplateOrder") +@AnNew +@AnTable(table = "DES_TEMPLATE_ORDER", key = "DESIGN_ID", type = "InnoDB") +public class DesTemplateOrder implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "DESIGN_ID", type = "long", notNull = true) + private long designId; // 1.订单号 + @AnTableField(column = "INDUSTRY_ID", type = "long", notNull = false) + private long industryId; // 2.行业ID + @AnTableField(column = "TYPE_ID", type = "long", notNull = true) + private long typeId; // 3.类型ID + @AnTableField(column = "OPERATOR_CODE", type = "string,64", notNull = false) + private String operatorCode; // 4.操作人 + @AnTableField(column = "MEDIA_ID", type = "long", notNull = false) + private long mediaId; // 5.媒体编号 + @AnTableField(column = "DESIGN_MEDIA_ID", type = "long", notNull = false) + private long designMediaId; // 6.订单模板ID + @AnTableField(column = "OLD_PARAM_TEXT", type = "string,2000", notNull = false) + private String oldParamText; // 7.原参数文本 + @AnTableField(column = "OCR_TEXT", type = "string,2000", notNull = false) + private String ocrText; // 8.图片识别后文本 + @AnTableField(column = "PARAM_TEXT", type = "string,2000", notNull = false) + private String paramText; // 9.参数文本 + @AnTableField(column = "QR_CODE_PATH", type = "string,2000", notNull = false) + private String qrCodePath; // 10.二维码路径 + @AnTableField(column = "FILE_ID", type = "string,32", notNull = false) + private String fileId; // 11.上传组件CODE + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getMediaId() + { + return mediaId; + } + + public void setMediaId(long mediaId) + { + this.mediaId = mediaId; + } + + public long getDesignMediaId() + { + return designMediaId; + } + + public void setDesignMediaId(long designMediaId) + { + this.designMediaId = designMediaId; + } + + public String getOldParamText() + { + return oldParamText; + } + + public void setOldParamText(String oldParamText) + { + this.oldParamText = oldParamText; + } + + public String getOcrText() + { + return ocrText; + } + + public void setOcrText(String ocrText) + { + this.ocrText = ocrText; + } + + public String getParamText() + { + return paramText; + } + + public void setParamText(String paramText) + { + this.paramText = paramText; + } + + public String getQrCodePath() + { + return qrCodePath; + } + + public void setQrCodePath(String qrCodePath) + { + this.qrCodePath = qrCodePath; + } + + public String getFileId() + { + return fileId; + } + + public void setFileId(String fileId) + { + this.fileId = fileId; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateScore.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateScore.java new file mode 100644 index 0000000..531323c --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateScore.java @@ -0,0 +1,92 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.template; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 模板本身分数表 对应表《DES_TEMPLATE_SCORE》 + */ +@AnAlias("DesTemplateScore") +@AnNew +@AnTable(table="DES_TEMPLATE_SCORE", key="MEDIA_ID", type="InnoDB") +public class DesTemplateScore implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="MEDIA_ID", type="long", notNull=true) private long mediaId; //1.媒体编号 + @AnTableField(column="BASE_SCORE", type="int", notNull=true) private int baseScore; //2.基础分 + @AnTableField(column="FLOAT_SCORE", type="int", notNull=true) private int floatScore; //3.动态分 + @AnTableField(column="SALE_SCORE", type="int", notNull=true) private int saleScore; //4.销量分 + @AnTableField(column="USER_SCORE", type="int", notNull=true) private int userScore; //5.用户评分 + + public String toString() + { + return Jsons.toString(this); + } + + public long getMediaId() + { + return mediaId; + } + + public void setMediaId(long mediaId) + { + this.mediaId = mediaId; + } + + public int getBaseScore() + { + return baseScore; + } + + public void setBaseScore(int baseScore) + { + this.baseScore = baseScore; + } + + public int getFloatScore() + { + return floatScore; + } + + public void setFloatScore(int floatScore) + { + this.floatScore = floatScore; + } + + public int getSaleScore() + { + return saleScore; + } + + public void setSaleScore(int saleScore) + { + this.saleScore = saleScore; + } + + public int getUserScore() + { + return userScore; + } + + public void setUserScore(int userScore) + { + this.userScore = userScore; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateScoreLog.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateScoreLog.java new file mode 100644 index 0000000..84c327b --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/DesTemplateScoreLog.java @@ -0,0 +1,126 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.template; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 模板分数日志表 对应表《DES_TEMPLATE_SCORE_LOG》 + */ +@AnAlias("DesTemplateScoreLog") +@AnNew +@AnTable(table="DES_TEMPLATE_SCORE_LOG", key="LOG_ID", type="InnoDB") +public class DesTemplateScoreLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="LOG_ID", type="long", notNull=true) private long logId; //1.主键 + @AnTableField(column="MEDIA_ID", type="long", notNull=true) private long mediaId; //2.媒体编号 + @AnTableField(column="SCORE_NAME", type="string,32", notNull=false) private String scoreName; //3.规则名称(TEMPLATE,KEYWORD) + @AnTableField(column="SCORE_TYPE", type="string,32", notNull=true) private String scoreType; //4.评分规则类型(基础分:BASE_SCORE,动态分:FLOAT_SCORE,销售分:SALE_SCORE, 用户评分:USER_SCORE ) + @AnTableField(column="PARAM_TYPE", type="int", notNull=true) private int paramType; //5.参数类型(0代表加分,1代表减分) + @AnTableField(column="PARAM_KEY", type="string,32", notNull=true) private String paramKey; //6.参数键 + @AnTableField(column="PARAM_VALUE", type="int", notNull=true) private int paramValue; //7.参数值 + @AnTableField(column="CREATE_TIME", type="datetime", notNull=true) private Timestamp createTime; //8.创建时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getLogId() + { + return logId; + } + + public void setLogId(long logId) + { + this.logId = logId; + } + + public long getMediaId() + { + return mediaId; + } + + public void setMediaId(long mediaId) + { + this.mediaId = mediaId; + } + + public String getScoreName() + { + return scoreName; + } + + public void setScoreName(String scoreName) + { + this.scoreName = scoreName; + } + + public String getScoreType() + { + return scoreType; + } + + public void setScoreType(String scoreType) + { + this.scoreType = scoreType; + } + + public int getParamType() + { + return paramType; + } + + public void setParamType(int paramType) + { + this.paramType = paramType; + } + + public String getParamKey() + { + return paramKey; + } + + public void setParamKey(String paramKey) + { + this.paramKey = paramKey; + } + + public int getParamValue() + { + return paramValue; + } + + public void setParamValue(int paramValue) + { + this.paramValue = paramValue; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/MediaTemplate.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/MediaTemplate.java new file mode 100644 index 0000000..7439126 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/MediaTemplate.java @@ -0,0 +1,316 @@ +package com.zhiqim.yangcai.design.dbo.template; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 模板表 对应表《MEDIA_TEMPLATE》 + */ +@AnAlias("MediaTemplate") +@AnNew +@AnTable(table = "MEDIA_TEMPLATE", key = "MEDIA_ID", type = "InnoDB") +public class MediaTemplate implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "MEDIA_ID", type = "long", notNull = true) + private long mediaId; // 1.媒体编号 + @AnTableField(column = "TEMPLATE_TYPE", type = "int", notNull = true) + private int templateType; // 2.模板类型: 0:临时、 10:我的草稿、 20:我的模板、 80:订单模板、 100:系统模板、 110:精品模板 + @AnTableField(column = "TEMPLATE_STATUS", type = "int", notNull = true) + private int templateStatus; // 3.模板状态,0:未审核,1:审核中,2:已审核 + @AnTableField(column = "DESIGNER", type = "string,32", notNull = true) + private String designer; // 4.设计师 + @AnTableField(column = "TYPE_ID", type = "long", notNull = true) + private long typeId; // 5.类型编号 + @AnTableField(column = "PAGE_VALUE", type = "int", notNull = true) + private int pageValue; // 6.面数,单面=1,双面=2, 8P=8,12P=12 + @AnTableField(column = "INDUSTRY_ID", type = "long", notNull = false) + private long industryId; // 7.行业ID + @AnTableField(column = "ATTRIBUTE_ID", type = "long", notNull = false) + private long attributeId; // 8.属性ID + @AnTableField(column = "INDUSTRY_SUB_IDS", type = "string,5000", notNull = false) + private String industrySubIds; // 9.子行业ID + @AnTableField(column = "INDUSTRY_SUB_NAME", type = "string,5000", notNull = false) + private String industrySubName; // 10.子行业名称 + @AnTableField(column = "ATTRIBUTE_IDS", type = "string,5000", notNull = false) + private String attributeIds; // 11.属性ID + @AnTableField(column = "ATTRIBUTE_NAME", type = "string,5000", notNull = false) + private String attributeName; // 12.属性值名称 + @AnTableField(column = "TEMPLATE_GROUP", type = "string,850", notNull = false) + private String templateGroup; // 13.设计师所属小组 + @AnTableField(column = "SHARE_DEPT", type = "string,850", notNull = false) + private String shareDept; // 14.分享部门 + @AnTableField(column = "DESIGN_ID", type = "long", notNull = false) + private long designId; // 15.设计订单ID + @AnTableField(column = "THEME_COLOR", type = "string,10", notNull = false) + private String themeColor; // 16.主色调 + @AnTableField(column = "KEYWORD_ID", type = "long", notNull = false) + private long keywordId; // 17.关键词ID + @AnTableField(column = "KEYWORD_NAME", type = "string,5000", notNull = false) + private String keywordName; // 18.关键词名称 + @AnTableField(column = "KEYWORDS", type = "string,5000", notNull = false) + private String keywords; // 19.关键字,多个逗号分隔 + @AnTableField(column = "TEMPLATE_SRC", type = "long", notNull = false) + private long templateSrc; // 20.模板来源ID + @AnTableField(column = "RELEASE_STATUS", type = "byte", notNull = true) + private int releaseStatus; // 21.发布状态,0:未发布,1:已发布 + @AnTableField(column = "RELEASE_TIME", type = "string,19", notNull = false) + private String releaseTime; // 22.发布时间 + @AnTableField(column = "FILE_TYPE", type = "string,50", notNull = false) + private String fileType; // 23.模板外部稿件后缀格式pdf、cdr、ai,多个分隔符连接 + @AnTableField(column = "CREATE_CHANNEL", type = "string,20", notNull = false) + private String createChannel;// 创建通道 :out_draft外部稿件、platform_design平台设计 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getMediaId() + { + return mediaId; + } + + public void setMediaId(long mediaId) + { + this.mediaId = mediaId; + } + + public int getTemplateType() + { + return templateType; + } + + public void setTemplateType(int templateType) + { + this.templateType = templateType; + } + + public int getTemplateStatus() + { + return templateStatus; + } + + public void setTemplateStatus(int templateStatus) + { + this.templateStatus = templateStatus; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + public int getPageValue() + { + return pageValue; + } + + public void setPageValue(int pageValue) + { + this.pageValue = pageValue; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public long getAttributeId() + { + return attributeId; + } + + public void setAttributeId(long attributeId) + { + this.attributeId = attributeId; + } + + public String getIndustrySubIds() + { + return industrySubIds; + } + + public void setIndustrySubIds(String industrySubIds) + { + this.industrySubIds = industrySubIds; + } + + public String getIndustrySubName() + { + return industrySubName; + } + + public void setIndustrySubName(String industrySubName) + { + this.industrySubName = industrySubName; + } + + public String getAttributeIds() + { + return attributeIds; + } + + public void setAttributeIds(String attributeIds) + { + this.attributeIds = attributeIds; + } + + public String getAttributeName() + { + return attributeName; + } + + public void setAttributeName(String attributeName) + { + this.attributeName = attributeName; + } + + public String getTemplateGroup() + { + return templateGroup; + } + + public void setTemplateGroup(String templateGroup) + { + this.templateGroup = templateGroup; + } + + public String getShareDept() + { + return shareDept; + } + + public void setShareDept(String shareDept) + { + this.shareDept = shareDept; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getThemeColor() + { + return themeColor; + } + + public void setThemeColor(String themeColor) + { + this.themeColor = themeColor; + } + + public long getKeywordId() + { + return keywordId; + } + + public void setKeywordId(long keywordId) + { + this.keywordId = keywordId; + } + + public String getKeywordName() + { + return keywordName; + } + + public void setKeywordName(String keywordName) + { + this.keywordName = keywordName; + } + + public String getKeywords() + { + return keywords; + } + + public void setKeywords(String keywords) + { + this.keywords = keywords; + } + + public long getTemplateSrc() + { + return templateSrc; + } + + public void setTemplateSrc(long templateSrc) + { + this.templateSrc = templateSrc; + } + + public int getReleaseStatus() + { + return releaseStatus; + } + + public void setReleaseStatus(int releaseStatus) + { + this.releaseStatus = releaseStatus; + } + + public String getReleaseTime() + { + return releaseTime; + } + + public void setReleaseTime(String releaseTime) + { + this.releaseTime = releaseTime; + } + + public String getFileType() + { + return fileType; + } + + public void setFileType(String fileType) + { + this.fileType = fileType; + } + + public String getCreateChannel() + { + return createChannel; + } + + public void setCreateChannel(String createChannel) + { + this.createChannel = createChannel; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/MediaTemplateSolrModel.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/MediaTemplateSolrModel.java new file mode 100644 index 0000000..80f48ea --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/MediaTemplateSolrModel.java @@ -0,0 +1,465 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dbo.template; + +import java.io.Serializable; +import java.util.Date; + +import org.apache.commons.lang3.time.DateFormatUtils; +import org.apache.solr.client.solrj.beans.Field; +import org.zhiqim.kernel.json.Jsons; + +/** + * 模板素材solrModel + */ +public class MediaTemplateSolrModel implements Serializable +{ + private static final long serialVersionUID = 1L; + + @Field + private String mediaName; // 2.媒体名称 + @Field + private double width; // 3.画布宽度,单位像素 + @Field + private double height; // 4.画布高度,单位像素 + @Field + private double widthMm; // 5.画布宽度,单位mm + @Field + private double heightMm; // 6.画布高度,单位mm + @Field + private int dpi; // 7.分辨率 + @Field + private String mediaUrl; // 8.媒体参考图片 + @Field + private Date createTime; // 9.创建时间 + @Field + private String updateTime; // 10.更新时间 + @Field + private int isEdit; // 11.是否支持编辑,0:支持,1:不支持 + @Field + private double bleedSize; // 12.出血尺寸,单位mm + @Field + private long mediaId; // 1.媒体编号 + @Field + private int templateType; // 2.模板类型: 0:临时、 10:我的草稿、 20:我的模板、 80:订单模板、 100:系统模板、 110:精品模板 + @Field + private long oddEven;// 版式ID 0横版 1竖版 + @Field + private int templateStatus; // 3.模板状态,0:未审核,1:审核中,2:已审核 + @Field + private String designer; // 4.设计师 + @Field + private long typeId; // 5.类型编号 + @Field + private int pageValue; // 6.面数,单面=1,双面=2, 8P=8,12P=12 + @Field + private long industryId; // 7.行业ID + @Field + private long attributeId; // 8.属性ID + @Field + private String industrySubIds; // 9.子行业ID + @Field + private String industrySubName; // 10.子行业名称 + @Field + private String attributeIds; // 11.属性ID + @Field + private String attributeName; // 12.属性值名称 + @Field + private String templateGroup; // 13.设计师所属小组 + @Field + private String shareDept; // 14.分享部门 + @Field + private long designId; // 15.设计订单ID + @Field + private String themeColor; // 16.主色调 + @Field + private long keywordId; // 17.关键词ID + @Field + private String keywordName; // 18.关键词名称 + @Field + private String keywords; // 19.关键字,多个逗号分隔 + @Field + private long templateSrc; // 20.模板来源ID + @Field + private int releaseStatus; // 21.发布状态,0:未发布,1:已发布 + @Field + private String releaseTime; // 22.发布时间 + @Field + private String fileType; // 23.模板外部稿件后缀格式pdf、cdr、ai,多个分隔符连接 + @Field + private int score;// 评分 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getMediaName() + { + return mediaName; + } + + public void setMediaName(String mediaName) + { + this.mediaName = mediaName; + } + + public double getWidth() + { + return width; + } + + public void setWidth(double width) + { + this.width = width; + } + + public double getHeight() + { + return height; + } + + public void setHeight(double height) + { + this.height = height; + } + + public double getWidthMm() + { + return widthMm; + } + + public void setWidthMm(double widthMm) + { + this.widthMm = widthMm; + } + + public double getHeightMm() + { + return heightMm; + } + + public void setHeightMm(double heightMm) + { + this.heightMm = heightMm; + } + + public int getDpi() + { + return dpi; + } + + public void setDpi(int dpi) + { + this.dpi = dpi; + } + + public String getMediaUrl() + { + return mediaUrl; + } + + public void setMediaUrl(String mediaUrl) + { + this.mediaUrl = mediaUrl; + } + + public String getCreateTime() + { + return DateFormatUtils.format(createTime, "yyyy-MM-dd HH:mm:ss"); + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } + + public String getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(String updateTime) + { + this.updateTime = updateTime; + } + + public int getIsEdit() + { + return isEdit; + } + + public void setIsEdit(int isEdit) + { + this.isEdit = isEdit; + } + + public double getBleedSize() + { + return bleedSize; + } + + public void setBleedSize(double bleedSize) + { + this.bleedSize = bleedSize; + } + + public long getMediaId() + { + return mediaId; + } + + public void setMediaId(long mediaId) + { + this.mediaId = mediaId; + } + + public int getTemplateType() + { + return templateType; + } + + public void setTemplateType(int templateType) + { + this.templateType = templateType; + } + + public int getTemplateStatus() + { + return templateStatus; + } + + public void setTemplateStatus(int templateStatus) + { + this.templateStatus = templateStatus; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + public int getPageValue() + { + return pageValue; + } + + public void setPageValue(int pageValue) + { + this.pageValue = pageValue; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public long getAttributeId() + { + return attributeId; + } + + public void setAttributeId(long attributeId) + { + this.attributeId = attributeId; + } + + public String getIndustrySubIds() + { + return industrySubIds; + } + + public void setIndustrySubIds(String industrySubIds) + { + this.industrySubIds = industrySubIds; + } + + public String getIndustrySubName() + { + return industrySubName; + } + + public void setIndustrySubName(String industrySubName) + { + this.industrySubName = industrySubName; + } + + public String getAttributeIds() + { + return attributeIds; + } + + public void setAttributeIds(String attributeIds) + { + this.attributeIds = attributeIds; + } + + public String getAttributeName() + { + return attributeName; + } + + public void setAttributeName(String attributeName) + { + this.attributeName = attributeName; + } + + public String getTemplateGroup() + { + return templateGroup; + } + + public void setTemplateGroup(String templateGroup) + { + this.templateGroup = templateGroup; + } + + public String getShareDept() + { + return shareDept; + } + + public void setShareDept(String shareDept) + { + this.shareDept = shareDept; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getThemeColor() + { + return themeColor; + } + + public void setThemeColor(String themeColor) + { + this.themeColor = themeColor; + } + + public long getKeywordId() + { + return keywordId; + } + + public void setKeywordId(long keywordId) + { + this.keywordId = keywordId; + } + + public String getKeywordName() + { + return keywordName; + } + + public void setKeywordName(String keywordName) + { + this.keywordName = keywordName; + } + + public String getKeywords() + { + return keywords; + } + + public void setKeywords(String keywords) + { + this.keywords = keywords; + } + + public long getTemplateSrc() + { + return templateSrc; + } + + public void setTemplateSrc(long templateSrc) + { + this.templateSrc = templateSrc; + } + + public int getReleaseStatus() + { + return releaseStatus; + } + + public void setReleaseStatus(int releaseStatus) + { + this.releaseStatus = releaseStatus; + } + + public String getReleaseTime() + { + return releaseTime; + } + + public void setReleaseTime(String releaseTime) + { + this.releaseTime = releaseTime; + } + + public String getFileType() + { + return fileType; + } + + public void setFileType(String fileType) + { + this.fileType = fileType; + } + + public int getScore() + { + return score; + } + + public void setScore(int score) + { + this.score = score; + } + + public long getOddEven() + { + return oddEven; + } + + public void setOddEven(long oddEven) + { + this.oddEven = oddEven; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/MediaTemplateView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/MediaTemplateView.java new file mode 100644 index 0000000..952d171 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/MediaTemplateView.java @@ -0,0 +1,176 @@ +package com.zhiqim.yangcai.design.dbo.template; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * 模板素材关联表 对应视图《MEDIA_TEMPLATE_VIEW》 + */ +@AnAlias("MediaTemplateView") +@AnNew +@AnView("MEDIA_TEMPLATE,MEDIA_CANVAS") +@AnViewJoin( +{ + @AnViewJoinValue(type = "EQUAL", lTable = "MEDIA_TEMPLATE", lColumn = "MEDIA_ID", rTable = "MEDIA_CANVAS", rColumn = "MEDIA_ID") +}) +public class MediaTemplateView extends MediaTemplate +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table = "MEDIA_CANVAS", column = "MEDIA_NAME") + private String mediaName; // 2.媒体名称 + @AnViewField(table = "MEDIA_CANVAS", column = "WIDTH") + private double width; // 3.画布宽度,单位像素 + @AnViewField(table = "MEDIA_CANVAS", column = "HEIGHT") + private double height; // 4.画布高度,单位像素 + @AnViewField(table = "MEDIA_CANVAS", column = "WIDTH_MM") + private double widthMm; // 5.画布宽度,单位mm + @AnViewField(table = "MEDIA_CANVAS", column = "HEIGHT_MM") + private double heightMm; // 6.画布高度,单位mm + @AnViewField(table = "MEDIA_CANVAS", column = "DPI") + private int dpi; // 7.分辨率 + @AnViewField(table = "MEDIA_CANVAS", column = "MEDIA_URL") + private String mediaUrl; // 8.媒体参考图片 + @AnViewField(table = "MEDIA_CANVAS", column = "CREATE_TIME") + private String createTime; // 9.创建时间 + @AnViewField(table = "MEDIA_CANVAS", column = "UPDATE_TIME") + private String updateTime; // 10.更新时间 + @AnViewField(table = "MEDIA_CANVAS", column = "IS_EDIT") + private int isEdit; // 11.是否支持编辑,0:支持,1:不支持 + @AnViewField(table = "MEDIA_CANVAS", column = "BLEED_SIZE") + private double bleedSize; // 12.出血尺寸,单位mm + @AnViewField(table = "MEDIA_CANVAS", column = "ODD_EVEN") + private long oddEven; // 12.模板版式 0横版 1竖版 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getMediaName() + { + return mediaName; + } + + public void setMediaName(String mediaName) + { + this.mediaName = mediaName; + } + + public double getWidth() + { + return width; + } + + public void setWidth(double width) + { + this.width = width; + } + + public double getHeight() + { + return height; + } + + public void setHeight(double height) + { + this.height = height; + } + + public double getWidthMm() + { + return widthMm; + } + + public void setWidthMm(double widthMm) + { + this.widthMm = widthMm; + } + + public double getHeightMm() + { + return heightMm; + } + + public void setHeightMm(double heightMm) + { + this.heightMm = heightMm; + } + + public int getDpi() + { + return dpi; + } + + public void setDpi(int dpi) + { + this.dpi = dpi; + } + + public String getMediaUrl() + { + return mediaUrl; + } + + public void setMediaUrl(String mediaUrl) + { + this.mediaUrl = mediaUrl; + } + + public String getCreateTime() + { + return createTime; + } + + public void setCreateTime(String createTime) + { + this.createTime = createTime; + } + + public String getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(String updateTime) + { + this.updateTime = updateTime; + } + + public int getIsEdit() + { + return isEdit; + } + + public void setIsEdit(int isEdit) + { + this.isEdit = isEdit; + } + + public double getBleedSize() + { + return bleedSize; + } + + public void setBleedSize(double bleedSize) + { + this.bleedSize = bleedSize; + } + + public long getOddEven() + { + return oddEven; + } + + public void setOddEven(long oddEven) + { + this.oddEven = oddEven; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/UserMaterial.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/UserMaterial.java new file mode 100644 index 0000000..bd772bf --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/template/UserMaterial.java @@ -0,0 +1,114 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.template; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 用户素材表 对应表《USER_MATERIAL》 + */ +@AnAlias("UserMaterial") +@AnNew +@AnTable(table="USER_MATERIAL", key="SVG_ID", type="InnoDB") +public class UserMaterial implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="SVG_ID", type="long", notNull=true) private long svgId; //1.素材编号 + @AnTableField(column="TYPE_CODE", type="string,16", notNull=true) private String typeCode; //2.素材类型,bg:背景,text:文字,image:素材,qcode:二维码 + @AnTableField(column="CAT_CODE", type="string,16", notNull=true) private String catCode; //3.分类编码 + @AnTableField(column="SVG_SEQ", type="int", notNull=true) private int svgSeq; //4.素材序号 + @AnTableField(column="DESIGNER", type="string,32", notNull=true) private String designer; //5.设计师 + @AnTableField(column="SVG_CODE", type="string,50000", notNull=true) private String svgCode; //6.SVG代码 + @AnTableField(column="KEYWORDS", type="string,128", notNull=false) private String keywords; //7.素材关键字,多个空格分隔 + + public String toString() + { + return Jsons.toString(this); + } + + public long getSvgId() + { + return svgId; + } + + public void setSvgId(long svgId) + { + this.svgId = svgId; + } + + public String getTypeCode() + { + return typeCode; + } + + public void setTypeCode(String typeCode) + { + this.typeCode = typeCode; + } + + public String getCatCode() + { + return catCode; + } + + public void setCatCode(String catCode) + { + this.catCode = catCode; + } + + public int getSvgSeq() + { + return svgSeq; + } + + public void setSvgSeq(int svgSeq) + { + this.svgSeq = svgSeq; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getSvgCode() + { + return svgCode; + } + + public void setSvgCode(String svgCode) + { + this.svgCode = svgCode; + } + + public String getKeywords() + { + return keywords; + } + + public void setKeywords(String keywords) + { + this.keywords = keywords; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/user/BuyerUser.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/user/BuyerUser.java new file mode 100644 index 0000000..fee8c6e --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/user/BuyerUser.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.user; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 客户表 对应表《BUYER_USER》 + */ +@AnAlias("BuyerUser") +@AnNew +@AnTable(table="BUYER_USER", key="BUYER_CODE", type="InnoDB") +public class BuyerUser implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="BUYER_CODE", type="string,64", notNull=true) private String buyerCode; //1.客户编码 + @AnTableField(column="ORDER_COUNT", type="int", notNull=true) private int orderCount; //2.设计订单数 + + public String toString() + { + return Jsons.toString(this); + } + + public String getBuyerCode() + { + return buyerCode; + } + + public void setBuyerCode(String buyerCode) + { + this.buyerCode = buyerCode; + } + + public int getOrderCount() + { + return orderCount; + } + + public void setOrderCount(int orderCount) + { + this.orderCount = orderCount; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/utils/BaseUtil.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/utils/BaseUtil.java new file mode 100644 index 0000000..efa7aa9 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/utils/BaseUtil.java @@ -0,0 +1,271 @@ +package com.zhiqim.yangcai.design.dbo.utils; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; + +import com.zhiqim.yangcai.design.model.PrintMsSize; + +/** + * 常用工具类 + * + * @author zhouwenbin + * + */ +public class BaseUtil implements SignConstants +{ + /**** + * 计算模数 + * userWidth和userHeight 小于等于 0 时 取 alias 第一个数据尺寸值 进行比较 + * + * @param alias 标准工厂尺寸,多个逗号隔开 例:92X56 含出血 + * @param userWidth 用户尺寸宽度,单位/mm 不含出血 + * @param userHeight 用户尺寸高度,单位/mm 不含出血 + * @param bleed 出血 单位/mm + * @return 模位数 + * @throws Exception + */ + public static int calcMod(String alias, int userWidth, int userHeight, int bleed) throws Exception + { + List list = getPtintMsSize(alias, userWidth, userHeight, bleed); + Collections.sort(list); + return list.get(0).getPrintMs(); + + } + + /**** + * 通过 模数获取 对应尺寸值 列表 + * userWidth和userHeight 小于等于 0 时 返回 alias 第一个数据尺寸值 + * + * @param alias 标准工厂尺寸,多个逗号隔开 例:92X56 含出血 + * @param userWidth 不含出血 + * @param userHeight 不含出血 + * @param bleed 模位数 + * @return + * @throws Exception + */ + public static List getPtintMsSize(String alias, int userWidth, int userHeight, int bleed) throws Exception + { + List msizeList = new ArrayList(); + alias = Strings.removeAllBlank(alias.toLowerCase()).replace(",", ",").toLowerCase(); + alias = alias.replace("X", "x"); + String[] strs = alias.split(","); + + // 默认尺寸宽高 + int defaultWidth = Integer.parseInt(strs[0].split("x")[0]);// 含出血 + int defaultHeight = Integer.parseInt(strs[0].split("x")[1]);// 含出血 + userWidth = userWidth <= 0 ? defaultWidth - bleed : userWidth; + userHeight = userHeight <= 0 ? defaultHeight - bleed : userHeight; + + int ms = 0; + for (int i = 0; i < strs.length; i++) + { + String[] strsTmp = strs[i].split("x"); + int width = Integer.parseInt(strsTmp[0]);// 含出血 + int height = Integer.parseInt(strsTmp[1]);// 含出血 + int side = 0; + if (strsTmp.length > 2) + { + // 类似手提袋的侧边搞数据不计算出血,// yixin 2019-06-06 先不计算出血 + side = Integer.parseInt(strsTmp[2].toLowerCase().replace("mm", "")); + } + + int m1 = ((userWidth + bleed - 1) / width + 1) * ((userHeight + bleed - 1) / height + 1); + int m2 = ((userWidth + bleed - 1) / height + 1) * ((userHeight + bleed - 1) / width + 1); + + double printWidth = width; + double printHeight = height; + double printSide = side; + + // 取最小模 + if (m1 > m2) + { + m1 = m2; + } + + if (ms == 0 || ms < m1) + { + ms = m1; + } + + if (ms == 0) + { + ms = 1; + } + + PrintMsSize mSize = new PrintMsSize(); + mSize.setPrintMs(ms); + mSize.setPrintWidth(printWidth); + mSize.setPrintHeight(printHeight); + mSize.setPrintSide(printSide); + msizeList.add(mSize); + } + Collections.sort(msizeList); + return msizeList; + } + + /** + * 计算尺寸面积 + * + * @param alias 具体尺寸,如:214X289 + * @return + */ + public static int calcSizeArea(String alias) + { + String aligns = alias.toLowerCase(); + String[] strs = aligns.split(","); + + int area = 0; // 面积 mm*mm + for (int i = 0; i < strs.length; i++) + { + int bw = Integer.parseInt(strs[i].split("x")[0]); + int bh = Integer.parseInt(strs[i].split("x")[1]); + + if (bw * bh > area) + { + area = bw * bh; + } + } + + return area; + } + + /** + * 获取尺寸的长宽值 + * + * @param alias + * @return + */ + public static List getSizeWH(String alias) + { + String aligns = alias.toLowerCase(); + String[] strs = aligns.split(","); + + List list = new ArrayList<>(); + for (int i = 0; i < strs.length; i++) + { + int bw = Integer.parseInt(strs[i].split("x")[0]); + int bh = Integer.parseInt(strs[i].split("x")[1]); + + int[] ret = + { + bw, bh + }; + list.add(ret); + } + + return list; + } + + /** + * 计算重量 + * + * @param width 自定义宽度 默认为-1 + * @param height 自定义高度 默认为-1 + * @param total 数量 + * @param unitKg 1000张重量,单位kg + * @param sizeAlias 尺寸 如:214X289 + * @return + */ + public static double calcKg(int width, int height, int total, double unitKg, String sizeAlias) + { + double kg = 0; + if (width <= 0 || height <= 0) + { + kg = 1.0 * total / 1000 * unitKg; // 总数量/1000*单位重量 + } + else + {// 自定义长宽 + int area = BaseUtil.calcSizeArea(sizeAlias); // 单位面积 + kg = (1.0 * width * height / area) * total / 1000 * unitKg; + } + + DecimalFormat df = new DecimalFormat("#.00"); + return Double.parseDouble(df.format(kg)); + } + + /** + * 文件大小单位 + * + * @param size 字节数 + * @return + */ + public static String getPrintSize(long size) + { + if (size < 1024) + { + return size + "B"; + } + + long kSize = size / KiB; + if (kSize < 1024) + {// 忽略KiB以下 + return kSize + "KiB"; + } + + long qSize = size / MiB; + long rSize = size % MiB; + if (qSize < 1024) + {// 要保留最后1位小数 + return qSize + "." + (rSize / (MiB / 10)) + "MiB"; + } + + // 保留1位小数 + qSize = size / GiB; + rSize = size % GiB; + return qSize + "." + (rSize / (GiB / 10)) + "GiB"; + + } + + /** + * 删除s中空白,多个空格间 只保留一个空格 (包括空格以下(0x00-0x20)之间的所有字符,包括\t,\r,\n,\b等) + * + * 举例: s = " a\tb\rc d ";得到结果是:returnString = "abcd"; + * + * @param s 原字符串 + * @return 删除空白之后的字符串 + */ + public static String removeBlank(String s) + { + if (Validates.isEmpty(s)) + { + return s; + } + + StringBuilder strb = new StringBuilder(); + for (int i = 0; i < s.length(); i++) + { + char c = s.charAt(i); + if (c < _SPACE_ || c == _SPACE_ZH_ || c == _SPACE_BOM_) + { + continue; + } + + if (c == _SPACE_) + { + if (strb.charAt(strb.length() - 1) != _SPACE_) + { + strb.append(c);// 当前是空格,上一个符也不是空格,则保留当前空格 + } + } + else + { + strb.append(c); + } + } + + return strb.toString(); + } + + public static void main(String[] args) throws Exception + { + int ms = BaseUtil.calcMod("92X56", 140, 68, 0); + System.out.println(ms); + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/utils/CalculationUtil.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/utils/CalculationUtil.java new file mode 100644 index 0000000..d5d8d15 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/utils/CalculationUtil.java @@ -0,0 +1,746 @@ +package com.zhiqim.yangcai.design.dbo.utils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.retention.RetentionDetails; +import com.zhiqim.yangcai.design.dbo.stat.DesignerOrderPerformanceStat; + +/** + * 数字计算工具类 + * TODO:类功能介绍 + * + * @version v1.0.0 @author yixin 2019年6月18日 新建与整理 + */ +@AnAlias("CalculationUtil") +public class CalculationUtil +{ + + private static Map designTypeMap = new HashMap<>(); // 产品类型时效信息Map + + public static void designTypeListFill() throws Exception + { + List designTypeList = DesignTypeDao.listAll(); + for (DesignType designType : designTypeList) + { + designTypeMap.put(designType.getTypeId(), designType.getEffectiveEndTime()); + } + + } + + public static double subtraction(double a, double b) + { + return new BigDecimal(a - b).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + } + + /** + * + * 退回率计算 + * + * @author gjx + * @param orderBackSum 退回次数 + * @param orderPassCount 定稿单数 + * @return + */ + public static String calculatePercent(int count, int sum) + { + if (sum == 0) + { + return "0%"; + } + BigDecimal countBig = new BigDecimal(count * 100 + ""); + BigDecimal sumBig = new BigDecimal(sum + ""); + double percent = countBig.divide(sumBig, 2, RoundingMode.HALF_UP).doubleValue(); + return percent + "%"; + } + + /** + * + * 定稿占比 + * + * @author gjx + * @param passOrderCount 组织定稿数 + * @param orgAllOrder 组织总定稿数 + * @return + */ + public static String orgOrderPercent(int passOrderCount, int orgAllOrder) + { + if (orgAllOrder == 0) + { + return "0%"; + } + BigDecimal passOrderCountBig = new BigDecimal(passOrderCount * 100 + ""); + BigDecimal orgAllOrderBig = new BigDecimal(orgAllOrder + ""); + double orgPercent = passOrderCountBig.divide(orgAllOrderBig, 2, RoundingMode.HALF_UP).doubleValue(); + return orgPercent + "%"; + } + + /** + * 计算定稿倒计时 + * + * @author gjx + * @throws Exception + */ + public static String reckonEndOrderTimeliness(Date designDraftTime, long typeId) throws Exception + { + if (typeId > 0 && designDraftTime != null) + { + if (!designTypeMap.containsKey(typeId)) + { + designTypeListFill(); + } + int minute = designTypeMap.get(typeId); // 得到定稿时效 + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String nowDesignDraftTime = DateTimes.getNextDateTimeStringBySecond(simple.format(designDraftTime), minute * 60); + Date compareTime = simple.parse(nowDesignDraftTime); + String currentDateTime = simple.format(new Date()); + Date currentDate = simple.parse(currentDateTime); + + if (currentDate.getTime() > compareTime.getTime()) + {// 已超时 + int diffMinte = DateTimes.compareMinute(currentDate, compareTime); + return dateTimeTran(diffMinte); + } + else + { + int diffMinte = DateTimes.compareMinute(compareTime, currentDate); + return dateTimeTran(diffMinte); + } + } + return "订单产品有误"; + } + + /** + * + * 定稿是否超时标识 + * + * @author gjx + * @param designDraftTime + * @param typeId + * @return + * @throws ParseException + */ + public static boolean reckonEndOrderTimelinessFlag(Date designDraftTime, long typeId) throws Exception + { + if (typeId > 0 && designDraftTime != null) + { + if (!designTypeMap.containsKey(typeId)) + { + designTypeListFill(); + } + int minute = designTypeMap.get(typeId); // 得到定稿时效 + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String nowDesignDraftTime = DateTimes.getNextDateTimeStringBySecond(simple.format(designDraftTime), minute * 60); + Date compareTime = simple.parse(nowDesignDraftTime); + String currentDateTime = simple.format(new Date()); + Date currentDate = simple.parse(currentDateTime); + + if (currentDate.getTime() > compareTime.getTime()) + {// 已超时 + return true; + } + else + { + return false; + } + } + return false; + } + + /** + * + * 分钟转化成 天:小时:分钟格式 + * + * @author gjx + * @param diffMinte + * @return + */ + public static String dateTimeTran(int diffMinte) + { + if (diffMinte == 0) + { + return "小于1分钟"; + } + int day = 0; + int hour = 0; + int minutes = 0; + if (diffMinte / (24 * 60) > 0) + { + day = diffMinte / (24 * 60); + diffMinte = diffMinte % (24 * 60); + } + if (diffMinte / 60 > 0) + { + hour = diffMinte / 60; + } + minutes = diffMinte % 60; + StringBuilder builder = new StringBuilder(); + builder.append(day > 0 ? day + "天" : ""); + builder.append(hour > 0 ? hour + "小时" : ""); + builder.append(minutes > 0 ? minutes + "分钟" : ""); + return builder.toString(); + } + + /** + * 滞留单处理倒计时计算 + * + * @author gjx + * @return + */ + public static String retentDealCountDownCal(HttpRequest request, long designId) throws Exception + { + if (designId > 0) + { + RetentionDetails retentionDetails = ORM.get(ZTable.class).item(RetentionDetails.class, new Selector().addMust("designId", designId)); + if (retentionDetails == null) + { + return ""; + } + String paramValue = ZmrParamDao.getString(request.getContext(), "yangcai.design", "retentDealHourTime"); + Date retentDealTime = retentionDetails.getRetentDealTime(); + if (retentDealTime == null) + { + return ""; + } + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String newestTime = DateTimes.getNextDateTimeStringByHour(simple.format(retentDealTime), Integer.valueOf(paramValue)); + String currentDate = simple.format(new Date()); + if (simple.parse(newestTime).getTime() > simple.parse(currentDate).getTime()) + { + int diffMinte = DateTimes.compareMinute(newestTime, currentDate); + return dateTimeTran(diffMinte); + } + else + { + return ""; + } + } + return ""; + } + + /** + * + * 滞留单处理限制时间 + * + * @author gjx + * @param request + * @return + * @throws Exception + */ + public static String retentDealDateTime(HttpRequest request) throws Exception + { + String paramValue = ZmrParamDao.getString(request.getContext(), "yangcai.design", "retentDealHourTime"); + return paramValue; + } + + /** + * + * 设计退款率,退款比例计算 + * + * @author gjx + * @param finalizeMoneySum + * @param refundMoneySum + * @return + * @throws Exception + */ + public static String designerRefundCalculate(long finalizeMoneySum, long refundMoneySum) throws Exception + { + if (finalizeMoneySum > 0) + { + BigDecimal refundMoneySumBig = new BigDecimal(refundMoneySum * 100 + ""); + BigDecimal finalizeMoneySumBig = new BigDecimal(finalizeMoneySum + ""); + double percent = refundMoneySumBig.divide(finalizeMoneySumBig, 2, RoundingMode.HALF_UP).doubleValue(); + return percent + "%"; + } + return "0%"; + } + + /** + * + * 根据操作员获取上级部门负责人 + * + * @author gjx + * @param operatorCode + * @return + * @throws Exception + */ + public static String operatorGetDeptSatrap(String operatorCode) throws Exception + { + if (Validates.isEmpty(operatorCode)) + { + return ""; + } + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, new Selector().addMaybe("operatorCode", operatorCode)); + if (operator == null) + { + return ""; + } + String operatorDept = operator.getOperatorDept(); + if (operatorDept == null || "".equals(operatorDept)) + { + return ""; + } + String[] deptIdArray = operatorDept.split(","); + if (deptIdArray == null || deptIdArray.length == 0) + { + return ""; + } + long deptId = Long.valueOf(deptIdArray[0]); + ZmrDept dept = ORM.get(ZTable.class).item(ZmrDept.class, new Selector().addMaybe("deptId", deptId)); + if (dept == null) + { + return ""; + } + return dept.getDeptManager(); + } + + /** + * + * 根据操作员获取组织名 + * + * @author jiangbin + * @param operatorCode + * @return + * @throws Exception + */ + public static String operatorGetOrgName(String operatorCode) throws Exception + { + if (Validates.isEmpty(operatorCode)) + { + return ""; + } + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, new Selector().addMaybe("operatorCode", operatorCode)); + if (operator == null) + { + return ""; + } + long operatorOrgId = operator.getOrgId(); + if (operatorOrgId <= 0) + { + return ""; + } + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, new Selector().addMust("orgId", operatorOrgId)); + if (Validates.isEmpty(org)) + { + return ""; + } + return org.getOrgName(); + } + + /** + * + * 计算审核退回处理是否超时 + * + * @author gjx + * @param checkTime + * @return + * @throws Exception + */ + public static boolean doCalculCheckBackCountDownBefore(String checkTime) throws Exception + { + if (Validates.isEmpty(checkTime)) + { + return false; + } + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String currTime = simple.format(new Date()); + int minute = DateTimes.compareMinute(currTime, checkTime); + if (minute < 120) + { + return false; + } + return true; + } + + /** + * + * 审核退回处理时间计算 + * + * @author gjx + * @param checkTime + * @return + * @throws Exception + */ + public static String doCalculCheckBackCountDown(String checkTime) throws Exception + { + if (Validates.isEmpty(checkTime)) + { + return null; + } + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String currTime = simple.format(new Date()); + int minute = DateTimes.compareMinute(currTime, checkTime); + if (minute < 120) + { + int countDownMinute = 120 - minute; + return dateTimeTran(countDownMinute); + } + return dateTimeTran(minute - 120); + } + + /** + * + * 计算审核退回处理是否超时 + * + * @author gjx + * @param checkTime + * @param dateTime + * @return + * @throws Exception + */ + public static boolean doCalculCheckBackCountDownBefore(String checkTime, String dateTime) throws Exception + { + if (Validates.isEmpty(checkTime) || Validates.isEmpty(dateTime)) + { + return false; + } + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String currTime = simple.format(simple.parse(dateTime)); + String checkBackTime = simple.format(simple.parse(checkTime)); + int minute = DateTimes.compareMinute(currTime, checkBackTime); + if (minute < 120) + { + return false; + } + return true; + } + + /** + * + * 审核退回处理时间计算 + * + * @author gjx + * @param checkTime + * @param dateTime + * @return + * @throws Exception + */ + public static String doCalculCheckBackCountDown(String checkTime, String dateTime) throws Exception + { + if (Validates.isEmpty(checkTime)) + { + return null; + } + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date designEndTime = simple.parse(dateTime); + String currTime = simple.format(designEndTime); + int minute = DateTimes.compareMinute(currTime, checkTime); + if (minute < 120) + { + int countDownMinute = 120 - minute; + return dateTimeTran(countDownMinute); + } + return dateTimeTran(minute - 120); + } + + /** + * + * 审核退回处理时间计算 + * + * @author gjx + * @param checkTime + * @param dateTime + * @return + * @throws Exception + */ + public static int doCalculCheckBackTotalTime(String checkTime, String dateTime) throws Exception + { + if (Validates.isEmpty(checkTime)) + { + return 0; + } + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String currTime = simple.format(simple.parse(dateTime)); + String checkBackTime = simple.format(simple.parse(checkTime)); + int minute = DateTimes.compareMinute(currTime, checkBackTime); + return minute; + } + + /** + * + * 计算滞留时长 + * + * @author gjx + * @param createTime + * @return + * @throws Exception + */ + public static String retentionDateTime(Date createTime) throws Exception + { + if (createTime != null) + { + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + int retentDealMinute = DateTimes.compareMinute(simple.format(new Date()), simple.format(createTime)); + return CalculationUtil.dateTimeTran(retentDealMinute); + } + + return ""; + } + + /** + * + * [简要描述]: 获取设计师订单绩效订单
            + * [详细描述]:
            + * + * @author gjx + * @param designId + * @param designEndTime + * @return + */ + public static Object getDesignerOrderPerformance(DesignSelfView order, String designer) throws Exception + { + // long typeId = order.getTypeId(); + int draftType = order.getDraftType(); + + long designPrice = 0L; + if (order.getDesignPrice() == 0) + { + designPrice = StatDao.calculateOrderPerformance(order); + } + else + { + designPrice = order.getDesignPrice(); + } + + if (order.getDesignEndTime().before(Sqls.toTimestampBegin(DateTimes.getFirstMonthDay()))) + {// 往月直接查设计师订单绩效表 + DesignerOrderPerformanceStat stat = ORM.get(ZTable.class).item(DesignerOrderPerformanceStat.class, order.getDesignId()); + if (stat == null) + { + return ""; + } + if (draftType == DraftConstants.DRAFT_TEMPLATE.value()) + { + int printKs = stat.getPrintKs(); + String fee = Amounts.toYuan(stat.getOrderDesignerFee()); + String templateFee = Amounts.toYuan(stat.getTemplateDraftFee()); + String desc = designPrice + "元 =  " + templateFee + " (改稿单价) "; + if (printKs > 0) + { + desc = fee + "元 =  " + templateFee + " (改稿单价)* " + printKs + " (款数)"; + } + return getTemplateDraftOrderPerformanceEquation(desc, fee); + } + String prdConvertFee = Amounts.toYuan(stat.getPrdConvertFee()); + return getOrderPerformanceEquation(order, prdConvertFee, designPrice); + } + else + { + int printKs = order.getPrintKs(); + + if (draftType == DraftConstants.DRAFT_TEMPLATE.value()) + {// 改稿自来稿设计费一律按0.5元 * 款计算不区分产品 + String fee = Amounts.toYuan(StatDao.calculateTemplateDraftOrderPrice(order)); + String templateFee = Amounts.toYuan(StatDao.calculateTemplateDraftProductPrice(order)); + String desc = designPrice + "元 =  " + templateFee + " (改稿单价) "; + if (printKs > 0) + { + desc = designPrice + "元 =  " + templateFee + " (改稿单价)* " + printKs + " (款数)"; + } + return getTemplateDraftOrderPerformanceEquation(desc, fee); + } + String prdConvertFee = Amounts.toYuan(StatDao.calculateOrderProductPerformance(order)); + return getOrderPerformanceEquation(order, prdConvertFee, designPrice); + } + } + + /** + * + * [简要描述]: 获取设计师订单绩效订单
            + * [详细描述]:
            + * + * @author gjx + * @param designId + * @param designEndTime + * @return + */ + public static Object getDesignerOrderPerformanceYuan(DesignSelfView order, String designer) throws Exception + { + // long typeId = order.getTypeId(); + int draftType = order.getDraftType(); + + long designPrice = 0L; + if (order.getDesignPrice() == 0) + { + designPrice = StatDao.calculateOrderPerformance(order); + } + else + { + designPrice = order.getDesignPrice(); + } + + if (order.getDesignEndTime().before(Sqls.toTimestampBegin(DateTimes.getFirstMonthDay()))) + {// 往月直接查设计师订单绩效表 + DesignerOrderPerformanceStat stat = ORM.get(ZTable.class).item(DesignerOrderPerformanceStat.class, order.getDesignId()); + if (stat == null) + { + return ""; + } + if (draftType == DraftConstants.DRAFT_TEMPLATE.value()) + { + int printKs = stat.getPrintKs(); + String fee = Amounts.toYuan(stat.getOrderDesignerFee()); + String templateFee = Amounts.toYuan(stat.getTemplateDraftFee()); + String desc = designPrice + "元 =  " + templateFee + " (改稿单价) "; + if (printKs > 0) + { + desc = fee + "元 =  " + templateFee + " (改稿单价)* " + printKs + " (款数)"; + } + return fee + "元"; + } + String prdConvertFee = Amounts.toYuan(stat.getPrdConvertFee()); + return getOrderPerformanceEquationYuan(order, prdConvertFee, designPrice); + } + else + { + int printKs = order.getPrintKs(); + + if (draftType == DraftConstants.DRAFT_TEMPLATE.value()) + {// 改稿自来稿设计费一律按0.5元 * 款计算不区分产品 + String fee = Amounts.toYuan(StatDao.calculateTemplateDraftOrderPrice(order)); + String templateFee = Amounts.toYuan(StatDao.calculateTemplateDraftProductPrice(order)); + String desc = designPrice + "元 =  " + templateFee + " (改稿单价) "; + if (printKs > 0) + { + desc = designPrice + "元 =  " + templateFee + " (改稿单价)* " + printKs + " (款数)"; + } + return fee + "元"; + } + String prdConvertFee = Amounts.toYuan(StatDao.calculateOrderProductPerformance(order)); + return getOrderPerformanceEquationYuan(order, prdConvertFee, designPrice); + } + } + + /** + * + * [简要描述]: 获取改稿订单绩效表达式
            + * [详细描述]:
            + * + * @author gjx + * @param desc + * @param fee + * @return + */ + public static String getTemplateDraftOrderPerformanceEquation(String desc, Object fee) + { + return "" + fee + "元"; + } + + /** + * + * [简要描述]: 获取订单绩效表达式
            + * [详细描述]:
            + * + * @author gjx + * @param order + * @param prdConvertFee + * @param multiKsFee + * @return + */ + private static String getOrderPerformanceEquation(DesignSelfView order, String prdConvertFee, long designPrice) + { + long typeId = order.getTypeId(); + int printKs = order.getPrintKs(); + int designCopies = order.getDesignCopies(); + if (designCopies < 1) + {// 设计费最少一份 + designCopies = 1; + } + + long urgentPrice = 0L; + if (order.isUrgent() && Validates.isNotEmpty(order.getUrgentPrice())) + { + urgentPrice = order.getUrgentPrice(); + } + + Double fee = (double) (designPrice + urgentPrice) / 100; + String desc = ""; + if (designCopies >= printKs || typeId == 13879L) + { // 设计费份数>=款数,则订单单价为:产品单价*设计费份数+加急费 海报产品特殊处理 设计单 = 单价*设计费份数 + 加急费 + desc = fee + "元 =  " + prdConvertFee + "(产品单价)* " + designCopies + " (多份设计费)+" + urgentPrice / 100 + "(加急费)"; + } + else + {// 设计费份数<款数,则订单单价为:产品单价*设计费份数+(款数-设计费份数)*改稿单价 + Double templateDraftPrice = Double.valueOf(Amounts.toYuan(StatDao.calculateTemplateDraftProductPrice(order))); + desc = fee + "元 =  " + prdConvertFee + "(产品单价)* " + designCopies + " (多份设计费)+ " + urgentPrice / 100 + "(加急费)" + + Double.valueOf((printKs - designCopies) * templateDraftPrice); + } + + String result = "" + fee + "元"; + return result; + } + + + /** + * + * [简要描述]: 获取订单绩效表达式
            + * [详细描述]:
            + * + * @author gjx + * @param order + * @param prdConvertFee + * @param multiKsFee + * @return + */ + private static String getOrderPerformanceEquationYuan(DesignSelfView order, String prdConvertFee, long designPrice) + { + long typeId = order.getTypeId(); + int printKs = order.getPrintKs(); + int designCopies = order.getDesignCopies(); + if (designCopies < 1) + {// 设计费最少一份 + designCopies = 1; + } + + long urgentPrice = 0L; + if (order.isUrgent() && Validates.isNotEmpty(order.getUrgentPrice())) + { + urgentPrice = order.getUrgentPrice(); + } + + Double fee = (double) (designPrice + urgentPrice) / 100; + String desc = ""; + if (designCopies >= printKs || typeId == 13879L) + { // 设计费份数>=款数,则订单单价为:产品单价*设计费份数+加急费 海报产品特殊处理 设计单 = 单价*设计费份数 + 加急费 + desc = fee + "元 =  " + prdConvertFee + "(产品单价)* " + designCopies + " (多份设计费)+" + urgentPrice / 100 + "(加急费)"; + } + else + {// 设计费份数<款数,则订单单价为:产品单价*设计费份数+(款数-设计费份数)*改稿单价 + Double templateDraftPrice = Double.valueOf(Amounts.toYuan(StatDao.calculateTemplateDraftProductPrice(order))); + desc = fee + "元 =  " + prdConvertFee + "(产品单价)* " + designCopies + " (多份设计费)+ " + urgentPrice / 100 + "(加急费)" + + Double.valueOf((printKs - designCopies) * templateDraftPrice); + } + + String result = "" + fee + "元"; + return fee + "元"; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/utils/LunarCalendarUtil.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/utils/LunarCalendarUtil.java new file mode 100644 index 0000000..b411526 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/utils/LunarCalendarUtil.java @@ -0,0 +1,431 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ +package com.zhiqim.yangcai.design.dbo.utils; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; + +public class LunarCalendarUtil +{ + + private int year; // 农历的年份 + private int month; + private int day; + private String lunarMonth; // 农历的月份 + public int leapMonth = 0; // 闰的是哪个月 + + final static String chineseNumber[] = + { + "一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二" + }; + static SimpleDateFormat chineseDateFormat = new SimpleDateFormat("yyyy年MM月dd日", Locale.CHINA); + final static long[] lunarInfo = new long[] + { // + 0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, // + 0x055d2, 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, // + 0x095b0, 0x14977, 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, // + 0x09570, 0x052f2, 0x04970, 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, // + 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, // + 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, 0x06ca0, 0x0b550, 0x15355, 0x04da0, // + 0x0a5d0, 0x14573, 0x052d0, 0x0a9a8, 0x0e950, 0x06aa0, 0x0aea6, 0x0ab50, 0x04b60, // + 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, 0x096d0, 0x04dd5, // + 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b5a0, 0x195a6, 0x095b0, // + 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, // + 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, // + 0x092e0, 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, // + 0x092d0, 0x0cab5, 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, // + 0x15176, 0x052b0, 0x0a930, 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, // + 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, 0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, // + 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, // + 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0 + }; + + // 农历部分假日 + final static String[] lunarHoliday = new String[] + { + "0101 春节", "0115 元宵", "0505 端午", "0707 情人", "0715 中元", "0815 中秋", "0909 重阳", "1208 腊八", "1224 小年", "0100 除夕" + }; + + // 公历部分节假日 + final static String[] solarHoliday = new String[] + { // + "0101 元旦", "0214 情人", "0308 妇女", "0312 植树", "0315 消费者权益日", "0401 愚人", "0501 劳动", "0504 青年", // + "0512 护士", "0601 儿童", "0701 建党", "0801 建军", "0808 父亲", "0909 毛泽东逝世纪念", "0910 教师", "0928 孔子诞辰", // + "1001 国庆", "1006 老人", "1024 联合国日", "1112 孙中山诞辰纪念", "1220 澳门回归纪念", "1225 圣诞", "1226 毛泽东诞辰纪念" + }; + + // ====== 传回农历 y年的总天数 + final private static int yearDays(int y) + { + int i, sum = 348; + for (i = 0x8000; i > 0x8; i >>= 1) + { + if ((lunarInfo[y - 1900] & i) != 0) + { + sum += 1; + } + } + return (sum + leapDays(y)); + } + + // ====== 传回农历 y年闰月的天数 + final private static int leapDays(int y) + { + if (leapMonth(y) != 0) + { + if ((lunarInfo[y - 1900] & 0x10000) != 0) + { + return 30; + } + else + { + return 29; + } + } + else + { + return 0; + } + } + + // ====== 传回农历 y年闰哪个月 1-12 , 没闰传回 0 + final private static int leapMonth(int y) + { + int result = (int) (lunarInfo[y - 1900] & 0xf); + return result; + } + + // ====== 传回农历 y年m月的总天数 + final private static int monthDays(int y, int m) + { + if ((lunarInfo[y - 1900] & (0x10000 >> m)) == 0) + { + return 29; + } + else + { + return 30; + } + } + + // ====== 传回农历 y年的生肖 + final public String animalsYear(int year) + { + final String[] Animals = new String[] + { + "鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪" + }; + return Animals[(year - 4) % 12]; + } + + // ====== 传入 月日的offset 传回干支, 0=甲子 + final private static String cyclicalm(int num) + { + final String[] Gan = new String[] + { + "甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸" + }; + final String[] Zhi = new String[] + { + "子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥" + }; + return (Gan[num % 10] + Zhi[num % 12]); + } + + // ====== 传入 offset 传回干支, 0=甲子 + final public String cyclical(int year) + { + int num = year - 1900 + 36; + return (cyclicalm(num)); + } + + public static String getChinaDayString(int day) + { + String chineseTen[] = + { + "初", "十", "廿", "卅" + }; + int n = day % 10 == 0 ? 9 : day % 10 - 1; + if (day > 30) + { + return ""; + } + if (day == 10) + { + return "初十"; + } + else + { + return chineseTen[day / 10] + chineseNumber[n]; + } + } + + /** + * 传出y年m月d日对应的农历. yearCyl3:农历年与1864的相差数 ? monCyl4:从1900年1月31日以来,闰月数 + * dayCyl5:与1900年1月31日相差的天数,再加40 ? + * + * isday: 这个参数为false---日期为节假日时,阴历日期就返回节假日 ,true---不管日期是否为节假日依然返回这天对应的阴历日期 + * + * @return + */ + public String getLunarDate(int year_log, int month_log, int day_log, boolean isday) + { + int yearCyl = 0; + int monCyl = 0; + int dayCyl = 0; + // int leapMonth = 0; + String nowadays; + Date baseDate = null; + Date nowaday = null; + try + { + baseDate = chineseDateFormat.parse("1900年1月31日"); + } + catch (ParseException e) + { + e.printStackTrace(); // To change body of catch statement use + // Options | File Templates. + } + + nowadays = year_log + "年" + month_log + "月" + day_log + "日"; + try + { + nowaday = chineseDateFormat.parse(nowadays); + } + catch (ParseException e) + { + e.printStackTrace(); // To change body of catch statement use + // Options | File Templates. + } + + // 求出和1900年1月31日相差的天数 + int offset = (int) ((nowaday.getTime() - baseDate.getTime()) / 86400000L); + dayCyl = offset + 40; + monCyl = 14; + // System.out.println(dayCyl + monCyl + yearCyl); + // 用offset减去每农历年的天数 + // 计算当天是农历第几天 + // i最终结果是农历的年份 + // offset是当年的第几天 + int iYear, daysOfYear = 0; + for (iYear = 1900; iYear < 10000 && offset > 0; iYear++) + { + daysOfYear = yearDays(iYear); + offset -= daysOfYear; + monCyl += 12; + } + if (offset < 0) + { + offset += daysOfYear; + iYear--; + monCyl -= 12; + } + // 农历年份 + year = iYear; + setYear(year); // 设置公历对应的农历年份 + + yearCyl = iYear - 1864; + leapMonth = leapMonth(iYear); // 闰哪个月,1-12 + boolean leap = false; + + // 用当年的天数offset,逐个减去每月(农历)的天数,求出当天是本月的第几天 + int iMonth, daysOfMonth = 0; + for (iMonth = 1; iMonth < 13 && offset > 0; iMonth++) + { + // 闰月 + if (leapMonth > 0 && iMonth == (leapMonth + 1) && !leap) + { + --iMonth; + leap = true; + daysOfMonth = leapDays(year); + } + else + { + daysOfMonth = monthDays(year, iMonth); + } + + offset -= daysOfMonth; + // 解除闰月 + if (leap && iMonth == (leapMonth + 1)) + { + leap = false; + } + if (!leap) + { + monCyl++; + } + } + // offset为0时,并且刚才计算的月份是闰月,要校正 + if (offset == 0 && leapMonth > 0 && iMonth == leapMonth + 1) + { + if (leap) + { + leap = false; + } + else + { + leap = true; + --iMonth; + --monCyl; + } + } + // offset小于0时,也要校正 + if (offset < 0) + { + offset += daysOfMonth; + --iMonth; + --monCyl; + } + month = iMonth; + setLunarMonth(chineseNumber[month - 1] + "月"); // 设置对应的阴历月份 + day = offset + 1; + + if (!isday) + { + // 如果日期为节假日则阴历日期则返回节假日 + // setLeapMonth(leapMonth); + for (int i = 0; i < solarHoliday.length; i++) + { + // 返回公历节假日名称 + String sd = solarHoliday[i].split(" ")[0]; // 节假日的日期 + String sdv = solarHoliday[i].split(" ")[1]; // 节假日的名称 + String smonth_v = month_log + ""; + String sday_v = day_log + ""; + String smd = ""; + if (month_log < 10) + { + smonth_v = "0" + month_log; + } + if (day_log < 10) + { + sday_v = "0" + day_log; + } + smd = smonth_v + sday_v; + if (sd.trim().equals(smd.trim())) + { + return sdv; + } + } + + for (int i = 0; i < lunarHoliday.length; i++) + { + // 返回农历节假日名称 + String ld = lunarHoliday[i].split(" ")[0]; // 节假日的日期 + String ldv = lunarHoliday[i].split(" ")[1]; // 节假日的名称 + String lmonth_v = month + ""; + String lday_v = day + ""; + String lmd = ""; + if (month < 10) + { + lmonth_v = "0" + month; + } + if (day < 10) + { + lday_v = "0" + day; + } + lmd = lmonth_v + lday_v; + if ("12".equals(lmonth_v)) + { // 除夕夜需要特殊处理 + if ((daysOfMonth == 29 && day == 29) || (daysOfMonth == 30 && day == 30)) + { + return ldv; + } + } + if (ld.trim().equals(lmd.trim())) + { + return ldv; + } + } + } + if (day == 1) + { + return chineseNumber[month - 1] + "月"; + } + else + { + return getChinaDayString(day); + } + + } + + @Override + public String toString() + { + if (chineseNumber[month - 1] == "一" && getChinaDayString(day) == "初一") + { + return "农历" + year + "年"; + } + else if (getChinaDayString(day) == "初一") + { + return chineseNumber[month - 1] + "月"; + } + else + { + return getChinaDayString(day); + // return year + "年" + (leap ? "闰" : "") + chineseNumber[month - 1] + + // "月" + getChinaDayString(day); + } + } + + /* + * public static void main(String[] args) { System.out.println(new + * LunarCalendar().getLunarDate(2012, 1, 23)); } + */ + + public int getLeapMonth() + { + return leapMonth; + } + + public void setLeapMonth(int leapMonth) + { + this.leapMonth = leapMonth; + } + + /** + * 得到当前日期对应的阴历月份 + * + * @return + */ + public String getLunarMonth() + { + return lunarMonth; + } + + public void setLunarMonth(String lunarMonth) + { + this.lunarMonth = lunarMonth; + } + + /** + * 得到当前年对应的农历年份 + * + * @return + */ + public int getYear() + { + return year; + } + + public void setYear(int year) + { + this.year = year; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesMaterialCat.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesMaterialCat.java new file mode 100644 index 0000000..a1c6739 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesMaterialCat.java @@ -0,0 +1,76 @@ +package com.zhiqim.yangcai.design.dbo.works; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * CDR素材分类表 对应表《DES_MATERIAL_CAT》 + */ +@AnAlias("DesMaterialCat") +@AnNew +@AnTable(table = "DES_MATERIAL_CAT", key = "CAT_ID", type = "InnoDB") +public class DesMaterialCat implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "CAT_ID", type = "long", notNull = true) + private long catId; // 1.分类编号 + @AnTableField(column = "CAT_NAME", type = "string,32", notNull = true) + private String catName; // 2.分类名称 + @AnTableField(column = "CAT_STATUS", type = "byte", notNull = true) + private int catStatus; // 3.状态,0:正常,1:停用 + @AnTableField(column = "CAT_SEQ", type = "int", notNull = true) + private int catSeq; // 4.序号 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getCatId() + { + return catId; + } + + public void setCatId(long catId) + { + this.catId = catId; + } + + public String getCatName() + { + return catName; + } + + public void setCatName(String catName) + { + this.catName = catName; + } + + public int getCatStatus() + { + return catStatus; + } + + public void setCatStatus(int catStatus) + { + this.catStatus = catStatus; + } + + public int getCatSeq() + { + return catSeq; + } + + public void setCatSeq(int catSeq) + { + this.catSeq = catSeq; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesMaterialCont.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesMaterialCont.java new file mode 100644 index 0000000..c78c152 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesMaterialCont.java @@ -0,0 +1,180 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dbo.works; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * CDR素材表 对应表《DES_MATERIAL_CONT》 + */ +@AnAlias("DesMaterialCont") +@AnNew +@AnTable(table="DES_MATERIAL_CONT", key="MID", type="InnoDB") +public class DesMaterialCont implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="MID", type="long", notNull=true) private long mid; //1.素材编号 + @AnTableField(column="CAT_ID", type="long", notNull=true) private long catId; //2.分类编码 + @AnTableField(column="MATERIAL_STATUS", type="byte", notNull=true) private int materialStatus; //3.资源状态,0:正常,1:停用 + @AnTableField(column="MATERIAL_PATH", type="string,200", notNull=true) private String materialPath; //4.资源本地路径 + @AnTableField(column="MATERIAL_URL", type="string,200", notNull=true) private String materialUrl; //5.资源网络路径 + @AnTableField(column="MATERIAL_SEQ", type="int", notNull=true) private int materialSeq; //6.资源序号 + @AnTableField(column="MATERIAL_SUFFIX", type="string,16", notNull=true) private String materialSuffix; //7.扩展名 + @AnTableField(column="THUMB_PATH", type="string,200", notNull=false) private String thumbPath; //8.效果图本地路径 + @AnTableField(column="THUMB_URL", type="string,200", notNull=false) private String thumbUrl; //9.效果图网络路径 + @AnTableField(column="KEYWORDS", type="string,128", notNull=false) private String keywords; //10.关键字,多个空格分隔 + @AnTableField(column="UPLOADER", type="string,20", notNull=false) private String uploader; //11.上传者 + @AnTableField(column="UPLOAD_TIME", type="string,19", notNull=true) private String uploadTime; //12.上传时间 + @AnTableField(column="OSS_STATUS", type="int", notNull=true) private int ossStatus; //13.0=未上传,1=已上传,2=不需要上传 + + public String toString() + { + return Jsons.toString(this); + } + + public long getMid() + { + return mid; + } + + public void setMid(long mid) + { + this.mid = mid; + } + + public long getCatId() + { + return catId; + } + + public void setCatId(long catId) + { + this.catId = catId; + } + + public int getMaterialStatus() + { + return materialStatus; + } + + public void setMaterialStatus(int materialStatus) + { + this.materialStatus = materialStatus; + } + + public String getMaterialPath() + { + return materialPath; + } + + public void setMaterialPath(String materialPath) + { + this.materialPath = materialPath; + } + + public String getMaterialUrl() + { + return materialUrl; + } + + public void setMaterialUrl(String materialUrl) + { + this.materialUrl = materialUrl; + } + + public int getMaterialSeq() + { + return materialSeq; + } + + public void setMaterialSeq(int materialSeq) + { + this.materialSeq = materialSeq; + } + + public String getMaterialSuffix() + { + return materialSuffix; + } + + public void setMaterialSuffix(String materialSuffix) + { + this.materialSuffix = materialSuffix; + } + + public String getThumbPath() + { + return thumbPath; + } + + public void setThumbPath(String thumbPath) + { + this.thumbPath = thumbPath; + } + + public String getThumbUrl() + { + return thumbUrl; + } + + public void setThumbUrl(String thumbUrl) + { + this.thumbUrl = thumbUrl; + } + + public String getKeywords() + { + return keywords; + } + + public void setKeywords(String keywords) + { + this.keywords = keywords; + } + + public String getUploader() + { + return uploader; + } + + public void setUploader(String uploader) + { + this.uploader = uploader; + } + + public String getUploadTime() + { + return uploadTime; + } + + public void setUploadTime(String uploadTime) + { + this.uploadTime = uploadTime; + } + + public int getOssStatus() + { + return ossStatus; + } + + public void setOssStatus(int ossStatus) + { + this.ossStatus = ossStatus; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesWorksEvent.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesWorksEvent.java new file mode 100644 index 0000000..3393226 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesWorksEvent.java @@ -0,0 +1,89 @@ +package com.zhiqim.yangcai.design.dbo.works; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 作品库事件表 对应表《DES_WORKS_EVENT》 + */ +@AnAlias("DesWorksEvent") +@AnNew +@AnTable(table = "DES_WORKS_EVENT", key = "EVENT_ID", type = "InnoDB") +public class DesWorksEvent implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "EVENT_ID", type = "long", notNull = true) + private long eventId; // 1.事件ID + @AnTableField(column = "WORKS_ID", type = "long", notNull = true) + private long worksId; // 2.作品ID + @AnTableField(column = "EVENT_TYPE", type = "int", notNull = true) + private int eventType; // 3.事件类型(1代表浏览、2代表收藏,3代表给我分享的、4代表下载) + @AnTableField(column = "OPERATOR_CODE", type = "string,64", notNull = false) + private String operatorCode; // 4.操作人 + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 5.创建时间 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getEventId() + { + return eventId; + } + + public void setEventId(long eventId) + { + this.eventId = eventId; + } + + public long getWorksId() + { + return worksId; + } + + public void setWorksId(long worksId) + { + this.worksId = worksId; + } + + public int getEventType() + { + return eventType; + } + + public void setEventType(int eventType) + { + this.eventType = eventType; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesWorksEventView.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesWorksEventView.java new file mode 100644 index 0000000..e6cc9f1 --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesWorksEventView.java @@ -0,0 +1,56 @@ +package com.zhiqim.yangcai.design.dbo.works; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +/** + * 源文件事件关联表 对应视图《DES_WORKS_EVENT_VIEW》 + */ +@AnAlias("DesWorksEventView") +@AnNew +@AnView("DES_WORKS_FILE,DES_WORKS_EVENT") +@AnViewJoin( +{ + @AnViewJoinValue(type = "EQUAL", lTable = "DES_WORKS_FILE", lColumn = "WORKS_ID", rTable = "DES_WORKS_EVENT", rColumn = "WORKS_ID") +}) +public class DesWorksEventView extends DesWorksFile +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table = "DES_WORKS_EVENT", column = "EVENT_TYPE") + private int eventType; // 1.事件类型(1代表浏览、2代表收藏,3代表给我分享的、4代表下载) + @AnViewField(table = "DES_WORKS_EVENT", column = "OPERATOR_CODE") + private String operatorCode; // 2.操作人 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public int getEventType() + { + return eventType; + } + + public void setEventType(int eventType) + { + this.eventType = eventType; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + +} diff --git a/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesWorksFile.java b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesWorksFile.java new file mode 100644 index 0000000..67b076b --- /dev/null +++ b/Yangcai365_web/src/dbo/com/zhiqim/yangcai/design/dbo/works/DesWorksFile.java @@ -0,0 +1,365 @@ +package com.zhiqim.yangcai.design.dbo.works; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 作品库 对应表《DES_WORKS_FILE》 + */ +@AnAlias("DesWorksFile") +@AnNew +@AnTable(table = "DES_WORKS_FILE", key = "WORKS_ID", type = "InnoDB") +public class DesWorksFile implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "WORKS_ID", type = "long", notNull = true) + private long worksId; // 1.作品ID + @AnTableField(column = "INDUSTRY_ID", type = "long", notNull = true) + private long industryId; // 2.行业ID + @AnTableField(column = "PRD_TYPE_ID", type = "long", notNull = true) + private long prdTypeId; // 3.产品类型ID + @AnTableField(column = "PRD_PAGE_ID", type = "long", notNull = true) + private long prdPageId; // 4.面数ID + @AnTableField(column = "PRD_SIZE_ID", type = "long", notNull = true) + private long prdSizeId; // 5.尺寸ID + @AnTableField(column = "TEMPLATE_ID", type = "long", notNull = false) + private long templateId; // 6.模板ID + @AnTableField(column = "INDUSTRY_SUB_IDS", type = "string,5000", notNull = false) + private String industrySubIds; // 7.子行业ID + @AnTableField(column = "INDUSTRY_SUB_NAME", type = "string,5000", notNull = false) + private String industrySubName; // 8.子行业名称 + @AnTableField(column = "ATTRIBUTE_IDS", type = "string,5000", notNull = false) + private String attributeIds; // 9.属性ID + @AnTableField(column = "ATTRIBUTE_NAME", type = "string,5000", notNull = false) + private String attributeName; // 10.属性名称 + @AnTableField(column = "KEYWORD_ID", type = "long", notNull = false) + private long keywordId; // 11.关键词ID + @AnTableField(column = "KEYWORD_NAME", type = "string,5000", notNull = false) + private String keywordName; // 12.关键词名称 + @AnTableField(column = "WORKS_NAME", type = "string,255", notNull = false) + private String worksName; // 13.作品名称 + @AnTableField(column = "WORKS_TYPE", type = "int", notNull = false) + private int worksType; // 14.作品类型(0代表普通、1代表精品、2代表待审精品、3代表模板审核、4代表模板) + @AnTableField(column = "CDR_FILE_NAME", type = "string,255", notNull = true) + private String cdrFileName; // 15.CDR源文件名称 + @AnTableField(column = "PDF_FILE_NAME", type = "string,255", notNull = false) + private String pdfFileName; // 16.PDF源文件名称 + @AnTableField(column = "CDR_PATH", type = "string,500", notNull = true) + private String cdrPath; // 17.CDR路径 + @AnTableField(column = "PDF_PATH", type = "string,500", notNull = false) + private String pdfPath; // 18.PDF路径 + @AnTableField(column = "DESIGNER", type = "string,32", notNull = true) + private String designer; // 19.设计师 + @AnTableField(column = "DESIGN_GROUP_ID", type = "string,850", notNull = false) + private String designGroupId; // 20.包含设计小组ID在内的设计师所属部门 + @AnTableField(column = "DEPT_ID", type = "string,850", notNull = false) + private String deptId; // 21.分享部门ID + @AnTableField(column = "THUMB_IMAGE_PATH", type = "string,3000", notNull = false) + private String thumbImagePath; // 22.缩略图存储路径,多个用英文逗号分隔(OSS路径) + @AnTableField(column = "THUMB_IMAGE_OSS_URL", type = "string,3000", notNull = false) + private String thumbImageOssUrl; // 23.缩略图存储路径,多个用英文逗号分隔(OSS路径)废弃 + @AnTableField(column = "THUMB_IMAGE_PHY_PATH", type = "string,3000", notNull = false) + private String thumbImagePhyPath; // 24.缩略图存储路径,多个用英文逗号分隔(物理路径) + @AnTableField(column = "UPLOAD_TYPE", type = "int", notNull = false) + private int uploadType; // 25.上传类型(0代表订单作品,1代表手工上传,2代表只有CDR文件,3代表路径有误) + @AnTableField(column = "CREATE_TIME", type = "datetime", notNull = true) + private Timestamp createTime; // 26.创建时间 + @AnTableField(column = "OSS_STATUS", type = "int", notNull = true) + private int ossStatus; // 27.0=文件在本地, 1=文件已上传在OSS, 2=本地&oss都不存在 + @AnTableField(column = "FILE_TYPE", type = "string,10", notNull = false) + private String fileType; // 28.设计文件类型后缀。pdf、cdr、ai + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getWorksId() + { + return worksId; + } + + public void setWorksId(long worksId) + { + this.worksId = worksId; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public long getPrdPageId() + { + return prdPageId; + } + + public void setPrdPageId(long prdPageId) + { + this.prdPageId = prdPageId; + } + + public long getPrdSizeId() + { + return prdSizeId; + } + + public void setPrdSizeId(long prdSizeId) + { + this.prdSizeId = prdSizeId; + } + + public long getTemplateId() + { + return templateId; + } + + public void setTemplateId(long templateId) + { + this.templateId = templateId; + } + + public String getIndustrySubIds() + { + return industrySubIds; + } + + public void setIndustrySubIds(String industrySubIds) + { + this.industrySubIds = industrySubIds; + } + + public String getIndustrySubName() + { + return industrySubName; + } + + public void setIndustrySubName(String industrySubName) + { + this.industrySubName = industrySubName; + } + + public String getAttributeIds() + { + return attributeIds; + } + + public void setAttributeIds(String attributeIds) + { + this.attributeIds = attributeIds; + } + + public String getAttributeName() + { + return attributeName; + } + + public void setAttributeName(String attributeName) + { + this.attributeName = attributeName; + } + + public long getKeywordId() + { + return keywordId; + } + + public void setKeywordId(long keywordId) + { + this.keywordId = keywordId; + } + + public String getKeywordName() + { + return keywordName; + } + + public void setKeywordName(String keywordName) + { + this.keywordName = keywordName; + } + + public String getWorksName() + { + return worksName; + } + + public void setWorksName(String worksName) + { + this.worksName = worksName; + } + + public int getWorksType() + { + return worksType; + } + + public void setWorksType(int worksType) + { + this.worksType = worksType; + } + + public String getCdrFileName() + { + return cdrFileName; + } + + public void setCdrFileName(String cdrFileName) + { + this.cdrFileName = cdrFileName; + } + + public String getPdfFileName() + { + return pdfFileName; + } + + public void setPdfFileName(String pdfFileName) + { + this.pdfFileName = pdfFileName; + } + + public String getCdrPath() + { + return cdrPath; + } + + public void setCdrPath(String cdrPath) + { + this.cdrPath = cdrPath; + } + + public String getPdfPath() + { + return pdfPath; + } + + public void setPdfPath(String pdfPath) + { + this.pdfPath = pdfPath; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getDesignGroupId() + { + return designGroupId; + } + + public void setDesignGroupId(String designGroupId) + { + this.designGroupId = designGroupId; + } + + public String getDeptId() + { + return deptId; + } + + public void setDeptId(String deptId) + { + this.deptId = deptId; + } + + public String getThumbImagePath() + { + return thumbImagePath; + } + + public void setThumbImagePath(String thumbImagePath) + { + this.thumbImagePath = thumbImagePath; + } + + public String getThumbImageOssUrl() + { + return thumbImageOssUrl; + } + + public void setThumbImageOssUrl(String thumbImageOssUrl) + { + this.thumbImageOssUrl = thumbImageOssUrl; + } + + public String getThumbImagePhyPath() + { + return thumbImagePhyPath; + } + + public void setThumbImagePhyPath(String thumbImagePhyPath) + { + this.thumbImagePhyPath = thumbImagePhyPath; + } + + public int getUploadType() + { + return uploadType; + } + + public void setUploadType(int uploadType) + { + this.uploadType = uploadType; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public int getOssStatus() + { + return ossStatus; + } + + public void setOssStatus(int ossStatus) + { + this.ossStatus = ossStatus; + } + + public String getFileType() + { + return fileType; + } + + public void setFileType(String fileType) + { + this.fileType = fileType; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/DesignerWorkListner.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/DesignerWorkListner.java new file mode 100644 index 0000000..47470f4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/DesignerWorkListner.java @@ -0,0 +1,127 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design; + +import org.zhiqim.httpd.HttpWebsocket; +import org.zhiqim.httpd.HttpWebsocketConnection; +import org.zhiqim.httpd.HttpWebsocketManager; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Bytes; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.DesignerWorkStatus; +import com.zhiqim.yangcai.design.dao.DesignerDao; +import com.zhiqim.yangcai.design.dbo.dispatch.DesOnline; + +/** + * 设计师上下班监听器 + * + * @version v1.0.0 @author zouzhigang 2017-12-21 新建与整理 + */ +@AnAlias("yangcai_designer") +public class DesignerWorkListner implements HttpWebsocket +{ + private static final Log log = LogFactory.getLog(DesignerWorkListner.class); + + @Override + public void onOpen(HttpWebsocketConnection conn) + { + if (!"yangcai_designer".equals(conn.getProtocol())) + return; + + ZmrSessionUser sessionUser = conn.getSession().getSessionUser(ZmrSessionUser.class); + if (sessionUser == null) + return; + + HttpWebsocketManager websocketManager = conn.getWebsocketManager(); + if (websocketManager.get("yangcai_designer", sessionUser.getSessionId()).size() == 0) + websocketManager.add(conn); + + Updater updater = new Updater() + .addMust("operatorCode", sessionUser.getSessionName()) + .addField("sessionId", sessionUser.getSessionId()); + + try + { + ORM.get(ZTable.class).update(DesOnline.class, updater); + + //写入登录浏览器日志 + DesignerDao.doWorksStatusLog(sessionUser.getOperatorOrgId(), sessionUser.getSessionName(), "登录浏览器", DesignerWorkStatus.LOGIN_ED); + } + catch (Exception e) + { + log.error("设计师[%s][%s]异常", sessionUser.getSessionName(), "登录浏览器", e); + } + } + + @Override + public void onClose(HttpWebsocketConnection conn) + { + close(conn, "退出浏览器"); + } + + @Override + public void onException(HttpWebsocketConnection conn, Throwable e) + { + close(conn, "异常退出浏览器"); + } + + @Override + public void onMessage(HttpWebsocketConnection conn, String message) + { + if (!"yangcai_designer".equals(conn.getProtocol())) + return; + + log.info("设计师信息:" + message); + } + + @Override + public void onMessage(HttpWebsocketConnection conn, byte[] message) + { + if (!"yangcai_designer".equals(conn.getProtocol())) + return; + + log.info("设计师信息:" + Bytes.toStringASCII(message)); + } + + private void close(HttpWebsocketConnection conn, String reason) + { + if (!"yangcai_designer".equals(conn.getProtocol())) + return; + + ZmrSessionUser user = conn.getSession().getSessionUser(ZmrSessionUser.class); + if (user == null) + return; + + try + { + + //设计师下班&停止接单操作 + if (DesignerDao.isDesignerOnWork(user.getSessionName()))//如果设计师 此刻处于正在接单状态,则设置设计师下班状态 + DesignerDao.stopWorkExec(user.getOperatorOrgId(), user.getSessionName(), "停止接单(浏览器断开)"); + + DesignerDao.doWorksStatusLog(user.getOperatorOrgId(), user.getSessionName(), reason, DesignerWorkStatus.LOGOUT); + } + catch (Exception e) + { + log.error("设计师[%s][%s]异常", user.getSessionName(), reason, e); + } + + log.info("设计师[%s][%s]", user.getSessionName(), reason); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/MediaDesignBootstrap.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/MediaDesignBootstrap.java new file mode 100644 index 0000000..eed9b44 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/MediaDesignBootstrap.java @@ -0,0 +1,95 @@ +package com.zhiqim.yangcai.design; + +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.kernel.Global; +import org.zhiqim.manager.ZmrBootstrapApi; + +import com.zhiqim.media.service.Employee; +import com.zhiqim.yangcai.cache.CustomerTypeCache; +import com.zhiqim.yangcai.cache.DesMaterialCatCache; +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.cache.DesignMerchantCache; +import com.zhiqim.yangcai.cache.DesignOrderRefundReasonCache; +import com.zhiqim.yangcai.cache.DesignTypeCache; +import com.zhiqim.yangcai.cache.IndustryLabelCache; +import com.zhiqim.yangcai.cache.LabelDimensionCache; +import com.zhiqim.yangcai.cache.OrgCache; +import com.zhiqim.yangcai.cache.ProductConvertCache; +import com.zhiqim.yangcai.design.service.MediaDesignEmployee; + +/** + * 初始化类 + * + * @version v1.0.0 @author zhouwenbin 2017-7-24 新建与整理 + * @version v1.1.0 @author caohong 2019-8-29 增加商户信息缓存 + */ +public class MediaDesignBootstrap extends ZmrBootstrapApi +{ + /** + * 在配置加载之后,初始化系统接口 + * + * @throws Exception + */ + public void init(Context context) throws Exception + { + initCache(); + } + + public static void initCache() + { + + // 实现编辑编辑回调 + MediaDesignEmployee ws = new MediaDesignEmployee(); + Employee employee = new Employee(); + employee.setEmployer(ws); + Global.add(Employee.class, employee); + + // 初始化作品素材分类 + Global.add(DesMaterialCatCache.class, new DesMaterialCatCache().doRefresh()); + + // 初始化商户信息缓存 + DesignMerchantCache merchantCache = Global.get(DesignMerchantCache.class); + merchantCache = merchantCache != null ? merchantCache : new DesignMerchantCache(); + Global.add(DesignMerchantCache.class, merchantCache.doRefresh()); + + // 设计分类 + DesignTypeCache dc = Global.get(DesignTypeCache.class); + dc = dc != null ? dc : new DesignTypeCache(); + Global.add(DesignTypeCache.class, dc.doRefresh()); + + // 产品单价 + ProductConvertCache pc = Global.get(ProductConvertCache.class); + pc = pc != null ? pc : new ProductConvertCache(); + Global.add(ProductConvertCache.class, pc.doRefresh()); + + // 设计行业分类 + DesignIndustryCache dic = Global.get(DesignIndustryCache.class); + dic = dic != null ? dic : new DesignIndustryCache(); + Global.add(DesignIndustryCache.class, dic.doRefresh()); + + // 行业标签缓存 + IndustryLabelCache ilc = Global.get(IndustryLabelCache.class); + ilc = ilc != null ? ilc : new IndustryLabelCache(); + Global.add(IndustryLabelCache.class, new IndustryLabelCache()); + + // 标签维度缓存 + LabelDimensionCache ldc = Global.get(LabelDimensionCache.class); + ldc = ldc != null ? ldc : new LabelDimensionCache(); + Global.add(LabelDimensionCache.class, new LabelDimensionCache()); + + // 客户类型缓存 + CustomerTypeCache ctt = Global.get(CustomerTypeCache.class); + ctt = ctt != null ? ctt : new CustomerTypeCache(); + Global.add(CustomerTypeCache.class, new CustomerTypeCache()); + + // 组织信息缓存 + OrgCache oc = Global.get(OrgCache.class); + oc = oc != null ? oc : new OrgCache(); + Global.add(OrgCache.class, oc.doRefresh()); + // 退款问题配置缓存 + + DesignOrderRefundReasonCache reasonCache = Global.get(DesignOrderRefundReasonCache.class); + reasonCache = reasonCache != null ? reasonCache : new DesignOrderRefundReasonCache(); + Global.add(DesignOrderRefundReasonCache.class, reasonCache.doRefresh()); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/YangcaiPassworder.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/YangcaiPassworder.java new file mode 100644 index 0000000..0d247f9 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/YangcaiPassworder.java @@ -0,0 +1,52 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.codes.MD5; +import org.zhiqim.kernel.util.codes.SHA256; +import org.zhiqim.manager.ZmrPassworder; + +public class YangcaiPassworder extends ZmrPassworder +{ + /** + * 重写 + * + * 操作员密码不可逆编码,默认SHA256(name + code + pass + salt) + * + * @param operatorCode 操作员编码 + * @param operatorPass 操作员密码 + * @param operatorPassSalt 操作员密码盐值 + * @return 编码之后的密码 + */ + public String encode(String operatorCode, String operatorPass, String operatorPassSalt) + { + return SHA256.encodeUTF8("fadfox" + operatorCode + operatorPass + operatorPassSalt); + } + + /** + * 重写 + * + * 密钥编码,默认MD5(name + code + salt),取MD5前10 + len + 后20 + * + * @param operatorCode 操作员编码 + * @param operatorPass 操作员密码 + * @param operatorPassSalt 操作员密码盐值 + * @return 编码之后的密码 + */ + public String secret(String operatorCode, String operatorPass, String operatorPassSalt) + { + String value = Strings.prefixZero(operatorPass.length(), 2); + String md5 = MD5.encodeUTF8("fadfox" + operatorCode + operatorPassSalt); + return md5.substring(0, 10) + value + md5.substring(12); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/AttaFileListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/AttaFileListAction.java new file mode 100644 index 0000000..5550534 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/AttaFileListAction.java @@ -0,0 +1,163 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action; + +import java.io.File; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.media.dbo.dzmp.DzmpUserCardStorage; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.AttaFileDao; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.model.AttaFileModel; + +/** + * 设计文件列表,右边iframe使用 + * + * @author zhouwenbin + * + */ +public class AttaFileListAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String data = request.getParameter("data"); + String addRule = request.getParameter("addRule"); // 添加排除项 + String delRule = request.getParameter("delRule"); // 删除排除项 + String checkeds = request.getParameter("checkeds"); + + request.setAttribute("checkeds", Validates.isEmpty(checkeds) ? false : true); + + List addList = Lists.toStringList(addRule); + List delList = Lists.toStringList(delRule); + + int height = 0; + List attaList = new ArrayList<>(); + if (Validates.isNotEmpty(data)) + { + String dateDir = DateTimes.getDateTime8String(); + for (String key : data.split(",")) + { + key = key.trim(); + AttaFileModel temp = AttaFileDao.get(key); + if (temp != null) + { + if ("file".equals(temp.getType())) + { + temp.setSavePath(dateDir + "/" + temp.getName()); + if (addList.contains(key)) + { + temp.setAdd(false); + } + else + { + temp.setAdd(true); + } + + if (delList.contains(key)) + { + temp.setDel(false); + } + else + { + temp.setDel(true); + } + } + + height += temp.getHeight(); + attaList.add(temp); + } + } + } + + request.setAttribute("attaList", attaList); + request.setAttribute("height", height); + + long designId = request.getParameterLong("designId"); + if (designId == -1) + { + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + request.setAttribute("order", order); + + if (data.contains("ThumFile") && order.getStatus() >= StatusConstants.ORDER_55.value()) + {// 智能名片展示缩略图 + DzmpUserCardStorage card = ORM.get(ZTable.class).item(DzmpUserCardStorage.class, new Selector("designId", designId).addOrderbyAsc("addTime")); + if (card != null && Validates.isNotEmpty(card.getCardUrl())) + { + int thumFileListIndex = 0; + for (Iterator it = attaList.iterator(); it.hasNext();) + { + AttaFileModel attaFileModel = it.next(); + if ("thumFile".equals(attaFileModel.getType())) + { + it.remove();// 先删除 + + AttaFileModel attaModel = new AttaFileModel("thumFile", "缩略图", "thumFile"); + + attaModel.setName("缩略图"); + attaModel.setType("thumFile"); + attaModel.setHeight(190); + attaModel.setSavePath(card.getCardUrl()); + + attaList.add(thumFileListIndex, attaModel);// 当前位置替换文件对象 + break; + } + thumFileListIndex++; + } + } + } + request.setAttribute("attaList", attaList); + + // 订单客户素材、源文件、成品文件 + List fileList = ORM.get(ZTable.class).list(DesignAtta.class, new Selector("designId", designId)); + request.setAttribute("fileList", fileList); + + String endFileLink = null; + for (DesignAtta atta : fileList) + { + if (FileTypeConstants.FILE_END.value().equals(atta.getAttaModul()) && Validates.isNotEmptyBlank(atta.getOssUrl())) + { + endFileLink = atta.getOssUrl(); + break; + } + else if (FileTypeConstants.FILE_END.value().equals(atta.getAttaModul()) && new File(atta.getSavePath()).exists()) + { + String prefix = Global.getString("designParam", "endFileLink"); + if (Validates.isUrl(prefix)) + { + endFileLink = prefix + atta.getAttaId(); + } + } + } + request.setAttribute("endFileLink", endFileLink); + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/CacheRefreshAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/CacheRefreshAction.java new file mode 100644 index 0000000..b204405 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/CacheRefreshAction.java @@ -0,0 +1,56 @@ +/** + * 扬彩印刷设计 + * 文件名 :CacheRefreshAction.java + * 创建人 :gjx + * 创建时间:2019-12-23 + */ + +package com.zhiqim.yangcai.design.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; + +import com.zhiqim.yangcai.cache.CustomerTypeCache; +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.cache.IndustryLabelCache; +import com.zhiqim.yangcai.cache.LabelDimensionCache; + +/** + * [简要描述]刷新缓存 :
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-12-23 新建与整理 + */ +public class CacheRefreshAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + // 设计行业分类 + DesignIndustryCache dic = Global.get(DesignIndustryCache.class); + dic = dic != null ? dic : new DesignIndustryCache(); + Global.remove(DesignIndustryCache.class); + Global.add(DesignIndustryCache.class, dic.doRefresh()); + + // 行业标签缓存 + IndustryLabelCache idl = Global.get(IndustryLabelCache.class); + idl = idl != null ? idl : new IndustryLabelCache(); + Global.remove(IndustryLabelCache.class); + Global.add(IndustryLabelCache.class, idl.doRefresh()); + + // 标签维度缓存 + LabelDimensionCache lbd = Global.get(LabelDimensionCache.class); + lbd = lbd != null ? lbd : new LabelDimensionCache(); + Global.remove(LabelDimensionCache.class); + Global.add(LabelDimensionCache.class, lbd.doRefresh()); + + // 客户类型缓存 + CustomerTypeCache ctt = Global.get(CustomerTypeCache.class); + ctt = ctt != null ? ctt : new CustomerTypeCache(); + Global.remove(CustomerTypeCache.class); + Global.add(CustomerTypeCache.class, ctt.doRefresh()); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DesignRefundAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DesignRefundAction.java new file mode 100644 index 0000000..42b08c3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DesignRefundAction.java @@ -0,0 +1,69 @@ +package com.zhiqim.yangcai.design.action; + +import java.io.IOException; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.constants.HttpConstants; +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Minute; +import org.zhiqim.kernel.schedule.Scheduler; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.kernel.util.consts.Str; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; + +import org.zhiqim.orm.dbo.Updater; + + +import com.zhiqim.yangcai.design.constants.StatusConstants; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + + +/**** + * 订单退款同步 + * + * @version v1.0.0 @author wuyongkang 23-12-20 + */ +public class DesignRefundAction implements Action, HttpConstants { + private static final Log log = LogFactory.getLog(DesignRefundAction.class); + + @Override + public void execute(HttpRequest request) throws ORMException, SQLException { + String appkey = request.getParameter("appkey"); + if(appkey.equals("15448AKAK125455")){ + String tid = request.getParameter("tid"); + Updater updater = new Updater(); + updater.addMust("designId", Long.valueOf(tid)); + updater.addField("status", StatusConstants.ORDER_34.value()); + updater.addField("refundTime", DateTimes.getDateTimeString()); + updater.addField("complaintFlag", 0); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + } + System.out.println(appkey); + + } + + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DesignRestAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DesignRestAction.java new file mode 100644 index 0000000..4d99bfe --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DesignRestAction.java @@ -0,0 +1,333 @@ +package com.zhiqim.yangcai.design.action; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.constants.HttpConstants; +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Minute; +import org.zhiqim.kernel.schedule.Scheduler; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.kernel.util.consts.Str; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.alibaba.fastjson.JSON; +import com.zhiqim.yangcai.design.dao.MerchantDao; +import com.zhiqim.yangcai.design.dbo.api.ApiInvokeLog; +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; +import com.zhiqim.yangcai.design.server.ApiResponse; +import com.zhiqim.yangcai.design.server.DesignController; +import com.zhiqim.yangcai.util.QiyeWechatUtil; + +/**** + * 设计平台接口服务类,再通知方法匹配具体的处理类 + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public class DesignRestAction implements Action, HttpConstants { + private static final Log log = LogFactory.getLog(DesignRestAction.class); + + @Override + public void execute(HttpRequest request) { + if (isQueryMethod(request)) { + return; + } + + initTask();// 初始化日志清理任务 + request.getResponse().addHeader("Content-Type", "text/xml"); + + ApiErrorResponse error = new ApiErrorResponse(); + // 第一步,查询内容 + int len = request.getContentLength(); + if (len == 0) { + Int code = ApiErrorCodes.ERROR_API_NO_REQUEST_CONTENT; + error.setError(null, code.value(), code.desc()); + responseError(request.getResponse(), error, request.getRemoteAddr(), request.getRequestURI()); + return; + } + + // 第二步 获取参数信息 + String queryString = request.getInputStreamString(); + TreeMap paramMap = new TreeMap(); + Urls.toMapUTF8(queryString, paramMap); + if(paramMap.isEmpty()) { + paramMap = JSON.parseObject(queryString, paramMap.getClass()); + } + + // 第三步 检查访问类型 + // int queryOption = request.getParameterAmount2R(name) + + // 第三步 验证必须参数参数格式 + String method = paramMap.get("method"); + String timestamp = paramMap.get("timestamp"); + String merchantId = paramMap.get("merchantId"); + String appKey = paramMap.get("appKey");// appKey 将替代 merchantId + if (Validates.isNotEmptyBlank(merchantId)) { + merchantId = appKey; + } + + String sign = paramMap.remove("sign"); + + if (!DesignController.validateSysMustParam(error, method, timestamp, merchantId, sign)) { + responseError(request.getResponse(), error, request.getRemoteAddr(), method); + return; + } + + // 第四步 验证商户 + DesignMerchant mer = null; + try { + mer = MerchantDao.get(Longs.toLong(merchantId, 0)); + } catch (Exception e) { + Int code = ApiErrorCodes.ERROR_API_REST; + error.setError(null, code.value(), code.desc(), e); + responseError(request.getResponse(), error, request.getRemoteAddr(), method); + return; + } + + if (mer == null || !mer.isEnabled()) { + Int code = ApiErrorCodes.ERROR_API_DESIGN_MERCHANT; + error.setError(null, code.value(), code.desc()); + responseError(request.getResponse(), error, request.getRemoteAddr(), method); + return; + } + + // 第五步 验证签名 + String appSecret = mer.getMerchantSecret(); + String signMD5 = DesignController.biuldSignMD5(method, timestamp, merchantId, appSecret); + if (!signMD5.equalsIgnoreCase(sign)) { + Int code = ApiErrorCodes.ERROR_API_REQUEST_SIGN; + error.setError(null, code.value(), code.desc()); + responseError(request.getResponse(), error, mer.getMerchantName(), method); + return; + } + + // 第六步 参数解析&参数验证,得到请求类 + ApiRequest req = DesignController.getRequest(method); + try { + if (!req.parse(paramMap, sign, error)) { + responseError(request.getResponse(), error, mer.getMerchantName(), method); + return; + } + } catch (Exception e) { + log.error("客户端[" + request.getRemoteAddr() + "]调用接口[" + method + "]异常", e); + Int code = ApiErrorCodes.ERROR_API_SERVER; + error.setError(null, code.value(), code.desc(), e); + responseError(request.getResponse(), error, mer.getMerchantName(), method); + return; + } + + // 第七部 获取接口请求 处理器处理请求 + Handler> handler = DesignController.getHandler(req); + ApiErrorResponse handleResult = null; + Transaction tx = null; + try { + tx = TransactionManager.beginTransaction(); + handler.process(req); + handleResult = req.getError(); + if (handleResult != null) { + tx.rollback();// 处理失败 事务回滚 + } else { + tx.commit();// 提交事务 + } + } catch (Exception e) { + // 事务回滚 + if (tx != null) { + try { + tx.rollback(); + } catch (Exception e1) { + log.error("客户端[" + request.getRemoteAddr() + "]调用接口[" + method + "]事务回滚异常", e1); + } + } + + log.error("客户端[" + request.getRemoteAddr() + "]调用接口[" + method + "]处理请求异常", e); + Int code = ApiErrorCodes.ERROR_API_SERVER_PROCESS; + error.setError(null, code.value(), code.desc(), e); + handleResult = error; + } finally { + if (tx != null) { + try { + tx.close(); + } catch (Exception e1) { + log.error("客户端[" + request.getRemoteAddr() + "]调用接口[" + method + "]关闭连接异常", e1); + } + } + } + + // 最后 响应结果 + if (handleResult != null) { + responseError(request.getResponse(), handleResult, mer.getMerchantName(), method);// 响应失败 + } else { + responseSuccess(request.getResponse(), req.getResponse(), mer.getMerchantName(), method);// 响应成功 + } + } + + /** 响应成功 */ + private void responseSuccess(HttpResponse response, ApiResponse resp, String merName, String method) { + log.info("客户[" + merName + "]调用接口" + (Validates.isEmptyBlank(method) ? "" : "[" + method + "]") + "成功");// 打印客户端请求方法 + + try { + response.setCharacterEncoding(_UTF_8_); + response.print(resp.buildResponse()); + } catch (IOException e) { + log.error("服务端响应[" + merName + "]调用接口" + (Validates.isEmptyBlank(method) ? "" : "[" + method + "]") + "异常", + e); + } + } + + /** 响应指定失败 */ + private void responseError(HttpResponse response, ApiErrorResponse error, String merName, String method) { + log.error("客户[" + merName + "]调用接口" + (Validates.isEmptyBlank(method) ? "" : "[" + method + "]") + "错误:" + + error.toString());// 打印客户端请求错误 + // 1.通知入库 + String remoteIp = response.getRequest().getRemoteAddr(); + writeInvockLog(remoteIp, merName, method, error.toString(), error); + if (error.getCode() != 721 && error.getCode() != 719) {// 订单已存在,业务不支持(不满足接口判断条件)不发送 + sendMsg(remoteIp, merName, method, error.toString(), error); + } + + // 2.响应 + try { + response.setCharacterEncoding(_UTF_8_); + response.print(error.toString()); + } catch (IOException e) { + log.error("服务端响应[" + merName + "]调用接口" + (Validates.isEmptyBlank(method) ? "" : "[" + method + "]") + "异常", + e); + } + + } + + /** + * [简要描述]:发送错误消息通知
            + * + * @author caohong + */ + private void sendMsg(String remoteIp, String remoteUser, String apiName, String invockMsg, ApiErrorResponse error) { + Map map = new HashMap(); + map.put("remoteIp", remoteIp); + map.put("调用者", remoteUser); + map.put("orderID", error == null ? null : error.getErrorId()); + map.put("apiName", apiName); + map.put("errorMsg", invockMsg.replace("\"", "")); + QiyeWechatUtil.sendMsgToQiyeWechat("设计平台接口调用失败告警:\n" + map.toString()); + } + + /*** 记录接口调用错误日志 */ + private void writeInvockLog(String remoteIp, String remoteUser, String apiName, String invockMsg, + ApiErrorResponse error) { + if (remoteIp == null) { + return; + } + + ApiInvokeLog logInfo = new ApiInvokeLog(); + logInfo.setRemoteIp(remoteIp); + logInfo.setInvokeLogId(Ids.longId19()); + logInfo.setCreateTime(Sqls.nowTimestamp()); + logInfo.setInvokeMessage(invockMsg); + logInfo.setErrorId(error == null ? null : error.getErrorId()); + logInfo.setApiName(apiName); + logInfo.setInvokeStackTrace(error == null ? null : error.getStackTrace()); + logInfo.setStatusCode(error == null ? 0 : error.getCode()); + logInfo.setRemoteUser(remoteUser == null ? remoteIp : remoteUser); + + try { + ORM.get(ZTable.class).insert(logInfo); + } catch (Exception e) { + log.error("客户[" + (Validates.isEmptyBlank(remoteUser) ? remoteIp : remoteUser) + "]调用接口" + + (Validates.isEmptyBlank(apiName) ? "" : "[" + apiName + "]") + "错误信息入库异常", e);// 打印客户端请求错误 + } + } + + private boolean isQueryMethod(HttpRequest request) { + HttpResponse response = request.getResponse(); + response.addHeader("Content-Type", "text/html"); + + String methodOption = request.getParameter("methodOption"); + if (Strings.trim(methodOption) != null) { + if ("all".equalsIgnoreCase(methodOption)) {// 查询所有接口 + try { + response.setCharacterEncoding(_GBK_); + List apiList = DesignController.getApiList(); + for (Str api : apiList) { + boolean flag = false; + if (DesignController.getActivationApi(api.value()) != null) { + flag = true; + } + + response.print("[" + api.value() + "]      接口说明:" + api.desc() + + (flag ? "  (已激活)" : "  (开发中)") + "
            "); + } + } catch (IOException e) { + log.error("查询接口信息异常", e); + } + return true; + } else if ("online".equalsIgnoreCase(methodOption)) { + try { + response.setCharacterEncoding(_GBK_); + List apiList = DesignController.getActivationApiList(); + for (Str api : apiList) { + response.print("[" + api.value() + "]      接口说明:" + api.desc() + + "  (已激活)
            "); + } + } catch (IOException e) { + log.error("查询接口信息异常", e); + } + return true; + } + } + + return false; + } + + private static boolean initedTask = false; + + private void initTask() { + if (initedTask) { + return; + } + + initedTask = true; + // 启动任务 + Scheduler scheduler = Global.getWithoutNew(Scheduler.class); + Task task = new Task() { + @Override + public void execute() { + int diff = 10; + String option = "day"; + String expression = "SUBDATE(now(),INTERVAL (%diff) %option)"; + expression = expression.replace("%diff", "" + diff).replace("%option", option); + Selector selector = new Selector(); + selector.addExpressionThenL("createTime", expression); + try { + ORM.get(ZTable.class).delete(ApiInvokeLog.class, selector); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + + } + }; + scheduler.addTask(new Minute(task, 0)); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DownloadDesignOperatorOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DownloadDesignOperatorOrderAction.java new file mode 100644 index 0000000..0a53621 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DownloadDesignOperatorOrderAction.java @@ -0,0 +1,28 @@ +/** + * 扬彩印刷设计 + * 文件名 :ExpressCacheProvideAction.java + * 创建人 :yixin + * 创建时间:2020-10-17 + */ + +package com.zhiqim.yangcai.design.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + +import com.zhiqim.yangcai.design.presenter.OperatorOrderPresenter; + +/** + * 下载操作员未完成订单 + * + * @version 1.0 @author gjx 2019-11-5 新建与整理 + */ +public class DownloadDesignOperatorOrderAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + OperatorOrderPresenter.downloadDesignOperatorOrder(request); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DownloadFileAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DownloadFileAction.java new file mode 100644 index 0000000..dd1c001 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DownloadFileAction.java @@ -0,0 +1,289 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.httpclient.HttpDownload; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Day; +import org.zhiqim.kernel.schedule.Scheduler; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.presenter.UploadFilePresenter; +import com.zhiqim.yangcai.design.task.TempFileDeleteTask; + +/** + * 文件流下载 + * + * @version v1.0.0 @author zhouwenbin 2017-8-10 新建与整理 + */ +public class DownloadFileAction implements Action { + @SuppressWarnings("unused") + private static Log log = LogFactory.getLog(DownloadFileAction.class); + private static TempFileDeleteTask deleteTempFileTask = TempFileDeleteTask.getInstance(); + + @Override + public void execute(HttpRequest request) throws Exception { + + downLoadFromOss(request); + + // 启动删除临时文件任务 + if (!deleteTempFileTask.isRunning()) { + Scheduler scheduler = Global.getWithoutNew(Scheduler.class); + scheduler.create(); + scheduler.addTask(new Day(deleteTempFileTask, 5, 29, 59)); + deleteTempFileTask.setRunning(true); + } + } + + /** 从oss下载 */ + public void downLoadFromOss(HttpRequest request) throws Exception { + long[] attaIds = Arrays.toLongArray(request.getParameter("attaId")); + if (attaIds.length == 0) { + request.returnHistory("文件不存在"); + return; + } + + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector().addMustInLong("attaId", attaIds)); + + // 至少要有一个文件 + Iterator iterator = attaList.iterator(); + while (iterator.hasNext()) { + DesignAtta atta = iterator.next(); + if (Validates.isNotEmptyBlank(atta.getOssUrl())) { + continue;// 有文件 + } + + if (Validates.isNotEmptyBlank(atta.getSavePath())) { + File file = new File(atta.getSavePath()); + if (file.exists() && file.isFile()) { + continue;// 有文件 + } + } + + iterator.remove(); + } + + if (attaList.size() == 0) { + request.returnHistory("文件不存在"); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, attaList.get(0).getDesignId()); + if (attaList.size() == 1) { + DesignAtta atta = attaList.get(0); + String fileName = atta.getFileName(); + String savePath = atta.getSavePath(); + String ossUrl = atta.getOssUrl(); + + // 1.检查是否有下载的临时文件 + String tempFilePath = UploadFilePresenter + .getCurrentTempFolder(Strings.addEndsWith(atta.getAttaModul(), "/")) + atta.getAttaId() + + Strings.addStartsWith(atta.getFileType(), "."); + File tempFile = new File(tempFilePath); + if (tempFile.exists() && tempFile.isFile()) { + // 响应文件 + responseFile(tempFilePath, request, fileName); + return; + } + + // 2.只有网络路径情况 (外部系统提供的信息) + if (Validates.isEmptyBlank(savePath) && Validates.isNotEmptyBlank(ossUrl)) {// 只有网络路径情况 (外部系统提供的信息) + // 检查 临时文件 + // 没有临时文件 文件时 直接重定向 下载地址 + request.setRedirect(ossUrl); + return; + } + + // 3.本地有文件 + File file = new File(savePath); + if (file.exists() && file.isFile()) { + // 响应文件 + responseFile(savePath, request, fileName); + return; + } + + if (Validates.isNotEmptyBlank(atta.getOssUrl())) { + request.setRedirect(ossUrl); + return; + } + + request.returnHistory("文件不存在"); + return; + } else { + String zipName = order.getDesignId() + "-" + + (Validates.isEmptyBlank(order.getBuyerNick()) ? order.getUserContact() : order.getBuyerNick()) + + ".zip"; + String tempZipDir = UploadFilePresenter.getCurrentTempFolder(Strings.addEndsWith("zip", "/")); + String tempZipFilePath = tempZipDir + Ids.longId() + ".zip"; + File dir = new File(tempZipDir); + if (!dir.exists()) { + Files.mkDirectory(dir); + } + + ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(tempZipFilePath), + Charset.forName("utf-8")); + Map fileNameContMap = new LinkedHashMap(); + for (DesignAtta atta : attaList) { + if (Validates.isNotEmptyBlank(atta.getOssUrl())) {// 有网络地址 + String tempFileDir = UploadFilePresenter + .getCurrentTempFolder(Strings.addEndsWith(atta.getAttaModul(), "/")); + File tempFile = new File( + tempFileDir + atta.getAttaId() + Strings.addStartsWith(atta.getFileType(), ".")); + if (!tempFile.exists() && !tempFile.isFile()) { + HttpDownload download = new HttpDownload(atta.getOssUrl()); + download.setConnectTimeout(30); + download.setReadTimeout(50 * 60); + download.setFileDir(tempFileDir); + download.setFileName(tempFile.getName()); + download.execute(); + } + + Integer fileNameCount = fileNameContMap.get(atta.getFileName()); + fileNameCount = fileNameCount == null ? 0 : fileNameCount; + fileNameCount += 1; + fileNameContMap.put(atta.getFileName(), fileNameCount); + String attaName = atta.getFileName(); + String zipEntryName = attaName; + if (attaName.lastIndexOf(".") != -1) { + zipEntryName = attaName.substring(0, attaName.lastIndexOf(".")); + } + + zipOut.putNextEntry(new ZipEntry(Strings.addEndsWith( + zipEntryName + (fileNameCount > 1 ? "(" + (fileNameCount - 1) + ")" : ""), + Strings.addStartsWith(atta.getFileType(), ".")))); + try (FileInputStream input = new FileInputStream(tempFile)) { + int len = 0; + byte[] buf = new byte[1024 * 20]; + while ((len = input.read(buf)) != -1) { + zipOut.write(buf, 0, len); + zipOut.flush(); + } + } + zipOut.closeEntry(); + } else {// 没有网络地址 + if (Validates.isEmptyBlank(atta.getSavePath())) { + continue; + } + + File file = new File(atta.getSavePath()); + Integer fileNameCount = fileNameContMap.get(atta.getFileName()); + fileNameCount = fileNameCount == null ? 0 : fileNameCount; + fileNameCount += 1; + fileNameContMap.put(atta.getFileName(), fileNameCount); + String attaName = atta.getFileName(); + String zipEntryName = attaName; + if (attaName.lastIndexOf(".") != -1) { + zipEntryName = attaName.substring(0, attaName.lastIndexOf(".")); + } + + zipOut.putNextEntry(new ZipEntry(Strings.addEndsWith( + zipEntryName + (fileNameCount > 1 ? "(" + (fileNameCount - 1) + ")" : ""), + Strings.addStartsWith(atta.getFileType(), ".")))); + try (FileInputStream input = new FileInputStream(file)) { + int len = 0; + byte[] buf = new byte[1024 * 20]; + while ((len = input.read(buf)) != -1) { + zipOut.write(buf, 0, len); + zipOut.flush(); + } + } + zipOut.closeEntry(); + } + } + + zipOut.finish(); + zipOut.close(); + + // 最后打包写出 + responseFile(tempZipFilePath, request, zipName); + } + } + + /** + * 响应文件 + * + * @param filePath 文件路径 + * @param response + * @throws IOException + * @throws Exception + */ + public static void responseFile(String filePath, HttpRequest request, String fileName) throws IOException { + HttpResponse response = request.getResponse(); + if (Validates.isEmptyBlank(fileName)) { + fileName = Files.getFileName(filePath); + } + + try (FileInputStream input = new FileInputStream(filePath)) { + String downName = fileName; +// Matcher resizeMatcher = Pattern.compile("[\u4e00-\u9fa5]+").matcher(fileName); +// while (resizeMatcher.find()) +// { +// String zhCode = resizeMatcher.group(); +// String encode = Urls.encodeUTF8(zhCode); +// downName = resizeMatcher.replaceAll(encode); +// } + downName = Urls.encodeUTF8(downName); + if (request.isChrome()) {// chrome不支持括号也是醉了 + downName = downName.replaceAll("%28", "("); + downName = downName.replaceAll("%29", ")"); + } + + if (request.isFirefox()) { + response.setHeader(_CONTENT_DISPOSITION_, "attachment; filename*=UTF-8''" + fileName); + } else { + response.setHeader(_CONTENT_DISPOSITION_, "attachment; filename=" + downName); + } + + response.setContentType(_APPLICATION_OCTET_STREAM_); + response.setHeader(_CONTENT_LENGTH_, new File(filePath).length()); + Streams.putBytes(input, response.getOutputStream()); + } finally { + if (filePath.contains("temp")) { + File file = new File(filePath); + if (file.exists() && file.isFile()) { + file.delete(); + } + } + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DownloadQuestionsFileAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DownloadQuestionsFileAction.java new file mode 100644 index 0000000..609dfe7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/DownloadQuestionsFileAction.java @@ -0,0 +1,198 @@ +package com.zhiqim.yangcai.design.action; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.URLEncoder; +import java.nio.charset.Charset; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import javax.print.DocFlavor.URL; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.QuestionsAtta; +import com.zhiqim.yangcai.design.presenter.UploadFilePresenter; + +/** + * 文件流下载 + */ +public class DownloadQuestionsFileAction implements Action { + @Override + public void execute(HttpRequest request) throws Exception { + downLoad(request); + + } + + public void downLoad(HttpRequest request) throws Exception { + long[] attaIds = Arrays.toLongArray(request.getParameter("attaId")); + String downFileType = request.getParameter("downFileType"); + if (attaIds.length == 0) { + request.returnHistory("文件不存在"); + return; + } + + List attaList = ORM.get(ZTable.class).list(QuestionsAtta.class, + new Selector().addMustInLong("attaId", attaIds)); + + // 至少要有一个文件 + Iterator iterator = attaList.iterator(); + while (iterator.hasNext()) { + QuestionsAtta atta = iterator.next(); + + if (Validates.isNotEmptyBlank(atta.getSavePath())) { + File file = new File(atta.getSavePath()); + if (file.exists() && file.isFile()) { + continue;// 有文件 + } + } + + iterator.remove(); + } + + if (attaList.size() == 0) { + request.returnHistory("文件不存在"); + return; + } + + if (attaList.size() == 1) { + QuestionsAtta atta = attaList.get(0); + String fileName = atta.getFileName(); + String savePath = atta.getSavePath(); + + // 本地有文件 + File file = new File(savePath); + if (file.exists() && file.isFile()) { + // 响应文件 + responseFile(savePath, request, fileName); + return; + } + + request.returnHistory("文件不存在"); + return; + } else { + String zipName = null; + if (downFileType.equals("DesginFile")) { + zipName = attaList.get(0).getQuestionsId() + "-设计文件.zip"; + } else if (downFileType.equals("EndFile")) { + zipName = attaList.get(0).getQuestionsId() + "-印刷文件.zip"; + } else { + zipName = attaList.get(0).getQuestionsId() + "-素材文件.zip"; + } + String tempZipDir = UploadFilePresenter.getCurrentTempFolder(Strings.addEndsWith("zip", "/")); + String tempZipFilePath = tempZipDir + Ids.longId() + ".zip"; + File dir = new File(tempZipDir); + if (!dir.exists()) { + Files.mkDirectory(dir); + } + + ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(tempZipFilePath), + Charset.forName("utf-8")); + Map fileNameContMap = new LinkedHashMap(); + for (QuestionsAtta atta : attaList) { + if (Validates.isEmptyBlank(atta.getSavePath())) { + continue; + } + + File file = new File(atta.getSavePath()); + Integer fileNameCount = fileNameContMap.get(atta.getFileName()); + fileNameCount = fileNameCount == null ? 0 : fileNameCount; + fileNameCount += 1; + fileNameContMap.put(atta.getFileName(), fileNameCount); + String attaName = atta.getFileName(); + String zipEntryName = attaName; + if (attaName.lastIndexOf(".") != -1) { + zipEntryName = attaName.substring(0, attaName.lastIndexOf(".")); + } + + zipOut.putNextEntry(new ZipEntry( + Strings.addEndsWith(zipEntryName + (fileNameCount > 1 ? "(" + (fileNameCount - 1) + ")" : ""), + Strings.addStartsWith(atta.getFileType(), ".")))); + try (FileInputStream input = new FileInputStream(file)) { + int len = 0; + byte[] buf = new byte[1024 * 20]; + while ((len = input.read(buf)) != -1) { + zipOut.write(buf, 0, len); + zipOut.flush(); + } + } + zipOut.closeEntry(); + } + + zipOut.finish(); + zipOut.close(); + + // 最后打包写出 + responseFile(tempZipFilePath, request, zipName); + } + } + + /** + * 响应文件 + * + * @param filePath 文件路径 + * @param response + * @throws IOException + * @throws Exception + */ + public static void responseFile(String filePath, HttpRequest request, String fileName) throws IOException { + HttpResponse response = request.getResponse(); + if (Validates.isEmptyBlank(fileName)) { + fileName = Files.getFileName(filePath); + } + + try (FileInputStream input = new FileInputStream(filePath)) { + String downName = fileName; +// Matcher resizeMatcher = Pattern.compile("[\u4e00-\u9fa5]+").matcher(fileName); +// while (resizeMatcher.find()) +// { +// String zhCode = resizeMatcher.group(); +// String encode = Urls.encodeUTF8(zhCode); +// downName = resizeMatcher.replaceAll(encode); +// } + downName = Urls.encodeUTF8(downName); + if (request.isChrome()) {// chrome不支持括号也是醉了 + downName = downName.replaceAll("%28", "("); + downName = downName.replaceAll("%29", ")"); + } + + if (request.isFirefox()) { + response.setHeader(_CONTENT_DISPOSITION_, "attachment; filename*=UTF-8''" + fileName); + } else { + response.setHeader(_CONTENT_DISPOSITION_, "attachment; filename=" + downName); + } + + response.setContentType(_APPLICATION_OCTET_STREAM_); + response.setHeader(_CONTENT_LENGTH_, new File(filePath).length()); + Streams.putBytes(input, response.getOutputStream()); + } finally { + if (filePath.contains("temp")) { + File file = new File(filePath); + if (file.exists() && file.isFile()) { + file.delete(); + } + } + } + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/OrgSelectorAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/OrgSelectorAction.java new file mode 100644 index 0000000..c3870a9 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/OrgSelectorAction.java @@ -0,0 +1,27 @@ +package com.zhiqim.yangcai.design.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.dbo.Selector; + +/** + * + * [简要描述] 组织选择器:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年9月21日 新建与整理 + */ +public class OrgSelectorAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + String orgName = request.getParameter("orgName"); + List list = ZmrBootstrap.tableOpr(request).list(ZmrOrg.class, new Selector().addMaybeLike("orgName", orgName).addMust("orgStatus", 0)); + request.setAttribute("list", list); + } +} \ No newline at end of file diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/PNGAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/PNGAction.java new file mode 100644 index 0000000..95bb7cf --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/PNGAction.java @@ -0,0 +1,73 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action; + +import java.io.File; +import java.io.FileInputStream; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; + +/** + * TODO:初稿缩略图读取PNG图片 + * + * @version v1.0.0 @author Deng 2017-6-9 新建与整理 + */ +public class PNGAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + HttpResponse response = request.getResponse(); + List paramList = request.getParameterMatch(); + + long designId = Longs.toLong(paramList.get(0)); + Selector selector = new Selector(); + selector.addMust("designId", designId); + selector.addMust("attaModul", FileTypeConstants.FILE_FIRSTTHUMFILE.value()); + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, selector); + if (atta == null) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + if (Validates.isNotEmptyBlank(atta.getOssUrl())) + request.setRedirect(atta.getOssUrl());//从oss下载数据做显示 + else + {//从本地响应做显示 + response.setContentType("image/png"); + File file = new File(atta.getSavePath()); + if (!file.exists()) + { + response.sendError(_404_NOT_FOUND_); + return; + } + try (FileInputStream input = new FileInputStream(file)) + { + Streams.putBytes(input, response.getOutputStream()); + } + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/PdfQueueAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/PdfQueueAction.java new file mode 100644 index 0000000..661ab97 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/PdfQueueAction.java @@ -0,0 +1,73 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action; + +import java.lang.reflect.Field; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.control.HandlerController; +import org.zhiqim.kernel.control.Queue; +import org.zhiqim.kernel.control.Threader; + +import com.zhiqim.media.service.handler.MediaCanvasController; + +/** + * pdf定稿队列 不能修改数据 否则会造成定稿错误 + * + * @version v1.0.0 @author yixin 2020-08-29 新建与整理 + */ +public class PdfQueueAction implements Action +{ + + @SuppressWarnings( + { + "unchecked", "rawtypes" + }) + @Override + public void execute(HttpRequest request) throws Exception + { + MediaCanvasController controller = Global.getService(MediaCanvasController.class); + Field topdfcontrollerField = controller.getClass().getDeclaredField("topdfcontroller"); + topdfcontrollerField.setAccessible(true); + HandlerController topdfcontroller = (HandlerController) topdfcontrollerField.get(controller); + List theaderList = topdfcontroller.getThreaderList(); + int sleepNum = 0; + int runNum = 0; + for (Threader threader : theaderList) + { + if (threader.isActive()) + { + runNum++; + } + else + { + sleepNum++; + } + } + Queue queue = topdfcontroller.getQueue(); + Field runnableListField = queue.getClass().getDeclaredField("list"); + runnableListField.setAccessible(true); + List runnableList = (List) runnableListField.get(queue); + Field pdfSuccMapField = controller.getClass().getDeclaredField("pdfSuccMap"); + pdfSuccMapField.setAccessible(true); + Map pdfSuccMap = (Map) pdfSuccMapField.get(controller); + request.setAttribute("theaderList", theaderList); + request.setAttribute("waitQueue", runnableList); + request.setAttribute("finishList", pdfSuccMap.values()); + request.setAttribute("sleepNum", sleepNum); + request.setAttribute("runNum", runNum); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/QuickContextAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/QuickContextAction.java new file mode 100644 index 0000000..d80ce1e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/QuickContextAction.java @@ -0,0 +1,129 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.constants.HttpConstants; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/**** + * 快捷联系 + * + * @version v1.0.0 @author lgz 2019-4-13 新建与整理 + */ +public class QuickContextAction implements Action, HttpConstants +{ + private static final Log log = LogFactory.getLog(QuickContextAction.class); + + @Override + public void execute(HttpRequest request) + { + HttpResponse response = request.getResponse(); + response.setCharacterEncoding(_UTF_8_); + try + { + request.addValidate(new IsNotEmpty("orderId", "请选择订单")); + if (!request.chkValidate()) + { + response.print(""); + return; + } + + long designId = request.getParameterLong("orderId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (order == null) + { + response.print(""); + return; + } + + // 获取客服信息 + HashMapSO attrMap = new HashMapSO(); + attrMap.put("order", order); + + ZmrOperator deptManager = null; + ZmrOperator supperDeptManager = null; + if (Validates.isNotEmptyBlank(order.getDesigner())) + {// 已经分派给设计师了 + // 设计师 + ZmrOperator designer = ZmrOperatorDao.getOperator(request, order.getDesigner()); + attrMap.put("operator", designer); + if (designer != null) + { + long deptId = 0; + if (Lists.toLongList(designer.getOperatorDept()).size() > 0) + { + deptId = Lists.toLongList(designer.getOperatorDept()).get(0); + } + + if (deptId > 0 && designer.getOrgId() > 0) + { + Selector sel = new Selector("orgId", designer.getOrgId()).addMust("deptId", deptId).addOrderbyAsc("deptLevel,deptSeq,deptId"); + ZmrDept dept = ZmrBootstrap.table(request).item(ZmrDept.class, sel); + if (dept != null) + { + // 设计主管 及部门负责人 + if (Validates.isNotEmptyBlank(dept.getDeptManager())) + { + deptManager = ZmrOperatorDao.getOperator(request, dept.getDeptManager()); + } + + if (dept.getParentId() == 0) + { + supperDeptManager = deptManager; + } + else + {// 紧急联系人 紧急联系人为上上级部门负责人。 + Selector sel2 = new Selector("orgId", dept.getOrgId()); + sel2.addMust("deptId", dept.getParentId()); + sel2.addOrderbyAsc("deptLevel,deptSeq,deptId"); + ZmrDept supperDept = ZmrBootstrap.table(request).item(ZmrDept.class, sel2); + if (supperDept != null && Validates.isNotEmptyBlank(supperDept.getDeptManager())) + { + supperDeptManager = ZmrOperatorDao.getOperator(request, supperDept.getDeptManager()); + } + } + } + } + } + } + + attrMap.put("deptManager", deptManager); + attrMap.put("supperDeptManager", supperDeptManager); + String resultHtml = ZmlContexts.parseZmlPath(request, "/zview/order/presenter/quickContact.zml", attrMap); + + // 响应结果 + response.print(resultHtml); + } + catch (Exception e) + { + log.error("快捷联系 异常:", e); + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/QuickContextInfoAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/QuickContextInfoAction.java new file mode 100644 index 0000000..562a7e5 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/QuickContextInfoAction.java @@ -0,0 +1,131 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.constants.HttpConstants; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/**** + * 快捷联系(返回json字符串) + * + * @version v1.0.0 @author 蒋斌 2019-10-10 新建与整理 + */ +public class QuickContextInfoAction implements Action, HttpConstants +{ + private static final Log log = LogFactory.getLog(QuickContextInfoAction.class); + + @Override + public void execute(HttpRequest request) + { + + HttpResponse response = request.getResponse(); + response.setCharacterEncoding(_UTF_8_); + try + { + request.addValidate(new IsNotEmpty("orderId", "请选择订单")); + if (!request.chkValidate()) + { + response.print(""); + return; + } + + long designId = request.getParameterLong("orderId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (order == null) + { + response.print(""); + return; + } + + // 获取客服信息 + HashMapSO attrMap = new HashMapSO(); + attrMap.put("order", order); + + ZmrOperator deptManager = null; + ZmrOperator supperDeptManager = null; + if (Validates.isNotEmptyBlank(order.getDesigner())) + {// 已经分派给设计师了 + // 设计师 + ZmrOperator designer = ZmrOperatorDao.getOperator(request, order.getDesigner()); + attrMap.put("operator", designer); + if (designer != null) + { + long deptId = 0; + if (Lists.toLongList(designer.getOperatorDept()).size() > 0) + { + deptId = Lists.toLongList(designer.getOperatorDept()).get(0); + } + + if (deptId > 0 && designer.getOrgId() > 0) + { + Selector sel = new Selector("orgId", designer.getOrgId()).addMust("deptId", deptId).addOrderbyAsc("deptLevel,deptSeq,deptId"); + ZmrDept dept = ZmrBootstrap.table(request).item(ZmrDept.class, sel); + if (dept != null) + { + // 设计主管 及部门负责人 + if (Validates.isNotEmptyBlank(dept.getDeptManager())) + { + deptManager = ZmrOperatorDao.getOperator(request, dept.getDeptManager()); + } + + if (dept.getParentId() == 0) + { + supperDeptManager = deptManager; + } + else + {// 紧急联系人 紧急联系人为上上级部门负责人。 + Selector sel2 = new Selector("orgId", dept.getOrgId()); + sel2.addMust("deptId", dept.getParentId()); + sel2.addOrderbyAsc("deptLevel,deptSeq,deptId"); + ZmrDept supperDept = ZmrBootstrap.table(request).item(ZmrDept.class, sel2); + if (supperDept != null && Validates.isNotEmptyBlank(supperDept.getDeptManager())) + { + supperDeptManager = ZmrOperatorDao.getOperator(request, supperDept.getDeptManager()); + } + } + } + } + } + } + + attrMap.put("deptManager", deptManager); + attrMap.put("supperDeptManager", supperDeptManager); + String result = Jsons.toString(attrMap); + + // 响应结果 + response.print(result); + + } + catch (Exception e) + { + log.error("快捷联系 异常:", e); + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/TagAttaInfoListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/TagAttaInfoListAction.java new file mode 100644 index 0000000..6032df4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/TagAttaInfoListAction.java @@ -0,0 +1,43 @@ +/** + * 扬彩印刷设计 + * 文件名 :TagAttaInfoListAction.java + * 创建人 :gjx + * 创建时间:2019-12-19 + */ + +package com.zhiqim.yangcai.design.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; + +/** + * [简要描述]订单标签列表,右边iframe使用:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-12-19 新建与整理 + */ +public class TagAttaInfoListAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + DesignSelfView order = new DesignSelfView(); + MediaTemplateView mediaTemplate = new MediaTemplateView(); + if (designId > 0) + { + order = ORM.get(ZView.class).item(DesignSelfView.class, new Selector("designId", designId)); + mediaTemplate = ORM.get(ZView.class).item(MediaTemplateView.class, new Selector("designId", designId)); + } + request.setAttribute("order", order); + request.setAttribute("mediaTemplate", mediaTemplate); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/ThumImgAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/ThumImgAction.java new file mode 100644 index 0000000..e00d73c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/ThumImgAction.java @@ -0,0 +1,245 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.net.FileNameMap; +import java.net.URLConnection; +import java.util.List; + +import javax.imageio.ImageIO; + +import org.icepdf.core.pobjects.Document; +import org.icepdf.core.pobjects.Page; +import org.icepdf.core.util.GraphicsRenderingHints; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.presenter.UploadFilePresenter; + +/** + * TODO:读取PDF文件 + * + * @version v1.0.0 @author longguizhi 2017-5-23 新建与整理 + */ +public class ThumImgAction implements Action +{ + private static Log log = LogFactory.getLog(ThumImgAction.class); + + @Override + public void execute(HttpRequest request) throws Exception + { + HttpResponse response = request.getResponse(); + + String name = Strings.trim(request.getPathInContext(), "/", ""); + String[] nameinfo = name.split("-"); + if (nameinfo.length < 2) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + if (!Validates.isIntegerPositive(nameinfo[0])) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + long attaId = Longs.toLong(nameinfo[0]); + int page = Ints.toInt(nameinfo[1]); + + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, attaId); + String suffix = atta.getFileType(); + if (Validates.isEmptyBlank(suffix)) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + suffix = suffix.toLowerCase(); + if ("cdr".equals(suffix)) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + if (Validates.isUrl(atta.getOssUrl())) + {// 设置重定向到OSS + request.setRedirect(atta.getOssUrl()); + return; + } + + sendThumbnail(atta, response, page); + } + + /*** + * 读取缩略图 + * + * @param atta + * @param response + * @param page + * @throws Exception + */ + private void sendThumbnail(DesignAtta atta, HttpResponse response, int page) throws Exception + { + if (atta == null) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + if ("pdf".equalsIgnoreCase(atta.getFileType())) + {// pdf文件 + List thumFileNameList = UploadFilePresenter.getThumFileNames(atta); + if (thumFileNameList.size() == 0) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + String thumFilePath = Strings + .addEndsWith(UploadFilePresenter.getCurrentTempFolder(Strings.addEndsWith(FileTypeConstants.FILE_THUMFILE.value(), "/")), "/") + + atta.getAttaId() + "-" + FileTypeConstants.FILE_THUMFILE.value() + "-" + page + ".png"; + File thumFile = new File(thumFilePath); + if (!thumFile.exists()) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + response.setContentType("image/png"); + + try (FileInputStream input = new FileInputStream(thumFile)) + { + OutputStream os = response.getOutputStream(); + Streams.putBytes(input, os); + os.flush(); + os.close(); + input.close(); + } + } + else + {// 其他图片类型 + FileNameMap mime = URLConnection.getFileNameMap(); + String mimeType = mime.getContentTypeFor(atta.getSavePath()); + if (Validates.isEmptyBlank(mimeType) || !Strings.toLowerCase(mimeType).startsWith("image")) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + response.setContentType("image/png"); + + File file = new File(atta.getSavePath()); + if (!file.exists()) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + try (FileInputStream input = new FileInputStream(file)) + { + Streams.putBytes(input, response.getOutputStream()); + } + } + } + + @SuppressWarnings("unused") + private void sendPDFtoImg(DesignAtta atta, HttpResponse response, int page) throws Exception + { + + if (atta == null) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + response.setContentType("image/png"); + Document document = new Document(); + + try + { + File file = new File(atta.getSavePath()); + if (!file.exists()) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + document.setFile(atta.getSavePath()); + int pdfpage = document.getNumberOfPages(); + + page = page > pdfpage ? pdfpage : (page < 0 ? 0 : page); + float scale = 2f; + float rotation = 0f; + + BufferedImage image = document.getPageImage(page, GraphicsRenderingHints.SCREEN, Page.BOUNDARY_CROPBOX, rotation, scale); + try + { + ByteArrayOutputStream output = new ByteArrayOutputStream(); + ImageIO.write(image, "png", output); + Streams.putBytes(new ByteArrayInputStream(output.toByteArray()), response.getOutputStream()); + } + catch (IOException e) + { + log.error("显示缩略图异常:", e); + } + } + catch (Exception e) + { + log.error("显示缩略图异常:", e); + } + finally + { + document.dispose(); + } + } + + @SuppressWarnings("unused") + private void sendImg(DesignAtta atta, HttpResponse response) throws Exception + { + if (atta == null) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + response.setContentType("image/png"); + String filePath = atta.getSavePath(); + File file = new File(filePath); + if (file.exists()) + { + try (FileInputStream input = new FileInputStream(file)) + { + Streams.putBytes(input, response.getOutputStream()); + } + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/account/ExportWageSchedule.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/account/ExportWageSchedule.java new file mode 100644 index 0000000..befa476 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/account/ExportWageSchedule.java @@ -0,0 +1,64 @@ +package com.zhiqim.yangcai.design.action.account; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.account.VirtualAccount; +import com.zhiqim.yangcai.util.ExportUtils; +import com.zhiqim.yangcai.util.Report; + +public class ExportWageSchedule implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + + Selector selector = new Selector(); + selector.addMust("operatorStatus", 1); + selector.addMustThenG("usableMoney", 0); + selector.addOrderbyDesc("usableMoney"); + List listResult = ORM.get(ZTable.class).list(VirtualAccount.class, selector); + + String title = "设计师薪资表"; + Report report = new Report(); + report.setTitle(title); + report.setFileName(title + (DateTimes.getDateTimeString()) + ".xls"); + report.setHearder(new String[] + { + "设计师", "可用余额(单元:元)", + }); + report.setWidths(new int[] + { + 30, 30 + }); + report.setFormats(new int[] + { + 0, 0 + }); + report.setHeight(700); + report.setExcelPageType(1); + report.setPageSize(1); + + for (VirtualAccount virtualAccount : listResult) + { + + String[] drow = new String[] + { + virtualAccount.getOperatorCode(), Amounts.toYuanMustRadix(virtualAccount.getUsableMoney()) + }; + + report.addData(drow); + } + + report.setFooter("共" + listResult.size() + "条数据 导出时间:" + DateTimes.getDateString()); + ExportUtils.exportExcel(request, report); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/account/VirtualAccountAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/account/VirtualAccountAction.java new file mode 100644 index 0000000..d9eca8e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/account/VirtualAccountAction.java @@ -0,0 +1,620 @@ +package com.zhiqim.yangcai.design.action.account; + +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.ProductConvertCache; +import com.zhiqim.yangcai.design.constant.VirtualAccountConstants; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.account.VirtualAccount; +import com.zhiqim.yangcai.design.dbo.account.VirtualAccountDetails; +import com.zhiqim.yangcai.design.dbo.account.VirtualTransactionDetails; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * + * [简要描述]:虚拟账户 资金账户列表
            + * [详细描述]:
            + * + * @version 1.0 @author hc 2021年6月21日 新建与整理 + */ +@AnAlias("VirtualAccountAction") +public class VirtualAccountAction implements Action +{ + + private static final Log log = LogFactory.getLog(VirtualAccountAction.class); + + @Override + public void execute(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 8); + + Selector selector = new Selector(); + selector.addMaybeLike("operatorCode", request.getParameter("operatorCode")); + + PageResult pageResult = ORM.get(ZTable.class).page(VirtualAccount.class, pageNo, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + } + + /** + * + * [简要描述]:发工资
            + * [详细描述]:
            + * + * @author hc + * @param request + * @param operatorCode + * @param modifyMoney + * @throws Exception + */ + public static void sendSalary(HttpRequest request) throws Exception + { + String desinger = request.getParameter("operatorCode");// 设计师 + String operatorCode = request.getSessionName();// 操作人员 + String modifyMoneyString = request.getParameter("modifyMoney"); + if (modifyMoneyString.isEmpty()) + { + request.setResponseError("发放金额不能为空!"); + return; + } + long modifyMoneys = new Double(Double.parseDouble(modifyMoneyString) * 100).longValue(); + String remark = request.getParameter("remark"); + + VirtualAccount virtualAccount = ORM.get(ZTable.class).item(VirtualAccount.class, new Selector().addMust("operatorCode", desinger)); + + if (modifyMoneys <= 0) + { + request.setResponseError("发放金额必须大于0!"); + return; + } + + if (modifyMoneys > virtualAccount.getUsableMoney()) + { + request.setResponseError("发放金额不可大于可用金额!"); + return; + } + + int sendSalary = Integer.parseInt((VirtualAccountConstants.SENDSALARY.value())); + + Transaction tx = null; + try + { + tx = TransactionManager.beginTransaction(); + operatorSalary(desinger, operatorCode, virtualAccount, modifyMoneys, sendSalary, remark, null, null); + tx.commit(); + } + catch (Exception e) + { + if (tx != null) + { + tx.rollback(); + } + request.returnCloseDialog("发放失败,请重试"); + log.error("设计师:【" + desinger + "】发放工资失败,金额为:【" + modifyMoneys + "】", e); + } + finally + { + if (tx != null) + { + tx.close(); + } + } + + } + + /** + * + * [简要描述]:冻结资金
            + * [详细描述]:
            + * + * @author hc + * @param request + * @param operatorCode + * @param modifyMoney + * @throws Exception + */ + public static void freezeSalary(HttpRequest request) throws Exception + { + String desinger = request.getParameter("operatorCode"); + String operatorCode = request.getSessionName(); + long modifyMoney = request.getParameterLong("modifyMoney"); + String remark = request.getParameter("remark"); + if (-1 == modifyMoney) + { + request.setResponseError("冻结金额不能为空!"); + return; + } + VirtualAccount virtualAccount = ORM.get(ZTable.class).item(VirtualAccount.class, new Selector().addMust("operatorCode", desinger)); + long modifyMoneys = modifyMoney * 100; + + if (modifyMoneys <= 0) + { + request.setResponseError("冻结金额必须大于0!"); + return; + } + + if (modifyMoneys > virtualAccount.getUsableMoney()) + { + request.setResponseError("冻结金额不可大于可用金额!"); + return; + } + + int sendSalary = Integer.parseInt((VirtualAccountConstants.FREEZESALARY.value())); + + Transaction tx = null; + try + { + tx = TransactionManager.beginTransaction(); + operatorSalary(desinger, operatorCode, virtualAccount, modifyMoneys, sendSalary, remark, null, null); + tx.commit(); + } + catch (Exception e) + { + if (tx != null) + { + tx.rollback(); + } + request.returnCloseDialog("冻结失败,请重试"); + log.error("设计师:【" + desinger + "】冻结工资失败,金额为:【" + modifyMoneys + "】", e); + } + finally + { + if (tx != null) + { + tx.close(); + } + } + + } + + // 发放工资,冻结资金,异常稽核共用同步信息 + public static void operatorSalary(String desinger, String operatorCode, VirtualAccount virtualAccount, long modifyMoneys, int sendSalary, String remark, + String type, String designOrderId) throws Exception + { + Updater updater = new Updater(); + // 设计师 + VirtualAccountDetails designerAccountDetails = new VirtualAccountDetails(); + VirtualTransactionDetails designerTransactionDetails = new VirtualTransactionDetails(); + // 操作人员 + VirtualAccountDetails operatorAccountDetails = new VirtualAccountDetails(); + VirtualTransactionDetails operatorTransactionDetails = new VirtualTransactionDetails(); + + DesignOrder designOrder = null; + + // 发放工资记录 + if (sendSalary == 102) + { + // 设计师记录 + updater.addField("sumMoney", virtualAccount.getSumMoney() - modifyMoneys); + updater.addMust("operatorCode", desinger); + updater.addField("usableMoney", virtualAccount.getUsableMoney() - modifyMoneys); + + designerAccountDetails.setTransactionStatus(sendSalary); + designerAccountDetails.setUsableMoney(virtualAccount.getUsableMoney() - modifyMoneys); + designerAccountDetails.setFreezeMoney(virtualAccount.getFreezeMoney()); + designerAccountDetails.setSumMoney(virtualAccount.getSumMoney() - modifyMoneys); + remark = Validates.isEmpty(remark) ? "未说明" : remark; + designerAccountDetails.setOperatorRemark(operatorCode + "-发放" + ":
            " + remark); + designerAccountDetails.setUsableMoneyDown(-modifyMoneys); + + designerTransactionDetails.setTransactionStatus(sendSalary); + + // 操作人员记录 + operatorAccountDetails.setTransactionStatus(sendSalary); + operatorAccountDetails.setOperatorRemark("发给-" + desinger + ":
            " + remark); + + operatorTransactionDetails.setTransactionStatus(sendSalary); + } + // 冻结资金记录 + else if (sendSalary == 103) + { + // 设计师记录 + updater.addField("freezeMoney", virtualAccount.getFreezeMoney() + modifyMoneys); + updater.addMust("operatorCode", desinger); + updater.addField("usableMoney", virtualAccount.getUsableMoney() - modifyMoneys); + + designerAccountDetails.setTransactionStatus(sendSalary); + designerAccountDetails.setFreezeMoneyAdd(modifyMoneys); + designerAccountDetails.setOperatorRemark(operatorCode + "冻结" + "-
            " + remark); + + designerTransactionDetails.setTransactionStatus(sendSalary); + + // 操作人员记录 + operatorAccountDetails.setTransactionStatus(sendSalary); + operatorAccountDetails.setOperatorRemark("冻结:" + desinger + "-
            " + remark); + + operatorTransactionDetails.setTransactionStatus(sendSalary); + } + // 订单异常稽核操作 + else if (sendSalary == 104) + { + // 设计师记录 + boolean flag = true; + if (modifyMoneys < 0) + { + flag = false; + } + + if (Validates.isNotEmpty(designOrderId)) + { + designOrder = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", Long.parseLong(designOrderId))); + } + + updater.addField("sumMoney", virtualAccount.getSumMoney() + modifyMoneys); + updater.addMust("operatorCode", desinger); + if (type.equals("freeze")) + { + updater.addField("freezeMoney", virtualAccount.getFreezeMoney() + modifyMoneys); + designerAccountDetails.setFreezeMoney(virtualAccount.getFreezeMoney() + modifyMoneys); + designerAccountDetails.setUsableMoney(virtualAccount.getUsableMoney()); + if (flag) + { + designerAccountDetails.setFreezeMoneyAdd(modifyMoneys); + } + else + { + designerAccountDetails.setFreezeMoneyDown(modifyMoneys); + } + } + else + { + updater.addField("usableMoney", virtualAccount.getUsableMoney() + modifyMoneys); + designerAccountDetails.setUsableMoney(virtualAccount.getUsableMoney() + modifyMoneys); + designerAccountDetails.setFreezeMoney(virtualAccount.getFreezeMoney()); + if (flag) + { + designerAccountDetails.setUsableMoneyAdd(modifyMoneys); + } + else + { + designerAccountDetails.setUsableMoneyDown(modifyMoneys); + } + } + + designerAccountDetails.setTransactionStatus(sendSalary); + designerAccountDetails.setSumMoney(virtualAccount.getSumMoney() + modifyMoneys); + remark = Validates.isEmpty(remark) ? "未说明" : remark; + designerAccountDetails.setOperatorRemark(operatorCode + "-异常稽核" + ":
            " + remark); + + designerTransactionDetails.setTransactionStatus(sendSalary); + + // 操作人员记录 + operatorAccountDetails.setTransactionStatus(sendSalary); + operatorAccountDetails.setOperatorRemark("异常稽核-" + desinger + ":
            " + remark); + + operatorTransactionDetails.setTransactionStatus(sendSalary); + } + + ORM.get(ZTable.class).update(VirtualAccount.class, updater); + + Timestamp nowTimestamp = Sqls.nowTimestamp(); + long designerTransactionBlotter = Ids.longId(); + long operatorTransactionBlotter = Ids.longId(); + Timestamp endTime = Sqls.nowTimestamp(); + // 同步虚拟账户 账户明细表 + // 设计师记录 + designerAccountDetails.setAccountBlotter(Ids.longId()); + designerAccountDetails.setOperatorCode(desinger); + designerAccountDetails.setTransactionBlotter(designerTransactionBlotter); + designerAccountDetails.setOperatorTime(nowTimestamp); + ORM.get(ZTable.class).insert(designerAccountDetails); + + // 操作人员记录 + operatorAccountDetails.setAccountBlotter(Ids.longId()); + operatorAccountDetails.setOperatorCode(operatorCode); + operatorAccountDetails.setTransactionBlotter(operatorTransactionBlotter); + operatorAccountDetails.setOperatorTime(nowTimestamp); + ORM.get(ZTable.class).insert(operatorAccountDetails); + + // 同步虚拟账户 交易明细表 + // 设计师记录 + designerTransactionDetails.setOperatorCode(desinger); + designerTransactionDetails.setTransactionBlotter(designerTransactionBlotter); + if (Validates.isNotEmpty(designOrder)) + { + designerTransactionDetails.setDesignId(Long.parseLong(designOrderId)); + } + if (Validates.isNotEmpty(designOrder)) + { + designerTransactionDetails.setOrderText(designOrder.getOrderText()); + } + designerTransactionDetails.setOrderMoney(modifyMoneys); + designerTransactionDetails.setEndTime(endTime); + designerTransactionDetails.setTransactionTime(nowTimestamp); + ORM.get(ZTable.class).insert(designerTransactionDetails); + + // 操作人员记录 + operatorTransactionDetails.setOperatorCode(operatorCode); + operatorTransactionDetails.setTransactionBlotter(operatorTransactionBlotter); + operatorTransactionDetails.setEndTime(endTime); + operatorTransactionDetails.setTransactionTime(nowTimestamp); + operatorTransactionDetails.setOrderMoney(modifyMoneys); + ORM.get(ZTable.class).insert(operatorTransactionDetails); + } + + // 修改设计师账户状态 + public static void updateStatus(HttpRequest request, int num, String operatorCode) throws Exception + { + Updater updater = new Updater(); + updater.addMust("operatorCode", operatorCode); + if (num == 1) + { + updater.addField("operatorStatus", 1); + } + else + { + updater.addField("operatorStatus", 0); + } + ORM.get(ZTable.class).update(VirtualAccount.class, updater); + } + + // 定稿订单重新记录,用于异常数据修复调用 + public static void finalizeCheck(HttpRequest request, String operatorCode) throws Exception + { + // 当月第一天 + Date startDate = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getFirstMonthDay()); + String startDateString = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(startDate); + + // 本月该设计师已完成订单 + List designOrderList = ORM.get(ZTable.class).list(DesignOrder.class, + new Selector().addMustThenGE("designEndTime", Sqls.toTimestamp(startDateString)).addMust("designer", operatorCode) + .addMustThenGE("status", StatusConstants.ORDER_55.value()).addOrderbyAsc("designEndTime") + .addMustNotEqual("draftType", DraftConstants.DRAFT_STANDARD.value())// 标准自来稿 + .addMustNotEqual("draftType", DraftConstants.DRAFT_ACTUALS.value()));// 现货 + + if (designOrderList.isEmpty()) + { + log.info("设计师" + operatorCode + "本月无定稿订单"); + return; + } + + // 刷新缓存 + Global.get(ProductConvertCache.class).doRefresh(); + + // 重置该设计师账户表 + Updater vaUpdater = new Updater(); + vaUpdater.addMust("operatorCode", operatorCode); + vaUpdater.addField("freezeMoney", 0); + vaUpdater.addField("sumMoney", 0); + ORM.get(ZTable.class).update(VirtualAccount.class, vaUpdater); + ORM.get(ZTable.class).delete(VirtualAccountDetails.class, new Selector().addMust("operatorCode", operatorCode).addMust("transactionStatus", 4) + .addMustThenGE("operatorTime", Sqls.toTimestamp(startDateString))); + ORM.get(ZTable.class).delete(VirtualTransactionDetails.class, new Selector().addMust("operatorCode", operatorCode).addMust("transactionStatus", 4) + .addMustThenGE("transactionTime", Sqls.toTimestamp(startDateString))); + + long usableMoney = 0L; + long freezeMoney = 0L; + long sumMoney = 0L; + for (DesignOrder designOrder : designOrderList) + { + // 获取该设计师虚拟账户表 + VirtualAccount vacc = ORM.get(ZTable.class).item(VirtualAccount.class, new Selector().addMust("operatorCode", operatorCode)); + long money = StatDao.calculateOrderPerformance(designOrder); + + usableMoney = vacc.getUsableMoney(); + freezeMoney = vacc.getFreezeMoney() + money; + sumMoney = usableMoney + freezeMoney; + + VirtualAccountDetails virtualAccountDetails = new VirtualAccountDetails(); + VirtualTransactionDetails virtualTransactionDetails = new VirtualTransactionDetails(); + + // 同步虚拟账户表 + Updater virtualAccountUpdater = new Updater(); + virtualAccountUpdater.addMust("operatorCode", operatorCode); + virtualAccountUpdater.addField("usableMoney", usableMoney); + virtualAccountUpdater.addField("freezeMoney", freezeMoney); + virtualAccountUpdater.addField("sumMoney", sumMoney); + ORM.get(ZTable.class).update(VirtualAccount.class, virtualAccountUpdater); + + long accountBlotter = Ids.longId(); + long transactionBlotter = Ids.longId(); + // 同步虚拟账户明细表 + virtualAccountDetails.setOperatorCode(operatorCode); + virtualAccountDetails.setAccountBlotter(accountBlotter); + virtualAccountDetails.setTransactionBlotter(transactionBlotter); + virtualAccountDetails.setTransactionStatus(4); + virtualAccountDetails.setUsableMoneyAdd(0); + virtualAccountDetails.setUsableMoneyDown(0); + virtualAccountDetails.setFreezeMoneyAdd(money); + virtualAccountDetails.setFreezeMoneyDown(0); + virtualAccountDetails.setOperatorTime(designOrder.getDesignEndTime()); + virtualAccountDetails.setUsableMoney(usableMoney); + virtualAccountDetails.setFreezeMoney(freezeMoney); + virtualAccountDetails.setSumMoney(sumMoney); + ORM.get(ZTable.class).insert(virtualAccountDetails); + + // 同步虚拟交易明细表 + virtualTransactionDetails.setOperatorCode(operatorCode); + virtualTransactionDetails.setDesignId(designOrder.getDesignId()); + virtualTransactionDetails.setTransactionBlotter(transactionBlotter); + virtualTransactionDetails.setOrderText(designOrder.getOrderText()); + virtualTransactionDetails.setEndTime(designOrder.getDesignEndTime()); + virtualTransactionDetails.setTransactionTime(designOrder.getDesignEndTime()); + virtualTransactionDetails.setTransactionStatus(4); + virtualTransactionDetails.setOrderMoney(money); + ORM.get(ZTable.class).insert(virtualTransactionDetails); + } + } + + // 解冻金额,用于异常数据修复调用 + public static void unfreezeMoney(HttpRequest request, String operatorCode) throws Exception + { + // 上月 + Date parseHead = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getPreviousMonthFirstDay()); + Date parseEnd = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getFirstMonthDay()); + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String formatHead = simpleDateFormat.format(parseHead); + String formatEnd = simpleDateFormat.format(parseEnd); + + // 判断设计师当月是否已经解冻可解冻余额 + Selector selector = new Selector(); + selector.addMust("operatorCode", operatorCode); + selector.addMust("transactionStatus", Long.parseLong(VirtualAccountConstants.UNFREEZE.value())); + selector.addMustThenGE("operatorTime", Sqls.toTimestamp(formatEnd)); + List virtualAccountDetailsList = ORM.get(ZTable.class).list(VirtualAccountDetails.class, selector); + if (virtualAccountDetailsList.size() != 0) + { + log.info("设计师:【" + operatorCode + "】当月已解冻了可解冻资金"); + return; + } + + VirtualAccount va = ORM.get(ZTable.class).item(VirtualAccount.class, new Selector().addMust("operatorCode", operatorCode)); + ORM.get(ZTable.class).delete(VirtualAccountDetails.class, new Selector().addMust("operatorCode", operatorCode).addMust("transactionStatus", 101)); + ORM.get(ZTable.class).delete(VirtualTransactionDetails.class, new Selector().addMust("operatorCode", operatorCode).addMust("transactionStatus", 101)); + + if (va.getFreezeMoney() <= 0) + { + log.info("设计师:【" + va.getOperatorCode() + "】解冻失败,可解冻金额小于0!"); + return; + } + + // 查出上月所有可解冻订单 + // 排除单个订单 (定稿+退回)流水条数 % 2 > 0 + // 排除单个订单 (定稿+售后)流水条数 % 2 > 0 + // 思路:倒序查询上月定稿+退回数为奇数的记录 + // 内部select为查询上月定稿+退回数记录, limit为固定排序 + // 外部select为分组(去重) + 计算记录条路为奇数 ,ORDER BY NULL为阻止GROUP BY的排序; + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("SELECT * FROM ( "); + stringBuffer.append("SELECT "); + stringBuffer.append( + "vtd.design_id as designId,vad.FREEZE_MONEY_ADD as freezeMoneyAdd,vad.freeze_money_down as freezeMoneyDown,vtd.ORDER_TEXT AS orderText,vtd.end_time AS endTime,vad.operator_time AS operatorTime "); + stringBuffer.append("FROM "); + stringBuffer.append("virtual_account_details AS vad "); + stringBuffer.append("LEFT JOIN virtual_transaction_details AS vtd ON vad.OPERATOR_CODE = vtd.OPERATOR_CODE "); + stringBuffer.append("and vad.transaction_blotter = vtd.transaction_blotter "); + stringBuffer.append("WHERE "); + stringBuffer.append("vad.OPERATOR_CODE = '" + va.getOperatorCode() + "' "); + stringBuffer.append("AND (vad.TRANSACTION_STATUS = 4 OR vad.TRANSACTION_STATUS = 6) "); + stringBuffer.append("AND vtd.END_TIME >= '" + formatHead + "'"); + stringBuffer.append("AND vtd.END_TIME <= '" + formatEnd + "'"); + stringBuffer.append("ORDER BY endTime DESC LIMIT 100000 "); + stringBuffer.append(")AS dataList "); + stringBuffer.append("GROUP BY dataList.designId "); + stringBuffer.append("HAVING COUNT(designId) %2 > 0 "); + stringBuffer.append("ORDER BY NULL"); + + List list = ORM.get(ZSQL.class).executeQuery(stringBuffer.toString()); + + if (list.isEmpty()) + { + log.info("设计师:【" + va.getOperatorCode() + "】无可解冻资金"); + return; + } + + // 同步流水信息 + for (LinkedMapSO sumFreezeMoney : list) + { + if (sumFreezeMoney.get("freezeMoneyAdd") == null || sumFreezeMoney.get("freezeMoneyDown") == null) + { + log.info("设计师:【" + va.getOperatorCode() + "】无可解冻资金"); + return; + } + + if (Long.parseLong(sumFreezeMoney.get("freezeMoneyAdd").toString()) <= 0 && Long.parseLong(sumFreezeMoney.get("freezeMoneyDown").toString()) == 0) + { + log.info("设计师:【" + va.getOperatorCode() + "】无可解冻资金"); + return; + } + + long moneyAdd = Long.parseLong(sumFreezeMoney.get("freezeMoneyAdd").toString()); + long moneyDown = Long.parseLong(sumFreezeMoney.get("freezeMoneyDown").toString()); + // 同步虚拟账户表 + VirtualAccount item = ORM.get(ZTable.class).item(VirtualAccount.class, new Selector().addMust("operatorCode", va.getOperatorCode())); + + Updater virtualAccountUpdater = new Updater(); + virtualAccountUpdater.addMust("operatorCode", item.getOperatorCode()); + virtualAccountUpdater.addField("usableMoney", item.getUsableMoney() + moneyAdd + moneyDown); + virtualAccountUpdater.addField("freezeMoney", item.getFreezeMoney() - moneyAdd - moneyDown); + virtualAccountUpdater.addField("sumMoney", item.getSumMoney()); + ORM.get(ZTable.class).update(VirtualAccount.class, virtualAccountUpdater); + + long longId = Ids.longId(); + Timestamp nowTimestamp = Sqls.nowTimestamp(); + // 同步虚拟账户 账户明细表 + VirtualAccountDetails virtualAccountDetails = new VirtualAccountDetails(); + virtualAccountDetails.setOperatorCode(item.getOperatorCode()); + virtualAccountDetails.setAccountBlotter(Ids.longId()); + virtualAccountDetails.setTransactionBlotter(longId); + virtualAccountDetails.setTransactionStatus(Integer.parseInt(VirtualAccountConstants.UNFREEZE.value())); + virtualAccountDetails.setUsableMoneyAdd(moneyAdd + moneyDown); + virtualAccountDetails.setFreezeMoneyDown(-moneyAdd - moneyDown); + virtualAccountDetails.setOperatorTime(nowTimestamp); + virtualAccountDetails.setUsableMoney(item.getUsableMoney() + moneyAdd + moneyDown); + virtualAccountDetails.setFreezeMoney(item.getFreezeMoney() - moneyAdd - moneyDown); + virtualAccountDetails.setSumMoney(item.getSumMoney()); + ORM.get(ZTable.class).insert(virtualAccountDetails); + + // 同步虚拟账户 交易明细表 + VirtualTransactionDetails virtualTransactionDetails = new VirtualTransactionDetails(); + virtualTransactionDetails.setOperatorCode(item.getOperatorCode()); + virtualTransactionDetails.setTransactionBlotter(longId); + virtualTransactionDetails.setOrderText(sumFreezeMoney.get("orderText").toString()); + virtualTransactionDetails.setDesignId(Long.parseLong(sumFreezeMoney.get("designId").toString())); + virtualTransactionDetails.setEndTime(Sqls.toTimestamp(sumFreezeMoney.get("endTime").toString())); + virtualTransactionDetails.setTransactionTime(nowTimestamp); + virtualTransactionDetails.setTransactionStatus(Integer.parseInt(VirtualAccountConstants.UNFREEZE.value())); + virtualTransactionDetails.setOrderMoney(-moneyAdd - moneyDown); + ORM.get(ZTable.class).insert(virtualTransactionDetails); + + } + } + + // 订单异常稽核 + public void abnormalAudit(HttpRequest request, String operatorCode, long modifyMoney, String designOrderId, String remark, String type) throws Exception + { + VirtualAccount virtualAccount = ORM.get(ZTable.class).item(VirtualAccount.class, new Selector().addMust("operatorCode", operatorCode)); + Transaction tx = null; + try + { + tx = TransactionManager.beginTransaction(); + operatorSalary(operatorCode, request.getSessionName(), virtualAccount, modifyMoney * 100, + Integer.parseInt(VirtualAccountConstants.ABNORMALAUDIT.value()), remark, type, designOrderId); + tx.commit(); + } + catch (Exception e) + { + if (tx != null) + { + tx.rollback(); + } + request.returnCloseDialog("操作失败"); + log.error("设计师:【" + operatorCode + "】异常稽核失败,金额为:【" + modifyMoney + "】", e); + } + finally + { + if (tx != null) + { + tx.close(); + } + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/account/VirtualAccountDetailsAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/account/VirtualAccountDetailsAction.java new file mode 100644 index 0000000..53f33ab --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/account/VirtualAccountDetailsAction.java @@ -0,0 +1,74 @@ +package com.zhiqim.yangcai.design.action.account; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.account.VirtualAccountDetails; +import com.zhiqim.yangcai.design.dbo.account.VirtualAccountType; + +/** + * + * [简要描述]:虚拟账户 账户明细表
            + * [详细描述]:
            + * + * @version 1.0 @author hc 2021年6月19日 新建与整理 + */ +public class VirtualAccountDetailsAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 12); + String operatorCode = null; + if (request.getParameter("operatorCode") == null || request.getParameter("operatorCode").isEmpty()) + { + operatorCode = request.getSessionName(); + } + else + { + operatorCode = request.getParameter("operatorCode"); + } + + Long parameter = request.getParameterLong("status"); + request.setAttribute("status", parameter); + + Long typeId = request.getParameterLong("typeId"); + + String beginDate = request.getParameter("beginDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + + Selector vadSel = new Selector(); + Selector vatSel = new Selector(); + // 总账户页面 + vadSel.addMaybe("transactionStatus", typeId); + + vadSel.addMaybe("accountBlotter", request.getParameterLong("accountBlotter")); + vadSel.addMaybe("transactionBlotter", request.getParameterLong("transactionBlotter")); + vadSel.addMustThenGE("operatorTime", Sqls.toTimestamp(beginDate, "00:00:00")); + vadSel.addMustThenLE("operatorTime", Sqls.toTimestamp(endDate, "23:59:59")); + vadSel.addMust("operatorCode", operatorCode); + vadSel.addOrderbyDesc("operatorTime"); + vadSel.addOrderbyDesc("usableMoney"); + PageResult pageResult = ORM.get(ZTable.class).page(VirtualAccountDetails.class, pageNo, pageSize, vadSel); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + + // 可查询条件 + List statusType = ORM.get(ZTable.class).list(VirtualAccountType.class, vatSel); + request.setAttribute("statusType", statusType); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/account/VirtualAccountTransactionDetailsAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/account/VirtualAccountTransactionDetailsAction.java new file mode 100644 index 0000000..6d865c7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/account/VirtualAccountTransactionDetailsAction.java @@ -0,0 +1,76 @@ +package com.zhiqim.yangcai.design.action.account; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.account.VirtualAccountType; +import com.zhiqim.yangcai.design.dbo.account.VirtualTransactionDetails; + +/** + * + * [简要描述]:虚拟账户 交易明细表
            + * [详细描述]:
            + * + * @version 1.0 @author hc 2021年6月19日 新建与整理 + */ +public class VirtualAccountTransactionDetailsAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 12); + String operatorCode = null; + if (request.getParameter("operatorCode") == null || request.getParameter("operatorCode").isEmpty()) + { + operatorCode = request.getSessionName(); + } + else + { + operatorCode = request.getParameter("operatorCode"); + } + Long parameter = request.getParameterLong("status"); + request.setAttribute("status", parameter); + + Long typeId = request.getParameterLong("typeId"); + + long designId = request.getParameterLong("designId"); + long transactionBlotter = request.getParameterLong("transactionBlotter"); + + String beginDate = request.getParameter("beginDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + + Selector vadSel = new Selector(); + Selector vatSel = new Selector(); + // 总账户页面 + + vadSel.addMaybe("transactionStatus", typeId); + + vadSel.addMaybe("transactionBlotter", transactionBlotter); + vadSel.addMaybe("designId", designId); + vadSel.addMustThenGE("transactionTime", Sqls.toTimestamp(beginDate, "00:00:00")); + vadSel.addMustThenLE("transactionTime", Sqls.toTimestamp(endDate, "23:59:59")); + vadSel.addMust("operatorCode", operatorCode); + vadSel.addOrderbyDesc("transactionTime"); + PageResult pageResult = ORM.get(ZTable.class).page(VirtualTransactionDetails.class, pageNo, pageSize, vadSel); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + + // 可查询条件 + List statusType = ORM.get(ZTable.class).list(VirtualAccountType.class, vatSel); + request.setAttribute("statusType", statusType); + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/accounts/accountsManageAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/accounts/accountsManageAction.java new file mode 100644 index 0000000..dfd43fe --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/accounts/accountsManageAction.java @@ -0,0 +1,201 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignerManageAction.java + * 创建人 :gjx + * 创建时间:2021年3月15日 +*/ + +package com.zhiqim.yangcai.design.action.accounts; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; +import com.zhiqim.yangcai.design.dbo.order.accountsSelfView; +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourseView; + +/** + * + * [简要描述]: 设计师管理
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年3月15日 新建与整理 + */ +public class accountsManageAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { +/* int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 12); + long orgId = request.getParameterLong("orgId"); + + Selector selector = new Selector(); + selector.addMaybe("designer", request.getParameter("designer")); + selector.addMaybe("workDuration", request.getParameter("workDuration")); + selector.addMaybeLike("workExperience", request.getParameter("workExperience")); + selector.addMaybeLike("designType", request.getParameter("designType")); + selector.addMaybeLike("skillScope", request.getParameter("skillScope")); + selector.addMaybe("workStatus", request.getParameter("workStatus")); + selector.addMaybeLike("designerRemark", request.getParameter("designerRemark")); + if (orgId > 0) + { + selector.addMust("orgId", orgId); + } + else + { + selector.addMustNotInLong("orgId", 1805031820320001L, 1808071102554512L);// 非总部,临时注册 + } + + selector.addMaybe("operatorMobile", request.getParameter("operatorMobile")); + selector.addOrderbyDesc("operatorCreated"); + + PageResult pageResult = ORM.get(ZView.class).page(DesignerCourseView.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + selOrg.addMustNotEqual("orgId", 1808071102554512L); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + + request.setAttribute("orgList", orgList);*/ + + // String sql = DesignerDao.getDesignerManageSql(request); + // + // List modelList = new ArrayList(); + // List queryList = ORM.get(ZSQL.class).executeQuery(sql); + // for (LinkedMapSO so : queryList) + // { + // DesignerManageModel model = new DesignerManageModel(); + // model.setDesigner(so.get("designer").toString()); + // model.setOrgName(so.get("orgName").toString()); + // model.setAddTime(so.get("addTime").toString()); + // model.setLastOnlimeTime(so.get("lastOnlimeTime").toString()); + // model.setDesignerLever(so.get("designerLever").toString()); + // model.setDesignerRemark(so.get("designerRemark").toString()); + // model.setReceiveAccount(so.get("receiveAccount").toString()); + // model.setReceiveType(so.get("receiveType").toString()); + // model.setOperatorMobile(so.get("operatorMobile").toString()); + // + // modelList.add(model); + // } + // + // PageResult pageResult = PageBuilder.pageResult(page, pageSize, + // modelList); + // pageResult.addConditionMap(request.getParameterMap()); + // + // request.setAttribute("pageResult", pageResult); + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + startDate = Validates.isDateTime(startDate) ? startDate : DateTimes.getPreviousDateStringByMonth(1)+ " 00:00:00"; + endDate = Validates.isDateTime(endDate) ? endDate : DateTimes.getDateTimeString(); + + + long designId = request.getParameterLong("designId"); + String buyerNick = request.getParameter("buyerNick"); + int status = request.getParameterInt("orderStatus"); + String tids = request.getParameter("tids"); + Selector sel = new Selector(); + sel.addMaybe("designId", designId); + if (status != -1) { + if (status == 110) { + // 所有未完成订单 + sel.addMustThenGE("status", StatusConstants.ORDER_30.value());// 大于等于 正在设计 + sel.addMustThenLE("status", StatusConstants.ORDER_50.value());// 小于等于已初稿状态 + } else if (status == 120) { + // 所有未完成订单 + sel.addMustThenGE("status", StatusConstants.ORDER_30.value());// 大于等于 正在设计 + sel.addMustThenLE("status", StatusConstants.ORDER_50.value());// 小于等于已初稿状态 + + // 有审核打回记录 + sel.addMustIsNotNull("checkBackReason"); + } else { + sel.addMust("status", status); + } + } + + if (designId <= 0 && Validates.isEmpty(buyerNick) && status < 100 && Validates.isEmpty(tids) ) {// 如果输入订单号或者旺旺号不加时间限制 + sel.addMustThenGE("checkTime", Sqls.toTimestamp(startDate)); + sel.addMustThenLE("checkTime", Sqls.toTimestamp(endDate )); + } + + sel.addMaybe("typeId", request.getParameterLong("typeId")); + sel.addMaybe("draftType", request.getParameterInt("draftType")); + sel.addMaybe("buyerNick", buyerNick); + sel.addMaybe("tids", tids); + sel.addMaybe("designer", request.getParameter("designer")); + + sel.addMaybe("shopNick", request.getParameter("merchantId")); + sel.addMaybeThenGE("amount", request.getParameterLong("amount")); + sel.addOrderbyDesc("createTime"); + + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if (zmrOrgList.size() > 0) { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) { + orgIdArr = orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() - 1); + Selector selector2 = new Selector(); + selector2.addExpression("designer", + "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID in (" + orgIdArr + "))"); + selector2.addMust("designer", "1"); + sel.addOr(selector2); + } + + PageResult pageResult = ORM.get(ZView.class).page(accountsSelfView.class, page, pageSize, sel); + pageResult.addConditionMap(request.getParameterMap()); + + // 获取进度备注 + Map progressNoteMap = new HashMap(); + for (accountsSelfView order : pageResult.list()) { + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class).item(OrdProgressNote.class, + new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" + : "" + + "

            " + + note.getOrdProgressNote() + "

            " + Sqls.toDateTimeString(note.getCreateTime()) + + "
            "); + } + + request.setAttribute("pageResult", pageResult); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + + request.setAttribute("progressNoteMap", progressNoteMap); + + List typeList = DesignTypeDao.listAll(); + request.setAttribute("typeList", typeList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/accounts/accountsManageExportAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/accounts/accountsManageExportAction.java new file mode 100644 index 0000000..5de94b4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/accounts/accountsManageExportAction.java @@ -0,0 +1,148 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignerManageExportAction.java + * 创建人 :gjx + * 创建时间:2021年3月17日 +*/ + +package com.zhiqim.yangcai.design.action.accounts; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; +import com.zhiqim.yangcai.design.dbo.order.accountsSelfView; +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourseView; +import com.zhiqim.yangcai.util.ExportUtils; +import com.zhiqim.yangcai.util.Report; + +/** + * + * [简要描述]: 设计师管理导出
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年3月17日 新建与整理 + */ +public class accountsManageExportAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 1000); + + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + startDate = Validates.isDateTime(startDate) ? startDate : DateTimes.getPreviousDateStringByMonth(1)+ " 00:00:00"; + endDate = Validates.isDateTime(endDate) ? endDate : DateTimes.getDateTimeString(); + + long designId = request.getParameterLong("designId"); + String buyerNick = request.getParameter("buyerNick"); + int status = request.getParameterInt("orderStatus"); + String tids = request.getParameter("tids"); + Selector sel = new Selector(); + sel.addMaybe("designId", designId); + if (status != -1) { + if (status == 110) { + // 所有未完成订单 + sel.addMustThenGE("status", StatusConstants.ORDER_30.value());// 大于等于 正在设计 + sel.addMustThenLE("status", StatusConstants.ORDER_50.value());// 小于等于已初稿状态 + } else if (status == 120) { + // 所有未完成订单 + sel.addMustThenGE("status", StatusConstants.ORDER_30.value());// 大于等于 正在设计 + sel.addMustThenLE("status", StatusConstants.ORDER_50.value());// 小于等于已初稿状态 + + // 有审核打回记录 + sel.addMustIsNotNull("checkBackReason"); + } else { + sel.addMust("status", status); + } + } + + if (designId <= 0 && Validates.isEmpty(buyerNick) && status < 100 && Validates.isEmpty(tids)) {// 如果输入订单号或者旺旺号不加时间限制 + sel.addMustThenGE("checkTime", Sqls.toTimestamp(startDate)); + sel.addMustThenLE("checkTime", Sqls.toTimestamp(endDate)); + } + + sel.addMaybe("typeId", request.getParameterLong("typeId")); + sel.addMaybe("draftType", request.getParameterInt("draftType")); + sel.addMaybe("buyerNick", buyerNick); + sel.addMaybe("tids", tids); + sel.addMaybe("designer", request.getParameter("designer")); + + sel.addMaybe("merchantId", request.getParameterLong("merchantId")); + sel.addMaybeThenGE("amount", request.getParameterLong("amount")); + sel.addOrderbyDesc("createTime"); + + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if (zmrOrgList.size() > 0) { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) { + orgIdArr = orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() - 1); + Selector selector2 = new Selector(); + selector2.addExpression("designer", + "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID in (" + orgIdArr + "))"); + selector2.addMust("designer", "1"); + sel.addOr(selector2); + } + List listResult = ORM.get(ZView.class).list(accountsSelfView.class, sel); + String title = "结算详情"; + Report report = new Report(); + report.setTitle(title); + report.setFileName(title + (DateTimes.getDateTime14String()) + ".xls"); + report.setHearder(new String[] + { + "设计师", "订单号", "文件名", "订单状态", "提现账号", "设计佣金", "审核完成时间", + }); + report.setWidths(new int[] + { + 25, 25, 50, 20, 30, 25, 25 + }); + report.setFormats(new int[] + { + 0, 0, 0, 0, 0, 0, 0 + }); + report.setHeight(700); + report.setExcelPageType(1); + report.setPageSize(1); + + for (accountsSelfView designer : listResult) + { + + String[] drow = new String[] + { + designer.getDesigner(), Long.toString(designer.getDesignId()), designer.getOrderText(), + StatusConstants.getOrderStatusItem(designer.getStatus()).desc(), designer.getReceiveAccount(), + Long.toString(designer.getDesignPrice() / 100) , Sqls.toDateTimeString(designer.getCheckTime()) + }; + + report.addData(drow); + } + + report.setFooter("共" + listResult.size() + "条数据 导出时间:" + DateTimes.getDateTimeString()); + ExportUtils.exportExcel(request, report); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/AfterBlameReturnOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/AfterBlameReturnOrderAction.java new file mode 100644 index 0000000..41f3245 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/AfterBlameReturnOrderAction.java @@ -0,0 +1,154 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.after; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrderView; +import com.zhiqim.yangcai.design.dbo.design.AfterPicType; +import com.zhiqim.yangcai.design.dbo.design.AfterProblemType; + +/*** + * 申诉单列表 + * + * @version v1.0.0 @author longguizhi 2018-12-16 新建与整理 + */ +public class AfterBlameReturnOrderAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page"); + pageNo = pageNo <= 0 ? 1 : pageNo; + int pageSize = request.getParameterInt("pageSize"); + pageSize = pageSize <= 0 ? 20 : (pageSize > 1000 ? 1000 : pageSize); + String startCreateDate = request.getParameter("startCreateDate", DateTimes.getPreviousDateString(20));// 默认查询20天前 + String endCreateDate = request.getParameter("endCreateDate", DateTimes.getDateString());// 默认当天 + long designId = request.getParameterLong("designId"); + int day = DateTimes.compareDay(endCreateDate, startCreateDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + Selector selector = new Selector(); + String afterStatus = request.getParameter("afterStatus"); + if (afterStatus == null || "".equals(afterStatus)) + { + selector.addMaybeIn("afterStatus", AfterConstants.CS_100.value(), AfterConstants.CS_200.value(), AfterConstants.CS_500.value(), + AfterConstants.CS_F100.value()); + } + else if (afterStatus.equals("100")) + { + selector.addMaybe("afterStatus", AfterConstants.CS_100.value()); + } + else if (afterStatus.equals("200")) + { + selector.addMaybe("afterStatus", AfterConstants.CS_200.value()); + } + else if (afterStatus.equals("500")) + { + selector.addMaybe("afterStatus", AfterConstants.CS_500.value()); + } + else if (afterStatus.equals("-100")) + { + selector.addMaybe("afterStatus", AfterConstants.CS_F100.value()); + } + request.setAttribute("afterStatus", afterStatus); + // 不展示淘印通的申述 + selector.addMustNotInLong("merchantId", 1823193227002L); + selector.addMaybe("designAfsId", request.getParameterLong("designAfsId")); + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("merchantId", request.getParameterLong("merchantId")); + selector.addMaybe("picType", request.getParameterInt("picType")); + selector.addMaybe("problemType", request.getParameter("problemType")); + selector.addMaybe("afterBlamer", request.getParameter("afterBlamer")); + selector.addMaybeThenGE("afterCreateTime", Sqls.toTimestamp(startCreateDate, "00:00:00")); + selector.addMaybeThenLE("afterCreateTime", Sqls.toTimestamp(endCreateDate, "23:59:59")); + + if (designId > 0) + { + selector.addOr(new Selector("designId", designId).addMust("outId", designId)); + } + + // 根据组织显示 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long rootOrgId = ZmrOrgDao.getOrgRootId(request); + // 非总组织 + if (rootOrgId != sessionUser.getSelectedOrgId()) + { + selector.addMust("picOrgId", sessionUser.getSelectedOrgId()); + } + + selector.addOrderbyDesc("afterCreateTime"); + PageResult pageResult = ORM.get(ZView.class).page(DesignAfterOrderView.class, pageNo, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + Map picNameMap = new HashMap(); + Map troubleNameMap = new HashMap(); + List picList = ORM.get(ZTable.class).list(AfterPicType.class); + for (AfterPicType item : picList) + { + picNameMap.put(item.getPicType(), item.getPicTypeName()); + } + + List troubleList = ORM.get(ZTable.class).list(AfterProblemType.class); + for (AfterProblemType item : troubleList) + { + troubleNameMap.put(item.getProblemType(), item.getProblemName()); + } + + // 数据设置 + request.setAttribute("pageResult", pageResult); + request.setAttribute("picList", picList); + request.setAttribute("troubleList", troubleList); + request.setAttribute("startCreateDate", startCreateDate); + request.setAttribute("endCreateDate", endCreateDate); + request.setAttribute("picNameMap", picNameMap); + request.setAttribute("troubleNameMap", troubleNameMap); + request.setAttribute("page", pageNo); + + List designerList = new ArrayList(); + if (rootOrgId == sessionUser.getSelectedOrgId()) + { + request.setAttribute("queryAll", true); + for (ZmrOrg org : ZmrOrgDao.list(request)) + { + designerList.addAll(ZmrOperatorDao.getOperator(request, org.getOrgId())); + } + } + else + { + designerList = ZmrOperatorDao.getOperator(request, sessionUser.getSelectedOrgId()); + } + + request.setAttribute("designerList", designerList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/DesignAfterOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/DesignAfterOrderAction.java new file mode 100644 index 0000000..9240a4d --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/DesignAfterOrderAction.java @@ -0,0 +1,115 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.after; + +import java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrder; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrderView; +import com.zhiqim.yangcai.design.dbo.design.AfterPicType; +import com.zhiqim.yangcai.design.dbo.design.AfterProblemType; + +/*** + * 售后订单列表 + * + * @version v1.0.0 @author longguizhi 2018-12-16 新建与整理 + */ +@AnAlias("DesignAfterOrderAction") +public class DesignAfterOrderAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page"); + pageNo = pageNo <= 0 ? 1 : pageNo; + int pageSize = request.getParameterInt("pageSize"); + pageSize = pageSize <= 0 ? 20 : (pageSize > 1000 ? 1000 : pageSize); + String startCreateDate = request.getParameter("startCreateDate", DateTimes.getPreviousDateString(30));// 默认查询30天前 + String endCreateDate = request.getParameter("endCreateDate", DateTimes.getDateString());// 默认当天 + long designId = request.getParameterLong("designId"); + int day = DateTimes.compareDay(endCreateDate, startCreateDate); + if (day > 60) + { + request.setResponseError("请勿将时间区间跨度选择大于二个月"); + return; + } + Selector selector = new Selector(); + selector.addMaybe("designAfsId", request.getParameterLong("designAfsId")); + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("merchantId", request.getParameterLong("merchantId")); + selector.addMaybe("afterStatus", request.getParameter("afterStatus")); + selector.addMaybe("picType", request.getParameterInt("picType")); + selector.addMaybe("problemType", request.getParameter("problemType")); + selector.addMaybe("designer", request.getParameter("designer")); + selector.addMaybeThenGE("afterCreateTime", Sqls.toTimestamp(startCreateDate, "00:00:00")); + selector.addMaybeThenLE("afterCreateTime", Sqls.toTimestamp(endCreateDate, "23:59:59")); + + if (designId > 0) + { + selector.addOr(new Selector("designId", designId).addMust("outId", designId)); + } + + selector.addOrderbyDesc("afterCreateTime"); + PageResult pageResult = ORM.get(ZView.class).page(DesignAfterOrderView.class, pageNo, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + Map picNameMap = new HashMap(); + Map troubleNameMap = new HashMap(); + List picList = ORM.get(ZTable.class).list(AfterPicType.class); + for (AfterPicType item : picList) + { + picNameMap.put(item.getPicType(), item.getPicTypeName()); + } + List troubleList = ORM.get(ZTable.class).list(AfterProblemType.class); + for (AfterProblemType item : troubleList) + { + troubleNameMap.put(item.getProblemType(), item.getProblemName()); + } + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + long lNowTime = simpleDateFormat.parse("2021-10-01 00:00:00").getTime(); + // 数据设置 + request.setAttribute("pageResult", pageResult); + request.setAttribute("picList", picList); + request.setAttribute("troubleList", troubleList); + request.setAttribute("startCreateDate", startCreateDate); + request.setAttribute("endCreateDate", endCreateDate); + request.setAttribute("picNameMap", picNameMap); + request.setAttribute("troubleNameMap", troubleNameMap); + request.setAttribute("page", pageNo); + request.setAttribute("lNowTime", lNowTime); + } + + public void doEditDesignAfsId(HttpRequest request, Long designAfsId, Double compensateAmount, Long designId, Double compensateRatio) throws Exception + { + ORM.get(ZTable.class).update(DesignAfterOrder.class, new Updater().addMust("designAfsId", designAfsId).addField("compensateAmount", compensateAmount)); + // 记录日志 + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "修改订单售后赔付比为" + compensateRatio + "%", EventConstants.ORDER_44.value()); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/HandledAfterOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/HandledAfterOrderAction.java new file mode 100644 index 0000000..39edb37 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/HandledAfterOrderAction.java @@ -0,0 +1,133 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.after; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrderView; +import com.zhiqim.yangcai.design.dbo.design.AfterPicType; +import com.zhiqim.yangcai.design.dbo.design.AfterProblemType; + +/**** + * 我导致的售后单 + * + * @version v1.0.0 @author lgz 2019-3-12 新建与整理 + */ +public class HandledAfterOrderAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page"); + pageNo = pageNo <= 0 ? 1 : pageNo; + int pageSize = request.getParameterInt("pageSize"); + pageSize = pageSize <= 0 ? 20 : (pageSize > 1000 ? 1000 : pageSize); + String startCreateDate = request.getParameter("startCreateDate", DateTimes.getPreviousDateString(20));// 默认查询20天前 + String endCreateDate = request.getParameter("endCreateDate", DateTimes.getDateString());// 默认当天 + long designId = request.getParameterLong("designId"); + int day = DateTimes.compareDay(endCreateDate, startCreateDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + Selector selector = new Selector(); + selector.addMust("afterStatus", AfterConstants.CS_400.value()); + selector.addMaybe("designAfsId", request.getParameterLong("designAfsId")); + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("merchantId", request.getParameterLong("merchantId")); + selector.addMaybe("picType", request.getParameterInt("picType")); + selector.addMaybe("afterBlamer", request.getParameter("afterBlamer")); + // selector.addMaybe("afterHandler", request.getParameter("afterHandler", + // request.getSessionName())); + selector.addMaybeThenGE("afterCreateTime", Sqls.toTimestamp(startCreateDate, "00:00:00")); + selector.addMaybeThenLE("afterCreateTime", Sqls.toTimestamp(endCreateDate, "23:59:59")); + + if (designId > 0) + { + selector.addOr(new Selector("designId", designId).addMust("outId", designId)); + } + + // 根据组织显示 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long rootOrgId = ZmrOrgDao.getOrgRootId(request); + // 非总组织 + if (rootOrgId != sessionUser.getSelectedOrgId()) + { + selector.addMust("picOrgId", sessionUser.getSelectedOrgId()); + } + + selector.addOrderbyDesc("afterCreateTime"); + PageResult pageResult = ORM.get(ZView.class).page(DesignAfterOrderView.class, pageNo, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + Map picNameMap = new HashMap(); + Map troubleNameMap = new HashMap(); + List picList = ORM.get(ZTable.class).list(AfterPicType.class); + for (AfterPicType item : picList) + { + picNameMap.put(item.getPicType(), item.getPicTypeName()); + } + + List troubleList = ORM.get(ZTable.class).list(AfterProblemType.class); + for (AfterProblemType item : troubleList) + { + troubleNameMap.put(item.getProblemType(), item.getProblemName()); + } + + // 数据设置 + request.setAttribute("pageResult", pageResult); + request.setAttribute("picList", picList); + request.setAttribute("troubleList", troubleList); + request.setAttribute("startCreateDate", startCreateDate); + request.setAttribute("endCreateDate", endCreateDate); + request.setAttribute("picNameMap", picNameMap); + request.setAttribute("troubleNameMap", troubleNameMap); + request.setAttribute("page", pageNo); + + List designerList = new ArrayList(); + if (rootOrgId == sessionUser.getSelectedOrgId()) + { + request.setAttribute("queryAll", true); + for (ZmrOrg org : ZmrOrgDao.list(request)) + { + designerList.addAll(ZmrOperatorDao.getOperator(request, org.getOrgId())); + } + } + else + { + designerList = ZmrOperatorDao.getOperator(request, sessionUser.getSelectedOrgId()); + } + + request.setAttribute("designerList", designerList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/PersonalAfterOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/PersonalAfterOrderAction.java new file mode 100644 index 0000000..671a00b --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/PersonalAfterOrderAction.java @@ -0,0 +1,126 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.after; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrderView; +import com.zhiqim.yangcai.design.dbo.design.AfterPicType; +import com.zhiqim.yangcai.design.dbo.design.AfterProblemType; + +/*** + * 申诉单列表 + * + * @version v1.0.0 @author longguizhi 2018-12-16 新建与整理 + */ +public class PersonalAfterOrderAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page"); + pageNo = pageNo <= 0 ? 1 : pageNo; + int pageSize = request.getParameterInt("pageSize"); + pageSize = pageSize <= 0 ? 20 : (pageSize > 1000 ? 1000 : pageSize); + String startCreateDate = request.getParameter("startCreateDate", DateTimes.getPreviousDateString(20));// 默认查询20 + String endCreateDate = request.getParameter("endCreateDate", DateTimes.getDateString());// 默认当天 + long designId = request.getParameterLong("designId"); + Selector selector = new Selector(); + selector.addMaybe("designAfsId", request.getParameterLong("designAfsId")); + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("merchantId", request.getParameterLong("merchantId")); + selector.addMaybe("afterStatus", request.getParameter("afterStatus")); + selector.addMaybe("picType", request.getParameterInt("picType")); + selector.addMaybe("afterBlamer", request.getParameter("afterBlamer")); + selector.addMaybe("problemType", request.getParameter("problemType")); + selector.addMaybe("designer", request.getParameter("designer")); + selector.addMaybeThenGE("afterCreateTime", Sqls.toTimestamp(startCreateDate, "00:00:00")); + selector.addMaybeThenLE("afterCreateTime", Sqls.toTimestamp(endCreateDate, "23:59:59")); + + if (designId > 0) + { + selector.addOr(new Selector("designId", designId).addMust("outId", designId)); + } + + // 根据组织显示 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long rootOrgId = ZmrOrgDao.getOrgRootId(request); + //非总组织 + if (rootOrgId != sessionUser.getSelectedOrgId()) + { + selector.addMust("picOrgId", sessionUser.getSelectedOrgId()); + } + + selector.addOrderbyDesc("afterCreateTime"); + PageResult pageResult = ORM.get(ZView.class).page(DesignAfterOrderView.class, pageNo, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + Map picNameMap = new HashMap(); + Map troubleNameMap = new HashMap(); + List picList = ORM.get(ZTable.class).list(AfterPicType.class); + for (AfterPicType item : picList) + { + picNameMap.put(item.getPicType(), item.getPicTypeName()); + } + + List troubleList = ORM.get(ZTable.class).list(AfterProblemType.class); + for (AfterProblemType item : troubleList) + { + troubleNameMap.put(item.getProblemType(), item.getProblemName()); + } + + // 数据设置 + request.setAttribute("pageResult", pageResult); + request.setAttribute("picList", picList); + request.setAttribute("troubleList", troubleList); + request.setAttribute("startCreateDate", startCreateDate); + request.setAttribute("endCreateDate", endCreateDate); + request.setAttribute("picNameMap", picNameMap); + request.setAttribute("troubleNameMap", troubleNameMap); + request.setAttribute("page", pageNo); + + List designerList = new ArrayList(); + if (rootOrgId == sessionUser.getSelectedOrgId()) + { + request.setAttribute("queryAll", true); + for (ZmrOrg org : ZmrOrgDao.list(request)) + { + designerList.addAll(ZmrOperatorDao.getOperator(request, org.getOrgId())); + } + } + else + { + designerList = ZmrOperatorDao.getOperator(request, sessionUser.getSelectedOrgId()); + } + + request.setAttribute("designerList", designerList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/WaitHandleAfterOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/WaitHandleAfterOrderAction.java new file mode 100644 index 0000000..c5bdcfc --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/after/WaitHandleAfterOrderAction.java @@ -0,0 +1,96 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.after; + +import java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrderView; +import com.zhiqim.yangcai.design.dbo.design.AfterPicType; +import com.zhiqim.yangcai.design.dbo.design.AfterProblemType; + +/*** + * 等待处理的售后单 + * + * @version v1.0.0 @author longguizhi 2018-12-27 新建与整理 + */ +public class WaitHandleAfterOrderAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 15); + + String startCreateDate = request.getParameter("startCreateDate", DateTimes.getPreviousDateString(20));// 默认查询20天前 + String endCreateDate = request.getParameter("endCreateDate", DateTimes.getDateString());// 默认当天 + int day = DateTimes.compareDay(endCreateDate, startCreateDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + + Selector selector = new Selector(); + selector.addMust("afterBlamer", request.getSessionName()); + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("buyerNick", request.getParameter("buyerNick")); + selector.addMustThenGE("afterCreateTime", Sqls.toTimestamp(startCreateDate, "00:00:00")); + selector.addMustThenLE("afterCreateTime", Sqls.toTimestamp(endCreateDate, "23:59:59")); + selector.addMaybe("afterStatus", request.getParameterInt("afterStatus")); + selector.addOrderbyDesc("afterCreateTime"); + PageResult pageResult = ORM.get(ZView.class).page(DesignAfterOrderView.class, pageNo, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + Map picNameMap = new HashMap(); + Map troubleNameMap = new HashMap(); + List picList = ORM.get(ZTable.class).list(AfterPicType.class); + for (AfterPicType item : picList) + { + picNameMap.put(item.getPicType(), item.getPicTypeName()); + } + + List troubleList = ORM.get(ZTable.class).list(AfterProblemType.class); + for (AfterProblemType item : troubleList) + { + troubleNameMap.put(item.getProblemType(), item.getProblemName()); + } + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + long lNowTime = simpleDateFormat.parse("2021-10-01 00:00:00").getTime(); + // 数据设置 + request.setAttribute("pageResult", pageResult); + request.setAttribute("picList", picList); + request.setAttribute("troubleList", troubleList); + request.setAttribute("startCreateDate", startCreateDate); + request.setAttribute("endCreateDate", endCreateDate); + request.setAttribute("picNameMap", picNameMap); + request.setAttribute("troubleNameMap", troubleNameMap); + request.setAttribute("page", pageNo); + // request.setAttribute("designerList", OperatorDao.getOrgOperatorList(request, + // sessionUser.getSelectedOrgId(), request.getSessionName())); + request.setAttribute("lNowTime", lNowTime); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainDealAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainDealAction.java new file mode 100644 index 0000000..c2fab3f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainDealAction.java @@ -0,0 +1,39 @@ +/** + * 扬彩印刷设计 + * 文件名 :complainDetailAction.java + * 创建人 :gjx + * 创建时间:2019-8-15 + */ + +package com.zhiqim.yangcai.design.action.complain; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.complain.DesignComplainView; + +/** + * 投诉详情 + * + * @version 1.0 @author gjx 2019-8-15 新建与整理 + */ +public class ComplainDealAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long complainId = request.getParameterLong("complainId"); + DesignComplainView order = ORM.get(ZView.class).item(DesignComplainView.class, new Selector().addMust("complainId", complainId)); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + + } + request.setAttribute("order", order); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainDetailAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainDetailAction.java new file mode 100644 index 0000000..c05895f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainDetailAction.java @@ -0,0 +1,39 @@ +/** + * 扬彩印刷设计 + * 文件名 :complainDetailAction.java + * 创建人 :gjx + * 创建时间:2019-8-15 + */ + +package com.zhiqim.yangcai.design.action.complain; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.complain.DesignComplainView; + +/** + * 投诉详情 + * + * @version 1.0 @author gjx 2019-8-15 新建与整理 + */ +public class ComplainDetailAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long complainId = request.getParameterLong("complainId"); + DesignComplainView order = ORM.get(ZView.class).item(DesignComplainView.class, new Selector().addMust("complainId", complainId)); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + + } + request.setAttribute("order", order); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainFinishlListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainFinishlListAction.java new file mode 100644 index 0000000..a545b83 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainFinishlListAction.java @@ -0,0 +1,74 @@ +package com.zhiqim.yangcai.design.action.complain; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.ShopDao; +import com.zhiqim.yangcai.design.dbo.complain.DesignComplainView; + +/** + * 投诉订单统计 + * + * @version 1.0 @author gjx 2019-8-15 新建与整理 + */ +public class ComplainFinishlListAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 10); + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(6)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + + Selector selector = new Selector(); + selector.addMaybeThenGE("complainAddTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMaybeThenLE("complainAddTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addOrderbyDesc("complainAddTime"); + // selector.addMaybe("complainStatus", ComplainConstants.TX_40.value()); + selector.addMaybe("undertakePerson", request.getParameter("undertakePerson")); + selector.addMaybe("undertakeOrg", request.getParameterLong("orgId")); + + List complainList = ORM.get(ZView.class).list(DesignComplainView.class, selector); + + Map pcMap = new HashMap(); + for (DesignComplainView complain : complainList) + { + String text = complain.getComplainType(); + Integer count = pcMap.get(text); + count = count == null ? 0 : count; + pcMap.put(text, count + 1); + } + PageResult pageResult = PageBuilder.pageResult(page, pageSize, complainList); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("shopNickList", ShopDao.getShopList()); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + request.setAttribute("pcMap", pcMap); + request.setAttribute("orgAllOrder", complainList.size()); + + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + selOrg.addMustNotEqual("orgId", 1808071102554512L); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + + request.setAttribute("orgList", orgList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainTotalOrderListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainTotalOrderListAction.java new file mode 100644 index 0000000..989ecc5 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainTotalOrderListAction.java @@ -0,0 +1,62 @@ +/** + * 扬彩印刷设计 + * 文件名 :ComplainTotalOrderListAction.java + * 创建人 :gjx + * 创建时间:2019-8-15 + */ + +package com.zhiqim.yangcai.design.action.complain; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.ShopDao; +import com.zhiqim.yangcai.design.dbo.complain.DesignComplainView; + +/** + * 投诉单列表 + * + * @version 1.0 @author gjx 2019-8-15 新建与整理 + */ +public class ComplainTotalOrderListAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 12); + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(6)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + + Selector selector = new Selector(); + selector.addMaybeThenGE("complainAddTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMaybeThenLE("complainAddTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addOrderbyDesc("complainAddTime"); + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("complainId", request.getParameterLong("complainId")); + selector.addMaybe("buyerNick", request.getParameter("buyerNick")); + selector.addMaybe("complainStatus", request.getParameter("complainStatus")); + selector.addMaybe("shopNick", request.getParameter("shopNick")); + selector.addMaybe("undertakePerson", request.getParameter("undertakePerson")); + + List designComplainViews = ORM.get(ZView.class).list(DesignComplainView.class, selector); + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, designComplainViews); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("shopNickList", ShopDao.getShopList()); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainWantDealListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainWantDealListAction.java new file mode 100644 index 0000000..f86d7d9 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/complain/ComplainWantDealListAction.java @@ -0,0 +1,59 @@ +/** + * 扬彩印刷设计 + * 文件名 :ComplainTotalOrderListAction.java + * 创建人 :gjx + * 创建时间:2019-8-15 + */ + +package com.zhiqim.yangcai.design.action.complain; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.ShopDao; +import com.zhiqim.yangcai.design.dbo.complain.DesignComplainView; + +/** + * 设计师-我的投诉 + * + * @version 1.0 @author gjx 2019-8-15 新建与整理 + */ +public class ComplainWantDealListAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 12); + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(6)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + + Selector selector = new Selector(); + selector.addMaybe("undertakePerson", request.getSessionName()); + selector.addMaybeThenGE("complainAddTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMaybeThenLE("complainAddTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addOrderbyDesc("complainAddTime"); + selector.addMaybe("complainStatus", request.getParameter("complainStatus")); + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("complainId", request.getParameterLong("complainId")); + selector.addMaybe("buyerNick", request.getParameter("buyerNick")); + selector.addMaybe("complainStatus", request.getParameter("complainStatus")); + selector.addMaybe("shopNick", request.getParameter("shopNick")); + + PageResult pageResult = ORM.get(ZView.class).page(DesignComplainView.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("shopNickList", ShopDao.getShopList()); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/des/TemplateCustomerPreviewAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/des/TemplateCustomerPreviewAction.java new file mode 100644 index 0000000..8679b1f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/des/TemplateCustomerPreviewAction.java @@ -0,0 +1,35 @@ +package com.zhiqim.yangcai.design.action.des; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.design.constant.DesignConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 模板客户预览 + * + * @version v1.0.0 @author Deng 2019-10-22 新建与整理 + */ +public class TemplateCustomerPreviewAction implements Action, DesignConstants +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + if (designId == -1) + { + request.returnCloseWindow("设计订单信息不存在"); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.returnCloseWindow("设计订单信息不存在"); + return; + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/des/TemplatePreviewAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/des/TemplatePreviewAction.java new file mode 100644 index 0000000..c35f40a --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/des/TemplatePreviewAction.java @@ -0,0 +1,75 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.des; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constant.DesignConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.WhetherMayLeadToDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; + +/** + * 电子名片模板预览 + * + * @version v1.0.0 @author caohong + */ +public class TemplatePreviewAction implements Action, DesignConstants +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + if (designId == -1) + { + request.returnCloseWindow("设计订单信息不存在"); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.returnCloseWindow("设计订单信息不存在"); + return; + } + + if (order.getStatus() > StatusConstants.ORDER_50.value()) + { + request.returnCloseWindow("该订单已定稿,不允许前往设计"); + return; + } + + // 是否有权限通往智能设计平台 + WhetherMayLeadToDao.ergodicOpecoterCode(request, request.getSessionName(), order); + + DesignType typeItem = DesignTypeDao.get(order.getTypeId()); + if (typeItem == null) + { + request.returnCloseWindow("订单对应类型不存在"); + return; + } + + int templateNum = ORM.get(ZView.class).count(MediaTemplateView.class, new Selector("designId", designId)); + request.setAttribute("display", templateNum > 0); // 显示选项卡 + + request.setAttribute("order", order); + request.addParam("designId", designId); + request.setAttribute("orderIsCardType", Boolean.TRUE); + request.setAttribute("typeItem", typeItem); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designer/DesignerCourseDetailAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designer/DesignerCourseDetailAction.java new file mode 100644 index 0000000..a0f871a --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designer/DesignerCourseDetailAction.java @@ -0,0 +1,63 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignerCourseDetailAction.java + * 创建人 :gjx + * 创建时间:2021年3月17日 +*/ + +package com.zhiqim.yangcai.design.action.designer; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourse; +import com.zhiqim.yangcai.design.dbo.profile.DesignerProfile; +import com.zhiqim.yangcai.design.dbo.profile.DesignerWorks; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerLever; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordView; + +/** + * + * [简要描述]: 设计师详情
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年3月17日 新建与整理 + */ +public class DesignerCourseDetailAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String designer = request.getParameter("designer"); + + DesignerCourse designerCourse = ORM.get(ZTable.class).item(DesignerCourse.class, designer); + request.setAttribute("designerCourse", designerCourse); + + List scoreDesignerLeverList = ORM.get(ZTable.class).list(ScoreDesignerLever.class);// 等级 + ScoreDesignerRecordView score = StatDao.doQueryDesignerScore(designer); + String designerLever = "--"; + if (score != null) + { + ScoreDesignerLever scoreDesignerLever = StatDao.doQueryDesignerScoreLever(scoreDesignerLeverList, score); + if (scoreDesignerLever != null) + { + designerLever = scoreDesignerLever.getDesignerLever(); + } + } + request.setAttribute("designerLever", designerLever); + + DesignerProfile profile = ORM.get(ZTable.class).item(DesignerProfile.class, designer); + request.setAttribute("profile", profile); + + List works = ORM.get(ZTable.class).list(DesignerWorks.class, new Selector("operatorCode", designer)); + request.setAttribute("works", works); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designer/DesignerManageAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designer/DesignerManageAction.java new file mode 100644 index 0000000..8dc4d71 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designer/DesignerManageAction.java @@ -0,0 +1,114 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignerManageAction.java + * 创建人 :gjx + * 创建时间:2021年3月15日 +*/ + +package com.zhiqim.yangcai.design.action.designer; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatchValue; +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourseView; +import com.zhiqim.yangcai.design.dbo.qc.QcOrderView; + +/** + * + * [简要描述]: 设计师管理
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年3月15日 新建与整理 + */ +public class DesignerManageAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 12); + long orgId = request.getParameterLong("orgId"); + + Selector selector = new Selector(); + selector.addMaybe("designer", request.getParameter("designer")); + selector.addMaybe("workDuration", request.getParameter("workDuration")); + selector.addMaybeLike("workExperience", request.getParameter("workExperience")); + selector.addMaybeLike("designType", request.getParameter("designType")); + selector.addMaybeLike("skillScope", request.getParameter("skillScope")); + selector.addMaybe("workStatus", request.getParameter("workStatus")); + selector.addMaybeLike("designerRemark", request.getParameter("designerRemark")); + if (orgId > 0) + { + selector.addMust("orgId", orgId); + } + else + { + selector.addMustNotInLong("orgId", 1805031820320001L, 1808071102554512L);// 非总部,临时注册 + } + + selector.addMaybe("operatorMobile", request.getParameter("operatorMobile")); + selector.addOrderbyDesc("operatorCreated"); + + PageResult pageResult = ORM.get(ZView.class).page(DesignerCourseView.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + selOrg.addMustNotEqual("orgId", 1808071102554512L); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + + request.setAttribute("orgList", orgList); + + // String sql = DesignerDao.getDesignerManageSql(request); + // + // List modelList = new ArrayList(); + // List queryList = ORM.get(ZSQL.class).executeQuery(sql); + // for (LinkedMapSO so : queryList) + // { + // DesignerManageModel model = new DesignerManageModel(); + // model.setDesigner(so.get("designer").toString()); + // model.setOrgName(so.get("orgName").toString()); + // model.setAddTime(so.get("addTime").toString()); + // model.setLastOnlimeTime(so.get("lastOnlimeTime").toString()); + // model.setDesignerLever(so.get("designerLever").toString()); + // model.setDesignerRemark(so.get("designerRemark").toString()); + // model.setReceiveAccount(so.get("receiveAccount").toString()); + // model.setReceiveType(so.get("receiveType").toString()); + // model.setOperatorMobile(so.get("operatorMobile").toString()); + // + // modelList.add(model); + // } + // + // PageResult pageResult = PageBuilder.pageResult(page, pageSize, + // modelList); + // pageResult.addConditionMap(request.getParameterMap()); + // + // request.setAttribute("pageResult", pageResult); + } + + @AnTransaction + protected void delete(HttpRequest request) throws Exception + { + String designer = request.getParameter("designer"); + StringBuffer sql = new StringBuffer(); + sql.append("update zmr_operator set OPERATOR_MOBILE where OPERATOR_CODE = '" +designer +"'"); + ORM.get(ZSQL.class).executeQuery(sql.toString()); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designer/DesignerManageExportAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designer/DesignerManageExportAction.java new file mode 100644 index 0000000..d8d6ac6 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designer/DesignerManageExportAction.java @@ -0,0 +1,98 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignerManageExportAction.java + * 创建人 :gjx + * 创建时间:2021年3月17日 +*/ + +package com.zhiqim.yangcai.design.action.designer; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourseView; +import com.zhiqim.yangcai.util.ExportUtils; +import com.zhiqim.yangcai.util.Report; + +/** + * + * [简要描述]: 设计师管理导出
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年3月17日 新建与整理 + */ +public class DesignerManageExportAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + Selector selector = new Selector(); + selector.addMustNotEqual("operatorParam", "reg");// 新注册,未审核标记 + selector.addMaybe("designer", request.getParameter("designer")); + selector.addMaybe("workDuration", request.getParameter("workDuration")); + selector.addMaybeLike("workExperience", request.getParameter("workExperience")); + selector.addMaybeLike("designType", request.getParameter("designType")); + selector.addMaybeLike("skillScope", request.getParameter("skillScope")); + selector.addMaybe("workStatus", request.getParameter("workStatus")); + selector.addMaybeLike("designerRemark", request.getParameter("designerRemark")); + if (orgId > 0) + { + selector.addMust("orgId", orgId); + } + else + { + selector.addMustNotEqual("orgId", 1805031820320001L);// 非总部 + } + + selector.addMaybe("operatorMobile", request.getParameter("operatorMobile")); + selector.addOrderbyDesc("operatorCreated"); + List listResult = ORM.get(ZView.class).list(DesignerCourseView.class, selector); + + String title = "设计师数据详情"; + Report report = new Report(); + report.setTitle(title); + report.setFileName(title + (DateTimes.getDateTime14String()) + ".xls"); + report.setHearder(new String[] + { + "设计师", "手机号", "组织", "注册时间", "最后接单时间", "同时接单量", "标签备注", "提现账号", "提现方式", + }); + report.setWidths(new int[] + { + 25, 25, 25, 20, 30, 20, 25, 25, 25 + }); + report.setFormats(new int[] + { + 0, 0, 0, 0, 0, 0, 0, 0, 0 + }); + report.setHeight(700); + report.setExcelPageType(1); + report.setPageSize(1); + + for (DesignerCourseView designer : listResult) + { + + String[] drow = new String[] + { + designer.getDesigner(), designer.getOperatorMobile(), ZmrOrgDao.getOrgName(request, designer.getOrgId()), designer.getOperatorCreated(), + Sqls.toDateTimeString(designer.getLastOnlimeTime()), designer.getOperatorParam(), designer.getDesignerRemark(), + designer.getReceiveAccount(), designer.getReceiveType() + }; + + report.addData(drow); + } + + report.setFooter("共" + listResult.size() + "条数据 导出时间:" + DateTimes.getDateTimeString()); + ExportUtils.exportExcel(request, report); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designer/TeamManageAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designer/TeamManageAction.java new file mode 100644 index 0000000..92d620d --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designer/TeamManageAction.java @@ -0,0 +1,99 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignerManageAction.java + * 创建人 :gjx + * 创建时间:2021年3月15日 +*/ + +package com.zhiqim.yangcai.design.action.designer; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourseView; + +/** + * + * [简要描述]: 设计师管理
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年3月15日 新建与整理 + */ +public class TeamManageAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 100); + long orgId = request.getParameterLong("orgId"); + + Selector selector = new Selector(); + selector.addMaybe("designer", request.getParameter("designer")); + selector.addMaybe("workDuration", request.getParameter("workDuration")); + selector.addMaybeLike("workExperience", request.getParameter("workExperience")); + selector.addMaybeLike("designType", request.getParameter("designType")); + selector.addMaybeLike("skillScope", request.getParameter("skillScope")); + selector.addMaybe("workStatus", request.getParameter("workStatus")); + selector.addMaybeLike("designerRemark", request.getParameter("designerRemark")); + if (orgId > 0) + { + selector.addMust("orgId", orgId); + } + else + { + selector.addMustNotInLong("orgId", 1805031820320001L, 1808071102554512L);// 非总部,临时注册 + } + + selector.addMaybe("operatorMobile", request.getParameter("operatorMobile")); + selector.addOrderbyDesc("operatorCreated"); + + PageResult pageResult = ORM.get(ZView.class).page(DesignerCourseView.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + selOrg.addMustNotEqual("orgId", 1808071102554512L); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + + request.setAttribute("orgList", orgList); + + // String sql = DesignerDao.getDesignerManageSql(request); + // + // List modelList = new ArrayList(); + // List queryList = ORM.get(ZSQL.class).executeQuery(sql); + // for (LinkedMapSO so : queryList) + // { + // DesignerManageModel model = new DesignerManageModel(); + // model.setDesigner(so.get("designer").toString()); + // model.setOrgName(so.get("orgName").toString()); + // model.setAddTime(so.get("addTime").toString()); + // model.setLastOnlimeTime(so.get("lastOnlimeTime").toString()); + // model.setDesignerLever(so.get("designerLever").toString()); + // model.setDesignerRemark(so.get("designerRemark").toString()); + // model.setReceiveAccount(so.get("receiveAccount").toString()); + // model.setReceiveType(so.get("receiveType").toString()); + // model.setOperatorMobile(so.get("operatorMobile").toString()); + // + // modelList.add(model); + // } + // + // PageResult pageResult = PageBuilder.pageResult(page, pageSize, + // modelList); + // pageResult.addConditionMap(request.getParameterMap()); + // + // request.setAttribute("pageResult", pageResult); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/DesignerProfileAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/DesignerProfileAction.java new file mode 100644 index 0000000..0a70c96 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/DesignerProfileAction.java @@ -0,0 +1,32 @@ +package com.zhiqim.yangcai.design.action.designerworks; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.profile.DesignerProfile; + +/** + * 设计师简介待审核信息 + * + * @version v1.0.0 @author yixin 20020-09-12 新建与整理 + */ +public class DesignerProfileAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 20; + Selector selector = new Selector(); + selector.addOrderbyDesc("addTime"); + // 只查询未审核的 + selector.addMust("state", 1); + PageResult pageResult = ORM.get(ZTable.class).page(DesignerProfile.class, page, pageSize, selector); + request.setAttribute("pageResult", pageResult); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/DesignerRegAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/DesignerRegAction.java new file mode 100644 index 0000000..a6a6ba3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/DesignerRegAction.java @@ -0,0 +1,108 @@ +package com.zhiqim.yangcai.design.action.designerworks; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dbo.order.OrderQuestions; +import com.zhiqim.yangcai.design.dbo.order.QuestionsAtta; + +/** + * 设计师考试审核操作 + * + * @version v1.0.0 @author caohong 2021-5-25 08:50:15 + */ +@AnAlias("DesignerRegAction") +public class DesignerRegAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + + int page = request.getParameterInt("page"); + int pageSize = 15; + int status = request.getParameterInt("status"); + Selector selector = new Selector(); + selector.addMaybe("designer", request.getParameter("designer")); + selector.addMaybe("mobile", request.getParameter("mobile")); + if (status >= 0) + { + selector.addMust("status", status); + } + else + { + selector.addMustNotEqual("status", 30); // 默认排除已审核的 + } + selector.addOrderbyDesc("designEndTime"); + PageResult pageResult = ORM.get(ZTable.class).page(OrderQuestions.class, page, pageSize, selector); + request.setAttribute("pageResult", pageResult); + } + + /** + * 查看考试凭证 + * + * @author caohong + * @param questionsId + * @throws Exception + */ + public void queryExamVoucher(HttpRequest request, long questionsId) throws Exception + { + Selector sel = new Selector(); + sel.addMust("questionsId", questionsId); + sel.addMaybe("attaModul", "ExamVoucher"); + QuestionsAtta examVoucher = ORM.get(ZTable.class).item(QuestionsAtta.class, sel); + if (examVoucher != null) + { + request.setResponseResult(examVoucher.getFileUrl()); + } + else + { + request.setResponseError("未找到考试凭证信息,请重新刷新查看"); + } + } + + /** + * + * [简要描述]:设计文件和印刷文件下载
            + * [详细描述]:
            + * + * @author hc + * @param request + * @param downFileType + * @param questionsId + * @throws Exception + */ + public void downFile(HttpRequest request, long questionsId, String downFileType, HttpResponse response) throws Exception + { + Selector sel = new Selector(); + sel.addMust("questionsId", questionsId); + sel.addMaybe("attaModul", downFileType); + List result = ORM.get(ZTable.class).list(QuestionsAtta.class, sel); + if (result != null && result.size() > 0) + { + List attaIdList = new ArrayList(); + for (QuestionsAtta attaId : result) + { + attaIdList.add(attaId.getAttaId()); + } + + request.setResponseResult(Jsons.toString(attaIdList)); + } + else + { + request.setResponseError("未找到考试文件信息,请重新刷新查看"); + } + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/DesignerWorksAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/DesignerWorksAction.java new file mode 100644 index 0000000..9e21f36 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/DesignerWorksAction.java @@ -0,0 +1,32 @@ +package com.zhiqim.yangcai.design.action.designerworks; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.profile.DesignerWorks; + +/** + * 设计师作品待审核信息 + * + * @version v1.0.0 @author yixin 20020-09-12 新建与整理 + */ +public class DesignerWorksAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 20; + Selector selector = new Selector(); + selector.addOrderbyDesc("addTime"); + // 只查询未审核的 + selector.addMust("state", 0); + PageResult pageResult = ORM.get(ZTable.class).page(DesignerWorks.class, page, pageSize, selector); + request.setAttribute("pageResult", pageResult); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/ProfileAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/ProfileAction.java new file mode 100644 index 0000000..68142b7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/ProfileAction.java @@ -0,0 +1,54 @@ +package com.zhiqim.yangcai.design.action.designerworks; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourse; + +/** + * 操作员个人中心 + * + * @version v1.0.0 + */ +public class ProfileAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String operatorCode = request.getSessionName(); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + // DesignerProfile profile = ORM.get(ZTable.class).item(DesignerProfile.class, + // request.getSessionName()); + // List works = ORM.get(ZTable.class).list(DesignerWorks.class, new + // Selector("operatorCode", operatorCode)); + // ScoreDesignerRecord scoreDesignerRecord = + // ORM.get(ZTable.class).item(ScoreDesignerRecord.class, new Selector("operatorCode", + // operatorCode)); + // int orderCount = ORM.get(ZTable.class).count(DesignOrder.class, new Selector("designer", + // operatorCode)); + // int worksCount = ORM.get(ZTable.class).count(MediaTemplate.class, new + // Selector("designer", operatorCode)); + request.setAttribute("operator", operator); + // request.setAttribute("profile", profile); + // request.setAttribute("works", works); + // request.setAttribute("scoreDesignerRecord", scoreDesignerRecord); + // request.setAttribute("orderCount", orderCount); + // request.setAttribute("worksCount", worksCount); + // Selector selector = new Selector(); + // List scoreDesignerLeverList = + // ORM.get(ZTable.class).list(ScoreDesignerLever.class, selector); + // request.setAttribute("scoreDesignerLeverList", scoreDesignerLeverList); + + DesignerCourse designerCourse = ORM.get(ZTable.class).item(DesignerCourse.class, operatorCode); + if (designerCourse == null) + { + designerCourse = new DesignerCourse(); + } + request.setAttribute("course", designerCourse); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/RegCheckApprovedAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/RegCheckApprovedAction.java new file mode 100644 index 0000000..d609f04 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/RegCheckApprovedAction.java @@ -0,0 +1,166 @@ +package com.zhiqim.yangcai.design.action.designerworks; + +import java.io.File; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.manager.dbo.ZmrRole; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.uploadlarge.dbo.UpllFile; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dao.ScoreDesignerRecordDao; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroup; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.order.OrderQuestions; +import com.zhiqim.yangcai.design.dbo.order.QuestionsAtta; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordDetail; + +/** + * 设计师审核通过 + * + * @version v1.0.0 @author caohong 2021-5-25 08:50:15 + */ +@AnAlias("RegCheckApprovedAction") +public class RegCheckApprovedAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + + + String questionsId = request.getParameter("questionsId"); + + // 查询考试订单数据 + request.setAttribute("questionsId", questionsId); + + // 初始组织 + Selector selector = new Selector(); + selector.addMust("orgLevel", 1); + selector.addMust("orgStatus", 0); + selector.addMustNotEqual("orgId", 1808071102554512L); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector); + request.setAttribute("orgList", orgList); + + // 初始接单规则组 + List designerGroupList = ORM.get(ZTable.class).list(DesignerGroup.class, new Selector().addMust("status", 1)); + request.setAttribute("designerGroupList", designerGroupList); + } + + /** + * [简要描述]:注册审核通过
            + * + * @author caohong + * @param request + * @param questionsId + * @throws Exception + */ + public void checkApproved(HttpRequest request) throws Exception + { + long questionsId = request.getParameterLong("questionsId"); + long orgId = request.getParameterLong("orgId"); + int score = request.getParameterInt("score"); + long designerGroupId = request.getParameterLong("designerGroupId"); + + OrderQuestions questions = ORM.get(ZTable.class).item(OrderQuestions.class, questionsId); + if (questions == null) + { + request.setResponseError("未找到考试订单信息"); + return; + } + + // 查询组织对接角色 + List role_list = ORM.get(ZTable.class).list(ZmrRole.class, new Selector("orgId", orgId).addOrderbyAsc("roleSeq")); + if (role_list == null || role_list.size() == 0) + { + request.setResponseError("对应组织未配置操作员角色信息"); + return; + } + + // 1.修改考试记录 + Updater updater = new Updater(); + updater.addMust("questionsId", questionsId); + updater.addField("status", 30); + ORM.get(ZTable.class).update(OrderQuestions.class, updater); + + // 删除附件记录 + List attaList = ORM.get(ZTable.class).list(QuestionsAtta.class, new Selector().addMustInLong("questionsId", questionsId)); + for (QuestionsAtta atta : attaList) + { + // 素材文件需要共用,不能删除 + if (!"MaterialFile".equals(atta.getAttaModul())) + { + File file = new File(atta.getSavePath()); + if (file.exists()) + { + Files.deleteFile(atta.getSavePath()); + } + + if (Validates.isNotEmpty(atta.getFileid())) + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", atta.getFileid()).addReplace("id", null)); + } + } + + // 考试凭证需要删除oss + if ("ExamVoucher".equals(atta.getAttaModul())) + { + String path = atta.getFileUrl().split(OssFileDao.getPrefix_dir())[1]; + OssFileDao.deleteOssFile(OssFileDao.getPrefix_dir() + path); + } + + ORM.get(ZTable.class).delete(QuestionsAtta.class, atta.getAttaId()); + } + + // 2.账号权限角色分配 + Updater updater_oper = new Updater(); + updater_oper.addMust("operatorCode", questions.getDesigner()); + updater_oper.addField("orgId", orgId); + updater_oper.addField("operatorRole", String.valueOf(role_list.get(0).getRoleId())); + updater_oper.addField("operatorParam", ""); + ORM.get(ZTable.class).update(ZmrOperator.class, updater_oper); + + // 3.关联接单规则 + DesignerGroupDispatch designerGroupDispatch = new DesignerGroupDispatch(); + designerGroupDispatch.setDesignerGroupId(designerGroupId); + designerGroupDispatch.setOrgId(orgId); + designerGroupDispatch.setMaxOrderAmount(0); + designerGroupDispatch.setMinOrderAmount(0); + designerGroupDispatch.setHighQualityOrder(false); + designerGroupDispatch.setDesign(false); + designerGroupDispatch.setModifyOperatorCode(request.getSessionName()); + designerGroupDispatch.setModifyTime(Sqls.nowTimestamp()); + designerGroupDispatch.setStatus(1); + designerGroupDispatch.setLargeAmount(false); + designerGroupDispatch.setMaxOrderNum(0); + designerGroupDispatch.setOperatorCode(questions.getDesigner()); + designerGroupDispatch.setSpecial(false); + designerGroupDispatch.setUrgent(false); + ORM.get(ZTable.class).replace(designerGroupDispatch); + + // 4.初始积分设置 + if (score > 0) + { + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_100.value())); + scoreDesignerRecordDetail.setOperatorCode(questions.getDesigner()); + scoreDesignerRecordDetail.setCreateOperator(request.getSessionUser(ZmrSessionUser.class).getOperatorCode()); + scoreDesignerRecordDetail.setRemark("注册初始积分"); + scoreDesignerRecordDetail.setScore(score); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/RegCheckBackAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/RegCheckBackAction.java new file mode 100644 index 0000000..3e0a73c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/designerworks/RegCheckBackAction.java @@ -0,0 +1,53 @@ +package com.zhiqim.yangcai.design.action.designerworks; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.order.OrderQuestions; + +/** + * 设计师审核拒绝 + * + * @version v1.0.0 @author caohong 2021-5-25 08:50:15 + */ +@AnAlias("RegCheckBackAction") +public class RegCheckBackAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String questionsId = request.getParameter("questionsId"); + + // 查询考试订单数据 + request.setAttribute("questionsId", questionsId); + } + + /** + * [简要描述]:注册审核拒绝
            + * + * @author caohong + * @param request + * @param questionsId + * @throws Exception + */ + public void backRemarks(HttpRequest request, long questionsId, String remarks) throws Exception + { + if (questionsId < 0) + { + request.setResponseError("未找到考试订单信息"); + return; + } + + Updater updater = new Updater(); + updater.addMust("questionsId", questionsId); + updater.addField("status", 40); + updater.addField("remarks", remarks); + ORM.get(ZTable.class).update(OrderQuestions.class, updater); + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DesOnliceTimeLogAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DesOnliceTimeLogAction.java new file mode 100644 index 0000000..a8ed952 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DesOnliceTimeLogAction.java @@ -0,0 +1,94 @@ +package com.zhiqim.yangcai.design.action.dispatch; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.dispatch.DesWorkSearchLog; +import com.zhiqim.yangcai.design.model.DesOnliceTimeLogModel; +import com.zhiqim.yangcai.design.service.DesOnliceTimeLogCallable; + +/** + * 在线时长 + * + * @version v1.0.0 @author zzy 2018-7-4 新建与整理 + * @version v1.0.1 @author gjx 2020-09-03 新建与整理 + */ +public class DesOnliceTimeLogAction implements Action +{ + private static final Log log = LogFactory.getLog(DesOnliceTimeLogAction.class); + + @Override + public void execute(HttpRequest request) + { + int page = request.getParameterInt("page", 1); + int pageSize = 15; + String dayCode = request.getParameter("dayCode", DateTimes.getDateString()); + String operatorCode = request.getParameter("operatorCode"); + try + { + + Selector selector = new Selector(); + selector.addMaybe("operatorCode", operatorCode); + selector.addMustThenGE("createTime", Sqls.toTimestamp(dayCode, "00:00:00")); + selector.addMustThenLE("createTime", Sqls.toTimestamp(dayCode, "23:59:59")); + selector.addMust("logType", 1);// 有开启接单记录 + selector.addGroupbyFields("operatorCode"); + + List logList = ORM.get(ZTable.class).list(DesWorkSearchLog.class, selector); + + List modelList = new ArrayList(); + int logSize = logList.size(); + if (logSize > 0) + { + // 创建一个线程池 + ExecutorService pool = Executors.newFixedThreadPool(2); + // 创建多个有返回值的任务 + List> futureList = new ArrayList>(); + for (int i = 0; i < logList.size(); i++) + { + Selector sel = new Selector(); + sel.addMust("operatorCode", logList.get(i).getOperatorCode()); + sel.addMustThenGE("createTime", Sqls.toTimestamp(dayCode, "00:00:00")); + sel.addMustThenLE("createTime", Sqls.toTimestamp(dayCode, "23:59:59")); + sel.addOrderbyAsc("createTime"); + Callable c = new DesOnliceTimeLogCallable(sel); + Future f = pool.submit(c); + futureList.add(f); + } + pool.shutdown(); + for (Future f : futureList) + { + DesOnliceTimeLogModel model = (DesOnliceTimeLogModel) f.get(); + modelList.add(model); + } + } + + Collections.sort(modelList); + PageResult pageResult = PageBuilder.pageResult(page, pageSize, modelList); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + } + catch (Exception e) + { + log.error("设计师在线时长查询异常," + e.getMessage(), e); + } + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DesignerGroupDispatchLogAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DesignerGroupDispatchLogAction.java new file mode 100644 index 0000000..00f2749 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DesignerGroupDispatchLogAction.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.dispatch; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.dispatch.DesignerGroupDispatchLog; + +/** + * + * 派单日志 + * + * @version v1.0.0 @author Deng 2017-8-21 新建与整理 + */ +public class DesignerGroupDispatchLogAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 20; + + String destime = request.getParameter("destime", DateTimes.getDateString()); + long designId = request.getParameterLong("designId"); + designId = designId != -1 ? designId : request.getParameterLong("oid"); + Selector selector = new Selector(); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + if (orgId > 0) + { + ZmrOrg org = request.getContextAttribute(ZmrBootstrap.class).table().item(ZmrOrg.class, orgId); + if (org != null && org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + } + + selector.addOrderbyDesc("desTime"); + selector.addMaybe("designId", designId); + + if (Validates.isNotEmpty(destime)) + { + selector.addMaybeThenGE("desTime", Sqls.toTimestamp(destime, "00:00:00")); + selector.addMaybeThenLE("desTime", Sqls.toTimestamp(destime, "23:59:59")); + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesignerGroupDispatchLog.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DispatchLogAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DispatchLogAction.java new file mode 100644 index 0000000..9d64eb1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DispatchLogAction.java @@ -0,0 +1,88 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.dispatch; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.dispatch.DesDispatchOrderLog; + +/** + * + * 派单日志 + * + * @version v1.0.0 @author Deng 2017-8-21 新建与整理 + */ +public class DispatchLogAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 20; + + String destime = request.getParameter("destime", DateTimes.getDateString()); + String operatorCode = request.getParameter("operatorCode"); + long designId = request.getParameterLong("designId"); + long industryId = request.getParameterLong("industryId"); + long disOrderStatus = request.getParameterLong("disOrderStatus"); + + Selector selector = new Selector(); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + if (orgId > 0) + { + ZmrOrg org = request.getContextAttribute(ZmrBootstrap.class).table().item(ZmrOrg.class, orgId); + if (org != null && org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + } + selector.addOrderbyDesc("desTime"); + selector.addMaybeLike("operatorCode", operatorCode); + selector.addMaybe("designId", designId); + selector.addMaybe("industryId", industryId); + if (disOrderStatus != -1) + { + selector.addMust("disOrderStatus", disOrderStatus); + } + + if (Validates.isNotEmpty(destime)) + { + selector.addMaybeThenGE("desTime", Sqls.toTimestamp(destime, "00:00:00")); + selector.addMaybeThenLE("desTime", Sqls.toTimestamp(destime, "23:59:59")); + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesDispatchOrderLog.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + request.setAttribute("operatorCode", operatorCode); + request.setAttribute("industryId", industryId); + request.setAttribute("destime", destime); + + if (designId != -1) + { + request.setAttribute("designId", designId); + } + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DispatchPropertyAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DispatchPropertyAction.java new file mode 100644 index 0000000..bc9ec7d --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DispatchPropertyAction.java @@ -0,0 +1,230 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.dispatch; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dao.ParamDao; +import com.zhiqim.yangcai.design.dbo.dispatch.DesDispatchProperty; +import com.zhiqim.yangcai.design.dbo.dispatch.DesOnline; + +/** + * + * 派单属性 + * + * @version v1.0.0 @author Deng 2017-8-21 新建与整理 + */ +public class DispatchPropertyAction extends StdSwitchAction +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("operatorCode", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsNotEmpty("operatorCode", "必须选择设计师")); + request.addValidate(new IsNotEmpty("majorType", "请选择一个主产品类型")); + request.addValidate(new IsNotEmpty("majorIndustry", "请选择一个主行业")); + request.addValidate(new IsNotEmpty("designerLevel", "选择设计师级别")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 20; + + Selector selector = new Selector(); + selector.addMaybe("operatorStatus", request.getParameterInt("operatorStatus")); + selector.addMaybeLike("operatorCode", request.getParameter("operatorCode")); + + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + if (orgId > 0) + { + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org != null && org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesDispatchProperty.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + request.setAttribute("typeMap", DesignTypeDao.mapAll()); + request.setAttribute("industryMap", Global.get(DesignIndustryCache.class).mapAll()); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + List operatorList = new ArrayList(); + List orgList = OperatorDao.getOperatorOrgList(request, request.getSessionName(), false); + if (orgList.size() > 0) + { + operatorList = OperatorDao.getOrgOperatorAllList(orgList.get(0).getOrgId()); + } + + request.setAttribute("orgList", orgList); + request.setAttribute("operatorList", operatorList); + + // 查找店铺 + request.setAttribute("shopList", ParamDao.doGetShopNameParam()); + } + + @Override + @AnTransaction + protected void insert(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode"); + int designerLevel = request.getParameterInt("designerLevel"); + + long majorType = request.getParameterLong("majorType"); + String secondaryTypesVals = request.getParameter("secondaryTypes", ""); + long majorIndustry = request.getParameterLong("majorIndustry"); + String secondaryIndustryVals = request.getParameter("secondaryIndustry", ""); + String shopNick = request.getParameter("shopNick"); + boolean isDesignOrder = request.getParameterBoolean("isDesignOrder"); + boolean isDraftOrder = request.getParameterBoolean("isDraftOrder"); + boolean isNormDraftOrder = request.getParameterBoolean("isNormDraftOrder"); + boolean isHighQualityOrder = request.getParameterBoolean("isHighQualityOrder"); + int count = ORM.get(ZTable.class).count(DesDispatchProperty.class, new Selector("operatorCode", operatorCode)); + if (count > 0) + { + request.setResponseError("设计师已经关联了派单属性"); + request.returnHistory(); + return; + } + + List typeList = Lists.toStringList(secondaryTypesVals); + if (!typeList.contains("" + majorType)) + { + typeList.add("" + majorType); + } + + List industryList = Lists.toStringList(secondaryIndustryVals); + if (!industryList.contains("" + majorIndustry)) + { + industryList.add("" + majorIndustry); + } + + DesDispatchProperty prop = new DesDispatchProperty(); + prop.setCreateTime(Sqls.nowTimestamp()); + prop.setUpdateTime(Sqls.nowTimestamp()); + prop.setMajorType(majorType); + prop.setSecondaryTypes(Lists.toString(typeList)); + prop.setMajorIndustry(majorIndustry); + prop.setSecondaryIndustrys(Lists.toString(industryList)); + prop.setOperatorCode(operatorCode); + prop.setOrgId(ZmrOperatorDao.getOperator(request, operatorCode).getOrgId()); + prop.setDesignerLevel(designerLevel); + prop.setShopNick(Strings.trim(shopNick)); + prop.setDesignOrder(isDesignOrder); + prop.setDraftOrder(isDraftOrder); + prop.setNormDraftOrder(isNormDraftOrder); + prop.setHighQualityOrder(isHighQualityOrder); + + ORM.get(ZTable.class).insert(prop); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode"); + + DesDispatchProperty dispatchProperty = ORM.get(ZTable.class).item(DesDispatchProperty.class, new Selector("operatorCode", operatorCode)); + request.setAttribute("dispatchProperty", dispatchProperty); + // 查找店铺 + request.setAttribute("shopList", ParamDao.doGetShopNameParam()); + } + + @Override + @AnTransaction + protected void update(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode"); + int designerLevel = request.getParameterInt("designerLevel"); + + long majorType = request.getParameterLong("majorType"); + String secondaryTypesVals = request.getParameter("secondaryTypes", ""); + long majorIndustry = request.getParameterLong("majorIndustry"); + String secondaryIndustryVals = request.getParameter("secondaryIndustry", ""); + String shopNick = request.getParameter("shopNick"); + boolean isDesignOrder = request.getParameterBoolean("isDesignOrder"); + boolean isDraftOrder = request.getParameterBoolean("isDraftOrder"); + boolean isNormDraftOrder = request.getParameterBoolean("isNormDraftOrder"); + boolean isHighQualityOrder = request.getParameterBoolean("isHighQualityOrder"); + boolean isUrgent = request.getParameterBoolean("isUrgent"); + + List typeList = Lists.toStringList(secondaryTypesVals); + if (!typeList.contains("" + majorType)) + { + typeList.add("" + majorType); + } + + List industryList = Lists.toStringList(secondaryIndustryVals); + if (!industryList.contains("" + majorIndustry)) + { + industryList.add("" + majorIndustry); + } + Updater updater = new Updater(); + updater.addMust("operatorCode", operatorCode); + updater.addField("majorType", majorType); + updater.addField("secondaryTypes", Lists.toString(typeList)); + updater.addField("majorIndustry", majorIndustry); + updater.addField("secondaryIndustrys", Lists.toString(industryList)); + updater.addField("designerLevel", designerLevel); + updater.addField("updateTime", Sqls.nowTimestamp()); + updater.addField("shopNick", Strings.trim(shopNick)); + updater.addField("isDesignOrder", isDesignOrder); + updater.addField("isDraftOrder", isDraftOrder); + updater.addField("isNormDraftOrder", isNormDraftOrder); + updater.addField("isHighQualityOrder", isHighQualityOrder); + updater.addField("isUrgent", isUrgent); + + ORM.get(ZTable.class).update(DesDispatchProperty.class, updater); + } + + @Override + @AnTransaction + protected void delete(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode"); + ORM.get(ZTable.class).delete(DesDispatchProperty.class, operatorCode); + ORM.get(ZTable.class).delete(DesOnline.class, operatorCode); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DispatchStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DispatchStatAction.java new file mode 100644 index 0000000..1e9eefc --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DispatchStatAction.java @@ -0,0 +1,132 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.dispatch; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.model.DispatchStatModel; + +public class DispatchStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getDateString()); + // String endDate = request.getParameter("endDate", DateTimes.getDateString()); + request.setAttribute("beginDate", beginDate); + // request.setAttribute("endDate", endDate); + // int day = DateTimes.compareDay(endDate, beginDate); + // if (day > 0) + // { + // request.setResponseError("请勿将时间区间跨度选择大于一天"); + // return; + // } + Selector sel = new Selector(); + sel.addMaybeThenGE("designReceiveTime", Sqls.toTimestamp(beginDate, "00:00:00")); + sel.addMaybeThenLE("designReceiveTime", Sqls.toTimestamp(beginDate, "23:59:59")); + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, sel); + + int sumCount = orderList.size(); // 总单数 + int contendOrder = 0; + int dispatchCount = 0; // 自动派发订单数 + int assignCount = 0; // 手工指定订单数 + + String cards = ZmrParamDao.getParam(request.getContext(), "yangcai.design", "card").getParamValue(); + String colorPages = ZmrParamDao.getParam(request.getContext(), "yangcai.design", "colorPage").getParamValue(); + + Map map = new HashMap(); + for (DesignOrder ord : orderList) + { + DispatchStatModel temp = map.get(ord.getOrgId()); + if (temp == null) + { + temp = new DispatchStatModel(); + } + + temp.setOrgId(ord.getOrgId()); + temp.setOrderNum(temp.getOrderNum() + 1); + + if (Lists.toLongList(cards).contains(ord.getTypeId())) + { + temp.setCardNum(temp.getCardNum() + 1); // 名片类 + if (1 == ord.getTypeId())// 名片 + { + temp.setOnlyCardNum(temp.getOnlyCardNum() + 1); + } + } + else if (Lists.toLongList(colorPages).contains(ord.getTypeId())) + { + temp.setColorPageNum(temp.getColorPageNum() + 1); // 彩页类 + if (2 == ord.getTypeId())// 彩页 + { + temp.setOnlyColorPageNum(temp.getOnlyColorPageNum() + 1); + } + } + else + { + temp.setOtherNum(temp.getOtherNum() + 1); + } + + map.put(ord.getOrgId(), temp); + + if (ord.getReceiveType() == 0) + { + contendOrder++; + } + + if (ord.getReceiveType() == 1) + { + dispatchCount++; + } + else if (ord.getReceiveType() == 2) + { + assignCount++; + } + } + + // 组织列表 + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class); + for (DispatchStatModel dis : map.values()) + { + for (ZmrOrg org : orgList) + { + if (dis.getOrgId() == org.getOrgId()) + { + dis.setOrgName(org.getOrgName()); + map.put(dis.getOrgId(), dis); + } + } + } + + request.setAttribute("sumCount", sumCount); + request.setAttribute("contendOrder", contendOrder); + request.setAttribute("assignCount", assignCount); + request.setAttribute("dispatchCount", dispatchCount); + request.setAttribute("map", map); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DispatchWaitStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DispatchWaitStatAction.java new file mode 100644 index 0000000..938b920 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/DispatchWaitStatAction.java @@ -0,0 +1,109 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.dispatch; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.model.DispatchStatModel; + +/** + * 已分拣待派发 + * + * @version v1.0.0 @author zzy 2018-9-11 新建与整理 + */ +public class DispatchWaitStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + Selector sel = new Selector(); + sel.addMust("status", StatusConstants.ORDER_20.value()); + sel.addMustIsNotNull("orgId"); + sel.addMustNotEqual("orgId", 0); + sel.addMustThenGE("draftType", DraftConstants.DRAFT_COMMON_DESIGN.value()); + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, sel); + + int sumCount = orderList.size(); // 总单数 + String cards = ZmrParamDao.getParam(request.getContext(), "yangcai.design", "card").getParamValue(); + String colorPages = ZmrParamDao.getParam(request.getContext(), "yangcai.design", "colorPage").getParamValue(); + + Map map = new HashMap(); + for (DesignOrder ord : orderList) + { + DispatchStatModel temp = map.get(ord.getOrgId()); + if (temp == null) + { + temp = new DispatchStatModel(); + } + + temp.setOrgId(ord.getOrgId()); + temp.setOrderNum(temp.getOrderNum() + 1); + + if (Lists.toLongList(cards).contains(ord.getTypeId())) + { + temp.setCardNum(temp.getCardNum() + 1); // 名片类 + if (1 == ord.getTypeId())// 名片 + { + temp.setOnlyCardNum(temp.getOnlyCardNum() + 1); + } + } + else if (Lists.toLongList(colorPages).contains(ord.getTypeId())) + { + temp.setColorPageNum(temp.getColorPageNum() + 1); // 彩页类 + if (2 == ord.getTypeId())// 彩页 + { + temp.setOnlyColorPageNum(temp.getOnlyColorPageNum() + 1); + } + } + else + { + temp.setOtherNum(temp.getOtherNum() + 1); + } + + map.put(ord.getOrgId(), temp); + + } + + // 组织列表 + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class); + for (DispatchStatModel dis : map.values()) + { + for (ZmrOrg org : orgList) + { + if (dis.getOrgId() == org.getOrgId()) + { + dis.setOrgName(org.getOrgName()); + map.put(dis.getOrgId(), dis); + } + } + } + + request.setAttribute("sumCount", sumCount); + request.setAttribute("map", map); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/MerDispatchLogAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/MerDispatchLogAction.java new file mode 100644 index 0000000..4e026cf --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/MerDispatchLogAction.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.dispatch; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.dispatch.DesMerDispatchLog; + +/** + * + * 派单日志 + * + * @version v1.0.0 @author Deng 2017-8-21 新建与整理 + */ +public class MerDispatchLogAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 20; + + String destime = request.getParameter("destime", DateTimes.getDateString()); + long designId = request.getParameterLong("designId"); + designId = designId != -1 ? designId : request.getParameterLong("oid"); + Selector selector = new Selector(); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + if (orgId > 0) + { + ZmrOrg org = request.getContextAttribute(ZmrBootstrap.class).table().item(ZmrOrg.class, orgId); + if (org != null && org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + } + + selector.addOrderbyDesc("desTime"); + selector.addMaybe("designId", designId); + + if (Validates.isNotEmpty(destime)) + { + selector.addMaybeThenGE("desTime", Sqls.toTimestamp(destime, "00:00:00")); + selector.addMaybeThenLE("desTime", Sqls.toTimestamp(destime, "23:59:59")); + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesMerDispatchLog.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/NoticeLogAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/NoticeLogAction.java new file mode 100644 index 0000000..40d570e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/NoticeLogAction.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.dispatch; + +import java.sql.Timestamp; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.dispatch.DesNoticeLog; + +public class NoticeLogAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 15; + + Selector selector = new Selector(); + + String search = request.getParameter("search"); + if (Validates.isNotEmpty(search) && "0001".equals(search)) + { + String noticeTime = request.getParameter("noticeTime"); + String keyWord = request.getParameter("keyWord"); + request.setAttribute("noticeTime", noticeTime); + request.setAttribute("keyWord", keyWord); + + if (Validates.isNotEmpty(noticeTime)) + { + String noticeTimeStart = noticeTime + " 00:00:00.0"; + String noticeTimeEnd = noticeTime + " 23:59:59.999"; + selector.addMustThenGE("noticeTime", Timestamp.valueOf(noticeTimeStart)); + selector.addMustThenLE("noticeTime", Timestamp.valueOf(noticeTimeEnd)); + } + + if (Validates.isNotEmpty(keyWord)) + { + selector.addMustLike("keyWord", keyWord); + } + + } + selector.addOrderbyDesc("noticeTime"); + PageResult pageResult = ORM.get(ZTable.class).page(DesNoticeLog.class, page, pageSize,selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/OnlineLogAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/OnlineLogAction.java new file mode 100644 index 0000000..2120144 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/OnlineLogAction.java @@ -0,0 +1,60 @@ +package com.zhiqim.yangcai.design.action.dispatch; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.dispatch.DesOnline; + +/** + * 在线设计师 + * + * @version v1.0.0 @author Deng 2018-1-3 新建与整理 + * @version V1.1 @author caohong 2021-5-13 优化设计师订单数量逻辑 + */ +public class OnlineLogAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = 20; + + String operatorCode = request.getParameter("operatorCode"); + int onlineStatus = request.getParameterInt("onlineStatus", -1); + + Selector selector = new Selector(); + selector.addOrderbyDesc("onlineStatus").addOrderbyDesc("lastDraftTime"); + + if (Validates.isNotEmpty(operatorCode)) + { + selector.addMust("operatorCode", operatorCode); + } + if (onlineStatus != -1) + { + selector.addMust("onlineStatus", onlineStatus); + } + PageResult pageResult = ORM.get(ZTable.class).page(DesOnline.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + request.setAttribute("operatorCode", operatorCode); + request.setAttribute("onlineStatus", onlineStatus); + Map typeMap = new HashMap(); + List typeList = DesignTypeDao.listAll(); + for (DesignType designType : typeList) + { + typeMap.put(designType.getTypeId(), designType); + } + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/WaitDisDesignerGroupOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/WaitDisDesignerGroupOrderAction.java new file mode 100644 index 0000000..f7d2ad2 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/WaitDisDesignerGroupOrderAction.java @@ -0,0 +1,67 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.dispatch; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/**** + * 等待分拣的设计师组订单列表 + * + * @version v1.0.0 @author longguizhi 2018-11-26 新建与整理 + */ +public class WaitDisDesignerGroupOrderAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 20; + + long designId = request.getParameterLong("designId"); + int draftType = request.getParameterInt("draftType"); + + Selector selector = new Selector(); + if (designId != -1) + { + selector.addMust("designId", designId); + } + + if (draftType != -1) + { + selector.addMust("draftType", draftType); + } + + selector.addMust("status", 10); + selector.addOrderbyDesc("createTime"); + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + + request.setAttribute("pageResult", pageResult); + + if (designId != -1) + { + request.setAttribute("designId", designId); + } + if (draftType != -1) + { + request.setAttribute("draftType", draftType); + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/WaitDisMerOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/WaitDisMerOrderAction.java new file mode 100644 index 0000000..a6e5d68 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/WaitDisMerOrderAction.java @@ -0,0 +1,69 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.dispatch; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/**** + * 等待分拣列表 + * + * @version v1.0.0 @author longguizhi 2018-11-26 新建与整理 + */ +public class WaitDisMerOrderAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 20; + + long designId = request.getParameterLong("designId"); + long industryId = request.getParameterLong("industryId"); + + Selector selector = new Selector(); + if (designId != -1) + { + selector.addMust("designId", designId); + } + + if (industryId != -1) + { + selector.addMust("industryId", industryId); + } + + selector.addMust("status", StatusConstants.ORDER_10.value()); + + selector.addOrderbyAsc("createTime"); + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("industryId", industryId); + + if (designId != -1) + { + request.setAttribute("designId", designId); + } + + request.setAttribute("industryMap", Global.get(DesignIndustryCache.class).mapAll()); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/WaitDisOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/WaitDisOrderAction.java new file mode 100644 index 0000000..52bdb18 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/WaitDisOrderAction.java @@ -0,0 +1,81 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.dispatch; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 待派订单 + * + * @version v1.0.0 @author Deng 2018-4-25 新建与整理 + */ +public class WaitDisOrderAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 20; + + long designId = request.getParameterLong("designId"); + long industryId = request.getParameterLong("industryId"); + + Selector selector = new Selector(); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + if (orgId > 0) + { + ZmrOrg org = request.getContextAttribute(ZmrBootstrap.class).table().item(ZmrOrg.class, orgId); + if (org != null && org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + } + if (designId != -1) + { + selector.addMust("designId", designId); + } + + if (industryId != -1) + { + selector.addMust("industryId", industryId); + } + + selector.addMust("status", StatusConstants.ORDER_20.value()); + + selector.addOrderbyAsc("createTime"); + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("industryId", industryId); + + if (designId != -1) + { + request.setAttribute("designId", designId); + } + request.setAttribute("industryMap", Global.get(DesignIndustryCache.class).mapAll()); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/WorkSearchLogAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/WorkSearchLogAction.java new file mode 100644 index 0000000..8cbe339 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dispatch/WorkSearchLogAction.java @@ -0,0 +1,60 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.dispatch; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.dispatch.DesWorkSearchLog; + +/** + * 派单日志 + * + * @version v1.0.0 @author Deng 2018-4-25 新建与整理 + */ +public class WorkSearchLogAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 20; + + String operatorCode = request.getParameter("operatorCode"); + String startDate = DateTimes.getPreviousDateString(7); + String endDate = DateTimes.getDateString(); + Selector selector = new Selector(); + selector.addOrderbyDesc("createTime"); + + selector.addMaybeThenGE("createTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMaybeThenLE("createTime", Sqls.toTimestamp(endDate, "23:59:59")); + if (Validates.isNotEmpty(operatorCode)) + { + selector.addMust("operatorCode", operatorCode); + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesWorkSearchLog.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + + request.setAttribute("operatorCode", operatorCode); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dzmpsupport/DzmpSupportAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dzmpsupport/DzmpSupportAction.java new file mode 100644 index 0000000..39756af --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dzmpsupport/DzmpSupportAction.java @@ -0,0 +1,217 @@ +package com.zhiqim.yangcai.design.action.dzmpsupport; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.media.dbo.dzmp.DzmpImageStorage; +import com.zhiqim.media.dbo.dzmp.DzmpUserCardStorage; +import com.zhiqim.media.manage.model.DzmpImageModel; +import com.zhiqim.media.manage.utils.CollectionUtils; +import com.zhiqim.yangcai.design.dbo.dzmpsupport.DzmpDesignElement; + +/** + * 电子名片支持接口
            + * + * @author HuangZhiGao + * @date 2020年7月16日 下午2:28:16 + */ +public class DzmpSupportAction extends StdSwitchAction implements ZmrConstants +{ + private static final Log log = LogFactory.getLog(DzmpSupportAction.class); + private static Map resultMap = new HashMap(6); + + /** + * 校验参数[id必须传入] + */ + private Boolean checkParams(HttpRequest request) throws Exception + { + HttpResponse response = request.getResponse(); + String id = request.getParameter("id"); + if (Validates.isEmpty(id)) + { + resultMap.clear(); + resultMap.put("error", Boolean.TRUE); + resultMap.put("errorMsg", "请求参数错误,必须携带id参数"); + String result = Jsons.toString(resultMap); + response.print(result); + return Boolean.FALSE; + } + return Boolean.TRUE; + } + + /** + * 电子名片小程序:查询电子名片设计元素json字符串
            + * GET请求,参数id放在URL中 + */ + @Override + public void list(HttpRequest request) + { + + try + { + if (!checkParams(request)) + { + return; + } + + HttpResponse response = request.getResponse(); + String id = request.getParameter("id"); + String result; + resultMap.clear(); + + /** 设计平台电子名片版式布局信息 **/ + DzmpDesignElement cardLayout = ORM.get(ZTable.class).item(DzmpDesignElement.class, new Selector("id", id)); + /** 设计平台电子名片信息 **/ + DzmpUserCardStorage cardStorage = ORM.get(ZTable.class).item(DzmpUserCardStorage.class, new Selector("id", Long.parseLong(id))); + /** 设计平台名片关联的个人相册图片 **/ + List albumList = ORM.get(ZTable.class).list(DzmpImageStorage.class, + new Selector("userCardId", Long.parseLong(id)).addMust("type", 1).addOrderbyAsc("sort")); + List imageList = new ArrayList(); + for (DzmpImageStorage album : albumList) + { + if (Validates.isNotEmpty(album)) + { + DzmpImageModel dzmpImageModel = new DzmpImageModel(); + dzmpImageModel.setType(album.getType()); + dzmpImageModel.setUserCardId(Long.parseLong(id)); + dzmpImageModel.setImgUrl(album.getImgUrl()); + imageList.add(dzmpImageModel); + } + } + + if (Validates.isNotEmpty(cardLayout)) + { + resultMap.put("error", Boolean.FALSE); + resultMap.put("cardLayoutInfo", cardLayout); + } + if (Validates.isNotEmpty(cardStorage)) + { + resultMap.put("error", Boolean.FALSE); + resultMap.put("cardInfo", cardStorage); + } + if (!CollectionUtils.isEmpty(imageList)) + { + resultMap.put("error", Boolean.FALSE); + resultMap.put("cardAlbums", imageList); + } + + if (Validates.isEmpty(cardLayout) && Validates.isEmpty(cardStorage)) + { + resultMap.put("error", Boolean.TRUE); + resultMap.put("errorMsg", "设计平台电子名片信息不存在,id为[" + id + "]"); + } + result = Jsons.toString(resultMap); + response.print(result); + return; + } + catch (Exception e) + { + log.error("电子名片小程序调用查询电子名片设计元素json字符串异常:" + e.getMessage()); + } + } + + /** + * 电子名片小程序:编辑电子名片设计元素json字符串
            + * POST请求,参数id放在URL中,参数eleJson放在请求体body里面
            + * Content-Type设置为application/json
            + */ + @Override + protected void update(HttpRequest request) + { + try + { + if (!checkParams(request)) + { + return; + } + + HttpResponse response = request.getResponse(); + String id = request.getParameter("id"); + String jsonStr = request.getInputStreamString(); + jsonStr = Jsons.getString(jsonStr, "eleJson"); + + String result; + resultMap.clear(); + if (Validates.isEmpty(jsonStr)) + { + resultMap.put("error", Boolean.TRUE); + resultMap.put("errorMsg", "请求参数错误,设计元素json字符串不能为空"); + result = Jsons.toString(resultMap); + response.print(result); + return; + } + + DzmpDesignElement item = ORM.get(ZTable.class).item(DzmpDesignElement.class, new Selector("id", id)); + if (Validates.isEmpty(item)) + { + resultMap.put("error", Boolean.TRUE); + resultMap.put("errorMsg", "电子名片设计元素json字符串不存在,id为[" + id + "]"); + result = Jsons.toString(resultMap); + response.print(result); + return; + } + Updater updater = new Updater(); + updater.addMust("id", id); + updater.addField("eleJson", jsonStr); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DzmpDesignElement.class, updater); + + resultMap.put("error", Boolean.FALSE); + resultMap.put("successMsg", "修改成功"); + result = Jsons.toString(resultMap); + response.print(result); + return; + } + catch (Exception e) + { + log.error("电子名片小程序调用编辑电子名片设计元素json字符串异常:" + e.getMessage()); + } + } + + @Override + protected void validateId(HttpRequest request) throws Exception + { + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + } + + @Override + protected void add(HttpRequest request) throws Exception + { + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dzmpsupport/DzmpUserBindCardAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dzmpsupport/DzmpUserBindCardAction.java new file mode 100644 index 0000000..21903af --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/dzmpsupport/DzmpUserBindCardAction.java @@ -0,0 +1,319 @@ +package com.zhiqim.yangcai.design.action.dzmpsupport; + +import java.math.BigDecimal; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.alibaba.fastjson.JSON; +import com.zhiqim.media.dbo.dzmp.DzmpImageStorage; +import com.zhiqim.media.dbo.dzmp.DzmpUserCardStorage; +import com.zhiqim.media.manage.model.DzmpImageModel; +import com.zhiqim.media.manage.model.DzmpUserCardModel; +import com.zhiqim.media.manage.utils.CollectionUtils; +import com.zhiqim.media.manage.utils.DzmpServiceClientUtil; +import com.zhiqim.media.manage.utils.QiyeWechatUtil; +import com.zhiqim.media.service.dao.DzmpUserCardStorageDao; + +/** + * 电子名片用户绑定设计平台名片相关信息接口
            + * + * @author HuangZhiGao + * @date 2020年11月25日 下午3:11:51 + */ +public class DzmpUserBindCardAction implements Action +{ + private static final Log log = LogFactory.getLog(DzmpUserBindCardAction.class); + private static Map resultMap = new HashMap(2); + + @Override + public void execute(HttpRequest request) + { + long cardId = request.getParameterLong("cardId"); + long userId = request.getParameterLong("userId"); + if (cardId < 0) + { + resultMap.clear(); + resultMap.put("error", Boolean.TRUE); + resultMap.put("errorMsg", "请求参数错误,必须携带cardId参数"); + return; + } + if (userId < 0) + { + resultMap.clear(); + resultMap.put("error", Boolean.TRUE); + resultMap.put("errorMsg", "请求参数错误,必须携带userId参数"); + return; + } + + try + { + // 查询设计平台电子名片 + DzmpUserCardStorage cardStorage = ORM.get(ZTable.class).item(DzmpUserCardStorage.class, new Selector("id", cardId)); + if (Validates.isEmpty(cardStorage)) + { + resultMap.clear(); + resultMap.put("error", Boolean.TRUE); + resultMap.put("errorMsg", "设计平台不存在[" + cardId + "]名片"); + return; + } + + // 更新设计平台电子名片信息 + String data = request.getInputStreamString(); + String jsonStr = Jsons.getString(data, "jsonData"); + DzmpUserCardStorage updateCardStorage = JSON.parseObject(jsonStr, DzmpUserCardStorage.class); + if (Validates.isNotEmpty(updateCardStorage)) + { + updateCardInfo(updateCardStorage, cardId); + } + + cardStorage = ORM.get(ZTable.class).item(DzmpUserCardStorage.class, new Selector("id", cardId)); + // 电子名片用户绑定设计平台名片信息及其关联的个人相册图片信息 + bindCard(cardStorage, userId); + + HttpResponse response = request.getResponse(); + resultMap.clear(); + resultMap.put("error", Boolean.FALSE); + String result = Jsons.toString(resultMap); + response.print(result); + } + catch (Exception e) + { + String tempMsg = "电子名片用户绑定设计平台名片信息异常:" + e.getMessage(); + log.error(tempMsg); + QiyeWechatUtil.sendMsgToQiyeWechat(tempMsg); + } + return; + } + + /** + * 更新设计平台电子名片信息
            + * + * @param cardStorage + * @return void + * @author HuangZhiGao + * @throws SQLException + * @throws ORMException + * @date 2020年11月25日 下午5:06:29 + */ + private static void updateCardInfo(DzmpUserCardStorage cardStorage, long cardId) throws ORMException, SQLException + { + Updater updater = new Updater(); + updater.addMust("id", cardId); + if (Validates.isNotEmpty(cardStorage.getUserCardName())) + { + updater.addField("userCardName", cardStorage.getUserCardName()); + } + if (Validates.isNotEmpty(cardStorage.getUserRemark())) + { + updater.addField("userRemark", cardStorage.getUserRemark()); + } + if (Validates.isNotEmpty(cardStorage.getCompanyAlias())) + { + updater.addField("companyAlias", cardStorage.getCompanyAlias()); + } + if (Validates.isNotEmpty(cardStorage.getPosition())) + { + updater.addField("position", cardStorage.getPosition()); + } + if (Validates.isNotEmpty(cardStorage.getCardUrl())) + { + updater.addField("cardUrl", cardStorage.getCardUrl()); + } + if (Validates.isNotEmpty(cardStorage.getRegion())) + { + updater.addField("region", cardStorage.getRegion()); + } + if (Validates.isNotEmpty(cardStorage.getCity())) + { + updater.addField("city", cardStorage.getCity()); + } + if (Validates.isNotEmpty(cardStorage.getDistrict())) + { + updater.addField("district", cardStorage.getDistrict()); + } + if (Validates.isNotEmpty(cardStorage.getAddress())) + { + updater.addField("address", cardStorage.getAddress()); + } + if (Validates.isNotEmpty(cardStorage.getLatitude())) + { + updater.addField("latitude", cardStorage.getLatitude()); + } + if (Validates.isNotEmpty(cardStorage.getLongitude())) + { + updater.addField("longitude", cardStorage.getLongitude()); + } + if (Validates.isNotEmpty(cardStorage.getWxcode())) + { + updater.addField("wxcode", cardStorage.getWxcode()); + } + if (Validates.isNotEmpty(cardStorage.getUserQq())) + { + updater.addField("userQq", cardStorage.getUserQq()); + } + if (Validates.isNotEmpty(cardStorage.getUserEmail())) + { + updater.addField("userEmail", cardStorage.getUserEmail()); + } + if (Validates.isNotEmpty(cardStorage.getMobile())) + { + updater.addField("mobile", cardStorage.getMobile()); + } + if (Validates.isNotEmpty(cardStorage.getLandline())) + { + updater.addField("landline", cardStorage.getLandline()); + } + if (Validates.isNotEmpty(cardStorage.getUserFax())) + { + updater.addField("userFax", cardStorage.getUserFax()); + } + if (Validates.isNotEmpty(cardStorage.getWebsiteUrl())) + { + updater.addField("websiteUrl", cardStorage.getWebsiteUrl()); + } + if (Validates.isNotEmpty(cardStorage.getCardAvatar())) + { + updater.addField("cardAvatar", cardStorage.getCardAvatar()); + } + if (Validates.isNotEmpty(cardStorage.getCardBackground())) + { + updater.addField("cardBackground", cardStorage.getCardBackground()); + } + if (Validates.isNotEmpty(cardStorage.getCardBackgroundType())) + { + updater.addField("cardBackgroundType", cardStorage.getCardBackgroundType()); + } + if (Validates.isNotEmpty(cardStorage.getCardLayoutId())) + { + updater.addField("cardLayoutId", cardStorage.getCardLayoutId()); + } + if (Validates.isNotEmpty(cardStorage.getRemark())) + { + updater.addField("remark", cardStorage.getRemark()); + } + + updater.addField("updateOperatorCode", "0"); + updater.addField("updateTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(DzmpUserCardStorage.class, updater); + } + + /** + * 电子名片用户绑定设计平台名片信息
            + * + * @param cardStorage 设计平台名片信息 + * @param userId 电子名片用户id + * @return void + * @author HuangZhiGao + * @throws SQLException + * @throws ORMException + * @date 2020年11月25日 下午2:31:35 + */ + private static void bindCard(DzmpUserCardStorage cardStorage, long userId) throws ORMException, SQLException + { + // 组装数据 + DzmpUserCardModel dzmpUserCardModel = new DzmpUserCardModel(); + dzmpUserCardModel.setUserId(userId); + dzmpUserCardModel.setDesignId(cardStorage.getDesignId()); + dzmpUserCardModel.setUserCardName(cardStorage.getUserCardName()); + dzmpUserCardModel.setUserRemark(cardStorage.getUserRemark()); + dzmpUserCardModel.setCompanyAlias(cardStorage.getCompanyAlias()); + dzmpUserCardModel.setPosition(cardStorage.getPosition()); + dzmpUserCardModel.setCardUrl(cardStorage.getCardUrl()); + dzmpUserCardModel.setRegion(cardStorage.getRegion()); + dzmpUserCardModel.setCity(cardStorage.getCity()); + dzmpUserCardModel.setDistrict(cardStorage.getDistrict()); + dzmpUserCardModel.setAddress(cardStorage.getAddress()); + if (Validates.isNotEmpty(cardStorage.getLatitude())) + { + dzmpUserCardModel.setLatitude(new BigDecimal(cardStorage.getLatitude())); + } + if (Validates.isNotEmpty(cardStorage.getLongitude())) + { + dzmpUserCardModel.setLongitude(new BigDecimal(cardStorage.getLongitude())); + } + dzmpUserCardModel.setWxcode(cardStorage.getWxcode()); + dzmpUserCardModel.setUserQq(cardStorage.getUserQq()); + dzmpUserCardModel.setUserEmail(cardStorage.getUserEmail()); + dzmpUserCardModel.setMobile(cardStorage.getMobile()); + dzmpUserCardModel.setLandline(cardStorage.getLandline()); + dzmpUserCardModel.setUserFax(cardStorage.getUserFax()); + dzmpUserCardModel.setWebsiteUrl(cardStorage.getWebsiteUrl()); + dzmpUserCardModel.setCardAvatar(cardStorage.getCardAvatar()); + dzmpUserCardModel.setCardBackground(cardStorage.getCardBackground()); + dzmpUserCardModel.setCardBackgroundType(cardStorage.getCardBackgroundType()); + dzmpUserCardModel.setCardLayoutId(cardStorage.getCardLayoutId()); + dzmpUserCardModel.setRemark(cardStorage.getRemark()); + + // 在运营平台新建名片 + String newCardId = DzmpServiceClientUtil.doCreateCardInfo(dzmpUserCardModel); + if (Validates.isNotEmpty(newCardId)) + { + Updater updater = new Updater(); + updater.addMust("id", cardStorage.getId()); + updater.addMust("useState", DzmpUserCardStorageDao.USED);// 修改设计平台名片为已使用状态 + updater.addField("updateOperatorCode", "0"); + updater.addField("updateTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DzmpUserCardStorage.class, updater); + + // 在运营平台新建的名片绑定设计平台个人相册信息 + cardBindImages(newCardId, cardStorage.getId()); + } + } + + /** + * 在运营平台新建的名片绑定设计平台个人相册信息
            + * + * @param newCardId 运营平台名片id + * @param cardId 设计平台名片id + * @return void + * @author HuangZhiGao + * @throws SQLException + * @throws ORMException + * @date 2020年11月25日 下午2:37:39 + */ + private static void cardBindImages(String newCardId, long cardId) throws ORMException, SQLException + { + // 设计平台名片关联的个人相册图片 + List albumList = ORM.get(ZTable.class).list(DzmpImageStorage.class, new Selector("userCardId", cardId).addMust("type", 1)); + List imageList = new ArrayList(); + for (DzmpImageStorage album : albumList) + { + if (Validates.isNotEmpty(album)) + { + DzmpImageModel dzmpImageModel = new DzmpImageModel(); + dzmpImageModel.setType(album.getType()); + dzmpImageModel.setUserCardId(Long.parseLong(newCardId)); + dzmpImageModel.setImgUrl(album.getImgUrl()); + dzmpImageModel.setSort(album.getSort()); + imageList.add(dzmpImageModel); + } + } + + if (!CollectionUtils.isEmpty(imageList)) + { + LinkedHashMap jsonParamsMap = new LinkedHashMap(); + jsonParamsMap.put("drArr", imageList); + DzmpServiceClientUtil.doBatchCreateImageInfo(jsonParamsMap); + } + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/editor/BindingTypeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/editor/BindingTypeAction.java new file mode 100644 index 0000000..9a08e8f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/editor/BindingTypeAction.java @@ -0,0 +1,37 @@ +package com.zhiqim.yangcai.design.action.editor; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.editor.DesignPinlei; + +public class BindingTypeAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception { + // TODO Auto-generated method stub + long id = request.getParameterLong("id"); + if (id <= 0) + { + request.returnCloseDialog("品类【" + id + "】不存在,请重新选择!"); + return; + } + DesignPinlei designPinlei = ORM.get(ZTable.class).item(DesignPinlei.class, new Selector("id", id)); + if (designPinlei == null) + { + request.returnCloseDialog("品类【" + id + "】不存在,请重新选择!"); + return; + } + request.setAttribute("designPinlei", designPinlei); + List typeList = DesignTypeDao.listAll(); + request.setAttribute("typeList", typeList); + } +} \ No newline at end of file diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/editor/DesignPinleiAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/editor/DesignPinleiAction.java new file mode 100644 index 0000000..9fb1dd9 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/editor/DesignPinleiAction.java @@ -0,0 +1,110 @@ +package com.zhiqim.yangcai.design.action.editor; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.design.dbo.design.DesignSize; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.editor.DesignPinlei; +import com.zhiqim.yangcai.util.BusinessTbzBjqUtil; + +public class DesignPinleiAction extends StdSwitchAction +{ + + @Override + protected void add(HttpRequest request) throws Exception { + // TODO Auto-generated method stub + JSONArray jsonArray = BusinessTbzBjqUtil.getPinleiList(); + if(null == jsonArray) { + request.setResponseError("编辑器暂未配置上线品类"); + return; + } + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonobject = jsonArray.getJSONObject(i); + Long id = jsonobject.getLong("id"); + JSONObject jsonobject2 = jsonobject.getJSONObject("classify"); + String name = jsonobject2.getString("name"); + + DesignPinlei designPinlei1 = ORM.get(ZTable.class).item(DesignPinlei.class, new Selector().addMust("id", id)); + if(null == designPinlei1) {//不存在则新增 + DesignPinlei designPinlei = new DesignPinlei(); + designPinlei.setId(id); + designPinlei.setName(name); + ORM.get(ZTable.class).insert(designPinlei); + }else {//存在则修改 + Updater updater = new Updater(); + updater.addMust("id", id); + updater.addField("name", name); + ORM.get(ZTable.class).update(DesignPinlei.class, updater); + } + } + + } + + @Override + protected void delete(HttpRequest arg0) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + protected void insert(HttpRequest request) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + protected void list(HttpRequest request) throws Exception { + // TODO Auto-generated method stub + int page = request.getParameterInt("page"); + int pageSize = request.getParameterInt("pageSize", 15); + + Selector selector = new Selector(); + selector.addMaybeLike("name", request.getParameter("name")); + selector.addMaybe("id", request.getParameterLong("id")); + selector.addMaybeLike("typeName", request.getParameter("typeName")); + selector.addMaybe("typeId", request.getParameterLong("typeId")); + + PageResult pageResult = ORM.get(ZTable.class).page(DesignPinlei.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + } + + @Override + protected void modify(HttpRequest arg0) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + protected void update(HttpRequest arg0) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + protected void validateForm(HttpRequest arg0) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + protected void validateId(HttpRequest arg0) throws Exception { + // TODO Auto-generated method stub + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/editor/DiansanOrderDataAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/editor/DiansanOrderDataAction.java new file mode 100644 index 0000000..46a1576 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/editor/DiansanOrderDataAction.java @@ -0,0 +1,206 @@ +package com.zhiqim.yangcai.design.action.editor; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.server.DiansanService; +import com.zhiqim.yangcai.util.HttpDiansanResult; + +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +public class DiansanOrderDataAction implements Action { + private static final Log log = LogFactory.getLog(DiansanOrderDataAction.class); + + @Override + public void execute(HttpRequest request) throws Exception { + // 从请求体中获取json数据并存储 + HttpResponse response = request.getResponse(); + response.setContentType("text/json;charset=UTF-8"); + try { + log.info("当前请求点三请求开始"); + if (request.getMethod().equals("POST")) { + BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream())); + StringBuilder stringBuilder = new StringBuilder(); + String string; + while ((string = reader.readLine()) != null) { + stringBuilder.append(string); + } + reader.close(); + /* + * StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append( + * "{\"content\":{\"businessType\":\"GUARANTEE\",\"buyerMemo\":\"\",\"createTime\":1693133678000,\"discountFee\":0.0,\"finishTime\":1693547224000,\"flag\":\"RED\",\"lines\":[{\"num\":1,\"outerId\":\"\",\"picUrl\":\"https://img.alicdn.com/bao/uploaded/i1/2200824481996/O1CN01KSOqga1QcDLtvbVaf_!!2200824481996.jpg\",\"platServiceFee\":0.0,\"price\":24.0,\"refOlId\":\"3494539189817180103\",\"refSkuId\":\"4936288804241\",\"refSpuId\":\"696245994493\",\"refundStatus\":\"REFUNDED\",\"sellPrice\":24.0,\"singleFee\":24.0,\"standards\":\"90*54mm【包设计】,加厚铜版纸【不覆膜/易手写】,500张\",\"status\":\"CLOSE\",\"title\":\"外卖卡订餐卡名片定制餐饮快餐小吃送餐卡优惠券小卡片广告宣传代金券订制打印印刷定做卡片制作简奈旗舰店\",\"totalFee\":24.0,\"totalPrice\":24.0,\"totalSellPrice\":24.0}],\"logisticsOrderNo\":\"\",\"mark2\":[],\"modifyTime\":1693547586000,\"openBuyerId\":\"AAGxRHraABkUZRPgSx16Jde-\",\"openBuyerNick\":\"fnn闹闹\",\"openSellerNick\":\"简奈旗舰店\",\"orderSource\":\"SYNC\",\"orderTime\":1693133437000,\"payTime\":1693133500000,\"payment\":24.0,\"platServiceFee\":0.0,\"posCode\":\"简奈旗舰店\",\"postFee\":0.0,\"props\":{},\"receivedPayment\":0.0,\"receiverCity\":\"固原市\",\"receiverCountry\":\"中国\",\"receiverDistrict\":\"西吉县\",\"receiverId\":\"357de481dbd94ff0c2d8acaf0cfffd4f$\",\"receiverState\":\"宁夏回族自治区\",\"receiverTown\":\"吉强镇\",\"refOid\":\"3494539189817180103\",\"refType\":\"TMALL\",\"refundStatus\":\"ALL_REFUNDED\",\"sellerMemo\":\"待提供销毁图\",\"serviceFee\":0.0,\"shippingTime\":1693233912000,\"status\":\"CLOSE\",\"totalFee\":24.0,\"totalPrice\":24.0,\"totalSellPrice\":24.0,\"type\":\"SALE\"}}" + * ); + */ + HashMap map = new HashMap(); + // 将json参数转成map + map = (HashMap) JSON.parseObject(stringBuilder.toString(), Map.class); + + String content = JSON.toJSONString(map.get("content")); + JSONObject json = JSONObject.parseObject(content); + String tid = json.getString("refOid");//淘宝订单号 + String status = json.getString("status");//订单状态 + String refundStatus = json.getString("refundStatus");//订单售后状态 + if("PART_REFUNDED".equals(refundStatus)) {//部分退款 + Selector selector = new Selector(); + selector.addMaybeLike("tids", tid); + List list = ORM.get(ZTable.class).list(DesignOrder.class, selector); + if(0 == list.size()) {//如果没有根据这个订单查到数据 + log.error("点三订单数据推送错误:设计平台未找到淘宝订单【" + tid + "】"); + HttpDiansanResult result = new HttpDiansanResult(); + result.setSuccess(false); + result.setTimestamp(System.currentTimeMillis()); + result.setMsg("点三订单数据推送错误:设计平台未找到淘宝订单【" + tid + "】"); + result.setCode(500); + result.setData(""); + response.getOutputStream().write(JSON.toJSONString(result).getBytes("UTF-8")); + return; + } + for (DesignOrder designOrder:list) { + Updater updater = new Updater(); + updater.addMust("designId", designOrder.getDesignId()); + updater.addField("returnMsg", "淘宝该订单部分退款,请联系客服确认此单"); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + OrderLogDao.saveOrderOperateLog(designOrder.getDesignId(), "系统", "点三系统推送订单数据部分退款", 34);// 保存日志 + } + + }else if("ALL_REFUNDED".equals(refundStatus)){//全部退款 + Selector selector = new Selector(); + selector.addMaybeLike("tids", tid); + List list = ORM.get(ZTable.class).list(DesignOrder.class, selector); + if(0 == list.size()) {//如果没有根据这个订单查到数据 + log.error("点三订单数据推送错误:设计平台未找到淘宝订单【" + tid + "】"); + HttpDiansanResult result = new HttpDiansanResult(); + result.setSuccess(false); + result.setTimestamp(System.currentTimeMillis()); + result.setMsg("点三订单数据推送错误:设计平台未找到淘宝订单【" + tid + "】"); + result.setCode(500); + result.setData(""); + response.getOutputStream().write(JSON.toJSONString(result).getBytes("UTF-8")); + return; + } + for (DesignOrder designOrder:list) { + boolean isStatus10 = false; + //如果已取消或者到了请求退款,就不操作这条数据 + if(designOrder.getStatus() == StatusConstants.ORDER_34.value() || designOrder.getStatus() == StatusConstants.ORDER_F100.value()) { + continue; + } + if(designOrder.getStatus() == StatusConstants.ORDER_10.value()) {//如果是未分拣的,就直接退货完成 + isStatus10 = true; + } + String tids = designOrder.getTids(); + String[] tidArr = tids.split(","); + if(tidArr.length > 1) {//如果还有别的订单,就要去查下另外的订单是否都已经退款 + DesignOrder designOrder1 = DiansanService.designOrderReturn(tids); + if(null != designOrder1) { + Updater exUpdater = new Updater(); + exUpdater.addMust("designId", designOrder.getDesignId()); + if(0 != designOrder1.getStatus() && designOrder1.getStatus() >= 10) { + if(isStatus10) { + exUpdater.addField("status", StatusConstants.ORDER_F100.value()); + }else { + exUpdater.addField("status", designOrder1.getStatus()); + } + } + //原来的状态也记录下来 + if(designOrder.getReturnAfterStatus() > 0 ) { + + }else { + exUpdater.addField("returnAfterStatus", designOrder.getStatus()); + } + exUpdater.addField("returnMsg", designOrder1.getReturnMsg()); + exUpdater.addField("returnMsgTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, exUpdater); + } + }else {//如果只有自己,直接退货处理 + Updater updater = new Updater(); + updater.addMust("designId", designOrder.getDesignId()); + if(isStatus10) { + updater.addField("status", StatusConstants.ORDER_F100.value()); + }else { + updater.addField("status", StatusConstants.ORDER_34.value()); + } + //原来的状态也记录下来 + if(designOrder.getReturnAfterStatus() > 0 ) { + + }else { + updater.addField("returnAfterStatus", designOrder.getStatus()); + } + updater.addField("returnMsg", "淘宝已退款成功"); + updater.addField("returnMsgTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + } + OrderLogDao.saveOrderOperateLog(designOrder.getDesignId(), "系统", "点三系统推送订单数据全部退款", 34);// 保存日志 + } + + }else {//无事发生 + + } + + HttpDiansanResult result = new HttpDiansanResult(); + result.setSuccess(true); + result.setTimestamp(System.currentTimeMillis()); + result.setMsg("操作成功"); + result.setCode(200); + result.setData(""); + response.getOutputStream().write(JSON.toJSONString(result).getBytes("UTF-8")); + } else { + log.info("当前请求不是post请求"); + HttpDiansanResult result = new HttpDiansanResult(); + result.setSuccess(false); + result.setTimestamp(System.currentTimeMillis()); + result.setMsg("操作失败,当前请求不是POST请求"); + result.setCode(500); + result.setData(""); + response.getOutputStream().write(JSON.toJSONString(result).getBytes("UTF-8")); + } + } catch (Exception e) { + // TODO: handle exception + e.printStackTrace(); + log.error("淘宝导入数据失败:" + e.getMessage()); + HttpDiansanResult result = new HttpDiansanResult(); + result.setSuccess(false); + result.setTimestamp(System.currentTimeMillis()); + result.setMsg("操作失败,出现异常"); + result.setCode(500); + result.setData(""); + response.getOutputStream().write(JSON.toJSONString(result).getBytes("UTF-8")); + } + + } + + + public static void main(String[] args) { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("{\"content\":{\"businessType\":\"GUARANTEE\",\"buyerMemo\":\"\",\"createTime\":1693133678000,\"discountFee\":0.0,\"finishTime\":1693547224000,\"flag\":\"RED\",\"lines\":[{\"num\":1,\"outerId\":\"\",\"picUrl\":\"https://img.alicdn.com/bao/uploaded/i1/2200824481996/O1CN01KSOqga1QcDLtvbVaf_!!2200824481996.jpg\",\"platServiceFee\":0.0,\"price\":24.0,\"refOlId\":\"3494539189817180103\",\"refSkuId\":\"4936288804241\",\"refSpuId\":\"696245994493\",\"refundStatus\":\"REFUNDED\",\"sellPrice\":24.0,\"singleFee\":24.0,\"standards\":\"90*54mm【包设计】,加厚铜版纸【不覆膜/易手写】,500张\",\"status\":\"CLOSE\",\"title\":\"外卖卡订餐卡名片定制餐饮快餐小吃送餐卡优惠券小卡片广告宣传代金券订制打印印刷定做卡片制作简奈旗舰店\",\"totalFee\":24.0,\"totalPrice\":24.0,\"totalSellPrice\":24.0}],\"logisticsOrderNo\":\"\",\"mark2\":[],\"modifyTime\":1693547586000,\"openBuyerId\":\"AAGxRHraABkUZRPgSx16Jde-\",\"openBuyerNick\":\"fnn闹闹\",\"openSellerNick\":\"简奈旗舰店\",\"orderSource\":\"SYNC\",\"orderTime\":1693133437000,\"payTime\":1693133500000,\"payment\":24.0,\"platServiceFee\":0.0,\"posCode\":\"简奈旗舰店\",\"postFee\":0.0,\"props\":{},\"receivedPayment\":0.0,\"receiverCity\":\"固原市\",\"receiverCountry\":\"中国\",\"receiverDistrict\":\"西吉县\",\"receiverId\":\"357de481dbd94ff0c2d8acaf0cfffd4f$\",\"receiverState\":\"宁夏回族自治区\",\"receiverTown\":\"吉强镇\",\"refOid\":\"3494539189817180103\",\"refType\":\"TMALL\",\"refundStatus\":\"ALL_REFUNDED\",\"sellerMemo\":\"待提供销毁图\",\"serviceFee\":0.0,\"shippingTime\":1693233912000,\"status\":\"CLOSE\",\"totalFee\":24.0,\"totalPrice\":24.0,\"totalSellPrice\":24.0,\"type\":\"SALE\"}}"); + + HashMap map = new HashMap(); + + // 将json参数转成map + map = (HashMap) JSON.parseObject(stringBuilder.toString(), Map.class); + String content = JSON.toJSONString(map.get("content")); + JSONObject json = JSONObject.parseObject(content); + String designId = json.getString("refOid"); + String status = json.getString("status"); + + String refundStatus = json.getString("refundStatus"); + System.out.println("点三map:" + map.toString()); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/editor/GetDesignTypeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/editor/GetDesignTypeAction.java new file mode 100644 index 0000000..116f22e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/editor/GetDesignTypeAction.java @@ -0,0 +1,49 @@ +package com.zhiqim.yangcai.design.action.editor; + +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.constants.HttpConstants; + +import com.alibaba.fastjson.JSON; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.server.ApiRequest; +import com.zhiqim.yangcai.design.server.ApiResponse; +import com.zhiqim.yangcai.design.server.DesignController; + +public class GetDesignTypeAction implements Action, HttpConstants +{ + private static final Log log = LogFactory.getLog(GetDesignTypeAction.class); + + @Override + public void execute(HttpRequest request) throws Exception { + // TODO 自动生成的方法存根 + List typeList = DesignTypeDao.listAll(); + request.setAttribute("typeList", typeList); + String method = ""; + ApiRequest req = DesignController.getRequest(method); + HttpResponse response = request.getResponse(); + // 最后 响应结果 + if (typeList.size() == 0) + { + response.println("没有数据"); + //responseError(request.getResponse(), handleResult, mer.getMerchantName(), method);// 响应失败 + } + else + { + + response.setCharacterEncoding(_UTF_8_); + String string= JSON.toJSONString(typeList); + response.println(string); + + //responseSuccess(request.getResponse(), req.getResponse(), "zzq", method);// 响应成功 + } + } + + +} \ No newline at end of file diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/keyword/KeywordIndustryTopAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/keyword/KeywordIndustryTopAction.java new file mode 100644 index 0000000..38c4bd3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/keyword/KeywordIndustryTopAction.java @@ -0,0 +1,34 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.keyword; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + +/** + * 行业关键词排行 + * + * @version v1.0.0 @author Deng 2018-3-20 新建与整理 + */ +public class KeywordIndustryTopAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long industryId = request.getParameterLong("industryId"); + long industrySubId = request.getParameterLong("industrySubId"); + + request.setAttribute("industryId", industryId); + request.setAttribute("industrySubId", industrySubId); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/keyword/KeywordTopAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/keyword/KeywordTopAction.java new file mode 100644 index 0000000..6137b63 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/keyword/KeywordTopAction.java @@ -0,0 +1,67 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.keyword; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.keyword.DesKeywordCoreLog; + +/** + * 关键词排行 + * + * @version v1.0.0 @author Deng 2018-3-20 新建与整理 + */ +public class KeywordTopAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String dayCode = DateTimes.getPreviousDateString(); + + Selector selector = new Selector(); + selector.addMust("dayCode", dayCode); + selector.addOrderbyDesc("keywordNum"); + List logList = ORM.get(ZTable.class).list(DesKeywordCoreLog.class, selector); + if (logList == null) + { + return; + } + + int toIndex = logList.size() > 3 ? 3 : logList.size(); + List threeList = logList.subList(0, toIndex); + request.setAttribute("threeList", threeList); + + List restList = new ArrayList(); + for (int i = 3; i < logList.size(); i++) + { + DesKeywordCoreLog log = logList.get(i); + restList.add(log); + + if (i == 7) + { + break; + } + } + + request.setAttribute("restList", restList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/label/LabelAttributeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/label/LabelAttributeAction.java new file mode 100644 index 0000000..c5bf4e9 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/label/LabelAttributeAction.java @@ -0,0 +1,155 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.label; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.DesLabelAttribute; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; + +/** + * 标签属性 + * + * @version v1.0.0 @author Deng 2017-11-13 新建与整理 + */ +public class LabelAttributeAction extends StdSwitchAction implements ZmrConstants +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("attributeId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsNotEmpty("industryId", "请选择标签行业")); + request.addValidate(new IsNotEmpty("attributeCatId", "请选择标签属性分类")); + request.addValidate(new IsLen("attributeName", "标签属性名称不能为空且不能超过64个字符", 1, 64)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = 20; + long industryId = request.getParameterLong("industryId"); + + Selector selector = new Selector(); + if (industryId != -1) + { + selector.addMust("industryId", industryId); + } + selector.addOrderbyDesc("industryId"); + selector.addOrderbyDesc("attributeCatId"); + PageResult pageResult = ORM.get(ZTable.class).page(DesLabelAttribute.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + request.setAttribute("industryList", Global.get(DesignIndustryCache.class).getIndustryListAll()); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + long industryId = request.getParameterLong("industryId"); + long attributeCatId = request.getParameterLong("attributeCatId"); + String attributeName = request.getParameter("attributeName"); + if (attributeName.indexOf(",") < -1) + { + DesLabelAttribute attr = new DesLabelAttribute(); + attr.setAttributeId(Ids.longId19()); + attr.setAttributeCatId(attributeCatId); + attr.setAttributeName(attributeName); + attr.setIndustryId(industryId); + attr.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(attr); + } + else + { + for (String attrStr : attributeName.split(",")) + { + DesLabelAttribute attr = new DesLabelAttribute(); + attr.setAttributeId(Ids.longId19()); + attr.setAttributeCatId(attributeCatId); + attr.setAttributeName(attrStr); + attr.setIndustryId(industryId); + attr.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(attr); + } + } + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + + long attributeId = request.getParameterLong("attributeId"); + DesLabelAttribute attr = ORM.get(ZTable.class).item(DesLabelAttribute.class, attributeId); + if (attr == null) + { + request.returnHistory("标签属性不存在,请重新选择"); + return; + } + + request.setAttribute("attr", attr); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long attributeId = request.getParameterLong("attributeId"); + long attributeCatId = request.getParameterLong("attributeCatId"); + int industryId = request.getParameterInt("industryId"); + String attributeName = request.getParameter("attributeName"); + + Updater updater = new Updater(); + updater.addMust("attributeId", attributeId); + updater.addField("attributeCatId", attributeCatId); + updater.addField("industryId", industryId); + updater.addField("attributeName", attributeName); + + ORM.get(ZTable.class).update(DesLabelAttribute.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long attributeId = request.getParameterLong("attributeId"); + ORM.get(ZTable.class).delete(DesLabelAttribute.class, attributeId); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/label/LabelAttributeCatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/label/LabelAttributeCatAction.java new file mode 100644 index 0000000..9c0e7f1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/label/LabelAttributeCatAction.java @@ -0,0 +1,138 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.label; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.DesLabelAttribute; +import com.zhiqim.yangcai.design.dbo.DesLabelAttributeCat; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; + +/** + * 标签属性分类 + * + * @version v1.0.0 @author Deng 2017-6-27 新建与整理 + */ +public class LabelAttributeCatAction extends StdSwitchAction implements ZmrConstants +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("attributeCatId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsLen("attributeCatName", "标签属性分类名称不能为空且不能超过64个字符", 1, 64)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt("page.size", 15); + long industryId = request.getParameterLong("industryId"); + + Selector selector = new Selector(); + if (industryId != -1) + { + selector.addMust("industryId", industryId); + } + selector.addOrderbyDesc("createTime"); + PageResult pageResult = ORM.get(ZTable.class).page(DesLabelAttributeCat.class, page, pageSize, selector); + request.setAttribute("pageResult", pageResult); + request.setAttribute("industryList", Global.get(DesignIndustryCache.class).getIndustryListAll()); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + long industryId = request.getParameterLong("industryId"); + String attributeCatName = request.getParameter("attributeCatName"); + + DesLabelAttributeCat cat = new DesLabelAttributeCat(); + cat.setAttributeCatId(Ids.longId19()); + cat.setIndustryId(industryId); + cat.setAttributeCatName(attributeCatName); + cat.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(cat); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + + long attributeCatId = request.getParameterLong("attributeCatId"); + DesLabelAttributeCat cat = ORM.get(ZTable.class).item(DesLabelAttributeCat.class, attributeCatId); + if (cat == null) + { + request.returnHistory("标签属性分类不存在,请重新选择"); + return; + } + + request.setAttribute("cat", cat); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long attributeCatId = request.getParameterLong("attributeCatId"); + long industryId = request.getParameterLong("industryId"); + String attributeCatName = request.getParameter("attributeCatName"); + + Updater updater = new Updater(); + updater.addMust("attributeCatId", attributeCatId); + updater.addField("industryId", industryId); + updater.addField("attributeCatName", attributeCatName); + + ORM.get(ZTable.class).update(DesLabelAttributeCat.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long attributeCatId = request.getParameterLong("attributeCatId"); + if (ORM.get(ZTable.class).count(DesLabelAttribute.class, new Selector().addMust("attributeCatId", attributeCatId)) > 0) + { + request.returnHistory("标签属性分类下存在属性,请先删除标签属性"); + return; + } + + ORM.get(ZTable.class).delete(DesLabelAttributeCat.class, attributeCatId); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/label/LabelIndustryAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/label/LabelIndustryAction.java new file mode 100644 index 0000000..c423645 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/label/LabelIndustryAction.java @@ -0,0 +1,125 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.label; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.DesLabelIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; + +/** + * 标签行业 + * + * @version v1.0.0 @author PVer 2017-6-27 新建与整理 + */ +public class LabelIndustryAction extends StdSwitchAction implements ZmrConstants +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("industrySubId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsNotEmpty("industryId", "请选择标签行业")); + request.addValidate(new IsLen("industrySubName", "子行业名称不能为空且不能超过64个字符", 1, 64)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + request.setAttribute("industryId", indList.size() > 0 ? indList.get(0).getIndustryId() : 0); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + long industryId = request.getParameterLong("industryId"); + String industrySubName = request.getParameter("industrySubName"); + industrySubName = industrySubName.replaceAll("\\s", "").replaceAll(",", ","); + + List subList = Lists.toStringList(industrySubName); + for (String industryStr : subList) + { + DesLabelIndustry industry = new DesLabelIndustry(); + industry.setIndustryId(industryId); + industry.setIndustrySubId(Ids.longId13()); + industry.setIndustrySubName(industryStr); + industry.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(industry); + } + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + + long industrySubId = request.getParameterLong("industrySubId"); + DesLabelIndustry industry = ORM.get(ZTable.class).item(DesLabelIndustry.class, industrySubId); + if (industry == null) + { + request.returnHistory("标签行业不存在,请重新选择"); + return; + } + request.setAttribute("industry", industry); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long industrySubId = request.getParameterLong("industrySubId"); + long industryId = request.getParameterLong("industryId"); + String industrySubName = request.getParameter("industrySubName"); + + Updater updater = new Updater(); + updater.addMust("industrySubId", industrySubId); + updater.addField("industryId", industryId); + updater.addField("industrySubName", industrySubName); + + ORM.get(ZTable.class).update(DesLabelIndustry.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long industrySubId = request.getParameterLong("industrySubId"); + ORM.get(ZTable.class).delete(DesLabelIndustry.class, industrySubId); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/mobiletemplate/MobileTemplateAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/mobiletemplate/MobileTemplateAction.java new file mode 100644 index 0000000..56b40a4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/mobiletemplate/MobileTemplateAction.java @@ -0,0 +1,33 @@ +package com.zhiqim.yangcai.design.action.mobiletemplate; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; + +/** + * 移动端模板库Action + * + * @author HuangZhiGao + * @date 2020-02-26 14:00 + */ +public class MobileTemplateAction implements Action +{ + @Override + public void execute(HttpRequest httpRequest) throws Exception + { + // 如果是pc则重定向到pc端 + if (!httpRequest.isMobile()) + { + httpRequest.setRedirect("/pcWorks.htm"); + return; + } + // 准备行业分类数据[可用] + List indList = Global.get(DesignIndustryCache.class).getIndustryList(); + httpRequest.setAttribute("indList", indList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/mobiletemplate/MobileTemplateDetailAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/mobiletemplate/MobileTemplateDetailAction.java new file mode 100644 index 0000000..d255c06 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/mobiletemplate/MobileTemplateDetailAction.java @@ -0,0 +1,34 @@ +package com.zhiqim.yangcai.design.action.mobiletemplate; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; + +/** + * 移动端单个模板详情Action + * + * @author HuangZhiGao + * @date 2020-02-26 16:43 + */ +public class MobileTemplateDetailAction implements Action +{ + + @Override + public void execute(HttpRequest httpRequest) throws Exception + { + long mediaId = httpRequest.getParameterLong("mediaId"); + if (mediaId == -1L) + { + return; + } + MediaTemplateView media = ORM.get(ZView.class).item(MediaTemplateView.class, new Selector("mediaId", mediaId)); + HttpResponse response = httpRequest.getResponse(); + response.print(media.toString()); + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/mobileworks/MobileWorksAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/mobileworks/MobileWorksAction.java new file mode 100644 index 0000000..cc2322e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/mobileworks/MobileWorksAction.java @@ -0,0 +1,26 @@ +package com.zhiqim.yangcai.design.action.mobileworks; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; + +import java.util.List; + +/** + * 移动端作品库Action + * + * @author HuangZhiGao + * @date 2020-02-22 14:00 + */ +public class MobileWorksAction implements Action +{ + @Override + public void execute(HttpRequest httpRequest) throws Exception + { + // 准备行业分类数据[可用] + List indList = Global.get(DesignIndustryCache.class).getIndustryList(); + httpRequest.setAttribute("indList", indList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/mobileworks/MobileWorksDetailAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/mobileworks/MobileWorksDetailAction.java new file mode 100644 index 0000000..f77c741 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/mobileworks/MobileWorksDetailAction.java @@ -0,0 +1,60 @@ +package com.zhiqim.yangcai.design.action.mobileworks; + +import com.zhiqim.yangcai.design.dbo.works.DesWorksEvent; +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import java.util.List; + +/** + * 移动端单个作品详情Action + * + * @author HuangZhiGao + * @date 2020-02-24 16:43 + */ +public class MobileWorksDetailAction implements Action +{ + @Override + public void execute(HttpRequest httpRequest) throws Exception + { + long worksId = httpRequest.getParameterLong("worksId"); + DesWorksFile works = ORM.get(ZTable.class).item(DesWorksFile.class, worksId); + if (works == null) + { + httpRequest.returnHistory("文件不存在,请重新选择"); + return; + } + + if (Validates.isNotEmptyBlank(works.getKeywordName())) + { + works.setKeywordName(works.getKeywordName().replace(" ", ",")); + } + + Selector dSelector = new Selector(); + dSelector.addMustInLong("parentId", 1803021010350856L, 1803021011250863L); + List deptList = ORM.get(ZTable.class).list(ZmrDept.class, dSelector); + httpRequest.setAttribute("deptList", deptList); + + // 浏览数 + int browseNum = ORM.get(ZTable.class).count(DesWorksEvent.class, new Selector().addMust("worksId", worksId).addMust("eventType", 1)); + + // 浏览事件-新增浏览记录 + DesWorksEvent event = new DesWorksEvent(); + event.setEventId(Ids.longId19()); + event.setWorksId(worksId); + event.setEventType(1); + event.setCreateTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(event); + + httpRequest.setAttribute("browseNum", browseNum); + httpRequest.setAttribute("works", works); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/notice/NoticeHistoryAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/notice/NoticeHistoryAction.java new file mode 100644 index 0000000..6eb96a1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/notice/NoticeHistoryAction.java @@ -0,0 +1,31 @@ +/** + * 扬彩印刷设计 + * 文件名 :NoticeHistoryAction.java + * 创建人 :xiepan + * 创建时间:2021年7月1日 +*/ + +package com.zhiqim.yangcai.design.action.notice; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.notice.Notice; + +public class NoticeHistoryAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("page.size", 15); + PageResult result = ORM.get(ZTable.class).page(Notice.class, pageNo, pageSize, new Selector().addMust("status", 1).addOrderbyDesc("finshTime")); + request.setAttribute("result", result); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/notice/NoticeListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/notice/NoticeListAction.java new file mode 100644 index 0000000..5648c09 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/notice/NoticeListAction.java @@ -0,0 +1,134 @@ +/** + * 扬彩印刷设计 + * 文件名 :NoticeListAction.java + * 创建人 :xiepan + * 创建时间:2021年6月29日 +*/ + +package com.zhiqim.yangcai.design.action.notice; + +import org.apache.commons.lang3.StringUtils; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.notice.Notice; + +public class NoticeListAction extends StdSwitchAction +{ + @Override + protected void list(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("page.size", 15); + Selector selector = new Selector(); + String title = request.getParameter("title"); + + if (!StringUtils.isEmpty(title)) + { + selector.addMaybeLike("title", title); + } + String status = request.getParameter("status"); + if (!StringUtils.isEmpty(status)) + { + selector.addMaybe("status", Integer.valueOf(status)); + } + selector.addOrderbyAsc("status"); + selector.addOrderbyDesc("updateTime"); + PageResult pageResult = ORM.get(ZTable.class).page(Notice.class, pageNo, pageSize, selector); + request.setAttribute("noticeList", pageResult); + + } + + @Override + protected void add(HttpRequest httprequest) throws Exception + { + + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long id = Long.valueOf(request.getParameter("noticeId")); + Notice notice = ORM.get(ZTable.class).item(Notice.class, id); + request.setAttribute("notice", notice); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String title = request.getParameter("title"); + + int status = Integer.valueOf(request.getParameter("status")); + String content = request.getParameterNoFileterOnCNT("content"); + Notice notice = new Notice(); + if (status == 1) + { + notice.setUpdateTime(Sqls.nowTimestamp()); + notice.setUpdateUser(request.getSessionName()); + notice.setFinshTime(Sqls.nowTimestamp()); + notice.setFinshUser(request.getSessionName()); + } + notice.setId(Ids.longId()); + notice.setTitle(title); + notice.setStatus(status); + notice.setAddUser(request.getSessionName()); + notice.setAddTime(Sqls.nowTimestamp()); + notice.setContent(content); + ORM.get(ZTable.class).insert(notice); + + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long id = Long.valueOf(request.getParameter("noticeId")); + String title = request.getParameter("title"); + int status = Integer.valueOf(request.getParameter("status")); + String content = request.getParameterNoFileterOnCNT("content"); + Updater updater = new Updater(); + updater.addMust("id", id); + updater.addField("title", title); + updater.addField("content", content); + updater.addField("status", status); + updater.addField("updateTime", Sqls.nowTimestamp()); + updater.addField("updateUser", request.getSessionName()); + if (status == 0) + { + updater.addField("finshTime", null); + updater.addField("finshUser", ""); + } + if (status == 1) + { + updater.addField("finshTime", Sqls.nowTimestamp()); + updater.addField("finshUser", request.getSessionName()); + } + + ORM.get(ZTable.class).update(Notice.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long id = Long.valueOf(request.getParameter("noticeId")); + ORM.get(ZTable.class).delete(Notice.class, id); + } + + @Override + protected void validateId(HttpRequest request) throws Exception + { + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + request.addValidate(new IsLen("title", "标题不能为空且不能超过32个字符", 1, 32)); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/AfterMessageAddAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/AfterMessageAddAction.java new file mode 100644 index 0000000..dbb8752 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/AfterMessageAddAction.java @@ -0,0 +1,39 @@ +/** + * 扬彩印刷设计 + * 文件名 :AfterMessageAddAction.java + * 创建人 :jiangbin + * 创建时间:2020-1-11 + */ +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 添加售后留言页面 + * + * @version 1.0 @author jiangbin 2020-1-11 新建与整理 + */ +public class AfterMessageAddAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + Long designId = request.getParameterLong("designId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", designId)); + if (Validates.isEmpty(order)) + { + request.setResponseError("订单不存在"); + return; + } + request.setAttribute("order", order); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/AssignDesignerAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/AssignDesignerAction.java new file mode 100644 index 0000000..be54e88 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/AssignDesignerAction.java @@ -0,0 +1,134 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * + * 指定内部设计师 + * + * @version v1.0.0 @author PVer 2018-3-8 新建与整理 + */ +public class AssignDesignerAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + int onWork = request.getParameterInt("onWork", 1); + + if (designId <= 0) + { + request.returnCloseDialog("订单【" + designId + "】不存在,请重新选择!"); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (order == null) + { + request.returnCloseDialog("订单【" + designId + "】不存在,请重新选择!"); + return; + } + + // long orgId = request.getParameterLong("orgId", 0); + // long industryId = request.getParameterLong("industryId", order.getIndustryId()); // + // 默认为订单所属行业,0时查全部 + + if (order.getStatus() < StatusConstants.ORDER_10.value() || order.getStatus() >= StatusConstants.ORDER_55.value()) + { + request.returnCloseDialog("当前订单状态不允许该项操作!"); + return; + } + + // List orgList = new ArrayList(); + // for (ZmrOrg org : OperatorDao.getOperatorOrgList(request, request.getSessionName(), + // false)) + // {// 检查商户 接单状态 + // DesignOrgMer mer = ORM.get(ZTable.class).item(DesignOrgMer.class, new + // Selector("isPauseRecieive", false).addMust("orgId", org.getOrgId())); + // if (mer != null) + // { + // orgList.add(org); + // } + // } + // + // if (orgId == 0 && orgList.size() > 0) + // { + // orgId = orgList.get(0).getOrgId(); + // } + + // 查询设置了派单属性的设计师 + StringBuffer slq = new StringBuffer(); + slq.append("SELECT dgd.* FROM zmr_operator zo "); + slq.append("LEFT JOIN designer_group_dispatch dgd ON dgd.OPERATOR_CODE = zo.OPERATOR_CODE "); + slq.append("LEFT JOIN designer_group dg ON dg.DESIGNER_GROUP_ID = dgd.DESIGNER_GROUP_ID "); + slq.append("WHERE zo.OPERATOR_STATUS = 0 AND dgd. STATUS = 1 AND dg. STATUS = 1 "); + // slq.append("AND zo.ORG_ID = " + orgId + " "); + // 查询组织下,设置了派单属性的设计师 + // if (industryId > 0) + // { + // slq.append("AND ("); + // slq.append("EXISTS(SELECT 1 FROM designer_group_value dgv WHERE dg.DESIGNER_GROUP_ID = + // dgv.DESIGNER_GROUP_ID "); + // slq.append("AND dgv.RELATED_TYPE = 3 "); + // slq.append("AND dgv.RELATED_VALUE = " + industryId + ")or("); + // slq.append("EXISTS(SELECT 1 FROM designer_group_dispatch_value dgdv WHERE + // dgd.OPERATOR_CODE = dgdv.OPERATOR_CODE "); + // slq.append("AND dgdv.RELATED_TYPE = 3 "); + // slq.append("AND dgdv.RELATED_VALUE = " + industryId + "))) "); + // + // } + // 添加在线中的查询 + if (onWork == 1) + { + slq.append("AND EXISTS (SELECT 1 FROM des_online where OPERATOR_CODE = zo.OPERATOR_CODE and ONLINE_STATUS = 1)"); + } + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgIdArr=orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() -1); + slq.append(" and zo.org_id in ("+ orgIdArr + ")"); + } + + List disPropList = ORM.get(ZSQL.class).executeQuery(slq.toString(), DesignerGroupDispatch.class); + + request.setAttribute("operatorList", disPropList); + // request.setAttribute("orgList", orgList); + // request.setAttribute("orgId", orgId); + request.setAttribute("order", order); + request.setAttribute("onWork", onWork); + // request.setAttribute("industryId", industryId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/AssignDesignerActions.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/AssignDesignerActions.java new file mode 100644 index 0000000..17ea391 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/AssignDesignerActions.java @@ -0,0 +1,115 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.util.DesignerGroupDispatchUtil; + +/** + * + * 批量指定内部设计师 + * + * @version v1.0.0 @author PVer 2018-3-8 新建与整理 + */ +public class AssignDesignerActions implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String[] oids = request.getParameterValues("designId"); + long[] designIds = Arrays.toLongArray(oids); + int onWork = request.getParameterInt("onWork", 1); + DesignOrder orderNew = new DesignOrder(); + int i =0; + for (long designId : designIds) { + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (order == null) + { + request.returnCloseDialog("订单【" + designId + "】不存在,请重新选择!"); + return; + } + if (order.getStatus() < StatusConstants.ORDER_10.value() || order.getStatus() >= StatusConstants.ORDER_55.value()) + { + request.returnCloseDialog("当前订单状态不允许该项操作!"); + return; + } + if(i == 0){ + orderNew = order; + orderNew.setOrderText(orderNew.getOrderText()+"...."); + orderNew.setAfterNames(orderNew.getDesignId()+","); + }else if(i == designIds.length-1 && i !=0){ + orderNew.setAfterNames(orderNew.getAfterNames()+order.getDesignId()); + }else{ + orderNew.setAfterNames(orderNew.getAfterNames()+order.getDesignId()+","); + } + i++; + } + + integration(orderNew,onWork,request); + } + + + + public void integration( DesignOrder order,int onWork,HttpRequest request) throws ORMException, SQLException{ + // 查询设置了派单属性的设计师 + StringBuffer slq = new StringBuffer(); + slq.append("SELECT dgd.* FROM zmr_operator zo "); + slq.append("LEFT JOIN designer_group_dispatch dgd ON dgd.OPERATOR_CODE = zo.OPERATOR_CODE "); + slq.append("LEFT JOIN designer_group dg ON dg.DESIGNER_GROUP_ID = dgd.DESIGNER_GROUP_ID "); + slq.append("WHERE zo.OPERATOR_STATUS = 0 AND dgd. STATUS = 1 AND dg. STATUS = 1 "); + // 添加在线中的查询 + if (onWork == 1) + { + slq.append("AND EXISTS (SELECT 1 FROM des_online where OPERATOR_CODE = zo.OPERATOR_CODE and ONLINE_STATUS = 1)"); + } + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgIdArr=orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() -1); + slq.append(" and zo.org_id in ("+ orgIdArr + ")"); + } + + List disPropList = ORM.get(ZSQL.class).executeQuery(slq.toString(), DesignerGroupDispatch.class); + + request.setAttribute("operatorList", disPropList); + // request.setAttribute("orgList", orgList); + // request.setAttribute("orgId", orgId); + request.setAttribute("order", order); + request.setAttribute("onWork", onWork); + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/AssignOrgAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/AssignOrgAction.java new file mode 100644 index 0000000..4025dcf --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/AssignOrgAction.java @@ -0,0 +1,43 @@ +package com.zhiqim.yangcai.design.action.order; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +/** + * 设计师指定组织 + * + * @version v1.0.0 caohong + */ +public class AssignOrgAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String designer = request.getParameter("designer"); + ZmrOperator oper = ZmrOperatorDao.getOperator(request, designer); + if (oper == null) + { + request.setResponseError("设计师【" + designer + "】不存在,请重新选择!"); + return; + } + + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + selOrg.addMustNotEqual("orgId", 1808071102554512L); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + + request.setAttribute("orgList", orgList); + request.setAttribute("oper", oper); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ChangeStatusAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ChangeStatusAction.java new file mode 100644 index 0000000..470333f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ChangeStatusAction.java @@ -0,0 +1,46 @@ +package com.zhiqim.yangcai.design.action.order; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.model.OrderCheckModel; + +/** + * 审核退回详情 + * + * @version v1.0.0 @author liuhu 2018-12-20 新建与整理 + */ +public class ChangeStatusAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + Selector sel = new Selector(); + sel.addMust("designId", designId); + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, sel); + if (order == null) + { + request.returnCloseDialog("订单数据未查到,请核对后再操作。"); + return; + } + + request.setAttribute("order", order); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/CheckBackDetailAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/CheckBackDetailAction.java new file mode 100644 index 0000000..fbb7326 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/CheckBackDetailAction.java @@ -0,0 +1,97 @@ +package com.zhiqim.yangcai.design.action.order; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.model.OrderCheckModel; + +/** + * 审核退回详情 + * + * @version v1.0.0 @author liuhu 2018-12-20 新建与整理 + */ +public class CheckBackDetailAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + Selector sel = new Selector(); + sel.addMust("designId", designId); + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, sel); + if (order == null) + { + request.returnCloseDialog("订单数据未查到,请核对后再操作。"); + return; + } + + if (Validates.isEmpty(order.getCheckBackReason()) && Validates.isEmpty(order.getDraftBackReason()) && Validates.isEmpty(order.getEndBackReason())) + { + request.returnCloseDialog("您的订单无审核记录"); + return; + } + + // 有初稿、定稿、印前审核退回场景,根据退回时间展示最近记录 + List checkModelList = new ArrayList(); + if (Validates.isNotEmpty(order.getCheckBackReason())) + { + OrderCheckModel model = new OrderCheckModel(); + model.setBackReason(order.getCheckBackReason()); + model.setBackReasonPicUrl(order.getCheckBackPictureUrl()); + model.setBackTime(order.getCheckTime()); + checkModelList.add(model); + } + if (Validates.isNotEmpty(order.getDraftBackReason())) + { + OrderCheckModel model = new OrderCheckModel(); + model.setBackReason(order.getDraftBackReason()); + model.setBackReasonPicUrl(order.getDraftBackReasonPicUrl()); + model.setBackTime(order.getDraftBackTime()); + checkModelList.add(model); + } + if (Validates.isNotEmpty(order.getEndBackReason())) + { + OrderCheckModel model = new OrderCheckModel(); + model.setBackReason(order.getEndBackReason()); + model.setBackReasonPicUrl(order.getEndBackReasonPicUrl()); + model.setBackTime(order.getEndBackTime()); + checkModelList.add(model); + } + + Collections.sort(checkModelList, new Comparator() + { + DateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + @Override + public int compare(OrderCheckModel o1, OrderCheckModel o2) + { + try + { + return f.parse(Sqls.toDateTimeString(o2.getBackTime())).compareTo(f.parse(Sqls.toDateTimeString(o1.getBackTime()))); + } + catch (ParseException e) + { + throw new IllegalArgumentException(e); + } + } + }); + + request.setAttribute("orderCheckModel", checkModelList.get(0)); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ComplaintOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ComplaintOrderAction.java new file mode 100644 index 0000000..a7ca786 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ComplaintOrderAction.java @@ -0,0 +1,74 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 申诉订单列表 + * + * @version v1.0.0 @author liuhu 2018-12-7 新建与整理 + */ +public class ComplaintOrderAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("pageSize", 10); + String designer = request.getParameter("designer", ""); + long designId = request.getParameterLong("designId"); + String buyerNick = request.getParameter("buyerNick"); + String beginDate = request.getParameter("beginDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + Selector selector = new Selector(); + selector.addMaybe("designId", designId); + selector.addMaybe("designer", designer); + selector.addMaybe("buyerNick", buyerNick); + OperatorDao.getOrgSelector(request, selector); + selector.addMustThenGE("refundTime", beginDate + " 00:00:00"); + selector.addMustThenLE("refundTime", endDate + " 23:59:59"); + selector.addMustIsNotEmpty("complaintReason"); + selector.addMust("complaintFlag", 3); + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + List operatorList = ZmrOperatorDao.getOperator(request, request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId()); + + request.setAttribute("operatorList", operatorList); + request.setAttribute("pageResult", pageResult); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ComplaintViewAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ComplaintViewAction.java new file mode 100644 index 0000000..72cdfaa --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ComplaintViewAction.java @@ -0,0 +1,49 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.order; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 申诉详情 + * + * @version v1.0.0 @author liuhu 2018-12-7 新建与整理 + */ +public class ComplaintViewAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + } + request.setAttribute("order", order); + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, new Selector("designId", designId).addMust("attaModul", FileTypeConstants.FILE_COMPLAINT.value())); + request.setAttribute("attaList", attaList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ConfigQuestionsAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ConfigQuestionsAction.java new file mode 100644 index 0000000..34e4a5d --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ConfigQuestionsAction.java @@ -0,0 +1,158 @@ +package com.zhiqim.yangcai.design.action.order; + +import java.io.File; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.uploadlarge.dbo.UpllFile; + +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dbo.order.ConfigQuestions; +import com.zhiqim.yangcai.design.dbo.order.QuestionsAtta; + +/** + * + * [简要描述]:考试题库
            + * + * @version 1.0 @author hc 2021年5月19日 新建与整理 + */ + +@AnAlias("ConfigQuestionsAction") +@AnIntercept("chkZmrLogin") +public class ConfigQuestionsAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt("page.size", 20); + + Selector selector = new Selector(); + selector.addMaybeLike("designRequirements", request.getParameter("designRequirements")); + selector.addOrderbyDesc("modificationTime"); + PageResult pageResult = ORM.get(ZTable.class).page(ConfigQuestions.class, page, pageSize, selector); + request.setAttribute("pageResult", pageResult); + + // 获取订单素材上传路径 + String dateDir = DateTimes.getDateTime8String(); + String customFile = "订单考核/设计素材"; + String customPath = dateDir + "/" + customFile; + request.setAttribute("customPath", customPath); + } + + /** + * + * [简要描述]:添加考试订单
            + * [详细描述]:
            + * + * @author hc + * @param request + * @throws Exception + */ + public void orderQuestionsAdd(HttpRequest request) throws Exception + { + + String product = request.getParameter("product"); + String materials = request.getParameter("materials"); + String sizeLength = request.getParameter("sizeLength"); + String sizeWidth = request.getParameter("sizeWidth"); + String faceCount = request.getParameter("faceCount"); + String styleCount = request.getParameter("styleCount"); + String others = request.getParameter("others"); + + String designRequirement = product + materials + sizeLength + sizeWidth + faceCount + styleCount; + + String designRequirements = null; + + if (designRequirement.isEmpty()) + { + request.setResponseError("设计需求不能为空!"); + return; + } + + ConfigQuestions cq = request.getParameter(ConfigQuestions.class); + + designRequirements = product + " | " + materials + " | " + sizeLength + "×" + sizeWidth + "mm | " + faceCount + " | " + styleCount + " | " + others; + + cq.setQuestionsId(Ids.longId()); + cq.setDesignRequirements(designRequirements); + cq.setUpdateOperator(request.getSessionName()); + cq.setModificationTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(cq); + + } + + /** + * + * [简要描述]:修改考试订单
            + * [详细描述]:
            + * + * @author hc + * @param request + * @throws Exception + */ + public void orderQuestionsModify(HttpRequest request) throws Exception + { + long questionsId = request.getParameterLong("questionsId"); + String designRequirements = request.getParameter("designRequirements"); + Updater updater = new Updater(); + updater.addMust("questionsId", questionsId); + updater.addField("designRequirements", designRequirements); + + ORM.get(ZTable.class).update(ConfigQuestions.class, updater); + } + + /** + * + * [简要描述]:删除考试订单
            + * [详细描述]:
            + * + * @author hc + * @param request + * @throws Exception + */ + public void designOrderQuestionsDelete(HttpRequest request) throws Exception + { + long questionsId = request.getParameterLong("questionsId"); + List attaList = ORM.get(ZTable.class).list(QuestionsAtta.class, new Selector().addMust("questionsId", questionsId)); + for (QuestionsAtta atta : attaList) + { + File file = new File(atta.getSavePath()); + if (file.exists()) + { + Files.deleteFile(atta.getSavePath()); + } + + if (Validates.isNotEmpty(atta.getFileid())) + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", atta.getFileid()).addReplace("id", null)); + } + + if ("ExamVoucher".equals(atta.getAttaModul())) + { + String path = atta.getFileUrl().split(OssFileDao.getPrefix_dir())[1]; + OssFileDao.deleteOssFile(OssFileDao.getPrefix_dir() + path); + } + + } + + ORM.get(ZTable.class).delete(QuestionsAtta.class, questionsId); + ORM.get(ZTable.class).delete(ConfigQuestions.class, questionsId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ConfigQuestionsModifyAciton.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ConfigQuestionsModifyAciton.java new file mode 100644 index 0000000..300e85c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ConfigQuestionsModifyAciton.java @@ -0,0 +1,25 @@ +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.ConfigQuestions; + +public class ConfigQuestionsModifyAciton implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long questionsId = request.getParameterLong("questionsId"); + Selector selector = new Selector(); + selector.addMust("questionsId", questionsId); + ConfigQuestions result = ORM.get(ZTable.class).item(ConfigQuestions.class, selector); + request.setAttribute("result", result); + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ContendOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ContendOrderAction.java new file mode 100644 index 0000000..9f26bfc --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ContendOrderAction.java @@ -0,0 +1,97 @@ +package com.zhiqim.yangcai.design.action.order; + +import java.util.Map; +import java.util.Map.Entry; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.service.ContendOrderService; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +/** + * + * [简要描述]:抢单 Controller
            + * [详细描述]:
            + * + * @version 1.0 @author hc 2021年6月2日 新建与整理 + */ +@AnAlias("ContendOrderAction") +@AnIntercept("chkZmrLogin") +public class ContendOrderAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + String orderText = request.getParameter("orderText"); + request.setAttribute("designId", designId); + request.setAttribute("orderText", orderText); + } + + /** + * + * [简要描述]:抢单
            + * [详细描述]:
            + * + * @author hc + * @param request + * @throws Exception + */ + public void contendOrder(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + String operatorCode = request.getSessionName(); + + // 是否有已完善个人信息 + boolean orderAuthority = ContendOrderService.isOrderAuthority(operatorCode); + if (!orderAuthority) + { + request.setResponseError("接单前请前往个人中心完善个人简介~"); + return; + } + + DesignerGroupDispatch designerGroupDispatchResult = ORM.get(ZTable.class).item(DesignerGroupDispatch.class, + new Selector().addMaybe("operatorCode", operatorCode)); + + // 是否有权限接受此单 + Map passMuster = ContendOrderService.isPassMuster(designId, operatorCode, designerGroupDispatchResult); + for (Entry m : passMuster.entrySet()) + { + if (!m.getKey().equals("true")) + { + request.setResponseError(m.getValue()); + return; + } + } + + DesignOrder item = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", designId)); + if (item.getStatus() != 10 && Validates.isNotEmpty(item.getDesigner())) + { + request.setResponseError("该订单已被领取,请选择其他订单~"); + return; + } + + // 抢单 + String contendOrderResult = ContendOrderService.isContendOrderSuccess(designId, operatorCode, designerGroupDispatchResult); + if (contendOrderResult.equals("error")) + { + request.setResponseError("该订单已被领取,请选择其他订单~"); + return; + } + + String logItem = "设计师在抢单大厅领取订单"; + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), logItem, EventConstants.ORDER_3.value()); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DesignCopiesrAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DesignCopiesrAction.java new file mode 100644 index 0000000..00daf6d --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DesignCopiesrAction.java @@ -0,0 +1,33 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + +/** + * 设计份数修改 + * + * @version v1.0.0 @author hc 2021-5-12 新建与整理 + */ +public class DesignCopiesrAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long copies = request.getParameterLong("copies"); + + request.setAttribute("copies", copies); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DesignOrderRefundInfoAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DesignOrderRefundInfoAction.java new file mode 100644 index 0000000..15a9745 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DesignOrderRefundInfoAction.java @@ -0,0 +1,88 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignOrderRefundInfoAction.java + * 创建人 :gjx + * 创建时间:2021年6月5日 +*/ + +package com.zhiqim.yangcai.design.action.order; + +import java.io.File; +import java.io.FileInputStream; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; + +import sun.misc.BASE64Encoder; + +/** + * TODO:退款订单详情 + * + * @version v1.0.0 @author PVer 2017-6-5 新建与整理 + */ +public class DesignOrderRefundInfoAction implements Action +{ + private static final Log log = LogFactory.getLog(DesignOrderRefundInfoAction.class); + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = Long.parseLong(request.getParameter("designId")); + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, new Selector().addMaybe("designId", designId)); + Map typeMap = new HashMap(); + List typeList = DesignTypeDao.listAll(); + for (DesignType designType : typeList) + { + typeMap.put(designType.getTypeId(), designType); + } + Selector selector = new Selector(); + selector.addMaybe("attaModul", "ApplyRefundFile"); + selector.addMust("designId", order.getDesignId()); + DesignAtta designAtta = ORM.get(ZTable.class).item(DesignAtta.class, selector); + // 读取服务器硬盘文件,使用base64输出 + FileInputStream is = null; + if (designAtta != null && Validates.isNotEmpty(designAtta.getSavePath())) + { + try + { + File file = new File(designAtta.getSavePath()); + is = new FileInputStream(file); + byte[] data = new byte[is.available()]; + is.read(data); + BASE64Encoder encoder = new BASE64Encoder(); + String base64Img = encoder.encode(data); + request.setAttribute("base64Img", base64Img); + } + catch (Exception e) + { + log.error("订单查看退款截图失败:订单号:{}", designId, e); + } + finally + { + if (is != null) + { + is.close(); + } + } + } + request.setAttribute("typeList", typeList); + request.setAttribute("typeMap", typeMap); + request.setAttribute("order", order); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DesignOrderRefundModifyAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DesignOrderRefundModifyAction.java new file mode 100644 index 0000000..882b066 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DesignOrderRefundModifyAction.java @@ -0,0 +1,29 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignOrderRefundModifyAction.java + * 创建人 :xp + * 创建时间:2021年6月24日 +*/ + +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrderRefundReason; + +public class DesignOrderRefundModifyAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + Long id = Long.valueOf(request.getParameter("id")); + DesignOrderRefundReason designOrderRefundReason = ORM.get(ZTable.class).item(DesignOrderRefundReason.class, new Selector().addMust("id", id)); + request.setAttribute("designOrderRefundReason", designOrderRefundReason); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DesignOrderRefundReasonAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DesignOrderRefundReasonAction.java new file mode 100644 index 0000000..a4833cc --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DesignOrderRefundReasonAction.java @@ -0,0 +1,28 @@ +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrderRefundReason; + +/** + * TODO:退款问题列表 + * + * @version v1.0.0 @author PVer 2017-6-5 新建与整理 + */ +public class DesignOrderRefundReasonAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 10); + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrderRefundReason.class, page, pageSize, + new Selector().addOrderbyDesc("updateTime")); + request.setAttribute("pageResult", pageResult); + } +} \ No newline at end of file diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DoEditDesignOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DoEditDesignOrderAction.java new file mode 100644 index 0000000..d2e7fb9 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/DoEditDesignOrderAction.java @@ -0,0 +1,22 @@ +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; + +public class DoEditDesignOrderAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + DesignSelfView designSelfView = ORM.get(ZView.class).item(DesignSelfView.class, new Selector().addMust("designId", designId)); + request.setAttribute("order", designSelfView); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/HistoryBackDetailsAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/HistoryBackDetailsAction.java new file mode 100644 index 0000000..bf60a55 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/HistoryBackDetailsAction.java @@ -0,0 +1,87 @@ +/** + * 扬彩印刷设计 + * 文件名 :HistoryBackDetailsAction.java + * 创建人 :gjx + * 创建时间:2019-9-18 + */ + +package com.zhiqim.yangcai.design.action.order; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdOprLog; +import com.zhiqim.yangcai.design.dbo.utils.CalculationUtil; +import com.zhiqim.yangcai.design.model.HistoryBackDetailsModel; + +/** + * 订单历史审核退回详情 + * + * @version 1.0 @author gjx 2019-9-18 新建与整理 + */ +public class HistoryBackDetailsAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + DesignOrder designOrder = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMaybe("designId", designId)); + if (designOrder == null) + { + request.setResponseError("订单不存在"); + return; + } + + List models = new ArrayList<>(); + List finalizeLogList = ORM.get(ZTable.class).list(OrdOprLog.class, + new Selector().addMust("designId", designId).addMust("eventType", EventConstants.ORDER_9.value()).addOrderbyAsc("createTime")); + List backLogList = ORM.get(ZTable.class).list(OrdOprLog.class, + new Selector().addMust("designId", designId).addMust("eventType", EventConstants.ORDER_10.value()).addOrderbyAsc("createTime")); + for (int i = 0; i < backLogList.size(); i++) + { + HistoryBackDetailsModel model = new HistoryBackDetailsModel(); + model.setDesignId(designOrder.getDesignId()); + model.setBuyerNick(designOrder.getBuyerNick()); + model.setOrderText(designOrder.getOrderText()); + model.setAmount(designOrder.getAmount()); + model.setBackTime(backLogList.get(i).getCreateTime()); + model.setCheckBackReason(backLogList.get(i).getOperateDesc()); + Timestamp checkBackTime = backLogList.get(i).getCreateTime(); + if (i < finalizeLogList.size() - 1) + { + Timestamp designEndTime = finalizeLogList.get(i + 1).getCreateTime(); + model.setDesignEndTime(designEndTime); + boolean isTimeOut = CalculationUtil + .doCalculCheckBackCountDownBefore(Sqls.toDateTimeString(checkBackTime), Sqls.toDateTimeString(designEndTime)); + String dateText = CalculationUtil.doCalculCheckBackCountDown(Sqls.toDateTimeString(checkBackTime), Sqls.toDateTimeString(designEndTime)); + model.setTimeOut(isTimeOut); + model.setBackCountDown(dateText); + } + else + { + boolean isTimeOut = CalculationUtil.doCalculCheckBackCountDownBefore(Sqls.toDateTimeString(checkBackTime), + String.valueOf(DateTimes.getDateTimeString())); + String dateText = CalculationUtil.doCalculCheckBackCountDown(Sqls.toDateTimeString(checkBackTime), + String.valueOf(DateTimes.getDateTimeString())); + model.setTimeOut(isTimeOut); + model.setBackCountDown(dateText); + } + + models.add(model); + } + + request.setAttribute("models", models); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/HistoryOrderTagLogAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/HistoryOrderTagLogAction.java new file mode 100644 index 0000000..141eb9c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/HistoryOrderTagLogAction.java @@ -0,0 +1,91 @@ +/** + * 扬彩印刷设计 + * 文件名 :HistoryOrderTagLogAction.java + * 创建人 :gjx + * 创建时间:2019-12-19 + */ + +package com.zhiqim.yangcai.design.action.order; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.dbo.order.OrdOprLog; +import com.zhiqim.yangcai.design.model.HisToryOrderTagLogModel; + +/** + * [简要描述]历史订单标签日志查询:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-12-19 新建与整理 + */ +public class HistoryOrderTagLogAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + + Selector selector = new Selector(); + selector.addMust("designId", designId); + selector.addMust("eventType", EventConstants.ORDER_31.value()); + selector.addOrderbyDesc("createTime"); + List logList = ORM.get(ZTable.class).list(OrdOprLog.class, selector); + List modelList = new ArrayList<>(); + HisToryOrderTagLogModel model = null; + for (OrdOprLog log : logList) + { + model = new HisToryOrderTagLogModel(); + model.setOperatorCode(log.getOperatorCode()); + model.setOperatorTime(log.getCreateTime()); + String operateDesc = Validates.isNotEmpty(log.getOperateDesc()) ? log.getOperateDesc() : ""; + // 修改订单标签 :主行业:美容妆饰,客户类型:渠道商,子行业:理发,应用场景:舞会,设计风格:欧美风 + // 修改订单标签 :客户类型:渠道商,子行业:理发,应用场景:舞会,设计风格:中国风, + // 修改订单标签 :主行业:美容妆饰,客户类型:,子行业:,应用场景:,设计风格: + String[] orderTag1 = operateDesc.split(":"); + String orderTagStr = orderTag1[1]; + String[] orderTag2 = orderTagStr.split(","); + for (int i = 0; i < orderTag2.length; i++) + { + String strKey = Strings.trim(orderTag2[i].substring(0, orderTag2[i].indexOf(":"))); + if ("主行业".equals(strKey)) + { + model.setMainIndustryName(Strings.trim(orderTag2[i].substring(strKey.length() + 1, orderTag2[i].length()))); + } + if ("客户类型".equals(strKey)) + { + model.setCustomerType(Strings.trim(orderTag2[i].substring(strKey.length() + 1, orderTag2[i].length()))); + } + if ("子行业".equals(strKey)) + { + model.setSonIndustryName(Strings.trim(orderTag2[i].substring(strKey.length() + 1, orderTag2[i].length()))); + } + if ("应用场景".equals(strKey)) + { + model.setAppScenarios(Strings.trim(orderTag2[i].substring(strKey.length() + 1, orderTag2[i].length()))); + } + if ("设计风格".equals(strKey)) + { + model.setDesignStyle(Strings.trim(orderTag2[i].substring(strKey.length() + 1, orderTag2[i].length()))); + } + if ("未匹配的关键词".equals(strKey)) + { + model.setUnmatchKeyword(Strings.trim(orderTag2[i].substring(strKey.length() + 1, orderTag2[i].length()))); + } + } + modelList.add(model); + } + + request.setAttribute("modelList", modelList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ModifyIndustryAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ModifyIndustryAction.java new file mode 100644 index 0000000..8073690 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ModifyIndustryAction.java @@ -0,0 +1,50 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * + * 修改行业 + * + * @version v1.0.0 @author Deng 2018-3-17 新建与整理 + */ +public class ModifyIndustryAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + if(designId <= 0) + { + request.returnCloseDialog("订单【"+designId+"】不存在,请重新选择!"); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if(order == null) + { + request.returnCloseDialog("订单【"+designId+"】不存在,请重新选择!"); + return; + } + + request.setAttribute("order", order); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/MyDesignOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/MyDesignOrderAction.java new file mode 100644 index 0000000..4c872bc --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/MyDesignOrderAction.java @@ -0,0 +1,66 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.order; + + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 我的设计订单 + * + * @version v1.0.0 @author Deng 2017-4-6 新建与整理 + */ +public class MyDesignOrderAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + long designId = request.getParameterLong("designId"); + + Selector selector = new Selector(); + selector.addOrderbyDesc("designReceiveTime"); + selector.addMustThenGE("status", StatusConstants.ORDER_30.value()); + if (designId > 0) + selector.addOr(new Selector("designId", designId).addMust("outId", designId)); + + selector.addMaybe("buyerNick", request.getParameter("buyerNick")); + selector.addMaybeLike("tids", request.getParameter("tid")); + selector.addMaybe("designType", request.getParameterLong("designType")); + selector.addMaybe("industryId", request.getParameterLong("industryId")); + selector.addMust("designer", sessionUser.getOperatorCode()); + + //根据组织显示 + long orgId = sessionUser.getSelectedOrgId(); + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org.getOrgLevel() > 0) + selector.addMust("orgId", orgId); + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize,selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/MyDraftOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/MyDraftOrderAction.java new file mode 100644 index 0000000..f7dc7e7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/MyDraftOrderAction.java @@ -0,0 +1,68 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 我的初稿订单 + * + * @version v1.0.0 @author Deng 2017-4-6 新建与整理 + */ +public class MyDraftOrderAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + long designId = request.getParameterLong("designId"); + + Selector selector = new Selector(); + selector.addOrderbyDesc("designDraftTime"); + if (designId > 0) + { + selector.addOr(new Selector("designId", designId).addMust("outId", designId)); + } + selector.addMust("status", StatusConstants.ORDER_50.value()); + selector.addMaybe("buyerNick", request.getParameter("buyerNick")); + selector.addMaybeLike("tids", request.getParameter("tid")); + selector.addMaybe("designType", request.getParameterLong("designType")); + selector.addMaybe("industryId", request.getParameterLong("industryId")); + selector.addMust("designer", sessionUser.getOperatorCode()); + + // 根据组织显示 + long orgId = sessionUser.getSelectedOrgId(); + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/NotTimeoutCompleteOrderHistoryAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/NotTimeoutCompleteOrderHistoryAction.java new file mode 100644 index 0000000..3eb0c62 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/NotTimeoutCompleteOrderHistoryAction.java @@ -0,0 +1,167 @@ +/** + * 扬彩印刷设计 + * 文件名 :NotTimeoutCompleteOrderHistoryAction.java + * 创建人 :jiangbin + * 创建时间:2020-05-12 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; +import com.zhiqim.yangcai.design.dbo.stat.TimelinessParameter; +import com.zhiqim.yangcai.design.model.TimelinessStatModel; + +/** + * 定稿未超时订单Action + * + * @version v1.0.0 @author jiangbin 2020-05-12 新建与整理 + */ +public class NotTimeoutCompleteOrderHistoryAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 20); + String designer = request.getParameter("designer"); + + String startDate = request.getParameter("startDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + + // 查询订单 + Selector selector = new Selector(); + selector.addMustThenGE("draftType", 1); // 改稿自来稿 普通设计稿 资深设计稿 + selector.addMustThenGE("status", StatusConstants.ORDER_55.value()); // 状态大于等于已定稿 + selector.addMaybeThenGE("designEndTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMaybeThenLE("designEndTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMaybe("typeId", request.getParameterLong("prdTypeId")); + selector.addOrderbyDesc("designEndTime"); + + // 根据组织查询 + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + List allList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + Map specialMap = new HashMap<>(); + specialMap.put("彩页", 300); + specialMap.put("名片", 180); + specialMap.put("优惠券", 180); + specialMap.put("不干胶", 180); + specialMap.put("海报类", 300); + specialMap.put("展架", 300); + specialMap.put("折页", 1440); + specialMap.put("画册", 2880); + + // 筛选出定稿未超时的订单 + List list = new ArrayList(); + Map typeMap = DesignTypeDao.mapAll(); + for (DesignOrder designOrder : allList) + { + DesignType type = typeMap.get(designOrder.getTypeId()); + if (Validates.isNotEmpty(type)) + { + int designMinute = DateTimes.compareMinute(designOrder.getDesignEndTime(), designOrder.getDesignReceiveTime()); + int effectiveTime = 1000;// 默认1000分钟超时时间范畴 + if (specialMap.containsKey(type.getTypeName())) + { + effectiveTime = specialMap.get(type.getTypeName()); + } + if (designMinute <= effectiveTime) + { + list.add(designOrder); + } + } + } + + // 统计 + List timelinessParameters = ORM.get(ZTable.class).list(TimelinessParameter.class); + Map map = new HashMap(); + List tempList = new ArrayList(); + for (DesignOrder item : list) + { + TimelinessStatModel tsModel = new TimelinessStatModel(); + long tpRewardAmount = 0; + if (Validates.isEmpty(map.get(item.getDesigner()))) + { + tsModel.setDesigner(item.getDesigner()); + tsModel.setDesignOrderSum(0); + tsModel.setRewardAmountSum(0); + } + else + { + tsModel = map.get(item.getDesigner()); + } + for (TimelinessParameter tp : timelinessParameters) + { + if (tp.getPrdTypeId() == item.getTypeId()) + { + tpRewardAmount = tp.getRewardAmount(); + } + } + tsModel.setDesignOrderSum(tsModel.getDesignOrderSum() + 1); + tsModel.setRewardAmountSum(tsModel.getRewardAmountSum() + tpRewardAmount); + map.put(item.getDesigner(), tsModel); + + if (Validates.isNotEmpty(designer) && !designer.equals(item.getDesigner())) + { + continue; + } + + tempList.add(item); + } + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, tempList); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("map", map); + + // 获取进度备注 + Map progressNoteMap = new HashMap(); + for (DesignOrder order : pageResult.list()) + { + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class).item(OrdProgressNote.class, + new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" : note.getOrdProgressNote()); + } + request.setAttribute("progressNoteMap", progressNoteMap); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderBackLogAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderBackLogAction.java new file mode 100644 index 0000000..eb7f8b6 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderBackLogAction.java @@ -0,0 +1,156 @@ +package com.zhiqim.yangcai.design.action.order; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.ScoreDesignerRecordDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.design.teamManagement; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; +import com.zhiqim.yangcai.design.dbo.order.OrderBacklog; +import com.zhiqim.yangcai.design.dbo.order.accountsSelfView; +import com.zhiqim.yangcai.design.dbo.order.backLogSelfView; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordDetail; + +/** + * 平台所有订单列表 + * + * @version v1.0.0 @author zhouwenbin 2017-8-11 新建与整理 + * @version v2.0.0 @author caohong 2021-6-2 去掉组织规则条件,增加未完成,退回等逻辑状态条件 + */ +public class OrderBackLogAction implements Action { + @Override + public void execute(HttpRequest request) throws Exception { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + +/* String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + startDate = Validates.isDateTime(startDate) ? startDate : DateTimes.getPreviousDateStringByMonth(1)+ " 00:00:00"; + endDate = Validates.isDateTime(endDate) ? endDate : DateTimes.getDateTimeString(); + + + long designId = request.getParameterLong("designId"); + String buyerNick = request.getParameter("buyerNick"); + int status = request.getParameterInt("orderStatus"); + String tids = request.getParameter("tids"); + Selector sel = new Selector(); + sel.addMaybe("designId", designId); + if (status != -1) { + if (status == 110) { + // 所有未完成订单 + sel.addMustThenGE("status", StatusConstants.ORDER_30.value());// 大于等于 正在设计 + sel.addMustThenLE("status", StatusConstants.ORDER_50.value());// 小于等于已初稿状态 + } else if (status == 120) { + // 所有未完成订单 + sel.addMustThenGE("status", StatusConstants.ORDER_30.value());// 大于等于 正在设计 + sel.addMustThenLE("status", StatusConstants.ORDER_50.value());// 小于等于已初稿状态 + + // 有审核打回记录 + sel.addMustIsNotNull("checkBackReason"); + } else { + sel.addMust("status", status); + } + } + + if (designId <= 0 && Validates.isEmpty(buyerNick) && status < 100 && Validates.isEmpty(tids) ) {// 如果输入订单号或者旺旺号不加时间限制 + sel.addMustThenGE("createTime", Sqls.toTimestamp(startDate)); + sel.addMustThenLE("createTime", Sqls.toTimestamp(endDate )); + } + + sel.addMaybe("typeId", request.getParameterLong("typeId")); + sel.addMaybe("draftType", request.getParameterInt("draftType")); + sel.addMaybe("buyerNick", buyerNick); + sel.addMaybe("tids", tids); + sel.addMaybe("designer", request.getParameter("designer")); + + sel.addMaybe("shopNick", request.getParameter("merchantId")); + sel.addMaybeThenGE("amount", request.getParameterLong("amount")); + sel.addOrderbyDesc("createTime"); + + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if (zmrOrgList.size() > 0) { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) { + orgIdArr = orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() - 1); + Selector selector2 = new Selector(); + selector2.addExpression("designer", + "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID in (" + orgIdArr + "))"); + selector2.addMust("designer", "1"); + sel.addOr(selector2); + }*/ + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + startDate = Validates.isDateTime(startDate) ? startDate : DateTimes.getPreviousDateStringByMonth(1)+ " 00:00:00"; + endDate = Validates.isDateTime(endDate) ? endDate : DateTimes.getDateTimeString(); + long designId = request.getParameterLong("designId"); + int status = request.getParameterInt("orderStatus"); + Selector sel = new Selector(); + + if(status ==1){ + sel.addMustThenGE("status", StatusConstants.ORDER_36.value());// 大于等于 正在设计 + sel.addMustThenLE("status", StatusConstants.ORDER_37.value());// 小于等于已初稿状态 + } + if(status ==2){ + sel.addMaybe("messageType", 1); + } + if(status ==3){ + sel.addMaybe("messageType", 2); + } + if(status ==4){ + sel.addMustLike("messageBody", "已被系统回收"); + } + if (designId <= 0 ) {// + sel.addMustThenGE("createTime", Sqls.toTimestamp(startDate)); + sel.addMustThenLE("createTime", Sqls.toTimestamp(endDate )); + } + sel.addMaybe("designId", designId); + sel.addMaybe("consumerCode", request.getParameter("designer")); + sel.addMaybe("shopNick", request.getParameter("merchantId")); + sel.addOrderbyDesc("createTime"); + PageResult pageResult = ORM.get(ZView.class).page(backLogSelfView.class, page, pageSize, sel); + request.setAttribute("result", pageResult); + + // 获取进度备注 + + + request.setAttribute("pageResult", pageResult); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + + + + } + + + + + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderCheckBackListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderCheckBackListAction.java new file mode 100644 index 0000000..a0dbca3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderCheckBackListAction.java @@ -0,0 +1,111 @@ +/** + * 扬彩印刷设计 + * 文件名 :OrderCheckBackListAction.java + * 创建人 :gjx + * 创建时间:2019-9-17 + */ + +package com.zhiqim.yangcai.design.action.order; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.AuthorityDao; +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdOprLog; + +/** + * 订单审核退回列表 + * + * @version 1.0 @author gjx 2019-9-17 新建与整理 + */ +public class OrderCheckBackListAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + String sessionName = request.getSessionName(); + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 10); + + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 93) + { + request.setResponseError("请勿将时间区间跨度选择大于三个月"); + return; + } + + Selector selector = new Selector(); + selector.addMustIsNotNull("checkBackReason");// 退回原因不能为空 + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("buyerNick", request.getParameter("buyerNick")); + selector.addMaybe("designer", request.getParameter("designer")); + selector.addMustThenGE("checkTime", Sqls.toTimestamp(startDate + " 00:00:00")); + selector.addMustThenLE("checkTime", Sqls.toTimestamp(endDate + " 23:59:59")); + selector.addMustThenGE("status", StatusConstants.ORDER_10.value()); + selector.addMustThenL("status", StatusConstants.ORDER_60.value()); + + ZmrOperator operator = ZmrOperatorDao.getOperator(request, sessionName); + if (operator.getOrgId() != ZmrOrgDao.getOrgRootId(request)) + { + AuthorityDao.ergodicOpecoterCode(request, sessionName, selector, "designer"); + } + if (ZmrOrgDao.getOrgRootId(request) != sessionUser.getSelectedOrgId()) + { + selector.addMust("orgId", sessionUser.getSelectedOrgId()); + } + selector.addOrderbyAsc("status"); + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + int size = pageResult.list().size(); + List designOrderList = pageResult.list(); + long[] designIds = new long[size]; + for (int i = 0; i < size; i++) + { + designIds[i] = designOrderList.get(i).getDesignId(); + } + + Map backCountMap = new HashMap(); + List ordOprLogList = ORM.get(ZTable.class).list(OrdOprLog.class, + new Selector().addMaybeInLong("designId", designIds).addMust("eventType", EventConstants.ORDER_10.value())); + for (OrdOprLog ordOprLog : ordOprLogList) + { + long designId = ordOprLog.getDesignId(); + if (!backCountMap.containsKey(designId)) + { + backCountMap.put(designId, 0); + } + int backCount = backCountMap.get(designId); + backCountMap.put(designId, backCount + 1); + } + + request.setAttribute("backCountMap", backCountMap); + request.setAttribute("pageResult", pageResult); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + request.setAttribute("operatorList", OperatorDao.getOrgOperatorList(request, sessionUser.getSelectedOrgId(), sessionName)); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderCheckFinishAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderCheckFinishAction.java new file mode 100644 index 0000000..11e54ac --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderCheckFinishAction.java @@ -0,0 +1,97 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 已审订单列表
            + */ +public class OrderCheckFinishAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + long designId = request.getParameterLong("designId"); + + Selector sel = new Selector(); + if (designId > 0) + { + sel.addOr(new Selector("designId", designId).addMust("outId", String.valueOf(designId))); + } + + sel.addMustIn("status", StatusConstants.ORDER_60.value(), StatusConstants.ORDER_62.value(), StatusConstants.ORDER_70.value()); + sel.addMaybe("typeId", request.getParameterLong("typeId")); + sel.addMaybe("buyerNick", request.getParameter("buyerNick")); + sel.addMustThenGE("checkTime", Sqls.toTimestamp(startDate + " 00:00:00")); + sel.addMustThenLE("checkTime", Sqls.toTimestamp(endDate + " 23:59:59")); + + String otherText = request.getParameter("otherInfo", ""); + if (!Validates.isEmptyBlank(otherText)) + { + sel.addOr(new Selector().addMaybeLike("userContact", otherText).addMaybeLike("userMobile", otherText)); + } + + sel.addOrderbyDesc("checkTime"); + // 根据组织显示 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (ZmrOrgDao.getOrgRootId(request) != sessionUser.getSelectedOrgId()) + { + sel.addMust("orgId", sessionUser.getSelectedOrgId()); + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, sel); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + Map typeMap = new HashMap(); + List typeList = DesignTypeDao.listAll(); + for (DesignType designType : typeList) + { + typeMap.put(designType.getTypeId(), designType); + } + + request.setAttribute("typeList", typeList); + request.setAttribute("typeMap", typeMap); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderCheckWaitAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderCheckWaitAction.java new file mode 100644 index 0000000..472ee43 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderCheckWaitAction.java @@ -0,0 +1,82 @@ +package com.zhiqim.yangcai.design.action.order; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; + +/** + * 印前待审订单列表 + * + * @version v1.0.0 @author zhouwenbin 2017-8-11 新建与整理 + */ + +public class OrderCheckWaitAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 30); + + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 60) + { + request.setResponseError("请勿将时间区间跨度选择大于2个月"); + return; + } + long designId = request.getParameterLong("designId"); + String buyerNick = request.getParameter("buyerNick"); + String afterNames = request.getParameter("afterNames"); + String designIdold = request.getParameter("designIdold"); + Selector sel = new Selector(); + sel.addMaybe("designId", designId); + sel.addMaybe("draftType", request.getParameterInt("draftType")); + sel.addMust("status", StatusConstants.ORDER_55.value()); + sel.addMaybe("typeId", request.getParameterLong("typeId")); + sel.addMaybe("buyerNick", buyerNick); + sel.addMaybe("shopNick", request.getParameter("merchantId")); + sel.addMaybeLike("orderText", designIdold); + sel.addMaybe("tids", request.getParameter("tid")); + if ("true".equals(afterNames)) + { + sel.addMustIsNotNull("afterNames"); + } + else if ("false".equals(afterNames)) + { + sel.addMustIsNull("afterNames"); + } + + sel.addOrderbyAsc("createTime"); + + PageResult pageResult = ORM.get(ZView.class).page(DesignSelfView.class, page, pageSize, sel); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + Map typeMap = new HashMap(); + List typeList = DesignTypeDao.listAll(); + for (DesignType designType : typeList) + { + typeMap.put(designType.getTypeId(), designType); + } + + request.setAttribute("typeList", typeList); + request.setAttribute("typeMap", typeMap); + request.setAttribute("afterNames", afterNames); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderDraftCheckWaitAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderDraftCheckWaitAction.java new file mode 100644 index 0000000..b5b0080 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderDraftCheckWaitAction.java @@ -0,0 +1,70 @@ +package com.zhiqim.yangcai.design.action.order; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; + +/** + * 初稿待审订单列表 + * + * @version v1.0.0 @author caohong 2021-9-10 11:09:38 + */ + +public class OrderDraftCheckWaitAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + + long designId = request.getParameterLong("designId"); + String buyerNick = request.getParameter("buyerNick"); + String afterNames = request.getParameter("afterNames"); + + Selector sel = new Selector(); + sel.addMaybe("designId", designId); + sel.addMaybe("draftType", request.getParameterInt("draftType")); + sel.addMust("status", StatusConstants.ORDER_40.value()); + sel.addMaybe("typeId", request.getParameterLong("typeId")); + sel.addMaybe("buyerNick", buyerNick); + sel.addMaybe("shopNick", request.getParameter("merchantId")); + sel.addMaybe("tids", request.getParameter("tid")); + if ("true".equals(afterNames)) + { + sel.addMustIsNotNull("afterNames"); + } + else if ("false".equals(afterNames)) + { + sel.addMustIsNull("afterNames"); + } + + sel.addOrderbyAsc("createTime"); + + PageResult pageResult = ORM.get(ZView.class).page(DesignSelfView.class, page, pageSize, sel); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + Map typeMap = new HashMap(); + List typeList = DesignTypeDao.listAll(); + for (DesignType designType : typeList) + { + typeMap.put(designType.getTypeId(), designType); + } + + request.setAttribute("typeList", typeList); + request.setAttribute("typeMap", typeMap); + request.setAttribute("afterNames", afterNames); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderEndCheckWaitAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderEndCheckWaitAction.java new file mode 100644 index 0000000..512f2df --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderEndCheckWaitAction.java @@ -0,0 +1,71 @@ +package com.zhiqim.yangcai.design.action.order; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; + +/** + * 定稿待审订单列表 + * + * @version v1.0.0 @author caohong 2021-9-10 11:10:31 + */ + +public class OrderEndCheckWaitAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + long designId = request.getParameterLong("designId"); + String buyerNick = request.getParameter("buyerNick"); + String afterNames = request.getParameter("afterNames"); + + Selector sel = new Selector(); + sel.addMaybe("designId", designId); + sel.addMaybe("draftType", request.getParameterInt("draftType")); + sel.addMust("status", StatusConstants.ORDER_52.value()); + sel.addMaybe("typeId", request.getParameterLong("typeId")); + sel.addMaybe("buyerNick", buyerNick); + sel.addMaybe("shopNick", request.getParameter("merchantId")); + sel.addMaybe("tids", request.getParameter("tid")); + if ("true".equals(afterNames)) + { + sel.addMustIsNotNull("afterNames"); + } + else if ("false".equals(afterNames)) + { + sel.addMustIsNull("afterNames"); + } + + sel.addOrderbyDesc("isUrgent"); + sel.addOrderbyAsc("designDraftTime"); + sel.addOrderbyAsc("createTime"); + + PageResult pageResult = ORM.get(ZView.class).page(DesignSelfView.class, page, pageSize, sel); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + Map typeMap = new HashMap(); + List typeList = DesignTypeDao.listAll(); + for (DesignType designType : typeList) + { + typeMap.put(designType.getTypeId(), designType); + } + + request.setAttribute("typeList", typeList); + request.setAttribute("typeMap", typeMap); + request.setAttribute("afterNames", afterNames); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderListAction.java new file mode 100644 index 0000000..772e14c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderListAction.java @@ -0,0 +1,189 @@ +package com.zhiqim.yangcai.design.action.order; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.design.teamManagement; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; + +/** + * 平台所有订单列表 + * + * @version v1.0.0 @author zhouwenbin 2017-8-11 新建与整理 + * @version v2.0.0 @author caohong 2021-6-2 去掉组织规则条件,增加未完成,退回等逻辑状态条件 + */ +public class OrderListAction implements Action { + @Override + public void execute(HttpRequest request) throws Exception { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 183) { + request.setResponseError("请勿将时间区间跨度选择大于六个月"); + return; + } + long designId = request.getParameterLong("designId"); + String buyerNick = request.getParameter("buyerNick"); + int status = request.getParameterInt("orderStatus"); + String tids = request.getParameter("tids"); + Selector sel = new Selector(); + sel.addMaybe("designId", designId); + if (status != -1) { + if (status == 110) { + // 所有未完成订单 + sel.addMustThenGE("status", StatusConstants.ORDER_30.value());// 大于等于 正在设计 + sel.addMustThenLE("status", StatusConstants.ORDER_50.value());// 小于等于已初稿状态 + } else if (status == 120) { + // 所有未完成订单 + sel.addMustThenGE("status", StatusConstants.ORDER_30.value());// 大于等于 正在设计 + sel.addMustThenLE("status", StatusConstants.ORDER_50.value());// 小于等于已初稿状态 + + // 有审核打回记录 + sel.addMustIsNotNull("checkBackReason"); + } else { + sel.addMust("status", status); + } + } + + if (designId <= 0 && Validates.isEmpty(buyerNick) && status < 100 && Validates.isEmpty(tids)) {// 如果输入订单号或者旺旺号不加时间限制 + sel.addMustThenGE("createTime", Sqls.toTimestamp(startDate + " 00:00:00")); + sel.addMustThenLE("createTime", Sqls.toTimestamp(endDate + " 23:59:59")); + } + + sel.addMaybe("typeId", request.getParameterLong("typeId")); + sel.addMaybe("draftType", request.getParameterInt("draftType")); + sel.addMaybe("buyerNick", buyerNick); + sel.addMaybe("tids", tids); + + sel.addMaybe("designer", request.getParameter("designer")); + + sel.addMaybe("shopNick", request.getParameter("merchantId")); + sel.addMaybeThenGE("amount", request.getParameterLong("amount")); + sel.addOrderbyDesc("createTime"); + + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + + Selector selector3 = new Selector(); + selector3.addMustLike("deptTeam", sessionUser.getSessionName()); + selector3.addMaybe("isEnabled", true); + List teamManagementList = ORM.get(ZTable.class).list(teamManagement.class, selector3); + if (teamManagementList.size() > 0) { + teamManagement team = teamManagementList.get(0); + if (!team.getDeptOrg().equals("")) { + String zmrOperatorId = ""; + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + selOrg.addMustIn("orgName", team.getDeptOrg().split(",")); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + String deptId = ""; + for (ZmrOrg zmrOrg : orgList) { + deptId = deptId + zmrOrg.getOrgId() + ","; + } + + deptId = deptId.substring(0, deptId.length() - 1); + Selector selector4 = new Selector(); + selector4.addMustInLong("orgId", org.zhiqim.kernel.util.Arrays.toLongArray(deptId)); + List ZmrOperatorList = ORM.get(ZTable.class).list(ZmrOperator.class, selector4); + if (ZmrOperatorList.size() > 0) { + for (ZmrOperator zmrOperator : ZmrOperatorList) { + zmrOperatorId = zmrOperatorId + zmrOperator.getOperatorName() + ","; + } + zmrOperatorId = zmrOperatorId.substring(0, zmrOperatorId.length() - 1); + + } + String[] mergedArray = mergeArraysUnique(team.getTeamSecret().split(","), zmrOperatorId.split(",")); + boolean found = false; + if (request.getParameter("designer") != null && request.getParameter("designer").length() > 0) { + for (String element : mergedArray) { + if (element.equals(request.getParameter("designer"))) { + found = true; + break; + } + } + } + if (!found) { + sel.addMustIn("shopNick", team.getMerchantName().split(",")); + //sel.addMustIn("designer", mergedArray); + + } + } + } + + if (zmrOrgList.size() > 0) { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) { + orgIdArr = orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() - 1); + Selector selector2 = new Selector(); + selector2.addExpression("designer", + "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID in (" + orgIdArr + "))"); + selector2.addMust("designer", "1"); + sel.addOr(selector2); + } + + PageResult pageResult = ORM.get(ZView.class).page(DesignSelfView.class, page, pageSize, sel); + pageResult.addConditionMap(request.getParameterMap()); + + // 获取进度备注 + Map progressNoteMap = new HashMap(); + for (DesignSelfView order : pageResult.list()) { + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class).item(OrdProgressNote.class, + new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" + : "" + + "

            " + + note.getOrdProgressNote() + "

            " + Sqls.toDateTimeString(note.getCreateTime()) + + "
            "); + } + + request.setAttribute("pageResult", pageResult); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + request.setAttribute("progressNoteMap", progressNoteMap); + + List typeList = DesignTypeDao.listAll(); + request.setAttribute("typeList", typeList); + } + + public static String[] mergeArraysUnique(String[] array1, String[] array2) { + Set set = new LinkedHashSet<>(); // 使用LinkedHashSet以保持插入顺序 + + // 添加两个数组到集合中,重复的元素将不会被添加 + set.addAll(Arrays.asList(array1)); + set.addAll(Arrays.asList(array2)); + + return set.toArray(new String[0]); // 返回包含所有元素的数组,没有重复 + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderLogListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderLogListAction.java new file mode 100644 index 0000000..f375dc2 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderLogListAction.java @@ -0,0 +1,38 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.OrdOprLog; + +public class OrderLogListAction implements Action +{ + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + long designId = request.getParameterLong("designId", 0); + Selector sel = new Selector(); + sel.addMust("designId", designId); + sel.addOrderbyDesc("createTime"); + sel.addOrderbyDesc("logId"); + PageResult pageResult = ORM.get(ZTable.class).page(OrdOprLog.class, page, pageSize, sel); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderRefundListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderRefundListAction.java new file mode 100644 index 0000000..a37b57e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderRefundListAction.java @@ -0,0 +1,54 @@ +package com.zhiqim.yangcai.design.action.order; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.DesignOrderRefundReasonCache; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; + +/** + * 退款列表 + * + * @version v1.0.0 @author 高佳新 2019-05-05 @modify:谢盼 2021-06-03 新建与整理 + */ +public class OrderRefundListAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + Global.get(DesignOrderRefundReasonCache.class).doRefresh(); + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + + Selector sel = new Selector(); + sel.addMust("status", StatusConstants.ORDER_34.value()); + sel.addMaybe("designId", request.getParameterLong("designId")); + long refundReason = request.getParameterLong("refundReason"); + if (refundReason >= 0) + { + sel.addMust("refundReason", refundReason); + } + sel.addMaybe("typeId", request.getParameterLong("typeId")); + sel.addMaybe("draftType", request.getParameterInt("draftType")); + sel.addMaybe("buyerNick", request.getParameter("buyerNick")); + sel.addMaybe("shopNick", request.getParameter("merchantId")); + + sel.addOrderbyDesc("refundTime"); + PageResult pageResult = ORM.get(ZView.class).page(DesignSelfView.class, page, pageSize, sel); + pageResult.addConditionMap(request.getParameterMap()); + // 退款原因查询列表 + request.setAttribute("pageResult", pageResult); + List typeList = DesignTypeDao.listAll(); + request.setAttribute("typeList", typeList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderTagListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderTagListAction.java new file mode 100644 index 0000000..67f0b57 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/OrderTagListAction.java @@ -0,0 +1,117 @@ +/** + * 扬彩印刷设计 + * 文件名 :OrderTagListAction.java + * 创建人 :gjx + * 创建时间:2019-12-19 + */ + +package com.zhiqim.yangcai.design.action.order; + +import java.util.HashMap; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.IndustryLabelCache; +import com.zhiqim.yangcai.cache.LabelDimensionCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.model.IndustryLabelModel; +import com.zhiqim.yangcai.design.model.LabelDimensionModel; + +/** + * [简要描述]订单标签列表:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-12-19 新建与整理 + */ +public class OrderTagListAction implements Action, ZmrConstants +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (sessionUser == null) + { + request.setRedirectTop("/" + request.getContextAttributeString(ZMR_PATH) + "/logout.htm", "您闲置太久或未登录,正在返回初始界面,请确定....."); + return; + } + + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 183) + { + request.setResponseError("请勿将时间区间跨度选择大于六个月"); + return; + } + + Selector selector = new Selector(); + selector.addMustThenGE("status", StatusConstants.ORDER_55.value()); + selector.addMustThenGE("draftType", DraftConstants.DRAFT_COMMON_DESIGN.value()); + selector.addMustThenGE("createTime", Sqls.toTimestamp(startDate + " 00:00:00")); + selector.addMustThenLE("createTime", Sqls.toTimestamp(endDate + " 23:59:59")); + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("typeId", request.getParameterLong("typeId")); + selector.addMaybe("buyerNick", request.getParameter("buyerNick")); + selector.addMaybe("industryId", request.getParameterLong("industryId")); + selector.addMaybe("industryId", request.getParameterLong("waitRedress")); + selector.addMaybe("designer", request.getParameter("designer")); + selector.addMustIsNotNull("labelIds"); + + PageResult pageResult = ORM.get(ZView.class).page(DesignSelfView.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + Map map = new HashMap(); + + String subIndustry = ""; + String value = ""; + for (LabelDimensionModel label : Global.get(LabelDimensionCache.class).getDimensionAll()) + { + if ("子行业".endsWith(label.getDimensionName())) + { + subIndustry = label.getDimensionId(); + break; + } + } + + Map labelMap = Global.get(IndustryLabelCache.class).mapAll(); + + for (DesignSelfView order : pageResult.list()) + { + + String[] tags = Validates.isNotEmpty(order.getLabelIds()) ? order.getLabelIds().split(",") : new String[0]; + for (int i = 0; i < tags.length; i++) + { + String tag = tags[i]; + IndustryLabelModel labelModel = labelMap.get(Long.valueOf(tag)); + if (labelModel != null && subIndustry.equals(labelModel.getDimensionId())) + { + value = labelModel.getLabelName(); + } + } + map.put(order.getDesignId(), value); + } + + request.setAttribute("pageResult", pageResult); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + request.setAttribute("map", map); + request.setAttribute("designerList", OperatorDao.getOrgOperatorAllList(sessionUser.getSelectedOrgId())); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ProgressNoteAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ProgressNoteAction.java new file mode 100644 index 0000000..0e22c47 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ProgressNoteAction.java @@ -0,0 +1,46 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; + +/**** + * 进度备注 + * + * @version v1.0.0 @author longguizhi 2018-9-13 新建与整理 + */ +public class ProgressNoteAction implements Action +{ + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 10); + + long designId = request.getParameterLong("designId"); + + Selector selector = new Selector(); + selector.addMust("designId", designId); + selector.addOrderbyDesc("createTime"); + PageResult pageResult = ORM.get(ZTable.class).page(OrdProgressNote.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("designId", designId); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/PushReturnOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/PushReturnOrderAction.java new file mode 100644 index 0000000..0a57bcc --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/PushReturnOrderAction.java @@ -0,0 +1,5 @@ +package com.zhiqim.yangcai.design.action.order; + +public class PushReturnOrderAction { + +} \ No newline at end of file diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcApplyDetailAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcApplyDetailAction.java new file mode 100644 index 0000000..d7c8351 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcApplyDetailAction.java @@ -0,0 +1,51 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.design.constants.AwardedTypeConstants; +import com.zhiqim.yangcai.design.dbo.qc.QcApplyScore; +import com.zhiqim.yangcai.design.dbo.qc.QcAwardedType; + +/** + * 申请详情(图片) + * + * @version v1.0.0 @author liuhu 2019-1-29 新建与整理 + */ +public class QcApplyDetailAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long applyId = request.getParameterLong("applyId"); + boolean readonly = request.getParameterBoolean("readonly"); + QcApplyScore apply = ORM.get(ZTable.class).item(QcApplyScore.class, applyId); + if (apply == null) + { + request.setResponseError("订单申请不存在"); + return; + } + + request.setAttribute("readonly", readonly); + request.setAttribute("apply", apply); + request.setAttribute("qcTypeIdChecked", apply.getQcTypeId()); + List awardedTypeList = AwardedTypeConstants.getAwardedTypeList(); + request.setAttribute("awardedTypeList", awardedTypeList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcApplyScoreAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcApplyScoreAction.java new file mode 100644 index 0000000..477911f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcApplyScoreAction.java @@ -0,0 +1,34 @@ +/** + * 扬彩印刷设计 + * 文件名 :QcApplyScoreAction.java + * 创建人 :高佳新 + * 创建时间:2019-5-20 + */ + +package com.zhiqim.yangcai.design.action.order; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + +import com.zhiqim.yangcai.design.constants.AwardedTypeConstants; +import com.zhiqim.yangcai.design.dbo.qc.QcAwardedType; + +/** + * + * 查询加分类型列表 + * + * @version 1.0 @author 高佳新 2019-5-21 新建与整理 + */ +public class QcApplyScoreAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + List awardedTypeList = AwardedTypeConstants.getAwardedTypeList(); + request.setAttribute("awardedTypeList", awardedTypeList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcApplyScoreListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcApplyScoreListAction.java new file mode 100644 index 0000000..51b94a1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcApplyScoreListAction.java @@ -0,0 +1,96 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.AwardedTypeConstants; +import com.zhiqim.yangcai.design.dbo.qc.QcApplyScore; +import com.zhiqim.yangcai.design.dbo.qc.QcAwardedType; + +/** + * 质检加分列表 + * + * @version v1.0.0 @author liuhu 2019-1-29 新建与整理 + */ +public class QcApplyScoreListAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + int applyFlag = request.getParameterInt("applyFlag"); + Long qcTypeId = request.getParameterLong("qcTypeId"); + String qcAwardedAuditor = request.getParameter("qcAwardedAuditor"); + String designer = request.getParameter("designer"); + + String beginAuditDate = request.getParameter("beginAuditDate"); + String endAuditDate = request.getParameter("endAuditDate"); + + String beginDate = request.getParameter("beginDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + + Selector selector = new Selector(); + selector.addMustThenGE("applyTime", Sqls.toTimestamp(beginDate + " 00:00:00")); + selector.addMustThenLE("applyTime", Sqls.toTimestamp(endDate + " 23:59:59")); + selector.addMaybe("designer", designer); + if (beginAuditDate != null && !beginAuditDate.equals("")) + { + selector.addMustThenGE("qcAwardedAuditorTime", Sqls.toTimestamp(beginAuditDate + " 00:00:00")); + selector.addMustThenLE("qcAwardedAuditorTime", Sqls.toTimestamp(endAuditDate + " 23:59:59")); + } + selector.addMaybe("applyFlag", applyFlag); + selector.addMaybeLike("qcAwardedAuditor", qcAwardedAuditor); + selector.addMaybe("qcTypeId", qcTypeId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + selector.addOrderbyDesc("applyTime"); + request.setAttribute("qcTypeIdSelected", qcTypeId); + PageResult pageResult = ORM.get(ZTable.class).page(QcApplyScore.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + List operatorList = ORM.get(ZTable.class).list(ZmrOperator.class); + if (org.getOrgLevel() > 0) + { + operatorList = ORM.get(ZTable.class).list(ZmrOperator.class, new Selector("orgId", orgId)); + } + + List awardedTypeList = AwardedTypeConstants.getAwardedTypeList(); + request.setAttribute("awardedTypeList", awardedTypeList); + request.setAttribute("applyFlag", applyFlag); + request.setAttribute("qcAwardedAuditor", qcAwardedAuditor); + request.setAttribute("operatorList", operatorList); + request.setAttribute("beginAuditDate", beginAuditDate); + request.setAttribute("endAuditDate", endAuditDate); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + request.setAttribute("pageResult", pageResult); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcJudgeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcJudgeAction.java new file mode 100644 index 0000000..67fb072 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcJudgeAction.java @@ -0,0 +1,49 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.order; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.qc.QcParameter; + +/** + * 质检判定类 + * + * @version v1.0.0 @author liuhu 2019-1-16 新建与整理 + */ +public class QcJudgeAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if(order == null) + { + request.returnCloseDialog("订单不存在"); + return; + } + List list = ORM.get(ZTable.class).list(QcParameter.class, new Selector("flag", 1)); + + request.setAttribute("order", order); + request.setAttribute("list", list); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcOrderListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcOrderListAction.java new file mode 100644 index 0000000..837e39d --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcOrderListAction.java @@ -0,0 +1,139 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; +import com.zhiqim.yangcai.design.dbo.stat.PerformanceStatistics; +import com.zhiqim.yangcai.design.dbo.stat.RefundParameter; + +/** + * 质检订单列表 + * + * @version v1.0.0 @author liuhu 2019-1-16 新建与整理 + */ +public class QcOrderListAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + String designer = request.getParameter("designer"); + long designId = request.getParameterLong("designId"); + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateString(7)); + String stopDate = request.getParameter("stopDate", DateTimes.getDateString()); + int qcFlag = request.getParameterInt("qcFlag"); + int orderStatus = request.getParameterInt("orderStatus"); + int draftType = request.getParameterInt("draftType"); + int day = DateTimes.compareDay(stopDate, startDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择为大于一个月"); + return; + } + // String beginDate = request.getParameter("beginDate", + // DateTimes.getPreviousDateStringByMonth(1)); + // String endDate = request.getParameter("endDate", DateTimes.getDateString()); + + Selector selector = new Selector(); + selector.addMaybe("designer", designer); + selector.addMaybe("designId", designId); + selector.addMaybe("status", orderStatus); + selector.addMaybe("draftType", draftType); + selector.addMaybeThenGE("createTime", Sqls.toTimestamp(startDate + " 00:00:00")); + selector.addMaybeThenLE("createTime", Sqls.toTimestamp(stopDate + " 23:59:59")); + + // selector.addMaybeThenGE("designBeginTime", Sqls.toTimestamp(beginDate + " 00:00:00")); + // selector.addMaybeThenLE("designBeginTime", Sqls.toTimestamp(endDate + " 23:59:59")); + + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + selector.addMustNotEqual("qcFlag", 2); + selector.addMaybe("qcFlag", qcFlag); + selector.addOrderbyAsc("qcFlag"); + selector.addOrderbyDesc("designReceiveTime"); + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + List operatorList = org.getOrgLevel() > 0 ? ORM.get(ZTable.class).list(ZmrOperator.class, new Selector("orgId", orgId)) : ORM.get( + ZTable.class).list(ZmrOperator.class); + + // 查询退款率超标设计师 + List designerList = new ArrayList(); + int currentDay = DateTimes.getCurrentDay(); + String date = currentDay < 10 ? DateTimes.getPreviousDateStringByMonth(2) : DateTimes.getPreviousDateStringByMonth(1); + date = date.substring(0, date.lastIndexOf("-")); + + RefundParameter parameter = ORM.get(ZTable.class).item(RefundParameter.class); + + Selector select = new Selector(); + select.addMust("statDate", date); + select.addMustThenG("refundRate", parameter.getStandardRefundRate()); + List list = ORM.get(ZTable.class).list(PerformanceStatistics.class, select); + for (PerformanceStatistics stat : list) + { + designerList.add(stat.getDesigner()); + } + + // 进度备注 + Map progressNoteMap = new HashMap(); + for (DesignOrder order : pageResult.list()) + { + if (Validates.isEmptyBlank(order.getDesigner())) + { + continue; + } + + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class) + .item(OrdProgressNote.class, new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" : note.getOrdProgressNote()); + } + + request.setAttribute("progressNoteMap", progressNoteMap); + + request.setAttribute("draftType", draftType); + request.setAttribute("orderStatus", orderStatus); + request.setAttribute("qcFlag", qcFlag); + request.setAttribute("designerList", designerList); + request.setAttribute("operatorList", operatorList); + request.setAttribute("startDate", startDate); + request.setAttribute("stopDate", stopDate); + request.setAttribute("pageResult", pageResult); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcPersonalAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcPersonalAction.java new file mode 100644 index 0000000..0feb0fc --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcPersonalAction.java @@ -0,0 +1,143 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.order; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constant.PerformanceStatConstants; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.qc.QcApplyScore; +import com.zhiqim.yangcai.design.dbo.qc.QcRecord; + +/** + * 我的质检 + * + * @version v1.0.0 @author liuhu 2019-2-20 新建与整理 + */ +public class QcPersonalAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = 8; + + String operatorCode = request.getSessionName(); + String year = request.getParameter("year", DateTimes.getCurrentYear()+""); + String month = request.getParameter("month", DateTimes.getCurrentMonth() +""); + String dateTime = year + "-" + month; + int day = DateTimes.getMonthDays(year + month); + + Selector selector = new Selector(); + selector.addMustThenGE("qcTime", Sqls.toTimestamp(dateTime+ "-01" + " 00:00:00")); + selector.addMustThenLE("qcTime", Sqls.toTimestamp(dateTime + "-" + day + " 23:59:59")); + selector.addMust("designer", operatorCode); + selector.addMust("qcFlag", 2); + + List list = ORM.get(ZTable.class).list(QcRecord.class, selector); + + Map map = new HashMap(); + for (QcRecord record : list) + { + String reason = record.getReason(); + if (!map.containsKey(reason)) + map.put(reason, 1); + + else + map.put(reason, map.get(reason) + 1); + } + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, list); + pageResult.addConditionMap(request.getParameterMap()); + + Selector select = new Selector(); + select.addMustThenGE("applyTime", Sqls.toTimestamp(dateTime+ "-01" + " 00:00:00")); + select.addMustThenLE("applyTime", Sqls.toTimestamp(dateTime + "-" + day + " 23:59:59")); + select.addMust("designer", operatorCode); + + PageResult result = ORM.get(ZTable.class).page(QcApplyScore.class, page, pageSize, select); + + //计算当月质检分数 + double score = PerformanceStatConstants.QC_SCORE; //质检分数 + double punishScore = 0; //质检扣分 + double applyScore = 0; //质检加分 + + Selector selector2 = new Selector(); + selector2.addMustThenGE("qcTime", Sqls.toTimestamp(dateTime + "-01" + " 00:00:00")); + selector2.addMustThenLE("qcTime", Sqls.toTimestamp(dateTime + "-" + day + " 23:59:59")); + selector2.addMust("qcFlag", 2); + selector2.addMust("designer", operatorCode); + List qcList = ORM.get(ZTable.class).list(QcRecord.class, selector); + List repeatList = new ArrayList(); + + for (QcRecord record : qcList) + { + String designer = record.getDesigner(); + String reason = record.getReason(); + String date = Sqls.toDateString(record.getQcTime()); + + boolean flag = true; + for (QcRecord qcRecord : repeatList) + {//单个设计师一天内 多条订单违反同一条违规内容 只统计一次违规扣分 + String designer2 = qcRecord.getDesigner(); + String reason2 = qcRecord.getReason(); + String date2 = Sqls.toDateString(qcRecord.getQcTime()); + if (designer.equals(designer2) && reason.equals(reason2) && date.equals(date2)) + { + flag = false; + break; + } + } + + if (flag) + punishScore += record.getScore(); + } + + Selector selector3 = new Selector(); + selector3.addMustThenGE("applyTime", Sqls.toTimestamp(dateTime + "-01" + " 00:00:00")); + selector3.addMustThenLE("applyTime", Sqls.toTimestamp(dateTime + "-" + day + " 23:59:59")); + selector3.addMust("applyFlag", 1); + selector3.addMust("designer", operatorCode); + List applyList = ORM.get(ZTable.class).list(QcApplyScore.class, selector3); + + for (QcApplyScore apply : applyList) + { + applyScore += apply.getScore(); + } + + List yearList = StatDao.yearList(2018, DateTimes.getCurrentYear()); + + request.setAttribute("score", score + applyScore - punishScore); + request.setAttribute("result", result); + request.setAttribute("designer", operatorCode); + request.setAttribute("year", year); + request.setAttribute("yearList", yearList); + request.setAttribute("month", month); + request.setAttribute("pageResult", pageResult); + request.setAttribute("map", map); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcViolationsDetailAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcViolationsDetailAction.java new file mode 100644 index 0000000..af3e1e1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcViolationsDetailAction.java @@ -0,0 +1,47 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.qc.QcRecord; + +/** + * 质检违规详情 + * + * @version v1.0.0 @author liuhu 2019-1-25 新建与整理 + */ +public class QcViolationsDetailAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + + QcRecord record = ORM.get(ZTable.class).item(QcRecord.class, designId); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, new Selector("designId", designId).addMust("attaModul", FileTypeConstants.FILE_QC_JUDGE.value())); + + request.setAttribute("record", record); + request.setAttribute("order", order); + request.setAttribute("atta", atta); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcViolationsListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcViolationsListAction.java new file mode 100644 index 0000000..7af9df0 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/QcViolationsListAction.java @@ -0,0 +1,85 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 质检违规订单列表类 + * + * @version v1.0.0 @author liuhu 2019-1-18 新建与整理 + */ +public class QcViolationsListAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + String designer = request.getParameter("designer"); + String beginDate = request.getParameter("beginDate", DateTimes.getPreviousDateString(30)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择为大于一个月"); + return; + } + long designId = request.getParameterLong("designId"); + int status = request.getParameterInt("status"); + int draftType = request.getParameterInt("draftType"); + + Selector selector = new Selector(); + selector.addMaybe("designer", designer); + selector.addMust("qcFlag", 2); + selector.addMaybe("designId", designId); + selector.addMaybe("status", status); + selector.addMaybe("draftType", draftType); + selector.addMaybeThenGE("createTime", Sqls.toTimestamp(beginDate + " 00:00:00")); + selector.addMaybeThenLE("createTime", Sqls.toTimestamp(endDate + " 23:59:59")); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + List operatorList = org.getOrgLevel() > 0 ? ORM.get(ZTable.class).list(ZmrOperator.class, new Selector("orgId", orgId)) : ORM.get( + ZTable.class).list(ZmrOperator.class); + + request.setAttribute("operatorList", operatorList); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + request.setAttribute("designer", designer); + request.setAttribute("pageResult", pageResult); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ReceiveOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ReceiveOrderAction.java new file mode 100644 index 0000000..e863fd0 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/ReceiveOrderAction.java @@ -0,0 +1,80 @@ +package com.zhiqim.yangcai.design.action.order; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.design.teamManagement; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; + +/** + * 抢单大厅列表 + * + * @version v1.0.0 @author hc 2021.6.1 + */ +public class ReceiveOrderAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 12); + + Timestamp timestamp = Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringBySecond(300)); + Selector selector = new Selector(); + selector.addMaybe("typeId", request.getParameterLong("typeId")); + selector.addMust("status", StatusConstants.ORDER_10.value()); // 等待设计 + selector.addMustThenL("createTime", timestamp); + + // 印前组织只抢标准自来稿,反之需要过滤掉 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + // 印前组织 + if (sessionUser.getSelectedOrgId() == 2018280240394L) + { + selector.addMust("draftType", DraftConstants.DRAFT_STANDARD.value()); + } + else + { + selector.addMustNotEqual("draftType", DraftConstants.DRAFT_STANDARD.value()); + } + + selector.addOr(new Selector("orgId", 0).addMustIsNull("orgId")); // 未派单给组织 + selector.addOrderbyDesc("createTime"); + + Selector selector3 = new Selector(); + selector3.addMustLike("deptTeam", sessionUser.getSessionName()); + selector3.addMaybe("isEnabled", true); + List teamManagementList = ORM.get(ZTable.class).list(teamManagement.class, selector3); + if(teamManagementList.size()>0){ + teamManagement team = teamManagementList.get(0); + if(!team.getDeptOrg().equals("")){ + selector.addMustIn("shopNick",team.getMerchantName().split(",")); + } + } + PageResult pageResult = ORM.get(ZView.class).page(DesignSelfView.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + + List typeList = DesignTypeDao.listAll(); + request.setAttribute("typeList", typeList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/SelectRefundOrderImgAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/SelectRefundOrderImgAction.java new file mode 100644 index 0000000..3f51bba --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/SelectRefundOrderImgAction.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 单个退款订单查询 + * + * @version v1.0.0 @author 高佳新 2019-05-05 新建与整理 + */ +@AnAlias("SelectRefundOrderImgAction") +@AnIntercept("chkZmrLogin") +public class SelectRefundOrderImgAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + } + request.setAttribute("order", order); + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector("designId", designId).addMust("attaModul", FileTypeConstants.FILE_REFUND.value())); + if (attaList.size() <= 0) + { + request.setResponseError("该订单未上传截图"); + return; + } + request.setAttribute("attaList", attaList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimelinessOrgStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimelinessOrgStatAction.java new file mode 100644 index 0000000..667985b --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimelinessOrgStatAction.java @@ -0,0 +1,204 @@ +/** + * 扬彩印刷设计 + * 文件名 :TimelinessOrgStatAction.java + * 创建人 :高佳新 + * 创建时间:2019-7-11 + */ + +package com.zhiqim.yangcai.design.action.order; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.model.TimelinessOrgStatModel; + +/** + * + * 组织初稿时效统计 + * + * @version 1.0 @author gjx 2019-7-11 新建与整理 + */ +public class TimelinessOrgStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String startDate = request.getParameter("startDate", DateTimes.getDateString()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + Long typeId = request.getParameterLong("typeId"); + + Selector selector = new Selector(); + selector.addMustThenGE("createTime", Sqls.toTimestamp(startDate + " 00:00:00")); + selector.addMustThenLE("createTime", Sqls.toTimestamp(endDate + " 23:59:59")); + // selector.addMustNotEqual("status", StatusConstants.ORDER_F100.value()); + selector.addMustNotIn("status", StatusConstants.ORDER_F100.value(), StatusConstants.ORDER_F110.value()); + selector.addMaybe("typeId", typeId); + + List designOrderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + + Map designTypeMap = new HashMap<>(); // 产品类型时效信息Map + Map proTypeMap = new HashMap<>(); // 产品类型Map + Map orgMap = new HashMap<>(); // 组织map + Map orgTimelinessMap = new HashMap(); + List designTypeList = DesignTypeDao.listAll(); + for (DesignType designType : designTypeList) + { + designTypeMap.put(designType.getTypeName(), designType.getEffectiveTime()); + proTypeMap.put(designType.getTypeId(), designType.getTypeName()); + } + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class); // 得到所有组织id与名称 + if (zmrOrgList.size() == 0) + { + request.setResponseError("系统组织异常"); + return; + } + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgMap.put(zmrOrg.getOrgId(), zmrOrg.getOrgName()); + } + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + int firstDraftSum = 0;// 总初稿量 + int timelinessSum = 0;// 初稿时效内订单量 + int sleepDraftSum = 0;// 等待初稿量 + int sleepTimelinessSum = 0;// 等待初稿时效内订单量 + for (DesignOrder designOrder : designOrderList) + { + Integer minute = designTypeMap.get(proTypeMap.get(designOrder.getTypeId())); // 获取订单产品对应时效(分钟) + String orgName = orgMap.get(designOrder.getOrgId()); // 获取组织名称 + if (orgName == null) + { + orgName = "印前改稿组织"; + } + if (!orgTimelinessMap.containsKey(orgName)) + { + orgTimelinessMap.put(orgName, new TimelinessOrgStatModel(orgName));// 组织名称 + } + TimelinessOrgStatModel orgModel = orgTimelinessMap.get(orgName); + orgModel.setOrgOrderSum(orgModel.getOrgOrderSum() + 1); // 组织总单量 + if (designOrder.getStatus() >= StatusConstants.ORDER_50.value()) + { + orgModel.setOrgFirstDraftSum(orgModel.getOrgFirstDraftSum() + 1); // 组织已初稿量 + firstDraftSum++; + if (designOrder.getCreateTime() != null && minute != null) + { + String createTime = DateTimes.getNextDateTimeStringBySecond(simple.format(designOrder.getCreateTime()), minute * 60); + Date nowCreateTime = simple.parse(createTime); + if (designOrder.getDesignDraftTime() != null) + { + String draftTime = simple.format(designOrder.getDesignDraftTime()); + Date draftDateTime = simple.parse(draftTime); + if (draftDateTime.getTime() <= nowCreateTime.getTime()) + {// 初稿时间小于等于订单创建时间+订单产品初稿时效时间则属于时效内订单 + timelinessSum++; + orgModel.setOrgTimelinessSum(orgModel.getOrgTimelinessSum() + 1); // 组织已初稿时效内订单 + } + else + { + orgModel.setOrgExceedTimelinessSum(orgModel.getOrgExceedTimelinessSum() + 1);// 组织已初稿已超时订单 + } + } + } + } + else + { + orgModel.setOrgSleepDraftSum(orgModel.getOrgSleepDraftSum() + 1); // 组织等待初稿量 + sleepDraftSum++; + if (designOrder.getCreateTime() != null && minute != null) + { + String createTime = DateTimes.getNextDateTimeStringBySecond(simple.format(designOrder.getCreateTime()), minute * 60); + Date nowCreateTime = simple.parse(createTime); + String currentDate = simple.format(new Date()); + Date currentDateTime = simple.parse(currentDate); + if (currentDateTime.getTime() <= nowCreateTime.getTime()) + {// 当前时间小于等于等于订单创建时间+订单产品初稿时效时间则属于时效内订单 + sleepTimelinessSum++; + orgModel.setOrgSleepTimelinessSum(orgModel.getOrgSleepTimelinessSum() + 1);// 组织等待初稿时效内订单 + } + else + { + orgModel.setOrgExceedSleepTimelinessSum(orgModel.getOrgExceedSleepTimelinessSum() + 1);// 组织等待初稿已超时订单 + } + } + } + } + + List orgStatModelList = new ArrayList<>(orgTimelinessMap.values()); + BigDecimal bigDecimal = null; + for (TimelinessOrgStatModel timelinessOrgStatModel : orgStatModelList) + { + if (timelinessOrgStatModel.getOrgOrderSum() > 0) + { + int exceedSum = timelinessOrgStatModel.getOrgExceedTimelinessSum() + timelinessOrgStatModel.getOrgExceedSleepTimelinessSum(); + bigDecimal = new BigDecimal(exceedSum * 100 + ""); + double orgExceedPrent = bigDecimal.divide(new BigDecimal(timelinessOrgStatModel.getOrgOrderSum() + ""), 2, RoundingMode.HALF_UP).doubleValue(); + timelinessOrgStatModel.setOrgExceedPrent(orgExceedPrent); + } + + } + List sortList = null; + for (int g = 0; g < orgStatModelList.size() - 1; g++) + { // 冒泡按指定条件降序 + for (int d = 0; d < orgStatModelList.size() - 1 - g; d++) + { + if (orgStatModelList.get(d).getOrgOrderSum() < orgStatModelList.get(d + 1).getOrgOrderSum()) + { + sortList = new ArrayList<>(); + sortList.add(0, orgStatModelList.get(d)); + orgStatModelList.set(d, orgStatModelList.get(d + 1)); + orgStatModelList.set(d + 1, sortList.get(0)); + } + } + } + int exceedSum = firstDraftSum - timelinessSum + sleepDraftSum - sleepTimelinessSum; + BigDecimal bigExceed = new BigDecimal(exceedSum * 100 + ""); + double prentSum = 0.0; + if (designOrderList.size() > 0) + { + prentSum = bigExceed.divide(new BigDecimal(designOrderList.size() + ""), 2, RoundingMode.HALF_UP).doubleValue(); + } + Map statMap = new HashMap<>();// 报表Map + statMap.put("超时", firstDraftSum - timelinessSum + sleepDraftSum - sleepTimelinessSum); + statMap.put("未超时", timelinessSum + sleepTimelinessSum); + + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + request.setAttribute("statMap", statMap); + request.setAttribute("orgStatModelList", orgStatModelList); + request.setAttribute("designTypeList", designTypeList); + request.setAttribute("designOrderSum", designOrderList.size());// 总订单量 + request.setAttribute("firstDraftSum", firstDraftSum);// 总初稿量 + request.setAttribute("timelinessSum", timelinessSum);// 初稿时效内订单量 + request.setAttribute("exceedTimelinessSum", firstDraftSum - timelinessSum);// 初稿已超时订单量 + request.setAttribute("sleepDraftSum", sleepDraftSum);// 等待初稿量 + request.setAttribute("sleepTimelinessSum", sleepTimelinessSum);// 等待初稿时效内订单量 + request.setAttribute("exceedSleepTimelinessSum", sleepDraftSum - sleepTimelinessSum);// 等待初稿已超时订单量 + request.setAttribute("prentSum", prentSum);// 等待初稿已超时订单量 + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutCompleteOrderHistoryAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutCompleteOrderHistoryAction.java new file mode 100644 index 0000000..f4d46d7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutCompleteOrderHistoryAction.java @@ -0,0 +1,144 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.manager.dbo.ZmrParam; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; + +/** + * 定稿超时订单 + * + * @version v1.0.0 @author zzy 2018-6-6 新建与整理 + */ +public class TimeoutCompleteOrderHistoryAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 20); + int hasComplete = request.getParameterInt("hasComplete"); + String designer = request.getParameter("designer"); + + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateString(1)); + String endDate = request.getParameter("endDate", DateTimes.getPreviousDateString(1)); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 0) + { + request.setResponseError("请勿将时间区间跨度选择大于一天"); + return; + } + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + + // 查询订单 + Selector selector = new Selector(); + selector.addMustThenG("draftType", 1); // 设计稿 + selector.addMustThenGE("status", StatusConstants.ORDER_50.value()); // 状态大于等于初稿 + selector.addMustNotEqual("orderFlag", 1); // 排除不计时效的老用户 + selector.addMaybeThenGE("createTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMaybeThenLE("createTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMaybe("industryId", request.getParameterLong("industryId")); + selector.addOrderbyAsc("createTime"); + + if (hasComplete == 0) + { + selector.addMustIsNull("designEndTime"); + selector.addExpressionThenL("createTime", "SUBDATE(now(),INTERVAL (24*60) MINUTE)"); + } + else if (hasComplete == 1) + { + selector.addExpressionThenL("createTime", "SUBDATE(design_order.DESIGN_DRAFT_TIME,INTERVAL (24*60) MINUTE)"); + } + + // 根据组织查询 + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + + // 获取时效结束时间 + ZmrParam param = ZmrParamDao.getParam(request.getContext(), "yangcai.design", "effectiveEndTime"); + if (param != null && Validates.isNotEmptyBlank(param.getParamValue())) + { + selector.addExpressionThenL("createTime", "CONCAT(DATE_FORMAT(design_order.CREATE_TIME, '%Y-%m-%d'),' " + param.getParamValue() + "')"); // 结束时间 + selector.addExpressionThenG("createTime", "CONCAT(DATE_FORMAT(design_order.CREATE_TIME + 1, '%Y-%m-%d'),' 08:00:00')"); // 开始时间 + } + + List allList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + + Map map = new HashMap(); + List tempList = new ArrayList(); + for (DesignOrder item : allList) + { + int count = map.get(item.getDesigner()) == null ? 0 : map.get(item.getDesigner()); + map.put(item.getDesigner(), count + 1); + + if (Validates.isNotEmpty(designer) && !designer.equals(item.getDesigner())) + { + continue; + } + + tempList.add(item); + } + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, tempList); + pageResult.addConditionMap(request.getParameterMap()); + + List designerList = OperatorDao.getOrgOperatorAllList(orgId); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("designerList", designerList); + request.setAttribute("map", map); + + // 获取进度备注 + Map progressNoteMap = new HashMap(); + for (DesignOrder order : pageResult.list()) + { + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class) + .item(OrdProgressNote.class, new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" : note.getOrdProgressNote()); + } + request.setAttribute("progressNoteMap", progressNoteMap); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutDispatchOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutDispatchOrderAction.java new file mode 100644 index 0000000..e92a229 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutDispatchOrderAction.java @@ -0,0 +1,79 @@ +/** + * 扬彩印刷设计 + * 文件名 :TimeoutDispatchOrderAction.java + * 创建人 :gjx + * 创建时间:2020年11月5日 +*/ + +package com.zhiqim.yangcai.design.action.order; + +import java.util.HashMap; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; + +/** + * + * [简要描述]: 派单超时
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年11月5日 新建与整理 + */ +public class TimeoutDispatchOrderAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 12); + + Selector selector = new Selector(); + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("buyerNick", request.getParameter("buyerNick")); + selector.addMaybe("typeId", request.getParameterLong("typeId")); + selector.addMaybe("industryId", request.getParameterLong("industryId")); + selector.addMust("status", StatusConstants.ORDER_20.value()); // 等待设计 + selector.addMustIsNotEmpty("orgReceiveTime"); + selector.addExpressionThenL("orgReceiveTime", + "SUBDATE(now(),INTERVAL (SELECT dt.DISPATCH_ORDER_EFFECTIVE_TIME FROM design_type dt WHERE dt.TYPE_ID = DESIGN_ORDER.TYPE_ID) MINUTE)"); + selector.addOrderbyAsc("createTime"); + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + // 根据组织查询 + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + // 获取进度备注 + Map progressNoteMap = new HashMap(); + for (DesignOrder order : pageResult.list()) + { + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class).item(OrdProgressNote.class, + new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" : note.getOrdProgressNote()); + } + request.setAttribute("progressNoteMap", progressNoteMap); + request.setAttribute("pageResult", pageResult); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutDraftOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutDraftOrderAction.java new file mode 100644 index 0000000..8ba63e2 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutDraftOrderAction.java @@ -0,0 +1,138 @@ +/** + * 扬彩印刷设计 + * 文件名 :TimeoutDraftOrderAction.java + * 创建人 :gjx + * 创建时间:2020年11月5日 +*/ + +package com.zhiqim.yangcai.design.action.order; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.model.TimeoutDraftOrderModel; + +/** + * + * [简要描述]: 初稿超时
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年11月5日 新建与整理 + */ +public class TimeoutDraftOrderAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + // 总部组织 + boolean isOrgRoot = false; + if (ZmrOrgDao.getOrgRootId(request) == orgId) + { + isOrgRoot = true; + } + + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 12); + + String beginDate = request.getParameter("beginDate", DateTimes.getDateString()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + String designer = request.getParameter("designer"); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 183) + { + request.setResponseError("请勿将时间区间跨度选择大于六个月"); + return; + } + + // 非总部只查自己 + if (!isOrgRoot) + { + designer = sessionUser.getOperatorCode(); + } + + StringBuilder sqlBuilder = new StringBuilder( + "select designer,count(*) timeoutOrdCount,(select count(*) from design_order d where d.org_id = orgIdStr and d.designer = design_order.designer and d.design_begin_time >= 'beginDateStr' and d.design_begin_time <= 'endDateStr') ordCount"); + sqlBuilder.append( + " from design_order where org_id = orgIdStr and designer = 'designerStr' and design_begin_time >= 'beginDateStr' and design_begin_time <= 'endDateStr'"); + sqlBuilder.append( + " and design_begin_time < subdate(case when (isnull(design_order.design_draft_time) = 1) || (length(trim(design_order.design_draft_time)) = 0) then now() else design_order.design_draft_time end,interval (select dt.effective_time from design_type dt where dt.type_id = design_order.type_id) minute ) group by designer order by timeoutOrdCount desc"); + String sql = sqlBuilder.toString().replace("beginDateStr", beginDate + " 00:00:00").replace("endDateStr", endDate + " 23:59:59"); + if (Validates.isNotEmpty(designer)) + { + sql = sql.replace("designerStr", designer); + } + else + { + sql = sql.replace("designer = 'designerStr' and", ""); + } + + if (!isOrgRoot) + {// 非总部 + sql = sql.replace("orgIdStr", String.valueOf(orgId)); + } + else + { + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgIdArr=orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() -1); + sql = sql.replace("d.org_id = orgIdStr and", "d.org_id in("+orgIdArr+") and").replace("org_id = orgIdStr and", "org_id in("+orgIdArr+") AND"); + } else { + sql = sql.replace("d.org_id = orgIdStr and", "").replace("org_id = orgIdStr and", ""); + } + } + + int timeoutOrdSum = 0; + int ordSum = 0; + List modelList = new ArrayList(); + List statList = ORM.get(ZSQL.class).executeQuery(sql); + for (LinkedMapSO so : statList) + { + String itemDesigner = String.valueOf(so.get("designer")); + int timeoutOrdCount = Integer.valueOf(String.valueOf(so.get("timeoutOrdCount"))); + int ordCount = Integer.valueOf(String.valueOf(so.get("ordCount"))); + + TimeoutDraftOrderModel model = new TimeoutDraftOrderModel(itemDesigner); + model.setOrdCount(ordCount); + model.setTimeoutOrdCount(timeoutOrdCount); + + modelList.add(model); + ordSum += ordCount; + timeoutOrdSum += timeoutOrdCount; + } + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, modelList); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("timeoutOrdSum", timeoutOrdSum); + request.setAttribute("ordSum", ordSum); + request.setAttribute("isOrgRoot", isOrgRoot); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutMerDispatchAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutMerDispatchAction.java new file mode 100644 index 0000000..5957a0b --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutMerDispatchAction.java @@ -0,0 +1,99 @@ +/** + * 扬彩印刷设计 + * 文件名 :TimeoutMerDispatchAction.java + * 创建人 :gjx + * 创建时间:2020年11月5日 +*/ + +package com.zhiqim.yangcai.design.action.order; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * + * [简要描述]:分拣超时
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年11月5日 新建与整理 + */ +public class TimeoutMerDispatchAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getDateString()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 183) + { + request.setResponseError("请勿将时间区间跨度选择大于六个月"); + return; + } + + Selector selector = new Selector(); + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("buyerNick", request.getParameter("buyerNick")); + selector.addMaybe("typeId", request.getParameterLong("typeId")); + selector.addMaybe("industryId", request.getParameterLong("industryId")); + selector.addMustThenGE("createTime", Sqls.toTimestampBegin(beginDate)); + selector.addMustThenLE("createTime", Sqls.toTimestampEnd(endDate)); + selector.addOrderbyAsc("createTime"); + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + // 根据组织查询 + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + }else { + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + } + + int ordCount = ORM.get(ZTable.class).count(DesignOrder.class, selector);// 订单数 + + selector.addExpressionThenL("createTime", + "SUBDATE(CASE WHEN (ISNULL(DESIGN_ORDER.ORG_RECEIVE_TIME) = 1) || (LENGTH(TRIM(DESIGN_ORDER.ORG_RECEIVE_TIME)) = 0) THEN now() ELSE DESIGN_ORDER.ORG_RECEIVE_TIME END,INTERVAL (SELECT dt.MER_DISPATCH_EFFECTIVE_TIME FROM design_type dt WHERE dt.TYPE_ID = DESIGN_ORDER.TYPE_ID) MINUTE)"); + + int timeoutOrdCount = ORM.get(ZTable.class).count(DesignOrder.class, selector); + + PageResult pageResult = PageBuilder.newResult(1); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + request.setAttribute("pageResult", pageResult); + request.setAttribute("ordCount", ordCount); + request.setAttribute("timeoutOrdCount", timeoutOrdCount); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutOrderHistoryAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutOrderHistoryAction.java new file mode 100644 index 0000000..f06104a --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutOrderHistoryAction.java @@ -0,0 +1,160 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.manager.dbo.ZmrParam; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; + +/** + * 历史超时订单 + * + * @version v1.0.0 @author zzy 2018-6-6 新建与整理 + */ +public class TimeoutOrderHistoryAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 20); + int hasDesigner = request.getParameterInt("hasDesigner"); + int hasDraft = request.getParameterInt("hasDraft", 1); + String designer = request.getParameter("designer"); + + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateString(1)); + String endDate = request.getParameter("endDate", DateTimes.getPreviousDateString(1)); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 0) + { + request.setResponseError("请勿将时间区间跨度选择大于一天"); + return; + } + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + + // 查询订单 + Selector selector = new Selector(); + selector.addMustThenG("draftType", 1); // 设计稿 + selector.addMustThenGE("status", StatusConstants.ORDER_20.value()); // 状态大于等于等待设计 + selector.addMustNotEqual("orderFlag", 1); // 排除不计时效的老用户 + selector.addMaybeThenGE("createTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMaybeThenLE("createTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMaybe("industryId", request.getParameterLong("industryId")); + selector.addMaybe("typeId", request.getParameterLong("typeId")); + selector.addOrderbyAsc("createTime"); + + if (hasDesigner == 0) + { + selector.addMustIsNull("designer"); + } + else if (hasDesigner == 1) + { + selector.addMustIsNotNull("designer"); + } + + if (hasDraft == 0) + { + selector.addMustIsNull("designDraftTime"); + selector.addExpressionThenL("createTime", + "SUBDATE(now(),INTERVAL (SELECT dt.EFFECTIVE_TIME FROM design_type dt WHERE dt.TYPE_ID = design_order.TYPE_ID) MINUTE)"); + } + else if (hasDraft == 1) //不加else有其它不满足条件也不会报错、有测试过 + { + selector.addExpressionThenL("createTime", + "SUBDATE(design_order.DESIGN_DRAFT_TIME,INTERVAL (SELECT dt.EFFECTIVE_TIME FROM design_type dt WHERE dt.TYPE_ID = design_order.TYPE_ID) MINUTE)"); + } + + // 根据组织查询 + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + + // 获取时效结束时间 + ZmrParam param = ZmrParamDao.getParam(request.getContext(), "yangcai.design", "effectiveEndTime"); + if (param != null && Validates.isNotEmptyBlank(param.getParamValue())) + { + selector.addExpressionThenL("createTime", "CONCAT(DATE_FORMAT(design_order.CREATE_TIME, '%Y-%m-%d'),' " + param.getParamValue() + "')"); // 结束时间 + selector.addExpressionThenG("createTime", "CONCAT(DATE_FORMAT(design_order.CREATE_TIME + 1, '%Y-%m-%d'),' 08:00:00')"); // 开始时间 + } + + List allList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + + Map map = new HashMap(); + List tempList = new ArrayList(); + for (DesignOrder item : allList) + { + int count = map.get(item.getDesigner()) == null ? 0 : map.get(item.getDesigner()); + map.put(item.getDesigner(), count + 1); + + if (Validates.isNotEmpty(designer) && !designer.equals(item.getDesigner())) + { + continue; + } + + tempList.add(item); + } + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, tempList); + pageResult.addConditionMap(request.getParameterMap()); + + List designerList = OperatorDao.getOrgOperatorAllList(orgId); + List designTypeList = DesignTypeDao.listAll(); + + request.setAttribute("designTypeList", designTypeList); + request.setAttribute("pageResult", pageResult); + request.setAttribute("designerList", designerList); + request.setAttribute("map", map); + + // 获取进度备注 + Map progressNoteMap = new HashMap(); + for (DesignOrder order : pageResult.list()) + { + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class) + .item(OrdProgressNote.class, new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" : note.getOrdProgressNote()); + } + request.setAttribute("progressNoteMap", progressNoteMap); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutOrderHistoryStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutOrderHistoryStatAction.java new file mode 100644 index 0000000..dae4ad1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutOrderHistoryStatAction.java @@ -0,0 +1,126 @@ +/** + * 扬彩印刷设计 + * 文件名 :TimeoutOrderHistoryStatAction.java + * 创建人 :高佳新 + * 创建时间:2019-7-10 + */ + +package com.zhiqim.yangcai.design.action.order; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * + * 初稿超时折线图 + * + * @version 1.0 @author gjx 2019-7-11 新建与整理 + */ +public class TimeoutOrderHistoryStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + Long typeId = request.getParameterLong("typeId"); + + Selector selector = new Selector(); + selector.addMustThenGE("createTime", Sqls.toTimestamp(startDate + " 00:00:00")); + selector.addMustThenLE("createTime", Sqls.toTimestamp(endDate + " 23:59:59")); + selector.addMaybe("typeId", typeId); + selector.addOrderbyDesc("createTime"); + + Map designTypeMap = new HashMap<>(); // 产品类型时效信息Map + Map orderCountMap = new HashMap();// 录入单数Map + Map historyOrderCountMap = new HashMap();// 超时单数Map + Map proTypeMap = new HashMap<>(); // 产品类型Map + List designTypeList = DesignTypeDao.listAll(); + for (DesignType designType : designTypeList) + { + designTypeMap.put(designType.getTypeName(), designType.getEffectiveTime()); + proTypeMap.put(designType.getTypeId(), designType.getTypeName()); + } + List designOrderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + for (int i = 0; i <= day; i++) + { // 初始化天数数据 + String date = DateTimes.getPreviousDateString(endDate, i); + orderCountMap.put(date, 0);// 录入单数 + historyOrderCountMap.put(date, 0);// 超时单数 + } + int orderTimeoutSum = 0; + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + for (DesignOrder designOrder : designOrderList) + {// 得到折线图所要数据格式 + String dateTiem = Sqls.toDateString(designOrder.getCreateTime()); + Integer num = orderCountMap.get(dateTiem); + int countOrder = num == null ? 1 : (num + 1); + orderCountMap.put(dateTiem, countOrder);// 每天录入单数 + Integer minute = designTypeMap.get(proTypeMap.get(designOrder.getTypeId())); + if (designOrder.getCreateTime() != null && minute != null) + { + String createTime = DateTimes.getNextDateTimeStringBySecond(simple.format(designOrder.getCreateTime()), minute * 60); + Date nowCreateTime = simple.parse(createTime); + if (designOrder.getDesignDraftTime() != null) + { + String draftTime = simple.format(designOrder.getDesignDraftTime()); + Date draftDateTime = simple.parse(draftTime); + if (draftDateTime.getTime() > nowCreateTime.getTime()) + {// 初稿时间大于订单创建时间+订单产品初稿时效时间则属于超时订单 + Integer historyNum = historyOrderCountMap.get(dateTiem); + int historyCountOrder = historyNum == null ? 1 : (historyNum + 1); + historyOrderCountMap.put(dateTiem, historyCountOrder); + orderTimeoutSum++; + } + } + } + + } + // 天数排序 + List dateList = new ArrayList(0); + for (String date : orderCountMap.keySet()) + { + dateList.add(date); + } + Collections.sort(dateList); + SimpleDateFormat simpleDate = new SimpleDateFormat("yyyy-MM-dd"); + Date titleStartDate = simpleDate.parse(startDate); + Date titleEndDate = simpleDate.parse(endDate); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd"); + request.setAttribute("titleStartDate", simpleDateFormat.format(new Date(titleStartDate.getTime()))); + request.setAttribute("titleEndDate", simpleDateFormat.format(new Date(titleEndDate.getTime()))); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + request.setAttribute("dateList", dateList); + request.setAttribute("orderCountMap", orderCountMap); + request.setAttribute("historyOrderCountMap", historyOrderCountMap); + request.setAttribute("designTypeList", designTypeList); + request.setAttribute("typeId", typeId); + request.setAttribute("orderSum", designOrderList.size()); + request.setAttribute("orderTimeoutSum", orderTimeoutSum); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutOrderNearAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutOrderNearAction.java new file mode 100644 index 0000000..8a2543c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutOrderNearAction.java @@ -0,0 +1,142 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; +import com.zhiqim.yangcai.design.model.DesignQuickTimeOutModel; + +/** + * 快超时订单 + * + * @version v1.0.0 @author zzy 2018-6-6 新建与整理 + */ +public class TimeoutOrderNearAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 20); + int hasDesigner = request.getParameterInt("hasDesigner"); + + // 查询订单 + Selector selector = new Selector(); + selector.addMustThenG("draftType", 1); // 设计稿 + selector.addMustThenGE("status", StatusConstants.ORDER_20.value()); // 状态大于等于等待设计 + selector.addMustThenL("status", StatusConstants.ORDER_50.value()); // 状态小于等于初稿 + selector.addExpressionThenG("createTime", + "SUBDATE(now(),INTERVAL (SELECT pt.EFFECTIVE_TIME FROM design_type pt WHERE pt.TYPE_ID = DESIGN_ORDER.TYPE_ID) MINUTE)"); + selector.addMaybe("designer", request.getParameter("designer")); + selector.addMaybe("industryId", request.getParameterLong("industryId")); + selector.addMaybe("typeId", request.getParameterLong("typeId")); + selector.addOrderbyAsc("createTime"); + + if (hasDesigner == 0) + { + selector.addMaybeIsNull("designer"); + } + else if (hasDesigner == 1) + { + selector.addMaybeIsNotNull("designer"); + } + + // 根据组织查询 + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + List designOrderList = new ArrayList(); + Map typeMap = DesignTypeDao.mapAll(); + DesignQuickTimeOutModel designQuickTimeOutModel = null; + for (DesignOrder designOrder : pageResult.list()) + { + designQuickTimeOutModel = new DesignQuickTimeOutModel(); + int countDown = typeMap.containsKey(designOrder.getTypeId()) ? typeMap.get(designOrder.getTypeId()).getEffectiveTime() : 0; + designQuickTimeOutModel.setDesignId(designOrder.getDesignId()); + designQuickTimeOutModel.setOrgId(designOrder.getOrgId()); + designQuickTimeOutModel.setOrderText(designOrder.getOrderText()); + designQuickTimeOutModel.setBuyerNick(designOrder.getBuyerNick()); + designQuickTimeOutModel.setCreateTime(designOrder.getCreateTime()); + designQuickTimeOutModel.setDesigner(designOrder.getDesigner()); + designQuickTimeOutModel.setDesignReceiveTime(designOrder.getDesignReceiveTime()); + designQuickTimeOutModel.setIndustryId(designOrder.getIndustryId()); + designQuickTimeOutModel.setCountDown(DateTimes.compareMinute(Sqls.toDateTimeString(designOrder.getCreateTime()), DateTimes.getDateTimeString()) + + countDown); + designOrderList.add(designQuickTimeOutModel); + } + + List sortList = null; + for (int g = 0; g < designOrderList.size() - 1; g++) + { // 冒泡按指定条件升序 + for (int d = 0; d < designOrderList.size() - 1 - g; d++) + { + if (designOrderList.get(d).getCountDown() > designOrderList.get(d + 1).getCountDown()) + { + sortList = new ArrayList<>(); + sortList.add(0, designOrderList.get(d)); + designOrderList.set(d, designOrderList.get(d + 1)); + designOrderList.set(d + 1, sortList.get(0)); + } + } + } + PageResult resultList = PageBuilder.newResult(pageResult.total(), page, pageSize, designOrderList); + pageResult.addConditionMap(request.getParameterMap()); + + List designerList = OperatorDao.getOrgOperatorAllList(orgId); + List designTypeList = DesignTypeDao.listAll(); + request.setAttribute("designTypeList", designTypeList); + request.setAttribute("pageResult", resultList); + request.setAttribute("designerList", designerList); + + // 获取进度备注 + Map progressNoteMap = new HashMap(); + for (DesignOrder order : pageResult.list()) + { + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class) + .item(OrdProgressNote.class, new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" : note.getOrdProgressNote()); + } + request.setAttribute("progressNoteMap", progressNoteMap); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutOrderTodayAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutOrderTodayAction.java new file mode 100644 index 0000000..7c4ad39 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/TimeoutOrderTodayAction.java @@ -0,0 +1,118 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.order; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.manager.dbo.ZmrParam; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; + +/** + * 今日超时订单 + * + * @version v1.0.0 @author zzy 2018-6-6 新建与整理 + */ +public class TimeoutOrderTodayAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 20); + int hasDesigner = request.getParameterInt("hasDesigner"); + + // 查询订单 + Selector selector = new Selector(); + selector.addMustThenG("draftType", 1); // 设计稿 + selector.addMustThenGE("status", StatusConstants.ORDER_20.value()); // 状态大于等于等待设计 + selector.addMustThenL("status", StatusConstants.ORDER_50.value()); // 状态小于等于初稿 + selector.addMustIsNull("designDraftTime"); // 初稿时间为空 + selector.addExpressionThenL("createTime", + "SUBDATE(now(),INTERVAL (SELECT dt.EFFECTIVE_TIME FROM design_type dt WHERE dt.TYPE_ID = DESIGN_ORDER.TYPE_ID) MINUTE)"); + selector.addMustThenGE("createTime", Sqls.toTimestamp(DateTimes.getDateString(), "00:00:00")); // 今日的 + selector.addMaybe("designer", request.getParameter("designer")); + selector.addMaybe("industryId", request.getParameterLong("industryId")); + selector.addMaybe("typeId", request.getParameterLong("typeId")); + selector.addOrderbyDesc("createTime"); + + if (hasDesigner == 0) + { + selector.addMaybeIsNull("designer"); + } + else if (hasDesigner == 1) + { + selector.addMaybeIsNotNull("designer"); + } + + // 根据组织查询 + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + + // 获取时效结束时间 + ZmrParam param = ZmrParamDao.getParam(request.getContext(), "yangcai.design", "effectiveEndTime"); + if (param != null && Validates.isNotEmptyBlank(param.getParamValue())) + { + selector.addMustThenL("createTime", Sqls.toTimestamp(DateTimes.getDateString(), param.getParamValue())); + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + List designerList = OperatorDao.getOrgOperatorAllList(orgId); + List designTypeList = DesignTypeDao.listAll(); + + request.setAttribute("designTypeList", designTypeList); + request.setAttribute("pageResult", pageResult); + request.setAttribute("designerList", designerList); + + // 获取进度备注 + Map progressNoteMap = new HashMap(); + for (DesignOrder order : pageResult.list()) + { + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class) + .item(OrdProgressNote.class, new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" : note.getOrdProgressNote()); + } + request.setAttribute("progressNoteMap", progressNoteMap); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/UploadDataAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/UploadDataAction.java new file mode 100644 index 0000000..4a590f2 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/UploadDataAction.java @@ -0,0 +1,92 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 资料上传 + * + * @version v1.0.0 @author Deng 2017-9-14 新建与整理 + */ +public class UploadDataAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + long designId = request.getParameterLong("designId"); + + Selector sel = new Selector(); + if (designId > 0) + sel.addOr(new Selector("designId", designId).addMust("outId", designId)); + + sel.addMaybe("designType", request.getParameterLong("designType")); + sel.addMaybeLike("buyerNick", request.getParameter("buyerNick")); + sel.addMaybeLike("tids", request.getParameter("tid")); + sel.addMaybe("draftType", request.getParameterInt("draftType")); + sel.addMustThenGE("createTime", Sqls.toTimestamp(startDate + " 00:00:00")); + sel.addMustThenLE("createTime", Sqls.toTimestamp(endDate + " 23:59:59")); + + String otherText = request.getParameter("otherInfo",""); + if(!Validates.isEmptyBlank(otherText)) + { + sel.addOr(new Selector() + .addMaybeLike("userQq", otherText) + .addMaybeLike("receiverName", otherText) + .addMaybeLike("receiverMobile", otherText) + .addMaybeLike("userMobile", otherText)); + } + + int isOnlyDesign = request.getParameterInt("isOnlyDesign"); + if(isOnlyDesign != -1) + sel.addMust("isOnlyDesign", isOnlyDesign == 1 ? true : false); + + int havaIndustry = request.getParameterInt("havaIndustry"); + if(havaIndustry == 0) + sel.addMaybeIsNotNull("industryId"); + if(havaIndustry == 1) + sel.addMaybe("industryId", 0); + +// //根据组织显示 +// ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, new Selector("orgLevel", 0)); +// ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); +// long orgId = sessionUser.getOperator().getOrgId(); +// if (org.getOrgId() != orgId) +// sel.addMust("orgId", orgId); + + sel.addOrderbyDesc("createTime"); + sel.addOrderbyAsc("buyerNick"); + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, sel); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/WaiveOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/WaiveOrderAction.java new file mode 100644 index 0000000..e10bab3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/WaiveOrderAction.java @@ -0,0 +1,116 @@ +package com.zhiqim.yangcai.design.action.order; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.aliyun.oss.common.utils.StringUtils; +import com.zhiqim.yangcai.cache.DesignTypeCache; +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DispatchDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.ScoreDesignerRecordDao; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupView; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordDetail; +import com.zhiqim.yangcai.design.server.ErpClassService; +import com.zhiqim.yangcai.design.server.ErpClassService.statusEnum; + +/** + * + * [简要描述]:放弃订单
            + * [详细描述]:
            + * + * @version 1.0 @author hc 2021年6月3日 新建与整理 + */ +@AnAlias("WaiveOrderAction") +@AnIntercept("chkZmrLogin") +public class WaiveOrderAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + String operatorCode = request.getSessionName(); + DesignOrder result = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", designId)); + String typeName = Global.get(DesignTypeCache.class).getName(result.getTypeId()); + DesignerGroupView designerGroupView = ORM.get(ZView.class).item(DesignerGroupView.class, new Selector().addMaybe("operatorCode", operatorCode)); + + request.setAttribute("designId", designId); + request.setAttribute("typeName", typeName); + request.setAttribute("waiveNum", designerGroupView.getDesignerWaiveNum()); + + } + + /** + * + * [简要描述]:放弃订单
            + * [详细描述]:
            + * + * @author hc + * @param request + * @throws Exception + */ + public static void waiveOrder(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + String operatorCode = request.getSessionName(); + + DesignOrder item = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", designId)); + if (item == null) + { + request.setResponseError("此订单不存在,请联系管理员处理!"); + return; + } + if (item.getReceiveType() == 2) + { + request.setResponseError("该订单是指定订单不能放弃哦~"); + return; + } + DesignerGroupView designerGroupView = ORM.get(ZView.class).item(DesignerGroupView.class, new Selector().addMust("operatorCode", operatorCode)); + if (designerGroupView.getDesignerWaiveNum() == 0) + { + request.setResponseError("您的放弃订单次数已使用完!"); + return; + } + + String logItem = "设计师放弃订单"; + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("designer", ""); + updater.addField("status", StatusConstants.ORDER_10.value()); + updater.addField("orgId", 0); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + if (item != null && !StringUtils.isNullOrEmpty(item.getTids())) { + new ErpClassService(item.getTids(), item.getDesigner(), statusEnum.TO_BE_DESIGNED.getCode()); + } + DispatchDao.doUpdateDesignerOrderNum(operatorCode); + + Updater updaterWaiverNum = new Updater(); + updaterWaiverNum.addMust("operatorCode", operatorCode); + updaterWaiverNum.addField("waiveNum", designerGroupView.getDesignerWaiveNum() - 1); + ORM.get(ZTable.class).update(DesignerGroupDispatch.class, updaterWaiverNum); + + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_108.value())); + scoreDesignerRecordDetail.setOperatorCode(operatorCode); + scoreDesignerRecordDetail.setCreateOperator(request.getSessionUser(ZmrSessionUser.class).getOperatorCode()); + scoreDesignerRecordDetail.setRemark("设计师放弃订单"); + scoreDesignerRecordDetail.setScore(-10); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), logItem, EventConstants.ORDER_38.value()); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/WangwangOrderAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/WangwangOrderAction.java new file mode 100644 index 0000000..a63d8e9 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/order/WangwangOrderAction.java @@ -0,0 +1,54 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.order; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; + +public class WangwangOrderAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String buyerNick = request.getParameter("buyerNick"); + if (Validates.isEmptyBlank(buyerNick)) + { + request.returnHistory("旺旺号不能为空,请重新选择"); + return; + } + + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, new Selector("buyerNick", buyerNick).addOrderbyDesc("createTime")); + request.setAttribute("orderList", orderList); + //获取进度备注 + Map progressNoteMap = new HashMap(); + for (DesignOrder order : orderList) + { + //进度备注 + OrdProgressNote note = ORM.get(ZTable.class).item(OrdProgressNote.class, new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" : note.getOrdProgressNote()); + } + request.setAttribute("progressNoteMap", progressNoteMap); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/plugin/LoginAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/plugin/LoginAction.java new file mode 100644 index 0000000..494260f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/plugin/LoginAction.java @@ -0,0 +1,66 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.plugin; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNumericLen; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrPassworder; +import org.zhiqim.manager.dao.ZmrParamDao; + +/** + * cdr插件登录 + * @version v1.0.0 @author zhouwenbin 2018-5-5 新建与整理 + */ +public class LoginAction implements Action +{ + public void execute(HttpRequest request) throws Exception + { + request.setResponsePrivateCache(); + + request.addValidate(new IsLen("operatorCode", "请输入正确的帐号", 2, 32)); + request.addValidate(new IsLen("operatorPass", "请输入正确的密码", 6, 90)); + + boolean hasVerificationCode = ZmrParamDao.hasVerificationCode(request.getContext()); + boolean hasRememberCode = ZmrParamDao.hasRememberCode(request.getContext()); + boolean hasRememberPass = ZmrParamDao.hasRememberPass(request.getContext()); + if(hasVerificationCode) + { + request.addValidate(new IsNumericLen("verificationCode", "验证码必须是4位数字", 4, 4)); + } + + request.setAttribute("hasRememberCode", hasRememberCode); + request.setAttribute("hasRememberPass", hasRememberPass); + request.setAttribute("hasVerificationCode", hasVerificationCode); + + if(hasRememberCode) + {//记住用户名 + String operatorCode = request.getCookie("operatorCode"); + request.setAttribute("operatorCode", operatorCode); + + if (hasRememberPass) + {//记住密码 + String operatorPass = request.getCookie("operatorPass"); + if (!Validates.isEmptyBlank(operatorPass)) + { + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + int len = passworder.secretLen(operatorPass); + request.setAttribute("operatorPass", Strings.prefixLen("", len, '●')); + } + } + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/ArticleAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/ArticleAction.java new file mode 100644 index 0000000..d1e5ce3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/ArticleAction.java @@ -0,0 +1,156 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.question; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.onex.IsInteger; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.YqArticle; +import com.zhiqim.yangcai.design.dbo.YqArticleEx; +import com.zhiqim.yangcai.design.dbo.YqCategory; + +/** + * 文章详情 + * + * @version v1.0.0 @author huangsufang 2017-9-20 新建与整理 + */ +public class ArticleAction extends StdSwitchAction +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsInteger("articleId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + // request.addValidate(new IsSelect("categoryId", "二级分类为空,请先添加")); + request.addValidate(new IsLen("articleTitle", "标题不能为空且不能超过32个字符", 1, 32)); + request.addValidate(new IsLen("articleContent", "内容不能为空且不能超过25000个字符", 1, 25000)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 10); + + Selector selector = new Selector("categoryId,categoryName,articleId,articleTitle,articleStatus,articleTime"); + selector.addOrderbyDesc("articleTime"); + selector.addMaybeLike("articleTitle", request.getParameter("articleKey")); + + PageResult articlePage = ORM.get(ZView.class).page(YqArticleEx.class, page, pageSize, selector); + articlePage.addConditionMap(request.getParameterMap()); + + request.setAttribute("articlePage", articlePage); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + Selector selector = new Selector(); + selector.addMustNotEqual("categoryLevel", 0); + selector.addMustNotEqual("categoryLevel", 1); + + List categoryList = ORM.get(ZTable.class).list(YqCategory.class, selector); + if (categoryList.size() == 0) + { + request.returnHistory("二级分类为空,请先添加"); + return; + } + + request.setAttribute("categoryList", categoryList); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + Selector selector = new Selector(); + selector.addMustNotEqual("categoryLevel", 0); + selector.addMustNotEqual("categoryLevel", 1); + + List categoryList = ORM.get(ZTable.class).list(YqCategory.class, selector); + request.setAttribute("categoryList", categoryList); + + long articleId = request.getParameterLong("articleId"); + YqArticle article = ORM.get(ZTable.class).item(YqArticle.class, articleId); + if (article == null) + { + request.returnHistory("该文章不存在,请重新选择!"); + return; + } + + request.setAttribute("article", article); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + long categoryId = request.getParameterLong("categoryId"); + String articleTitle = request.getParameter("articleTitle"); + String articleContent = request.getParameterNoFileterOnCNT("articleContent"); + int articleStatus = request.getParameterInt("articleStatus"); + + // 插入到数据库 + YqArticle article = new YqArticle(); + article.setArticleId(Ids.longId()); + article.setArticleTitle(articleTitle); + article.setArticleContent(articleContent); + article.setCategoryId(categoryId); + article.setArticleTime(Sqls.toTimestamp(DateTimes.getDateTimeString())); + article.setArticleStatus(articleStatus); + + ORM.get(ZTable.class).insert(article); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long articleId = request.getParameterLong("articleId"); + long categoryId = request.getParameterLong("categoryId"); + String articleTitle = request.getParameter("articleTitle"); + String articleContent = request.getParameterNoFileterOnCNT("articleContent"); + int articleStatus = request.getParameterInt("articleStatus"); + + Updater updater = new Updater(); + updater.addMust("articleId", articleId); + updater.addField("articleTitle", articleTitle); + updater.addField("articleContent", articleContent); + updater.addField("categoryId", categoryId); + updater.addField("articleStatus", articleStatus); + updater.addField("articleTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(YqArticle.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long articleId = request.getParameterLong("articleId"); + + ORM.get(ZTable.class).delete(YqArticle.class, articleId); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/CategoryAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/CategoryAction.java new file mode 100644 index 0000000..93f4a38 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/CategoryAction.java @@ -0,0 +1,208 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.question; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.onex.IsInteger; +import org.zhiqim.kernel.tree.Tree; +import org.zhiqim.kernel.tree.TreeBuilder; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.YqArticle; +import com.zhiqim.yangcai.design.dbo.YqCategory; + +/** + * 文章分类 + * + * @version v1.0.0 @author huangsufang 2017-9-20 新建与整理 + */ +public class CategoryAction extends StdSwitchAction +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsInteger("categoryId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsLen("categoryName", "分类名称为空且不能超过32个字符", 1, 32)); + request.addValidate(new IsInteger("categorySeq", "分类排序编号不能为空")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + if (ORM.get(ZTable.class).count(YqCategory.class) == 0) + { + YqCategory firstCategory = new YqCategory(); + firstCategory.setParentId(0); + firstCategory.setCategoryId(1000000000000000L); + firstCategory.setCategoryName("扬彩知识库"); + firstCategory.setCategoryLevel(0); + firstCategory.setCategoryStatus(0); + firstCategory.setCategorySeq(0); + + ORM.get(ZTable.class).insert(firstCategory); + } + + List list = ORM.get(ZTable.class).list(YqCategory.class, new Selector().addOrderbyAsc("categoryLevel,categorySeq,categoryId")); + Tree tree = TreeBuilder.newTree(list, "parentId", "categoryId"); + + request.setAttribute("tree", tree); + request.setAttribute("size", getTreeSize(tree)); + } + + public int getTreeSize(Tree tree) + { + int size = 1; + for (Tree tre : tree.children()) + { + size += getTreeSize(tre); + } + return size; + } + + @Override + protected void add(HttpRequest request) throws Exception + { + Selector selector = new Selector(); + selector.addMust("parentId", 0); + List categoryList = ORM.get(ZTable.class).list(YqCategory.class, selector); + + long categoryId = request.getParameterLong("categoryId"); + YqCategory category = ORM.get(ZTable.class).item(YqCategory.class, categoryId); + if (category == null) + { + request.returnHistory("该分类不存在,请重新选择!"); + return; + } + if (category.getCategoryLevel() != 0) + { + request.returnHistory("最多添加1级分类!"); + return; + } + + request.setAttribute("categoryList", categoryList); + request.setAttribute("category", category); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + Selector selector = new Selector(); + selector.addMust("parentId", 0); + + List categoryList = ORM.get(ZTable.class).list(YqCategory.class, selector); + + long categoryId = request.getParameterLong("categoryId"); + if (categoryId == 1000000000000000L) + { + request.returnHistory("该分类为根分类,不能修改!"); + return; + } + YqCategory category = ORM.get(ZTable.class).item(YqCategory.class, categoryId); + if (category == null) + { + request.returnHistory("该分类不存在,请重新选择!"); + return; + } + + YqCategory parent = ORM.get(ZTable.class).item(YqCategory.class, category.getParentId()); + + Selector selector2 = new Selector(); + selector2.addMust("categoryId", category.getCategoryId()); + + List articleList = ORM.get(ZTable.class).list(YqArticle.class, selector2); + + request.setAttribute("categoryList", categoryList); + request.setAttribute("category", category); + request.setAttribute("parent", parent); + request.setAttribute("articleList", articleList); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + long parentId = request.getParameterLong("parentId"); + String categoryName = request.getParameter("categoryName"); + // int categoryLevel = request.getParameterInt("parentLevel"); + // categoryLevel++; + int categoryStatus = request.getParameterInt("categoryStatus"); + int categorySeq = request.getParameterInt("categorySeq"); + + // 插入到数据库 + YqCategory category = new YqCategory(); + category.setParentId(parentId); + category.setCategoryId(Ids.longId()); + category.setCategoryName(categoryName); + category.setCategoryLevel(2); + category.setCategoryStatus(categoryStatus); + category.setCategorySeq(categorySeq); + + ORM.get(ZTable.class).insert(category); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long categoryId = request.getParameterLong("categoryId"); + String categoryName = request.getParameter("categoryName"); + int categoryStatus = request.getParameterInt("categoryStatus"); + int categorySeq = request.getParameterInt("categorySeq"); + + Updater updater = new Updater(); + updater.addMust("categoryId", categoryId); + updater.addField("categoryStatus", categoryStatus); + updater.addField("categoryName", categoryName); + updater.addField("categorySeq", categorySeq); + + ORM.get(ZTable.class).update(YqCategory.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long categoryId = request.getParameterLong("categoryId"); + if (categoryId == 1000000000000000L) + { + request.returnHistory("该分类为根分类,不能删除!"); + return; + } + // 判断分类下是否有子分类 + if (ORM.get(ZTable.class).count(YqCategory.class, new Selector().addMust("parentId", categoryId)) > 0) + { + request.returnHistory("该分类下存在子分类,请先删除"); + return; + } + + // //判断分类下是否有文章 + // if (ORM.get(ZTable.class).count(YqArticle.class, new Selector().addMust("categoryId", + // categoryId)) > 0) + // { + // request.returnHistory("该分类下存在文章,请先删除"); + // return; + // } + + ORM.get(ZTable.class).delete(YqCategory.class, categoryId); + ORM.get(ZTable.class).delete(YqArticle.class, new Selector().addMust("categoryId", categoryId)); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/QuestionAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/QuestionAction.java new file mode 100644 index 0000000..4e0367b --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/QuestionAction.java @@ -0,0 +1,167 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.question; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.YqArticle; +import com.zhiqim.yangcai.design.dbo.YqCategory; + +public class QuestionAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + Selector categorSelector = new Selector(); + categorSelector.addOrderbyDesc("categorySeq"); + categorSelector.addMust("categoryStatus", 0); + + List categoryList = ORM.get(ZTable.class).list(YqCategory.class, categorSelector); + List childrenList = new ArrayList(); + List parentList = new ArrayList(); + int categoryLength = categoryList.size(); + List selectedList = new ArrayList(); + for (int i = 0; i < categoryLength; i++) + { + selectedList.add(false); + } + + for (int i = 0; i < categoryLength; i++) + { + YqCategory category = categoryList.get(i); + int forNum = 0; + if (category.getParentId() != -1) + { + childrenList.add(category); + } + // 检测是不是有子分类 + for (int j = 0; j < categoryLength; j++) + { + if (category.getCategoryId() == categoryList.get(j).getParentId()) + { + continue; + } + forNum++; + } + if (forNum == categoryLength) + { + parentList.add(false); + } + else + { + parentList.add(true); + } + } + + // 文章列表 + Selector articleSelector = new Selector(); + articleSelector.addMust("articleStatus", 0); + List articleList = ORM.get(ZTable.class).list(YqArticle.class, 1, 10, articleSelector); + + // 读取当前分类id + long categoryId = request.getParameterLong("categoryId", 0); + int categoryIndex = getCategoryIndex(categoryList, categoryId); + if (categoryId != 0 && categoryIndex > 0) + { + // 标识已选中 + selectedList.set(categoryIndex, true); + // 获取当前分类下文章列表 + articleSelector.addMust("categoryId", categoryId); + articleSelector.addOrderbyDesc("articleTime"); + articleList = ORM.get(ZTable.class).list(YqArticle.class, articleSelector); + } + else + { + // 标识已选中 + // 获取当前分类下文章列表 + articleSelector.addOrderbyDesc("articleNumber"); + articleList = ORM.get(ZTable.class).list(YqArticle.class, 1, 20, articleSelector); + } + + // 读取当前文章id + long articleId = request.getParameterLong("articleId", 0); + if (articleId != 0) + { + Selector itemSelector = new Selector(); + itemSelector.addMust("articleId", articleId); + itemSelector.addOrderbyDesc("articleTime"); + YqArticle article = ORM.get(ZTable.class).item(YqArticle.class, itemSelector); + int articleNumber = article.getArticleNumber(); + articleNumber++; + + // 点击次数+1 + Updater updater = new Updater(); + updater.addMust("articleId", articleId); + updater.addField("articleNumber", articleNumber); + + ORM.get(ZTable.class).update(YqArticle.class, updater); + + String articleStr = "

            " + article.getArticleTitle() + "

            " + + "

            " + + article.getArticleTime().toString().substring(0, article.getArticleTime().toString().length() - 2) + "

            "; + request.setAttribute("articleStr", articleStr); + request.setAttribute("content", article.getArticleContent()); + } + request.setAttribute("categoryList", categoryList); + request.setAttribute("categoryId", categoryId); + request.setAttribute("parentList", parentList); + request.setAttribute("selectedList", selectedList); + request.setAttribute("childrenList", childrenList); + request.setAttribute("articleList", articleList); + } + + /** + * 获取分类在列表中的排序位置 + * + * @param list + * @param categoryId + * @return + * @throws ORMException + * @throws SQLException + */ + public static int getCategoryIndex(List list, long categoryId) throws ORMException, SQLException + { + int categoryLength = list.size(); + for (int i = 0; i < categoryLength; i++) + { + if (list.get(i).getCategoryId() == categoryId) + { + long targId = list.get(i).getParentId(); + if (targId != 0) + { + for (int j = 0; j < categoryLength; j++) + { + if (list.get(j).getCategoryId() == targId) + { + return j; + } + } + } + else + { + return i; + } + } + } + return -1; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/SearchAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/SearchAction.java new file mode 100644 index 0000000..429bc9a --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/SearchAction.java @@ -0,0 +1,100 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.question; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.YqArticle; +import com.zhiqim.yangcai.design.dbo.YqCategory; + +public class SearchAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + // TODO Auto-generated method stub + // 获取分类列表 + Selector categorSelector = new Selector(); + categorSelector.addOrderbyDesc("categorySeq"); + categorSelector.addMust("categoryStatus", 0); + + List categoryList = ORM.get(ZTable.class).list(YqCategory.class, categorSelector); + List childrenList = new ArrayList(); + List isParent = new ArrayList(); + int categoryLength = categoryList.size(); + + for (int i = 0; i < categoryLength; i++) + { + YqCategory category = categoryList.get(i); + int forNum = 0; + if (category.getParentId() != -1) + { + childrenList.add(category); + } + // 检测是不是有子分类 + for (int j = 0; j < categoryLength; j++) + { + if (category.getCategoryId() == categoryList.get(j).getParentId()) + { + continue; + } + forNum++; + } + ; + if (forNum == categoryLength) + { + isParent.add(false); + } + else + { + isParent.add(true); + } + } + ; + + String keyword = request.getParameter("keyword", ""); + + Selector selector = new Selector(); + selector.addMaybeLike("articleTitle", keyword); + selector.addOrderbyDesc("articleId"); + selector.addMust("articleStatus", 0); + + List articleList = ORM.get(ZTable.class).list(YqArticle.class, selector); + List contentList = new ArrayList(); + for (YqArticle article : articleList) + { + String content = new String(article.getArticleContent()); + content = content.replaceAll("<[a-zA-Z\\/][^>]*>", "").replaceAll(" ", ""); + int subEnd = 100; + if (content.length() < 100) + { + subEnd = content.length(); + } + content = content.substring(0, subEnd); + contentList.add(content); + } + + request.setAttribute("categoryList", categoryList); + request.setAttribute("isParent", isParent); + request.setAttribute("childrenList", childrenList); + request.setAttribute("articleList", articleList); + request.setAttribute("contentList", contentList); + request.setAttribute("keyword", keyword); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/api/ArticleSearchForUccnAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/api/ArticleSearchForUccnAction.java new file mode 100644 index 0000000..8396ca8 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/api/ArticleSearchForUccnAction.java @@ -0,0 +1,61 @@ +/** + * 扬彩印刷设计 + * 文件名 :ArticleSearchForUccnAction.java + * 创建人 :gjx + * 创建时间:2021年5月20日 +*/ + +package com.zhiqim.yangcai.design.action.question.api; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.YqArticle; +import com.zhiqim.yangcai.util.CodeEnum; +import com.zhiqim.yangcai.util.ResponseData; + +public class ArticleSearchForUccnAction implements Action +{ + // 模糊查询文章 + @Override + public void execute(HttpRequest request) throws Exception + { + request.getResponse().setHeader("Access-Control-Allow-Origin", "*"); + request.getResponse().setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); + request.getResponse().setHeader("Access-Control-Max-Age", "3600"); + request.getResponse().setHeader("Access-Control-Allow-Headers", "x-requested-with"); + Selector yqArticleSelector = new Selector(); + String articleTitle = request.getParameter("articleTitle").toString(); + if (!articleTitle.equals("")) + { + yqArticleSelector.addMustLike("articleTitle", articleTitle); + } + try + { + yqArticleSelector.addMust("articleStatus", 0); + List YqArticleList = ORM.get(ZTable.class).list(YqArticle.class, yqArticleSelector); + if (YqArticleList.size() == 0 || null == YqArticleList) + { + Object res = ResponseData.out(CodeEnum.SUCCESS.getCode(), new int[0], "操作成功"); + request.getResponse().println(Jsons.toString(res)); + return; + } + Object res = ResponseData.out(CodeEnum.SUCCESS.getCode(), YqArticleList, "操作成功"); + request.getResponse().println(Jsons.toString(res)); + } + catch (Exception e) + { + Object res = ResponseData.out(CodeEnum.ERROR.getCode(), "服务器错误," + e.getMessage()); + request.getResponse().println(Jsons.toString(res)); + + } + + } + +} \ No newline at end of file diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/api/CategoryLeval2ContentForUccnAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/api/CategoryLeval2ContentForUccnAction.java new file mode 100644 index 0000000..44b789f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/api/CategoryLeval2ContentForUccnAction.java @@ -0,0 +1,67 @@ +/** + * 扬彩印刷设计 + * 文件名 :ArticleForUccnAction.java + * 创建人 :gjx + * 创建时间:2021年5月20日 +*/ + +package com.zhiqim.yangcai.design.action.question.api; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.YqArticle; +import com.zhiqim.yangcai.util.CodeEnum; +import com.zhiqim.yangcai.util.ResponseData; + +public class CategoryLeval2ContentForUccnAction implements Action +{ + // 查询文章富文本内容信息 + @Override + public void execute(HttpRequest request) throws Exception + { + request.getResponse().setHeader("Access-Control-Allow-Origin", "*"); + request.getResponse().setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); + request.getResponse().setHeader("Access-Control-Max-Age", "3600"); + request.getResponse().setHeader("Access-Control-Allow-Headers", "x-requested-with"); + Selector yqArticleSelector = new Selector(); + String articleIdStr = request.getParameter("articleId").toString(); + try + { + if (articleIdStr == null || articleIdStr.equals("")) + { + Object res = ResponseData.out(CodeEnum.SUCCESS.getCode(), new int[0], "操作成功"); + request.getResponse().println(Jsons.toString(res)); + return; + } + + Long articleId = Long.valueOf(articleIdStr); + yqArticleSelector.addMust("articleId", articleId); + yqArticleSelector.addMust("articleStatus", 0); + YqArticle yqArticle = ORM.get(ZTable.class).item(YqArticle.class, yqArticleSelector); + int articleNumber = yqArticle.getArticleNumber(); + articleNumber++; + + // 点击次数+1 + Updater updater = new Updater(); + updater.addMust("articleId", articleId); + updater.addField("articleNumber", articleNumber); + ORM.get(ZTable.class).update(YqArticle.class, updater); + + Object res = ResponseData.out(CodeEnum.SUCCESS.getCode(), yqArticle, "操作成功"); + request.getResponse().println(Jsons.toString(res)); + } + catch (Exception e) + { + Object res = ResponseData.out(CodeEnum.SUCCESS.getCode(), "查询文章错误"); + request.getResponse().println(Jsons.toString(res)); + } + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/api/CategoryLeval2DetailForUccnAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/api/CategoryLeval2DetailForUccnAction.java new file mode 100644 index 0000000..c0744c3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/question/api/CategoryLeval2DetailForUccnAction.java @@ -0,0 +1,73 @@ +/** + * 扬彩印刷设计 + * 文件名 :CategoryLeval3ForUccnAction.java + * 创建人 :gjx + * 创建时间:2021年5月20日 +*/ + +package com.zhiqim.yangcai.design.action.question.api; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.YqArticle; +import com.zhiqim.yangcai.util.CodeEnum; +import com.zhiqim.yangcai.util.ResponseData; + +public class CategoryLeval2DetailForUccnAction implements Action +{ + // 查询二级分类下文章 + @Override + public void execute(HttpRequest request) throws Exception + { + request.getResponse().setHeader("Access-Control-Allow-Origin", "*"); + request.getResponse().setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); + request.getResponse().setHeader("Access-Control-Max-Age", "3600"); + request.getResponse().setHeader("Access-Control-Allow-Headers", "x-requested-with"); + Selector yqArticleSelector = new Selector(); + String categoryIdStr = request.getParameter("categoryId").toString(); + try + { + if (categoryIdStr == null || categoryIdStr.equals("")) + { + Selector yqArticleOrderbyNum = new Selector(); + yqArticleOrderbyNum.addOrderbyDesc("articleNumber"); + List yqArticleList = ORM.get(ZTable.class).list(YqArticle.class, yqArticleOrderbyNum); + Object res = ResponseData.out(CodeEnum.SUCCESS.getCode(), yqArticleList, "操作成功"); + request.getResponse().println(Jsons.toString(res)); + return; + } + + Long categoryId = Long.valueOf(categoryIdStr); + yqArticleSelector.addMust("categoryId", categoryId); + yqArticleSelector.addMust("articleStatus", 0); + yqArticleSelector.addOrderbyDesc("articleTime"); + List yqArticleList = ORM.get(ZTable.class).list(YqArticle.class, yqArticleSelector); + if (yqArticleList == null) + { + Object res = ResponseData.out(CodeEnum.SUCCESS.getCode(), new int[0], "操作成功"); + request.getResponse().println(Jsons.toString(res)); + return; + } + for (YqArticle yqArticleItem : yqArticleList) + { + yqArticleItem.setArticleContent(null); + } + Object res = ResponseData.out(CodeEnum.SUCCESS.getCode(), yqArticleList, "操作成功"); + request.getResponse().println(Jsons.toString(res)); + } + catch (Exception e) + { + Object res = ResponseData.out(CodeEnum.SUCCESS.getCode(), "查询文章错误"); + request.getResponse().println(Jsons.toString(res)); + } + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/KeywordScoreAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/KeywordScoreAction.java new file mode 100644 index 0000000..c8357ae --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/KeywordScoreAction.java @@ -0,0 +1,131 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.score; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.dbo.score.DesScoreParam; +import com.zhiqim.yangcai.design.dbo.score.DesScoreWeight; + +/** + * 关键词评分参数 + * + * @version v1.0.0 @author Deng 2018-3-13 新建与整理 + */ +public class KeywordScoreAction extends StdSwitchAction implements ZmrConstants +{ + @Override + protected void validateId(HttpRequest request) + { + + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsNotEmpty("paramKey","请选择参数名称")); + request.addValidate(new IsNotEmpty("paramKey","请选择参数键")); + request.addValidate(new IsNotEmpty("paramValue","请选择参数值")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + Selector selector = new Selector(); + selector.addMust("scoreName", ScoreConstants.SCORE_KEYWORD); + selector.addMust("scoreValue", 0); + List scoreList = ORM.get(ZTable.class).list(DesScoreWeight.class, selector); + request.setAttribute("scoreList", scoreList); + + String scoreType = request.getParameter("scoreType"); + Selector pSelector = new Selector(); + pSelector.addMust("scoreName", "KEYWORD"); + pSelector.addOrderbyAsc("paramType"); + + if (Validates.isNotEmpty(scoreType)) + pSelector.addMust("scoreType", scoreType); + + List paramList = ORM.get(ZTable.class).list(DesScoreParam.class, pSelector); + request.setAttribute("paramList", paramList); + request.setAttribute("scoreType", scoreType); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + String scoreType = request.getParameter("scoreType"); + + Selector selector = new Selector(); + selector.addMust("scoreName", ScoreConstants.SCORE_KEYWORD); + + if (Validates.isNotEmpty(scoreType)) + selector.addMust("scoreType", scoreType); + else + selector.addMust("scoreValue", 0); + + List scoreList = ORM.get(ZTable.class).list(DesScoreWeight.class, selector); + request.setAttribute("scoreList", scoreList); + + request.setAttribute("scoreType", scoreType); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String scoreName = request.getParameter("scoreName"); + String scoreType = request.getParameter("scoreType"); + String paramKey = request.getParameter("paramKey"); + int paramType = request.getParameterInt("paramType"); + int paramValue = request.getParameterInt("paramValue"); + + DesScoreParam param = new DesScoreParam(); + param.setParamId(Ids.longId()); + param.setScoreName(scoreName); + param.setScoreType(scoreType); + param.setParamType(paramType); + param.setParamKey(paramKey); + param.setParamValue(paramValue); + + ORM.get(ZTable.class).insert(param); + + request.addParam("scoreType", scoreType); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + + } + + @Override + protected void update(HttpRequest request) throws Exception + { + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/KeywordWeightAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/KeywordWeightAction.java new file mode 100644 index 0000000..820718a --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/KeywordWeightAction.java @@ -0,0 +1,127 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.score; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.dbo.score.DesScoreWeight; + +/** + * 关键词分数权重 + * + * @version v1.0.0 @author Deng 2018-3-14 新建与整理 + */ +public class KeywordWeightAction extends StdSwitchAction implements ZmrConstants +{ + + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("scoreId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsNotEmpty("dayCode","请选择日期")); + request.addValidate(new IsNotEmpty("scoreWeight","请输入权重比例")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt("page.size", 20); + + Selector selector = new Selector(); + selector.addMust("scoreName", ScoreConstants.SCORE_KEYWORD); + selector.addOrderbyDesc("dayCode"); + PageResult pageResult = ORM.get(ZTable.class).page(DesScoreWeight.class, page, pageSize, selector); + request.setAttribute("pageResult", pageResult); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String scoreName = request.getParameter("scoreName"); + String dayCode = request.getParameter("dayCode"); + String scoreType = request.getParameter("scoreType"); + int scoreWeight = request.getParameterInt("scoreWeight"); + int scoreValue = request.getParameterInt("scoreValue", 0); + + DesScoreWeight weight = new DesScoreWeight(); + weight.setScoreId(Ids.longId()); + weight.setScoreName(scoreName); + weight.setDayCode(dayCode); + weight.setScoreType(scoreType); + weight.setScoreWeight(scoreWeight); + weight.setScoreValue(scoreValue); + + ORM.get(ZTable.class).insert(weight); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long scoreId = request.getParameterLong("scoreId"); + DesScoreWeight weight = ORM.get(ZTable.class).item(DesScoreWeight.class, scoreId); + if (weight == null) + { + request.returnHistory("该关键词分数权重不存在,请重新选择"); + return; + } + + request.setAttribute("weight", weight); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long scoreId = request.getParameterLong("scoreId"); + String dayCode = request.getParameter("dayCode"); + int scoreWeight = request.getParameterInt("scoreWeight"); + int scoreValue = request.getParameterInt("scoreValue", 0); + + Updater update = new Updater(); + update.addMust("scoreId", scoreId); + update.addField("dayCode", dayCode); + update.addField("scoreWeight", scoreWeight); + update.addField("scoreValue", scoreValue); + + ORM.get(ZTable.class).update(DesScoreWeight.class, update); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long scoreId = request.getParameterLong("scoreId"); + + ORM.get(ZTable.class).delete(DesScoreWeight.class, scoreId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/ScoreDesignerLeverAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/ScoreDesignerLeverAction.java new file mode 100644 index 0000000..370c4de --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/ScoreDesignerLeverAction.java @@ -0,0 +1,189 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.score; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsIntegerValue; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerLever; + +/** + * 设计师等级配置 + * + * @version v1.0.0 @author jiangfan 2020-8-27 新建与整理 + */ +public class ScoreDesignerLeverAction extends StdSwitchAction implements ZmrConstants +{ + + @Override + protected void validateId(HttpRequest request) + { + + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsNotEmpty("designerLever", "请输入设计师等级名称")); + request.addValidate(new IsLen("designerLever", "设计师等级名称不能超过10个字符", 1, 10)); + request.addValidate(new IsNotEmpty("minScore", "请输入最小评分分数")); + request.addValidate(new IsNotEmpty("maxScore", "请输入最大评分分数")); + request.addValidate(new IsIntegerValue("minScore", "最小评分分数在【-999999到999999】之间", -999999, 999999)); + request.addValidate(new IsIntegerValue("maxScore", "最大评分分数在【-999999到999999】之间", -999999, 999999)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt("page.size", 20); + + Selector selector = new Selector(); + PageResult pageResult = ORM.get(ZTable.class).page(ScoreDesignerLever.class, page, pageSize, selector); + request.setAttribute("pageResult", pageResult); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String designerLever = request.getParameter("designerLever"); + Integer minScore = request.getParameterInt("minScore"); + Integer maxScore = request.getParameterInt("maxScore"); + if (minScore > maxScore) + { + request.setResponseError("最小分数应小于最大分数"); + return; + } + List scoreDesignerLeverList = ORM.get(ZTable.class).list(ScoreDesignerLever.class); + if (null != scoreDesignerLeverList) + { + for (ScoreDesignerLever scoreDesignerLever : scoreDesignerLeverList) + { + if (scoreDesignerLever.getDesignerLever().equals(designerLever)) + { + request.setResponseError("设计师等级名称冲突"); + return; + } + } + } + for (int i = minScore; i < maxScore; i++) + { + for (ScoreDesignerLever scoreDesignerLever : scoreDesignerLeverList) + { + if (scoreDesignerLever.getMinScore() <= i && i < scoreDesignerLever.getMaxScore()) + { + request.setResponseError("评分分数与其他数据有交集,如" + i); + return; + } + } + } + ScoreDesignerLever scoreDesignerLever = new ScoreDesignerLever(); + scoreDesignerLever.setDesignerLeverId(Ids.longId()); + scoreDesignerLever.setDesignerLever(designerLever); + scoreDesignerLever.setMinScore(minScore); + scoreDesignerLever.setMaxScore(maxScore); + scoreDesignerLever.setState(1); + scoreDesignerLever.setLastOperatorCode(request.getSessionName()); + scoreDesignerLever.setCreateTime(Sqls.nowTimestamp()); + scoreDesignerLever.setModifyTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(scoreDesignerLever); + request.setRedirect("/scoreDesignerLever.htm"); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long designerLeverId = request.getParameterLong("designerLeverId"); + ScoreDesignerLever scoreDesignerLever = ORM.get(ZTable.class).item(ScoreDesignerLever.class, designerLeverId); + if (scoreDesignerLever == null) + { + request.returnHistory("该设计师等级不存在,请重新选择"); + return; + } + + request.setAttribute("scoreDesignerLever", scoreDesignerLever); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long designerLeverId = request.getParameterLong("designerLeverId"); + String designerLever = request.getParameter("designerLever"); + int minScore = request.getParameterInt("minScore"); + int maxScore = request.getParameterInt("maxScore"); + if (minScore > maxScore) + { + request.setResponseError("最小分数应小于最大分数"); + return; + } + List scoreDesignerLeverList = ORM.get(ZTable.class).list(ScoreDesignerLever.class); + if (null != scoreDesignerLeverList) + { + for (ScoreDesignerLever scoreDesignerLever : scoreDesignerLeverList) + { + if (scoreDesignerLever.getDesignerLever().equals(designerLever) && scoreDesignerLever.getDesignerLeverId() != designerLeverId) + { + request.setResponseError("设计师等级名称冲突"); + return; + } + } + } + for (int i = minScore; i < maxScore; i++) + { + for (ScoreDesignerLever scoreDesignerLever : scoreDesignerLeverList) + { + if (scoreDesignerLever.getMinScore() <= i && i < scoreDesignerLever.getMaxScore() && scoreDesignerLever.getDesignerLeverId() != designerLeverId) + { + request.setResponseError("评分分数与其他数据有交集,如" + i); + return; + } + } + } + Updater update = new Updater(); + update.addMust("designerLeverId", designerLeverId); + update.addField("designerLever", designerLever); + update.addField("minScore", minScore); + update.addField("maxScore", maxScore); + update.addField("lastOperatorCode", request.getSessionName()); + update.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(ScoreDesignerLever.class, update); + request.setRedirect("/scoreDesignerLever.htm"); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long designerLeverId = request.getParameterLong("designerLeverId"); + + ORM.get(ZTable.class).delete(ScoreDesignerLever.class, designerLeverId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/ScoreDesignerRecordAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/ScoreDesignerRecordAction.java new file mode 100644 index 0000000..10fce70 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/ScoreDesignerRecordAction.java @@ -0,0 +1,140 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.score; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerLever; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordView; + +/** + * 设计师积分总账 + * + * @version v1.0.0 @author jiangfan 2020-8-27 新建与整理 + */ +public class ScoreDesignerRecordAction extends StdSwitchAction implements ZmrConstants +{ + + @Override + protected void validateId(HttpRequest request) + { + + } + + @Override + protected void validateForm(HttpRequest request) + { + + } + + @Override + protected void list(HttpRequest request) throws Exception + { + Selector selector = new Selector(); + + List scoreDesignerLeverList = ORM.get(ZTable.class).list(ScoreDesignerLever.class, selector); + request.setAttribute("scoreDesignerLeverList", scoreDesignerLeverList); + + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + if (orgId > 0) + { + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org != null && org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + } + + List designerList = ORM.get(ZTable.class).list(DesignerGroupDispatch.class, selector); + request.setAttribute("designerList", designerList); + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + String sortColumn = request.getParameter("sortColumn", "score"); + request.setAttribute("sortColumn", sortColumn); + String sortType = request.getParameter("sortType", "desc"); + request.setAttribute("sortType", sortType); + int state = request.getParameterInt("state"); + request.setAttribute("state", state); + + Selector pSelector = new Selector(); + pSelector.addMaybe("state", state); + pSelector.addMaybe("orgId", request.getParameterLong("orgId")); + String operatorCode = request.getParameter("operatorCode"); + request.setAttribute("operatorCode", operatorCode); + if (Validates.isNotEmpty(operatorCode)) + { + pSelector.addMust("operatorCode", operatorCode); + } + if ("desc".equals(sortType)) + { + pSelector.addOrderbyDesc(sortColumn); + } + else + { + pSelector.addOrderbyAsc(sortColumn); + } + PageResult pageResult = ORM.get(ZView.class).page(ScoreDesignerRecordView.class, page, pageSize, pSelector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + selOrg.addMustNotEqual("orgId", 1808071102554512L); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + + request.setAttribute("orgList", orgList); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + + } + + @Override + protected void update(HttpRequest request) throws Exception + { + // TODO + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/ScoreDesignerRecordDetailAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/ScoreDesignerRecordDetailAction.java new file mode 100644 index 0000000..bbfe1e0 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/ScoreDesignerRecordDetailAction.java @@ -0,0 +1,135 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.score; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsIntegerValue; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.dao.ScoreDesignerRecordDao; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordDetail; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordDetailView; + +/** + * 设计师积分总账 + * + * @version v1.0.0 @author jiangfan 2020-8-27 新建与整理 + */ +public class ScoreDesignerRecordDetailAction extends StdSwitchAction implements ZmrConstants +{ + + @Override + protected void validateId(HttpRequest request) + { + + } + + @Override + protected void validateForm(HttpRequest request) + { + + request.addValidate(new IsNotEmpty("score", "请输入分数")); + request.addValidate(new IsIntegerValue("score", "分数在【-999999到999999】之间", -999999, 999999)); + request.addValidate(new IsNotEmpty("remark", "请输入备注")); + request.addValidate(new IsLen("remark", "备注不能超过100个字符", 1, 100)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + String detailType = request.getParameter("detailType", "all"); + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + + Selector pSelector = new Selector(); + pSelector.addMust("operatorCode", request.getParameter("operatorCode")); + pSelector.addMust("state", 1); + if ("add".equals(detailType)) + { + pSelector.addMustThenGE("score", 0); + } + else if ("sub".equals(detailType)) + { + pSelector.addMustThenLE("score", 0); + } + pSelector.addMustThenGE("createTime", Sqls.toTimestamp(startDate + " 00:00:00")); + pSelector.addMustThenLE("createTime", Sqls.toTimestamp(endDate + " 23:59:59")); + pSelector.addOrderbyDesc("modifyTime"); + PageResult pageResult = ORM.get(ZView.class).page(ScoreDesignerRecordDetailView.class, page, pageSize, pSelector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + request.setAttribute("detailType", detailType); + request.setAttribute("operatorCode", request.getParameter("operatorCode")); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + request.setAttribute("operatorCode", request.getParameter("operatorCode")); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode"); + String score = request.getParameter("score"); + long orderId = request.getParameterLong("orderId"); + String remark = request.getParameter("remark"); + + // 人工修正 + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_100.value())); + scoreDesignerRecordDetail.setOperatorCode(operatorCode); + scoreDesignerRecordDetail.setCreateOperator(request.getSessionUser(ZmrSessionUser.class).getOperatorCode()); + if (orderId > 0) + { + scoreDesignerRecordDetail.setOrderId(orderId); + } + scoreDesignerRecordDetail.setRemark(remark); + scoreDesignerRecordDetail.setScore(Integer.valueOf(score)); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + + } + + @Override + protected void update(HttpRequest request) throws Exception + { + // TODO + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/ScoreTypeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/ScoreTypeAction.java new file mode 100644 index 0000000..4c42c51 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/ScoreTypeAction.java @@ -0,0 +1,124 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.score; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.dbo.score.ScoreType; + +/** + * 评分权重 + * + * @version v1.0.0 @author jiangfan 2020-8-27 新建与整理 + */ +public class ScoreTypeAction extends StdSwitchAction implements ZmrConstants +{ + + @Override + protected void validateId(HttpRequest request) + { + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsNotEmpty("typeId", "请选择评分类型")); + request.addValidate(new IsNotEmpty("value", "请输入积分值")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt("page.size", 20); + + Selector selector = new Selector(); + selector.addOrderbyDesc("modifyTime").addOrderbyDesc("state"); + PageResult pageResult = ORM.get(ZTable.class).page(ScoreType.class, page, pageSize, selector); + request.setAttribute("pageResult", pageResult); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + request.setAttribute("scoreTypeList", ScoreConstants.getScoreTypeList()); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + Long typeId = request.getParameterLong("typeId"); + int value = request.getParameterInt("value"); + String remark = request.getParameter("remark"); + ScoreType scoreType = new ScoreType(); + scoreType.setTypeId(typeId); + scoreType.setTypeName(ScoreConstants.getScoreTypeListDesc(String.valueOf(typeId))); + scoreType.setValue(value); + scoreType.setState(1); + scoreType.setRemark(remark); + scoreType.setLastOperatorCode(request.getSessionName()); + scoreType.setCreateTime(Sqls.nowTimestamp()); + scoreType.setModifyTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(scoreType); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long typeId = request.getParameterLong("typeId"); + ScoreType scoreType = ORM.get(ZTable.class).item(ScoreType.class, typeId); + if (scoreType == null) + { + request.returnHistory("该评分权重不存在,请重新选择"); + return; + } + request.setAttribute("typeId", typeId); + request.setAttribute("scoreTypeList", ScoreConstants.getScoreTypeList()); + request.setAttribute("scoreType", scoreType); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + Long typeId = request.getParameterLong("typeId"); + int value = request.getParameterInt("value"); + String remark = request.getParameter("remark"); + + Updater update = new Updater(); + update.addMust("typeId", typeId); + update.addField("typeName", ScoreConstants.getScoreTypeListDesc(String.valueOf(typeId))); + update.addField("value", value); + update.addField("remark", remark); + update.addField("lastOperatorCode", request.getSessionName()); + update.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(ScoreType.class, update); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long typeId = request.getParameterLong("typeId"); + + ORM.get(ZTable.class).delete(ScoreType.class, typeId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/TemplateScoreAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/TemplateScoreAction.java new file mode 100644 index 0000000..2c0cbf8 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/TemplateScoreAction.java @@ -0,0 +1,131 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.score; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.dbo.score.DesScoreParam; +import com.zhiqim.yangcai.design.dbo.score.DesScoreWeight; + +/** + * 模板评分参数 + * + * @version v1.0.0 @author Deng 2018-3-13 新建与整理 + */ +public class TemplateScoreAction extends StdSwitchAction implements ZmrConstants +{ + @Override + protected void validateId(HttpRequest request) + { + + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsNotEmpty("paramKey","请选择参数名称")); + request.addValidate(new IsNotEmpty("paramKey","请选择参数键")); + request.addValidate(new IsNotEmpty("paramValue","请选择参数值")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + Selector selector = new Selector(); + selector.addMust("scoreName", ScoreConstants.SCORE_TEMPLATE); + selector.addMust("scoreValue", 0); + List scoreList = ORM.get(ZTable.class).list(DesScoreWeight.class, selector); + request.setAttribute("scoreList", scoreList); + + String scoreType = request.getParameter("scoreType"); + Selector pSelector = new Selector(); + pSelector.addMust("scoreName", "TEMPLATE"); + pSelector.addOrderbyAsc("paramType"); + + if (Validates.isNotEmpty(scoreType)) + pSelector.addMust("scoreType", scoreType); + + List paramList = ORM.get(ZTable.class).list(DesScoreParam.class, pSelector); + request.setAttribute("paramList", paramList); + request.setAttribute("scoreType", scoreType); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + String scoreType = request.getParameter("scoreType"); + + Selector selector = new Selector(); + selector.addMust("scoreName", ScoreConstants.SCORE_TEMPLATE); + + if (Validates.isNotEmpty(scoreType)) + selector.addMust("scoreType", scoreType); + else + selector.addMust("scoreValue", 0); + + List scoreList = ORM.get(ZTable.class).list(DesScoreWeight.class, selector); + request.setAttribute("scoreList", scoreList); + + request.setAttribute("scoreType", scoreType); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String scoreName = request.getParameter("scoreName"); + String scoreType = request.getParameter("scoreType"); + String paramKey = request.getParameter("paramKey"); + int paramType = request.getParameterInt("paramType"); + int paramValue = request.getParameterInt("paramValue"); + + DesScoreParam param = new DesScoreParam(); + param.setParamId(Ids.longId()); + param.setScoreName(scoreName); + param.setScoreType(scoreType); + param.setParamType(paramType); + param.setParamKey(paramKey); + param.setParamValue(paramValue); + + ORM.get(ZTable.class).insert(param); + + request.addParam("scoreType", scoreType); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + + } + + @Override + protected void update(HttpRequest request) throws Exception + { + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/TemplateWeightAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/TemplateWeightAction.java new file mode 100644 index 0000000..fc6c9ec --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/score/TemplateWeightAction.java @@ -0,0 +1,125 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.score; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.dbo.score.DesScoreWeight; + +/** + * 模板分数权重 + * + * @version v1.0.0 @author Deng 2018-3-14 新建与整理 + */ +public class TemplateWeightAction extends StdSwitchAction implements ZmrConstants +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("scoreId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsNotEmpty("dayCode","请选择日期")); + request.addValidate(new IsNotEmpty("scoreWeight","请输入权重比例")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt("page.size", 20); + + Selector selector = new Selector(); + selector.addMust("scoreName", ScoreConstants.SCORE_TEMPLATE); + selector.addOrderbyDesc("dayCode"); + PageResult pageResult = ORM.get(ZTable.class).page(DesScoreWeight.class, page, pageSize, selector); + request.setAttribute("pageResult", pageResult); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String scoreName = request.getParameter("scoreName"); + String dayCode = request.getParameter("dayCode"); + String scoreType = request.getParameter("scoreType"); + int scoreWeight = request.getParameterInt("scoreWeight"); + int scoreValue = request.getParameterInt("scoreValue", 0); + + DesScoreWeight weight = new DesScoreWeight(); + weight.setScoreId(Ids.longId()); + weight.setScoreName(scoreName); + weight.setDayCode(dayCode); + weight.setScoreType(scoreType); + weight.setScoreWeight(scoreWeight); + weight.setScoreValue(scoreValue); + + ORM.get(ZTable.class).insert(weight); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long scoreId = request.getParameterLong("scoreId"); + DesScoreWeight weight = ORM.get(ZTable.class).item(DesScoreWeight.class, scoreId); + if (weight == null) + { + request.returnHistory("该模板分数权重不存在,请重新选择"); + return; + } + + request.setAttribute("weight", weight); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long scoreId = request.getParameterLong("scoreId"); + String dayCode = request.getParameter("dayCode"); + int scoreWeight = request.getParameterInt("scoreWeight"); + int scoreValue = request.getParameterInt("scoreValue", 0); + + Updater update = new Updater(); + update.addMust("scoreId", scoreId); + update.addField("dayCode", dayCode); + update.addField("scoreWeight", scoreWeight); + update.addField("scoreValue", scoreValue); + + ORM.get(ZTable.class).update(DesScoreWeight.class, update); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long scoreId = request.getParameterLong("scoreId"); + + ORM.get(ZTable.class).delete(DesScoreWeight.class, scoreId); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sms/SmsSendLogAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sms/SmsSendLogAction.java new file mode 100644 index 0000000..6612e2f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sms/SmsSendLogAction.java @@ -0,0 +1,54 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sms; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.sms.SmsLog; + +/** + * 短信发送日志 + * @version v1.0.0 @author zhouwenbin 2018-6-12 新建与整理 + */ +public class SmsSendLogAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 20; + + int sendStatus = request.getParameterInt("sendStatus"); + long designId = request.getParameterLong("designId"); + String mobile = request.getParameter("mobile"); + + Selector selector = new Selector(); + selector.addMaybe("mobile", mobile); + selector.addMaybe("designId", designId); + if(sendStatus != -1) + selector.addMaybe("sendStatus", sendStatus); + + selector.addOrderbyDesc("sendTime"); + + PageResult pageResult = ORM.get(ZTable.class).page(SmsLog.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/DesignAfterCreateStatisticsAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/DesignAfterCreateStatisticsAction.java new file mode 100644 index 0000000..1e00021 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/DesignAfterCreateStatisticsAction.java @@ -0,0 +1,78 @@ +/* + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ + +package com.zhiqim.yangcai.design.action.stat.after; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrderView; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterStatisticDetail; +import com.zhiqim.yangcai.design.stat.model.AfterStatisticModule; + +/***** + * 售后创建统计 + * + * @version v1.0.0 @author lgz 2019-3-13 新建与整理 + */ +public class DesignAfterCreateStatisticsAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int currYear = DateTimes.getCurrentYear(); + int currMonth = DateTimes.getCurrentMonth(); + currYear = currMonth == 1 ? currYear - 1 : currYear; + currMonth = currMonth == 1 ? 12 : currMonth; + + int year = request.getParameterInt("year", currYear); + int month = request.getParameterInt("month", currMonth); + month = month < 1 ? 1 : (month > 12 ? 12 : month); + request.setAttribute("year", year); + request.setAttribute("month", month); + + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + Selector selector = new Selector(); + selector.addMaybe("picOrgId", orgId); + selector.addMustNotEqual("afterStatus", AfterConstants.CS_0.value()); + selector.addMustThenGE("afterHandelTime", Sqls.toTimestamp(year + "-" + (month < 10 ? "0" : "") + month + "-01", "00:00:00")); + selector.addMustThenLE("afterHandelTime", Sqls.toTimestamp(DateTimes.getLastMonthDay(year + (month < 10 ? "0" : "") + month), "23:59:59")); + Map blamerAfterMap = new HashMap(); + + List dataList = ORM.get(ZView.class).list(DesignAfterOrderView.class, selector); + for (DesignAfterOrderView after : dataList) + { + DesignAfterStatisticDetail detail = new DesignAfterStatisticDetail(); + Objects.copyDeep(after, detail); + detail.setStartDate(year + "-" + (month < 10 ? "0" : "") + month); + AfterStatisticModule module = blamerAfterMap.get(detail.getAfterHandler()); + module = module != null ? module : new AfterStatisticModule(); + module.addAfterDetail(detail); + module.setAfterBlamer(detail.getAfterHandler()); + blamerAfterMap.put(detail.getAfterHandler(), module); + } + + request.setAttribute("blamerAfterMap", blamerAfterMap); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/DesignAfterOrgStatisticsAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/DesignAfterOrgStatisticsAction.java new file mode 100644 index 0000000..c31710e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/DesignAfterOrgStatisticsAction.java @@ -0,0 +1,83 @@ +package com.zhiqim.yangcai.design.action.stat.after; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterStatisticDetail; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.stat.model.AfterStatisticModule; + +/**** + * 组织售后订单统计 + * + * @version v1.0.0 @author lgz 2019-3-13 新建与整理 + * @version v1.0.1 @author gjx 2019-08-03 右侧表格增加组织定稿单数 + */ +public class DesignAfterOrgStatisticsAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int year = request.getParameterInt("year"); + int month = request.getParameterInt("month"); + + String commenMonth = (month < 10 ? "0" : "") + month; + int monthDays = DateTimes.getMonthDays(year, month); + + Map orgAfterMap = new HashMap(); + Map allDesignOrderCountMap = new HashMap<>();// 组织定稿金额 + Map finalizeMap = new HashMap<>();// 组织定稿单数Map + + if (year > 0 && month > 0) + { + Selector designSel = new Selector(); + designSel.addMustThenGE("status", StatusConstants.ORDER_55.value());// 大于等于已定稿状态 + designSel.addMustThenGE("createTime", Sqls.toTimestamp(year + "-" + commenMonth + "-01 00:00:00")); + designSel.addMustThenLE("createTime", Sqls.toTimestamp(year + "-" + commenMonth + "-" + monthDays + " 23:59:59")); + List designList = ORM.get(ZTable.class).list(DesignOrder.class, designSel); + + for (DesignOrder designOrder : designList) + { + String orgName = ZmrOrgDao.getOrgName(request, designOrder.getOrgId()); + Long finalizeCount = finalizeMap.get(orgName); + finalizeMap.put(orgName, finalizeCount == null ? 1 : finalizeCount + 1); + Double allDesignOrderCount = allDesignOrderCountMap.get(orgName); + allDesignOrderCountMap.put(orgName, allDesignOrderCount == null ? 0 : allDesignOrderCount + designOrder.getAmount()); + } + + Selector selector = new Selector(); + // selector.addMaybe("picOrgId", orgId); + selector.addMust("startDate", year + "-" + commenMonth); + + List dataList = ORM.get(ZTable.class).list(DesignAfterStatisticDetail.class, selector); + for (DesignAfterStatisticDetail detail : dataList) + { + AfterStatisticModule module = orgAfterMap.get(Strings.valueOf(detail.getPicOrgId())); + module = module != null ? module : new AfterStatisticModule(); + module.addAfterDetail(detail); + module.setAfterBlamer(Strings.valueOf(detail.getPicOrgId())); + orgAfterMap.put(Strings.valueOf(detail.getPicOrgId()), module); + } + } + + request.setAttribute("orgAfterMap", orgAfterMap); + request.setAttribute("orgList", ZmrOrgDao.list(request)); + request.setAttribute("year", year <= 0 ? DateTimes.getCurrentYear() : year); + request.setAttribute("month", month <= 0 ? DateTimes.getCurrentMonth() : month); + request.setAttribute("finalizeMap", finalizeMap); + request.setAttribute("allDesignOrderCountMap", allDesignOrderCountMap); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/DesignAfterReasonStatisticsAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/DesignAfterReasonStatisticsAction.java new file mode 100644 index 0000000..d110e87 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/DesignAfterReasonStatisticsAction.java @@ -0,0 +1,90 @@ +package com.zhiqim.yangcai.design.action.stat.after; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.stat.model.AfterStatisticModule; + +/**** + * 售后原因统计 + * + * @version v1.0.0 @author caohong 2020-11-9 + */ +public class DesignAfterReasonStatisticsAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 186) + { + request.setResponseError("请勿将时间区间跨度选择大于6个月"); + return; + } + + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + String startCreateDate = beginDate + " 00:00:00"; + String endCreateDate = endDate + " 23:59:59"; + + String querySql = "SELECT PROBLEM_REASON,COUNT(*) AS COUNTS,SUM(LOSS_AMOUNT) AS LOSS_AMOUNT,SUM(AMOUNT) AS AMOUNT "; + querySql += "FROM DESIGN_AFTER_ORDER a,DESIGN_ORDER o WHERE a.DESIGN_ID=o.DESIGN_ID "; + if (ZmrOrgDao.getOrgRootId(request) != orgId) + { + querySql += "AND a.PIC_ORG_ID = " + orgId + " "; + }else { + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgIdArr=orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() -1); + querySql += "AND a.PIC_ORG_ID in (" + orgIdArr + ") "; + } + } + + querySql += "AND AFTER_CREATE_TIME >= '" + startCreateDate + "' AND AFTER_CREATE_TIME <='" + endCreateDate + "' "; + querySql += "GROUP BY PROBLEM_REASON ORDER BY COUNTS DESC "; + + List listQuery = ORM.get(ZSQL.class).executeQuery(querySql); + List reasonList = new ArrayList(); + if (listQuery != null && listQuery.size() > 0) + { + for (LinkedMapSO linked : listQuery) + { + int afterCount = Integer.valueOf(linked.get("COUNTS").toString()); + double lostAmount = Double.valueOf(linked.get("LOSS_AMOUNT").toString()); + long totalOrderAmount = Long.valueOf(linked.get("AMOUNT").toString()); + AfterStatisticModule module = new AfterStatisticModule(); + module.setAfterCount(afterCount); + module.setLostAmount(lostAmount); + module.setTotalOrderAmount(totalOrderAmount); + module.setProblemReason(linked.get("PROBLEM_REASON").toString()); + reasonList.add(module); + } + } + + request.setAttribute("reasonList", reasonList); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/DesignAfterStatisticsAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/DesignAfterStatisticsAction.java new file mode 100644 index 0000000..2f55b68 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/DesignAfterStatisticsAction.java @@ -0,0 +1,137 @@ +package com.zhiqim.yangcai.design.action.stat.after; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrderView; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterStatisticDetail; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.stat.model.AfterStatisticModule; + +/***** + * 售后订单统计 + * + * @version v1.0.0 @author lgz 2019-3-13 新建与整理 + */ +public class DesignAfterStatisticsAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int currYear = DateTimes.getCurrentYear(); + int currMonth = DateTimes.getCurrentMonth(); + currYear = currMonth == 1 ? currYear - 1 : currYear; + currMonth = currMonth == 1 ? 12 : currMonth; + + int year = request.getParameterInt("year", currYear); + int month = request.getParameterInt("month", currMonth); + month = month < 1 ? 1 : (month > 12 ? 12 : month); + + String afterBlamer = request.getParameter("afterBlamer", request.getSessionName()); + + request.setAttribute("year", year); + request.setAttribute("month", month); + request.setAttribute("afterBlamer", afterBlamer); + + long picOrgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + String startDate = year + "-" + (month < 10 ? "0" : "") + month; + + Selector selector = new Selector(); + + // 非总部组织只能看自己 + ZmrOrg org = ZmrOrgDao.getOrg(request, picOrgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("afterBlamer", afterBlamer); + selector.addMust("picOrgId", picOrgId); + } + else + { + selector.addMaybe("picOrgId", request.getParameterLong("orgId")); + + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + selOrg.addMustNotEqual("orgId", 1808071102554512L); + + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selOrg.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + selector.addMustInLong("picOrgId", Arrays.toArrayLong(orgList)); + } + + + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + request.setAttribute("orgList", orgList); + } + selector.addMustNotEqual("afterStatus", AfterConstants.CS_0.value()); + selector.addMustThenGE("afterHandelTime", Sqls.toTimestamp(year + "-" + (month < 10 ? "0" : "") + month + "-01", "00:00:00")); + selector.addMustThenLE("afterHandelTime", Sqls.toTimestamp(DateTimes.getLastMonthDay(year + (month < 10 ? "0" : "") + month), "23:59:59")); + Map blamerAfterMap = new HashMap(); + + List dataList = ORM.get(ZView.class).list(DesignAfterOrderView.class, selector); + + for (DesignAfterOrderView after : dataList) + { + DesignAfterStatisticDetail detail = new DesignAfterStatisticDetail(); + Objects.copyDeep(after, detail); + detail.setStartDate(startDate); + detail.setStartDate(year + "-" + (month < 10 ? "0" : "") + month); + ORM.get(ZTable.class).replace(detail); + + AfterStatisticModule module = blamerAfterMap.get(detail.getAfterBlamer()); + module = module != null ? module : new AfterStatisticModule(); + detail.setCompensateAmount(after.getCompensateAmount()); + module.addAfterDetail(detail); + blamerAfterMap.put(detail.getAfterBlamer(), module); + } + + for (AfterStatisticModule model : blamerAfterMap.values()) + { + Selector sel = new Selector("designer", model.getAfterBlamer()); + sel.addMustThenGE("status", StatusConstants.ORDER_55.value()); + sel.addMustThenGE("designEndTime", Sqls.toTimestampBegin(startDate + "-01")); + sel.addMustThenLE("designEndTime", Sqls.toTimestampEnd(DateTimes.getLastMonthDay(startDate.replace("-", "")))); + + // 定稿单数 + int orderEnds = ORM.get(ZTable.class).count(DesignOrder.class, sel); + model.setOrderEnds(orderEnds); + if (orderEnds > 0) + {// 售后率 + model.setAfterRatio(new BigDecimal(String.valueOf(model.getAfterCount() * 100)) + .divide(new BigDecimal(String.valueOf(orderEnds)), 2, RoundingMode.HALF_UP).doubleValue()); + } + } + + request.setAttribute("blamerAfterMap", blamerAfterMap); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/PersonalAfterStatisticsAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/PersonalAfterStatisticsAction.java new file mode 100644 index 0000000..95d05af --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/after/PersonalAfterStatisticsAction.java @@ -0,0 +1,66 @@ +/* + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ + +package com.zhiqim.yangcai.design.action.stat.after; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.after.DesignAfterStatisticDetail; +import com.zhiqim.yangcai.design.stat.model.AfterStatisticModule; + +/**** + * 个人售后订单统计 + * + * @version v1.0.0 @author lgz 2019-3-13 新建与整理 + */ +public class PersonalAfterStatisticsAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int currYear = DateTimes.getCurrentYear(); + int currMonth = DateTimes.getCurrentMonth(); + currYear = currMonth == 1 ? currYear - 1 : currYear; + currMonth = currMonth == 1 ? 12 : currMonth; + + int year = request.getParameterInt("year", currYear); + int month = request.getParameterInt("month", currMonth); + month = month < 1 ? 1 : (month > 12 ? 12 : month); + String afterBlamer = request.getParameter("afterBlamer", request.getSessionName()); + request.setAttribute("year", year); + request.setAttribute("month", month); + request.setAttribute("afterBlamer", afterBlamer); + + Map blamerAfterMap = new HashMap(); + Selector selector = new Selector(); + selector.addMust("afterBlamer", afterBlamer); + selector.addMust("startDate", year + "-" + (month < 10 ? "0" : "") + month); + + List dataList = ORM.get(ZTable.class).list(DesignAfterStatisticDetail.class, selector); + for (DesignAfterStatisticDetail detail : dataList) + { + AfterStatisticModule module = blamerAfterMap.get(detail.getAfterBlamer()); + module = module != null ? module : new AfterStatisticModule(); + module.addAfterDetail(detail); + blamerAfterMap.put(detail.getAfterBlamer(), module); + } + request.setAttribute("blamerAfterMap", blamerAfterMap); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/BeforeCauseChartAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/BeforeCauseChartAction.java new file mode 100644 index 0000000..20989b8 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/BeforeCauseChartAction.java @@ -0,0 +1,91 @@ +package com.zhiqim.yangcai.design.action.stat.back; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.model.BeforeCauseChartModel; + +/** + * 印前原因退回统计查询 + * + * @version 1.0 @author gjx 2019-4-22 新建与整理 + * @version 1.1 @author gjx 2019-08-05 表格增加显示字段 + */ +public class BeforeCauseChartAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getPreviousDateString(7)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + + Map modelMap = new HashMap<>(); + Selector selector = new Selector(); + selector.addMaybeThenGE("checkTime", Sqls.toTimestamp(beginDate + " 00:00:00")); + selector.addMaybeThenLE("checkTime", Sqls.toTimestamp(endDate + " 23:59:59")); + selector.addMaybeIsNotNull("checkBackReason"); + List causeList = ORM.get(ZView.class).list(DesignSelfView.class, selector); + int backMergeCount = 0; + long backMergeMoney = 0; + for (DesignSelfView design : causeList) + { + String checkBackReason = design.getCheckBackReason(); + String backCause = Validates.isNotEmpty(checkBackReason) ? checkBackReason.substring(0, checkBackReason.indexOf("】") + 1) : checkBackReason; + if (!modelMap.containsKey(backCause)) + { + modelMap.put(backCause, new BeforeCauseChartModel(backCause)); + } + BeforeCauseChartModel backModel = modelMap.get(backCause); + backModel.setBackCount(backModel.getBackCount() + 1); + backModel.setBackMoney(backModel.getBackMoney() + design.getAmount()); + backMergeCount++; + backMergeMoney += design.getAmount(); + } + List modelList = new ArrayList<>(modelMap.values()); + List sortList = null; + for (int g = 0; g < modelList.size() - 1; g++) + { // 冒泡按指定条件降序 + for (int d = 0; d < modelList.size() - 1 - g; d++) + { + if (modelList.get(d).getBackCount() < modelList.get(d + 1).getBackCount()) + { + sortList = new ArrayList<>(); + sortList.add(0, modelList.get(d)); + modelList.set(d, modelList.get(d + 1)); + modelList.set(d + 1, sortList.get(0)); + } + } + } + Map pieMap = new HashMap(); + for (BeforeCauseChartModel model : modelList) + { + pieMap.put(model.getBackCause(), model.getBackCount()); + } + + request.setAttribute("pieMap", pieMap); + request.setAttribute("modelList", modelList); + request.setAttribute("backMergeCount", backMergeCount); + request.setAttribute("backMergeMoney", backMergeMoney); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/DraftOrderBackStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/DraftOrderBackStatAction.java new file mode 100644 index 0000000..1d9a2e1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/DraftOrderBackStatAction.java @@ -0,0 +1,139 @@ +package com.zhiqim.yangcai.design.action.stat.back; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.model.OrderCheckModel; + +/** + * 初稿审稿退回统计 + * + * @version 1.0 @author caohong 2021-9-18 11:33:12 + */ +public class DraftOrderBackStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 13); + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateString(7)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + String filtDesigner = request.getParameter("designer"); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + + Selector selector = new Selector(); + selector.addMaybe("designer", filtDesigner); + selector.addMustThenGE("designDraftTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMustThenLE("designDraftTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMustThenGE("status", StatusConstants.ORDER_50.value());// 已定稿 + selector.addMustNotEqual("draftType", DraftConstants.DRAFT_STANDARD.value());// 标准自来稿 + selector.addMustNotEqual("draftType", DraftConstants.DRAFT_ACTUALS.value());// 现货 + selector.addOrderbyAsc("createTime"); + + List orderList = ORM.get(ZView.class).list(DesignSelfView.class, selector); + Map draftCountsMap = new HashMap();// 退回计数 + Map passCountsMap = new HashMap();// 通过计数 + List designerList = new ArrayList();// 设计师 + for (DesignSelfView order : orderList) + { + String designer = order.getDesigner(); + if (!draftCountsMap.containsKey(designer)) + { + draftCountsMap.put(designer, 1); + } + else + { + Integer count = draftCountsMap.get(designer); + draftCountsMap.put(designer, count + 1); + } + + // 沒有初稿退回记录 + if (Validates.isEmpty(order.getDraftBackReason())) + { + if (!passCountsMap.containsKey(designer)) + { + passCountsMap.put(designer, 1); + } + else + { + Integer passCount = passCountsMap.get(designer); + passCountsMap.put(designer, passCount + 1); + } + } + + if (!Lists.contains(designerList, null, designer)) + { + designerList.add(designer); + } + } + + List checkOrderList = new ArrayList();// 最终统计数据 + for (String des : designerList) + { + int draftCounts = 0; + int passCounts = 0; + if (draftCountsMap.get(des) != null) + { + draftCounts = draftCountsMap.get(des); + } + if (passCountsMap.get(des) != null) + { + passCounts = passCountsMap.get(des); + } + double passRate = (double) passCounts / draftCounts; + String rate = new BigDecimal(passRate * 100).setScale(2, BigDecimal.ROUND_HALF_UP).toString(); + + OrderCheckModel model = new OrderCheckModel(); + model.setDesigner(des); + model.setOrderCount(draftCounts); + model.setOrderPassCount(passCounts); + model.setPassRatio(rate); + checkOrderList.add(model); + } + + Comparator valCmp = new Comparator() + { + @Override + public int compare(OrderCheckModel o1, OrderCheckModel o2) + { + return o2.getOrderCount() - o1.getOrderCount();// 降序 + } + }; + + Collections.sort(checkOrderList, valCmp); + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, checkOrderList); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/EndOrderBackStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/EndOrderBackStatAction.java new file mode 100644 index 0000000..2047278 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/EndOrderBackStatAction.java @@ -0,0 +1,139 @@ +package com.zhiqim.yangcai.design.action.stat.back; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.model.OrderCheckModel; + +/** + * 定稿审稿退回统计 + * + * @version 1.0 @author caohong 2021-9-18 11:33:12 + */ +public class EndOrderBackStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 13); + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateString(7)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + String filtDesigner = request.getParameter("designer"); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + + Selector selector = new Selector(); + selector.addMaybe("designer", filtDesigner); + selector.addMustThenGE("designEndTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMustThenLE("designEndTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMustThenGE("status", StatusConstants.ORDER_55.value());// 已定稿 + selector.addMustNotEqual("draftType", DraftConstants.DRAFT_STANDARD.value());// 标准自来稿 + selector.addMustNotEqual("draftType", DraftConstants.DRAFT_ACTUALS.value());// 现货 + selector.addOrderbyAsc("createTime"); + + List orderList = ORM.get(ZView.class).list(DesignSelfView.class, selector); + Map draftCountsMap = new HashMap();// 退回计数 + Map passCountsMap = new HashMap();// 通过计数 + List designerList = new ArrayList();// 设计师 + for (DesignSelfView order : orderList) + { + String designer = order.getDesigner(); + if (!draftCountsMap.containsKey(designer)) + { + draftCountsMap.put(designer, 1); + } + else + { + Integer count = draftCountsMap.get(designer); + draftCountsMap.put(designer, count + 1); + } + + // 沒有初稿退回记录 + if (Validates.isEmpty(order.getEndBackReason())) + { + if (!passCountsMap.containsKey(designer)) + { + passCountsMap.put(designer, 1); + } + else + { + Integer passCount = passCountsMap.get(designer); + passCountsMap.put(designer, passCount + 1); + } + } + + if (!Lists.contains(designerList, null, designer)) + { + designerList.add(designer); + } + } + + List checkOrderList = new ArrayList();// 最终统计数据 + for (String des : designerList) + { + int draftCounts = 0; + int passCounts = 0; + if (draftCountsMap.get(des) != null) + { + draftCounts = draftCountsMap.get(des); + } + if (passCountsMap.get(des) != null) + { + passCounts = passCountsMap.get(des); + } + double passRate = (double) passCounts / draftCounts; + String rate = new BigDecimal(passRate * 100).setScale(2, BigDecimal.ROUND_HALF_UP).toString(); + + OrderCheckModel model = new OrderCheckModel(); + model.setDesigner(des); + model.setOrderCount(draftCounts); + model.setOrderPassCount(passCounts); + model.setPassRatio(rate); + checkOrderList.add(model); + } + + Comparator valCmp = new Comparator() + { + @Override + public int compare(OrderCheckModel o1, OrderCheckModel o2) + { + return o2.getOrderCount() - o1.getOrderCount();// 降序 + } + }; + + Collections.sort(checkOrderList, valCmp); + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, checkOrderList); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/OrderBackEffectStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/OrderBackEffectStatAction.java new file mode 100644 index 0000000..04de7f4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/OrderBackEffectStatAction.java @@ -0,0 +1,95 @@ +/** + * 扬彩印刷设计 + * 文件名 :OrderBackEffectStatAction.java + * 创建人 :gjx + * 创建时间:2019-9-19 + */ + +package com.zhiqim.yangcai.design.action.stat.back; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.dbo.order.OrdOprLog; + +/** + * 印前审稿退回统计 + * + * @version 1.0 @author gjx 2019-9-19 新建与整理 + */ +public class OrderBackEffectStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 13); + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateString(7)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + String filtDesigner = request.getParameter("designer"); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + + Selector selector = new Selector(); + // selector.addMustThenGE("draftType", DraftConstants.DRAFT_COMMON_DESIGN.value()); + selector.addMaybe("designer", filtDesigner); + selector.addMustThenGE("createTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMustThenLE("createTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMust("eventType", EventConstants.ORDER_10.value());// 退回 + selector.addMustIsNotEmpty("designer"); + selector.addOrderbyAsc("designId"); + selector.addOrderbyAsc("createTime"); + + Map backCountMap = new HashMap(); + List logList = ORM.get(ZTable.class).list(OrdOprLog.class, selector); + for (OrdOprLog log : logList) + { + String designer = log.getDesigner(); + if (!backCountMap.containsKey(designer)) + { + backCountMap.put(designer, Integer.valueOf(0)); + } + Integer backCount = backCountMap.get(designer); + backCountMap.put(designer, backCount + 1); + } + + Comparator> valCmp = new Comparator>() + { + @Override + public int compare(Entry o1, Entry o2) + { + return o2.getValue() - o1.getValue();// 降序 + } + }; + + List> pageList = new ArrayList>(backCountMap.entrySet()); + Collections.sort(pageList, valCmp); + + PageResult> pageResult = PageBuilder.pageResult(page, pageSize, pageList); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/SectionFinalizeCompleteStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/SectionFinalizeCompleteStatAction.java new file mode 100644 index 0000000..f620136 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/back/SectionFinalizeCompleteStatAction.java @@ -0,0 +1,129 @@ +/** + * 扬彩印刷设计 + * 文件名 :SectionFinalizeCompleteStatAction.java + * 创建人 :gjx + * 创建时间:2019-11-22 + */ + +package com.zhiqim.yangcai.design.action.stat.back; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdOprLog; +import com.zhiqim.yangcai.design.model.SectionFinalizeCompleteStatModel; + +/** + * [简要描述]部门定稿退回统计:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-11-22 新建与整理 + */ +public class SectionFinalizeCompleteStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String year = request.getParameter("year", DateTimes.getCurrentYear() + ""); + String month = request.getParameter("month", DateTimes.getCurrentMonth() + ""); + int day = DateTimes.getMonthDays(Integer.valueOf(year), Integer.valueOf(month)); + String nowMonth = Integer.valueOf(month) < 10 ? "0" + month : month; + + Selector selector = new Selector(); + selector.addMustThenGE("createTime", Sqls.toTimestamp(year + "-" + nowMonth + "-01 00:00:00")); + selector.addMustThenLE("createTime", Sqls.toTimestamp(year + "-" + nowMonth + "-" + day + " 23:59:59")); + selector.addOrderbyAsc("createTime"); + + Map statMap = new HashMap(); + List backIdList = new ArrayList<>();// 退回订单id + Map deptNameMap = new HashMap<>();// id:部门名称Map + SectionFinalizeCompleteStatModel stat = null; + List designOrder = ORM.get(ZTable.class).list(DesignOrder.class, selector); + for (DesignOrder order : designOrder) + { + long designId = order.getDesignId(); + String deptName = order.getDraftType() > DraftConstants.DRAFT_TEMPLATE.value() ? "设计部" : "印前部"; + stat = statMap.get(deptName) == null ? new SectionFinalizeCompleteStatModel(deptName) : statMap.get(deptName); + stat.setDeptFinalizeCount(order.getStatus() >= StatusConstants.ORDER_55.value() ? stat.getDeptFinalizeCount() + 1 : stat.getDeptFinalizeCount());// 状态大于等于已定稿单数+1 + if (Validates.isNotEmpty(order.getCheckBackReason()))// 审核退回原因不为空 + { + deptNameMap.put(designId, deptName); + backIdList.add(designId);// 退回的单放入集合根据日志查询退回次数 + stat.setDeptBackCount(stat.getDeptBackCount() + 1);// 退回单数+1 + stat.setDeptBackMoney(stat.getDeptBackMoney() + order.getAmount());// 退回金额累加 + } + statMap.put(deptName, stat); + } + long[] designIds = Arrays.toArrayLong(backIdList); + + List ordOprLogList = ORM.get(ZTable.class).list(OrdOprLog.class, + new Selector().addMaybeInLong("designId", designIds).addMust("eventType", EventConstants.ORDER_10.value())); + for (OrdOprLog ordOprLog : ordOprLogList) + { + long designId = ordOprLog.getDesignId(); + String deptName = deptNameMap.get(designId); + if (Validates.isNotEmpty(deptName)) + { + stat = statMap.get(deptName); + } + if (null != stat) + { + stat.setDeptBackSum(stat.getDeptBackSum() + 1); + } + } + Map pieMap = new HashMap();// 部门名称:定稿单数 + int passOrderSum = 0;// 部门总定稿量 + int backSum = 0;// 部门退回总单数 + int backRepeatSum = 0;// 部门退回总次数 + long backAmountSum = 0; + List statList = new ArrayList<>(statMap.values()); + for (SectionFinalizeCompleteStatModel model : statList) + { + pieMap.put(model.getDeptName(), model.getDeptFinalizeCount()); + passOrderSum += model.getDeptFinalizeCount(); + backSum += model.getDeptBackCount(); + backRepeatSum += model.getDeptBackSum(); + backAmountSum += model.getDeptBackMoney(); + } + List sortList = null; + for (int g = 0; g < statList.size() - 1; g++) + { // 冒泡按指定条件降序 + for (int d = 0; d < statList.size() - 1 - g; d++) + { + if (statList.get(d).getDeptFinalizeCount() < statList.get(d + 1).getDeptFinalizeCount()) + { + sortList = new ArrayList<>(); + sortList.add(0, statList.get(d)); + statList.set(d, statList.get(d + 1)); + statList.set(d + 1, sortList.get(0)); + } + } + } + + request.setAttribute("pieMap", pieMap);// 饼图需要数据 + request.setAttribute("statList", statList); // 表格需要数据 + request.setAttribute("year", year); + request.setAttribute("month", month); + request.setAttribute("passOrderSum", passOrderSum); // 部门定稿总单数 + request.setAttribute("backSum", backSum); // 部门退回总单数 + request.setAttribute("backRepeatSum", backRepeatSum); // 部门退回总次数 + request.setAttribute("backAmountSum", backAmountSum); // 部门退回单数总金额 + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteDesignRateStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteDesignRateStatAction.java new file mode 100644 index 0000000..ec83c66 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteDesignRateStatAction.java @@ -0,0 +1,180 @@ +/** + * 扬彩印刷设计 + * 文件名 :CompleteDesignRateStatAction.java + * 创建人 :gjx + * 创建时间:2020年11月9日 +*/ + +package com.zhiqim.yangcai.design.action.stat.design; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.model.CompleteDesignRateStatModel; + +/** + * + * [简要描述]: 设计师定稿率统计
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年11月9日 新建与整理 + */ +public class CompleteDesignRateStatAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + String startDate = request.getParameter("startDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + String designer = request.getParameter("designer"); + Long orgId = request.getParameterLong("orgId", 0L); + if (Validates.isNotEmpty(designer)) + { + if (DateTimes.compareDay(endDate, startDate) > 183) + { + request.setResponseError("请勿将时间区间跨度选择大于6个月"); + return; + } + } + else + { + if (DateTimes.compareDay(endDate, startDate) > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于1个月"); + return; + } + } + + StringBuilder sqlStr = new StringBuilder( + " SELECT d.designer, COUNT(*) orderNum,(SELECT COUNT(*) FROM design_order WHERE DESIGN_BEGIN_TIME >= 'startDateStr' AND DESIGN_BEGIN_TIME <= 'endDateStr' AND STATUS >= 55 AND ORG_ID = orgIdStr AND designer IS NOT NULL AND designer = d.designer ) orderEndNum,"); + sqlStr.append( + " ROUND((SELECT COUNT(*) FROM design_order WHERE DESIGN_BEGIN_TIME >= 'startDateStr' AND DESIGN_BEGIN_TIME <= 'endDateStr' AND STATUS >= 55 AND ORG_ID = orgIdStr AND designer IS NOT NULL AND designer = d.designer ) / COUNT(*) * 100,2) endProportion"); + sqlStr.append( + " FROM design_order d WHERE d.DESIGN_BEGIN_TIME >= 'startDateStr' AND d.DESIGN_BEGIN_TIME <= 'endDateStr' AND d.ORG_ID = orgIdStr AND d.designer IS NOT NULL AND d.designer = 'designerStr' GROUP BY d.designer ORDER BY endProportion DESC;"); + + String sql = sqlStr.toString().replace("startDateStr", startDate + " 00:00:00").replace("endDateStr", endDate + " 23:59:59"); + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + // 总部组织 + boolean isOrgRoot = false; + if (ZmrOrgDao.getOrgRootId(request) == sessionUser.getSelectedOrgId()) + { + isOrgRoot = true; + } + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + // 非总部只查自己 + if (!isOrgRoot) + { + sql = sql.replace("orgIdStr", String.valueOf(sessionUser.getSelectedOrgId())); + designer = sessionUser.getOperatorCode(); + } + else + { + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + + if(zmrOrgList.size()>0) { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgIdArr=orgIdArr + zmrOrg.getOrgId() + ","; + } + + + orgIdArr = orgIdArr.substring(0, orgIdArr.length() -1); + + if(orgId == 0L) { + sql = sql.replace("AND ORG_ID = orgIdStr", "AND ORG_ID in("+orgIdArr+")").replace("AND d.ORG_ID = orgIdStr", "AND d.ORG_ID in("+orgIdArr+")"); + }else {//如果选择了组织,就要必须在组织里面 + sql = sql.replace("AND ORG_ID = orgIdStr", "AND ORG_ID ="+orgId+"").replace("AND d.ORG_ID = orgIdStr", "AND d.ORG_ID ="+orgId+""); + } + + + + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selOrg.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } else { + if(orgId == 0L) { + sql = sql.replace("AND ORG_ID = orgIdStr", "").replace("AND d.ORG_ID = orgIdStr", ""); + }else {//如果选择了组织,就要必须在组织里面 + sql = sql.replace("AND ORG_ID = orgIdStr", "AND ORG_ID ="+orgId+"").replace("AND d.ORG_ID = orgIdStr", "AND d.ORG_ID ="+orgId+""); + } + selOrg.addMustNotEqual("orgId", 1808071102554512L); + } + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + request.setAttribute("orgList", orgList); + } + + if (Validates.isNotEmpty(designer)) + { + sql = sql.replace("designerStr", designer); + } + else + { + sql = sql.replace("AND d.designer = 'designerStr'", ""); + } + + List modelList = new ArrayList(); + List statList = ORM.get(ZSQL.class).executeQuery(sql); + int orderNum =0; + int setOrderEndNum=0; + double setEndProportion = 0.0; + int sum = 0 ; + for (LinkedMapSO so : statList) + { + String designerItem = String.valueOf(so.get("designer")); + if (Validates.isEmpty(designerItem)) + { + continue; + } + + CompleteDesignRateStatModel model = new CompleteDesignRateStatModel(designerItem); + model.setOrderNum(Integer.valueOf(String.valueOf(so.get("orderNum")))); + model.setOrderEndNum(Integer.valueOf(String.valueOf(so.get("orderEndNum")))); + model.setEndProportion(Double.valueOf(String.valueOf(so.get("endProportion")))); + orderNum += Integer.valueOf(String.valueOf(so.get("orderNum"))); + setOrderEndNum += Integer.valueOf(String.valueOf(so.get("orderEndNum"))); + setEndProportion += Double.valueOf(String.valueOf(so.get("endProportion"))); + if(Integer.valueOf(String.valueOf(so.get("orderNum"))) > 0){ + sum ++ ; + } + modelList.add(model); + } + CompleteDesignRateStatModel completeDesignRateStatModel = new CompleteDesignRateStatModel("汇总"); + completeDesignRateStatModel.setOrderNum(orderNum); + completeDesignRateStatModel.setOrderEndNum(setOrderEndNum); + DecimalFormat df = new DecimalFormat("#.00"); + String formattedNumber = df.format(setEndProportion / sum); + completeDesignRateStatModel.setEndProportion(Double.valueOf(formattedNumber)); + + modelList.add(completeDesignRateStatModel); + request.setAttribute("modelList", modelList); + request.setAttribute("designer", designer); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + request.setAttribute("isOrgRoot", isOrgRoot); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteOrderTimelinessAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteOrderTimelinessAction.java new file mode 100644 index 0000000..cd5dcc7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteOrderTimelinessAction.java @@ -0,0 +1,139 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.stat.model.DraftTimelinessModel; + +/** + * 定稿时效 + * + * @version v1.0.0 @author zzy 2018-8-7 新建与整理 + */ +public class CompleteOrderTimelinessAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + String beginDate = request.getParameter("beginDate", DateTimes.getDateString()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + + Selector selector = new Selector(); + selector.addMustNotIn("status", StatusConstants.ORDER_F100.value(), StatusConstants.ORDER_F110.value()); + selector.addMustThenGE("status", StatusConstants.ORDER_55.value()); + selector.addMaybeThenGE("designEndTime", Sqls.toTimestamp(beginDate, "00:00:00")); + selector.addMaybeThenLE("designEndTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMustIn("draftType", DraftConstants.DRAFT_COMMON_DESIGN.value(), DraftConstants.DRAFT_PAGE_DESIGN.value()); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + return; + } + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + + Map modelMap = new HashMap(); + List typeList = DesignTypeDao.listAll(); + + for (DesignOrder order : orderList) + { + DraftTimelinessModel temp = modelMap.get(order.getDesigner()); + if (temp == null) + { + temp = new DraftTimelinessModel(order.getDesigner()); + } + + HashMap numberMap = temp.getNumberMap(); + HashMap timeMap = temp.getTimeMap(); + + for (DesignType type : typeList) + { + int number = 0; // 类型的单数 + int time = 0; // 类型初稿总耗时(分钟) + + String typeName = type.getTypeName(); + if (order.getTypeId() == type.getTypeId()) // 先匹配单的类型 + { + if (type.getTypeSeq() > 9) + { + typeName = "其他"; + } + + if (numberMap.containsKey(typeName)) + { + number = numberMap.get(typeName) + 1; + } + else + { + number = 1; + } + + if (timeMap.containsKey(typeName)) + { + time = timeMap.get(typeName) + DateTimes.compareMinute(order.getDesignEndTime(), order.getDesignDraftTime()); + } + else + { + time = DateTimes.compareMinute(order.getDesignEndTime(), order.getDesignDraftTime()); + } + + numberMap.put(typeName, number); + timeMap.put(typeName, time); + + temp.setAllCount(temp.getAllCount() + 1); + temp.setAllTime(temp.getAllTime() + DateTimes.compareMinute(order.getDesignEndTime(), order.getDesignDraftTime())); + break; + } + } + modelMap.put(order.getDesigner(), temp); + } + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, modelMap.values()); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("typeList", typeList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteOrderTimelinessInfoAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteOrderTimelinessInfoAction.java new file mode 100644 index 0000000..3c317a9 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteOrderTimelinessInfoAction.java @@ -0,0 +1,68 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.stat.design; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * + * 定稿统计清单 + * + * @version v1.0.0 @author longguizhi 2018-10-22 新建与整理 + */ +public class CompleteOrderTimelinessInfoAction implements Action +{ + + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + String beginDate = request.getParameter("beginDate"); + String endDate = request.getParameter("endDate"); + String designer = request.getParameter("designer"); + long prdTypeId = request.getParameterLong("prdTypeId"); + + Selector selector = new Selector(); + selector.addMust("designer", designer); + selector.addMust("typeId", prdTypeId); + selector.addMustNotIn("status", StatusConstants.ORDER_F100.value(), StatusConstants.ORDER_F110.value()); + selector.addMustThenGE("status", StatusConstants.ORDER_55.value()); + selector.addMaybeThenGE("designEndTime", Sqls.toTimestamp(beginDate, "00:00:00")); + selector.addMaybeThenLE("designEndTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMustIn("draftType",DraftConstants.DRAFT_COMMON_DESIGN.value() , DraftConstants.DRAFT_PAGE_DESIGN.value()); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if(org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + return; + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteOrderTypeTimelinessAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteOrderTypeTimelinessAction.java new file mode 100644 index 0000000..1a34949 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteOrderTypeTimelinessAction.java @@ -0,0 +1,81 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.stat.model.DraftTypeTimelinessModel; + +/*** + * 定稿订单产品类型时效 + * + * @version v1.0.0 @author longguizhi 2018-10-22 新建与整理 + */ +public class CompleteOrderTypeTimelinessAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + + Selector selector = new Selector(); + selector.addMustNotIn("status", StatusConstants.ORDER_F100.value(), StatusConstants.ORDER_F110.value()); + selector.addMustThenGE("status", StatusConstants.ORDER_55.value()); + selector.addMaybeThenGE("designEndTime", Sqls.toTimestamp(beginDate, "00:00:00")); + selector.addMaybeThenLE("designEndTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMustIn("draftType",DraftConstants.DRAFT_COMMON_DESIGN.value() , DraftConstants.DRAFT_PAGE_DESIGN.value()); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if(org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + return; + } + + List orderList = ORM.get(ZTable.class).list(DesignOrder.class,selector); + + Map modelMap = new HashMap(); + for (DesignOrder order : orderList) + { + DraftTypeTimelinessModel temp = modelMap.get(order.getTypeId()); + if (temp == null) + temp = new DraftTypeTimelinessModel(order.getTypeId()); + + temp.setCount(temp.getCount() +1); + temp.setTime(temp.getTime() + DateTimes.compareMinute(order.getDesignEndTime(), order.getCreateTime())); + + modelMap.put(order.getTypeId(), temp); + } + + request.setAttribute("timelinessList", modelMap.values()); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteOrgRateStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteOrgRateStatAction.java new file mode 100644 index 0000000..5fac744 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/CompleteOrgRateStatAction.java @@ -0,0 +1,103 @@ +/** + * 扬彩印刷设计 + * 文件名 :CompleteOrgRateStatAction.java + * 创建人 :gjx + * 创建时间:2020年11月9日 +*/ + +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; + +import com.zhiqim.yangcai.design.model.CompleteOrgRateStatModel; + +/** + * + * [简要描述]:组织定稿率统计
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年11月9日 新建与整理 + */ +public class CompleteOrgRateStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String startDate = request.getParameter("startDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + + if (DateTimes.compareDay(endDate, startDate) > 93) + { + request.setResponseError("请勿将时间区间跨度选择大于3个月"); + return; + } + + StringBuilder sqlStr = new StringBuilder( + " SELECT (SELECT org_name FROM zmr_org WHERE ORG_ID = d.ORG_ID) orgName, COUNT(*) orgOrderNum, (SELECT COUNT(*) FROM design_order WHERE CREATE_TIME >= 'startDateStr' AND CREATE_TIME <= 'endDateStr' AND STATUS >= 55 AND ORG_ID > 0 AND ORG_ID = d.ORG_ID) orgOrderEndNum,"); + sqlStr.append( + " ROUND((SELECT COUNT(*) FROM design_order WHERE CREATE_TIME >= 'startDateStr' AND CREATE_TIME <= 'endDateStr' AND STATUS >= 55 AND ORG_ID > 0 AND ORG_ID = d.ORG_ID) / COUNT(*) * 100,2) orgEndProportion"); + sqlStr.append( + " FROM design_order d WHERE d.CREATE_TIME >= 'startDateStr' AND d.CREATE_TIME <= 'endDateStr' AND d.ORG_ID > 0 AND d.ORG_ID = orgIdStr GROUP BY d.ORG_ID ORDER BY orgOrderNum DESC;"); + + String sql = sqlStr.toString().replace("startDateStr", startDate + " 00:00:00").replace("endDateStr", endDate + " 23:59:59"); + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long selectedOrgId = sessionUser.getSelectedOrgId(); + if (ZmrOrgDao.getOrgRootId(request) != selectedOrgId) + {// 非总部 + sql = sql.replace("orgIdStr", String.valueOf(selectedOrgId)); + } + else + { + sql = sql.replace("AND d.ORG_ID = orgIdStr", ""); + } + + int orgOrderEndSum = 0; + List modelList = new ArrayList(); + List statList = ORM.get(ZSQL.class).executeQuery(sql); + for (LinkedMapSO so : statList) + { + String orgName = String.valueOf(so.get("orgName")); + if (Validates.isEmpty(orgName)) + { + continue; + } + + orgOrderEndSum += Integer.valueOf(String.valueOf(so.get("orgOrderEndNum"))); + + CompleteOrgRateStatModel model = new CompleteOrgRateStatModel(orgName); + model.setOrgOrderNum(Integer.valueOf(String.valueOf(so.get("orgOrderNum")))); + model.setOrgOrderEndNum(Integer.valueOf(String.valueOf(so.get("orgOrderEndNum")))); + model.setOrgEndProportion(String.valueOf(so.get("orgEndProportion"))); + + modelList.add(model); + } + + Map pieMap = new HashMap(); + for (CompleteOrgRateStatModel model : modelList) + { + pieMap.put(model.getOrgName(), model.getOrgOrderEndNum()); + } + + request.setAttribute("pieMap", pieMap); + request.setAttribute("orgOrderEndSum", orgOrderEndSum); + request.setAttribute("modelList", modelList); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignFinalizeOrgCaseAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignFinalizeOrgCaseAction.java new file mode 100644 index 0000000..80d5008 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignFinalizeOrgCaseAction.java @@ -0,0 +1,231 @@ +/* + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ + +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.stat.CompleteOrderStat; +import com.zhiqim.yangcai.design.model.DesignFinalizeOrgCaseModel; + +/** + * + * 订单定稿组织统计 + * + * @version 1.0 @author gjx 2019-7-3 新建与整理 + */ +public class DesignFinalizeOrgCaseAction implements Action +{ + private String[] repeatOrder = {}; // 退回定稿单(包含重复退回单) + + @Override + public void execute(HttpRequest request) throws Exception + { + String year = request.getParameter("year", DateTimes.getCurrentYear() + ""); + String month = request.getParameter("month", DateTimes.getCurrentMonth() + ""); + // String dateTime = year + "-" + month; + int day = DateTimes.getMonthDays(Integer.valueOf(year), Integer.valueOf(month)); + String nowMonth = Integer.valueOf(month) < 10 ? "0" + month : month; + Selector selector = new Selector(); + selector.addMustThenGE("completeDate", year + "-" + nowMonth + "-01"); + selector.addMustThenLE("completeDate", year + "-" + nowMonth + "-" + day); + + List completeList = ORM.get(ZTable.class).list(CompleteOrderStat.class, selector); + Map orgMap = new HashMap<>(); // 组织map + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class); // 得到所有组织id与名称 + if (zmrOrgList.size() == 0) + { + request.setResponseError("系统组织异常"); + return; + } + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgMap.put(zmrOrg.getOrgId(), zmrOrg.getOrgName()); + } + StringBuilder backBuilder = new StringBuilder(); // 所有退稿次数 + Set passSet = new HashSet<>(); // 所有定稿单数 + Set backSet = new HashSet<>(); // 所有退稿单数 + for (CompleteOrderStat completeOrderStat : completeList) + {// 拼接所有定稿订单id + String[] orderPassArray = completeOrderStat.getOrderPassId().split(","); + Long[] orderPassId = new Long[orderPassArray.length]; + if (orderPassArray.length > 0 && !"".equals(orderPassArray[0])) + { + for (int i = 0; i < orderPassArray.length; i++) + { + orderPassId[i] = Long.valueOf(orderPassArray[i]); + } + passSet.addAll(Arrays.asList(orderPassId)); + } + + String[] orderBackArray = completeOrderStat.getOrderBackId().split(","); + Long[] orderbackId = new Long[orderBackArray.length]; + if (orderBackArray.length > 0 && !"".equals(orderBackArray[0])) + { + for (int i = 0; i < orderBackArray.length; i++) + { + orderbackId[i] = Long.valueOf(orderBackArray[i]); + } + backSet.addAll(Arrays.asList(orderbackId)); + } + if (!"".equals(completeOrderStat.getOrderBackId())) + { + backBuilder.append(completeOrderStat.getOrderBackId() + ","); + } + + } + if (backBuilder.length() > 0) + { + backBuilder.delete(backBuilder.length() - 1, backBuilder.length()); + } + this.repeatOrder = backBuilder.toString().split(","); + long[] passIdArray = {}; + List passOrderList = new ArrayList<>(); + if (passSet.size() > 0) + { + passIdArray = toSetTwoArray(passSet); // Set转Array + Selector passSel = new Selector(); + passSel.addFields("designId"); + passSel.addFields("orgId"); + passSel.addMustInLong("designId", passIdArray); + passOrderList = ORM.get(ZTable.class).list(DesignOrder.class, passSel); // 所有定稿单数 + } + Map orgCaseModelMap = new HashMap<>(); + for (DesignOrder designOrder : passOrderList) + {// 得到组织及对应的定稿单数 + String orgName = orgMap.get(designOrder.getOrgId()); + if (!orgCaseModelMap.containsKey(orgName)) + { + orgCaseModelMap.put(orgName, new DesignFinalizeOrgCaseModel(orgName)); + } + DesignFinalizeOrgCaseModel orgCaseModel = orgCaseModelMap.get(orgName); + orgCaseModel.setPassOrderCount(orgCaseModel.getPassOrderCount() + 1); + } + long[] backIdArray = {}; + List backOrderList = new ArrayList<>(); + if (backSet.size() > 0) + { + backIdArray = toSetTwoArray(backSet); // Set转Array + Selector backSel = new Selector(); + backSel.addFields("designId"); + backSel.addFields("orgId"); + backSel.addFields("amount"); + backSel.addMustInLong("designId", backIdArray); + backOrderList = ORM.get(ZTable.class).list(DesignOrder.class, backSel); // 所有退稿单数 + } + int backAmountSum = 0; // 总退回单数金额 + for (DesignOrder designOrder : backOrderList) + {// 得到组织退回单数、退回次数、退回金额 + String orgName = orgMap.get(designOrder.getOrgId()); + if (!orgCaseModelMap.containsKey(orgName)) + { + orgCaseModelMap.put(orgName, new DesignFinalizeOrgCaseModel(orgName)); + } + DesignFinalizeOrgCaseModel orgCaseModel = orgCaseModelMap.get(orgName); + orgCaseModel.setBackOrderCount(orgCaseModel.getBackOrderCount() + 1); + orgCaseModel.setBackOrderMoneySum(orgCaseModel.getBackOrderMoneySum() + designOrder.getAmount()); + orgCaseModel.setBackOrderRepeatCount(orgCaseModel.getBackOrderRepeatCount() + existArrayQuantity(designOrder.getDesignId())); + backAmountSum += designOrder.getAmount(); + } + List orgCaseList = new ArrayList(orgCaseModelMap.values()); + List orgCaseSortList = null; + for (int g = 0; g < orgCaseList.size() - 1; g++) + { // 冒泡按指定条件排序 + for (int d = 0; d < orgCaseList.size() - 1 - g; d++) + { + if (orgCaseList.get(d).getPassOrderCount() < orgCaseList.get(d + 1).getPassOrderCount()) + { + orgCaseSortList = new ArrayList<>(); + orgCaseSortList.add(0, orgCaseList.get(d)); + orgCaseList.set(d, orgCaseList.get(d + 1)); + orgCaseList.set(d + 1, orgCaseSortList.get(0)); + } + } + } + Map pieMap = new HashMap(); + for (DesignFinalizeOrgCaseModel designFinalizeOrgCaseModel : orgCaseList) + { + pieMap.put(designFinalizeOrgCaseModel.getOrgName(), designFinalizeOrgCaseModel.getPassOrderCount()); + } + // request.setAttribute("orgAllOrder", passOrderList.size()); // 总组织定稿单数 + request.setAttribute("orgCaseList", orgCaseList); // 表格需要数据 + request.setAttribute("pieMap", pieMap);// 饼图需要数据 + request.setAttribute("year", year); + request.setAttribute("month", month); + request.setAttribute("passOrderSum", passIdArray.length); // 组织定稿总单数 + request.setAttribute("backOrderSum", backIdArray.length); // 组织退回总单数 + request.setAttribute("backRepeatSum", repeatOrder.length); // 组织退回总次数 + request.setAttribute("backAmountSum", backAmountSum + ""); // 组织退回单数总金额 + } + + /** + * + * Set 转 Array + * + * @author gjx + * @param hashSet 需要转的Set集合 + * @return Array + */ + public long[] toSetTwoArray(Set hashSet) + { + if (hashSet.size() == 0) + { + return new long[0]; + } + Object[] objArray = new Object[hashSet.size()]; + objArray = hashSet.toArray(); + long[] fullId = new long[objArray.length]; + for (int i = 0; i < objArray.length; i++) + { + fullId[i] = Long.valueOf(String.valueOf(objArray[i])); + } + return fullId; + } + + /** + * 查找id出现次数 + * + * @author gjx + * @param backOrderId 订单id + * @return backOrderId在数组出现的次数 + */ + public int existArrayQuantity(long backOrderId) + { + if (backOrderId <= 0) + { + return 0; + } + String backId = String.valueOf(backOrderId); + int count = 0; + for (int i = 0; i < repeatOrder.length; i++) + { + if (repeatOrder[i].equals(backId)) + { + count++; + } + } + return count; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignGroupPerformanceStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignGroupPerformanceStatAction.java new file mode 100644 index 0000000..80727be --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignGroupPerformanceStatAction.java @@ -0,0 +1,128 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.stat.DesignGroup; +import com.zhiqim.yangcai.design.dbo.stat.GroupMembers; +import com.zhiqim.yangcai.design.dbo.stat.PerformanceStatistics; +import com.zhiqim.yangcai.design.stat.model.DesignGroupPerformanceStatisModel; + +/** + * 设计组统计绩效 + * + * @version v1.0.0 @author liuhu 2019-2-26 新建与整理 + */ +public class DesignGroupPerformanceStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + String year = request.getParameter("year", DateTimes.getCurrentYear()+""); + int monthInt = request.getParameterInt("month", DateTimes.getCurrentMonth()); + String month = monthInt < 10 ? "0" + monthInt : "" + monthInt; + String yearMonth = year + "" + month; + String endDate = DateTimes.getLastMonthDay(yearMonth); + + long groupId = request.getParameterLong("groupId"); + + Selector sel = new Selector().addMaybe("groupId", groupId); + if (ZmrOrgDao.getOrgRootId(request) != orgId) + sel.addMust("orgId", orgId); + + List groupList = ORM.get(ZTable.class).list(DesignGroup.class, sel); + Map groupMap = new HashMap(); + for (DesignGroup group : groupList) + { + Selector selector = new Selector("groupId", group.getGroupId()); + selector.addMustThenLE("startDate", year+"-"+month+"-01"); + selector.addOr(new Selector().addMustIsNull("endDate").addMust("endDate", endDate)); + selector.addOrderbyDesc("isGroupLeader"); + selector.addOrderbyAsc("startDate"); + List memberList = ORM.get(ZTable.class).list(GroupMembers.class, selector); + + List designers = new ArrayList(); + Map designerMap = new HashMap(); + for (GroupMembers member : memberList) + { + designers.add(member.getUserCode()); + designerMap.put(member.getUserCode(), member); + } + + + if (designers.size() == 0) + continue; + + + List dataList = ORM.get(ZTable.class).list(PerformanceStatistics.class, new Selector("statDate", year+"-"+month).addMustIn("designer", Arrays.toStringArray(Lists.toString(designers)))); + for (PerformanceStatistics stat : dataList) + { + DesignGroupPerformanceStatisModel groupModule = groupMap.get(group.getGroupId()); + groupModule = groupModule != null ? groupModule : new DesignGroupPerformanceStatisModel(); + groupModule.AddMember(stat, group, designerMap.get(stat.getDesigner()).getIsGroupLeader() == 1); + groupMap.put(group.getGroupId(), groupModule); + } + } + + //计算小组平均值 + Set> entrySet = groupMap.entrySet(); + for (Entry entry : entrySet) + { + DesignGroupPerformanceStatisModel group = entry.getValue(); + PerformanceStatistics groupLeader = group.getGroupLeader(); + if (groupLeader == null) + continue;//没有组长的return掉 + + List members = group.getMembers(); + + //小组总单数 + double groupOrderCount = groupLeader.getDesignCompleteSum(); + long all_group_salary = groupLeader.getDesignAmount() + groupLeader.getOrderTypeAmount() + groupLeader.getRefundAmount(); + for (PerformanceStatistics member : members) + { + groupOrderCount += member.getDesignCompleteSum(); + all_group_salary += member.getDesignAmount() + member.getOrderTypeAmount() + member.getRefundAmount(); + } + //小组平均单数; + double groupAvgOrderCount = groupOrderCount/(1+members.size());//四舍五入 + + group.setGroupCompleteSum(groupOrderCount); + group.setGroupCompleteAvgCount(groupAvgOrderCount); + group.setGroupPerformanceAmount(all_group_salary); + } + + request.setAttribute("groupList", ORM.get(ZTable.class).list(DesignGroup.class)); + request.setAttribute("groupPerformanceMap", groupMap); + request.setAttribute("year", year); + request.setAttribute("month", monthInt); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderCountStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderCountStatAction.java new file mode 100644 index 0000000..a36bc1c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderCountStatAction.java @@ -0,0 +1,98 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.stat.model.OrderCountStatModel; + +/*** + * 设计总订单数量统计 + * + * @version v1.0.0 @author longguizhi 2018-10-22 新建与整理 + */ +public class DesignOrderCountStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateString(7)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + + Selector selector = new Selector(); + selector.addMustThenGE("draftType", DraftConstants.DRAFT_COMMON_DESIGN.value()); //设计订单 + selector.addMustThenGE("createTime", Sqls.toTimestamp(startDate + " 00:00:00")); + selector.addMustThenLE("createTime", Sqls.toTimestamp(endDate + " 23:59:59")); + selector.addMustNotEqual("status", StatusConstants.ORDER_F100.value()); + selector.addMustNotEqual("status", StatusConstants.ORDER_F110.value()); + selector.addOrderbyAsc("createTime"); + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + + //仅展示名片、特种纸、精品特种纸、PVC名片、彩页、折页、画册、优惠券、展架、喷绘 + //仅展示产品类型前九 + List typeList = DesignTypeDao.listAll(); + List typeIdList = new ArrayList();; + int index = 0; + for (DesignType type : typeList) + { + index++; + if (index > 9) + break; + + typeIdList.add(type.getTypeId()); + } + + LinkedHashMap map = new LinkedHashMap(); + for (DesignOrder order : orderList) + { + String date = Sqls.toDateString(order.getCreateTime()); + OrderCountStatModel temp = map.get(date); + if (temp == null) + temp = new OrderCountStatModel(date); + + Map typeMap = temp.getTypeMap(); + if (typeIdList.contains(order.getTypeId())) + { + int count = typeMap.get(order.getTypeId()) == null?0:typeMap.get(order.getTypeId()); + typeMap.put(order.getTypeId(), count+1); + + temp.setElseCount(temp.getElseCount() +1); + } + + temp.setSumCount(temp.getSumCount() +1); + map.put(date, temp); + } + + request.setAttribute("list", map.values()); + request.setAttribute("typeList", map.values()); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderMeriysAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderMeriysAction.java new file mode 100644 index 0000000..4bbba3c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderMeriysAction.java @@ -0,0 +1,173 @@ +/** +* 扬彩印刷设计 + * 文件名 :DesignerPerformanceAction.java + * 创建人 :gjx + * 创建时间:2021年3月8日 +*/ + +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.ProductConvertCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.order.DesignOrderMerits; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.model.DesignerPerformanceModel; + +/** + * + * [简要描述]: 设计师修改绩效统计
            + * [详细描述]:
            + * + * @version 1.0 @author zzq 2023年7月21日 新建与整理 + */ +public class DesignOrderMeriysAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getDateString()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int query = request.getParameterInt("query"); + String designer = request.getParameter("designer"); + + int queryFlag = -1; + + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + + List pageModelList = new ArrayList(); + String firstMonthDay = DateTimes.getFirstMonthDay(); + + + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode());//当前用户是否是组织负责人 + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if (Validates.isNotEmpty(designer) && zmrOrgList.size() > 0)//判断设计师要在这些组织 + { + Selector selector = new Selector(); + selector.addMustLike("operatorCode", designer); + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selector.addMust("operatorCode", designer); + selector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + List zmrOperatorList = ORM.get(ZTable.class).list(ZmrOperator.class, selector); + if(zmrOperatorList.size() == 0) { + request.setResponseError("您查找的设计师不在您负责的组织"); + return; + } + } + + + //要判断设计师是不是你这个分组的 + if (query == 1) + {// 往月 + queryFlag = 1; + StringBuilder builder = new StringBuilder(); + builder.append("select designer,count(*) orderEndCount from design_order_merits"); + builder.append(" where designer = 'DESIGNER' and add_time >= 'beginDate' and add_time <= 'endDate'"); + builder.append(" group by designer order by orderEndCount desc"); + String sql = builder.toString().replace("beginDate", beginDate + " 00:00:00").replace("endDate", endDate + " 23:59:59"); + if(zmrOrgList.size()>0) {//如果是负责了某个组织 + if (Validates.isEmpty(designer))//判断设计师要在这些组织 + { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgIdArr=orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() -1); + sql = sql.replace("designer = 'DESIGNER' and", + "designer in (select OPERATOR_CODE from zmr_operator where org_id in ("+ orgIdArr +")) and"); + } + else + { + sql = sql.replace("DESIGNER", designer); + } + }else {//如果是没负责组织,一切照常 + if (Validates.isEmpty(designer)) + { + sql = sql.replace("designer = 'DESIGNER' and", ""); + } + else + { + sql = sql.replace("DESIGNER", designer); + } + } + + + List queryList = ORM.get(ZSQL.class).executeQuery(sql); + for (LinkedMapSO so : queryList) + { + DesignerPerformanceModel model = new DesignerPerformanceModel(so.get("designer").toString()); + model.setOrderEndCount(Integer.valueOf(so.get("orderEndCount").toString())); + + pageModelList.add(model); + } + } + else if (query == 1 && firstMonthDay.compareTo(beginDate) <= 0 && firstMonthDay.compareTo(endDate) <= 0 && Validates.isNotEmpty(designer)) + {// 当月有选设计师才查询 + queryFlag = 1; + DesignerPerformanceModel model = new DesignerPerformanceModel(designer); + + StringBuilder builder = new StringBuilder(); + builder.append("select 1 as orderEndCount from design_order_merits"); + builder.append(" where designer = 'DESIGNER' and add_time >= 'beginDate' and add_time <= 'endDate'"); + builder.append(" order by add_Time desc"); + String sql = builder.toString().replace("beginDate", beginDate + " 00:00:00").replace("endDate", endDate + " 23:59:59"); + sql = sql.replace("DESIGNER", designer); + List orderList = ORM.get(ZSQL.class).executeQuery(sql); + model.setOrderEndCount(orderList.size());//修改次数 + pageModelList.add(model); + } + else if (query == 1 && firstMonthDay.compareTo(beginDate) <= 0 && firstMonthDay.compareTo(endDate) <= 0 && Validates.isEmpty(designer)) + { + request.setResponseError("查询当月数据需选择设计师条件"); + return; + } + + int endCount = 0;// 总修改次数 + for (DesignerPerformanceModel model : pageModelList) + { + endCount += model.getOrderEndCount(); + } + + request.setAttribute("queryFlag", queryFlag); + request.setAttribute("endCount", endCount); + request.setAttribute("pageModelList", pageModelList); + request.setAttribute("designer", designer); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderRefundRateStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderRefundRateStatAction.java new file mode 100644 index 0000000..6676f1f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderRefundRateStatAction.java @@ -0,0 +1,238 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Maths; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.stat.model.RefundRateModel; + +/** + * 设计退款率统计 + * + * @version v1.0.0 @author liuhu 2018-11-30 新建与整理 + */ +public class DesignOrderRefundRateStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + // 总部组织 + boolean isOrgRoot = false; + if (ZmrOrgDao.getOrgRootId(request) == orgId) + { + isOrgRoot = true; + } + + String beginDate = request.getParameter("beginDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + String operatorCode = request.getParameter("designer"); + Long orgIdSelect = request.getParameterLong("orgId", 0L); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + + String beginTime = beginDate + " 00:00:00"; + String endTime = endDate + " 23:59:59"; + + Selector refundSelector = new Selector(); + refundSelector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + refundSelector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + refundSelector.addMustIsNotNull("designer"); + refundSelector.addMustNotEqual("complaintFlag", 1); + refundSelector.addMaybeThenGE("designBeginTime", Sqls.toTimestamp(beginTime)); + refundSelector.addMaybeThenLE("designBeginTime", Sqls.toTimestamp(endTime)); + // refundSelector.addMustIn("status", StatusConstants.ORDER_F110.value(), + // StatusConstants.ORDER_F100.value()); 去掉已取消 状态订单 + refundSelector.addMustIn("status", StatusConstants.ORDER_F110.value()); + // 相关子查询(一小时内重新下单不算设计师责任) + refundSelector.addExpressionNotEqual("buyerNick", "all (select BUYER_NICK from design_order as b " + "where b.DESIGN_ID <> design_order.DESIGN_ID " + + "and b.CREATE_TIME >= design_order.REFUND_TIME " + "and DATE_SUB(b.CREATE_TIME,INTERVAL 1 HOUR) <= design_order.REFUND_TIME)"); + + + + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selectororg = new Selector(); + selectororg.addMustLike("orgManagerArr", sessionUser.getOperatorCode());//当前用户是否是组织负责人 + List zmrOrgList3 = ORM.get(ZTable.class).list(ZmrOrg.class, selectororg); + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList3) + { + orgList.add(zmrOrg.getOrgId()); + } + Selector selOrg = new Selector(); + if(null != orgList && orgList.size() > 0) { + selOrg.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + List orgList1 = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + request.setAttribute("orgList", orgList1); + + // 不是顶级组织加入组织条件,只查自己 + if (!isOrgRoot) + { + refundSelector.addExpression("designer", "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID = $orgId$)"); + refundSelector.addReplace("ORG_ID", orgId + ""); + refundSelector.addMust("designer", sessionUser.getOperatorCode()); + } + else + { + Selector selector1 = new Selector(); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(orgIdSelect != 0L) { + refundSelector.addExpression("designer", "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID in ("+orgIdSelect+"))"); + }else if(zmrOrgList.size()>0) { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgIdArr=orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() -1); + refundSelector.addExpression("designer", "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID in ("+orgIdArr+"))"); + } + refundSelector.addMaybe("designer", operatorCode); + } + + List refundList = ORM.get(ZView.class).list(DesignSelfView.class, refundSelector); + int refundSum = 0; + long refundMoneyMerge = 0L;// 总退回金额 + Map map = new HashMap(); + for (DesignOrder order : refundList) + { + String designer = order.getDesigner(); + if (!map.containsKey(designer)) + { + map.put(designer, new RefundRateModel(designer)); + } + + RefundRateModel model = map.get(designer); + model.setRefundCount(model.getRefundCount() + 1); + model.setRefundMoneySum(model.getRefundMoneySum() + order.getAmount()); + refundMoneyMerge += order.getAmount(); + refundSum++; + } + + Selector selector = new Selector(); + selector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + selector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + selector.addMustIsNotNull("designer"); + selector.addMaybeThenGE("designBeginTime", Sqls.toTimestamp(beginTime)); + selector.addMaybeThenLE("designBeginTime", Sqls.toTimestamp(endTime)); + if (!isOrgRoot) + {// 不是顶级组织加入组织条件 + selector.addExpression("designer", "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID = $orgId$)"); + selector.addReplace("ORG_ID", orgId + ""); + selector.addMust("designer", sessionUser.getOperatorCode()); + } + else + { + Selector selector1 = new Selector(); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(orgIdSelect != 0L) { + selector.addExpression("designer", "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID in ("+orgIdSelect+"))"); + }else if(zmrOrgList.size()>0) { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgIdArr=orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() -1); + selector.addExpression("designer", "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID in ("+orgIdArr+"))"); + } + selector.addMaybe("designer", operatorCode); + } + List list = ORM.get(ZTable.class).list(DesignOrder.class, selector); + + int sum = 0; + long finalizeMoneyMerge = 0L;// 总设计金额 + for (DesignOrder order : list) + { + String designer = order.getDesigner(); + if (!map.containsKey(designer)) + { + map.put(designer, new RefundRateModel(designer)); + } + + RefundRateModel model = map.get(designer); + model.setSumCount(model.getSumCount() + 1); + model.setFinalizeMoneySum(model.getFinalizeMoneySum() + order.getAmount()); + finalizeMoneyMerge += order.getAmount(); + sum++; + } + + List designerStatList = new ArrayList(); + for (RefundRateModel model : map.values()) + {// 计算奖罚金 + if (model.getSumCount() == 0) + { + model.setRefundRate(0); + model.setAmount(0); + designerStatList.add(model); + continue; + } + + // 计算退款率 + String rate = Maths.division(model.getRefundCount() * 100, model.getSumCount(), 2); + long refundRate = (long) (Double.parseDouble(rate) * 100); + model.setRefundRate(refundRate); + + // 计算奖罚金 + long amount = StatDao.calculateAmount(refundRate, model.getSumCount(), request); + model.setAmount(amount); + + designerStatList.add(model); + } + + Collections.sort(designerStatList); + + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + request.setAttribute("designerStatList", designerStatList); + request.setAttribute("refundSum", refundSum); + request.setAttribute("sum", sum); + request.setAttribute("refundMoneyMerge", refundMoneyMerge); + request.setAttribute("finalizeMoneyMerge", finalizeMoneyMerge); + request.setAttribute("designer", operatorCode); + request.setAttribute("isOrgRoot", isOrgRoot); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderRefundStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderRefundStatAction.java new file mode 100644 index 0000000..262b705 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderRefundStatAction.java @@ -0,0 +1,112 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 订单退款总统计 + * + * @version v1.0.0 @author zzy 2018-7-16 新建与整理 + */ +public class DesignOrderRefundStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getPreviousDateString(7)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + Selector selector = new Selector(); + selector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + selector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + selector.addMaybeThenGE("createTime", Sqls.toTimestamp(beginDate, "00:00:00")); + selector.addMaybeThenLE("createTime", Sqls.toTimestamp(endDate, "23:59:59")); + + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + + // 取消的设计订单列表 + // selector.addMust("status", StatusConstants.ORDER_F100.value()); + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + // 总设计订单数 + int allCount = orderList.size(); + + Map map = new HashMap(); + // 有效设计单数 + int effectiveCount = allCount; + // 退款单说明 + String explain = ""; + for (DesignOrder order : orderList) + { + if (order.getStatus() != StatusConstants.ORDER_F100.value() && order.getStatus() != StatusConstants.ORDER_F110.value()) + { + continue;// 不是取消的 跳过 + } + + if (Validates.isNotEmptyBlank(order.getDesigner()) && order.getComplaintFlag() != 1) + { + explain = "有设计师退款单"; + } + else + { + explain = "无设计师退款单"; + } + + int count = map.get(explain) == null ? 0 : map.get(explain); + map.put(explain, count + 1); + effectiveCount--; + } + map.put("有效设计订单", effectiveCount); + + request.setAttribute("map", map); + request.setAttribute("allCount", allCount); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderTypeStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderTypeStatAction.java new file mode 100644 index 0000000..feeb787 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignOrderTypeStatAction.java @@ -0,0 +1,118 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dbo.stat.OrderTypeStat; +import com.zhiqim.yangcai.design.model.OrderTypeStatModel; + +/** + * 订单类型统计显示 + * + * @version v1.0.0 @author liuhu 2018-12-14 新建与整理 + */ +public class DesignOrderTypeStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + + String beginDate = request.getParameter("beginDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + + Selector selector = new Selector(); + selector.addMustIsNotNull("designer"); + selector.addMaybeThenGE("date", beginDate); + selector.addMaybeThenLE("date", endDate); + OperatorDao.getOrgSelector(request, selector); + + List statList = ORM.get(ZTable.class).list(OrderTypeStat.class, selector); + + Map map = new HashMap(); + + for (OrderTypeStat stat : statList) + { + String designer = stat.getDesigner(); + if (!map.containsKey(designer)) + { + map.put(designer, new OrderTypeStatModel(designer)); + } + + OrderTypeStatModel model = map.get(designer); + model.setOrderSum(model.getOrderSum() + stat.getOrderSum()); + + model.setMultiple3_5(model.getMultiple3_5() + stat.getMultiple35()); + model.setMultiple6_8(model.getMultiple6_8() + stat.getMultiple68()); + model.setMultiple9_11(model.getMultiple9_11() + stat.getMultiple911()); + model.setMultiple12(model.getMultiple12() + stat.getMultiple12()); + + model.setNormalProcessing(model.getNormalProcessing() + stat.getNormalProcessing()); + model.setSpecialProcessing(model.getSpecialProcessing() + stat.getSpecialProcessing()); + model.setApplyOrder(model.getApplyOrder() + stat.getApplyOrder()); + + model.setAmount100_150(model.getAmount100_150() + stat.getAmount100150()); + model.setAmount150_200(model.getAmount150_200() + stat.getAmount150200()); + model.setAmount200_250(model.getAmount200_250() + stat.getAmount200250()); + model.setAmount250_300(model.getAmount250_300() + stat.getAmount250300()); + model.setAmount300_350(model.getAmount300_350() + stat.getAmount300350()); + model.setAmount350_400(model.getAmount350_400() + stat.getAmount350400()); + model.setAmount400_450(model.getAmount400_450() + stat.getAmount400450()); + model.setAmount450_500(model.getAmount450_500() + stat.getAmount450500()); + model.setAmount500(model.getAmount500() + stat.getAmount500()); + + long amount = model.getMultiple3_5() * 50 + model.getMultiple6_8() * 100 + model.getMultiple9_11() * 150 + model.getMultiple12() * 200 + + model.getNormalProcessing() * 100 + model.getSpecialProcessing() * 200 + model.getApplyOrder() * 100 + model.getAmount100_150() * 100 + + model.getAmount150_200() * 150 + model.getAmount200_250() * 200 + model.getAmount250_300() * 250 + model.getAmount300_350() * 300 + + model.getAmount350_400() * 350 + model.getAmount400_450() * 400 + model.getAmount450_500() * 450 + model.getAmount500() * 500; + model.setAmount(amount); + } + + List list = new ArrayList(); + for (OrderTypeStatModel model : map.values()) + { + list.add(model); + } + + Collections.sort(list); + PageResult pageResult = PageBuilder.pageResult(page, pageSize, list); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignRefundOrgTotalStatisticsAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignRefundOrgTotalStatisticsAction.java new file mode 100644 index 0000000..dbe1a98 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignRefundOrgTotalStatisticsAction.java @@ -0,0 +1,166 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignRefundOrgTotalStatisticsAction.java + * 创建人 :高佳新 + * 创建时间:2019-8-3 + */ + +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.model.DesignRefundOrgTotalStatisticsModel; + +/** + * + * 组织退款总统计 + * + * @version 1.0 @author gjx 2019-8-3 新建与整理 + */ +public class DesignRefundOrgTotalStatisticsAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String year = request.getParameter("year", DateTimes.getCurrentYear() + ""); + String month = request.getParameter("month", DateTimes.getCurrentMonth() + ""); + + int day = DateTimes.getMonthDays(Integer.valueOf(year), Integer.valueOf(month)); + String nowMonth = Integer.valueOf(month) < 10 ? "0" + month : month; + + Map orgMap = new HashMap<>(); // 组织map + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class); // 得到所有组织id与名称 + if (zmrOrgList.size() == 0) + { + request.setResponseError("系统组织异常"); + return; + } + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgMap.put(zmrOrg.getOrgId(), zmrOrg.getOrgName()); + } + + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if (org == null) + { + request.setResponseError("组织不存在"); + return; + } + + Selector selector = new Selector(); + selector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + selector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + selector.addMustThenGE("createTime", Sqls.toTimestamp(year + "-" + nowMonth + "-01 00:00:00")); + selector.addMustThenLE("createTime", Sqls.toTimestamp(year + "-" + nowMonth + "-" + day + " 23:59:59")); + selector.addMustThenG("orgId", 0); + if (org.getOrgLevel() > 0) + {// 不是顶级组织加入组织条件 + selector.addExpression("designer", "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID = $orgId$)"); + selector.addReplace("ORG_ID", orgId + ""); + } + + Map refundOrgModelMap = new HashMap<>();// 表格Model + + List designOrderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + int orgOrderMergeCount = 0;// 组织总单量 + long orgOrderMoneySum = 0;// 组织总金额 + for (DesignOrder designOrder : designOrderList) + { + String orgName = orgMap.get(designOrder.getOrgId()); + if (!refundOrgModelMap.containsKey(orgName)) + { + refundOrgModelMap.put(orgName, new DesignRefundOrgTotalStatisticsModel(orgName)); + } + DesignRefundOrgTotalStatisticsModel model = refundOrgModelMap.get(orgName); + model.setOrgOrderCount(model.getOrgOrderCount() + 1); + model.setOrgOrderMoneySum(model.getOrgOrderMoneySum() + designOrder.getAmount()); + orgOrderMoneySum += designOrder.getAmount(); + orgOrderMergeCount++; + } + + Selector refundSelector = new Selector(); + refundSelector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + refundSelector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + refundSelector.addMustIsNotNull("designer"); + refundSelector.addMustNotEqual("complaintFlag", 1); + refundSelector.addMaybeThenGE("refundTime", year + "-" + nowMonth + "-01 00:00:00"); + refundSelector.addMaybeThenLE("refundTime", year + "-" + nowMonth + "-" + day + " 23:59:59"); + refundSelector.addMustThenG("orgId", 0); + // 相关子查询(一小时内重新下单不算设计师责任) + refundSelector.addExpressionNotEqual("buyerNick", "all (select BUYER_NICK from design_order as b " + "where b.DESIGN_ID <> design_order.DESIGN_ID " + + "and b.CREATE_TIME >= design_order.REFUND_TIME " + "and DATE_SUB(b.CREATE_TIME,INTERVAL 1 HOUR) <= design_order.REFUND_TIME)"); + + if (org.getOrgLevel() > 0) + {// 不是顶级组织加入组织条件 + refundSelector.addExpression("designer", "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID = $orgId$)"); + refundSelector.addReplace("ORG_ID", orgId + ""); + } + + List refundList = ORM.get(ZTable.class).list(DesignOrder.class, refundSelector); + int refundOrgMergeCount = 0;// 组织退款总单量 + long refundOrgMoneySum = 0;// 组织退款总金额 + for (DesignOrder refundOrder : refundList) + { + String orgName = orgMap.get(refundOrder.getOrgId()); + if (!refundOrgModelMap.containsKey(orgName)) + { + refundOrgModelMap.put(orgName, new DesignRefundOrgTotalStatisticsModel(orgName)); + } + DesignRefundOrgTotalStatisticsModel model = refundOrgModelMap.get(orgName); + model.setOrgRefundCount(model.getOrgRefundCount() + 1); + model.setOrgRefundMoneySum(model.getOrgRefundMoneySum() + refundOrder.getAmount()); + refundOrgMoneySum += refundOrder.getAmount(); + refundOrgMergeCount++; + } + + List refundOrgList = new ArrayList(refundOrgModelMap.values()); + + List refundOrgSortList = null; + for (int g = 0; g < refundOrgList.size() - 1; g++) + { // 冒泡按指定条件排序 + for (int d = 0; d < refundOrgList.size() - 1 - g; d++) + { + if (refundOrgList.get(d).getOrgRefundCount() < refundOrgList.get(d + 1).getOrgRefundCount()) + { + refundOrgSortList = new ArrayList<>(); + refundOrgSortList.add(0, refundOrgList.get(d)); + refundOrgList.set(d, refundOrgList.get(d + 1)); + refundOrgList.set(d + 1, refundOrgSortList.get(0)); + } + } + } + + Map pieMap = new HashMap(); + for (DesignRefundOrgTotalStatisticsModel refundOrgModel : refundOrgList) + { + pieMap.put(refundOrgModel.getOrgName(), refundOrgModel.getOrgRefundCount()); + } + + request.setAttribute("pieMap", pieMap);// 饼图需要数据 + request.setAttribute("refundOrgList", refundOrgList);// 表格需要数据 + request.setAttribute("year", year); + request.setAttribute("month", month); + request.setAttribute("refundOrgMergeCount", refundOrgMergeCount); + request.setAttribute("orgOrderMergeCount", orgOrderMergeCount); + request.setAttribute("refundOrgMoneySum", refundOrgMoneySum); + request.setAttribute("orgOrderMoneySum", orgOrderMoneySum); + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignRefundPrdTypeStatisticsAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignRefundPrdTypeStatisticsAction.java new file mode 100644 index 0000000..81428ff --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignRefundPrdTypeStatisticsAction.java @@ -0,0 +1,180 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignRefundPrdTypeStatisticsAction.java + * 创建人 蒋斌 + * 创建时间:2019-6-15 + */ + +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.DesignTypeCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.model.DesignRefundPrdTypeStatisticsModel; + +/** + * + * 产品退款总统计 + * + * @version 1.0 @author jiangbin 2020-6-15 新建与整理 + */ +public class DesignRefundPrdTypeStatisticsAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String year = request.getParameter("year", DateTimes.getCurrentYear() + ""); + String month = request.getParameter("month", DateTimes.getCurrentMonth() + ""); + + int day = DateTimes.getMonthDays(Integer.valueOf(year), Integer.valueOf(month)); + String nowMonth = Integer.valueOf(month) < 10 ? "0" + month : month; + + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if (org == null) + { + request.setResponseError("组织不存在"); + return; + } + + Map prdTypeMap = Global.get(DesignTypeCache.class).getMap(); // 产品map + + Selector selector = new Selector(); + selector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + selector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + selector.addMustThenGE("createTime", Sqls.toTimestamp(year + "-" + nowMonth + "-01 00:00:00")); + selector.addMustThenLE("createTime", Sqls.toTimestamp(year + "-" + nowMonth + "-" + day + " 23:59:59")); + selector.addMustThenG("orgId", 0); + if (org.getOrgLevel() > 0) + {// 不是顶级组织加入组织条件 + selector.addMust("orgId", orgId); + }else { + + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + } + + Map refundPrdTypeModelMap = new HashMap<>();// 表格Model + + List designOrderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + int prdTypeOrderMergeCount = 0;// 产品总单量 + long prdTypeOrderMoneySum = 0;// 产品总金额 + for (DesignOrder designOrder : designOrderList) + { + DesignType designType = prdTypeMap.get(designOrder.getTypeId()); + if (Validates.isNotEmpty(designType)) + { + String prdTypeName = designType.getTypeName(); + if (!refundPrdTypeModelMap.containsKey(prdTypeName)) + { + refundPrdTypeModelMap.put(prdTypeName, new DesignRefundPrdTypeStatisticsModel(prdTypeName)); + } + DesignRefundPrdTypeStatisticsModel model = refundPrdTypeModelMap.get(prdTypeName); + model.setPrdOrderCount(model.getPrdOrderCount() + 1); + model.setPrdOrderMoneySum(model.getPrdOrderMoneySum() + designOrder.getAmount()); + prdTypeOrderMoneySum += designOrder.getAmount(); + prdTypeOrderMergeCount++; + } + } + + Selector refundSelector = new Selector(); + refundSelector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + refundSelector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + refundSelector.addMustIsNotNull("designer"); + refundSelector.addMustNotEqual("complaintFlag", 1); + refundSelector.addMaybeThenGE("refundTime", year + "-" + nowMonth + "-01 00:00:00"); + refundSelector.addMaybeThenLE("refundTime", year + "-" + nowMonth + "-" + day + " 23:59:59"); + refundSelector.addMustThenG("orgId", 0); + // 相关子查询(一小时内重新下单不算设计师责任) + refundSelector.addExpressionNotEqual("buyerNick", "all (select BUYER_NICK from design_order as b " + "where b.DESIGN_ID <> design_order.DESIGN_ID " + + "and b.CREATE_TIME >= design_order.REFUND_TIME " + "and DATE_SUB(b.CREATE_TIME,INTERVAL 1 HOUR) <= design_order.REFUND_TIME)"); + if (org.getOrgLevel() > 0) + {// 不是顶级组织加入组织条件 + refundSelector.addMust("orgId", orgId); + }else { + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + refundSelector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + } + + List refundList = ORM.get(ZTable.class).list(DesignOrder.class, refundSelector); + int refundPrdTypeMergeCount = 0;// 产品退款总单量 + long refundPrdTypeMoneySum = 0;// 产品退款总金额 + for (DesignOrder refundOrder : refundList) + { + DesignType dType = prdTypeMap.get(refundOrder.getTypeId()); + if (Validates.isNotEmpty(dType)) + { + String prdTypeName = dType.getTypeName(); + if (!refundPrdTypeModelMap.containsKey(prdTypeName)) + { + refundPrdTypeModelMap.put(prdTypeName, new DesignRefundPrdTypeStatisticsModel(prdTypeName)); + } + DesignRefundPrdTypeStatisticsModel model = refundPrdTypeModelMap.get(prdTypeName); + model.setPrdRefundCount(model.getPrdRefundCount() + 1); + model.setPrdRefundMoneySum(model.getPrdRefundMoneySum() + refundOrder.getAmount()); + refundPrdTypeMoneySum += refundOrder.getAmount(); + refundPrdTypeMergeCount++; + } + } + + List refundPrdTypeList = new ArrayList(refundPrdTypeModelMap.values()); + + Map pieMap = new HashMap(); + for (DesignRefundPrdTypeStatisticsModel refundPrdTypeStatisticsModel : refundPrdTypeList) + { + pieMap.put(refundPrdTypeStatisticsModel.getPrdName(), refundPrdTypeStatisticsModel.getPrdRefundCount()); + } + Collections.sort(refundPrdTypeList); + request.setAttribute("pieMap", pieMap);// 饼图需要数据 + request.setAttribute("refundPrdTypeList", refundPrdTypeList);// 表格需要数据 + request.setAttribute("year", year); + request.setAttribute("month", month); + + request.setAttribute("prdTypeOrderMergeCount", prdTypeOrderMergeCount); + request.setAttribute("refundPrdTypeMergeCount", refundPrdTypeMergeCount); + request.setAttribute("prdTypeOrderMoneySum", prdTypeOrderMoneySum); + request.setAttribute("refundPrdTypeMoneySum", refundPrdTypeMoneySum); + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignerPerformanceAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignerPerformanceAction.java new file mode 100644 index 0000000..26ab1ed --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignerPerformanceAction.java @@ -0,0 +1,251 @@ +/** +* 扬彩印刷设计 + * 文件名 :DesignerPerformanceAction.java + * 创建人 :gjx + * 创建时间:2021年3月8日 +*/ + +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.ProductConvertCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.model.DesignerPerformanceModel; + +/** + * + * [简要描述]: 设计师绩效统计
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年3月8日 新建与整理 + */ +public class DesignerPerformanceAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getDateString()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int query = request.getParameterInt("query"); + String designer = request.getParameter("designer"); + Long orgId = request.getParameterLong("orgId", 0L); + int queryFlag = -1; + + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + + List pageModelList = new ArrayList(); + String firstMonthDay = DateTimes.getFirstMonthDay(); + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode());//当前用户是否是组织负责人 + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + Selector selOrg = new Selector(); + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + if(null != orgList && orgList.size() > 0) { + selOrg.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + + if (Validates.isNotEmpty(designer) && zmrOrgList.size() > 0)//判断设计师要在这些组织 + { + Selector selector = new Selector(); + selector.addMustLike("operatorCode", designer); + + selector.addMust("operatorCode", designer); + selector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + List zmrOperatorList = ORM.get(ZTable.class).list(ZmrOperator.class, selector); + if(zmrOperatorList.size() == 0) { + request.setResponseError("您查找的设计师不在您负责的组织"); + return; + } + + } + + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + //要判断设计师是不是你这个分组的 + if (query == 1 && firstMonthDay.compareTo(beginDate) > 0 && firstMonthDay.compareTo(endDate) > 0) + {// 往月 + queryFlag = 1; + StringBuilder builder = new StringBuilder(); + builder.append("select designer,count(*) orderEndCount,sum(order_designer_fee) designPerformance from designer_order_performance_stat"); + builder.append(" where designer = 'DESIGNER' and org_id = 'orgId' and design_end_time >= 'beginDate' and design_end_time <= 'endDate'"); + builder.append(" group by designer order by designPerformance desc"); + String sql = builder.toString().replace("beginDate", beginDate + " 00:00:00").replace("endDate", endDate + " 23:59:59"); + if(zmrOrgList.size()>0) {//如果是负责了某个组织 + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgIdArr=orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() -1); + if (Validates.isEmpty(designer))//判断设计师要在这些组织 + { + sql = sql.replace("designer = 'DESIGNER' and", "");//没选设计师,就去掉设计师的条件 + if(orgId != 0L) {//如果选择了组织,就要必须在组织里面 + sql = sql.replace("org_id = 'orgId' and", + " org_id in ("+ orgId +") and"); + }else { + sql = sql.replace("org_id = 'orgId' and", + " org_id in ("+ orgIdArr +") and"); + } + + } + else + { + sql = sql.replace("DESIGNER", designer); + if(orgId != 0L) {//如果选择了组织,就要必须在组织里面 + sql = sql.replace("org_id = 'orgId' and", + " org_id in ("+ orgId +") and"); + }else { + sql = sql.replace("org_id = 'orgId' and", + " org_id in ("+ orgIdArr +") and"); + } + + } + + orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selOrg.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + }else {//如果是没负责组织,一切照常 + if (Validates.isEmpty(designer)) + { + sql = sql.replace("designer = 'DESIGNER' and", "");//没选设计师,就去掉设计师的条件 + if(orgId != 0L) {//如果选择了组织,就要必须在组织里面 + sql = sql.replace("org_id = 'orgId' and", + " org_id in ("+ orgId +") and"); + }else { + sql = sql.replace("org_id = 'orgId' and", + " "); + } + + } + else + {//如果设计师不为空 + sql = sql.replace("DESIGNER", designer); + if(orgId != 0L) {//如果选择了组织,就要必须在组织里面 + sql = sql.replace("org_id = 'orgId' and", + " org_id in ("+ orgId +") and"); + }else { + sql = sql.replace("org_id = 'orgId' and", + " "); + } + + } + selOrg.addMustNotEqual("orgId", 1808071102554512L); + } + + + List queryList = ORM.get(ZSQL.class).executeQuery(sql); + for (LinkedMapSO so : queryList) + { + DesignerPerformanceModel model = new DesignerPerformanceModel(so.get("designer").toString()); + model.setOrderEndCount(Integer.valueOf(so.get("orderEndCount").toString())); + model.setDesignPerformance(Long.valueOf(so.get("designPerformance").toString())); + + pageModelList.add(model); + } + } + else if (query == 1 && firstMonthDay.compareTo(beginDate) <= 0 && firstMonthDay.compareTo(endDate) <= 0 && Validates.isNotEmpty(designer)) + {// 当月有选设计师才查询 + queryFlag = 1; + DesignerPerformanceModel model = new DesignerPerformanceModel(designer); + + Selector selector = new Selector(); + selector.addMustThenGE("designEndTime", Sqls.toTimestampBegin(beginDate)); + selector.addMustThenLE("designEndTime", Sqls.toTimestampEnd(endDate)); + selector.addMust("designer", designer); + selector.addMustThenGE("status", StatusConstants.ORDER_55.value()); + selector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + selector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + selector.addOrderbyAsc("createTime"); + List orderList = ORM.get(ZView.class).list(DesignSelfView.class, selector); + + // 先更新产品单价缓存,防止数据未同步 + Global.get(ProductConvertCache.class).doRefresh(); + + long designerOrdCost = 0L; + long urgentPrice = 0L; + for (DesignSelfView order : orderList) + { + long designPrice = 0L; + if (order.getDesignPrice() == 0) + { + designPrice = StatDao.calculateOrderPerformance(order); + } + else + { + designPrice = order.getDesignPrice(); + } + + designerOrdCost += designPrice; + if (order.isUrgent() && Validates.isNotEmpty(order.getUrgentPrice())) + { + urgentPrice = order.getUrgentPrice(); + designerOrdCost += urgentPrice; + } + } + model.setDesignPerformance(designerOrdCost); + model.setOrderEndCount(orderList.size());// 定稿单数 + + pageModelList.add(model); + } + else if (query == 1 && firstMonthDay.compareTo(beginDate) <= 0 && firstMonthDay.compareTo(endDate) <= 0 && Validates.isEmpty(designer)) + { + request.setResponseError("查询当月数据需选择设计师条件"); + return; + } + List orgList1 = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + request.setAttribute("orgList", orgList1); + int endCount = 0;// 总定稿数 + long performanceCount = 0L;// 总绩效 + for (DesignerPerformanceModel model : pageModelList) + { + performanceCount += model.getDesignPerformance(); + endCount += model.getOrderEndCount(); + } + + request.setAttribute("queryFlag", queryFlag); + request.setAttribute("endCount", endCount); + request.setAttribute("performanceCount", performanceCount); + request.setAttribute("pageModelList", pageModelList); + request.setAttribute("designer", designer); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignerPerformanceStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignerPerformanceStatAction.java new file mode 100644 index 0000000..ea754d3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DesignerPerformanceStatAction.java @@ -0,0 +1,208 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dao.PerformanceParamDao; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.stat.DesignGroup; +import com.zhiqim.yangcai.design.dbo.stat.GroupMembers; +import com.zhiqim.yangcai.design.dbo.stat.PerformanceParam; +import com.zhiqim.yangcai.design.dbo.stat.PerformanceStatistics; +import com.zhiqim.yangcai.design.dbo.stat.QcPerformanceParam; +import com.zhiqim.yangcai.design.model.PerformanceStatCalculModel; + +/** + * 设计师绩效统计 + * + * @version v1.0.0 @author liuhu 2019-1-5 新建与整理 + * @version v1.0.1 @author gjx 2019-09-11 整改优化逻辑 + */ +public class DesignerPerformanceStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long selectedOrgId = sessionUser.getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, selectedOrgId); + if (org == null) + { + request.setResponseError("组织不存在"); + return; + } + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 12); + + String operatorCode = request.getParameter("operatorCode"); + String year = request.getParameter("year", String.valueOf(DateTimes.getCurrentYear())); + int mon = request.getParameterInt("month", DateTimes.getCurrentMonth()); + String month = mon < 10 ? "0" + mon : "" + mon; + String startDate = year + "" + month; + + String endDate = DateTimes.getLastMonthDay(startDate); + String beginDate = year + "-" + month + "-01"; + Selector selector = new Selector(); + selector.addMust("statDate", startDate);// yyyyMM + selector.addMaybe("designer", operatorCode); + if (org.getOrgLevel() > 0) + {// 不是顶级组织加入组织查询条件 + selector.addExpression("designer", "any (select operator_code from zmr_operator AS a WHERE a.ORG_ID = $orgId$)"); + selector.addReplace("orgId", selectedOrgId + ""); + } + + Map groupMap = new HashMap<>();// 组长对应小组金额 + Map amountMap = new HashMap<>();// 操作员对应绩效金额 + PageResult pageResult = ORM.get(ZTable.class).page(PerformanceStatistics.class, page, pageSize, selector); + for (PerformanceStatistics stat : pageResult.list()) + { + String designer = stat.getDesigner(); + if (stat.getIsGroupLeader() == 1) + { + DesignGroup designGroup = ORM.get(ZTable.class).item(DesignGroup.class, new Selector().addMust("groupLeader", designer)); + if (designGroup != null) + {// 设计组不存在不算绩效 + PerformanceParam performanceParam = ORM.get(ZTable.class).item(PerformanceParam.class, + new Selector().addMust("orgId", designGroup.getOrgId()).addMust("priceType", 1).addOrderbyDesc("validDate")); + if (performanceParam != null) + { + Selector sel = new Selector("groupId", designGroup.getGroupId()); + sel.addMustThenLE("startDate", beginDate);// yyyy-MM-dd + sel.addOr(new Selector().addMustIsNull("endDate").addMust("endDate", endDate)); + sel.addOrderbyDesc("isGroupLeader"); + sel.addOrderbyAsc("startDate"); + + List memberList = ORM.get(ZTable.class).list(GroupMembers.class, sel); + String[] groupMember = new String[memberList.size()]; + for (int i = 0; i < memberList.size(); i++) + { + groupMember[i] = memberList.get(i).getUserCode(); + } + if (groupMember != null && groupMember.length != 0) + {// 组长下面没有设计师不计算组员带给组长的绩效金额 + PerformanceStatCalculModel model = new PerformanceStatCalculModel(); + List groupMemberList = ORM.get(ZTable.class).list(PerformanceStatistics.class, + new Selector().addMust("statDate", startDate).addMustIn("designer", groupMember)); + long leaderAvgAmount = 0L; + PerformanceStatistics leaderStat = null;// 组长个人统计 + for (PerformanceStatistics statistics : groupMemberList) + { + if (statistics.getIsGroupLeader() == 1) + { + leaderStat = statistics; + } + model.setDesignCompleteSum(model.getDesignCompleteSum() + statistics.getDesignCompleteSum()); + model.setRefundRate(model.getRefundRate() + statistics.getRefundRate()); + model.setQcScore(model.getQcScore() + statistics.getQcScore()); + leaderAvgAmount += statistics.getDesignAmount() + statistics.getOrderTypeAmount() + statistics.getRefundAmount() + + statistics.getQcAmount() - statistics.getAfterLossAmount(); + } + int groupMemberListSize = groupMemberList.size(); + if (groupMemberListSize > 0 && Validates.isNotEmpty(leaderStat)) + { + int avgDesignOrder = (int) Math.round(model.getDesignCompleteSum() / groupMemberListSize);// 组平均设计折算单 + long member_price = PerformanceParamDao.getValidPerformanceParamPrice(performanceParam, avgDesignOrder); + // 组平均设计绩效 + // long member_salary = member_price * Math.round(avgDesignOrder); + long avgRefundRate = Math.round((float) model.getRefundRate() / groupMemberListSize); + // 计算奖罚金,低于200单(设计完成)只罚不奖 + long avgRefundAmount = StatDao.calculateAmount(avgRefundRate, avgDesignOrder);// 组平均退款率奖罚 + + double avgQcScore = model.getQcScore() / groupMemberListSize; + long avgQcAmount = calculQcAmount(avgQcScore, avgDesignOrder);// 组平均质检奖罚 + long groupBringAmount = (int) Math.round(model.getDesignCompleteSum()) * member_price - leaderAvgAmount + + leaderStat.getQcAmount() + leaderStat.getRefundAmount() - leaderStat.getAfterLossAmount() + + leaderStat.getOrderTypeAmount() + avgRefundAmount + avgQcAmount; + groupMap.put(designer, groupBringAmount); + } + } + } + } + } + long performanceAmount = stat.getDesignAmount() + stat.getOrderTypeAmount() + stat.getRefundAmount() + stat.getQcAmount() + - stat.getAfterLossAmount(); + if (groupMap.containsKey(designer)) + { + performanceAmount += groupMap.get(designer); + } + + amountMap.put(designer, performanceAmount); + } + pageResult.addConditionMap(request.getParameterMap()); + + List yearList = StatDao.yearList(2018, DateTimes.getCurrentYear()); + request.setAttribute("yearList", yearList); + request.setAttribute("groupMap", groupMap); + request.setAttribute("amountMap", amountMap); + request.setAttribute("year", year); + request.setAttribute("month", mon); + request.setAttribute("pageResult", pageResult); + request.setAttribute("designerList", OperatorDao.getOrgOperatorList(request, selectedOrgId, request.getSessionName())); + } + + public long calculQcAmount(double qcScore, int designCompleteSum) throws Exception + { + long qcAmount = 0L; + // 质检绩效参数 + QcPerformanceParam qcParam = ORM.get(ZTable.class).item(QcPerformanceParam.class); + if (qcParam == null) + { + return qcAmount; + } + if (qcScore > 0) + {// 质检奖励 + if (designCompleteSum < 200) + {// 折算单数小于200只罚不奖 + return qcAmount; + } + else + { + double rewardParamScore = qcParam.getRewardScore(); + double rewardScoreMoney = rewardParamScore / 100;// 得到质检绩效奖励分数 + double score = qcScore / rewardScoreMoney; + qcAmount = (long) (score * qcParam.getRewardAmount()); + qcAmount = qcAmount > qcParam.getRewardAmountMax() ? qcParam.getRewardAmountMax() : qcAmount; + } + } + else if (qcScore == 0) + {// 不罚不扣 + qcAmount = 0L; + } + else if (qcScore < 0) + {// 质检罚钱 + double punishParamScore = qcParam.getPunishScore(); + double punishScoreMoney = punishParamScore / 100;// 得到质检绩效扣罚分数 + double score = qcScore / punishScoreMoney; + qcAmount = (long) (score * qcParam.getPunishAmount()); + qcAmount = qcAmount < -(qcParam.getPunishAmountMax()) ? -(qcParam.getRewardAmountMax()) : qcAmount; + + } + return qcAmount; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderConvertAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderConvertAction.java new file mode 100644 index 0000000..71a206d --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderConvertAction.java @@ -0,0 +1,125 @@ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.stat.model.DraftDayStatModel; + +/** + * 初稿订单统计 + * + * @version v1.0.0 @author Deng 2017-9-18 新建与整理 + */ +public class DraftOrderConvertAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getDateString()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int query = request.getParameterInt("query"); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 7) + { + request.setResponseError("请勿将时间区间跨度选择大于一周"); + return; + } + + Selector selector = new Selector(); + // 总部看所有,其他组织只能看个人 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + selector.addMust("designer", sessionUser.getOperatorCode()); + } + else + { + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selOrg.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + selector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + }else { + selector.addMaybe("orgId", request.getParameterLong("orgId")); + selOrg.addMustNotEqual("orgId", 1808071102554512L); + } + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + request.setAttribute("orgList", orgList); + } + + Map dtoMap = new HashMap();// 组装初稿订单DTO + if (query == 1) + { + selector.addMustThenGE("status", StatusConstants.ORDER_50.value()); + selector.addMaybeThenGE("designDraftTime", Sqls.toTimestamp(beginDate, "00:00:00")); + selector.addMaybeThenLE("designDraftTime", Sqls.toTimestamp(endDate, "23:59:59")); + + List oList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + for (DesignOrder ord : oList) + { + String designName = ord.getDesigner(); + DraftDayStatModel dto = dtoMap.get(designName); + if (dto == null) + { + dto = new DraftDayStatModel(designName, 0.0, 0, 0); + dtoMap.put(designName, dto); + } + // 设计稿折算 + dto.setDraftOrderCount(dto.getDraftOrderCount() + 1); + } + request.setAttribute("querys", 1); + } + List draftList = new ArrayList(dtoMap.values()); + Collections.sort(draftList, new Comparator() + { + + @Override + public int compare(DraftDayStatModel o1, DraftDayStatModel o2) + { + return o2.getDraftOrderCount() - o1.getDraftOrderCount(); + } + }); + int allDraftOrderCount = 0; + for (DraftDayStatModel model : draftList) + { + allDraftOrderCount += model.getDraftOrderCount(); + } + + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + request.setAttribute("draftList", draftList); + request.setAttribute("allDraftOrderCount", allDraftOrderCount); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderOrgTimelinessAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderOrgTimelinessAction.java new file mode 100644 index 0000000..c25cb29 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderOrgTimelinessAction.java @@ -0,0 +1,154 @@ +/** + * 扬彩印刷设计 + * 文件名 :DraftOrderOrgTimelinessAction.java + * 创建人 :jiangbin + * 创建时间:2020-6-19 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.stat.model.DraftOrgTimelinessModel; + +/*** + * 初稿时效统计(组织) + * + * @version v1.0.0 @author jiangbin 2020-06-19 新建与整理 + */ +public class DraftOrderOrgTimelinessAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + String beginDate = request.getParameter("beginDate", DateTimes.getPreviousDateString(7)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + + Selector selector = new Selector(); + selector.addMustNotIn("status", StatusConstants.ORDER_F100.value(), StatusConstants.ORDER_F110.value()); + selector.addMustThenGE("status", StatusConstants.ORDER_50.value()); + selector.addMaybeThenGE("designDraftTime", Sqls.toTimestamp(beginDate, "00:00:00")); + selector.addMaybeThenLE("designDraftTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMustIn("draftType", DraftConstants.DRAFT_COMMON_DESIGN.value(), DraftConstants.DRAFT_PAGE_DESIGN.value()); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + + List orgList = ZmrOrgDao.list(request); + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + + Map modelMap = new HashMap(); + List typeList = DesignTypeDao.listAll(); + List showTypeList = DesignTypeDao.listDraftOrderTimelinessShowType(); + + for (DesignOrder order : orderList) + { + String orgName = ""; + for (ZmrOrg zmrOrg : orgList) + { + if (zmrOrg.getOrgId() == order.getOrgId()) + { + orgName = zmrOrg.getOrgName(); + } + } + DraftOrgTimelinessModel temp = modelMap.get(order.getOrgId()); + if (temp == null) + { + temp = new DraftOrgTimelinessModel(order.getOrgId(), orgName); + } + + HashMap numberMap = temp.getNumberMap(); + HashMap timeMap = temp.getTimeMap(); + + for (DesignType type : typeList) + { + int number = 0; // 类型的单数 + int time = 0; // 类型初稿总耗时(分钟) + + String typeName = type.getTypeName(); + if (order.getTypeId() == type.getTypeId()) // 先匹配单的类型 + { + boolean flag = false; + for (DesignType designType : showTypeList) + { + if (designType.getTypeId() == order.getTypeId()) + { + flag = true; + break; + } + } + if (!flag) + { + typeName = "其他"; + } + + if (numberMap.containsKey(typeName)) + { + number = numberMap.get(typeName) + 1; + } + else + { + number = 1; + } + + if (timeMap.containsKey(typeName)) + { + time = timeMap.get(typeName) + DateTimes.compareMinute(order.getDesignDraftTime(), order.getDesignReceiveTime()); + } + else + { + time = DateTimes.compareMinute(order.getDesignDraftTime(), order.getDesignReceiveTime()); + } + + numberMap.put(typeName, number); + timeMap.put(typeName, time); + + temp.setAllCount(temp.getAllCount() + 1); + temp.setAllTime(temp.getAllTime() + DateTimes.compareMinute(order.getDesignDraftTime(), order.getDesignReceiveTime())); + break; + } + } + modelMap.put(order.getOrgId(), temp); + } + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, modelMap.values()); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("showTypeList", showTypeList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderOrgTimelinessInfoAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderOrgTimelinessInfoAction.java new file mode 100644 index 0000000..8c9c7c3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderOrgTimelinessInfoAction.java @@ -0,0 +1,167 @@ +/** + * 扬彩印刷设计 + * 文件名 :DraftOrderOrgTimelinessInfoAction.java + * 创建人 :jiangbin + * 创建时间:2020-6-19 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrDeptDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.stat.model.DraftTimelinessModel; + +/*** + * 初稿统计清单(组织) + * + * @version v1.0.0 @author jiangbin 2020-6-19 新建与整理 + */ +public class DraftOrderOrgTimelinessInfoAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + String beginDate = request.getParameter("beginDate"); + String endDate = request.getParameter("endDate"); + long orgId = request.getParameterLong("orgId"); + + Selector selector = new Selector(); + selector.addMust("orgId", orgId); + selector.addMustNotIn("status", StatusConstants.ORDER_F100.value(), StatusConstants.ORDER_F110.value()); + selector.addMustThenGE("status", StatusConstants.ORDER_50.value()); + selector.addMaybeThenGE("designDraftTime", Sqls.toTimestamp(beginDate, "00:00:00")); + selector.addMaybeThenLE("designDraftTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMustIn("draftType", DraftConstants.DRAFT_COMMON_DESIGN.value(), DraftConstants.DRAFT_PAGE_DESIGN.value()); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + ZmrOrg sessionUserOrg = ORM.get(ZTable.class).item(ZmrOrg.class, sessionUser.getSelectedOrgId()); + + List allOrderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + + List orderList = new ArrayList<>(); + // 如果是管理员或者是总部的查看所有的 + if (sessionUser.getOperatorType() <= 1 || sessionUserOrg.getOrgLevel() == 0) + { + orderList = allOrderList; + } + else if (ZmrDeptDao.isDeptManager(request, sessionUser.getOperatorCode())) + {// 如果是部门主管查看部门下所有操作员的 + List operators = ZmrDeptDao.getDeptOperatorCodeList(request, sessionUser.getOperatorCode(), true); + for (DesignOrder designOrder : allOrderList) + { + for (String operatorCode : operators) + { + if (operatorCode.equals(designOrder.getDesigner())) + { + orderList.add(designOrder); + } + } + } + } + else + {// 普通操作员查看自己的 + for (DesignOrder designOrder : allOrderList) + { + if (sessionUser.getOperatorCode().equals(designOrder.getDesigner())) + { + orderList.add(designOrder); + } + } + } + + Map modelMap = new HashMap(); + List typeList = DesignTypeDao.listAll(); + List showTypeList = DesignTypeDao.listDraftOrderTimelinessShowType(); + + for (DesignOrder order : orderList) + { + DraftTimelinessModel temp = modelMap.get(order.getDesigner()); + if (temp == null) + { + temp = new DraftTimelinessModel(order.getDesigner()); + } + + HashMap numberMap = temp.getNumberMap(); + HashMap timeMap = temp.getTimeMap(); + + for (DesignType type : typeList) + { + int number = 0; // 类型的单数 + int time = 0; // 类型初稿总耗时(分钟) + + String typeName = type.getTypeName(); + if (order.getTypeId() == type.getTypeId()) // 先匹配单的类型 + { + boolean flag = false; + for (DesignType designType : showTypeList) + { + if (designType.getTypeId() == order.getTypeId()) + { + flag = true; + break; + } + } + if (!flag) + { + typeName = "其他"; + } + + if (numberMap.containsKey(typeName)) + { + number = numberMap.get(typeName) + 1; + } + else + { + number = 1; + } + + if (timeMap.containsKey(typeName)) + { + time = timeMap.get(typeName) + DateTimes.compareMinute(order.getDesignDraftTime(), order.getDesignReceiveTime()); + } + else + { + time = DateTimes.compareMinute(order.getDesignDraftTime(), order.getDesignReceiveTime()); + } + + numberMap.put(typeName, number); + timeMap.put(typeName, time); + + temp.setAllCount(temp.getAllCount() + 1); + temp.setAllTime(temp.getAllTime() + DateTimes.compareMinute(order.getDesignDraftTime(), order.getDesignReceiveTime())); + break; + } + } + modelMap.put(order.getDesigner(), temp); + } + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, modelMap.values()); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("showTypeList", showTypeList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderTimelinessAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderTimelinessAction.java new file mode 100644 index 0000000..5c36e12 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderTimelinessAction.java @@ -0,0 +1,184 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrDeptDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.stat.model.DraftTimelinessModel; + +/*** + * 初稿时效统计 + * + * @version v1.0.0 @author longguizhi 2018-10-22 新建与整理 + */ +public class DraftOrderTimelinessAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + String beginDate = request.getParameter("beginDate", DateTimes.getPreviousDateString(7)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + + Selector selector = new Selector(); + selector.addMustNotIn("status", StatusConstants.ORDER_F100.value(), StatusConstants.ORDER_F110.value()); + selector.addMustThenGE("status", StatusConstants.ORDER_50.value()); + selector.addMaybeThenGE("designDraftTime", Sqls.toTimestamp(beginDate, "00:00:00")); + selector.addMaybeThenLE("designDraftTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMustIn("draftType", DraftConstants.DRAFT_COMMON_DESIGN.value(), DraftConstants.DRAFT_PAGE_DESIGN.value()); + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + + List allOrderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + + List orderList = new ArrayList<>(); + // 如果是管理员或者是总部的查看所有的 + if (sessionUser.getOperatorType() <= 1 || org.getOrgLevel() == 0) + { + orderList = allOrderList; + } + else if (ZmrDeptDao.isDeptManager(request, sessionUser.getOperatorCode())) + {// 如果是部门主管查看部门下所有操作员的 + List operators = ZmrDeptDao.getDeptOperatorCodeList(request, sessionUser.getOperatorCode(), true); + for (DesignOrder designOrder : allOrderList) + { + for (String operatorCode : operators) + { + if (operatorCode.equals(designOrder.getDesigner())) + { + orderList.add(designOrder); + } + } + } + } + else + {// 普通操作员查看自己的 + for (DesignOrder designOrder : allOrderList) + { + if (sessionUser.getOperatorCode().equals(designOrder.getDesigner())) + { + orderList.add(designOrder); + } + } + } + + Map modelMap = new HashMap(); + List typeList = DesignTypeDao.listAll(); + List showTypeList = DesignTypeDao.listDraftOrderTimelinessShowType(); + + for (DesignOrder order : orderList) + { + DraftTimelinessModel temp = modelMap.get(order.getDesigner()); + if (temp == null) + { + temp = new DraftTimelinessModel(order.getDesigner()); + } + + HashMap numberMap = temp.getNumberMap(); + HashMap timeMap = temp.getTimeMap(); + + for (DesignType type : typeList) + { + int number = 0; // 类型的单数 + int time = 0; // 类型初稿总耗时(分钟) + + String typeName = type.getTypeName(); + if (order.getTypeId() == type.getTypeId()) // 先匹配单的类型 + { + boolean flag = false; + for (DesignType designType : showTypeList) + { + if (designType.getTypeId() == order.getTypeId()) + { + flag = true; + break; + } + } + if (!flag) + { + typeName = "其他"; + } + + if (numberMap.containsKey(typeName)) + { + number = numberMap.get(typeName) + 1; + } + else + { + number = 1; + } + + if (timeMap.containsKey(typeName)) + { + time = timeMap.get(typeName) + DateTimes.compareMinute(order.getDesignDraftTime(), order.getDesignReceiveTime()); + } + else + { + time = DateTimes.compareMinute(order.getDesignDraftTime(), order.getDesignReceiveTime()); + } + + numberMap.put(typeName, number); + timeMap.put(typeName, time); + + temp.setAllCount(temp.getAllCount() + 1); + temp.setAllTime(temp.getAllTime() + DateTimes.compareMinute(order.getDesignDraftTime(), order.getDesignReceiveTime())); + break; + } + } + modelMap.put(order.getDesigner(), temp); + } + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, modelMap.values()); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("showTypeList", showTypeList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderTimelinessInfoAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderTimelinessInfoAction.java new file mode 100644 index 0000000..1a3a5f2 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderTimelinessInfoAction.java @@ -0,0 +1,67 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.stat.design; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/*** + * 初稿统计清单 + * + * @version v1.0.0 @author longguizhi 2018-10-22 新建与整理 + */ +public class DraftOrderTimelinessInfoAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + String beginDate = request.getParameter("beginDate"); + String endDate = request.getParameter("endDate"); + String designer = request.getParameter("designer"); + long prdTypeId = request.getParameterLong("prdTypeId"); + + Selector selector = new Selector(); + selector.addMust("designer", designer); + selector.addMust("typeId", prdTypeId); + selector.addMustNotIn("status", StatusConstants.ORDER_F100.value(), StatusConstants.ORDER_F110.value()); + selector.addMustThenGE("status", StatusConstants.ORDER_50.value()); + selector.addMaybeThenGE("designDraftTime", Sqls.toTimestamp(beginDate, "00:00:00")); + selector.addMaybeThenLE("designDraftTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMustIn("draftType", DraftConstants.DRAFT_COMMON_DESIGN.value(), DraftConstants.DRAFT_PAGE_DESIGN.value()); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderTypeTimelinessAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderTypeTimelinessAction.java new file mode 100644 index 0000000..1d83af1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftOrderTypeTimelinessAction.java @@ -0,0 +1,80 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.stat.model.DraftTypeTimelinessModel; + +/** + * 初稿订单产品类型时效 + * + * @version v1.0.0 @author zzy 2018-8-7 新建与整理 + */ +public class DraftOrderTypeTimelinessAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + + Selector selector = new Selector(); + selector.addMustNotIn("status", StatusConstants.ORDER_F100.value(), StatusConstants.ORDER_F110.value()); + selector.addMustThenGE("status", StatusConstants.ORDER_50.value()); + selector.addMaybeThenGE("designDraftTime", Sqls.toTimestamp(beginDate, "00:00:00")); + selector.addMaybeThenLE("designDraftTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMustIn("draftType",DraftConstants.DRAFT_COMMON_DESIGN.value() , DraftConstants.DRAFT_PAGE_DESIGN.value()); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if(org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + return; + } + + List orderList = ORM.get(ZTable.class).list(DesignOrder.class,selector); + Map modelMap = new HashMap(); + for (DesignOrder order : orderList) + { + DraftTypeTimelinessModel temp = modelMap.get(order.getTypeId()); + if (temp == null) + temp = new DraftTypeTimelinessModel(order.getTypeId()); + + temp.setCount(temp.getCount() +1); + temp.setTime(temp.getTime() + DateTimes.compareMinute(order.getDesignDraftTime(), order.getCreateTime())); + + modelMap.put(order.getTypeId(), temp); + } + + request.setAttribute("timelinessList", modelMap.values()); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftStatusOrderStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftStatusOrderStatAction.java new file mode 100644 index 0000000..2730757 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/DraftStatusOrderStatAction.java @@ -0,0 +1,103 @@ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.Validate; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.stat.model.DraftStatusOrderStatModel; + +/** + * 所有未设计完成状态订单统计 + * + * @version v1.0.0 @author caohong 2020-11-11 + */ +public class DraftStatusOrderStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + // 总部看所有,其他组织只能看个人 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + //查到个人所属组织,但是如果是运营平台的话,增加判断,只能看到自己组织下面的 + long orgId = sessionUser.getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + + Selector selector = new Selector(); + + String operatorCode = sessionUser.getOperatorCode(); + //拿到负责人信息,如果是某组负责人,就只能看到这些组的信息 + Selector selector1 = new Selector(); + selector1.addMustLike("orgManagerArr", operatorCode); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + + selector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + selector.addMust("designer", sessionUser.getOperatorCode()); + } + selector.addMustThenGE("status", StatusConstants.ORDER_30.value());// 大于等于 正在设计 + selector.addMustThenLE("status", StatusConstants.ORDER_50.value());// 小于等于已初稿状态 + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + + Map map = new HashMap(); + String today = DateTimes.getDateString(); + + for (DesignOrder order : orderList) + { + DraftStatusOrderStatModel model = map.get(order.getDesigner()); + if (model == null) + { + model = new DraftStatusOrderStatModel(order.getDesigner()); + } + + model.setSumCount(model.getSumCount() + 1); + String createDay = Sqls.toDateString(order.getCreateTime()); + if (DateTimes.compareDay(today, createDay) <= 2) + { + model.setDayCount(model.getDayCount() + 1); + } + else if (DateTimes.compareDay(today, createDay) <= 7) + { + model.setWeekCount(model.getWeekCount() + 1); + } + else if (DateTimes.compareDay(today, createDay) <= 30) + { + model.setMonthCount(model.getMonthCount() + 1); + } + else + { + model.setOtherCount(model.getOtherCount() + 1); + } + + map.put(order.getDesigner(), model); + } + + request.setAttribute("list", map.values()); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/ExportPerformanceSchedule.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/ExportPerformanceSchedule.java new file mode 100644 index 0000000..b4e315d --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/ExportPerformanceSchedule.java @@ -0,0 +1,136 @@ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.utils.CalculationUtil; +import com.zhiqim.yangcai.util.ExportUtils; +import com.zhiqim.yangcai.util.Report; + +public class ExportPerformanceSchedule implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getLastMonthDay()); + String designer = request.getParameter("designer"); + boolean console = request.getParameterBoolean("console", false); + Long orgId = request.getParameterLong("orgId", 0L); + String firstMonthDay = DateTimes.getFirstMonthDay(); + if (console && ((firstMonthDay.compareTo(beginDate) > 0 && firstMonthDay.compareTo(endDate) <= 0) + || (firstMonthDay.compareTo(endDate) > 0 && firstMonthDay.compareTo(beginDate) <= 0))) + { + request.setResponseError("不支持当月与往月跨月查询"); + return; + } + + List pageResult = null; + if (request.getParameterInt("query") == 1) + { + Selector selector = new Selector(); + selector.addMustThenGE("designEndTime", Sqls.toTimestampBegin(beginDate)); + selector.addMustThenLE("designEndTime", Sqls.toTimestampEnd(endDate)); + //我要只能看到自己负责的组织的数据 + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) {//是负责人,就只能查看负责组织下面的数据 + Selector selectorOp = new Selector(); + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selectorOp.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + if(orgId != 0L) {//如果选择了组织,就要必须在组织里面 + selectorOp.addMust("orgId", orgId); + } + List zmrOperatorList = ORM.get(ZTable.class).list(ZmrOperator.class, selectorOp);//查看该组织下面所有成员 + String[] operatorCodes = new String[zmrOperatorList.size()]; + for (int i = 0; i < zmrOperatorList.size(); i++) + { + operatorCodes[i] = zmrOperatorList.get(i).getOperatorCode(); + } + selector.addMustIn("designer", operatorCodes); + }else { + + if(orgId != 0L) {//如果选择了组织,就要必须在组织里面 + Selector selectorOp = new Selector(); + selectorOp.addMust("orgId", orgId); + List zmrOperatorList = ORM.get(ZTable.class).list(ZmrOperator.class, selectorOp);//查看该组织下面所有成员 + String[] operatorCodes = new String[zmrOperatorList.size()]; + for (int i = 0; i < zmrOperatorList.size(); i++) + { + operatorCodes[i] = zmrOperatorList.get(i).getOperatorCode(); + } + selector.addMustIn("designer", operatorCodes); + } + selector.addMaybe("designer", designer); + + } + + selector.addMustThenGE("status", StatusConstants.ORDER_55.value()); + selector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + selector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + selector.addOrderbyDesc("designEndTime"); + pageResult = ORM.get(ZView.class).list(DesignSelfView.class, selector); + } + + String title = "设计师绩效统计"; + Report report = new Report(); + report.setTitle(title); + report.setFileName(title + (DateTimes.getDateTimeString()) + ".xls"); + //订单号 旺旺号 设计师 店铺 设计类型 产品 设计费份数 领单时间 定稿时间 订单绩效 + report.setHearder(new String[] + { + "订单号", "旺旺号", "设计师", "店铺", "设计类型", "产品", "设计费份数", "领单时间", "定稿时间", "订单绩效", + }); + report.setWidths(new int[] + { + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 + }); + report.setFormats(new int[] + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }); + report.setHeight(700); + report.setExcelPageType(1); + report.setPageSize(1); + + for (DesignSelfView designSelfView : pageResult) + { + String[] drow = new String[] + { + String.valueOf(designSelfView.getDesignId()), designSelfView.getBuyerNick(), designSelfView.getDesigner(), designSelfView.getShopNick(), + DraftConstants.get(designSelfView.getDraftType()), designSelfView.getOrderText(), String.valueOf(designSelfView.getDesignCopies()), + Sqls.toDateTimeString(designSelfView.getDesignReceiveTime()), Sqls.toDateTimeString(designSelfView.getDesignEndTime()), + String.valueOf(CalculationUtil.getDesignerOrderPerformanceYuan(designSelfView, designer)) + }; + + report.addData(drow); + } + + report.setFooter("共" + pageResult.size() + "条数据 导出时间:" + DateTimes.getDateString()); + ExportUtils.exportExcel(request, report); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/OrderAnalysisAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/OrderAnalysisAction.java new file mode 100644 index 0000000..9d5c237 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/OrderAnalysisAction.java @@ -0,0 +1,145 @@ +/** + * 扬彩印刷设计 + * 文件名 :OrderAnalysisAction.java + * 创建人 :江帆 + * 创建时间:2020-9-16 + */ + +package com.zhiqim.yangcai.design.action.stat.design; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; + +/** + * + * 订单分析 + * + * @version 1.0 @author 江帆 2020-9-16 新建与整理 + */ +public class OrderAnalysisAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + Integer timeType = request.getParameterInt("timeType"); + if (timeType == null || timeType == -1) + { + timeType = 3; + } + String startDate = getLastDateInt(0 - timeType); + String endDate = DateTimes.getDateString(); + + List dateList = new ArrayList(0); + Map orderCountMap = new HashMap();// 订单Map + Map draftCountMap = new HashMap();// 初稿Map + Map endCountMap = new HashMap();// 定稿Map + for (int i = 0; i <= 24; i++) + { // 初始化天数数据 + String timePoint = ""; + if (i < 10) + { + timePoint = "0" + i; + } + else + { + timePoint = "" + i; + } + dateList.add(timePoint); + orderCountMap.put(timePoint, 0);// 订单Map + draftCountMap.put(timePoint, 0);// 设计单量 + endCountMap.put(timePoint, 0);// 定稿Map + } + + StringBuffer allSql = new StringBuffer(); + allSql.append("SELECT "); + allSql.append("substring(CREATE_TIME, 12, 2) timePoint,sum(1) sum "); + allSql.append("FROM "); + allSql.append("DESIGN_ORDER "); + allSql.append("WHERE "); + allSql.append("DESIGN_ORDER.CREATE_TIME >= '" + startDate + " 00:00:00' "); + allSql.append("AND DESIGN_ORDER.CREATE_TIME <= '" + endDate + " 23:59:59' "); + allSql.append(" GROUP BY substring(CREATE_TIME, 12, 2) "); + + List orderLinkedMapSOList = ORM.get(ZSQL.class).executeQuery(allSql.toString()); + + for (LinkedMapSO linkedMapSO : orderLinkedMapSOList) + { + String timePoint = linkedMapSO.get("timePoint").toString(); + int sum = Integer.valueOf(linkedMapSO.get("sum").toString()); + orderCountMap.put(timePoint, sum); + } + + allSql = new StringBuffer(); + allSql.append("SELECT "); + allSql.append("substring(DESIGN_DRAFT_TIME, 12, 2) timePoint,sum(1) sum "); + allSql.append("FROM "); + allSql.append("DESIGN_ORDER "); + allSql.append("WHERE "); + allSql.append("DESIGN_ORDER.DESIGN_DRAFT_TIME >= '" + startDate + " 00:00:00' "); + allSql.append("AND DESIGN_ORDER.DESIGN_DRAFT_TIME <= '" + endDate + " 23:59:59' "); + allSql.append(" GROUP BY substring(DESIGN_DRAFT_TIME, 12, 2) "); + + orderLinkedMapSOList = ORM.get(ZSQL.class).executeQuery(allSql.toString()); + + for (LinkedMapSO linkedMapSO : orderLinkedMapSOList) + { + String timePoint = linkedMapSO.get("timePoint").toString(); + int sum = Integer.valueOf(linkedMapSO.get("sum").toString()); + draftCountMap.put(timePoint, sum); + } + + allSql = new StringBuffer(); + allSql.append("SELECT "); + allSql.append("substring(DESIGN_END_TIME, 12, 2) timePoint,sum(1) sum "); + allSql.append("FROM "); + allSql.append("DESIGN_ORDER "); + allSql.append("WHERE "); + allSql.append("DESIGN_ORDER.DESIGN_END_TIME >= '" + startDate + " 00:00:00' "); + allSql.append("AND DESIGN_ORDER.DESIGN_END_TIME <= '" + endDate + " 23:59:59' "); + allSql.append(" GROUP BY substring(DESIGN_END_TIME, 12, 2) "); + + orderLinkedMapSOList = ORM.get(ZSQL.class).executeQuery(allSql.toString()); + + for (LinkedMapSO linkedMapSO : orderLinkedMapSOList) + { + String timePoint = linkedMapSO.get("timePoint").toString(); + int sum = Integer.valueOf(linkedMapSO.get("sum").toString()); + endCountMap.put(timePoint, sum); + } + request.setAttribute("timeType", timeType); + request.setAttribute("dateList", dateList); + request.setAttribute("orderCountMap", orderCountMap); + request.setAttribute("draftCountMap", draftCountMap); + request.setAttribute("endCountMap", endCountMap); + } + + /** + * 获取前几日的值 + * + * @param day + * + * @return + */ + public static String getLastDateInt(int day) + { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DATE, day); // 得到前几天 + Date date = calendar.getTime(); + DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); + return df.format(date); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/PersonalPerformanceStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/PersonalPerformanceStatAction.java new file mode 100644 index 0000000..ed22a65 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/PersonalPerformanceStatAction.java @@ -0,0 +1,186 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.PerformanceParamDao; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.stat.DesignGroup; +import com.zhiqim.yangcai.design.dbo.stat.GroupMembers; +import com.zhiqim.yangcai.design.dbo.stat.PerformanceParam; +import com.zhiqim.yangcai.design.dbo.stat.PerformanceStatistics; +import com.zhiqim.yangcai.design.dbo.stat.QcPerformanceParam; +import com.zhiqim.yangcai.design.model.PerformanceStatCalculModel; + +/** + * + * 个人绩效 + * + * @version v1.0.1 @author gjx 2019-09-11 整改优化逻辑 + */ +public class PersonalPerformanceStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + + String year = request.getParameter("year", String.valueOf(DateTimes.getCurrentYear())); + int mon = request.getParameterInt("month", DateTimes.getCurrentMonth()); + String month = mon < 10 ? "0" + mon : "" + mon; + String startDate = year + "" + month; + + String endDate = DateTimes.getLastMonthDay(startDate); + String beginDate = year + "-" + month + "-01"; + String designer = request.getSessionName(); + Selector selector = new Selector(); + selector.addMust("statDate", startDate); + selector.addMust("designer", designer); + + PerformanceStatistics stat = ORM.get(ZTable.class).item(PerformanceStatistics.class, selector); + stat = stat == null ? new PerformanceStatistics() : stat; + + Map map = new HashMap(); + map.put("设计绩效", Amounts.toYuan(stat.getDesignAmount())); + map.put("疑难订单绩效", Amounts.toYuan(stat.getOrderTypeAmount())); + map.put("退款率绩效", Amounts.toYuan(stat.getRefundAmount() < 0 ? -(stat.getRefundAmount()) : stat.getRefundAmount())); + map.put("质检绩效", Amounts.toYuan(stat.getQcAmount() < 0 ? -(stat.getQcAmount()) : stat.getQcAmount())); + map.put("售后扣罚", Amounts.toYuan(stat.getAfterLossAmount() < 0 ? -(stat.getAfterLossAmount()) : stat.getAfterLossAmount())); + + long groupBringAmount = 0L; + long amount = stat.getDesignAmount() + stat.getOrderTypeAmount() + stat.getRefundAmount() + stat.getQcAmount() - stat.getAfterLossAmount(); + if (stat.getIsGroupLeader() == 1) + {// 组长 + DesignGroup designGroup = ORM.get(ZTable.class).item(DesignGroup.class, new Selector().addMust("groupLeader", designer)); + if (designGroup != null) + {// 设计组不存在不算绩效 + PerformanceParam performanceParam = ORM.get(ZTable.class).item(PerformanceParam.class, + new Selector().addMust("orgId", designGroup.getOrgId()).addMust("priceType", 1).addOrderbyDesc("validDate")); + if (performanceParam != null) + { + Selector sel = new Selector("groupId", designGroup.getGroupId()); + sel.addMustThenLE("startDate", beginDate); + sel.addOr(new Selector().addMustIsNull("endDate").addMust("endDate", endDate)); + sel.addOrderbyDesc("isGroupLeader"); + sel.addOrderbyAsc("startDate"); + + List memberList = ORM.get(ZTable.class).list(GroupMembers.class, sel); + String[] groupMember = new String[memberList.size()]; + for (int i = 0; i < memberList.size(); i++) + { + groupMember[i] = memberList.get(i).getUserCode(); + } + if (groupMember != null && groupMember.length != 0) + {// 组长下面没有设计师不计算组员带给组长的绩效金额 + PerformanceStatCalculModel model = new PerformanceStatCalculModel(); + List groupMemberList = ORM.get(ZTable.class).list(PerformanceStatistics.class, + new Selector().addMust("statDate", startDate).addMustIn("designer", groupMember)); + long leaderAvgAmount = 0L; + PerformanceStatistics leaderStat = null;// 组长个人统计 + for (PerformanceStatistics statistics : groupMemberList) + { + if (statistics.getIsGroupLeader() == 1) + { + leaderStat = statistics; + } + model.setDesignCompleteSum(model.getDesignCompleteSum() + statistics.getDesignCompleteSum()); + model.setRefundRate(model.getRefundRate() + statistics.getRefundRate()); + model.setQcScore(model.getQcScore() + statistics.getQcScore()); + leaderAvgAmount += statistics.getDesignAmount() + statistics.getOrderTypeAmount() + statistics.getRefundAmount() + + statistics.getQcAmount() - statistics.getAfterLossAmount(); + } + int groupMemberListSize = groupMemberList.size(); + if (groupMemberListSize > 0 && Validates.isNotEmpty(leaderStat)) + { + int avgDesignOrder = (int) Math.round(model.getDesignCompleteSum() / groupMemberListSize);// 组平均设计折算单 + long member_price = PerformanceParamDao.getValidPerformanceParamPrice(performanceParam, avgDesignOrder);// 组均单量对应单价 + // 组平均设计绩效 + // long member_salary = member_price * Math.round(avgDesignOrder); + long avgRefundRate = Math.round((float) model.getRefundRate() / groupMemberListSize);// 组平均退款率 + // 计算奖罚金,低于200单(设计完成)只罚不奖 + long avgRefundAmount = StatDao.calculateAmount(avgRefundRate, avgDesignOrder);// 组平均退款率奖罚 + double avgQcScore = model.getQcScore() / groupMemberListSize;// 组平均质检分 + long avgQcAmount = calculQcAmount(avgQcScore, avgDesignOrder);// 组平均质检奖罚 + + groupBringAmount = (int) Math.round(model.getDesignCompleteSum()) * member_price - leaderAvgAmount + leaderStat.getQcAmount() + + leaderStat.getRefundAmount() - leaderStat.getAfterLossAmount() + leaderStat.getOrderTypeAmount() + avgRefundAmount + + avgQcAmount; + amount += groupBringAmount; + } + } + } + } + map.put("小组绩效", Amounts.toYuan(groupBringAmount)); + } + + List yearList = StatDao.yearList(2018, DateTimes.getCurrentYear()); + request.setAttribute("yearList", yearList); + request.setAttribute("amountSum", Amounts.toYuan(amount)); + request.setAttribute("year", year); + request.setAttribute("month", mon); + request.setAttribute("stat", stat); + request.setAttribute("map", map); + request.setAttribute("groupBringAmount", Amounts.toYuan(groupBringAmount)); + } + + public long calculQcAmount(double qcScore, int designCompleteSum) throws Exception + { + long qcAmount = 0L; + // 质检绩效参数 + QcPerformanceParam qcParam = ORM.get(ZTable.class).item(QcPerformanceParam.class); + if (qcParam == null) + { + return qcAmount; + } + if (qcScore > 0) + {// 质检奖励 + if (designCompleteSum < 200) + {// 折算单数小于200只罚不奖 + return qcAmount; + } + else + { + double rewardParamScore = qcParam.getRewardScore(); + double rewardScoreMoney = rewardParamScore / 100;// 得到质检绩效奖励分数 + double score = qcScore / rewardScoreMoney; + qcAmount = (long) (score * qcParam.getRewardAmount()); + qcAmount = qcAmount > qcParam.getRewardAmountMax() ? qcParam.getRewardAmountMax() : qcAmount; + } + } + else if (qcScore == 0) + {// 不罚不扣 + qcAmount = 0L; + } + else if (qcScore < 0) + {// 质检罚钱 + double punishParamScore = qcParam.getPunishScore(); + double punishScoreMoney = punishParamScore / 100;// 得到质检绩效扣罚分数 + double score = qcScore / punishScoreMoney; + qcAmount = (long) (score * qcParam.getPunishAmount()); + qcAmount = qcAmount < -(qcParam.getPunishAmountMax()) ? -(qcParam.getRewardAmountMax()) : qcAmount; + + } + return qcAmount; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/PersonalRefundRateStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/PersonalRefundRateStatAction.java new file mode 100644 index 0000000..0ae9ffd --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/PersonalRefundRateStatAction.java @@ -0,0 +1,103 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Maths; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 个人退款率统计 + * + * @version v1.0.0 @author liuhu 2018-12-3 新建与整理 + */ + +public class PersonalRefundRateStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 10); + String beginDate = request.getParameter("beginDate", DateTimes.getPreviousDateString(7)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + String operator = request.getSessionUser(ZmrSessionUser.class).getOperatorCode(); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + Selector refundSelector = new Selector(); + refundSelector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + refundSelector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + refundSelector.addMust("designer", operator); + refundSelector.addMustNotEqual("complaintFlag", 1); + refundSelector.addMaybeThenGE("refundTime", beginDate + " 00:00:00"); + refundSelector.addMaybeThenLE("refundTime", endDate + " 23:59:59"); + + // 相关子查询(一小时内重新下单不算设计师责任) + refundSelector.addExpressionNotEqual("buyerNick", "all (select BUYER_NICK from design_order as b " + "where b.DESIGN_ID <> design_order.DESIGN_ID " + + "and b.CREATE_TIME >= design_order.REFUND_TIME " + "and DATE_SUB(b.CREATE_TIME,INTERVAL 1 HOUR) <= design_order.REFUND_TIME)"); + + PageResult refundResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, refundSelector); + + Selector selector = new Selector(); + selector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + selector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + selector.addMust("designer", operator); + selector.addMaybeThenGE("designBeginTime", Sqls.toTimestamp(beginDate + " 00:00:00")); + selector.addMaybeThenLE("designBeginTime", Sqls.toTimestamp(endDate + " 23:59:59")); + List list = ORM.get(ZTable.class).list(DesignOrder.class, selector); + + Selector passSelector = new Selector(); + passSelector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + passSelector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + passSelector.addMaybe("designer", operator); + passSelector.addMust("complaintFlag", 1); + passSelector.addMustThenGE("refundTime", beginDate + " 00:00:00"); + passSelector.addMustThenLE("refundTime", endDate + " 23:59:59"); + PageResult passResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, passSelector); + + long amount = 0; + if (list.size() > 0) + {// 计算奖罚金 + String rate = Maths.division(refundResult.total() * 100, list.size(), 2); + long refundRate = (long) (Double.parseDouble(rate) * 100); + amount = StatDao.calculateAmount(refundRate, list.size(), request); + } + + request.setAttribute("amount", amount); + request.setAttribute("page", page); + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + request.setAttribute("list", list); + request.setAttribute("refundResult", refundResult); + request.setAttribute("passResult", passResult); + request.setAttribute("designer", operator); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/QcDesignerStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/QcDesignerStatAction.java new file mode 100644 index 0000000..1510394 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/QcDesignerStatAction.java @@ -0,0 +1,179 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dao.ZmrDeptDao; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.qc.QcRecord; +import com.zhiqim.yangcai.design.model.QcStatModel; + +/** + * 设计师质检统计 + * + * @version v1.0.0 @author liuhu 2019-1-28 新建与整理 + */ +public class QcDesignerStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + + String year = request.getParameter("year", DateTimes.getCurrentYear() + ""); + String month = request.getParameter("month", DateTimes.getCurrentMonth() + ""); + String dateTime = year + "-" + month; + int day = DateTimes.getMonthDays(year + month); + + // 计算扣分 + Selector selector = new Selector(); + selector.addMustThenGE("qcTime", Sqls.toTimestamp(dateTime + "-01" + " 00:00:00")); + selector.addMustThenLE("qcTime", Sqls.toTimestamp(dateTime + "-" + day + " 23:59:59")); + selector.addMust("qcFlag", 2); + OperatorDao.getOrgSelector(request, selector); + List qcList = ORM.get(ZTable.class).list(QcRecord.class, selector); + + List repeatList = new ArrayList(); + + Map map = new HashMap(); + for (QcRecord record : qcList) + { + String designer = record.getDesigner(); + String reason = record.getReason(); + String date = Sqls.toDateString(record.getQcTime()); + if (!map.containsKey(designer)) + { + map.put(designer, new QcStatModel(designer)); + } + + boolean flag = true; + for (QcRecord qcRecord : repeatList) + {// 单个设计师一天内 多条订单违反同一条违规内容 只统计一次违规扣分 + String designer2 = qcRecord.getDesigner(); + String reason2 = qcRecord.getReason(); + String date2 = Sqls.toDateString(qcRecord.getQcTime()); + if (designer.equals(designer2) && reason.equals(reason2) && date.equals(date2)) + { + flag = false; + break; + } + } + if (flag) + { + QcStatModel model = map.get(designer); + model.setPunishScore(model.getPunishScore() + record.getScore()); + repeatList.add(record); + } + } + + // 计算加分 + StringBuffer sqlBuffer = new StringBuffer(); + sqlBuffer.append("select Designer,SUM(SCORE) AS sumScore from QC_APPLY_SCORE WHERE"); + sqlBuffer.append(" APPLY_TIME >= '" + dateTime + "-01 00:00:00' and APPLY_TIME <= '" + dateTime + "-" + day + " 23:59:59'"); + sqlBuffer.append(" and APPLY_FLAG = 1 GROUP BY DESIGNER"); + String designerSql = sqlBuffer.toString(); + List afterOrdOrderList = ORM.get(ZSQL.class).executeQuery(designerSql); + QcStatModel modelReawrd = null; + for (LinkedMapSO linkedMapSO : afterOrdOrderList) + { + BigDecimal bigDecimal = (BigDecimal) linkedMapSO.get("sumScore"); + double reward = bigDecimal.doubleValue(); + String design = (String) linkedMapSO.get("Designer"); + if (map.containsKey(design)) + { + modelReawrd = map.get(design); + } + else + { + modelReawrd = new QcStatModel(design); + } + modelReawrd.setRewardScore(reward); + map.put(design, modelReawrd); + } + List modelList = new ArrayList(); + for (QcStatModel model : map.values()) + {// 计算质检分数 + model.setQcScore(model.getQcScore() + model.getRewardScore() - model.getPunishScore()); + modelList.add(model); + } + String sessionName = request.getSessionName(); + ZmrOperator zmrOperator = ORM.get(ZTable.class).item(ZmrOperator.class, new Selector().addMust("operatorCode", sessionName)); + if (zmrOperator == null) + { + request.returnHistory("该用户不存在"); + return; + } + if (zmrOperator.getOperatorType() == 2 && zmrOperator.getOrgId() != ZmrOrgDao.getOrgRootId(request)) + {// 非总部管理员用户需要区分权限 + List operatorList = new ArrayList<>(); + List deptList = ZmrBootstrap.table(request).list(ZmrDept.class, new Selector("deptManager", sessionName)); + if (deptList.isEmpty()) + {// 不是部门负责人 + operatorList.add(sessionName); + } + else + { + operatorList = ZmrDeptDao.getDeptOperatorCodeList(request, sessionName, true); + } + Iterator iterator = modelList.iterator(); + while (iterator.hasNext()) + { + QcStatModel qcModel = iterator.next(); + if (!operatorList.contains(qcModel.getDesigner())) + { + iterator.remove(); + } + } + } + List electricList = null; + for (int g = 0; g < modelList.size() - 1; g++) + { + for (int d = 0; d < modelList.size() - 1 - g; d++) + { + if (modelList.get(d).getQcScore() < modelList.get(d + 1).getQcScore()) + { + electricList = new ArrayList<>(); + electricList.add(0, modelList.get(d)); + modelList.set(d, modelList.get(d + 1)); + modelList.set(d + 1, electricList.get(0)); + } + } + } + List yearList = StatDao.yearList(2018, DateTimes.getCurrentYear()); + + request.setAttribute("year", year); + request.setAttribute("month", month); + request.setAttribute("yearList", yearList); + request.setAttribute("modelList", modelList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/QcDisposeStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/QcDisposeStatAction.java new file mode 100644 index 0000000..68fbb14 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/QcDisposeStatAction.java @@ -0,0 +1,89 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.qc.QcRecord; +import com.zhiqim.yangcai.design.model.QcDisposeModel; + +/** + * 质检处理统计,统计处理人每日处理订单情况 + * + * @version v1.0.0 @author liuhu 2019-1-28 新建与整理 + */ +public class QcDisposeStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + Selector selector = new Selector(); + selector.addMustThenGE("qcTime", Sqls.toTimestamp(beginDate + " 00:00:00")); + selector.addMustThenLE("qcTime", Sqls.toTimestamp(endDate + " 23:59:59")); + List list = ORM.get(ZTable.class).list(QcRecord.class, selector); + + Map map = new HashMap(); + for (QcRecord record : list) + { + String operatorCode = record.getOperatorCode(); + if (!map.containsKey(operatorCode)) + { + map.put(operatorCode, new QcDisposeModel(operatorCode)); + } + + QcDisposeModel model = map.get(operatorCode); + model.setQcCount(model.getQcCount() + 1); + if (record.getQcFlag() == 1) + { + model.setNormalCount(model.getNormalCount() + 1); + } + else if (record.getQcFlag() == 2) + { + model.setViolationsCount(model.getViolationsCount() + 1); + } + } + + List modelList = new ArrayList(); + for (QcDisposeModel model : map.values()) + { + modelList.add(model); + } + + Collections.sort(modelList); + + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + request.setAttribute("modelList", modelList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/QcReasonStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/QcReasonStatAction.java new file mode 100644 index 0000000..6ccb613 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/QcReasonStatAction.java @@ -0,0 +1,75 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dbo.qc.QcRecord; + +/** + * 质检原因统计 + * + * @version v1.0.0 @author liuhu 2019-1-28 新建与整理 + */ +public class QcReasonStatAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String beginDate = request.getParameter("beginDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, beginDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + Selector selector = new Selector(); + selector.addMustThenGE("qcTime", Sqls.toTimestamp(beginDate + " 00:00:00")); + selector.addMustThenLE("qcTime", Sqls.toTimestamp(endDate + " 23:59:59")); + selector.addMust("qcFlag", 2); + OperatorDao.getOrgSelector(request, selector); + + List list = ORM.get(ZTable.class).list(QcRecord.class, selector); + + Map map = new HashMap(); + for (QcRecord record : list) + { + String reason = record.getReason(); + if (!map.containsKey(reason)) + { + map.put(reason, 1); + } + else + { + map.put(reason, map.get(reason) + 1); + } + } + + request.setAttribute("beginDate", beginDate); + request.setAttribute("endDate", endDate); + request.setAttribute("map", map); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/TimeoutDesignerCompleteAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/TimeoutDesignerCompleteAction.java new file mode 100644 index 0000000..af3009f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/TimeoutDesignerCompleteAction.java @@ -0,0 +1,115 @@ +/** + * 扬彩印刷设计 + * 文件名 :TimeoutDesignerCompleteAction.java + * 创建人 :gjx + * 创建时间:2020年11月6日 +*/ + +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +/** + * + * [简要描述]:设计师定稿超时
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年11月6日 新建与整理 + */ +public class TimeoutDesignerCompleteAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + // 总部组织 + boolean isOrgRoot = false; + if (ZmrOrgDao.getOrgRootId(request) == orgId) + { + isOrgRoot = true; + } + + String startDate = request.getParameter("startDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + String designer = request.getParameter("designer"); + + int day = DateTimes.compareDay(endDate, startDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } + + // 非总部只查自己 + if (!isOrgRoot) + { + designer = sessionUser.getOperatorCode(); + } + + StringBuilder sqlStr = new StringBuilder( + "SELECT designer, count(*) timeoutNum FROM design_order WHERE STATUS > 0 AND CREATE_TIME >= 'startDateStr' AND CREATE_TIME <= 'endDateStr' AND DESIGNER IS NOT NULL"); + + if (!isOrgRoot) + { + sqlStr.append(" AND ORG_ID = " + orgId); + }else { + Selector selector1 = new Selector(); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + String orgIdArr = ""; + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgIdArr=orgIdArr + zmrOrg.getOrgId() + ","; + } + orgIdArr = orgIdArr.substring(0, orgIdArr.length() -1); + sqlStr.append(" AND ORG_ID in (" + orgIdArr +")"); + } + } + sqlStr.append( + " AND DESIGN_BEGIN_TIME < SUBDATE(IF(design_order.`STATUS` >= 55,design_order.DESIGN_END_TIME,now()),INTERVAL (SELECT dt.EFFECTIVE_END_TIME FROM design_type dt WHERE dt.TYPE_ID = DESIGN_ORDER.TYPE_ID) MINUTE) GROUP BY DESIGNER HAVING count(*) > 0"); + + if (Validates.isNotEmpty(designer)) + { + sqlStr.append(" and designer = '" + designer + "'"); + } + sqlStr.append(" ORDER BY timeoutNum DESC"); + String sql = sqlStr.toString().replace("startDateStr", startDate + " 00:00:00").replace("endDateStr", endDate + " 23:59:59"); + + Map timeoutMap = new LinkedHashMap(); + int timeoutOrderNumSum = 0; + + List timeoutEndStatList = ORM.get(ZSQL.class).executeQuery(sql); + for (LinkedMapSO so : timeoutEndStatList) + { + Integer timeoutOrderNum = Integer.valueOf(String.valueOf(so.get("timeoutNum"))); + timeoutOrderNumSum += timeoutOrderNum; + timeoutMap.put(String.valueOf(so.get("designer")), timeoutOrderNum); + } + + request.setAttribute("timeoutMap", timeoutMap); + request.setAttribute("timeoutOrderNumSum", timeoutOrderNumSum); + request.setAttribute("designer", designer); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/TimeoutOrgCompleteAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/TimeoutOrgCompleteAction.java new file mode 100644 index 0000000..bffff8b --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/design/TimeoutOrgCompleteAction.java @@ -0,0 +1,153 @@ +/** + * 扬彩印刷设计 + * 文件名 :TimeoutOrgCompleteAction.java + * 创建人 :gjx + * 创建时间:2020年11月6日 +*/ + +package com.zhiqim.yangcai.design.action.stat.design; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; + +/** + * + * [简要描述]: 组织超时统计
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年11月6日 新建与整理 + */ +public class TimeoutOrgCompleteAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String startDate = request.getParameter("startDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + + int day = DateTimes.compareDay(endDate, startDate); + if (day > 31) + { + request.setResponseError("请勿将时间区间跨度选择大于一个月"); + return; + } // 根据组织显示 + + long typeId = request.getParameterLong("typeId"); + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (ZmrOrgDao.getOrgRootId(request) == sessionUser.getSelectedOrgId()) + {// 选择总部时:左侧饼状图展示各组织超时占比饼状图 + StringBuilder sqlStr = new StringBuilder( + "SELECT ( SELECT org_name FROM zmr_org WHERE ORG_ID = design_order.ORG_ID ) orgName,count(*) orgTimeoutNum, root_org.timeoutNum orgTimeoutSumNum,ROUND( count(*) / root_org.timeoutNum * 100, 2 ) orgTimeoutProportion,"); + sqlStr.append(" (SELECT COUNT(*) FROM design_order d WHERE d.CREATE_TIME >= 'startDateStr' AND d.CREATE_TIME <= 'endDateStr'"); + sqlStr.append(" AND d.ORG_ID = design_order.ORG_ID AND d.TYPE_ID = typeIdStr) orgOrderNum"); + sqlStr.append(" FROM design_order,(SELECT count(*) timeoutNum FROM design_order WHERE STATUS > 0 AND CREATE_TIME >= 'startDateStr'"); + sqlStr.append(" AND CREATE_TIME <= 'endDateStr' AND TYPE_ID = typeIdStr AND DESIGNER IS NOT NULL AND DESIGN_BEGIN_TIME IS NOT NULL"); + sqlStr.append( + " AND DESIGN_BEGIN_TIME < SUBDATE(IF (design_order.`STATUS` >= 55,design_order.DESIGN_END_TIME,now()),INTERVAL (SELECT dt.EFFECTIVE_END_TIME FROM design_type dt WHERE dt.TYPE_ID = DESIGN_ORDER.TYPE_ID ) MINUTE)) root_org"); + sqlStr.append(" WHERE STATUS > 0 AND CREATE_TIME >= 'startDateStr' AND CREATE_TIME <= 'endDateStr'"); + sqlStr.append(" AND TYPE_ID = typeIdStr AND DESIGNER IS NOT NULL AND DESIGN_BEGIN_TIME IS NOT NULL AND"); + sqlStr.append( + " DESIGN_BEGIN_TIME < SUBDATE(IF (design_order.`STATUS` >= 55,design_order.DESIGN_END_TIME, now()), INTERVAL (SELECT dt.EFFECTIVE_END_TIME FROM design_type dt WHERE dt.TYPE_ID = DESIGN_ORDER.TYPE_ID) MINUTE) GROUP BY ORG_ID ORDER BY orgOrderNum DESC"); + + String sql = sqlStr.toString().replace("startDateStr", startDate + " 00:00:00").replace("endDateStr", endDate + " 23:59:59"); + if (typeId <= 0) + {// 没有选择产品筛选条件 + sql = sql.replace("AND TYPE_ID = typeIdStr", "").replace("AND d.TYPE_ID = typeIdStr", ""); + } + else + {// 选择产品筛选条件 + sql = sql.replace("typeIdStr", String.valueOf(typeId)); + } + + int orgTimeoutSumNum = 0; + Map statMap = new HashMap(); + List statList = ORM.get(ZSQL.class).executeQuery(sql); + for (LinkedMapSO so : statList) + { + String orgName = String.valueOf(so.get("orgName")); + if (Validates.isEmpty(orgName)) + { + continue; + } + + orgTimeoutSumNum = Integer.valueOf(String.valueOf(so.get("orgTimeoutSumNum"))); + + statMap.put(orgName, String.valueOf(so.get("orgTimeoutProportion"))); + } + request.setAttribute("statMap", statMap); + request.setAttribute("statList", statList); + request.setAttribute("orgTimeoutSumNum", orgTimeoutSumNum); + } + else + {// 切换到组织时:左侧饼状图展示该组织超时/未超时占比饼状图 + StringBuilder sqlStr = new StringBuilder( + "SELECT if((SELECT org_name FROM zmr_org WHERE ORG_ID = design_order.ORG_ID) is null, (SELECT org_name FROM zmr_org WHERE ORG_ID = orgIdStr), (SELECT org_name FROM zmr_org WHERE ORG_ID = design_order.ORG_ID)) orgName, count(*) orgTimeoutNum, orgObj.orgOrdNum orgOrderNum,round( COUNT(*) / orgObj.orgOrdNum * 100, 2) orgTimeoutProportion"); + sqlStr.append( + " FROM design_order,( SELECT COUNT(*) orgOrdNum FROM design_order d WHERE d.CREATE_TIME >= 'startDateStr' AND d.CREATE_TIME <= 'endDateStr' AND d.TYPE_ID = typeIdStr AND d.ORG_ID = orgIdStr) orgObj"); + sqlStr.append( + " WHERE STATUS > 0 AND CREATE_TIME >= 'startDateStr' AND CREATE_TIME <= 'endDateStr' AND TYPE_ID = typeIdStr AND ORG_ID = orgIdStr AND DESIGNER IS NOT NULL AND DESIGN_BEGIN_TIME IS NOT NULL"); + sqlStr.append( + " AND DESIGN_BEGIN_TIME < SUBDATE(IF (`STATUS` >= 55,DESIGN_END_TIME,now()),INTERVAL (SELECT dt.EFFECTIVE_END_TIME FROM design_type dt WHERE dt.TYPE_ID = DESIGN_ORDER.TYPE_ID) MINUTE)"); + + String sql = sqlStr.toString().replace("startDateStr", startDate + " 00:00:00").replace("endDateStr", endDate + " 23:59:59").replace("orgIdStr", + String.valueOf(sessionUser.getSelectedOrgId())); + if (typeId <= 0) + {// 没有选择产品筛选条件 + sql = sql.replace("AND d.TYPE_ID = typeIdStr", "").replace("AND TYPE_ID = typeIdStr", ""); + } + else + {// 选择产品筛选条件 + sql = sql.replace("typeIdStr", String.valueOf(typeId)); + } + + int orgOrderNum = 0; + Map statMap = new HashMap(); + List statList = ORM.get(ZSQL.class).executeQuery(sql); + for (LinkedMapSO so : statList) + { + if (Validates.isEmpty(so.get("orgTimeoutProportion"))) + { + if (statList.size() == 1) + { + statList = new ArrayList(); + } + continue; + } + orgOrderNum = Integer.valueOf(String.valueOf(so.get("orgOrderNum"))); + + statMap.put("超时", String.valueOf(so.get("orgTimeoutProportion"))); + } + if (statMap.isEmpty()) + { + statMap.put("未超时", "0.0"); + } + else + { + statMap.put("未超时", String.valueOf(100 - Double.valueOf(statMap.get("超时")))); + } + request.setAttribute("statMap", statMap); + request.setAttribute("statList", statList); + request.setAttribute("orgOrderNum", orgOrderNum); + } + + request.setAttribute("sessionUser", sessionUser); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + request.setAttribute("typeId", typeId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/subscribe/SubscribeStatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/subscribe/SubscribeStatAction.java new file mode 100644 index 0000000..869e072 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/subscribe/SubscribeStatAction.java @@ -0,0 +1,201 @@ +package com.zhiqim.yangcai.design.action.stat.subscribe; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.dispatch.DesWorkSearchLog; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.subscribe.SubscribeDesignerQuotaRecord; +import com.zhiqim.yangcai.design.model.DesOnliceTimeLogModel; +import com.zhiqim.yangcai.design.model.SubscribeDesignerQuotaRecordModel; +import com.zhiqim.yangcai.design.service.DesOnliceTimeLogCallable; + +/** + * + * [简要描述]订单预约统计(组员):
            + * [详细描述]:
            + * + * @version 1.0 @author jiangfan 2020-09-03 新建与整理 + */ +public class SubscribeStatAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long operatorOrgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg zmrOrg = ORM.get(ZTable.class).item(ZmrOrg.class, operatorOrgId); + if (zmrOrg == null) + { + request.returnHistory("该组织不存在,请重新选择"); + return; + } + Integer dutyTime, year, month, currentDay; + if (request.getParameterInt("dutyTime") != -1) + { + dutyTime = request.getParameterInt("dutyTime"); + year = dutyTime / 10000; + month = (dutyTime - (year * 10000)) / 100; + currentDay = dutyTime - (year * 10000) - month * 100; + } + else + { + Calendar calendar = Calendar.getInstance(); + year = calendar.get(Calendar.YEAR); + month = calendar.get(Calendar.MONTH) + 1; + currentDay = calendar.get(Calendar.DAY_OF_MONTH); + } + String timeString = year + "-" + (month < 10 ? "0" + month : month) + "-" + (currentDay < 10 ? "0" + currentDay : currentDay); + Selector selector = new Selector(); + selector.addMust("operatorStatus", 0); + selector.addMust("orgId", operatorOrgId); + List zmrOperatorList = ORM.get(ZTable.class).list(ZmrOperator.class, selector); + int subscribeSum = 0; + int finishSum = 0; + int subscribeOperatorNum = 0; + List resultList = new ArrayList(); + for (ZmrOperator zmrOperator : zmrOperatorList) + { + selector = new Selector(); + selector.addMust("dutyTime", year * 10000 + (month) * 100 + currentDay); + selector.addMust("orgId", operatorOrgId); + selector.addMust("operatorCode", zmrOperator.getOperatorCode()); + List subscribeDesignerQuotaRecordList = ORM.get(ZTable.class).list(SubscribeDesignerQuotaRecord.class, selector); + SubscribeDesignerQuotaRecord subscribeDesignerQuotaRecord = null; + if (null != subscribeDesignerQuotaRecordList && subscribeDesignerQuotaRecordList.size() > 0) + { + subscribeDesignerQuotaRecord = subscribeDesignerQuotaRecordList.get(0); + } + else + { + subscribeDesignerQuotaRecord = new SubscribeDesignerQuotaRecord(); + subscribeDesignerQuotaRecord.setOperatorCode(zmrOperator.getOperatorCode()); + subscribeDesignerQuotaRecord.setSubscribeState(0); + subscribeDesignerQuotaRecord.setSubscribeNum(0); + subscribeDesignerQuotaRecord.setFinishedNum(0); + } + + if (subscribeDesignerQuotaRecord.getSubscribeState() == 2) + { + subscribeSum += subscribeDesignerQuotaRecord.getSubscribeNum(); + subscribeOperatorNum++; + } + finishSum += subscribeDesignerQuotaRecord.getFinishedNum(); + // 定稿数量 + selector = new Selector(); + selector.addMust("designer", subscribeDesignerQuotaRecord.getOperatorCode()); + + selector.addMaybeThenGE("designEndTime", Sqls.toTimestamp(timeString, "00:00:00")); + selector.addMaybeThenLE("designEndTime", Sqls.toTimestamp(timeString, "23:59:59")); + int dingGaoSum = ORM.get(ZTable.class).count(DesignOrder.class, selector); + subscribeDesignerQuotaRecord.setDingGaoSum(dingGaoSum); + + // 接单时长 + selector = new Selector(); + selector.addMaybe("operatorCode", subscribeDesignerQuotaRecord.getOperatorCode()); + selector.addMustThenGE("createTime", Sqls.toTimestamp(timeString, "00:00:00")); + selector.addMustThenLE("createTime", Sqls.toTimestamp(timeString, "23:59:59")); + selector.addMust("logType", 1);// 有开启接单记录 + selector.addGroupbyFields("operatorCode"); + + List logList = ORM.get(ZTable.class).list(DesWorkSearchLog.class, selector); + + List modelList = new ArrayList(); + int logSize = logList.size(); + if (logSize > 0) + { + // 创建一个线程池 + ExecutorService pool = Executors.newFixedThreadPool(2); + // 创建多个有返回值的任务 + List> futureList = new ArrayList>(); + for (int i = 0; i < logList.size(); i++) + { + Selector sel = new Selector(); + sel.addMust("operatorCode", logList.get(i).getOperatorCode()); + sel.addMustThenGE("createTime", Sqls.toTimestamp(timeString, "00:00:00")); + sel.addMustThenLE("createTime", Sqls.toTimestamp(timeString, "23:59:59")); + sel.addOrderbyAsc("createTime"); + Callable c = new DesOnliceTimeLogCallable(sel); + Future f = pool.submit(c); + futureList.add(f); + } + pool.shutdown(); + for (Future f : futureList) + { + DesOnliceTimeLogModel model = (DesOnliceTimeLogModel) f.get(); + modelList.add(model); + } + } + int jieDanOnlineTime = 0; + for (DesOnliceTimeLogModel desOnliceTimeLogModel : modelList) + { + jieDanOnlineTime += desOnliceTimeLogModel.getOnlineTime(); + } + subscribeDesignerQuotaRecord.setJieDanOnlineTime(jieDanOnlineTime); + resultList.add(subscribeDesignerQuotaRecord); + } + request.setAttribute("currentOrgName", zmrOrg.getOrgName()); + request.setAttribute("operatorNum", zmrOperatorList.size()); + request.setAttribute("subscribeOperatorNum", subscribeOperatorNum); + request.setAttribute("subscribeSum", subscribeSum); + request.setAttribute("finishSum", finishSum); + request.setAttribute("subscribeDesignerQuotaRecordList", resultList); + + // 准备日历 + int prevYear = month == 1 ? year - 1 : year; + int prevMonth = month == 1 ? 12 : month - 1; + int nextYear = month == 12 ? year + 1 : year; + int nextMonth = month == 12 ? 1 : month + 1; + List list = new ArrayList(); + int firstWeek = DateTimes.getDateWeek7(year, month, 1); + int curMonthMaxDay = DateTimes.getMonthDays(year, month); + int prevMonthMaxDay = DateTimes.getMonthDays(prevYear, prevMonth); + for (int i = 1; i <= firstWeek; i++) + { + int day = prevMonthMaxDay - firstWeek + i; + + SubscribeDesignerQuotaRecordModel date = new SubscribeDesignerQuotaRecordModel(); + date.setDutyTime(prevYear, prevMonth, day); + date.setDutyMonth("prevMonth"); + list.add(date); + } + for (int i = firstWeek + 1; i < firstWeek + 1 + curMonthMaxDay; i++) + { + int day = i - firstWeek; + + SubscribeDesignerQuotaRecordModel date = new SubscribeDesignerQuotaRecordModel(); + date.setDutyTime(year, month, day); + date.setDutyMonth("currMonth"); + list.add(date); + } + for (int i = firstWeek + 1 + curMonthMaxDay; i <= 42; i++) + { + int day = i - curMonthMaxDay - firstWeek; + + SubscribeDesignerQuotaRecordModel date = new SubscribeDesignerQuotaRecordModel(); + date.setDutyTime(nextYear, nextMonth, day); + date.setDutyMonth("nextMonth"); + list.add(date); + } + int today = DateTimes.getCurrentDate(); + request.setAttribute("today", today); + request.setAttribute("selectedDay", year * 10000 + (month) * 100 + currentDay); + request.setAttribute("list", list); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/subscribe/SubscribeStatAllAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/subscribe/SubscribeStatAllAction.java new file mode 100644 index 0000000..fadbcee --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/stat/subscribe/SubscribeStatAllAction.java @@ -0,0 +1,168 @@ +package com.zhiqim.yangcai.design.action.stat.subscribe; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Maths; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.subscribe.SubscribeDesignerQuotaRecord; +import com.zhiqim.yangcai.design.model.SubscribeDesignerQuotaRecordModel; +import com.zhiqim.yangcai.design.model.ZmrOrgModel; + +/** + * + * [简要描述]订单预约统计(组织):
            + * [详细描述]:
            + * + * @version 1.0 @author jiangfan 2020-09-03 新建与整理 + */ +public class SubscribeStatAllAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + Selector selector = new Selector(); + selector.addMust("orgStatus", 0); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector); + Integer dutyTime, year, month, currentDay; + if (request.getParameterInt("dutyTime") != -1) + { + dutyTime = request.getParameterInt("dutyTime"); + year = dutyTime / 10000; + month = (dutyTime - (year * 10000)) / 100; + currentDay = dutyTime - (year * 10000) - month * 100; + } + else + { + Calendar calendar = Calendar.getInstance(); + year = calendar.get(Calendar.YEAR); + month = calendar.get(Calendar.MONTH) + 1; + currentDay = calendar.get(Calendar.DAY_OF_MONTH); + } + // String timeString = year + "-" + (month < 10 ? "0" + month : month) + "-" + (currentDay < + // 10 ? "0" + currentDay : currentDay); + int allSubscribeOperatorNum = 0; + int allSubscribeSum = 0; + int allFinishSum = 0; + int allDingGaoSum = 0; + List zmrOrgModelList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + ZmrOrgModel zmrOrgModel = new ZmrOrgModel(); + zmrOrgModel.setOrgId(zmrOrg.getOrgId()); + zmrOrgModel.setOrgName(zmrOrg.getOrgName()); + selector = new Selector(); + selector.addMust("operatorStatus", 0); + selector.addMust("orgId", zmrOrg.getOrgId()); + List zmrOperatorList = ORM.get(ZTable.class).list(ZmrOperator.class, selector); + zmrOrgModel.setOperatorNum(zmrOperatorList.size()); + + selector = new Selector(); + selector.addMust("dutyTime", year * 10000 + (month) * 100 + currentDay); + selector.addMust("orgId", zmrOrg.getOrgId()); + List subscribeDesignerQuotaRecordList = ORM.get(ZTable.class).list(SubscribeDesignerQuotaRecord.class, selector); + + int subscribeSum = 0; + int finishSum = 0; + int subscribeOperatorNum = 0; + for (SubscribeDesignerQuotaRecord subscribeDesignerQuotaRecord : subscribeDesignerQuotaRecordList) + { + if (subscribeDesignerQuotaRecord.getSubscribeState() == 2) + { + subscribeSum += subscribeDesignerQuotaRecord.getSubscribeNum(); + subscribeOperatorNum++; + } + finishSum += subscribeDesignerQuotaRecord.getFinishedNum(); + } + zmrOrgModel.setSubscribeOperatorNum(subscribeOperatorNum); + allSubscribeOperatorNum += subscribeOperatorNum; + String finishedRate = "0"; + zmrOrgModel.setSubscribeSum(subscribeSum); + zmrOrgModel.setFinishSum(finishSum); + if (subscribeSum != 0) + { + if (finishSum > subscribeSum) + { + finishedRate = "100"; + } + else + { + finishedRate = Maths.division(finishSum * 100, subscribeSum, 2); + } + } + else + { + finishedRate = "0"; + } + zmrOrgModel.setFinishRate(finishedRate); + allSubscribeSum += subscribeSum; + allFinishSum += finishSum; + + // // 定稿数量 + // selector = new Selector(); + // selector.addMust("orgId", zmrOrg.getOrgId()); + // selector.addMaybeThenGE("designEndTime", Sqls.toTimestamp(timeString, "00:00:00")); + // selector.addMaybeThenLE("designEndTime", Sqls.toTimestamp(timeString, "23:59:59")); + // int dingGaoSum = ORM.get(ZTable.class).count(DesignOrder.class, selector); + // zmrOrgModel.setDingGaoSum(dingGaoSum); + // allDingGaoSum += dingGaoSum; + + zmrOrgModelList.add(zmrOrgModel); + } + request.setAttribute("allSubscribeOperatorNum", allSubscribeOperatorNum); + request.setAttribute("allSubscribeSum", allSubscribeSum); + request.setAttribute("allFinishSum", allFinishSum); + request.setAttribute("allDingGaoSum", allDingGaoSum); + request.setAttribute("zmrOrgModelList", zmrOrgModelList); + + // 准备日历 + int prevYear = month == 1 ? year - 1 : year; + int prevMonth = month == 1 ? 12 : month - 1; + int nextYear = month == 12 ? year + 1 : year; + int nextMonth = month == 12 ? 1 : month + 1; + List list = new ArrayList(); + int firstWeek = DateTimes.getDateWeek7(year, month, 1); + int curMonthMaxDay = DateTimes.getMonthDays(year, month); + int prevMonthMaxDay = DateTimes.getMonthDays(prevYear, prevMonth); + for (int i = 1; i <= firstWeek; i++) + { + int day = prevMonthMaxDay - firstWeek + i; + + SubscribeDesignerQuotaRecordModel date = new SubscribeDesignerQuotaRecordModel(); + date.setDutyTime(prevYear, prevMonth, day); + date.setDutyMonth("prevMonth"); + list.add(date); + } + for (int i = firstWeek + 1; i < firstWeek + 1 + curMonthMaxDay; i++) + { + int day = i - firstWeek; + + SubscribeDesignerQuotaRecordModel date = new SubscribeDesignerQuotaRecordModel(); + date.setDutyTime(year, month, day); + date.setDutyMonth("currMonth"); + list.add(date); + } + for (int i = firstWeek + 1 + curMonthMaxDay; i <= 42; i++) + { + int day = i - curMonthMaxDay - firstWeek; + + SubscribeDesignerQuotaRecordModel date = new SubscribeDesignerQuotaRecordModel(); + date.setDutyTime(nextYear, nextMonth, day); + date.setDutyMonth("nextMonth"); + list.add(date); + } + int today = DateTimes.getCurrentDate(); + request.setAttribute("today", today); + request.setAttribute("selectedDay", year * 10000 + (month) * 100 + currentDay); + request.setAttribute("list", list); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/subscribe/DesignerSubscribeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/subscribe/DesignerSubscribeAction.java new file mode 100644 index 0000000..717db82 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/subscribe/DesignerSubscribeAction.java @@ -0,0 +1,248 @@ +package com.zhiqim.yangcai.design.action.subscribe; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.subscribe.SubscribeDesignerQuotaRecord; +import com.zhiqim.yangcai.design.model.SubscribeDesignerQuotaRecordModel; + +public class DesignerSubscribeAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + boolean isPrev = request.getParameterBoolean("prev"); + boolean isNext = request.getParameterBoolean("next"); + boolean isCurr = request.getParameterBoolean("curr"); + String operatorCode = request.getSessionName(); + Calendar calendar = Calendar.getInstance(); + int year = calendar.get(Calendar.YEAR); + int month = calendar.get(Calendar.MONTH) + 1; + if (isCurr) + { + + } + else if (isPrev) + { + year = request.getParameterInt("year", DateTimes.getCurrentYear()); + month = request.getParameterInt("month", DateTimes.getCurrentMonth()); + String type = request.getParameter("type"); + if ("year".equals(type)) + { + year = year - 1; + } + else + { + year = month == 1 ? year - 1 : year; + month = month == 1 ? 12 : month - 1; + } + + } + else if (isNext) + { + year = request.getParameterInt("year", DateTimes.getCurrentYear()); + month = request.getParameterInt("month", DateTimes.getCurrentMonth()); + String type = request.getParameter("type"); + if ("year".equals(type)) + { + year = year + 1; + } + else + { + year = month == 12 ? year + 1 : year; + month = month == 12 ? 1 : month + 1; + } + } + int today = DateTimes.getCurrentDate(); + request.setAttribute("today", today); + request.setAttribute("hour", DateTimes.getCurrentHour()); + request.setAttribute("year", Integer.valueOf(year)); + request.setAttribute("month", Integer.valueOf(month)); + request.setAttribute("operatorCode", operatorCode); + + Calendar cal = Calendar.getInstance();// 使用默认时区和语言环境获得一个日历。 + cal.add(Calendar.DAY_OF_MONTH, +7);// 取当前日期的后一天. + Integer afterToday7 = Integer.valueOf(DateTimes.toDateTimeString(cal.getTime(), "yyyyMMdd")); + + int prevYear = month == 1 ? year - 1 : year; + int prevMonth = month == 1 ? 12 : month - 1; + int nextYear = month == 12 ? year + 1 : year; + int nextMonth = month == 12 ? 1 : month + 1; + request.setAttribute("designerLever", "--"); + + Selector selector = new Selector(); + selector.addMustThenG("dutyTime", Integer.valueOf(prevYear * 10000 + prevMonth * 100)); + selector.addMustThenL("dutyTime", Integer.valueOf(nextYear * 10000 + (nextMonth + 1) * 100)); + selector.addMust("operatorCode", operatorCode); + List subscribeDesignerQuotaRecordList = ORM.get(ZTable.class, request).list(SubscribeDesignerQuotaRecord.class, selector); + Map recordMap = new HashMap(57); + for (SubscribeDesignerQuotaRecord subscribeDesignerQuotaRecord : subscribeDesignerQuotaRecordList) + { + recordMap.put(subscribeDesignerQuotaRecord.getDutyTime(), subscribeDesignerQuotaRecord); + } + + List list = new ArrayList(); + + int firstWeek = DateTimes.getDateWeek7(year, month, 1); + int curMonthMaxDay = DateTimes.getMonthDays(year, month); + int prevMonthMaxDay = DateTimes.getMonthDays(prevYear, prevMonth); + for (int i = 1; i <= firstWeek; i++) + { + int day = prevMonthMaxDay - firstWeek + i; + + SubscribeDesignerQuotaRecordModel subscribeDesignerQuotaRecordModel = new SubscribeDesignerQuotaRecordModel(); + subscribeDesignerQuotaRecordModel.setDutyTime(prevYear, prevMonth, day); + subscribeDesignerQuotaRecordModel.setDutyMonth("prevMonth"); + setCalendarDay(recordMap, subscribeDesignerQuotaRecordModel, today); + list.add(subscribeDesignerQuotaRecordModel); + } + for (int i = firstWeek + 1; i < firstWeek + 1 + curMonthMaxDay; i++) + { + int day = i - firstWeek; + + SubscribeDesignerQuotaRecordModel subscribeDesignerQuotaRecordModel = new SubscribeDesignerQuotaRecordModel(); + subscribeDesignerQuotaRecordModel.setDutyTime(year, month, day); + subscribeDesignerQuotaRecordModel.setDutyMonth("currMonth"); + if (subscribeDesignerQuotaRecordModel.getDutyTime() <= afterToday7) + { + subscribeDesignerQuotaRecordModel.setCanSubscribe(1); + } + else + { + subscribeDesignerQuotaRecordModel.setCanSubscribe(0); + } + setCalendarDay(recordMap, subscribeDesignerQuotaRecordModel, today); + list.add(subscribeDesignerQuotaRecordModel); + } + for (int i = firstWeek + 1 + curMonthMaxDay; i <= 42; i++) + { + int day = i - curMonthMaxDay - firstWeek; + + SubscribeDesignerQuotaRecordModel subscribeDesignerQuotaRecordModel = new SubscribeDesignerQuotaRecordModel(); + subscribeDesignerQuotaRecordModel.setDutyTime(nextYear, nextMonth, day); + subscribeDesignerQuotaRecordModel.setDutyMonth("nextMonth"); + if (subscribeDesignerQuotaRecordModel.getDutyTime() <= afterToday7) + { + subscribeDesignerQuotaRecordModel.setCanSubscribe(1); + } + else + { + subscribeDesignerQuotaRecordModel.setCanSubscribe(0); + } + setCalendarDay(recordMap, subscribeDesignerQuotaRecordModel, today); + list.add(subscribeDesignerQuotaRecordModel); + } + request.setAttribute("list", list); + + // 准备近20次数据 + int sumFinishedNum20 = 0; // 近20次总接单量 + int currSubscribeDay20 = 0; // 近20次预约天数 + int currSubscribeOkDay20 = 0;// 近20次预约达标天数 + + selector = new Selector(); + // selector.addMustThenG("dutyTime", getLastDateInt(-20)); + selector.addMustThenL("dutyTime", today); + selector.addMust("operatorCode", operatorCode); + selector.addMust("subscribeState", 2); + selector.addOrderbyDesc("dutyTime"); + + PageResult pageResult = ORM.get(ZTable.class).page(SubscribeDesignerQuotaRecord.class, 1, 20, selector); + if (null != pageResult && null != pageResult.list() && pageResult.list().size() > 0) + { + for (SubscribeDesignerQuotaRecord subscribeDesignerQuotaRecord : pageResult.list()) + { + currSubscribeDay20++; + if (subscribeDesignerQuotaRecord.getFinishedNum() != 0 + && subscribeDesignerQuotaRecord.getFinishedNum() >= subscribeDesignerQuotaRecord.getSubscribeNum()) + { + currSubscribeOkDay20++; + } + sumFinishedNum20 = sumFinishedNum20 + subscribeDesignerQuotaRecord.getFinishedNum(); + } + + request.setAttribute("sumFinishedNum20", sumFinishedNum20); + double avgFinishedNum20 = new BigDecimal(sumFinishedNum20).divide(new BigDecimal(currSubscribeDay20), 2, RoundingMode.HALF_UP).doubleValue(); + request.setAttribute("avgFinishedNum20", avgFinishedNum20); + Double okRate20 = Double.valueOf(okPercent(currSubscribeOkDay20, currSubscribeDay20)); + request.setAttribute("okRate20", okRate20.toString() + '%'); + + // ZmrParam zmrParamZhiShu = ORM.get(ZTable.class).item(ZmrParam.class, + // new Selector("paramGroup", "subscribe.config").addMust("paramKey", + // "subscribeIndex")); + // Double maxQuota = avgFinishedNum20 * Double.valueOf(zmrParamZhiShu.getParamValue()) * + // (okRate20 / 100); + // maxQuota.intValue() == 0 ? 1 :// maxQuota.intValue() + request.setAttribute("maxQuota", 100); + } + else + { + request.setAttribute("sumFinishedNum20", "--"); + request.setAttribute("avgFinishedNum20", "--"); + request.setAttribute("okRate20", "--"); + request.setAttribute("maxQuota", 100); + } + } + + /** + * + * 达成率计算 + * + * @param currSubscribeOkDay20 预约达成天数 + * @param currSubscribeDay20 预约天数 + * @return + */ + private String okPercent(int currSubscribeOkDay20, int currSubscribeDay20) + { + if (currSubscribeDay20 == 0) + { + return "0"; + } + double percent = new BigDecimal(currSubscribeOkDay20 * 100 + "").divide(new BigDecimal(currSubscribeDay20 + ""), 2, RoundingMode.HALF_UP).doubleValue(); + return percent + ""; + } + + private void setCalendarDay(Map recordMap, SubscribeDesignerQuotaRecordModel subscribeDesignerQuotaRecordModel, + int today) + { + // 默认未预约 + subscribeDesignerQuotaRecordModel.setSubscribeState(1); + SubscribeDesignerQuotaRecord record = recordMap.get(subscribeDesignerQuotaRecordModel.getDutyTime()); + if (record != null) + { + Objects.copyDeep(record, subscribeDesignerQuotaRecordModel); + } + } + + /** + * 获取前几日的值 + * + * @param day + * + * @return yyyyMMdd格式的int型值 + */ + public static int getLastDateInt(int day) + { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DATE, day); // 得到前几天 + Date date = calendar.getTime(); + DateFormat df = new SimpleDateFormat("yyyyMMdd"); + return Integer.valueOf(df.format(date)); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/subscribe/SubscribeOrgTempQuotaAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/subscribe/SubscribeOrgTempQuotaAction.java new file mode 100644 index 0000000..9e8259f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/subscribe/SubscribeOrgTempQuotaAction.java @@ -0,0 +1,138 @@ +package com.zhiqim.yangcai.design.action.subscribe; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dbo.subscribe.SubscribeOrgTempQuota; + +/** + * 预约-组织临时额度配置 + * + * @version v1.0.0 @author yixin 2020年9月1日 新建与整理 + */ +public class SubscribeOrgTempQuotaAction extends StdSwitchAction +{ + + @Override + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("orgId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = 20; + + Selector selector = new Selector(); + selector.addMaybe("operatorStatus", request.getParameterInt("operatorStatus")); + selector.addMaybeLike("operatorCode", request.getParameter("operatorCode")); + + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + if (orgId > 0) + { + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org != null && org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + } + } + + PageResult pageResult = ORM.get(ZTable.class).page(SubscribeOrgTempQuota.class, page, pageSize, selector); + List orgList = OperatorDao.getOperatorOrgList(request, request.getSessionName(), false); + request.setAttribute("orgList", orgList); + request.setAttribute("pageResult", pageResult); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + List orgList = OperatorDao.getOperatorOrgList(request, request.getSessionName(), false); + List result = new ArrayList(); + if (null != orgList) + { + for (ZmrOrg zmrOrg : orgList) + { + if (zmrOrg.getOrgStatus() == 0) + { + result.add(zmrOrg); + } + } + } + request.setAttribute("orgList", result); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + SubscribeOrgTempQuota subscribeOrgTempQuota = ORM.get(ZTable.class).item(SubscribeOrgTempQuota.class, new Selector("orgId", orgId)); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, new Selector("orgId", orgId)); + request.setAttribute("subscribeOrgTempQuota", subscribeOrgTempQuota); + request.setAttribute("org", org); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + int count = ORM.get(ZTable.class).count(SubscribeOrgTempQuota.class, new Selector("orgId", orgId)); + if (count > 0) + { + request.returnHistory("已有该组织临时额度配置"); + return; + } + int tempQuota = request.getParameterInt("tempQuota"); + + SubscribeOrgTempQuota subscribeOrgTempQuota = new SubscribeOrgTempQuota(); + subscribeOrgTempQuota.setOrgId(orgId); + subscribeOrgTempQuota.setTempQuota(tempQuota); + subscribeOrgTempQuota.setSafeLine(0); + subscribeOrgTempQuota.setCreateTime(Sqls.nowTimestamp()); + subscribeOrgTempQuota.setState(1); + ORM.get(ZTable.class).insert(subscribeOrgTempQuota); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + int tempQuota = request.getParameterInt("tempQuota"); + + Updater updater = new Updater(); + updater.addMust("orgId", orgId); + updater.addField("tempQuota", tempQuota); + updater.addField("modifyTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(SubscribeOrgTempQuota.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + ORM.get(ZTable.class).delete(SubscribeOrgTempQuota.class, orgId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/AfterPicTypeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/AfterPicTypeAction.java new file mode 100644 index 0000000..1de6e74 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/AfterPicTypeAction.java @@ -0,0 +1,97 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.onex.IsNumeric; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.design.AfterPicType; + +/**** + * 售后责任类型 + * + * @version v1.0.0 @author longguizhi 2018-12-15 新建与整理 + */ +public class AfterPicTypeAction extends StdSwitchAction +{ + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNumeric("picType", "请选择一个选项")); + } + + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsLen("picTypeName","责任归属名称不能为空且不能超过64个字符",1,64)); + } + + public void list(HttpRequest request) throws Exception + { + List dataList = ORM.get(ZTable.class).list(AfterPicType.class); + request.setAttribute("dataList", dataList); + } + + public void add(HttpRequest request) throws Exception + { + } + + public void modify(HttpRequest request) throws Exception + { + AfterPicType pic = ORM.get(ZTable.class).item(AfterPicType.class, request.getParameterLong("picType")); + if (pic == null) + { + request.returnHistory("数据不存在, 请稍后重试!"); + return; + } + request.setAttribute("pic", pic); + } + + @AnTransaction + protected void insert(HttpRequest request) throws Exception + { + AfterPicType data = request.getParameter(AfterPicType.class); + data.setPicType(Ids.longId()); + ORM.get(ZTable.class).insert(data); + } + + @AnTransaction + protected void update(HttpRequest request) throws Exception + { + AfterPicType data = request.getParameter(AfterPicType.class); + if (!Validates.isNumeric(request.getParameter("picType"))) + { + request.returnHistory("无效参数编号, 请稍后重试!"); + return; + } + + Updater update = new Updater(); + update.addMust("picType", data.getPicType()); + update.addField("picTypeName", data.getPicTypeName()); + update.addField("picStatus", data.getPicStatus()); + + ORM.get(ZTable.class).update(AfterPicType.class, update); + } + + protected void delete(HttpRequest request) throws Exception + { + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/AfterProblemTypeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/AfterProblemTypeAction.java new file mode 100644 index 0000000..b939db2 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/AfterProblemTypeAction.java @@ -0,0 +1,118 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNumericLen; +import org.zhiqim.httpd.validate.onex.IsNumeric; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.design.AfterPicType; +import com.zhiqim.yangcai.design.dbo.design.AfterProblemType; + + +/**** + * 售后责任类型 + * + * @version v1.0.0 @author longguizhi 2018-12-15 新建与整理 + */ +public class AfterProblemTypeAction extends StdSwitchAction +{ + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNumeric("problemType", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsNumericLen("picType", "请选择责任归属", 1, 20)); + request.addValidate(new IsLen("problemName","问题类型名称不能为空且不能超过100个字符",1,64)); + } + + public void list(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page"); + pageNo = pageNo <= 0 ? 1 : pageNo; + Selector selector = new Selector().addOrderbyAsc("picType,problemType"); + selector.addMaybe("picType", request.getParameterLong("picType")); + PageResult pageResult= ORM.get(ZTable.class).page(AfterProblemType.class, 1, 20, selector); + request.setAttribute("pageResult", pageResult); + + Map picNameMap = new HashMap(); + List picList = ORM.get(ZTable.class).list(AfterPicType.class); + for (AfterPicType pic : picList) + picNameMap.put(pic.getPicType(), pic.getPicTypeName()); + + request.setAttribute("picNameMap", picNameMap); + } + + public void add(HttpRequest request) throws Exception + { + List picList = ORM.get(ZTable.class).list(AfterPicType.class); + request.setAttribute("picList", picList); + } + + public void modify(HttpRequest request) throws Exception + { + List picList = ORM.get(ZTable.class).list(AfterPicType.class); + request.setAttribute("picList", picList); + + AfterProblemType problem = ORM.get(ZTable.class).item(AfterProblemType.class, request.getParameterLong("problemType")); + request.setAttribute("problem", problem); + } + + @AnTransaction + protected void insert(HttpRequest request) throws Exception + { + AfterProblemType data = request.getParameter(AfterProblemType.class); + data.setProblemType(Ids.longId()); + ORM.get(ZTable.class).insert(data); + } + + @AnTransaction + protected void update(HttpRequest request) throws Exception + { + AfterProblemType data = request.getParameter(AfterProblemType.class); + if (!Validates.isNumeric(request.getParameter("problemType"))) + { + request.returnHistory("无效参数编号, 请稍后重试!"); + return; + } + + Updater update = new Updater(); + update.addMust("problemType", data.getProblemType()); + update.addField("picType", data.getPicType()); + update.addField("problemName", data.getProblemName()); + update.addField("problemStatus", data.getProblemStatus()); + ORM.get(ZTable.class).update(AfterProblemType.class, update); + } + + @AnTransaction + protected void delete(HttpRequest request) throws Exception + { + ORM.get(ZTable.class).delete(AfterProblemType.class, request.getParameterLong("problemType")); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/ApiInvokeLogAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/ApiInvokeLogAction.java new file mode 100644 index 0000000..71c48cd --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/ApiInvokeLogAction.java @@ -0,0 +1,107 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sys; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.api.ApiInvokeLog; +import com.zhiqim.yangcai.design.server.DesignController; + +/*** + *api 调用日志 + * @version v1.0.0 @author lgz 2019-1-12 新建与整理 + */ +public class ApiInvokeLogAction extends StdSwitchAction +{ + + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("invokeLogId", "请选择一个选项")); + } + + protected void validateForm(HttpRequest request) throws Exception + { + } + + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + page = page <= 0 ? 1 : page; + int pageSize = request.getContextAttributeInt("pageSize", 20); + + String remoteIp = request.getParameter("remoteIp"); //2.用户IP地址 + String remoteUser = request.getParameter("remoteUser"); //3.用户名 没有用户 名时填写IP地址 + String apiName = request.getParameter("apiName"); //4.调用接口名 + int statusCode = request.getParameterInt("statusCode"); //5.调用状态 0 = 成功,1=失败 + String invokeMessage = request.getParameter("invokeMessage"); + invokeMessage = Validates.isEmptyBlank(invokeMessage) ? null : Strings.trim(invokeMessage); + String startTime = request.getParameter("startTime", DateTimes.getPreviousDateTimeStringByHour(1)); + String endTime = request.getParameter("endTime", DateTimes.getDateTimeString()); + startTime = Validates.isDateTime(startTime) ? startTime : DateTimes.getPreviousDateTimeStringByHour(1); + endTime = Validates.isDateTime(endTime) ? endTime : DateTimes.getDateTimeString(); + + Selector selector = new Selector(); + selector.addMaybe("remoteIp", remoteIp); + selector.addMaybe("remoteUser", remoteUser); + selector.addMaybe("apiName", apiName); + if (statusCode > 0) + selector.addMaybe("statusCode", statusCode); + else + selector.addMustThenG("statusCode", 0); + selector.addMaybeLike("invokeMessage", invokeMessage); + selector.addMustThenGE("createTime", Sqls.toTimestamp(startTime)); + selector.addMustThenLE("createTime", Sqls.toTimestamp(endTime)); + selector.addOrderbyDesc("createTime"); + PageResult pageResult = ORM.get(ZTable.class).page(ApiInvokeLog.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + request.setAttribute("startTime", startTime); + request.setAttribute("endTime", endTime); + request.setAttribute("apiList", DesignController.getApiList()); + } + + protected void add(HttpRequest request) throws Exception + { + + } + + protected void modify(HttpRequest request) throws Exception + { + + } + + protected void insert(HttpRequest request) throws Exception + { + } + + protected void update(HttpRequest request) throws Exception + { + } + + protected void delete(HttpRequest request) throws Exception + { + long invokeLogId = request.getParameterLong("invokeLogId"); + invokeLogId = invokeLogId < 0 ? 0 : invokeLogId; + ORM.get(ZTable.class).delete(ApiInvokeLog.class, invokeLogId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/CheckBackReasonAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/CheckBackReasonAction.java new file mode 100644 index 0000000..ac8430e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/CheckBackReasonAction.java @@ -0,0 +1,186 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.stat.CheckBackReason; +import com.zhiqim.yangcai.design.dbo.utils.BaseUtil; + +/** + * + * 印前原因预录 + * + * @version 1.0 @author gjx 2019-9-16 新建与整理 + */ +public class CheckBackReasonAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long catId = request.getParameterLong("reasonCatId"); + Map> reasonMap = new HashMap>(); + List catList = new ArrayList(); + List tresaonList = ORM.get(ZTable.class).list(CheckBackReason.class, new Selector().addOrderbyAsc("reasonParent,reasonId")); + for (CheckBackReason reason : tresaonList) + { + + if (reason.isReasonType()) + { + catList.add(reason); + } + else + { + List list = reasonMap.get(reason.getReasonParent()); + list = list != null ? list : new ArrayList(); + list.add(reason); + reasonMap.put(reason.getReasonParent(), list); + } + } + + if (catId <= 0) + { + catId = 0; + if (catList.size() > 0) + { + catId = catList.get(0).getReasonId(); + } + } + + List reasonList = reasonMap.get(catId); + request.setAttribute("catList", catList); + request.setAttribute("catId", catId); + request.setAttribute("reasonList", reasonList != null ? reasonList : new ArrayList<>()); + } + + @AnTransaction + public void insert(HttpRequest request) throws Exception + { + CheckBackReason data = request.getParameter(CheckBackReason.class); + data.setReasonId(Ids.longId()); + if (data.isReasonType()) + { + if (Validates.isEmptyBlank(data.getReasonText()) || data.getReasonText().length() > 32) + { + request.setResponseError("原因分类 不能为空 且不能超过32字符"); + return; + } + + } + else + {// 原因项 + long parentId = data.getReasonParent(); + parentId = parentId <= 0 ? 0 : parentId; + + CheckBackReason parent = ORM.get(ZTable.class).item(CheckBackReason.class, parentId); + if (parent == null) + { + request.setResponseError("未知原因分类"); + return; + } + + if (data.isReasonType() && Validates.isEmptyBlank(data.getReasonText()) || data.getReasonText().length() > 32) + { + request.setResponseError("原因项 不能为空 且不能超过32字符"); + return; + } + } + + data.setReasonText(BaseUtil.removeBlank(data.getReasonText())); + ORM.get(ZTable.class).replace(data); + } + + @AnTransaction + public void update(HttpRequest request) throws Exception + { + CheckBackReason data = request.getParameter(CheckBackReason.class); + long reasonId = data.getReasonId(); + reasonId = reasonId <= 0 ? 0 : reasonId; + CheckBackReason reason = ORM.get(ZTable.class).item(CheckBackReason.class, reasonId); + if (reason == null) + { + request.setResponseError("未知原因"); + return; + } + + long parentId = data.getReasonParent(); + parentId = parentId <= 0 ? 0 : parentId; + + CheckBackReason parent = ORM.get(ZTable.class).item(CheckBackReason.class, parentId); + if (parent == null) + { + request.setResponseError("未知原因分类"); + return; + } + + if (data.isReasonType() && Validates.isEmptyBlank(data.getReasonText()) || data.getReasonText().length() > 32) + { + request.setResponseError("原因项 不能为空 且不能超过32字符"); + return; + } + data.setReasonText(BaseUtil.removeBlank(data.getReasonText())); + ORM.get(ZTable.class).replace(data); + } + + public void beforeDelete(HttpRequest request) throws Exception + { + long reasonId = request.getParameterLong("reasonId"); + CheckBackReason reason = ORM.get(ZTable.class).item(CheckBackReason.class, new Selector().addMaybe("reasonId", reasonId)); + if (reason == null) + { + request.setResponseError("预录原因不存在"); + return; + } + List reasonList = ORM.get(ZTable.class).list(CheckBackReason.class, new Selector().addMust("reasonParent", reason.getReasonParent())); + + boolean returnContent = false; + if (reasonList.size() == 1) + { + returnContent = true; + } + + request.setResponseResult(Jsons.toString(returnContent)); + } + + @AnTransaction + public void delete(HttpRequest request) throws Exception + { + long reasonId = request.getParameterLong("reasonId"); + CheckBackReason reason = ORM.get(ZTable.class).item(CheckBackReason.class, new Selector().addMaybe("reasonId", reasonId)); + if (reason == null) + { + request.setResponseError("预录原因不存在"); + return; + } + + List reasonList = ORM.get(ZTable.class).list(CheckBackReason.class, new Selector().addMust("reasonParent", reason.getReasonParent())); + if (reasonList.size() == 1) + { + ORM.get(ZTable.class).delete(CheckBackReason.class, reason.getReasonParent()); + } + ORM.get(ZTable.class).delete(CheckBackReason.class, reasonId); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DeptTeamAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DeptTeamAction.java new file mode 100644 index 0000000..82db614 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DeptTeamAction.java @@ -0,0 +1,69 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.dbo.Selector; + +/** + * 部门操作员选择器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class DeptTeamAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + Selector selector = new Selector(); + + // 获取部门下未关联的所有操作员,管理员除外 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (sessionUser.isAdmin()) + {// 管理员可以看到管理员和操作员 + selector.addMustThenG("operatorType", 0); + } + else + {// 操作员只能查操作员 + selector.addMustThenG("operatorType", 1); + } + + String operatorKey = request.getParameter("operatorKey"); + if (Validates.isNotEmpty(operatorKey)) + {// 条件 + selector.addOr(new Selector().addMaybeLike("operatorCode", operatorKey).addMaybeLike("operatorName", operatorKey)); + } + selector.addMaybe("operatorStatus", request.getParameterInt("operatorStatus")); + selector.addOrderbyAsc("operatorType"); + selector.addOrderbyAsc("operatorStatus"); + selector.addOrderbyAsc("operatorCreated"); + + List operatorList = ZmrBootstrap.tableOpr(request).list(ZmrOperator.class, selector); + + + request.setAttribute("operatorList", operatorList); + } +} \ No newline at end of file diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignGroupAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignGroupAction.java new file mode 100644 index 0000000..6433068 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignGroupAction.java @@ -0,0 +1,292 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sys; + + +import java.util.HashMap; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.stat.DesignGroup; +import com.zhiqim.yangcai.design.dbo.stat.GroupMembers; + +public class DesignGroupAction extends StdSwitchAction +{ + + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("groupId", "请选择一个选项")); + } + + protected void validateForm(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("groupName", "组名不能为空")); + request.addValidate(new IsNotEmpty("groupLeader", "请添加组长")); + request.addValidate(new IsNotEmpty("groupLeader", "排序只能为数字")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt("page.size", 15); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + + Selector sel = new Selector(); + if (ZmrOrgDao.getOrgRootId(request) != orgId) + sel.addMust("orgId", orgId); + + + sel.addOrderbyAsc("orgId,groupSeq"); + PageResult pageResult = ORM.get(ZTable.class).page(DesignGroup.class, page, pageSize, sel); + Map nextLeaderMap = new HashMap<>(); + Map currLeaderMap = new HashMap<>(); +// GroupMembers + for (DesignGroup group : pageResult.list()) + { + //查询下月组长做显示 + Selector sel1 = new Selector("groupId", group.getGroupId()); + sel1.addMust("isGroupLeader", 1); + sel1.addMustThenGE("startDate", DateTimes.getNextMonthFirstDay()); + sel1.addOrderbyDesc("startDate"); + GroupMembers nextLeader = ORM.get(ZTable.class).item(GroupMembers.class, sel1); + if (nextLeader != null) + nextLeaderMap.put(Strings.valueOf(group.getGroupId()), nextLeader); + + Selector sel2 = new Selector("groupId", group.getGroupId()); + sel2.addMust("isGroupLeader", 1); + sel2.addMustThenL("startDate", DateTimes.getNextMonthFirstDay()); + sel2.addOrderbyDesc("startDate"); + GroupMembers currLeader = ORM.get(ZTable.class).item(GroupMembers.class, sel2); + if (currLeader != null) + currLeaderMap.put(Strings.valueOf(group.getGroupId()), currLeader); + + } + + request.setAttribute("nextLeaderMap", nextLeaderMap); + request.setAttribute("currLeaderMap", currLeaderMap); + request.setAttribute("pageResult", pageResult); + } + + + protected void add(HttpRequest request) throws Exception + { + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + + request.setAttribute("orgId", orgId); + request.setAttribute("org", org); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long groupId = request.getParameterLong("groupId"); + DesignGroup group = ORM.get(ZTable.class).item(DesignGroup.class, groupId); + if (group == null) + { + request.setResponseError("该设计组不存在"); + return; + } + + request.setAttribute("item", group); + } + + @AnTransaction + protected void insert(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + String groupName = request.getParameter("groupName"); + String groupLeader = request.getParameter("groupLeader"); + groupName = Strings.trim(groupName); + groupLeader = Strings.trim(groupLeader); + int groupSeq = request.getParameterInt("groupSeq"); + + Selector selector = new Selector(); + selector.addMust("groupName", groupName); + selector.addMust("groupLeader", groupLeader); + DesignGroup designGroup = ORM.get(ZTable.class).item(DesignGroup.class, selector); + if (designGroup != null) + { + request.returnHistory("已存在 组长["+groupLeader+"]的小组,请另选他人为组长"); + return; + } + + long groupId = Ids.longId13(); + DesignGroup group = new DesignGroup(); + group.setGroupId(groupId); + group.setOrgId(orgId); + group.setGroupName(groupName); + group.setGroupLeader(groupLeader); + group.setGroupSeq(groupSeq); + group.setCreateTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(group); + + GroupMembers member = new GroupMembers(); + member.setStartDate(DateTimes.getFirstMonthDay()); + member.setGroupId(groupId); + member.setUserCode(groupLeader); + member.setIsGroupLeader(1); + ORM.get(ZTable.class).insert(member); + } + + + @AnTransaction + protected void update(HttpRequest request) throws Exception + { + long groupId = request.getParameterLong("groupId"); + String groupName = request.getParameter("groupName"); + String groupLeader = request.getParameter("groupLeader"); + groupName = Strings.trim(groupName); + groupLeader = Strings.trim(groupLeader); + int groupSeq = request.getParameterInt("groupSeq"); + + //修改组信息 + Updater updater = new Updater(); + updater.addMust("groupId", groupId); + updater.addField("groupName", groupName); + updater.addField("groupLeader", groupLeader); + updater.addField("groupSeq", groupSeq); + ORM.get(ZTable.class).update(DesignGroup.class, updater); + + String nextMonthFirstDay = DateTimes.getNextMonthFirstDay(); + String endLeaderDate = DateTimes.getLastMonthDay(); + + //查出即将生效的组长数据 删除未生效效数据 + Selector nextLsel = new Selector("groupId", groupId).addMustThenG("startDate", DateTimes.getLastMonthDay()).addMust("isGroupLeader", 1); + GroupMembers nextLeader = ORM.get(ZTable.class).item(GroupMembers.class, nextLsel); + ORM.get(ZTable.class).delete(GroupMembers.class, new Selector("groupId", groupId).addMustThenG("startDate", DateTimes.getLastMonthDay())); + + //查询当前 组长 + Selector sel1 = new Selector("groupId", groupId); + sel1.addMust("isGroupLeader", 1); + sel1.addOrderbyDesc("startDate"); + GroupMembers leader = ORM.get(ZTable.class).item(GroupMembers.class, sel1); + if (leader == null) + { + leader = new GroupMembers(); + leader.setStartDate(nextMonthFirstDay); + leader.setUserCode(groupLeader); + leader.setGroupId(groupId); + leader.setIsGroupLeader(1); + ORM.get(ZTable.class).replace(leader); + return; + } + + //没有更换换操作员 + if (leader.getUserCode().equals(groupLeader)) + { + leader.setEndDate(null); + ORM.get(ZTable.class).replace(leader); + if (nextLeader != null) + {//下月预设有组长时 则还原下月预设有组长的原有数据 切组长不是在本组 + //1查询组长是否有预设 + Selector othernextset = new Selector("userCode", nextLeader.getUserCode()); + othernextset.addMustNotEqual("groupId", groupId); + othernextset.addMustThenG("startDate", DateTimes.getLastMonthDay());//大于当月最后一天 + othernextset.addOrderbyDesc("startDate"); + + GroupMembers othernextsetm = ORM.get(ZTable.class).item(GroupMembers.class, othernextset); + if (othernextsetm != null) + return;//有预设 不管了 + + + //没有预设则还原数据 + Selector othernonextset = new Selector("userCode", nextLeader.getUserCode()); + othernextset.addMustNotEqual("groupId", groupId); + othernextset.addMustThenG("startDate", DateTimes.getNextMonthFirstDay());//小于下月第一天 + othernextset.addOrderbyDesc("startDate"); + GroupMembers othernextnosetm = ORM.get(ZTable.class).item(GroupMembers.class, othernonextset); + if (othernextnosetm == null) + return; + + if (!(othernextnosetm.getEndDate() != null && othernextnosetm.getIsGroupLeader() == 1)) + { + othernextnosetm.setEndDate(null); + ORM.get(ZTable.class).replace(othernextnosetm); + return; + } + + //若被还原组长,有下月预设组长时 则设被还原组长为组员 + Selector sl = new Selector("groupId", othernextnosetm.getGroupId()); + sl.addMust("startDate", DateTimes.getNextMonthFirstDay());//小于下月第一天 + sl.addMust("isGroupLeader", 1); + sl.addOrderbyDesc("startDate"); + GroupMembers t2 = ORM.get(ZTable.class).item(GroupMembers.class, sl); + if (t2 == null) + { + othernextnosetm.setEndDate(null); + ORM.get(ZTable.class).replace(othernextnosetm); + return; + } + + othernextnosetm.setStartDate( DateTimes.getNextMonthFirstDay()); + othernextnosetm.setEndDate(null); + othernextnosetm.setIsGroupLeader(0); + ORM.get(ZTable.class).replace(othernextnosetm); + } + + return; + } + + //结束当月组长 + leader.setEndDate(endLeaderDate); + ORM.get(ZTable.class).replace(leader); + //判断原来组长 是否有预设 没有预设则将原来组长职位组员 + leader.setEndDate(null); + leader.setIsGroupLeader(0); + leader.setStartDate(nextMonthFirstDay); + ORM.get(ZTable.class).replace(leader); + + //插入下月组长数据 + GroupMembers currLeader = new GroupMembers(); + currLeader.setStartDate(nextMonthFirstDay); + currLeader.setUserCode(groupLeader); + currLeader.setGroupId(groupId); + currLeader.setIsGroupLeader(1); + ORM.get(ZTable.class).replace(currLeader); + + //结束该操作员 在其他组已生效的数据 + Selector sel3 = new Selector("userCode", groupLeader); + sel3.addMustIsNull("endDate"); + sel3.addMustThenL("startDate", DateTimes.getNextMonthFirstDay()); + sel3.addOrderbyDesc("startDate"); + GroupMembers om2 = ORM.get(ZTable.class).item(GroupMembers.class, sel3); + if (om2 == null) + return; + + + om2.setEndDate(DateTimes.getLastMonthDay()); + ORM.get(ZTable.class).replace(om2); + } + + @AnTransaction + protected void delete(HttpRequest request) throws Exception + { + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignStandardAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignStandardAction.java new file mode 100644 index 0000000..0ce0c7c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignStandardAction.java @@ -0,0 +1,271 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.sys; + +import java.io.File; +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.Base64; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.imageio.stream.FileImageOutputStream; +import javax.imageio.stream.ImageOutputStream; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dbo.design.DesignTypeContent; +import com.zhiqim.yangcai.design.dbo.stat.CheckBackReason; +import com.zhiqim.yangcai.design.dbo.stat.DesignStandard; +import com.zhiqim.yangcai.design.dbo.utils.BaseUtil; + +/** + * + * 印前原因预录 + * + * @version 1.0 @author gjx 2019-9-16 新建与整理 + */ +public class DesignStandardAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long catId = request.getParameterLong("reasonCatId"); + Map> reasonMap = new HashMap>(); + List catList = new ArrayList(); + List tresaonList = ORM.get(ZTable.class).list(DesignStandard.class, new Selector().addOrderbyDesc("createTime")); + for (DesignStandard reason : tresaonList) + { + + if (reason.isStandardType()) + { + catList.add(reason); + } + else + { + List list = reasonMap.get(reason.getStandardParent()); + list = list != null ? list : new ArrayList(); + list.add(reason); + reasonMap.put(reason.getStandardParent(), list); + } + } + + if (catId <= 0) + { + catId = 0; + if (catList.size() > 0) + { + catId = catList.get(0).getStandardId(); + } + } + List reasonList = reasonMap.get(catId); + request.setAttribute("catList", catList); + request.setAttribute("catId", catId); + request.setAttribute("reasonList", reasonList != null ? reasonList : new ArrayList<>()); + } + + @AnTransaction + public void insert(HttpRequest request) throws Exception + { + DesignStandard data = request.getParameter(DesignStandard.class); + data.setStandardId(Ids.longId()); + if (data.isStandardType()) + { + if (Validates.isEmptyBlank(data.getStandardTitle()) || data.getStandardTitle().length() > 32) + { + request.setResponseError("原因分类 不能为空 且不能超过32字符"); + return; + } + + } + else + {// 原因项 + long parentId = data.getStandardParent(); + parentId = parentId <= 0 ? 0 : parentId; + + DesignStandard parent = ORM.get(ZTable.class).item(DesignStandard.class, parentId); + if (parent == null) + { + request.setResponseError("未知原因分类"); + return; + } + + if (data.isStandardType() && Validates.isEmptyBlank(data.getStandardTitle()) || data.getStandardTitle().length() > 32) + { + request.setResponseError("原因项 不能为空 且不能超过32字符"); + return; + } + } + data.setCreateTime(Sqls.nowTimestamp()); + data.setStandardTitle(BaseUtil.removeBlank(data.getStandardTitle())); + ORM.get(ZTable.class).replace(data); + } + + @AnTransaction + public void update(HttpRequest request) throws Exception + { + DesignStandard data = request.getParameter(DesignStandard.class); + long reasonId = data.getStandardId(); + reasonId = reasonId <= 0 ? 0 : reasonId; + DesignStandard reason = ORM.get(ZTable.class).item(DesignStandard.class, reasonId); + if (reason == null) + { + request.setResponseError("未知原因"); + return; + } + + Updater exUpdater = new Updater(); + exUpdater.addMust("standardId", Long.valueOf(reasonId)); + exUpdater.addField("standardTitle", data.getStandardTitle()); + ORM.get(ZTable.class).update(DesignStandard.class, exUpdater); + + /* long parentId = data.getStandardParent(); + parentId = parentId <= 0 ? 0 : parentId; + + DesignStandard parent = ORM.get(ZTable.class).item(DesignStandard.class, parentId); + if (parent == null) + { + request.setResponseError("未知原因分类"); + return; + } + + if (data.isStandardType() && Validates.isEmptyBlank(data.getStandardTitle()) || data.getStandardTitle().length() > 32) + { + request.setResponseError("原因项 不能为空 且不能超过32字符"); + return; + } + data.setStandardTitle(BaseUtil.removeBlank(data.getStandardTitle())); + ORM.get(ZTable.class).replace(data); + ORM.get(ZTable.class).update(reason);*/ + } + + public void beforeDelete(HttpRequest request) throws Exception + { + long reasonId = request.getParameterLong("reasonId"); + DesignStandard reason = ORM.get(ZTable.class).item(DesignStandard.class, new Selector().addMaybe("standardId", reasonId)); + if (reason == null) + { + request.setResponseError("预录原因不存在"); + return; + } + ORM.get(ZTable.class).delete(DesignStandard.class, reason.getStandardId()); +/* List reasonList = ORM.get(ZTable.class).list(DesignStandard.class, new Selector().addMust("standardParent", reason.getStandardParent())); + + boolean returnContent = false; + if (reasonList.size() == 1) + { + returnContent = true; + }*/ + + request.setResponseResult(Jsons.toString(true)); + } + + @AnTransaction + public void Details(HttpRequest request) throws Exception + { + long reasonId = request.getParameterLong("reasonId"); + +/* List reasonList = ORM.get(ZTable.class).list(DesignStandard.class, new Selector().addMust("standardParent", reason.getStandardParent())); + + boolean returnContent = false; + if (reasonList.size() == 1) + { + returnContent = true; + }*/ + + request.setResponseResult(Jsons.toString(true)); + } + + @AnTransaction + public void delete(HttpRequest request) throws Exception + { + long reasonId = request.getParameterLong("reasonId"); + DesignStandard reason = ORM.get(ZTable.class).item(DesignStandard.class, new Selector().addMaybe("standardId", reasonId)); + if (reason == null) + { + request.setResponseError("预录原因不存在"); + return; + } + + List reasonList = ORM.get(ZTable.class).list(DesignStandard.class, new Selector().addMust("reasonParent", reason.getStandardParent())); + if (reasonList.size() == 1) + { + ORM.get(ZTable.class).delete(DesignStandard.class, reason.getStandardParent()); + } + ORM.get(ZTable.class).delete(DesignStandard.class, reasonId); + } + + + + + public static void designtypeImge(HttpRequest request) throws Exception { + String designId = request.getParameter("designId"); + String imgBase64Str = URLDecoder.decode(request.getParameter("content"), "UTF-8"); + + + String rootDir = Strings.trimRight(request.getContext().getAttributeString("upload.rootDir"), "/"); + + String fileName = request.getSessionName() + "-" + DateTimes.getDateTime14String() + ".png"; + String checkPath = rootDir + "/" + DateTimes.getDateTime8String() + "/" + new Date().getTime()+"行为规范图片"; + String path = checkPath + "/" + fileName; + Files.mkDirectory(checkPath); + + // 对传过来的图片解码并且写入文件 + imgBase64Str = imgBase64Str.replace("data:image/png;base64,", ""); + byte[] imageBytes = Base64.getDecoder().decode(imgBase64Str); + File file = new File(path); + ImageOutputStream out = new FileImageOutputStream(file); + out.write(imageBytes); + out.flush(); + out.close(); + // 图片上传OSS处理 + String ossUrl = OssFileDao.uploadFile(file, OssFileDao.getUploadFileKey(new Date().getTime())); + + request.setResponseResult(ossUrl); + + } + + + + public static void designtype(HttpRequest request) throws Exception { + long designId = request.getParameterLong("designId"); + String content = URLDecoder.decode(request.getParameter("content"), "UTF-8"); + DesignStandard order = ORM.get(ZTable.class).item(DesignStandard.class, designId); + if (order == null) { + + + } else { + Updater exUpdater = new Updater(); + exUpdater.addMust("standardId", Long.valueOf(designId)); + exUpdater.addField("standardText", content); + ORM.get(ZTable.class).update(DesignStandard.class, exUpdater); + } + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignStandardDetailsAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignStandardDetailsAction.java new file mode 100644 index 0000000..6daed75 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignStandardDetailsAction.java @@ -0,0 +1,186 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.design.DesignTypeContent; +import com.zhiqim.yangcai.design.dbo.stat.CheckBackReason; +import com.zhiqim.yangcai.design.dbo.stat.DesignStandard; +import com.zhiqim.yangcai.design.dbo.utils.BaseUtil; + +/** + * + * 印前原因预录 + * + * @version 1.0 @author gjx 2019-9-16 新建与整理 + */ +public class DesignStandardDetailsAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long catId = request.getParameterLong("reasonId"); + DesignStandard parent = ORM.get(ZTable.class).item(DesignStandard.class, catId); + if(parent != null){ + request.setAttribute("content", parent.getStandardText()); + request.setAttribute("reasonId", catId); + } + + } + + @AnTransaction + public void insert(HttpRequest request) throws Exception + { + DesignStandard data = request.getParameter(DesignStandard.class); + data.setStandardId(Ids.longId()); + if (data.isStandardType()) + { + if (Validates.isEmptyBlank(data.getStandardTitle()) || data.getStandardTitle().length() > 32) + { + request.setResponseError("原因分类 不能为空 且不能超过32字符"); + return; + } + + } + else + {// 原因项 + long parentId = data.getStandardParent(); + parentId = parentId <= 0 ? 0 : parentId; + + DesignStandard parent = ORM.get(ZTable.class).item(DesignStandard.class, parentId); + if (parent == null) + { + request.setResponseError("未知原因分类"); + return; + } + + if (data.isStandardType() && Validates.isEmptyBlank(data.getStandardTitle()) || data.getStandardTitle().length() > 32) + { + request.setResponseError("原因项 不能为空 且不能超过32字符"); + return; + } + } + + data.setStandardTitle(BaseUtil.removeBlank(data.getStandardTitle())); + ORM.get(ZTable.class).replace(data); + } + + @AnTransaction + public void update(HttpRequest request) throws Exception + { + DesignStandard data = request.getParameter(DesignStandard.class); + long reasonId = data.getStandardId(); + reasonId = reasonId <= 0 ? 0 : reasonId; + DesignStandard reason = ORM.get(ZTable.class).item(DesignStandard.class, reasonId); + if (reason == null) + { + request.setResponseError("未知原因"); + return; + } + + Updater exUpdater = new Updater(); + exUpdater.addMust("standardId", Long.valueOf(reasonId)); + exUpdater.addField("standardTitle", data.getStandardTitle()); + ORM.get(ZTable.class).update(DesignStandard.class, exUpdater); + + /* long parentId = data.getStandardParent(); + parentId = parentId <= 0 ? 0 : parentId; + + DesignStandard parent = ORM.get(ZTable.class).item(DesignStandard.class, parentId); + if (parent == null) + { + request.setResponseError("未知原因分类"); + return; + } + + if (data.isStandardType() && Validates.isEmptyBlank(data.getStandardTitle()) || data.getStandardTitle().length() > 32) + { + request.setResponseError("原因项 不能为空 且不能超过32字符"); + return; + } + data.setStandardTitle(BaseUtil.removeBlank(data.getStandardTitle())); + ORM.get(ZTable.class).replace(data); + ORM.get(ZTable.class).update(reason);*/ + } + + public void beforeDelete(HttpRequest request) throws Exception + { + long reasonId = request.getParameterLong("reasonId"); + DesignStandard reason = ORM.get(ZTable.class).item(DesignStandard.class, new Selector().addMaybe("standardId", reasonId)); + if (reason == null) + { + request.setResponseError("预录原因不存在"); + return; + } + ORM.get(ZTable.class).delete(DesignStandard.class, reason.getStandardId()); +/* List reasonList = ORM.get(ZTable.class).list(DesignStandard.class, new Selector().addMust("standardParent", reason.getStandardParent())); + + boolean returnContent = false; + if (reasonList.size() == 1) + { + returnContent = true; + }*/ + + request.setResponseResult(Jsons.toString(true)); + } + + @AnTransaction + public void Details(HttpRequest request) throws Exception + { + long reasonId = request.getParameterLong("reasonId"); + +/* List reasonList = ORM.get(ZTable.class).list(DesignStandard.class, new Selector().addMust("standardParent", reason.getStandardParent())); + + boolean returnContent = false; + if (reasonList.size() == 1) + { + returnContent = true; + }*/ + + request.setResponseResult(Jsons.toString(true)); + } + + @AnTransaction + public void delete(HttpRequest request) throws Exception + { + long reasonId = request.getParameterLong("reasonId"); + DesignStandard reason = ORM.get(ZTable.class).item(DesignStandard.class, new Selector().addMaybe("standardId", reasonId)); + if (reason == null) + { + request.setResponseError("预录原因不存在"); + return; + } + + List reasonList = ORM.get(ZTable.class).list(DesignStandard.class, new Selector().addMust("reasonParent", reason.getStandardParent())); + if (reasonList.size() == 1) + { + ORM.get(ZTable.class).delete(DesignStandard.class, reason.getStandardParent()); + } + ORM.get(ZTable.class).delete(DesignStandard.class, reasonId); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignTypeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignTypeAction.java new file mode 100644 index 0000000..69d0871 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignTypeAction.java @@ -0,0 +1,416 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.onex.IsFloat; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.aliyuncs.utils.StringUtils; +import com.taobao.api.internal.toplink.embedded.websocket.util.StringUtil; +import com.zhiqim.yangcai.cache.DesignTypeCache; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignSize; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.design.DesignTypeContent; + +/*** + * 设计类型 + * + * @version v1.0.0 @author longguizhi 2018-9-6 新建与整理 + */ +public class DesignTypeAction extends StdSwitchAction +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("typeId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsLen("typeName", "设计类型名称不能为空且不能超过100个字符", 1, 100)); + // request.addValidate(new IsIntegerValue("merDispatchEffectiveTime", + // "分拣时效不能为空,且数值在【1-99999】", 1, 99999)); + // request.addValidate(new IsIntegerValue("dispatchOrderEffectiveTime", + // "派单时效不能为空,且数值在【1-99999】", 1, 99999)); + // request.addValidate(new IsIntegerValue("effectiveTime", "初稿时效不能为空,且数值在【1-99999】", 1, + // 99999)); + // request.addValidate(new IsIntegerValue("effectiveEndTime", "定稿时效不能为空,且数值在【1-99999】", 1, + // 99999)); + request.addValidate(new IsFloat("sizeMWidth", "模位尺寸宽不能为空")); + request.addValidate(new IsFloat("sizeMHeight", "模位尺寸高不能为空")); + } + + @Override + public void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getParameterInt("pageSize", 15); + + String designId = request.getParameter("designId"); + if(StringUtils.isNotEmpty(designId)){ + + DesignTypeContent order = ORM.get(ZTable.class).item(DesignTypeContent.class, new Selector().addMust("typeId", Long.valueOf(designId))); + if(order != null){ + request.setAttribute("content", order.getContent()); + } + } + + Selector selector = new Selector(); + selector.addMaybeLike("typeName", request.getParameter("typeName")); + selector.addMaybe("typeId", request.getParameterLong("typeId")); + if (request.getParameterInt("isEnabled") >= 0) + { + selector.addMaybe("isEnabled", request.getParameterInt("isEnabled") == 0 ? true : false); + } + selector.addOrderbyAsc("typeSeq"); + selector.addOrderbyAsc("typeId"); + + PageResult pageResult = ORM.get(ZTable.class).page(DesignType.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + + Map> typeSizeMap = new HashMap>(); + for (DesignType type : pageResult.list()) + { + List sizeList = ORM.get(ZTable.class).list(DesignSize.class, new Selector("typeId", type.getTypeId()).addOrderbyAsc("sizeSeq")); + typeSizeMap.put(type.getTypeId(), sizeList); + } + + request.setAttribute("typeSizeMap", typeSizeMap); + } + + @Override + public void add(HttpRequest request) throws Exception + { + List tempList = DesignTypeDao.listAll(); + + // 最大值排序号 + int typeSeq = tempList.size() == 0 ? 1 : tempList.get(tempList.size() - 1).getTypeSeq(); + request.setAttribute("typeSeq", typeSeq); + } + + @Override + public void modify(HttpRequest request) throws Exception + { + long typeId = request.getParameterLong("typeId"); + DesignType designType = ORM.get(ZTable.class).item(DesignType.class, typeId); + request.setAttribute("type", designType); + + if (Validates.isNotEmpty(designType.getDesignFileType())) + { + String[] designFileType = designType.getDesignFileType().split(","); + List designFileTypeList = new ArrayList(); + for (String designFile : designFileType) + { + designFileTypeList.add(designFile); + } + request.setAttribute("designFileType", designFileTypeList); + } + + if (Validates.isNotEmpty(designType.getPrintingFileType())) + { + String[] printingFileType = designType.getPrintingFileType().split(","); + List printingFileTypeList = new ArrayList(); + for (String printingFile : printingFileType) + { + printingFileTypeList.add(printingFile); + } + request.setAttribute("printingFileType", printingFileTypeList); + } + + List sizeList = ORM.get(ZTable.class).list(DesignSize.class, new Selector("typeId", typeId).addOrderbyAsc("sizeSeq")); + request.setAttribute("sizeList", sizeList); + } + + @Override + @AnTransaction + protected void insert(HttpRequest request) throws Exception + { + String designTypeName = request.getParameter("typeName"); + boolean isEnabled = request.getParameterBoolean("isEnabled"); + int typeSeq = request.getParameterInt("typeSeq"); + int merDispatchEffectiveTime = request.getParameterInt("merDispatchEffectiveTime"); + int dispatchOrderEffectiveTime = request.getParameterInt("dispatchOrderEffectiveTime"); + int effectiveTime = request.getParameterInt("effectiveTime"); + int effectiveEndTime = request.getParameterInt("effectiveEndTime"); + typeSeq = typeSeq <= 0 ? 1 : typeSeq; + + DesignType type = new DesignType(); + long typeId = Ids.longId13(); + type.setTypeId(typeId); + type.setTypeName(designTypeName); + type.setMerDispatchEffectiveTime(merDispatchEffectiveTime); + type.setDispatchOrderEffectiveTime(dispatchOrderEffectiveTime); + type.setEffectiveTime(effectiveTime); + type.setEffectiveEndTime(effectiveEndTime); + type.setEnabled(isEnabled); + type.setTypeSeq(typeSeq); + + String sizeMWidth = request.getParameter("sizeMWidth"); + String sizeMHeight = request.getParameter("sizeMHeight"); + type.setSizeMWidth(Double.valueOf(sizeMWidth)); + type.setSizeMHeight(Double.valueOf(sizeMHeight)); + + String bleeding = request.getParameter("bleeding"); + if (Validates.isEmpty(bleeding)) + { + bleeding = "0"; + } + type.setBleeding(Double.valueOf(bleeding)); + String dpiWidth = request.getParameter("dpiWidth"); + String dpiHeight = request.getParameter("dpiHeight"); + if (Validates.isEmpty(dpiWidth)) + { + dpiWidth = "0"; + } + if (Validates.isEmpty(dpiHeight)) + { + dpiHeight = "0"; + } + type.setDpi(Double.valueOf(dpiWidth)); + + String designFile_new = request.getParameter("designFile_new"); + List designFileList_new = Lists.toLongList(designFile_new); + String designFileType = ""; + for (int i = 0; i < designFileList_new.size(); i++) + { + long tempId = designFileList_new.get(i); + if (i == designFileList_new.size() - 1) + { + designFileType += request.getParameter("designFile_" + tempId); + } + else + { + designFileType += request.getParameter("designFile_" + tempId) + ","; + } + } + type.setDesignFileType(designFileType); + + String printingFile_new = request.getParameter("printingFile_new"); + List printingFileList_new = Lists.toLongList(printingFile_new); + String printingFileType = ""; + for (int i = 0; i < printingFileList_new.size(); i++) + { + long tempId = printingFileList_new.get(i); + if (i == printingFileList_new.size() - 1) + { + printingFileType += request.getParameter("printingFile_" + tempId); + } + else + { + printingFileType += request.getParameter("printingFile_" + tempId) + ","; + } + } + type.setPrintingFileType(printingFileType); + + ORM.get(ZTable.class).insert(type); + // 重新排序 + sortTypeBySeq(typeId); + + // 刷新缓存 + DesignTypeCache ctt = Global.get(DesignTypeCache.class); + ctt = ctt != null ? ctt : new DesignTypeCache(); + Global.remove(DesignTypeCache.class); + Global.add(DesignTypeCache.class, ctt.doRefresh()); + } + + @Override + @AnTransaction + protected void update(HttpRequest request) throws Exception + { + long typeId = request.getParameterLong("typeId"); + String designTypeName = request.getParameter("typeName"); + boolean isEnabled = request.getParameterBoolean("isEnabled"); + int typeSeq = request.getParameterInt("typeSeq"); + int merDispatchEffectiveTime = request.getParameterInt("merDispatchEffectiveTime"); + int dispatchOrderEffectiveTime = request.getParameterInt("dispatchOrderEffectiveTime"); + int effectiveTime = request.getParameterInt("effectiveTime"); + int effectiveEndTime = request.getParameterInt("effectiveEndTime"); + typeSeq = typeSeq <= 0 ? 1 : typeSeq; + Updater updater = new Updater(); + updater.addMust("typeId", typeId); + updater.addField("typeName", designTypeName); + updater.addField("isEnabled", isEnabled); + updater.addField("typeSeq", typeSeq); + updater.addField("merDispatchEffectiveTime", merDispatchEffectiveTime); + updater.addField("dispatchOrderEffectiveTime", dispatchOrderEffectiveTime); + updater.addField("effectiveTime", effectiveTime); + updater.addField("effectiveEndTime", effectiveEndTime); + String sizeMWidth = request.getParameter("sizeMWidth"); + String sizeMHeight = request.getParameter("sizeMHeight"); + updater.addField("sizeMWidth", Double.valueOf(sizeMWidth)); + updater.addField("sizeMHeight", Double.valueOf(sizeMHeight)); + String bleeding = request.getParameter("bleeding"); + String dpiWidth = request.getParameter("dpiWidth"); + if (Validates.isEmpty(bleeding)) + { + bleeding = "0"; + } + if (Validates.isEmpty(dpiWidth)) + { + dpiWidth = "0"; + } + updater.addField("bleeding", Double.valueOf(bleeding)); + updater.addField("dpi", Double.valueOf(dpiWidth)); + + DesignType designType = ORM.get(ZTable.class).item(DesignType.class, new Selector().addMust("typeId", typeId)); + String designFileType = ""; + String designFile_new = request.getParameter("designFile_new"); + List designFileList_new = Lists.toLongList(designFile_new); + if (Validates.isNotEmpty(designType.getDesignFileType())) + { + + String[] split = designType.getDesignFileType().split(","); + for (int i = 0; i < split.length; i++) + { + String designFile = request.getParameter("designFile_" + split[i]); + if (i == split.length - 1 && designFileList_new.size() > 0) + { + designFileType += designFile + ","; + } + else if (i == split.length - 1) + { + designFileType += designFile; + } + else + { + designFileType += designFile + ","; + } + + } + + } + for (int i = 0; i < designFileList_new.size(); i++) + { + long tempId = designFileList_new.get(i); + if (i == designFileList_new.size() - 1) + { + designFileType += request.getParameter("designFile_" + tempId); + } + else + { + designFileType += request.getParameter("designFile_" + tempId) + ","; + } + } + updater.addField("designFileType", designFileType); + + String printingFileType = ""; + String printingFile_new = request.getParameter("printingFile_new"); + List printingFileList_new = Lists.toLongList(printingFile_new); + if (Validates.isNotEmpty(designType.getPrintingFileType())) + { + String[] split = designType.getPrintingFileType().split(","); + for (int i = 0; i < split.length; i++) + { + String printingFile = request.getParameter("printingFile_" + split[i]); + if (i == split.length - 1 && printingFileList_new.size() > 0) + { + printingFileType += printingFile + ","; + } + else if (i == split.length - 1) + { + printingFileType += printingFile; + } + else + { + printingFileType += printingFile + ","; + } + + } + + } + for (int i = 0; i < printingFileList_new.size(); i++) + { + long tempId = printingFileList_new.get(i); + if (i == printingFileList_new.size() - 1) + { + printingFileType += request.getParameter("printingFile_" + tempId); + } + else + { + printingFileType += request.getParameter("printingFile_" + tempId) + ","; + } + } + updater.addField("printingFileType", printingFileType); + + ORM.get(ZTable.class).update(DesignType.class, updater); + // 重新排序 + sortTypeBySeq(typeId); + + // 刷新缓存 + DesignTypeCache ctt = Global.get(DesignTypeCache.class); + ctt = ctt != null ? ctt : new DesignTypeCache(); + Global.remove(DesignTypeCache.class); + Global.add(DesignTypeCache.class, ctt.doRefresh()); + + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + // long designTypeId = request.getParameterLong("designTypeId"); + // ORM.get(ZTable.class).delete(designType.class, designTypeId); + } + + private void sortTypeBySeq(long currTypeId) throws Exception + { + List tempList = DesignTypeDao.listAll(); + Iterator iterator = tempList.iterator(); + int typeSeq = 0; + while (iterator.hasNext()) + { + DesignType item = iterator.next(); + if (currTypeId == item.getTypeId()) + { + typeSeq = item.getTypeSeq(); + iterator.remove(); + } + } + + if (tempList.size() == 0) + { + return; + } + + for (DesignType designType : tempList) + { + if (typeSeq == designType.getTypeSeq()) + { + typeSeq++; + designType.setTypeSeq(typeSeq); + ORM.get(ZTable.class).update(DesignType.class, + new Updater().addMust("typeId", designType.getTypeId()).addField("typeSeq", designType.getTypeSeq())); + } + } + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignerGroupAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignerGroupAction.java new file mode 100644 index 0000000..feaed65 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignerGroupAction.java @@ -0,0 +1,271 @@ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.ParamDao; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroup; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupValue; + +public class DesignerGroupAction extends StdSwitchAction +{ + private static final Log log = LogFactory.getLog(DesignerGroupAction.class); + + @Override + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("designerGroupId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("designerGroupName", "设计师组名不能为空")); + request.addValidate(new IsNotEmpty("maxOrderNum", "最大接单量不能为空")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt("page.size", 15); + Selector sel = new Selector(); + sel.addOrderbyDesc("status"); + sel.addOrderbyDesc("modifyTime"); + PageResult pageResult = ORM.get(ZTable.class).page(DesignerGroup.class, page, pageSize, sel); + + List typeList = DesignTypeDao.list(); + Map typeMap = new HashMap(); + for (DesignType designType : typeList) + { + typeMap.put(designType.getTypeId(), designType.getTypeName()); + } + + request.setAttribute("typeMap", typeMap); + request.setAttribute("pageResult", pageResult); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + List industryList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + List typeList = DesignTypeDao.list(); + List merchantList = ORM.get(ZTable.class).list(DesignMerchant.class); + + request.setAttribute("typeList", Jsons.toString(typeList)); + request.setAttribute("industryList", Jsons.toString(industryList)); + request.setAttribute("afterList", ParamDao.doGetAfterNameParam()); + request.setAttribute("merchantList", merchantList); + } + + @Override + @AnTransaction + protected void insert(HttpRequest request) throws Exception + { + long designerGroupId = Ids.longId(); + long maxOrderAmount = request.getParameterAmount2R("maxOrderAmount", 0); + long minOrderAmount = request.getParameterAmount2R("minOrderAmount", 0); + long maxOrderNum = request.getParameterLong("maxOrderNum"); + long maxWaiveNum = request.getParameterLong("maxWaiveNum"); + DesignerGroup designerGroup = request.getParameter(DesignerGroup.class); + designerGroup.setMaxOrderAmount(maxOrderAmount); + designerGroup.setMinOrderAmount(minOrderAmount); + designerGroup.setMinOrderAmount(maxOrderNum); + designerGroup.setMinOrderAmount(maxWaiveNum); + int count = ORM.get(ZTable.class).count(DesignerGroup.class, new Selector().addMust("designerGroupName", designerGroup.getDesignerGroupName())); + if (count > 0) + { + request.returnHistory("已有该名称的设计师组"); + return; + } + designerGroup.setDesignerGroupId(designerGroupId); + designerGroup.setStatus(1); + designerGroup.setModifyOperatorCode(request.getSessionName()); + designerGroup.setModifyTime(Sqls.nowTimestamp()); + Transaction tx = null; + try + { + tx = TransactionManager.beginTransaction(); + insertDesignerGroup(designerGroup, request); + tx.commit(); + } + catch (Exception e) + { + if (tx != null) + { + tx.rollback(); + } + request.returnHistory("保存失败,请稍后再试"); + log.error("新增设计师组失败", e); + } + finally + { + if (tx != null) + { + tx.close(); + } + } + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long designerGroupId = request.getParameterLong("designerGroupId"); + DesignerGroup designerGroup = ORM.get(ZTable.class).item(DesignerGroup.class, designerGroupId); + if (designerGroup == null) + { + request.setResponseError("该设计师组不存在"); + return; + } + + List industryList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + List typeList = DesignTypeDao.list(); + List groupValues = ORM.get(ZTable.class).list(DesignerGroupValue.class, new Selector("designerGroupId", designerGroupId)); + String[] afterNames = Validates.isNotEmpty(designerGroup.getAfterNames()) ? designerGroup.getAfterNames().split(",") : new String[0]; + + // 关联渠道 + List merchantList = ORM.get(ZTable.class).list(DesignMerchant.class); + String[] merchantIdStrings = Validates.isNotEmpty(designerGroup.getMerchantIds()) ? designerGroup.getMerchantIds().split(",") : new String[0]; + List merchantIds = new ArrayList(); + for (String merchantId : merchantIdStrings) + { + merchantIds.add(Long.parseLong(merchantId)); + } + + request.setAttribute("designerGroup", designerGroup); + request.setAttribute("afterNames", Lists.toList(afterNames)); + request.setAttribute("typeList", Jsons.toString(typeList)); + request.setAttribute("industryList", Jsons.toString(industryList)); + request.setAttribute("groupValues", Jsons.toString(groupValues)); + request.setAttribute("afterList", ParamDao.doGetAfterNameParam()); + request.setAttribute("merchantList", merchantList); + request.setAttribute("merchantIds", merchantIds); + } + + @Override + @AnTransaction + protected void update(HttpRequest request) throws Exception + { + long designerGroupId = request.getParameterLong("designerGroupId"); + long maxOrderAmount = request.getParameterAmount2R("maxOrderAmount", 0); + long minOrderAmount = request.getParameterAmount2R("minOrderAmount", 0); + long maxOrderNum = request.getParameterLong("maxOrderNum"); + long maxWaiveNum = request.getParameterLong("maxWaiveNum"); + DesignerGroup designerGroup = request.getParameter(DesignerGroup.class); + designerGroup.setMaxOrderAmount(maxOrderAmount); + designerGroup.setMinOrderAmount(minOrderAmount); + designerGroup.setMinOrderAmount(maxOrderNum); + designerGroup.setMinOrderAmount(maxWaiveNum); + designerGroup.setModifyOperatorCode(request.getSessionName()); + designerGroup.setModifyTime(Sqls.nowTimestamp()); + int count = ORM.get(ZTable.class).count(DesignerGroup.class, + new Selector().addMust("designerGroupName", designerGroup.getDesignerGroupName()).addMustNotEqual("designerGroupId", designerGroupId)); + if (count > 0) + { + request.returnHistory("已有该名称的设计师组"); + return; + } + Transaction tx = null; + try + { + tx = TransactionManager.beginTransaction(); + ORM.get(ZTable.class).delete(DesignerGroupValue.class, new Selector().addMust("designerGroupId", designerGroupId)); + insertDesignerGroup(designerGroup, request); + tx.commit(); + } + catch (Exception e) + { + if (tx != null) + { + tx.rollback(); + } + request.returnHistory("保存失败,请稍后再试"); + log.error("修改设计师组失败", e); + } + finally + { + if (tx != null) + { + tx.close(); + } + } + } + + /** + * 添加设计师组数据 + * + * @param designerGroup + * @param request + * @throws Exception + */ + private void insertDesignerGroup(DesignerGroup designerGroup, HttpRequest request) throws Exception + { + long designerGroupId = designerGroup.getDesignerGroupId(); + int[] typeArray = + { + 0, 1, 2, 3, 4 + }; + ORM.get(ZTable.class).replace(designerGroup); + for (int i = 0; i < typeArray.length; i++) + { + List typeValues = JSONObject.parseArray(request.getParameter("type" + i, "[]"), Long.class); + List list = new ArrayList(); + if (Validates.isNotEmpty(typeValues)) + { + for (Long value : typeValues) + { + DesignerGroupValue groupValue = new DesignerGroupValue(); + groupValue.setDesignerGroupValueId(Ids.longId()); + groupValue.setDesignerGroupId(designerGroupId); + groupValue.setRelatedType(i); + groupValue.setRelatedValue(value); + list.add(groupValue); + } + ORM.get(ZTable.class).insertBatch(list); + } + } + } + + @Override + @AnTransaction + protected void delete(HttpRequest request) throws Exception + { + long designerGroupId = request.getParameterLong("designerGroupId"); + if (ORM.get(ZTable.class).count(DesignerGroupDispatch.class, new Selector().addMust("designerGroupId", designerGroupId)) > 0) + { + request.returnHistory("该条件组已关联设计师,无法删除"); + return; + } + ORM.get(ZTable.class).delete(DesignerGroupValue.class, new Selector().addMust("designerGroupId", designerGroupId)); + ORM.get(ZTable.class).delete(DesignerGroup.class, designerGroupId); + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignerGroupDispatch2Action.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignerGroupDispatch2Action.java new file mode 100644 index 0000000..1a0a0a7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignerGroupDispatch2Action.java @@ -0,0 +1,217 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.ParamDao; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroup; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatchValue; +import com.zhiqim.yangcai.design.dbo.dispatch.DesOnline; + +public class DesignerGroupDispatch2Action extends StdSwitchAction +{ + private static final Log log = LogFactory.getLog(DesignerGroupDispatch2Action.class); + + @Override + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("operatorCode", "请选择一个设计师")); + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("operatorCode", "设计师不能为空")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt("page.size", 15); + + Selector sel = new Selector(); + sel.addMaybeLike("operatorCode", request.getParameter("operatorCode")); + sel.addMaybe("designerGroupId", request.getParameterLong("designerGroupId")); + sel.addMaybe("orgId", request.getParameterLong("orgId")); + sel.addOrderbyDesc("status"); + sel.addOrderbyDesc("modifyTime"); + Selector selector1 = new Selector(); + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode());//当前用户是否是组织负责人 + selector1.addMust("orgStatus", 0); + selector1.addMust("orgLevel", 1); + selector1.addMustNotEqual("orgId", 1808071102554512L); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size() > 0) { + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + sel.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + PageResult pageResult = ORM.get(ZTable.class).page(DesignerGroupDispatch.class, page, pageSize, sel); + List designerGroupList = ORM.get(ZTable.class).list(DesignerGroup.class, new Selector().addMust("status", 1)); + List typeList = DesignTypeDao.list(); + Map typeMap = new HashMap(); + for (DesignType designType : typeList) + { + typeMap.put(designType.getTypeId(), designType.getTypeName()); + } + Map designerGroupMap = new HashMap(); + for (DesignerGroup designerGroup : designerGroupList) + { + designerGroupMap.put(designerGroup.getDesignerGroupId(), designerGroup.getDesignerGroupName()); + } + + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + selOrg.addMustNotEqual("orgId", 1808071102554512L); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + if(zmrOrgList.size() > 0) { + request.setAttribute("orgList", zmrOrgList); + }else { + request.setAttribute("orgList", orgList); + } + + + request.setAttribute("typeMap", typeMap); + request.setAttribute("designerGroupList", designerGroupList); + request.setAttribute("pageResult", pageResult); + request.setAttribute("designerGroupMap", designerGroupMap); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode", ""); + DesignerGroupDispatch designerGroupDispatch = ORM.get(ZTable.class).item(DesignerGroupDispatch.class, new Selector("operatorCode", operatorCode)); + if (designerGroupDispatch == null) + { + request.setResponseError("该设计师配置不存在"); + return; + } + + List industryList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + List typeList = DesignTypeDao.list(); + List groupDispatchValues = ORM.get(ZTable.class).list(DesignerGroupDispatchValue.class, + new Selector("operatorCode", operatorCode)); + List designerGroupList = ORM.get(ZTable.class).list(DesignerGroup.class, new Selector().addMust("status", 1)); + String[] afterNames = Validates.isNotEmpty(designerGroupDispatch.getAfterNames()) ? designerGroupDispatch.getAfterNames().split(",") : new String[0]; + + // 免检产品 + List freeCheckTypes = new ArrayList(); + for (DesignerGroupDispatchValue value : groupDispatchValues) + { + if (value.getRelatedType() == 5) + { + freeCheckTypes.add(value.getRelatedValue()); + } + } + + // 关联渠道 + List merchantList = ORM.get(ZTable.class).list(DesignMerchant.class); + String[] merchantIdStrings = Validates.isNotEmpty(designerGroupDispatch.getMerchantIds()) ? designerGroupDispatch.getMerchantIds().split(",") + : new String[0]; + List merchantIds = new ArrayList(); + for (String merchantId : merchantIdStrings) + { + merchantIds.add(Long.parseLong(merchantId)); + } + + request.setAttribute("designerGroupDispatch", designerGroupDispatch); + request.setAttribute("afterNames", Lists.toList(afterNames)); + request.setAttribute("typeList", Jsons.toString(typeList)); + request.setAttribute("industryList", Jsons.toString(industryList)); + request.setAttribute("groupDispatchValues", Jsons.toString(groupDispatchValues)); + request.setAttribute("afterList", ParamDao.doGetAfterNameParam()); + request.setAttribute("designerGroupList", designerGroupList); + request.setAttribute("designTypeList", typeList); + request.setAttribute("freeCheckTypes", freeCheckTypes); + request.setAttribute("merchantList", merchantList); + request.setAttribute("merchantIds", merchantIds); + } + + @Override + @AnTransaction + protected void update(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode", ""); + int isShowCost = request.getParameterInt("isShowCost", 1); + int maxOrderNum = request.getParameterInt("maxOrderNum", 1); + Updater updater = new Updater() + .addMust("operatorCode", operatorCode) + .addField("modifyOperatorCode", request.getSessionName()) + .addField("modifyTime", Sqls.nowTimestamp()) + .addField("maxOrderNum", maxOrderNum) + .addField("waiveNum", request.getParameterInt("WaiveNum")) + .addField("isShowCost", isShowCost); + ORM.get(ZTable.class).update(DesignerGroupDispatch.class, updater); + } + + @Override + protected void add(HttpRequest arg0) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + protected void delete(HttpRequest arg0) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + protected void insert(HttpRequest arg0) throws Exception { + // TODO Auto-generated method stub + + } + +} \ No newline at end of file diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignerGroupDispatchAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignerGroupDispatchAction.java new file mode 100644 index 0000000..62072c3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/DesignerGroupDispatchAction.java @@ -0,0 +1,345 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.ParamDao; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroup; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatchValue; + +public class DesignerGroupDispatchAction extends StdSwitchAction +{ + private static final Log log = LogFactory.getLog(DesignerGroupDispatchAction.class); + + @Override + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("operatorCode", "请选择一个设计师")); + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("designerGroupId", "设计师组不能为空")); + request.addValidate(new IsNotEmpty("operatorCode", "设计师不能为空")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt("page.size", 15); + Selector sel = new Selector(); + sel.addMaybeLike("operatorCode", request.getParameter("operatorCode")); + sel.addMaybe("designerGroupId", request.getParameterLong("designerGroupId")); + sel.addMaybe("orgId", request.getParameterLong("orgId")); + sel.addOrderbyDesc("status"); + sel.addOrderbyDesc("modifyTime"); + + PageResult pageResult = ORM.get(ZTable.class).page(DesignerGroupDispatch.class, page, pageSize, sel); + List designerGroupList = ORM.get(ZTable.class).list(DesignerGroup.class, new Selector().addMust("status", 1)); + List typeList = DesignTypeDao.list(); + Map typeMap = new HashMap(); + for (DesignType designType : typeList) + { + typeMap.put(designType.getTypeId(), designType.getTypeName()); + } + Map designerGroupMap = new HashMap(); + for (DesignerGroup designerGroup : designerGroupList) + { + designerGroupMap.put(designerGroup.getDesignerGroupId(), designerGroup.getDesignerGroupName()); + } + + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + selOrg.addMustNotEqual("orgId", 1808071102554512L); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + request.setAttribute("orgList", orgList); + + request.setAttribute("typeMap", typeMap); + request.setAttribute("designerGroupList", designerGroupList); + request.setAttribute("pageResult", pageResult); + request.setAttribute("designerGroupMap", designerGroupMap); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + List industryList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + List typeList = DesignTypeDao.list(); + List designerGroupList = ORM.get(ZTable.class).list(DesignerGroup.class, new Selector().addMust("status", 1)); + Selector selector = new Selector(); + selector.addMust("operatorStatus", 0); + selector.addMustNotEqual("orgId", 1805031820320001L); + selector.addMustNotEqual("orgId", 1808071102554512L); + List operatorList = ORM.get(ZTable.class).list(ZmrOperator.class, selector); + List merchantList = ORM.get(ZTable.class).list(DesignMerchant.class); + + request.setAttribute("operatorList", operatorList); + request.setAttribute("typeList", Jsons.toString(typeList)); + request.setAttribute("industryList", Jsons.toString(industryList)); + request.setAttribute("afterList", ParamDao.doGetAfterNameParam()); + request.setAttribute("designerGroupList", designerGroupList); + request.setAttribute("designTypeList", typeList); + request.setAttribute("merchantList", merchantList); + } + + @Override + @AnTransaction + protected void insert(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode", ""); + long maxOrderAmount = request.getParameterAmount2R("maxOrderAmount", 0); + long minOrderAmount = request.getParameterAmount2R("minOrderAmount", 0); + long designerGroupId = request.getParameterLong("designerGroupId"); + int isShowCost = request.getParameterInt("isShowCost", 1); + int isShowQddt = request.getParameterInt("isShowQddt", 1); + ZmrOperator zmrOperator = ORM.get(ZTable.class).item(ZmrOperator.class, new Selector().addMust("operatorCode", operatorCode)); + if ("reg".equals(zmrOperator.getOperatorParam())) + { + request.returnHistory("该设计师未通过入驻审核"); + return; + } + + DesignerGroupDispatch designerGroupDispatch = request.getParameter(DesignerGroupDispatch.class); + designerGroupDispatch.setOrgId(zmrOperator.getOrgId()); + designerGroupDispatch.setMaxOrderAmount(maxOrderAmount); + designerGroupDispatch.setMinOrderAmount(minOrderAmount); + designerGroupDispatch.setModifyOperatorCode(request.getSessionName()); + designerGroupDispatch.setModifyTime(Sqls.nowTimestamp()); + designerGroupDispatch.setIsShowCost(isShowCost); + designerGroupDispatch.setIsShowQddt(isShowQddt); + designerGroupDispatch + .setWaiveNum(ORM.get(ZTable.class).item(DesignerGroup.class, new Selector().addMust("designerGroupId", designerGroupId)).getMaxWaiveNum()); + int count = ORM.get(ZTable.class).count(DesignerGroupDispatch.class, new Selector().addMust("operatorCode", operatorCode)); + if (count > 0) + { + request.returnHistory("已有该设计师配置"); + return; + } + designerGroupDispatch.setStatus(1); + Transaction tx = null; + try + { + tx = TransactionManager.beginTransaction(); + insertDesignerGroupDispatch(designerGroupDispatch, request); + tx.commit(); + } + catch (Exception e) + { + if (tx != null) + { + tx.rollback(); + } + request.returnHistory("保存失败,请稍后再试"); + log.error("新增设计师配置失败", e); + } + finally + { + if (tx != null) + { + tx.close(); + } + } + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode", ""); + DesignerGroupDispatch designerGroupDispatch = ORM.get(ZTable.class).item(DesignerGroupDispatch.class, new Selector("operatorCode", operatorCode)); + if (designerGroupDispatch == null) + { + request.setResponseError("该设计师配置不存在"); + return; + } + + List industryList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + List typeList = DesignTypeDao.list(); + List groupDispatchValues = ORM.get(ZTable.class).list(DesignerGroupDispatchValue.class, + new Selector("operatorCode", operatorCode)); + List designerGroupList = ORM.get(ZTable.class).list(DesignerGroup.class, new Selector().addMust("status", 1)); + String[] afterNames = Validates.isNotEmpty(designerGroupDispatch.getAfterNames()) ? designerGroupDispatch.getAfterNames().split(",") : new String[0]; + + // 免检产品 + List freeCheckTypes = new ArrayList(); + for (DesignerGroupDispatchValue value : groupDispatchValues) + { + if (value.getRelatedType() == 5) + { + freeCheckTypes.add(value.getRelatedValue()); + } + } + + // 关联渠道 + List merchantList = ORM.get(ZTable.class).list(DesignMerchant.class); + String[] merchantIdStrings = Validates.isNotEmpty(designerGroupDispatch.getMerchantIds()) ? designerGroupDispatch.getMerchantIds().split(",") + : new String[0]; + List merchantIds = new ArrayList(); + for (String merchantId : merchantIdStrings) + { + merchantIds.add(Long.parseLong(merchantId)); + } + + request.setAttribute("designerGroupDispatch", designerGroupDispatch); + request.setAttribute("afterNames", Lists.toList(afterNames)); + request.setAttribute("typeList", Jsons.toString(typeList)); + request.setAttribute("industryList", Jsons.toString(industryList)); + request.setAttribute("groupDispatchValues", Jsons.toString(groupDispatchValues)); + request.setAttribute("afterList", ParamDao.doGetAfterNameParam()); + request.setAttribute("designerGroupList", designerGroupList); + request.setAttribute("designTypeList", typeList); + request.setAttribute("freeCheckTypes", freeCheckTypes); + request.setAttribute("merchantList", merchantList); + request.setAttribute("merchantIds", merchantIds); + } + + @Override + @AnTransaction + protected void update(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode", ""); + long maxOrderAmount = request.getParameterAmount2R("maxOrderAmount", 0); + long minOrderAmount = request.getParameterAmount2R("minOrderAmount", 0); + int isShowCost = request.getParameterInt("isShowCost", 1); + int isShowQddt = request.getParameterInt("isShowQddt", 1); + ZmrOperator zmrOperator = ORM.get(ZTable.class).item(ZmrOperator.class, new Selector().addMust("operatorCode", operatorCode)); + DesignerGroupDispatch designerGroupDispatch = request.getParameter(DesignerGroupDispatch.class); + designerGroupDispatch.setOrgId(zmrOperator.getOrgId()); + designerGroupDispatch.setMaxOrderAmount(maxOrderAmount); + designerGroupDispatch.setMinOrderAmount(minOrderAmount); + designerGroupDispatch.setModifyOperatorCode(request.getSessionName()); + designerGroupDispatch.setModifyTime(Sqls.nowTimestamp()); + designerGroupDispatch.setWaiveNum(request.getParameterInt("WaiveNum")); + designerGroupDispatch.setIsShowCost(isShowCost); + designerGroupDispatch.setIsShowQddt(isShowQddt); + Transaction tx = null; + try + { + tx = TransactionManager.beginTransaction(); + ORM.get(ZTable.class).delete(DesignerGroupDispatchValue.class, new Selector().addMust("operatorCode", operatorCode)); + insertDesignerGroupDispatch(designerGroupDispatch, request); + tx.commit(); + } + catch (Exception e) + { + if (tx != null) + { + tx.rollback(); + } + request.returnHistory("保存失败,请稍后再试"); + log.error("修改设计师失败", e); + } + finally + { + if (tx != null) + { + tx.close(); + } + } + } + + /** + * 添加设计师数据 + * + * @param designerGroup + * @param request + * @throws Exception + */ + private void insertDesignerGroupDispatch(DesignerGroupDispatch designerGroupDispatch, HttpRequest request) throws Exception + { + String operatorCode = designerGroupDispatch.getOperatorCode(); + int[] typeArray = + { + 0, 1, 2, 3, 4 + }; + ORM.get(ZTable.class).replace(designerGroupDispatch); + for (int i = 0; i < typeArray.length; i++) + { + List typeValues = JSONObject.parseArray(request.getParameter("type" + i, "[]"), Long.class); + List list = new ArrayList(); + if (Validates.isNotEmpty(typeValues)) + { + for (Long value : typeValues) + { + DesignerGroupDispatchValue groupDispatchValue = new DesignerGroupDispatchValue(); + groupDispatchValue.setDesignerGroupDispatchValueId(Ids.longId()); + groupDispatchValue.setOperatorCode(operatorCode); + groupDispatchValue.setRelatedType(i); + groupDispatchValue.setRelatedValue(value); + list.add(groupDispatchValue); + } + ORM.get(ZTable.class).insertBatch(list); + } + } + + // 保存免检产品配置 + String[] freeCheckTypes = request.getParameterValues("freeCheckTypes"); + List valueList = new ArrayList(); + if (Validates.isNotEmpty(freeCheckTypes)) + { + for (String value : freeCheckTypes) + { + DesignerGroupDispatchValue groupDispatchValue = new DesignerGroupDispatchValue(); + groupDispatchValue.setDesignerGroupDispatchValueId(Ids.longId()); + groupDispatchValue.setOperatorCode(operatorCode); + groupDispatchValue.setRelatedType(5); + groupDispatchValue.setRelatedValue(Long.parseLong(value)); + valueList.add(groupDispatchValue); + } + ORM.get(ZTable.class).insertBatch(valueList); + } + } + + @Override + @AnTransaction + protected void delete(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode"); + ORM.get(ZTable.class).delete(DesignerGroupDispatchValue.class, new Selector().addMust("operatorCode", operatorCode)); + ORM.get(ZTable.class).delete(DesignerGroupDispatch.class, operatorCode); + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/GroupMembersAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/GroupMembersAction.java new file mode 100644 index 0000000..cc2ee42 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/GroupMembersAction.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.stat.DesignGroup; + +public class GroupMembersAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + Selector selector = new Selector(); + if (ZmrOrgDao.getOrgRootId(request) != orgId) + selector.addMust("orgId", orgId); + selector.addOrderbyAsc("groupSeq"); + List groupList = ORM.get(ZTable.class).list(DesignGroup.class, selector); + + request.setAttribute("groupList", groupList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/IndustryListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/IndustryListAction.java new file mode 100644 index 0000000..9886e9c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/IndustryListAction.java @@ -0,0 +1,98 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; + +public class IndustryListAction extends StdSwitchAction +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("industryId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsLen("industryName", "行业名称不能为空且不能超过20个字符", 1, 20)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + List industryList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + + request.setAttribute("industryList", industryList); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long industryId = request.getParameterLong("industryId"); + DesignIndustry industry = ORM.get(ZTable.class).item(DesignIndustry.class, industryId); + + request.setAttribute("industry", industry); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + DesignIndustry industry = request.getParameter(DesignIndustry.class); + + industry.setIndustryId(Ids.longId13()); + + if (industry.getIndustrySeq() <= 0) + { + industry.setIndustrySeq(ORM.get(ZTable.class).count(DesignIndustry.class) + 1); + } + + ORM.get(ZTable.class).insert(industry); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + DesignIndustry industry = request.getParameter(DesignIndustry.class); + + if (industry.getIndustrySeq() <= 0) + { + industry.setIndustrySeq(ORM.get(ZTable.class).count(DesignIndustry.class) + 1); + } + + ORM.get(ZTable.class).replace(industry); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long industryId = request.getParameterLong("industryId"); + ORM.get(ZTable.class).delete(DesignIndustry.class, industryId); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/MembersSelectorAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/MembersSelectorAction.java new file mode 100644 index 0000000..b33cafa --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/MembersSelectorAction.java @@ -0,0 +1,105 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.stat.DesignGroup; +import com.zhiqim.yangcai.design.dbo.stat.GroupMembers; + +/**** + * TODO:设计师选择 + * + * @version v1.0.0 @author lgz 2019-3-6 新建与整理 + */ +public class MembersSelectorAction implements Action +{ + public void execute(HttpRequest request) throws Exception + { + request.setResponsePrivateCache(); + int operatorType = request.getParameterInt("operatorType"); + //查询本组织操作员(超级管理员可以查管理员,管理员和操作员只能查操作员) + long orgId = request.getParameterLong("orgId"); + if(orgId == -1) + return; + List excludesList = new ArrayList(); + + //获取查询排除的人 + switch (operatorType) + { + case 1://选择组长 + //需要排除的人 + Selector sel = new Selector(); + sel.addOrderbyAsc("orgId,groupSeq"); + List list = ORM.get(ZTable.class).list(DesignGroup.class, sel); + for (DesignGroup designGroup : list) + excludesList.add(designGroup.getGroupLeader()); + break; + case 2://选择操作员 + long groupId = request.getParameterLong("groupId"); + if (groupId == -1) + { + request.returnCloseDialog("未知小组编号"); + return; + } + + //有预设的不能选 + Selector sel1 = new Selector("startDate", DateTimes.getNextMonthFirstDay()); + List lms = ORM.get(ZTable.class).list(GroupMembers.class, sel1); + for (GroupMembers m : lms) + excludesList.add(m.getUserCode()); + + //未结束 组长不能选 + Selector sel2 = new Selector("isGroupLeader", 1); + sel2.addMustIsNull("endDate"); + List lms2 = ORM.get(ZTable.class).list(GroupMembers.class, sel2); + for (GroupMembers m : lms2) + excludesList.add(m.getUserCode()); + + break; + default: + request.returnCloseDialog("未知选择操作类型"); + return; + } + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + Selector selector = new Selector(); + selector.addMustThenG("operatorType", sessionUser.getOperatorTypeThenG()); + selector.addMust("orgId", orgId); + selector.addMust("operatorStatus", 0); + String operatorKey = request.getParameter("operatorKey"); + if (Validates.isNotEmpty(operatorKey))//条件 + selector.addOr(new Selector().addMaybeLike("operatorCode", operatorKey).addMaybeLike("operatorName", operatorKey)); + + if (excludesList.size() > 0) + selector.addMustNotIn("operatorCode", Arrays.toStringArray(Lists.toString(excludesList))); + List list = ZmrBootstrap.tableOpr(request).list(ZmrOperator.class, selector); + + request.setAttribute("list", list); + request.setAttribute("multiSelect", operatorType == 2); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/OrderConvertAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/OrderConvertAction.java new file mode 100644 index 0000000..f38d750 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/OrderConvertAction.java @@ -0,0 +1,197 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.Arrays; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsGreaterThenValue; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.stat.OrderConvert; + +/** + * 订单折算类 + * + * @version v1.0.0 @author liuhu 2018-12-13 新建与整理 + */ +public class OrderConvertAction extends StdSwitchAction +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("convertId", "请选择一个选项")); + request.addParam("page", request.getParameterInt("page", 1)); + request.setAttribute("page", request.getParameterInt("page", 1)); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsGreaterThenValue("prdTypeId", "请选择产品类型", "0")); + request.addValidate(new IsGreaterThenValue("convertType", "请选择折算类型", "-1")); + request.addValidate(new IsLen("convertNum", "折算系数不能为空且不超过10个字符", 1, 10)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + long prdTypeId = request.getParameterLong("prdTypeId"); + + Selector selector = new Selector(); + selector.addOrderbyAsc("prdTypeId"); + if (prdTypeId != -1) + { + selector.addMustInLong("prdTypeId", prdTypeId); + } + PageResult pageResult = ORM.get(ZTable.class).page(OrderConvert.class, page, pageSize, selector); + request.setAttribute("pageResult", pageResult); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String[] modulus = request.getParameterValues("modulus"); + String[] modulusConvertNum = request.getParameterValues("modulusConvertNum"); + int convertType = request.getParameterInt("convertType"); + + // 如果折算类型为系数则校验-折算模数和折算系数 + if (2 == convertType) + { + if (Validates.isEmpty(modulus) || Validates.isEmpty(modulusConvertNum)) + { + request.returnHistory("模数折算系数不能为空!"); + return; + } + if (modulus.length != modulusConvertNum.length) + { + request.returnHistory("模数折算系数不能为空!"); + return; + } + for (int i = 0; i < modulusConvertNum.length; i++) + { + if (Validates.isEmpty(modulusConvertNum[i])) + { + request.returnHistory("模数折算系数不能为空!"); + return; + } + } + } + + String convertStr = request.getParameter("convertNum"); + long prdTypeId = request.getParameterLong("prdTypeId"); + String prdTypeName = request.getParameter("prdTypeName"); + + double convertNum = Double.valueOf(convertStr); + + Selector selector = new Selector(); + selector.addMustInLong("prdTypeId", prdTypeId); + OrderConvert orderConvert = ORM.get(ZTable.class).item(OrderConvert.class, selector); + if (orderConvert != null) + { + request.returnHistory("每种产品只允许一条折算系数"); + return; + } + + orderConvert = new OrderConvert(); + orderConvert.setConvertId(Ids.longId13()); + orderConvert.setConvertType(convertType); + orderConvert.setConvertNum(convertNum); + orderConvert.setPrdTypeId(prdTypeId); + orderConvert.setPrdTypeName(prdTypeName); + orderConvert.setConvertModulus(request.getParameter("modulus")); + orderConvert.setConvertModulusNum(request.getParameter("modulusConvertNum")); + orderConvert.setModifyTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(orderConvert); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long convertId = request.getParameterLong("convertId"); + OrderConvert orderConvert = ORM.get(ZTable.class).item(OrderConvert.class, convertId); + request.setAttribute("convertModulus", Arrays.asList(orderConvert.getConvertModulus().split(","))); + request.setAttribute("convertModulusNum", Arrays.asList(orderConvert.getConvertModulusNum().split(","))); + request.setAttribute("orderConvert", orderConvert); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long convertId = request.getParameterLong("convertId"); + String[] modulus = request.getParameterValues("modulus"); + String[] modulusConvertNum = request.getParameterValues("modulusConvertNum"); + int convertType = request.getParameterInt("convertType"); + + // 如果折算类型为系数则校验-折算模数和折算系数 + if (2 == convertType) + { + if (Validates.isEmpty(modulus) || Validates.isEmpty(modulusConvertNum)) + { + request.returnHistory("模数折算系数不能为空!"); + return; + } + if (modulus.length != modulusConvertNum.length) + { + request.returnHistory("模数折算系数不能为空!"); + return; + } + for (int i = 0; i < modulusConvertNum.length; i++) + { + if (Validates.isEmpty(modulusConvertNum[i])) + { + request.returnHistory("模数折算系数不能为空!"); + return; + } + } + } + + String convertStr = request.getParameter("convertNum"); + double convertNum = Double.valueOf(convertStr); + + Updater updater = new Updater(); + updater.addMust("convertId", convertId); + updater.addField("convertType", convertType); + updater.addField("convertNum", convertNum); + updater.addField("convertModulus", request.getParameter("modulus")); + updater.addField("convertModulusNum", request.getParameter("modulusConvertNum")); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(OrderConvert.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long convertId = request.getParameterLong("convertId"); + + ORM.get(ZTable.class).delete(OrderConvert.class, convertId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/OrderMerchantAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/OrderMerchantAction.java new file mode 100644 index 0000000..05aa683 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/OrderMerchantAction.java @@ -0,0 +1,105 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; + +/*** + * 订单商户 + * + * @version v1.0.0 @author longguizhi 2018-9-10 新建与整理 + */ +public class OrderMerchantAction extends StdSwitchAction +{ + + @Override + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("merchantId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + request.addValidate(new IsLen("merchantName", "商户名不能为空,且不能操作20个字符", 1, 20)); + request.addValidate(new IsLen("merchantSecret", "商户名不能为空,且不能操作2048个字符", 6, 2048)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + List merchantList = ORM.get(ZTable.class).list(DesignMerchant.class); + request.setAttribute("merchantList", merchantList); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long merchantId = request.getParameterLong("merchantId", 0); + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, merchantId); + if (merchant == null) + { + request.returnHistory("商户不存在!"); + return; + } + + request.setAttribute("merchant", merchant); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + DesignMerchant merchant = request.getParameter(DesignMerchant.class); + merchant.setMerchantId(Ids.longId13()); + ORM.get(ZTable.class).insert(merchant); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long merchantId = request.getParameterLong("merchantId", 0); + String merchantName = request.getParameter("merchantName"); + String merchantSecret = request.getParameter("merchantSecret"); + boolean isEnabled = request.getParameterBoolean("isEnabled"); + Updater updater = new Updater(); + updater.addMust("merchantId", merchantId); + updater.addField("merchantName", merchantName); + updater.addField("merchantSecret", merchantSecret); + updater.addField("isEnabled", isEnabled); + ORM.get(ZTable.class).update(DesignMerchant.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + // TODO Auto-generated method stub + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/PerformanceParameterAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/PerformanceParameterAction.java new file mode 100644 index 0000000..4495cba --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/PerformanceParameterAction.java @@ -0,0 +1,320 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsIntegerValue; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.onex.IsFloat; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.stat.PerformanceParam; + +/** + * 设计绩效参数类 + * + * @version v1.0.0 @author liuhu 2019-1-5 新建与整理 + */ +public class PerformanceParameterAction extends StdSwitchAction +{ + + @Override + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("orgId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + request.addValidate(new IsFloat("priceLevel1", "请填写试一级单价")); + request.addValidate(new IsFloat("priceLevel1", "请填写试二级单价")); + request.addValidate(new IsFloat("priceLevel1", "请填写正三级单价")); + request.addValidate(new IsFloat("priceLevel1", "请填写正四级单价")); + request.addValidate(new IsFloat("priceLevel1", "请填写正五级单价")); + request.addValidate(new IsFloat("priceLevel1", "请填写正六级单价")); + + request.addValidate(new IsIntegerValue("level1MaxCount", "请填写试一级上限单数(1-6)字符", 0, 999999)); + request.addValidate(new IsIntegerValue("level2MaxCount", "请填写试二级上限单数(1-6)字符", 0, 999999)); + request.addValidate(new IsIntegerValue("level3MaxCount", "请填写正三级上限单数(1-6)字符", 0, 999999)); + request.addValidate(new IsIntegerValue("level4MaxCount", "请填写正四级上限单数(1-6)字符", 0, 999999)); + request.addValidate(new IsIntegerValue("level5MaxCount", "请填写正五级上限单数(1-6)字符", 0, 999999)); + request.addValidate(new IsIntegerValue("level6MaxCount", "请填写正六级上限单数(1-6)字符", 0, 999999)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 20); + String validDate = request.getParameter("validDate", DateTimes.getFirstMonthDay()); + + String validDate1 = DateTimes.compareDay(validDate, DateTimes.getNextMonthFirstDay()) > 0 ? DateTimes.getNextMonthFirstDay() : validDate; + Selector selector = new Selector(); + selector.addMustThenLE("validDate", validDate1); + selector.addOrderbyDesc("validDate");// 必须倒序显示 + selector.addOrderbyAsc("orgId"); + selector.addOrderbyDesc("priceType"); + PageResult tempPageResult = ORM.get(ZTable.class).page(PerformanceParam.class, page, pageSize, selector); + Map> dataMap = new LinkedHashMap<>(); + Map tempMap = new HashMap(); + List dataList = new ArrayList(); + for (PerformanceParam param : tempPageResult.list()) + { + List list = dataMap.get(param.getOrgId()); + list = list != null ? list : new ArrayList(); + + String key = "" + param.getOrgId() + "_" + param.getPriceType(); + PerformanceParam tp = tempMap.get(key); + if (tp == null || DateTimes.compareDay(tp.getValidDate(), param.getValidDate()) < 0) + { + tempMap.put(key, param); + list.add(param); + dataList.add(param); + } + dataMap.put(param.getOrgId(), list); + } + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, dataList); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("dataMap", dataMap); + request.setAttribute("pageResult", pageResult); + request.setAttribute("validDate", validDate); + request.setAttribute("year", Integer.valueOf(validDate.split("-")[0])); + request.setAttribute("month", Integer.valueOf(validDate.split("-")[1])); + + } + + @Override + protected void add(HttpRequest request) throws Exception + { + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + String validDate = request.getParameter("validDate"); + int priceType = request.getParameterInt("priceType"); + + if (orgId <= 0 || !Validates.isDate(validDate) || (priceType != 0 && priceType != 1)) + { + request.returnHistory("未知请求参数"); + return; + } + + PerformanceParam parameter = ORM.get(ZTable.class).item(PerformanceParam.class, + new Selector("validDate", validDate).addMust("orgId", orgId).addMust("priceType", priceType)); + if (parameter == null) + { + request.returnHistory("参数不存在"); + return; + } + + request.setAttribute("param", parameter); + } + + @Override + @AnTransaction + protected void insert(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + if (orgId == -1) + { + request.returnHistory("请选择组织"); + return; + } + + int priceType = request.getParameterInt("priceType"); + if (priceType != 1 && priceType != 0) + { + request.returnHistory("无效单价类型"); + return; + } + + PerformanceParam parameter = ORM.get(ZTable.class).item(PerformanceParam.class, new Selector("orgId", orgId).addMust("priceType", priceType)); + if (parameter != null) + { + request.returnHistory("该组织 已设置设计绩效参数"); + return; + } + + long priceLevel1 = request.getParameterAmount2RLong("priceLevel1"); + long priceLevel2 = request.getParameterAmount2RLong("priceLevel2"); + long priceLevel3 = request.getParameterAmount2RLong("priceLevel3"); + long priceLevel4 = request.getParameterAmount2RLong("priceLevel4"); + long priceLevel5 = request.getParameterAmount2RLong("priceLevel5"); + long priceLevel6 = request.getParameterAmount2RLong("priceLevel6"); + + int level1MaxCount = request.getParameterInt("level1MaxCount"); + int level2MaxCount = request.getParameterInt("level2MaxCount"); + int level3MaxCount = request.getParameterInt("level3MaxCount"); + int level4MaxCount = request.getParameterInt("level4MaxCount"); + int level5MaxCount = request.getParameterInt("level5MaxCount"); + int level6MaxCount = request.getParameterInt("level6MaxCount"); + + if (level6MaxCount != 0 && level6MaxCount <= level5MaxCount) + { + request.returnHistory("正六级上限单数 必须大于正五级上限单数"); + return; + } + + if (level5MaxCount != 0 && level5MaxCount <= level4MaxCount) + { + request.returnHistory("正五级上限单数 必须大于正四级上限单数"); + return; + } + + if (level4MaxCount != 0 && level4MaxCount <= level3MaxCount) + { + request.returnHistory("正四级上限单数 必须大于正三级上限单数"); + return; + } + + if (level3MaxCount != 0 && level3MaxCount <= level2MaxCount) + { + request.returnHistory("正三级上限单数 必须大于试二级上限单数"); + return; + } + + if (level2MaxCount != 0 && level2MaxCount <= level1MaxCount) + { + request.returnHistory("试二级上限单数 必须大于试一级上限单数"); + return; + } + + parameter = new PerformanceParam(); + parameter.setValidDate(DateTimes.getFirstMonthDay()); + parameter.setOrgId(orgId); + parameter.setPriceType(priceType); + + parameter.setPriceLevel1(priceLevel1); + parameter.setPriceLevel2(priceLevel2); + parameter.setPriceLevel3(priceLevel3); + parameter.setPriceLevel4(priceLevel4); + parameter.setPriceLevel5(priceLevel5); + parameter.setPriceLevel6(priceLevel6); + + parameter.setLevel1MaxCount(level1MaxCount); + parameter.setLevel2MaxCount(level2MaxCount); + parameter.setLevel3MaxCount(level3MaxCount); + parameter.setLevel4MaxCount(level4MaxCount); + parameter.setLevel5MaxCount(level5MaxCount); + parameter.setLevel6MaxCount(level6MaxCount); + + ORM.get(ZTable.class).insert(parameter); + } + + @Override + @AnTransaction + protected void update(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + String validDate = request.getParameter("validDate"); + int priceType = request.getParameterInt("priceType"); + if (priceType != 1 && priceType != 0) + { + request.returnHistory("无效单价类型"); + return; + } + + long priceLevel1 = request.getParameterAmount2RLong("priceLevel1"); + long priceLevel2 = request.getParameterAmount2RLong("priceLevel2"); + long priceLevel3 = request.getParameterAmount2RLong("priceLevel3"); + long priceLevel4 = request.getParameterAmount2RLong("priceLevel4"); + long priceLevel5 = request.getParameterAmount2RLong("priceLevel5"); + long priceLevel6 = request.getParameterAmount2RLong("priceLevel6"); + + int level1MaxCount = request.getParameterInt("level1MaxCount"); + int level2MaxCount = request.getParameterInt("level2MaxCount"); + int level3MaxCount = request.getParameterInt("level3MaxCount"); + int level4MaxCount = request.getParameterInt("level4MaxCount"); + int level5MaxCount = request.getParameterInt("level5MaxCount"); + int level6MaxCount = request.getParameterInt("level6MaxCount"); + + if (level6MaxCount != 0 && level6MaxCount <= level5MaxCount) + { + request.returnHistory("正六级上限单数 必须大于正五级上限单数"); + return; + } + + if (level5MaxCount != 0 && level5MaxCount <= level4MaxCount) + { + request.returnHistory("正五级上限单数 必须大于正四级上限单数"); + return; + } + + if (level4MaxCount != 0 && level4MaxCount <= level3MaxCount) + { + request.returnHistory("正四级上限单数 必须大于正三级上限单数"); + return; + } + + if (level3MaxCount != 0 && level3MaxCount <= level2MaxCount) + { + request.returnHistory("正三级上限单数 必须大于试二级上限单数"); + return; + } + + if (level2MaxCount != 0 && level2MaxCount <= level1MaxCount) + { + request.returnHistory("试二级上限单数 必须大于试一级上限单数"); + return; + } + + PerformanceParam parameter = new PerformanceParam(); + parameter.setValidDate(validDate); + parameter.setOrgId(orgId); + parameter.setPriceType(priceType); + + parameter.setPriceLevel1(priceLevel1); + parameter.setPriceLevel2(priceLevel2); + parameter.setPriceLevel3(priceLevel3); + parameter.setPriceLevel4(priceLevel4); + parameter.setPriceLevel5(priceLevel5); + parameter.setPriceLevel6(priceLevel6); + + parameter.setLevel1MaxCount(level1MaxCount); + parameter.setLevel2MaxCount(level2MaxCount); + parameter.setLevel3MaxCount(level3MaxCount); + parameter.setLevel4MaxCount(level4MaxCount); + parameter.setLevel5MaxCount(level5MaxCount); + parameter.setLevel6MaxCount(level6MaxCount); + + ORM.get(ZTable.class).replace(parameter); + + } + + @Override + @AnTransaction + protected void delete(HttpRequest request) throws Exception + { + // long orgId = request.getParameterLong("orgId"); + // + // ORM.get(ZTable.class).delete(PerformanceParam.class, orgId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/ProductConvertAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/ProductConvertAction.java new file mode 100644 index 0000000..843ffbf --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/ProductConvertAction.java @@ -0,0 +1,587 @@ +/** + * 扬彩印刷设计 + * 文件名 :ProductConvertAction.java + * 创建人 :gjx + * 创建时间:2021年3月4日 +*/ + +package com.zhiqim.yangcai.design.action.sys; + +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignOrderMeritsDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.design.DesignPrice; +import com.zhiqim.yangcai.design.dbo.design.ProductConvert; +import com.zhiqim.yangcai.design.dbo.design.ProductDesignPriceView; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.order.SelfOrder; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerLever; +import com.zhiqim.yangcai.design.model.DesignPriceModel; +import com.zhiqim.yangcai.util.RandomUtil; +import com.zhiqim.yangcai.util.RedisUtils; + +import redis.clients.jedis.Jedis; + +/** + * + * [简要描述]: 产品单价配置
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年3月4日 新建与整理 + * @version 2.0 @author hc 2021年8月16日 改版优化 + */ +@AnAlias("ProductConvertAction") +public class ProductConvertAction extends StdSwitchAction +{ + + private static final Log log = LogFactory.getLog(ProductConvertAction.class); + + @Override + protected void add(HttpRequest request) throws Exception + { + List leverList = ORM.get(ZTable.class).list(ScoreDesignerLever.class, new Selector().addOrderbyAsc("minScore")); + + request.setAttribute("leverList", leverList); + + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long convertId = request.getParameterLong("convertId"); + + ORM.get(ZTable.class).delete(ProductConvert.class, convertId); + ORM.get(ZTable.class).delete(DesignPrice.class, new Selector().addMust("convertId", convertId)); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + ProductConvert prdCvt = request.getParameter(ProductConvert.class); + + int prdSizeWidth = prdCvt.getPrdSizeWidth(); + int prdSizeHeight = prdCvt.getPrdSizeHeight(); + if ((prdSizeWidth > 0 && prdSizeHeight <= 0) || (prdSizeHeight > 0 && prdSizeWidth <= 0)) + { + request.returnHistory("请完整填写尺寸信息"); + return; + } + + boolean sizeNotNull = prdSizeWidth > 0 && prdSizeHeight > 0; + + Selector selector = new Selector(); + selector.addMust("prdTypeId", prdCvt.getPrdTypeId()); + if (sizeNotNull && Validates.isNotEmpty(prdCvt.getPrdPageName())) + { + prdCvt.setSeq(Integer.valueOf(RandomUtil.randomLengthDigit(8))); + + selector.addMustThenG("prdSizeWidth", 0); + selector.addMustThenG("prdSizeHeight", 0); + selector.addMust("prdPageName", prdCvt.getPrdPageName());// 查询产品配有尺寸 面数名称相等的数据 + } + else if (sizeNotNull) + { + prdCvt.setSeq(Integer.valueOf(RandomUtil.randomLengthDigit(6))); + + selector.addMustThenG("prdSizeWidth", 0); + selector.addMustThenG("prdSizeHeight", 0); + selector.addMustIsEmpty("prdPageName");// 查询产品配有尺寸 面数名称为空的数据 + } + else if (Validates.isNotEmpty(prdCvt.getPrdPageName())) + { + prdCvt.setSeq(Integer.valueOf(RandomUtil.randomLengthDigit(4))); + + selector.addMust("prdPageName", prdCvt.getPrdPageName()); + selector.addMust("prdSizeWidth", 0); + selector.addMust("prdSizeHeight", 0);// 查看产品面数名称相等 尺寸为空的数据 + } + else + { + prdCvt.setSeq(Integer.valueOf(RandomUtil.randomLengthDigit(2))); + + selector.addMustIsEmpty("prdPageName"); + selector.addMust("prdSizeWidth", 0); + selector.addMust("prdSizeHeight", 0);// 查询产品面数 尺寸为空的数据 + } + + if (sizeNotNull) + {// 添加有尺寸的配置需要校验 + List convertList = ORM.get(ZTable.class).list(ProductConvert.class, selector); + for (ProductConvert cvt : convertList) + { + int dbPrdSizeWidth = cvt.getPrdSizeWidth(); + int dbPrdSizeHeight = cvt.getPrdSizeHeight(); + if ((prdSizeWidth == dbPrdSizeWidth && prdSizeHeight == dbPrdSizeHeight) || (prdSizeWidth == dbPrdSizeHeight && prdSizeHeight == dbPrdSizeWidth) + || (prdSizeWidth < dbPrdSizeWidth && prdSizeHeight > dbPrdSizeHeight) + || (prdSizeWidth > dbPrdSizeWidth && prdSizeHeight < dbPrdSizeHeight)) + { + request.returnHistory("尺寸不允许重复添加或者交叉存在"); + return; + } + } + } + + Timestamp nowTimestamp = Sqls.nowTimestamp(); + prdCvt.setAddOperator(request.getSessionName()); + prdCvt.setAddTime(nowTimestamp); + prdCvt.setUpdateOperator(request.getSessionName()); + prdCvt.setUpdateTime(nowTimestamp); + ORM.get(ZTable.class).insert(prdCvt); + + ProductConvert item = ORM.get(ZTable.class).item(ProductConvert.class, + new Selector().addMust("prdTypeId", prdCvt.getPrdTypeId()).addMust("addTime", nowTimestamp)); + + // 普通设计单价 + String prdPriceParameter = request.getParameter("prdPriceDate"); + if (Validates.isEmpty(prdPriceParameter)) + { + request.setResponseError("请设置生效时间!"); + return; + } + String prdPriceDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new SimpleDateFormat("yyyy-MM-dd").parse(prdPriceParameter)); + DesignPrice designPrice = new DesignPrice(); + designPrice.setConvertId(item.getConvertId()); + designPrice.setPrdTypeId(item.getPrdTypeId()); + designPrice.setDraftType(2);// 普通设计 + designPrice.setDesignPriceMoney(Amounts.toFen(request.getParameter("prdPrice"), 0L)); + designPrice.setEffectTime(Sqls.toTimestamp(prdPriceDate)); + designPrice.setStatus(1);// 新增默认为1生效 + ORM.get(ZTable.class).insert(designPrice); + + // 资深设计单价 + String srPriceParameter = request.getParameter("srPriceDate"); + if (Validates.isEmpty(srPriceParameter)) + { + request.setResponseError("请设置生效时间!"); + return; + } + String srPriceDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new SimpleDateFormat("yyyy-MM-dd").parse(srPriceParameter)); + DesignPrice srPrice = new DesignPrice(); + srPrice.setConvertId(item.getConvertId()); + srPrice.setPrdTypeId(item.getPrdTypeId()); + srPrice.setDraftType(3);// 资深设计 + srPrice.setDesignPriceMoney(Amounts.toFen(request.getParameter("srPrice"), 0L)); + srPrice.setEffectTime(Sqls.toTimestamp(srPriceDate)); + srPrice.setStatus(1);// 新增默认为1生效 + ORM.get(ZTable.class).insert(srPrice); + + // 改稿单价 + String rewritePriceParameter = request.getParameter("rewritePriceDate"); + if (Validates.isEmpty(rewritePriceParameter)) + { + request.setResponseError("请设置生效时间!"); + return; + } + String rewritePriceDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new SimpleDateFormat("yyyy-MM-dd").parse(rewritePriceParameter)); + DesignPrice rewritePrice = new DesignPrice(); + rewritePrice.setConvertId(item.getConvertId()); + rewritePrice.setPrdTypeId(item.getPrdTypeId()); + rewritePrice.setDraftType(1);// 改稿自来稿 + rewritePrice.setDesignPriceMoney(Amounts.toFen(request.getParameter("templateDraftPrice"), 0L)); + rewritePrice.setEffectTime(Sqls.toTimestamp(rewritePriceDate)); + rewritePrice.setStatus(1);// 新增默认为1生效 + ORM.get(ZTable.class).insert(rewritePrice); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 36); + long prdTypeId = request.getParameterLong("prdTypeId"); + String prdSizeStd = request.getParameter("prdSizeStd"); + String prdPageName = request.getParameter("prdPageName"); + + Selector selector = new Selector(); + selector.addMaybe("prdTypeId", prdTypeId); + selector.addMaybe("prdSizeStd", prdSizeStd); + selector.addMaybe("prdPageName", prdPageName); + selector.addOrderbyAsc("prdTypeId"); + selector.addOrderbyDesc("seq"); + + PageResult pageResult = ORM.get(ZView.class).page(ProductDesignPriceView.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + List dpmList = new ArrayList(); + DesignPriceModel dpm = null; + long statConvertId = 0L; + long endConvertId = 0L; + for (ProductDesignPriceView prdp : pageResult.list()) + { + if (prdp.getStatus() != 1) + { + continue; + } + + if (statConvertId == prdp.getConvertId()) + { + if (prdp.getDraftType() == 2) + { + dpm.setDraftCommonDesign(prdp.getDesignPriceMoney()); + } + else if (prdp.getDraftType() == 1) + { + dpm.setDraftTemplate(prdp.getDesignPriceMoney()); + } + else if (prdp.getDraftType() == 3) + { + dpm.setSrDesign(prdp.getDesignPriceMoney()); + } + } + else + { + dpm = new DesignPriceModel(); + dpm.setConvertId(prdp.getConvertId()); + if (prdp.getDraftType() == 2) + { + dpm.setDraftCommonDesign(prdp.getDesignPriceMoney()); + } + else if (prdp.getDraftType() == 1) + { + dpm.setDraftTemplate(prdp.getDesignPriceMoney()); + } + else if (prdp.getDraftType() == 3) + { + dpm.setSrDesign(prdp.getDesignPriceMoney()); + } + dpm.setPrdPageName(prdp.getPrdPageName()); + dpm.setPrdSizeHeight(prdp.getPrdSizeHeight()); + dpm.setPrdSizeWidth(prdp.getPrdSizeWidth()); + dpm.setPrdTypeId(prdp.getPrdTypeId()); + dpm.setSeq(prdp.getSeq()); + dpm.setUpdateOperator(prdp.getUpdateOperator()); + dpm.setUpdateTime(prdp.getUpdateTime()); + dpm.setAlias(prdp.getAlias()); + } + + statConvertId = prdp.getConvertId(); + if (statConvertId == endConvertId) + { + dpmList.add(dpm); + } + + endConvertId = prdp.getConvertId(); + } + PageResult resultList = PageBuilder.newResult(pageResult.total(), page, pageSize, dpmList); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", resultList); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long convertId = request.getParameterLong("convertId"); + + List itemList = ORM.get(ZView.class).list(ProductDesignPriceView.class, new Selector().addMust("convertId", convertId)); + ProductConvert item = ORM.get(ZTable.class).item(ProductConvert.class, new Selector().addMust("convertId", convertId)); + request.setAttribute("convert", item); + request.setAttribute("ProductDesignPriceView", itemList); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + ProductConvert prdCvt = request.getParameter(ProductConvert.class); + + int prdSizeWidth = prdCvt.getPrdSizeWidth(); + int prdSizeHeight = prdCvt.getPrdSizeHeight(); + if ((prdSizeWidth > 0 && prdSizeHeight <= 0) || (prdSizeHeight > 0 && prdSizeWidth <= 0)) + { + request.returnHistory("请完整填写尺寸信息"); + return; + } + + Updater updater = new Updater(); + updater.addMust("convertId", prdCvt.getConvertId()); + updater.addField("seq", Integer.valueOf(RandomUtil.randomLengthDigit(2))); + + boolean sizeNotNull = prdSizeWidth > 0 && prdSizeHeight > 0; + + Selector selector = new Selector(); + selector.addMust("prdTypeId", prdCvt.getPrdTypeId()); + selector.addMustNotEqual("convertId", prdCvt.getConvertId());// 排除自己 + if (sizeNotNull && Validates.isNotEmpty(prdCvt.getPrdPageName())) + { + updater.addField("seq", Integer.valueOf(RandomUtil.randomLengthDigit(8))); + + selector.addMustThenG("prdSizeWidth", 0); + selector.addMustThenG("prdSizeHeight", 0); + selector.addMust("prdPageName", prdCvt.getPrdPageName());// 查询产品配有尺寸 面数名称相等的数据 + } + else if (sizeNotNull) + { + updater.addField("seq", Integer.valueOf(RandomUtil.randomLengthDigit(6))); + + selector.addMustThenG("prdSizeWidth", 0); + selector.addMustThenG("prdSizeHeight", 0); + selector.addMustIsEmpty("prdPageName");// 查询产品配有尺寸 面数名称为空的数据 + } + else if (Validates.isNotEmpty(prdCvt.getPrdPageName())) + { + updater.addField("seq", Integer.valueOf(RandomUtil.randomLengthDigit(4))); + + selector.addMust("prdPageName", prdCvt.getPrdPageName()); + selector.addMust("prdSizeWidth", 0); + selector.addMust("prdSizeHeight", 0);// 查看产品面数名称相等 尺寸为空的数据 + } + else + { + + selector.addMustIsEmpty("prdPageName"); + selector.addMust("prdSizeWidth", 0); + selector.addMust("prdSizeHeight", 0);// 查询产品面数 尺寸为空的数据 + } + + if (sizeNotNull) + {// 添加有尺寸的配置需要校验 + List convertList = ORM.get(ZTable.class).list(ProductConvert.class, selector); + for (ProductConvert cvt : convertList) + { + int dbPrdSizeWidth = cvt.getPrdSizeWidth(); + int dbPrdSizeHeight = cvt.getPrdSizeHeight(); + if ((prdSizeWidth == dbPrdSizeWidth && prdSizeHeight == dbPrdSizeHeight) || (prdSizeWidth == dbPrdSizeHeight && prdSizeHeight == dbPrdSizeWidth) + || (prdSizeWidth < dbPrdSizeWidth && prdSizeHeight > dbPrdSizeHeight) + || (prdSizeWidth > dbPrdSizeWidth && prdSizeHeight < dbPrdSizeHeight)) + { + request.returnHistory("尺寸不允许重复添加或者交叉存在"); + return; + } + } + } + + updater.addField("prdTypeId", prdCvt.getPrdTypeId()); + updater.addField("prdSizeWidth", prdSizeWidth); + updater.addField("prdSizeHeight", prdSizeHeight); + updater.addField("prdPageName", prdCvt.getPrdPageName()); + updater.addField("updateOperator", request.getSessionName()); + updater.addField("updateTime", Sqls.nowTimestamp()); + updater.addField("alias", prdCvt.getAlias()); + ORM.get(ZTable.class).update(ProductConvert.class, updater); + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + } + + @Override + protected void validateId(HttpRequest request) throws Exception + { + } + + // 立即生效单个设计单价 + public static void useDesignPrice(HttpRequest request, long priceId, long prdPriceId) throws Exception + { + ORM.get(ZTable.class).update(DesignPrice.class, new Updater().addMust("priceId", prdPriceId).addField("status", 0)); + ORM.get(ZTable.class).update(DesignPrice.class, new Updater().addMust("priceId", priceId).addField("status", 1)); + } + + // 删除单个设计单价 + public static void delDesignPrice(HttpRequest request, long priceId) throws Exception + { + ORM.get(ZTable.class).delete(DesignPrice.class, priceId); + } + + // 添加单个设计单价 + public static void insertDesignPrice(HttpRequest request) throws Exception + { + String prdPriceDate = request.getParameter("prdPriceDate"); + long prdPrice = request.getParameterLong("prdPrice"); + long convertId = request.getParameterLong("convertId"); + long prdTypeId = request.getParameterLong("prdTypeId"); + int draftType = request.getParameterInt("draftType"); + + Date prpDate = new SimpleDateFormat("yyyy-MM").parse(prdPriceDate); + String prpDateString = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(prpDate); + + DesignPrice designPrice = new DesignPrice(); + designPrice.setDesignPriceMoney(prdPrice * 100); + designPrice.setEffectTime(Sqls.toTimestamp(prpDateString)); + List dpList = ORM.get(ZTable.class).list(DesignPrice.class, + new Selector().addMust("convertId", convertId).addMust("draftType", draftType)); + if (dpList.size() > 0) + { + designPrice.setStatus(0);// 无信息或默认是 0失效 + } + else + { + designPrice.setStatus(1);// 生效 + } + designPrice.setConvertId(convertId); + designPrice.setPrdTypeId(prdTypeId); + designPrice.setDraftType(draftType); + ORM.get(ZTable.class).replace(designPrice); + } + + /* + * public static void designPrice(HttpRequest request) throws Exception + * { + * List pcList = ORM.get(ZTable.class).list(ProductConvert.class); + * for (ProductConvert pc : pcList) + * { + * DesignPrice designPrice = new DesignPrice(); + * designPrice.setConvertId(pc.getConvertId()); + * designPrice.setDesignPriceMoney(pc.getPrdPriceRank1()); + * designPrice.setDraftType(2); + * designPrice.setPrdTypeId(pc.getPrdTypeId()); + * designPrice.setStatus(1); + * designPrice.setEffectTime(pc.getUpdateTime()); + * ORM.get(ZTable.class).insert(designPrice); + * DesignPrice designPrice2 = new DesignPrice(); + * designPrice2.setConvertId(pc.getConvertId()); + * designPrice2.setDesignPriceMoney(pc.getTemplateDraftPrice()); + * designPrice2.setDraftType(1); + * designPrice2.setPrdTypeId(pc.getPrdTypeId()); + * designPrice2.setStatus(1); + * designPrice2.setEffectTime(pc.getUpdateTime()); + * ORM.get(ZTable.class).insert(designPrice2); + * } + * } + */ + + // 修改订单佣金 + public static void editDesignPrice(HttpRequest request, Long designId, String designPrice) throws Exception + { + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", designId)); + if (Validates.isEmpty(order)) + { + request.setResponseError("该订单不存在!"); + return; + } + /* if (order.getStatus() >= StatusConstants.ORDER_55.value()) + { + request.setResponseError("定稿订单不可修改设计单价!"); + return; + }*/ + Number num = Float.parseFloat(designPrice) * 100; + long designPrices = Long.valueOf(num.intValue()); + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("designPrice", designPrices); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 记录日志 + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "修改订单单价", EventConstants.ORDER_42.value()); + DesignOrderMeritsDao.saveDesignOrderMerits(designId, "3", "", "", request.getSessionName(), order.getDesigner(), + order.getTypeId(), order.getStatus(), order.getOrderText(), order.getDesignPrice(), designPrices); + } + + // 修改加急费 + public static void editUrgentPrice(HttpRequest request, Long designId, String designPrice) throws Exception + { + Number num = Float.parseFloat(designPrice) * 100; + long designPrices = Long.valueOf(num.intValue()); + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, new Selector().addMust("designId", designId)); + Updater updater = new Updater(); + if (Validates.isEmpty(order)) + { + request.setResponseError("该订单不存在!"); + return; + } + if (order.getStatus() >= StatusConstants.ORDER_55.value()) + { + request.setResponseError("定稿订单不可修改加急费!"); + return; + } + + if (designPrices == 0)// 加急费为0则取消加急 + { + ORM.get(ZTable.class).update(DesignOrder.class, new Updater().addMust("designId", designId).addField("isUrgent", false)); + ORM.get(ZTable.class).update(SelfOrder.class, new Updater().addMust("designId", designId).addField("urgentPrice", designPrices)); + DesignOrderMeritsDao.saveDesignOrderMerits(designId, "4", "", "", request.getSessionName(), order.getDesigner(), + order.getTypeId(), order.getStatus(), order.getOrderText(), order.getUrgentPrice(), designPrices); + request.setAlertMsg("取消加急成功!"); + return; + } + + if (order.getStatus() == StatusConstants.ORDER_10.value()) + { + Jedis conn = RedisUtils.getConn(); + try + { + String locakKey = "UrgentPrice:" + designId; + conn.set(locakKey, designId.toString()); + conn.expire(locakKey, 1800); // 30分钟过期 + } + catch (Exception e) + { + log.error("订单:" + designId + "修改加急费设置加急时间失败!", e); + return; + } + finally + { + conn.close(); + } + } + updater.addMust("designId", designId); + updater.addField("isUrgent", true); // 加急 + ORM.get(ZTable.class).update(DesignOrder.class, updater); + ORM.get(ZTable.class).update(SelfOrder.class, new Updater().addMust("designId", designId).addField("urgentPrice", designPrices)); + + request.setAlertMsg("操作成功"); + + // 记录日志 + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "修改订单加急费", EventConstants.ORDER_43.value()); + DesignOrderMeritsDao.saveDesignOrderMerits(designId, "4", "", "", request.getSessionName(), order.getDesigner(), + order.getTypeId(), order.getStatus(), order.getOrderText(), order.getUrgentPrice(), designPrices); + } + + // 修改单个设计单价 + public static void doEditDesignPrice(HttpRequest request) throws Exception + { + String prdPriceDate = request.getParameter("prdPriceDate"); + long prdPrice = new Double(Double.parseDouble(request.getParameter("prdPrice")) * 100.0).longValue(); + long priceId = request.getParameterLong("priceId"); + + Date prpDate = new SimpleDateFormat("yyyy-MM").parse(prdPriceDate); + String prpDateString = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(prpDate); + + Updater updater = new Updater(); + updater.addMust("priceId", priceId); + updater.addField("designPriceMoney", prdPrice); + updater.addField("effectTime", Sqls.toTimestamp(prpDateString)); + ORM.get(ZTable.class).update(DesignPrice.class, updater); + } + + // 修改稿件类型 + public static void editDraftType(HttpRequest request, long designId, int draftType) throws Exception + { + DesignOrder order1 = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", designId)); + ORM.get(ZTable.class).update(DesignOrder.class, new Updater().addMust("designId", designId).addField("draftType", draftType)); + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", designId)); + long calculateOrderPerformance = StatDao.calculateOrderPerformance(order); + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("designPrice", calculateOrderPerformance); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + DesignOrderMeritsDao.saveDesignOrderMerits(designId, "5", order1.getDraftType()+"", draftType+"", request.getSessionName(), order1.getDesigner(), + order.getTypeId(), order.getStatus(), order.getOrderText(), order.getDesignPrice(), calculateOrderPerformance); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/QcAwardedTypeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/QcAwardedTypeAction.java new file mode 100644 index 0000000..efee1c3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/QcAwardedTypeAction.java @@ -0,0 +1,113 @@ +/** + * 扬彩印刷设计 + * 文件名 :QcAwardedTypeAction.java + * 创建人 :高佳新 + * 创建时间:2019-5-20 + */ + +package com.zhiqim.yangcai.design.action.sys; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.qc.QcAwardedType; + +/** + * + * 质检加分类型列表 + * + * @version 1.0 @author 高佳新 2019-5-20 新建与整理 + */ +public class QcAwardedTypeAction extends StdSwitchAction +{ + + @Override + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("qcTypeId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("qcAwardedName", "请填写加分类型名称")); + request.addValidate(new IsNotEmpty("qcScore", "请填写加分类型分数")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + PageResult pageResult = ORM.get(ZTable.class).page(QcAwardedType.class, page, pageSize); + + request.setAttribute("pageResult", pageResult); + + } + + @Override + protected void add(HttpRequest request) throws Exception + { + + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long qcTypeId = request.getParameterLong("qcTypeId"); + ORM.get(ZTable.class).delete(QcAwardedType.class, qcTypeId); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String qcAwardedName = request.getParameter("qcAwardedName"); + String qcScore = request.getParameter("qcScore"); + + QcAwardedType qcAwardedType = new QcAwardedType(); + qcAwardedType.setQcTypeId(Ids.longId13()); + qcAwardedType.setQcAwardedName(qcAwardedName); + qcAwardedType.setQcScore(Double.parseDouble(qcScore)); + + ORM.get(ZTable.class).insert(qcAwardedType); + + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long qcTypeId = request.getParameterLong("qcTypeId"); + QcAwardedType qcAwardedType = ORM.get(ZTable.class).item(QcAwardedType.class, qcTypeId); + if (qcAwardedType == null) + { + request.setResponseError("质检加分类型不存在"); + return; + } + + request.setAttribute("qcAwardedType", qcAwardedType); + + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long qcTypeId = request.getParameterLong("qcTypeId"); + String qcAwardedName = request.getParameter("qcAwardedName"); + String qcScore = request.getParameter("qcScore"); + + Updater updater = new Updater(); + updater.addMust("qcTypeId", qcTypeId); + updater.addField("qcAwardedName", qcAwardedName); + updater.addField("qcScore", Double.parseDouble(qcScore)); + + ORM.get(ZTable.class).update(QcAwardedType.class, updater); + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/QcParameterAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/QcParameterAction.java new file mode 100644 index 0000000..bc1b9cf --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/QcParameterAction.java @@ -0,0 +1,113 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sys; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.qc.QcParameter; + +/** + * 质检参数类 + * + * @version v1.0.0 @author liuhu 2019-1-15 新建与整理 + */ +public class QcParameterAction extends StdSwitchAction +{ + + @Override + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("parameterId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("content", "请填写参数内容")); + request.addValidate(new IsNotEmpty("score", "请填写分数")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + PageResult pageResult = ORM.get(ZTable.class).page(QcParameter.class, page, pageSize); + + request.setAttribute("pageResult", pageResult); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long parameterId = request.getParameterLong("parameterId"); + QcParameter parameter = ORM.get(ZTable.class).item(QcParameter.class, parameterId); + if (parameter == null) + { + request.setResponseError("质检参数不存在"); + return; + } + + request.setAttribute("parameter", parameter); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String content = request.getParameter("content"); + String score = request.getParameter("score"); + + QcParameter parameter = new QcParameter(); + parameter.setParameterId(Ids.longId13()); + parameter.setFlag(1); //默认减分 + parameter.setContent(content); + parameter.setScore(Double.parseDouble(score)); + + ORM.get(ZTable.class).insert(parameter); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long parameterId = request.getParameterLong("parameterId"); + String content = request.getParameter("content"); + String score = request.getParameter("score"); + + Updater updater = new Updater(); + updater.addMust("parameterId", parameterId); + updater.addField("content", content); + updater.addField("score", Double.parseDouble(score)); + + ORM.get(ZTable.class).update(QcParameter.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long parameterId = request.getParameterLong("parameterId"); + ORM.get(ZTable.class).delete(QcParameter.class, parameterId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/QcPerformanceParamAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/QcPerformanceParamAction.java new file mode 100644 index 0000000..8254db7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/QcPerformanceParamAction.java @@ -0,0 +1,138 @@ +/** + * 扬彩印刷设计 + * 文件名 :QcPerformanceParamAction.java + * 创建人 :gjx + * 创建时间:2019-9-4 + */ + +package com.zhiqim.yangcai.design.action.sys; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.onex.IsFloat; +import org.zhiqim.httpd.validate.onex.IsNumeric; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.stat.QcPerformanceParam; + +/** + * 质检绩效参数 + * + * @version 1.0 @author gjx 2019-9-4 新建与整理 + */ +public class QcPerformanceParamAction extends StdSwitchAction +{ + @Override + protected void validateForm(HttpRequest request) throws Exception + { + request.addValidate(new IsFloat("rewardScore", "奖励分不能为空且只能为数字", false)); + request.addValidate(new IsFloat("punishScore", "扣罚分不能为空且只能为数字", false)); + request.addValidate(new IsFloat("rewardAmount", "奖励金额不能为空且只能为数字", false)); + request.addValidate(new IsFloat("punishAmount", "扣罚金额不能为空且只能为数字", false)); + request.addValidate(new IsFloat("rewardAmountMax", "最大奖励金额不能为空且只能为数字", false)); + request.addValidate(new IsFloat("punishAmountMax", "最大扣罚金额不能为空且只能为数字", false)); + } + + @Override + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNumeric("qcPerformanceId", "请选择一个选项", false)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + PageResult pageResult = ORM.get(ZTable.class).page(QcPerformanceParam.class, page, pageSize); + + request.setAttribute("pageResult", pageResult); + request.setAttribute("listSize", pageResult.list().size()); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + + // long standardQcScore = request.getParameterLong("standardQcScore"); + long rewardScore = request.getParameterAmount2RLong("rewardScore"); + long punishScore = request.getParameterAmount2RLong("punishScore"); + long rewardAmount = request.getParameterAmount2RLong("rewardAmount"); + long punishAmount = request.getParameterAmount2RLong("punishAmount"); + long rewardAmountMax = request.getParameterAmount2RLong("rewardAmountMax"); + long punishAmountMax = request.getParameterAmount2RLong("punishAmountMax"); + + QcPerformanceParam qcParam = new QcPerformanceParam(); + qcParam.setQcPerformanceId(Ids.longId13()); + qcParam.setStandardQcScore(10000); + qcParam.setRewardScore(rewardScore); + qcParam.setPunishScore(punishScore); + qcParam.setRewardAmount(rewardAmount); + qcParam.setPunishAmount(punishAmount); + qcParam.setRewardAmountMax(rewardAmountMax); + qcParam.setPunishAmountMax(punishAmountMax); + + ORM.get(ZTable.class).insert(qcParam); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long qcPerformanceId = request.getParameterLong("qcPerformanceId"); + QcPerformanceParam qcParam = ORM.get(ZTable.class).item(QcPerformanceParam.class, new Selector().addMust("qcPerformanceId", qcPerformanceId)); + if (qcParam == null) + { + request.setResponseError("参数订单不存在"); + return; + } + request.setAttribute("order", qcParam); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long qcPerformanceId = request.getParameterLong("qcPerformanceId"); + long rewardScore = request.getParameterAmount2RLong("rewardScore"); + long punishScore = request.getParameterAmount2RLong("punishScore"); + long rewardAmount = request.getParameterAmount2RLong("rewardAmount"); + long punishAmount = request.getParameterAmount2RLong("punishAmount"); + long rewardAmountMax = request.getParameterAmount2RLong("rewardAmountMax"); + long punishAmountMax = request.getParameterAmount2RLong("punishAmountMax"); + QcPerformanceParam qcParam = ORM.get(ZTable.class).item(QcPerformanceParam.class, new Selector().addMust("qcPerformanceId", qcPerformanceId)); + if (qcParam == null) + { + request.setResponseError("参数订单不存在"); + return; + } + + Updater updater = new Updater(); + updater.addMust("qcPerformanceId", qcPerformanceId); + updater.addField("rewardScore", rewardScore); + updater.addField("punishScore", punishScore); + updater.addField("rewardAmount", rewardAmount); + updater.addField("punishAmount", punishAmount); + updater.addField("rewardAmountMax", rewardAmountMax); + updater.addField("punishAmountMax", punishAmountMax); + + ORM.get(ZTable.class).update(QcPerformanceParam.class, updater); + + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/ReceiveMerManage.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/ReceiveMerManage.java new file mode 100644 index 0000000..09ea8b1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/ReceiveMerManage.java @@ -0,0 +1,139 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.ones.IsNumericLen; +import org.zhiqim.httpd.validate.ones.IsSelect; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.ParamDao; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignOrgMer; +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/** + * 组织派单属性 + * + * @version v1.0.0 @author longguizhi 2018-5-30 新建与整理 + */ +public class ReceiveMerManage extends StdSwitchAction +{ + + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("orgId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsSelect("orgId", "请选择商户")); + request.addValidate(new IsNumericLen("merLevel", "请输入排序优先级别,并且不能超过6个字符", 1, 6)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + boolean isPauseRecieive = request.getParameterBoolean("isPauseRecieive"); + int merStatus = request.getParameterInt("merStatus"); + int pageSize = 10; + + Selector selector = new Selector(); + selector.addMaybe("isPauseRecieive", isPauseRecieive); + selector.addMaybe("merStatus", merStatus); + selector.addOrderbyAsc("merLevel"); + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrgMer.class, page, pageSize, selector); + request.setAttribute("pageResult", pageResult); + request.setAttribute("isPauseRecieive", isPauseRecieive); + request.setAttribute("merStatus", merStatus); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + List orgList = ZmrOrgDao.levelList(request, 1); + request.setAttribute("orgList", orgList); + // 查找店铺 + request.setAttribute("shopList", ParamDao.doGetShopNameParam()); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId", 0); + List orgList = ZmrOrgDao.levelList(request, 1); + DesignOrgMer orgMer = ORM.get(ZTable.class).item(DesignOrgMer.class, orgId); + if (orgMer == null) + { + request.returnHistory("数据不存在"); + return; + } + + List industryList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + List typeList = DesignTypeDao.list(); + request.setAttribute("typeList", typeList); + request.setAttribute("industryList", industryList); + request.setAttribute("orgMer", orgMer); + request.setAttribute("orgList", orgList); + + // 查找店铺 + request.setAttribute("shopList", ParamDao.doGetShopNameParam()); + // 查找后加工 + request.setAttribute("afterList", ParamDao.doGetAfterNameParam()); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String orderShop = request.getParameter("orderShop"); + + DesignOrgMer orgMer = request.getParameter(DesignOrgMer.class); + orgMer.setOrderShop(orderShop); + orgMer.setModifyOperatorCode(request.getSessionName()); + orgMer.setModifyTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).replace(orgMer); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + String orderShop = request.getParameter("orderShop"); + + DesignOrgMer orgMer = request.getParameter(DesignOrgMer.class); + orgMer.setOrderShop(orderShop); + orgMer.setModifyOperatorCode(request.getSessionName()); + orgMer.setModifyTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).replace(orgMer); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId", 0); + ORM.get(ZTable.class).delete(DesignOrgMer.class, orgId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/ReceiveMerModifyAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/ReceiveMerModifyAction.java new file mode 100644 index 0000000..9f343f5 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/ReceiveMerModifyAction.java @@ -0,0 +1,62 @@ +package com.zhiqim.yangcai.design.action.sys; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.ViewExecAction; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.design.DesignOrgMer; + +/** + * 组织派单规则 + * + * @version v1.0.0 @author longguizhi 2018-5-30 新建与整理 + */ +public class ReceiveMerModifyAction extends ViewExecAction +{ + + @Override + protected void view(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId", 0); + DesignOrgMer orgMer = ORM.get(ZTable.class).item(DesignOrgMer.class, orgId); + if (orgMer == null) + { + request.returnCloseDialog("数据不存在"); + return; + } + request.setAttribute("orgMer", orgMer); + } + + @Override + protected void exec(HttpRequest request) throws Exception + { + } + + public void update(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); // 组织编号 + int merStatus = request.getParameterInt("merStatus"); // 组织状态 + int merLevel = request.getParameterInt("merLevel"); // 优先级 + boolean isPauseRecieive = request.getParameterBoolean("isPauseRecieive"); // 是否暂停接单 + + if (orgId <= 0) + { + request.setResponseError("商户编号正确"); + return; + } + + Updater updater = new Updater(); + updater.addMust("orgId", orgId); + updater.addField("merStatus", merStatus); + updater.addField("isPauseRecieive", isPauseRecieive); + updater.addField("modifyOperatorCode", request.getSessionName()); + updater.addField("modifyTime", Sqls.nowTimestamp()); + updater.addField("merLevel", merLevel); + + ORM.get(ZTable.class).update(DesignOrgMer.class, updater); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/RefundParameterAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/RefundParameterAction.java new file mode 100644 index 0000000..0194fed --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/RefundParameterAction.java @@ -0,0 +1,145 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.sys; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.onex.IsFloat; +import org.zhiqim.httpd.validate.onex.IsNumeric; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.stat.RefundParameter; + +/** + * 退款参数类 + * + * @version v1.0.0 @author liuhu 2019-1-15 新建与整理 + */ +public class RefundParameterAction extends StdSwitchAction +{ + + @Override + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNumeric("parameterId", "请选择一个选项", false)); + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + request.addValidate(new IsFloat("standardRefundRate", "标准退款率不能未空且只能为数字", false)); + request.addValidate(new IsFloat("floor", "标准退款率下限不能未空且只能为数字", false)); + request.addValidate(new IsFloat("ceil", "标准退款率上限不能未空且只能为数字", false)); + request.addValidate(new IsFloat("rewardDot", "奖励点不能未空且只能为数字", false)); + request.addValidate(new IsFloat("punishDot", "扣罚点不能未空且只能为数字", false)); + request.addValidate(new IsFloat("rewardAmount", "奖励金额不能未空且只能为数字", false)); + request.addValidate(new IsFloat("punishAmount", "扣罚金额不能未空且只能为数字", false)); + request.addValidate(new IsFloat("rewardAmountMax", "最大奖励金额不能未空且只能为数字", false)); + request.addValidate(new IsFloat("punishAmountMax", "最大扣罚金额不能未空且只能为数字", false)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + PageResult pageResult = ORM.get(ZTable.class).page(RefundParameter.class, page, pageSize); + + request.setAttribute("pageResult", pageResult); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long parameterId = request.getParameterLong("parameterId"); + RefundParameter parameter = ORM.get(ZTable.class).item(RefundParameter.class, parameterId); + if (parameter == null) + { + request.returnHistory("退款参数不存在"); + return; + } + + request.setAttribute("item", parameter); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + long standardRefundRate = request.getParameterAmount2RLong("standardRefundRate"); + long floor = request.getParameterAmount2RLong("floor"); + long ceil = request.getParameterAmount2RLong("ceil"); + long rewardDot = request.getParameterAmount2RLong("rewardDot"); + long punishDot = request.getParameterAmount2RLong("punishDot"); + long rewardAmount = request.getParameterAmount2RLong("rewardAmount"); + long punishAmount = request.getParameterAmount2RLong("punishAmount"); + long rewardAmountMax = request.getParameterAmount2RLong("rewardAmountMax"); + long punishAmountMax = request.getParameterAmount2RLong("punishAmountMax"); + + RefundParameter parameter = new RefundParameter(); + parameter.setRefundParameterId(Ids.longId()); + parameter.setStandardRefundRate(standardRefundRate); + parameter.setStandardRefundRateFloor(floor); + parameter.setStandardRefundRateCeil(ceil); + parameter.setRewardDot(rewardDot); + parameter.setPunishDot(punishDot); + parameter.setRewardAmount(rewardAmount); + parameter.setPunishAmount(punishAmount); + parameter.setRewardAmount(rewardAmountMax); + parameter.setPunishAmount(punishAmountMax); + + ORM.get(ZTable.class).insert(parameter); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long parameterId = request.getParameterLong("parameterId"); + long standardRefundRate = request.getParameterAmount2RLong("standardRefundRate"); + long floor = request.getParameterAmount2RLong("floor"); + long ceil = request.getParameterAmount2RLong("ceil"); + long rewardDot = request.getParameterAmount2RLong("rewardDot"); + long punishDot = request.getParameterAmount2RLong("punishDot"); + long rewardAmount = request.getParameterAmount2RLong("rewardAmount"); + long punishAmount = request.getParameterAmount2RLong("punishAmount"); + long rewardAmountMax = request.getParameterAmount2RLong("rewardAmountMax"); + long punishAmountMax = request.getParameterAmount2RLong("punishAmountMax"); + + Updater updater = new Updater(); + updater.addMust("refundParameterId", parameterId); + updater.addField("standardRefundRate", standardRefundRate); + updater.addField("standardRefundRateFloor", floor); + updater.addField("standardRefundRateCeil", ceil); + updater.addField("rewardDot", rewardDot); + updater.addField("punishDot", punishDot); + updater.addField("rewardAmount", rewardAmount); + updater.addField("punishAmount", punishAmount); + updater.addField("rewardAmountMax", rewardAmountMax); + updater.addField("punishAmountMax", punishAmountMax); + + ORM.get(ZTable.class).update(RefundParameter.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/SpecialOrderTypeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/SpecialOrderTypeAction.java new file mode 100644 index 0000000..40ecaf4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/SpecialOrderTypeAction.java @@ -0,0 +1,112 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sys; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.stat.SpecialOrderType; + +/** + * 特殊订单类型类 + * + * @version v1.0.0 @author liuhu 2018-12-13 新建与整理 + */ +public class SpecialOrderTypeAction extends StdSwitchAction +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("typeId", "请选择一个选项")); + request.addParam("page", request.getParameterInt("page", 1)); + request.setAttribute("page", request.getParameterInt("page", 1)); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsLen("specialOrderType", "特殊订单类型不能为空且不超过200字符", 1, 200)); + request.addValidate(new IsLen("specialOrderDescribe", "特殊订单类型描述不能为空且不超过200字符", 1, 200)); + request.addValidate(new IsLen("specialOrderAmount", "金额不能为空且不超过10个字符", 1, 10)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page",1); + int pageSize = request.getContextAttributeInt("page.size", 15); + + PageResult pageResult = ORM.get(ZTable.class).page(SpecialOrderType.class, page, pageSize); + request.setAttribute("pageResult", pageResult); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String specialOrderType = request.getParameter("specialOrderType"); + String specialOrderDescribe = request.getParameter("specialOrderDescribe"); + long specialOrderAmount = request.getParameterAmount2RLong("specialOrderAmount"); + + SpecialOrderType type = new SpecialOrderType(); + type.setSpecialTypeId(Ids.longId13()); + type.setSpecialOrderType(specialOrderType); + type.setSpecialOrderDescribe(specialOrderDescribe); + type.setSpecialOrderAmount(specialOrderAmount); + ORM.get(ZTable.class).insert(type); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long typeId = request.getParameterLong("typeId"); + SpecialOrderType specialOrderType = ORM.get(ZTable.class).item(SpecialOrderType.class, typeId); + + request.setAttribute("item", specialOrderType); + } + + + @Override + protected void update(HttpRequest request) throws Exception + { + long typeId = request.getParameterLong("typeId"); + String specialOrderType = request.getParameter("specialOrderType"); + String specialOrderDescribe = request.getParameter("specialOrderDescribe"); + long specialOrderAmount = request.getParameterAmount2RLong("specialOrderAmount"); + + Updater updater = new Updater(); + updater.addMust("specialTypeId", typeId); + updater.addField("specialOrderType", specialOrderType); + updater.addField("specialOrderDescribe", specialOrderDescribe); + updater.addField("specialOrderAmount", specialOrderAmount); + ORM.get(ZTable.class).update(SpecialOrderType.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long typeId = request.getParameterLong("typeId"); + + ORM.get(ZTable.class).delete(SpecialOrderType.class, typeId); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/TeamManagementAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/TeamManagementAction.java new file mode 100644 index 0000000..e3cc73f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/TeamManagementAction.java @@ -0,0 +1,157 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; +import com.zhiqim.yangcai.design.dbo.design.teamManagement; +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourseView; + +/*** + * 订单商户 + * + * @version v1.0.0 @author longguizhi 2018-9-10 新建与整理 + */ +public class TeamManagementAction extends StdSwitchAction +{ + + @Override + protected void validateId(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("merchantId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) throws Exception + { + + } + + @Override + protected void list(HttpRequest request) throws Exception + { + List merchantList = ORM.get(ZTable.class).list(teamManagement.class); + request.setAttribute("merchantList", merchantList); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + insert(request); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long merchantId = request.getParameterLong("merchantId", 0); + teamManagement merchant = ORM.get(ZTable.class).item(teamManagement.class, merchantId); + if (merchant == null) + { + request.returnHistory("商户不存在!"); + return; + } + + request.setAttribute("merchant", merchant); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + teamManagement merchant = request.getParameter(teamManagement.class); + merchant.setTeamId(Ids.longId13()); + ORM.get(ZTable.class).insert(merchant); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long merchantId = request.getParameterLong("merchantId", 0); + String merchantName = request.getParameter("merchantName"); + String merchantSecret = request.getParameter("teamSecret"); + boolean isEnabled = request.getParameterBoolean("isEnabled"); + String teamName = request.getParameter("teamName"); + String deptTeam = request.getParameter("deptTeam"); + String deptOrg = request.getParameter("deptOrg"); + Updater updater = new Updater(); + updater.addMust("teamId", merchantId); + updater.addField("merchantName", merchantName); + updater.addField("teamSecret", merchantSecret); + updater.addField("isEnabled", isEnabled); + updater.addField("teamName", teamName); + updater.addField("deptTeam", deptTeam); + updater.addField("deptOrg", deptOrg); + ORM.get(ZTable.class).update(teamManagement.class, updater); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + // TODO Auto-generated method stub + + } + + + public void lists(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 12); + long orgId = request.getParameterLong("orgId"); + + Selector selector = new Selector(); + selector.addMaybe("designer", request.getParameter("designer")); + selector.addMaybe("workDuration", request.getParameter("workDuration")); + selector.addMaybeLike("workExperience", request.getParameter("workExperience")); + selector.addMaybeLike("designType", request.getParameter("designType")); + selector.addMaybeLike("skillScope", request.getParameter("skillScope")); + selector.addMaybe("workStatus", request.getParameter("workStatus")); + selector.addMaybeLike("designerRemark", request.getParameter("designerRemark")); + if (orgId > 0) + { + selector.addMust("orgId", orgId); + } + else + { + selector.addMustNotInLong("orgId", 1805031820320001L, 1808071102554512L);// 非总部,临时注册 + } + + selector.addMaybe("operatorMobile", request.getParameter("operatorMobile")); + selector.addOrderbyDesc("operatorCreated"); + + PageResult pageResult = ORM.get(ZView.class).page(DesignerCourseView.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + selOrg.addMustNotEqual("orgId", 1808071102554512L); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + + request.setAttribute("orgList", orgList); + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/TimelinessParameterAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/TimelinessParameterAction.java new file mode 100644 index 0000000..674a8e9 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/TimelinessParameterAction.java @@ -0,0 +1,155 @@ +/** + * 扬彩印刷设计 + * 文件名 :TimelinessParameterAction.java + * 创建人 :jiangbin + * 创建时间:2020-05-12 + */ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsGreaterThenValue; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.stat.TimelinessParameter; + +/** + * 时效绩效参数action + * + * @version v1.0.0 @author jiangbin 2020-05-12 新建与整理 + */ +public class TimelinessParameterAction extends StdSwitchAction +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("timelinessParameterId", "请选择一个选项")); + request.addParam("page", request.getParameterInt("page", 1)); + request.setAttribute("page", request.getParameterInt("page", 1)); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsGreaterThenValue("prdTypeId", "请选择产品类型", "0")); + request.addValidate(new IsGreaterThenValue("rewardAmount", "请输入奖励金额", "0")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + Map prdTypeMap = DesignTypeDao.mapAll(); + Selector selector = new Selector(); + selector.addOrderbyAsc("prdTypeId"); + PageResult pageResult = ORM.get(ZTable.class).page(TimelinessParameter.class, page, pageSize, selector); + request.setAttribute("pageResult", pageResult); + request.setAttribute("prdTypeMap", prdTypeMap); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + List list = DesignTypeDao.listAll(); + request.setAttribute("prdTypeList", list); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + long prdTypeId = request.getParameterLong("prdTypeId"); + long rewardAmount = request.getParameterAmount2RLong("rewardAmount"); + if (prdTypeId < 0) + { + request.returnHistory("产品类型不能为空!"); + return; + } + + if (rewardAmount < 0) + { + request.returnHistory("奖励金额不能为空!"); + return; + } + List oldList = ORM.get(ZTable.class).list(TimelinessParameter.class); + for (TimelinessParameter tp : oldList) + { + if (tp.getPrdTypeId() == prdTypeId) + { + request.returnHistory("该产品类型的时效绩效参数已存在!"); + return; + } + } + TimelinessParameter timelinessParameter = new TimelinessParameter(); + timelinessParameter.setTimelinessParameterId(Ids.longId13_4()); + timelinessParameter.setPrdTypeId(prdTypeId); + timelinessParameter.setRewardAmount(rewardAmount); + ORM.get(ZTable.class).insert(timelinessParameter); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long timelinessParameterId = request.getParameterLong("timelinessParameterId"); + TimelinessParameter timelinessParameter = ORM.get(ZTable.class).item(TimelinessParameter.class, timelinessParameterId); + List list = DesignTypeDao.listAll(); + request.setAttribute("prdTypeList", list); + request.setAttribute("timelinessParameter", timelinessParameter); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long timelinessParameterId = request.getParameterLong("timelinessParameterId"); + long prdTypeId = request.getParameterLong("prdTypeId"); + long rewardAmount = request.getParameterAmount2RLong("rewardAmount"); + if (timelinessParameterId < 0) + { + request.returnHistory("时效绩效参数ID不能为空!"); + return; + } + if (prdTypeId < 0) + { + request.returnHistory("产品类型不能为空!"); + return; + } + if (rewardAmount < 0) + { + request.returnHistory("奖励金额不能为空!"); + return; + } + List oldList = ORM.get(ZTable.class).list(TimelinessParameter.class, + new Selector().addMustNotEqual("timelinessParameterId", timelinessParameterId)); + for (TimelinessParameter tp : oldList) + { + if (tp.getPrdTypeId() == prdTypeId) + { + request.returnHistory("该产品类型的时效绩效参数已存在!"); + return; + } + } + TimelinessParameter timelinessParameter = new TimelinessParameter(); + timelinessParameter.setTimelinessParameterId(timelinessParameterId); + timelinessParameter.setPrdTypeId(prdTypeId); + timelinessParameter.setRewardAmount(rewardAmount); + ORM.get(ZTable.class).update(timelinessParameter); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long timelinessParameterId = request.getParameterLong("timelinessParameterId"); + ORM.get(ZTable.class).delete(TimelinessParameter.class, timelinessParameterId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/deptOrgAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/deptOrgAction.java new file mode 100644 index 0000000..8796ded --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/sys/deptOrgAction.java @@ -0,0 +1,37 @@ +package com.zhiqim.yangcai.design.action.sys; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +/** + * 设计师指定组织 + * + * @version v1.0.0 caohong + */ +public class deptOrgAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + + + Selector selOrg = new Selector(); + selOrg.addMust("orgStatus", 0); + selOrg.addMust("orgLevel", 1); + selOrg.addMustNotEqual("orgId", 1808071102554512L); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, selOrg); + + request.setAttribute("orgList", orgList); + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/DesTemplateLogAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/DesTemplateLogAction.java new file mode 100644 index 0000000..c6182eb --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/DesTemplateLogAction.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.template; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.template.DesTemplateLog; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; + +/** + * 模版审核日志查询 + * + * @version v1.0.0 @author zzy 2018-7-11 新建与整理 + */ +public class DesTemplateLogAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 15); + long mediaId = request.getParameterLong("mediaId", 0); + long queryType = request.getParameterLong("queryType", 0); + + if(queryType == 0) + { + Selector sel = new Selector(); + sel.addMust("mediaId", mediaId); + sel.addOrderbyDesc("createTime"); + PageResult pageResult = ORM.get(ZTable.class).page(DesTemplateLog.class, page, pageSize, sel); + pageResult.addConditionMap(request.getParameterMap()); + + request.setAttribute("pageResult", pageResult); + } + else + { + MediaTemplate temp = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + List list = new ArrayList<>(); + if(temp != null) + { + DesTemplateLog data = new DesTemplateLog(); + data.setMediaId(mediaId); + list.add(data); + } + + PageResult pageResult = PageBuilder.newResult(list.size(), 1, pageSize, list); + request.setAttribute("pageResult", pageResult); + } + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/ExternalDraftDownloadAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/ExternalDraftDownloadAction.java new file mode 100644 index 0000000..bfbf26e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/ExternalDraftDownloadAction.java @@ -0,0 +1,51 @@ +/** + * 扬彩印刷设计 + * 文件名 :ExternalDraftDownloadAction.java + * 创建人 :gjx + * 创建时间:2019-12-14 + */ + +package com.zhiqim.yangcai.design.action.template; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; + +/** + * [简要描述]:外部稿件下载
            + * + * @version 1.0 @author gjx 2019-12-14 新建与整理 + */ +public class ExternalDraftDownloadAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + List worksFiles = ORM.get(ZTable.class).list(DesWorksFile.class, new Selector("templateId", mediaId)); + Map urlMap = new HashMap<>(); + for (DesWorksFile desWorksFile : worksFiles) + { + urlMap.put(desWorksFile.getFileType(), desWorksFile.getCdrPath()); + if (Validates.isNotEmpty(desWorksFile.getPdfPath())) + { + { + urlMap.put("pdf", desWorksFile.getPdfPath()); + } + } + + } + request.setAttribute("mediaId", mediaId); + request.setAttribute("urlMap", urlMap); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/FillLabelInfoAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/FillLabelInfoAction.java new file mode 100644 index 0000000..eac5afa --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/FillLabelInfoAction.java @@ -0,0 +1,48 @@ +/** + * 扬彩印刷设计 + * 文件名 :FillLabelInfoAction.java + * 创建人 :jiangbin + * 创建时间:2019-12-19 + */ +package com.zhiqim.yangcai.design.action.template; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; + +/** + * + * 补充标签信息 + * + * @version 1.0 @author jiangbin 2019-12-19 新建与整理 + */ +public class FillLabelInfoAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + long mediaId = request.getParameterLong("mediaId"); + int mark = request.getParameterInt("mark", 0); + if (designId < 0) + { + request.setResponseError("订单号不存在!"); + return; + } + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, new Selector("designId", designId)); + if (Validates.isEmpty(order)) + { + request.setResponseError("订单不存在!"); + return; + } + request.setAttribute("order", order); + request.setAttribute("mediaId", mediaId); + request.setAttribute("mark", mark); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/IndustrySelectAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/IndustrySelectAction.java new file mode 100644 index 0000000..fb92009 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/IndustrySelectAction.java @@ -0,0 +1,58 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.template; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Validates; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; + +/** + * 行业例表 + * + * @version v1.0.0 @author Deng 2017-11-16 新建与整理 + */ +public class IndustrySelectAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + String industryKeywords = request.getParameter("industryKeywords"); + + List searchIndustryList = new ArrayList<>(); + List industrieList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + + if (Validates.isEmptyBlank(industryKeywords)) + { + searchIndustryList = industrieList; + } + else + { + for (DesignIndustry industry : industrieList) + { + if (industry.getIndustryName().contains(industryKeywords) || industry.getIndustryKeywords().contains(industryKeywords)) + { + searchIndustryList.add(industry); + } + } + } + + request.setAttribute("searchIndustryList", searchIndustryList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/NewMyTemplateAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/NewMyTemplateAction.java new file mode 100644 index 0000000..6d20dd6 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/NewMyTemplateAction.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.template; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignSize; + +/** + * 新建我的模板 + * + * @version v1.0.0 @author zhouwenbin 2018-9-8 新建与整理 + */ +public class NewMyTemplateAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + Map> sizeMap = new HashMap<>(); + List sizeList = ORM.get(ZTable.class).list(DesignSize.class, new Selector().addMust("sizeStatus", 0).addOrderbyAsc("typeId,sizeSeq")); + for (DesignSize size : sizeList) + { + long key = size.getTypeId(); + if (sizeMap.containsKey(key)) + { + sizeMap.get(key).add(size); + } + else + { + List tempList = new ArrayList<>(); + tempList.add(size); + sizeMap.put(key, tempList); + } + } + + request.setAttribute("sizeMap", Jsons.toString(sizeMap)); + request.setAttribute("typeList", DesignTypeDao.listTemmplate()); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/TemplateDownloadAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/TemplateDownloadAction.java new file mode 100644 index 0000000..2f9b1c6 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/TemplateDownloadAction.java @@ -0,0 +1,102 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.template; + +import java.io.File; +import java.io.FileInputStream; +import java.io.OutputStream; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; + +/** + * 模板下载 + * @version v1.0.0 @author Deng 2017-11-22 新建与整理 + */ +public class TemplateDownloadAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + String _APPLICATION_OCTET_STREAM_ = "application/octet-stream"; + String _CONTENT_DISPOSITION_ = "Content-Disposition"; + long attaId = request.getParameterLong("attaId"); + + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, attaId); + if (atta == null) + { + request.returnHistory("该文件不存在,请重新操作"); + return; + } + + if (Validates.isNotEmptyBlank(atta.getOssUrl()) && Validates.isUrl(atta.getOssUrl())) + {//优先从网络地址下载 + request.setRedirect(atta.getOssUrl()); + return; + } + + String savePath = atta.getSavePath(); + File file = new File(savePath); + if (!file.exists() || !file.isFile()) + { + request.returnHistory("该文件不存在,请重新操作"); + return; + } + + String fileName = Urls.encodeUTF8(file.getName()); + + HttpResponse response = request.getResponse(); + response.setContentType(_APPLICATION_OCTET_STREAM_); + if (request.isChrome()) + {//chrome不支持括号 + fileName = fileName.replaceAll("%28", "("); + fileName = fileName.replaceAll("%29", ")"); + } + + if (request.isFirefox()) + response.setHeader(_CONTENT_DISPOSITION_, "attachment; filename*=UTF-8''"+file.getName()); + else + response.setHeader(_CONTENT_DISPOSITION_, "attachment; filename="+fileName); + + FileInputStream stream = new FileInputStream(savePath); + OutputStream out = response.getOutputStream(); + try + { + // 设置响应头和下载保存的文件名 + if (fileName != null && fileName.length() > 0) + { + if (stream != null) + { + byte[] buffer = new byte[1024]; + int len = 0; + while ((len = stream.read(buffer)) != -1) + { + out.write(buffer, 0, len); + } + } + } + } + catch (Exception e){} + finally + { + stream.close(); + out.close(); + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/TemplateLabelAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/TemplateLabelAction.java new file mode 100644 index 0000000..009d92f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/TemplateLabelAction.java @@ -0,0 +1,125 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.template; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.DesLabelAttribute; +import com.zhiqim.yangcai.design.dbo.DesLabelAttributeCat; +import com.zhiqim.yangcai.design.dbo.DesLabelIndustry; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; + +/** + * 模板关联标签 + * + * @version v1.0.0 @author Deng 2017-11-24 新建与整理 + */ +public class TemplateLabelAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + if (mediaId == -1) + return; + + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + request.setAttribute("template", template); + + List subsList = new ArrayList(); + List attrList = new ArrayList(); + + //组装已关联的行业属性 + if(Validates.isNotEmpty(template.getIndustrySubIds()) && + Validates.isNotEmpty( template.getAttributeIds())) + { + for(String subs : template.getIndustrySubIds().split(",")) + subsList.add(subs); + + for(String attr : template.getAttributeIds().split(",")) + attrList.add(attr); + } + + request.setAttribute("indIdarr", Lists.toString(subsList)); + request.setAttribute("subsList", subsList); + request.setAttribute("attrIdarr", Lists.toString(attrList)); + request.setAttribute("attrList", attrList); + + //获取行业下的子行业 + List inSubList = ORM.get(ZTable.class).list(DesLabelIndustry.class, new Selector("industryId", template.getIndustryId())); + request.setAttribute("inSubList", inSubList); + + //获取行业下的属性分类 + List attrCatList = ORM.get(ZTable.class).list(DesLabelAttributeCat.class, new Selector("industryId", template.getIndustryId())); + request.setAttribute("attrCatList", attrCatList); + + Map> map = new HashMap>(); + for(DesLabelAttributeCat cat : attrCatList) + { + List attrsList = ORM.get(ZTable.class).list(DesLabelAttribute.class, new Selector("attributeCatId", cat.getAttributeCatId())); + map.put(cat.getAttributeCatId(), attrsList); + } + request.setAttribute("map", map); + + //==================================================================================== + + //子行业列表 + List subIndustryList = ORM.get(ZTable.class).list(DesLabelIndustry.class); + Map> subIndustryMap = new HashMap<>(); + for (DesLabelIndustry subIn: subIndustryList) + { + List subList = subIndustryMap.get(subIn.getIndustryId()); + subList = subList != null ? subList : new ArrayList(); + subList.add(subIn); + + subIndustryMap.put(subIn.getIndustryId(), subList); + } + request.setAttribute("subIndustryMap", subIndustryMap); + + //行业所有分类 + List attributeCatList = ORM.get(ZTable.class).list(DesLabelAttributeCat.class); + Map> attributeCatMap = new HashMap<>(); + for (DesLabelAttributeCat cat : attributeCatList) + { + List group = attributeCatMap.get(cat.getIndustryId()); + group = group != null ? group : new ArrayList(); + group.add(cat); + + attributeCatMap.put(cat.getIndustryId(), group); + } + request.setAttribute("attributeCatMap", attributeCatMap); + + //关联标签属性 列表 + List attributeList = ORM.get(ZTable.class).list(DesLabelAttribute.class); + Map> attributeMap = new HashMap>(); + for (DesLabelAttribute attr : attributeList) + { + List group = attributeMap.get(attr.getAttributeCatId()); + group = group != null ? group : new ArrayList(); + group.add(attr); + + attributeMap.put(attr.getAttributeCatId(), group); + } + request.setAttribute("attributeMap", attributeMap); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/TemplateShowAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/TemplateShowAction.java new file mode 100644 index 0000000..1403d83 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/TemplateShowAction.java @@ -0,0 +1,107 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.template; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.media.dbo.MediaBg; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateEvent; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateScore; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; + +/** + * 模板详情 + * + * @version v1.0.0 @author PVer 2017-11-17 新建与整理 + */ +public class TemplateShowAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + if (mediaId == -1) + { + return; + } + + MediaTemplateView media = ORM.get(ZView.class).item(MediaTemplateView.class, new Selector("mediaId", mediaId)); + if (media == null) + { + request.setResponseError("该模板已删除"); + return; + } + request.setAttribute("media", media); + request.setAttribute("urlParam", request.getParameter("urlParam")); + + // 浏览数 + int browseNum = ORM.get(ZTable.class).count(DesTemplateEvent.class, new Selector().addMust("mediaId", mediaId).addMust("eventType", 1)); + // 收藏数mediaId + int collectNum = ORM.get(ZTable.class).count(DesTemplateEvent.class, new Selector().addMust("mediaId", mediaId).addMust("eventType", 2)); + // 下载数 + int downNum = ORM.get(ZTable.class).count(DesTemplateEvent.class, new Selector().addMust("mediaId", mediaId).addMust("eventType", 4)); + // 版式 + MediaBg mediaBg = ORM.get(ZTable.class).item(MediaBg.class, new Selector().addMust("mediaId", mediaId)); + + // 此用户是否已收藏 + Selector selector = new Selector(); + selector.addMust("mediaId", mediaId); + selector.addMust("eventType", 2); + selector.addMust("operatorCode", request.getSessionName()); + DesTemplateEvent event = ORM.get(ZTable.class).item(DesTemplateEvent.class, selector); + if (event != null) + { + request.setAttribute("userEventId", event.getEventId()); + } + else + { + request.setAttribute("userEventId", 0); + } + + List worksFiles = ORM.get(ZTable.class).list(DesWorksFile.class, new Selector("templateId", mediaId)); + Set fileTypeSet = new HashSet<>(); + Map urlMap = new HashMap<>(); + for (DesWorksFile desWorksFile : worksFiles) + { + urlMap.put(desWorksFile.getFileType(), desWorksFile.getCdrPath()); + fileTypeSet.add(desWorksFile.getFileType()); + } + Selector sel = new Selector("operatorStatus", 0); + List oplist = ZmrBootstrap.table(request).list(ZmrOperator.class, sel); + DesTemplateScore templateScore = ORM.get(ZTable.class).item(DesTemplateScore.class, mediaId); + int score = 0; + if (templateScore != null) + { + score = templateScore.getFloatScore() + templateScore.getSaleScore() + templateScore.getUserScore(); + } + request.setAttribute("score", score); + request.setAttribute("oplist", oplist); + request.setAttribute("urlMap", urlMap); + request.setAttribute("fileTypeSet", fileTypeSet); + request.setAttribute("browseNum", browseNum); + request.setAttribute("collectNum", collectNum); + request.setAttribute("downNum", downNum); + request.setAttribute("oddEven", mediaBg.getOddEven()); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/UserMaterialAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/UserMaterialAction.java new file mode 100644 index 0000000..e03e01a --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/template/UserMaterialAction.java @@ -0,0 +1,57 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.action.template; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.SwitchAction; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.template.UserMaterial; + +/** + * 用户素材管理 + * @version v1.0.0 @author zhouwenbin 2018-10-10 新建与整理 + */ +public class UserMaterialAction extends SwitchAction +{ + + public void list(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("page.size", 20); + String typeCode = request.getParameter("typeCode"); + String catCode = request.getParameter("catCode"); + String designer = request.getParameter("designer"); + + Selector sel = new Selector(); + sel.addMaybe("typeCode", typeCode); + sel.addMaybe("catCode", catCode); + sel.addMaybeLike("designer", designer); + + sel.addOrderbyAsc("svgSeq"); + PageResult pageResult = ORM.get(ZTable.class).page(UserMaterial.class, pageNo, pageSize, sel); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + + request.setAttribute("catCode", catCode); + } + + public void add(HttpRequest request) throws Exception + { + long svgId = request.getParameterLong("svgId"); + UserMaterial material = ORM.get(ZTable.class).item(UserMaterial.class, svgId); + request.setAttribute("material", material); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/wkwechatsupport/WkwechatSupportAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/wkwechatsupport/WkwechatSupportAction.java new file mode 100644 index 0000000..9b784e0 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/wkwechatsupport/WkwechatSupportAction.java @@ -0,0 +1,76 @@ +package com.zhiqim.yangcai.design.action.wkwechatsupport; + +import java.util.HashMap; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +/** + * 微信公众号支持接口:用于获取设计师个人信息
            + * + * @author HuangZhiGao + * @date 2020年9月14日 下午11:33:49 + */ +public class WkwechatSupportAction implements Action +{ + + private static final Log log = LogFactory.getLog(WkwechatSupportAction.class); + + /** + * 根据设计师名称获取设计师企业微信账号或联系电话
            + * + * @author HuangZhiGao + * @throws Exception + * @date 2020年9月14日 下午11:33:49 + */ + @Override + public void execute(HttpRequest request) throws Exception + { + HttpResponse response = request.getResponse(); + Map jsonMap = new HashMap(); + jsonMap.put("error", Boolean.FALSE); + + String designerName = request.getParameter("designerName"); + if (Validates.isEmpty(designerName)) + { + jsonMap.put("error", Boolean.TRUE); + jsonMap.put("errorMsg", "参数-设计师名称不能为空"); + response.print(Jsons.toString(jsonMap)); + return; + } + + try + { + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, new Selector().addMust("operatorCode", designerName)); + + if (Validates.isNotEmpty(operator)) + { + jsonMap.put("data", Jsons.toString(operator)); + } + else + { + jsonMap.put("error", Boolean.TRUE); + jsonMap.put("errorMsg", "没有匹配到设计师"); + } + } + catch (Exception e) + { + jsonMap.put("error", Boolean.TRUE); + jsonMap.put("errorMsg", "查询异常:" + e.getMessage()); + log.error("查询异常:" + e.getMessage(), e); + } + + response.print(Jsons.toString(jsonMap)); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/AllWorksAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/AllWorksAction.java new file mode 100644 index 0000000..7d3bcb4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/AllWorksAction.java @@ -0,0 +1,37 @@ +package com.zhiqim.yangcai.design.action.works; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/** + * 所有作品 + * + * @version v1.0.0 @author Deng 2017-10-24 新建与整理 + */ +public class AllWorksAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + // 如果是手机则重定向到手机端 + if (request.isMobile()) + { + request.setRedirect("/mobileTemplateHome.htm"); + return; + } + List prdList = ORM.get(ZTable.class).list(DesignType.class); + request.setAttribute("prdList", prdList); + + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/BestWorksAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/BestWorksAction.java new file mode 100644 index 0000000..381ccc5 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/BestWorksAction.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.works; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/** + * 精品作品 + * + * @version v1.0.0 @author Deng 2017-11-2 新建与整理 + */ +public class BestWorksAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + List prdList = ORM.get(ZTable.class).list(DesignType.class); + request.setAttribute("prdList", prdList); + + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/CdrWorksDownloadAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/CdrWorksDownloadAction.java new file mode 100644 index 0000000..0bd2ef6 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/CdrWorksDownloadAction.java @@ -0,0 +1,104 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.works; + +import java.io.FileInputStream; +import java.io.OutputStream; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.design.dbo.works.DesWorksEvent; +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; + +/** + * 作品下载 + * + * @version v1.0.0 @author zzy 2017-10-21 新建与整理 + */ +public class CdrWorksDownloadAction implements Action +{ + + private static final Log log = LogFactory.getLog(CdrWorksDownloadAction.class); + + @Override + public void execute(HttpRequest request) throws Exception + { + long worksId = request.getParameterLong("worksId"); + DesWorksFile srcFile = ORM.get(ZTable.class).item(DesWorksFile.class, worksId); + if (srcFile == null) + { + HttpResponse response = request.getResponse(); + response.sendError(701, "数据库不存在!"); + return; + } + + String fileName = srcFile.getCdrFileName(); + String savePath = srcFile.getCdrPath(); + if (!Files.exists(savePath)) + { + HttpResponse response = request.getResponse(); + response.sendError(702, "文件或目录不存在!"); + return; + } + + HttpResponse response = request.getResponse(); + FileInputStream stream = new FileInputStream(savePath); + OutputStream out = response.getOutputStream(); + response.setContentType("application/octet-stream"); + response.addHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes())); + try + { + // 设置响应头和下载保存的文件名 + if (Validates.isNotEmpty(fileName) && fileName.length() > 0) + { + if (stream != null) + { + int filelen = stream.available(); + // 文件太大时内存不能一次读出,要循环 + byte a[] = new byte[filelen]; + stream.read(a); + + out.write(a); + out.flush(); + } + } + } + catch (Exception e) + { + log.error(e.getMessage(), e); + } + finally + { + stream.close(); + out.close(); + } + + DesWorksEvent event = new DesWorksEvent(); + event.setEventId(Ids.longId19()); + event.setWorksId(worksId); + event.setEventType(4); + event.setOperatorCode(request.getSessionName()); + event.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(event); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/GroupWorksAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/GroupWorksAction.java new file mode 100644 index 0000000..db139b1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/GroupWorksAction.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.works; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/** + * 小组作品 + * + * @version v1.0.0 @author Deng 2017-10-24 新建与整理 + */ +public class GroupWorksAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + List prdList = ORM.get(ZTable.class).list(DesignType.class); + request.setAttribute("prdList", prdList); + + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/LabelRelationAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/LabelRelationAction.java new file mode 100644 index 0000000..6653bef --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/LabelRelationAction.java @@ -0,0 +1,130 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.works; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.DesLabelAttribute; +import com.zhiqim.yangcai.design.dbo.DesLabelAttributeCat; +import com.zhiqim.yangcai.design.dbo.DesLabelIndustry; +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; + +/** + * 标签关联 + * + * @version v1.0.0 @author Deng 2017-10-25 新建与整理 + */ +public class LabelRelationAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long worksId = request.getParameterLong("worksId"); + if (worksId == -1) + { + return; + } + + DesWorksFile works = ORM.get(ZTable.class).item(DesWorksFile.class, worksId); + request.setAttribute("works", works); + + List subsList = new ArrayList(); + List attrList = new ArrayList(); + + // 组装已关联的行业属性 + if (Validates.isNotEmpty(works.getIndustrySubIds()) && Validates.isNotEmpty(works.getAttributeIds())) + { + for (String subs : works.getIndustrySubIds().split(",")) + { + subsList.add(subs); + } + + for (String attr : works.getAttributeIds().split(",")) + { + attrList.add(attr); + } + } + + request.setAttribute("indIdarr", Lists.toString(subsList)); + request.setAttribute("subsList", subsList); + request.setAttribute("attrIdarr", Lists.toString(attrList)); + request.setAttribute("attrList", attrList); + + // 获取行业下的子行业 + List inSubList = ORM.get(ZTable.class).list(DesLabelIndustry.class, new Selector("industryId", works.getIndustryId())); + request.setAttribute("inSubList", inSubList); + + // 获取行业下的属性分类 + List attrCatList = ORM.get(ZTable.class).list(DesLabelAttributeCat.class, new Selector("industryId", works.getIndustryId())); + request.setAttribute("attrCatList", attrCatList); + + Map> map = new HashMap>(); + for (DesLabelAttributeCat cat : attrCatList) + { + List attrsList = ORM.get(ZTable.class).list(DesLabelAttribute.class, new Selector("attributeCatId", cat.getAttributeCatId())); + map.put(cat.getAttributeCatId(), attrsList); + } + request.setAttribute("map", map); + + // ==================================================================================== + + // 子行业列表 + List subIndustryList = ORM.get(ZTable.class).list(DesLabelIndustry.class); + Map> subIndustryMap = new HashMap<>(); + for (DesLabelIndustry subIn : subIndustryList) + { + List subList = subIndustryMap.get(subIn.getIndustryId()); + subList = subList != null ? subList : new ArrayList(); + subList.add(subIn); + + subIndustryMap.put(subIn.getIndustryId(), subList); + } + request.setAttribute("subIndustryMap", subIndustryMap); + + // 行业所有分类 + List attributeCatList = ORM.get(ZTable.class).list(DesLabelAttributeCat.class); + Map> attributeCatMap = new HashMap<>(); + for (DesLabelAttributeCat cat : attributeCatList) + { + List group = attributeCatMap.get(cat.getIndustryId()); + group = group != null ? group : new ArrayList(); + group.add(cat); + + attributeCatMap.put(cat.getIndustryId(), group); + } + request.setAttribute("attributeCatMap", attributeCatMap); + + // 关联标签属性 列表 + List attributeList = ORM.get(ZTable.class).list(DesLabelAttribute.class); + Map> attributeMap = new HashMap>(); + for (DesLabelAttribute attr : attributeList) + { + List group = attributeMap.get(attr.getAttributeCatId()); + group = group != null ? group : new ArrayList(); + group.add(attr); + + attributeMap.put(attr.getAttributeCatId(), group); + } + request.setAttribute("attributeMap", attributeMap); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/MaterialCatAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/MaterialCatAction.java new file mode 100644 index 0000000..a507c12 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/MaterialCatAction.java @@ -0,0 +1,104 @@ +package com.zhiqim.yangcai.design.action.works; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.ones.IsSelect; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.DesMaterialCatCache; +import com.zhiqim.yangcai.design.dbo.works.DesMaterialCat; +import com.zhiqim.yangcai.design.dbo.works.DesMaterialCont; + +/** + * [简要描述]:作品素材分类
            + * + * @version 1.0 @author caohong 2019-9-5 新建与整理 + */ +public class MaterialCatAction extends StdSwitchAction +{ + + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsSelect("catId", "字符编码不能为空且不超过16个字母")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsNotEmpty("catName", "请输入分类名称")); + request.addValidate(new IsNotEmpty("catSeq", "请选分类序号")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + List result = ORM.get(ZTable.class).list(DesMaterialCat.class, new Selector().addOrderbyAsc("catSeq")); + request.setAttribute("result", result); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long catId = request.getParameterLong("catId"); + DesMaterialCat cat = ORM.get(ZTable.class).item(DesMaterialCat.class, catId); + + request.setAttribute("item", cat); + } + + @Override + @AnTransaction + protected void insert(HttpRequest request) throws Exception + { + DesMaterialCat cat = request.getParameter(DesMaterialCat.class); + cat.setCatId(Ids.longId13()); + if (ORM.get(ZTable.class).count(DesMaterialCat.class, cat.getCatId()) > 0) + { + request.returnHistory("分类编码已存在,请重新输入"); + return; + } + + ORM.get(ZTable.class).insert(cat); + Global.get(DesMaterialCatCache.class).doRefresh(); + } + + @Override + @AnTransaction + protected void update(HttpRequest request) throws Exception + { + DesMaterialCat cat = request.getParameter(DesMaterialCat.class); + + ORM.get(ZTable.class).replace(cat); + Global.get(DesMaterialCatCache.class).doRefresh(); + } + + @Override + @AnTransaction + protected void delete(HttpRequest request) throws Exception + { + long catId = request.getParameterLong("catId"); + if (ORM.get(ZTable.class).count(DesMaterialCont.class, new Selector("catId", catId)) > 0) + { + request.returnHistory("该分类已被使用,不允许删除"); + return; + } + + ORM.get(ZTable.class).delete(DesMaterialCat.class, catId); + Global.get(DesMaterialCatCache.class).doRefresh(); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/MaterialContAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/MaterialContAction.java new file mode 100644 index 0000000..04662f6 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/MaterialContAction.java @@ -0,0 +1,46 @@ +package com.zhiqim.yangcai.design.action.works; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.SwitchAction; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.works.DesMaterialCont; + +/** + * [简要描述]:素材内容管理
            + * + * @version 1.0 @author caohong 2019-9-5 新建与整理 + */ +public class MaterialContAction extends SwitchAction +{ + public static String ROOT = Global.getString("works", "root", "works"); // 根目录 + + public void list(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("page.size", 20); + String keywords = request.getParameter("keywords"); + long catId = request.getParameterLong("catId"); + + Selector sel = new Selector(); + sel.addMaybe("catId", catId); + sel.addMaybeLike("keywords", keywords); + + sel.addOrderbyAsc("materialSeq"); + PageResult pageResult = ORM.get(ZTable.class).page(DesMaterialCont.class, pageNo, pageSize, sel); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + } + + public void add(HttpRequest request) throws Exception + { + request.setAttribute("uploadPath", Strings.addEndsWith(ROOT, "/") + "material/" + DateTimes.getDateTime6String()); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksAuditAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksAuditAction.java new file mode 100644 index 0000000..15a8fda --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksAuditAction.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.works; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/** + * 精品审核 + * + * @version v1.0.0 @author Deng 2017-11-4 新建与整理 + */ +public class WorksAuditAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + List prdList = ORM.get(ZTable.class).list(DesignType.class); + request.setAttribute("prdList", prdList); + + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksBestAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksBestAction.java new file mode 100644 index 0000000..60a3dab --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksBestAction.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.works; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/** + * 我的精品 + * + * @version v1.0.0 @author Deng 2017-10-21 新建与整理 + */ +public class WorksBestAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + List prdList = ORM.get(ZTable.class).list(DesignType.class); + request.setAttribute("prdList", prdList); + + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksCollectAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksCollectAction.java new file mode 100644 index 0000000..f2a40de --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksCollectAction.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.works; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/** + * 我收藏的 + * + * @version v1.0.0 @author Deng 2017-10-21 新建与整理 + */ +public class WorksCollectAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + List prdList = ORM.get(ZTable.class).list(DesignType.class); + request.setAttribute("prdList", prdList); + + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksDownloadAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksDownloadAction.java new file mode 100644 index 0000000..5f15ac7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksDownloadAction.java @@ -0,0 +1,160 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.works; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.httpclient.HttpDownload; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dao.FileCheckDao; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.works.DesWorksEvent; +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; + +/** + * 作品下载 + * + * @version v1.0.0 @author zzy 2017-10-21 新建与整理 + */ +public class WorksDownloadAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long worksId = request.getParameterLong("worksId"); + DesWorksFile srcFile = ORM.get(ZTable.class).item(DesWorksFile.class, worksId); + if (srcFile == null) + { + request.setAlertMsg("文件不存在,请重新选择"); + return; + } + + String fileName = srcFile.getCdrFileName(); + String cdrPath = srcFile.getCdrPath(); + + if (Validates.isUrl(cdrPath)) + { + String dir = FileCheckDao.getCurrentTempFolder("works/srcFile"); + HttpDownload download = new HttpDownload(cdrPath); + download.setConnectTimeout(30); + download.setReadTimeout(30 * 60); + download.setFileDir(dir); + download.setFileName(fileName); + download.execute(); + + responseFile(dir + "/" + fileName, request, fileName); + return; + } + + if (Files.exists(cdrPath)) + {// 本地文件存在 + responseFile(cdrPath, request, fileName); + } + else + { + Selector selector = new Selector(); + selector.addMust("designId", worksId); + selector.addMust("attaModul", FileTypeConstants.FILE_DESGIN.value()); + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, selector); + if (atta == null) + { + request.returnHistory("文件不存在,请重新选择"); + return; + } + + if (Files.exists(atta.getSavePath())) + { + responseFile(cdrPath, request, fileName); + return; + } + + if (Validates.isEmptyBlank(atta.getOssUrl())) + { + request.returnHistory("文件不存在,请重新选择"); + return; + } + + String dir = FileCheckDao.getCurrentTempFolder("works"); + String filePath = Strings.addEndsWith(dir, "/") + fileName; + HttpDownload download = new HttpDownload(atta.getOssUrl()); + download.setConnectTimeout(30); + download.setReadTimeout(30 * 60); + download.setFileDir(dir); + download.setFileName(fileName); + download.execute(); + if (!download.isResponseSuccess()) + {// 下载失败 + request.returnHistory("下载失败"); + return; + } + + responseFile(filePath, request, fileName); + } + + DesWorksEvent event = new DesWorksEvent(); + event.setEventId(Ids.longId19()); + event.setWorksId(worksId); + event.setEventType(4); + event.setOperatorCode(request.getSessionName()); + event.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(event); + } + + private static void responseFile(String filePath, HttpRequest request, String fileName) throws IOException + { + HttpResponse response = request.getResponse(); + if (Validates.isEmptyBlank(fileName)) + { + fileName = Files.getFileName(filePath); + } + + try (FileInputStream input = new FileInputStream(filePath)) + { + String downName = Urls.encodeUTF8(fileName); + if (request.isChrome()) + {// chrome不支持括号也是醉了 + downName = downName.replaceAll("%28", "("); + downName = downName.replaceAll("%29", ")"); + } + + if (request.isFirefox()) + { + response.setHeader(_CONTENT_DISPOSITION_, "attachment; filename*=UTF-8''" + fileName); + } + else + { + response.setHeader(_CONTENT_DISPOSITION_, "attachment; filename=" + downName); + } + + response.setContentType(_APPLICATION_OCTET_STREAM_); + response.setHeader(_CONTENT_LENGTH_, new File(filePath).length()); + Streams.putBytes(input, response.getOutputStream()); + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksListAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksListAction.java new file mode 100644 index 0000000..0aab801 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksListAction.java @@ -0,0 +1,55 @@ +package com.zhiqim.yangcai.design.action.works; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; + +/** + * 作品列表 + * + * @version v1.0.0 @author Deng 2017-11-24 新建与整理 + */ +public class WorksListAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = 20; + + long worksType = request.getParameterLong("worksType"); + long prdTypeId = request.getParameterLong("prdTypeId"); + long industryId = request.getParameterLong("industryId"); + + Selector selector = new Selector(); + if (worksType != -1) + { + selector.addMust("worksType", worksType); + } + + if (prdTypeId != -1) + { + selector.addMust("prdTypeId", prdTypeId); + } + + if (industryId != -1) + { + selector.addMust("industryId", industryId); + } + + selector.addOrderbyDesc("createTime"); + PageResult pageResult = ORM.get(ZTable.class).page(DesWorksFile.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + request.setAttribute("pageResult", pageResult); + + request.setAttribute("worksType", worksType); + request.setAttribute("prdTypeId", prdTypeId); + request.setAttribute("industryId", industryId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksMyAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksMyAction.java new file mode 100644 index 0000000..9ed75d7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksMyAction.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.works; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/** + * 我的作品 + * + * @version v1.0.0 @author Deng 2017-10-21 新建与整理 + */ +public class WorksMyAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + List prdList = ORM.get(ZTable.class).list(DesignType.class); + request.setAttribute("prdList", prdList); + + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksShareAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksShareAction.java new file mode 100644 index 0000000..7e69a29 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksShareAction.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.works; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/** + * 给我分享的 + * + * @version v1.0.0 @author Deng 2017-10-21 新建与整理 + */ +public class WorksShareAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + List prdList = ORM.get(ZTable.class).list(DesignType.class); + request.setAttribute("prdList", prdList); + + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksShowAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksShowAction.java new file mode 100644 index 0000000..c786363 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksShowAction.java @@ -0,0 +1,96 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.action.works; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.works.DesWorksEvent; +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; + +/** + * + * 查看作品 + * + * @version v1.0.0 @author Deng 2017-11-2 新建与整理 + */ +public class WorksShowAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long worksId = request.getParameterLong("worksId"); + DesWorksFile works = ORM.get(ZTable.class).item(DesWorksFile.class, worksId); + if (works == null) + { + request.returnHistory("文件不存在,请重新选择"); + return; + } + + if (works.getKeywordName() != null) + { + works.setKeywordName(works.getKeywordName().replace(" ", ",")); + } + + Selector dSelector = new Selector(); + dSelector.addMustInLong("parentId", 1803021010350856L, 1803021011250863L); + List deptList = ORM.get(ZTable.class).list(ZmrDept.class, dSelector); + request.setAttribute("deptList", deptList); + + // 组装已分享的部门ID + List constrList = new ArrayList(); + if (Validates.isNotEmpty(works.getDeptId())) + { + String[] deptStr = works.getDeptId().split(","); + for (String str : deptStr) + { + constrList.add(str); + } + } + request.setAttribute("constrList", constrList); + + // 浏览数 + int browseNum = ORM.get(ZTable.class).count(DesWorksEvent.class, new Selector().addMust("worksId", worksId).addMust("eventType", 1)); + // 收藏数 + int collectNum = ORM.get(ZTable.class).count(DesWorksEvent.class, new Selector().addMust("worksId", worksId).addMust("eventType", 2)); + // 下载数 + int downNum = ORM.get(ZTable.class).count(DesWorksEvent.class, new Selector().addMust("worksId", worksId).addMust("eventType", 4)); + + // 此用户是否已收藏 + Selector selector = new Selector(); + selector.addMust("worksId", worksId); + selector.addMust("eventType", 2); + selector.addMust("operatorCode", request.getSessionName()); + DesWorksEvent event = ORM.get(ZTable.class).item(DesWorksEvent.class, selector); + if (event != null) + { + request.setAttribute("userEventId", event.getEventId()); + } + else + { + request.setAttribute("userEventId", 0); + } + + request.setAttribute("browseNum", browseNum); + request.setAttribute("collectNum", collectNum); + request.setAttribute("downNum", downNum); + request.setAttribute("works", works); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksShowPCAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksShowPCAction.java new file mode 100644 index 0000000..d41be43 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksShowPCAction.java @@ -0,0 +1,32 @@ +package com.zhiqim.yangcai.design.action.works; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; + +/** + * + * 对外查看作品 + * + * @version v1.0.0 @author caohong 2019-9-7 新建与整理 + */ +public class WorksShowPCAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long templateId = request.getParameterLong("templateId"); + + MediaTemplateView media = ORM.get(ZView.class).item(MediaTemplateView.class, new Selector("mediaId", templateId)); + if (media == null) + { + request.setResponseError("该模板已删除"); + return; + } + request.setAttribute("media", media); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksUploadAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksUploadAction.java new file mode 100644 index 0000000..31547af --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/action/works/WorksUploadAction.java @@ -0,0 +1,66 @@ +package com.zhiqim.yangcai.design.action.works; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.cache.DesignTypeCache; +import com.zhiqim.yangcai.design.dbo.DesLabelIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/** + * 作品上传 + * + * @version v1.0.0 @author caohong 2019-9-5 新建与整理 + */ +public class WorksUploadAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + List prdList = ORM.get(ZTable.class).list(DesignType.class); + request.setAttribute("prdList", prdList); + List indList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setAttribute("indList", indList); + + // 获取行业下的子行业,默认取第一个 + List inSubList = ORM.get(ZTable.class).list(DesLabelIndustry.class, new Selector("industryId", indList.get(0).getIndustryId())); + request.setAttribute("inSubList", inSubList); + + Map prdMap = new HashMap(); + for (DesignType type : Global.get(DesignTypeCache.class).getList()) + { + prdMap.put(type.getTypeId(), type.getTypeName()); + } + + // 子行业列表 + List subIndustryList = ORM.get(ZTable.class).list(DesLabelIndustry.class); + Map> subIndustryMap = new HashMap<>(); + for (DesLabelIndustry subIn : subIndustryList) + { + List subList = subIndustryMap.get(subIn.getIndustryId()); + subList = subList != null ? subList : new ArrayList(); + subList.add(subIn); + + subIndustryMap.put(subIn.getIndustryId(), subList); + } + request.setAttribute("subIndustryMap", subIndustryMap); + + String dateDir = DateTimes.getDateTime8String(); + + request.setAttribute("dateDir", dateDir); + request.setAttribute("prdMap", prdMap); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/ConsumerTypeConstants.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/ConsumerTypeConstants.java new file mode 100644 index 0000000..733b26e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/ConsumerTypeConstants.java @@ -0,0 +1,60 @@ +/** + * 扬彩印刷设计 + * 文件名 :ConsumerTypeConstants.java + * 创建人 :jiangbin + * 创建时间:2019-12-17 + */ +package com.zhiqim.yangcai.design.constant; + +import java.util.HashMap; +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnAlias; + +/** + * 客户类型常量 + * + * @version v1.0.0 @author jiangbin 2019-12-17 新建与整理 + */ +@AnAlias("ConsumerTypeConstants") +public class ConsumerTypeConstants +{ + /** 企业 */ + public static int ENTERPRISE = 1; + + /** 渠道商 */ + public static int CHANNEL_BUSINESS = 2; + + /** 个体户 */ + public static int SELF_EMPLOYED = 3; + + public static Map map = new HashMap<>(); + + static + { + map.clear(); + + map.put(ENTERPRISE, "企业"); + map.put(CHANNEL_BUSINESS, "渠道商"); + map.put(SELF_EMPLOYED, "个体户"); + } + + /** + * 客户类型map + * @return + */ + public static Map getConsumerTypeMap() + { + return map; + } + + /** + * 获取客户类型 + * @param i + * @return + */ + public static String getConsumerType(int i) + { + return map.get(i); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/DesignConstants.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/DesignConstants.java new file mode 100644 index 0000000..92be198 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/DesignConstants.java @@ -0,0 +1,17 @@ +package com.zhiqim.yangcai.design.constant; + +/** + * + * 公共常量定义 + * + * @version v1.0.0 @author PVer 2018-3-19 新建与整理 + */ +public interface DesignConstants +{ + public static final String DESIGNNING_MAP = "designningMap"; + + public static final String LONG_TAIL_KEYWORD_MAP = "longTailKeywordMap"; + + /** 11位手机号 */ + public static final String ZMR_MOBILE = "^0?(13|14|15|16|17|18|19)[0-9]{9}$"; +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/KeywordScoreConstants.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/KeywordScoreConstants.java new file mode 100644 index 0000000..907ff9f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/KeywordScoreConstants.java @@ -0,0 +1,82 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.constant; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.consts.Str; + +/** + * 关键词分数常量 + * + * @version v1.0.0 @author Deng 2018-3-5 新建与整理 + */ +@AnAlias("KeywordScoreConstants") +public class KeywordScoreConstants +{ + /** 选中 */ + public static Str KEYWORD_SELECT = new Str("KEYWORD_SELECT", "选中"); + + /** 初稿 */ + public static Str KEYWORD_DRAFT = new Str("KEYWORD_DRAFT", "初稿"); + + /** 定稿 */ + public static Str KEYWORD_FINAL = new Str("KEYWORD_FINAL", "定稿"); + + /** 取消选中 */ + public static Str KEYWORD_SELECT_CANCEL = new Str("KEYWORD_SELECT_CANCEL", "取消选中"); + + /** 订单取消 */ + public static Str KEYWORD_ORDER_CANCEL = new Str("KEYWORD_ORDER_CANCEL", "订单取消"); + + /**************************************************/ + //业务操作 + /**************************************************/ + private static List allList = new ArrayList<>(); + + static + { + allList.add(KEYWORD_SELECT); + allList.add(KEYWORD_DRAFT); + allList.add(KEYWORD_FINAL); + allList.add(KEYWORD_SELECT_CANCEL); + allList.add(KEYWORD_ORDER_CANCEL); + } + + /** + * 关键词参数列表 + * @param scoreName + * @return + */ + public static List getKeywordParamList() + { + return allList; + } + + /** + * 查询关键词参数描述 + * @param key + * @return + */ + public static String getKeywordParamDesc(String key) + { + for (Str score : allList) + { + if (score.value().equals(key)) + return score.desc(); + } + + return ""; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/PerformanceStatConstants.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/PerformanceStatConstants.java new file mode 100644 index 0000000..04bd291 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/PerformanceStatConstants.java @@ -0,0 +1,31 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.constant; + +import org.zhiqim.kernel.util.consts.Str; + +/** + * 统计绩效常量 + * + * @version v1.0.0 @author liuhu 2018-12-13 新建与整理 + */ +public class PerformanceStatConstants +{ + public static Str NORMAL_PROCESSING = new Str("NORMAL_PROCESSING", "常规后加工"); + public static Str SPECIAL_PROCESSING = new Str("SPECIAL_PROCESSING", "特殊后加工"); + + public static long SOFT_ROLE_ID = 1822254949277L; // 软件应用组 设计组长角色编号 + + public static long CDR_ROLE_ID = 1806191442254777L; // CDR组 设计组长角色编号 + + public static double QC_SCORE = 100; // 设计师质检初始分数; +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/ScoreConstants.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/ScoreConstants.java new file mode 100644 index 0000000..004e7ce --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/ScoreConstants.java @@ -0,0 +1,211 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.constant; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.consts.Str; + +/** + * 模板分数常量 + * + * @version v1.0.0 @author Deng 2018-3-5 新建与整理 + */ +@AnAlias("ScoreConstants") +public class ScoreConstants +{ + public static final String SCORE_TEMPLATE = "TEMPLATE"; + + public static final String SCORE_KEYWORD = "KEYWORD"; + + /**************************************************/ + // 关键词常量 + /**************************************************/ + + /** 关键词基础分 */ + public static Str KEYWROD_BASE_SCORE = new Str("KEYWROD_BASE_SCORE", "基础分"); + + /** 关键词搜索分 */ + public static Str KEYWROD_SEARCH_SCORE = new Str("KEYWROD_SEARCH_SCORE", "搜索分"); + + /** 关键词标签 */ + public static Str KEYWROD_LABEL_SCORE = new Str("KEYWROD_LABEL_SCORE", "标签"); + + /** 自定义标签 */ + public static Str CUSTOM_LABEL_KEYWORD = new Str("CUSTOM_LABEL_KEYWORD", "自定义标签"); + + /** 长尾词 */ + public static Str LONG_TAIL_KEYWROD_SCORE = new Str("LONG_TAIL_KEYWROD_SCORE", "长尾词"); + + /**************************************************/ + // 模板分数常量 + /**************************************************/ + + /** 基础分 */ + public static Str BASE_SCORE = new Str("BASE_SCORE", "基础分"); + + /** 动态分 */ + public static Str FLOAT_SCORE = new Str("FLOAT_SCORE", "动态分"); + + /** 销量分 */ + public static Str SALE_SCORE = new Str("SALE_SCORE", "销量分"); + + /** 用户评分 */ + public static Str USER_SCORE = new Str("USER_SCORE", "用户评分"); + + /** 积分类型 */ + public static Str SCORE_TYPE_1 = new Str("1", "常规时间内开启接单"); + public static Str SCORE_TYPE_2 = new Str("2", "接单4小时内定稿"); + public static Str SCORE_TYPE_3 = new Str("3", "接单4-6小时内定稿"); + public static Str SCORE_TYPE_4 = new Str("4", "大金额订单定稿奖励(300-500元)"); + public static Str SCORE_TYPE_5 = new Str("5", "大金额订单定稿奖励(500元以上)"); + public static Str SCORE_TYPE_6 = new Str("6", "定稿5款及以上订单"); + public static Str SCORE_TYPE_7 = new Str("7", "定稿包含后加工"); + public static Str SCORE_TYPE_100 = new Str("100", "人工修正"); + public static Str SCORE_TYPE_101 = new Str("101", "接单48小时未定稿"); + public static Str SCORE_TYPE_102 = new Str("102", "待办事项12小时内未处理"); + public static Str SCORE_TYPE_103 = new Str("103", "订单申请退款"); + public static Str SCORE_TYPE_104 = new Str("104", "订单产生售后"); + public static Str SCORE_TYPE_105 = new Str("105", "客户投诉"); + public static Str SCORE_TYPE_106 = new Str("106", "订单设计取消"); + public static Str SCORE_TYPE_107 = new Str("107", "老客户订单"); + public static Str SCORE_TYPE_108 = new Str("108", "设计师放弃订单"); + + /**************************************************/ + // 业务操作 + /**************************************************/ + + private static List keywordList = new ArrayList<>(); + private static List templateList = new ArrayList<>(); + private static List scoreTypeList = new ArrayList<>(); + static + { + templateList.add(BASE_SCORE); + templateList.add(FLOAT_SCORE); + templateList.add(SALE_SCORE); + templateList.add(USER_SCORE); + + keywordList.add(KEYWROD_BASE_SCORE); + keywordList.add(KEYWROD_SEARCH_SCORE); + keywordList.add(KEYWROD_LABEL_SCORE); + keywordList.add(CUSTOM_LABEL_KEYWORD); + keywordList.add(LONG_TAIL_KEYWROD_SCORE); + + scoreTypeList.add(SCORE_TYPE_1); + scoreTypeList.add(SCORE_TYPE_2); + scoreTypeList.add(SCORE_TYPE_3); + scoreTypeList.add(SCORE_TYPE_4); + scoreTypeList.add(SCORE_TYPE_5); + scoreTypeList.add(SCORE_TYPE_6); + scoreTypeList.add(SCORE_TYPE_7); + scoreTypeList.add(SCORE_TYPE_100); + scoreTypeList.add(SCORE_TYPE_101); + scoreTypeList.add(SCORE_TYPE_102); + scoreTypeList.add(SCORE_TYPE_103); + scoreTypeList.add(SCORE_TYPE_104); + scoreTypeList.add(SCORE_TYPE_105); + scoreTypeList.add(SCORE_TYPE_106); + scoreTypeList.add(SCORE_TYPE_107); + scoreTypeList.add(SCORE_TYPE_108); + } + + /** + * 模板分数类型列表 + * + * @param scoreName + * @return + */ + public static List getTemplateScoreTypeList() + { + return templateList; + } + + /** + * 查询模板类型描述 + * + * @param key + * @return + */ + public static String getTemplateScoreTypeDesc(String key) + { + for (Str score : templateList) + { + if (score.value().equals(key)) + { + return score.desc(); + } + } + + return ""; + } + + /** + * 关键词分数类型列表 + * + * @param scoreName + * @return + */ + public static List getKeywordScoreTypeList() + { + return keywordList; + } + + /** + * 查询关键词类型描述 + * + * @param key + * @return + */ + public static String getKeywordScoreTypeDesc(String key) + { + for (Str score : keywordList) + { + if (score.value().equals(key)) + { + return score.desc(); + } + } + + return ""; + } + + /** + * 评分类型列表 + * + * @return + */ + public static List getScoreTypeList() + { + return scoreTypeList; + } + + /** + * 查询评分类型描述 + * + * @param key + * @return + */ + public static String getScoreTypeListDesc(String key) + { + for (Str score : scoreTypeList) + { + if (score.value().equals(key)) + { + return score.desc(); + } + } + + return ""; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/TemplateScoreConstants.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/TemplateScoreConstants.java new file mode 100644 index 0000000..6f47efd --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/TemplateScoreConstants.java @@ -0,0 +1,194 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.constant; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.consts.Str; + +/** + * 模板分数常量 + * + * @version v1.0.0 @author Deng 2018-3-5 新建与整理 + */ +@AnAlias("TemplateScoreConstants") +public class TemplateScoreConstants +{ + + /**************************************************/ + // 动态分常量 + /**************************************************/ + + /** 浏览 */ + public static Str TEMPLATE_BROWSE = new Str("TEMPLATE_BROWSE", "浏览"); + + /** 下载 */ + public static Str TEMPLATE_DOWN = new Str("TEMPLATE_DOWN", "下载"); + + /** 收藏 */ + public static Str TEMPLATE_COLLECT = new Str("TEMPLATE_COLLECT", "收藏"); + + /** 分享 */ + public static Str TEMPLATE_SHARE = new Str("TEMPLATE_SHARE", "分享"); + + /** 取消分享 */ + public static Str CANCEL_TEMPLATE_SHARE = new Str("CANCEL_TEMPLATE_SHARE", "取消分享"); + + /** 复制 */ + public static Str TEMPLATE_COPY = new Str("TEMPLATE_COPY", "复制"); + + /** 精品 */ + public static Str TEMPLATE_BEST = new Str("TEMPLATE_BEST", "精品"); + + /** 取消精品 */ + public static Str TEMPLATE_BEST_CANCEL = new Str("TEMPLATE_BEST_CANCEL", "取消精品"); + + /** 取消收藏 */ + public static Str TEMPLATE_COLLECT_CANCEL = new Str("TEMPLATE_COLLECT_CANCEL", "取消收藏"); + + /**************************************************/ + // 销量分常量 + /**************************************************/ + /** 初稿 */ + public static Str TEMPLATE_DRAFT = new Str("TEMPLATE_DRAFT", "初稿"); + + /** 定稿 */ + public static Str TEMPLATE_FINAL = new Str("TEMPLATE_FINAL", "定稿"); + + /** 定稿退回 */ + public static Str TEMPLATE_FINAL_CANCEL = new Str("TEMPLATE_FINAL_CANCEL", "定稿退回"); + + /** 取消订单 */ + public static Str TEMPLATE_ORDER_CANCEL = new Str("TEMPLATE_ORDER_CANCEL", "取消订单"); + + /**************************************************/ + // 业务操作 + /**************************************************/ + private static List allList = new ArrayList<>(); + private static List floatList = new ArrayList<>(); + private static List saleList = new ArrayList<>(); + + static + { + allList.add(TEMPLATE_BROWSE); + allList.add(TEMPLATE_DOWN); + allList.add(TEMPLATE_COLLECT); + allList.add(TEMPLATE_SHARE); + allList.add(CANCEL_TEMPLATE_SHARE); + allList.add(TEMPLATE_COPY); + allList.add(TEMPLATE_BEST); + allList.add(TEMPLATE_BEST_CANCEL); + allList.add(TEMPLATE_COLLECT_CANCEL); + allList.add(TEMPLATE_DRAFT); + allList.add(TEMPLATE_FINAL); + allList.add(TEMPLATE_FINAL_CANCEL); + allList.add(TEMPLATE_ORDER_CANCEL); + + floatList.add(TEMPLATE_BROWSE); + floatList.add(TEMPLATE_DOWN); + floatList.add(TEMPLATE_COLLECT); + floatList.add(TEMPLATE_SHARE); + floatList.add(CANCEL_TEMPLATE_SHARE); + floatList.add(TEMPLATE_COPY); + floatList.add(TEMPLATE_BEST); + floatList.add(TEMPLATE_BEST_CANCEL); + floatList.add(TEMPLATE_COLLECT_CANCEL); + + saleList.add(TEMPLATE_DRAFT); + saleList.add(TEMPLATE_FINAL); + saleList.add(TEMPLATE_ORDER_CANCEL); + } + + /** + * 模板分数列表 + * + * @param scoreName + * @return + */ + public static List getTemplateParamList() + { + return allList; + } + + /** + * 查询模板动态分描述 + * + * @param key + * @return + */ + public static String getTemplateParamDesc(String key) + { + for (Str score : allList) + { + if (score.value().equals(key)) + return score.desc(); + } + + return ""; + } + + /** + * 模板动态分列表 + * + * @param scoreName + * @return + */ + public static List getTemplateFloatList() + { + return floatList; + } + + /** + * 查询模板动态分描述 + * + * @param key + * @return + */ + public static String getTemplateFloatDesc(String key) + { + for (Str score : floatList) + { + if (score.value().equals(key)) + return score.desc(); + } + + return ""; + } + + /** + * 模板销量分列表 + * + * @param scoreName + * @return + */ + public static List getTemplateSaleList() + { + return saleList; + } + + /** + * 查询模板销量分描述 + * + * @param key + * @return + */ + public static String getTemplateSaleDesc(String key) + { + for (Str score : saleList) + { + if (score.value().equals(key)) + return score.desc(); + } + + return ""; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/VirtualAccountConstants.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/VirtualAccountConstants.java new file mode 100644 index 0000000..3987f77 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/constant/VirtualAccountConstants.java @@ -0,0 +1,81 @@ +package com.zhiqim.yangcai.design.constant; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.consts.Str; + +/** + * 虚拟账户交易类型常量 + * + * @version 1.0 @author hc 2021年6月17日 新建与整理 + */ +@AnAlias("VirtualAccountConstants") +public class VirtualAccountConstants +{ + + /** 交易类型 */ + public static Str UNFREEZE = new Str("101", "解冻金额"); + public static Str SENDSALARY = new Str("102", "发放工资"); + public static Str FREEZESALARY = new Str("103", "冻结资金"); + public static Str ABNORMALAUDIT = new Str("104", "异常稽核"); + + public static Str TRANSACTION_STATUS_0 = new Str("0", "订单量奖励"); + public static Str TRANSACTION_STATUS_1 = new Str("1", "加急单奖励"); + public static Str TRANSACTION_STATUS_2 = new Str("2", "时效奖励"); + public static Str TRANSACTION_STATUS_3 = new Str("3", "老客户奖励"); + public static Str TRANSACTION_STATUS_4 = new Str("4", "完成订单奖励"); + public static Str TRANSACTION_STATUS_5 = new Str("5", "售后处理"); + public static Str TRANSACTION_STATUS_6 = new Str("6", "订单退回"); + public static Str TRANSACTION_STATUS_7 = new Str("7", "跨月订单退回"); + + /**************************************************/ + // 业务操作 + /**************************************************/ + + private static List transactionStatusList = new ArrayList<>(); + static + { + transactionStatusList.add(UNFREEZE); + transactionStatusList.add(SENDSALARY); + transactionStatusList.add(FREEZESALARY); + transactionStatusList.add(ABNORMALAUDIT); + + transactionStatusList.add(TRANSACTION_STATUS_0); + transactionStatusList.add(TRANSACTION_STATUS_1); + transactionStatusList.add(TRANSACTION_STATUS_2); + transactionStatusList.add(TRANSACTION_STATUS_3); + transactionStatusList.add(TRANSACTION_STATUS_4); + transactionStatusList.add(TRANSACTION_STATUS_5); + transactionStatusList.add(TRANSACTION_STATUS_6); + transactionStatusList.add(TRANSACTION_STATUS_7); + } + + /** + * 交易类型列表 + */ + public static List getTransactionStatusList() + { + return transactionStatusList; + } + + /** + * 查询交易类型描述 + * + * @param key + * @return + */ + public static String getTransactionStatusListDesc(String key) + { + for (Str status : transactionStatusList) + { + if (status.value().equals(key)) + { + return status.desc(); + } + } + + return ""; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/AttaFileDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/AttaFileDao.java new file mode 100644 index 0000000..157a885 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/AttaFileDao.java @@ -0,0 +1,85 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dao; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.util.consts.Str; + +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.model.AttaFileModel; + + +/** + * 附件文件常用方法 + * @version v1.0.0 @author zhouwenbin 2017-8-10 新建与整理 + */ +public class AttaFileDao +{ + private static Map baseMap = new HashMap<>(); + private static Map> pageMap = new HashMap<>(); + static + { + AttaFileModel copy = new AttaFileModel("copy", "产品信息", "button"); + copy.setHeight(100); + baseMap.put("copy", copy); + + AttaFileModel userText = new AttaFileModel("userText", "客户文件", "text"); + userText.setHeight(160); + baseMap.put("userText", userText); + + AttaFileModel userNotice = new AttaFileModel("userNotice", "注意事项", "text"); + userNotice.setHeight(160); + baseMap.put("userNotice", userNotice); + + for (Str temp : FileTypeConstants.getFileTypeList()) + { + if (FileTypeConstants.FILE_THUMFILE.value().equals(temp.value())) + {//缩略图 + AttaFileModel custom = new AttaFileModel(temp.value(), temp.desc(), "thumFile"); + custom.setHeight(190); + baseMap.put(temp.value(), custom); + } + else if (FileTypeConstants.FILE_FIRSTTHUMFILE.value().equals(temp.value())) + {//初稿缩略图 + AttaFileModel custom = new AttaFileModel(temp.value(), temp.desc(), "firstThumFile"); + custom.setHeight(190); + baseMap.put(temp.value(), custom); + } + else + { + AttaFileModel custom = new AttaFileModel(temp.value(), temp.desc(), "file"); + custom.setHeight(190); + baseMap.put(temp.value(), custom); + } + } + } + + public static List getFileList(String name) + { + if (pageMap.containsKey(name)) + return pageMap.get(name); + else + return new ArrayList<>(); + } + + public static AttaFileModel get(String key) + { + if (baseMap.containsKey(key)) + return baseMap.get(key); + else + return null; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/AuthorityDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/AuthorityDao.java new file mode 100644 index 0000000..51adf6d --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/AuthorityDao.java @@ -0,0 +1,142 @@ +/** + * 扬彩印刷设计 + * 文件名 :AuthorityDao.java + * 创建人 :高佳新 + * 创建时间:2019-6-6 + */ + +package com.zhiqim.yangcai.design.dao; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +/** + * + * 权限部门遍历dao + * + * @version 1.0 @author gjx 2019-7-19 新建与整理 + */ +public class AuthorityDao +{ + /** + * + * 区分用户权限公用方法 + * + * @author gjx + * @param request + * @param sessionName 用户名(登录账号) + * @param selector 要添加的查询器 + * @param fieldName 区分权限字段名称 + * @throws ORMException + * @throws SQLException + */ + public static void ergodicOpecoterCode(HttpRequest request, String sessionName, Selector selector, String fieldName) throws ORMException, SQLException + { + + ZmrOperator zmrOperator = ORM.get(ZTable.class).item(ZmrOperator.class, new Selector().addMust("operatorCode", sessionName)); + if (zmrOperator == null) + { + request.returnHistory("该用户不存在"); + return; + } + if (zmrOperator.getOperatorType() == 2) + { + // 判定是否是部门管理人 + StringBuffer isDeptManagerSql = new StringBuffer(); + isDeptManagerSql.append("select * from zmr_dept where DEPT_MANAGER = '"); + isDeptManagerSql.append(sessionName); + isDeptManagerSql.append("' or FIND_IN_SET('"); + isDeptManagerSql.append(sessionName); + isDeptManagerSql.append("',DEPT_SUB_MANAGER)"); + List listDept = ORM.get(ZSQL.class).executeQuery(isDeptManagerSql.toString(), ZmrDept.class); + boolean isDeptManager = null != listDept && listDept.size() > 0; + // 不是部门管理员只允许看自己的 + if (!isDeptManager) + { + request.setAttribute("operatorList", new ArrayList<>()); + selector.addMust(fieldName, sessionName); + } + // 是部门管理员可以查看部门下所有人 + else if (isDeptManager) + { + // 递归所有子部门 + List newDeptList = new ArrayList<>(listDept); + for (ZmrDept zmrDept : listDept) + { + ergodicAllDept(zmrDept, newDeptList); + } + // 查询部门人员 + StringBuffer deptOperatorSql = new StringBuffer(); + deptOperatorSql.append("select * from ZMR_OPERATOR where 1=1 AND ("); + for (ZmrDept zmrDept : newDeptList) + { + deptOperatorSql.append(" FIND_IN_SET("); + deptOperatorSql.append(zmrDept.getDeptId()); + deptOperatorSql.append(",OPERATOR_DEPT) "); + deptOperatorSql.append("OR"); + } + deptOperatorSql.delete(deptOperatorSql.length() - 2, deptOperatorSql.length()); + deptOperatorSql.append(" ) "); + List oplist = ORM.get(ZSQL.class).executeQuery(deptOperatorSql.toString(), ZmrOperator.class); + request.setAttribute("operatorList", oplist); + String[] operatorId = new String[oplist.size()]; + for (int i = 0; i < operatorId.length; i++) + { + operatorId[i] = oplist.get(i).getOperatorCode(); + } + selector.addMustIn(fieldName, operatorId); + } + } + else + { + List operatorList = ORM.get(ZTable.class).list(ZmrOperator.class, new Selector().addMust("operatorStatus", 0)); + request.setAttribute("operatorList", operatorList); + } + } + + /** + * 递归所有子部门 + * + * @param dept + * @param list + */ + public static void ergodicAllDept(ZmrDept dept, List list) + { + if (null == dept || dept.getDeptId() <= 0 || null == list) + { + return; + } + StringBuffer sb = new StringBuffer("select * from zmr_dept where parent_id = "); + sb.append(dept.getDeptId()); + try + { + List oplist = ORM.get(ZSQL.class).executeQuery(sb.toString(), ZmrDept.class); + for (ZmrDept zmrDept : oplist) + { + if (!list.contains(zmrDept)) + { + list.add(zmrDept); + } + } + } + catch (ORMException e) + { + e.printStackTrace(); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/DesignerDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/DesignerDao.java new file mode 100644 index 0000000..40e69ce --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/DesignerDao.java @@ -0,0 +1,285 @@ +package com.zhiqim.yangcai.design.dao; + +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.DesignerWorkStatus; +import com.zhiqim.yangcai.design.dbo.design.DesignOrgMer; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.dispatch.DesOnline; +import com.zhiqim.yangcai.design.dbo.dispatch.DesOnlineTime; +import com.zhiqim.yangcai.design.dbo.dispatch.DesWorkSearchLog; +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourse; +import com.zhiqim.yangcai.design.dbo.qc.QcApplyScore; + +/** + * 设计师数据访问对象 + * + * @version v1.0.0 @author zouzhigang 2017-12-21 新建与整理 + */ +@AnAlias("DesignerDao") +public class DesignerDao +{ + + /** + * 是否显示接单 + * + * @param operatorCode 操作员编码 + * @return =true表示是设计师 + * @throws Exception 异常 + */ + public static boolean isDesigner(HttpRequest request, String operatorCode) throws Exception + { + + ZmrOperator operator = ZmrOperatorDao.getOperator(request, operatorCode); + if (operator == null) + { + return false; + } + + if ("reg".equals(operator.getOperatorParam())) + { + // 外部注册设计师标记,审核通过之后清除 + return false; + } + + DesignOrgMer org = ORM.get(ZTable.class).item(DesignOrgMer.class, operator.getOrgId()); + if (org == null) + { + return false; + } + + return true; + } + + /** + * 判断设计师是否正在接单状态 + * + * @param operatorCode 操作员编码 + * @return =true表示上班中 + * @throws Exception 异常 + */ + public static boolean isDesignerOnWork(String operatorCode) throws Exception + { + if (Validates.isEmptyBlank(operatorCode)) + { + return false; + } + + DesOnline online = ORM.get(ZTable.class).item(DesOnline.class, operatorCode); + return online != null && online.getOnlineStatus() == 1; + } + + /** + * 获取设计师接单状态 + * + * @param sessionUser 设计师会话 + * @return =0表示停止接单,=1表示正在接单 + * @throws Exception 异常 + */ + public static int getDesignerStatus(ZmrSessionUser sessionUser) throws Exception + { + DesOnline online = ORM.get(ZTable.class).item(DesOnline.class, sessionUser.getOperatorCode()); + if (online == null) + { + return 0; + } + + int status = online.getOnlineStatus(); + if (status == 1 && !sessionUser.getSessionId().equals(online.getSessionId())) + {// 在上班状态,但会话不同更新会话 + Updater updater = new Updater().addMust("operatorCode", sessionUser.getOperatorCode()).addField("sessionId", sessionUser.getSessionId()); + + ORM.get(ZTable.class).update(DesOnline.class, updater); + } + + return status; + } + + /** + * 获取设计师接单状态 + * + * @param sessionUser 设计师会话 + * @return =0表示停止接单,=1表示正在接单 + * @throws Exception 异常 + */ + public static int getDesignerStatus(String operatorCode) throws Exception + { + DesOnline online = ORM.get(ZTable.class).item(DesOnline.class, operatorCode); + if (online == null) + { + return 0; + } + + int status = online.getOnlineStatus(); + return status; + } + + /** + * 设计师开始接单 + * + * @param operatorCode + * @throws Exception + */ + @AnTransaction + public static void startWorkExec(long orgId, String operatorCode, Timestamp ondutyTime, String desc) throws Exception + { + // 上班操作日志 + doWorksStatusLog(orgId, operatorCode, desc, DesignerWorkStatus.ON_DUTY); + } + + /** + * 设计师停止接单 + * + * @param operatorCode + * @throws Exception + */ + @AnTransaction + public static void stopWorkExec(long orgId, String operatorCode, String desc) throws Exception + { + // 更新接单状态 + Updater updater = new Updater(); + updater.addMust("operatorCode", operatorCode); + updater.addField("onlineStatus", 0); + updater.addField("sessionId", null); + updater.addField("sessionTime", null); + updater.addField("orderNum", DispatchDao.getUnCompleteOrderNumber(operatorCode)); + ORM.get(ZTable.class).update(DesOnline.class, updater); + + // 设计师在线时长 ,根据日志计算 + // doDesOnlineTime(orgId, operatorCode); + + // 下班操作日志 + doWorksStatusLog(orgId, operatorCode, desc, DesignerWorkStatus.OFF_DUTY); + } + + /*** + * 接单状态操作日志 + * + * @param operatorCode 操作员 + * @param oprDesc 操作日志描述 + * @param type 操作类型 0=登录系统, 1=停止接单,2 正在接单,3=退出浏览器 + * @throws Exception + */ + public static void doWorksStatusLog(long orgId, String operatorCode, String oprDesc, int type) throws Exception + { + // 更新工作日志表 + DesWorkSearchLog log = new DesWorkSearchLog(); + log.setLogId(Ids.longId()); + log.setCreateTime(Sqls.nowTimestamp()); + log.setOperatorCode(operatorCode); + log.setOprDesc(oprDesc); + log.setLogType(type); + log.setOrgId(orgId); + ORM.get(ZTable.class).insert(log); + + // 更新扩展表 + Updater updater = new Updater(); + updater.addMust("designer", operatorCode); + updater.addField("lastOnlimeTime", Sqls.nowTimestamp()); + updater.addField("updateTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignerCourse.class, updater); + } + + /** + * 设计师在线时长 + * + * @param operatorCode + * @param status + * @throws Exception + */ + public static void doDesOnlineTime(long orgId, String operatorCode) throws Exception + { + String dayCode = DateTimes.getDateString(); + + Selector selector = new Selector(); + selector.addMust("operatorCode", operatorCode); + selector.addMustThenGE("createTime", Sqls.toTimestamp(dayCode, "00:00:00")); + selector.addOrderbyDesc("createTime"); + DesWorkSearchLog log = ORM.get(ZTable.class).item(DesWorkSearchLog.class, selector); + if (log == null) + { + return; + } + + if (!"点击开始接单".equals(log.getOprDesc())) + { + return; + } + + int onlineTime = DateTimes.compareMinute(Sqls.nowTimestamp(), log.getCreateTime()); + DesOnlineTime des = ORM.get(ZTable.class).item(DesOnlineTime.class, dayCode, operatorCode); + if (des == null) + { + DesOnlineTime time = new DesOnlineTime(); + time.setDayCode(dayCode); + time.setOperatorCode(operatorCode); + time.setOnlineTime(onlineTime); + time.setOrgId(orgId); + ORM.get(ZTable.class).insert(time); + } + else + { + Updater updater = new Updater(); + updater.addMust("dayCode", dayCode); + updater.addMust("operatorCode", operatorCode); + updater.addField("onlineTime", onlineTime + des.getOnlineTime()); + updater.addField("orgId", orgId); + ORM.get(ZTable.class).update(DesOnlineTime.class, updater); + } + } + + /** + * 通过产品类型编号查询产品类型 + * + * @param typeId + * @return + * @throws ORMException + * @throws SQLException + */ + public static String queryTypeName(long typeId) throws Exception + { + DesignType type = ORM.get(ZTable.class).item(DesignType.class, typeId); + if (type == null) + { + return ""; + } + + return type.getTypeName(); + } + + public static double getApplyScore(String designer) throws ORMException, SQLException + { + double score = 0; + if (Validates.isEmptyBlank(designer)) + { + return score; + } + + List list = ORM.get(ZTable.class).list(QcApplyScore.class, new Selector("designer", designer).addMust("applyFlag", 1)); + for (QcApplyScore temp : list) + { + score += temp.getScore(); + } + + return score; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/DesignerOrderDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/DesignerOrderDao.java new file mode 100644 index 0000000..f1f473f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/DesignerOrderDao.java @@ -0,0 +1,77 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dao; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; + +/** + * + * 设计师订单Dao + * + * @version v1.0.0 @author Deng 2017-12-27 新建与整理 + */ +@AnAlias("DesignerOrderDao") +public class DesignerOrderDao +{ + /** + * 查询订单是否有关联模板 + * @param designId + * @throws Exception + */ + public static boolean isOrderTemplate(long designId)throws Exception + { + int count = ORM.get(ZTable.class).count(MediaTemplate.class, new Selector("designId", designId)); + if(count > 0) + return true; + else + return false; + } + + /** + * 查询订单已选模板id + * @param oid + * @return + */ + public static List getOrderTemplate(long designId)throws Exception + { + List idList = new ArrayList(); + List mediaList = ORM.get(ZView.class).list(MediaTemplateView.class, new Selector("designId", designId)); + + for(MediaTemplateView media: mediaList) + { + idList.add(media.getMediaId()); + } + + return idList; + } + + /** + * 查询订单是否有缓存 + * @param designId + * @return + * @throws Exception + */ + public static boolean isOrderSession(long designId)throws Exception + { + return false; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/DesignerTemplateScoreDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/DesignerTemplateScoreDao.java new file mode 100644 index 0000000..3b35bc1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/DesignerTemplateScoreDao.java @@ -0,0 +1,247 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dao; + +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.dbo.keyword.DesKeywordIndex; +import com.zhiqim.yangcai.design.dbo.score.DesScoreParam; +import com.zhiqim.yangcai.design.dbo.score.DesScoreWeight; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateScore; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateScoreLog; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.util.SolrUtil; + +/** + * 设计师模板评分Dao + * + * @version v1.0.0 @author Deng 2018-3-5 新建与整理 + */ +public class DesignerTemplateScoreDao +{ + /** + * 模板基础分数计算 + * + * @param mediaId + * @param paramKey + * @throws Exception + */ + @AnTransaction + public static void doTempalteBaseScore(long mediaId) throws Exception + { + Selector selector = new Selector(); + selector.addMust("scoreName", ScoreConstants.SCORE_TEMPLATE); + selector.addMust("scoreType", ScoreConstants.BASE_SCORE.value()); + DesScoreWeight weight = ORM.get(ZTable.class).item(DesScoreWeight.class, selector); + if (weight == null) + return; + + DesTemplateScore score = new DesTemplateScore(); + score.setMediaId(mediaId); + score.setBaseScore(weight.getScoreValue()); + + ORM.get(ZTable.class).insert(score); + + doTemplateScoreCalc(mediaId); + } + + /** + * 模板动态分计算 + * + * @param mediaId + * @throws Exception + */ + @AnTransaction + public static void doTemplateFloatScore(long mediaId, String paramKey) throws Exception + { + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (media == null) + return; + + if (media.getTemplateType() < 100) + return; + + Selector selector = new Selector(); + selector.addMust("scoreName", ScoreConstants.SCORE_TEMPLATE); + selector.addMust("scoreType", ScoreConstants.FLOAT_SCORE.value()); + selector.addMust("paramKey", paramKey); + DesScoreParam param = ORM.get(ZTable.class).item(DesScoreParam.class, selector); + if (param == null) + return; + + int paramValue = param.getParamValue(); + DesTemplateScore score = ORM.get(ZTable.class).item(DesTemplateScore.class, mediaId); + if (score == null) + { + score = new DesTemplateScore(); + score.setMediaId(mediaId); + if (param.getParamType() == 0) + score.setFloatScore(paramValue); + else + score.setFloatScore(-paramValue); + + ORM.get(ZTable.class).insert(score); + } + else + { + Updater sUpdater = new Updater(); + sUpdater.addMust("mediaId", mediaId); + if (param.getParamType() == 0) + {// 加分 + sUpdater.addField("floatScore", score.getFloatScore() + paramValue); + } + else + {// 减分 + if (score.getFloatScore() < 0) + { + int floatScore = Math.abs(score.getFloatScore()) - paramValue; + sUpdater.addField("floatScore", floatScore); + } + else + sUpdater.addField("floatScore", score.getFloatScore() - paramValue); + } + + ORM.get(ZTable.class).update(DesTemplateScore.class, sUpdater); + } + + doTemplateScoreCalc(mediaId); + doDesTemplateScoreLogAdd(mediaId, ScoreConstants.FLOAT_SCORE.value(), param); + } + + /** + * 模板销量分计算 + * + * @param mediaId + * @throws Exception + */ + @AnTransaction + public static void doTemplateSaleScore(long mediaId, String paramKey) throws Exception + { + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (media == null) + return; + + if (media.getTemplateType() < 100) + return; + + Selector selector = new Selector(); + selector.addMust("scoreName", ScoreConstants.SCORE_TEMPLATE); + selector.addMust("scoreType", ScoreConstants.SALE_SCORE.value()); + selector.addMust("paramKey", paramKey); + DesScoreParam param = ORM.get(ZTable.class).item(DesScoreParam.class, selector); + if (param == null) + return; + + int paramValue = param.getParamValue(); + DesTemplateScore score = ORM.get(ZTable.class).item(DesTemplateScore.class, mediaId); + if (score == null) + { + score = new DesTemplateScore(); + score.setMediaId(mediaId); + if (param.getParamType() == 0) + score.setSaleScore(paramValue); + else + score.setSaleScore(-paramValue); + + ORM.get(ZTable.class).insert(score); + } + else + { + Updater sUpdater = new Updater(); + sUpdater.addMust("mediaId", mediaId); + if (param.getParamType() == 0) + {// 加分 + sUpdater.addField("floatScore", score.getSaleScore() + paramValue); + } + else + {// 减分 + if (score.getFloatScore() < 0) + { + int saleScore = Math.abs(score.getSaleScore()) - paramValue; + sUpdater.addField("saleScore", saleScore); + } + else + sUpdater.addField("saleScore", score.getSaleScore() - paramValue); + } + + ORM.get(ZTable.class).update(DesTemplateScore.class, sUpdater); + } + + doTemplateScoreCalc(mediaId); + doDesTemplateScoreLogAdd(mediaId, ScoreConstants.SALE_SCORE.value(), param); + } + + /** + * 模板分数计算 + * + * @param mediaId + * @param scoreType + * @throws Exception + */ + @AnTransaction + public static void doTemplateScoreCalc(long mediaId) throws Exception + { + DesTemplateScore score = ORM.get(ZTable.class).item(DesTemplateScore.class, mediaId); + int baseWeight = ScoreDao.doTemplateWeight(ScoreConstants.BASE_SCORE.value()); + int floatWeight = ScoreDao.doTemplateWeight(ScoreConstants.FLOAT_SCORE.value()); + int saleWeight = ScoreDao.doTemplateWeight(ScoreConstants.SALE_SCORE.value()); + + int scoreValue = score.getBaseScore() * baseWeight + score.getFloatScore() * floatWeight + score.getSaleScore() * saleWeight; + DesKeywordIndex index = ORM.get(ZTable.class).item(DesKeywordIndex.class, mediaId); + if (index == null) + { + index = new DesKeywordIndex(); + index.setMediaId(mediaId); + index.setMediaScore(scoreValue); + + ORM.get(ZTable.class).insert(index); + } + else + { + // 更新数据库模板指数 + Updater update = new Updater(); + update.addMust("mediaId", mediaId); + update.addField("mediaScore", scoreValue); + ORM.get(ZTable.class).update(DesKeywordIndex.class, update); + } + // 更新solr模板 + SolrUtil.updateMediaData(mediaId); + } + + /** + * 模板本身分数日志 + * + * @param mediaId + * @param scoreType + * @param param + * @throws Exception + */ + private static void doDesTemplateScoreLogAdd(long mediaId, String scoreType, DesScoreParam param) throws Exception + { + DesTemplateScoreLog log = new DesTemplateScoreLog(); + log.setLogId(Ids.longId()); + log.setMediaId(mediaId); + log.setScoreName(ScoreConstants.SCORE_TEMPLATE); + log.setScoreType(scoreType); + log.setParamType(param.getParamType()); + log.setParamKey(param.getParamKey()); + log.setParamValue(param.getParamValue()); + log.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(log); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/DispatchDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/DispatchDao.java new file mode 100644 index 0000000..bf5e62b --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/DispatchDao.java @@ -0,0 +1,302 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dao; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupView; +import com.zhiqim.yangcai.design.dbo.dispatch.DesDispatchProperty; +import com.zhiqim.yangcai.design.dbo.dispatch.DesOnline; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.subscribe.SubscribeDesignerQuotaRecord; + +/** + * + * 派单Utils + * + * @version v1.0.0 @author Deng 2017-9-14 新建与整理 + */ +@AnAlias("DispatchDao") +public class DispatchDao +{ + /** + * 获取在线设计师 + * + * @param operatorCode + * @return + * @throws Exception + */ + public static DesOnline getOnlineDesigner(String operatorCode) throws Exception + { + DesOnline online = ORM.get(ZTable.class).item(DesOnline.class, new Selector().addMust("operatorCode", operatorCode).addMustIn("onlineStatus", 1)); + return online; + } + + /** + * 获取当前组织正在接单设计师列表 + * + * @return + * @throws Exception + */ + public static List getOnlineDesignerList(long orgId) throws Exception + { + Selector selector = new Selector(); + selector.addMust("orgId", orgId); + selector.addMust("onlineStatus", 1); + List desList = ORM.get(ZTable.class).list(DesOnline.class, selector); + + return desList; + } + + /** + * 获取设计师关联的行业 + * + * @param operatorCode + * @return + * @throws Exception + */ + public static String getDesignerIndustry(String operatorCode) throws Exception + { + DesDispatchProperty dp = ORM.get(ZTable.class).item(DesDispatchProperty.class, operatorCode); + if (dp == null) + { + return ""; + } + + List idList = Lists.toLongList(dp.getSecondaryIndustrys()); + if (!idList.contains(dp.getMajorIndustry())) + { + idList.add(dp.getMajorIndustry()); + } + + List industryList = new ArrayList<>(); + Map map = Global.get(DesignIndustryCache.class).mapAll(); + for (long industryId : idList) + { + if (map.containsKey(industryId)) + { + industryList.add(map.get(industryId).getIndustryName()); + } + } + + return Lists.toString(industryList); + } + + /** + * 获取正在接单设计师列表 + * + * @return + * @throws Exception + */ + public static List getDesignerWorkingList() throws Exception + { + List desList = ORM.get(ZTable.class).list(DesOnline.class, new Selector("onlineStatus", 1)); + return desList; + } + + /** + * 获取设计师全部未完成订单数,未定稿状态(正在设计,补全资料,联系不上,已初稿,请求退款) + * + * @author caohong + * @param operatorCode + * @return + * @throws Exception + */ + public static int getUnCompleteOrderNumber(String operatorCode) throws Exception + { + Selector selector = new Selector(); + selector.addMust("designer", operatorCode); + selector.addMustThenGE("status", StatusConstants.ORDER_30.value());// + selector.addMustThenLE("status", StatusConstants.ORDER_50.value());// 大于等于 正在设计 小于等于已初稿状态 + int count = ORM.get(ZTable.class).count(DesignOrder.class, selector); + return count; + } + + /** + * 获取设计师设计中订单数量 + * + * @author caohong + * @param operatorCode + * @return + * @throws Exception + */ + public static int getDesignOrderNumber(String operatorCode) throws Exception + { + Selector selector = new Selector(); + selector.addMust("designer", operatorCode); + selector.addMust("status", StatusConstants.ORDER_30.value()); + int count = ORM.get(ZTable.class).count(DesignOrder.class, selector); + return count; + } + + /** + * 更新设计师的未完成订单数量 + * + * @param operatorCode + * @throws Exception + */ + public static void doUpdateDesignerOrderNum(String operatorCode) throws Exception + { + Updater oUpdater = new Updater(); + oUpdater.addMust("operatorCode", operatorCode); + oUpdater.addField("orderNum", DispatchDao.getUnCompleteOrderNumber(operatorCode)); + ORM.get(ZTable.class).update(DesOnline.class, oUpdater); + } + + /** + * 更新设计师预约完成数量 + * + * @param operatorCode + * @throws Exception + */ + public static void doUpdateSubscribeDesignerQuotaRecordFinishedNum(String operatorCode) throws Exception + { + int today = DateTimes.getCurrentDate(); + SubscribeDesignerQuotaRecord subscribeDesignerQuotaRecord = ORM.get(ZTable.class).item(SubscribeDesignerQuotaRecord.class, + new Selector("operatorCode", operatorCode).addMust("dutyTime", today)); + if (subscribeDesignerQuotaRecord != null) + { + int finishedNum = subscribeDesignerQuotaRecord.getFinishedNum(); + finishedNum++; + Updater oUpdater = new Updater(); + oUpdater.addMust("operatorCode", operatorCode); + oUpdater.addMust("dutyTime", today); + oUpdater.addField("finishedNum", finishedNum); + oUpdater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(SubscribeDesignerQuotaRecord.class, oUpdater); + } + } + + /** + * 设置最近完成初稿类型和初稿完成时间 + * + * @param operatorCode + * @param draftType + * @throws Exception + */ + public static void setDraftType(String operatorCode, long designType) throws Exception + { + DesOnline designer = ORM.get(ZTable.class).item(DesOnline.class, operatorCode); + if (designer == null) + { + return; + } + + Updater updater = new Updater(); + updater.addMust("operatorCode", operatorCode); + updater.addField("lastDraftType", designType); + updater.addField("lastDraftTime", Sqls.nowTimestamp()); + updater.addField("orderNum", DispatchDao.getUnCompleteOrderNumber(operatorCode)); + + ORM.get(ZTable.class).update(DesOnline.class, updater); + } + + /** + * 换算时分秒格式 + * + * @param seconds + * @throws Exception + */ + public static String doCaclTime(int seconds) throws Exception + { + int hour = seconds / 3600; + int minute = (seconds - hour * 3600) / 60; + int second = (seconds - hour * 3600 - minute * 60); + + if (hour > 0 && minute > 0) + { + return hour + "小时" + minute + "分" + second + "秒"; + } + else if (hour > 0 && minute <= 0) + { + return hour + "小时" + "0分" + second + "秒"; + } + else if (hour <= 0 && minute > 0) + { + return minute + "分" + second + "秒"; + } + else + { + return second + "秒"; + } + } + + /** + * + * [简要描述]: 设计师/设计师组-订单来源渠道 + * + * @author hc + * @param Order // 订单 + * @param designer // 设计师 + * @return + * @throws Exception + */ + public static boolean ifRelevance(DesignOrder order, String designer) throws Exception + { + // 设计师组设计师关联表 + DesignerGroupView designerGroupView = ORM.get(ZView.class).item(DesignerGroupView.class, new Selector().addMust("operatorCode", designer)); + if (designerGroupView == null) + { + return false; + } + + String merchantIds = designerGroupView.getMerchantIds(); + String designerMerchantIds = designerGroupView.getDesignerMerchantIds(); + + if (merchantIds == null && designerMerchantIds == null) + { + return false; + } + + // 设计师组 + if (merchantIds != null) + { + String[] merchantIdsSplit = merchantIds.split(","); + for (String merchantId : merchantIdsSplit) + { + if (merchantId.equals(order.getMerchantId() + "")) + { + return true; + } + } + } + + // 设计师个人 + if (designerMerchantIds != null) + { + String[] designerMerchantIdsSplit = designerMerchantIds.split(","); + for (String merchantId : designerMerchantIdsSplit) + { + if (merchantId.equals(order.getMerchantId() + "")) + { + return true; + } + } + } + + return false; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/EventDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/EventDao.java new file mode 100644 index 0000000..b34d470 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/EventDao.java @@ -0,0 +1,94 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dao; + + +/** + * + * 事件类型DAO + * + * @version v1.0.0 @author PVer 2017-10-17 新建与整理 + */ +public class EventDao +{ + /* *//** + * 创建类型 + * + * @param draftType + * @return + * @throws Exception + */ + /* + * public static String doCreateType(int draftType) throws Exception + * { + * String createStr = ""; + * if (draftType == DraftConstants.DRAFT_STANDARD.value() || draftType == + * DraftConstants.DRAFT_TEMPLATE.value()) + * { + * createStr = EventConstants.ORDER_24.desc(); + * } + * else + * { + * createStr = EventConstants.ORDER_30.value(); + * } + * return createStr; + * } + */ + /* *//** + * 取消类型 + * + * @param order + * @return + * @throws Exception + */ + /* + * public static String doCancelType(OrdOrderView view) throws Exception + * { + * OrdOrderView order = ORM.get(ZView.class).item(OrdOrderView.class, new Selector("oid", + * view.getOid())); + * String cancelStr = ""; + * String cancelTime = Sqls.toDateTimeString(order.getCancelTime()); + * String createTime = Sqls.toDateTimeString(order.getCreateTime()); + * if (DateTimes.compareDay(cancelTime.substring(0, 10), createTime.substring(0, 10)) > 0) + * {// 历史取消 + * if (Validates.isNotEmpty(order.getSelfDraftDesigner())) + * { + * cancelStr = EventConstants.YC_SELFDRAFT_HISTORY_CANCEL.value(); + * } + * else if (Validates.isNotEmpty(order.getDesigner())) + * { + * cancelStr = EventConstants.YC_DESIGN_HISTORY_CANCEL.value(); + * } + * else + * { + * cancelStr = EventConstants.YC_ORDER_HISTORY_CANCEL.value(); + * } + * } + * else + * { + * if (Validates.isNotEmpty(order.getSelfDraftDesigner())) + * { + * cancelStr = EventConstants.YC_SELFDRAFT_CANCEL.value(); + * } + * else if (Validates.isNotEmpty(order.getDesigner())) + * { + * cancelStr = EventConstants.YC_DESIGN_CANCEL.value(); + * } + * else + * { + * cancelStr = EventConstants.YC_ORDER_CANCEL.value(); + * } + * } + * return cancelStr; + * } + */ +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/FileCheckDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/FileCheckDao.java new file mode 100644 index 0000000..065eb1f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/FileCheckDao.java @@ -0,0 +1,538 @@ +package com.zhiqim.yangcai.design.dao; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +import org.icepdf.core.pobjects.Document; +import org.icepdf.core.pobjects.Page; +import org.icepdf.core.util.GraphicsRenderingHints; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.httpclient.HttpDownload; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Day; +import org.zhiqim.kernel.schedule.Scheduler; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.uploadlarge.dbo.UpllFile; + +import com.itextpdf.text.pdf.PdfReader; +import com.itextpdf.text.pdf.parser.PdfTextExtractor; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.utils.BaseUtil; +import com.zhiqim.yangcai.design.model.PrdNumberModel; +import com.zhiqim.yangcai.design.model.PrdProductModel; +import com.zhiqim.yangcai.design.rmi.erp.ErpRmiService; +import com.zhiqim.yangcai.design.task.TempFileDeleteTask; + +/** + * 文件审核相关方法 + * + * @version v1.0.0 @author zhouwenbin 2017-9-6 新建与整理 + */ +public class FileCheckDao +{ + private static final Log log = LogFactory.getLog(FileCheckDao.class); + private static final Map checkingMap = new HashMap();// 正在审核的文件 + public static float MM = 2.83464579439252f;// pdf尺寸转毫米的系数 + + /** + * 检测文件命名是否正确 + * + * @param fileName + * @param designId + * @param wangwang + * @param receiveName + * @return + */ + public static Int checkSelfFileName(String fileName, String designId, String wangwang, String receiveName) + { + if (Validates.isEmpty(fileName)) + { + return new Int(-1, "文件名不能为空"); + } + + String fileExt = Files.getFileExt(fileName); + if (Validates.isEmpty(fileExt)) + { + return new Int(-1, "文件扩展名不正确,扩展名:" + fileExt); + } + fileName = fileName.substring(0, fileName.lastIndexOf(".")); + String subOid = fileName.substring(0, fileName.indexOf("-")); + String subWangwang = fileName.substring(fileName.indexOf("-") + 1, fileName.length()); + if (Validates.isNotEmptyBlank(wangwang)) + { + wangwang = Strings.trim(wangwang); + } + + if (Validates.isNotEmptyBlank(receiveName)) + { + receiveName = Strings.trim(receiveName); + } +// if (!subOid.equals(designId)) +// {// 第一项必须是订单号 +// return new Int(-1, "文件命名第一项订单号不正确"); +// } +// if (!subWangwang.equals(wangwang)) +// { +// return new Int(-1, "文件命名第二项不是旺旺号"); +// } + + return new Int("成功"); + } + + /** + * 成品文件审核 + * + * @param oid 订单编号 + * @param fileName 文件名 + * @param attaModul 附件标识 + * @return 错误信息 + * @throws Exception + */ + public static String doCheckSelfFile(long designId, String fileName, String attaModul) throws Exception + { + if (designId == -1) + { + return "订单不存在-" + designId; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + return "订单不存在-" + designId; + } + + Selector selector = new Selector("designId", designId); + selector.addMust("fileName", fileName); + selector.addMust("attaModul", attaModul); + selector.addOrderbyDesc("uploadTime"); + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, selector); + if (atta == null) + { + return "文件审核失败,印刷文件不存在"; + } + + if (!"pdf".equalsIgnoreCase(atta.getFileType())) + { + return "";// 不是pdf文件不审核 + } + + File file = new File(atta.getSavePath()); + if (!file.exists() && Validates.isEmptyBlank(atta.getOssUrl())) + { + return "文件审核失败,系统找不到指定的文件"; + } + + if (!file.exists()) + {// + String dir = getCurrentTempFolder(atta.getAttaModul()); + String tempFileName = Strings.addEndsWith(fileName, Strings.addStartsWith(atta.getFileType(), ".")); + HttpDownload download = new HttpDownload(atta.getOssUrl()); + download.setConnectTimeout(30); + download.setReadTimeout(50 * 60); + download.setFileDir(dir); + download.setFileName(tempFileName); + download.execute(); + if (!download.isResponseSuccess()) + { + return "文件审核失败,无效的下载地址"; + } + + file = new File(Strings.addEndsWith(dir, "/" + tempFileName)); + } + + String error = ""; + try + { + checkingMap.put(atta.getAttaId(), true);// 标记正在检测文件 + error = checkEndFile(order, file); + } + catch (Exception e) + { + log.error("文件内容检测异常:", e); + error = "文件内容检测异常"; + } + finally + { + checkingMap.remove(atta.getAttaId());// 检测完毕 + } + + return error; + } + + /** + * 检测文件命名是否正确 + * + * @param fileName + * @param oid + * @param wangwang + * @param receiveName + * @return + */ + public static Int checkFileName(String fileName, String oid, String wangwang, String receiveName) + { + if (Validates.isEmpty(fileName)) + { + return new Int(-1, "文件名不能为空"); + } + + String fileExt = Files.getFileExt(fileName); + if (Validates.isEmpty(fileExt)) + { + return new Int(-1, "文件扩展名不正确,扩展名:" + fileExt); + } + + fileName = fileName.substring(0, fileName.lastIndexOf(".")); + String[] strs = fileName.split("-"); + if (strs == null || strs.length < 2 || strs.length > 3) + { + return new Int(-1, "文件命名规则不正确"); + } + + if (Validates.isNotEmptyBlank(wangwang)) + { + wangwang = Strings.trim(wangwang); + } + + if (Validates.isNotEmptyBlank(receiveName)) + { + receiveName = Strings.trim(receiveName); + } + + String data1 = Strings.trim(strs[0]);// 订单号 + String data2 = Strings.trim(strs[1]);// 旺旺或者收件人 + + data1 = data1.replaceAll("[\r\n]", ""); + data2 = data2.replaceAll("[\r\n]", ""); + +// if (!data1.equals(oid)) +// {// 第一项必须是订单号 +// return new Int(-1, "文件命名第一项订单号不正确"); +// } +// +// if (strs.length == 2) +// { +// if (!data2.equals(wangwang) && !data2.equals(receiveName)) +// { +// return new Int(-1, "文件命名第二项不是旺旺号\r\n且不是收件人"); +// } +// } +// else +// { +// String data3 = Strings.trim(strs[2]);// 收件人 +// data3 = data3.replaceAll("[\r\n]", ""); +// +// if (!data2.equals(wangwang)) +// { +// return new Int(-1, "文件命名第二项不是旺旺号"); +// } +// +// if (!data3.equals(receiveName)) +// { +// return new Int(-1, "文件命名第三项不是收件人"); +// } +// } + + return new Int("成功"); + } + + /*** + * 判断文件是否正在审核 + * + * @param attaId 附件ID + * @return 返回=true 表示正在审核 + */ + public static boolean isChecking(long attaId) + { + return checkingMap.containsKey(attaId); + } + + /*** + * 获取当天临时文件目录 + * + * @return 例:./temp/20180112/fileModel/ + */ + private static TempFileDeleteTask deleteTempFileTask = TempFileDeleteTask.getInstance(); + + public static String getCurrentTempFolder(String fileModel) + { + String date = DateTimes.getDateTime8String(); + String folder = Strings.addEndsWith("./temp", "/") + date; + folder = Strings.addEndsWith(folder, "/"); + if (Validates.isNotEmptyBlank(fileModel)) + { + folder = folder + Strings.addEndsWith(fileModel, "/"); + } + + Files.mkDirectory(folder); + + // 启动临时文件删除任务 每天早上在 5:29:59 执行 + if (!deleteTempFileTask.isRunning()) + { + Scheduler scheduler = Global.getWithoutNew(Scheduler.class); + scheduler.create(); + scheduler.addTask(new Day(deleteTempFileTask, 5, 29, 59)); + deleteTempFileTask.setRunning(true); + } + + return folder; + } + + /** + * 成品文件审核,自来稿 设计流程历史订单还在临时使用,现在已合并到设计流程了 + * + * @param order 订单对象 + * @param file 文件对象 + * @return 错误信息 + * @throws Exception + */ + private static String checkEndFile(DesignOrder order, File file) throws Exception + { + if (order == null) + { + return "订单不存在"; + } + + if (file == null || !file.exists()) + { + return "文件审核失败,印刷文件不存在"; + } + + PdfReader readerN = null; + try + { + // 文字转曲判断 --caohong 2020-4-20 + readerN = new PdfReader(file.getPath()); + int nrPages = readerN.getNumberOfPages(); + for (int i = 1; i < nrPages; i++) + { + String text = PdfTextExtractor.getTextFromPage(readerN, i); + if (text != null && !"".equals(text)) + { + return ("文件审核失败,第" + i + "页有文字未转曲!"); + } + } + } + catch (Exception e) + { + log.error("文件审核异常[" + order.getDesignId() + "]:" + e.getMessage(), e); + return "文件审核失败,有文字未转曲或编码异常!"; + } + catch (Error e) + { + log.error("文件审核异常[" + order.getDesignId() + "]:" + e.getMessage(), e); + return "文件审核失败,有文字未转曲或编码异常!"; + } + finally + { + if (readerN != null) + { + readerN.close(); + } + } + + // 透明PVC,并且是印白墨后加工的情况,不判断版面数量,因为有白墨版,比较特殊 --caohong + if (order.getTypeId() == 1806070857392601L && order.getAfterNames() != null && order.getAfterNames().contains("印白墨")) + { + return ""; + } + + int pageValue = order.getDesignPage(); + double stdWidth = order.getDesignWidth(); + double stdHeight = order.getDesignHeight(); + + // 优惠券产品需要特殊处理,由于录单去掉了模位计算操作,审核的时候需要使用名片标准尺寸来检查内容。--caohong 2019-11-12 + if ("1710131129568467".equals(String.valueOf(order.getTypeId()))) + { + stdWidth = 92; + stdHeight = 56; + + double tmpWidth = order.getDesignWidth(); + double tmpHeight = order.getDesignHeight(); + if (order.getPrintWidth() > 0 && order.getPrintHeight() > 0) + { + tmpWidth = order.getPrintWidth(); + tmpHeight = order.getPrintHeight(); + } + // 临时计算模位用于计算检测 + int ms = BaseUtil.calcMod("92X56", new Double(tmpWidth).intValue(), new Double(tmpHeight).intValue(), 0); + order.setPrintMs(ms); + } + + // 画册产品不需要检查内容 + if (!"3".equals(String.valueOf(order.getTypeId()))) + { + Document document = new Document(); + document.setFile(file.getPath()); + int pageTotal = document.getNumberOfPages(); + if (pageTotal < 1) + { + return "文件审核失败,印刷文件无页面"; + } + + // 总页数%单或双面 + if (pageTotal % pageValue != 0) + { + return "文件审核失败,印刷文件页数错误"; + } + + float firstWidth = 0f, firstHeight = 0f; + try + { + boolean flag = false; + float scale = 1f; + float rotation = 0f; + + // 获取第一条文件尺寸 + BufferedImage oneImage = document.getPageImage(0, GraphicsRenderingHints.SCREEN, Page.BOUNDARY_CROPBOX, rotation, scale); + firstWidth = oneImage.getWidth() / MM; + firstHeight = oneImage.getHeight() / MM; + + for (int i = 1; i < pageTotal; i++) + { + BufferedImage image = document.getPageImage(i, GraphicsRenderingHints.SCREEN, Page.BOUNDARY_CROPBOX, rotation, scale); + if (Math.abs(image.getWidth() / MM - firstWidth) >= 0.1) + { + return "文件审核失败,第" + i + "页,尺寸错误,实际宽:" + firstWidth + ",期望宽:" + stdWidth; + } + + if (Math.abs(image.getHeight() / MM - firstHeight) >= 0.1) + { + return "文件审核失败,第" + i + "页,尺寸错误,实际高:" + firstHeight + ",期望高:" + stdHeight; + } + } + + // 误差不超过0.1,则收为整数 + firstWidth = Math.round(firstWidth); + firstHeight = Math.round(firstHeight); + + // 根据面积判断是否符合规则 92*56 3款2模 92*56*6 92*56*6 + float rate = (float) Math + .abs((firstWidth * firstHeight * pageTotal / pageValue) - (stdWidth * stdHeight * order.getPrintMs() * order.getPrintKs())); + if (rate < 0.1) + { + flag = true; + } + + if (!flag) + { + return "文件审核失败,尺寸或模数错误"; + } + } + catch (Exception e) + { + log.error("[订单" + order.getDesignId() + "]印刷文件审核异常," + e.getMessage(), e); + return "文件审核异常,请重新上传"; + } + finally + { + document.dispose(); + } + } + + return ""; + } + + /** + * 文件审核失败,删除成品文件及数据 + * + * @param atta + * @throws Exception + */ + @AnTransaction + public static void doDeleteFile(DesignAtta atta) throws Exception + { + if (atta == null) + { + return; + } + + // 删除数据 + File file = new File(atta.getSavePath()); + if (file.exists()) + { + Files.deleteFile(atta.getSavePath()); + } + + ORM.get(ZTable.class).delete(DesignAtta.class, atta.getAttaId()); + + if (Validates.isNotEmpty(atta.getFileid())) + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", atta.getFileid()).addReplace("id", null)); + if (!file.exists() && Validates.isNotEmptyBlank(atta.getSavePath())) + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("filePath", atta.getSavePath()).addReplace("id", null)); + } + } + // 删除OSS文件 + OssFileDao.deleteOssFile(atta); + } + + /** + * + * [简要描述]判断自来稿是否需要人工审核:
            + * [详细描述]:
            + * + * @author gjx + * @param order + * @return + * @throws Exception + */ + public static boolean isCheckDraft(DesignSelfView order) throws Exception + { + Map map = ErpRmiService.doQueryOrderProductInfo(order.getDesignId()); + PrdProductModel product = Jsons.toObject(map.get("product"), PrdProductModel.class); + PrdNumberModel number = Jsons.toObject(map.get("number"), PrdNumberModel.class); + // 非名片、彩页都需审核 + String prdTypeName = product.getProductName(); + if (!(Validates.isEqual("名片", prdTypeName) || Validates.isEqual("彩页", prdTypeName))) + { + return true; + } + + // 金额大于300 + if (order.getAmount() > 200 * 100) + { + return true; + } + + // 非常规尺寸 + if (order.getPrintWidth() > 0 && order.getPrintHeight() > 0) + { + return true; + } + + // 数量大于3000张 + if (number.getPrdNumberValue() >= 3000) + { + return true; + } + + // 存在后加工 + if (Validates.isNotEmpty(order.getAfterNames())) + { + return true; + } + + // 产品定义需审核 + if (product.isProductCheck()) + { + return true; + } + + return false; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/HotWordDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/HotWordDao.java new file mode 100644 index 0000000..b2421c6 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/HotWordDao.java @@ -0,0 +1,93 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dao; + +/** + * 热搜词Dao + * + * @version v1.0.0 @author Deng 2018-1-8 新建与整理 + */ +public class HotWordDao +{ + /** + * 相似度比较 + * @param str + * @param target + * @return + */ + private static int compare(String str, String target) + { + int d[][]; // 矩阵 + int n = str.length(); + int m = target.length(); + int i; // 遍历str的 + int j; // 遍历target的 + char ch1; // str的 + char ch2; // target的 + int temp; // 记录相同字符,在某个矩阵位置值的增量,不是0就是1 + + if (n == 0) + return m; + + if (m == 0) + return n; + + d = new int[n + 1][m + 1]; + for (i = 0; i <= n; i++)// 初始化第一列 + d[i][0] = i; + + for (j = 0; j <= m; j++) // 初始化第一行 + d[0][j] = j; + + for (i = 1; i <= n; i++) + { // 遍历str + ch1 = str.charAt(i - 1); + // 去匹配target + for (j = 1; j <= m; j++) + { + ch2 = target.charAt(j - 1); + if (ch1 == ch2) + temp = 0; + else + temp = 1; + + // 左边+1,上边+1, 左上角+temp取最小 + d[i][j] = min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + temp); + } + } + + return d[n][m]; + } + + private static int min(int one, int two, int three) + { + return (one = one < two ? one : two) < three ? one : three; + } + + /** + * 获取两字符串的相似度 + * + * @param str + * @param target + * @return + */ + + public static float getSimilarityRatio(String str, String target) + { + return 1 - (float) compare(str, target) / Math.max(str.length(), target.length()); + } + + public static void main(String[] args) + { + System.err.println((int)(getSimilarityRatio("我家", "先生家") * 10000)); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/KeywordDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/KeywordDao.java new file mode 100644 index 0000000..3dd7437 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/KeywordDao.java @@ -0,0 +1,780 @@ +package com.zhiqim.yangcai.design.dao; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.DesKeyword; +import com.zhiqim.yangcai.design.dbo.DesKeywordLog; +import com.zhiqim.yangcai.design.dbo.DesLabelAttribute; +import com.zhiqim.yangcai.design.dbo.DesLabelIndustry; +import com.zhiqim.yangcai.design.dbo.keyword.DesKeywordCore; +import com.zhiqim.yangcai.design.dbo.keyword.DesKeywordCoreLog; +import com.zhiqim.yangcai.design.dbo.keyword.DesKeywordIndex; +import com.zhiqim.yangcai.design.dbo.keyword.DesKeywordIndustry; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; +import com.zhiqim.yangcai.design.model.HotKeywordModel; + +/** + * 关键词Dao + * + * @version v1.0.0 @author Deng 2018-1-10 新建与整理 + */ +@AnAlias("KeywordDao") +public class KeywordDao +{ + /** + * 组装solr查询器 + * + * @param attrList + * @param q + * @return + */ + public static String createQueryCondition(List attrList, String keyword) + { + if (Validates.isEmpty(attrList) && Validates.isEmptyBlank(keyword)) + { + return ""; + } + + String attr = ""; + if (Validates.isNotEmpty(attrList)) + { + attr = "labelKeyword:(" + Lists.toString(attrList, "&&") + ")"; + } + + if (Validates.isEmptyBlank(keyword)) + { + return attr; + } + + List keyList = new ArrayList(); + String query = keyword.replace(" ", " "); // 中文空格替换成英文空格 + + for (String key : Lists.toStringList(query, " ")) + { + if (Validates.isEmptyBlank(key)) + { + continue; + } + + keyList.add("\"" + Strings.trim(key) + "\""); + } + + query = Lists.toString(keyList, "||"); + if (Validates.isEmpty(attr)) + { + return query; + } + + return attr + "&&(" + query + ")"; + } + + /** + * 判断中文长度 + * + * @param keywowrdName + * @return length >=2 计算热度,length >=3 长尾词 + * @throws Exception + */ + public static boolean isChineseLength(String keywowrdName, int length) throws Exception + { + // 至少三个以上的中文,认为是长尾词 + boolean flag = false; + int chinaCount = 0; + Pattern p = Pattern.compile("[\u4E00-\u9FA5]+"); + char c[] = keywowrdName.toCharArray(); + for (int i = 0; i < c.length; i++) + { + Matcher matcher = p.matcher(String.valueOf(c[i])); + if (matcher.matches()) + { + chinaCount++; + if (chinaCount >= length) + { + flag = true; + break; + } + } + } + + return flag; + } + + /** + * 计算热词度 + * + * @throws Exception + */ + @AnTransaction + public static void doKeywordHotSearch(String keyword) throws Exception + { + List floatList = new ArrayList(); + List coreList = ORM.get(ZTable.class).list(DesKeywordCore.class, new Selector().addMustLike("keywordName", keyword)); + if (!coreList.isEmpty()) + { + for (DesKeywordCore core : coreList) + { + float strValue = HotWordDao.getSimilarityRatio(keyword, core.getKeywordName()); + + HotKeywordModel model = new HotKeywordModel(); + model.setKeywordName(core.getKeywordName()); + model.setDegree((int) (strValue * 10000));// 转换成整型,进行排序 + + floatList.add(model); + } + + // 排序,降序 + Collections.sort(floatList, new Comparator() + { + @Override + public int compare(HotKeywordModel o1, HotKeywordModel o2) + { + return o2.getDegree() - o1.getDegree(); + } + }); + + // 相似度最高的词条,并且大于等于50% + 1 + String keywordName = floatList.get(0).getKeywordName(); + int degree = floatList.get(0).getDegree(); + int maxNum = 5000; + + if (degree >= maxNum) + { + DesKeywordCore core = ORM.get(ZTable.class).item(DesKeywordCore.class, new Selector("keywordName", keywordName)); + + Updater update = new Updater(); + update.addMust("keywordName", keywordName); + update.addField("keywordHot", core.getKeywordHot() + 1); + + ORM.get(ZTable.class).update(DesKeywordCore.class, update); + + doKeywordCoreLog(keywordName, 0); + } + } + } + + /** + * 计算关键词之前的向量相似性 + * + * @param list + * @param list2 + * @return + */ + public static int getSimilarDegree(List list, List list2) + { + // 创建向量空间模型,使用map实现,主键为词项,值为长度为2的数组,存放着对应词项在字符串中的出现次数 + Map vectorSpace = new HashMap(); + int[] itemCountArray = null;// 为了避免频繁产生局部变量,所以将itemCountArray声明在此 + + // 动态数组转为数组 + int size1 = list.size(); + String[] strArray1 = list.toArray(new String[size1]); + + for (int i = 0; i < strArray1.length; ++i) + { + if (vectorSpace.containsKey(strArray1[i])) + { + ++(vectorSpace.get(strArray1[i])[0]); + } + else + { + itemCountArray = new int[2]; + itemCountArray[0] = 1; + itemCountArray[1] = 0; + vectorSpace.put(strArray1[i], itemCountArray); + } + } + int size2 = list2.size(); + String[] strArray2 = list2.toArray(new String[size2]); + for (int i = 0; i < strArray2.length; ++i) + { + if (vectorSpace.containsKey(strArray2[i])) + { + ++(vectorSpace.get(strArray2[i])[1]); + } + else + { + itemCountArray = new int[2]; + itemCountArray[0] = 0; + itemCountArray[1] = 1; + vectorSpace.put(strArray2[i], itemCountArray); + } + } + + // 计算相似度 + double vector1Modulo = 0.00;// 向量1的模 + double vector2Modulo = 0.00;// 向量2的模 + double vectorProduct = 0.00; // 向量积 + Iterator> iter = vectorSpace.entrySet().iterator(); + + while (iter.hasNext()) + { + Entry entry = iter.next(); + itemCountArray = entry.getValue(); + + vector1Modulo += itemCountArray[0] * itemCountArray[0]; + vector2Modulo += itemCountArray[1] * itemCountArray[1]; + + vectorProduct += itemCountArray[0] * itemCountArray[1]; + } + + vector1Modulo = Math.sqrt(vector1Modulo); + vector2Modulo = Math.sqrt(vector2Modulo); + + double value = vectorProduct / (vector1Modulo * vector2Modulo); + DecimalFormat df = new DecimalFormat("#.00"); + df.format(value); + + int dfValue = (int) (value * 100); + + // 返回相似度 + return dfValue; + } + + /** + * 单次或多次增加关键词及关键词日志 + * + * @param keywordName + * @param operatorCode + * @throws Exception + */ + @AnTransaction + public static void doKeywordLostofAdd(String keywordName, String operatorCode, int keywordType) throws Exception + { + DesKeyword keyword = new DesKeyword(); + keyword.setKeywordId(Ids.longId()); + keyword.setKeywordName(keywordName); + keyword.setOperatorCode(operatorCode); + keyword.setCreateTime(Sqls.nowTimestamp()); + keyword.setKeywordType(keywordType); + + ORM.get(ZTable.class).insert(keyword); + + DesKeywordLog log = new DesKeywordLog(); + log.setLogId(Ids.longId()); + log.setKeywordName(keywordName); + log.setSearchCount(0); + log.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(log); + } + + /** + * 删除关键词时,更新作品或模板的keywordName参数 + * + * @param media + * @param keywordName + * @throws Exception + */ + public static boolean doKeywordNameUpdater(long mediaId, String keywordName, String type) throws Exception + { + if (Validates.isEmpty(keywordName)) + { + return false; + } + + if ("template".equals(type)) + { + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + String oldName = media.getKeywordName(); + String newName = ""; + + String[] keyStrName = oldName.split(","); + for (String kName : keyStrName) + { + if (kName.equals(keywordName)) + { + continue; + } + + newName += kName + ","; + } + + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + + if (Validates.isNotEmpty(newName)) + { + updater.addField("keywordName", newName.substring(0, newName.length() - 1)); + } + else + { + updater.addField("keywordName", newName); + } + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + } + else + { + DesWorksFile works = ORM.get(ZTable.class).item(DesWorksFile.class, mediaId); + String oldName = works.getKeywordName(); + String newName = ""; + + String[] keyStrName = oldName.split(",| "); + for (String kName : keyStrName) + { + if (kName.equals(keywordName)) + { + continue; + } + + newName += kName + ","; + } + + Updater updater = new Updater(); + updater.addMust("worksId", mediaId); + + if (Validates.isNotEmpty(newName)) + { + updater.addField("keywordName", newName.substring(0, newName.length() - 1)); + } + else + { + updater.addField("keywordName", newName); + } + + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + + return true; + } + + /** + * 获取子行业名称 + * + * @param industrySubIds + * @return + * @throws Exception + */ + public static String doIndustrySubName(String industrySubIds) throws Exception + { + if (Validates.isEmpty(industrySubIds)) + { + return ""; + } + + String subsName = ""; + String[] subsStr = industrySubIds.split(","); + if (subsStr.length == 0) + { + return ""; + } + + for (String subs : subsStr) + { + DesLabelIndustry industry = ORM.get(ZTable.class).item(DesLabelIndustry.class, Long.parseLong(subs)); + if (industry == null) + { + continue; + } + + subsName += industry.getIndustrySubName() + " "; + } + + return subsName.substring(0, subsName.length() - 1); + } + + /** + * 获取属性名称 + * + * @param attributeIds + * @return + * @throws Exception + */ + public static String doAttributeName(String attributeIds) throws Exception + { + if (Validates.isEmpty(attributeIds)) + { + return ""; + } + + String attributeName = ""; + String[] subsStr = attributeIds.split(","); + if (subsStr.length == 0) + { + return ""; + } + + for (String subs : subsStr) + { + DesLabelAttribute attr = ORM.get(ZTable.class).item(DesLabelAttribute.class, Long.parseLong(subs)); + if (attr == null) + { + continue; + } + + attributeName += attr.getAttributeName() + " "; + } + + return attributeName.substring(0, attributeName.length() - 1); + } + + /** + * 同步更新solr行业属性 + * + * @param mediaId + * @param labelName + * @throws Exception + */ + public static void doSolrLabelKeyword(long mediaId, String labelName) throws Exception + { + DesKeywordIndex index = ORM.get(ZTable.class).item(DesKeywordIndex.class, mediaId); + if (index == null) + { + DesKeywordIndex in = new DesKeywordIndex(); + in.setMediaId(mediaId); + in.setCustomLabelKeyword(labelName); + + ORM.get(ZTable.class).insert(index); + } + else + { + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("labelKeyword", labelName); + + ORM.get(ZTable.class).update(DesKeywordIndex.class, updater); + } + + } + + /** + * 同步更新solr自定义标签 + * + * @param mediaId + * @param labelName 自定义标签 + * @param coreName 关键字 + * @param type 0:新增至关键字库,1:关键字库删除该关键字 + * @throws Exception + */ + public static void doSolrCustomLabelKeyword(long mediaId, String labelName, String coreName, int type) throws Exception + { + DesKeywordIndex index = ORM.get(ZTable.class).item(DesKeywordIndex.class, mediaId); + if (index == null) + { + index = new DesKeywordIndex(); + index.setMediaId(mediaId); + index.setCustomLabelKeyword(labelName); + + ORM.get(ZTable.class).insert(index); + } + else + { + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("customLabelKeyword", labelName); + + ORM.get(ZTable.class).update(DesKeywordIndex.class, updater); + } + + if (type == 0) + { + doKeywordCoreAdd(coreName);// 更新关键词库 + } + else + { + doKeywordCoreDelete(coreName); + } + } + + /** + * 同步更新solr长尾词 + * + * @param mediaId + * @param keyword + * @throws Exception + */ + public static void doSolrLongTailKeyword(long mediaId, String longTailKeyword) throws Exception + { + DesKeywordIndex index = ORM.get(ZTable.class).item(DesKeywordIndex.class, mediaId); + if (index == null) + { + index = new DesKeywordIndex(); + index.setMediaId(mediaId); + index.setLongTailKeyword(longTailKeyword); + + ORM.get(ZTable.class).insert(index); + + doKeywordCoreAdd(longTailKeyword);// 更新关键词库 + } + else + { + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + + if (Validates.isEmpty(index.getLongTailKeyword())) + { + updater.addField("longTailKeyword", longTailKeyword); + ORM.get(ZTable.class).update(DesKeywordIndex.class, updater); + } + else if (!isHashLongTailKeyword(mediaId, index, longTailKeyword)) + { + updater.addField("longTailKeyword", index.getLongTailKeyword() + "," + longTailKeyword); + ORM.get(ZTable.class).update(DesKeywordIndex.class, updater); + } + + doKeywordCoreAdd(longTailKeyword);// 更新关键词库. + } + + } + + /** + * 判断长尾词是否存在 + * + * @param mediaId + * @param longTailKeyword + * @return + * @throws Exception + */ + public static boolean isHashLongTailKeyword(long mediaId, DesKeywordIndex index, String longTailKeyword) throws Exception + { + String[] longStr = index.getLongTailKeyword().split(","); + for (String str : longStr) + { + if (longTailKeyword.equals(str)) + { + return true; + } + } + + return false; + } + + /** + * 增加关键词库 + * + * @param keywordName + * @throws Exception + */ + public static void doKeywordCoreAdd(String keywordName) throws Exception + { + if (Validates.isEmptyBlank(keywordName)) + { + return; + } + + DesKeywordCore core = ORM.get(ZTable.class).item(DesKeywordCore.class, new Selector("keywordName", keywordName)); + if (core == null) + { + core = new DesKeywordCore(); + core.setKeywordName(keywordName); + core.setKeywordHot(0); + core.setKeywordNum(0); + core.setKeywordScore(0); + + ORM.get(ZTable.class).insert(core); + } + } + + /** + * 删除关键词库 + * + * @param keywordName + * @throws Exception + */ + public static void doKeywordCoreDelete(String keywordName) throws Exception + { + if (Validates.isEmptyBlank(keywordName)) + { + return; + } + + ORM.get(ZTable.class).delete(DesKeywordCore.class, new Selector("keywordName", keywordName)); + } + + /** + * 增加行业关键词 + * + * @param keywordName + * @throws Exception + */ + public static void dokeywordIndustryAdd(long mediaId, String industryKeyword) throws Exception + { + doKeywordCoreAdd(industryKeyword);// 更新关键词库 + + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + long industryId = media.getIndustryId(); + String industrySubIds = media.getIndustrySubIds(); + + if (Validates.isEmpty(industrySubIds)) + { + return; + } + + Selector selector = new Selector(); + selector.addMust("industryId", industryId); + selector.addMustLike("industrySubId", media.getIndustrySubIds()); + DesKeywordIndustry ki = ORM.get(ZTable.class).item(DesKeywordIndustry.class, selector); + if (ki == null) + { + ki = new DesKeywordIndustry(); + ki.setIndustryId(industryId); + ki.setIndustrySubId(media.getIndustrySubIds()); + ki.setIndustryKeyword(industryKeyword); + + ORM.get(ZTable.class).insert(ki); + } + else + { + // 关键词是否存在 + String[] ikStr = ki.getIndustryKeyword().split(","); + for (String str : ikStr) + { + if (str.equals(industryKeyword)) + { + return; + } + } + + Updater update = new Updater(); + update.addMust("industryId", industryId); + update.addMustLike("industrySubId", media.getIndustrySubIds()); + + if (Validates.isEmpty(ki.getIndustryKeyword())) + { + update.addField("industryKeyword", industryKeyword); + } + else + { + update.addField("industryKeyword", ki.getIndustryKeyword() + "," + industryKeyword); + } + + ORM.get(ZTable.class).update(DesKeywordIndustry.class, update); + } + } + + /** + * 关键词搜索次数增加 + * + * @param keyword + * @throws Exception + */ + public static void doKeywordCoreNumAdd(String keywordName) throws Exception + { + DesKeywordCore core = ORM.get(ZTable.class).item(DesKeywordCore.class, new Selector("keywordName", keywordName)); + if (core == null) + { + return; + } + + Updater update = new Updater(); + update.addMust("keywordName", keywordName); + update.addField("keywordNum", core.getKeywordNum() + 1); + ORM.get(ZTable.class).update(DesKeywordCore.class, update); + + doKeywordCoreLog(keywordName, 1); + } + + /** + * 关键词库日志 + * + * @param keywordName + * @throws Exception + */ + public static void doKeywordCoreLog(String keywordName, int keywordType) throws Exception + { + DesKeywordCore core = ORM.get(ZTable.class).item(DesKeywordCore.class, new Selector("keywordName", keywordName)); + if (core == null) + { + return; + } + + String dayCode = DateTimes.getDateString(); + Selector selector = new Selector(); + selector.addMust("keywordName", keywordName); + selector.addMust("dayCode", dayCode); + DesKeywordCoreLog log = ORM.get(ZTable.class).item(DesKeywordCoreLog.class, selector); + if (log == null) + { + log = new DesKeywordCoreLog(); + log.setLogId(Ids.longId()); + log.setKeywordName(keywordName); + log.setDayCode(DateTimes.getDateString()); + log.setMonthCode(DateTimes.getDateTime7String()); + if (keywordType == 0) + { + log.setKeywordHot(1); + } + else + { + log.setKeywordNum(1); + } + + ORM.get(ZTable.class).insert(log); + } + else + { + Updater update = new Updater(); + update.addMust("logId", log.getLogId()); + if (keywordType == 0) + { + update.addField("keywordHot", log.getKeywordHot() + 1); + } + else + { + update.addField("keywordNum", log.getKeywordNum() + 1); + } + + ORM.get(ZTable.class).update(DesKeywordCoreLog.class, update); + } + } + + /** + * 查询关键词搜索次数,并且排序 + * + * @param keywordName + * @return + * @throws Exception + */ + public static List doKeywordCoreSort(String keywordName) throws Exception + { + List coreList = new ArrayList(); + String[] keywordStr = Arrays.toStringArray(keywordName); + for (String keyword : keywordStr) + { + DesKeywordCore core = ORM.get(ZTable.class).item(DesKeywordCore.class, new Selector("keywordName", keyword)); + if (core == null) + { + continue; + } + + coreList.add(core); + } + + // 排序,降序 + Collections.sort(coreList, new Comparator() + { + @Override + public int compare(DesKeywordCore o1, DesKeywordCore o2) + { + return o2.getKeywordNum() - o1.getKeywordNum(); + } + }); + + return coreList; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/LabelDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/LabelDao.java new file mode 100644 index 0000000..aa8e78e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/LabelDao.java @@ -0,0 +1,104 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dao; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.DesLabelAttribute; +import com.zhiqim.yangcai.design.dbo.DesLabelIndustry; + +/** + * 标签Dao + * + * @version v1.0.0 @author Deng 2018-3-15 新建与整理 + */ +@AnAlias("LabelDao") +public class LabelDao +{ + /** + * 获取子行业名称 + * @param industrySubIds + * @return + * @throws Exception + */ + public static String doIndustrySubName(String industrySubIds)throws Exception + { + if(Validates.isEmpty(industrySubIds)) + return ""; + + String[] subsStr = industrySubIds.split(","); + if(subsStr.length == 0) + return ""; + + List subList = new ArrayList<>(); + for (String subs : subsStr) + { + DesLabelIndustry industry = ORM.get(ZTable.class).item(DesLabelIndustry.class, Long.parseLong(subs)); + if (industry == null) + continue; + + subList.add(industry.getIndustrySubName()); + } + + return Lists.toString(subList); + } + + /** + * 获取行业下的子行业 + * @param industryId + * @return + * @throws Exception + */ + public static long getIndustrySubId(long industryId)throws Exception + { + DesLabelIndustry industry = ORM.get(ZTable.class).item(DesLabelIndustry.class, new Selector("industryId", industryId)); + + return industry.getIndustrySubId(); + } + + /** + * 获取属性值名称 + * @param attributeIds + * @return + * @throws Exception + */ + public static String doAttributeName(String attributeIds)throws Exception + { + if(Validates.isEmpty(attributeIds)) + return ""; + + String[] subsStr = attributeIds.split(","); + if(subsStr.length == 0) + return ""; + + List attrList = new ArrayList<>(); + for (String subs : subsStr) + { + DesLabelAttribute attr = ORM.get(ZTable.class).item(DesLabelAttribute.class, Long.parseLong(subs)); + if(attr == null) + continue; + + attrList.add(attr.getAttributeName()); + } + + return Lists.toString(attrList); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/ParamTypeDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/ParamTypeDao.java new file mode 100644 index 0000000..f8b21ea --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/ParamTypeDao.java @@ -0,0 +1,368 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dao; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.zhiqim.kernel.util.Validates; + +/** + * 文本参数分析 + * + * @version v1.0.0 @author Deng 2018-1-8 新建与整理 + */ +public class ParamTypeDao +{ + + public static String isAnalysis(String str) + { + if (isUserName(str)) + return "姓名"; + + else if (isPosition(str)) + return "职位"; + + else if (isMobile(str)) + return "手机"; + + else if (isTel(str)) + return "固定电话"; + + else if (isQQ(str)) + return "QQ"; + + else if (isWechat(str)) + return "微信"; + + else if (isEmail(str)) + return "邮箱"; + + else if (isCompany(str)) + return "公司名称"; + + else if (isAddr(str)) + return "公司地址"; + + else if (isBusiness(str)) + return "经营(业务)范围"; + + return null; + } + + /** + * 判断是否为姓名 + * @param str + * @return + */ + public static boolean isUserName(String str) + { + String[] USERNAME_STR = {"姓名", "名字", "联系人"}; + if (Validates.isStrContainStrArr(str, USERNAME_STR)) + return true; + + return false; + + } + + /** + * 判断是否为职位 + * @param str + * @return + */ + public static boolean isPosition(String str) + { + String[] POSITION_STR = {"职位", "title", "公司职位", "头衔"}; + if (Validates.isStrContainStrArr(str, POSITION_STR)) + return true; + + return false; + + } + + /** + * 判断是否为手机号码 + * @param str + * @return + */ + public static boolean isMobile(String str) + { + String[] MOBILE_STR = {"手机", "电话","电话号码" ,"mobile", "phone", "TEL", "Tel"}; + if (Validates.isStrContainStrArr(str, MOBILE_STR)) + return true; + + return false; + + } + + /** + * 判断是否为固定电话 + * @param str + * @return + */ + public static boolean isTel(String str) + { + String[] TEL_STR = {"固定电话", "座机电话", "座机号码"}; + if (Validates.isStrContainStrArr(str, TEL_STR)) + return true; + + return false; + } + + /** + * 判断是否为QQ + * @param str + * @return + */ + public static boolean isQQ(String str) + { + String[] QQ_STR = {"QQ" ,"QQ号码", "Qq", "qq"}; + if (Validates.isStrContainStrArr(str, QQ_STR)) + return true; + + return false; + + } + + /** + * 判断是否为微信 + * @param str + * @return + */ + public static boolean isWechat(String str) + { + String[] WECHAT_STR = {"微信" ,"微信号码"}; + if (Validates.isStrContainStrArr(str, WECHAT_STR)) + return true; + + return false; + + } + + /** + * 判断是否为邮箱 + * @param str + * @return + */ + public static boolean isEmail(String str) + { + String[] EMAIL_STR ={"邮箱","电子邮箱","EMAIL","email"}; + if (Validates.isStrContainStrArr(str, EMAIL_STR)) + return true; + + Validates.isEmail(str); + return false; + + } + + /** + * 判断是否为公司名称 + * @param str + * @return + */ + public static boolean isCompany(String str) + { + String[] COMPANY_STR = {"有限公司", "公司名称", "公司", "公司名"}; + if (Validates.isStrContainStrArr(str, COMPANY_STR)) + return true; + + return false; + + } + + /** + * 判断是否为公司地址 + * @param str + * @return + */ + public static boolean isAddr(String str) + { + String[] ADDR_STR = {"公司地址", "地址", "addr", "店址"}; + if (Validates.isStrContainStrArr(str, ADDR_STR)) + return true; + return false; + + } + + /** + * 判断是否为经营(业务)范围 + * @param str + * @return + */ + public static boolean isBusiness(String str) + { + String[] BUSINESS_STR = {"经营","范围", "经营范围", "营业范围", "主营"}; + if (Validates.isStrContainStrArr(str, BUSINESS_STR)) + return true; + + return false; + + } + + /** + * 文本字符检查判断替换 + * @param argStr + * @param splitFormat + * @return + */ + public static List ChkPhaseChar(String argStr, String[] splitFormat) + { + List dataList = new ArrayList(); + if (Validates.isStrContainStrArr(argStr, splitFormat)) + {//存在文本单字符 + String[] characterStr = doContentSplit(argStr, splitFormat); //段段文本字节 + if (characterStr == null) + return dataList; + + //查找同义词 + String synonym = ParamTypeDao.isAnalysis(characterStr[0]); + if (synonym != null) + dataList.add(synonym + ":" + characterStr[1]); + } + else + {//正则表达式判断 + + //汉字 + 数字 + String chrInt = "^[\\u4E00-\\u9FA5_0-9]+$"; + if (Validates.isRegexp(chrInt, argStr)) + dataList.addAll(ParamTypeDao.doRegEx(argStr)); + + if (Validates.isPhone(argStr)) + dataList.add("固定电话:" + argStr); + + if (Validates.isEmail(argStr)) + dataList.add("邮箱:" + argStr); + } + + return dataList; + } + + /** + * 汉字数字格式判断 + * @param argStr + * @return + */ + public static List doRegEx(String argStr) + { + List strList = new ArrayList(); + String chnName = doChnName(argStr); + String number = doNumber(argStr); + if (chnName.length() == 0) + {//只有数字 + //纯数字 + if (Validates.isInteger(argStr) && argStr.length() == 11) + strList.add("手机:" + argStr); + } + else if (chnName.length() <= 3) + { + //检查同义词 + String name = isAnalysis(chnName); + if (name == null) + strList.add("姓名:" + chnName); + else if (number.length() != 0) + { + strList.add(name + ":" + number); + } + } + else if (chnName.length() !=0 && number.length() != 0) + { + strList.add("公司地址:" + argStr); + } + + else if (chnName.length() >= 5 && number.length() == 0) + { + if (chnName.contains("有限公司")) + strList.add("公司名称:" + chnName); + } + + return strList; + } + + /** + * 获取汉字 + * @param argStr + * @return + */ + public static String doChnName(String argStr) + { + String regEx = "[\\u4e00-\\u9fa5]"; + Pattern p = Pattern.compile(regEx); + Matcher m = p.matcher(argStr); + StringBuffer sb = new StringBuffer(); + while(m.find()){ + sb.append(m.group()); + } + + return sb.toString(); + } + + /** + * 获取数字 + * @param argStr + * @return + */ + public static String doNumber(String argStr) + { + String regEx = "[0-9]+"; + Pattern p = Pattern.compile(regEx); + Matcher m = p.matcher(argStr); + StringBuffer sb = new StringBuffer(); + while(m.find()){ + sb.append(m.group()); + } + + return sb.toString(); + } + + /** + * 数组转List + * @param phaseStr + * @return + */ + public static List doDataStrList(String[] phaseStr) + { + List phaseStrList = Arrays.asList(phaseStr); + + return phaseStrList; + } + + /** + * 数组分隔,去除空格组装 + * @param contentStr + * @param splitFormat + * @return + */ + public static String[] doContentSplit(String contentStr, String[] splitFormat) + { + String[] textStr = null; + for (String str : splitFormat) + { + if (contentStr.contains(str)) + textStr = contentStr.split(str); + } + + List strList = doDataStrList(textStr); + List strListNew=new ArrayList<>(); + for (int i = 0; i 4 * 1000 * 60 * 60 && finishHour <= 6 * 1000 * 60 * 60) + { + // 接单6小时内定稿奖励积分 + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_3.value())); + scoreDesignerRecordDetail.setOperatorCode(order.getDesigner()); + scoreDesignerRecordDetail.setOrderId(order.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + if (order.getAmount() >= 30000 && order.getAmount() < 50000) + { + // 定稿大金额奖励300-500元区间 + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_4.value())); + scoreDesignerRecordDetail.setOperatorCode(order.getDesigner()); + scoreDesignerRecordDetail.setOrderId(order.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + else if (order.getAmount() >= 50000) + { + // 定稿大金额奖励500元以上 + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_5.value())); + scoreDesignerRecordDetail.setOperatorCode(order.getDesigner()); + scoreDesignerRecordDetail.setOrderId(order.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + if (order.getPrintKs() >= 5) + { + // 定稿5款及以上订单 + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_6.value())); + scoreDesignerRecordDetail.setOperatorCode(order.getDesigner()); + scoreDesignerRecordDetail.setOrderId(order.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + if (StringUtils.isNotEmpty(order.getAfterNames())) + { + // 定稿包含后加工 + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_7.value())); + scoreDesignerRecordDetail.setOperatorCode(order.getDesigner()); + scoreDesignerRecordDetail.setOrderId(order.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + return true; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/StatDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/StatDao.java new file mode 100644 index 0000000..2ba7b00 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/StatDao.java @@ -0,0 +1,451 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dao; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.ProductConvertCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.dbo.design.ProductDesignPriceView; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerLever; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordView; +import com.zhiqim.yangcai.design.dbo.stat.DesignGroup; +import com.zhiqim.yangcai.design.dbo.stat.RefundParameter; + +/** + * 设计统计DAO + * + * @version v1.0.0 @author Deng 2017-9-18 新建与整理 + */ +public class StatDao +{ + /** + * 计算退款奖罚金 + * + * @param model + * @param request + * @return + * @throws ORMException + * @throws SQLException + */ + public static long calculateAmount(long refundRate, int sumCount, HttpRequest request) throws ORMException, SQLException + { + RefundParameter parameter = ORM.get(ZTable.class).item(RefundParameter.class); + if (parameter == null) + { + request.returnHistory("请先设置退款率奖罚参数"); + return 0; + } + + // 退款率高于标准退款率(罚钱) + if (refundRate > parameter.getStandardRefundRateCeil()) + { + long difference = refundRate + 1 - parameter.getStandardRefundRateCeil(); + + double multiple = difference * 1.0 / parameter.getPunishDot(); + long amount = (long) (Math.ceil(multiple) * parameter.getPunishAmount()); + + return -amount < -parameter.getPunishAmountMax() ? -parameter.getPunishAmountMax() : -amount; + } + + // 退款在标准退款率范围内(不奖不罚) + else if (refundRate >= parameter.getStandardRefundRateFloor() && refundRate < parameter.getStandardRefundRateCeil()) + { + return 0; + } + else if (refundRate < parameter.getStandardRefundRateFloor()) + { // 退款率高于标准退款率(奖励) + if (sumCount < 200) + { + return 0; + } + + long difference = parameter.getStandardRefundRateFloor() - refundRate; + double multiple = difference * 1.0 / parameter.getRewardDot(); + long amount = (long) (Math.ceil(multiple) * parameter.getRewardAmount()); + + return amount > parameter.getRewardAmountMax() ? parameter.getRewardAmountMax() : amount; + } + + return 0; + } + + /** + * 计算退款奖罚金 + * + * @param model + * @param request + * @return + * @throws ORMException + * @throws SQLException + */ + public static long calculateAmount(long refundRate, int sumCount) throws ORMException, SQLException + { + RefundParameter parameter = ORM.get(ZTable.class).item(RefundParameter.class); + if (parameter == null) + { + return 0; + } + + // 退款率高于标准退款率(罚钱) + if (refundRate > parameter.getStandardRefundRateCeil()) + { + long difference = refundRate + 1 - parameter.getStandardRefundRateCeil(); + + double multiple = difference * 1.0 / parameter.getPunishDot(); + long amount = (long) (Math.ceil(multiple) * parameter.getPunishAmount()); + + return -amount < -parameter.getPunishAmountMax() ? -parameter.getPunishAmountMax() : -amount; + } + + // 退款在标准退款率范围内(不奖不罚) + else if (refundRate >= parameter.getStandardRefundRateFloor() && refundRate < parameter.getStandardRefundRateCeil()) + { + return 0; + } + else if (refundRate < parameter.getStandardRefundRateFloor()) + { + if (sumCount < 200) + {// 小于两百单只罚不奖 + return 0; + } + + long difference = parameter.getStandardRefundRateFloor() - refundRate; + double multiple = difference * 1.0 / parameter.getRewardDot(); + long amount = (long) (Math.ceil(multiple) * parameter.getRewardAmount()); + + return amount > parameter.getRewardAmountMax() ? parameter.getRewardAmountMax() : amount; + } + + return 0; + } + + /** + * 返回一个年份列表 + * + * @param beginYear + * @param endYear + * @return + */ + public static List yearList(int beginYear, int endYear) + { + List yearList = new ArrayList(); + for (int i = beginYear; i <= endYear; i++) + { + yearList.add(i); + } + + return yearList; + } + + /** + * 根据设计组ID查组织ID + * + * @param groupId + * @return + * @throws ORMException + * @throws SQLException + */ + public static long queryOrgIdByGroupId(long groupId) throws ORMException, SQLException + { + DesignGroup group = ORM.get(ZTable.class).item(DesignGroup.class, groupId); + if (group == null) + { + return 0; + } + + return group.getOrgId(); + } + + /** + * + * [简要描述]: 获取设计师积分对象
            + * [详细描述]:
            + * + * @author gjx + * @param designer + * @return + * @throws Exception + */ + public static ScoreDesignerRecordView doQueryDesignerScore(String designer) throws Exception + { + Selector pSelector = new Selector(); + pSelector.addMust("operatorCode", designer); + + return ORM.get(ZView.class).item(ScoreDesignerRecordView.class, pSelector); + } + + /** + * + * [简要描述]: 获取设计师等级对象
            + * [详细描述]:
            + * + * @author gjx + * @param scoreDesignerLeverList + * @param designer + * @return + * @throws Exception + */ + public static ScoreDesignerLever doQueryDesignerScoreLever(List scoreDesignerLeverList, ScoreDesignerRecordView scoreDesignerRecordView) + throws Exception + { + for (ScoreDesignerLever scoreDesignerLever : scoreDesignerLeverList) + { + if (scoreDesignerLever.getMaxScore() >= scoreDesignerRecordView.getScore() + && scoreDesignerRecordView.getScore() >= scoreDesignerLever.getMinScore()) + { + return scoreDesignerLever; + } + } + return null; + } + + /** + * + * [简要描述]: 计算订单设计师绩效
            + * [详细描述]:
            + * + * @author gjx + * @param scoreDesignerLever + * @param order + * @return + */ + public static long calculateOrderPerformance(DesignOrder order) + { + // 刷新缓存 + Global.get(ProductConvertCache.class).doRefresh(); + int printKs = order.getPrintKs(); + // long typeId = order.getTypeId(); + int draftType = order.getDraftType(); + int designCopies = order.getDesignCopies(); + + // 排除标准自来稿 + if (draftType == DraftConstants.DRAFT_STANDARD.value()) + { + return 0L; + } + + if (draftType == DraftConstants.DRAFT_TEMPLATE.value()) + {// 改稿 + return calculateTemplateDraftOrderPrice(order); + } + + long orderDesignerFee = calculateOrderProductPerformance(order); + + if (designCopies < 1) + {// 设计费最少一份 + designCopies = 1; + } + + if (designCopies >= printKs || order.getTypeId() == 13879L || order.getTypeId() == 4L) + { // 设计费份数>=款数,则订单单价为:产品单价*设计费份数 海报产品,展架特殊处理 设计单 = 单价*设计费份数 + orderDesignerFee = orderDesignerFee * designCopies; + } + else + { // 设计费份数<款数,则订单单价为:产品单价*设计费份数+(款数-设计费份数)*改稿单价 + orderDesignerFee = (orderDesignerFee * designCopies) + + Amounts.toFen(String.valueOf((printKs - designCopies) * Double.valueOf(Amounts.toYuan(calculateTemplateDraftProductPrice(order)))), 0); + } + + return orderDesignerFee; + } + + /** + * + * [简要描述]: 获取改稿订单价格
            + * [详细描述]: 改稿根据产品单价配置得出(改稿单价*款数)
            + * + * @author gjx + * @param order + * @return + */ + public static long calculateTemplateDraftOrderPrice(DesignOrder order) + { + long templateDraftPrice = calculateTemplateDraftProductPrice(order); + if (order.getTypeId() == 13879) + {// 海报类不计算份数 + return templateDraftPrice; + } + if (order.getPrintKs() > 0) + { + templateDraftPrice = templateDraftPrice * order.getPrintKs(); + } + return templateDraftPrice; + } + + /** + * + * [简要描述]: 获取改稿产品单价
            + * [详细描述]:
            + * + * @author gjx + * @param order + * @return + */ + public static long calculateTemplateDraftProductPrice(DesignOrder order) + { + // 按产品+尺寸+面数 产品+尺寸 产品+面数 产品排序 + List prdPriceList = Global.get(ProductConvertCache.class).getProductLeverPriceList(order.getTypeId()); + if (Validates.isEmpty(prdPriceList)) + {// 未匹配上产品单价配置 + return 0; + } + + List prdCvt = matchOrderPrdPriceRule(prdPriceList, order, 1); + if (null == prdCvt) + {// 未匹配上产品单价配置 + return 0; + } + + // return prdCvt.getTemplateDraftPrice(); + for (ProductDesignPriceView prpd : prdCvt) + { + if (prpd.getDraftType() == 1)// 改稿单价 + { + return prpd.getDesignPriceMoney(); + } + } + + return 0L; + } + + /** + * + * [简要描述]: 计算订单产品单价
            + * [详细描述]:
            + * + * @author gjx + * @param scoreDesignerLever + * @param order + */ + public static long calculateOrderProductPerformance(DesignOrder order) + { + // 按产品+尺寸+面数 产品+尺寸 产品+面数 产品排序 + List prdPriceList = Global.get(ProductConvertCache.class).getProductLeverPriceList(order.getTypeId()); + if (prdPriceList == null) + { + return 0L;// 未配置返回0 + } + // 尺寸升序排序 + // prdPriceList.sort(Comparator.comparing(ProductConvert::getPrdSizeHeight)); + Collections.sort(prdPriceList, new Comparator() + { + @Override + public int compare(ProductDesignPriceView p1, ProductDesignPriceView p2) + { + if (p1.getPrdSizeHeight() == 0) + { + return Integer.compare(p2.getPrdSizeHeight(), p1.getPrdSizeHeight()); + } + else + { + return Integer.compare(p1.getPrdSizeHeight(), p2.getPrdSizeHeight()); + } + } + }); + if (Validates.isEmpty(prdPriceList)) + {// 未匹配上产品单价配置 + return 0; + } + + List prdCvt = matchOrderPrdPriceRule(prdPriceList, order, order.getDraftType()); + if (null == prdCvt) + {// 未匹配上产品单价配置 + return 0; + } + + for (ProductDesignPriceView prpd : prdCvt) + { + if (prpd.getDraftType() == order.getDraftType())// 设计单价 + { + // 画册、电子画册特殊处理 + if (order.getTypeId() == 3 || order.getTypeId() == 2127009652009L) + { + return prpd.getDesignPriceMoney() * order.getDesignPage(); + } + return prpd.getDesignPriceMoney(); + } + } + + return 0L; + } + + /** + * + * [简要描述]: 订单匹配产品单价
            + * [详细描述]:
            + * + * @author gjx + * @param prdPriceList + * @param order + * @return + */ + public static List matchOrderPrdPriceRule(List prdPriceList, DesignOrder order, int draftType) + { + double designWidth = order.getDesignWidth(); + double designHeight = order.getDesignHeight(); + if (order.getPrintWidth() > 0 && order.getPrintHeight() > 0) + {// 自定义尺寸 + designWidth = order.getPrintWidth(); + designHeight = order.getPrintHeight(); + } + String prdText = order.getOrderText(); + List prdpList = new ArrayList(); + for (ProductDesignPriceView cvt : prdPriceList) + { + int prdSizeWidth = cvt.getPrdSizeWidth(); + int prdSizeHeight = cvt.getPrdSizeHeight(); + String prdPageName = cvt.getPrdPageName(); + + if (prdSizeWidth > 0 && prdSizeHeight > 0) + { + boolean match = false; + + if ((designWidth <= prdSizeWidth && designHeight <= prdSizeHeight) || (designHeight <= prdSizeWidth && designWidth <= prdSizeHeight)) + { + match = true; + } + + if (!match) + {// 尺寸不匹配 + continue; + } + } + + if (Validates.isNotEmpty(prdPageName) && !prdText.contains(prdPageName)) + {// 产品描述不包含产品单价配置面数 + continue; + } + + // 稿件类型不匹配 + if (cvt.getDraftType() != draftType) + { + continue; + } + prdpList.add(cvt); + } + return prdpList; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/TemplateDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/TemplateDao.java new file mode 100644 index 0000000..05098b4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/TemplateDao.java @@ -0,0 +1,747 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dao; + +import java.awt.image.BufferedImage; +import java.awt.image.RenderedImage; +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import javax.imageio.ImageIO; + +import org.icepdf.core.pobjects.Document; +import org.icepdf.core.pobjects.Page; +import org.icepdf.core.util.GraphicsRenderingHints; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.media.dbo.MediaBg; +import com.zhiqim.media.dbo.MediaCanvas; +import com.zhiqim.media.dbo.MediaCoverMaterial; +import com.zhiqim.media.dbo.MediaImageUse; +import com.zhiqim.media.dbo.MediaMaterialParamEx; +import com.zhiqim.media.dbo.MediaParam; +import com.zhiqim.media.service.dao.MediaDao; +import com.zhiqim.media.service.dao.MediaPathDao; +import com.zhiqim.media.service.model.MediaBgModel; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateEventView; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateIndexView; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; +import com.zhiqim.yangcai.design.model.CopyTemplateModel; +import com.zhiqim.yangcai.design.model.TemplatePreviewModel; +import com.zhiqim.yangcai.util.SolrUtil; + +/** + * 模板dao + * + * @version v1.0.0 @author zhouwenbin 2017-11-27 新建与整理 + */ +public class TemplateDao implements SignConstants +{ + private static final Log log = LogFactory.getLog(TemplateDao.class); + + /** + * 查询事件模板列表 + * + * @param urlParam + * @param user + * @return + * @throws Exception + */ + public static List doTemplateEventList(String urlParam, ZmrSessionUser user, long designType, long industryId) throws Exception + { + List templateList = new ArrayList(); + + Selector selector = new Selector(); + selector.addOrderbyDesc("createTime"); + + if (designType != -1) + { + selector.addMust("designType", designType); + } + + if (industryId != -1) + { + selector.addMust("industryId", industryId); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("COLLECT")) + {// 我收藏的 + selector.addMust("operatorCode", user.getOperatorCode()); + selector.addMust("eventType", 2); + templateList = ORM.get(ZView.class).list(DesTemplateEventView.class, selector); + } + + return templateList; + } + + /** + * 关键词或全部查询模板,订单类型,按模板指数降顺 + * + * @param allList + * @param keyword + * @return + * @throws Exception + */ + public static List doTemplateList(List sorlList) throws Exception + { + List mediaList = new ArrayList(); + for (long mediaId : sorlList) + { + Selector selector = new Selector(); + selector.addMust("mediaId", mediaId); + DesTemplateIndexView index = ORM.get(ZView.class).item(DesTemplateIndexView.class, selector); + if (index == null) + { + continue; + } + + mediaList.add(index); + } + + // 组装新的模板列表,按模板指数降序 + Collections.sort(mediaList, new Comparator() + { + @Override + public int compare(DesTemplateIndexView o1, DesTemplateIndexView o2) + { + return o2.getMediaScore() - o1.getMediaScore(); + } + }); + + return mediaList; + } + + /** + * 复制模板,返回模板对象 + * + * @param mediaId 原id + * @param newMediaId 新id + * @param designer 创建者 + * @return + * @throws Exception + */ + private static CopyTemplateModel copyTemplate(long mediaId, long newMediaId, String designer) throws Exception + { + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (template == null) + { + return null; + } + + MediaCanvas newCanvas = ORM.get(ZTable.class).item(MediaCanvas.class, newMediaId); + if (newCanvas != null) + { + log.error("复制模板时,新mediaId已存在,新mediaId=" + newMediaId); + return null; + } + + // 复制模板 + MediaTemplate newTemplate = new MediaTemplate(); + Objects.copyDeep(template, newTemplate); + newTemplate.setMediaId(newMediaId); + + newTemplate.setTemplateType(20); + + newTemplate.setTemplateStatus(0); + // newTemplate.setOrderId(0); + newTemplate.setDesignId(0); + newTemplate.setTemplateSrc(mediaId); // 来源 + newTemplate.setReleaseTime(null); + newTemplate.setReleaseStatus(0); + newTemplate.setDesigner(designer); + + String time = DateTimes.getDateTimeString(); + List newBgList = new ArrayList<>(); + List refList = new ArrayList<>(); + + // 画布 + MediaCanvas canvas = ORM.get(ZTable.class).item(MediaCanvas.class, mediaId); + newCanvas = new MediaCanvas(); + Objects.copyDeep(canvas, newCanvas); + newCanvas.setMediaId(newMediaId); + newCanvas.setIsEdit(0); // 可编辑 + newCanvas.setMediaName(canvas.getMediaName()); + newCanvas.setCreateTime(time); + newCanvas.setUpdateTime(time); + + MediaDao.updateCanvasFullSize(newCanvas, newCanvas.getBaseWidthMm(), newCanvas.getBaseHeightMm(), true); + + // 背景 + List bgList = ORM.get(ZTable.class).list(MediaBg.class, new Selector("mediaId", mediaId)); + for (MediaBg bg : bgList) + { + MediaBg newBg = new MediaBg(); + Objects.copyDeep(bg, newBg); + newBg.setMediaId(newMediaId); + + newBgList.add(newBg); + } + + refList.addAll(MediaDao.recordBgRefNum(newBgList, "add")); // 添加引用记录 + + // 素材 + List materialList = ORM.get(ZView.class).list(MediaMaterialParamEx.class, new Selector("mediaId", mediaId)); + List newMaterialList = new ArrayList<>(); + for (MediaMaterialParamEx m : materialList) + { + MediaMaterialParamEx newM = new MediaMaterialParamEx(); + Objects.copyDeep(m, newM); + newM.setMediaId(newMediaId); + + newMaterialList.add(newM); + } + + List newCoverMaterialList = new ArrayList(); + List coverMaterialList = ORM.get(ZTable.class).list(MediaCoverMaterial.class, new Selector("mediaId", mediaId)); + for (MediaCoverMaterial mediaCoverMaterial : coverMaterialList) + { + MediaCoverMaterial newCoverMaterial = new MediaCoverMaterial(); + Objects.copyDeep(mediaCoverMaterial, newCoverMaterial); + newCoverMaterial.setMediaId(newMediaId); + + newCoverMaterialList.add(newCoverMaterial); + } + + refList.addAll(MediaDao.recordMaterialRefNum(newMaterialList, "add")); // 添加引用记录 + + CopyTemplateModel media = new CopyTemplateModel(newCanvas, newBgList, newMaterialList, newCoverMaterialList); + media.setTemplate(newTemplate); + media.setRefList(refList); + + return media; + } + + /** + * 复制模板,并入库 + * + * @param mediaId 原id + * @param newMediaId 新id + * @param designer 创建者 + * @return + * @throws Exception + */ + @AnTransaction + public static CopyTemplateModel copyTemplateAndInsert(long mediaId, long newMediaId, String designer) throws Exception + { + try + { + CopyTemplateModel media = copyTemplate(mediaId, newMediaId, designer); + + MediaCanvas canvas = media.getCanvas(); + String oldUrl = canvas.getMediaUrl(); + if (Validates.isNotEmpty(oldUrl)) + { + String oldFilePath = MediaPathDao.parseUplUrl(oldUrl); + + String fileName = Files.getFileName(oldFilePath); + String destPath = MediaPathDao.getCanvasLocalPre(newMediaId) + fileName; // 本地存储路径 + + if (!Files.copyFile(oldFilePath, destPath)) + { + log.error("复制模板时,复制素材效果图失败,原mediaId=" + mediaId); + return null; + } + + String mediaUrl = MediaPathDao.getCanvasUrlPre(newMediaId) + fileName; // 网络存储路径 + canvas.setMediaUrl(mediaUrl); // 更换url地址 + } + + ORM.get(ZTable.class).insert(media.getTemplate()); + ORM.get(ZTable.class).insert(canvas); + ORM.get(ZTable.class).insertBatch(media.getBgList()); + ORM.get(ZTable.class).insertBatch(media.getMediaMaterialList()); + ORM.get(ZTable.class).insertBatch(media.getMaterialParamList()); + ORM.get(ZTable.class).replaceBatch(media.getRefList()); // 替换引用数 + + return media; + } + catch (Exception e) + { + log.error("复制模板时异常,原mediaId=" + mediaId, e); + return null; + } + } + + /** + * 替换素材参数 + * + * @param materialList + * @param paramMap + * @return + * @throws Exception + */ + public static List replaceMaterialParam(List materialList, Map paramMap) throws Exception + { + List newMaterialList = new ArrayList<>(); + for (MediaMaterialParamEx m : materialList) + { + newMaterialList.add(replaceMaterialParam(m, paramMap)); + } + + return newMaterialList; + } + + /** + * 单个替换素材参数 + * + * @param m + * @param paramMap + * @return + * @throws Exception + */ + public static MediaMaterialParamEx replaceMaterialParam(MediaMaterialParamEx m, Map paramMap) throws Exception + { + String key = m.getParamKey(); + if (Validates.isEmpty(key)) + { + return m; + } + + // 3表示组合素材 + if (paramMap == null || !paramMap.containsKey(key) || m.getType() == 3) + { + return m; + } + + String paramValue = (String) paramMap.get(key); + if (Validates.isEmpty(paramValue)) + { + return m; + } + + String source = m.getSource(); + if (m.getType() == 1) + {// 文字 + source = MediaDao.replaceMaterialText(source, paramValue); + } + else + {// 图片 + String value = MediaDao.getImageValue(source); + source = source.replace(value, paramValue); + } + + m.setSource(source); + + return m; + } + + /** + * 解析客户文本数据 + * + * @param paramData + * @throws Exception + */ + public static Map doParseReplaceData(long paramCat, String paramData) throws Exception + { + Map dataMap = new HashMap(); + Map replaceMap = new HashMap(); + + if (Validates.isEmpty(paramData)) + { + return replaceMap; + } + + String[] paramStr = paramData.split("\n"); + for (String param : paramStr) + { + param = param.replace(":", ":"); // 中文冒号替换成英文冒号 + + int indx = param.indexOf(":"); + if (indx == -1) + { + continue; + } + + String first = Strings.trimLeft(param.substring(0, indx)); + + // 查询参数是否匹配 + MediaParam mParam = ORM.get(ZTable.class).item(MediaParam.class, new Selector("paramName", first)); + if (mParam == null) + { + Selector paramSel = new Selector(); + paramSel.addMaybeLike("paramDesc", first); + mParam = ORM.get(ZTable.class).item(MediaParam.class, paramSel); + } + + if (mParam == null) + { + continue; + } + + String paramCode = mParam.getParamName(); + String second = Strings.trimRight(param.substring(indx + 1)); + + dataMap.put(paramCode, second); + } + + Selector paramSel = new Selector(); + paramSel.addMust("paramCat", paramCat); + paramSel.addOrderbyAsc("paramIndex"); + List paramList = ORM.get(ZTable.class).list(MediaParam.class); + for (MediaParam param : paramList) + { + String paramName = param.getParamName(); + if (dataMap.containsKey(paramName)) + { + replaceMap.put(param.getParamKey(), dataMap.get(paramName)); + } + } + + return replaceMap; + } + + /** + * 生成模板svg展示图 + * + * @param mediaIdList + * @return + * @throws Exception + */ + public static Map getTemplatePreview(List mediaIdList) throws Exception + { + Map svgMap = new HashMap(); + if (mediaIdList == null || mediaIdList.isEmpty()) + { + return svgMap; + } + + for (long mediaId : mediaIdList) + { + MediaTemplateView canvas = ORM.get(ZView.class).item(MediaTemplateView.class, new Selector("mediaId", mediaId)); + int mediaScore = TemplateOrderDao.getTemplateScore(mediaId); + TemplatePreviewModel priview = new TemplatePreviewModel(mediaId, canvas.getPageValue(), mediaScore, canvas.getWidth(), canvas.getHeight()); + + // 设置svg内容展示代码 + List bgList = MediaDao.toSvgList(mediaId, 0, 0, MediaPathDao.MEDIA_URL_PRE, false, null, null, null, "SVG"); + List svgList = new ArrayList<>(); + for (MediaBgModel bg : bgList) + { + svgList.add(bg.getSvgCode()); + } + + // priview.setSvgList(svgList); + priview.setBgList(bgList); + svgMap.put(mediaId, priview); + } + + // 按模板指数,降序排列 + List> entryList = new ArrayList>(svgMap.entrySet()); + Collections.sort(entryList, new Comparator>() + { + @Override + public int compare(Entry o1, Entry o2) + { + return o2.getValue().getMediaScore() - o1.getValue().getMediaScore(); + } + }); + + return svgMap; + } + + /** + * 模板订单保存初稿、设计、成品文件 + * + * @param designId + * @throws Exception + */ + @AnTransaction + public static void doSaveTemplateOrderFile(long designId, String operatorCode, String pdfPath, String pdfFileName, String designPath, String designFielName, + String thumPath, String thumFileName) throws Exception + { + // 插入初稿缩图 + DesignAtta thumAtta = new DesignAtta(); + thumAtta.setDesignId(designId); + thumAtta.setAttaId(Ids.longId()); + thumAtta.setAttaModul(FileTypeConstants.FILE_FIRSTTHUMFILE.value()); + thumAtta.setSavePath(thumPath); + thumAtta.setFileName(thumFileName); + thumAtta.setFileType("png"); + thumAtta.setFileSize(Files.read(thumPath).length); + thumAtta.setUploadTime(Sqls.nowTimestamp()); + thumAtta.setOperatorCode(operatorCode); + + // 插入设计文件 + DesignAtta desAtta = new DesignAtta(); + desAtta.setDesignId(designId); + desAtta.setAttaId(Ids.longId()); + desAtta.setAttaModul(FileTypeConstants.FILE_DESGIN.value()); + desAtta.setSavePath(designPath); + desAtta.setFileName(designFielName); + desAtta.setFileType("svg"); + desAtta.setFileSize(Files.read(designPath).length); + desAtta.setUploadTime(Sqls.nowTimestamp()); + desAtta.setOperatorCode(operatorCode); + + // 插入成品文件附件 + byte[] cont = Files.read(new File(pdfPath), 500 * MiB); + long len = 0L; + if (cont != null) + { + len = cont.length; + } + + DesignAtta endAtta = new DesignAtta(); + endAtta.setDesignId(designId); + endAtta.setAttaId(Ids.longId()); + endAtta.setAttaModul("EndFile"); + endAtta.setSavePath(pdfPath); + endAtta.setFileName(pdfFileName); + endAtta.setFileType("pdf"); + endAtta.setFileSize(len); + endAtta.setUploadTime(Sqls.nowTimestamp()); + endAtta.setOperatorCode(operatorCode); + + ORM.get(ZTable.class).insert(thumAtta); + ORM.get(ZTable.class).insert(desAtta); + ORM.get(ZTable.class).insert(endAtta); + } + + /** + * 复制模板来创建新的订单模板 + * + * @param designId 订单号 + * @param mediaId 选择的模板ID + * @param designer 设计师 + * @return + */ + public static boolean doNewOrderTemplate(long designId, long mediaId, String designer) throws Exception + { + long newMediaId = Ids.longId(); + CopyTemplateModel media = TemplateDao.copyTemplateAndInsert(mediaId, newMediaId, designer); + if (media == null) + { + return false; + } + + // 生成临时订单草稿 + Updater tupdater = new Updater(); + tupdater.addMust("mediaId", newMediaId); + tupdater.addField("templateType", 0); + tupdater.addField("templateStatus", 0); + tupdater.addField("designId", designId); + ORM.get(ZTable.class).update(MediaTemplate.class, tupdater); + // 更新solr数据 + SolrUtil.updateMediaData(newMediaId); + return true; + } + + /** + * 复制模板来创建新的订单模板 + * + * @param designId 订单号 + * @param mediaId 选择的模板ID + * @param mediaId new模板ID + * @param designer 设计师 + * @return + */ + public static boolean doNewOrderTemplate(long designId, long mediaId, long newMediaId, String designer) throws Exception + { + CopyTemplateModel media = TemplateDao.copyTemplateAndInsert(mediaId, newMediaId, designer); + if (media == null) + { + return false; + } + + // 生成临时订单草稿 + Updater tupdater = new Updater(); + tupdater.addMust("mediaId", newMediaId); + tupdater.addField("templateType", 0); + tupdater.addField("templateStatus", 0); + tupdater.addField("designId", designId); + ORM.get(ZTable.class).update(MediaTemplate.class, tupdater); + // 更新solr数据 + SolrUtil.updateMediaData(newMediaId); + return true; + } + + /** + * pdf生成缩略图 + * + * @param path + * @param createPath + * @return + * @throws Exception + */ + public static boolean doThumFileCreate(String path, String createPath) throws Exception + { + Document document = new Document(); + document.setFile(path); + + float scale = 1f; + float rotation = 0f; + int pageTotal = document.getNumberOfPages(); + if (pageTotal == 0) + { + return false; + } + + for (int n = 0; n < 1; n++) + { + BufferedImage image = document.getPageImage(n, GraphicsRenderingHints.SCREEN, Page.BOUNDARY_CROPBOX, rotation, scale); + RenderedImage rendImage = image; + try + { + File outFile = new File(createPath); + ImageIO.write(rendImage, "png", outFile); + } + catch (Exception e) + { + Files.deleteFile(createPath); + log.error("作品库文件定时任务:生成缩略图失败" + e); + return false; + } + finally + { + document.dispose(); + } + + image.flush(); + } + + return true; + } + + /** + * 订单模板定稿处理更新模板为定稿模板 + * + * @param designId + * @param mediaId + * @throws Exception + */ + @AnTransaction + public static void doTemplateOrderCompleteExec(long designId, long mediaId) throws Exception + { + // 1.更新模板为定稿模类型 + Updater mUpdater = new Updater(); + mUpdater.addMust("designId", designId); + mUpdater.addMust("mediaId", mediaId); + mUpdater.addField("templateType", 80); + ORM.get(ZTable.class).update(MediaTemplate.class, mUpdater); + + // 2.更新模板为不可编辑状态 + Updater cUpdater = new Updater(); + cUpdater.addMust("mediaId", mediaId); + cUpdater.addField("isEdit", 1); // 不可编辑 + cUpdater.addField("updateTime", DateTimes.getDateTimeString()); + ORM.get(ZTable.class).update(MediaCanvas.class, cUpdater); + } + + /** + * 获取模板对象 + * + * @param mediaId + * @return + * @throws Exception + */ + public static List getTemplateViewList(List allList) throws Exception + { + List mediaList = new ArrayList();// 组装新的模板对象 + for (Long mediaId : allList) + { + Selector selector = new Selector(); + selector.addMust("mediaId", mediaId); + MediaTemplateView media = ORM.get(ZView.class).item(MediaTemplateView.class, selector); + if (media == null) + { + continue; + } + + mediaList.add(media); + } + + return mediaList; + } + + /** + * 获取模板事件对象 + * + * @param mediaId + * @return + * @throws Exception + */ + public static DesTemplateEventView getTemplateEventView(long mediaId) throws Exception + { + DesTemplateEventView media = ORM.get(ZView.class).item(DesTemplateEventView.class, new Selector("mediaId", mediaId)); + if (media == null) + { + return null; + } + + return media; + } + + /** + * 获取收藏模板对象ID + * + * @param mediaId + * @return + * @throws Exception + */ + public static long getTemplateEventId(long mediaId) throws Exception + { + DesTemplateEventView media = ORM.get(ZView.class).item(DesTemplateEventView.class, new Selector("mediaId", mediaId)); + if (media == null) + { + return 0L; + } + + return media.getMediaId(); + } + + /** + * 判断solr返回的模板对象 + * + * @param templateList + * @param mediaId + * @return + * @throws Exception + */ + public static List isSearchResult(List templateList, long mediaId) throws Exception + { + List mediaList = new ArrayList(); + if (!templateList.isEmpty()) + { + for (MediaTemplateView temp : templateList) + { + if (temp.getMediaId() == mediaId) + { + mediaList.add(temp); + } + } + } + + return mediaList; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/TemplateOrderDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/TemplateOrderDao.java new file mode 100644 index 0000000..dc3b487 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/TemplateOrderDao.java @@ -0,0 +1,54 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dao; + +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.keyword.DesKeywordIndex; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateOrder; + +/** + * 订单模板Dao + * + * @version v1.0.0 @author Deng 2018-3-24 新建与整理 + */ +public class TemplateOrderDao +{ + /** + * 获取模板初稿次数 + * @param mediaId + * @throws Exception + */ + public static int getTemplateDraftNum(long mediaId)throws Exception + { + int count = ORM.get(ZTable.class).count(DesTemplateOrder.class, new Selector("mediaId", mediaId)); + + return count; + } + + /** + * 获取模板分数 + * @param mediaId + * @return + * @throws Exception + */ + public static int getTemplateScore(long mediaId)throws Exception + { + DesKeywordIndex index = ORM.get(ZTable.class).item(DesKeywordIndex.class, mediaId); + if (index == null) + return 0; + + return index.getMediaScore(); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/TemplateScoreDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/TemplateScoreDao.java new file mode 100644 index 0000000..6bc8d51 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/TemplateScoreDao.java @@ -0,0 +1,262 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dao; + +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.dbo.keyword.DesKeywordIndex; +import com.zhiqim.yangcai.design.dbo.score.DesScoreParam; +import com.zhiqim.yangcai.design.dbo.score.DesScoreWeight; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateScore; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateScoreLog; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.util.SolrUtil; + +/** + * 模板评分Dao + * + * @version v1.0.0 @author Deng 2018-3-5 新建与整理 + */ +public class TemplateScoreDao +{ + /** + * 模板基础分数计算 + * + * @param mediaId + * @param paramKey + * @throws Exception + */ + @AnTransaction + public static void doTempalteBaseScore(long mediaId) throws Exception + { + Selector selector = new Selector(); + selector.addMust("scoreName", ScoreConstants.SCORE_TEMPLATE); + selector.addMust("scoreType", ScoreConstants.BASE_SCORE.value()); + DesScoreWeight weight = ORM.get(ZTable.class).item(DesScoreWeight.class, selector); + if (weight == null) + return; + + DesTemplateScore score = ORM.get(ZTable.class).item(DesTemplateScore.class, mediaId); + if (score == null) + { + score = new DesTemplateScore(); + score.setMediaId(mediaId); + score.setBaseScore(weight.getScoreValue()); + ORM.get(ZTable.class).insert(score); + + doTemplateScoreCalc(mediaId);// 计算模板分数 + } + } + + /** + * 模板动态分计算 + * + * @param mediaId + * @throws Exception + */ + @AnTransaction + public static void doTemplateFloatScore(long mediaId, String paramKey) throws Exception + { + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (media == null) + return; + + if (media.getTemplateType() < 100) + { + // 更新solr模板 + SolrUtil.updateMediaData(mediaId); + return; + } + + Selector selector = new Selector(); + selector.addMust("scoreName", ScoreConstants.SCORE_TEMPLATE); + selector.addMust("scoreType", ScoreConstants.FLOAT_SCORE.value()); + selector.addMust("paramKey", paramKey); + DesScoreParam param = ORM.get(ZTable.class).item(DesScoreParam.class, selector); + if (param == null) + return; + + int paramValue = param.getParamValue(); + DesTemplateScore score = ORM.get(ZTable.class).item(DesTemplateScore.class, mediaId); + if (score == null) + { + score = new DesTemplateScore(); + score.setMediaId(mediaId); + if (param.getParamType() == 0) + score.setFloatScore(paramValue); + else + score.setFloatScore(-paramValue); + + ORM.get(ZTable.class).insert(score); + } + else + { + Updater sUpdater = new Updater(); + sUpdater.addMust("mediaId", mediaId); + if (param.getParamType() == 0) + {// 加分 + sUpdater.addField("floatScore", score.getFloatScore() + paramValue); + } + else + {// 减分 + if (score.getFloatScore() < 0) + { + int floatScore = Math.abs(score.getFloatScore()) - paramValue; + sUpdater.addField("floatScore", floatScore); + } + else + sUpdater.addField("floatScore", score.getFloatScore() - paramValue); + } + + ORM.get(ZTable.class).update(DesTemplateScore.class, sUpdater); + } + + doTemplateScoreCalc(mediaId); + doDesTemplateScoreLogAdd(mediaId, ScoreConstants.FLOAT_SCORE.value(), param); + + } + + /** + * 模板销量分计算 + * + * @param mediaId + * @throws Exception + */ + @AnTransaction + public static void doTemplateSaleScore(long mediaId, String paramKey) throws Exception + { + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (media == null) + return; + + if (media.getTemplateType() < 100) + { + // 更新solr模板 + SolrUtil.updateMediaData(mediaId); + return; + } + + Selector selector = new Selector(); + selector.addMust("scoreName", ScoreConstants.SCORE_TEMPLATE); + selector.addMust("scoreType", ScoreConstants.SALE_SCORE.value()); + selector.addMust("paramKey", paramKey); + DesScoreParam param = ORM.get(ZTable.class).item(DesScoreParam.class, selector); + if (param == null) + return; + + int paramValue = param.getParamValue(); + DesTemplateScore score = ORM.get(ZTable.class).item(DesTemplateScore.class, mediaId); + if (score == null) + { + score = new DesTemplateScore(); + score.setMediaId(mediaId); + if (param.getParamType() == 0) + score.setSaleScore(paramValue); + else + score.setSaleScore(-paramValue); + + ORM.get(ZTable.class).insert(score); + } + else + { + Updater sUpdater = new Updater(); + sUpdater.addMust("mediaId", mediaId); + if (param.getParamType() == 0) + {// 加分 + sUpdater.addField("floatScore", score.getSaleScore() + paramValue); + } + else + {// 减分 + if (score.getFloatScore() < 0) + { + int saleScore = Math.abs(score.getSaleScore()) - paramValue; + sUpdater.addField("saleScore", saleScore); + } + else + sUpdater.addField("saleScore", score.getSaleScore() - paramValue); + } + + ORM.get(ZTable.class).update(DesTemplateScore.class, sUpdater); + } + + doTemplateScoreCalc(mediaId); + doDesTemplateScoreLogAdd(mediaId, ScoreConstants.SALE_SCORE.value(), param); + } + + /** + * 模板分数计算 + * + * @param mediaId + * @param scoreType + * @throws Exception + */ + @AnTransaction + public static void doTemplateScoreCalc(long mediaId) throws Exception + { + DesTemplateScore score = ORM.get(ZTable.class).item(DesTemplateScore.class, mediaId); + int baseWeight = ScoreDao.doTemplateWeight(ScoreConstants.BASE_SCORE.value()); + int floatWeight = ScoreDao.doTemplateWeight(ScoreConstants.FLOAT_SCORE.value()); + int saleWeight = ScoreDao.doTemplateWeight(ScoreConstants.SALE_SCORE.value()); + + int scoreValue = score.getBaseScore() * baseWeight + score.getFloatScore() * floatWeight + score.getSaleScore() * saleWeight; + + DesKeywordIndex index = ORM.get(ZTable.class).item(DesKeywordIndex.class, mediaId); + if (index == null) + { + index = new DesKeywordIndex(); + index.setMediaId(mediaId); + index.setMediaScore(scoreValue); + + ORM.get(ZTable.class).insert(index); + } + else + { + // 更新数据库模板指数 + Updater update = new Updater(); + update.addMust("mediaId", mediaId); + update.addField("mediaScore", scoreValue); + ORM.get(ZTable.class).update(DesKeywordIndex.class, update); + } + + // 更新solr模板 + SolrUtil.updateMediaData(mediaId); + + } + + /** + * 模板本身分数日志 + * + * @param mediaId + * @param scoreType + * @param param + * @throws Exception + */ + private static void doDesTemplateScoreLogAdd(long mediaId, String scoreType, DesScoreParam param) throws Exception + { + DesTemplateScoreLog log = new DesTemplateScoreLog(); + log.setLogId(Ids.longId()); + log.setMediaId(mediaId); + log.setScoreName(ScoreConstants.SCORE_TEMPLATE); + log.setScoreType(scoreType); + log.setParamType(param.getParamType()); + log.setParamKey(param.getParamKey()); + log.setParamValue(param.getParamValue()); + log.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(log); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/VirtualAccountDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/VirtualAccountDao.java new file mode 100644 index 0000000..14a37d5 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/VirtualAccountDao.java @@ -0,0 +1,224 @@ +package com.zhiqim.yangcai.design.dao; + +import java.sql.Timestamp; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.ProductConvertCache; +import com.zhiqim.yangcai.design.dbo.account.VirtualAccount; +import com.zhiqim.yangcai.design.dbo.account.VirtualAccountDetails; +import com.zhiqim.yangcai.design.dbo.account.VirtualAccountTransactionView; +import com.zhiqim.yangcai.design.dbo.account.VirtualTransactionDetails; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.stat.DesignerOrderPerformanceStat; + +/** + * + * [简要描述]:设计师虚拟账户Dao
            + * [详细描述]:
            + * + * @version 1.0 @author hc 2021年6月17日 新建与整理 + */ +@AnAlias("VirtualAccountDao") +public class VirtualAccountDao +{ + private static final Log log = LogFactory.getLog(VirtualAccountDao.class); + + /** + * + * [简要描述]:设计师虚拟账户交易 + * [详细描述]:
            + * + * @author hc + * @param virtualAccountTransactionView + * @throws Exception + */ + public static boolean VirtualAccountTransactionDetails(VirtualAccountTransactionView virtualAccountTransactionView) throws Exception + { + VirtualAccount item = ORM.get(ZTable.class).item(VirtualAccount.class, + new Selector().addMaybe("operatorCode", virtualAccountTransactionView.getOperatorCode())); + + long usableMoney = 0L; + long freezeMoney = 0L; + // 设计师虚拟账户不存在则创建 + if (item == null) + { + VirtualAccount virtualAccount = new VirtualAccount(); + virtualAccount.setOperatorCode(virtualAccountTransactionView.getOperatorCode()); + virtualAccount.setOperatorStatus(1); + ORM.get(ZTable.class).insert(virtualAccount); + + usableMoney = virtualAccountTransactionView.getUsableMoneyAdd() + virtualAccountTransactionView.getUsableMoneyDown(); + freezeMoney = virtualAccountTransactionView.getFreezeMoneyAdd() + virtualAccountTransactionView.getFreezeMoneyDown(); + } + else + { + usableMoney = item.getUsableMoney() + virtualAccountTransactionView.getUsableMoneyAdd() + virtualAccountTransactionView.getUsableMoneyDown(); + freezeMoney = item.getFreezeMoney() + virtualAccountTransactionView.getFreezeMoneyAdd() + virtualAccountTransactionView.getFreezeMoneyDown(); + } + // 设计师账户停用 + if (Validates.isNotEmpty(item) && item.getOperatorStatus() == 2) + { + log.info("设计师【" + virtualAccountTransactionView.getOperatorCode() + "】同步虚拟账户资金失败,该设计师账户已停用"); + return false; + } + + VirtualAccountDetails virtualAccountDetails = new VirtualAccountDetails(); + VirtualTransactionDetails virtualTransactionDetails = new VirtualTransactionDetails(); + + // 同步虚拟账户表 + Updater virtualAccountUpdater = new Updater(); + virtualAccountUpdater.addMust("operatorCode", virtualAccountTransactionView.getOperatorCode()); + virtualAccountUpdater.addField("usableMoney", usableMoney); + virtualAccountUpdater.addField("freezeMoney", freezeMoney); + virtualAccountUpdater.addField("sumMoney", usableMoney + freezeMoney); + ORM.get(ZTable.class).update(VirtualAccount.class, virtualAccountUpdater); + + // 同步虚拟账户明细表 + virtualAccountDetails.setOperatorCode(virtualAccountTransactionView.getOperatorCode()); + virtualAccountDetails.setAccountBlotter(virtualAccountTransactionView.getAccountBlotter()); + virtualAccountDetails.setTransactionBlotter(virtualAccountTransactionView.getAccountTransactionBlotter()); + virtualAccountDetails.setTransactionStatus(virtualAccountTransactionView.getAccountTransactionStatus()); + virtualAccountDetails.setUsableMoneyAdd(virtualAccountTransactionView.getUsableMoneyAdd()); + virtualAccountDetails.setUsableMoneyDown(virtualAccountTransactionView.getUsableMoneyDown()); + virtualAccountDetails.setFreezeMoneyAdd(virtualAccountTransactionView.getFreezeMoneyAdd()); + virtualAccountDetails.setFreezeMoneyDown(virtualAccountTransactionView.getFreezeMoneyDown()); + virtualAccountDetails.setOperatorTime(virtualAccountTransactionView.getOperatorTime()); + virtualAccountDetails.setUsableMoney(usableMoney); + virtualAccountDetails.setFreezeMoney(freezeMoney); + virtualAccountDetails.setSumMoney(usableMoney + freezeMoney); + ORM.get(ZTable.class).insert(virtualAccountDetails); + + // 同步虚拟交易明细表 + virtualTransactionDetails.setOperatorCode(virtualAccountTransactionView.getOperatorCode()); + virtualTransactionDetails.setDesignId(virtualAccountTransactionView.getDesignId()); + virtualTransactionDetails.setTransactionBlotter(virtualAccountTransactionView.getAccountTransactionBlotter()); + virtualTransactionDetails.setOrderText(virtualAccountTransactionView.getOrderText()); + virtualTransactionDetails.setEndTime(virtualAccountTransactionView.getEndTime()); + virtualTransactionDetails.setTransactionTime(virtualAccountTransactionView.getOperatorTime()); + virtualTransactionDetails.setTransactionStatus(virtualAccountTransactionView.getAccountTransactionStatus()); + virtualTransactionDetails.setOrderMoney(virtualAccountTransactionView.getOrderMoney()); + ORM.get(ZTable.class).insert(virtualTransactionDetails); + + return true; + } + + /** + * + * [简要描述]:
            + * [详细描述]:
            + * + * @author hc + * @param order + * @return + * @throws Exception + */ + public static boolean finishDesign(DesignSelfView order, String operatorCode, int status) throws Exception + { + Global.get(ProductConvertCache.class).doRefresh(); + VirtualAccountTransactionView virtualAccountTransactionView = new VirtualAccountTransactionView(); + + Timestamp endTime = Sqls.nowTimestamp(); + + long designPrice = 0L; + if (order.getDesignPrice() == 0) + { + designPrice = StatDao.calculateOrderPerformance(order); + ORM.get(ZTable.class).update(DesignOrder.class, new Updater().addMust("designId", order.getDesignId()).addField("designPrice", designPrice)); + } + else + { + designPrice = order.getDesignPrice(); + } + + if (status == 4)// 完成定稿奖励 + { + if (order.getTypeId() == 2023207561256L)// 电子名片 + { + boolean vCardFinalize = vCardFinalize(order, operatorCode); + if (!vCardFinalize) + { + log.error("设计师:【" + operatorCode + "】,订单:【" + order.getDesignId() + "】电子名片已完成过定稿"); + return false; + } + } + + virtualAccountTransactionView.setAccountTransactionStatus(status); + virtualAccountTransactionView.setFreezeMoneyAdd(designPrice); + virtualAccountTransactionView.setOrderMoney(designPrice); + } + else if (status == 5)// 订单售后 处理 扣除售后金额 + { + DesignAfterOrder designAfterOrder = ORM.get(ZTable.class).item(DesignAfterOrder.class, new Selector().addMust("designId", order.getDesignId())); + if (null == designAfterOrder) + { + return true; + } + long longValue = new Double(designAfterOrder.getLossAmount() * 100).longValue(); + virtualAccountTransactionView.setAccountTransactionStatus(status); + virtualAccountTransactionView.setFreezeMoneyDown(-longValue); + virtualAccountTransactionView.setOrderMoney(-longValue); + } + else if (status == 6)// 订单退回 处理 + { + virtualAccountTransactionView.setAccountTransactionStatus(status); + virtualAccountTransactionView.setFreezeMoneyDown(-designPrice); + virtualAccountTransactionView.setOrderMoney(-designPrice); + } + else if (status == 1)// 订单加急奖励 + { + if (!order.isUrgent()) + { + return true; + } + + virtualAccountTransactionView.setAccountTransactionStatus(status); + virtualAccountTransactionView.setFreezeMoneyAdd(order.getUrgentPrice()); + virtualAccountTransactionView.setOrderMoney(order.getUrgentPrice()); + } + else if (status == 7)// 订单跨月退回 + { + virtualAccountTransactionView.setAccountTransactionStatus(status); + virtualAccountTransactionView.setUsableMoneyDown(-order.getDesignPrice()); + virtualAccountTransactionView.setOrderMoney(-order.getDesignPrice()); + + ORM.get(ZTable.class).delete(DesignerOrderPerformanceStat.class, new Selector("designId", order.getDesignId())); + } + + virtualAccountTransactionView.setAccountBlotter(Ids.longId()); + virtualAccountTransactionView.setOperatorCode(operatorCode); + virtualAccountTransactionView.setOperatorTime(Sqls.nowTimestamp()); + virtualAccountTransactionView.setAccountTransactionBlotter(Ids.longId()); + virtualAccountTransactionView.setDesignId(order.getDesignId()); + virtualAccountTransactionView.setOrderText(order.getOrderText()); + virtualAccountTransactionView.setReceiveTime(order.getDesignReceiveTime()); + virtualAccountTransactionView.setEndTime(endTime); + + boolean result = VirtualAccountDao.VirtualAccountTransactionDetails(virtualAccountTransactionView); + return result; + } + + // 电子名片已定稿过无退回不再记录绩效 + public static boolean vCardFinalize(DesignOrder order, String operatorCode) throws Exception + { + int vtdListCount = ORM.get(ZTable.class).count(VirtualTransactionDetails.class, + new Selector().addMust("operatorCode", operatorCode).addMust("designId", order.getDesignId())); + if (vtdListCount % 2 == 0) + { + return true; + } + return false; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/WhetherMayLeadToDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/WhetherMayLeadToDao.java new file mode 100644 index 0000000..790f9bc --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/WhetherMayLeadToDao.java @@ -0,0 +1,146 @@ +/** + * 扬彩印刷设计 + * 文件名 :WhetherAllowLeadToDao.java + * 创建人 :高佳新 + * 创建时间:2019-8-2 + */ + +package com.zhiqim.yangcai.design.dao; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/*** + * + * 设计智能平台操作权限判断 + * + * @version 1.0 @author gjx 2019-8-2 新建与整理 + */ +@AnAlias("WhetherMayLeadToDao") +public class WhetherMayLeadToDao +{ + /** + * + * 区分用户设计操作权限 + * + * @author gjx + * @param request + * @param sessionName 用户名(登录账号) + * @param designer 设计师 + */ + public static void ergodicOpecoterCode(HttpRequest request, String sessionName, DesignOrder order) throws Exception + { + + ZmrOperator zmrOperator = ORM.get(ZTable.class).item(ZmrOperator.class, new Selector().addMust("operatorCode", sessionName)); + if (zmrOperator == null) + { + request.returnHistory("该用户不存在"); + return; + } + + if (zmrOperator.getOperatorType() == 2 && zmrOperator.getOrgId() != ZmrOrgDao.getOrgRootId(request)) + { + // 判定是否是部门管理人 + StringBuffer isDeptManagerSql = new StringBuffer(); + isDeptManagerSql.append("select * from zmr_dept where DEPT_MANAGER = '"); + isDeptManagerSql.append(sessionName); + isDeptManagerSql.append("' or FIND_IN_SET('"); + isDeptManagerSql.append(sessionName); + isDeptManagerSql.append("',DEPT_SUB_MANAGER)"); + List listDept = ORM.get(ZSQL.class).executeQuery(isDeptManagerSql.toString(), ZmrDept.class); + boolean isDeptManager = null != listDept && listDept.size() > 0; + // 不是部门管理员 + if (!isDeptManager) + { + if (!(order.getDesigner().equals(sessionName) || order.getTypeSetAuditor().equals(sessionName))) + {// 操作员不是设计师则不允许初稿 + request.setResponseError("订单设计师是:" + order.getDesigner() + ",您无法操作"); + return; + } + } + // 是部门管理员 + else if (isDeptManager) + { + // 递归所有子部门 + List newDeptList = new ArrayList<>(listDept); + for (ZmrDept zmrDept : listDept) + { + ergodicAllDept(zmrDept, newDeptList); + } + // 查询部门人员 + StringBuffer deptOperatorSql = new StringBuffer(); + deptOperatorSql.append("select * from ZMR_OPERATOR where 1=1 AND ("); + for (ZmrDept zmrDept : newDeptList) + { + deptOperatorSql.append(" FIND_IN_SET("); + deptOperatorSql.append(zmrDept.getDeptId()); + deptOperatorSql.append(",OPERATOR_DEPT) "); + deptOperatorSql.append("OR"); + } + deptOperatorSql.delete(deptOperatorSql.length() - 2, deptOperatorSql.length()); + deptOperatorSql.append(" ) "); + List oplist = ORM.get(ZSQL.class).executeQuery(deptOperatorSql.toString(), ZmrOperator.class); + List operatorList = new ArrayList<>(); + for (int i = 0; i < oplist.size(); i++) + { + operatorList.add(oplist.get(i).getOperatorCode()); + } + if (!operatorList.contains(order.getDesigner())) + {// 设计师不是部门负责下的人 + request.setResponseError("订单设计师是:" + order.getDesigner() + ",不属于您管理的部门"); + return; + } + } + } + } + + /** + * 递归所有子部门 + * + * @param dept + * @param list + */ + public static void ergodicAllDept(ZmrDept dept, List list) + { + if (null == dept || dept.getDeptId() <= 0 || null == list) + { + return; + } + StringBuffer sb = new StringBuffer("select * from zmr_dept where parent_id = "); + sb.append(dept.getDeptId()); + try + { + List oplist = ORM.get(ZSQL.class).executeQuery(sb.toString(), ZmrDept.class); + for (ZmrDept zmrDept : oplist) + { + if (!list.contains(zmrDept)) + { + list.add(zmrDept); + } + } + } + catch (ORMException e) + { + e.printStackTrace(); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/WorksDao.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/WorksDao.java new file mode 100644 index 0000000..3852bc8 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/dao/WorksDao.java @@ -0,0 +1,27 @@ +package com.zhiqim.yangcai.design.dao; + +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Str; + +public class WorksDao +{ + /***/ + public static final String WORK_PREFIX = "works"; + public static final Str WORK_THUMB = new Str("thumb", "作品缩略图"); + public static final Str WORK_END = new Str("endFile", "作品文件"); + public static final Str WORK_DESIGN = new Str("designFile", "作品源文件"); + public static final Str WORK_MATERIAL = new Str("material", "作品素材文件"); + public static final Str WORK_MATERIAL_THUMB = new Str("material/thumb", "作品素材缩略图"); + + public static String getWorksOssFilekey(Str modul, String fileName) + { + String module = modul == null ? "" : Strings.trim(modul.value()); + String fileKey = Strings.addEndsWith(WORK_PREFIX, "/"); + fileKey = fileKey + Strings.addEndsWith(DateTimes.getDateTime8String(), "/"); + fileKey = Validates.isEmptyBlank(module) ? fileKey : fileKey + Strings.addEndsWith(Strings.trimLeft(module, "/"), "/"); + fileKey = fileKey + fileName; + return fileKey; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/BackLogWorkAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/BackLogWorkAction.java new file mode 100644 index 0000000..dfc54d4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/BackLogWorkAction.java @@ -0,0 +1,131 @@ +/** + * 扬彩印刷设计 + * 文件名 :BackLogWorkAction.java + * 创建人 :gjx + * 创建时间:2020年8月15日 +*/ + +package com.zhiqim.yangcai.design.messagebox; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrderMessage; + +/** + * + * [简要描述] 待办事项:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年8月15日 新建与整理 + */ +public class BackLogWorkAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 10); + + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + int day = DateTimes.compareDay(endDate, startDate); + if (day > 365) + { + request.setResponseError("请勿将时间区间跨度选择大于一年"); + return; + } + + String consumerCode = request.getParameter("consumerCode"); + + boolean steer = false; + List operatorList = new ArrayList(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + String operatorCode = sessionUser.getOperatorCode(); + String[] consumerCodes = {}; + if (sessionUser.isAdmin()) + { + steer = true; + operatorList = ZmrOperatorDao.getOperatorAll(request); + } + else + { + List deptList = ZmrBootstrap.table(request).list(ZmrDept.class, + new Selector().addOr(new Selector().addMust("deptManager", operatorCode).addMustLike("deptSubManager", operatorCode))); + if (!deptList.isEmpty()) + { + steer = true; + operatorList = OperatorDao.getDeptOperatorList(request, operatorCode, true); + consumerCodes = new String[operatorList.size()]; + for (int i = 0; i < operatorList.size(); i++) + { + consumerCodes[i] = operatorList.get(i).getOperatorCode(); + } + } + } + + Selector selector = new Selector(); + selector.addMaybe("id", request.getParameterLong("id")); + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("buyerNick", request.getParameter("buyerNick")); + selector.addMaybe("consumerCode", steer ? consumerCode : operatorCode); + if (steer && Validates.isNotEmpty(consumerCodes)) + {// 管理员 + selector.addMustIn("consumerCode", consumerCodes); + } + selector.addMaybe("topic", request.getParameter("topic")); + selector.addMaybe("consumerState", request.getParameterInt("consumerState")); + selector.addMustThenGE("createTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMustThenLE("createTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addOrderbyAsc("consumerState"); + selector.addOrderbyAsc("createTime"); + + PageResult pageResult = ORM.get(ZTable.class).page(OrderMessage.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + + Map ordMap = new HashMap(); + List designIdList = new ArrayList(); + for (OrderMessage message : pageResult.list()) + { + designIdList.add(message.getDesignId()); + } + if (designIdList.size() > 0) + { + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, + new Selector().addMustInLong("designId", Arrays.toArrayLong(designIdList))); + for (DesignOrder ord : orderList) + { + ordMap.put(ord.getDesignId(), ord); + } + } + + request.setAttribute("pageResult", pageResult); + request.setAttribute("operatorList", operatorList); + request.setAttribute("ordMap", ordMap); + request.setAttribute("startDate", startDate); + request.setAttribute("endDate", endDate); + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/CusumerThreads.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/CusumerThreads.java new file mode 100644 index 0000000..f154932 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/CusumerThreads.java @@ -0,0 +1,110 @@ +package com.zhiqim.yangcai.design.messagebox; + +import java.util.List; + +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.zhiqim.httpd.HttpWebsocketConnection; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +import yangcai.messagebox.model.MessageBusi; + +@AnAlias("CusumerThreads") +public class CusumerThreads extends Thread +{ + private static final Log log = LogFactory.getLog(CusumerThreads.class); + + // 启动多线程。 + static + { + // new CusumerThreads().start(); + } + + @Override + public void run() + { + log.info("消息消费线程CusumerThreads-线程名称:" + this.getName() + "开始运行。。。。。。。。。。"); + do + { + try + { + /* + * String beginTime = Urls.encodeUTF8(DateTimes.getPreviousDateString(3) + + * " 00:00:00"); String endTime = Urls.encodeUTF8(DateTimes.getDateString() + + * " 23:59:59"); + * + * CloseableHttpClient httpclient = HttpClients.createDefault(); HttpGet get = + * new HttpGet(BusinessPlatformClientUtil.GATE_WAY_URL + + * "api-busi/messageBusi/list?consumerPlatformType=" + + * Global.getString("message-box", "sysCode") + + * "&state=1&page=1&limit=100&beginTime=" + beginTime + "&endTime=" + endTime); + * get.setHeader("Authorization", "bearer " + + * BusinessPlatformClientUtil.getAccessToken()); org.apache.http.HttpResponse + * resultRep = httpclient.execute(get); int statusCode = + * resultRep.getStatusLine().getStatusCode(); List messages = null; + * if (statusCode == 200) { String resultString = + * EntityUtils.toString(resultRep.getEntity()); JSONObject jsonObject = + * JSONObject.parseObject(resultString); int total = + * jsonObject.getIntValue("count"); // 没有消息 if (total == 0) { + * Thread.sleep(60000);// 1分钟执行一次 continue; } JSONArray array = + * jsonObject.getJSONArray("data"); messages = + * array.toJavaList(MessageBusi.class); } else { // 查询失败 try { + * Thread.sleep(60000);// 遇到错误,就1分钟后再次重试。 continue; } catch + * (InterruptedException e1) { log.error(e1.getMessage(), e1); } } + * + * log.info("消息消费线程CusumerThreads-线程名称:" + Thread.currentThread().getName() + + * ": 收到消息!"); + * + * // 有消息的情况 StringBuffer tempIds = new StringBuffer(); for (MessageBusi message + * : messages) { tempIds.append(message.getId()); tempIds.append(","); } if + * (Validates.isEmptyBlank(tempIds.toString())) { return; } + * tempIds.deleteCharAt(tempIds.length() - 1); + * + * // 告知busi已经接收到 HttpPost post = new + * HttpPost(BusinessPlatformClientUtil.GATE_WAY_URL + + * "api-busi/messageBusi/consumeMessage?ids=" + tempIds); + * post.setHeader("Authorization", "bearer " + + * BusinessPlatformClientUtil.getAccessToken()); resultRep = + * httpclient.execute(post); statusCode = + * resultRep.getStatusLine().getStatusCode(); if (statusCode == 200) { + * log.info("更新消息消费状态成功"); } else { log.error("更新消息消费状态失败(非重要)"); } + * + * // 通过Websocket发送到前端 for (MessageBusi message : messages) { ZqmLoginUser user + * = ZqmMessageUtil.getUserById(message.getConsumerPlatformType(), + * message.getConsumerOperateType(), message.getConsumerOperateCode()); + * JSONArray array = new JSONArray(); JSONObject obj = (JSONObject) + * JSON.toJSON(message); array.add(obj); if (user != null && + * user.hasConnections()) { for (HttpWebsocketConnection connection : + * user.getConnections()) { connection.send(array.toJSONString()); } } } + * Thread.sleep(60000);// 1分钟执行一次 + */ } + catch (Throwable e) + { + log.error(e.getMessage(), e); + try + { + Thread.sleep(60000);// 遇到错误,就1分钟后再次重试。 + } + catch (InterruptedException e1) + { + log.error(e1.getMessage(), e1); + } + } + } + while (true); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/MessageAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/MessageAction.java new file mode 100644 index 0000000..4502493 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/MessageAction.java @@ -0,0 +1,169 @@ +package com.zhiqim.yangcai.design.messagebox; + +import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.constants.HttpConstants; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.model.DersignerOrgOrderView; +import com.zhiqim.yangcai.design.model.MessageBusiModel; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +import yangcai.messagebox.model.MessageBusi; + +/** + * 个人消息盒子(我接收的)查询 + * + * @version v1.0.0 @author yixin 2019-11-12 新建与整理 + */ +public class MessageAction implements Action, ZmrConstants +{ + private static final Log log = LogFactory.getLog(MessageAction.class); + + @SuppressWarnings( + { + "unchecked", "rawtypes" + }) + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt(ZMR_PAGE_SIZE, 20); + String beginTime = request.getParameter("beginTime", DateTimes.getPreviousDateString(3) + " 00:00:00"); + String endTime = request.getParameter("endTime", DateTimes.getDateString() + " 23:59:59"); + String orderId = request.getParameter("orderId", ""); + String state = request.getParameter("state", ""); + String consumerPlatformType = Global.getString("message-box", "sysCode"); + // 消息服务中心个人消息查看接口URL + String busiAddress = BusinessPlatformClientUtil.GATE_WAY_URL + "api-busi/messageBusi/list"; + String consumerOperateCode = sessionUser.getSessionName(); + + CloseableHttpClient httpclient = HttpClients.createDefault(); + URIBuilder uriBuilder = new URIBuilder(busiAddress); + List list = new LinkedList(); + list.add(new BasicNameValuePair("access_token", BusinessPlatformClientUtil.getAccessToken())); + list.add(new BasicNameValuePair("page", String.valueOf(page))); + list.add(new BasicNameValuePair("limit", String.valueOf(pageSize))); + list.add(new BasicNameValuePair("beginTime", beginTime)); + list.add(new BasicNameValuePair("endTime", endTime)); + list.add(new BasicNameValuePair("consumerPlatformType", consumerPlatformType)); + list.add(new BasicNameValuePair("consumerOperateCode", consumerOperateCode)); + list.add(new BasicNameValuePair("consumerOperateType", "1")); + list.add(new BasicNameValuePair("orderId", orderId)); + list.add(new BasicNameValuePair("state", state)); + uriBuilder.setParameters(list); + HttpGet get = new HttpGet(uriBuilder.build()); + PageResult result = null; + Class pageResultclass = PageResult.class; + Constructor constructor = pageResultclass.getDeclaredConstructor(new Class[] + { + int.class, int.class, int.class, List.class + }); + constructor.setAccessible(true); + try + { + HttpResponse resultRep = httpclient.execute(get); + int statusCode = resultRep.getStatusLine().getStatusCode(); + if (statusCode == HttpConstants._200_OK_) + { + String resultString = EntityUtils.toString(resultRep.getEntity()); + JSONObject jsonObject = JSONObject.parseObject(resultString); + int total = jsonObject.getIntValue("count"); + JSONArray array = jsonObject.getJSONArray("data"); + List data = array.toJavaList(MessageBusiModel.class); + List oidList = new ArrayList<>(); + for (MessageBusiModel messageBusiModel : data) + { + if (Validates.isNotEmpty(messageBusiModel.getOrderId())) + { + oidList.add(Long.parseLong(messageBusiModel.getOrderId())); + } + } + + if (Validates.isNotEmpty(oidList)) + { + List dersignerOrgOrderViews = ORM.get(ZView.class).list(DersignerOrgOrderView.class, + new Selector().addMustInLong("designId", Arrays.toArrayLong(oidList))); + for (DersignerOrgOrderView view : dersignerOrgOrderViews) + { + for (int i = 0; i < data.size(); i++) + { + if (data.get(i).getOrderId().equals(Strings.toString(view.getDesignId()))) + { + data.get(i).setDesignerCode(view.getDesigner()); + data.get(i).setDesignerName(view.getDesignerName()); + data.get(i).setDesignerOrgId(view.getDesignerOrgId()); + data.get(i).setDesignerOrgName(view.getDesignerOrgName()); + data.get(i).setOrderStatus(Strings.toString(view.getStatus())); + data.get(i).setOrderStatusName(StatusConstants.getOrderStatusItem(view.getStatus()).desc()); + } + } + } + } + + result = (PageResult) constructor.newInstance(new Object[] + { + total, page, pageSize, data + }); + result.addConditionMap(request.getParameterMap()); + request.setAttribute("result", result); + request.setAttribute("startTime", beginTime); + request.setAttribute("endTime", endTime); + request.setAttribute("orderId", orderId); + } + else + { + log.error("操作员【" + consumerOperateCode + "】查询消息(我接收的)调用接口HTTP错误,错误码[" + statusCode + "]"); + result = (PageResult) constructor.newInstance(new Object[] + { + 0, page, pageSize, null + }); + } + } + catch (Exception e) + { + log.error("操作员【" + consumerOperateCode + "】个人消息中心(我接收的)查询异常", e); + result = (PageResult) constructor.newInstance(new Object[] + { + 0, page, pageSize, null + }); + } + + result.addConditionMap(request.getParameterMap()); + request.setAttribute("result", result); + request.setAttribute("startTime", beginTime); + request.setAttribute("endTime", endTime); + request.setAttribute("orderId", orderId); + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/MessageFromMeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/MessageFromMeAction.java new file mode 100644 index 0000000..21d7d64 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/MessageFromMeAction.java @@ -0,0 +1,169 @@ +package com.zhiqim.yangcai.design.messagebox; + +import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.constants.HttpConstants; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.model.DersignerOrgOrderView; +import com.zhiqim.yangcai.design.model.MessageBusiModel; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +import yangcai.messagebox.model.MessageBusi; + +/** + * 个人消息盒子(我发送的)查询 + * + * @version v1.0.0 @author jiangbin 2020-5-6 新建与整理 + */ +public class MessageFromMeAction implements Action, ZmrConstants +{ + private static final Log log = LogFactory.getLog(MessageFromMeAction.class); + + @SuppressWarnings( + { + "unchecked", "rawtypes" + }) + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt(ZMR_PAGE_SIZE, 20); + String beginTime = request.getParameter("beginTime", DateTimes.getPreviousDateString(3) + " 00:00:00"); + String endTime = request.getParameter("endTime", DateTimes.getDateString() + " 23:59:59"); + String orderId = request.getParameter("orderId", ""); + String state = request.getParameter("state", ""); + String producerPlatformType = Global.getString("message-box", "sysCode"); + // 消息服务中心个人消息查看接口URL + String busiAddress = BusinessPlatformClientUtil.GATE_WAY_URL + "api-busi/messageBusi/list"; + String producerOperateCode = sessionUser.getSessionName(); + + CloseableHttpClient httpclient = HttpClients.createDefault(); + URIBuilder uriBuilder = new URIBuilder(busiAddress); + List list = new LinkedList(); + list.add(new BasicNameValuePair("access_token", BusinessPlatformClientUtil.getAccessToken())); + list.add(new BasicNameValuePair("page", String.valueOf(page))); + list.add(new BasicNameValuePair("limit", String.valueOf(pageSize))); + list.add(new BasicNameValuePair("beginTime", beginTime)); + list.add(new BasicNameValuePair("endTime", endTime)); + list.add(new BasicNameValuePair("producerPlatformType", producerPlatformType)); + list.add(new BasicNameValuePair("producerOperateCode", producerOperateCode)); + list.add(new BasicNameValuePair("producerOperateType", "1")); + list.add(new BasicNameValuePair("orderId", orderId)); + list.add(new BasicNameValuePair("state", state)); + uriBuilder.setParameters(list); + HttpGet get = new HttpGet(uriBuilder.build()); + PageResult result = null; + Class pageResultclass = PageResult.class; + Constructor constructor = pageResultclass.getDeclaredConstructor(new Class[] + { + int.class, int.class, int.class, List.class + }); + constructor.setAccessible(true); + try + { + HttpResponse resultRep = httpclient.execute(get); + int statusCode = resultRep.getStatusLine().getStatusCode(); + if (statusCode == HttpConstants._200_OK_) + { + String resultString = EntityUtils.toString(resultRep.getEntity()); + JSONObject jsonObject = JSONObject.parseObject(resultString); + int total = jsonObject.getIntValue("count"); + JSONArray array = jsonObject.getJSONArray("data"); + List data = array.toJavaList(MessageBusiModel.class); + List oidList = new ArrayList<>(); + for (MessageBusiModel messageBusiModel : data) + { + if (Validates.isNotEmpty(messageBusiModel.getOrderId())) + { + oidList.add(Long.parseLong(messageBusiModel.getOrderId())); + } + } + + if (Validates.isNotEmpty(oidList)) + { + List dersignerOrgOrderViews = ORM.get(ZView.class).list(DersignerOrgOrderView.class, + new Selector().addMustInLong("designId", Arrays.toArrayLong(oidList))); + for (DersignerOrgOrderView view : dersignerOrgOrderViews) + { + for (int i = 0; i < data.size(); i++) + { + if (data.get(i).getOrderId().equals(Strings.toString(view.getDesignId()))) + { + data.get(i).setDesignerCode(view.getDesigner()); + data.get(i).setDesignerName(view.getDesignerName()); + data.get(i).setDesignerOrgId(view.getDesignerOrgId()); + data.get(i).setDesignerOrgName(view.getDesignerOrgName()); + data.get(i).setOrderStatus(Strings.toString(view.getStatus())); + data.get(i).setOrderStatusName(StatusConstants.getOrderStatusItem(view.getStatus()).desc()); + } + } + } + } + + result = (PageResult) constructor.newInstance(new Object[] + { + total, page, pageSize, data + }); + result.addConditionMap(request.getParameterMap()); + request.setAttribute("result", result); + request.setAttribute("startTime", beginTime); + request.setAttribute("endTime", endTime); + request.setAttribute("orderId", orderId); + } + else + { + log.error("操作员【" + producerOperateCode + "】查询消息(我发送的)调用接口HTTP错误,错误码[" + statusCode + "]"); + result = (PageResult) constructor.newInstance(new Object[] + { + 0, page, pageSize, null + }); + } + } + catch (Exception e) + { + log.error("操作员【" + producerOperateCode + "】个人消息中心(我发送的)查看异常", e); + result = (PageResult) constructor.newInstance(new Object[] + { + 0, page, pageSize, null + }); + } + + result.addConditionMap(request.getParameterMap()); + request.setAttribute("result", result); + request.setAttribute("startTime", beginTime); + request.setAttribute("endTime", endTime); + request.setAttribute("orderId", orderId); + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/NoticeAction.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/NoticeAction.java new file mode 100644 index 0000000..24a7b11 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/NoticeAction.java @@ -0,0 +1,117 @@ +package com.zhiqim.yangcai.design.messagebox; + +import java.lang.reflect.Constructor; +import java.util.LinkedList; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.constants.HttpConstants; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.manager.ZmrConstants; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.design.model.NoticeModel; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +import yangcai.messagebox.model.MessageBusi; + +/** + * 公告查询 + * + * @version v1.0.0 @author yixin 2019-11-12 新建与整理 + */ +public class NoticeAction implements Action, ZmrConstants +{ + private static final Log log = LogFactory.getLog(NoticeAction.class); + + @SuppressWarnings( + { + "unchecked", "rawtypes" + }) + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt(ZMR_PAGE_SIZE, 20); + String gtReleaseTime = "1"; + String isOffline = "1"; + String state = "1"; + String consumerPlatformType = Global.getString("message-box", "sysCode"); + // 消息服务中心个人消息查看接口URL + String busiAddress = BusinessPlatformClientUtil.GATE_WAY_URL + "api-conf/notice/list"; + + CloseableHttpClient httpclient = HttpClients.createDefault(); + URIBuilder uriBuilder = new URIBuilder(busiAddress); + List list = new LinkedList(); + list.add(new BasicNameValuePair("access_token", BusinessPlatformClientUtil.getAccessToken())); + list.add(new BasicNameValuePair("page", String.valueOf(page))); + list.add(new BasicNameValuePair("limit", String.valueOf(pageSize))); + list.add(new BasicNameValuePair("noticeObject", consumerPlatformType)); + list.add(new BasicNameValuePair("gtReleaseTime", gtReleaseTime)); + list.add(new BasicNameValuePair("isOffline", isOffline)); + list.add(new BasicNameValuePair("state", state)); + uriBuilder.setParameters(list); + HttpGet get = new HttpGet(uriBuilder.build()); + PageResult result = null; + Class pageResultclass = PageResult.class; + Constructor constructor = pageResultclass.getDeclaredConstructor(new Class[] + { + int.class, int.class, int.class, List.class + }); + constructor.setAccessible(true); + try + { + HttpResponse resultRep = httpclient.execute(get); + int statusCode = resultRep.getStatusLine().getStatusCode(); + if (statusCode == HttpConstants._200_OK_) + { + String resultString = EntityUtils.toString(resultRep.getEntity()); + JSONObject jsonObject = JSONObject.parseObject(resultString); + int total = jsonObject.getIntValue("count"); + JSONArray array = jsonObject.getJSONArray("data"); + List data = array.toJavaList(NoticeModel.class); + + result = (PageResult) constructor.newInstance(new Object[] + { + total, page, pageSize, data + }); + result.addConditionMap(request.getParameterMap()); + request.setAttribute("result", result); + } + else + { + log.error("查询运营平台公告调用接口HTTP错误,错误码[" + statusCode + "]"); + result = (PageResult) constructor.newInstance(new Object[] + { + 0, page, pageSize, null + }); + } + } + catch (Exception e) + { + log.error("查询运营平台公告调用接口HTTP查询异常", e); + result = (PageResult) constructor.newInstance(new Object[] + { + 0, page, pageSize, null + }); + } + + result.addConditionMap(request.getParameterMap()); + request.setAttribute("result", result); + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmLoginUser.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmLoginUser.java new file mode 100644 index 0000000..6a0a8b4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmLoginUser.java @@ -0,0 +1,75 @@ +package com.zhiqim.yangcai.design.messagebox; + +import java.util.List; +import org.zhiqim.httpd.HttpWebsocketConnection; + +public class ZqmLoginUser +{ + private String sysCode; + private int userType; + private String userId; + private List connections; + + public ZqmLoginUser(String sysCode, int userType, String userId, List connections) + { + this.sysCode = sysCode; + this.userType = userType; + this.userId = userId; + this.connections = connections; + } + + public void destroyConnection(HttpWebsocketConnection connection) + { + if (connections != null && !connections.isEmpty() && connections.contains(connection)) + { + connection.close(); + connections.remove(connection); + } + } + + public String getSysCode() + { + return sysCode; + } + + public void setSysCode(String sysCode) + { + this.sysCode = sysCode; + } + + public String getUserId() + { + return userId; + } + + public List getConnections() + { + return connections; + } + + public boolean hasConnections() + { + return connections != null && !connections.isEmpty(); + } + + public int getUserType() + { + return userType; + } + + public void setUserType(int userType) + { + this.userType = userType; + } + + public void setUserId(String userId) + { + this.userId = userId; + } + + public void setConnections(List connections) + { + this.connections = connections; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageBoxMQConsumerFactory.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageBoxMQConsumerFactory.java new file mode 100644 index 0000000..5553b16 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageBoxMQConsumerFactory.java @@ -0,0 +1,34 @@ +package com.zhiqim.yangcai.design.messagebox; + +import java.util.concurrent.ConcurrentHashMap; +import org.zhiqim.kernel.Global; +import com.aliyun.mq.http.MQClient; +import com.aliyun.mq.http.MQConsumer; + +public class ZqmMessageBoxMQConsumerFactory +{ + private static ConcurrentHashMap mqConsumerMap = new ConcurrentHashMap<>(100); + + /** + * 获取MQ消费者 + * + * @param topic + * @return + */ + public static MQConsumer getMQConsumer(String topic) + { + topic = Global.getString("message-box", "sysCode") + "-" + topic; + String mapKey = Global.getString("message-box", "aliyun.instanceId") + "-" + topic + "-" + Global.getString("message-box", "aliyun.groupId"); + MQConsumer consumer = mqConsumerMap.get(mapKey); + if (consumer == null) + { + MQClient mqClient = new MQClient(Global.getString("message-box", "aliyun.namesrvAddr"), Global.getString("message-box", "aliyun.accessKey"), + Global.getString("message-box", "aliyun.secretKey")); + // 获取消费者 + consumer = mqClient.getConsumer(Global.getString("message-box", "aliyun.instanceId"), topic, Global.getString("message-box", "aliyun.groupId"), + null); + mqConsumerMap.put(mapKey, consumer); + } + return consumer; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageBoxMQProducerFactory.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageBoxMQProducerFactory.java new file mode 100644 index 0000000..e1478a3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageBoxMQProducerFactory.java @@ -0,0 +1,36 @@ +package com.zhiqim.yangcai.design.messagebox; + +import org.zhiqim.kernel.Global; + +import com.aliyun.mq.http.MQClient; +import com.aliyun.mq.http.MQProducer; + +import java.util.concurrent.ConcurrentHashMap; + +public class ZqmMessageBoxMQProducerFactory +{ + + private static ConcurrentHashMap mqProducerMap = new ConcurrentHashMap<>(100); + + /** + * 获取MQ生产者 + * + * @param topic + * @return + */ + public static MQProducer getMQProducer(String topic) + { + topic = Global.getString("message-box", "sysCode") + "-" + topic; + + MQProducer producer = mqProducerMap.get(topic); + if (producer == null) + { + MQClient mqClient = new MQClient(Global.getString("message-box", "aliyun.namesrvAddr"), Global.getString("message-box", "aliyun.accessKey"), + Global.getString("message-box", "aliyun.secretKey")); + // 获取Topic的生产者 + producer = mqClient.getProducer(Global.getString("message-box", "aliyun.instanceId"), Global.getString("message-box", "sysCode") + "-" + topic); + mqProducerMap.put(topic, producer); + } + return producer; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageBoxWS.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageBoxWS.java new file mode 100644 index 0000000..339e630 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageBoxWS.java @@ -0,0 +1,155 @@ +package com.zhiqim.yangcai.design.messagebox; + +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.zhiqim.httpd.HttpSession; +import org.zhiqim.httpd.HttpSessionUser; +import org.zhiqim.httpd.HttpWebsocket; +import org.zhiqim.httpd.HttpWebsocketConnection; +import org.zhiqim.httpd.HttpWebsocketMessage; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +@AnAlias("message_box") +public class ZqmMessageBoxWS implements HttpWebsocket +{ + private static final Log log = LogFactory.getLog(ZqmMessageBoxWS.class); + + @Override + public void onOpen(final HttpWebsocketConnection conn) + { + if (!"message_box".equals(conn.getProtocol())) + { + return; + } + HttpSessionUser sessionUser = conn.getSession().getSessionUser(); + if (sessionUser == null) + { + conn.close(); + return; + } + try + { + ZqmMessageUtil.putUserChannel(Global.getString("message-box", "sysCode"), 1, sessionUser.getSessionName(), conn); + } + catch (Exception e1) + { + conn.close(); + log.error("打开消费者失败", e1); + } + + new Thread(new Runnable() + { + + @Override + public void run() + { + try + { + Thread.sleep(1000); + CloseableHttpClient httpclient = HttpClients.createDefault(); + ZqmLoginUser loginUser = ZqmMessageUtil.getUserByChannelId(conn); + if (null == loginUser) + { + log.error("ZqmMessageBoxWS:登录用户为空"); + return; + } + HttpGet get = new HttpGet(BusinessPlatformClientUtil.GATE_WAY_URL + + "api-busi/messageBusi/queryUnReadMessageListWhenLogin?consumerPlatformType=" + loginUser.getSysCode() + "&consumerOperateType=" + + loginUser.getUserType() + "&consumerOperateCode=" + loginUser.getUserId()); + get.setHeader("Authorization", "bearer " + BusinessPlatformClientUtil.getAccessToken()); + org.apache.http.HttpResponse resultRep = httpclient.execute(get); + int statusCode = resultRep.getStatusLine().getStatusCode(); + if (statusCode == 200) + { + JSONArray array = new JSONArray(); + JSONObject obj = JSONObject.parseObject(EntityUtils.toString(resultRep.getEntity())); + // log.info(loginUser.getUserId()+"第一次登陆时查询历史消息Result:"+obj); + array.add(obj); + conn.send(array.toJSONString()); + // log.info(loginUser.getUserId() + "send Success !!"); + } + } + catch (Exception e) + { + // 推送消息失败 + log.error(e.getMessage(), e); + } + } + }).start(); + } + + @Override + public void onClose(HttpWebsocketConnection conn) + { + if (!"message_box".equals(conn.getProtocol())) + { + return; + } + HttpSessionUser sessionUser = conn.getSession().getSessionUser(); + if (sessionUser == null) + { + return; + } + ZqmMessageUtil.removeConnection(conn); + } + + @Override + public void onException(HttpWebsocketConnection conn, Throwable e) + { + if (!"message_box".equals(conn.getProtocol())) + { + return; + } + HttpSessionUser sessionUser = conn.getSession().getSessionUser(); + if (sessionUser == null) + { + return; + } + ZqmMessageUtil.removeConnection(conn); + } + + @Override + public void onMessage(HttpWebsocketConnection conn, String message) + { + if (!"message_box".equals(conn.getProtocol())) + { + return; + } + HttpSession session = conn.getSession(); + HttpSessionUser sessionUser = session.getSessionUser(); + if (sessionUser == null) + { + conn.close(); + return; + } + + conn.send(new HttpWebsocketMessage().buildPong().toBytes()); + } + + @Override + public void onMessage(HttpWebsocketConnection conn, byte[] message) + { + if (!"message_box".equals(conn.getProtocol())) + { + return; + } + HttpSessionUser sessionUser = conn.getSession().getSessionUser(); + if (sessionUser == null) + { + conn.close(); + return; + } + + conn.send(new HttpWebsocketMessage().buildPong().toBytes()); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageProducerHandler.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageProducerHandler.java new file mode 100644 index 0000000..bbb2945 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageProducerHandler.java @@ -0,0 +1,83 @@ +package com.zhiqim.yangcai.design.messagebox; + +import java.net.URLEncoder; +import java.util.Date; +import java.util.HashMap; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.zhiqim.kernel.Global; + +import yangcai.messagebox.model.MessageBusi; +import yangcai.messagebox.model.MessageResult; + +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +public class ZqmMessageProducerHandler +{ + + private static final Log log = LogFactory.getLog(ZqmMessageProducerHandler.class); + + public static MessageResult sendMessage(MessageBusi messageBusi, HashMap propertyMap) + { + + try + { + + String sysCode = Global.getString("message-box", "sysCode"); + + // 单条消息准备 + messageBusi.setState(1); + messageBusi.setSendTime(new Date()); + if (StringUtils.isEmpty(messageBusi.getProducerPlatformType())) + { + messageBusi.setProducerPlatformType(sysCode); + } + StringBuffer tagName = new StringBuffer(); + tagName.append(messageBusi.getConsumerPlatformType()); + tagName.append("-"); + tagName.append(messageBusi.getConsumerOperateType()); + tagName.append("-"); + tagName.append(messageBusi.getConsumerOperateCode()); + tagName.append("-tag"); + messageBusi.setTags(URLEncoder.encode(tagName.toString(), "GBK")); + + // 单条消息保存并发送 + HttpPost post = new HttpPost(BusinessPlatformClientUtil.GATE_WAY_URL + "api-busi/messageBusi/save"); + post.setHeader("Authorization", "bearer " + BusinessPlatformClientUtil.getAccessToken()); + CloseableHttpClient httpclient = HttpClients.createDefault(); + StringEntity stringEntity = new StringEntity(JSONObject.toJSONString(messageBusi), ContentType.APPLICATION_JSON); + post.setEntity(stringEntity); + try + { + HttpResponse resultRep = httpclient.execute(post); + int statusCode = resultRep.getStatusLine().getStatusCode(); + if (statusCode == 200) + { + log.info("新增消息成功"); + } + } + catch (Exception e) + { + log.error(e.toString()); + return MessageResult.failed(e.toString()); + } + + return MessageResult.succeed("执行成功"); + } + catch (Exception e) + { + // 其他异常处理 + log.error(e); + return MessageResult.failed(e.toString()); + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageUtil.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageUtil.java new file mode 100644 index 0000000..57bcfa4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/messagebox/ZqmMessageUtil.java @@ -0,0 +1,180 @@ +package com.zhiqim.yangcai.design.messagebox; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.zhiqim.httpd.HttpWebsocketConnection; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; + +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +public final class ZqmMessageUtil +{ + + private static final Log log = LogFactory.getLog(ZqmMessageUtil.class); + + private static final ConcurrentHashMap userMap = new ConcurrentHashMap<>(100); + private static final ConcurrentHashMap connectionMap = new ConcurrentHashMap<>(100); + + /** + * 根据userId获取用户 + * + * @param sysCode + * @param userType + * @param userId + * @return + */ + public static ZqmLoginUser getUserById(String sysCode, String userType, String userId) + { + return userMap.get(sysCode + "-" + userType + "-" + userId); + } + + /** + * 根据tag获取用户 + * + * @param tag + * @return + */ + public static ZqmLoginUser getUserByTag(String tag) + { + if (null != tag && tag.length() > 4) + { + return userMap.get(tag.substring(0, tag.length() - 4)); + } + else + { + return null; + } + } + + /** + * 根据httpWebsocketConnection获取用户 + * + * @param httpWebsocketConnection + * @return + */ + public static ZqmLoginUser getUserByChannelId(HttpWebsocketConnection httpWebsocketConnection) + { + return connectionMap.get(httpWebsocketConnection); + } + + /** + * 根据通道销毁缓存数据 + * + * @param channel + * @return + */ + public static boolean removeConnection(HttpWebsocketConnection connection) + { + ZqmLoginUser user = connectionMap.get(connection); + if (user != null) + { + connectionMap.remove(connection); + user.destroyConnection(connection); + if (!user.hasConnections()) + { + userMap.remove(user.getSysCode() + "-" + user.getUserType() + "-" + user.getUserId()); + } + } + return true; + } + + /** + * 添加用户通道映射 + * + * @param sysCode + * @param userType + * @param userId + * @param connection + * @return + */ + public static boolean putUserChannel(String sysCode, int userType, String userId, HttpWebsocketConnection connection) throws Exception + { + ZqmLoginUser user = userMap.get(sysCode + "-" + userType + "-" + userId); + List connectionList = null; + if (user == null) + { + connectionList = new ArrayList<>(); + }else{ + connectionList = user.getConnections(); + } + + if (!connectionList.contains(connection)) + { + connectionList.add(connection); + user = new ZqmLoginUser(sysCode, userType, userId, connectionList); + userMap.put(sysCode + "-" + userType + "-" + userId, user); + connectionMap.put(connection, user); + } + return true; + } + + public static void readMessages(String ids) + { + if (ids == null || ids.isEmpty()) + { + return; + } + StringBuffer url = new StringBuffer(); + url.append(BusinessPlatformClientUtil.GATE_WAY_URL + "api-busi/messageBusi/readMessages?ids="); + url.append(ids); + CloseableHttpClient httpclient = HttpClients.createDefault(); + HttpPost post = new HttpPost(url.toString()); + post.setHeader("Authorization", "bearer " + BusinessPlatformClientUtil.getAccessToken()); + try + { + HttpResponse resultRep = httpclient.execute(post); + int statusCode = resultRep.getStatusLine().getStatusCode(); + if (statusCode == 200) + { + log.info("已读信息状态成功"); + } + else + { + log.error("已读信息状态失败(非重要)"); + } + } + catch (IOException e) + { + log.error("已读信息状态失败(非重要)"); + } + } + + public static void consumeMessages(String ids) + { + if (ids == null || ids.isEmpty()) + { + return; + } + StringBuffer url = new StringBuffer(); + url.append(BusinessPlatformClientUtil.GATE_WAY_URL + "api-busi/messageBusi/consumeMessage?ids="); + url.append(ids); + CloseableHttpClient httpclient = HttpClients.createDefault(); + HttpPost post = new HttpPost(url.toString()); + post.setHeader("Authorization", "bearer " + BusinessPlatformClientUtil.getAccessToken()); + try + { + HttpResponse resultRep = httpclient.execute(post); + int statusCode = resultRep.getStatusLine().getStatusCode(); + if (statusCode == 200) + { + log.info("更新消息消费状态成功"); + } + else + { + log.error("更新消息消费状态失败(非重要)"); + } + } + catch (IOException e) + { + log.error("更新消息消费状态失败(非重要)"); + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/AttaFileModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/AttaFileModel.java new file mode 100644 index 0000000..78ce7bb --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/AttaFileModel.java @@ -0,0 +1,143 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +import org.zhiqim.kernel.json.Jsons; + +/** + * @author longguizhi + * + */ +public class AttaFileModel +{ + private String id; // + private String name = ""; // 中文名称,如:模板文件等 + private String type; // 文件类型,file,button,text,thumFile四种 + private String savePath; // 存储文件夹名 + + private int width = 340; // 默认宽度 + private int height = 160; // 默认高度 + private boolean isAdd = true; + private boolean isDel = true; + private boolean isDownload = true; + + public AttaFileModel(String id, String name, String type) + { + this.id = id; + this.name = name == null ? "" : name; + this.type = type; + } + + public void setSize(int width, int height) + { + this.width = width < 340 ? 340 : width; + this.height = height < 160 ? 160 : height; + } + + public void setOperate(boolean isAdd, boolean isDel, boolean isDownload) + { + this.isAdd = isAdd; + this.isDel = isDel; + this.isDownload = isDownload; + } + + public void setSavePath(String savePath) + { + this.savePath = savePath; + } + + public String getId() + { + return id; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getType() + { + return type; + } + + public String getSavePath() + { + return savePath; + } + + public int getWidth() + { + return width; + } + + public int getHeight() + { + return height; + } + + public boolean isAdd() + { + return isAdd; + } + + public boolean isDel() + { + return isDel; + } + + public boolean isDownload() + { + return isDownload; + } + + public void setType(String type) + { + this.type = type; + } + + public void setWidth(int width) + { + this.width = width; + } + + public void setHeight(int height) + { + this.height = height; + } + + public void setAdd(boolean isAdd) + { + this.isAdd = isAdd; + } + + public void setDel(boolean isDel) + { + this.isDel = isDel; + } + + public void setDownload(boolean isDownload) + { + this.isDownload = isDownload; + } + + @Override + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/BeforeCauseChartModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/BeforeCauseChartModel.java new file mode 100644 index 0000000..ceee2cf --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/BeforeCauseChartModel.java @@ -0,0 +1,59 @@ +/** + * 扬彩印刷设计 + * 文件名 :BeforeCauseChartModel.java + * 创建人 :高佳新 + * 创建时间:2019-8-5 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * + * 印前退回Model + * + * @version 1.0 @author gjx 2019-8-5 新建与整理 + */ +public class BeforeCauseChartModel +{ + private String backCause; // 违规原因 + private int backCount;// 退回单数 + private long backMoney;// 退回金额 + + public BeforeCauseChartModel(String backCause) + { + this.backCause = backCause; + this.backCount = 0; + this.backMoney = 0; + } + + public String getBackCause() + { + return backCause; + } + + public void setBackCause(String backCause) + { + this.backCause = backCause; + } + + public int getBackCount() + { + return backCount; + } + + public void setBackCount(int backCount) + { + this.backCount = backCount; + } + + public long getBackMoney() + { + return backMoney; + } + + public void setBackMoney(long backMoney) + { + this.backMoney = backMoney; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/ComparisonMoneyModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/ComparisonMoneyModel.java new file mode 100644 index 0000000..a2f3515 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/ComparisonMoneyModel.java @@ -0,0 +1,28 @@ +package com.zhiqim.yangcai.design.model; + +public class ComparisonMoneyModel +{ + private long designerOrdCost;// 统计报表金额 + private long money;// 账户中心金额 + + public long getDesignerOrdCost() + { + return designerOrdCost; + } + + public void setDesignerOrdCost(long designerOrdCost) + { + this.designerOrdCost = designerOrdCost; + } + + public long getMoney() + { + return money; + } + + public void setMoney(long money) + { + this.money = money; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/CompleteDesignRateStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/CompleteDesignRateStatModel.java new file mode 100644 index 0000000..73a46c1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/CompleteDesignRateStatModel.java @@ -0,0 +1,69 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignCompleteStatModel.java + * 创建人 :gjx + * 创建时间:2020年11月9日 +*/ + +package com.zhiqim.yangcai.design.model; + +/** + * + * [简要描述]: 设计师定稿率
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年11月9日 新建与整理 + */ +public class CompleteDesignRateStatModel +{ + private String designer;// 设计师 + private int orderNum;// 接单量 + private int orderEndNum;// 定稿量 + private double endProportion;// 定稿率 + + public CompleteDesignRateStatModel(String designer) + { + this.designer = designer; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public int getOrderNum() + { + return orderNum; + } + + public void setOrderNum(int orderNum) + { + this.orderNum = orderNum; + } + + public int getOrderEndNum() + { + return orderEndNum; + } + + public void setOrderEndNum(int orderEndNum) + { + this.orderEndNum = orderEndNum; + } + + public double getEndProportion() + { + return endProportion; + } + + public void setEndProportion(double endProportion) + { + this.endProportion = endProportion; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/CompleteOrgRateStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/CompleteOrgRateStatModel.java new file mode 100644 index 0000000..81861bf --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/CompleteOrgRateStatModel.java @@ -0,0 +1,70 @@ +/** + * 扬彩印刷设计 + * 文件名 :CompleteOrgRateStatModel.java + * 创建人 :gjx + * 创建时间:2020年11月9日 +*/ + +package com.zhiqim.yangcai.design.model; + +/** + * + * [简要描述]: 组织定稿率统计
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年11月9日 新建与整理 + */ + +public class CompleteOrgRateStatModel +{ + private String orgName;// 设计师 + private int orgOrderNum;// 接单量 + private int orgOrderEndNum;// 定稿量 + private String orgEndProportion;// 定稿率 + + public CompleteOrgRateStatModel(String orgName) + { + this.orgName = orgName; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public int getOrgOrderNum() + { + return orgOrderNum; + } + + public void setOrgOrderNum(int orgOrderNum) + { + this.orgOrderNum = orgOrderNum; + } + + public int getOrgOrderEndNum() + { + return orgOrderEndNum; + } + + public void setOrgOrderEndNum(int orgOrderEndNum) + { + this.orgOrderEndNum = orgOrderEndNum; + } + + public String getOrgEndProportion() + { + return orgEndProportion; + } + + public void setOrgEndProportion(String orgEndProportion) + { + this.orgEndProportion = orgEndProportion; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/CompleteStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/CompleteStatModel.java new file mode 100644 index 0000000..c0de199 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/CompleteStatModel.java @@ -0,0 +1,173 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.model; + +import java.util.HashSet; +import java.util.Set; + +public class CompleteStatModel implements Comparable +{ + private String designer; // 设计师 + private Set orderPassSet = new HashSet(); + private String orderPassId; // 3.定稿审核通过编号,多个用逗号隔开 + private String orderBackId; // 4.定稿审核退回编号 + private int orderPassSum; // 5.定稿审核通过总数(次数) + private int orderBackSum; // 6.定稿审核退回总数(次数) + private double passConvertSum; // 7.定稿审核通过折算总数 + private double backConvertSum; // 8.定稿审核退回折算总数 + private long designAmount; // 9.设计绩效金额 + private int orderBackCount; // 10.实际退稿单数 + private int orderPassCount; // 11.实际定稿单数 + private int achieveOrderCount; // 12 结算单数(定稿单数 - 退稿单数(退稿了没有再次定稿的退稿单数)) + private double achieveConvertCount; // 定稿单数折算总数 + + public CompleteStatModel(String designer) + { + this.designer = designer; + } + + public double getAchieveConvertCount() + { + return achieveConvertCount; + } + + public void setAchieveConvertCount(double achieveConvertCount) + { + this.achieveConvertCount = achieveConvertCount; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public int getOrderPassCount() + { + return orderPassCount; + } + + public void setOrderPassCount(int orderPassCount) + { + this.orderPassCount = orderPassCount; + } + + public String getOrderPassId() + { + return orderPassId; + } + + public void setOrderPassId(String orderPassId) + { + this.orderPassId = orderPassId; + } + + public String getOrderBackId() + { + return orderBackId; + } + + public void setOrderBackId(String orderBackId) + { + this.orderBackId = orderBackId; + } + + public int getOrderPassSum() + { + return orderPassSum; + } + + public void setOrderPassSum(int orderPassSum) + { + this.orderPassSum = orderPassSum; + } + + public int getOrderBackSum() + { + return orderBackSum; + } + + public void setOrderBackSum(int orderBackSum) + { + this.orderBackSum = orderBackSum; + } + + public double getPassConvertSum() + { + return passConvertSum; + } + + public void setPassConvertSum(double passConvertSum) + { + this.passConvertSum = passConvertSum; + } + + public double getBackConvertSum() + { + return backConvertSum; + } + + public void setBackConvertSum(double backConvertSum) + { + this.backConvertSum = backConvertSum; + } + + public long getDesignAmount() + { + return designAmount; + } + + public void setDesignAmount(long designAmount) + { + this.designAmount = designAmount; + } + + public int getOrderBackCount() + { + return orderBackCount; + } + + public void setOrderBackCount(int orderBackCount) + { + this.orderBackCount = orderBackCount; + } + + public int getAchieveOrderCount() + { + return achieveOrderCount; + } + + public void setAchieveOrderCount(int achieveOrderCount) + { + this.achieveOrderCount = achieveOrderCount; + } + + public Set getOrderPassSet() + { + return orderPassSet; + } + + public void setOrderPassSet(Set orderPassSet) + { + this.orderPassSet = orderPassSet; + } + + @Override + public int compareTo(CompleteStatModel o) + {// 乘上10防止double转int时小数位丢失导致排序不对 + return o.getOrderPassCount() - orderPassCount; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/CustomerTypeCacheModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/CustomerTypeCacheModel.java new file mode 100644 index 0000000..681a6b3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/CustomerTypeCacheModel.java @@ -0,0 +1,41 @@ +/** + * 扬彩印刷设计 + * 文件名 :CustomerTypeCacheModel.java + * 创建人 :gjx + * 创建时间:2019-12-23 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * [简要描述]客户类型缓存Model :
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-12-23 新建与整理 + */ +public class CustomerTypeCacheModel +{ + private int customerTypeId; + private String customerTypeName; + + public int getCustomerTypeId() + { + return customerTypeId; + } + + public void setCustomerTypeId(int customerTypeId) + { + this.customerTypeId = customerTypeId; + } + + public String getCustomerTypeName() + { + return customerTypeName; + } + + public void setCustomerTypeName(String customerTypeName) + { + this.customerTypeName = customerTypeName; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DersignerOrgOrderView.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DersignerOrgOrderView.java new file mode 100644 index 0000000..026d2fe --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DersignerOrgOrderView.java @@ -0,0 +1,64 @@ +package com.zhiqim.yangcai.design.model; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 设计师,组织,订单 对应视图《DERSIGNER_ORG_ORDER_VIEW》 + */ +@AnAlias("DersignerOrgOrderView") +@AnNew +@AnView("ZMR_OPERATOR,ZMR_ORG,DESIGN_ORDER") +@AnViewJoin( +{ + @AnViewJoinValue(type = "EQUAL", lTable = "DESIGN_ORDER", lColumn = "DESIGNER", rTable = "ZMR_OPERATOR", rColumn = "OPERATOR_CODE"), + @AnViewJoinValue(type = "EQUAL", lTable = "ZMR_OPERATOR", lColumn = "ORG_ID", rTable = "ZMR_ORG", rColumn = "ORG_ID") +}) +public class DersignerOrgOrderView extends DesignOrder +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table = "ZMR_ORG", column = "ORG_ID") + private long designerOrgId; // //1.设计师组织ID + @AnViewField(table = "ZMR_ORG", column = "ORG_NAME") + private String designerOrgName; // 2.设计师组织名称 + @AnViewField(table = "ZMR_OPERATOR", column = "OPERATOR_NAME") + private String designerName; // 3.设计师名称 + + public long getDesignerOrgId() + { + return designerOrgId; + } + + public void setDesignerOrgId(long designerOrgId) + { + this.designerOrgId = designerOrgId; + } + + public String getDesignerOrgName() + { + return designerOrgName; + } + + public void setDesignerOrgName(String designerOrgName) + { + this.designerOrgName = designerOrgName; + } + + public String getDesignerName() + { + return designerName; + } + + public void setDesignerName(String designerName) + { + this.designerName = designerName; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesOnliceTimeLogModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesOnliceTimeLogModel.java new file mode 100644 index 0000000..ba4abf7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesOnliceTimeLogModel.java @@ -0,0 +1,73 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesOnliceTimeLogModel.java + * 创建人 :gjx + * 创建时间:2020年9月2日 +*/ + +package com.zhiqim.yangcai.design.model; + +import org.zhiqim.kernel.json.Jsons; + +/** + * + * [简要描述]: 在线时长Model
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年9月2日 新建与整理 + */ +public class DesOnliceTimeLogModel implements Comparable +{ + private String dayCode; + private String designer; + private int onlineTime; + + public DesOnliceTimeLogModel(String dayCode, String designer) + { + this.dayCode = dayCode; + this.designer = designer; + } + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getDayCode() + { + return dayCode; + } + + public void setDayCode(String dayCode) + { + this.dayCode = dayCode; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public int getOnlineTime() + { + return onlineTime; + } + + public void setOnlineTime(int onlineTime) + { + this.onlineTime = onlineTime; + } + + @Override + public int compareTo(DesOnliceTimeLogModel o) + { + return o.getOnlineTime() - onlineTime; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesStatModel.java new file mode 100644 index 0000000..e59161c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesStatModel.java @@ -0,0 +1,57 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +/** + * 初稿统计DTO + * + * @version v1.0.0 @author Deng 2017-6-16 新建与整理 + */ +public class DesStatModel implements Comparable +{ + private String designName; // 1.设计师名称 + private int draftCount; // 2.初搞订单数 + + public DesStatModel(String designName, int draftCount) + { + this.designName = designName; + this.draftCount = draftCount; + } + + public String getDesignName() + { + return designName; + } + + public void setDesignName(String designName) + { + this.designName = designName; + } + + public int getDraftCount() + { + return draftCount; + } + + public void setDraftCount(int draftCount) + { + this.draftCount = draftCount; + } + + @Override + public int compareTo(DesStatModel o1) + { + + return this.getDraftCount() - o1.getDraftCount(); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesWorksFileModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesWorksFileModel.java new file mode 100644 index 0000000..ffd4c50 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesWorksFileModel.java @@ -0,0 +1,352 @@ +package com.zhiqim.yangcai.design.model; + +import java.sql.Timestamp; + +/** + * 用于返回带浏览数的DesWorksFileModel + * + * @author HuangZhiGao + * @date 2020-02-25 8:44 + */ +public class DesWorksFileModel +{ + private long worksId; // 1.作品ID + private long industryId; // 2.行业ID + private long prdTypeId; // 3.产品类型ID + + private long prdPageId; // 4.面数ID + private long prdSizeId; // 5.尺寸ID + private long templateId; // 6.模板ID + + private String industrySubIds; // 7.子行业ID + private String industrySubName; // 8.子行业名称 + private String attributeIds; // 9.属性ID + + private String attributeName; // 10.属性名称 + private long keywordId; // 11.关键词ID + private String keywordName; // 12.关键词名称 + + private String worksName; // 13.作品名称 + private int worksType; // 14.作品类型(0代表普通、1代表精品、2代表待审精品、3代表模板审核、4代表模板) + private String cdrFileName; // 15.CDR源文件名称 + + private String pdfFileName; // 16.PDF源文件名称 + private String cdrPath; // 17.CDR路径 + private String pdfPath; // 18.PDF路径 + + private String designer; // 19.设计师 + private String designGroupId; // 20.包含设计小组ID在内的设计师所属部门 + private String deptId; // 21.分享部门ID + + private String thumbImagePath; // 22.缩略图存储路径,多个用英文逗号分隔(OSS路径) + private String thumbImageOssUrl; // 23.缩略图存储路径,多个用英文逗号分隔(OSS路径)废弃 + private String thumbImagePhyPath; // 24.缩略图存储路径,多个用英文逗号分隔(物理路径) + + private int uploadType; // 25.上传类型(0代表订单作品,1代表手工上传,2代表只有CDR文件,3代表路径有误) + private Timestamp createTime; // 26.创建时间 + private int ossStatus; // 27.0=文件在本地, 1=文件已上传在OSS, 2=本地&oss都不存在 + + private String fileType; // 28.设计文件类型后缀。pdf、cdr、ai + + // 29.作品热度标签(1无、2精品、3推荐、4热门) + // 根据作品类型判断精品,否则根据浏览次数判断:无(<20)、推荐(>=20 <50)和热门(>=50) + private int worksHeatLabel; + + + public DesWorksFileModel() + { + super(); + } + + + public long getWorksId() + { + return worksId; + } + + public void setWorksId(long worksId) + { + this.worksId = worksId; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public long getPrdPageId() + { + return prdPageId; + } + + public void setPrdPageId(long prdPageId) + { + this.prdPageId = prdPageId; + } + + public long getPrdSizeId() + { + return prdSizeId; + } + + public void setPrdSizeId(long prdSizeId) + { + this.prdSizeId = prdSizeId; + } + + public long getTemplateId() + { + return templateId; + } + + public void setTemplateId(long templateId) + { + this.templateId = templateId; + } + + public String getIndustrySubIds() + { + return industrySubIds; + } + + public void setIndustrySubIds(String industrySubIds) + { + this.industrySubIds = industrySubIds; + } + + public String getIndustrySubName() + { + return industrySubName; + } + + public void setIndustrySubName(String industrySubName) + { + this.industrySubName = industrySubName; + } + + public String getAttributeIds() + { + return attributeIds; + } + + public void setAttributeIds(String attributeIds) + { + this.attributeIds = attributeIds; + } + + public String getAttributeName() + { + return attributeName; + } + + public void setAttributeName(String attributeName) + { + this.attributeName = attributeName; + } + + public long getKeywordId() + { + return keywordId; + } + + public void setKeywordId(long keywordId) + { + this.keywordId = keywordId; + } + + public String getKeywordName() + { + return keywordName; + } + + public void setKeywordName(String keywordName) + { + this.keywordName = keywordName; + } + + public String getWorksName() + { + return worksName; + } + + public void setWorksName(String worksName) + { + this.worksName = worksName; + } + + public int getWorksType() + { + return worksType; + } + + public void setWorksType(int worksType) + { + this.worksType = worksType; + } + + public String getCdrFileName() + { + return cdrFileName; + } + + public void setCdrFileName(String cdrFileName) + { + this.cdrFileName = cdrFileName; + } + + public String getPdfFileName() + { + return pdfFileName; + } + + public void setPdfFileName(String pdfFileName) + { + this.pdfFileName = pdfFileName; + } + + public String getCdrPath() + { + return cdrPath; + } + + public void setCdrPath(String cdrPath) + { + this.cdrPath = cdrPath; + } + + public String getPdfPath() + { + return pdfPath; + } + + public void setPdfPath(String pdfPath) + { + this.pdfPath = pdfPath; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getDesignGroupId() + { + return designGroupId; + } + + public void setDesignGroupId(String designGroupId) + { + this.designGroupId = designGroupId; + } + + public String getDeptId() + { + return deptId; + } + + public void setDeptId(String deptId) + { + this.deptId = deptId; + } + + public String getThumbImagePath() + { + return thumbImagePath; + } + + public void setThumbImagePath(String thumbImagePath) + { + this.thumbImagePath = thumbImagePath; + } + + public String getThumbImageOssUrl() + { + return thumbImageOssUrl; + } + + public void setThumbImageOssUrl(String thumbImageOssUrl) + { + this.thumbImageOssUrl = thumbImageOssUrl; + } + + public String getThumbImagePhyPath() + { + return thumbImagePhyPath; + } + + public void setThumbImagePhyPath(String thumbImagePhyPath) + { + this.thumbImagePhyPath = thumbImagePhyPath; + } + + public int getUploadType() + { + return uploadType; + } + + public void setUploadType(int uploadType) + { + this.uploadType = uploadType; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public int getOssStatus() + { + return ossStatus; + } + + public void setOssStatus(int ossStatus) + { + this.ossStatus = ossStatus; + } + + public String getFileType() + { + return fileType; + } + + public void setFileType(String fileType) + { + this.fileType = fileType; + } + + public int getWorksHeatLabel() + { + return worksHeatLabel; + } + + public void setWorksHeatLabel(int worksHeatLabel) + { + this.worksHeatLabel = worksHeatLabel; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignBackCountModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignBackCountModel.java new file mode 100644 index 0000000..6039cd4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignBackCountModel.java @@ -0,0 +1,131 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignBackOrderCountModel.java + * 创建人 :高佳新 + * 创建时间:2019-7-3 + */ + +package com.zhiqim.yangcai.design.model; + +import java.sql.Timestamp; + +/** + * + * 定稿统计(日志)定稿退回订单详情model + * + * @version 1.0 @author 高佳新 2019-7-3 新建与整理 + */ +public class DesignBackCountModel +{ + private long designId; // 1.设订单编号,设计平台独立编号 + private String shopNick; // 2.店铺名称 + private String buyerNick; // 3.客户昵称 + private String designer; // 4.设计师 + private String orderText; // 5.订单描述 + private Timestamp designEndTime; // 6.设计师定稿时间 + private Timestamp checkTime; // 7.审核时间(退回时间) + private int backOrderCount; // 8.单个订单退回次数 + private String checkBackReason; // 9.审核退回原因 + private int designCopies; // 10.设计费份数 + + public int getDesignCopies() + { + return designCopies; + } + + public void setDesignCopies(int designCopies) + { + this.designCopies = designCopies; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getShopNick() + { + return shopNick; + } + + public void setShopNick(String shopNick) + { + this.shopNick = shopNick; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public Timestamp getDesignEndTime() + { + return designEndTime; + } + + public void setDesignEndTime(Timestamp designEndTime) + { + this.designEndTime = designEndTime; + } + + public Timestamp getCheckTime() + { + return checkTime; + } + + public void setCheckTime(Timestamp checkTime) + { + this.checkTime = checkTime; + } + + public int getBackOrderCount() + { + return backOrderCount; + } + + public void setBackOrderCount(int backOrderCount) + { + this.backOrderCount = backOrderCount; + } + + public String getCheckBackReason() + { + return checkBackReason; + } + + public void setCheckBackReason(String checkBackReason) + { + this.checkBackReason = checkBackReason; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignFinalizeOrgCaseModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignFinalizeOrgCaseModel.java new file mode 100644 index 0000000..67799b3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignFinalizeOrgCaseModel.java @@ -0,0 +1,79 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignFinalizeOrgCaseModel.java + * 创建人 :高佳新 + * 创建时间:2019-7-4 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * + * 组织定稿统计model + * + * @version 1.0 @author 高佳新 2019-7-4 新建与整理 + */ +public class DesignFinalizeOrgCaseModel +{ + private String orgName; // 1.组织名称 + private int passOrderCount; // 2.定稿单数 + private int backOrderCount; // 3.退回单数 + private int backOrderRepeatCount; // 4.退回次数 + private long backOrderMoneySum; // 5.退回金额 + + public DesignFinalizeOrgCaseModel(String orgName) + { + this.orgName = orgName; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public int getPassOrderCount() + { + return passOrderCount; + } + + public void setPassOrderCount(int passOrderCount) + { + this.passOrderCount = passOrderCount; + } + + public int getBackOrderCount() + { + return backOrderCount; + } + + public void setBackOrderCount(int backOrderCount) + { + this.backOrderCount = backOrderCount; + } + + public int getBackOrderRepeatCount() + { + return backOrderRepeatCount; + } + + public void setBackOrderRepeatCount(int backOrderRepeatCount) + { + this.backOrderRepeatCount = backOrderRepeatCount; + } + + public long getBackOrderMoneySum() + { + return backOrderMoneySum; + } + + public void setBackOrderMoneySum(long backOrderMoneySum) + { + this.backOrderMoneySum = backOrderMoneySum; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignGroupStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignGroupStatModel.java new file mode 100644 index 0000000..172a327 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignGroupStatModel.java @@ -0,0 +1,88 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +public class DesignGroupStatModel +{ + private long groupId; //设计组ID + private String groupLeader; //组长 + private int memberSize; //成员人数 + private double groupCompleteSum; //设计组总定稿数 + private int groupCompleteAvgCount; //设计组平均定稿数 + private long groupPerformanceAmount; //设计组绩效 + + public DesignGroupStatModel(long groupId) + { + this.groupId = groupId; + } + + public long getGroupId() + { + return groupId; + } + + public void setGroupId(long groupId) + { + this.groupId = groupId; + } + + public String getGroupLeader() + { + return groupLeader; + } + + public void setGroupLeader(String groupLeader) + { + this.groupLeader = groupLeader; + } + + public int getMemberSize() + { + return memberSize; + } + + public void setMemberSize(int memberSize) + { + this.memberSize = memberSize; + } + + public double getGroupCompleteSum() + { + return groupCompleteSum; + } + + public void setGroupCompleteSum(double groupCompleteSum) + { + this.groupCompleteSum = groupCompleteSum; + } + + public int getGroupCompleteAvgCount() + { + return groupCompleteAvgCount; + } + + public void setGroupCompleteAvgCount(int groupCompleteAvgCount) + { + this.groupCompleteAvgCount = groupCompleteAvgCount; + } + + public long getGroupPerformanceAmount() + { + return groupPerformanceAmount; + } + + public void setGroupPerformanceAmount(long groupPerformanceAmount) + { + this.groupPerformanceAmount = groupPerformanceAmount; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignOrderCreateModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignOrderCreateModel.java new file mode 100644 index 0000000..d24a215 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignOrderCreateModel.java @@ -0,0 +1,464 @@ +package com.zhiqim.yangcai.design.model; + +import java.util.List; + +import com.zhiqim.yangcai.design.client.YangcaiApiFile; + +/** + * 用于ERP标准自来稿在设计平台创建待审订单或已审订单的model
            + * 字段同DesignOrderCreateRequest一致
            + * + * @author HuangZhiGao + * @date 2020/2/12 16:51 + */ +public class DesignOrderCreateModel +{ + // 数据类型 字段名 是否为空 数据长度 字段描述 + private long merchantId;// 是 订单商户编号 + private String outId;// 是 外部系统单号 + private long designType;// 是 产品类型,由设计平台提供,业务方适配。 + private long industryId;// 是 行业编号,由设计平台提供,业务方适配。 + private int draftType;// 是 稿件类型,0:自来稿,1:改稿自来稿,2:普通设计,3:高级设计 + private int designPage;// 是 设计面数,单面为1,双面为2 + private int printKs;// 是 设计款数 + private int printMs;// 是 设计模数 + private double designWidth;// 是 设计宽度,单位mm,最多两位小数,含出血 + private double designHeight;// 是 设计高度,单位mm,最多两位小数,含出血 + private double designSide;// 否 设计侧面长度,单位mm,最多两位小数,含出血 + private double printWidth;// 否 特殊尺寸宽度,单位mm,最多两位小数, 不含出血(用户尺寸) + private double printHeight;// 否 特殊尺寸高度,单位mm,最多两位小数, 不含出血(用户尺寸) + private double amount;// 否 金额最多支持两位小数 + private boolean isUrgent;// 是 是否加急,。 + private String userContact;// 否 100 联系人 + private String userMobile;// 是 64 联系电话 + private String buyerNick;// 否 100 买家昵称 + private String userQq;// 否 64 买家联系QQ + private String userWx;// 否 64 买家联系微信号 + private String orderText;// 否 200 产品全称,最多200个字符 + private String afterNames;// 否 500 后加工 多个逗号隔开 + private String printSpecial;// 否 100 特殊工艺,最多100个字符 + private String userText;// 否 4000 客户文本,最多4000个字符 + private String userNotice;// 否 1000 设计注意事项,最多1000个字符 + private String shopNick;// 否 32 店铺名 最多32字符 + private String servicesMessage;// 否 500 店铺名 最多500字符 + private int designCopies;// 否 设计费份数 + private String receiverName; // 否 50 收货人的姓名 + private String receiverMobile;// 否 40 收货人的手机号码 + private String receiverState; // 否 20 收货人的所在省份 + private String receiverCity; // 否 20 收货人的所在城市 + private String receiverDistrict; // 否 20 收货人的所在区县 + private String receiverAddress; // 是 100 收货人的详细地址 + private String expressCode;// 否 20 物流code + private String creater;// 是 20 录单人 + private int orderSrc; // 是 订单来源 + private String tids; // 是 200 淘宝单号,多个逗号分隔 + private boolean isOnlyDesign; // 是否仅设计 + private List apiFiles;// 否 0 用户文件资料 + + + public DesignOrderCreateModel() + { + super(); + } + + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public String getOutId() + { + return outId; + } + + public void setOutId(String outId) + { + this.outId = outId; + } + + public long getDesignType() + { + return designType; + } + + public void setDesignType(long designType) + { + this.designType = designType; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public int getDraftType() + { + return draftType; + } + + public void setDraftType(int draftType) + { + this.draftType = draftType; + } + + public int getDesignPage() + { + return designPage; + } + + public void setDesignPage(int designPage) + { + this.designPage = designPage; + } + + public int getPrintKs() + { + return printKs; + } + + public void setPrintKs(int printKs) + { + this.printKs = printKs; + } + + public int getPrintMs() + { + return printMs; + } + + public void setPrintMs(int printMs) + { + this.printMs = printMs; + } + + public double getDesignWidth() + { + return designWidth; + } + + public void setDesignWidth(double designWidth) + { + this.designWidth = designWidth; + } + + public double getDesignHeight() + { + return designHeight; + } + + public void setDesignHeight(double designHeight) + { + this.designHeight = designHeight; + } + + public double getDesignSide() + { + return designSide; + } + + public void setDesignSide(double designSide) + { + this.designSide = designSide; + } + + public double getPrintWidth() + { + return printWidth; + } + + public void setPrintWidth(double printWidth) + { + this.printWidth = printWidth; + } + + public double getPrintHeight() + { + return printHeight; + } + + public void setPrintHeight(double printHeight) + { + this.printHeight = printHeight; + } + + public double getAmount() + { + return amount; + } + + public void setAmount(double amount) + { + this.amount = amount; + } + + public boolean isUrgent() + { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) + { + this.isUrgent = isUrgent; + } + + public String getUserContact() + { + return userContact; + } + + public void setUserContact(String userContact) + { + this.userContact = userContact; + } + + public String getUserMobile() + { + return userMobile; + } + + public void setUserMobile(String userMobile) + { + this.userMobile = userMobile; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public String getUserQq() + { + return userQq; + } + + public void setUserQq(String userQq) + { + this.userQq = userQq; + } + + public String getUserWx() + { + return userWx; + } + + public void setUserWx(String userWx) + { + this.userWx = userWx; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public String getAfterNames() + { + return afterNames; + } + + public void setAfterNames(String afterNames) + { + this.afterNames = afterNames; + } + + public String getPrintSpecial() + { + return printSpecial; + } + + public void setPrintSpecial(String printSpecial) + { + this.printSpecial = printSpecial; + } + + public String getUserText() + { + return userText; + } + + public void setUserText(String userText) + { + this.userText = userText; + } + + public String getUserNotice() + { + return userNotice; + } + + public void setUserNotice(String userNotice) + { + this.userNotice = userNotice; + } + + public String getShopNick() + { + return shopNick; + } + + public void setShopNick(String shopNick) + { + this.shopNick = shopNick; + } + + public String getServicesMessage() + { + return servicesMessage; + } + + public void setServicesMessage(String servicesMessage) + { + this.servicesMessage = servicesMessage; + } + + public int getDesignCopies() + { + return designCopies; + } + + public void setDesignCopies(int designCopies) + { + this.designCopies = designCopies; + } + + public String getReceiverName() + { + return receiverName; + } + + public void setReceiverName(String receiverName) + { + this.receiverName = receiverName; + } + + public String getReceiverState() + { + return receiverState; + } + + public void setReceiverState(String receiverState) + { + this.receiverState = receiverState; + } + + public String getReceiverCity() + { + return receiverCity; + } + + public void setReceiverCity(String receiverCity) + { + this.receiverCity = receiverCity; + } + + public String getReceiverDistrict() + { + return receiverDistrict; + } + + public void setReceiverDistrict(String receiverDistrict) + { + this.receiverDistrict = receiverDistrict; + } + + public String getReceiverAddress() + { + return receiverAddress; + } + + public void setReceiverAddress(String receiverAddress) + { + this.receiverAddress = receiverAddress; + } + + public List getApiFiles() + { + return apiFiles; + } + + public void setApiFiles(List apiFiles) + { + this.apiFiles = apiFiles; + } + + public String getReceiverMobile() + { + return receiverMobile; + } + + public void setReceiverMobile(String receiverMobile) + { + this.receiverMobile = receiverMobile; + } + + public String getExpressCode() + { + return expressCode; + } + + public void setExpressCode(String expressCode) + { + this.expressCode = expressCode; + } + + public String getCreater() + { + return creater; + } + + public void setCreater(String creater) + { + this.creater = creater; + } + + public int getOrderSrc() + { + return orderSrc; + } + + public void setOrderSrc(int orderSrc) + { + this.orderSrc = orderSrc; + } + + public String getTids() + { + return tids; + } + + public void setTids(String tids) + { + this.tids = tids; + } + + public boolean isOnlyDesign() + { + return isOnlyDesign; + } + + public void setOnlyDesign(boolean isOnlyDesign) + { + this.isOnlyDesign = isOnlyDesign; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignOrderMeritsModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignOrderMeritsModel.java new file mode 100644 index 0000000..ffe372c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignOrderMeritsModel.java @@ -0,0 +1,83 @@ +package com.zhiqim.yangcai.design.model; + +import java.sql.Timestamp; + +public class DesignOrderMeritsModel { + private long meritsId; // 1.修改绩效编号 + private long designId; // 2.订单编号 + private String type; // 3.修改绩效类型 + private String oldData; // 4.老数据 + private String newData; // 5.新数据 + private Timestamp addTime; // 6.创建时间 + private String addUser; // 7.添加者 + private String designer; // 8.设计师 + private String typeId; //设计类型 + private String status; //订单状态 + private String orderText; //订单描述 + public long getMeritsId() { + return meritsId; + } + public void setMeritsId(long meritsId) { + this.meritsId = meritsId; + } + public long getDesignId() { + return designId; + } + public void setDesignId(long designId) { + this.designId = designId; + } + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + public String getOldData() { + return oldData; + } + public void setOldData(String oldData) { + this.oldData = oldData; + } + public String getNewData() { + return newData; + } + public void setNewData(String newData) { + this.newData = newData; + } + public Timestamp getAddTime() { + return addTime; + } + public void setAddTime(Timestamp addTime) { + this.addTime = addTime; + } + public String getAddUser() { + return addUser; + } + public void setAddUser(String addUser) { + this.addUser = addUser; + } + public String getDesigner() { + return designer; + } + public void setDesigner(String designer) { + this.designer = designer; + } + public String getTypeId() { + return typeId; + } + public void setTypeId(String typeId) { + this.typeId = typeId; + } + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } + public String getOrderText() { + return orderText; + } + public void setOrderText(String orderText) { + this.orderText = orderText; + } +} \ No newline at end of file diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignOrderQuestionsModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignOrderQuestionsModel.java new file mode 100644 index 0000000..bec414a --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignOrderQuestionsModel.java @@ -0,0 +1,50 @@ +package com.zhiqim.yangcai.design.model; + +public class DesignOrderQuestionsModel +{ + private String questionsId; + private String designRequirements; + private String updateOperator; + private String modificationTime; + + public String getQuestionsId() + { + return questionsId; + } + + public void setQuestionsId(String questionsId) + { + this.questionsId = questionsId; + } + + public String getDesignRequirements() + { + return designRequirements; + } + + public void setDesignRequirements(String designRequirements) + { + this.designRequirements = designRequirements; + } + + public String getUpdateOperator() + { + return updateOperator; + } + + public void setUpdateOperator(String updateOperator) + { + this.updateOperator = updateOperator; + } + + public String getModificationTime() + { + return modificationTime; + } + + public void setModificationTime(String modificationTime) + { + this.modificationTime = modificationTime; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignPriceModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignPriceModel.java new file mode 100644 index 0000000..ba85c58 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignPriceModel.java @@ -0,0 +1,173 @@ +package com.zhiqim.yangcai.design.model; + +import java.sql.Timestamp; + +public class DesignPriceModel +{ + private long convertId; // 产品单价id + private long prdTypeId; // 产品类型编号 + private int prdSizeWidth;// 尺寸范围宽度 + private int prdSizeHeight;// 尺寸范围高度 + private String prdPageName;// 面数名称 + private String addOperator;// 添加人 + private Timestamp addTime;// 添加时间 + private String updateOperator;// 更新人 + private Timestamp updateTime;// 更新时间 + private int seq; + private int draftType;// 稿件类型 + private long DraftCommonDesign;// 普通设计 ,2 + private long DraftTemplate;// 改稿设计 ,1 + private long srDesign;// 资深设计 ,3 + private String alias;// 产品别名 + + public long getConvertId() + { + return convertId; + } + + public void setConvertId(long convertId) + { + this.convertId = convertId; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public int getPrdSizeWidth() + { + return prdSizeWidth; + } + + public void setPrdSizeWidth(int prdSizeWidth) + { + this.prdSizeWidth = prdSizeWidth; + } + + public int getPrdSizeHeight() + { + return prdSizeHeight; + } + + public void setPrdSizeHeight(int prdSizeHeight) + { + this.prdSizeHeight = prdSizeHeight; + } + + public String getPrdPageName() + { + return prdPageName; + } + + public void setPrdPageName(String prdPageName) + { + this.prdPageName = prdPageName; + } + + public String getAddOperator() + { + return addOperator; + } + + public void setAddOperator(String addOperator) + { + this.addOperator = addOperator; + } + + public Timestamp getAddTime() + { + return addTime; + } + + public void setAddTime(Timestamp addTime) + { + this.addTime = addTime; + } + + public String getUpdateOperator() + { + return updateOperator; + } + + public void setUpdateOperator(String updateOperator) + { + this.updateOperator = updateOperator; + } + + public Timestamp getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Timestamp updateTime) + { + this.updateTime = updateTime; + } + + public int getDraftType() + { + return draftType; + } + + public void setDraftType(int draftType) + { + this.draftType = draftType; + } + + public long getDraftCommonDesign() + { + return DraftCommonDesign; + } + + public void setDraftCommonDesign(long draftCommonDesign) + { + DraftCommonDesign = draftCommonDesign; + } + + public long getDraftTemplate() + { + return DraftTemplate; + } + + public void setDraftTemplate(long draftTemplate) + { + DraftTemplate = draftTemplate; + } + + public int getSeq() + { + return seq; + } + + public void setSeq(int seq) + { + this.seq = seq; + } + + public String getAlias() + { + return alias; + } + + public void setAlias(String alias) + { + this.alias = alias; + } + + public long getSrDesign() + { + return srDesign; + } + + public void setSrDesign(long srDesign) + { + this.srDesign = srDesign; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignQuickTimeOutModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignQuickTimeOutModel.java new file mode 100644 index 0000000..3963eaa --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignQuickTimeOutModel.java @@ -0,0 +1,120 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignQuickTimeOutModel.java + * 创建人 :高佳新 + * 创建时间:2019-7-10 + */ + +package com.zhiqim.yangcai.design.model; + +import java.sql.Timestamp; + +/** + * + * 快超时订单model + * + * @version 1.0 @author gjx 2019-7-10 新建与整理 + */ +public class DesignQuickTimeOutModel +{ + private long designId; // 1.设订单编号,设计平台独立编号 + private long orgId; // 2.操作员组织编号 + private String orderText; // 3.订单描述 + private long industryId; // 4.所属行业 + private String buyerNick; // 5.客户昵称 + private Timestamp createTime; // 6.创建时间 + private Timestamp designReceiveTime; // 7.设计师领单时间 + private int countDown; // 8倒计时 + private String designer; // 9.设计师 + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getDesignReceiveTime() + { + return designReceiveTime; + } + + public void setDesignReceiveTime(Timestamp designReceiveTime) + { + this.designReceiveTime = designReceiveTime; + } + + public int getCountDown() + { + return countDown; + } + + public void setCountDown(int countDown) + { + this.countDown = countDown; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignRefundOrgTotalStatisticsModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignRefundOrgTotalStatisticsModel.java new file mode 100644 index 0000000..7a32295 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignRefundOrgTotalStatisticsModel.java @@ -0,0 +1,83 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignRefundOrgTotalStatisticsModel.java + * 创建人 :高佳新 + * 创建时间:2019-8-3 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * + * 组织退款统计Model + * + * @version 1.0 @author gjx 2019-8-3 新建与整理 + */ +public class DesignRefundOrgTotalStatisticsModel +{ + private String orgName;// 组织名称 + private int orgOrderCount;// 组织单量 + private int orgRefundCount;// 组织退款单量 + private long orgRefundMoneySum;// 组织退款金额 + private long orgOrderMoneySum;// 组织订单金额 + + public DesignRefundOrgTotalStatisticsModel(String orgName) + { + this.orgName = orgName; + this.orgOrderCount = 0; + this.orgRefundCount = 0; + this.orgRefundMoneySum = 0; + this.orgOrderMoneySum = 0; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public int getOrgOrderCount() + { + return orgOrderCount; + } + + public void setOrgOrderCount(int orgOrderCount) + { + this.orgOrderCount = orgOrderCount; + } + + public int getOrgRefundCount() + { + return orgRefundCount; + } + + public void setOrgRefundCount(int orgRefundCount) + { + this.orgRefundCount = orgRefundCount; + } + + public long getOrgRefundMoneySum() + { + return orgRefundMoneySum; + } + + public void setOrgRefundMoneySum(long orgRefundMoneySum) + { + this.orgRefundMoneySum = orgRefundMoneySum; + } + + public long getOrgOrderMoneySum() + { + return orgOrderMoneySum; + } + + public void setOrgOrderMoneySum(long orgOrderMoneySum) + { + this.orgOrderMoneySum = orgOrderMoneySum; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignRefundPrdTypeStatisticsModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignRefundPrdTypeStatisticsModel.java new file mode 100644 index 0000000..18a4965 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignRefundPrdTypeStatisticsModel.java @@ -0,0 +1,88 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignRefundPrdTypeStatisticsModel.java + * 创建人 :蒋斌 + * 创建时间:2020-6-15 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * + * 产品退款统计Model + * + * @version 1.0 @author jiangbin 2020-6-15 新建与整理 + */ +public class DesignRefundPrdTypeStatisticsModel implements Comparable +{ + private String prdName;// 产品名称 + private int prdOrderCount;// 产品单量 + private int prdRefundCount;// 产品退款单量 + private long prdRefundMoneySum;// 产品退款金额 + private long prdOrderMoneySum;// 产品订单金额 + + public DesignRefundPrdTypeStatisticsModel(String prdName) + { + this.prdName = prdName; + this.prdOrderCount = 0; + this.prdRefundCount = 0; + this.prdRefundMoneySum = 0; + this.prdOrderMoneySum = 0; + } + + public String getPrdName() + { + return prdName; + } + + public void setPrdName(String prdName) + { + this.prdName = prdName; + } + + public int getPrdOrderCount() + { + return prdOrderCount; + } + + public void setPrdOrderCount(int prdOrderCount) + { + this.prdOrderCount = prdOrderCount; + } + + public int getPrdRefundCount() + { + return prdRefundCount; + } + + public void setPrdRefundCount(int prdRefundCount) + { + this.prdRefundCount = prdRefundCount; + } + + public long getPrdRefundMoneySum() + { + return prdRefundMoneySum; + } + + public void setPrdRefundMoneySum(long prdRefundMoneySum) + { + this.prdRefundMoneySum = prdRefundMoneySum; + } + + public long getPrdOrderMoneySum() + { + return prdOrderMoneySum; + } + + public void setPrdOrderMoneySum(long prdOrderMoneySum) + { + this.prdOrderMoneySum = prdOrderMoneySum; + } + + @Override + public int compareTo(DesignRefundPrdTypeStatisticsModel o) + { + return o.getPrdOrderCount() - this.getPrdOrderCount(); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignerPerformanceModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignerPerformanceModel.java new file mode 100644 index 0000000..f12cb39 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DesignerPerformanceModel.java @@ -0,0 +1,59 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignerPerformanceModel.java + * 创建人 :gjx + * 创建时间:2021年3月8日 +*/ + +package com.zhiqim.yangcai.design.model; + +/** + * + * [简要描述]: 设计师绩效model
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年3月8日 新建与整理 + */ +public class DesignerPerformanceModel +{ + private String designer; + private int orderEndCount; + private long designPerformance; + + public DesignerPerformanceModel(String designer) + { + super(); + this.designer = designer; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public int getOrderEndCount() + { + return orderEndCount; + } + + public void setOrderEndCount(int orderEndCount) + { + this.orderEndCount = orderEndCount; + } + + public long getDesignPerformance() + { + return designPerformance; + } + + public void setDesignPerformance(long designPerformance) + { + this.designPerformance = designPerformance; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DispatchStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DispatchStatModel.java new file mode 100644 index 0000000..7a5f7e8 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/DispatchStatModel.java @@ -0,0 +1,104 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +public class DispatchStatModel +{ + private long orgId; // 组织编号 + private String orgName; // 组织名称 + private int orderNum; // 订单数 + private int cardNum; // 名片类单数 + private int onlyCardNum; // 名片单数 + private int colorPageNum; // 彩页类单数 + private int onlyColorPageNum; // 彩页单数 + private int otherNum; // 其他类单数 + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public int getOrderNum() + { + return orderNum; + } + + public void setOrderNum(int orderNum) + { + this.orderNum = orderNum; + } + + public int getCardNum() + { + return cardNum; + } + + public void setCardNum(int cardNum) + { + this.cardNum = cardNum; + } + + public int getColorPageNum() + { + return colorPageNum; + } + + public void setColorPageNum(int colorPageNum) + { + this.colorPageNum = colorPageNum; + } + + public int getOtherNum() + { + return otherNum; + } + + public void setOtherNum(int otherNum) + { + this.otherNum = otherNum; + } + + public int getOnlyCardNum() + { + return onlyCardNum; + } + + public void setOnlyCardNum(int onlyCardNum) + { + this.onlyCardNum = onlyCardNum; + } + + public int getOnlyColorPageNum() + { + return onlyColorPageNum; + } + + public void setOnlyColorPageNum(int onlyColorPageNum) + { + this.onlyColorPageNum = onlyColorPageNum; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/ExpressModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/ExpressModel.java new file mode 100644 index 0000000..0e323c5 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/ExpressModel.java @@ -0,0 +1,52 @@ +/** + * 扬彩印刷设计 + * 文件名 :ExpressModel.java + * 创建人 :gjx + * 创建时间:2019-11-5 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * [简要描述]:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-11-5 新建与整理 + */ +public class ExpressModel +{ + private String expressCode; // 1.物流code + private String expressName; // 2.物流名称别名 + private String expressAliasName; // 3.物流名称别名 + + public String getExpressCode() + { + return expressCode; + } + + public void setExpressCode(String expressCode) + { + this.expressCode = expressCode; + } + + public String getExpressName() + { + return expressName; + } + + public void setExpressName(String expressName) + { + this.expressName = expressName; + } + + public String getExpressAliasName() + { + return expressAliasName; + } + + public void setExpressAliasName(String expressAliasName) + { + this.expressAliasName = expressAliasName; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/FesignerFinishSelfDraftModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/FesignerFinishSelfDraftModel.java new file mode 100644 index 0000000..818402b --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/FesignerFinishSelfDraftModel.java @@ -0,0 +1,58 @@ +/** + * 扬彩印刷设计 + * 文件名 :FesignerFinishSelfDraftModel.java + * 创建人 :gjx + * 创建时间:2019-11-11 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * [简要描述] 设计师完成自来稿统计dto :
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-11-11 新建与整理 + */ +public class FesignerFinishSelfDraftModel implements Comparable +{ + private String designer; // 设计师 + private int revisedDraftNum; // 改稿自来稿数量 + private int standardDraftNum; // 标准自来稿数量 + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public int getRevisedDraftNum() + { + return revisedDraftNum; + } + + public void setRevisedDraftNum(int revisedDraftNum) + { + this.revisedDraftNum = revisedDraftNum; + } + + public int getStandardDraftNum() + { + return standardDraftNum; + } + + public void setStandardDraftNum(int standardDraftNum) + { + this.standardDraftNum = standardDraftNum; + } + + @Override + public int compareTo(FesignerFinishSelfDraftModel o) + { + return o.getStandardDraftNum() - this.standardDraftNum; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/GoalModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/GoalModel.java new file mode 100644 index 0000000..9869d2c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/GoalModel.java @@ -0,0 +1,112 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +/** + * 日历Model + * + * @version v1.0.0 @author Deng 2018-3-9 新建与整理 + */ +public class GoalModel +{ + private String goalMonth; + private int goalDate; + private int goalNum; + private boolean isSet; + + private int year; + private int month; + private int day; + + /****************************************************************/ + // 设置属性 + /****************************************************************/ + + public void setGoalMonth(String goalMonth) + { + this.goalMonth = goalMonth; + } + + public void setSet(boolean isSet) + { + this.isSet = isSet; + } + + public void setGoalNum(int goalNum) + { + this.goalNum = goalNum; + } + + public void setIsSet(int goalNum) + { + if (goalNum > 0) + this.isSet = true; + else + this.isSet = false; + } + + public void setGoalDate(int year, int month, int day) + { + this.goalDate = year * 10000 + month * 100 + day; + + this.year = year; + this.month = month; + this.day = day; + } + + public void setGoalDate(int goalDate) + { + this.goalDate = goalDate; + + this.year = goalDate / 10000; + this.month = goalDate / 100 % 100; + this.day = goalDate % 100; + } + + /****************************************************************/ + // 获取属性 + /****************************************************************/ + public String getGoalMonth() + { + return goalMonth; + } + + public int getGoalDate() + { + return goalDate; + } + + public int getGoalNum() + { + return goalNum; + } + + public boolean isSet() + { + return isSet; + } + + public int getYear() + { + return year; + } + + public int getMonth() + { + return month; + } + + public int getDay() + { + return day; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/HeatKeywordModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/HeatKeywordModel.java new file mode 100644 index 0000000..70d3d6d --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/HeatKeywordModel.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +/** + * 热词搜索MODEL + * + * @version v1.0.0 @author Deng 2018-1-8 新建与整理 + */ +public class HeatKeywordModel +{ + private long logId; + private int str; + + public long getLogId() + { + return logId; + } + + public void setLogId(long logId) + { + this.logId = logId; + } + + public int getStr() + { + return str; + } + + public void setStr(int str) + { + this.str = str; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/HisToryOrderTagLogModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/HisToryOrderTagLogModel.java new file mode 100644 index 0000000..8741804 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/HisToryOrderTagLogModel.java @@ -0,0 +1,109 @@ +/** + * 扬彩印刷设计 + * 文件名 :HisToryOrderTagLogModel.java + * 创建人 :gjx + * 创建时间:2019-12-19 + */ + +package com.zhiqim.yangcai.design.model; + +import java.sql.Timestamp; + +/** + * [简要描述]标签日志Model:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-12-19 新建与整理 + */ +public class HisToryOrderTagLogModel +{ + private String mainIndustryName;// 主行业名称 + private String sonIndustryName;// 子行业名称 + private String appScenarios;// 应用场景 + private String customerType;// 客户类型 + private String designStyle;// 设计风格 + private String operatorCode;// 操作人 + private String unmatchKeyword;// 未匹配关键字 + private Timestamp operatorTime; // 38.操作时间 + + public String getMainIndustryName() + { + return mainIndustryName; + } + + public void setMainIndustryName(String mainIndustryName) + { + this.mainIndustryName = mainIndustryName; + } + + public String getSonIndustryName() + { + return sonIndustryName; + } + + public void setSonIndustryName(String sonIndustryName) + { + this.sonIndustryName = sonIndustryName; + } + + public String getAppScenarios() + { + return appScenarios; + } + + public void setAppScenarios(String appScenarios) + { + this.appScenarios = appScenarios; + } + + public String getCustomerType() + { + return customerType; + } + + public void setCustomerType(String customerType) + { + this.customerType = customerType; + } + + public String getDesignStyle() + { + return designStyle; + } + + public void setDesignStyle(String designStyle) + { + this.designStyle = designStyle; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public String getUnmatchKeyword() + { + return unmatchKeyword; + } + + public void setUnmatchKeyword(String unmatchKeyword) + { + this.unmatchKeyword = unmatchKeyword; + } + + public Timestamp getOperatorTime() + { + return operatorTime; + } + + public void setOperatorTime(Timestamp operatorTime) + { + this.operatorTime = operatorTime; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/HistoryBackDetailsModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/HistoryBackDetailsModel.java new file mode 100644 index 0000000..210cefd --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/HistoryBackDetailsModel.java @@ -0,0 +1,119 @@ +/** + * 扬彩印刷设计 + * 文件名 :HistoryBackDetailsModel.java + * 创建人 :gjx + * 创建时间:2019-9-18 + */ + +package com.zhiqim.yangcai.design.model; + +import java.sql.Timestamp; + +/** + * 订单历史审核退回详情Model + * + * @version 1.0 @author gjx 2019-9-18 新建与整理 + */ +public class HistoryBackDetailsModel +{ + private long designId;// 订单号 + private String buyerNick;// 旺旺名 + private Timestamp backTime;// 审核退回时间 + private String backCountDown;// 退回处理倒计时 + private String checkBackReason;// 退回原因 + private Timestamp designEndTime;// 定稿时间 + private String orderText;// 产品文本 + private long amount;// 订单金额 + private boolean isTimeOut;// 是否超时 + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public Timestamp getBackTime() + { + return backTime; + } + + public void setBackTime(Timestamp backTime) + { + this.backTime = backTime; + } + + public String getBackCountDown() + { + return backCountDown; + } + + public void setBackCountDown(String backCountDown) + { + this.backCountDown = backCountDown; + } + + public String getCheckBackReason() + { + return checkBackReason; + } + + public void setCheckBackReason(String checkBackReason) + { + this.checkBackReason = checkBackReason; + } + + public Timestamp getDesignEndTime() + { + return designEndTime; + } + + public void setDesignEndTime(Timestamp designEndTime) + { + this.designEndTime = designEndTime; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public long getAmount() + { + return amount; + } + + public void setAmount(long amount) + { + this.amount = amount; + } + + public boolean isTimeOut() + { + return isTimeOut; + } + + public void setTimeOut(boolean isTimeOut) + { + this.isTimeOut = isTimeOut; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/HotKeywordModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/HotKeywordModel.java new file mode 100644 index 0000000..2d42fa1 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/HotKeywordModel.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +/** + * 热词搜索MODEL + * + * @version v1.0.0 @author Deng 2018-1-8 新建与整理 + */ +public class HotKeywordModel +{ + private String keywordName; + private int degree; + + public String getKeywordName() + { + return keywordName; + } + + public void setKeywordName(String keywordName) + { + this.keywordName = keywordName; + } + + public int getDegree() + { + return degree; + } + + public void setDegree(int degree) + { + this.degree = degree; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/IndustryLabelModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/IndustryLabelModel.java new file mode 100644 index 0000000..03f4645 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/IndustryLabelModel.java @@ -0,0 +1,73 @@ +/** + * 扬彩印刷设计 + * 文件名 :IndustryLabelModel.java + * 创建人 :jiangbin + * 创建时间:2019-12-16 + */ +package com.zhiqim.yangcai.design.model; + + +/** + * [简要描述]:行业标签model
            + * [详细描述]:
            + * + * @version 1.0 @author jiangbin 2019-12-16 新建与整理 + */ +public class IndustryLabelModel +{ + private long id;// 标签ID + private long industryId;// 行业ID 注意:这里对应运营平台行业表的CODE + private String dimensionId;// 维度ID + private String labelName;// 标签名称 + private int state;// 状态:0=失效;1=生效 + + public long getId() + { + return id; + } + + public void setId(long id) + { + this.id = id; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public String getDimensionId() + { + return dimensionId; + } + + public void setDimensionId(String dimensionId) + { + this.dimensionId = dimensionId; + } + + public String getLabelName() + { + return labelName; + } + + public void setLabelName(String labelName) + { + this.labelName = labelName; + } + + public int getState() + { + return state; + } + + public void setState(int state) + { + this.state = state; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/LabelDimensionModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/LabelDimensionModel.java new file mode 100644 index 0000000..ffea673 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/LabelDimensionModel.java @@ -0,0 +1,73 @@ +/** + * 扬彩印刷设计 + * 文件名 :LabelDimensionModel.java + * 创建人 :jiangbin + * 创建时间:2019-12-18 + */ +package com.zhiqim.yangcai.design.model; + +/** + * [简要描述]:标签维度model
            + * [详细描述]:
            + * + * @version 1.0 @author jiangbin 2019-12-18 新建与整理 + */ +public class LabelDimensionModel +{ + private String dimensionId;// 维度ID + private int dimensionSeq;// 序号 + private String remark;// 备注 + private String dimensionName;// 维度名称 + private boolean isEnabled;// 状态false=失效;true=生效 + + public String getDimensionId() + { + return dimensionId; + } + + public void setDimensionId(String dimensionId) + { + this.dimensionId = dimensionId; + } + + public int getDimensionSeq() + { + return dimensionSeq; + } + + public void setDimensionSeq(int dimensionSeq) + { + this.dimensionSeq = dimensionSeq; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + + public String getDimensionName() + { + return dimensionName; + } + + public void setDimensionName(String dimensionName) + { + this.dimensionName = dimensionName; + } + + public boolean isEnabled() + { + return isEnabled; + } + + public void setEnabled(boolean isEnabled) + { + this.isEnabled = isEnabled; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/LongTailKeywordModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/LongTailKeywordModel.java new file mode 100644 index 0000000..ff31bd2 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/LongTailKeywordModel.java @@ -0,0 +1,61 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +import java.util.ArrayList; +import java.util.List; + + +/** + * 长尾词Model + * + * @version v1.0.0 @author Deng 2018-3-19 新建与整理 + */ +public class LongTailKeywordModel +{ + private String longTailKeyword; + private List mediaList = new ArrayList(); + + public String getLongTailKeyword() + { + return longTailKeyword; + } + + public void setLongTailKeyword(String longTailKeyword) + { + this.longTailKeyword = longTailKeyword; + } + + public List getMediaList() + { + return mediaList; + } + + public void setMediaList(List mediaList) + { + this.mediaList = mediaList; + } + + public boolean hasMediaId(long templateId) + { + if (mediaList == null) + return false; + + for (long mediaId : mediaList) + { + if (mediaId == templateId) + return true; + } + + return false; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/MediaTemplateViewModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/MediaTemplateViewModel.java new file mode 100644 index 0000000..4f0c4be --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/MediaTemplateViewModel.java @@ -0,0 +1,418 @@ +package com.zhiqim.yangcai.design.model; + +/** + * 用于返回带浏览数的MediaTemplateViewModel + * + * @author HuangZhiGao + * @date 2020-02-26 17:54 + */ +public class MediaTemplateViewModel +{ + private long mediaId; // 1.媒体编号 + private int templateType; // 2.模板类型: 0:临时、 10:我的草稿、 20:我的模板、 80:订单模板、 100:系统模板、 110:精品模板 + private int templateStatus; // 3.模板状态,0:未审核,1:审核中,2:已审核 + + private String designer; // 4.设计师 + private long typeId; // 5.类型编号 + private int pageValue; // 6.面数,单面=1,双面=2, 8P=8,12P=12 + + private long industryId; // 7.行业ID + private long attributeId; // 8.属性ID + private String industrySubIds; // 9.子行业ID + + private String industrySubName; // 10.子行业名称 + private String attributeIds; // 11.属性ID + private String attributeName; // 12.属性值名称 + + private String templateGroup; // 13.设计师所属小组 + private String shareDept; // 14.分享部门 + private long designId; // 15.设计订单ID + + private String themeColor; // 16.主色调 + private long keywordId; // 17.关键词ID + private String keywordName; // 18.关键词名称 + + private String keywords; // 19.关键字,多个逗号分隔 + private long templateSrc; // 20.模板来源ID + private int releaseStatus; // 21.发布状态,0:未发布,1:已发布 + + private String releaseTime; // 22.发布时间 + private String fileType; // 23.模板外部稿件后缀格式pdf、cdr、ai,多个分隔符连接 + private String mediaName; // 24.媒体名称 + + private double width; // 25.画布宽度,单位像素 + private double height; // 26.画布高度,单位像素 + private double widthMm; // 27.画布宽度,单位mm + + private double heightMm; // 28.画布高度,单位mm + private int dpi; // 29.分辨率 + private String mediaUrl; // 30.媒体参考图片 + + private String createTime; // 31.创建时间 + private String updateTime; // 32.更新时间 + private int isEdit; // 33.是否支持编辑,0:支持,1:不支持 + + private double bleedSize; // 34.出血尺寸,单位mm + + // 35.模板热度标签(1无、2精品、3推荐、4热门) + // 根据模板类型判断精品,否则根据浏览次数判断:无(<20)、推荐(>=20 <50)和热门(>=50) + private int templateHeatLabel; + + + public MediaTemplateViewModel() + { + super(); + } + + + public long getMediaId() + { + return mediaId; + } + + public void setMediaId(long mediaId) + { + this.mediaId = mediaId; + } + + public int getTemplateType() + { + return templateType; + } + + public void setTemplateType(int templateType) + { + this.templateType = templateType; + } + + public int getTemplateStatus() + { + return templateStatus; + } + + public void setTemplateStatus(int templateStatus) + { + this.templateStatus = templateStatus; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + public int getPageValue() + { + return pageValue; + } + + public void setPageValue(int pageValue) + { + this.pageValue = pageValue; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public long getAttributeId() + { + return attributeId; + } + + public void setAttributeId(long attributeId) + { + this.attributeId = attributeId; + } + + public String getIndustrySubIds() + { + return industrySubIds; + } + + public void setIndustrySubIds(String industrySubIds) + { + this.industrySubIds = industrySubIds; + } + + public String getIndustrySubName() + { + return industrySubName; + } + + public void setIndustrySubName(String industrySubName) + { + this.industrySubName = industrySubName; + } + + public String getAttributeIds() + { + return attributeIds; + } + + public void setAttributeIds(String attributeIds) + { + this.attributeIds = attributeIds; + } + + public String getAttributeName() + { + return attributeName; + } + + public void setAttributeName(String attributeName) + { + this.attributeName = attributeName; + } + + public String getTemplateGroup() + { + return templateGroup; + } + + public void setTemplateGroup(String templateGroup) + { + this.templateGroup = templateGroup; + } + + public String getShareDept() + { + return shareDept; + } + + public void setShareDept(String shareDept) + { + this.shareDept = shareDept; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getThemeColor() + { + return themeColor; + } + + public void setThemeColor(String themeColor) + { + this.themeColor = themeColor; + } + + public long getKeywordId() + { + return keywordId; + } + + public void setKeywordId(long keywordId) + { + this.keywordId = keywordId; + } + + public String getKeywordName() + { + return keywordName; + } + + public void setKeywordName(String keywordName) + { + this.keywordName = keywordName; + } + + public String getKeywords() + { + return keywords; + } + + public void setKeywords(String keywords) + { + this.keywords = keywords; + } + + public long getTemplateSrc() + { + return templateSrc; + } + + public void setTemplateSrc(long templateSrc) + { + this.templateSrc = templateSrc; + } + + public int getReleaseStatus() + { + return releaseStatus; + } + + public void setReleaseStatus(int releaseStatus) + { + this.releaseStatus = releaseStatus; + } + + public String getReleaseTime() + { + return releaseTime; + } + + public void setReleaseTime(String releaseTime) + { + this.releaseTime = releaseTime; + } + + public String getFileType() + { + return fileType; + } + + public void setFileType(String fileType) + { + this.fileType = fileType; + } + + public String getMediaName() + { + return mediaName; + } + + public void setMediaName(String mediaName) + { + this.mediaName = mediaName; + } + + public double getWidth() + { + return width; + } + + public void setWidth(double width) + { + this.width = width; + } + + public double getHeight() + { + return height; + } + + public void setHeight(double height) + { + this.height = height; + } + + public double getWidthMm() + { + return widthMm; + } + + public void setWidthMm(double widthMm) + { + this.widthMm = widthMm; + } + + public double getHeightMm() + { + return heightMm; + } + + public void setHeightMm(double heightMm) + { + this.heightMm = heightMm; + } + + public int getDpi() + { + return dpi; + } + + public void setDpi(int dpi) + { + this.dpi = dpi; + } + + public String getMediaUrl() + { + return mediaUrl; + } + + public void setMediaUrl(String mediaUrl) + { + this.mediaUrl = mediaUrl; + } + + public String getCreateTime() + { + return createTime; + } + + public void setCreateTime(String createTime) + { + this.createTime = createTime; + } + + public String getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(String updateTime) + { + this.updateTime = updateTime; + } + + public int getIsEdit() + { + return isEdit; + } + + public void setIsEdit(int isEdit) + { + this.isEdit = isEdit; + } + + public double getBleedSize() + { + return bleedSize; + } + + public void setBleedSize(double bleedSize) + { + this.bleedSize = bleedSize; + } + + public int getTemplateHeatLabel() + { + return templateHeatLabel; + } + + public void setTemplateHeatLabel(int templateHeatLabel) + { + this.templateHeatLabel = templateHeatLabel; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/MessageBusiModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/MessageBusiModel.java new file mode 100644 index 0000000..950f02f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/MessageBusiModel.java @@ -0,0 +1,82 @@ +package com.zhiqim.yangcai.design.model; + +import yangcai.messagebox.model.MessageBusi; + +/** + * 消息Model + * + * @version v1.0.0 @author jiangbin 2020-4-29 新建与整理 + */ +public class MessageBusiModel extends MessageBusi +{ + + private static final long serialVersionUID = 1L; + + private String designerCode;// 设计师code + private String designerName;// 设计师名称 + private long designerOrgId;// 设计师所属组织ID + private String designerOrgName;// 设计师所属组织名称 + private String orderStatus;// 订单状态 + private String orderStatusName;// 订单状态名称 + + public String getOrderStatus() + { + return orderStatus; + } + + public void setOrderStatus(String orderStatus) + { + this.orderStatus = orderStatus; + } + + public String getOrderStatusName() + { + return orderStatusName; + } + + public void setOrderStatusName(String orderStatusName) + { + this.orderStatusName = orderStatusName; + } + + public String getDesignerCode() + { + return designerCode; + } + + public void setDesignerCode(String designerCode) + { + this.designerCode = designerCode; + } + + public String getDesignerName() + { + return designerName; + } + + public void setDesignerName(String designerName) + { + this.designerName = designerName; + } + + public long getDesignerOrgId() + { + return designerOrgId; + } + + public void setDesignerOrgId(long designerOrgId) + { + this.designerOrgId = designerOrgId; + } + + public String getDesignerOrgName() + { + return designerOrgName; + } + + public void setDesignerOrgName(String designerOrgName) + { + this.designerOrgName = designerOrgName; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/NoticeModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/NoticeModel.java new file mode 100644 index 0000000..0bf021a --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/NoticeModel.java @@ -0,0 +1,150 @@ +package com.zhiqim.yangcai.design.model; + +import java.io.Serializable; +import java.sql.Timestamp; + +/** + * 公告表 + * + * @Author jiangbin + * @Email + * @Date 2020-04-07 11:15:06 + */ + +public class NoticeModel implements Serializable +{ + private static final long serialVersionUID = 1L; + private long id; // 公告ID + private String noticeTitle; // 公告标题 + private String noticeObject; // 公告对象(英文逗号分割) + private String noticeContent; // 公告内容 + private Timestamp releaseTime; // 发布时间 + private Timestamp offlineTime; // 下线时间 + private int state; // 状态 + private long addUserId; // 添加人ID + private Timestamp addTime; // 添加时间 + private long updateUserId; // 修改人ID + private Timestamp updateTime; // 修改时间 + private int noOfflineTime; // 1 无下线时间(虚拟字段) + + public long getId() + { + return id; + } + + public void setId(long id) + { + this.id = id; + } + + public String getNoticeTitle() + { + return noticeTitle; + } + + public void setNoticeTitle(String noticeTitle) + { + this.noticeTitle = noticeTitle; + } + + public String getNoticeObject() + { + return noticeObject; + } + + public void setNoticeObject(String noticeObject) + { + this.noticeObject = noticeObject; + } + + public String getNoticeContent() + { + return noticeContent; + } + + public void setNoticeContent(String noticeContent) + { + this.noticeContent = noticeContent; + } + + public Timestamp getReleaseTime() + { + return releaseTime; + } + + public void setReleaseTime(Timestamp releaseTime) + { + this.releaseTime = releaseTime; + } + + public Timestamp getOfflineTime() + { + return offlineTime; + } + + public void setOfflineTime(Timestamp offlineTime) + { + this.offlineTime = offlineTime; + } + + public int getState() + { + return state; + } + + public void setState(int state) + { + this.state = state; + } + + public long getAddUserId() + { + return addUserId; + } + + public void setAddUserId(long addUserId) + { + this.addUserId = addUserId; + } + + public Timestamp getAddTime() + { + return addTime; + } + + public void setAddTime(Timestamp addTime) + { + this.addTime = addTime; + } + + public long getUpdateUserId() + { + return updateUserId; + } + + public void setUpdateUserId(long updateUserId) + { + this.updateUserId = updateUserId; + } + + public Timestamp getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Timestamp updateTime) + { + this.updateTime = updateTime; + } + + public int getNoOfflineTime() + { + return noOfflineTime; + } + + public void setNoOfflineTime(int noOfflineTime) + { + this.noOfflineTime = noOfflineTime; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrdOrderStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrdOrderStatModel.java new file mode 100644 index 0000000..6db3d14 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrdOrderStatModel.java @@ -0,0 +1,1012 @@ +/** + * 扬彩印刷设计 + * 文件名 :OrdOrderStatModel.java + * 创建人 :gjx + * 创建时间:2019-11-25 + */ + +package com.zhiqim.yangcai.design.model; + +import java.sql.Timestamp; + +/** + * [简要描述]订单统计Model:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-11-25 新建与整理 + */ +public class OrdOrderStatModel +{ + private long oid; // 1.订单编号 + private String tids; // 2.淘宝单号,多个逗号分隔 + private String status; // 3.订单状态 -1 退回给售中,-2 退回给设计, -100 取消, 0 报价, 1 已提交, 1.1 等待打字 ,1.2 正在打字, 2 + // 等待设计, 3 正在设计, 4 已初稿 , 5 审稿(已定稿/待审) 6 已审核 , 7 已下单 ,8 已生产, 9 已发货 + private String shopNick; // 4.店铺昵称 + private String buyerNick; // 5.客户昵称 + private long prdTypeId; // 6.产品类型,冗余字段,便于查询 + private long productId; // 7.产品id + private String productText; // 8.产品描述,自动组装 + private String policyIds; // 9.后加工策略,多个逗号分隔 + private long amount; // 10.订单总金额 + private long productAmount; // 11.产品费 + private long productConcessionalAmount; // 产品优惠价 + private long designAmount; // 12.设计费 + private long expressAmount; // 13.物流费 + private int draftType; // 14.稿件类型:0标准自来稿、1改稿、2普通设计、3资深设计 + private int invoiceType; // 15.发票类型 + private String invoiceNotes; // 16.发票抬头 + private String invoiceItin; // 17.买家纳税识别号 + private long industryId; // 18.所属行业 + private String thumbnail; // 19.缩略图,多个逗号分隔 + private boolean isOnlyDesign; // 20.是否仅设计 + private boolean isUrgent; // 21.是否加急 + private int printWidth; // 22.印刷宽度,非常规尺寸使用 + private int printHeight; // 23.印刷高度,非常规尺寸使用 + private int printKs; // 24.印刷款数 + private int printMs; // 25.印刷模数 + private String printOrderNum; // 26.印刷第几单 + private String printSpecial; // 27.印刷特殊工艺 + private String creater; // 28.录单员 + private Timestamp createTime; // 29.录单时间 + private Timestamp modifyTime; // 30.修改时间 + private String userText; // 31.客户文本 + private String userNotice; // 32.客户注意事项 + private String userMobile; // 33.用户手机 + private String userQq; // 34.用户QQ + private String userWx; // 35.用户微信 + private String receiverName; // 36.收货人的姓名 + private String receiverMobile; // 37.收货人的手机号码 + private String receiverState; // 38.收货人的所在省份 + private String receiverCity; // 39.收货人的所在城市 + private String receiverDistrict; // 40.收货人的所在区县 + private String receiverAddress; // 41.收货人的详细地址 + private long supplierId; // 42.供应商 + private String supplierOid; // 43.供应商订单号 + private String supplierOidStatus; // 44.供应商订单生产状态 + private Timestamp supplierTime; // 45.工厂下单时间 + private String canceler; // 46.取消人 + private Timestamp cancelTime; // 47.取消时间 + private String cancelNote; // 48.取消原因 + private boolean isSendSelfAddr; // 49.是否已发送自主上传链接 + private int csCount; // 50.售后记录数 + private int orderSrc; // 51.订单来源,0:原订单,1:售后补单,2:售后赠单,3:微商单 + private long orderSrcOid; // 52.来源订单号 + private String expressCode; // 53.物流code + private int ordPost; // 54.订单是否包邮 =1表示不包邮, =1表示包邮 + private boolean isSelfPickup; // 55.是否自提印刷品 + private boolean isSfTopay; // 56.是否顺丰到付 + private boolean isMergeOrder; // 57.是否合单 + private boolean isModifyAddrSend; // 58.是否改地址过地址发货 + private int unpackingNum; // 59.订单拆包数 + private String sendWaitSureNote; // 60.发货待定备注 + private String productCostPriceJson; // 61.产品成本价Json数据 + private String policyCostPriceJsons; // 62.后加工成本价json数据 + private String cancelLation; // 63.作废原因 + private int ordShipHours; // 64.预计耗时(小时),预计耗时 = 产品预计出货时间(小时)+后加工(加工耗时) + private Timestamp ordShipTime; // 65.预计出货时间 + private String userTextReplace; // 66.格式化后的客户文本 + private long consignmentOid; // 67.平台订单 + private int sendRemindType; // 68.发货提醒类型 + private long orgId; // 69.商户组织编号 + private Timestamp orgReceiveTime; // 70.商户接单时间 + private int orderFlag; // 71.订单标记,0:正常订单,1:老用户订单(不计时效),2:老用户订单(计时效) + private int ordDesignPlatformFlag; // 72.设计订单表示 0=表示默认订单, 1=表示需要发送到设计平台,2=已发送到设计平台 + private long designId; // 73.设计平台订单号 + private Timestamp designRetrunTime; // 74.设计平台退回时间 + private int designRetrunCount; // 75.设计平台退回次数 + private String servicesMessage; // 76.客服留言 + private int isOldUser; // 77.是否未老用户 + private int qcFlag; // 78.质检标志,0表示未质检,1表示质检正常,2表示质检违规 + private Timestamp qcTime; // 79.质检时间 + private String serverManageCode; // 80.质检人 + private int isSupplierChange; // 81.是否手工指定过厂家或定时任务修改过 1是 null则不是 + private String transferName; // 82.转让人 + private String transferPassName; // 83.被转让人 + private int transferFlag; // 84.转让标志,1订单转让中,2转让通过,3转让失败 + private Timestamp transferTime; // 85.转让时间 + private String transferDesc; // 86.转让描述 + private int designCopies; // 87.设计费份数 + private int isSynchronized;// 88.是否已同步:是否已经将订单客户信息同步到淘印通,0-未同步,1-已同步 + private int showRedMark; // 89.淘宝申请退款时显示红色感叹号[0-不显示,1-显示] + + public long getOid() + { + return oid; + } + + public void setOid(long oid) + { + this.oid = oid; + } + + public String getTids() + { + return tids; + } + + public void setTids(String tids) + { + this.tids = tids; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getShopNick() + { + return shopNick; + } + + public void setShopNick(String shopNick) + { + this.shopNick = shopNick; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public long getProductId() + { + return productId; + } + + public void setProductId(long productId) + { + this.productId = productId; + } + + public String getProductText() + { + return productText; + } + + public void setProductText(String productText) + { + this.productText = productText; + } + + public String getPolicyIds() + { + return policyIds; + } + + public void setPolicyIds(String policyIds) + { + this.policyIds = policyIds; + } + + public long getAmount() + { + return amount; + } + + public void setAmount(long amount) + { + this.amount = amount; + } + + public long getProductAmount() + { + return productAmount; + } + + public void setProductAmount(long productAmount) + { + this.productAmount = productAmount; + } + + public long getProductConcessionalAmount() + { + return productConcessionalAmount; + } + + public void setProductConcessionalAmount(long productConcessionalAmount) + { + this.productConcessionalAmount = productConcessionalAmount; + } + + public long getDesignAmount() + { + return designAmount; + } + + public void setDesignAmount(long designAmount) + { + this.designAmount = designAmount; + } + + public long getExpressAmount() + { + return expressAmount; + } + + public void setExpressAmount(long expressAmount) + { + this.expressAmount = expressAmount; + } + + public int getDraftType() + { + return draftType; + } + + public void setDraftType(int draftType) + { + this.draftType = draftType; + } + + public int getInvoiceType() + { + return invoiceType; + } + + public void setInvoiceType(int invoiceType) + { + this.invoiceType = invoiceType; + } + + public String getInvoiceNotes() + { + return invoiceNotes; + } + + public void setInvoiceNotes(String invoiceNotes) + { + this.invoiceNotes = invoiceNotes; + } + + public String getInvoiceItin() + { + return invoiceItin; + } + + public void setInvoiceItin(String invoiceItin) + { + this.invoiceItin = invoiceItin; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public String getThumbnail() + { + return thumbnail; + } + + public void setThumbnail(String thumbnail) + { + this.thumbnail = thumbnail; + } + + public boolean isOnlyDesign() + { + return isOnlyDesign; + } + + public void setOnlyDesign(boolean isOnlyDesign) + { + this.isOnlyDesign = isOnlyDesign; + } + + public boolean isUrgent() + { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) + { + this.isUrgent = isUrgent; + } + + public int getPrintWidth() + { + return printWidth; + } + + public void setPrintWidth(int printWidth) + { + this.printWidth = printWidth; + } + + public int getPrintHeight() + { + return printHeight; + } + + public void setPrintHeight(int printHeight) + { + this.printHeight = printHeight; + } + + public int getPrintKs() + { + return printKs; + } + + public void setPrintKs(int printKs) + { + this.printKs = printKs; + } + + public int getPrintMs() + { + return printMs; + } + + public void setPrintMs(int printMs) + { + this.printMs = printMs; + } + + public String getPrintOrderNum() + { + return printOrderNum; + } + + public void setPrintOrderNum(String printOrderNum) + { + this.printOrderNum = printOrderNum; + } + + public String getPrintSpecial() + { + return printSpecial; + } + + public void setPrintSpecial(String printSpecial) + { + this.printSpecial = printSpecial; + } + + public String getCreater() + { + return creater; + } + + public void setCreater(String creater) + { + this.creater = creater; + } + + public Timestamp getCreateTime() + { + return createTime; + } + + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + + public String getUserText() + { + return userText; + } + + public void setUserText(String userText) + { + this.userText = userText; + } + + public String getUserNotice() + { + return userNotice; + } + + public void setUserNotice(String userNotice) + { + this.userNotice = userNotice; + } + + public String getUserMobile() + { + return userMobile; + } + + public void setUserMobile(String userMobile) + { + this.userMobile = userMobile; + } + + public String getUserQq() + { + return userQq; + } + + public void setUserQq(String userQq) + { + this.userQq = userQq; + } + + public String getUserWx() + { + return userWx; + } + + public void setUserWx(String userWx) + { + this.userWx = userWx; + } + + public String getReceiverName() + { + return receiverName; + } + + public void setReceiverName(String receiverName) + { + this.receiverName = receiverName; + } + + public String getReceiverMobile() + { + return receiverMobile; + } + + public void setReceiverMobile(String receiverMobile) + { + this.receiverMobile = receiverMobile; + } + + public String getReceiverState() + { + return receiverState; + } + + public void setReceiverState(String receiverState) + { + this.receiverState = receiverState; + } + + public String getReceiverCity() + { + return receiverCity; + } + + public void setReceiverCity(String receiverCity) + { + this.receiverCity = receiverCity; + } + + public String getReceiverDistrict() + { + return receiverDistrict; + } + + public void setReceiverDistrict(String receiverDistrict) + { + this.receiverDistrict = receiverDistrict; + } + + public String getReceiverAddress() + { + return receiverAddress; + } + + public void setReceiverAddress(String receiverAddress) + { + this.receiverAddress = receiverAddress; + } + + public long getSupplierId() + { + return supplierId; + } + + public void setSupplierId(long supplierId) + { + this.supplierId = supplierId; + } + + public String getSupplierOid() + { + return supplierOid; + } + + public void setSupplierOid(String supplierOid) + { + this.supplierOid = supplierOid; + } + + public String getSupplierOidStatus() + { + return supplierOidStatus; + } + + public void setSupplierOidStatus(String supplierOidStatus) + { + this.supplierOidStatus = supplierOidStatus; + } + + public Timestamp getSupplierTime() + { + return supplierTime; + } + + public void setSupplierTime(Timestamp supplierTime) + { + this.supplierTime = supplierTime; + } + + public String getCanceler() + { + return canceler; + } + + public void setCanceler(String canceler) + { + this.canceler = canceler; + } + + public Timestamp getCancelTime() + { + return cancelTime; + } + + public void setCancelTime(Timestamp cancelTime) + { + this.cancelTime = cancelTime; + } + + public String getCancelNote() + { + return cancelNote; + } + + public void setCancelNote(String cancelNote) + { + this.cancelNote = cancelNote; + } + + public boolean isSendSelfAddr() + { + return isSendSelfAddr; + } + + public void setSendSelfAddr(boolean isSendSelfAddr) + { + this.isSendSelfAddr = isSendSelfAddr; + } + + public int getCsCount() + { + return csCount; + } + + public void setCsCount(int csCount) + { + this.csCount = csCount; + } + + public int getOrderSrc() + { + return orderSrc; + } + + public void setOrderSrc(int orderSrc) + { + this.orderSrc = orderSrc; + } + + public long getOrderSrcOid() + { + return orderSrcOid; + } + + public void setOrderSrcOid(long orderSrcOid) + { + this.orderSrcOid = orderSrcOid; + } + + public String getExpressCode() + { + return expressCode; + } + + public void setExpressCode(String expressCode) + { + this.expressCode = expressCode; + } + + public int getOrdPost() + { + return ordPost; + } + + public void setOrdPost(int ordPost) + { + this.ordPost = ordPost; + } + + public boolean isSelfPickup() + { + return isSelfPickup; + } + + public void setSelfPickup(boolean isSelfPickup) + { + this.isSelfPickup = isSelfPickup; + } + + public boolean isSfTopay() + { + return isSfTopay; + } + + public void setSfTopay(boolean isSfTopay) + { + this.isSfTopay = isSfTopay; + } + + public boolean isMergeOrder() + { + return isMergeOrder; + } + + public void setMergeOrder(boolean isMergeOrder) + { + this.isMergeOrder = isMergeOrder; + } + + public boolean isModifyAddrSend() + { + return isModifyAddrSend; + } + + public void setModifyAddrSend(boolean isModifyAddrSend) + { + this.isModifyAddrSend = isModifyAddrSend; + } + + public int getUnpackingNum() + { + return unpackingNum; + } + + public void setUnpackingNum(int unpackingNum) + { + this.unpackingNum = unpackingNum; + } + + public String getSendWaitSureNote() + { + return sendWaitSureNote; + } + + public void setSendWaitSureNote(String sendWaitSureNote) + { + this.sendWaitSureNote = sendWaitSureNote; + } + + public String getProductCostPriceJson() + { + return productCostPriceJson; + } + + public void setProductCostPriceJson(String productCostPriceJson) + { + this.productCostPriceJson = productCostPriceJson; + } + + public String getPolicyCostPriceJsons() + { + return policyCostPriceJsons; + } + + public void setPolicyCostPriceJsons(String policyCostPriceJsons) + { + this.policyCostPriceJsons = policyCostPriceJsons; + } + + public String getCancelLation() + { + return cancelLation; + } + + public void setCancelLation(String cancelLation) + { + this.cancelLation = cancelLation; + } + + public int getOrdShipHours() + { + return ordShipHours; + } + + public void setOrdShipHours(int ordShipHours) + { + this.ordShipHours = ordShipHours; + } + + public Timestamp getOrdShipTime() + { + return ordShipTime; + } + + public void setOrdShipTime(Timestamp ordShipTime) + { + this.ordShipTime = ordShipTime; + } + + public String getUserTextReplace() + { + return userTextReplace; + } + + public void setUserTextReplace(String userTextReplace) + { + this.userTextReplace = userTextReplace; + } + + public long getConsignmentOid() + { + return consignmentOid; + } + + public void setConsignmentOid(long consignmentOid) + { + this.consignmentOid = consignmentOid; + } + + public int getSendRemindType() + { + return sendRemindType; + } + + public void setSendRemindType(int sendRemindType) + { + this.sendRemindType = sendRemindType; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public Timestamp getOrgReceiveTime() + { + return orgReceiveTime; + } + + public void setOrgReceiveTime(Timestamp orgReceiveTime) + { + this.orgReceiveTime = orgReceiveTime; + } + + public int getOrderFlag() + { + return orderFlag; + } + + public void setOrderFlag(int orderFlag) + { + this.orderFlag = orderFlag; + } + + public int getOrdDesignPlatformFlag() + { + return ordDesignPlatformFlag; + } + + public void setOrdDesignPlatformFlag(int ordDesignPlatformFlag) + { + this.ordDesignPlatformFlag = ordDesignPlatformFlag; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public Timestamp getDesignRetrunTime() + { + return designRetrunTime; + } + + public void setDesignRetrunTime(Timestamp designRetrunTime) + { + this.designRetrunTime = designRetrunTime; + } + + public int getDesignRetrunCount() + { + return designRetrunCount; + } + + public void setDesignRetrunCount(int designRetrunCount) + { + this.designRetrunCount = designRetrunCount; + } + + public String getServicesMessage() + { + return servicesMessage; + } + + public void setServicesMessage(String servicesMessage) + { + this.servicesMessage = servicesMessage; + } + + public int getIsOldUser() + { + return isOldUser; + } + + public void setIsOldUser(int isOldUser) + { + this.isOldUser = isOldUser; + } + + public int getQcFlag() + { + return qcFlag; + } + + public void setQcFlag(int qcFlag) + { + this.qcFlag = qcFlag; + } + + public Timestamp getQcTime() + { + return qcTime; + } + + public void setQcTime(Timestamp qcTime) + { + this.qcTime = qcTime; + } + + public String getServerManageCode() + { + return serverManageCode; + } + + public void setServerManageCode(String serverManageCode) + { + this.serverManageCode = serverManageCode; + } + + public int getIsSupplierChange() + { + return isSupplierChange; + } + + public void setIsSupplierChange(int isSupplierChange) + { + this.isSupplierChange = isSupplierChange; + } + + public String getTransferName() + { + return transferName; + } + + public void setTransferName(String transferName) + { + this.transferName = transferName; + } + + public String getTransferPassName() + { + return transferPassName; + } + + public void setTransferPassName(String transferPassName) + { + this.transferPassName = transferPassName; + } + + public int getTransferFlag() + { + return transferFlag; + } + + public void setTransferFlag(int transferFlag) + { + this.transferFlag = transferFlag; + } + + public Timestamp getTransferTime() + { + return transferTime; + } + + public void setTransferTime(Timestamp transferTime) + { + this.transferTime = transferTime; + } + + public String getTransferDesc() + { + return transferDesc; + } + + public void setTransferDesc(String transferDesc) + { + this.transferDesc = transferDesc; + } + + public int getDesignCopies() + { + return designCopies; + } + + public void setDesignCopies(int designCopies) + { + this.designCopies = designCopies; + } + + public int getIsSynchronized() + { + return isSynchronized; + } + + public void setIsSynchronized(int isSynchronized) + { + this.isSynchronized = isSynchronized; + } + + public int getShowRedMark() + { + return showRedMark; + } + + public void setShowRedMark(int showRedMark) + { + this.showRedMark = showRedMark; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderBackEffectInfoStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderBackEffectInfoStatModel.java new file mode 100644 index 0000000..bccf5d9 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderBackEffectInfoStatModel.java @@ -0,0 +1,117 @@ +/** + * 扬彩印刷设计 + * 文件名 :OrderBackEffectInfoStatModel.java + * 创建人 :gjx + * 创建时间:2019-9-19 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * 退回时效统计详细Model + * + * @version 1.0 @author gjx 2019-9-19 新建与整理 + */ +public class OrderBackEffectInfoStatModel +{ + private long designId; // 设订单编号,设计平台独立编号 + private String shopNick; // 店铺名称 + private String buyerNick; // 客户昵称 + private String designer; // 设计师 + private String orderText; // 订单描述 + private long amount; // 订单总金额 + private int backCount;// 退回次数 + private int backOverCount;// 退回超时次数 + private String backTotalTime;// 退回累计用时 + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getShopNick() + { + return shopNick; + } + + public void setShopNick(String shopNick) + { + this.shopNick = shopNick; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public long getAmount() + { + return amount; + } + + public void setAmount(long amount) + { + this.amount = amount; + } + + public int getBackCount() + { + return backCount; + } + + public void setBackCount(int backCount) + { + this.backCount = backCount; + } + + public int getBackOverCount() + { + return backOverCount; + } + + public void setBackOverCount(int backOverCount) + { + this.backOverCount = backOverCount; + } + + public String getBackTotalTime() + { + return backTotalTime; + } + + public void setBackTotalTime(String backTotalTime) + { + this.backTotalTime = backTotalTime; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderBackEffectStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderBackEffectStatModel.java new file mode 100644 index 0000000..f0264ab --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderBackEffectStatModel.java @@ -0,0 +1,73 @@ +/** + * 扬彩印刷设计 + * 文件名 :OrderBackEffectStatModel.java + * 创建人 :gjx + * 创建时间:2019-9-19 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * 退回时效Model + * + * @version 1.0 @author gjx 2019-9-19 新建与整理 + */ +public class OrderBackEffectStatModel implements Comparable +{ + private String designer;// 设计师 + private int backCount;// 退回次数 + private int backOverCount;// 退回超时次数 + private double backOverPercent;// 超时比 + + public OrderBackEffectStatModel(String designer) + { + this.designer = designer; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public int getBackCount() + { + return backCount; + } + + public void setBackCount(int backCount) + { + this.backCount = backCount; + } + + public int getBackOverCount() + { + return backOverCount; + } + + public void setBackOverCount(int backOverCount) + { + this.backOverCount = backOverCount; + } + + public double getBackOverPercent() + { + return backOverPercent; + } + + public void setBackOverPercent(double backOverPercent) + { + this.backOverPercent = backOverPercent; + } + + @Override + public int compareTo(OrderBackEffectStatModel o) + { + return this.backCount - o.getBackCount(); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderCheckModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderCheckModel.java new file mode 100644 index 0000000..1fa0bdb --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderCheckModel.java @@ -0,0 +1,90 @@ +package com.zhiqim.yangcai.design.model; + +import java.sql.Timestamp; + +/** + * 订单审核数据model + * + * @version v1.0.0 @author caohong + */ +public class OrderCheckModel +{ + private String designer; // 设计师 + private int orderCount; // 单数 + private int orderPassCount; // 审核通过单数 + private String passRatio; // 审核通过比例 + private String backReason; // 审核退回原因 + private Timestamp backTime; // 审核退回时间 + private String backReasonPicUrl; // 审核退回原因截图 + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public int getOrderCount() + { + return orderCount; + } + + public void setOrderCount(int orderCount) + { + this.orderCount = orderCount; + } + + public int getOrderPassCount() + { + return orderPassCount; + } + + public void setOrderPassCount(int orderPassCount) + { + this.orderPassCount = orderPassCount; + } + + public String getPassRatio() + { + return passRatio; + } + + public void setPassRatio(String passRatio) + { + this.passRatio = passRatio; + } + + public String getBackReason() + { + return backReason; + } + + public void setBackReason(String backReason) + { + this.backReason = backReason; + } + + public Timestamp getBackTime() + { + return backTime; + } + + public void setBackTime(Timestamp backTime) + { + this.backTime = backTime; + } + + public String getBackReasonPicUrl() + { + return backReasonPicUrl; + } + + public void setBackReasonPicUrl(String backReasonPicUrl) + { + this.backReasonPicUrl = backReasonPicUrl; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderInfoModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderInfoModel.java new file mode 100644 index 0000000..85474e8 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderInfoModel.java @@ -0,0 +1,33 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.model; + +/** + * 订单信息model类 + * + * @version v1.0.0 @author zhouwenbin 2017-8-29 新建与整理 + */ +public class OrderInfoModel +{ + private OrdOrderStatModel order; + + public OrdOrderStatModel getOrder() + { + return order; + } + + public void setOrder(OrdOrderStatModel order) + { + this.order = order; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderTypeStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderTypeStatModel.java new file mode 100644 index 0000000..76d56d8 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/OrderTypeStatModel.java @@ -0,0 +1,209 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +/** + * 订单类型统计model + * + * @version v1.0.0 @author liuhu 2018-12-13 新建与整理 + */ +public class OrderTypeStatModel implements Comparable +{ + private String designer; //设计师 + private int orderSum; //订单总数量 + private int multiple3_5; //3-5款订单数量 + private int multiple6_8; //6-8款订单数量 + private int multiple9_11; //9-11款订单数量 + private int multiple12; //12款以上数量 + private int normalProcessing; //常规后加工订单数量 + private int specialProcessing;//特殊后加工订单数量 + private int applyOrder; //支援订单数量 + private int amount100_150; //100-150金额订单数量 (左闭右开) + private int amount150_200; //150-200金额订单数量 + private int amount200_250; //200_250金额订单数量 + private int amount250_300; //250_300金额订单数量 + private int amount300_350; //300_350金额订单数量 + private int amount350_400; //350_400金额订单数量 + private int amount400_450; //400_450金额订单数量 + private int amount450_500; //450_500金额订单数量 + private int amount500; //500金额以上订单数量 + private long amount; //绩效金额(单位分) + + public OrderTypeStatModel(String designer) + { + this.designer = designer; + } + + public int getOrderSum() + { + return orderSum; + } + + public void setOrderSum(int orderSum) + { + this.orderSum = orderSum; + } + + public String getDesigner() + { + return designer; + } + public void setDesigner(String designer) + { + this.designer = designer; + } + public int getMultiple3_5() + { + return multiple3_5; + } + public void setMultiple3_5(int multiple3_5) + { + this.multiple3_5 = multiple3_5; + } + public int getMultiple6_8() + { + return multiple6_8; + } + public void setMultiple6_8(int multiple6_8) + { + this.multiple6_8 = multiple6_8; + } + public int getMultiple9_11() + { + return multiple9_11; + } + public void setMultiple9_11(int multiple9_11) + { + this.multiple9_11 = multiple9_11; + } + public int getMultiple12() + { + return multiple12; + } + public void setMultiple12(int multiple12) + { + this.multiple12 = multiple12; + } + public int getNormalProcessing() + { + return normalProcessing; + } + public void setNormalProcessing(int normalProcessing) + { + this.normalProcessing = normalProcessing; + } + public int getSpecialProcessing() + { + return specialProcessing; + } + public void setSpecialProcessing(int specialProcessing) + { + this.specialProcessing = specialProcessing; + } + public int getApplyOrder() + { + return applyOrder; + } + public void setApplyOrder(int applyOrder) + { + this.applyOrder = applyOrder; + } + public int getAmount100_150() + { + return amount100_150; + } + public void setAmount100_150(int amount100_150) + { + this.amount100_150 = amount100_150; + } + public int getAmount150_200() + { + return amount150_200; + } + public void setAmount150_200(int amount150_200) + { + this.amount150_200 = amount150_200; + } + public int getAmount200_250() + { + return amount200_250; + } + public void setAmount200_250(int amount200_250) + { + this.amount200_250 = amount200_250; + } + public int getAmount250_300() + { + return amount250_300; + } + public void setAmount250_300(int amount250_300) + { + this.amount250_300 = amount250_300; + } + public int getAmount300_350() + { + return amount300_350; + } + public void setAmount300_350(int amount300_350) + { + this.amount300_350 = amount300_350; + } + public int getAmount350_400() + { + return amount350_400; + } + public void setAmount350_400(int amount350_400) + { + this.amount350_400 = amount350_400; + } + public int getAmount400_450() + { + return amount400_450; + } + public void setAmount400_450(int amount400_450) + { + this.amount400_450 = amount400_450; + } + public int getAmount450_500() + { + return amount450_500; + } + public void setAmount450_500(int amount450_500) + { + this.amount450_500 = amount450_500; + } + public int getAmount500() + { + return amount500; + } + public void setAmount500(int amount500) + { + this.amount500 = amount500; + } + + public long getAmount() + { + return amount; + } + + public void setAmount(long amount) + { + this.amount = amount; + } + + @Override + public int compareTo(OrderTypeStatModel o) + { + return (int) -(this.getAmount() - o.getAmount()); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/PerformanceStatCalculModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/PerformanceStatCalculModel.java new file mode 100644 index 0000000..5c33800 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/PerformanceStatCalculModel.java @@ -0,0 +1,73 @@ +/** + * 扬彩印刷设计 + * 文件名 :PerformanceStatCalculModel.java + * 创建人 :gjx + * 创建时间:2019-9-9 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * 绩效统计计算Model + * + * @version 1.0 @author gjx 2019-9-9 新建与整理 + */ +public class PerformanceStatCalculModel +{ + private double designCompleteSum;// 组单量 + private long refundRate; // 组退款率 + private long refundAmount;// 组退款率奖罚 + private double qcScore; // 组质检分数 + private long qcAmount;// 组质检奖罚 + + public double getDesignCompleteSum() + { + return designCompleteSum; + } + + public void setDesignCompleteSum(double designCompleteSum) + { + this.designCompleteSum = designCompleteSum; + } + + public long getRefundRate() + { + return refundRate; + } + + public void setRefundRate(long refundRate) + { + this.refundRate = refundRate; + } + + public long getRefundAmount() + { + return refundAmount; + } + + public void setRefundAmount(long refundAmount) + { + this.refundAmount = refundAmount; + } + + public double getQcScore() + { + return qcScore; + } + + public void setQcScore(double qcScore) + { + this.qcScore = qcScore; + } + + public long getQcAmount() + { + return qcAmount; + } + + public void setQcAmount(long qcAmount) + { + this.qcAmount = qcAmount; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/PerformanceStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/PerformanceStatModel.java new file mode 100644 index 0000000..279229e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/PerformanceStatModel.java @@ -0,0 +1,52 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +/** + * 绩效统计DTO + * + * @version v1.0.0 @author liuhu 2019-1-5 新建与整理 + */ +public class PerformanceStatModel implements Comparable +{ + private String designer; //设计师 + private long designAmount; //设计金额 + + public PerformanceStatModel(String designer) + { + this.designer = designer; + } + + public String getDesigner() + { + return designer; + } + public void setDesigner(String designer) + { + this.designer = designer; + } + public long getDesignAmount() + { + return designAmount; + } + public void setDesignAmount(long designAmount) + { + this.designAmount = designAmount; + } + + @Override + public int compareTo(PerformanceStatModel o) + {//根据金额排序 + return -(int)(this.designAmount - o.designAmount); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/PreSaleCommissionStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/PreSaleCommissionStatModel.java new file mode 100644 index 0000000..720a670 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/PreSaleCommissionStatModel.java @@ -0,0 +1,55 @@ +package com.zhiqim.yangcai.design.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * + * [简要描述]售前提成Model:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-11-21 新建与整理 + */ +public class PreSaleCommissionStatModel +{ + private String userName; // 1.售前人员 + private long amount; // 2.提成金额 + private Map proMap = new HashMap<>();// 3. 类型 | 金额 + + public PreSaleCommissionStatModel(String userName, long amount) + { + this.userName = userName; + this.amount = amount; + } + + public String getUserName() + { + return userName; + } + + public void setUserName(String userName) + { + this.userName = userName; + } + + public long getAmount() + { + return amount; + } + + public void setAmount(long d) + { + this.amount = d; + } + + public Map getProMap() + { + return proMap; + } + + public void setProMap(Map proMap) + { + this.proMap = proMap; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/PreSaleOrderStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/PreSaleOrderStatModel.java new file mode 100644 index 0000000..fd51241 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/PreSaleOrderStatModel.java @@ -0,0 +1,55 @@ +package com.zhiqim.yangcai.design.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * + * [简要描述]售前订单统计Model:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-11-21 新建与整理 + */ +public class PreSaleOrderStatModel +{ + private String userName; // 1.售前人员 + private int totalNumber; // 2.订单总数 + private Map proMap = new HashMap<>();// <产品类型,数量> + + public PreSaleOrderStatModel(String userName, int totalNumber) + { + this.userName = userName; + this.totalNumber = totalNumber; + } + + public String getUserName() + { + return userName; + } + + public void setUserName(String userName) + { + this.userName = userName; + } + + public int getTotalNumber() + { + return totalNumber; + } + + public void setTotalNumber(int totalNumber) + { + this.totalNumber = totalNumber; + } + + public Map getProMap() + { + return proMap; + } + + public void setProMap(Map proMap) + { + this.proMap = proMap; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/QcDisposeModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/QcDisposeModel.java new file mode 100644 index 0000000..97c578a --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/QcDisposeModel.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +/** + * 质检处理情况model + * + * @version v1.0.0 @author liuhu 2019-1-28 新建与整理 + */ +public class QcDisposeModel implements Comparable +{ + private String operatorCode; //处理人 + private int qcCount; //质检单数 + private int normalCount; //质检正常单数 + private int violationsCount; //质检违规单数; + + public QcDisposeModel(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public String getOperatorCode() + { + return operatorCode; + } + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + public int getQcCount() + { + return qcCount; + } + public void setQcCount(int qcCount) + { + this.qcCount = qcCount; + } + public int getNormalCount() + { + return normalCount; + } + public void setNormalCount(int normalCount) + { + this.normalCount = normalCount; + } + public int getViolationsCount() + { + return violationsCount; + } + public void setViolationsCount(int violationsCount) + { + this.violationsCount = violationsCount; + } + + @Override + public int compareTo(QcDisposeModel o) + {//按处理单数倒序 + return -(this.qcCount - o.qcCount); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/QcReasonModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/QcReasonModel.java new file mode 100644 index 0000000..c254478 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/QcReasonModel.java @@ -0,0 +1,46 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +/** + * 质检违规原因DTO + * + * @version v1.0.0 @author liuhu 2019-1-24 新建与整理 + */ +public class QcReasonModel +{ + + private String qcReason; //质检违规原因 + private int count; //质检违规次数 + + public QcReasonModel(String qcReason) + { + this.qcReason = qcReason; + } + public String getQcReason() + { + return qcReason; + } + public void setQcReason(String qcReason) + { + this.qcReason = qcReason; + } + public int getCount() + { + return count; + } + public void setCount(int count) + { + this.count = count; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/QcStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/QcStatModel.java new file mode 100644 index 0000000..09d38d2 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/QcStatModel.java @@ -0,0 +1,74 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.model; + +import com.zhiqim.yangcai.design.constant.PerformanceStatConstants; + +/** + * 质检统计model + * + * @version v1.0.0 @author liuhu 2019-1-28 新建与整理 + */ +public class QcStatModel +{ + private String designer; // 设计师 + private double qcScore; // 质检分数 默认12分 + private double punishScore; // 扣罚分数 + private double rewardScore; // 奖励分数 + + public QcStatModel(String designer) + { + this.designer = designer; + this.qcScore = PerformanceStatConstants.QC_SCORE; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public double getQcScore() + { + return qcScore; + } + + public void setQcScore(double qcScore) + { + this.qcScore = qcScore; + } + + public double getPunishScore() + { + return punishScore; + } + + public void setPunishScore(double punishScore) + { + this.punishScore = punishScore; + } + + public double getRewardScore() + { + return rewardScore; + } + + public void setRewardScore(double rewardScore) + { + this.rewardScore = rewardScore; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/SectionFinalizeCompleteStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/SectionFinalizeCompleteStatModel.java new file mode 100644 index 0000000..050ce65 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/SectionFinalizeCompleteStatModel.java @@ -0,0 +1,83 @@ +/** + * 扬彩印刷设计 + * 文件名 :SectionFinalizeCompleteStatModel.java + * 创建人 :gjx + * 创建时间:2019-11-22 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * [简要描述]部门退回统计Model:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-11-22 新建与整理 + */ +public class SectionFinalizeCompleteStatModel +{ + private String deptName; // 部门名称 + private int deptFinalizeCount; // 部门定稿单数 + private int deptBackSum;// 部门退回次数 + private int deptBackCount;// 部门退回单数 + private long deptBackMoney;// 部门损失金额 + + public SectionFinalizeCompleteStatModel(String deptName) + { + this.deptName = deptName; + this.deptFinalizeCount = 0; + this.deptBackSum = 0; + this.deptBackCount = 0; + this.deptBackMoney = 0; + } + + public String getDeptName() + { + return deptName; + } + + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public int getDeptFinalizeCount() + { + return deptFinalizeCount; + } + + public void setDeptFinalizeCount(int deptFinalizeCount) + { + this.deptFinalizeCount = deptFinalizeCount; + } + + public int getDeptBackSum() + { + return deptBackSum; + } + + public void setDeptBackSum(int deptBackSum) + { + this.deptBackSum = deptBackSum; + } + + public int getDeptBackCount() + { + return deptBackCount; + } + + public void setDeptBackCount(int deptBackCount) + { + this.deptBackCount = deptBackCount; + } + + public long getDeptBackMoney() + { + return deptBackMoney; + } + + public void setDeptBackMoney(long deptBackMoney) + { + this.deptBackMoney = deptBackMoney; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/StatPrdTypeStrModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/StatPrdTypeStrModel.java new file mode 100644 index 0000000..56f2448 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/StatPrdTypeStrModel.java @@ -0,0 +1,88 @@ +package com.zhiqim.yangcai.design.model; + +import java.util.HashMap; +import java.util.List; + +import org.zhiqim.kernel.Global; + +import com.zhiqim.yangcai.cache.DesignTypeCache; +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/** + * 产品类型数量详情MODEL + * + * @version v1.0.0 @author Deng 2017-9-21 新建与整理 + */ +public class StatPrdTypeStrModel +{ + private HashMap typeInfo = new HashMap(); + + public StatPrdTypeStrModel() + { + List typeList = Global.get(DesignTypeCache.class).getListAll(); + for (DesignType t : typeList) + { + this.typeInfo.put(t.getTypeName(), 0); + } + } + + public int getTypeInfo(String typeName) + { + if (this.typeInfo.containsKey(typeName)) + { + return this.typeInfo.get(typeName); + } + + return 0; + } + + public int getTypeInfo(long typeid) + { + DesignType type = Global.get(DesignTypeCache.class).get(typeid); + if (type == null) + { + return 0; + } + + if (this.typeInfo.containsKey(type.getTypeName())) + { + return this.typeInfo.get(type.getTypeName()); + } + + return 0; + } + + public void setTypeInfo(String typeName, int value) + { + + if (this.typeInfo.containsKey(typeName)) + { + this.typeInfo.put(typeName, value); + } + } + + public HashMap getTypeInfo() + { + return typeInfo; + } + + public void setTypeInfo(HashMap typeInfo) + { + this.typeInfo = typeInfo; + } + + public String export() + { + if (typeInfo == null || typeInfo.size() == 0) + { + return ""; + } + String info = ""; + for (String key : typeInfo.keySet()) + { + info += key + ":" + typeInfo.get(key) + " "; + } + + return info; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/StatSelfdraftDayModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/StatSelfdraftDayModel.java new file mode 100644 index 0000000..a36a136 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/StatSelfdraftDayModel.java @@ -0,0 +1,140 @@ +/** + * 扬彩印刷设计 + * 文件名 :StatSelfdraftDayModel.java + * 创建人 :gjx + * 创建时间:2019-11-25 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * [简要描述]自来稿日统计表:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-11-25 新建与整理 + */ +public class StatSelfdraftDayModel +{ + private String dayCode; // 1.日期 + private String operatorCode; // 2.操作CODE + private int addNum; // 3.初稿新增数 + private int cancelNum; // 4.初稿取消数 + private int historyNum; // 5.历史取消数 + private int recevieNum; // 6.被别人领取数 + private int vaildNum; // 7.有效初稿数(新增数-取消数-历史取消数-被别人领取数) + private String addNumStr; // 8.初稿新增数详情 + private String cancelNumStr; // 9.初稿取消数详情 + private String historyNumStr; // 10.历史取消数详情 + private String recevieNumStr; // 11.被别人领取数详情 + + public String getDayCode() + { + return dayCode; + } + + public void setDayCode(String dayCode) + { + this.dayCode = dayCode; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public int getAddNum() + { + return addNum; + } + + public void setAddNum(int addNum) + { + this.addNum = addNum; + } + + public int getCancelNum() + { + return cancelNum; + } + + public void setCancelNum(int cancelNum) + { + this.cancelNum = cancelNum; + } + + public int getHistoryNum() + { + return historyNum; + } + + public void setHistoryNum(int historyNum) + { + this.historyNum = historyNum; + } + + public int getRecevieNum() + { + return recevieNum; + } + + public void setRecevieNum(int recevieNum) + { + this.recevieNum = recevieNum; + } + + public int getVaildNum() + { + return vaildNum; + } + + public void setVaildNum(int vaildNum) + { + this.vaildNum = vaildNum; + } + + public String getAddNumStr() + { + return addNumStr; + } + + public void setAddNumStr(String addNumStr) + { + this.addNumStr = addNumStr; + } + + public String getCancelNumStr() + { + return cancelNumStr; + } + + public void setCancelNumStr(String cancelNumStr) + { + this.cancelNumStr = cancelNumStr; + } + + public String getHistoryNumStr() + { + return historyNumStr; + } + + public void setHistoryNumStr(String historyNumStr) + { + this.historyNumStr = historyNumStr; + } + + public String getRecevieNumStr() + { + return recevieNumStr; + } + + public void setRecevieNumStr(String recevieNumStr) + { + this.recevieNumStr = recevieNumStr; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/StatSelfraftListingModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/StatSelfraftListingModel.java new file mode 100644 index 0000000..0e30dc4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/StatSelfraftListingModel.java @@ -0,0 +1,84 @@ +package com.zhiqim.yangcai.design.model; + +import org.zhiqim.kernel.json.Jsons; + +/** + * 自来稿日统计清单Model + */ +public class StatSelfraftListingModel +{ + + private String dayCode; // 1.日期 + private String operatorCode; // 2.操作CODE + private long oid; // 3.订单OID + private long prdTypeId; // 4.产品类型ID + private String statType; // 5.统计类型 + private String listingInfo; // 6.清单明细 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getDayCode() + { + return dayCode; + } + + public void setDayCode(String dayCode) + { + this.dayCode = dayCode; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getOid() + { + return oid; + } + + public void setOid(long oid) + { + this.oid = oid; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public String getStatType() + { + return statType; + } + + public void setStatType(String statType) + { + this.statType = statType; + } + + public String getListingInfo() + { + return listingInfo; + } + + public void setListingInfo(String listingInfo) + { + this.listingInfo = listingInfo; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/SubscribeDesignerQuotaRecordModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/SubscribeDesignerQuotaRecordModel.java new file mode 100644 index 0000000..8aad089 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/SubscribeDesignerQuotaRecordModel.java @@ -0,0 +1,132 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ +package com.zhiqim.yangcai.design.model; + +import com.zhiqim.yangcai.design.dbo.subscribe.SubscribeDesignerQuotaRecord; +import com.zhiqim.yangcai.design.dbo.utils.LunarCalendarUtil; + +public class SubscribeDesignerQuotaRecordModel extends SubscribeDesignerQuotaRecord +{ + private static final long serialVersionUID = 1L; + private String dutyMonth; + private int dutyTime; + private int subscribeState; + private int year; + private int month; + private int day; + private String LunarDay; + private int canSubscribe; + + public void setDutyMonth(String dutyMonth) + { + this.dutyMonth = dutyMonth; + } + + public String getDutyMonth() + { + return this.dutyMonth; + } + + public void setDutyTime(int year, int month, int day) + { + this.dutyTime = (year * 10000 + month * 100 + day); + + this.year = year; + this.month = month; + this.day = day; + LunarCalendarUtil lunarCalendarUtil = new LunarCalendarUtil(); + this.LunarDay = lunarCalendarUtil.getLunarDate(year, month, day, true); + } + + @Override + public void setDutyTime(int dutyTime) + { + this.dutyTime = dutyTime; + + this.year = (dutyTime / 10000); + this.month = (dutyTime / 100 % 100); + this.day = (dutyTime % 100); + } + + @Override + public int getDutyTime() + { + return this.dutyTime; + } + + @Override + public void setSubscribeState(int subscribeState) + { + this.subscribeState = subscribeState; + } + + @Override + public int getSubscribeState() + { + return this.subscribeState; + } + + public int getYear() + { + return this.year; + } + + public int getMonth() + { + return this.month; + } + + public int getDay() + { + return this.day; + } + + public String getLunarDay() + { + return LunarDay; + } + + public void setLunarDay(String lunarDay) + { + LunarDay = lunarDay; + } + + public void setYear(int year) + { + this.year = year; + } + + public void setMonth(int month) + { + this.month = month; + } + + public void setDay(int day) + { + this.day = day; + } + + public int getCanSubscribe() + { + return this.canSubscribe; + } + + public void setCanSubscribe(int canSubscribe) + { + this.canSubscribe = canSubscribe; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/SvgDataModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/SvgDataModel.java new file mode 100644 index 0000000..b0716ed --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/SvgDataModel.java @@ -0,0 +1,109 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +import java.util.ArrayList; +import java.util.List; + +import com.zhiqim.media.service.model.MediaModel; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; + +/** + * SVG缓存model类 + * @version v1.0.0 @author zhouwenbin 2017-11-17 新建与整理 + */ +public class SvgDataModel +{ + private long oldMediaId; + private String oldMeidaUrl; + private int width; + private int height; + private List svgList = new ArrayList<>(); + private MediaModel media; + private MediaTemplate template; + + public SvgDataModel(int width, int height) + { + this.width = width; + this.height = height; + } + + public long getOldMediaId() + { + return oldMediaId; + } + + public void setOldMediaId(long oldMediaId) + { + this.oldMediaId = oldMediaId; + } + + public String getOldMeidaUrl() + { + return oldMeidaUrl; + } + + public void setOldMeidaUrl(String oldMeidaUrl) + { + this.oldMeidaUrl = oldMeidaUrl; + } + + public int getWidth() + { + return width; + } + + public void setWidth(int width) + { + this.width = width; + } + + public int getHeight() + { + return height; + } + + public void setHeight(int height) + { + this.height = height; + } + + public List getSvgList() + { + return svgList; + } + + public void setSvgList(List svgList) + { + this.svgList = svgList; + } + + public MediaModel getMedia() + { + return media; + } + + public void setMedia(MediaModel media) + { + this.media = media; + } + + public MediaTemplate getTemplate() + { + return template; + } + + public void setTemplate(MediaTemplate template) + { + this.template = template; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TemplateDataModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TemplateDataModel.java new file mode 100644 index 0000000..a13a05a --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TemplateDataModel.java @@ -0,0 +1,39 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +/** + * 缓存模板Model + * + * @version v1.0.0 @author Deng 2017-12-27 新建与整理 + */ +public class TemplateDataModel +{ + private long mediaId; + private String meidaUrl; + + public TemplateDataModel(long mediaId, String meidaUrl) + { + this.mediaId = mediaId; + this.meidaUrl = meidaUrl; + } + + public long getMediaId() + { + return mediaId; + } + + public String getMeidaUrl() + { + return meidaUrl; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TimelinessOrgStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TimelinessOrgStatModel.java new file mode 100644 index 0000000..3b4566f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TimelinessOrgStatModel.java @@ -0,0 +1,124 @@ +/** + * 扬彩印刷设计 + * 文件名 :TimelinessOrgStatModel.java + * 创建人 :高佳新 + * 创建时间:2019-7-11 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * + * 组织时效统计Model + * + * @version 1.0 @author gjx 2019-7-11 新建与整理 + */ +public class TimelinessOrgStatModel +{ + private String orgName; // 组织名称 + private int orgOrderSum; // 组织总单量 + private int orgFirstDraftSum; // 组织已初稿量 + private int orgTimelinessSum; // 组织时效内初稿量 + private int orgExceedTimelinessSum; // 组织已超时初稿量 + private int orgSleepDraftSum; // 组织等待初稿量 + private int orgSleepTimelinessSum; // 组织等待初稿时效内订单 + private int orgExceedSleepTimelinessSum; // 组织等待初稿已超时订单 + private double orgExceedPrent; // 超时百分比 + + public TimelinessOrgStatModel(String orgName) + { + super(); + this.orgName = orgName; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public int getOrgOrderSum() + { + return orgOrderSum; + } + + public void setOrgOrderSum(int orgOrderSum) + { + this.orgOrderSum = orgOrderSum; + } + + public int getOrgFirstDraftSum() + { + return orgFirstDraftSum; + } + + public void setOrgFirstDraftSum(int orgFirstDraftSum) + { + this.orgFirstDraftSum = orgFirstDraftSum; + } + + public int getOrgTimelinessSum() + { + return orgTimelinessSum; + } + + public void setOrgTimelinessSum(int orgTimelinessSum) + { + this.orgTimelinessSum = orgTimelinessSum; + } + + public int getOrgExceedTimelinessSum() + { + return orgExceedTimelinessSum; + } + + public void setOrgExceedTimelinessSum(int orgExceedTimelinessSum) + { + this.orgExceedTimelinessSum = orgExceedTimelinessSum; + } + + public int getOrgSleepDraftSum() + { + return orgSleepDraftSum; + } + + public void setOrgSleepDraftSum(int orgSleepDraftSum) + { + this.orgSleepDraftSum = orgSleepDraftSum; + } + + public int getOrgSleepTimelinessSum() + { + return orgSleepTimelinessSum; + } + + public void setOrgSleepTimelinessSum(int orgSleepTimelinessSum) + { + this.orgSleepTimelinessSum = orgSleepTimelinessSum; + } + + public int getOrgExceedSleepTimelinessSum() + { + return orgExceedSleepTimelinessSum; + } + + public void setOrgExceedSleepTimelinessSum(int orgExceedSleepTimelinessSum) + { + this.orgExceedSleepTimelinessSum = orgExceedSleepTimelinessSum; + } + + public double getOrgExceedPrent() + { + return orgExceedPrent; + } + + public void setOrgExceedPrent(double orgExceedPrent) + { + this.orgExceedPrent = orgExceedPrent; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TimelinessStatModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TimelinessStatModel.java new file mode 100644 index 0000000..f3e8011 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TimelinessStatModel.java @@ -0,0 +1,50 @@ +/** + * 扬彩印刷设计 + * 文件名 :TimelinessStatModel.java + * 创建人 :jiangbin + * 创建时间:2020-5-13 + */ +package com.zhiqim.yangcai.design.model; + +/** + * + * 定稿未超时统计Model + * + * @version 1.0 @author jiangbin 2020-5-13 新建与整理 + */ +public class TimelinessStatModel +{ + private String designer; // 设计师名称 + private int designOrderSum; // 订单数 + private long rewardAmountSum; // 奖励金额总数 + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public int getDesignOrderSum() + { + return designOrderSum; + } + + public void setDesignOrderSum(int designOrderSum) + { + this.designOrderSum = designOrderSum; + } + + public long getRewardAmountSum() + { + return rewardAmountSum; + } + + public void setRewardAmountSum(long rewardAmountSum) + { + this.rewardAmountSum = rewardAmountSum; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TimeoutDraftOrderModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TimeoutDraftOrderModel.java new file mode 100644 index 0000000..4efbe26 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TimeoutDraftOrderModel.java @@ -0,0 +1,62 @@ +/** + * 扬彩印刷设计 + * 文件名 :TimeoutDraftOrderModel.java + * 创建人 :gjx + * 创建时间:2021年2月1日 +*/ + +package com.zhiqim.yangcai.design.model; + +/** + * + * [简要描述]: 初稿超时
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年2月1日 新建与整理 + */ +public class TimeoutDraftOrderModel +{ + private String designer; + private int timeoutOrdCount; + private int ordCount; + + public TimeoutDraftOrderModel() + { + } + + public TimeoutDraftOrderModel(String designer) + { + this.designer = designer; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public int getTimeoutOrdCount() + { + return timeoutOrdCount; + } + + public void setTimeoutOrdCount(int timeoutOrdCount) + { + this.timeoutOrdCount = timeoutOrdCount; + } + + public int getOrdCount() + { + return ordCount; + } + + public void setOrdCount(int ordCount) + { + this.ordCount = ordCount; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TrainDataModel.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TrainDataModel.java new file mode 100644 index 0000000..3c67748 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/TrainDataModel.java @@ -0,0 +1,64 @@ +/** + * 扬彩印刷设计 + * 文件名 :TrainDataModel.java + * 创建人 :gjx + * 创建时间:2021年3月1日 +*/ + +package com.zhiqim.yangcai.design.model; + +/** + * + * [简要描述] 培训资料:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年3月1日 新建与整理 + */ +public class TrainDataModel +{ + private String fileName; + private String fileUrl; + private String fileSize; + private String modifyTime; + + public String getFileName() + { + return fileName; + } + + public void setFileName(String fileName) + { + this.fileName = fileName; + } + + public String getFileUrl() + { + return fileUrl; + } + + public void setFileUrl(String fileUrl) + { + this.fileUrl = fileUrl; + } + + public String getFileSize() + { + return fileSize; + } + + public void setFileSize(String fileSize) + { + this.fileSize = fileSize; + } + + public String getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(String modifyTime) + { + this.modifyTime = modifyTime; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/VirtualQuestionsOrder.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/VirtualQuestionsOrder.java new file mode 100644 index 0000000..089d455 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/model/VirtualQuestionsOrder.java @@ -0,0 +1,50 @@ +package com.zhiqim.yangcai.design.model; + +public class VirtualQuestionsOrder +{ + private String questionsId; + private String designRequirements; + private String fileName; + private String url; + + public String getQuestionsId() + { + return questionsId; + } + + public void setQuestionsId(String questionsId) + { + this.questionsId = questionsId; + } + + public String getDesignRequirements() + { + return designRequirements; + } + + public void setDesignRequirements(String designRequirements) + { + this.designRequirements = designRequirements; + } + + public String getFileName() + { + return fileName; + } + + public void setFileName(String fileName) + { + this.fileName = fileName; + } + + public String getUrl() + { + return url; + } + + public void setUrl(String url) + { + this.url = url; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/BasePresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/BasePresenter.java new file mode 100644 index 0000000..2c3b51f --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/BasePresenter.java @@ -0,0 +1,169 @@ +/** + * 扬彩印刷设计 + * 文件名 :BasePresenter.java + * 创建人 :gjx + * 创建时间:2020年11月14日 +*/ + +package com.zhiqim.yangcai.design.presenter; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.httpclient.HttpGet; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.manager.dbo.ZmrParam; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; + +/** + * + * [简要描述]: 系统参数基础Presenter
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年11月14日 新建与整理 + */ + +@AnAlias("BasePresenter") +@AnIntercept("chkZmrLogin") +public class BasePresenter +{ + /** + * + * [简要描述]: 更新业务参数值
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doUpdateBusinessParamValue(HttpRequest request) throws Exception + { + String paramGroup = request.getParameter("paramGroup"); + String paramKey = request.getParameter("paramKey"); + String paramValue = request.getParameterNoFilter("paramValue"); + + if (paramGroup.equals("yangcai.web") && paramKey.equals("AfterPayProportion")) + { + if (!Validates.isInteger(paramValue)) + { + int paramValueInteger = Integer.parseInt(paramValue); + if (paramValueInteger < 0 || paramValueInteger > 100) + { + request.setResponseError("参数只能为0-100的整数哦~"); + return; + } + } + request.setResponseError("参数只能为0-100的整数哦~"); + return; + } + + ZmrParam param = ZmrParamDao.getParam(request.getContext(), paramGroup, paramKey); + if (param == null) + { + request.setResponseError("您选择的参数不存在,请选择有效的参数进行修改"); + return; + } + + if (Validates.isEqual(param.getParamValue(), paramValue)) + { + return; + } + + ZmrParamDao.doUpdate(request.getContext(), paramGroup, paramKey, paramValue); + } + + /** + * + * [简要描述]: 查询erp产品尺寸信息
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doQueryPrdSizeByTypeId(HttpRequest request) throws Exception + { + String prdTypeId = request.getParameter("prdTypeId"); + + Selector select = new Selector(); + select.addMust("paramGroup", "yangcai.erp"); + select.addMust("paramKey", "productSize"); + try + { + ZmrParam zparam = ORM.get(ZTable.class).item(ZmrParam.class, select); + HttpGet get = new HttpGet(Urls.add(zparam.getParamValue(), "prdTypeId", prdTypeId)); + get.setConnectTimeout(2); + get.setReadTimeout(3); + get.execute(); + if (get.isResponseSuccess()) + { + String respText = get.getResponseText(); + + List prdSizeNameList = new ArrayList(); + JSONArray respArray = JSON.parseArray(Jsons.getString(respText, "data")); + for (int i = 0; i < respArray.size(); i++) + { + prdSizeNameList.add(respArray.getJSONObject(i).getString("prdSizeStd")); + } + + request.setResponseResult(Jsons.toString(prdSizeNameList)); + } + } + catch (Exception e) + { + } + } + + /** + * + * [简要描述]: 查询erp产品面数信息
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doQueryPrdPageByTypeId(HttpRequest request) throws Exception + { + String prdTypeId = request.getParameter("prdTypeId"); + + Selector select = new Selector(); + select.addMust("paramGroup", "yangcai.erp"); + select.addMust("paramKey", "productPage"); + try + { + ZmrParam zparam = ORM.get(ZTable.class).item(ZmrParam.class, select); + HttpGet get = new HttpGet(Urls.add(zparam.getParamValue(), "prdTypeId", prdTypeId)); + get.setConnectTimeout(2); + get.setReadTimeout(3); + get.execute(); + if (get.isResponseSuccess()) + { + String respText = get.getResponseText(); + + List prdSizeNameList = new ArrayList(); + JSONArray respArray = JSON.parseArray(Jsons.getString(respText, "data")); + for (int i = 0; i < respArray.size(); i++) + { + prdSizeNameList.add(respArray.getJSONObject(i).getString("prdPageName")); + } + + request.setResponseResult(Jsons.toString(prdSizeNameList)); + } + } + catch (Exception e) + { + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ComplainDealPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ComplainDealPresenter.java new file mode 100644 index 0000000..12ee6e9 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ComplainDealPresenter.java @@ -0,0 +1,88 @@ +/** + * 扬彩印刷设计 + * 文件名 :ComplainDealPresenter.java + * 创建人 :gjx + * 创建时间:2019-8-15 + */ + +package com.zhiqim.yangcai.design.presenter; + +import java.io.File; + +import javax.imageio.stream.FileImageOutputStream; +import javax.imageio.stream.ImageOutputStream; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.codes.Base64Decoder; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.ComplainConstants; +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dbo.complain.DesignComplain; + +/** + * 投诉单处理 + * + * @version 1.0 @author gjx 2019-8-15 新建与整理 + */ +@AnAlias("ComplainDealPresenter") +@AnIntercept("chkZmrLogin") +public class ComplainDealPresenter +{ + /** + * + * 提交投诉单处理 + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doDealComplainOrder(HttpRequest request) throws Exception + { + long complainId = request.getParameterLong("complainId"); + String imgBase64Str = request.getParameter("imgData"); + + DesignComplain order = ORM.get(ZTable.class).item(DesignComplain.class, new Selector().addMust("complainId", complainId)); + if (order == null) + { + request.setResponseError("投诉单不存在"); + return; + } + + String rootDir = Strings.trimRight(request.getContext().getAttributeString("upload.rootDir"), "/"); + + String fileName = request.getSessionName() + "-" + DateTimes.getDateTime14String() + ".png"; + String checkPath = rootDir + "/" + DateTimes.getDateTime8String() + "/" + "投诉图片"; + String path = checkPath + "/" + fileName; + Files.mkDirectory(checkPath); + + // 对传过来的图片解码并且写入文件 + imgBase64Str = imgBase64Str.replace("data:image/pngbase64,", ""); + byte[] imageBytes = Base64Decoder.decode(imgBase64Str.getBytes("utf-8")); + File file = new File(path); + ImageOutputStream out = new FileImageOutputStream(file); + out.write(imageBytes); + out.flush(); + out.close(); + // 图片上传OSS处理 + String ossUrl = OssFileDao.uploadFile(file, OssFileDao.getUploadFileKey(complainId)); + + Updater updater = new Updater(); + updater.addMust("complainId", complainId); + updater.addField("complainStatus", ComplainConstants.TX_20.value()); + updater.addField("finishImgPath", ossUrl); + updater.addField("complainModifyTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(DesignComplain.class, updater); + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ComplaintOrderPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ComplaintOrderPresenter.java new file mode 100644 index 0000000..870042c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ComplaintOrderPresenter.java @@ -0,0 +1,189 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.codes.Base64; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 申诉presenter + * + * @version v1.0.0 @author liuhu 2018-12-8 新建与整理 + */ +@AnAlias("ComplaintOrderPresenter") +public class ComplaintOrderPresenter +{ + + /** + * 保存申诉截图 + * + * @throws SQLException + * @throws ORMException + * @throws IOException + * @throws FileNotFoundException + */ + public static void saveComplaintScreenShots(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + int size = request.getParameterInt("size"); + if (size == 0) + { + return; + } + + for (int i = 0; i < size; i++) + { + String rootDir = Strings.trimRight(request.getContext().getAttributeString("upload.large.rootDir"), "/"); + + String path = request.getParameter("url" + i); + int fileLength = request.getParameterInt("fileLength" + i); + path = path.substring("/service/upl/".length()); + String pathName = path.substring(path.indexOf("/") + 1); + path = path.substring(0, path.indexOf("/")); + path = Base64.decodeFileUrlUTF8(path); + path = rootDir + "/" + path + "/" + pathName; + + // 插入订单附属表 + DesignAtta atta = new DesignAtta(); + atta.setAttaId(Ids.longId()); + atta.setAttaModul(FileTypeConstants.FILE_COMPLAINT.value()); + atta.setDesignId(designId); + atta.setFileName(pathName); + atta.setFileType("png"); + atta.setFileSize(fileLength); + atta.setSavePath(path); + atta.setUploadTime(Sqls.nowTimestamp()); + atta.setOperatorCode(request.getSessionName()); + + ORM.get(ZTable.class).insert(atta); + } + + String complaintReason = request.getParameter("complaintReason", ""); + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("complaintReason", complaintReason); + updater.addField("complaintFlag", 3); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 插入日志 + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "上传[" + designId + "]申诉截图成功", EventConstants.ORDER_20.value()); + } + + /** + * 保存申诉原因 + * + * @param request + * @throws ORMException + * @throws SQLException + * 已停用 + */ + public static void saveComplaintReason(HttpRequest request) throws ORMException, SQLException + { + long designId = request.getParameterLong("designId"); + String complaintReason = request.getParameter("complaintReason", ""); + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("complaintReason", complaintReason); + updater.addField("complaintFlag", 3); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + } + + /** + * 申诉审核通过 + * + * @param request + * @throws ORMException + * @throws SQLException + */ + public static void complaintPass(HttpRequest request) throws ORMException, SQLException, Exception + { + String[] designIds = request.getParameterValues("designIds"); + // if (order == null) + // { + // request.setResponseError("订单不存在"); + // return; + // } + + long[] designId = Arrays.toLongArray(designIds); + Updater updater = new Updater(); + updater.addMustInLong("designId", designId); + updater.addField("complaintFlag", 1); + // updater.addField("complaintBackReason", ""); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + /* + * for (long oneDesignId : designId) + * { + * DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, oneDesignId); + * if (order != null) + * { + * ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + * scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_103.value() + * )); + * scoreDesignerRecordDetail.setOperatorCode(order.getDesigner()); + * scoreDesignerRecordDetail.setOrderId(order.getDesignId()); + * ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + * } + * } + */ + } + + /** + * 申诉退回 + * + * @param request + * @throws ORMException + * @throws SQLException + */ + public static void complaintBack(HttpRequest request) throws ORMException, SQLException + { + long designId = request.getParameterLong("designId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + } + + String desc = request.getParameter("desc", ""); + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("complaintBackReason", desc); + updater.addField("complaintFlag", 2); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 申诉退回删除申诉图片 + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector("designId", designId).addMust("attaModul", FileTypeConstants.FILE_COMPLAINT.value())); + for (DesignAtta atta : attaList) + { + Files.deleteFile(atta.getSavePath()); + ORM.get(ZTable.class).delete(DesignAtta.class, atta.getAttaId()); + } + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "删除上传的[" + FileTypeConstants.FILE_COMPLAINT.value() + "]文件", + EventConstants.ORDER_20.value()); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ConsolePresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ConsolePresenter.java new file mode 100644 index 0000000..111645e --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ConsolePresenter.java @@ -0,0 +1,177 @@ +/** + * 扬彩印刷设计 + * 文件名 :ConsignCheckPresenter.java + * 创建人 :高佳新 + * 创建时间:2019-7-27 + */ + +package com.zhiqim.yangcai.design.presenter; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * yixin 工作台相关 + * + * @version 1.0 @author yixin 2020-06-22 新建与整理 + */ +@AnAlias("ConsolePresenter") +@AnIntercept("chkZmrLogin") +public class ConsolePresenter +{ + + /** + * 获取今日的订单信息 + * + * @param request + * @throws Exception + */ + public static void getTodayOrderInfo(HttpRequest request) throws Exception + { + String beginTime = DateTimes.getDateString() + " 00:00:00"; + String endTime = DateTimes.getDateString() + " 23:59:59"; + int[] info = getOrderInfoByDateTime(request, beginTime, endTime); + request.setResponseResult(Jsons.toString(info)); + } + + /** + * 获取当月的订单信息 + * + * @param request + * @throws Exception + */ + public static void getCurrentMonthOrderInfo(HttpRequest request) throws Exception + { + String beginTime = DateTimes.getFirstMonthDay() + " 00:00:00"; + String endTime = DateTimes.getDateString() + " 23:59:59"; + int[] info = getOrderInfoByDateTime(request, beginTime, endTime); + request.setResponseResult(Jsons.toString(info)); + } + + /** + * 获取上个月的订单信息 + * + * @param request + * @throws Exception + */ + public static void getLastMonthOrderInfo(HttpRequest request) throws Exception + { + String beginTime = DateTimes.getPreviousMonthFirstDay() + " 00:00:00"; + String endTime = DateTimes.getPreviousMonthLastDay() + " 23:59:59"; + int[] info = getOrderInfoByDateTime(request, beginTime, endTime); + request.setResponseResult(Jsons.toString(info)); + } + + /** + * 根据时间获取时间段订单信息 + * int[0]订单量 int[1]定稿量 int[2]退款量 + * + * @param request + * @param beginTime + * @param endTime + * @return + * @throws Exception + */ + private static int[] getOrderInfoByDateTime(HttpRequest request, String beginTime, String endTime) throws Exception + { + StringBuilder sqlStr = new StringBuilder( + " SELECT d.designer, COUNT(*) orderNum,(SELECT COUNT(*) FROM design_order WHERE DESIGN_BEGIN_TIME >= 'startDateStr' AND DESIGN_BEGIN_TIME <= 'endDateStr' AND STATUS >= 55 AND designer IS NOT NULL AND designer = d.designer AND designer = d.designer) orderEndNum"); + sqlStr.append( + " FROM design_order d WHERE d.DESIGN_BEGIN_TIME >= 'startDateStr' AND d.DESIGN_BEGIN_TIME <= 'endDateStr' AND d.designer IS NOT NULL GROUP BY d.designer"); + + if (Validates.isEmpty(beginTime)) + { + beginTime = DateTimes.getFirstMonthDay() + " 00:00:00"; + } + if (Validates.isEmpty(endTime)) + { + endTime = DateTimes.getDateString() + " 23:59:59"; + } + + String sql = sqlStr.toString().replace("startDateStr", beginTime).replace("endDateStr", endTime); + Selector refundSelector = new Selector(); + + int orderNum = 0; + int orderEndNum = 0; + // 订单量和定稿量 + List list = ORM.get(ZSQL.class).executeQuery(sql); + for (LinkedMapSO so : list) + { + orderNum += Integer.valueOf(String.valueOf(so.get("orderNum"))); + orderEndNum += Integer.valueOf(String.valueOf(so.get("orderEndNum"))); + } + + // 查询退款量 + refundSelector.addMustNotEqual("complaintFlag", 1); + refundSelector.addMaybeThenGE("refundTime", beginTime); + refundSelector.addMaybeThenLE("refundTime", endTime); + // 相关子查询(一小时内重新下单不算设计师责任) + refundSelector.addExpressionNotEqual("buyerNick", "all (select BUYER_NICK from design_order as b " + "where b.DESIGN_ID <> design_order.DESIGN_ID " + + "and b.CREATE_TIME >= design_order.REFUND_TIME " + "and DATE_SUB(b.CREATE_TIME,INTERVAL 1 HOUR) <= design_order.REFUND_TIME)"); + int refundResultCount = ORM.get(ZTable.class).count(DesignOrder.class, refundSelector); + + return new int[] + { + orderNum, orderEndNum, refundResultCount + }; + } + + /** + * 根据未完成订单信息 + * int[0]总订单量 int[1]小于24小时 int[2]24-48小时内 int[3]大于48小时 + * + * @param request + * @return + * @throws Exception + */ + public static void getUndoneOrderInfo(HttpRequest request) throws Exception + { + Selector selector = new Selector(); + selector.addMustIn("status", StatusConstants.ORDER_30.value(), StatusConstants.ORDER_36.value(), StatusConstants.ORDER_50.value()); + String today = DateTimes.getDateString(); + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + int orderCount = orderList.size(); + int dayCount = 0; + int twoDayCount = 0; + int otherCount = 0; + + for (DesignOrder order : orderList) + { + String createDay = Sqls.toDateString(order.getCreateTime()); + if (DateTimes.compareDay(today, createDay) <= 1) + { + dayCount++; + } + else if (DateTimes.compareDay(today, createDay) <= 2) + { + twoDayCount++; + } + else + { + otherCount++; + } + } + + int[] data = new int[] + { + orderCount, dayCount, twoDayCount, otherCount + }; + request.setResponseResult(Jsons.toString(data)); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignAfterOrderPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignAfterOrderPresenter.java new file mode 100644 index 0000000..2e0e6ce --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignAfterOrderPresenter.java @@ -0,0 +1,472 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.io.File; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import javax.imageio.stream.FileImageOutputStream; +import javax.imageio.stream.ImageOutputStream; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.Base64; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dao.OrderCheckDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dao.ScoreDesignerRecordDao; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrder; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrderView; +import com.zhiqim.yangcai.design.dbo.design.AfterPicType; +import com.zhiqim.yangcai.design.dbo.design.AfterProblemType; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordDetail; + +/**** + * 售后订单相关 + * + * @version v1.0.0 @author longguizhi 2018-12-16 新建与整理 + */ +@AnAlias("DesignAfterOrderPresenter") +@AnIntercept("chkZmrLogin") +public class DesignAfterOrderPresenter +{ + public static void doQueryAfterOrderDataInfo(HttpRequest request) throws Exception + { + long designAfsId = request.getParameterLong("designAfsId"); + designAfsId = designAfsId < 0 ? 0 : designAfsId; + + // 售后信息 + DesignAfterOrderView afterOrder = ORM.get(ZView.class).item(DesignAfterOrderView.class, new Selector("designAfsId", designAfsId)); + if (afterOrder == null) + { + request.setResponseError("售后单不存在"); + return; + } + + String[] attaModuls = new String[] + { + FileTypeConstants.FILE_DESGIN.value(), // 设计文件 + FileTypeConstants.FILE_END.value(), // 成品文件 + FileTypeConstants.FILE_AFTERSALE.value(), // 售后文件 + FileTypeConstants.FILE_AFTE_COMPLAIN_EVIDENCE.value() + // 申诉凭证 + }; + List afterAttaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector("designId", afterOrder.getDesignId()).addMustIn("attaModul", attaModuls).addOrderbyAsc("attaModul")); + + Map jsonMap = new TreeMap(); + jsonMap.put("afterAttaList", afterAttaList); + jsonMap.put("afterOrder", afterOrder); + jsonMap.put("problemType", ORM.get(ZTable.class).item(AfterProblemType.class, afterOrder.getProblemType())); + + request.setResponseResult(Jsons.toString(jsonMap)); + } + + /** 查新分配责任信息 **/ + public static void doQueryAppointBlameData(HttpRequest request) throws Exception + { + long designAfsId = request.getParameterLong("designAfsId"); + designAfsId = designAfsId < 0 ? 0 : designAfsId; + + // 售后信息 + DesignAfterOrderView afterOrder = ORM.get(ZView.class).item(DesignAfterOrderView.class, new Selector("designAfsId", designAfsId)); + if (afterOrder == null) + { + request.setResponseError("售后但不存在"); + return; + } + + String[] attaModuls = new String[] + { + FileTypeConstants.FILE_DESGIN.value(), // 设计文件 + FileTypeConstants.FILE_END.value(), // 成品文件 + FileTypeConstants.FILE_AFTERSALE.value(), // 售后文件 + FileTypeConstants.FILE_AFTE_COMPLAIN_EVIDENCE.value() + // 申诉凭证 + + }; + // 附件信息 + List afterAttaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector("designId", afterOrder.getDesignId()).addMustIn("attaModul", attaModuls).addOrderbyAsc("attaModul")); + + // 查询责任归属 & 责任问题原因 picStatus + List picList = ORM.get(ZTable.class).list(AfterPicType.class); + List problemList = ORM.get(ZTable.class).list(AfterProblemType.class); + + Map jsonMap = new TreeMap(); + jsonMap.put("afterAttaList", afterAttaList); + jsonMap.put("afterOrder", afterOrder); + jsonMap.put("picList", picList); + jsonMap.put("problemList", problemList); + request.setResponseResult(Jsons.toString(jsonMap)); + } + + /*** 责任分配 **/ + @AnTransaction + public static void doAppointAfterBlame(HttpRequest request) throws Exception + { + long designAfsId = request.getParameterLong("designAfsId"); + designAfsId = designAfsId <= 0 ? 0 : designAfsId; + String afterBlamer = request.getParameter("afterBlamer"); + + long picOrgId = request.getParameterLong("picOrgId"); + picOrgId = picOrgId <= 0 ? 0 : picOrgId; + + long picTypeId = request.getParameterLong("picType"); + picTypeId = picTypeId <= 0 ? 0 : picTypeId; + + long problemType = request.getParameterLong("problemType"); + problemType = problemType <= 0 ? 0 : problemType; + boolean isReAppointBlame = request.getParameterBoolean("isReAppointBlame");// 是否申诉通过重新指派责任 + long lossAmount = request.getParameterAmount2R("lossAmount", 0L); + DesignAfterOrder afterOrder = ORM.get(ZTable.class).item(DesignAfterOrder.class, new Selector("designAfsId", designAfsId)); + if (afterOrder == null) + { + request.setResponseError("售后单不存在"); + return; + } + + if (!isReAppointBlame && afterOrder.getAfterStatus() != AfterConstants.CS_0.value()) + {// 非申诉单 分配责任限制 + request.setResponseError("当前状态不允许操作请检查是否正确"); + return; + } + + if (isReAppointBlame && Validates.isEmptyBlank(afterOrder.getAfterBlamer())) + {// 申诉状态 没有责任人(异常数据) + request.setResponseError("申诉状态,[申诉人]为空,不允许重新指派"); + return; + } + + if (Validates.isEmptyBlank(afterBlamer)) + { + request.setResponseError("请选择正确的责任人"); + return; + } + + if (isReAppointBlame && afterBlamer.equals(afterOrder.getAfterBlamer())) + {// + request.setResponseError("重新指派不能指定同一个人"); + return; + } + + if (ZmrOrgDao.getOrg(request, picOrgId) == null) + { + request.setResponseError("请选择正确的责任组织"); + return; + } + + AfterPicType picType = ORM.get(ZTable.class).item(AfterPicType.class, new Selector("picType", picTypeId)); + if (picType == null) + { + request.setResponseError("请选择正确的责任归属"); + return; + } + + AfterProblemType problem = ORM.get(ZTable.class).item(AfterProblemType.class, new Selector("problemType", problemType)); + if (problem == null) + { + request.setResponseError("请选择正确的售后原因"); + return; + } + + // 删除之前的申诉内容及文件 + List blameAttaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector("designId", afterOrder.getDesignId()).addMust("attaModul", FileTypeConstants.FILE_AFTE_COMPLAIN_EVIDENCE.value())); + for (DesignAtta atta : blameAttaList) + { + OrderCheckDao.doDeleteAttaFile(atta); + } + + // 数据保存 + Updater updater = new Updater(); + updater.addMust("designAfsId", designAfsId); + updater.addField("afterStatus", AfterConstants.CS_300.value()); + updater.addField("picOrgId", picOrgId); + updater.addField("picType", picType.getPicType()); + updater.addField("problemType", problemType); + updater.addField("afterBlamer", afterBlamer); + updater.addField("lossAmount", Double.valueOf(Amounts.toYuan(lossAmount))); + updater.addField("afterHandler", request.getSessionName()); + updater.addField("afterHandelTime", Sqls.nowTimestamp()); + updater.addField("afterModifyTime", Sqls.nowTimestamp()); + updater.addField("afterBlameReturnNote", null); + updater.addField("afterBlameReturnTime", null); + ORM.get(ZTable.class).update(DesignAfterOrder.class, updater); + + String itemDesc = "给售后单[" + afterOrder.getOutAfsId() + "]"; + itemDesc += isReAppointBlame ? "[" + afterOrder.getAfterBlamer() + "]异议申诉通过, 重新指派责任给[" + afterBlamer + "]" : "指派责任给[" + afterBlamer + "]"; + OrderLogDao.saveOrderOperateLog(afterOrder.getDesignId(), request.getSessionName(), itemDesc, EventConstants.ORDER_20.value()); + + } + + /*** 售后完成 **/ + @AnTransaction + public static void doFinishAfterOrder(HttpRequest request) throws Exception + { + long designAfsId = request.getParameterLong("designAfsId"); + designAfsId = designAfsId <= 0 ? 0 : designAfsId; + String afterFinishNote = request.getParameter("afterFinishNote"); + + DesignAfterOrder afterOrder = ORM.get(ZTable.class).item(DesignAfterOrder.class, new Selector("designAfsId", designAfsId)); + if (afterOrder == null) + { + request.setResponseError("售后单不存在"); + return; + } + + if (afterOrder.getAfterStatus() == AfterConstants.CS_400.value()) + { + request.setResponseError("此订单售后已完成,请勿重复"); + return; + } + + if (Validates.isEmptyBlank(afterOrder.getAfterBlamer())) + {// 没有责任人 + request.setResponseError("售后单未知责任人,请检查是否正确!"); + return; + } + + // 申诉文件 上传到OSS + Selector attaSelect = new Selector("designId", afterOrder.getDesignId()); + attaSelect.addMust("attaModul", FileTypeConstants.FILE_AFTE_COMPLAIN_EVIDENCE.value()); + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, attaSelect); + for (DesignAtta afterAtta : attaList) + { + boolean result = OssFileDao.uploadFile(afterAtta); + if (!result) + { + request.setResponseError("申诉文件OSS转储失败"); + return; + } + // 删除文件 + Files.deleteFile(afterAtta.getSavePath()); + } + + Updater updater = new Updater(); + updater.addMust("designAfsId", designAfsId); + updater.addField("afterModifyTime", Sqls.nowTimestamp()); + + updater.addField("afterStatus", AfterConstants.CS_400.value()); + updater.addField("afterFinishNote", afterFinishNote); + updater.addField("afterFinishTime", Sqls.nowTimestamp()); + updater.addField("afterBlameReturnNote", null); + updater.addField("afterBlameReturnTime", null); + ORM.get(ZTable.class).update(DesignAfterOrder.class, updater); + OrderLogDao.saveOrderOperateLog(afterOrder.getDesignId(), request.getSessionName(), "完成售后单[" + afterOrder.getDesignAfsId() + "]", + EventConstants.ORDER_20.value()); + + if (afterOrder.getAfterBlamer() != null) + { + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_104.value())); + scoreDesignerRecordDetail.setOperatorCode(afterOrder.getAfterBlamer()); + scoreDesignerRecordDetail.setOrderId(afterOrder.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + + } + + /*** 提交申诉 */ + @AnTransaction + public static void doSubmitAfterComplain(HttpRequest request) throws Exception + { + long designAfsId = request.getParameterLong("designAfsId"); + designAfsId = designAfsId <= 0 ? 0 : designAfsId; + int complainEvidenceFileMethod = request.getParameterInt("complainEvidenceFileMethod");// 凭证方式 + // 0 + // 文件1截图 + String afterBlameReturnNote = request.getParameter("afterBlameReturnNote"); + afterBlameReturnNote = Strings.trim(afterBlameReturnNote); + + DesignAfterOrder afterOrder = ORM.get(ZTable.class).item(DesignAfterOrder.class, new Selector("designAfsId", designAfsId)); + if (afterOrder == null) + { + request.setResponseError("售后单不存在"); + return; + } + + if (afterOrder.getAfterStatus() != AfterConstants.CS_300.value()) + { + request.setResponseError("当前状态不允许操作!"); + return; + } + + if (!Validates.isLen(afterBlameReturnNote, 1, 600)) + { + request.setResponseError("申诉原因不能为空!"); + return; + } + + // + DesignAtta imgComplain = null; + if (complainEvidenceFileMethod == 1) + { + String imgData = request.getParameterNoFileterOnCNT("imgData"); + if (Validates.isNotEmptyBlank(imgData)) + { + String rootDir = Strings.trimRight(request.getContext().getAttributeString("upload.large.rootDir"), "/"); + String fileName = afterOrder.getDesignId() + "-售后申诉截图.png"; + String dateDir = DateTimes.getDateTime8String(); + String fileDir = rootDir + "/" + dateDir + "/" + FileTypeConstants.FILE_AFTE_COMPLAIN_EVIDENCE.value(); + if (!Files.exists(fileDir)) + { + Files.mkDirectory(fileDir); + } + + int idx = imgData.indexOf(","); + byte[] imageBytes = Base64.decode(imgData.substring(idx + 1)); + + // imgData = imgData.replace("data:image/pngbase64,", ""); + // byte[] imageBytes = Base64Decoder.decode(imgData.getBytes("utf-8")); + String filePath = fileDir + "/" + fileName; + File file = new File(filePath); + ImageOutputStream out = new FileImageOutputStream(file); + out.write(imageBytes); + out.flush(); + out.close(); + + // 插入订单附属表 + imgComplain = new DesignAtta(); + imgComplain.setAttaId(Ids.longId()); + imgComplain.setDesignId(afterOrder.getDesignId()); + imgComplain.setAttaFlag(0); + imgComplain.setAttaModul(FileTypeConstants.FILE_AFTE_COMPLAIN_EVIDENCE.value()); + imgComplain.setFileName(fileName); + imgComplain.setFileType("png"); + imgComplain.setFileSize(imageBytes.length); + imgComplain.setSavePath(filePath); + imgComplain.setUploadTime(Sqls.nowTimestamp()); + imgComplain.setOperatorCode(request.getSessionName()); + ORM.get(ZTable.class).insert(imgComplain); + } + } + + Updater updater = new Updater(); + updater.addMust("designAfsId", designAfsId); + updater.addField("afterModifyTime", Sqls.nowTimestamp()); + updater.addField("afterStatus", AfterConstants.CS_100.value()); + updater.addField("afterBlameReturnNote", afterBlameReturnNote); + updater.addField("afterBlameReturnTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignAfterOrder.class, updater); + OrderLogDao.saveOrderOperateLog(afterOrder.getDesignId(), request.getSessionName(), "售后单[" + afterOrder.getDesignAfsId() + "]异议申诉", + EventConstants.ORDER_20.value()); + } + + /*** 申诉拒绝 */ + @AnTransaction + public static void doAfterComplainReject(HttpRequest request) throws Exception + { + + long designAfsId = request.getParameterLong("designAfsId"); + designAfsId = designAfsId <= 0 ? 0 : designAfsId; + DesignAfterOrder afterOrder = ORM.get(ZTable.class).item(DesignAfterOrder.class, new Selector("designAfsId", designAfsId)); + if (afterOrder == null) + { + request.setResponseError("售后单不存在"); + return; + } + + if (afterOrder.getAfterStatus() != AfterConstants.CS_100.value() && afterOrder.getAfterStatus() != AfterConstants.CS_200.value()) + { + request.setResponseError("非申诉或待审状态不允许操作"); + return; + } + + Updater updater = new Updater(); + updater.addMust("designAfsId", designAfsId); + updater.addField("afterModifyTime", Sqls.nowTimestamp()); + updater.addField("afterStatus", AfterConstants.CS_500.value()); + + ORM.get(ZTable.class).update(DesignAfterOrder.class, updater); + OrderLogDao.saveOrderOperateLog(afterOrder.getDesignId(), request.getSessionName(), "售后单[" + afterOrder.getDesignAfsId() + "]申诉拒绝", + EventConstants.ORDER_20.value()); + } + + /*** 申诉通过 */ + @AnTransaction + public static void doAfterComplainAccess(HttpRequest request) throws Exception + { + + long designAfsId = request.getParameterLong("designAfsId"); + designAfsId = designAfsId <= 0 ? 0 : designAfsId; + DesignAfterOrder afterOrder = ORM.get(ZTable.class).item(DesignAfterOrder.class, new Selector("designAfsId", designAfsId)); + String checkNote = request.getParameter("checkNote"); + checkNote = Strings.trim(checkNote); + + if (afterOrder == null) + { + request.setResponseError("售后单不存在"); + return; + } + + if (afterOrder.getAfterStatus() != AfterConstants.CS_100.value()) + { + request.setResponseError("非申诉状态不允许操作"); + return; + } + if (Validates.isEmptyBlank(checkNote)) + { + request.setResponseError("审核备注不能为空"); + return; + } + if (checkNote.length() > 400) + { + request.setResponseError("审核备注不能超过 400 字符"); + return; + } + + // 申诉文件 上传到OSS + Selector attaSelect = new Selector("designId", afterOrder.getDesignId()); + attaSelect.addMust("attaModul", FileTypeConstants.FILE_AFTE_COMPLAIN_EVIDENCE.value()); + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, attaSelect); + for (DesignAtta afterAtta : attaList) + { + boolean result = OssFileDao.uploadFile(afterAtta); + if (!result) + { + request.setResponseError("申诉文件OSS转储失败"); + return; + } + // 删除文件 + Files.deleteFile(afterAtta.getSavePath()); + } + + String accessNote = (Validates.isEmptyBlank(checkNote) ? "" : checkNote); + Updater updater = new Updater(); + updater.addMust("designAfsId", designAfsId); + updater.addField("afterModifyTime", Sqls.nowTimestamp()); + updater.addField("afterStatus", AfterConstants.CS_F100.value()); + updater.addField("afterCanceler", request.getSessionName()); + updater.addField("afterCancelNote", accessNote); + updater.addField("afterCancelTime", Sqls.nowTimestamp()); + updater.addField("afterComplainCheckNote", accessNote); + updater.addField("afterFinishTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(DesignAfterOrder.class, updater); + OrderLogDao.saveOrderOperateLog(afterOrder.getDesignId(), request.getSessionName(), "售后申诉通过:" + accessNote, EventConstants.ORDER_20.value()); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignGroupPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignGroupPresenter.java new file mode 100644 index 0000000..e83f2f0 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignGroupPresenter.java @@ -0,0 +1,255 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.sql.SQLException; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.stat.DesignGroup; +import com.zhiqim.yangcai.design.dbo.stat.GroupMembers; + +/** + * 设计组 presenter + * + * @version v1.0.0 @author liuhu 2019-2-15 新建与整理 + */ +@AnAlias("DesignGroupPresenter") +@AnIntercept("chkZmrLogin") +public class DesignGroupPresenter +{ + + public static void doQueryMembers(HttpRequest request) throws Exception + { + long groupId = request.getParameterLong("groupId"); + String startDate = request.getParameter("startDate", DateTimes.getFirstMonthDay()); + startDate = Validates.isDate(startDate) ? startDate : DateTimes.getFirstMonthDay(); + String endDate = DateTimes.getLastMonthDay(startDate.replaceAll("-", "").substring(0, 6)); + + MapSO attrMap = new HashMapSO(); + if (groupId == -1) + { + String ret = ZmlContexts.parseZmlPath(request, "/zview/sys/presenter/groupMembersInfo.zml", attrMap); + request.setResponseResult(ret); + return; + } + + DesignGroup group = null; + List groupList = ORM.get(ZTable.class).list(DesignGroup.class); + for (DesignGroup designGroup : groupList) + { + if (designGroup.getGroupId() == groupId) + { + group = designGroup; + } + } + + Selector selector = new Selector("groupId", groupId); + selector.addMustThenLE("startDate", startDate); + selector.addOr(new Selector().addMustIsNull("endDate").addMust("endDate", endDate)); + selector.addOrderbyDesc("isGroupLeader"); + selector.addOrderbyAsc("startDate"); + + List memberList = ORM.get(ZTable.class).list(GroupMembers.class, selector); + Map operatorMap = new LinkedHashMap(); + + for (GroupMembers c : memberList) + { + operatorMap.put(c.getUserCode(), null); + } + + for (ZmrOperator o : ZmrOperatorDao.getOperator(request, group.getOrgId())) + { + + if (operatorMap.containsKey(o.getOperatorCode())) + { + operatorMap.put(o.getOperatorCode(), o); + } + } + + attrMap.put("memberList", memberList); + attrMap.put("operatorMap", operatorMap); + attrMap.put("group", group); + attrMap.put("year", Integer.valueOf(startDate.split("-")[0])); + attrMap.put("month", Integer.valueOf(startDate.split("-")[1])); + String ret = ZmlContexts.parseZmlPath(request, "/zview/sys/presenter/groupMembersInfo.zml", attrMap); + + Map jsonMap = new HashMap(); + jsonMap.put("membersHtml", ret); + request.setResponseResult(Jsons.toString(jsonMap)); + + } + + /** + * 增加设计组成员 + * + * @param request + * @throws ORMException + * @throws SQLException + */ + @AnTransaction + public static void doAddGroupMembers(HttpRequest request) throws ORMException, SQLException + { + long groupId = request.getParameterLong("groupId"); + groupId = groupId < 0 ? 0 : groupId; + DesignGroup group = ORM.get(ZTable.class).item(DesignGroup.class, groupId); + if (group == null) + { + request.returnCloseDialog("请先添加设计组"); + return; + } + String currMouthFirstDay = DateTimes.getFirstMonthDay(); + String[] members = request.getParameterValues("members"); + String nextMonthFirstDay = DateTimes.getNextMonthFirstDay(); + for (String userCode : members) + { + + // 1.查询在职是组长 + Selector sel1 = new Selector("userCode", userCode); + sel1.addMust("isGroupLeader", 1); + sel1.addMustIsNull("endDate"); + sel1.addOrderbyDesc("startDate"); + GroupMembers member = ORM.get(ZTable.class).item(GroupMembers.class, sel1); + if (member != null) + { + DesignGroup g = ORM.get(ZTable.class).item(DesignGroup.class, new Selector("groupId", member.getGroupId())); + + String ss = (nextMonthFirstDay.equals(member.getStartDate()) ? nextMonthFirstDay.substring(0, 7) + : DateTimes.getFirstMonthDay().substring(0, 7)); + request.setResponseError("[" + userCode + "]是[" + g.getGroupName() + "][" + ss + "]月分的组长,请先更换组长后在操作"); + return; + } + + // 2.删除未生效的组员数据 + ORM.get(ZTable.class).delete(GroupMembers.class, + new Selector("userCode", userCode).addMustThenG("startDate", DateTimes.getLastMonthDay()).addMust("isGroupLeader", 0)); + + // 3.1 查询该操作员是否为当前组织 + Selector sel2 = new Selector("userCode", userCode); + sel2.addMust("groupId", groupId); + sel2.addMustThenL("startDate", DateTimes.getNextMonthFirstDay()); + sel2.addOrderbyDesc("startDate"); + GroupMembers member2 = ORM.get(ZTable.class).item(GroupMembers.class, sel2); + if (member2 != null) + {// 上月在当前组 + member2.setEndDate(null); + ORM.get(ZTable.class).replace(member2); + return; + } + + // 3.1.修改在其他组 的结束时间 + Updater updater = new Updater(); + updater.addMust("userCode", userCode); + updater.addMustIsNull("endDate"); + updater.addMustNotEqual("groupId", groupId); + updater.addField("endDate", DateTimes.getLastMonthDay()); + ORM.get(ZTable.class).update(GroupMembers.class, updater); + + Selector selel = new Selector(); + selel.addMust("userCode", userCode); + selel.addMust("endDate", DateTimes.getLastMonthDay()); + selel.addMustNotEqual("groupId", groupId); + selel.addOrderbyDesc("endDate"); + GroupMembers om = ORM.get(ZTable.class).item(GroupMembers.class, selel); + + // 4. 插入下月生效组员数据 + GroupMembers nm = new GroupMembers(); + nm.setStartDate(om == null ? currMouthFirstDay : DateTimes.getNextMonthFirstDay()); + nm.setUserCode(userCode); + nm.setGroupId(groupId); + ORM.get(ZTable.class).replace(nm); + } + } + + /** + * 删除设计组成员 + * + * @param request + * @throws ORMException + * @throws SQLException + */ + @AnTransaction + public static void doDeleteGroupMember(HttpRequest request) throws ORMException, SQLException + { + long groupId = request.getParameterLong("groupId"); + String userCode = request.getParameter("userCode"); + + // 查询是否是删除未生效数据 + Selector sel = new Selector("userCode", userCode); + sel.addMust("groupId", groupId); + sel.addMustIsNull("endDate"); + sel.addMustThenG("startDate", DateTimes.getLastMonthDay()); + sel.addOrderbyDesc("startDate"); + GroupMembers members = ORM.get(ZTable.class).item(GroupMembers.class, sel); + if (members != null) + {// + if (members.getIsGroupLeader() == 1) + { + request.setResponseError("不能删除组长数据"); + return; + } + + // 2.删除在改组未生效的组员数据 + ORM.get(ZTable.class).delete(GroupMembers.class, new Selector("userCode", userCode).addMust("groupId", groupId) + .addMustThenG("startDate", DateTimes.getLastMonthDay()).addMust("isGroupLeader", 0)); + + // 3.还原已生效数据 + Selector sel2 = new Selector("userCode", userCode); + sel2.addMustThenL("endDate", DateTimes.getNextMonthFirstDay()); + sel2.addMustNotEqual("groupId", groupId); + sel2.addOrderbyDesc("endDate"); + GroupMembers members2 = ORM.get(ZTable.class).item(GroupMembers.class, sel2); + if (members2 == null) + { + return; + } + + Updater updater = new Updater(); + updater.addMust("userCode", userCode); + updater.addMust("startDate", members2.getStartDate()); + updater.addField("endDate", null); + ORM.get(ZTable.class).update(GroupMembers.class, updater); + + } + else + { + // 查询已生效数据 + Selector sel2 = new Selector("userCode", userCode); + sel2.addOr(new Selector().addMustIsNull("endDate").addMustThenL("startDate", DateTimes.getNextMonthFirstDay())); + sel2.addMust("isGroupLeader", 0); + sel2.addMust("groupId", groupId); + sel2.addOrderbyDesc("startDate"); + GroupMembers members2 = ORM.get(ZTable.class).item(GroupMembers.class, sel2); + if (members2 != null) + { + // 结束已生效数据 + Updater updater = new Updater(); + updater.addMust("groupId", groupId); + updater.addMust("startDate", members2.getStartDate()); + updater.addMust("userCode", userCode); + updater.addField("endDate", DateTimes.getLastMonthDay()); + ORM.get(ZTable.class).update(GroupMembers.class, updater); + } + } + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignOrderPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignOrderPresenter.java new file mode 100644 index 0000000..b36932b --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignOrderPresenter.java @@ -0,0 +1,659 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.io.File; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.ones.IsSelect; +import org.zhiqim.httpd.validate.onex.IsInteger; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.aliyun.oss.common.utils.StringUtils; +import com.zhiqim.yangcai.design.constants.DesignerWorkStatus; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignerDao; +import com.zhiqim.yangcai.design.dao.DispatchDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupView; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignAttaView; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignOrderRefundReason; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.messagebox.ZqmMessageProducerHandler; +import com.zhiqim.yangcai.design.rmi.erp.ErpRmiService; +import com.zhiqim.yangcai.design.server.ErpClassService; +import com.zhiqim.yangcai.design.server.ErpClassService.statusEnum; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; +import com.zhiqim.yangcai.util.DesignerGroupDispatchUtil; +import com.zhiqim.yangcai.util.RedisUtils; + +import redis.clients.jedis.Jedis; +import yangcai.messagebox.constant.MessageSysType; +import yangcai.messagebox.constant.MessageTopicType; +import yangcai.messagebox.model.MessageBusi; + +/** + * 设计Presenter + * + * @version v1.0.0 @author Deng 2017-8-15 新建与整理 + */ +@AnAlias("DesignOrderPresenter") +@AnIntercept("chkZmrLogin") +public class DesignOrderPresenter { + private static final Log log = LogFactory.getLog(DesignOrderPresenter.class); + + /** + * 运营指定设计师AB单判断 doAssignABCheck + * + * @author caohong + * @param request + * @throws Exception + */ + public static void doAssignABCheck(HttpRequest request) throws Exception { +// long designId = request.getParameterLong("designId"); + String[] oids = request.getParameterValues("designId"); + long[] designIds = Arrays.toLongArray(oids); + for (long designId : designIds) { + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (order == null) { + request.setResponseError("订单【" + designId + "】不存在,请重新选择!"); + return; + } + + if (order.getStatus() < StatusConstants.ORDER_10.value() + || order.getStatus() >= StatusConstants.ORDER_55.value()) { + request.setResponseError("当前订单【" + designId + "】状态不允许该项操作!"); + return; + } + + // AB单场景判断 + ZmrOperator abUser = DesignerGroupDispatchUtil.isABOrder(order); + if (abUser != null) { + request.setResponseResult("该订单【" + designId + "】是AB单,是否继续指定?"); + } + } + } + + /** + * 运营指定设计师 + * + * @author caohong + * @param request + * @throws Exception + */ + @AnTransaction + public static void doAssignDesigner(HttpRequest request) { + request.addValidate(new IsNotEmpty("designId", "请选择订单")); + request.addValidate(new IsSelect("designer", "请指定设计师")); + if (!request.chkValidate()) { + request.setResponseError(request.getAlertMsg()); + return; + } + + long designId = request.getParameterLong("designId"); + String designer = request.getParameter("designer"); + + String[] oids = request.getParameterValues("designIds"); + long[] designIds = Arrays.toLongArray(oids); + + + // 判断订单是否正在被抢单 + Jedis jedis = RedisUtils.getConn(); + try { + String lockKey = "ContendOrder:" + designId + "_lock"; + String lock = jedis.get(lockKey); + if (Validates.isNotEmpty(lock)) { + request.setResponseError("该订单正在派单中,请稍后再试"); + return; + } + } catch (Exception e) { + log.error("订单【" + designId + "】指定设计师【" + designer + "】异常", e); + } finally { + jedis.close(); + } + + try { + ZmrOperator oper = ZmrOperatorDao.getOperator(request, designer); + if (oper == null) { + request.setResponseError("设计师【" + designer + "】不存在,请重新选择!"); + return; + } + + long orgId = oper.getOrgId(); + + // 设计师接单规则 + Selector sel = new Selector(); + sel.addMust("operatorCode", designer); + sel.addMust("status", 1); + sel.addMust("designerStatus", 1); + DesignerGroupView designerGroup = ORM.get(ZView.class).item(DesignerGroupView.class, sel); + // 判断设计师接单数量 + if (designerGroup != null) { + int maxOrderNum = designerGroup.getDesignerMaxOrderNum(); + if (maxOrderNum == 0) { + // 个人没有配置独立规则,则获取对应规则组的数据 + maxOrderNum = designerGroup.getMaxOrderNum(); + } + + int orderNumber = DispatchDao.getUnCompleteOrderNumber(designer); + if (orderNumber >= maxOrderNum) { + request.setResponseError( + "指单失败,设计师[" + designer + "]未完成订单已满,最大[" + maxOrderNum + "],当前[" + orderNumber + "]"); + return; + } + } else { + request.setResponseError("设计师[" + designer + "]未配置接单规则权限"); + return; + } + + String logItem = "指定设计师:" + designer; + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("designer", designer); + updater.addField("designReceiveTime", Sqls.nowTimestamp()); + updater.addField("designBeginTime", Sqls.nowTimestamp()); + updater.addField("receiveType", 2); + updater.addField("status", StatusConstants.ORDER_30.value()); + updater.addField("orgId", orgId); + updater.addField("orgReceiveTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 更新设计师未完成订单数 + DispatchDao.doUpdateDesignerOrderNum(designer); + Selector selelct = new Selector("designId", designId <= 0 ? 0 : designId); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, selelct); + if (order != null && !StringUtils.isNullOrEmpty(order.getTids())) { + new ErpClassService(order.getTids(), order.getDesigner(), statusEnum.TO_BE_DESIGNEDING.getCode()); + } + + // 上班操作日志 + DesignerDao.doWorksStatusLog(orgId, designer, "接受平台指单", DesignerWorkStatus.ON_DUTY); + + // 发送通知 + // String text = "你有新的订单:\n" + order.getOrderText(); + // DesignerNoticePresenter.doDispatchNotice(request, designer, text); + + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), logItem, + EventConstants.ORDER_3.value()); + + } catch (Exception e) { + log.error( + request.getSessionName() + " 订单[" + designId + "]指定设计师[" + designer + "]失败,系统异常:" + e.getMessage(), + e); + request.setResponseError("指定设计师失败,系统异常:" + e.getMessage()); + } + } + + /** + * 运营指定设计师 + * + * @author caohong + * @param request + * @throws Exception + */ + @AnTransaction + public static void doAssignDesigners(HttpRequest request) { + /* request.addValidate(new IsNotEmpty("designId", "请选择订单")); + request.addValidate(new IsSelect("designer", "请指定设计师")); + if (!request.chkValidate()) { + request.setResponseError(request.getAlertMsg()); + return; + } + + long designId = request.getParameterLong("designId"); + String designer = request.getParameter("designer");*/ + + String[] oids = request.getParameterValues("designId"); + long[] designIds = Arrays.toLongArray(oids); + String designer = request.getParameter("designer"); + for (long designId : designIds) { + // 判断订单是否正在被抢单 + Jedis jedis = RedisUtils.getConn(); + try { + String lockKey = "ContendOrder:" + designId + "_lock"; + String lock = jedis.get(lockKey); + if (Validates.isNotEmpty(lock)) { + request.setResponseError("该订单正在派单中,请稍后再试"); + return; + } + } catch (Exception e) { + log.error("订单【" + designId + "】指定设计师【" + designer + "】异常", e); + } finally { + jedis.close(); + } + + try { + ZmrOperator oper = ZmrOperatorDao.getOperator(request, designer); + if (oper == null) { + request.setResponseError("设计师【" + designer + "】不存在,请重新选择!"); + return; + } + + long orgId = oper.getOrgId(); + + // 设计师接单规则 + Selector sel = new Selector(); + sel.addMust("operatorCode", designer); + sel.addMust("status", 1); + sel.addMust("designerStatus", 1); + DesignerGroupView designerGroup = ORM.get(ZView.class).item(DesignerGroupView.class, sel); + // 判断设计师接单数量 + if (designerGroup != null) { + int maxOrderNum = designerGroup.getDesignerMaxOrderNum(); + if (maxOrderNum == 0) { + // 个人没有配置独立规则,则获取对应规则组的数据 + maxOrderNum = designerGroup.getMaxOrderNum(); + } + + int orderNumber = DispatchDao.getUnCompleteOrderNumber(designer); + if (orderNumber >= maxOrderNum) { + request.setResponseError( + "指单失败,设计师[" + designer + "]未完成订单已满,最大[" + maxOrderNum + "],当前[" + orderNumber + "]"); + return; + } + } else { + request.setResponseError("设计师[" + designer + "]未配置接单规则权限"); + return; + } + + String logItem = "指定设计师:" + designer; + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("designer", designer); + updater.addField("designReceiveTime", Sqls.nowTimestamp()); + updater.addField("designBeginTime", Sqls.nowTimestamp()); + updater.addField("receiveType", 2); + updater.addField("status", StatusConstants.ORDER_30.value()); + updater.addField("orgId", orgId); + updater.addField("orgReceiveTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 更新设计师未完成订单数 + DispatchDao.doUpdateDesignerOrderNum(designer); + Selector selelct = new Selector("designId", designId <= 0 ? 0 : designId); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, selelct); + if (order != null && !StringUtils.isNullOrEmpty(order.getTids())) { + new ErpClassService(order.getTids(), order.getDesigner(), statusEnum.TO_BE_DESIGNEDING.getCode()); + } + + // 上班操作日志 + DesignerDao.doWorksStatusLog(orgId, designer, "接受平台指单", DesignerWorkStatus.ON_DUTY); + + // 发送通知 + // String text = "你有新的订单:\n" + order.getOrderText(); + // DesignerNoticePresenter.doDispatchNotice(request, designer, text); + + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), logItem, + EventConstants.ORDER_3.value()); + + } catch (Exception e) { + log.error( + request.getSessionName() + " 订单[" + designId + "]指定设计师[" + designer + "]失败,系统异常:" + e.getMessage(), + e); + request.setResponseError("指定设计师失败,系统异常:" + e.getMessage()); + } + + } + + + } + + + /** + * 修改行业 + * + * @param request + * @throws Exception + */ + public static void doModifyIndustry(HttpRequest request) throws Exception { + request.addValidate(new IsNotEmpty("designId", "请选择订单")); + request.addValidate(new IsSelect("industryId", "请选择行业")); + if (!request.chkValidate()) { + request.setResponseError(request.getAlertMsg()); + return; + } + + long designId = request.getParameterLong("designId"); + long industryId = request.getParameterLong("industryId"); + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (order == null) { + request.returnCloseDialog("订单【" + designId + "】不存在,请重新选择!"); + return; + } + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("industryId", industryId); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "修改行业", EventConstants.ORDER_20.value()); + } + + /*** + * 查询 设计订单 (客户端调用) + * + * @param request + * @throws Exception + */ + public static void doQueryDesignOrder(HttpRequest request) throws Exception { + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 15); + String startDate = request.getParameter("startDate", DateTimes.getPreviousDateStringByMonth(1)); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + long designId = request.getParameterLong("designId"); + + Selector sel = new Selector(); + if (designId > 0) { + sel.addOr(new Selector("designId", designId).addMust("outId", designId)); + } + + sel.addMaybeLike("buyerNick", request.getParameter("buyerNick")); + sel.addMaybeLike("tids", request.getParameter("tid")); + sel.addMaybe("draftType", request.getParameterInt("draftType")); + sel.addMaybe("status", request.getParameterInt("status", StatusConstants.ORDER_30.value())); + sel.addMaybe("designer", request.getParameter("designer")); + sel.addMaybe("receiverName", request.getParameter("receiverName")); + sel.addMustThenGE("designReceiveTime", Sqls.toTimestamp(startDate, "00:00:00")); + sel.addMustThenLE("designReceiveTime", Sqls.toTimestamp(endDate, "23:59:59")); + sel.addMustNotEqual("attaModul", FileTypeConstants.FILE_END.value()); + + sel.addOrderbyAsc("designReceiveTime"); + + Map jsonMap = new HashMap(); + List temp = ORM.get(ZView.class).list(DesignAttaView.class, sel); + Map orderMap = new HashMap(); + for (DesignAttaView o : temp) { + orderMap.put(o.getDesignId(), o); + } + List ssList = new ArrayList(); + for (DesignAttaView DesignOrderAttaView : orderMap.values()) { + ssList.add(DesignOrderAttaView.getDesignId()); + } + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, orderMap.values()); + jsonMap.put("orderList", pageResult.list()); + jsonMap.put("paramMap", request.getParameterMap()); + jsonMap.put("startDate", startDate); + jsonMap.put("endDate", endDate); + jsonMap.put("page", page); + jsonMap.put("pageSize", pageSize); + jsonMap.put("totalPages", pageResult.totalPages()); + + request.setResponseResult(Jsons.toString(jsonMap)); + } + + /** + * 查询订单是否关联模板 + * + * @param request + * @return =0表示不跳转,=1表示打开新窗口,=2表示不打开新窗口 + * @throws Exception + */ + public static void doDesignerOrderTemplate(HttpRequest request) throws Exception { + long designId = request.getParameterLong("designId"); + + // 查询是否已定稿模板 + Selector selector = new Selector(); + selector.addMust("designId", designId); + selector.addMust("templateType", 80); + int count = ORM.get(ZTable.class).count(MediaTemplate.class, selector); + if (count > 0) { + request.setResponseError("该订单已定稿,不允许前往设计"); + return; + } + + if (request.getParameterBoolean("orderFinish")) {// 订单完成卡片编辑修改状态 + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("status", StatusConstants.ORDER_30.value()); + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + Selector selelct = new Selector("designId", designId <= 0 ? 0 : designId); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, selelct); + if (order != null && !StringUtils.isNullOrEmpty(order.getTids())) { + new ErpClassService(order.getTids(), order.getDesigner(), statusEnum.TO_BE_DESIGNEDING.getCode()); + } + } + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + String url = request.getParameterNoFileterOnCNT("validateUrl"); + sessionUser.setMainUrl(url); + sessionUser.setWelcomeUrl(url); + request.setResponseResult(url); + } + + /** 查询订单信息 */ + public static void doQueryOrderInfo(HttpRequest request) { + request.addValidate(new IsInteger("mediaId", "模板id不存在")); + if (!request.chkValidate()) { + return; + } + + long mediaId = request.getParameterLong("mediaId"); + try { + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (template == null) { + return; + } + + long designId = template.getDesignId(); + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) { + return; + } + + request.setResponseResult(Jsons.toString(order)); + } catch (Exception e) { + + } + } + + /** + * 添加退款问题配置 + * + * @author 谢盼 + * @param 问题id + * @return + * @throws Exception + */ + public static void designOrderRefundReasonAdd(HttpRequest request) throws ORMException, SQLException { + String title = request.getParameter("reason"); + if (StringUtils.isNullOrEmpty(title)) { + + request.setResponseError("标题不能为空"); + } + DesignOrderRefundReason model = new DesignOrderRefundReason(); + model.setTitle(title); + model.setUpdateTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(model); + } + + /** + * 删除退款问题配置 + * + * @author 谢盼 + * @param 问题id + * @return + * @throws Exception + */ + public static void designOrderRefundReasonDelete(HttpRequest request, Long id) throws ORMException, SQLException { + ORM.get(ZTable.class).delete(DesignOrderRefundReason.class, id); + } + + /** + * 修改退款问题配置 + * + * @author 谢盼 + * @param 问题id,问题标题 + * @return + * @throws Exception + */ + public static void designOrderRefundReasonModify(HttpRequest request, String reason, Long id) + throws ORMException, SQLException { + ORM.get(ZTable.class).update(DesignOrderRefundReason.class, + new Updater().addField("title", reason).addMust("id", id)); + } + + /** + * 退款订单审核同意退款 + * + * @author 谢盼 + * @param 订单id + * @return 责任人id + * @throws Exception + */ + @AnTransaction + public static void designOrderAgreeRefund(HttpRequest request) throws Exception { + long designOrderId = Long.valueOf(request.getParameter("designOrderId")); + int responsibility = Integer.valueOf(request.getParameter("responsibility")); + Updater orderUpdater = new Updater(); + if (responsibility != 0) { + orderUpdater.addField("status", StatusConstants.ORDER_F100.value()); + } else { + orderUpdater.addField("status", StatusConstants.ORDER_F110.value()); + } + orderUpdater.addMust("designId", designOrderId); + + ORM.get(ZTable.class).update(DesignOrder.class, orderUpdater); + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designOrderId); + /*if (order.getMerchantId() == 1823193185001L) { + + Boolean flag = ErpRmiService.doSynOrderCancel(designOrderId); + if (!flag) { + Boolean reTry = ErpRmiService.doSynOrderCancel(designOrderId); + if (!reTry) { + throw new Exception("请求退款:同步ERP状态失败"); + } + } + } + try { + // 订单审核退回消息提醒 + MessageBusi messageBusi = new MessageBusi(); + messageBusi.setId(String.valueOf(Ids.longId13_4())); + messageBusi.setProducerOperateType("1"); + messageBusi.setProducerOperateCode(request.getSessionName()); + messageBusi.setProducerOperateName(request.getSessionName()); + messageBusi.setConsumerPlatformType(MessageSysType.DESIGN_CODE); + messageBusi.setConsumerOperateCode(order.getDesigner()); + messageBusi.setConsumerOperateName(order.getDesigner()); + messageBusi.setConsumerOperateType("1"); + messageBusi.setMessageType(3); + messageBusi.setOrderId(String.valueOf(order.getDesignId())); + messageBusi.setTopic(MessageTopicType.AFTER_ORDER); + messageBusi.setMessageBody("您有一条退款订单(" + order.getDesignId() + ")审核通过,请前往查看。"); + HashMap propertyMap = new HashMap(); + propertyMap.put("designId", String.valueOf(order.getDesignId())); + propertyMap.put("title", "退款订单审核提醒"); + propertyMap.put("sender", request.getSessionName()); + ZqmMessageProducerHandler.sendMessage(messageBusi, propertyMap); + } catch (Exception e) { + // 推送消息失败 + log.error(e.getMessage(), e); + }*/ + OrderLogDao.saveOrderOperateLog(designOrderId, request.getSessionName(), + "设计师【" + order.getDesigner() + "】申请退款审核通过", EventConstants.ORDER_39.value()); + + } + + /** + * 退款订单审核拒绝退款 + * + * @author 谢盼 + * @param 订单id + * @throws Exception + */ + public static void designOrderDisAgreeRefund(HttpRequest request) throws ORMException, SQLException { + long designId = Long.valueOf(request.getParameter("designId")); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector().addMaybe("designId", designId)); + + // SelfOrder selfOrder = ORM.get(ZTable.class).item(SelfOrder.class, designId); + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("status", StatusConstants.ORDER_30.value()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + if (order != null && !StringUtils.isNullOrEmpty(order.getTids())) { + new ErpClassService(order.getTids(), order.getDesigner(), statusEnum.TO_BE_DESIGNEDING.getCode()); + } + + Selector selector = new Selector(); + selector.addMust("designId", designId); + selector.addMust("attaModul", "ApplyRefundFile"); + DesignAtta designAtta = ORM.get(ZTable.class).item(DesignAtta.class, selector); + try { + File file = new File(designAtta.getSavePath()); + if (file.exists() && file.isFile()) { + file.delete(); + // 删除订单附件截图 + Selector deleteSelector = new Selector(); + deleteSelector.addMust("designId", designAtta.getDesignId()); + deleteSelector.addMust("attaModul", "ApplyRefundFile"); + ORM.get(ZTable.class).delete(DesignAtta.class, deleteSelector); + } + } catch (Exception e) { + log.error("拒绝退款订单截图删除异常,订单号:{}", designId, e.getMessage(), e); + } + try { + // 订单审核退回消息提醒 + MessageBusi messageBusi = new MessageBusi(); + messageBusi.setId(String.valueOf(Ids.longId13_4())); + messageBusi.setProducerOperateType("1"); + messageBusi.setProducerOperateCode(request.getSessionName()); + messageBusi.setProducerOperateName(request.getSessionName()); + messageBusi.setConsumerPlatformType(MessageSysType.DESIGN_CODE); + messageBusi.setConsumerOperateCode(order.getDesigner()); + messageBusi.setConsumerOperateName(order.getDesigner()); + messageBusi.setConsumerOperateType("1"); + messageBusi.setMessageType(3); + messageBusi.setOrderId(String.valueOf(order.getDesignId())); + messageBusi.setTopic(MessageTopicType.AFTER_ORDER); + messageBusi.setMessageBody("您有一条退款订单(" + order.getDesignId() + ")审核被驳回,请前往查看。"); + HashMap propertyMap = new HashMap(); + propertyMap.put("designId", String.valueOf(order.getDesignId())); + propertyMap.put("title", "退款订单审核提醒"); + propertyMap.put("sender", request.getSessionName()); + ZqmMessageProducerHandler.sendMessage(messageBusi, propertyMap); + } catch (Exception e) { + // 推送消息失败 + log.error("退款订单审核驳回:消息推送失败:订单号【{}】", designId, e.getMessage(), e); + } + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "设计师【" + order.getDesigner() + "】申请退款审核驳回", + EventConstants.ORDER_40.value()); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignPinleiPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignPinleiPresenter.java new file mode 100644 index 0000000..eb971cd --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignPinleiPresenter.java @@ -0,0 +1,102 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.editor.DesignPinlei; +import com.zhiqim.yangcai.util.BusinessTbzBjqUtil; + +@AnAlias("DesignPinleiPresenter") +@AnIntercept("chkZmrLogin") +public class DesignPinleiPresenter { + + public void insert(HttpRequest request) throws Exception { + // TODO Auto-generated method stub + JSONArray jsonArray = BusinessTbzBjqUtil.getPinleiList(); + if(null == jsonArray) { + request.setResponseError("编辑器暂未配置上线品类"); + return; + } + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonobject = jsonArray.getJSONObject(i); + Long id = jsonobject.getLong("id"); + JSONObject jsonobject2 = jsonobject.getJSONObject("classify"); + String name = jsonobject2.getString("name"); + Long classifyId = jsonobject2.getLong("classifyId"); + + DesignPinlei designPinlei1 = ORM.get(ZTable.class).item(DesignPinlei.class, new Selector().addMust("id", id)); + if(null == designPinlei1) {//不存在则新增 + DesignPinlei designPinlei = new DesignPinlei(); + designPinlei.setId(id); + designPinlei.setName(name); + designPinlei.setClassifyId(classifyId); + ORM.get(ZTable.class).insert(designPinlei); + }else {//存在则修改 + Updater updater = new Updater(); + updater.addMust("id", id); + updater.addField("name", name); + updater.addField("classifyId", classifyId); + ORM.get(ZTable.class).update(DesignPinlei.class, updater); + } + } + //拿到现有品类数据 + List list = ORM.get(ZTable.class).list(DesignPinlei.class, new Selector()); + for (DesignPinlei designPinlei : list) { + long oldId = designPinlei.getId(); + boolean isDel = true;//是否删除 + for (int i = 0; i < jsonArray.size(); i++) {//循环同步过来的品类数据 + JSONObject jsonobject = jsonArray.getJSONObject(i); + Long id = jsonobject.getLong("id"); + if(oldId == id) {//如果存在该品类数据,则将是否删除为否 + isDel = false; + } + } + if(isDel) { + ORM.get(ZTable.class).delete(DesignPinlei.class, oldId); + } + } + } + + public void bindingType(HttpRequest request) throws Exception { + // TODO Auto-generated method stub + long id = request.getParameterLong("id"); + long typeId = request.getParameterLong("typeId"); + if(typeId == 0) {//解绑 + Updater updater = new Updater(); + updater.addMust("id", id); + updater.addField("typeId", 0); + updater.addField("typeName", ""); + ORM.get(ZTable.class).update(DesignPinlei.class, updater); + return; + } + + DesignType designType = ORM.get(ZTable.class).item(DesignType.class, new Selector().addMust("typeId", typeId)); + if(designType == null ) { + request.setResponseError("未找到该产品类型"); + return; + } + + DesignPinlei designPinlei = ORM.get(ZTable.class).item(DesignPinlei.class, new Selector().addMust("typeId", typeId)); + if(null != designPinlei) { + request.setResponseError("该产品类型已被【" + designPinlei.getName() + "】绑定,请去解绑后再来操作"); + return; + } + Updater updater = new Updater(); + updater.addMust("id", id); + updater.addField("typeId", typeId); + updater.addField("typeName", designType.getTypeName()); + ORM.get(ZTable.class).update(DesignPinlei.class, updater); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerGroupPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerGroupPresenter.java new file mode 100644 index 0000000..a42ca72 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerGroupPresenter.java @@ -0,0 +1,224 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.design.dbo.design.DesignOrgMer; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroup; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.dispatch.DesignerGroupDispatchLog; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.subscribe.SubscribeOrgTempQuota; +import com.zhiqim.yangcai.dispatch.dao.DesignerGroupDispatchAnalysisDao; +import com.zhiqim.yangcai.dispatch.model.DesignOrgMerModule; +import com.zhiqim.yangcai.dispatch.model.DesignerGroupAnalysisResult; +import com.zhiqim.yangcai.dispatch.model.DesignerGroupDataModel; +import com.zhiqim.yangcai.dispatch.model.DesignerGroupMerDispatchAnalysisModule; +import com.zhiqim.yangcai.util.DesignerGroupDispatchUtil; + +@AnAlias( +{ + "DesignerGroupPresenter" +}) +@AnIntercept( +{ + "chkZmrLogin" +}) +public class DesignerGroupPresenter +{ + + /** + * yixin 2020-11-10 修改设计师组状态 + * + * @param request + * @throws Exception + */ + public static void doUpdateDesignerGroupStatus(HttpRequest request) throws Exception + { + long designerGroupId = request.getParameterLong("designerGroupId"); + int status = request.getParameterInt("status"); + request.setResponseResult("ok"); + Updater updater = new Updater(); + updater.addMust("designerGroupId", designerGroupId); + updater.addField("status", status); + updater.addField("modifyOperatorCode", request.getSessionName()); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignerGroup.class, updater); + } + + /** + * yixin 2020-11-10 修改设计师接单配置状态 + * + * @param request + * @throws Exception + */ + public static void doUpdateDesignerGroupDispatchStatus(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode", ""); + int status = request.getParameterInt("status"); + request.setResponseResult("ok"); + Updater updater = new Updater(); + updater.addMust("operatorCode", operatorCode); + updater.addField("status", status); + updater.addField("modifyOperatorCode", request.getSessionName()); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignerGroupDispatch.class, updater); + } + + /** + * yixin 2023-07-01 修改设计师接单配置是否显示佣金 + * + * @param request + * @throws Exception + */ + public static void doUpdateDesignerGroupDispatchIsShowCost(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode", ""); + int isShowCost = request.getParameterInt("isShowCost"); + request.setResponseResult("ok"); + Updater updater = new Updater(); + updater.addMust("operatorCode", operatorCode); + updater.addField("isShowCost", isShowCost); + updater.addField("modifyOperatorCode", request.getSessionName()); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignerGroupDispatch.class, updater); + } + + /** + * yixin 2023-07-10 修改设计师接单配置是否显示抢单大厅 + * + * @param request + * @throws Exception + */ + public static void doUpdateDesignerGroupDispatchIsShowQddt(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode", ""); + int isShowQddt = request.getParameterInt("isShowQddt"); + request.setResponseResult("ok"); + Updater updater = new Updater(); + updater.addMust("operatorCode", operatorCode); + updater.addField("isShowQddt", isShowQddt); + updater.addField("modifyOperatorCode", request.getSessionName()); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignerGroupDispatch.class, updater); + } + + + /**** + * 查询订单已分拣日志 的分拣分析 + * + * @param request + * @throws Exception + */ + public static void doViewDesignerGroupDispatchLogAnalysis(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + designId = designId < 0 ? 0 : designId; + String desTime = request.getParameter("desTime", DateTimes.getDateTimeString()); + DesignerGroupDispatchLog merlog = ORM.get(ZTable.class).item(DesignerGroupDispatchLog.class, + new Selector("designId", designId).addMust("desTime", Sqls.toTimestamp(desTime))); + if (merlog == null || Validates.isEmptyBlank(merlog.getAnalysisText())) + { + request.setResponseError("订单没有分拣分析日志"); + return; + } + + DesignerGroupAnalysisResult analysisResult = JSONObject.parseObject(merlog.getAnalysisText(), DesignerGroupAnalysisResult.class); + MapSO attaMap = new HashMapSO(); + attaMap.put("analysisResult", analysisResult); + String resultHtml = ZmlContexts.parseZmlPath(request, "/zview/dispatch/presenter/designerGroupAnalisysResult.zml", attaMap); + + Map jsonMap = new HashMap(); + jsonMap.put("analysisResult", analysisResult); + jsonMap.put("resultHtml", resultHtml); + + request.setResponseResult(Jsons.toString(jsonMap)); + } + + /** 查询订单分拣分析(订单未分拣) */ + public static void doQueryDesignerGroupOrderDispatchAnalysis(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + designId = designId < 0 ? 0 : designId; + //先去查这个订单是否存在 + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单【" + designId + "】不存在"); + return; + } + + List list = new ArrayList<>(); + + // 查询已经激活的组织信息 + Map orgMap = new HashMap(); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, new Selector().addMust("orgStatus", 0).addOrderbyAsc("orgLevel,orgSeq,orgId")); + for (ZmrOrg org : orgList) + { + orgMap.put(org.getOrgId(), org); + } + + // 查询组织接单规则信息 + Selector sel = new Selector(); + sel.addMust("merStatus", 0);// 组织状态正常 + sel.addMust("isPauseRecieive", false);// 接单状态正常 + sel.addOrderbyAsc("merLevel"); + List tempList = ORM.get(ZTable.class).list(DesignOrgMer.class, sel); + for (DesignOrgMer mer : tempList) + {// 筛选接单时间段内商户 + ZmrOrg org = orgMap.get(mer.getOrgId()); + if (org == null) + { + continue; + } + DesignOrgMerModule module = new DesignOrgMerModule(); + Objects.copyDeep(mer, module); + // 查询临时额度 + SubscribeOrgTempQuota subscribeOrgTempQuota = ORM.get(ZTable.class).item(SubscribeOrgTempQuota.class, + new Selector("orgId", mer.getOrgId()).addMust("state", 1)); + if (subscribeOrgTempQuota != null) + { + module.setTempQuota(subscribeOrgTempQuota.getTempQuota()); + } + module.setOrgName(org.getOrgName()); + list.add(module); + } + + //设计师组订单分拣分析结果 + DesignerGroupAnalysisResult analysisResult = DesignerGroupDispatchAnalysisDao.doAnalysis(order, list); + Map modelMap = DesignerGroupDispatchUtil.getDesignerGroupDataModelMap(); + for (DesignerGroupMerDispatchAnalysisModule module : analysisResult.getMerAnalysisList()) + { + module.setDesignerResultList(DesignerGroupDispatchUtil.doOrgMerAnalysis(module, order, modelMap)); + } + MapSO attaMap = new HashMapSO(); + attaMap.put("analysisResult", analysisResult); + String resultHtml = ZmlContexts.parseZmlPath(request, "/zview/dispatch/presenter/designerGroupAnalisysResult.zml", attaMap); + + Map jsonMap = new HashMap(); + jsonMap.put("analysisResult", analysisResult); + jsonMap.put("resultHtml", resultHtml); + + request.setResponseResult(Jsons.toString(jsonMap)); + } +} \ No newline at end of file diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerNoticePresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerNoticePresenter.java new file mode 100644 index 0000000..4e48a49 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerNoticePresenter.java @@ -0,0 +1,129 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpSessionManager; +import org.zhiqim.httpd.HttpSessionUser; +import org.zhiqim.httpd.HttpWebsocketConnection; +import org.zhiqim.httpd.HttpWebsocketManager; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.alibaba.fastjson.JSON; +import com.zhiqim.yangcai.design.dbo.notice.Notice; + +/** + * 派单通知Presenter + * + * @version v1.0.0 @author Deng 2017-12-22 新建与整理 + */ +@AnAlias("DesignerNoticePresenter") +@AnIntercept("chkZmrLogin") +public class DesignerNoticePresenter +{ + /** + * 派单消息提醒 + * + * @param operatorCode + * @param operatorPass + * @return + */ + public static void doDispatchNotice(HttpRequest request, String operatorCode, String text) + { + if (Validates.isEmptyBlank(operatorCode) || Validates.isEmptyBlank(text)) + { + return; + } + + HttpWebsocketManager websocketManager = request.getContext().getWebsocketManager(); + HttpSessionManager sessionManager = request.getContext().getSessionManager(); + List sessionUserList = sessionManager.getSessionUserList(); + for (HttpSessionUser sUser : sessionUserList) + { + if (!operatorCode.equals(sUser.getSessionName())) + { + continue; + } + + List connList = websocketManager.get("yangcai_designer", sUser.getSessionId()); + for (HttpWebsocketConnection conn : connList) + { + conn.send(text); + } + } + } + + /** + * 首页公告详情 + * + * @return + * @throws SQLException + * @throws ORMException + */ + public static void getNoticeInfo(HttpRequest request, long id) throws ORMException, SQLException + { + Notice notice = ORM.get(ZTable.class).item(Notice.class, id); + request.setResponseResult(JSON.toJSONString(notice)); + } + + /** + * 启用公告 + * + * @return + * @throws SQLException + * @throws ORMException + */ + public static void doEnable(HttpRequest request, long id) throws ORMException, SQLException + { + Notice notice = ORM.get(ZTable.class).item(Notice.class, id); + int status = notice.getStatus(); + if ((status < 0) || status == 1) + { + request.setResponseError("该公告已发布,请不要重复操作"); + return; + } + Updater updater = new Updater(); + updater.addMust("id", id); + updater.addField("status", 1); + updater.addField("updateTime", Sqls.nowTimestamp()); + updater.addField("updateUser", request.getSessionName()); + updater.addField("finshTime", Sqls.nowTimestamp()); + updater.addField("finshUser", request.getSessionName()); + ORM.get(ZTable.class).update(Notice.class, updater); + } + + /** + * 下线公告 + * + * @return + * @throws SQLException + * @throws ORMException + */ + public static void doBlockUp(HttpRequest request, long id) throws ORMException, SQLException + { + Notice notice = ORM.get(ZTable.class).item(Notice.class, id); + int status = notice.getStatus(); + if (status == 2) + { + request.setResponseError("该公告已下线,请不要重复操作!"); + } + if (status == 0) + { + request.setResponseError("草稿不支持下线!"); + } + Updater updater = new Updater(); + updater.addMust("id", id); + updater.addField("status", 2); + updater.addField("updateTime", Sqls.nowTimestamp()); + updater.addField("updateUser", request.getSessionName()); + ORM.get(ZTable.class).update(Notice.class, updater); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerPresenter.java new file mode 100644 index 0000000..3b32135 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerPresenter.java @@ -0,0 +1,802 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.*; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.HotWordDao; +import com.zhiqim.yangcai.design.dao.KeywordDao; +import com.zhiqim.yangcai.design.dbo.DesKeywordLog; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourse; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateEventView; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; +import com.zhiqim.yangcai.design.model.HeatKeywordModel; + +/** + * 设计Presenter + * + * @version v1.0.0 @author Deng 2017-11-28 新建与整理 + */ +@AnAlias("DesignerPresenter") +@AnIntercept("chkZmrLogin") +public class DesignerPresenter +{ + /** + * 根据输入搜索词查询关键词列表(最近10条) + * + * @param request 请求 + * @param keyword 关键词 + * @return 数组的JSON字符串 + * @throws Exception 异常 + */ + public static String doKeywordList(String keyword) throws Exception + { + if (Validates.isEmptyBlank(keyword)) + { + return "[]"; + } + + String[] word = keyword.split(" "); + Selector selector = new Selector(); + + // 搜热词量增加或新增 + doKeywordHeatSearch(keyword); + + for (int i = 0; i < word.length; i++) + { + if (Validates.isEmptyBlank(word[i])) + { + continue; + } + + selector.addMaybeLike("keywordName", word[i]); + } + selector.addOrderbyDesc("searchCount"); + PageResult pageResult = ORM.get(ZTable.class).page(DesKeywordLog.class, 1, 10, selector); + + List titleList = new ArrayList<>(); + for (DesKeywordLog item : pageResult.list()) + { + titleList.add(item.getKeywordName()); + } + + return Jsons.toString(titleList); + } + + /** + * 关键词搜索统计 + * + * @throws Exception + */ + public static void doKeywordHeatSearch(String keyword) throws Exception + { + List floatList = new ArrayList(); + List logList = ORM.get(ZTable.class).list(DesKeywordLog.class, new Selector().addMustLike("keywordName", keyword)); + if (logList.size() == 0) + { + // 插入搜索日志 + DesKeywordLog log = new DesKeywordLog(); + log.setLogId(Ids.longId()); + log.setKeywordName(keyword); + log.setSearchCount(1); + log.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(log); + } + else + { + for (DesKeywordLog log : logList) + { + float str = HotWordDao.getSimilarityRatio(keyword, log.getKeywordName()); + + HeatKeywordModel model = new HeatKeywordModel(); + model.setLogId(log.getLogId()); + model.setStr((int) (str * 10000)); + + floatList.add(model); + } + + // 排序,降序 + Collections.sort(floatList, new Comparator() + { + @Override + public int compare(HeatKeywordModel o1, HeatKeywordModel o2) + { + return o2.getStr() - o1.getStr(); + } + }); + + long logId = floatList.get(0).getLogId(); + int maxNum = floatList.get(0).getStr(); + int num = 4000; + // 相似度40%左右,热度+1,否则为新增关键词 + if (maxNum > num) + { + DesKeywordLog log = ORM.get(ZTable.class).item(DesKeywordLog.class, new Selector("logId", logId)); + Updater updater = new Updater(); + updater.addMust("logId", logId); + updater.addField("searchCount", log.getSearchCount() + 1); + + ORM.get(ZTable.class).update(DesKeywordLog.class, updater); + } + else + { + // 插入搜索日志 + DesKeywordLog log = new DesKeywordLog(); + log.setLogId(Ids.longId()); + log.setKeywordName(keyword); + log.setSearchCount(1); + log.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(log); + } + } + } + + /** + * 关键词查询模板 + * + * @param request + * @throws Exception + */ + public static void doTemplateKeywordSearch(HttpRequest request) throws Exception + { + ZmrSessionUser user = request.getSessionUser(ZmrSessionUser.class); + String[] deptStr = Arrays.toStringArray(user.getOperator().getOperatorDeptAll()); + + int page = request.getParameterInt("page", 1); + int pageSize = 20; + + String keyword = request.getParameter("keyword", ""); + String urlParam = request.getParameter("urlParam"); + long designType = request.getParameterLong("designType"); + long industryId = request.getParameterLong("industryId"); + Selector selector = new Selector(); + if (designType != -1) + { + if (designType == 10086) + { + List prdtypeList = DesignTypeDao.list(); + List prdList = new ArrayList(); + for (DesignType type : prdtypeList) + { + prdList.add(type.getTypeId()); + } + + selector.addMustInLong("designType", Arrays.toArrayLong(prdList)); + } + else + { + selector.addMust("designType", designType); + } + } + + if (industryId != -1) + { + if (industryId == 10087) + { + List indList = Global.get(DesignIndustryCache.class).getIndustryList(); + List inList = new ArrayList(); + for (DesignIndustry ind : indList) + { + inList.add(ind.getIndustryId()); + } + + selector.addMustInLong("industryId", Arrays.toArrayLong(inList)); + } + else + { + selector.addMust("industryId", industryId); + } + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("ALL")) + {// 系统模板 + selector.addMustIn("templateType", 100, 110); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("BEST")) + {// 精品模板 + selector.addMust("templateType", 110); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("MY")) + {// 我的模板 + selector.addMust("designer", user.getOperator().getOperatorCode()); + selector.addMustIn("templateType", 10, 20, 80, 100, 110); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("CDR")) + {// CDR转模板 + selector.addMust("templateType", 30); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("COLLECT")) + {// 我收藏的 + selector.addMust("operatorCode", user.getOperatorCode()); + selector.addMust("eventType", 2); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("SHARE")) + {// 分享给我的 + if (Validates.isNotEmpty(user.getOperator().getOperatorDeptAll())) + { + if (deptStr.length == 1) + { + selector.addMustLike("shareDept", deptStr[0]); + } + else if (deptStr.length > 1) + { + Selector sel = new Selector(); + for (String dept : deptStr) + { + sel.addMustLike("shareDept", dept); + } + selector.addOr(sel); + } + } + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("DRAFT")) + {// 临时 + selector.addMust("designer", user.getOperator().getOperatorCode()); + selector.addMust("templateType", 0); + selector.addMust("templateStatus", 0); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("ORDER")) + {// 订单 + selector.addMust("designer", user.getOperator().getOperatorCode()); + selector.addMust("templateType", 80); + selector.addMust("templateStatus", 0); + } + + // 关键词查询 + String[] word = keyword.split(" "); + for (int i = 0; i < word.length; i++) + { + if (Validates.isEmptyBlank(word[i])) + { + continue; + } + + selector.addMaybeLike("keywordName", word[i]); + } + + MapSO attrMap = new HashMapSO(); + attrMap.put("designId", request.getParameterLong("designId")); + if (Validates.isNotEmpty(urlParam) && urlParam.equals("COLLECT")) + { + PageResult pageResult = ORM.get(ZView.class).page(DesTemplateEventView.class, page, pageSize, selector); + attrMap.put("pageResult", pageResult); + } + else + { + PageResult pageResult = ORM.get(ZView.class).page(MediaTemplateView.class, page, pageSize, selector); + attrMap.put("pageResult", pageResult); + } + + attrMap.put("keyword", keyword); + attrMap.put("designType", designType); + attrMap.put("industryId", industryId); + attrMap.put("urlParam", urlParam); + String ret = ZmlContexts.parseZmlPath(request, "/zview/template/inner/templateSearchInfo.ftml", attrMap); + request.setResponseResult(ret); + } + + /** + * 添加关键词 + * + * @param request + * @param worksId + * @param keywordName + * @throws Exception + */ + @AnTransaction + public static void doKeywordAdd(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + String keywordName = request.getParameter("keywordName"); + String type = request.getParameter("type"); + + // 关键词是否进行过重塑的标志 + boolean remodelFlag = Boolean.FALSE; + // 重塑被新增的关键词 + if (Validates.isNotEmptyBlank(keywordName)) + { + // 如果被新增的关键词包含" " 或者 "," 或者 "," 则进行重塑 + if (keywordName.contains(" ") || keywordName.contains(",") || keywordName.contains(",") ) + { + remodelFlag = Boolean.TRUE; + keywordName = remodelKeyword(keywordName); + } + } + + if ("template".equals(type)) + { + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (Validates.isNotEmpty(media.getKeywordName())) + {// 关键词校验 + String[] splitName = media.getKeywordName().split(","); + for (String kName : splitName) + { + if (kName.indexOf(" ") > -1) + { + String[] strName = kName.split(" "); + for (String sName : strName) + { + if (keywordName.equals(sName)) + { + request.setResponseError("关键词已存在,请重新输入"); + return; + } + } + } + else + { + if (keywordName.equals(kName)) + { + request.setResponseError("关键词已存在,请重新输入"); + return; + } + } + } + } + + // 关键词重塑后做新的重复校验 + if (remodelFlag) + { + boolean res = checkKWRepeatAfterRemodel(keywordName, type, mediaId); + if (res) + { + request.setResponseError("关键词已存在,请重新输入"); + return; + } + } + + String name = ""; + if (Validates.isNotEmpty(media.getKeywordName())) + { + name += media.getKeywordName() + "," + keywordName; + } + + // 更新模板表的关键词字段 + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + + if (Validates.isNotEmpty(media.getKeywordName())) + { + updater.addField("keywordName", name); + } + else + { + updater.addField("keywordName", keywordName); + } + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + } + else + { + DesWorksFile works = ORM.get(ZTable.class).item(DesWorksFile.class, mediaId); + if (Validates.isNotEmpty(works.getKeywordName())) + {// 关键词校验 + String[] splitName = works.getKeywordName().split(","); + for (String kName : splitName) + { + if (kName.indexOf(" ") > -1) + { + String[] strName = kName.split(" "); + for (String sName : strName) + { + if (keywordName.equals(sName)) + { + request.setResponseError("关键词已存在,请重新输入"); + return; + } + } + } + else + { + if (keywordName.equals(kName)) + { + request.setResponseError("关键词已存在,请重新输入"); + return; + } + } + } + } + + // 关键词重塑后做新的重复校验 + if (remodelFlag) + { + boolean res = checkKWRepeatAfterRemodel(keywordName, type, mediaId); + if (res) + { + request.setResponseError("关键词已存在,请重新输入"); + return; + } + } + + String name = ""; + if (Validates.isNotEmpty(works.getKeywordName())) + { + name += works.getKeywordName() + "," + keywordName; + } + + // 更新模板表的关键词字段 + Updater updater = new Updater(); + updater.addMust("worksId", mediaId); + + if (Validates.isNotEmpty(works.getKeywordName())) + { + updater.addField("keywordName", name); + } + else + { + updater.addField("keywordName", keywordName); + } + + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + + // 插入关键词 + KeywordDao.doKeywordLostofAdd(keywordName, request.getSessionName(), 1); + + request.setResponseResult(keywordName); + } + + /** + * 用于被新增关键词重塑后返回
            + * 关键词存储规则:输入端关键词格式以英文逗号或者单个空格分隔
            + * 后台校验:去除被新增关键词前后全角半角逗号及空格,最后替换空格为英文逗号[考虑连续空格]
            + * + * @param oldKeyWord + * @return java.lang.String + * @author HuangZhiGao + * @date 2020/2/26 9:44 + */ + public static String remodelKeyword(String oldKeyWord) + { + String newKeyWord = ""; + // 使用zhiqim字符串工具类重塑关键词 + if (Validates.isNotEmptyBlank(oldKeyWord)) + { + // 首先替换关键词中所有的"," 和 "," 为 " " + oldKeyWord = oldKeyWord.replace(",", " "); + oldKeyWord = oldKeyWord.replace(",", " "); + + // 去除关键词前后连续的所有空白 + oldKeyWord = Strings.trimLeft(oldKeyWord); + oldKeyWord = Strings.trimRight(oldKeyWord); + // 并去除前后空格 + oldKeyWord = oldKeyWord.trim(); + + // 再格式化关键词内部连续的空格为一个空格 + oldKeyWord = Strings.formatSpace(oldKeyWord); + + // 最后替换关键词内部的" " 为 "," + oldKeyWord = oldKeyWord.replace(" ", ","); + + newKeyWord = oldKeyWord; + } + return newKeyWord; + } + + /** + * 关键词重塑后进行新的校验是否重复
            + * + * @param keyword 关键词 + * @param type 作品或模板 + * @param mediaId 作品id或模板id + * @return boolean + * @author HuangZhiGao + * @date 2020/2/26 11:04 + */ + public static boolean checkKWRepeatAfterRemodel(String keyword, String type, long mediaId) throws Exception + { + // 是否重复 + boolean result = Boolean.FALSE; + String[] keywordArr = keyword.split(","); + + if ("template".equals(type)) + { + // 模板关键词校验 + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (Validates.isNotEmpty(media.getKeywordName())) + { + String[] splitName = media.getKeywordName().split(","); + for (String kName : splitName) + { + if (kName.indexOf(" ") > -1) + { + String[] strName = kName.split(" "); + for (String sName : strName) + { + for (String keyw : keywordArr) + { + if (keyw.equals(sName)) + { + return Boolean.TRUE; + } + } + } + } + else + { + for (String keyw : keywordArr) + { + if (keyw.equals(kName)) + { + return Boolean.TRUE; + } + } + } + } + } + } + else + { + // 作品关键词校验 + DesWorksFile works = ORM.get(ZTable.class).item(DesWorksFile.class, mediaId); + if (Validates.isNotEmpty(works.getKeywordName())) + { + String[] splitName = works.getKeywordName().split(","); + for (String kName : splitName) + { + if (kName.indexOf(" ") > -1) + { + String[] strName = kName.split(" "); + for (String sName : strName) + { + for (String keyw : keywordArr) + { + if (keyw.equals(sName)) + { + return Boolean.TRUE; + } + } + } + } + else + { + for (String keyw : keywordArr) + { + if (keyw.equals(kName)) + { + return Boolean.TRUE; + } + } + } + } + } + } + + return result; + } + + /** + * 用于前端查看单个模板或作品时修改关键词结构
            + * 并且更新数据库关键词
            + * + * @param keyword 关键词 + * @param type 作品或模板 + * @param mediaId 作品id或模板id + * @param + * @return java.lang.String[] + * @author HuangZhiGao + * @date 2020/2/26 13:51 + */ + public static String[] updateKeywordArr(String keyword, String type, long mediaId) throws Exception + { + // 重塑关键词 + if (Validates.isNotEmptyBlank(keyword)) + { + keyword = remodelKeyword(keyword); + + Updater updater = new Updater(); + updater.addField("keywordName", keyword); + // 更新数据库关键词 + if ("template".equals(type)) + { + // 模板关键词更新 + updater.addMust("mediaId", mediaId); + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + } + else + { + // 作品关键词更新 + updater.addMust("worksId", mediaId); + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + } + return Arrays.toStringArray(keyword); + } + + /** + * 删除关键词 + * + * @param worksId + * @param keywordId + * @throws Exception + */ + @AnTransaction + public static void doKeywordDelete(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + String keywordName = request.getParameter("keywordName"); + String type = request.getParameter("type"); + + // 1.更新模板或作品中的关键词字段参数 + boolean falg = KeywordDao.doKeywordNameUpdater(mediaId, keywordName, type); + if (!falg) + { + request.setResponseError("未找到该关键词,请重新选择"); + return; + } + } + + /** + * 模板关联标签 + * + * @param worksId + * @param parIdarr + * @param catIdarr + * @param labIdarr + * @throws Exception + */ + @AnTransaction + public static void doTemplateLabelExec(HttpRequest request, long mediaId, long designType, long industryId, String industrySubIds, String attributeIds) + throws Exception + { + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + String oldPrdTypeName = DesignTypeDao.name(media.getTypeId()); + String oldIndustryName = Global.get(DesignIndustryCache.class).getIndustryName(media.getIndustryId()); + String oldIndustrySubName = KeywordDao.doIndustrySubName(media.getIndustrySubIds()); + String oldAttributeName = KeywordDao.doAttributeName(media.getAttributeIds()); + String oldLabelName = oldPrdTypeName + " " + oldIndustryName + " " + oldIndustrySubName + " " + oldAttributeName; + + String prdTypeName = DesignTypeDao.name(designType); + String industryName = Global.get(DesignIndustryCache.class).getIndustryName(industryId); + String industrySubName = KeywordDao.doIndustrySubName(industrySubIds); + String attributeName = KeywordDao.doAttributeName(attributeIds); + String labelName = prdTypeName + " " + industryName + " " + industrySubName + " " + attributeName; + + if (Validates.isEmpty(media.getKeywordName()) || Validates.isEmpty(media.getIndustrySubIds()) && Validates.isEmpty(media.getAttributeIds())) + { + String keywordName = ""; + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("industryId", industryId); + updater.addField("industrySubIds", industrySubIds); + updater.addField("industrySubName", industrySubName); + updater.addField("attributeIds", attributeIds); + updater.addField("attributeName", attributeName); + + if (Validates.isNotEmpty(media.getKeywordName())) + { + keywordName = media.getKeywordName() + "," + labelName + "," + media.getDesigner(); + updater.addField("keywordName", keywordName); + } + else + { + keywordName = labelName + "," + media.getDesigner(); + updater.addField("keywordName", keywordName); + } + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + + // 加入关键词 + KeywordDao.doKeywordLostofAdd(keywordName, request.getSessionName(), 1); + } + else + { + String keywordName = ""; + // 1.关键词中是否包含标签 + if (media.getKeywordName().contains(oldLabelName)) + { + if (!oldLabelName.equals(labelName)) + { + String[] newLabelNameStr = media.getKeywordName().split(","); + for (String newLabelName : newLabelNameStr) + { + if (oldLabelName.contains(newLabelName)) + { + keywordName += labelName + ","; + } + else + { + keywordName += newLabelName + ","; + } + } + + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("industryId", industryId); + updater.addField("industrySubIds", industrySubIds); + updater.addField("industrySubName", industrySubName); + updater.addField("attributeIds", attributeIds); + updater.addField("attributeName", attributeName); + updater.addField("keywordName", keywordName.substring(0, keywordName.length() - 1)); + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + + // 加入关键词 + KeywordDao.doKeywordLostofAdd(keywordName, request.getSessionName(), 1); + } + } + else + { + keywordName += labelName + ","; + String[] newLabelNameStr = media.getKeywordName().split(","); + for (String newLabelName : newLabelNameStr) + { + if (oldLabelName.contains(newLabelName)) + { + continue; + } + + keywordName += newLabelName + ","; + } + + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("industryId", industryId); + updater.addField("industrySubIds", industrySubIds); + updater.addField("industrySubName", industrySubName); + updater.addField("attributeIds", attributeIds); + updater.addField("attributeName", attributeName); + updater.addField("keywordName", keywordName.substring(0, keywordName.length() - 1)); + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + + // 加入关键词 + KeywordDao.doKeywordLostofAdd(keywordName, request.getSessionName(), 1); + } + } + } + + /** + * + * [简要描述]: 设计师备注
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doUpdateCourseRemark(HttpRequest request)throws Exception{ + String designer = request.getParameter("designer"); + String remark = request.getParameter("remark"); + + Updater updater = new Updater(); + updater.addMust("designer", designer); + updater.addField("designerRemark", remark); + + ORM.get(ZTable.class).update(DesignerCourse.class, updater); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerProfilePresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerProfilePresenter.java new file mode 100644 index 0000000..c31a9ae --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerProfilePresenter.java @@ -0,0 +1,263 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.Arrays; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrRole; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupView; +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourse; +import com.zhiqim.yangcai.design.dbo.profile.DesignerProfile; + +/** + * 设计师个人中心Presenter + * + * @version v1.0.0 @author yixin 2020-09-10 新建与整理 + */ +@AnAlias("DesignerProfilePresenter") +@AnIntercept("chkZmrLogin") +public class DesignerProfilePresenter +{ + /** + * 添加用户标签 + * + * @param request 请求 + */ + public static void addDesignerLabel(HttpRequest request) throws Exception + { + DesignerProfile profile = ORM.get(ZTable.class).item(DesignerProfile.class, request.getSessionName()); + String label = request.getParameter("label"); + if (Validates.isEmptyBlank(label)) + { + request.setResponseError("标签内容不能为空"); + return; + } + if (profile == null) + { + profile = new DesignerProfile(); + profile.setOperatorCode(request.getSessionName()); + profile.setState(0); + } + String oldLabels = profile.getLabels() == null ? "" : profile.getLabels(); + List labels = Arrays.asList(oldLabels.split(",")); + if (labels.contains(label)) + { + request.setResponseError("已有该标签"); + return; + } + profile.setLabels(oldLabels + label + ","); + ORM.get(ZTable.class).replace(profile); + request.setResponseResult("添加成功"); + } + + /** + * 删除用户标签 + * + * @param request 请求 + */ + public static void doDeleteLabel(HttpRequest request) throws Exception + { + DesignerProfile profile = ORM.get(ZTable.class).item(DesignerProfile.class, request.getSessionName()); + String label = request.getParameter("label"); + if (Validates.isEmptyBlank(label) || profile == null) + { + return; + } + String oldLabels = profile.getLabels() == null ? "" : profile.getLabels(); + oldLabels = oldLabels.replace(label + ",", ""); + profile.setLabels(oldLabels); + ORM.get(ZTable.class).replace(profile); + request.setResponseResult("删除成功"); + } + + /** + * 个人简介提交审核 + * + * @param request 请求 + */ + public static void doSubmitReview(HttpRequest request) throws Exception + { + DesignerProfile profile = ORM.get(ZTable.class).item(DesignerProfile.class, request.getSessionName()); + String personalProfile = request.getParameter("personalProfile"); + if (Validates.isEmptyBlank(personalProfile)) + { + request.setResponseError("个人简介不能为空"); + return; + } + if (profile == null) + { + profile = new DesignerProfile(); + profile.setOperatorCode(request.getSessionName()); + } + profile.setPersonalProfile(personalProfile); + // 提交审核状态 + profile.setState(1); + profile.setAddTime(Sqls.nowTimestamp()); + profile.setPersonalProfile(personalProfile); + ORM.get(ZTable.class).replace(profile); + request.setResponseResult("提交成功"); + } + + /** + * 个人简介审核 + * + * @param request 请求 + */ + public static void doProfileReview(HttpRequest request) throws Exception + { + int state = request.getParameterInt("state"); + String operatorCode = request.getParameter("operatorCode"); + if (state != 2 && state != 3) + { + request.setResponseError("传入的审核状态错误"); + } + else if (Validates.isEmpty(operatorCode)) + { + request.setResponseError("未查询到待审核设计师信息"); + } + else + { + Updater updater = new Updater(); + updater.addMust("operatorCode", operatorCode); + updater.addField("state", state); + ORM.get(ZTable.class).update(DesignerProfile.class, updater); + request.setResponseResult("审核成功"); + } + + } + + /** + * + * [简要描述]: 设计师个人经历信息提交
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doDesignerCourseSubmit(HttpRequest request) throws Exception + { + String operatorCode = request.getSessionName(); + DesignerCourse course = ORM.get(ZTable.class).item(DesignerCourse.class, operatorCode); + if (course == null) + {// 增加 + DesignerCourse designerCourse = request.getParameter(DesignerCourse.class); + designerCourse.setDesigner(operatorCode); + designerCourse.setAddOperator(operatorCode); + designerCourse.setAddTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(designerCourse); + } + else + { + Updater updater = new Updater(); + updater.addMust("designer", operatorCode); + updater.addField("workExperience", request.getParameter("workExperience")); + updater.addField("skillScope", request.getParameter("skillScope")); + updater.addField("designType", request.getParameter("designType")); + updater.addField("workDuration", request.getParameter("workDuration")); + updater.addField("workStatus", request.getParameter("workStatus")); + updater.addField("receiveType", request.getParameter("receiveType")); + updater.addField("receiveAccount", request.getParameter("receiveAccount")); + updater.addField("updateOperator", operatorCode); + updater.addField("updateTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(DesignerCourse.class, updater); + } + } + + /** + * + * [简要描述]: 修改设计师个人最大同时接单数量
            + * [详细描述]:设计订单列表中正在设计状态的订单数量,超过这个数量则系统不会再派单。
            + * + * @author caohong + * @param request + * @throws Exception + */ + public static void doModifyOrderNum(HttpRequest request) throws Exception + { + String operatorCode = request.getSessionName(); + int orderNum = request.getParameterInt("orderNum"); + + // 获取平台接单规则数量 + Selector sel = new Selector(); + sel.addMust("operatorCode", operatorCode); + sel.addMust("status", 1); + sel.addMust("designerStatus", 1); + DesignerGroupView designerGroup = ORM.get(ZView.class).item(DesignerGroupView.class, sel); + // 判断设计师接单数量 + if (designerGroup != null) + { + int maxOrderNum = designerGroup.getDesignerMaxOrderNum(); + if (maxOrderNum == 0) + { + // 个人没有配置独立规则,则获取对应规则组的数据 + maxOrderNum = designerGroup.getMaxOrderNum(); + } + + // 个人配置数据不能大于平台配置规则数据 + if (orderNum > maxOrderNum) + { + request.setResponseError("最大接单量不能大于平台规则设置,有疑问可以咨询管理员"); + return; + } + } + else + { + request.setResponseError("你还没有接单权限,请联系管理员"); + return; + } + + + Updater updater = new Updater(); + updater.addMust("operatorCode", operatorCode); + updater.addField("operatorParam", String.valueOf(orderNum)); + ORM.get(ZTable.class).update(ZmrOperator.class, updater); + } + + /** + * + * [简要描述]: 设计师切换组织
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doUpdateDesignerOrg(HttpRequest request) throws Exception + { + String designer = request.getParameter("designer"); + long orgId = request.getParameterLong("orgId"); + // 查询组织对接角色 + List role_list = ORM.get(ZTable.class).list(ZmrRole.class, new Selector("orgId", orgId).addOrderbyAsc("roleSeq")); + if (role_list == null || role_list.size() == 0) + { + request.setResponseError("对应组织未配置操作员角色信息"); + return; + } + + Updater updater = new Updater(); + updater.addMust("operatorCode", designer); + updater.addField("orgId", orgId); + updater.addField("operatorRole", String.valueOf(role_list.get(0).getRoleId())); + ORM.get(ZTable.class).update(ZmrOperator.class, updater); + + Updater updater1 = new Updater(); + updater1.addMust("operatorCode", designer); + updater1.addField("orgId", orgId); + ORM.get(ZTable.class).update(DesignerGroupDispatch.class, updater1); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerSubscribePresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerSubscribePresenter.java new file mode 100644 index 0000000..a666b91 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerSubscribePresenter.java @@ -0,0 +1,137 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.subscribe.SubscribeDesignerQuotaRecord; +import com.zhiqim.yangcai.design.dbo.subscribe.SubscribeOrgTempQuota; + +@AnAlias( +{ + "DesignerSubscribePresenter" +}) +@AnIntercept( +{ + "chkZmrLogin" +}) +public class DesignerSubscribePresenter +{ + public static void doToggle(HttpRequest request) throws Exception + { + int today = DateTimes.getCurrentDate(); + // Calendar calendar = Calendar.getInstance(); + // int year = calendar.get(Calendar.YEAR); + // int month = calendar.get(Calendar.MONTH) + 1; + // int prevYear = month == 1 ? year - 1 : year; + // int prevMonth = month == 1 ? 12 : month - 1; + + SubscribeDesignerQuotaRecord data = request.getParameter(SubscribeDesignerQuotaRecord.class); + ZmrSessionUser user = request.getSessionUser(ZmrSessionUser.class); + if (today == data.getDutyTime()) + { + if (DateTimes.getCurrentHour() >= 8) + { + request.setResponseError("当天预约需要在八点前之前"); + return; + } + } + else if (getNextDateInt(7) < data.getDutyTime()) + { + request.setResponseError("最大预约未来一周订单"); + return; + } + else if (today > data.getDutyTime()) + { + request.setResponseError("历史时间不允许预约"); + return; + } + + int maxQuota = request.getParameterInt("maxQuota"); + if (data.getSubscribeNum() > maxQuota) + { + request.setResponseError("超出订单预约上限,当前最大预约单量" + maxQuota + "单"); + return; + } + + // // 未完成订单 + // int unCompleteOrder = DispatchDao.getUnCompleteOrderNumber(user.getOperatorCode()); + + String operatorCode = request.getSessionName(); + SubscribeDesignerQuotaRecord subscribeDesignerQuotaRecord = ORM.get(ZTable.class).item(SubscribeDesignerQuotaRecord.class, + new Selector("operatorCode", operatorCode).addMust("dutyTime", data.getDutyTime())); + if (subscribeDesignerQuotaRecord != null) + { + data.setRecordId(subscribeDesignerQuotaRecord.getRecordId()); + } + else + { + data.setRecordId(Ids.longId()); + } + data.setModifyTime(Sqls.nowTimestamp()); + data.setMaxQuota(maxQuota); + data.setCreateTime(Sqls.nowTimestamp()); + data.setOperatorCode(operatorCode); + if (data.getSubscribeNum() == 0) + { + data.setSubscribeState(1); + } + else + { + data.setSubscribeState(2); + } + data.setState(1); + data.setOrgId(user.getOperatorOrgId()); + + // TODO 其他信息补充 + ORM.get(ZTable.class, request).replace(data); + request.setResponseResult("ok"); + } + + /** + * yixin 2020-09-04 修改临时额度状态 + * + * @param request + * @throws Exception + */ + public static void doUpdateSubscribeOrgTempQuotaState(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + int state = request.getParameterInt("state"); + request.setResponseResult("ok"); + Updater updater = new Updater(); + updater.addMust("orgId", orgId); + updater.addField("state", state); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(SubscribeOrgTempQuota.class, updater); + } + + /** + * 获取后几日的值 + * + * @param day + * + * @return yyyyMMdd格式的int型值 + */ + public static int getNextDateInt(int day) + { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DATE, day); // 得到后几天 + Date date = calendar.getTime(); + DateFormat df = new SimpleDateFormat("yyyyMMdd"); + return Integer.valueOf(df.format(date)); + } +} \ No newline at end of file diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerTestPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerTestPresenter.java new file mode 100644 index 0000000..9267b37 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerTestPresenter.java @@ -0,0 +1,185 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.io.File; +import java.util.List; + +import javax.imageio.stream.FileImageOutputStream; +import javax.imageio.stream.ImageOutputStream; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.Base64; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.uploadlarge.dbo.UpllFile; + +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dbo.order.OrderQuestions; +import com.zhiqim.yangcai.design.dbo.order.QuestionsAtta; + +/** + * + * [简要描述]:接单考试流程
            + * + * @version 1.0 @author hc 2021年5月24日 新建与整理 + */ + +@AnAlias("DesignerTestPresenter") +@AnIntercept("chkZmrLogin") +public class DesignerTestPresenter +{ + // 保存考核成绩表 + public void saveGrade(HttpRequest request, String imgData, long questionsId) throws Exception + { + if (questionsId < 0) + { + request.setResponseError("未找到考试订单信息"); + return; + } + String dateDir = DateTimes.getDateTime8String(); + String rootDir = Strings.trimRight(request.getContext().getAttributeString("upload.large.rootDir"), "/"); + String operatorCode = request.getSessionName(); + + String draftFile = "订单考核/考核成绩图"; + String fileName = operatorCode + "-" + "ExamVoucher" + ".png"; + String draftPath = rootDir + "/" + dateDir + "/" + draftFile; + String savePath = draftPath + "/" + fileName; + + Files.mkDirectory(draftPath); + int idx = imgData.indexOf(","); + byte[] imageBytes = Base64.decode(imgData.substring(idx + 1)); + + File file = new File(savePath); + ImageOutputStream out = new FileImageOutputStream(file); + out.write(imageBytes); + out.flush(); + out.close(); + + // 图片上传OSS处理 + String ossUrl = OssFileDao.uploadFile(file, OssFileDao.getUploadFileKey(questionsId, "ExamVoucher")); + + // 插入考试订单附属表 + QuestionsAtta atta = new QuestionsAtta(); + atta.setQuestionsId(questionsId); + atta.setAttaId(Ids.longId()); + atta.setAttaModul("ExamVoucher"); + atta.setFileName(fileName); + atta.setFileType("png"); + atta.setFileSize(file.length()); + atta.setSavePath(savePath); + atta.setFileUrl(ossUrl); + atta.setOperatorCode(request.getSessionName()); + atta.setUploadTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(atta); + + Updater updater = new Updater(); + updater.addMust("questionsId", questionsId); + updater.addField("status", 10); + ORM.get(ZTable.class).update(OrderQuestions.class, updater); + + } + + // 提交审核 + public void submitAudit(HttpRequest request, HttpResponse response, long questionsId) throws Exception + { + // 判断设计文件+印刷文件 + List list = ORM.get(ZTable.class).list(QuestionsAtta.class, new Selector().addMust("questionsId", questionsId)); + boolean desginFile = false; + boolean endFile = false; + for (QuestionsAtta atta : list) + { + if (atta.getAttaModul().equals("DesginFile")) + { + desginFile = true; + continue; + } + if (atta.getAttaModul().equals("EndFile")) + { + endFile = true; + continue; + } + } + if (desginFile != true && endFile == true) + { + response.sendError(2, "还未上传设计文件哦,请上传!"); + } + else if (desginFile == true && endFile != true) + { + response.sendError(2, "还未上传印刷文件哦,请上传!"); + } + else if (desginFile != true && endFile != true) + { + response.sendError(2, "还未上传文件哦,请上传!"); + } + else + { + Updater updater = new Updater(); + updater.addMust("questionsId", questionsId); + updater.addField("status", 20); + updater.addField("designEndTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(OrderQuestions.class, updater); + } + + } + + // 重新考核 + public void refreshAssess(HttpRequest request, long questionsId) throws Exception + { + // 删除考试订单记录 + Selector oq = new Selector(); + oq.addMust("questionsId", questionsId); + ORM.get(ZTable.class).delete(OrderQuestions.class, oq); + + // 删除附件记录 + List attaList = ORM.get(ZTable.class).list(QuestionsAtta.class, new Selector().addMustInLong("questionsId", questionsId)); + for (QuestionsAtta atta : attaList) + { + // 素材文件需要共用,不能删除 + if (!"MaterialFile".equals(atta.getAttaModul())) + { + File file = new File(atta.getSavePath()); + if (file.exists()) + { + Files.deleteFile(atta.getSavePath()); + } + + if (Validates.isNotEmpty(atta.getFileid())) + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", atta.getFileid()).addReplace("id", null)); + } + } + + // 考试凭证需要删除oss + if ("ExamVoucher".equals(atta.getAttaModul())) + { + String path = atta.getFileUrl().split(OssFileDao.getPrefix_dir())[1]; + OssFileDao.deleteOssFile(OssFileDao.getPrefix_dir() + path); + } + + ORM.get(ZTable.class).delete(QuestionsAtta.class, atta.getAttaId()); + } + } + + // 删除文件 + public void deleteFile(HttpRequest request, long attaId) throws Exception + { + QuestionsAtta item = ORM.get(ZTable.class).item(QuestionsAtta.class, new Selector().addMust("attaId", attaId)); + File file = new File(item.getSavePath()); + if (file.exists()) + { + Files.deleteFile(item.getSavePath()); + } + ORM.get(ZTable.class).delete(QuestionsAtta.class, attaId); + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerWorkPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerWorkPresenter.java new file mode 100644 index 0000000..34d01b4 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerWorkPresenter.java @@ -0,0 +1,123 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignerDao; +import com.zhiqim.yangcai.design.dao.DispatchDao; +import com.zhiqim.yangcai.design.dao.ScoreDesignerRecordDao; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.dispatch.DesOnline; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourse; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordDetail; +import com.zhiqim.yangcai.design.dbo.subscribe.SubscribeDesignerQuotaRecord; + +/** + * 设计师接单操作 + * + * @version v1.0.0 @author zouzhigang 2017-12-21 新建与整理 + */ +@AnAlias("DesignerWorkPresenter") +@AnIntercept("chkZmrLogin") +public class DesignerWorkPresenter +{ + /** + * 设计师开始接单 + * + * @param request 请求 + * @throws Exception 异常 + */ + @SuppressWarnings("deprecation") + @AnTransaction + public static void startWork(HttpRequest request) throws Exception + { + ZmrSessionUser user = request.getSessionUser(ZmrSessionUser.class); + DesignerGroupDispatch prop = ORM.get(ZTable.class).item(DesignerGroupDispatch.class, user.getOperatorCode()); + if (prop == null) + { + request.setResponseError("您暂时没有接单权限,请联系管理员处理。"); + return; + } + + if (ORM.get(ZTable.class).item(DesignerCourse.class, user.getOperatorCode()) == null) + { + request.setResponseError("1");// 特殊标记,前台控制跳转 + return; + } + + // 1.插入设计师在线状态表 + DesOnline online = ORM.get(ZTable.class).item(DesOnline.class, user.getOperatorCode()); + online = online != null ? online : new DesOnline(); + + online.setOperatorCode(user.getOperatorCode()); + online.setOnlineStatus(1); + online.setSessionId(user.getSessionId()); + online.setSessionTime(Sqls.nowTimestamp()); + online.setOrderNum(DispatchDao.getUnCompleteOrderNumber(user.getOperatorCode())); + online.setOrgId(user.getOperatorOrgId()); + online.setLastUpdateTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).replace(online); + + // 2.启用当天订单预约额度 + Updater updater = new Updater(); + updater.addMust("operatorCode", user.getOperatorCode()); + updater.addMust("dutyTime", DateTimes.getCurrentDate()); + updater.addField("state", 1); + ORM.get(ZTable.class).update(SubscribeDesignerQuotaRecord.class, updater); + + // 3.上班操作 + DesignerDao.startWorkExec(user.getOperatorOrgId(), user.getOperatorCode(), Sqls.nowTimestamp(), "点击开始接单"); + + if (Sqls.nowTimestamp().getHours() >= 9 && Sqls.nowTimestamp().getHours() <= 20) + { + // 09:00至20:00常规时间内容开启接单奖励(点击开启接单按钮操作) + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_1.value())); + scoreDesignerRecordDetail.setOperatorCode(user.getOperatorCode()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + } + + /** + * 设计师停止接单 + * + * @param request 请求 + * @throws Exception 异常 + */ + @AnTransaction + public static void stopWork(HttpRequest request) throws Exception + { + ZmrSessionUser user = request.getSessionUser(ZmrSessionUser.class); + + // 下班操作 + DesignerDao.stopWorkExec(user.getOperatorOrgId(), request.getSessionName(), "点击停止接单"); + } + + /** + * 获取设计师当前单量 + * + * @param request 请求 + * @throws Exception 异常 + */ + public static void getOrderNumber(HttpRequest request) throws Exception + { + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, + new Selector().addMust("designer", request.getSessionName()).addMust("status", StatusConstants.ORDER_30.value())); + int count = orderList.size(); + request.setResponseResult(count == 0 ? "0" : "" + count); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerWorksPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerWorksPresenter.java new file mode 100644 index 0000000..cc014f3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DesignerWorksPresenter.java @@ -0,0 +1,140 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.awt.image.BufferedImage; +import java.io.File; + +import javax.imageio.ImageIO; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.uploadlarge.dbo.UpllFile; + +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dbo.profile.DesignerWorks; + +/** + * 设计师作品Presenter + * + * @version v1.0.0 @author yixin 2020-09-10 新建与整理 + */ +@AnAlias("DesignerWorksPresenter") +@AnIntercept("chkZmrLogin") +public class DesignerWorksPresenter +{ + /** + * 上传作品 + * + * @param request 请求 + * @param fileId 文件id + */ + public static void doUplaodWorks(HttpRequest request, String fileId) throws Exception + { + UpllFile upllFile = ORM.get(ZTable.class).item(UpllFile.class, new Selector("fileId", fileId)); + String operatorCode = request.getSessionName(); + if (upllFile == null) + { + request.setResponseError("上传异常,请稍后重试"); + return; + } + File file = new File(upllFile.getFilePath()); + if (!file.exists()) + { + request.setResponseError("上传异常,请稍后重试"); + return; + } + int count = ORM.get(ZTable.class).count(DesignerWorks.class, new Selector("operatorCode", operatorCode)); + BufferedImage bi = ImageIO.read(file); + if (count >= 10) + { + request.setResponseError("个人作品最多同时存在10张"); + } + // 限定只能传入1200*800大小的图片 + else if (bi.getWidth() != 1200 && bi.getHeight() != 800) + { + request.setResponseError("仅支持像素为1200*800大小的图片"); + } + else + { + // 上传OSS + long designerWorksId = Ids.longId(); + String fileName = designerWorksId + "." + upllFile.getFileExt(); + String fileKey = "/designerWorks/" + DateTimes.getDateTime8String() + "/" + fileName; + String ossUrl = OssFileDao.uploadFile(file, fileKey); + DesignerWorks works = new DesignerWorks(); + works.setDesignerWorksId(designerWorksId); + works.setOperatorCode(operatorCode); + works.setImgPath(ossUrl); + works.setImgKey(fileKey); + works.setState(0); + works.setAddTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(works); + request.setResponseResult("添加成功"); + } + // 删除缓存文件和上传记录 + file.delete(); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", fileId)); + + } + + /** + * 删除作品 + * + * @param request 请求 + * @param fileId 文件id + */ + public static void doDeletDesignerWorks(HttpRequest request) throws Exception + { + long designerWorksId = request.getParameterLong("designerWorksId", 0); + if (designerWorksId == 0) + { + request.setResponseError("删除作品异常,请稍后重试"); + return; + } + DesignerWorks works = ORM.get(ZTable.class).item(DesignerWorks.class, designerWorksId); + String fileKey = works.getImgKey(); + if (Validates.isNotEmptyBlank(fileKey)) + { + OssFileDao.deleteOssFile(OssFileDao.getPrefix_dir() + fileKey); + } + ORM.get(ZTable.class).delete(DesignerWorks.class, designerWorksId); + request.setResponseResult("删除成功"); + } + + /** + * 个人作品审核 + * + * @param request 请求 + */ + public static void doWorksReview(HttpRequest request) throws Exception + { + int state = request.getParameterInt("state"); + long designerWorksId = request.getParameterLong("designerWorksId", 0); + if (state != 1 && state != 2) + { + request.setResponseError("传入的审核状态错误"); + } + else if (designerWorksId == 0) + { + request.setResponseError("未查询到审核作品"); + } + else + { + Updater updater = new Updater(); + updater.addMust("designerWorksId", designerWorksId); + updater.addField("state", state); + ORM.get(ZTable.class).update(DesignerWorks.class, updater); + request.setResponseResult("审核成功"); + } + + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DisaptchPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DisaptchPresenter.java new file mode 100644 index 0000000..febff13 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DisaptchPresenter.java @@ -0,0 +1,164 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.design.DesignOrgMer; +import com.zhiqim.yangcai.design.dbo.dispatch.DesMerDispatchLog; +import com.zhiqim.yangcai.design.dbo.dispatch.DesOnline; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.subscribe.SubscribeDesignerQuotaRecord; +import com.zhiqim.yangcai.design.dbo.subscribe.SubscribeOrgTempQuota; +import com.zhiqim.yangcai.dispatch.dao.MerDispatchAnalysisDao; +import com.zhiqim.yangcai.dispatch.model.AnalysisOrderResult; +import com.zhiqim.yangcai.dispatch.model.AnalysisResult; +import com.zhiqim.yangcai.dispatch.model.DesignOrgMerModule; +import com.zhiqim.yangcai.dispatch.model.MerDispatchAnalysisModule; + +/**** + * TODO:类功能介绍派单相关 + * + * @version v1.0.0 @author longguizhi 2018-11-24 新建与整理 + */ + +@AnAlias("DisaptchPresenter") +@AnIntercept("chkZmrLogin") +public class DisaptchPresenter +{ + /** 查询订单分拣分析(订单未分拣) */ + public static void doQueryOrderMerDispatchAnalysis(HttpRequest request) throws Exception + { + int today = DateTimes.getCurrentDate(); + long designId = request.getParameterLong("designId"); + designId = designId < 0 ? 0 : designId; + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单【" + designId + "】不存在"); + return; + } + + List list = new ArrayList<>(); + + // 查询组织信息 + Map orgMap = new HashMap(); + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, new Selector().addOrderbyAsc("orgLevel,orgSeq,orgId")); + for (ZmrOrg org : orgList) + { + orgMap.put(org.getOrgId(), org); + } + + // 查询接单商户信息 + List tempList = ORM.get(ZTable.class).list(DesignOrgMer.class, new Selector().addOrderbyAsc("merLevel")); + for (DesignOrgMer mer : tempList) + {// 筛选接单时间段内商户 + ZmrOrg org = orgMap.get(mer.getOrgId()); + if (org == null) + { + continue; + } + // 查询最大预约数量 + long merMaxOrder = ORM.get(ZTable.class).sum(SubscribeDesignerQuotaRecord.class, + new Selector("orgId", mer.getOrgId()).addMust("dutyTime", today).addMust("subscribeState", 2).addMust("state", 1), "subscribeNum"); + // 查询临时额度 + SubscribeOrgTempQuota subscribeOrgTempQuota = ORM.get(ZTable.class).item(SubscribeOrgTempQuota.class, + new Selector("orgId", mer.getOrgId()).addMust("state", 1)); + // 查询预约设计师数量 + int onlineDesignerCount = ORM.get(ZTable.class).count(DesOnline.class, new Selector("orgId", mer.getOrgId()).addMust("onlineStatus", 1)); + if (subscribeOrgTempQuota != null) + { + merMaxOrder += (subscribeOrgTempQuota.getTempQuota() * onlineDesignerCount); + } + DesignOrgMerModule module = new DesignOrgMerModule(); + Objects.copyDstDeep(mer, module); + module.setOrgName(org.getOrgName()); + module.setOrgManager(org.getOrgManager()); + module.setMerMaxOrder((int) merMaxOrder); + module.setOnlineDesignerCount(onlineDesignerCount); + list.add(module); + } + + AnalysisOrderResult analysisResult = MerDispatchAnalysisDao.doAnalysis(order, list); + if (analysisResult.getMerAnalysisList().size() == 0) + { + request.setResponseError("未查询到需要分析的接单商户"); + return; + } + + MapSO attaMap = new HashMapSO(); + attaMap.put("merAnalysisList", analysisResult.getMerAnalysisList()); + String resultHtml = ZmlContexts.parseZmlPath(request, "/zview/dispatch/presenter/orderMerAnalisysResult.zml", attaMap); + + Map jsonMap = new HashMap(); + jsonMap.put("analysisResult", analysisResult); + jsonMap.put("resultHtml", resultHtml); + + request.setResponseResult(Jsons.toString(jsonMap)); + } + + /**** + * 查询订单已分拣日志 的分拣分析 + * + * @param request + * @throws Exception + */ + public static void doViewMerDispatchLogAnalysis(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + designId = designId < 0 ? 0 : designId; + String desTime = request.getParameter("desTime", DateTimes.getDateTimeString()); + DesMerDispatchLog merlog = ORM.get(ZTable.class).item(DesMerDispatchLog.class, + new Selector("designId", designId).addMust("desTime", Sqls.toTimestamp(desTime))); + if (merlog == null || Validates.isEmptyBlank(merlog.getAnalysisText())) + { + request.setResponseError("订单没有分拣分析日志"); + return; + } + + AnalysisOrderResult analysisResult = Jsons.toObject(merlog.getAnalysisText(), AnalysisOrderResult.class); + List merAnalysisList = new ArrayList(); + for (String moduleJson : Jsons.toList(Jsons.getString(merlog.getAnalysisText(), "merAnalysisList"), String.class)) + { + MerDispatchAnalysisModule module = Jsons.toObject(moduleJson, MerDispatchAnalysisModule.class); + module.setResultList(Jsons.toList(Jsons.getString(moduleJson, "resultList"), AnalysisResult.class)); + merAnalysisList.add(module); + } + + analysisResult.setMerAnalysisList(merAnalysisList); + if (merAnalysisList.size() == 0) + { + request.setResponseError("未查询到需要分析的接单商户"); + return; + } + analysisResult.setMerAnalysisList(merAnalysisList); + MapSO attaMap = new HashMapSO(); + attaMap.put("merAnalysisList", merAnalysisList); + String resultHtml = ZmlContexts.parseZmlPath(request, "/zview/dispatch/presenter/orderMerAnalisysResult.zml", attaMap); + + Map jsonMap = new HashMap(); + jsonMap.put("analysisResult", analysisResult); + jsonMap.put("analysisText", merlog.getAnalysisText()); + jsonMap.put("resultHtml", resultHtml); + + request.setResponseResult(Jsons.toString(jsonMap)); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DzmpSupportPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DzmpSupportPresenter.java new file mode 100644 index 0000000..838928c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/DzmpSupportPresenter.java @@ -0,0 +1,264 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.HashMap; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.dzmpsupport.DzmpDesignElement; + +/** + * 操作电子名片设计元素
            + * + * @author HuangZhiGao + * @date 2020年7月22日 上午11:35:20 + */ +@AnAlias("DzmpSupportPresenter") +public class DzmpSupportPresenter +{ + private static final Log log = LogFactory.getLog(DzmpSupportPresenter.class); + + /** + * 新增电子名片设计元素json字符串
            + * + * @param request + * @throws Exception + * @return void + * @author HuangZhiGao + * @date 2020年7月22日 上午11:21:32 + */ + @AnTransaction + public static void doSaveDzmpElementJson(HttpRequest request) + { + String id = request.getParameter("id"); + long mediaId = request.getParameterLong("mediaId"); + String jsonStr = request.getParameterNoFileterOnCNT("eleJson"); + if (Validates.isEmpty(id)) + { + request.setResponseError("id不能为空"); + return; + } + if (mediaId == -1) + { + request.setResponseError("模板素材id不能为空"); + return; + } + if (Validates.isEmpty(jsonStr)) + { + request.setResponseError("设计元素json字符串不能为空"); + return; + } + + // long id = Ids.longId13_4(); + DzmpDesignElement dzmpDesignElement = new DzmpDesignElement(id, mediaId, jsonStr, Sqls.nowTimestamp()); + try + { + ORM.get(ZTable.class).insert(dzmpDesignElement); + } + catch (Exception e) + { + request.setResponseError("新增电子名片设计元素json字符串异常"); + log.error("新增电子名片设计元素json字符串异常:" + e.getMessage()); + return; + } + + // 新增后返回id + Map jsonMap = new HashMap(1); + jsonMap.put("id", id); + request.setResponseResult(Jsons.toString(jsonMap)); + return; + } + + /** + * 修改电子名片设计元素json字符串
            + * + * @param request + * @throws Exception + * @return void + * @author HuangZhiGao + * @date 2020年7月22日 上午11:49:10 + */ + @AnTransaction + public static void doUpdateDzmpElementJson(HttpRequest request) + { + String id = request.getParameter("id"); + String jsonStr = request.getParameterNoFileterOnCNT("eleJson"); + if (Validates.isEmpty(id)) + { + request.setResponseError("id不能为空"); + return; + } + if (Validates.isEmpty(jsonStr)) + { + request.setResponseError("设计元素json字符串不能为空"); + return; + } + + try + { + DzmpDesignElement item = ORM.get(ZTable.class).item(DzmpDesignElement.class, new Selector("id", id)); + if (Validates.isEmpty(item)) + { + request.setResponseError("电子名片设计元素json字符串不存在,id为[" + id + "]"); + return; + } + Updater updater = new Updater(); + updater.addMust("id", id); + updater.addField("eleJson", jsonStr); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DzmpDesignElement.class, updater); + + // 返回id + Map jsonMap = new HashMap(1); + jsonMap.put("id", id); + request.setResponseResult(Jsons.toString(jsonMap)); + } + catch (Exception e) + { + request.setResponseError("修改电子名片设计元素json字符串异常"); + log.error("修改电子名片设计元素json字符串异常:" + e.getMessage() + ",参数为[" + Jsons.toString(request.getParameterMap()) + "]"); + return; + } + } + + /** + * 新增或修改电子名片设计元素json字符串
            + * + * @param request + * @return void + * @author HuangZhiGao + * @date 2020年7月22日 下午5:31:23 + */ + @AnTransaction + public static void doSaveOrUpdateDzmpElementJson(HttpRequest request) + { + String id = request.getParameter("id"); + String jsonStr = request.getParameterNoFileterOnCNT("eleJson"); + if (Validates.isEmpty(id)) + { + request.setResponseError("id不能为空"); + return; + } + if (Validates.isEmpty(jsonStr)) + { + request.setResponseError("设计元素json字符串不能为空"); + return; + } + + try + { + DzmpDesignElement item = ORM.get(ZTable.class).item(DzmpDesignElement.class, new Selector("id", id)); + if (Validates.isNotEmpty(item)) + { + doUpdateDzmpElementJson(request); + return; + } + else + { + doSaveDzmpElementJson(request); + return; + } + } + catch (Exception e) + { + request.setResponseError("新增或修改电子名片设计元素json字符串异常"); + log.error("新增或修改电子名片设计元素json字符串异常:" + e.getMessage() + ",参数为[" + Jsons.toString(request.getParameterMap()) + "]"); + return; + } + } + + /** + * 根据id删除电子名片设计元素json字符串
            + * + * @param request + * @throws Exception + * @return void + * @author HuangZhiGao + * @date 2020年7月22日 下午1:57:21 + */ + @AnTransaction + public static void doDelDzmpElementJsonById(HttpRequest request) + { + String id = request.getParameter("id"); + if (Validates.isEmpty(id)) + { + request.setResponseError("id不能为空"); + return; + } + + try + { + Selector selector = new Selector("id", id); + DzmpDesignElement item = ORM.get(ZTable.class).item(DzmpDesignElement.class, selector); + if (Validates.isEmpty(item)) + { + request.setResponseError("电子名片设计元素json字符串不存在,id为[" + id + "]"); + return; + } + ORM.get(ZTable.class).delete(DzmpDesignElement.class, selector); + } + catch (Exception e) + { + request.setResponseError("删除电子名片设计元素json字符串异常"); + log.error("删除电子名片设计元素json字符串异常:" + e.getMessage() + ",id为[" + id + "]"); + return; + } + } + + /** + * 根据id查询电子名片设计元素json字符串
            + * + * @param request + * @throws Exception + * @return void + * @author HuangZhiGao + * @date 2020年7月22日 下午2:01:49 + */ + @AnTransaction + public static void doSelDzmpElementJsonById(HttpRequest request) + { + String id = request.getParameter("id"); + if (Validates.isEmpty(id)) + { + request.setResponseError("id不能为空"); + return; + } + + try + { + Map jsonMap = new HashMap(); + DzmpDesignElement item = ORM.get(ZTable.class).item(DzmpDesignElement.class, new Selector("id", id)); + if (Validates.isNotEmpty(item)) + { + jsonMap.put("error", Boolean.FALSE); + jsonMap.put("id", item.getId()); + jsonMap.put("eleJson", item.getEleJson()); + request.setResponseResult(Jsons.toString(jsonMap)); + } + else + { + jsonMap.put("error", Boolean.TRUE); + jsonMap.put("errorMsg", "未查询到[" + id + "]对应的设计元素json字符串"); + request.setResponseResult(Jsons.toString(jsonMap)); + } + } + catch (Exception e) + { + request.setResponseError("查询电子名片设计元素json字符串异常"); + log.error("查询电子名片设计元素json字符串异常:" + e.getMessage() + ",id为[" + id + "]"); + return; + } + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/KeywordPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/KeywordPresenter.java new file mode 100644 index 0000000..bab6403 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/KeywordPresenter.java @@ -0,0 +1,216 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.KeywordDao; +import com.zhiqim.yangcai.design.dbo.DesLabelIndustry; +import com.zhiqim.yangcai.design.dbo.keyword.DesKeywordCore; +import com.zhiqim.yangcai.design.dbo.keyword.DesKeywordIndustry; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateSolrModel; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; +import com.zhiqim.yangcai.util.SolrUtil; + +/** + * + * 关键词Presenter + * + * @version v1.0.0 @author Deng 2018-3-13 新建与整理 + */ +@AnAlias("KeywordPresenter") +@AnIntercept("chkZmrLogin") +public class KeywordPresenter +{ + /** + * 根据输入搜索词查询关键词列表(最近10条) + * + * @param request 请求 + * @param keyword 关键词 + * @return 数组的JSON字符串 + * @throws Exception 异常 + */ + public static String doKeywordList(String keyword) throws Exception + { + if (Validates.isEmptyBlank(keyword)) + { + return "[]"; + } + + String[] word = keyword.split(" "); + Selector selector = new Selector(); + + // 至少两个中文,计算词条的热度 + if (KeywordDao.isChineseLength(keyword, 2)) + { + KeywordDao.doKeywordHotSearch(keyword); + } + + for (int i = 0; i < word.length; i++) + { + if (Validates.isEmptyBlank(word[i])) + { + continue; + } + + selector.addMaybeLike("keywordName", word[i]); + } + selector.addOrderbyDesc("keywordHot"); + PageResult pageResult = ORM.get(ZTable.class).page(DesKeywordCore.class, 1, 10, selector); + + List titleList = new ArrayList<>(); + for (DesKeywordCore item : pageResult.list()) + { + titleList.add(item.getKeywordName()); + } + + return Jsons.toString(titleList); + } + + /** + * 关键词搜索模板 + * + * @param request + * @throws Exception + */ + public static void doKeywordSearch(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = 20; + long typeId = request.getParameterLong("designType"); + long industryId = request.getParameterLong("industryId"); + String fileType = request.getParameter("fileType"); + int sort = request.getParameterInt("sort", 0); + String oddEven = request.getParameter("oddEven") == null ? "-1" : request.getParameter("oddEven"); + + // String prdTypeName = ""; + // if (typeId != -1) + // { + // prdTypeName = DesignTypeDao.name(typeId); + // } + // + // String industryName = ""; + // if (industryId != -1) + // { + // industryName = Global.get(DesignIndustryCache.class).getIndustryName(industryId); + // } + + String keyword = request.getParameter("keyword"); + if (Validates.isNotEmpty(keyword)) + { + KeywordDao.doKeywordCoreNumAdd(keyword); // 增加关键词搜索日志 + } + Map param = new HashMap(); + param.put("typeId", String.valueOf(typeId)); + param.put("industryId", String.valueOf(industryId)); + param.put("fileType", fileType); + param.put("sort", String.valueOf(sort)); + param.put("keyword", keyword); + param.put("oddEven", oddEven); + + PageResult pageResult = SolrUtil.queryAllTemplate(page, pageSize, param); + + MapSO attrMap = new HashMapSO(); + attrMap.put("pageResult", pageResult); + attrMap.put("keyword", keyword); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/template/presenter/keywordSearchInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * 根据行业+子行业查询对应的关键字 + * + * @param request + * @throws Exception + */ + public static void doKeywordIndustryTop(HttpRequest request) throws Exception + { + List coreList = new ArrayList(); + long industryId = request.getParameterLong("industryId"); + long industrySubId = request.getParameterLong("industrySubId"); + + if (industryId == -1) + { + return; + } + + // 获取行业下的子行业 + List inSubList = ORM.get(ZTable.class).list(DesLabelIndustry.class, new Selector("industryId", industryId)); + if (inSubList.isEmpty()) + { + return; + } + + // 获取行业和子行业下的关键词 + Selector selector = new Selector(); + selector.addMust("industryId", industryId); + selector.addMustLike("industrySubId", String.valueOf(industrySubId)); + DesKeywordIndustry ki = ORM.get(ZTable.class).item(DesKeywordIndustry.class, selector); + if (ki != null) + { + String keywordName = ki.getIndustryKeyword(); + if (Validates.isNotEmpty(keywordName)) + { + coreList = KeywordDao.doKeywordCoreSort(keywordName); + } + } + + MapSO attrMap = new HashMapSO(); + attrMap.put("inSubList", inSubList); + attrMap.put("industrySubId", industrySubId); + attrMap.put("coreList", coreList); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/keyword/presenter/keywordIndustryTopInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * + * [简要描述] 过滤文件格式:
            + * [详细描述]:
            + * + * @author gjx + * @param mediaList + * @param fileType + * @return + * @throws Exception + */ + public static void doFilterFileType(List mediaList, String fileType) throws Exception + { + if (mediaList.isEmpty() || Validates.isEmpty(fileType)) + { + return; + } + + Iterator it = mediaList.iterator(); + while (it.hasNext()) + { + MediaTemplateView media = it.next(); + if (Validates.isEmpty(media.getFileType())) + { + it.remove(); + break; + } + if (media.getFileType().indexOf(fileType.toLowerCase()) == -1) + {// 模板不包含指定格式移除数据 + it.remove(); + } + } + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/LabelPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/LabelPresenter.java new file mode 100644 index 0000000..ab7098b --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/LabelPresenter.java @@ -0,0 +1,295 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.cache.DesignTypeCache; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.LabelDao; +import com.zhiqim.yangcai.design.dbo.DesKeyword; +import com.zhiqim.yangcai.design.dbo.DesKeywordCat; +import com.zhiqim.yangcai.design.dbo.DesLabelAttribute; +import com.zhiqim.yangcai.design.dbo.DesLabelAttributeCat; +import com.zhiqim.yangcai.design.dbo.DesLabelIndustry; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; +import com.zhiqim.yangcai.util.SolrUtil; + +/** + * 标签Presenter + * + * @version v1.0.0 @author Deng 2017-6-26 新建与整理 + */ +@AnAlias("LabelPresenter") +@AnIntercept("chkZmrLogin") +public class LabelPresenter +{ + /** + * 查询标签行业下的子行业 + * + * @param request + * @param labelId + * @throws Exception + */ + public static void doIndustrySubQuery(HttpRequest request, long industryId) throws Exception + { + Selector selector = new Selector(); + selector.addMust("industryId", industryId); + List subList = ORM.get(ZTable.class).list(DesLabelIndustry.class, selector); + + MapSO attrMap = new HashMapSO(); + attrMap.put("result", subList); + attrMap.put("industryId", industryId); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/label/presenter/industrySubInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * 获取标签行业下的属性分类 + * + * @param request + * @param labelId + * @return + * @throws Exception + */ + public static String doIndustryCatQuery(HttpRequest request, long industryId) throws Exception + { + List catList = ORM.get(ZTable.class).list(DesLabelAttributeCat.class, new Selector("industryId", industryId)); + return Jsons.toString(catList); + } + + /** + * 获取标签属性分类名称 + * + * @param request + * @param labelId + * @return + * @throws Exception + */ + public static String doAttributeCatName(long attributeCatId) throws Exception + { + DesLabelAttributeCat cat = ORM.get(ZTable.class).item(DesLabelAttributeCat.class, attributeCatId); + + return cat.getAttributeCatName(); + } + + /** + * 获取标签属性名称 + * + * @param request + * @param labelId + * @return + * @throws Exception + */ + public static String doAttributeName(String attributeCatId) throws Exception + { + DesLabelAttribute cat = ORM.get(ZTable.class).item(DesLabelAttribute.class, Long.parseLong(attributeCatId)); + + return cat.getAttributeName(); + } + + /** + * 获取标签子行业名称 + * + * @param request + * @param labelId + * @return + * @throws Exception + */ + public static String doIndustrySubName(String subsId) throws Exception + { + DesLabelIndustry industry = ORM.get(ZTable.class).item(DesLabelIndustry.class, Long.parseLong(subsId)); + + return industry.getIndustrySubName(); + } + + /** + * 获取关键词分类名称 + * + * @param catId + * @return + * @throws Exception + */ + public static String doKeywordCatName(long catId) throws Exception + { + DesKeywordCat cat = ORM.get(ZTable.class).item(DesKeywordCat.class, catId); + if (cat == null) + { + return ""; + } + + return cat.getCatName(); + } + + /** + * 获取关键词名称 + * + * @param keywordId + * @return + * @throws Exception + */ + public static String doKeywordName(long keywordId) throws Exception + { + DesKeyword keyword = ORM.get(ZTable.class).item(DesKeyword.class, keywordId); + if (keyword == null) + { + return ""; + } + + return keyword.getKeywordName(); + } + + /** + * 模板关联标签 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doTemplateLabelRelation(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + long industryId = request.getParameterLong("industryId"); + String industrySubIds = request.getParameter("industrySubIds"); + String attributeIds = request.getParameter("attributeIds"); + + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (media == null) + { + return; + } + + // String prdTypeName = DesignTypeDao.name(media.getTypeId()); + // String industryName = Global.get(DesignIndustryCache.class).getIndustryName(industryId); + String industrySubName = LabelDao.doIndustrySubName(industrySubIds); + String attributeName = LabelDao.doAttributeName(attributeIds); + + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("industryId", industryId); + updater.addField("industrySubIds", industrySubIds); + updater.addField("industrySubName", industrySubName); + updater.addField("attributeIds", attributeIds); + updater.addField("attributeName", attributeName); + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + + // 更新solr数据 + SolrUtil.updateMediaData(mediaId); + } + + /** + * 添加模板自定义标签 + * + * @param request + * @throws Exception + */ + public static void doTemplateCustomLabelAdd(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + String keywordName = request.getParameter("keywordName").trim(); + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + + String typeName = DesignTypeDao.name(media.getTypeId()); + + List industryList = Lists.toStringList(media.getIndustrySubName()); + List attrList = Lists.toStringList(media.getAttributeName()); + List definedList = Lists.toStringList(media.getKeywordName()); + + if (typeName.equals(keywordName) || industryList.contains(keywordName) || attrList.contains(keywordName) || definedList.contains(keywordName)) + { + request.setResponseError("该标签词已存在,请重新输入"); + return; + } + + String name = ""; + if (definedList.isEmpty()) + { + name = keywordName; + } + else + { + name = media.getKeywordName() + "," + keywordName; + } + + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("keywordName", name); + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + // 更新solr数据 + SolrUtil.updateMediaData(mediaId); + request.setResponseResult(keywordName); + } + + /** + * 删除自定义标签 + * + * @param request + * @throws Exception + */ + public static void doTemplateCustomLabelDelete(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + String keywordName = request.getParameter("keywordName"); + + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + + List definedList = Lists.toStringList(media.getKeywordName()); + definedList.remove(keywordName); + String newName = Lists.toString(definedList); + + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("keywordName", newName); + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + + // 更新solr数据 + SolrUtil.updateMediaData(mediaId); + } + + /** + * 作品关联的标签 + * + * @param worksId + * @return + * @throws Exception + */ + public static String doWorksLabelName(long worksId) throws Exception + { + DesWorksFile works = ORM.get(ZTable.class).item(DesWorksFile.class, worksId); + String prdTypeName = Global.get(DesignTypeCache.class).getName(works.getPrdTypeId()); + String industryName = Global.get(DesignIndustryCache.class).getIndustryName(works.getIndustryId()); + + String labelName = prdTypeName + " " + industryName + " "; + + if (Validates.isNotEmpty(works.getIndustrySubName())) + { + labelName += works.getIndustrySubName() + " "; + } + + if (Validates.isNotEmpty(works.getAttributeName())) + { + labelName += works.getAttributeName(); + } + + return labelName; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/MessagePresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/MessagePresenter.java new file mode 100644 index 0000000..22c9116 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/MessagePresenter.java @@ -0,0 +1,189 @@ +/** + * 扬彩印刷设计 + * 文件名 :MessagePresenter.java + * 创建人 :jiangbin + * 创建时间:2020-5-6 + */ +package com.zhiqim.yangcai.design.presenter; + +import java.util.HashMap; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.httpclient.HttpGet; +import org.zhiqim.kernel.httpclient.HttpPost; +import org.zhiqim.kernel.httpclient.HttpResult; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.alibaba.fastjson.JSON; +import com.zhiqim.yangcai.design.dbo.order.OrderMessage; +import com.zhiqim.yangcai.design.messagebox.ZqmMessageProducerHandler; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +import yangcai.messagebox.model.MessageBusi; + +/** + * 消息盒子信息处理 + * + * @version 1.0 @author jiangbin 2020-5-6 新建与整理 + */ +@AnAlias("MessagePresenter") +@AnIntercept("chkZmrLogin") +public class MessagePresenter +{ + private static final Log log = LogFactory.getLog(MessagePresenter.class); + + /** + * + * [简要描述]: 处理待办事项
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doProcessMessage(HttpRequest request) throws Exception + { + long id = request.getParameterLong("id"); + if (id <= 0) + { + request.setResponseError("请选择待处理事项"); + return; + } + + Updater updater = new Updater(); + updater.addMust("id", id); + updater.addField("consumerState", 1); + updater.addField("consumerTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(OrderMessage.class, updater); + } + + /** + * + * 消息处理 + * + * @author jiangbin + * @param request + */ + public static void doMessageHandle(HttpRequest request) + { + String id = request.getParameter("id"); + if (Validates.isEmail(id)) + { + request.setResponseError("消息ID为空"); + return; + } + try + { + String token = BusinessPlatformClientUtil.getAccessToken(); + HttpPost httpPost = new HttpPost( + BusinessPlatformClientUtil.GATE_WAY_URL + "api-busi/messageBusi/readMessagesWithTheSameOrderId/" + id + "?access_token=" + token); + httpPost.setReadTimeout(2); + httpPost.setConnectTimeout(1); + httpPost.execute(); + HttpResult result = httpPost.getResult(); + if (result.isSuccess()) + { + request.setResponseResult("true"); + return; + } + else + { + throw new Exception("处理消息【" + id + "】失败:" + result.getResponseText()); + } + } + catch (Exception e) + { + log.error("消息【" + id + "】处理异常," + e.getMessage(), e); + request.setResponseError("消息处理失败"); + return; + } + } + + /** + * + * 消息再次发送 + * + * @author jiangbin + * @param request + */ + public static void sendMessageAgain(HttpRequest request) + { + String id = request.getParameter("id"); + if (Validates.isEmail(id)) + { + request.setResponseError("消息ID为空"); + return; + } + try + { + String token = BusinessPlatformClientUtil.getAccessToken(); + HttpGet httpGet = new HttpGet(BusinessPlatformClientUtil.GATE_WAY_URL + "api-busi/messageBusi/" + id + "?access_token=" + token); + httpGet.setReadTimeout(2); + httpGet.setConnectTimeout(1); + httpGet.execute(); + HttpResult result = httpGet.getResult(); + if (result.isSuccess()) + { + MapSS mapss = Jsons.toMapSS(result.getResponseText()); + if (Validates.isNotEmpty(mapss) && Validates.isNotEmpty(mapss.get("data"))) + { + MessageBusi messageBusi = JSON.parseObject(mapss.get("data"), MessageBusi.class); + if (Validates.isNotEmpty(messageBusi)) + { + final String sessionName = request.getSessionName(); + // 再次发送消息提醒 + MessageBusi newMessageBusi = new MessageBusi(); + newMessageBusi.setId(String.valueOf(Ids.longId13_4())); + newMessageBusi.setProducerOperateType(messageBusi.getProducerOperateType()); + newMessageBusi.setProducerOperateCode(sessionName); + newMessageBusi.setProducerOperateName(sessionName); + newMessageBusi.setConsumerPlatformType(messageBusi.getConsumerPlatformType()); + newMessageBusi.setConsumerOperateCode(messageBusi.getConsumerOperateCode()); + newMessageBusi.setConsumerOperateName(messageBusi.getConsumerOperateName()); + newMessageBusi.setConsumerOperateType(messageBusi.getConsumerOperateType()); + newMessageBusi.setMessageType(messageBusi.getMessageType()); + newMessageBusi.setOrderId(messageBusi.getOrderId()); + newMessageBusi.setTopic(messageBusi.getTopic()); + newMessageBusi.setMessageBody(messageBusi.getMessageBody()); + HashMap propertyMap = new HashMap(); + /* + * propertyMap.put("designId", messageBusi.getOrderId()); + * propertyMap.put("title", "订单审核退回"); + * propertyMap.put("sender", sessionName); + */ + ZqmMessageProducerHandler.sendMessage(newMessageBusi, propertyMap); + request.setResponseResult("true"); + return; + } + } + else + { + throw new Exception("未查询到ID为【" + id + "】的消息数据"); + } + } + else + { + throw new Exception("调用消息查询接口失败:" + result.getResponseText()); + } + } + catch (Exception e) + { + log.error("消息【" + id + "】再次发送异常," + e.getMessage(), e); + request.setResponseError("消息再次发送失败"); + return; + } + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/MobileTemplatePresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/MobileTemplatePresenter.java new file mode 100644 index 0000000..08ce87a --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/MobileTemplatePresenter.java @@ -0,0 +1,85 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.HashMap; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; + +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateSolrModel; +import com.zhiqim.yangcai.util.SolrUtil; + +/** + * 移动端模板库Presenter + * + * @author HuangZhiGao + * @date 2020-02-26 8:52 + */ +@AnAlias("MobileTemplatePresenter") +public class MobileTemplatePresenter +{ + + /** + * 用于移动端模板查询(可根据关键字查询)
            + * + * @param httpRequest + * @throws Exception + */ + public static void doTemplateSearch(HttpRequest httpRequest) throws Exception + { + String keyword = httpRequest.getParameter("keyword", ""); + String industryId = httpRequest.getParameter("industryId"); + String sort = httpRequest.getParameter("sort"); + String typeId = httpRequest.getParameter("typeId"); + String oddEven = httpRequest.getParameter("oddEven"); + + Map param = new HashMap(); + param.put("keyword", keyword); + param.put("industryId", industryId); + param.put("sort", sort); + param.put("typeId", typeId); + param.put("mediaUrl", "*"); + param.put("oddEven", oddEven); + + // 现在默认查询第一页-每页10条 + int page = httpRequest.getParameterInt("page", 1); + int pageSize = 10; + + PageResult modelPageResult = SolrUtil.queryAllTemplate(page, pageSize, param); + MapSO attrMap = new HashMapSO(); + int total = modelPageResult.total(); + if (page * pageSize >= total) + { + attrMap.put("hasNext", false); + } + else + { + attrMap.put("hasNext", true); + } + + attrMap.put("pageResultList", modelPageResult.list()); + + HttpResponse response = httpRequest.getResponse(); + response.print(Jsons.toString(attrMap)); + } + + /** + * 用于移动端单个模板zml页面返回数量
            + * + * @param strs 带英文逗号分隔的字符串 + * @return int + * @author HuangZhiGao + * @date 2020/2/26 11:40 + */ + public static int getTemplateDetailCount(String strs) + { + return Arrays.toStringArray(strs).length; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/MobileWorksPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/MobileWorksPresenter.java new file mode 100644 index 0000000..6778869 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/MobileWorksPresenter.java @@ -0,0 +1,289 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.works.DesWorksEvent; +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; +import com.zhiqim.yangcai.design.model.DesWorksFileModel; + +/** + * 移动端作品库Presenter + * + * @author HuangZhiGao + * @date 2020-02-24 8:52 + */ +@AnAlias("MobileWorksPresenter") +public class MobileWorksPresenter implements SignConstants +{ + /** + * 用于移动端作品查询(可根据关键字查询)
            + * + * @param httpRequest + * @throws Exception + * @author HuangZhiGao + * @date 2020/2/24 8:56 + */ + public static void doWorksSearch(HttpRequest httpRequest) throws Exception + { + String keyword = httpRequest.getParameter("keyword", ""); + String searchLike = httpRequest.getParameter("searchLike", "false"); + long industryId = httpRequest.getParameterLong("industryId"); + String worksTypeIndex = httpRequest.getParameter("worksTypeIndex"); + String labelStatus = httpRequest.getParameter("labelStatus", ""); + + // 现在默认查询第一页-每页10条 + int page = httpRequest.getParameterInt("page", 1); + int pageSize = 10; + + Selector selector = new Selector(); + selector.addOrderbyDesc("createTime"); + // 过滤掉 缩略图存储路径 为空的情况 + selector.addMustIsNotEmpty("thumbImagePath"); + + // 行业id + if (industryId != -1L) + { + if (industryId == 10087) + { + List indList = Global.get(DesignIndustryCache.class).getIndustryList(); + List inList = new ArrayList(); + for (DesignIndustry ind : indList) + { + inList.add(ind.getIndustryId()); + } + + selector.addMustInLong("industryId", Arrays.toArrayLong(inList)); + } + else + { + selector.addMust("industryId", industryId); + } + } + // 精品作品 + if (Validates.isNotEmpty(worksTypeIndex) && worksTypeIndex.equals("BEST")) + { + selector.addMustIn("worksType", 1, 4); + } + + // 是否是找相似[根据industrySubName行业子名称进行模糊查询] + if (Boolean.parseBoolean(searchLike)) + { + // 重塑后再进行切割-避免首尾带半角逗号的情况 + keyword = DesignerPresenter.remodelKeyword(keyword); + // 找相似默认根据当前作品的第一个行业子名称查询 + if (keyword.contains(",")) + { + keyword = keyword.split(",")[0]; + } + selector.addMaybeLike("industrySubName", keyword); + } + else + { + // 关键词查询=输入全数字则查询worksId + Pattern pattern = Pattern.compile("^\\d+$"); + Matcher isNum = pattern.matcher(Strings.trim(keyword)); + if (isNum.matches()) + { + selector.addMust("worksId", Long.valueOf(Strings.trim(keyword))); + } + else + { + String[] word = keyword.split(" "); + for (int i = 0; i < word.length; i++) + { + if (Validates.isEmptyBlank(word[i])) + { + continue; + } + + selector.addMaybeLike("industrySubName", word[i]); + } + } + } + + MapSO attrMap = new HashMapSO(); + List worksFileList = ORM.get(ZTable.class).list(DesWorksFile.class, page, pageSize, selector); + List desWorksFileModels = makeupDesWorksFileModel(worksFileList); + // 数据总数 + int pageTotal = ORM.get(ZTable.class).count(DesWorksFile.class, selector); + + // 根据热度标签状态labelStatus进行二次筛选 + if (Validates.isNotEmptyBlank(labelStatus)) + { + desWorksFileModels = heatLabelFilter(desWorksFileModels, Integer.parseInt(labelStatus)); + } + attrMap.put("desWorksFileModels", desWorksFileModels); + attrMap.put("pageTotal", pageTotal); + attrMap.put("pageNo", page); + attrMap.put("keyword", keyword); + attrMap.put("industryId", industryId); + attrMap.put("worksTypeIndex", worksTypeIndex); + + HttpResponse response = httpRequest.getResponse(); + response.print(Jsons.toString(attrMap)); + } + + /** + * 用于组装返回DesWorksFileModel集合
            + * + * @param worksFileList + * @return java.util.List + * @author HuangZhiGao + * @date 2020/2/25 9:29 + */ + private static List makeupDesWorksFileModel(List worksFileList) throws Exception + { + List desWorksFileModels = new ArrayList<>(); + if (Validates.isNotEmpty(worksFileList) && worksFileList.size() > 0) + { + DesWorksFileModel worksFileModel; + for (DesWorksFile desWorksFile : worksFileList) + { + worksFileModel = new DesWorksFileModel(); + + worksFileModel.setWorksId(desWorksFile.getWorksId()); + worksFileModel.setIndustryId(desWorksFile.getIndustryId()); + worksFileModel.setPrdTypeId(desWorksFile.getPrdTypeId()); + + worksFileModel.setPrdPageId(desWorksFile.getPrdPageId()); + worksFileModel.setPrdSizeId(desWorksFile.getPrdSizeId()); + worksFileModel.setTemplateId(desWorksFile.getTemplateId()); + + worksFileModel.setIndustrySubIds(desWorksFile.getIndustrySubIds()); + worksFileModel.setKeywordId(desWorksFile.getKeywordId()); + worksFileModel.setAttributeIds(desWorksFile.getAttributeIds()); + + String indSubName = desWorksFile.getIndustrySubName(); + String attrName = desWorksFile.getAttributeName(); + String keywordName = desWorksFile.getKeywordName(); + if (Validates.isEmptyBlank(desWorksFile.getIndustrySubName())) + { + indSubName = ""; + } + if (Validates.isEmptyBlank(desWorksFile.getAttributeName())) + { + attrName = ""; + } + if (Validates.isEmptyBlank(desWorksFile.getKeywordName())) + { + keywordName = ""; + } + worksFileModel.setIndustrySubName(indSubName); + worksFileModel.setAttributeName(attrName); + worksFileModel.setKeywordName(keywordName); + + worksFileModel.setWorksName(desWorksFile.getWorksName()); + worksFileModel.setWorksType(desWorksFile.getWorksType()); + worksFileModel.setCdrFileName(desWorksFile.getCdrFileName()); + + worksFileModel.setPdfFileName(desWorksFile.getPdfFileName()); + worksFileModel.setCdrPath(desWorksFile.getCdrPath()); + worksFileModel.setPdfPath(desWorksFile.getPdfPath()); + + worksFileModel.setDesigner(desWorksFile.getDesigner()); + worksFileModel.setDesignGroupId(desWorksFile.getDesignGroupId()); + worksFileModel.setDeptId(desWorksFile.getDeptId()); + + worksFileModel.setThumbImagePath(desWorksFile.getThumbImagePath()); + worksFileModel.setThumbImageOssUrl(desWorksFile.getThumbImageOssUrl()); + worksFileModel.setThumbImagePhyPath(desWorksFile.getThumbImagePhyPath()); + + worksFileModel.setUploadType(desWorksFile.getUploadType()); + worksFileModel.setCreateTime(desWorksFile.getCreateTime()); + worksFileModel.setOssStatus(desWorksFile.getOssStatus()); + + worksFileModel.setFileType(desWorksFile.getFileType()); + + // 浏览数 + int browseNum = ORM.get(ZTable.class).count(DesWorksEvent.class, + new Selector().addMust("worksId", desWorksFile.getWorksId()).addMust("eventType", 1)); + // 作品热度标签(1无、2精品、3推荐、4热门) + // 根据作品类型判断精品,否则根据浏览次数判断:无(<20)、推荐(>=20 <50)和热门(>=50) + if (browseNum < 20) + { + worksFileModel.setWorksHeatLabel(1); + } + if (desWorksFile.getWorksType() == 1 || desWorksFile.getWorksType() == 2 || desWorksFile.getWorksType() == 3 + || desWorksFile.getWorksType() == 4) + { + worksFileModel.setWorksHeatLabel(2); + } + if (browseNum >= 20 && browseNum < 50) + { + if (desWorksFile.getWorksType() != 1 && desWorksFile.getWorksType() != 2 && desWorksFile.getWorksType() != 3 + && desWorksFile.getWorksType() != 4) + { + worksFileModel.setWorksHeatLabel(3); + } + } + if (browseNum > 50) + { + if (desWorksFile.getWorksType() != 1 && desWorksFile.getWorksType() != 2 && desWorksFile.getWorksType() != 3 + && desWorksFile.getWorksType() != 4) + { + worksFileModel.setWorksHeatLabel(4); + } + } + desWorksFileModels.add(worksFileModel); + } + } + + return desWorksFileModels; + } + + /** + * 根据热度标签状态labelStatus进行二次筛选
            + * + * @param desWorksFileModels + * @param labelStatus + * @return java.util.List + * @author HuangZhiGao + * @date 2020/2/25 16:43 + */ + private static List heatLabelFilter(List desWorksFileModels, int labelStatus) + { + List desWorksFileModelList = new ArrayList<>(); + for (DesWorksFileModel desWorksFileModel : desWorksFileModels) + { + if (desWorksFileModel.getWorksHeatLabel() == labelStatus) + { + desWorksFileModelList.add(desWorksFileModel); + } + } + return desWorksFileModelList; + } + + /** + * 用于移动端单个作品zml页面返回数量
            + * + * @param strs 带英文逗号分隔的字符串 + * @return int + * @author HuangZhiGao + * @date 2020/2/25 11:40 + */ + public static int getWorksDetailCount(String strs) + { + return Arrays.toStringArray(strs).length; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/OperatorOrderPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/OperatorOrderPresenter.java new file mode 100644 index 0000000..87bcca7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/OperatorOrderPresenter.java @@ -0,0 +1,319 @@ +/* + * 版权所有 (C) 2015 知启蒙(WWW.ZHIQIM.COM) 保留所有权利。 + * Download http://www.zhiqim.com/fadfox/ 欢迎加盟[凡狐]兴趣小组。 + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的发行站点进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标等知识产权; + * 4、您在互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行站点进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * 许可证链接:http://www.zhiqim.com/licenses/LICENSE + * 发行站点:http://www.zhiqim.com + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ +package com.zhiqim.yangcai.design.presenter; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Randoms; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrPassworder; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.presenter.WorkWechatPresenter; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.cache.DesignMerchantCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecord; +import com.zhiqim.yangcai.util.ExportUtils; +import com.zhiqim.yangcai.util.Report; + +/** + * + * 操作员订单相关 + * + * @version v1.0.0 @author yixin 2020-10-16 新建与整理 + */ +@AnAlias("OperatorOrderPresenter") +@AnIntercept("chkZmrLogin") +public class OperatorOrderPresenter +{ + + /** 修改操作员 */ + public static void operatorUpdate(HttpRequest request) throws Exception + { + String dateTime = DateTimes.getDateTimeString(); + String operatorCode = request.getParameter("operatorCode"); + String operatorName = request.getParameter("operatorName"); + String operatorPass = request.getParameter("operatorPass"); + String operatorMobile = request.getParameter("operatorMobile"); + int operatorStatus = request.getParameterInt("operatorStatus"); + int operatorType = request.getParameterInt("operatorType"); + String operatorWangwang = request.getParameter("operatorWangwang"); + String operatorWxcode = request.getParameter("operatorWxcode"); + + Updater updater = new Updater(); + updater.addMaybe("operatorCode", operatorCode); + updater.addField("operatorName", operatorName); + if (Validates.isNotEmpty(operatorPass)) + { + if (!Validates.isUserPass(operatorPass)) + { + request.setResponseError("请输入6-16位操作员密码(大小写字母数字和特殊字符必须四选三)"); + return; + } + if (operatorPass.toLowerCase().contains("yangcai")) + { + request.setResponseError("密码中不允许包含yangcai"); + return; + } + + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + String operatorPassSalt = Randoms.lettersDigitsSecure(64); + + operatorPass = passworder.encode(operatorCode, operatorPass, operatorPassSalt); + updater.addField("operatorPass", operatorPass); + updater.addField("operatorPassSalt", operatorPassSalt); + } + + if (Validates.isNotEmpty(operatorMobile)) + { + boolean isMatch = Pattern.matches(ZmrConstants.ZMR_MOBILE, operatorMobile); + if (!isMatch) + { + request.setResponseError("请输入正确的手机号"); + return; + } + } + + if (Validates.isEmpty(operatorWxcode)) + { + request.setResponseError("请输入个人微信账号"); + return; + } + + /* 根据企业成员手机号获取企业微信账号 */ + String accessToken = WorkWechatPresenter.doGetWorkWechatAccessToken(); + String wkwechatAccount = WorkWechatPresenter.getUserIdByPhoneNumber(accessToken, operatorMobile); + + // 停用时添加判断 + if (operatorStatus == 1) + { + int orderCount = getErpOperatorOrderCount(operatorCode); + if (orderCount > 0) + { + request.setResponseError("请注意,该操作员账户存在" + orderCount + "条未处理订单,请处理后停用"); + return; + } + + // 去掉角色 + updater.addField("operatorRole", ""); + // 停用设计师接单规则 + Updater updater2 = new Updater(); + updater2.addMust("operatorCode", operatorCode); + updater2.addField("status", 0); + updater2.addField("modifyOperatorCode", request.getSessionName()); + updater2.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignerGroupDispatch.class, updater2); + + // 停用设计师积分状态 + Updater updater3 = new Updater(); + updater3.addMust("operatorCode", operatorCode); + updater3.addField("state", 0); + updater3.addField("lastModifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(ScoreDesignerRecord.class, updater3); + } + else + { + // 启用设计师接单规则 + Updater updater2 = new Updater(); + updater2.addMust("operatorCode", operatorCode); + updater2.addField("status", 1); + updater2.addField("modifyOperatorCode", request.getSessionName()); + updater2.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignerGroupDispatch.class, updater2); + + // 启用设计师积分状态 + Updater updater3 = new Updater(); + updater3.addMust("operatorCode", operatorCode); + updater3.addField("state", 1); + updater3.addField("lastModifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(ScoreDesignerRecord.class, updater3); + } + + updater.addField("operatorStatus", operatorStatus); + updater.addField("operatorMobile", operatorMobile); + updater.addField("operatorModified", dateTime); + updater.addField("operatorType", operatorType); + updater.addField("operatorWangwang", operatorWangwang); + updater.addField("wkwechatAccount", wkwechatAccount); + updater.addField("operatorWxcode", operatorWxcode); + + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + request.setResponseResult("修改成功"); + } + + /** + * 获取操作员未完成的订单数量 + * + * @param operatorCode + * @return + * @throws SQLException + * @throws ORMException + */ + private static int getErpOperatorOrderCount(String operatorCode) throws ORMException, SQLException + { + Selector sel = getDesignOrderSelector(operatorCode); + int count = ORM.get(ZTable.class).count(DesignOrder.class, sel); + return count; + } + + /** + * 下载操作员未完成的订单 + */ + public static void downloadDesignOperatorOrder(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode"); + if (Validates.isEmpty(operatorCode)) + { + request.setResponseError("未查询到操作员信息"); + return; + } + List list = getDesignOperatorOrder(operatorCode, request); + ExportUtils.exportExcel(request, list, operatorCode + "未处理订单.xls"); + } + + /** + * 获取操作员未完成的订单 + * + * @param operatorCode + * @return + * @throws SQLException + * @throws ORMException + */ + private static List getDesignOperatorOrder(String operatorCode, HttpRequest request) throws Exception + { + List list = new ArrayList(); + // 订单列表数据 + Report report = getDesignOrderData(operatorCode, request); + if (report != null) + { + list.add(report); + } + return list; + } + + /** + * 获取操作员设计订单数据 + * + * @return + * @throws Exception + */ + private static Report getDesignOrderData(String operatorCode, HttpRequest request) throws Exception + { + Selector sel = getDesignOrderSelector(operatorCode); + List list = ORM.get(ZTable.class).list(DesignOrder.class, sel); + if (Validates.isNotEmpty(list)) + { + Report report = new Report(); + report.setTitle("订单列表"); + report.setHearder(new String[] + { + "订单号", "商户", "组织", "稿件类型", "旺旺号", "店铺", "状态", "产品", "进度备注", "印刷金额", "设计费份数", "录单时间", "领单时间", "完稿时间", "审稿时间", "审核人", "行业" + }); + report.setWidths(new int[] + { + 25, 25, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 + }); + report.setFormats(new int[17]); + report.setHeight(700); + report.setExcelPageType(1); + report.setPageSize(1); + + List industryList = Global.get(DesignIndustryCache.class).getIndustryListAll(); + Map progressNoteMap = new HashMap(); + Map industryMap = new HashMap<>(); + for (DesignOrder order : list) + { + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class).item(OrdProgressNote.class, + new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" : note.getOrdProgressNote()); + } + for (DesignIndustry industry : industryList) + { + industryMap.put(industry.getIndustryId(), industry); + } + + for (int i = 0; i < list.size(); i++) + { + DesignOrder item = list.get(i); + String designId = String.valueOf(item.getDesignId()); + String merchantId = Global.get(DesignMerchantCache.class).getName(item.getMerchantId()); + String orgId = ZmrOrgDao.getOrgName(request, item.getOrgId()); + String draftType = DraftConstants.get(item.getDraftType()); + String buyerNick = item.getBuyerNick(); + String shopNick = item.getShopNick(); + String status = StatusConstants.getOrderStatusItem(item.getStatus()).desc(); + String orderText = item.getOrderText(); + String progressNote = progressNoteMap.get(item.getDesignId()); + String amount = Amounts.toYuanMustRadix(item.getAmount()); + String designCopies = String.valueOf(item.getDesignCopies()); + String createTime = Sqls.toDateTimeString(item.getCreateTime()); + String designReceiveTime = Sqls.toDateTimeString(item.getDesignReceiveTime()); + String designEndTime = Sqls.toDateTimeString(item.getDesignEndTime()); + String checkTime = Sqls.toDateTimeString(item.getCheckTime()); + String checker = item.getChecker(); + DesignIndustry industry = industryMap.get(item.getIndustryId()); + String industryName = industry == null ? "" : industry.getIndustryName(); + String[] drow = new String[] + { + designId, merchantId, orgId, draftType, buyerNick, shopNick, status, orderText, progressNote, amount, designCopies, createTime, + designReceiveTime, designEndTime, checkTime, checker, industryName + }; + + report.addData(drow); + } + return report; + } + return null; + } + + /** + * + * @param operatorCode + */ + private static Selector getDesignOrderSelector(String operatorCode) + { + Selector sel = new Selector(); + sel.addMustIn("status", StatusConstants.ORDER_30.value(), StatusConstants.ORDER_36.value(), StatusConstants.ORDER_50.value()); + sel.addMust("designer", operatorCode); + return sel; + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/OrderCheckPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/OrderCheckPresenter.java new file mode 100644 index 0000000..2542070 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/OrderCheckPresenter.java @@ -0,0 +1,352 @@ +/** + * 扬彩印刷设计 + * 文件名 :OrderCheckPresenter.java + * 创建人 :gjx + * 创建时间:2019-9-16 + */ + +package com.zhiqim.yangcai.design.presenter; + +import java.io.File; +import java.sql.Timestamp; +import java.util.List; + +import javax.imageio.stream.FileImageOutputStream; +import javax.imageio.stream.ImageOutputStream; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.Base64Decoder; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.aliyuncs.utils.StringUtils; +import com.zhiqim.media.dbo.MediaCanvas; +import com.zhiqim.yangcai.design.constant.VirtualAccountConstants; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.MessageThemeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OrderCheckDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dao.VirtualAccountDao; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; +import com.zhiqim.yangcai.design.dbo.order.OrderMessage; +import com.zhiqim.yangcai.design.dbo.order.SelfOrder; +import com.zhiqim.yangcai.design.dbo.stat.CheckBackReason; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.dbo.utils.BaseUtil; +import com.zhiqim.yangcai.design.server.ErpClassService; +import com.zhiqim.yangcai.design.server.ErpClassService.statusEnum; + +/** + * 订单审核相关 + * + * @version 1.0 @author gjx 2019-9-16 新建与整理 + */ +@AnAlias("OrderCheckPresenter") +@AnIntercept("chkZmrLogin") +public class OrderCheckPresenter { + private static final Log log = LogFactory.getLog(OrderCheckPresenter.class); + + public static void doQueryBackReason(HttpRequest request) throws Exception { + List reasonList = ORM.get(ZTable.class).list(CheckBackReason.class); + request.setResponseResult(Jsons.toString("reasonList", + Jsons.toList(BaseUtil.removeBlank(Jsons.toString(reasonList)), CheckBackReason.class))); + + } + + /** + * 订单审核退回(带图片) + * + * @param request + * @param src 审核场景:printCheck 印前审核,draftCheck 初稿审核,endCheck 定稿审核 + * @throws Exception + */ + @AnTransaction + public static void doCheckback(HttpRequest request) throws Exception { + request.addValidate(new IsNotEmpty("designId", "请选择订单")); + if (!request.chkValidate()) { + request.setResponseError(request.getAlertMsg()); + return; + } + long designId = request.getParameterLong("designId"); + // 退回来源:printCheck 印前审核,draftCheck 初稿审核,endCheck 定稿审核 + String src = request.getParameter("src"); + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, + new Selector().addMust("designId", designId)); + if (order == null) { + request.setResponseError("订单【" + designId + "】不存在"); + return; + } + + // 退回状态 + int backStstus = StatusConstants.ORDER_30.value(); + int eventStatus = EventConstants.ORDER_10.value(); + // 日志记录 + String logItem = "印前审核退回"; + String attaModul = FileTypeConstants.FILE_END.value(); + if ("printCheck".equals(src)) { // 印前审核 + if (order.getStatus() != StatusConstants.ORDER_55.value()) { + request.setResponseError("非已定稿待审状态不允许审核退回"); + return; + } + } else if ("draftCheck".equals(src)) { + logItem = "设计初稿审核退回"; + attaModul = FileTypeConstants.FILE_FIRSTTHUMFILE.value(); + if (order.getStatus() != StatusConstants.ORDER_40.value()) { + request.setResponseError("非初稿待审状态不允许审核退回"); + return; + } + eventStatus = EventConstants.ORDER_13.value(); + } else { + backStstus = StatusConstants.ORDER_50.value(); + logItem = "设计定稿审核退回"; + if (order.getStatus() != StatusConstants.ORDER_52.value()) { + request.setResponseError("非定稿待审状态不允许审核退回"); + return; + } + eventStatus = EventConstants.ORDER_14.value(); + } + + if (order.getDraftType() == DraftConstants.DRAFT_STANDARD.value() && Validates.isEmpty(order.getDesigner())) {// 打回,标准自来稿+设计师为空,直接打回给印前组织负责人账号名下 + ZmrOrg zmrOrg = ORM.get(ZTable.class).item(ZmrOrg.class, 2018280240394L); + if (zmrOrg == null || Validates.isEmpty(zmrOrg.getOrgManager())) { + request.setResponseError("印前改稿组织负责人未配置"); + return; + } + order.setDesigner(zmrOrg.getOrgManager()); + } + + String sessionName = request.getSessionName(); + Timestamp currentTime = Sqls.nowTimestamp(); + String desc = request.getParameter("desc"); + long resonTypeId = request.getParameterLong("resonTypeId"); + resonTypeId = resonTypeId <= 0 ? 0 : resonTypeId; + long reasonId = request.getParameterLong("reasonId"); + reasonId = reasonId <= 0 ? 0 : reasonId; + + String typeText = ""; + String reasonText = ""; + if (resonTypeId >= 0) {// 原因分类必填 + CheckBackReason item = ORM.get(ZTable.class).item(CheckBackReason.class, + new Selector().addMust("reasonId", resonTypeId)); + if (item == null) { + request.setResponseError("未知原因分类或未选原因分类"); + return; + } + + typeText = item.getReasonText(); + } + + if (reasonId > 0) { + CheckBackReason item = ORM.get(ZTable.class).item(CheckBackReason.class, reasonId); + if (item == null) { + request.setResponseError("未知问题原因"); + return; + } + + reasonText = item.getReasonText(); + } + + String typeReason = (Validates.isNotEmptyBlank(typeText) ? "【" + typeText + "】" : "") + + (Validates.isNotEmptyBlank(reasonText) ? "【" + reasonText + "】" : ""); + desc = typeReason + desc; + + // 对传过来的图片解码并且写入文件 + String imgBase64Str = request.getParameter("imgData"); + String checkBackPictureUrl = null; + if (Validates.isNotEmptyBlank(imgBase64Str)) { + String rootDir = Strings.trimRight(request.getContext().getAttributeString("upload.rootDir"), "/"); + String fileName = designId + "_" + src + "_checkBackFile" + ".png"; + + String checkPath = rootDir + "/" + DateTimes.getDateTime8String() + "/" + + FileTypeConstants.FILE_CHECK_BACK.value(); + String path = checkPath + "/" + fileName; + Files.mkDirectory(checkPath); + + imgBase64Str = imgBase64Str.replace("data:image/pngbase64,", ""); + byte[] imageBytes = Base64Decoder.decode(imgBase64Str.getBytes("utf-8")); + File file = new File(path); + ImageOutputStream out = new FileImageOutputStream(file); + out.write(imageBytes); + out.flush(); + out.close(); + + // 插入订单附属表 + DesignAtta atta = new DesignAtta(); + atta.setAttaId(Ids.longId13()); + atta.setAttaModul(FileTypeConstants.FILE_CHECK_BACK.value()); + atta.setDesignId(designId); + atta.setFileName(fileName); + atta.setFileType("png"); + atta.setSavePath(path); + atta.setUploadTime(currentTime); + atta.setOperatorCode(sessionName); + ORM.get(ZTable.class).insert(atta); + boolean flag = OssFileDao.uploadFile(atta); + if (flag && Validates.isUrl(atta.getOssUrl())) { + checkBackPictureUrl = atta.getOssUrl(); + } + } + + // 修改订单信息 + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("status", backStstus); + if ("printCheck".equals(src)) {// 印前审核 + updater.addField("checker", sessionName); + updater.addField("checkBackReason", desc); + updater.addField("checkBackPictureUrl", checkBackPictureUrl); + updater.addField("checkTime", currentTime); + } + updater.addField("modifyTime", currentTime); + updater.addField("designer", order.getDesigner()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + // 修改设计中状态 + if (backStstus == StatusConstants.ORDER_30.value() && !StringUtils.isEmpty(order.getTids())) { + new ErpClassService(order.getTids(), order.getDesigner(), statusEnum.TO_BE_DESIGNEDING.getCode()); + } + if ("draftCheck".equals(src)) { + Updater up_self = new Updater(); + up_self.addMust("designId", designId); + up_self.addField("draftChecker", sessionName); + up_self.addField("draftBackReason", desc); + up_self.addField("draftBackReasonPicUrl", checkBackPictureUrl); + up_self.addField("draftBackTime", currentTime); + ORM.get(ZTable.class).update(SelfOrder.class, up_self); + } else if ("endCheck".equals(src)) { + Updater up_self = new Updater(); + up_self.addMust("designId", designId); + up_self.addField("endChecker", sessionName); + up_self.addField("endBackReason", desc); + up_self.addField("endBackReasonPicUrl", checkBackPictureUrl); + up_self.addField("endBackTime", currentTime); + ORM.get(ZTable.class).update(SelfOrder.class, up_self); + } + + // 删除成品/初稿文件 + Selector attaSel = new Selector(); + attaSel.addMust("designId", designId); + attaSel.addMust("attaModul", attaModul); + DesignAtta designAtta = ORM.get(ZTable.class).item(DesignAtta.class, attaSel); + if (designAtta != null) { + OrderCheckDao.doDeleteAttaFile(designAtta); + } + + // 定稿+印前审核退回都需要更新模板数据 + if (!"draftCheck".equals(src)) { + Selector sel = new Selector(); + sel.addMust("designId", designId); + sel.addMust("templateType", 80); + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, sel); + if (template != null) { + long mediaId = template.getMediaId(); + + // 修改定稿模板为临时模板 + Updater mUpdater = new Updater(); + mUpdater.addMust("mediaId", mediaId); + mUpdater.addField("templateType", 0); + ORM.get(ZTable.class).update(MediaTemplate.class, mUpdater); + + // 更新模板为可编辑状态 + Updater cUpdater = new Updater(); + cUpdater.addMust("mediaId", mediaId); + cUpdater.addField("isEdit", 0); // 可编辑 + cUpdater.addField("updateTime", DateTimes.getDateTimeString()); + ORM.get(ZTable.class).update(MediaCanvas.class, cUpdater); + } + } + + OrderMessage message = new OrderMessage(); + message.setDesignId(designId); + message.setBuyerNick(order.getBuyerNick()); + message.setCreateTime(currentTime); + message.setMessageType(1); // 消息类型(0:催稿,1:订单审核、排产退回) + message.setTopic(MessageThemeConstants.MSG_ORDER_RETURN.value());// 主题 + message.setProductionCode(sessionName);// 生产者 + message.setProductionTime(currentTime);// 生产时间 + message.setMessageBody("您有一条订单(" + designId + "," + desc + ")" + logItem + ",请及时查看原因并处理!");// 消息内容 + message.setConsumerCodeType(0);// 消费者类型 0:普通操作员、1:协调人 + message.setConsumerPlatformType(MessageThemeConstants.PLATFORM_TYPE_DESIGN.value());// 消费平台 + message.setConsumerCode(order.getDesigner());// 消费者 + message.setConsumerState(0);// 消费状态,0:未消费 + // ORM.get(ZTable.class).insert(message); + + OrderLogDao.saveOrderOperateLog(designId, sessionName, logItem + ":" + desc, eventStatus); + + OrdProgressNote progressNote = new OrdProgressNote(); + progressNote.setDesignId(designId); + progressNote.setOrdProgressNote(desc); + progressNote.setOperateCode(request.getSessionName()); + progressNote.setCreateTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(progressNote); + + Updater updater1 = new Updater(); + updater1.addMust("designId", designId); + updater1.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater1); + + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), + request.getSessionName() + "更新进度备注:" + desc, EventConstants.ORDER_20.value()); + + // 印前审核 + if ("printCheck".equals(src)) { + // 取消加急 + if (order.isUrgent()) { + ORM.get(ZTable.class).update(DesignOrder.class, + new Updater().addMust("designId", order.getDesignId()).addField("isUrgent", false)); + ORM.get(ZTable.class).update(SelfOrder.class, + new Updater().addMust("designId", order.getDesignId()).addField("urgentPrice", 0)); + + // 记录日志 + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "印前审核退回自动取消加急", + EventConstants.ORDER_43.value()); + } + + // 退回触发设计师虚拟账户资金计算 + if (order.getDraftType() < DraftConstants.DRAFT_TEMPLATE.value() + || order.getDraftType() > DraftConstants.DRAFT_PAGE_DESIGN.value()) {// 排除标准自来稿 + return; + } + boolean finishDesign = true; + // 本月完成的订单退回 直接走退回 + if (order.getDesignEndTime().getTime() >= DateTimes.toCalendar(DateTimes.getFirstMonthDay() + " 00:00:00") + .getTime().getTime()) { + finishDesign = VirtualAccountDao.finishDesign(order, order.getDesigner(), + Integer.parseInt(VirtualAccountConstants.TRANSACTION_STATUS_6.value())); + } // 订单非本月完成,需扣除完成该单的用户的可用金额并删除历史绩效统计表 + else if (order.getDesignEndTime().getTime() <= DateTimes + .toCalendar(DateTimes.getFirstMonthDay() + " 00:00:00").getTime().getTime()) { + finishDesign = VirtualAccountDao.finishDesign(order, order.getDesigner(), + Integer.parseInt(VirtualAccountConstants.TRANSACTION_STATUS_7.value())); + } + if (!finishDesign) { + request.setResponseError(order.getDesigner() + ":【" + designId + "】订单审核退回账户资金操作失败"); + log.error(order.getDesigner() + ":【" + designId + "】订单审核退回账户资金操作失败"); + } + } + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/OrderPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/OrderPresenter.java new file mode 100644 index 0000000..cf4ea1d --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/OrderPresenter.java @@ -0,0 +1,993 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.io.File; +import java.net.URLDecoder; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.imageio.stream.FileImageOutputStream; +import javax.imageio.stream.ImageOutputStream; +import java.util.Base64; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.onex.IsEmail; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.httpclient.HttpGet; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.Base64Decoder; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.zml.expression.Operator; + +import com.aliyuncs.utils.StringUtils; +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.constant.TemplateScoreConstants; +import com.zhiqim.yangcai.design.constant.VirtualAccountConstants; +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignOrderMeritsDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dao.ScoreDesignerRecordDao; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dao.TemplateDao; +import com.zhiqim.yangcai.design.dao.TemplateScoreDao; +import com.zhiqim.yangcai.design.dao.VirtualAccountDao; +import com.zhiqim.yangcai.design.dbo.complain.DesignComplain; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.design.DesignTypeContent; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrdRetentView; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourse; +import com.zhiqim.yangcai.design.dbo.retention.RetentionDetails; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordDetail; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateOrder; +import com.zhiqim.yangcai.design.dbo.utils.CalculationUtil; +import com.zhiqim.yangcai.design.rmi.erp.ErpRmiService; +import com.zhiqim.yangcai.design.server.ErpClassService; +import com.zhiqim.yangcai.design.server.ErpClassService.statusEnum; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; +import com.zhiqim.yangcai.util.DesignUtil; +import com.zhiqim.yangcai.util.FileTransferUtil; +import com.zhiqim.yangcai.util.FileTransferUtil.Response; + +/** + * 订单 相关 + * + * @version v1.0.0 @author zhouwenbin 2017-8-15 新建与整理 + */ +@AnAlias("OrderPresenter") +@AnIntercept("chkZmrLogin") +public class OrderPresenter { + + /** + * 拒绝退款 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doRejectRefundOrder(HttpRequest request) throws Exception { + request.addValidate(new IsNotEmpty("designId", "请选择订单")); + if (!request.chkValidate()) { + request.setResponseError(request.getAlertMsg()); + return; + } + + long designId = request.getParameterLong("designId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (order == null) { + request.setResponseError("订单【" + designId + "】不存在!"); + return; + } + + if (StatusConstants.ORDER_34.value() != order.getStatus()) { + request.setResponseError("该订单不是申请退款状态"); + return; + } + + Updater updater = new Updater(); + updater.addMust("designId", designId); + if (Validates.isEmpty(order.getDesignDraftTime())) {// 没有初稿 + updater.addField("status", StatusConstants.ORDER_30.value()); + updater.addField("designBeginTime", Sqls.nowTimestamp()); + if (!StringUtils.isEmpty(order.getTids())) { + new ErpClassService(order.getTids(), order.getDesigner(), statusEnum.TO_BE_DESIGNEDING.getCode()); + } + } else { + updater.addField("status", StatusConstants.ORDER_50.value()); + updater.addField("designBeginTime", order.getDesignBeginTime()); + } + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "拒绝退款请求", EventConstants.ORDER_5.value()); + } + + /** + * 进度备注 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void addProgressNote(HttpRequest request) throws Exception { + long designId = request.getParameterLong("designId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (null == order) { + request.setResponseError("订单不存在"); + return; + } + String ordProgressNote = request.getParameter("ordProgressNote"); + if (Validates.isEmpty(ordProgressNote)) { + request.returnHistory("进度备注不能为空"); + return; + } + + OrdProgressNote progressNote = new OrdProgressNote(); + progressNote.setDesignId(designId); + progressNote.setOrdProgressNote(ordProgressNote); + progressNote.setOperateCode(request.getSessionName()); + progressNote.setCreateTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(progressNote); + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), + request.getSessionName() + "更新进度备注:" + ordProgressNote, EventConstants.ORDER_20.value()); + // ERP、设计平台同步更新订单进度备注 + /* + * if (order != null ) { int orderState = 4; if(order.getStatus() == 10){ + * orderState = 3; } if(order.getStatus() == 70){ orderState = 5; } new + * ErpClassService(order.getTids(), request.getSessionName(), + * orderState,ordProgressNote); } + */ + + /* + * if (order.getMerchantId() == 1823193185001L) { + * ErpRmiService.doOrdProgressNote(designId, Jsons.toString(progressNote)); } + * else {// 运营平台同步 BusinessPlatformClientUtil.doOrdProgressNote(designId, + * progressNote.getOrdProgressNote()); } + */ + } + + /** + * 设计份数修改 [简要描述]:
            + * [详细描述]:
            + * + * @author Administrator + * @param request + * @throws Exception + */ + public static void upDesignCopiesr(HttpRequest request) throws Exception { + long designId = request.getParameterLong("designId"); + int copies = request.getParameterInt("copies"); + + if (copies < 0 || copies % 1 != 0) { + request.setResponseError("输入份数需大于0"); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (null == order) { + request.setResponseError("订单不存在"); + return; + } + + if (order.getStatus() >= StatusConstants.ORDER_55.value()) { + request.setResponseError("定稿之后不能再修改份数,会导致收益混乱。"); + return; + } + + Updater updater = new Updater().addField("designCopies", copies).addMust("designId", designId); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + DesignSelfView orderAfter = ORM.get(ZView.class).item(DesignSelfView.class, new Selector("designId", designId)); + + // 修改份数重新计算设计费 + long designPrice = StatDao.calculateOrderPerformance(orderAfter); + ORM.get(ZTable.class).update(DesignOrder.class, + new Updater().addMust("designId", designId).addField("designPrice", designPrice)); + + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "设计份数修改", EventConstants.ORDER_20.value()); + DesignOrderMeritsDao.saveDesignOrderMerits(designId, "1", order.getDesignCopies() + "", copies + "", + request.getSessionName(), order.getDesigner(), order.getTypeId(), order.getStatus(), + order.getOrderText(), order.getDesignPrice(), designPrice); + } + + /** 行业查询 */ + public static void doSearchIndustry(HttpRequest request) throws Exception { + String industryKeywords = request.getParameter("industryKeywords"); + Selector selector = new Selector(); + + if (Validates.isNotEmpty(industryKeywords)) { + + Selector or = new Selector(); + or.addMaybeLike("industryName", industryKeywords); + or.addMaybeLike("industryKeywords", industryKeywords); + + for (String string : Arrays.toStringArray(industryKeywords.replace(" ", ","))) { + if (Validates.isEmptyBlank(string)) { + continue; + } + + or.addMaybeLike("industryKeywords", Strings.trim(string)); + } + + selector.addOr(or); + } + + List searchIndustryList = Global.get(DesignIndustryCache.class).getIndustryList(); + request.setAttribute("oidIndustryId", request.getParameterLong("oidIndustryId")); + + MapSO jsonMap = new HashMapSO(); + jsonMap.put("searchIndustryList", searchIndustryList); + jsonMap.put("oidIndustryId", request.getParameterLong("oidIndustryId")); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/order/presenter/industryList.zml", jsonMap); + request.setResponseResult(ret); + } + + /** + * 多选下载 + */ + public static void downloads(HttpRequest request) throws Exception { + String industryKeywords = request.getParameter("industryKeywords"); + + String[] oids = request.getParameterValues("designIds"); + long[] designIds = Arrays.toLongArray(oids); + if (designIds.length == 0) { + request.setResponseError("请选择订单"); + return; + } + String type = request.getParameter("type"); + Selector selector = new Selector(); + selector.addMustInLong("designId", designIds); + +// if (Validates.isNotEmpty(type) && "end".equals(type)) { +// selector.addMust("attaModul", FileTypeConstants.FILE_DESGIN.value()); +// } else { + selector.addMust("attaModul", FileTypeConstants.FILE_END.value()); +// } + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, selector); + String atts = ""; + for (DesignAtta designAtta : attaList) { + + atts += designAtta.getAttaId() + ","; + } + String result = (atts.length() > 1) ? atts.substring(0, atts.length() - 1) : ""; + request.setResponseResult(result); + } + + /** + * 订单印前审核通过 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doPassCheck(HttpRequest request) throws Exception { + + request.addValidate(new IsNotEmpty("designIds", "请选择订单")); + if (!request.chkValidate()) { + request.setResponseError(request.getAlertMsg()); + return; + } + + String[] oids = request.getParameterValues("designIds"); + long[] designIds = Arrays.toLongArray(oids); + if (designIds.length == 0) { + request.setResponseError("请选择订单"); + return; + } + Boolean pushFile = request.getParameterBoolean("pushFile"); + List orderList = ORM.get(ZView.class).list(DesignSelfView.class, + new Selector().addMustInLong("designId", designIds)); + if (orderList.size() == 0) { + request.setResponseError("请选择订单"); + return; + } + List results = new ArrayList<>(); + for (DesignSelfView order : orderList) { + if (order.getStatus() < StatusConstants.ORDER_10.value()) { + request.setResponseError("订单已被取消"); + return; + } + if (order.getStatus() != StatusConstants.ORDER_55.value()) {// 已定稿状态 + request.setResponseError("设计稿不是已定稿状态不允许审核"); + return; + } + + // 检查文件是否存在 + Selector attaSel = new Selector(); + attaSel.addMust("designId", order.getDesignId()); + attaSel.addMust("attaModul", FileTypeConstants.FILE_END.value()); + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, attaSel); + if (atta == null) { + request.setResponseError("订单[" + order.getDesignId() + "]印刷文件不存在"); + return; + } + if (Validates.isEmptyBlank(atta.getOssUrl()) || !Validates.isUrl(atta.getOssUrl())) {// 访问地址 为空 或者不是访问地址 + // 3.检查文件是否存在 + File file = new File(atta.getSavePath()); + if (!file.exists() || file.isDirectory()) {// 文件不存在 + request.setResponseError("订单[" + order.getDesignId() + "]印刷文件不存在"); + return; + } + } + if (pushFile) { + Response result = FileTransferUtil.sendFile(atta.getSavePath()); + if ("0".equals(result.getRes())) {// 上传失败 + results.add(order.getOutId() + ":" + result.getMsg()); + continue; + } + } + // 修改订单信息 + Updater updater = new Updater(); + updater.addMust("designId", order.getDesignId()); + updater.addField("status", StatusConstants.ORDER_60.value()); + updater.addField("checker", request.getSessionName()); + updater.addField("checkTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + // 插入日志 + OrderLogDao.saveOrderOperateLog(order.getDesignId(), request.getSessionName(), "印前定稿文件审核通过", + EventConstants.ORDER_11.value()); + + DesTemplateOrder temOrder = ORM.get(ZTable.class).item(DesTemplateOrder.class, order.getDesignId()); + if (temOrder != null) { + // 模板状态改为订单模板80及修改模板为不可编辑相关操作,电子名片除外 + if (order.getTypeId() != 2023207561256L) { + TemplateDao.doTemplateOrderCompleteExec(order.getDesignId(), temOrder.getDesignMediaId()); + } + TemplateScoreDao.doTemplateSaleScore(temOrder.getMediaId(), + TemplateScoreConstants.TEMPLATE_FINAL.value());// 模板销售分计算 + } + + } + if (results.size() > 0) { + request.setResponseError(String.join(",", results)); + } + + } + + /** + * 订单设计审核通过 + * + * @author caohong + * @param request + * @param type 操作类型,初稿或者定稿审核 + * @throws Exception + */ + @AnTransaction + public static void designOrderPass(HttpRequest request) throws Exception { + request.addValidate(new IsNotEmpty("designIds", "请选择订单")); + if (!request.chkValidate()) { + request.setResponseError(request.getAlertMsg()); + return; + } + + String type = request.getParameter("type");// 操作类型,初稿或者定稿审核 + String[] oids = request.getParameterValues("designIds"); + long[] designIds = Arrays.toLongArray(oids); + if (designIds.length == 0) { + request.setResponseError("请选择订单"); + return; + } + + List orderList = ORM.get(ZView.class).list(DesignSelfView.class, + new Selector().addMustInLong("designId", designIds)); + if (orderList.size() == 0) { + request.setResponseError("请选择订单"); + return; + } + + for (DesignSelfView order : orderList) { + if (order.getStatus() < StatusConstants.ORDER_10.value()) { + request.setResponseError("订单[" + order.getDesignId() + "]已被取消"); + return; + } + + int status = StatusConstants.ORDER_50.value(); + String logItem = "设计初稿审核通过"; + // 初稿审核 + if ("draft".equals(type)) { + if (order.getStatus() != StatusConstants.ORDER_40.value()) { + request.setResponseError("订单[" + order.getDesignId() + "]不是初稿待审状态,不允许审核操作"); + return; + } + } + if ("end".equals(type)) { + if (order.getStatus() != StatusConstants.ORDER_52.value()) { + request.setResponseError("订单[" + order.getDesignId() + "]不是定稿待审状态,不允许审核操作"); + return; + } + + status = StatusConstants.ORDER_55.value(); + logItem = "设计定稿审核通过"; + + // 定稿触发设计师积分 奖励 + ScoreDesignerRecordDao.finishDesign(order); + + // 定稿触发设计师佣金 奖励 + boolean finishDesign = VirtualAccountDao.finishDesign(order, order.getDesigner(), + Integer.parseInt(VirtualAccountConstants.TRANSACTION_STATUS_4.value())); + if (!finishDesign) { + request.setResponseError("订单[" + order.getDesignId() + "]定稿审核失败,设计师佣金计算错误"); + return; + } + + // 定稿触发设计师佣金加急费 奖励 + if (order.isUrgent())// 加急 + { + boolean urgentPrice = VirtualAccountDao.finishDesign(order, order.getDesigner(), + Integer.parseInt(VirtualAccountConstants.TRANSACTION_STATUS_1.value())); + if (!urgentPrice) { + request.setResponseError("订单[" + order.getDesignId() + "]定稿审核失败,设计师佣金加急费计算错误"); + return; + } + } + } + + // 修改订单信息 + Updater updater = new Updater(); + updater.addMust("designId", order.getDesignId()); + updater.addField("status", status); + updater.addField("modifyTime", Sqls.nowTimestamp()); + if (status == StatusConstants.ORDER_55.value()) { + updater.addField("designEndTime", Sqls.nowTimestamp()); + } + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 插入日志 + OrderLogDao.saveOrderOperateLog(order.getDesignId(), order.getDesigner(), status, request.getSessionName(), + logItem, EventConstants.ORDER_11.value()); + } + + } + + /** + * [简要描述]:快捷联系人接口 + * + * @param request + * @throws Exception + */ + public static void quickContact(HttpRequest request) throws Exception { + request.addValidate(new IsNotEmpty("designId", "请选择订单")); + if (!request.chkValidate()) { + request.setResponseError(request.getAlertMsg()); + return; + } + + long designId = request.getParameterLong("designId"); + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, new Selector("designId", designId)); + if (order == null) { + request.setResponseError("订单【" + designId + "】不存在"); + return; + } + + HashMapSO attrMap = new HashMapSO(); + attrMap.put("order", order); + + // 获取客服信息 + ZmrOperator createrDesigner = null; + if (1823193185001L == order.getMerchantId()) { + // erp渠道 + String paramGroup = "yangcai.erp"; + String paramKey = "quickContact"; + String url = ZmrParamDao.getString(request.getContext(), paramGroup, paramKey); + HttpGet get = new HttpGet(Urls.add(url, "orderId", Strings.toString(designId))); + get.setConnectTimeout(10);// 10秒 连接 + get.setReadTimeout(30);// 30秒读取 + get.execute(); + String response = get.getResponseText(); + if (get.isResponseSuccess() && Validates.isNotEmptyBlank(response)) { + String tempOperator = Jsons.getString(response, "operator"); + createrDesigner = Jsons.toObject(tempOperator, ZmrOperator.class); + } + } else if (1920862616055L == order.getMerchantId()) { + // 淘印通 + createrDesigner = new ZmrOperator(); + createrDesigner.setOperatorCode("木易"); + createrDesigner.setOperatorName("木易"); + createrDesigner.setOperatorMobile("15874971979"); + createrDesigner.setOperatorWxcode("15874971979"); + } else if (2000922684001L == order.getMerchantId()) { + // 小程序 + createrDesigner = new ZmrOperator(); + createrDesigner.setOperatorCode("崔崔"); + createrDesigner.setOperatorName("崔崔"); + createrDesigner.setOperatorMobile("13786298968"); + createrDesigner.setOperatorWxcode("13786298968"); + } else if (2019491431057L == order.getMerchantId()) { + // 扬彩渠道 + createrDesigner = new ZmrOperator(); + createrDesigner.setOperatorCode("杰克"); + createrDesigner.setOperatorName("杰克"); + createrDesigner.setOperatorMobile("13667371515"); + createrDesigner.setOperatorWxcode("13667371515"); + } + + attrMap.put("createrDesigner", createrDesigner); + + // 设计师信息 + ZmrOperator designOperator = null; + if (Validates.isNotEmpty(order.getDesigner())) { + designOperator = ZmrOperatorDao.getOperator(request, order.getDesigner()); + attrMap.put("designOperator", designOperator); + } + + String resultHtml = ZmlContexts.parseZmlPath(request, "/zview/order/presenter/quickContact.zml", attrMap); + + Map jsonMap = new HashMap(); + jsonMap.putAll(attrMap.instance()); + jsonMap.put("resultHtml", resultHtml); + + request.setResponseResult(DesignUtil.removeBlank(Jsons.toString(jsonMap))); + } + + /** + * + * 滞留单自行处理 + * + * @author gjx + * @param request + */ + public static void doSelfRetentDeal(HttpRequest request) throws Exception { + long designId = request.getParameterLong("designId", -1); + if (designId == -1) { + request.setResponseError("订单不存在"); + return; + } + RetentionDetails retent = new RetentionDetails(); + retent.setDesignId(designId); + retent.setIsRetentDeal(1); + retent.setRetentDealTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(retent); + } + + /** + * + * 是否自行处理过判断 + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doSelfRetentDealBefore(HttpRequest request) throws Exception { + long designId = request.getParameterLong("designId"); + RetentionDetails retentionDetails = ORM.get(ZTable.class).item(RetentionDetails.class, + new Selector().addMust("designId", designId)); + if (retentionDetails != null) { + if (retentionDetails.getIsRetentDeal() == 1) { + request.setResponseError("不可二次申请处理"); + return; + } + } + } + + /** + * + * 滞留单处理弹框查询 + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doRetentDealDialog(HttpRequest request) throws Exception { + long designId = request.getParameterLong("designId"); + DesignOrder designOrder = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector().addMust("designId", designId)); + if (designOrder == null) { + request.setResponseError("订单不存在"); + return; + } + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + int retentDealMinute = DateTimes.compareMinute(simple.format(new Date()), + simple.format(designOrder.getCreateTime())); + HashMapSO hashMapSO = new HashMapSO(); + hashMapSO.put("order", designOrder); + hashMapSO.put("retentDealTime", CalculationUtil.dateTimeTran(retentDealMinute)); + String resultHtml = ZmlContexts.parseZmlPath(request, "/zview/order/retentionDealOrderDetails.zml", hashMapSO); + + Map jsonMap = new HashMap(); + jsonMap.putAll(hashMapSO.instance()); + jsonMap.put("resultHtml", resultHtml); + + request.setResponseResult(DesignUtil.removeBlank(Jsons.toString(jsonMap))); + } + + /** + * + * 滞留单处理 + * + * @author gjx + * @throws Exception + */ + @AnTransaction + public static void doRetentionDealTrigger(HttpRequest request) throws Exception { + long designId = request.getParameterLong("designId"); + int retentDealWay = request.getParameterInt("retentDealWay", -1); + int retentFollowFlag = request.getParameterInt("retentFollowFlag", -1); + String retentRemark = request.getParameter("retentRemark"); + if (retentDealWay == -1) { + request.setResponseError("请选择滞留单处理方式"); + return; + } + if (retentFollowFlag == -1) { + request.setResponseError("请选择设计师跟进情况"); + return; + } + if (retentRemark == null || "".equals(retentRemark)) { + request.setResponseError("滞留单处理备注不能为空"); + return; + } + DesignOrder designOrder = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector().addMust("designId", designId)); + if (designOrder == null) { + request.setResponseError("订单号不存在"); + return; + } + RetentionDetails reDetails = ORM.get(ZTable.class).item(RetentionDetails.class, + new Selector().addMust("designId", designId)); + if (reDetails == null) { + RetentionDetails retention = new RetentionDetails(); + retention.setDesignId(designId); + retention.setRetentDealName(request.getSessionName()); + retention.setRetentDealWay(retentDealWay); + retention.setRetentFollowFlag(retentFollowFlag); + retention.setRetentRemark(retentRemark); + retention.setRetentionEndTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(retention); + } else { + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("retentDealName", request.getSessionName()); + updater.addField("retentDealWay", retentDealWay); + updater.addField("retentFollowFlag", retentFollowFlag); + updater.addField("retentRemark", retentRemark); + updater.addField("retentionEndTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(RetentionDetails.class, updater); + } + Updater up = new Updater(); + up.addMust("designId", designId); + up.addField("status", StatusConstants.ORDER_F130.value()); + + ORM.get(ZTable.class).update(DesignOrder.class, up); + } + + /** + * + * 查看滞留单处理结果 + * + * @author gjx + */ + public static void doSelectRetentDeal(HttpRequest request) throws Exception { + long designId = request.getParameterLong("designId"); + DesignOrdRetentView designOrder = ORM.get(ZView.class).item(DesignOrdRetentView.class, + new Selector().addMust("designId", designId)); + if (designOrder == null) { + request.setResponseError("订单不存在"); + return; + } + SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + int retentDealMinute = DateTimes.compareMinute(simple.format(designOrder.getRetentionEndTime()), + simple.format(designOrder.getCreateTime())); + HashMapSO hashMapSO = new HashMapSO(); + hashMapSO.put("order", designOrder); + hashMapSO.put("retentDealTime", CalculationUtil.dateTimeTran(retentDealMinute)); + String resultHtml = ZmlContexts.parseZmlPath(request, "/zview/order/retentionFinishOrderDetails.zml", + hashMapSO); + + Map jsonMap = new HashMap(); + jsonMap.putAll(hashMapSO.instance()); + jsonMap.put("resultHtml", resultHtml); + + request.setResponseResult(DesignUtil.removeBlank(Jsons.toString(jsonMap))); + } + + /** + * + * 检测订单是否存在 + * + * @author jiangbin + * @param request + * @throws Exception + */ + public static void checkOrderExist(HttpRequest request) throws Exception { + long designId = request.getParameterLong("designId"); + if (designId <= 0) { + request.setResponseError("订单号不正确!请确认信息"); + return; + } + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", designId)); + if (Validates.isEmpty(order)) { + request.setResponseError("订单不存在"); + return; + } + } + + /** + * + * 添加售后留言单(ERP) + * + * @author jiangbin + * @param request + * @throws Exception + */ + public static void addAfterMessage(HttpRequest request) throws Exception { + long designId = request.getParameterLong("designId"); + String creater = request.getParameter("creater"); + String createTime = request.getParameter("createTime"); + String complainFlag = request.getParameter("complainFlag"); + String note = request.getParameter("note"); + if (designId <= 0) { + request.setResponseError("订单号不正确!请确认信息"); + return; + } + ErpRmiService.doAddAfterMessage(designId, creater, createTime, complainFlag, note); + request.setResponseResult(Jsons.toString("添加成功!")); + } + + /** + * 订单列表获取电子名片二维码[仅用于秒绘智能名片]
            + * + * @param request + * @throws Exception + * @return void + * @author HuangZhiGao + * @date 2020年9月29日 + */ + public static void getDzmpQrcode(HttpRequest request) throws Exception { + // 判断订单是否存在 + long designId = request.getParameterLong("designId"); + if (designId <= 0) { + request.setResponseError("订单号不正确!请确认信息"); + return; + } + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", designId)); + if (Validates.isEmpty(order)) { + request.setResponseError("订单不存在"); + return; + } + + // 判断订单状态是否为[设计完成] + if (order.getStatus() != StatusConstants.ORDER_70.value()) { + request.setResponseError("请选择设计完成的订单"); + return; + } + + // 判断订单设计类型是否为[秒绘智能名片] + if (order.getTypeId() != 2023207561256L) { + request.setResponseError("请选择设计类型为[秒绘智能名片]的订单"); + return; + } + + String fileUrl = ""; + Selector selector = new Selector(); + selector.addMust("designId", designId); + selector.addMust("attaModul", FileTypeConstants.FILE_END.value()); + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, selector); + if (atta != null && "png".equals(atta.getFileType())) { + fileUrl = atta.getOssUrl(); + } else { + fileUrl = "pdf"; + } + + request.setResponseResult(fileUrl); + } + + /** + * + * [简要描述]:设计单价计算
            + * [详细描述]:
            + * + * @author hc + * @param request + * @param designId 订单ID + * @throws Exception + */ + public static void designPriceCalculate(HttpRequest request, long designId) throws Exception { + + DesignSelfView deOrder = ORM.get(ZView.class).item(DesignSelfView.class, + new Selector().addMust("designId", designId)); + if (Validates.isEmpty(deOrder)) { + request.setResponseError("该订单不存在!"); + return; + } + // 排除标准自来稿 + if (deOrder.getDraftType() == DraftConstants.DRAFT_STANDARD.value()) { + request.setResponseError("标准自来稿不支持重置单价!"); + return; + } + if (deOrder.getStatus() >= StatusConstants.ORDER_55.value()) { + request.setResponseError("定稿订单不可修改设计单价!"); + return; + } + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("designPrice", StatDao.calculateOrderPerformance(deOrder)); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 记录日志 + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "重算设计单价", EventConstants.ORDER_41.value()); + DesignOrderMeritsDao.saveDesignOrderMerits(designId, "2", "", "", request.getSessionName(), + deOrder.getDesigner(), deOrder.getTypeId(), deOrder.getStatus(), deOrder.getOrderText(), + deOrder.getDesignPrice(), StatDao.calculateOrderPerformance(deOrder)); + } + + public static void returnTk(HttpRequest request, long designId) throws Exception { + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", designId)); + if (order == null) { + request.setResponseError("该订单不存在,请重新选择"); + return; + } + + if (order.getStatus() >= StatusConstants.ORDER_10.value()) { + request.setResponseError("该订单不是已取消状态"); + return; + } + if ("".equals(order.getReturnMsg()) || null == order.getReturnMsg()) { + request.setResponseError("该订单不是淘宝自动同步退款订单,未记录之前状态"); + return; + } + Updater exUpdater = new Updater(); + exUpdater.addMust("designId", designId); + // exUpdater.addField("designBeginTime", Sqls.nowTimestamp()); + exUpdater.addField("status", order.getReturnAfterStatus()); + ORM.get(ZTable.class).update(DesignOrder.class, exUpdater); + + // 录入操作日志 + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "管理员重新启用订单", order.getReturnAfterStatus()); + } + + public static void designtype(HttpRequest request) throws Exception { + String designId = request.getParameter("designId"); + String content = URLDecoder.decode(request.getParameter("content"), "UTF-8"); + DesignTypeContent order = ORM.get(ZTable.class).item(DesignTypeContent.class, + new Selector().addMust("typeId", Long.valueOf(designId))); + if (order == null) { + DesignTypeContent des = new DesignTypeContent(); + des.setContent(content); + des.setTypeId(Long.valueOf(designId)); + ORM.get(ZTable.class).insert(des); + + } else { + Updater exUpdater = new Updater(); + exUpdater.addMust("typeId", Long.valueOf(designId)); + exUpdater.addField("content", content); + ORM.get(ZTable.class).update(DesignTypeContent.class, exUpdater); + } + + } + + public static void designtypeImge(HttpRequest request) throws Exception { + String designId = request.getParameter("designId"); + String imgBase64Str = URLDecoder.decode(request.getParameter("content"), "UTF-8"); + + String rootDir = Strings.trimRight(request.getContext().getAttributeString("upload.rootDir"), "/"); + + String fileName = request.getSessionName() + "-" + DateTimes.getDateTime14String() + ".png"; + String checkPath = rootDir + "/" + DateTimes.getDateTime8String() + "/" + new Date().getTime() + "定稿规范图片"; + String path = checkPath + "/" + fileName; + Files.mkDirectory(checkPath); + + // 对传过来的图片解码并且写入文件 + imgBase64Str = imgBase64Str.replace("data:image/png;base64,", ""); + byte[] imageBytes = Base64.getDecoder().decode(imgBase64Str); + File file = new File(path); + ImageOutputStream out = new FileImageOutputStream(file); + out.write(imageBytes); + out.flush(); + out.close(); + // 图片上传OSS处理 + String ossUrl = OssFileDao.uploadFile(file, OssFileDao.getUploadFileKey(new Date().getTime())); + + request.setResponseResult(ossUrl); + + } + + @AnTransaction + public static void doChangeStatus(HttpRequest request) throws Exception { + request.addValidate(new IsNotEmpty("designId", "请选择订单")); + if (!request.chkValidate()) { + request.setResponseError(request.getAlertMsg()); + return; + } + + long designId = request.getParameterLong("designId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (order == null) { + request.setResponseError("订单【" + designId + "】不存在!"); + return; + } + int selectedValue = request.getParameterInt("selectedValue"); + if (selectedValue == 0) { + request.setResponseError("选择要修改的状态"); + return; + } +// if (order.getStatus() > StatusConstants.ORDER_10.value() +// && order.getStatus() < StatusConstants.ORDER_70.value()) { +// +// } + Updater exUpdater = new Updater(); + exUpdater.addMust("designId", designId); + if (selectedValue == 55) { + exUpdater.addField("designEndTime", Sqls.nowTimestamp()); + } + if (selectedValue == 70) { + exUpdater.addField("checkTime", Sqls.nowTimestamp()); + } + if (selectedValue == -110) { + exUpdater.addField("cancelTime", Sqls.nowTimestamp()); + } + exUpdater.addMust("designId", designId); + exUpdater.addField("status", selectedValue); + ORM.get(ZTable.class).update(DesignOrder.class, exUpdater); + + // 录入操作日志 + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "管理员修改订单状态", selectedValue); + + } + + public static void designSroce(HttpRequest request, String designId) throws Exception { + DesignerCourse order = ORM.get(ZTable.class).item(DesignerCourse.class, new Selector("designer", designId)); + if (order != null) { + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_100.value())); + scoreDesignerRecordDetail.setOperatorCode(order.getDesigner()); + scoreDesignerRecordDetail.setCreateOperator(request.getSessionUser(ZmrSessionUser.class).getOperatorCode()); + scoreDesignerRecordDetail.setRemark("增加接单积分"); + scoreDesignerRecordDetail.setScore(30); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + + } + + } + + public static void mobileDelete(HttpRequest request, String designer) throws Exception { + request.addValidate(new IsNotEmpty("designer", "请选择用户")); + Updater exUpdater = new Updater(); + exUpdater.addMust("operatorCode", designer); + exUpdater.addField("operatorMobile", null); + ORM.get(ZTable.class).update(ZmrOperator.class, exUpdater); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/QcOrderPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/QcOrderPresenter.java new file mode 100644 index 0000000..a6fc69b --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/QcOrderPresenter.java @@ -0,0 +1,266 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.io.File; +import java.sql.SQLException; + +import javax.imageio.stream.FileImageOutputStream; +import javax.imageio.stream.ImageOutputStream; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.codes.Base64Decoder; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.qc.QcApplyScore; +import com.zhiqim.yangcai.design.dbo.qc.QcAwardedType; +import com.zhiqim.yangcai.design.dbo.qc.QcParameter; +import com.zhiqim.yangcai.design.dbo.qc.QcRecord; + +/** + * 订单质检相关 + * + * @version v1.0.0 @author liuhu 2019-1-25 新建与整理 + */ +@AnAlias("QcOrderPresenter") +@AnIntercept("chkZmrLogin") +public class QcOrderPresenter +{ + /** + * 质检违规判定 + * + * @param request + * @throws Exception + */ + public static void saveQcJudge(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + long orgId = request.getParameterLong("orgId"); + String designer = request.getParameter("designer"); + String content = request.getParameter("content"); + String description = request.getParameter("description"); + QcParameter parameter = ORM.get(ZTable.class).item(QcParameter.class, new Selector("content", content)); + if (parameter == null) + { + request.setResponseError("请先设置质检参数"); + return; + } + + String rootDir = Strings.trimRight(request.getContext().getAttributeString("upload.rootDir"), "/"); + + String fileName = designId + "-" + "qcJudgeFile" + ".png"; + String checkPath = rootDir + "/" + DateTimes.getDateTime8String() + "/" + "质检违规凭证"; + String path = checkPath + "/" + fileName; + Files.mkDirectory(checkPath); + + // 对传过来的图片解码并且写入文件 + String imgBase64Str = request.getParameter("data"); + imgBase64Str = imgBase64Str.replace("data:image/pngbase64,", ""); + byte[] imageBytes = Base64Decoder.decode(imgBase64Str.getBytes("utf-8")); + File file = new File(path); + ImageOutputStream out = new FileImageOutputStream(file); + out.write(imageBytes); + out.flush(); + out.close(); + + // 插入订单附属表 + DesignAtta atta = new DesignAtta(); + atta.setAttaId(Ids.longId13()); + atta.setAttaModul(FileTypeConstants.FILE_QC_JUDGE.value()); + atta.setDesignId(designId); + atta.setFileName(fileName); + atta.setFileType("png"); + atta.setSavePath(path); + atta.setUploadTime(Sqls.nowTimestamp()); + atta.setOperatorCode(request.getSessionName()); + ORM.get(ZTable.class).insert(atta); + + QcRecord record = new QcRecord(); + record.setDesignId(designId); + record.setDesigner(designer); + record.setOrgId(orgId); + record.setReason(content); + record.setDescription(description); + record.setScore(parameter.getScore()); + record.setImgPath(path); + record.setOperatorCode(request.getSessionName()); + record.setQcTime(Sqls.nowTimestamp()); + record.setQcFlag(2); + ORM.get(ZTable.class).insert(record); + + // 将订单标记为质检违规 + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("qcFlag", 2); + updater.addField("qcTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + } + + /** + * 标识订单为质检正常 + * + * @param request + * @throws ORMException + * @throws SQLException + */ + public static void updateQcFlag(HttpRequest request) throws ORMException, SQLException + { + long orgId = request.getParameterLong("orgId"); + long designId = request.getParameterLong("designId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + } + + QcRecord record = new QcRecord(); + record.setDesignId(designId); + record.setDesigner(order.getDesigner()); + record.setOrgId(orgId); + record.setOperatorCode(request.getSessionName()); + record.setQcTime(Sqls.nowTimestamp()); + record.setQcFlag(1); + ORM.get(ZTable.class).insert(record); + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("qcFlag", 1); + updater.addField("qcTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + } + + /** + * 质检加分申请 + * + * @param request + * @throws Exception + */ + public static void doApplyScore(HttpRequest request) throws Exception + { + String designer = request.getParameter("designer"); + + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, designer); + if (operator == null) + { + request.returnCloseWindow("操作员不存在"); + return; + } + + String content = request.getParameter("content"); + + Long qcTypeId = request.getParameterLong("qcTypeId"); + + String rootDir = Strings.trimRight(request.getContext().getAttributeString("upload.rootDir"), "/"); + + String fileName = designer + "-" + DateTimes.getDateTime14String() + ".png"; + String checkPath = rootDir + "/" + DateTimes.getDateTime8String() + "/" + "质检加分凭证"; + String path = checkPath + "/" + fileName; + Files.mkDirectory(checkPath); + + // 对传过来的图片解码并且写入文件 + String imgBase64Str = request.getParameter("data"); + imgBase64Str = imgBase64Str.replace("data:image/pngbase64,", ""); + byte[] imageBytes = Base64Decoder.decode(imgBase64Str.getBytes("utf-8")); + File file = new File(path); + ImageOutputStream out = new FileImageOutputStream(file); + out.write(imageBytes); + out.flush(); + out.close(); + + // 插入订单附属表 + DesignAtta atta = new DesignAtta(); + atta.setAttaId(Ids.longId13()); + atta.setAttaModul(FileTypeConstants.FILE_QC_APPLY.value()); + atta.setDesignId(0); + atta.setFileName(fileName); + atta.setFileType("png"); + atta.setSavePath(path); + atta.setUploadTime(Sqls.nowTimestamp()); + atta.setOperatorCode(request.getSessionName()); + ORM.get(ZTable.class).insert(atta); + + QcApplyScore apply = new QcApplyScore(); + + // 图片显示时可以直接拿applyId去查订单附属表 + apply.setApplyId(atta.getAttaId()); + apply.setDesigner(designer); + apply.setOrgId(operator.getOrgId()); + apply.setApplyReason(content); + apply.setDesigner(designer); + apply.setApplyImgPath(path); + apply.setApplyFlag(0); + apply.setApplyTime(Sqls.nowTimestamp()); + apply.setQcTypeId(qcTypeId); + ORM.get(ZTable.class).insert(apply); + } + + /** + * 申请加分通过 + * + * @param request + * @throws ORMException + * @throws SQLException + */ + public static void doApplyPass(HttpRequest request) throws ORMException, SQLException + { + long applyId = request.getParameterLong("applyId"); + long qcTypeId = request.getParameterLong("qcTypeId"); + QcApplyScore qcApplyScore = ORM.get(ZTable.class).item(QcApplyScore.class, new Selector().addMust("applyId", applyId)); + Updater updater = new Updater(); + if (qcApplyScore.getQcTypeId() != 0L) + { + QcAwardedType qcAwardedType = ORM.get(ZTable.class).item(QcAwardedType.class, new Selector().addMust("qcTypeId", qcTypeId)); + updater.addMust("applyId", applyId); + updater.addField("applyFlag", 1); + updater.addField("score", qcAwardedType.getQcScore()); + updater.addField("qcAwardedAuditor", request.getSessionName()); + updater.addField("qcAwardedAuditorTime", Sqls.nowTimestamp()); + } + else + { + updater.addMust("applyId", applyId); + updater.addField("applyFlag", 1); + updater.addField("score", 0.5); + } + ORM.get(ZTable.class).update(QcApplyScore.class, updater); + } + + public static void docancelAwarded(HttpRequest request) throws Exception + { + long applyId = request.getParameterLong("applyId"); + ORM.get(ZTable.class).delete(QcApplyScore.class, applyId); + } + + /** + * 申请加分打回 + * + * @param request + * @throws ORMException + * @throws SQLException + */ + public static void doApplyBack(HttpRequest request) throws ORMException, SQLException + { + long applyId = request.getParameterLong("applyId"); + String desc = request.getParameter("desc"); + + Updater updater = new Updater(); + updater.addMust("applyId", applyId); + updater.addField("applyFlag", 2); + updater.addField("applyBackReason", desc); + ORM.get(ZTable.class).update(QcApplyScore.class, updater); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/QuestionsFilePresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/QuestionsFilePresenter.java new file mode 100644 index 0000000..7d42397 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/QuestionsFilePresenter.java @@ -0,0 +1,195 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.uploadlarge.dbo.UpllFile; + +import com.zhiqim.yangcai.design.dbo.order.ConfigQuestions; +import com.zhiqim.yangcai.design.dbo.order.QuestionsAtta; + +/** + * + * [简要描述]:考试题文件处理
            + * + * @version 1.0 @author hc 2021年5月25日 新建与整理 + */ +@AnAlias("QuestionsFilePresenter") +@AnIntercept("chkZmrLogin") +public class QuestionsFilePresenter +{ + + /** + * + * [简要描述]:订单素材展示
            + * [详细描述]:
            + * + * @author hc + * @param request + * @throws Exception + */ + public static void showMaterialFileList(HttpRequest request) throws Exception + { + long questionsId = request.getParameterLong("questionsId"); + if (questionsId == -1) + { + request.setResponseError("订单【" + questionsId + "】不存在"); + return; + } + + ConfigQuestions order = ORM.get(ZTable.class).item(ConfigQuestions.class, new Selector("questionsId", questionsId)); + if (order == null) + { + request.setResponseError("订单【" + questionsId + "】不存在"); + return; + } + + Selector sel = new Selector(); + sel.addMust("questionsId", questionsId); + sel.addMust("attaModul", "MaterialFile"); + List attaList = ORM.get(ZTable.class).list(QuestionsAtta.class, sel); + + Map jsonMap = new HashMap<>(); + jsonMap.put("attaList", attaList); + request.setResponseResult(Jsons.toString(jsonMap)); + } + + /** + * + * [简要描述]:上传考试订单文件
            + * [详细描述]:
            + * + * @author hc + * @param request + * @param questionsId + * @param fileId + * @param fileType + * @throws Exception + */ + public static void uploadQuestionsFile(HttpRequest request, long questionsId, String fileId, String fileType) throws Exception + { + UpllFile file = ORM.get(ZTable.class).item(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + String fileName = file.getFileName(); + boolean checkFileName = QuestionsFilePresenter.doCheckFileName(request, fileName, fileType); + + if (!checkFileName) + { + request.setResponseError("请上传PDF文件!"); + return; + } + + File saveFile = new File(file.getFilePath()); + if (!saveFile.isFile()) + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + request.setResponseError("未找到上传的文件,请重新上传"); + return; + } + + if (questionsId < 0) + { + request.setResponseError("考试订单未找到,请重新上传"); + return; + } + + // 插入考试订单附属表 + QuestionsAtta atta = new QuestionsAtta(); + atta.setQuestionsId(questionsId); + atta.setAttaId(Ids.longId()); + atta.setAttaModul(fileType); + atta.setFileName(file.getFileName()); + atta.setFileType(file.getFileExt()); + atta.setFileSize(file.getFileLength()); + atta.setSavePath(file.getFilePath()); + atta.setFileUrl(file.getFileUrl()); + atta.setOperatorCode(request.getSessionName()); + atta.setUploadTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(atta); + + // 页面数据展示 + Selector sel = new Selector(); + sel.addMust("questionsId", questionsId); + sel.addMust("attaModul", fileType); + List attaList = ORM.get(ZTable.class).list(QuestionsAtta.class, sel); + + Map jsonMap = new HashMap(); + jsonMap.put("attaList", attaList); + + request.setResponseResult(Jsons.toString(jsonMap)); + + } + + /** + * 删除文件 + * + * @param str + * @return + * @throws Exception + */ + public static void deleteMaterialFile(HttpRequest request, String strs) throws Exception + { + long[] attaidArr = Arrays.toLongArray(strs); + if (attaidArr.length <= 0) + { + request.setResponseError("删除文件数据不存在"); + return; + } + + List attaList = ORM.get(ZTable.class).list(QuestionsAtta.class, new Selector().addMustInLong("attaId", attaidArr)); + for (QuestionsAtta atta : attaList) + { + File file = new File(atta.getSavePath()); + if (file.exists()) + { + Files.deleteFile(atta.getSavePath()); + } + + if (Validates.isNotEmpty(atta.getFileid())) + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", atta.getFileid()).addReplace("id", null)); + } + + ORM.get(ZTable.class).delete(QuestionsAtta.class, atta.getAttaId()); + } + + request.setResponseResult("删除成功"); + } + + /** + * 文件命名检测 + * + * @param request + * @param questionsId + * @param fileType + * @param fileName + * @throws Exception + */ + public static boolean doCheckFileName(HttpRequest request, String fileName, String fileType) throws Exception + { + + if (fileType.equals("EndFile")) + { + String fileNameTyep = fileName.substring(fileName.lastIndexOf(".") + 1); + if (!fileNameTyep.toLowerCase().equals("pdf")) + { + request.setResponseError("请上传PDF文件!"); + return false; + } + } + return true; + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ReceiveMerPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ReceiveMerPresenter.java new file mode 100644 index 0000000..8aa507c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ReceiveMerPresenter.java @@ -0,0 +1,53 @@ +package com.zhiqim.yangcai.design.presenter; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; + +/** + * TODO:订单分拣相关 + * + * @version v1.0.0 @author longguizhi 2018-6-6 新建与整理 + */ +@AnAlias("ReceiveMerPresenter") +@AnIntercept("chkZmrLogin") +public class ReceiveMerPresenter +{ + public static void doQueryPolicy(HttpRequest request) throws Exception + { + // boolean enableType = request.getParameterBoolean("enableType", false); + // boolean enablePolicy = request.getParameterBoolean("enablePolicy", false); + // long[] prdTypeIds = Arrays.toLongArray(request.getParameter("prdTypeIds")); + // Map> dataMap = new HashMap>(); + // List typeList = new ArrayList(); + // if (prdTypeIds.length > 0) + // { + // Selector selector = new Selector().addMustInLong("prdTypeId", + // prdTypeIds).addOrderbyAsc("prdTypeId"); + // if (enableType) + // selector.addMust("prdTypeStatus", 0); + // + // typeList = ORM.get(ZTable.class).list(PrdType.class, selector); + // for (PrdType type : typeList) + // { + // long[] policyIds = Arrays.toLongArray(type.getPrdPolicyIds()); + // List tl = new ArrayList(); + // if (policyIds.length > 0) + // { + // Selector selector2 = new Selector(); + // selector2.addMustInLong("policyId", policyIds); + // if (enablePolicy) + // selector.addMust("policyStatus", 0); + // + // tl = ORM.get(ZTable.class).list(PrdPolicy.class, selector2); + // } + // + // dataMap.put(type.getPrdTypeId(), tl); + // } + // } + // Map jsonMap = new HashMap(); + // jsonMap.put("dataMap", dataMap); + // jsonMap.put("typeList", typeList); + // request.setResponseResult(Jsons.toString(jsonMap)); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ScorePresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ScorePresenter.java new file mode 100644 index 0000000..f103f26 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/ScorePresenter.java @@ -0,0 +1,75 @@ +package com.zhiqim.yangcai.design.presenter; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.score.DesScoreParam; +import com.zhiqim.yangcai.design.dbo.score.ScoreType; + +/** + * + * 评分Presenter + * + * @version v1.0.0 @author Deng 2018-3-13 新建与整理 + */ +@AnAlias("ScorePresenter") +@AnIntercept("chkZmrLogin") +public class ScorePresenter +{ + /** + * 修改评分参数值 + * + * @param request + * @throws Exception + */ + public static void doScoreParamUpdate(HttpRequest request) throws Exception + { + long paramId = request.getParameterLong("paramId"); + int paramValue = request.getParameterInt("paramValue"); + + Updater update = new Updater(); + update.addMust("paramId", paramId); + update.addField("paramValue", paramValue); + + ORM.get(ZTable.class).update(DesScoreParam.class, update); + } + + /** + * 删除评分参数 + * + * @param request + * @throws Exception + */ + public static void doScoreParamDelete(HttpRequest request) throws Exception + { + long paramId = request.getParameterLong("paramId"); + + ORM.get(ZTable.class).delete(DesScoreParam.class, paramId); + } + + /** + * 修改评分细则配置 + * + * @param request + * @throws Exception + */ + public static void doScoreTypeUpdate(HttpRequest request) throws Exception + { + long typeId = request.getParameterLong("typeId"); + int value = request.getParameterInt("value"); + int state = request.getParameterInt("state"); + + Updater update = new Updater(); + update.addMust("typeId", typeId); + update.addField("value", value); + update.addField("state", state); + update.addField("modifyTime", Sqls.nowTimestamp()); + update.addField("lastOperatorCode", request.getSessionName()); + ORM.get(ZTable.class).update(ScoreType.class, update); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/SearchPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/SearchPresenter.java new file mode 100644 index 0000000..f084e01 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/SearchPresenter.java @@ -0,0 +1,71 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.presenter; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.YqArticle; + +@AnAlias("SearchPresenter") +public class SearchPresenter +{ + /** + * 根据关键词查询文章标题列表 + * + * @param request 请求 + * @param keyword 关键词 + * @return 数组的JSON字符串 + * @throws Exception 异常 + */ + public static String search(HttpRequest request, String keyword) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = 10; + + if (Validates.isEmptyBlank(keyword)) + { + return "[]"; + } + String[] word = keyword.split(" "); + Selector selector = new Selector("articleTitle"); + for (int i = 0; i < word.length; i++) + { + if (Validates.isEmptyBlank(word[i])) + { + continue; + } + selector.addMaybeLike("articleTitle", word[i]); + } + selector.addOrderbyDesc("articleId"); + selector.addMust("articleStatus", 0); + + PageResult articlePage = ORM.get(ZTable.class).page(YqArticle.class, page, pageSize, selector); + + List titleList = new ArrayList<>(); + for (YqArticle item : articlePage.list()) + { + titleList.add(item.getArticleTitle()); + } + + return Jsons.toString(titleList); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/StatPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/StatPresenter.java new file mode 100644 index 0000000..8170ff7 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/StatPresenter.java @@ -0,0 +1,863 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OperatorDao; +import com.zhiqim.yangcai.design.dbo.order.DesignOrdLogView; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignOrderMerits; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; +import com.zhiqim.yangcai.design.dbo.qc.QcOrderView; +import com.zhiqim.yangcai.design.model.DesignOrderMeritsModel; + +/** + * 统计相关处理方法 + * + * @version v1.0.0 @author zzy 2017-9-7 新建与整理 + */ +@AnAlias("StatPresenter") +@AnIntercept("chkZmrLogin") +public class StatPresenter +{ + private static final Log log = LogFactory.getLog(StatPresenter.class); + + /** + * 初稿订单统计查询明细 + * + * @param request + * @throws Exception + */ + public static void doQueryDraftOrderStatInfo(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 20); + + String beginDate = request.getParameter("beginDate"); + String endDate = request.getParameter("endDate"); + String designer = request.getParameter("designer"); + int querys = request.getParameterInt("querys"); + PageResult pageResult = PageBuilder.newResult(pageSize); + if (querys == 1) + { + Selector selector = new Selector(); + selector.addMaybeThenGE("status", StatusConstants.ORDER_50.value()); + selector.addMaybeThenGE("designDraftTime", Sqls.toTimestamp(beginDate, "00:00:00")); + selector.addMaybeThenLE("designDraftTime", Sqls.toTimestamp(endDate, "23:59:59")); + // selector.addMustIn("draftType", DraftConstants.DRAFT_TEMPLATE.value(), + // DraftConstants.DRAFT_COMMON_DESIGN.value() + // DraftConstants.DRAFT_PAGE_DESIGN.value()); + selector.addMaybe("designer", designer); + selector.addOrderbyDesc("designDraftTime"); + + + + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) {//是负责人,就只能查看负责组织下面的数据 + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + OperatorDao.getOrgSelector(request, selector); + pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + } + + MapSO attrMap = new HashMapSO(); + attrMap.put("result", pageResult); + attrMap.put("beginDate", beginDate); + attrMap.put("endDate", endDate); + attrMap.put("designer", designer); + attrMap.put("page", page); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/stat/design/inner/draftOrderConvertInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * + * [简要描述]: 设计师绩效订单详情
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doQueryCompleteOrderInfo(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 12); + String beginDate = request.getParameter("beginDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getLastMonthDay()); + String designer = request.getParameter("designer"); + boolean console = request.getParameterBoolean("console", false); + Long orgIdR = request.getParameterLong("orgId", 0L); + + + String firstMonthDay = DateTimes.getFirstMonthDay(); + if (console && ((firstMonthDay.compareTo(beginDate) > 0 && firstMonthDay.compareTo(endDate) <= 0) + || (firstMonthDay.compareTo(endDate) > 0 && firstMonthDay.compareTo(beginDate) <= 0))) + { + request.setResponseError("不支持当月与往月跨月查询"); + return; + } + + PageResult pageResult = PageBuilder.newResult(0); + if (request.getParameterInt("query") == 1) + { + Selector selector = new Selector(); + selector.addMustThenGE("designEndTime", Sqls.toTimestampBegin(beginDate)); + selector.addMustThenLE("designEndTime", Sqls.toTimestampEnd(endDate)); + //我要只能看到自己负责的组织的数据 + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) {//是负责人,就只能查看负责组织下面的数据 + Selector selectorOp = new Selector(); + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selectorOp.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + List zmrOperatorList = ORM.get(ZTable.class).list(ZmrOperator.class, selectorOp);//查看该组织下面所有成员 + String[] operatorCodes = new String[zmrOperatorList.size()]; + for (int i = 0; i < zmrOperatorList.size(); i++) + { + operatorCodes[i] = zmrOperatorList.get(i).getOperatorCode(); + } + selector.addMustIn("designer", operatorCodes); + }else { + selector.addMaybe("designer", designer); + } + if(orgIdR != 0L) { + selector.addMust("orgId", orgIdR); + } + + selector.addMustThenGE("status", StatusConstants.ORDER_55.value()); + selector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + selector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + selector.addOrderbyDesc("designEndTime"); + pageResult = ORM.get(ZView.class).page(DesignSelfView.class, page, pageSize, selector); + } + + MapSO attrMap = new HashMapSO(); + attrMap.put("result", pageResult); + attrMap.put("designerPerformanceBeginDate", beginDate); + attrMap.put("designerPerformanceEndDate", endDate); + attrMap.put("designer", designer); + attrMap.put("console", console); + attrMap.put("page", page); + String ret = ZmlContexts.parseZmlPath(request, "/zview/stat/design/inner/designerCompleteOrderInfo.zml", attrMap); + request.setResponseResult(ret); + } + + + /** + * + * [简要描述]: 设计师绩效修改订单详情
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doQueryOrderMeritsInfo(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 12); + String beginDate = request.getParameter("beginDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getLastMonthDay()); + String designer = request.getParameter("designer"); + boolean console = request.getParameterBoolean("console", false); + + String firstMonthDay = DateTimes.getFirstMonthDay(); + if (console && ((firstMonthDay.compareTo(beginDate) > 0 && firstMonthDay.compareTo(endDate) <= 0) + || (firstMonthDay.compareTo(endDate) > 0 && firstMonthDay.compareTo(beginDate) <= 0))) + { + request.setResponseError("不支持当月与往月跨月查询"); + return; + } + + PageResult pageResult = PageBuilder.newResult(0); + if (request.getParameterInt("query") == 1) + { + Selector selector = new Selector(); + selector.addMustThenGE("addTime", Sqls.toTimestampBegin(beginDate)); + selector.addMustThenLE("addTime", Sqls.toTimestampEnd(endDate)); + //我要只能看到自己负责的组织的数据 + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + + if(zmrOrgList.size()>0) {//是负责人,就只能查看负责组织下面的数据 + Selector selectorOp = new Selector(); + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selectorOp.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + List zmrOperatorList = ORM.get(ZTable.class).list(ZmrOperator.class, selectorOp);//查看该组织下面所有成员 + String[] operatorCodes = new String[zmrOperatorList.size()]; + for (int i = 0; i < zmrOperatorList.size(); i++) + { + operatorCodes[i] = zmrOperatorList.get(i).getOperatorCode(); + } + selector.addMustIn("designer", operatorCodes); + } else { + selector.addMaybe("designer", designer); + } + selector.addOrderbyDesc("addTime"); + pageResult = ORM.get(ZTable.class).page(DesignOrderMerits.class, page, pageSize, selector); + } + + MapSO attrMap = new HashMapSO(); + attrMap.put("result", pageResult); + attrMap.put("designerPerformanceBeginDate", beginDate); + attrMap.put("designerPerformanceEndDate", endDate); + attrMap.put("designer", designer); + attrMap.put("console", console); + attrMap.put("page", page); + String ret = ZmlContexts.parseZmlPath(request, "/zview/merits/designOrderMeritsInfo.zml", attrMap); + request.setResponseResult(ret); + } + + + /** + * + * 查找字符串在数组中出现重复次数 + * + * @author gjx + * @param backId + * @param arrayId + * @return + */ + public static int findArrayRepetit(String backId, String[] arrayId) + { + int backExistCount = 0; + for (int i = 0; i < arrayId.length; i++) + { + if (arrayId[i].equals(backId)) + { + backExistCount++; + } + } + return backExistCount; + } + + /** + * 查询个人退款订单 + * + * @param request + * @throws Exception + */ + public static void doQueryRefundDetail(HttpRequest request) throws Exception + { + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if (org == null) + { + request.setResponseError("组织不存在"); + return; + } + + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 10); + String designer = request.getParameter("designer", "全部"); + String beginDate = request.getParameter("beginDate"); + String endDate = request.getParameter("endDate"); + + Selector selector = new Selector(); + Selector selectorCopy = new Selector(); + + if ("全部".equals(designer)) + { + OperatorDao.getOrgOperatorSelector(request, orgId, selector, "designer", request.getSessionName()); + } + else + { + selector.addMust("designer", designer); + selectorCopy.addMust("designer", designer); + } + // selector.addMustNotEqual("complaintFlag", 1); + // selector.addMustThenGE("refundTime", beginDate + " 00:00:00"); + // selector.addMustThenLE("refundTime", endDate + " 23:59:59"); + selector.addMaybeThenGE("designBeginTime", Sqls.toTimestamp(beginDate + " 00:00:00")); + selector.addMaybeThenLE("designBeginTime", Sqls.toTimestamp(endDate + " 23:59:59")); + selector.addMustIn("status", StatusConstants.ORDER_F100.value()); + + // 相关子查询(一小时内重新下单不算设计师责任) + selector.addExpressionNotEqual("buyerNick", "all (select BUYER_NICK from design_order as b " + "where b.DESIGN_ID <> design_order.DESIGN_ID " + + "and b.CREATE_TIME >= design_order.REFUND_TIME " + "and DATE_SUB(b.CREATE_TIME,INTERVAL 1 HOUR) <= design_order.REFUND_TIME)"); + // selectorCopy.addMustNotEqual("complaintFlag", 1); + // selector.addMustThenGE("refundTime", beginDate + " 00:00:00"); + // selector.addMustThenLE("refundTime", endDate + " 23:59:59"); + selectorCopy.addMaybeThenGE("designBeginTime", Sqls.toTimestamp(beginDate + " 00:00:00")); + selectorCopy.addMaybeThenLE("designBeginTime", Sqls.toTimestamp(endDate + " 23:59:59")); + selectorCopy.addMustIn("status", StatusConstants.ORDER_F110.value()); + + // 相关子查询(一小时内重新下单不算设计师责任) + selectorCopy.addExpressionNotEqual("buyerNick", "all (select BUYER_NICK from design_order as b " + "where b.DESIGN_ID <> design_order.DESIGN_ID " + + "and b.CREATE_TIME >= design_order.REFUND_TIME " + "and DATE_SUB(b.CREATE_TIME,INTERVAL 1 HOUR) <= design_order.REFUND_TIME)"); + if (org.getOrgLevel() > 0) + {// 不是顶级组织加入组织条件 + selector.addExpression("designer", "any (select operator_code from zmr_operator as a WHERE a.ORG_ID = $orgId$)"); + selector.addReplace("ORG_ID", orgId + ""); + selectorCopy.addExpression("designer", "any (select operator_code from zmr_operator as a WHERE a.ORG_ID = $orgId$)"); + selectorCopy.addReplace("ORG_ID", orgId + ""); + } + PageResult noResponsibleRefundResult = ORM.get(ZView.class).page(DesignSelfView.class, page, pageSize, selector); + PageResult responsibleRefundResult = ORM.get(ZView.class).page(DesignSelfView.class, page, pageSize, selectorCopy); + + MapSO attrMap = new HashMapSO(); + attrMap.put("noResponsibleRefundResult", noResponsibleRefundResult); + attrMap.put("responsibleRefundResult", responsibleRefundResult); + // attrMap.put("passResult", passResult); + attrMap.put("beginDate", beginDate); + attrMap.put("endDate", endDate); + attrMap.put("designer", designer); + attrMap.put("page", page); + String ret = ZmlContexts.parseZmlPath(request, "/zview/stat/refund/inner/designOrderRefundRateStatInfo.zml", attrMap); + request.setResponseResult(ret); + } + + public static void doQueryQcOrder(HttpRequest request) + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt("page.size", 10); + + String year = request.getParameter("year"); + String month = request.getParameter("month"); + String dateTime = year + "-" + month; + int day = DateTimes.getMonthDays(year + month); + + String designer = request.getParameter("designer"); + + StringBuffer sql = new StringBuffer( + "select QC_RECORD.REASON as reason, QC_RECORD.SCORE as score, QC_RECORD.IMG_PATH as imgPath, QC_RECORD.OPERATOR_CODE as operatorCode, DESIGN_ORDER.DESIGN_ID as designId, DESIGN_ORDER.MERCHANT_ID as merchantId, DESIGN_ORDER.OUT_ID as outId, DESIGN_ORDER.STATUS as status, DESIGN_ORDER.ORDER_TEXT as orderText, DESIGN_ORDER.AMOUNT as amount, DESIGN_ORDER.TYPE_ID as typeId, DESIGN_ORDER.INDUSTRY_ID as industryId, DESIGN_ORDER.DRAFT_TYPE as draftType, DESIGN_ORDER.IS_URGENT as isUrgent, DESIGN_ORDER.DESIGN_PAGE as designPage, DESIGN_ORDER.DESIGN_WIDTH as designWidth, DESIGN_ORDER.DESIGN_HEIGHT as designHeight, DESIGN_ORDER.PRINT_WIDTH as printWidth, DESIGN_ORDER.PRINT_HEIGHT as printHeight, DESIGN_ORDER.PRINT_KS as printKs, DESIGN_ORDER.PRINT_MS as printMs, DESIGN_ORDER.USER_CONTACT as userContact, DESIGN_ORDER.USER_MOBILE as userMobile, DESIGN_ORDER.AFTER_NAMES as afterNames, DESIGN_ORDER.PRINT_SPECIAL as printSpecial, DESIGN_ORDER.BUYER_NICK as buyerNick, DESIGN_ORDER.USER_TEXT as userText, DESIGN_ORDER.USER_NOTICE as userNotice, DESIGN_ORDER.USER_QQ as userQq, DESIGN_ORDER.USER_WX as userWx, DESIGN_ORDER.USER_TEXT_REPLACE as userTextReplace, DESIGN_ORDER.REMINDER_NUM as reminderNum, DESIGN_ORDER.SHOP_NICK as shopNick, DESIGN_ORDER.ORG_ID as orgId, DESIGN_ORDER.ORG_RECEIVE_TIME as orgReceiveTime, DESIGN_ORDER.RECEIVE_TYPE as receiveType, DESIGN_ORDER.ORDER_FLAG as orderFlag, DESIGN_ORDER.DESIGNER as designer, DESIGN_ORDER.DESIGN_RECEIVE_TIME as designReceiveTime, DESIGN_ORDER.DESIGN_BEGIN_TIME as designBeginTime, DESIGN_ORDER.DESIGN_DRAFT_TIME as designDraftTime, DESIGN_ORDER.DESIGN_END_TIME as designEndTime, DESIGN_ORDER.DESIGN_PAUSE_REASON as designPauseReason, DESIGN_ORDER.DESIGN_PAUSE_TIME as designPauseTime, DESIGN_ORDER.DESIGN_EXCLUDE as designExclude, DESIGN_ORDER.DESIGN_REQUEST_REASON as designRequestReason, DESIGN_ORDER.REQUEST_TIME as requestTime, DESIGN_ORDER.DESIGN_REJECT_REASON as designRejectReason, DESIGN_ORDER.DESIGN_KEEP_DURATION as designKeepDuration, DESIGN_ORDER.REQUEST_REFOUND_ACCEPT_REASON as requestRefoundAcceptReason, DESIGN_ORDER.REFUND_TIME as refundTime, DESIGN_ORDER.CHECKER as checker, DESIGN_ORDER.CHECK_TIME as checkTime, DESIGN_ORDER.CHECK_BACK_REASON as checkBackReason, DESIGN_ORDER.CHECK_BACK_PICTURE_URL as checkBackPictureUrl, DESIGN_ORDER.PREPRESS_BACK_REASON as prepressBackReason, DESIGN_ORDER.CANCELER as canceler, DESIGN_ORDER.CANCEL_TIME as cancelTime, DESIGN_ORDER.CANCEL_REASON as cancelReason, DESIGN_ORDER.CREATE_TIME as createTime, DESIGN_ORDER.MODIFY_TIME as modifyTime, DESIGN_ORDER.RE_DESIGN_SRC_ID as reDesignSrcId, DESIGN_ORDER.RE_DESIGN_CREATE_NOTE as reDesignCreateNote, DESIGN_ORDER.COMPLAINT_REASON as complaintReason, DESIGN_ORDER.COMPLAINT_FLAG as complaintFlag, DESIGN_ORDER.COMPLAINT_BACK_REASON as complaintBackReason, DESIGN_ORDER.SERVICES_MESSAGE as servicesMessage, DESIGN_ORDER.QC_TIME as qcTime, DESIGN_ORDER.QC_FLAG as qcFlag, DESIGN_ORDER.IS_OLD_USER as isOldUser from QC_RECORD left join DESIGN_ORDER on QC_RECORD.DESIGN_ID = DESIGN_ORDER.DESIGN_ID where QC_RECORD.QC_FLAG = 2"); + + // 过滤时间 + sql.append(" and QC_RECORD.QC_TIME >= "); + sql.append("\'"); + sql.append(Sqls.toTimestamp(dateTime + "-01" + " 00:00:00")); + sql.append("\'"); + sql.append(" and QC_RECORD.QC_TIME <= "); + sql.append("\'"); + sql.append(Sqls.toTimestamp(dateTime + "-" + day + " 23:59:59")); + sql.append("\'"); + // 过滤设计师 + if (designer != null && !"".equals(designer)) + { + sql.append(" and QC_RECORD.DESIGNER = "); + sql.append("\'" + designer + "\'"); + } + + List listUsers = null; + int toal = 0; + try + { + // 过滤组织,如果是总组织则查看所有数据 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + ZmrOrg org = ZmrBootstrap.table(request).item(ZmrOrg.class, orgId); + if (org.getOrgLevel() > 0) + { + sql.append(" and QC_RECORD.ORG_ID = "); + sql.append(org.getOrgId()); + } + + // 查询sql条数 + String countSql = "select count(*) count from (" + sql.toString() + ") _p"; + List list = ORM.get(ZSQL.class).executeQuery(countSql); + toal = Integer.valueOf((list.get(0).get("count")).toString()); + // 分页查询数据 + sql.insert(0, "select * from ("); + sql.append(" ) _p"); + sql.append(" limit "); + sql.append((page - 1) * pageSize); + sql.append(","); + sql.append(pageSize); + listUsers = ORM.get(ZSQL.class).executeQuery(sql.toString(), QcOrderView.class); + } + catch (Exception e) + { + log.info("查询【QcOrderView】视图出错", e); + } + + PageResult pageResult = PageBuilder.newResult(toal, page, pageSize, listUsers); + MapSO attrMap = new HashMapSO(); + attrMap.put("pageResult", pageResult); + attrMap.put("designer", designer); + attrMap.put("page", page); + + String ret = ""; + try + { + ret = ZmlContexts.parseZmlPath(request, "/zview/stat/qc/inner/qcViolationsOrderInfo.zml", attrMap); + } + catch (Exception e) + { + log.info("查询【QcOrderView】视图出错", e); + } + + request.setResponseResult(ret); + } + + public static void doQueryQcDispose(HttpRequest request) + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt("page.size", 10); + + String beginDate = request.getParameter("beginDate", DateTimes.getFirstMonthDay()); + String endDate = request.getParameter("endDate", DateTimes.getDateString()); + String operatorCode = request.getParameter("operatorCode"); + + Selector selector = new Selector(); + selector.addMaybe("operatorCode", operatorCode); + selector.addMustThenGE("qcTime", Sqls.toTimestamp(beginDate + " 00:00:00")); + selector.addMustThenLE("qcTime", Sqls.toTimestamp(endDate + " 23:59:59")); + + PageResult pageResult = PageBuilder.newResult(page); + try + { + pageResult = ORM.get(ZView.class).page(QcOrderView.class, page, pageSize, selector); + } + catch (Exception e) + { + log.info("查询【QcOrderView】视图出错", e); + } + + MapSO attrMap = new HashMapSO(); + attrMap.put("pageResult", pageResult); + attrMap.put("operatorCode", operatorCode); + attrMap.put("page", page); + + String ret = ""; + try + { + ret = ZmlContexts.parseZmlPath(request, "/zview/stat/qc/inner/qcDisposeOrderInfo.zml", attrMap); + } + catch (Exception e) + { + log.info("查询【QcOrderView】视图出错", e); + } + + request.setResponseResult(ret); + } + + /** + * 印前审稿退回时效统计Info + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doOrderBackEffectStatInfo(HttpRequest request) throws Exception + { + + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 13); + String designer = request.getParameter("designer"); + + Selector selector = new Selector(); + selector.addMaybe("designer", designer); + selector.addMustThenGE("createLogTime", Sqls.toTimestamp(request.getParameter("startDate"), "00:00:00")); + selector.addMustThenLE("createLogTime", Sqls.toTimestamp(request.getParameter("endDate"), "23:59:59")); + selector.addMust("eventType", EventConstants.ORDER_10.value());// 退回 + selector.addMustIsNotEmpty("designer"); + selector.addOrderbyAsc("designId"); + selector.addOrderbyAsc("createLogTime"); + + PageResult infoPageResult = ORM.get(ZView.class).page(DesignOrdLogView.class, page, pageSize, selector); + infoPageResult.addConditionMap(request.getParameterMap()); + + MapSO attrMap = new HashMapSO(); + attrMap.put("infoPageResult", infoPageResult); + attrMap.put("designer", designer); + attrMap.put("page", page); + String ret = ZmlContexts.parseZmlPath(request, "/zview/stat/back/orderBackEffectStatInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * 初稿审稿退回时效统计Info + * + * @author caohong + * @param request + * @throws Exception + */ + public static void draftOrderBackEffectStatInfo(HttpRequest request) throws Exception + { + + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 13); + String designer = request.getParameter("designer"); + + Selector selector = new Selector(); + selector.addMaybe("designer", designer); + selector.addMustThenGE("designDraftTime", Sqls.toTimestamp(request.getParameter("startDate"), "00:00:00")); + selector.addMustThenLE("designDraftTime", Sqls.toTimestamp(request.getParameter("endDate"), "23:59:59")); + selector.addMustThenGE("status", StatusConstants.ORDER_50.value());// 已定稿 + selector.addMustNotEqual("draftType", DraftConstants.DRAFT_STANDARD.value());// 标准自来稿 + selector.addMustNotEqual("draftType", DraftConstants.DRAFT_ACTUALS.value());// 现货 + selector.addMustIsNotNull("draftBackReason"); + selector.addOrderbyAsc("createTime"); + + PageResult infoPageResult = ORM.get(ZView.class).page(DesignSelfView.class, page, pageSize, selector); + infoPageResult.addConditionMap(request.getParameterMap()); + + MapSO attrMap = new HashMapSO(); + attrMap.put("infoPageResult", infoPageResult); + attrMap.put("designer", designer); + attrMap.put("page", page); + String ret = ZmlContexts.parseZmlPath(request, "/zview/stat/back/draftOrderBackStatInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * 定稿审稿退回时效统计Info + * + * @author caohong + * @param request + * @throws Exception + */ + public static void endOrderBackEffectStatInfo(HttpRequest request) throws Exception + { + + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 13); + String designer = request.getParameter("designer"); + + Selector selector = new Selector(); + selector.addMaybe("designer", designer); + selector.addMustThenGE("designDraftTime", Sqls.toTimestamp(request.getParameter("startDate"), "00:00:00")); + selector.addMustThenLE("designDraftTime", Sqls.toTimestamp(request.getParameter("endDate"), "23:59:59")); + selector.addMustThenGE("status", StatusConstants.ORDER_55.value());// 已定稿 + selector.addMustNotEqual("draftType", DraftConstants.DRAFT_STANDARD.value());// 标准自来稿 + selector.addMustNotEqual("draftType", DraftConstants.DRAFT_ACTUALS.value());// 现货 + selector.addMustIsNotNull("endBackReason"); + selector.addOrderbyAsc("createTime"); + + PageResult infoPageResult = ORM.get(ZView.class).page(DesignSelfView.class, page, pageSize, selector); + infoPageResult.addConditionMap(request.getParameterMap()); + + MapSO attrMap = new HashMapSO(); + attrMap.put("infoPageResult", infoPageResult); + attrMap.put("designer", designer); + attrMap.put("page", page); + String ret = ZmlContexts.parseZmlPath(request, "/zview/stat/back/endOrderBackStatInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * + * [简要描述]: 设计师定稿超时详情
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doQueryCompleteTimeoutOrderInfo(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = 12; + + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + + Selector selector = new Selector(); + selector.addMustThenGE("createTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMustThenLE("createTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addMustThenGE("status", StatusConstants.ORDER_10.value()); + selector.addMustIsNotEmpty("designer"); + selector.addMaybe("designer", request.getParameter("designer")); + // 根据组织显示 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (ZmrOrgDao.getOrgRootId(request) != sessionUser.getSelectedOrgId()) + { + selector.addMust("orgId", sessionUser.getSelectedOrgId()); + }else { + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + } + selector.addExpressionThenL("designBeginTime", + "SUBDATE(IF(design_order.`STATUS` >= 55,design_order.DESIGN_END_TIME,now()),INTERVAL (SELECT dt.EFFECTIVE_END_TIME FROM design_type dt WHERE dt.TYPE_ID = DESIGN_ORDER.TYPE_ID) MINUTE)"); + selector.addOrderbyAsc("createTime"); + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + Map progressNoteMap = new HashMap(); + for (DesignOrder order : pageResult.list()) + { + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class).item(OrdProgressNote.class, + new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" + : "" + + "

            " + + note.getOrdProgressNote() + "

            " + Sqls.toDateTimeString(note.getCreateTime()) + "
            "); + } + + MapSO attrMap = new HashMapSO(); + attrMap.put("progressNoteMap", progressNoteMap); + attrMap.put("pageResult", pageResult); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/stat/design/inner/timeoutDesignerCompleteInfo.zml", attrMap); + request.setResponseResult(ret); + + } + + /** + * + * [简要描述]: 设计师定稿率统计
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doQueryDesignNotCompleteOrderInfo(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = 12; + + // 查询组织 + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + + String designer = request.getParameter("designer"); + Long orgIdR = request.getParameterLong("orgId", 0L); + + Selector selector = new Selector(); + selector.addMustThenGE("designBeginTime", Sqls.toTimestampBegin(startDate)); + selector.addMustThenLE("designBeginTime", Sqls.toTimestampEnd(endDate)); + selector.addMustThenL("status", StatusConstants.ORDER_55.value()); + if (ZmrOrgDao.getOrgRootId(request) != orgId) + { + selector.addMust("orgId", orgId); + } + if(orgIdR != 0L) { + selector.addMust("orgId", orgIdR); + } + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + + selector.addMustIsNotEmpty("designer"); + selector.addMaybe("designer", designer); + selector.addOrderbyAsc("designBeginTime"); + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + pageResult.addConditionMap(request.getParameterMap()); + Map progressNoteMap = new HashMap(); + for (DesignOrder order : pageResult.list()) + { + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class).item(OrdProgressNote.class, + new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" + : "" + + "

            " + + note.getOrdProgressNote() + "

            " + Sqls.toDateTimeString(note.getCreateTime()) + "
            "); + } + + MapSO attrMap = new HashMapSO(); + attrMap.put("pageResult", pageResult); + attrMap.put("progressNoteMap", progressNoteMap); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/stat/design/inner/completeDesignRateStatInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * + * [简要描述]: 查询分拣超时订单
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doQueryTimeoutMerDispatchOrder(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = 12; + + String beginDate = request.getParameter("beginDate"); + String endDate = request.getParameter("endDate"); + + Selector selector = new Selector(); + selector.addMaybe("designId", request.getParameterLong("designId")); + selector.addMaybe("buyerNick", request.getParameter("buyerNick")); + selector.addMaybe("typeId", request.getParameterLong("typeId")); + selector.addMaybe("industryId", request.getParameterLong("industryId")); + selector.addMustThenGE("createTime", Sqls.toTimestampBegin(beginDate)); + selector.addMustThenLE("createTime", Sqls.toTimestampEnd(endDate)); + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + // 根据组织查询 + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + }else { + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + } + + selector.addExpressionThenL("createTime", + "SUBDATE(CASE WHEN (ISNULL(DESIGN_ORDER.ORG_RECEIVE_TIME) = 1) || (LENGTH(TRIM(DESIGN_ORDER.ORG_RECEIVE_TIME)) = 0) THEN now() ELSE DESIGN_ORDER.ORG_RECEIVE_TIME END,INTERVAL (SELECT dt.MER_DISPATCH_EFFECTIVE_TIME FROM design_type dt WHERE dt.TYPE_ID = DESIGN_ORDER.TYPE_ID) MINUTE)"); + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + + MapSO attrMap = new HashMapSO(); + attrMap.put("pageResult", pageResult); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/stat/design/inner/timeoutMerDispatchInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * + * [简要描述]: 初稿超时订单详情
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doQueryTimeoutDraftOrder(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = 12; + + // 查询组织 + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + + String beginDate = request.getParameter("beginDate"); + String endDate = request.getParameter("endDate"); + String designer = request.getParameter("designer"); + + Selector selector = new Selector(); + selector.addMaybe("designer", designer); + selector.addMustThenGE("designBeginTime", Sqls.toTimestampBegin(beginDate)); + selector.addMustThenLE("designBeginTime", Sqls.toTimestampEnd(endDate)); + selector.addExpressionThenL("designBeginTime", + "SUBDATE(CASE WHEN (ISNULL(DESIGN_ORDER.DESIGN_DRAFT_TIME) = 1) || (LENGTH(TRIM(DESIGN_ORDER.DESIGN_DRAFT_TIME)) = 0) THEN now() ELSE DESIGN_ORDER.DESIGN_DRAFT_TIME END,INTERVAL (SELECT dt.EFFECTIVE_TIME FROM design_type dt WHERE dt.TYPE_ID = DESIGN_ORDER.TYPE_ID) MINUTE)"); + if (ZmrOrgDao.getOrgRootId(request) != orgId) + { + selector.addMust("orgId", orgId); + }else { + //判断是不是负责人,如果是负责人,就只能看到他负责的部门的数据 + Selector selector1 = new Selector(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + selector1.addMustLike("orgManagerArr", sessionUser.getOperatorCode()); + List zmrOrgList = ORM.get(ZTable.class).list(ZmrOrg.class, selector1); + if(zmrOrgList.size()>0) { + List orgList = new ArrayList(); + for (ZmrOrg zmrOrg : zmrOrgList) + { + orgList.add(zmrOrg.getOrgId()); + } + selector.addMustInLong("orgId", Arrays.toArrayLong(orgList)); + } + } + selector.addOrderbyAsc("designBeginTime"); + + PageResult pageResult = ORM.get(ZTable.class).page(DesignOrder.class, page, pageSize, selector); + Map progressNoteMap = new HashMap(); + for (DesignOrder order : pageResult.list()) + { + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class).item(OrdProgressNote.class, + new Selector("designId", order.getDesignId()).addOrderbyDesc("createTime")); + progressNoteMap.put(order.getDesignId(), note == null ? "" + : "" + + "

            " + + note.getOrdProgressNote() + "

            " + Sqls.toDateTimeString(note.getCreateTime()) + "
            "); + } + + MapSO attrMap = new HashMapSO(); + attrMap.put("pageResult", pageResult); + attrMap.put("designer", designer); + attrMap.put("progressNoteMap", progressNoteMap); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/stat/design/inner/timeoutDraftOrderInfo.zml", attrMap); + request.setResponseResult(ret); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/TemplateOrderPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/TemplateOrderPresenter.java new file mode 100644 index 0000000..44c05c3 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/TemplateOrderPresenter.java @@ -0,0 +1,1162 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.math.BigDecimal; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.validate.onex.IsInteger; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Maths; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.media.dbo.MediaBg; +import com.zhiqim.media.dbo.MediaCanvas; +import com.zhiqim.media.service.dao.MediaDao; +import com.zhiqim.media.service.dao.MediaPathDao; +import com.zhiqim.media.service.handler.MediaHandlePdfModel; +import com.zhiqim.yangcai.cache.CustomerTypeCache; +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.cache.IndustryLabelCache; +import com.zhiqim.yangcai.cache.LabelDimensionCache; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OrderCheckDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.TemplateDao; +import com.zhiqim.yangcai.design.dao.WhetherMayLeadToDao; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.order.SelfOrder; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateOrder; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; +import com.zhiqim.yangcai.design.model.CustomerTypeCacheModel; +import com.zhiqim.yangcai.design.model.IndustryLabelModel; +import com.zhiqim.yangcai.design.model.LabelDimensionModel; +import com.zhiqim.yangcai.design.model.TemplatePreviewModel; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +/** + * 订单模板Presenter + * + * @version v1.0.0 @author Deng 2018-2-5 新建与整理 + * @version V1.1 @author caohong 2019-5-18 优化模板定稿逻辑,直接使用预览pdf定稿 + */ +@AnAlias("TemplateOrderPresenter") +@AnIntercept("chkZmrLogin") +public class TemplateOrderPresenter +{ + private static final Log log = LogFactory.getLog(TemplateOrderPresenter.class); + + /** + * 判断模板是否显示提交初稿按键 + * + * @param mediaId + * @return + * @throws Exception + */ + public static boolean doCheckIsOrderTemplate(long mediaId) throws Exception + { + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (template == null) + { + return false; + } + + long designId = template.getDesignId(); + if (designId <= 0) + { + return false; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + return false; + } + + float status = order.getStatus(); + if (status >= StatusConstants.ORDER_20.value() && status < StatusConstants.ORDER_60.value()) + { + return true; + } + else + { + return false; + } + } + + /** + * 订单模板信息查询 + * + * @param request + * @throws Exception + */ + public static void doTemplateOrderQuery(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mediaId", "模板id不存在")); + if (!request.chkValidate()) + { + return; + } + + long mediaId = request.getParameterLong("mediaId"); + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (template == null) + { + request.setResponseError("模板不存在,请重新选择"); + return; + } + + long designId = template.getDesignId(); + if (Validates.isEmpty(designId) || designId == 0 || designId == -1) + { + request.setResponseError("订单ID不存在,请重新选择"); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单信息不存在,请重新选择"); + return; + } + + List mediaList = ORM.get(ZView.class).list(MediaTemplateView.class, new Selector("designId", designId)); + if (mediaList.isEmpty()) + { + return; + } + + List idList = new ArrayList(); + for (MediaTemplateView media : mediaList) + { + idList.add(media.getMediaId()); + } + // svg展示图 + Map svgMap = TemplateDao.getTemplatePreview(idList); + + // 订单的客户素材 + Selector attaSel = new Selector(); + attaSel.addMust("designId", designId); + attaSel.addMust("attaModul", FileTypeConstants.FILE_CUSTOM.value()); + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, attaSel); + + MapSO attrMap = new HashMapSO(); + attrMap.put("svgMap", svgMap); + attrMap.put("order", order); + attrMap.put("mediaId", mediaId); + attrMap.put("attaList", attaList); + + DesTemplateOrder desOrder = ORM.get(ZTable.class).item(DesTemplateOrder.class, designId); + if (desOrder != null && Validates.isNotEmpty(desOrder.getParamText())) + { + attrMap.put("paramText", desOrder.getParamText()); + } + + attrMap.put("desOrder", desOrder); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/templateOrder/templateOrder.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * 检测订单模板的版面数 + * + * @param request + * @throws Exception + */ + public static void doCheckTempatePage(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mediaId", "未获取模板编号,请重新选择")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long mediaId = request.getParameterLong("mediaId"); + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (template == null) + { + request.setResponseError("模板文件不存在,请重新选择"); + return; + } + + long designId = template.getDesignId(); + if (designId <= 0) + { + request.setResponseError("未获取订单号,请重新选择"); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("未获取订单信息"); + return; + } + + // 后工文件检测 --caohong + String msg = OrderCheckDao.isAfterFileCheck(order); + if (!"".equals(msg)) + { + request.setResponseError(msg); + return; + } + + // 透明PVC,并且是印白墨后加工的情况,不判断版面数量,因为有白墨版,比较特殊 --caohong + if (order.getTypeId() == 1806070857392601L && order.getAfterNames() != null && order.getAfterNames().contains("印白墨")) + { + return; + } + + int num = ORM.get(ZTable.class).count(MediaBg.class, new Selector("mediaId", mediaId)); + if (num != order.getDesignPage() * order.getPrintKs()) + { + request.setResponseError("订单模板版面数与订单模数不一致"); + return; + } + } + + /** + * 检测订单模板的尺寸 + * + * @param request + * @throws Exception + */ + public static String doCheckTempateSize(DesignOrder order, MediaCanvas canvas) throws Exception + { + double orderWidth = order.getPrintWidth(); + double orderHeight = order.getPrintHeight(); + long typeId = order.getTypeId(); + + // pvc名片不补位特殊流程 + if (typeId == 1806070857392601L) + { + if (order.getDesignWidth() == 90 && order.getDesignHeight() == 53) + { + if (orderWidth == 0) + { + orderWidth = 90; + } + else + { + orderWidth += canvas.getBleedSize(); + } + if (orderHeight == 0) + { + orderHeight = 53; + } + else + { + orderHeight += canvas.getBleedSize(); + } + } + else if (order.getDesignWidth() == 88 && order.getDesignHeight() == 57) + { + if (orderWidth == 0) + { + orderWidth = 88.5; + } + else + { + orderWidth += canvas.getBleedSize(); + } + if (orderHeight == 0) + { + orderHeight = 57; + } + else + { + orderHeight += canvas.getBleedSize(); + } + } + else + { + if (orderWidth == 0) + { + orderWidth = 88.5; + } + else + { + orderWidth += canvas.getBleedSize(); + } + if (orderHeight == 0) + { + orderHeight = 57; + } + else + { + orderHeight += canvas.getBleedSize(); + } + } + } + else + { + if (orderWidth == 0) + { + orderWidth = order.getDesignWidth(); + } + else + { + orderWidth += canvas.getBleedSize(); + } + if (orderHeight == 0) + { + orderHeight = order.getDesignHeight(); + } + else + { + orderHeight += canvas.getBleedSize(); + } + } + + double canvasWidth = canvas.getWidthMm(); + double canvasHeight = canvas.getHeightMm(); + BigDecimal canvasW = new BigDecimal(canvasWidth); + BigDecimal canvasH = new BigDecimal(canvasHeight); + BigDecimal orderW = new BigDecimal(orderWidth); + BigDecimal orderH = new BigDecimal(orderHeight); + + if (orderW.compareTo(canvasW) != 0) + { + if (orderW.compareTo(canvasH) != 0 || orderH.compareTo(canvasW) != 0) + { + return "设计尺寸与订单尺寸不一致"; + } + } + else if (orderH.compareTo(canvasH) != 0) + { + return "设计尺寸与订单尺寸不一致"; + } + + return ""; + } + + /** + * 预览定稿设计文件 + * + * @param request + * @throws Exception + */ + public static void doPreviewFinalOrderTempalte(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mediaId", "未获取模板编号")); + + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long mediaId = request.getParameterLong("mediaId"); + MediaTemplateView media = ORM.get(ZView.class).item(MediaTemplateView.class, new Selector("mediaId", mediaId)); + if (media == null) + { + request.setResponseError("模板文件不存在,请重新选择"); + return; + } + + long designId = media.getDesignId(); + if (designId <= 0) + { + request.setResponseError("未获取订单号,请重新选择"); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + } + + // 是否有权限提交预览 + WhetherMayLeadToDao.ergodicOpecoterCode(request, request.getSessionName(), order); + + MediaCanvas canvas = ORM.get(ZTable.class).item(MediaCanvas.class, mediaId); + if (canvas == null) + { + request.setResponseError("素材文件不存在[mediaCanvas]"); + return; + } + + String err = doCheckTempateSize(order, canvas); + if (!"".equals(err)) + { + request.setResponseError(err); + return; + } + + // 初稿可提交多次,定稿后不允许再次提交 + if (order.getStatus() != StatusConstants.ORDER_50.value()) + { + request.setResponseError("该订单状态不是初稿状态,请先完成初稿操作"); + return; + } + + int doHandle = request.getParameterInt("doHandle", 1); + if (0 == doHandle) + { + return; + } + + // 定稿素材生产成品文件,用于预览pdf和最终定稿 + String curDate = DateTimes.getDateTime8String(); + String fileName = order.getDesignId() + Ids.longId13() + ".pdf"; + String pdfPath = MediaPathDao.getTempLocalPre(curDate) + fileName; + MediaHandlePdfModel model = new MediaHandlePdfModel(canvas, -1, false, pdfPath); + MediaDao.doMediaHandleToPdf(model); + } + + /** + * 查询订单总金额 + * + * @param request + * @throws Exception + */ + public static long doQueryOrderAmount(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + MediaTemplateView media = ORM.get(ZView.class).item(MediaTemplateView.class, new Selector("mediaId", mediaId)); + if (media == null) + { + request.setResponseError("素材文件不存在[mediaCanvas]"); + return 0; + } + + long designId = media.getDesignId(); + if (designId <= 0) + { + request.setResponseError("未获取订单号!"); + return 0; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + return order.getAmount(); + } + + /** 查询定稿预览进度 */ + public static void doQueryPreviewFinalOrderTempalteProgressing(HttpRequest request) throws Exception + { + + long mediaId = request.getParameterLong("mediaId"); + MediaTemplateView media = ORM.get(ZView.class).item(MediaTemplateView.class, new Selector("mediaId", mediaId)); + if (media == null) + { + request.setResponseError("模板文件不存在,请重新选择"); + return; + } + + long designId = media.getDesignId(); + if (designId <= 0) + { + request.setResponseError("未获取订单号,请重新选择"); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + } + + MediaHandlePdfModel model = MediaDao.doQueryMediaHandlePdfModel(mediaId, false); + String pdfUrl = null; + if (model != null && model.getHandleStatus() == 2)// 处理器处理完成 + { + // 成品文件临时预览pdf + String pdfName = Files.getFileName(model.getPdfSavePath()); + String curDate = DateTimes.getDateTime8String(); + pdfUrl = MediaPathDao.getTempUrlPre(curDate) + pdfName; + } + + long amount = order.getAmount(); + Map jsonMap = new HashMap(); + jsonMap.put("mediaId", mediaId); + jsonMap.put("url", pdfUrl); + jsonMap.put("amount", amount); + jsonMap.put("mediaHandlePdfModel", model); + request.setResponseResult(Jsons.toString(jsonMap)); + + } + + /** + * 生成订单定稿模板,并完成相应操作 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doSubmitFinalOrderTempalte(HttpRequest request) throws Exception + { + // 运营后台不需要该逻辑 + } + + /** + * [简要描述]:电子名片定稿
            + * [详细描述]:
            + * + * @author caohong + * @param httpRequest + * @throws SQLException + * @throws ORMException + */ + public static void doSubmitFinalOrderCard(HttpRequest request) throws Exception + { + // 运营后台不需要该逻辑 + } + + /** 查询定稿进度 */ + @AnTransaction + public static void doQueryFinalOrderTemplateProgressing(HttpRequest request) throws Exception + { + // 运营端无定稿操作逻辑 + } + + /** 客户端完成定稿上传,回调更新 */ + @AnTransaction + public static void doSubmitFinalLocalSave(HttpRequest request) throws Exception + { + // 运营端无定稿操作逻辑 + + } + + /** + * 订单标签信息查询 + * + * @param request + * @throws Exception + */ + public static void doTemplateOrderLabelQuery(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mediaId", "模板id不存在")); + if (!request.chkValidate()) + { + return; + } + + long mediaId = request.getParameterLong("mediaId"); + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (template == null) + { + request.setResponseError("模板不存在,请重新选择"); + return; + } + + long designId = template.getDesignId(); + if (Validates.isEmpty(designId) || designId == 0 || designId == -1) + { + request.setResponseError("订单ID不存在,请重新选择"); + return; + } + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, new Selector().addMust("designId", designId)); + if (order == null) + { + request.setResponseError("订单信息不存在,请重新选择"); + return; + } + MapSO attrMap = new HashMapSO(); + attrMap.put("order", order); + attrMap.put("mediaId", mediaId); + String ret = ZmlContexts.parseZmlPath(request, "/zview/templateOrder/templateOrderLabel.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * 根据输入的行业关键字查询主行业 + * + * @param request + * @throws Exception + */ + public void doQueryIndustryByKey(HttpRequest request) throws Exception + { + String industryKey = request.getParameter("industryKey"); + long designId = request.getParameterLong("labelOid"); + String unmatchkey = request.getParameter("unmatchkey", ""); + if (Validates.isEmpty(industryKey)) + { + request.setResponseError("请输入行业关键词"); + return; + } + if (designId < 0) + { + request.setResponseError("订单ID为空"); + return; + } + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (Validates.isEmpty(order)) + { + request.setResponseError("订单不存在"); + return; + } + + List industries = Global.get(DesignIndustryCache.class).getIndustryList(); + List industryList = new ArrayList(); + boolean isQT = false;// 判断是否匹配到了其他行业 + for (DesignIndustry designIndustry : industries) + { + if (Validates.isNotEmpty(designIndustry.getIndustryKeywords())) + { + // 统一转换成大写英文字母进行判断 + if (designIndustry.getIndustryKeywords().toUpperCase().contains(industryKey.toUpperCase())) + { + industryList.add(designIndustry); + } + } + } + if (Validates.isNotEmpty(industryList) && industryList.size() == 1) + { + if ("其它行业".equals(industryList.get(0).getIndustryName())) + { + isQT = true; + } + } + // 如果未匹配到行业则默认使用其他行业 + if (Validates.isEmpty(industryList) || isQT) + { + // 保存未匹配的关键词 + String[] unmatchkeys = unmatchkey.split(","); + boolean isExit = false; + for (String string : unmatchkeys) + { + if (industryKey.equals(string)) + { + isExit = true; + } + } + if (!isExit) + { + if ("".equals(unmatchkey)) + { + unmatchkey = industryKey; + } + else + { + unmatchkey = unmatchkey + "," + industryKey; + } + } + DesignIndustry industry = Global.get(DesignIndustryCache.class).queryIndustryByName("其它行业"); + if (Validates.isNotEmpty(industry) && !isQT) + { + industryList.add(Global.get(DesignIndustryCache.class).getIndustry(industry.getIndustryId())); + } + } + List recommendIndustryList = matchRecommendIndustryList(industryKey); + recommendIndustryList = excludeExist(industryList, recommendIndustryList); + + Map map = new HashMap<>(); + map.put("industrys", industryList); + map.put("recommendIndustryList", recommendIndustryList); + map.put("unmatchkey", unmatchkey); + request.setResponseResult(Jsons.toString(map)); + } + + /** + * 用于连续双字匹配推荐行业并返回DesignIndustry集合 + * + * @param keyword 需要匹配的关键词 + * @return java.util.List + * @author HuangZhiGao + * @date 2020/3/4 16:41 + * @description 截取连续双字匹配成功的追加到返回集合,均未符合追加要求则最后默认返回[其他行业] + */ + public static List matchRecommendIndustryList(String keyword) throws Exception + { + // 获取所有可用行业 + List industries = Global.get(DesignIndustryCache.class).getIndustryList(); + + List recommendIndustryList = new ArrayList(); + Map chkRepeatMap = new HashMap(); + if (Validates.isNotEmptyBlank(keyword)) + { + char[] kwChars = keyword.toCharArray(); + // 关键词长度大于等于2时截取连续双字进行匹配 + if (kwChars.length >= 2) + { + for (int i = 0; i < kwChars.length; i++) + { + String tempPhrase = ""; + if (i < (kwChars.length - 1)) + { + tempPhrase = String.valueOf(kwChars[i]) + String.valueOf(kwChars[i + 1]); + for (DesignIndustry designIndustry : industries) + { + if (Validates.isNotEmpty(designIndustry.getIndustryKeywords())) + { + // 统一转换成大写英文字母进行判断 + if (designIndustry.getIndustryKeywords().toUpperCase().contains(tempPhrase.toUpperCase())) + { + chkRepeatMap.put(designIndustry.getIndustryId(), designIndustry); + } + } + } + } + } + } + + // 关键词长度等于1时进行单字匹配 + if (kwChars.length == 1) + { + for (DesignIndustry designIndustry : industries) + { + if (Validates.isNotEmpty(designIndustry.getIndustryKeywords())) + { + // 统一转换成大写英文字母进行判断 + if (designIndustry.getIndustryKeywords().toUpperCase().contains(String.valueOf(kwChars[0]).toUpperCase())) + { + chkRepeatMap.put(designIndustry.getIndustryId(), designIndustry); + } + } + } + } + recommendIndustryList = new ArrayList(chkRepeatMap.values()); + } + + // 匹配关键字为空或者最后匹配出的推荐行业集合为空则返回其他行业 + if (Validates.isEmptyBlank(keyword) || Validates.isEmpty(recommendIndustryList)) + { + DesignIndustry industry = Global.get(DesignIndustryCache.class).queryIndustryByName("其它行业"); + if (Validates.isNotEmpty(industry)) + { + recommendIndustryList.add(Global.get(DesignIndustryCache.class).getIndustry(industry.getIndustryId())); + } + } + return recommendIndustryList; + } + + /** + * 排除推荐行业中主行业已有的行业 + * + * @param mainIndustryList 主行业集合 + * @param recommendIndustryList 推荐行业集合 + * @return java.util.List + * @author HuangZhiGao + * @date 2020/3/5 11:04 + */ + public static List excludeExist(List mainIndustryList, List recommendIndustryList) + { + for (DesignIndustry mainIndustry : mainIndustryList) + { + // 使用迭代器遍历删除 + Iterator iterator = recommendIndustryList.iterator(); + while (iterator.hasNext()) + { + DesignIndustry industry = iterator.next(); + if (mainIndustry.getIndustryId() == industry.getIndustryId()) + { + iterator.remove(); + } + } + } + return recommendIndustryList; + } + + /** + * 根据输入的行业关查询标签 + * + * @param request + * @throws Exception + */ + public void doQueryIndustryLabel(HttpRequest request) throws Exception + { + long industryId = request.getParameterLong("industryId"); + if (industryId < 0) + { + request.setResponseError("行业不存在"); + return; + } + List labels = Global.get(IndustryLabelCache.class).getIndustryLabelList(); + List labelList = new ArrayList<>(); + for (IndustryLabelModel label : labels) + { + if (label.getIndustryId() == industryId) + { + labelList.add(label); + } + } + Map map = new HashMap<>(); + map.put("labelList", labelList); + map.put("dimensionList", Global.get(LabelDimensionCache.class).getDimensionAll()); + request.setResponseResult(Jsons.toString(map)); + } + + /** + * 保存标签 + * + * @param request + * @throws Exception + */ + @AnTransaction + public void doSaveIndustryLabel(HttpRequest request) throws Exception + { + long labelOid = request.getParameterLong("labelOid");// 订单ID + long industryId = request.getParameterLong("industryId");// 主行业ID + int consumerType = request.getParameterInt("consumerType", 0);// 客户类型ID + long subIndustryId = request.getParameterLong("subIndustryId");// 子行业ID + long applicationScenarioId = request.getParameterLong("applicationScenarioId");// 应用场景ID + long designStyleId = request.getParameterLong("designStyleId");// 设计风格ID + String unmatchkey = request.getParameter("unmatchkey", ""); + int flag = request.getParameterInt("flag", 0); + if (flag == 1) + { + if (consumerType <= 0) + { + request.setResponseError("请选择客户类型"); + return; + } + if (industryId < 0) + { + request.setResponseError("请选择主行业"); + return; + } + if (subIndustryId < 0) + { + request.setResponseError("请选择子行业"); + return; + } + if (applicationScenarioId < 0) + { + request.setResponseError("请选择应用场景"); + return; + } + } + if (labelOid <= 0) + { + request.setResponseError("订单号错误"); + return; + } + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, new Selector("designId", labelOid)); + if (Validates.isEmpty(order)) + { + request.setResponseError("订单不存在"); + return; + } + long beginTime = System.currentTimeMillis(); + Map labMap = Global.get(IndustryLabelCache.class).mapAll(); + long endTime = System.currentTimeMillis(); + log.info("IndustryLabelModel保存处理器[" + labelOid + "]处理中,共耗时[%s]秒", Maths.division((endTime - beginTime), 1000, 3)); + long beginTime1 = System.currentTimeMillis(); + Map industryMap = Global.get(DesignIndustryCache.class).mapAll(); + long endTime1 = System.currentTimeMillis(); + log.info("DesignIndustry保存处理器[" + labelOid + "]处理中,共耗时[%s]秒", Maths.division((endTime1 - beginTime1), 1000, 3)); + long beginTime2 = System.currentTimeMillis(); + Map ctMap = Global.get(CustomerTypeCache.class).map(); + long endTime2 = System.currentTimeMillis(); + log.info("CustomerTypeCacheModel保存处理器[" + labelOid + "]处理中,共耗时[%s]秒", Maths.division((endTime2 - beginTime2), 1000, 3)); + if (industryId > 0 && !industryMap.containsKey(industryId)) + { + request.setResponseError("该行业已被删除或者已被停用"); + return; + } + if (subIndustryId > 0 && !labMap.containsKey(subIndustryId)) + { + request.setResponseError("该子行业已被删除或者已被停用"); + return; + } + if (applicationScenarioId > 0 && !labMap.containsKey(applicationScenarioId)) + { + request.setResponseError("该应用场景已被删除或者已被停用"); + return; + } + if (designStyleId > 0 && !labMap.containsKey(designStyleId)) + { + request.setResponseError("该设计风格已被删除或者已被停用"); + return; + } + + if (consumerType > 0 && !ctMap.containsKey(consumerType)) + { + request.setResponseError("该客户类型已被删除或者已被停用"); + return; + } + // 修改订单标签 :主行业:美容妆饰,客户类型:渠道商,子行业:理发,应用场景:舞会,设计风格:欧美风 + StringBuffer labelIds = new StringBuffer("");// 拼接标签id + StringBuffer logText = new StringBuffer("修改订单标签 :");// 拼接日志信息 + boolean defaultLabel = order.isDefaultLabel();// 是否选用了原订单行业标签 + + if (industryId > 0 && order.getIndustryId() != industryId) + { + logText.append("主行业:"); + logText.append(Global.get(DesignIndustryCache.class).mapAll().get(industryId).getIndustryName()); + logText.append(","); + ORM.get(ZTable.class).update(DesignOrder.class, new Updater().addMust("designId", labelOid).addField("industryId", industryId)); + defaultLabel = false; + } + else + {// 未选择行业默认原订单行业 + logText.append("主行业:"); + logText.append(Global.get(DesignIndustryCache.class).mapAll().get(order.getIndustryId()).getIndustryName()); + logText.append(","); + } + + Updater updater = new Updater(); + updater.addMust("designId", labelOid); + updater.addField("consumerType", consumerType); + if (consumerType > 0) + { + logText.append("客户类型:"); + logText.append(Global.get(CustomerTypeCache.class).getCustomerTypeName(consumerType)); + logText.append(","); + } + else + { + logText.append("客户类型:,"); + } + + if (subIndustryId > 0) + { + labelIds.append("," + subIndustryId); + logText.append("子行业:"); + logText.append(labMap.get(subIndustryId).getLabelName()); + logText.append(","); + defaultLabel = false; + } + else + { + logText.append("子行业:,"); + } + + if (applicationScenarioId > 0) + { + labelIds.append("," + applicationScenarioId); + logText.append("应用场景:"); + logText.append(labMap.get(applicationScenarioId).getLabelName()); + logText.append(","); + defaultLabel = false; + } + else + { + logText.append("应用场景:,"); + } + + if (designStyleId > 0) + { + labelIds.append("," + designStyleId); + logText.append("设计风格:"); + logText.append(labMap.get(designStyleId).getLabelName()); + logText.append(","); + defaultLabel = false; + } + else + { + logText.append("设计风格:,"); + } + + updater.addField("defaultLabel", defaultLabel); + String labelIdsStr = Strings.trim(labelIds.toString(), ",", ","); + updater.addField("labelIds", labelIdsStr); + + // 更新订单扩展表的标签字段 + ORM.get(ZTable.class).update(SelfOrder.class, updater); + // 增加订单操作日志 + if (!"修改订单标签 :".equals(logText.toString())) + { + logText.append("未匹配的关键词:"); + logText.append(unmatchkey); + OrderLogDao.saveOrderOperateLog(labelOid, request.getSessionName(), logText.toString(), EventConstants.ORDER_31.value()); + if (!BusinessPlatformClientUtil.addUserOrderTag(labelOid, industryId, consumerType, subIndustryId, applicationScenarioId, designStyleId, + request.getSessionName())) + { + throw new Exception("运营平台增加标签失败"); + } + if (!BusinessPlatformClientUtil.addUserOrderTagLog(labelOid, logText.toString(), request.getSessionName())) + { + throw new Exception("运营平台增加标签日志失败"); + } + } + + } + + /** + * 提交定稿时对订单标签进行检查 + * + * @param request + * @throws Exception + */ + public void doPreviewFinalOrderTempalteCheckLabel(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + if (mediaId < 0) + { + request.setResponseError("模板ID不存在"); + return; + } + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, new Selector("mediaId", mediaId)); + if (Validates.isEmpty(template)) + { + request.setResponseError("模板不存在"); + return; + } + if (Validates.isEmpty(template.getDesignId())) + { + request.setResponseError("模板无关联的订单"); + return; + } + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, new Selector("designId", template.getDesignId())); + if (Validates.isEmpty(order)) + { + request.setResponseError("订单不存在"); + return; + } + boolean flag = true; + if (order.getConsumerType() == 0 || order.getLabelIds() == null) + { + flag = false; + } + else + { + Map labelMap = Global.get(IndustryLabelCache.class).mapAll(); + Map ldMap = Global.get(LabelDimensionCache.class).mapAll(); + String subIndustryDimensionId = "";// 子行业维度ID + String applicationScenarioDimensionId = "";// 应用场景维度ID + // String designStyleDimensionId = "";// 设计风格维度ID + for (LabelDimensionModel ldModel : ldMap.values()) + { + if ("子行业".equals(ldModel.getDimensionName())) + { + subIndustryDimensionId = ldModel.getDimensionId(); + } + if ("应用场景".equals(ldModel.getDimensionName())) + { + applicationScenarioDimensionId = ldModel.getDimensionId(); + } + } + String ordSubIndustry = "";// 订单子行业 + String ordApplicationScenario = "";// 订单应用场景 + // String ordDesignStyle = "";// 订单设计风格 + String[] ordLabels = order.getLabelIds().split(","); + for (String labelId : ordLabels) + { + if (Validates.isNotEmpty(labelId)) + { + IndustryLabelModel model = labelMap.get(Long.valueOf(labelId)); + if (Validates.isNotEmpty(model) && Validates.isNotEmpty(subIndustryDimensionId) && subIndustryDimensionId.equals(model.getDimensionId())) + { + ordSubIndustry = model.getLabelName(); + } + if (Validates.isNotEmpty(model) && Validates.isNotEmpty(applicationScenarioDimensionId) + && applicationScenarioDimensionId.equals(model.getDimensionId())) + { + ordApplicationScenario = model.getLabelName(); + } + } + } + if (Validates.isEmpty(ordSubIndustry) || Validates.isEmpty(ordApplicationScenario)) + { + flag = false; + } + } + Map map = new HashMap<>(); + map.put("flag", flag); + map.put("designId", order.getDesignId()); + request.setResponseResult(Jsons.toString(map)); + } + + /** + * 初稿页面提交定稿时对订单标签进行检查 + * + * @param request + * @throws Exception + */ + public void doCheckLabel(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + if (designId < 0) + { + request.setResponseError("订单ID不存在"); + return; + } + + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, new Selector("designId", designId)); + if (Validates.isEmpty(order)) + { + request.setResponseError("订单不存在"); + return; + } + MediaTemplate mediaTemplate = ORM.get(ZTable.class).item(MediaTemplate.class, new Selector("designId", designId)); + + boolean flag = true; + if (order.getConsumerType() == 0 || order.getLabelIds() == null) + { + flag = false; + } + else + { + Map labelMap = Global.get(IndustryLabelCache.class).map(); + Map ldMap = Global.get(LabelDimensionCache.class).map(); + String subIndustryDimensionId = "";// 子行业维度ID + String applicationScenarioDimensionId = "";// 应用场景维度ID + // String designStyleDimensionId = "";// 设计风格维度ID + for (LabelDimensionModel ldModel : ldMap.values()) + { + if ("子行业".equals(ldModel.getDimensionName())) + { + subIndustryDimensionId = ldModel.getDimensionId(); + } + if ("应用场景".equals(ldModel.getDimensionName())) + { + applicationScenarioDimensionId = ldModel.getDimensionId(); + } + } + String ordSubIndustry = "";// 订单子行业 + String ordApplicationScenario = "";// 订单应用场景 + // String ordDesignStyle = "";// 订单设计风格 + String[] ordLabels = order.getLabelIds().split(","); + for (String labelId : ordLabels) + { + if (Validates.isNotEmpty(labelId)) + { + IndustryLabelModel model = labelMap.get(Long.valueOf(labelId)); + if (Validates.isNotEmpty(model) && Validates.isNotEmpty(subIndustryDimensionId) && subIndustryDimensionId.equals(model.getDimensionId())) + { + ordSubIndustry = model.getLabelName(); + } + if (Validates.isNotEmpty(model) && Validates.isNotEmpty(applicationScenarioDimensionId) + && applicationScenarioDimensionId.equals(model.getDimensionId())) + { + ordApplicationScenario = model.getLabelName(); + } + } + } + if (Validates.isEmpty(ordSubIndustry) || Validates.isEmpty(ordApplicationScenario)) + { + flag = false; + } + } + Map map = new HashMap<>(); + map.put("flag", flag); + map.put("mediaId", Validates.isEmpty(mediaTemplate) ? -1 : mediaTemplate.getMediaId()); + map.put("designId", designId); + request.setResponseResult(Jsons.toString(map)); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/TemplatePresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/TemplatePresenter.java new file mode 100644 index 0000000..cf1e146 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/TemplatePresenter.java @@ -0,0 +1,998 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.onex.IsFloat; +import org.zhiqim.httpd.validate.onex.IsInteger; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.media.dbo.MediaCanvas; +import com.zhiqim.media.service.dao.MediaDao; +import com.zhiqim.media.service.dao.MediaPathDao; +import com.zhiqim.media.service.dao.PdfDao; +import com.zhiqim.media.service.model.MediaModel; +import com.zhiqim.media.service.util.ItextPdfUtil; +import com.zhiqim.yangcai.design.constant.TemplateScoreConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.KeywordDao; +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dao.TemplateDao; +import com.zhiqim.yangcai.design.dao.TemplateScoreDao; +import com.zhiqim.yangcai.design.dbo.keyword.DesKeywordIndex; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateEvent; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateEventView; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateLog; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; +import com.zhiqim.yangcai.design.model.CopyTemplateModel; +import com.zhiqim.yangcai.util.SolrUtil; + +/** + * 模板Presenter + * + * @version v1.0.0 @author Deng 2017-11-10 新建与整理 + */ +@AnAlias("TemplatePresenter") +@AnIntercept("chkZmrLogin") +public class TemplatePresenter +{ + + /** + * 模板信息查询,包括我的模板、CDR模板,收藏模板、分享模板、精品模板 + * + * @param request + * @throws Exception + */ + public static void doTemplateSearch(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("urlParam", "查询参数类型不能为空")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + String urlParam = request.getParameter("urlParam"); + long typeId = request.getParameterLong("typeId"); + long industryId = request.getParameterLong("industryId"); + String fileType = request.getParameter("fileType"); + int page = request.getParameterInt("page", 1); + int pageSize = 20; + + // 精品模板增加关键字搜索 + String keyword = request.getParameter("keyword"); + if (Validates.isNotEmpty(keyword)) + { + KeywordDao.doKeywordCoreNumAdd(keyword); // 增加关键词搜索日志 + } + + ZmrSessionUser user = request.getSessionUser(ZmrSessionUser.class); + + MapSO attrMap = new HashMapSO(); + if (urlParam.equals("COLLECT")) + { + List mediaList = TemplateDao.doTemplateEventList(urlParam, user, typeId, industryId); + PageResult pageResult = PageBuilder.pageResult(page, pageSize, mediaList); + attrMap.put("pageResult", pageResult); + } + else + { + Selector selector = new Selector(); + selector.addOrderbyDesc("createTime"); + if (typeId != -1) + { + selector.addMust("typeId", typeId); + } + + if (industryId != -1) + { + selector.addMust("industryId", industryId); + } + + PageResult pageResult = PageBuilder.newResult(page, pageSize); + if (urlParam.equals("MY")) + {// 我的模板 + selector.addMust("designer", request.getSessionName()); + selector.addMustIn("templateType", 10, 20, 100, 110); + if (Validates.isNotEmpty(fileType)) + { + List mediaList = ORM.get(ZView.class).list(MediaTemplateView.class, selector); + Iterator it = mediaList.iterator(); + while (it.hasNext()) + { + MediaTemplateView media = it.next(); + if (Validates.isEmpty(media.getFileType())) + { + it.remove(); + break; + } + if (media.getFileType().indexOf(fileType.toLowerCase()) == -1) + {// 模板不包含指定格式移除数据 + it.remove(); + } + } + pageResult = PageBuilder.pageResult(page, pageSize, mediaList); + + } + else + { + pageResult = ORM.get(ZView.class).page(MediaTemplateView.class, page, pageSize, selector); + + } + } + else if (urlParam.equals("CDR")) + {// CDR转模板 + selector.addMust("templateType", 30); + pageResult = ORM.get(ZView.class).page(MediaTemplateView.class, page, pageSize, selector); + } + else if (urlParam.equals("BEST")) + {// 精品模板 + if (Validates.isNumericLen(keyword, 13, 19)) + {// 纯id查询 + selector.addMust("mediaId", Long.parseLong(keyword)); + } + else + { + selector.addMaybeLike("keywordName", keyword); + } + + selector.addMust("templateType", 110); + if (Validates.isNotEmpty(fileType)) + { + List mediaList = ORM.get(ZView.class).list(MediaTemplateView.class, selector); + Iterator it = mediaList.iterator(); + while (it.hasNext()) + { + MediaTemplateView media = it.next(); + if (Validates.isEmpty(media.getFileType())) + { + it.remove(); + break; + } + if (media.getFileType().indexOf(fileType.toLowerCase()) == -1) + {// 模板不包含指定格式移除数据 + it.remove(); + } + } + pageResult = PageBuilder.pageResult(page, pageSize, mediaList); + + } + else + { + pageResult = ORM.get(ZView.class).page(MediaTemplateView.class, page, pageSize, selector); + } + } + else if (urlParam.equals("SHARE")) + {// 分享给我的 + String operatorCode = request.getSessionName(); + selector.addMustLike("shareDept", "," + operatorCode + ","); + List templateList = ORM.get(ZView.class).list(MediaTemplateView.class, selector); + pageResult = PageBuilder.pageResult(page, pageSize, templateList); + } + attrMap.put("urlParam", urlParam); + attrMap.put("pageResult", pageResult); + } + + String ret = ZmlContexts.parseZmlPath(request, "/zview/template/presenter/templateInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * 订单模板查询,包括订单草稿、定稿草稿 + * + * @param request + * @throws Exception + */ + public static void doSearchOrderTemplate(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("urlParam", "查询参数类型不能为空")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + String urlParam = request.getParameter("urlParam"); + long typeId = request.getParameterLong("typeId"); + long industryId = request.getParameterLong("industryId"); + String q = request.getParameter("q"); + int page = request.getParameterInt("page", 1); + int pageSize = 10; + + Selector selector = new Selector(); + selector.addOrderbyDesc("createTime"); + if (typeId != -1) + { + selector.addMust("typeId", typeId); + } + + if (industryId != -1) + { + selector.addMust("industryId", industryId); + } + + PageResult pageResult = PageBuilder.newResult(page, pageSize); + if (urlParam.equals("DRAFT")) + {// 订单草稿 + // 为数字时表示查询草稿模板,否则查询个人草稿模板列表 + if (!Validates.isInteger(q)) + { + selector.addMaybeLike("keywords", q); + selector.addMust("designer", request.getSessionName()); + } + else + { + selector.addMust("designId", Long.parseLong(q)); + } + + selector.addMust("templateType", 0); + selector.addMust("templateStatus", 0); + // 草稿只查询最近7天 + selector.addMustThenGE("createTime", Sqls.toTimestamp(DateTimes.getPreviousDateString(7) + " 00:00:00")); + pageResult = ORM.get(ZView.class).page(MediaTemplateView.class, page, pageSize, selector); + } + else if (urlParam.equals("ORDER")) + {// 订单模板 + // 为数字时表示查询订单模板,否则查询个人订单模板列表 + if (!Validates.isInteger(q)) + { + String selOrderTemplate = request.getParameter("selOrderTemplate"); // 非空时,表示模板设计查询所有模板 + if (Validates.isEmpty(selOrderTemplate)) + { + selector.addMust("designer", request.getSessionName()); + } + selector.addMaybeLike("keywords", q); + } + else + { + selector.addMust("designId", Long.parseLong(q)); + } + + selector.addMust("templateType", 80); + selector.addMust("templateStatus", 0); + + pageResult = ORM.get(ZView.class).page(MediaTemplateView.class, page, pageSize, selector); + } + + MapSO attrMap = new HashMapSO(); + attrMap.put("pageResult", pageResult); + attrMap.put("typeId", typeId); + attrMap.put("industryId", industryId); + attrMap.put("urlParam", urlParam); + attrMap.put("q", q); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/template/presenter/orderTemplateInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * 模板审核查询,包括所有模板、精品审核 + * + * @param request + * @throws Exception + */ + public static void doTemplateAuditSearch(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("urlParam", "查询参数类型不能为空")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + int page = request.getParameterInt("page", 1); + int pageSize = 20; + int templateType = request.getParameterInt("templateType"); + long typeId = request.getParameterLong("typeId"); + long industryId = request.getParameterLong("industryId"); + + Selector selector = new Selector(); + selector.addMaybe("typeId", typeId); + selector.addMaybe("industryId", industryId); + selector.addOrderbyDesc("createTime"); + selector.addMustIn("templateType", 20, 100); + selector.addMust("templateType", templateType); + selector.addMust("templateStatus", 1); + + PageResult pageResult = ORM.get(ZView.class).page(MediaTemplateView.class, page, pageSize, selector); + + MapSO attrMap = new HashMapSO(); + attrMap.put("pageResult", pageResult); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/template/presenter/checkTemplateInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * 浏览事件 + * + * @param worksId + * @throws Exception + */ + @AnTransaction + public static void doTemplateBrowse(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + + DesTemplateEvent event = new DesTemplateEvent(); + event.setEventId(Ids.longId()); + event.setMediaId(mediaId); + event.setEventType(1); + event.setOperatorCode(request.getSessionName()); + event.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(event); + + TemplateScoreDao.doTemplateFloatScore(mediaId, TemplateScoreConstants.TEMPLATE_BROWSE.value());// 模板分数计算 + } + + /** + * 下载事件 + * + * @param worksId + * @throws Exception + */ + @AnTransaction + public static void doTemplateDownload(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + + DesTemplateEvent event = new DesTemplateEvent(); + event.setEventId(Ids.longId()); + event.setMediaId(mediaId); + event.setEventType(4); + event.setOperatorCode(request.getSessionName()); + event.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(event); + + TemplateScoreDao.doTemplateFloatScore(mediaId, TemplateScoreConstants.TEMPLATE_DOWN.value());// 模板分数计算 + } + + /** + * 模板分享 + * + * @param worksId + * @param deptId + * @throws Exception + */ + @AnTransaction + public static void doTemplateShare(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + String operatorCode = request.getParameter("operatorCode"); + String seachOperatorCode = "," + operatorCode + ","; + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + + if (Validates.isNotEmpty(template.getShareDept())) + { + if (template.getShareDept().contains(seachOperatorCode)) + { + request.setResponseError("该设计师已被分享"); + return; + } + else + { + String shareDept = template.getShareDept() + operatorCode + ","; + updater.addField("shareDept", shareDept); + } + } + else + { + updater.addField("shareDept", seachOperatorCode); + } + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + + DesTemplateEvent event = new DesTemplateEvent(); + event.setEventId(Ids.longId()); + event.setMediaId(mediaId); + event.setEventType(3); + event.setCreateTime(Sqls.nowTimestamp()); + event.setOperatorCode(request.getSessionName()); + + ORM.get(ZTable.class).insert(event); + + TemplateScoreDao.doTemplateFloatScore(mediaId, TemplateScoreConstants.TEMPLATE_SHARE.value());// 模板动态分数计算 + } + + /** + * 取消分享 + * + * @param worksId + * @param deptId + * @throws Exception + */ + @AnTransaction + public static void doCancelShare(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + String operatorCode = request.getSessionName(); + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (template != null) + { + String tmp = "," + operatorCode + ","; + String shareDept = template.getShareDept(); + if (shareDept != null && shareDept.contains(tmp)) + { + tmp = shareDept.replace(tmp, ","); + if (",".equals(tmp)) + { + tmp = null; + } + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("shareDept", tmp); + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + + DesTemplateEvent event = new DesTemplateEvent(); + event.setEventId(Ids.longId()); + event.setMediaId(mediaId); + event.setEventType(3); + event.setCreateTime(Sqls.nowTimestamp()); + event.setOperatorCode(request.getSessionName()); + + ORM.get(ZTable.class).insert(event); + TemplateScoreDao.doTemplateFloatScore(mediaId, TemplateScoreConstants.CANCEL_TEMPLATE_SHARE.value());// 模板动态分数计算 + } + else + { + request.setResponseError("分享已被取消"); + return; + } + + } + + } + + /** + * 我收藏的 + * + * @param request + * @param worksId + * @throws Exception + */ + public static String doTemplateCollect(HttpRequest request, long mediaId, String eventId) throws Exception + { + ZmrSessionUser user = request.getSessionUser(ZmrSessionUser.class); + int count = 0; + if (Long.parseLong(eventId) > 0) + { + ORM.get(ZTable.class).delete(DesTemplateEvent.class, Long.parseLong(eventId)); + TemplateScoreDao.doTemplateFloatScore(mediaId, TemplateScoreConstants.TEMPLATE_COLLECT_CANCEL.value());// 模板动态分数计算 + + count = ORM.get(ZTable.class).count(DesTemplateEvent.class, new Selector("mediaId", mediaId).addMust("eventType", 2)); + // 修改后通知solr + SolrUtil.updateMediaData(mediaId); + return String.valueOf(count + ""); + } + else + { + long eventIds = Ids.longId(); + DesTemplateEvent event = new DesTemplateEvent(); + event.setEventId(eventIds); + event.setMediaId(mediaId); + event.setEventType(2); + event.setCreateTime(Sqls.nowTimestamp()); + event.setOperatorCode(user.getOperatorCode()); + + ORM.get(ZTable.class).insert(event); + + TemplateScoreDao.doTemplateFloatScore(mediaId, TemplateScoreConstants.TEMPLATE_COLLECT.value());// 模板动态分数计算 + + count = ORM.get(ZTable.class).count(DesTemplateEvent.class, new Selector("mediaId", mediaId).addMust("eventType", 2)); + // 修改后通知solr + SolrUtil.updateMediaData(mediaId); + return String.valueOf(count + "+" + eventIds); + } + } + + /** + * 删除模板,需提交至solr + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doTemplateDelete(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mediaId", "请选择模板")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long mediaId = request.getParameterLong("mediaId"); + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (template == null) + { + request.setResponseError("模板不存在"); + return; + } + + MediaDao.deleteMedia(template.getMediaId()); + ORM.get(ZTable.class).delete(MediaTemplate.class, mediaId); + ORM.get(ZTable.class).delete(DesKeywordIndex.class, mediaId); // 移除索引表 + + String prePath = MediaPathDao.getCanvasLocalPre(mediaId); + Files.deleteDirectory(prePath); + + // 提交solr删除索引 + SolrUtil.deleteTemplateById(String.valueOf(mediaId)); + + // 删除作品库附件记录 + List worksFiles = ORM.get(ZTable.class).list(DesWorksFile.class, new Selector("templateId", mediaId)); + for (DesWorksFile desWorksFile : worksFiles) + { + String srcPath = desWorksFile.getCdrPath(); + String thumbPath = desWorksFile.getThumbImagePath(); + if (Validates.isNotEmptyBlank(srcPath)) + { + String path = srcPath.split(OssFileDao.getPrefix_dir())[1]; + OssFileDao.deleteOssFile(OssFileDao.getPrefix_dir() + path); + } + + if (Validates.isNotEmptyBlank(thumbPath)) + { + String thpath = thumbPath.split(OssFileDao.getPrefix_dir())[1]; + OssFileDao.deleteOssFile(OssFileDao.getPrefix_dir() + thpath); + } + } + Selector selector = new Selector(); + selector.addMust("templateId", mediaId); + ORM.get(ZTable.class).delete(DesWorksFile.class, selector); + + // 插入模版日志 + DesTemplateLog log = new DesTemplateLog(); + log.setLogId(Ids.longId()); + log.setMediaId(mediaId); + log.setOperatorCode(request.getSessionName()); + log.setLogDesc("删除模版"); + log.setCreateTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(log); + } + + /** + * 复制模板 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doTemplateCopy(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mediaId", "请选择模板")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long mediaId = request.getParameterLong("mediaId"); + CopyTemplateModel media = TemplateDao.copyTemplateAndInsert(mediaId, Ids.longId(), request.getSessionName()); + if (media == null) + { + request.setResponseError("模板复制失败"); + return; + } + + DesTemplateEvent event = new DesTemplateEvent(); + event.setEventId(Ids.longId()); + event.setMediaId(mediaId); + event.setEventType(5); + event.setOperatorCode(request.getSessionName()); + event.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(event); + + TemplateScoreDao.doTemplateFloatScore(mediaId, TemplateScoreConstants.TEMPLATE_COPY.value());// 模板动态分数计算 + } + + /** + * 模板审核,需提交至solr + * + * @param mediaId + * @param type + * @throws Exception + */ + @AnTransaction + public static void doTemplateAudit(HttpRequest request, long mediaId, String type) throws Exception + { + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (template == null) + { + request.setResponseError("模板不存在"); + return; + } + + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + if ("yes".equals(type)) + { + updater.addField("templateType", 100); + updater.addField("templateStatus", 0); + + TemplateScoreDao.doTempalteBaseScore(mediaId); + + String typeName = DesignTypeDao.name(template.getTypeId()); + List industryList = Lists.toStringList(template.getIndustrySubName()); + List attrList = Lists.toStringList(template.getAttributeName()); + + List templateList = new ArrayList<>(); + templateList.add(typeName); + templateList.addAll(industryList); + templateList.addAll(attrList); + } + else + { + updater.addField("templateStatus", 0); + } + + // 插入模版日志 + DesTemplateLog log = new DesTemplateLog(); + log.setLogId(Ids.longId()); + log.setMediaId(mediaId); + log.setOperatorCode(request.getSessionName()); + log.setCreateTime(Sqls.nowTimestamp()); + if ("yes".equals(type)) + { + log.setLogDesc("同意模版审核"); + } + else + { + log.setLogDesc("拒绝模版审核"); + } + ORM.get(ZTable.class).insert(log); + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + // 更新solr数据 + SolrUtil.updateMediaData(mediaId); + } + + /** + * 精品审核 + * + * @param mediaId + * @param type + * @throws Exception + */ + public static void doTemplateBestAudit(HttpRequest request, long mediaId, String type) throws Exception + { + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + if ("yes".equals(type)) + { + updater.addField("templateType", 110); + updater.addField("templateStatus", 0); + + TemplateScoreDao.doTemplateFloatScore(mediaId, TemplateScoreConstants.TEMPLATE_BEST.value());// 模板动态分数计算 + + } + else + { + updater.addField("templateStatus", 0); + } + + // 插入模版日志 + DesTemplateLog log = new DesTemplateLog(); + log.setLogId(Ids.longId()); + log.setMediaId(mediaId); + log.setOperatorCode(request.getSessionName()); + log.setCreateTime(Sqls.nowTimestamp()); + if ("yes".equals(type)) + { + log.setLogDesc("同意精品审核"); + } + else + { + log.setLogDesc("拒绝精品审核"); + } + ORM.get(ZTable.class).insert(log); + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + // 更新solr数据 + SolrUtil.updateMediaData(mediaId); + } + + /** + * 申请系统模板 + * + * @param request + * @throws Exception + */ + public static void doTemplateToSys(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + if (mediaId == -1) + { + return; + } + + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("templateStatus", 1); + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + } + + /** + * 申请精品模板 + * + * @param request + * @throws Exception + */ + public static void doTemplateToBest(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + if (mediaId == -1) + { + return; + } + + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("templateStatus", 1); + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + // 更新solr数据 + SolrUtil.updateMediaData(mediaId); + } + + /** + * 发布模板 + * + * @param request + * @throws Exception + */ + public static void doTemplateToMy(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + if (mediaId == -1) + { + return; + } + MediaTemplate media = ORM.get(ZTable.class).item(MediaTemplate.class, new Selector("mediaId", mediaId)); + if (media == null) + { + request.setResponseError("模板不存在,无法发布!"); + return; + } + if (media.getIndustryId() <= 0 || Validates.isEmpty(media.getIndustrySubIds())) + { + request.setResponseError("请先填写行业,子行业信息!"); + return; + } + + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("templateType", 20); + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + // 更新solr数据 + SolrUtil.updateMediaData(mediaId); + } + + /** + * 取消模板/精品,取消模板需删除solr索引 + * + * @param request + * @throws Exception + */ + public static void doTemplateCancel(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + if (mediaId == -1) + { + return; + } + + int type = request.getParameterInt("type", 0); // 0:取消精品,1:取消模板 + int templateType = 100; + if (type == 1) + {// 取消模板 + templateType = 20; + } + else + { + TemplateScoreDao.doTemplateFloatScore(mediaId, TemplateScoreConstants.TEMPLATE_BEST_CANCEL.value());// 模板动态分数计算 + } + + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addField("templateType", templateType); + + ORM.get(ZTable.class).update(MediaTemplate.class, updater); + // 更新solr数据 + SolrUtil.updateMediaData(mediaId); + + } + + /** + * 新建我的空白模板,并入库 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doCreateMyTemplate(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("typeId", "请选择设计类型")); + request.addValidate(new IsInteger("pageValue", "请选择设计面数")); + request.addValidate(new IsFloat("width", "请输入正确的设计尺寸宽度")); + request.addValidate(new IsFloat("height", "请输入正确的设计尺寸高度")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long typeId = request.getParameterLong("typeId"); + int pageValue = request.getParameterInt("pageValue"); + if (pageValue < 1) + { + request.setResponseError("无效设计单面数"); + return; + } + + String createChannel = request.getParameter("createChannel"); + if (Validates.isEmpty(createChannel)) + { + request.setResponseError("请选择模板类型"); + return; + } + + String bleedSizeStr = request.getParameter("sizeBleed"); + double bleedSize = Double.parseDouble(Validates.isNotEmptyBlank(bleedSizeStr) ? bleedSizeStr : "2"); // 默认出血为2 + int createMode = request.getParameterInt("createMode", 0); // 默认为mm单位 + boolean isModify = request.getParameterBoolean("isModify", false); // 默认不支持修改尺寸 + + // 模基础尺寸 + String baseWidthStr = request.getParameter("baseWidthMm"); + String baseHeightStr = request.getParameter("baseHeightMm"); + double baseWidthMm = Double.parseDouble(baseWidthStr); + double baseHeightMm = Double.parseDouble(baseHeightStr); + + // 设计尺寸 + String widthStr = request.getParameter("width"); + String heightStr = request.getParameter("height"); + double width = Double.parseDouble(widthStr); + double height = Double.parseDouble(heightStr); + String fullWidthStr = request.getParameter("fullWidth"); + String fullHeightStr = request.getParameter("fullHeight"); + double fullWidth = Double.parseDouble(fullWidthStr); + double fullHeight = Double.parseDouble(fullHeightStr); + + long oddEven = request.getParameterLong("oddEven") < 0 ? 0 : request.getParameterLong("oddEven"); + String templateName = Validates.isEmpty(request.getParameter("templateName")) ? "" : request.getParameter("templateName"); + + MediaModel media = MediaDao.createMedia(typeId, baseWidthMm, baseHeightMm, width, height, fullWidth, fullHeight, 300, pageValue, bleedSize, createMode, + isModify, oddEven, templateName); + + // 生成缩略图 + String mediaUrl = MediaDao.createMediaEffect(media.getCanvas().getMediaId()); + media.getCanvas().setMediaUrl(mediaUrl); + media.getCanvas().setCreateTime(DateTimes.getDateTimeString()); + media.getCanvas().setUpdateTime(DateTimes.getDateTimeString()); + + // 模板 + long mediaId = media.getCanvas().getMediaId(); + MediaTemplate template = new MediaTemplate(); + template.setMediaId(mediaId); + template.setTypeId(typeId); + template.setPageValue(pageValue); + template.setCreateChannel(createChannel); + template.setTemplateType(10); // 我的草稿 + template.setTemplateStatus(0); + template.setDesigner(request.getSessionName()); + + ORM.get(ZTable.class).insert(template); + ORM.get(ZTable.class).insert(media.getCanvas()); + ORM.get(ZTable.class).insertBatch(media.getBgList()); + ORM.get(ZTable.class).insertBatch(media.getMediaMaterialList()); + // 添加solr模板数据 + SolrUtil.updateMediaData(mediaId); + request.setResponseResult(String.valueOf(mediaId)); + } + + /** + * 下载订单模板pdf文件 + * + * @param request + * @throws Exception + */ + public static void doDownloadPdf(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mediaId", "不能为空")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long mediaId = request.getParameterLong("mediaId"); + + MediaCanvas media = ORM.get(ZTable.class).item(MediaCanvas.class, mediaId); + if (media == null) + { + request.setResponseError("下载的订单模板不存在"); + return; + } + + List pdfList = PdfDao.getPdfList(media, -1, false, null, null, null, "PDF"); + long id = Ids.longId13(); + String curDate = DateTimes.getDateTime8String(); + + // 合成pdf + String savePath = MediaPathDao.getTempLocalPre(curDate) + id + ".pdf"; + ItextPdfUtil.megerPdf(pdfList, savePath); + + String downloadUrl = MediaPathDao.getTempUrlPre(curDate) + id + ".pdf"; + request.setResponseResult(downloadUrl); + } + + /** + * 下载外部稿件 + * + * @param request + * @throws Exception + */ + public static void checkWorksDownload(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mediaId", "不能为空")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long mediaId = request.getParameterLong("mediaId"); + + List worksFiles = ORM.get(ZTable.class).list(DesWorksFile.class, new Selector("templateId", mediaId)); + if (Validates.isEmpty(worksFiles)) + { + request.setResponseError("该模板【" + mediaId + "】的外部稿件不存在"); + return; + } + + } + + /** + * 模板更新 + * + * @param worksId + * @throws Exception + */ + @AnTransaction + public static void doTemplateUpdate(HttpRequest request) throws Exception + { + long mediaId = request.getParameterLong("mediaId"); + SolrUtil.updateMediaData(mediaId); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/TemplatePreviewPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/TemplatePreviewPresenter.java new file mode 100644 index 0000000..ce8d176 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/TemplatePreviewPresenter.java @@ -0,0 +1,1073 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.onex.IsInteger; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.Base64; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.media.dbo.MediaCanvas; +import com.zhiqim.media.dbo.MediaMaterial; +import com.zhiqim.media.dbo.MediaMaterialParamEx; +import com.zhiqim.media.service.dao.BaiduDao; +import com.zhiqim.media.service.dao.MediaDao; +import com.zhiqim.media.service.dao.MediaPathDao; +import com.zhiqim.media.service.model.MediaModel; +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.dao.DesignSizeDao; +import com.zhiqim.yangcai.design.dao.DesignerOrderDao; +import com.zhiqim.yangcai.design.dao.ParamTypeDao; +import com.zhiqim.yangcai.design.dao.TemplateDao; +import com.zhiqim.yangcai.design.dbo.DesLabelIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignSize; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateEventView; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateIndexView; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateOrder; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateSolrModel; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; +import com.zhiqim.yangcai.design.model.TemplatePreviewModel; +import com.zhiqim.yangcai.util.SolrUtil; + +/** + * 订单预览presenter + * + * @version v1.0.0 @author Deng 2018-3-24 新建与整理 + */ +@AnAlias("TemplatePreviewPresenter") +@AnIntercept("chkZmrLogin") +public class TemplatePreviewPresenter +{ + + private static final Log log = LogFactory.getLog(TemplatePreviewPresenter.class); + + /** + * 查询已选模板 + * + * @param request + * @throws Exception + */ + public static void doTemplateExistQuery(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("designId", "订单ID不能为空")); + request.addValidate(new IsInteger("typeId", "设计类型不能为空")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long designId = request.getParameterLong("designId"); + long typeId = request.getParameterLong("typeId"); + if (designId == -1) + { + request.setResponseError("设计订单信息不存在"); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + } + DesignSize sizeItem = DesignSizeDao.get(order.getTypeId(), order.getDesignWidth(), order.getDesignHeight()); + if (sizeItem == null) + { + request.setResponseError("订单对应尺寸不存在"); + return; + } + DesignType type = ORM.get(ZTable.class).item(DesignType.class, order.getTypeId()); + if (type == null) + { + request.setResponseError("无效设计单类型"); + return; + } + List idList = DesignerOrderDao.getOrderTemplate(designId); + + /* 此处数据用于电子名片设计时在设计页面生成二维码 */ + Boolean orderIsCardType = Boolean.FALSE; + if (order.getTypeId() == 2023207561256L) + { + orderIsCardType = Boolean.TRUE; + } + + // svg展示图 + Map svgMap = TemplateDao.getTemplatePreview(idList); + HashMapSO jsonMap = new HashMapSO(); + jsonMap.put("svgMap", svgMap); + jsonMap.put("paramCat", typeId); + jsonMap.put("designOrder", order); + jsonMap.put("sizeItem", sizeItem); + jsonMap.put("type", type); + jsonMap.put("orderIsCardType", orderIsCardType); + + // pvc名片不补位特殊流程 + if (typeId == 1806070857392601L) + { + if (order.getDesignWidth() == 90 && order.getDesignHeight() == 53) + { + type.setSizeMWidth(90); + type.setSizeMHeight(53); + sizeItem.setSizeBleed(3); + } + else if (order.getDesignWidth() == 88 && order.getDesignHeight() == 57) + { + type.setSizeMWidth(88.5); + type.setSizeMHeight(57); + if (order.getPrintWidth() == 0 && order.getPrintHeight() == 0) + { + order.setPrintHeight(85); + order.setPrintWidth(53.5); + } + sizeItem.setSizeBleed(3.5); + } + else + { + type.setSizeMWidth(88.5); + type.setSizeMHeight(57); + sizeItem.setSizeBleed(3.5); + } + } + + String ret = ZmlContexts.parseZmlPath(request, "/zview/des/presenter/templatePreviewInfo.zml", jsonMap); + request.setResponseResult(ret); + } + + /** + * 为客户查询已选模板 + * + * @param request + * @throws Exception + */ + public static void doTemplateExistQueryForCustomer(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("designId", "订单ID不能为空")); + request.addValidate(new IsInteger("typeId", "设计类型不能为空")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long designId = request.getParameterLong("designId"); + long typeId = request.getParameterLong("typeId"); + if (designId == -1) + { + request.setResponseError("设计订单信息不存在"); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + } + DesignSize sizeItem = DesignSizeDao.get(order.getTypeId(), order.getDesignWidth(), order.getDesignHeight()); + if (sizeItem == null) + { + request.setResponseError("订单对应尺寸不存在"); + return; + } + + List idList = DesignerOrderDao.getOrderTemplate(designId); + + // svg展示图 + Map svgMap = TemplateDao.getTemplatePreview(idList); + HashMapSO jsonMap = new HashMapSO(); + jsonMap.put("svgMap", svgMap); + jsonMap.put("paramCat", typeId); + jsonMap.put("designOrder", order); + jsonMap.put("sizeItem", sizeItem); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/des/presenter/templateCustomerPreviewInfo.zml", jsonMap); + request.setResponseResult(ret); + } + + /** + * 选择模板预览时增加缓存 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doTemplateCacheAdd(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + long mediaId = request.getParameterLong("mediaId"); + int templateNum = ORM.get(ZView.class).count(MediaTemplateView.class, new Selector("designId", designId)); + if (templateNum >= 4) + { + request.setResponseError("最多支持添加4个预览模板"); + return; + } + + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, new Selector("designId", designId).addMust("templateSrc", mediaId)); + if (template != null) + { + request.setResponseError("订单已复制了该模板"); + return; + } + + // 复制订单模板 + if (!TemplateDao.doNewOrderTemplate(designId, mediaId, request.getSessionName())) + { + request.setResponseError("复制模板时失败,mediaId=" + mediaId); + return; + } + } + + /** + * 选择模板删除缓存 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doTemplateCacheDelete(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + long mediaId = request.getParameterLong("mediaId"); + + Selector selector = new Selector(); + selector.addMust("designId", designId); + selector.addMust("templateSrc", mediaId); + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, selector); + if (template != null) + { + // 画布删除 + MediaDao.deleteMedia(template.getMediaId()); + String prePath = MediaPathDao.getCanvasLocalPre(template.getMediaId()); + Files.deleteDirectory(prePath); + + ORM.get(ZTable.class).delete(MediaTemplate.class, template.getMediaId()); + } + } + + /** + * 新建空白订单模板,并入库 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doCreateOrderTemplate(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("designId", "请选择订单")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + String createChannel = request.getParameter("createChannel", "platform_design"); + long designId = request.getParameterLong("designId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (order == null) + { + request.setResponseError("订单【" + designId + "】不存在,请重新选择!"); + return; + } + + int pageValue = order.getDesignPage(); + if (pageValue < 1) + { + request.setResponseError("无效设计单面数"); + return; + } + + long typeId = order.getTypeId(); + double designWidth = order.getDesignWidth(); + double designHeight = order.getDesignHeight(); + double printWidth = order.getPrintWidth(); + double printHeight = order.getPrintHeight(); + + DesignSize sizeItem = DesignSizeDao.get(typeId, designWidth, designHeight); + if (sizeItem == null) + { + request.setResponseError("无效设计单尺寸"); + return; + } + DesignType type = ORM.get(ZTable.class).item(DesignType.class, order.getTypeId()); + if (type == null) + { + request.setResponseError("无效设计单类型"); + return; + } + double bleedSize = sizeItem.getSizeBleed(); + double baseWidthMm = type.getSizeMWidth(); + double baseHeightMm = type.getSizeMHeight(); + + // pvc名片不补位特殊流程 + if (typeId == 1806070857392601L) + { + if (order.getDesignWidth() == 90 && order.getDesignHeight() == 53) + { + designWidth = 90; + designHeight = 53; + baseWidthMm = 90; + baseHeightMm = 53; + bleedSize = 3; + } + else if (order.getDesignWidth() == 88 && order.getDesignHeight() == 57) + { + designWidth = 88.5; + designHeight = 57; + baseWidthMm = 88.5; + baseHeightMm = 57; + bleedSize = 3.5; + } + else + { + designWidth = 88.5; + designHeight = 57; + baseWidthMm = 88.5; + baseHeightMm = 57; + bleedSize = 3.5; + } + } + + if (baseWidthMm <= 0 || baseHeightMm <= 0) + { + request.setResponseError("请先配置产品【" + type.getTypeName() + "】模位尺寸"); + return; + } + + double fullWidth = baseWidthMm * Math.ceil(designWidth / baseWidthMm); + double fullHeight = baseHeightMm * Math.ceil(designHeight / baseHeightMm); + + printWidth = printWidth == 0 ? designWidth : (printWidth + bleedSize); + printHeight = printHeight == 0 ? designHeight : (printHeight + bleedSize); + int createMode = 0; // media 创建模式,0:mm,1:像素 + int dpi = 300; + MediaModel media = MediaDao.createMedia(typeId, designWidth, designHeight, printWidth, printHeight, fullWidth, fullHeight, dpi, pageValue, bleedSize, + createMode, false, 0, ""); + + String designer = order.getDesigner(); + if (Validates.isEmptyBlank(designer)) + { + designer = request.getSessionName(); + } + + // 生成缩略图 + String mediaUrl = MediaDao.createMediaEffect(media.getCanvas().getMediaId()); + media.getCanvas().setMediaUrl(mediaUrl); + media.getCanvas().setCreateTime(DateTimes.getDateTimeString()); + media.getCanvas().setUpdateTime(DateTimes.getDateTimeString()); + + // 模板 + long mediaId = media.getCanvas().getMediaId(); + MediaTemplate template = new MediaTemplate(); + template.setMediaId(mediaId); + template.setTypeId(typeId); + template.setPageValue(pageValue); + template.setTemplateType(0); + template.setTemplateStatus(0); + template.setDesignId(designId); + template.setDesigner(designer); + template.setCreateChannel(createChannel); + + ORM.get(ZTable.class).insert(template); + ORM.get(ZTable.class).insert(media.getCanvas()); + ORM.get(ZTable.class).insertBatch(media.getBgList()); + ORM.get(ZTable.class).insertBatch(media.getMediaMaterialList()); + + /* 此处数据用于电子名片设计时在设计页面生成二维码 */ + Boolean orderIsCardType = Boolean.FALSE; + if (order.getTypeId() == 2023207561256L) + { + orderIsCardType = Boolean.TRUE; + } + + Map jsonMap = new HashMap(); + jsonMap.put("mediaId", mediaId); + jsonMap.put("designWidth", designWidth); + jsonMap.put("designHeight", designHeight); + jsonMap.put("printWidth", printWidth); + jsonMap.put("printHeight", printHeight); + jsonMap.put("printKs", order.getPrintKs()); + jsonMap.put("printMs", order.getPrintMs()); + jsonMap.put("bleedSize", bleedSize); + jsonMap.put("type", type); + jsonMap.put("orderIsCardType", orderIsCardType); + // 添加solr模板数据 + SolrUtil.updateMediaData(mediaId); + request.setResponseResult(Jsons.toString(jsonMap)); + } + + /** + * 模板推荐类型(订单模板推荐,猜你喜欢,我收藏的,热搜排行,老客户模板) + * + * @param request + * @throws Exception + */ + public static void doTemplateTypeQuery(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("designId", "订单ID不能为空")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long designId = request.getParameterLong("designId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("设计订单信息不存在"); + return; + } + + DesignSize sizeItem = DesignSizeDao.get(order.getTypeId(), order.getDesignWidth(), order.getDesignHeight()); + if (sizeItem == null) + { + request.setResponseError("订单对应尺寸不存在"); + return; + } + + long typeId = order.getTypeId(); + int page = request.getParameterInt("page", 1); + int pageSize = 4; + String queryType = request.getParameter("queryType"); + String keyword = request.getParameter("keyword"); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + + MapSO attrMap = new HashMapSO(); + attrMap.put("page", page); + attrMap.put("designId", designId); + attrMap.put("queryType", queryType); + attrMap.put("keyword", keyword); + if ("RECOMMEND".equals(queryType)) + { + PageResult pageResult = doTemplateRecommendQuery(page, pageSize, order); + attrMap.put("pageResult", pageResult); + attrMap.put("page", page); + } + else if ("COLLECT".equals(queryType)) + { + PageResult pageResult = doTemplateCollectQuery(typeId, keyword, page, pageSize, sessionUser.getOperatorCode()); + attrMap.put("pageResult", pageResult); + attrMap.put("page", page); + } + else if ("LIKE".equals(queryType)) + { + PageResult pageResult = doTemplateLikeQuery(typeId, page, pageSize, sessionUser.getOperatorCode()); + attrMap.put("pageResult", pageResult); + attrMap.put("page", page); + } + else if ("OLD".equals(queryType)) + {// 老客户模板 + PageResult pageResult = doQueryOldUserTemplate(designId, order.getBuyerNick(), typeId, page, pageSize); + attrMap.put("pageResult", pageResult); + attrMap.put("page", page); + } + else if ("KEYWORD".equals(queryType)) + { + String sort = request.getParameter("sort"); + PageResult pageResult = null; + PageResult solrPageResult = null; + if (Validates.isNumericLen(keyword, 13, 19)) + {// 纯id查询本地 + Selector sel = new Selector(); + sel.addMustThenGE("templateType", 100); + sel.addMust("mediaId", Long.parseLong(keyword)); + sel.addMaybe("typeId", typeId); + pageResult = ORM.get(ZView.class).page(MediaTemplateView.class, page, pageSize, sel); + } + else + {// solr查询 + Map param = new HashMap<>(); + param.put("typeId", String.valueOf(typeId)); + param.put("keyword", keyword); + param.put("sort", sort); + solrPageResult = SolrUtil.queryAllTemplate(page, pageSize, param); + } + + List subIndustryList = ORM.get(ZTable.class).list(DesLabelIndustry.class, new Selector("industryId", order.getIndustryId())); + + attrMap.put("pageResult", pageResult); + if (pageResult == null && solrPageResult != null) + { + attrMap.put("pageResult", solrPageResult); + } + attrMap.put("subIndustryList", subIndustryList); + attrMap.put("page", page); + attrMap.put("sort", sort); + } + + List idList = new ArrayList(); + List mediaList = ORM.get(ZView.class).list(MediaTemplateView.class, new Selector("designId", designId)); + for (MediaTemplateView temp : mediaList) + { + if (temp.getTemplateSrc() > 0) + { + idList.add(temp.getTemplateSrc()); + } + } + attrMap.put("idList", idList); + attrMap.put("sizeItem", sizeItem); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/des/presenter/templateQueryInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * 订单模板推荐 + * + * @param page + * @param pageSize + * @param order + * @param product + * @return + * @throws Exception + */ + private static PageResult doTemplateRecommendQuery(int page, int pageSize, DesignOrder order) throws Exception + { + + Selector selector = new Selector(); + selector.addMust("typeId", order.getTypeId()); + selector.addMustLike("shareDept", "," + order.getDesigner() + ","); + PageResult pageResult = ORM.get(ZView.class).page(DesTemplateIndexView.class, page, pageSize, selector); + + // 排序,降序 + Collections.sort(pageResult.list(), new Comparator() + { + @Override + public int compare(DesTemplateIndexView o1, DesTemplateIndexView o2) + { + return o2.getMediaScore() - o1.getMediaScore(); + } + }); + + return pageResult; + } + + /** + * 我收藏的模板 + * + * @param typeId + * @param page + * @param operatorCode + * @return + * @throws Exception + */ + private static PageResult doTemplateCollectQuery(long typeId, String keyword, int page, int pageSize, String operatorCode) + throws Exception + { + Selector selector = new Selector(); + // selector.addMustInLong("templateType", 100, 110); + selector.addMust("typeId", typeId); + selector.addMust("operatorCode", operatorCode); + selector.addMust("eventType", 2); + if (Validates.isInteger(keyword) && keyword.length() > 10) + { + selector.addMaybe("mediaId", Long.parseLong(keyword)); + } + else if (Validates.isNotEmpty(keyword)) + { + Selector selector2 = new Selector().addMaybeLike("attributeName", keyword).addMaybeLike("keywordName", keyword); + selector.addOr(selector2); + } + selector.addOrderbyDesc("updateTime"); + PageResult pageResult = ORM.get(ZView.class).page(DesTemplateEventView.class, page, pageSize, selector); + + return pageResult; + } + + /** + * 我喜欢的 + * + * @param operatorCode + * @param typeId + * @return + * @throws Exception + */ + private static PageResult doTemplateLikeQuery(long typeId, int page, int pageSize, String operatorCode) throws Exception + { + List longList = new ArrayList(); + + Selector selector = new Selector(); + selector.addMustInLong("templateType", 100, 110); + selector.addMust("typeId", typeId); + selector.addMust("operatorCode", operatorCode); + List allList = ORM.get(ZView.class).list(DesTemplateEventView.class, selector); + for (DesTemplateEventView event : allList) + { + if (!longList.contains(event.getMediaId())) + { + longList.add(event.getMediaId()); + } + } + + PageResult pageResult = PageBuilder.pageResult(page, pageSize, doLikeList(longList, page, pageSize)); + + return pageResult; + } + + /** + * 查询老客户模板 + * + * @param designId + * @param buyerNick + * @param typeId + * @param page + * @param pageSize + * @return + * @throws Exception + */ + private static PageResult doQueryOldUserTemplate(long designId, String buyerNick, long typeId, int page, int pageSize) throws Exception + { + Selector selector = new Selector(); + selector.addMust("typeId", typeId); + selector.addMust("buyerNick", buyerNick); + selector.addMustIsNotNull("designer"); + selector.addMustNotEqual("designId", designId); // 排除自己 + selector.addOrderbyDesc("createTime"); + PageResult result = ORM.get(ZTable.class).page(DesignOrder.class, 1, 10, selector); + + if (result.isEmpty()) + { + return PageBuilder.newResult(pageSize); + } + + List designIdList = new ArrayList<>(); + for (DesignOrder temp : result.list()) + { + designIdList.add("" + temp.getDesignId()); + } + + Selector sel = new Selector(); + sel.addMust("typeId", typeId); + sel.addMustThenGE("templateType", 80); // 订单模板 + sel.addMustIsNotNull("designId"); + sel.addMustIn("designId", Arrays.toArray(designIdList, String.class)); + PageResult pageResult = ORM.get(ZView.class).page(MediaTemplateView.class, page, pageSize, sel); + + return pageResult; + } + + /** + * 根据模板的关键词,选出相似模板,再计算模板关键词与相似模板关键词向量相似性大于50% + * + * @param allList + * @throws Exception + */ + private static List doLikeList(List allList, int page, int pageSize) throws Exception + { + List mediaList = new ArrayList(); + for (long mediaId : allList) + { + DesTemplateIndexView index = ORM.get(ZView.class).item(DesTemplateIndexView.class, new Selector("mediaId", mediaId)); + if (index == null) + { + continue; + } + + mediaList.add(index); + } + + // 组装新的模板列表,按模板指数降序 + Collections.sort(mediaList, new Comparator() + { + @Override + public int compare(DesTemplateIndexView o1, DesTemplateIndexView o2) + { + return o2.getMediaScore() - o1.getMediaScore(); + } + }); + + return mediaList; + } + + /** + * 客户文本数据分析 + * + * @param request + * @return + * @throws Exception + */ + public static void doParseParamData(HttpRequest request) throws Exception + { + int type = request.getParameterInt("type", 1); // 默认百度分词 + String paramData = request.getParameterNoFilter("paramData"); + if (type == 1) + { + try + {// 百度词法分析,异常调用原处理方法 + paramData = paramData.replace("\r\n", "/"); + paramData = paramData.replace("\n", "/"); + request.setResponseResult(Jsons.toString(BaiduDao.parseText2(paramData))); + return; + } + catch (Exception e) + { + log.error("百度智能分析客户文本数据异常" + e.getMessage(), e); + } + } + + String[] PHASE_FORMAT = + { + "\r\n", "\n" + };// 常用分段分隔字符 + String[] PHASE_SPLIT_FORMAT = + { + "\t", "。", ",", ",", ";", ";" + }; // 段落文本分隔字符 + String[] PHASE_SPLIT_CHAR_FORMAT = + { + ":", ":", " " + };// 文本单字符 + + if (!Validates.isStrContainStrArr(paramData, PHASE_FORMAT) && !Validates.isStrContainStrArr(paramData, PHASE_SPLIT_FORMAT) + && !Validates.isStrContainStrArr(paramData, PHASE_SPLIT_CHAR_FORMAT)) + { + request.setResponseError("不支持单行格式分析"); + return; + } + + List phaseList = new ArrayList(); + List textList = new ArrayList(); + List charList = new ArrayList(); + List dataList = new ArrayList(); + + // 1.在多种分隔符情况下,获取内容值 + if (Validates.isStrContainStrArr(paramData, PHASE_FORMAT)) + { + String[] phaseStr = ParamTypeDao.doContentSplit(paramData, PHASE_FORMAT);// 段落 + if (phaseStr != null) + { + phaseList = ParamTypeDao.doDataStrList(phaseStr); + } + } + else + { + if (Validates.isStrContainStrArr(paramData, PHASE_SPLIT_FORMAT)) + {// 存在 + String[] textStr = ParamTypeDao.doContentSplit(paramData, PHASE_SPLIT_FORMAT);// 段落 + if (textStr != null) + { + textList = ParamTypeDao.doDataStrList(textStr); + } + } + else + {// 不存在 + if (Validates.isStrContainStrArr(paramData, PHASE_SPLIT_CHAR_FORMAT)) + { + String[] characterStr = ParamTypeDao.doContentSplit(paramData, PHASE_SPLIT_CHAR_FORMAT); // 段段文本字节 + if (characterStr != null) + { + charList = ParamTypeDao.doDataStrList(characterStr); + } + } + } + } + + if (phaseList.size() > 0) + { + // 分析每一段落 + for (int i = 0; i < phaseList.size(); i++) + { + String argStr = phaseList.get(i).trim(); + if (Validates.isStrContainStrArr(argStr, PHASE_SPLIT_FORMAT)) + {// 存在段落文本分隔字符 + String[] textStr = ParamTypeDao.doContentSplit(argStr, PHASE_SPLIT_FORMAT); // 段落文本 + if (textStr == null) + { + continue; + } + + List strList = ParamTypeDao.doDataStrList(textStr); + for (String args : strList) + { + // 分析单字符 + dataList.addAll(ParamTypeDao.ChkPhaseChar(args, PHASE_SPLIT_CHAR_FORMAT)); + } + } + else + { + // 分析单字符 + dataList.addAll(ParamTypeDao.ChkPhaseChar(argStr, PHASE_SPLIT_CHAR_FORMAT)); + } + } + } + + if (textList.size() > 0) + { + // 分析每一段落文本 + for (int i = 0; i < textList.size(); i++) + { + String argStr = textList.get(i).trim(); + dataList.addAll(ParamTypeDao.ChkPhaseChar(argStr, PHASE_SPLIT_CHAR_FORMAT)); + } + } + + if (charList.size() > 0) + { + // 分析单字符 + for (int i = 0; i < charList.size(); i++) + { + String argStr = charList.get(i).trim(); + dataList.addAll(ParamTypeDao.ChkPhaseChar(argStr, PHASE_SPLIT_CHAR_FORMAT)); + } + } + + request.setResponseResult(Jsons.toString(dataList)); + } + + /** + * 模板参数替换 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doTemplateReplaceParam(HttpRequest request) throws Exception + { + long paramCat = request.getParameterLong("paramCat", 1); + long designId = request.getParameterLong("designId"); + long typeId = request.getParameterLong("typeId"); + long industryId = request.getParameterLong("industryId"); + String paramData = request.getParameter("paramData"); + + // 查询已选模板 + List templateList = ORM.get(ZView.class).list(MediaTemplateView.class, new Selector("designId", designId)); + if (templateList.isEmpty()) + { + request.setResponseError("请选择模板"); + return; + } + + if (templateList.size() > 4) + { + request.setResponseError("已择模板不能超过4个,请根据实际需要选择."); + return; + } + + List mediaIdList = new ArrayList<>(); + for (MediaTemplateView media : templateList) + { + mediaIdList.add(media.getMediaId()); + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + } + DesignSize sizeItem = DesignSizeDao.get(order.getTypeId(), order.getDesignWidth(), order.getDesignHeight()); + if (sizeItem == null) + { + request.setResponseError("订单对应尺寸不存在"); + return; + } + + // 增加或更新订单模板参数数据,便于保存 + DesTemplateOrder orderTemplate = ORM.get(ZTable.class).item(DesTemplateOrder.class, designId); + if (orderTemplate == null) + { + orderTemplate = new DesTemplateOrder(); + orderTemplate.setDesignId(designId); + orderTemplate.setTypeId(typeId); + orderTemplate.setIndustryId(industryId); + orderTemplate.setParamText(paramData); + + ORM.get(ZTable.class).insert(orderTemplate); + log.info("增加订单[" + designId + "]模板参数成功,参数:" + paramData); + } + else + { + Updater paramUpdater = new Updater(); + paramUpdater.addMust("designId", designId); + paramUpdater.addField("paramText", paramData); + ORM.get(ZTable.class).update(DesTemplateOrder.class, paramUpdater); + log.info("更新订单[" + designId + "]模板参数成功,参数:" + paramData); + } + + Map replaceMap = TemplateDao.doParseReplaceData(paramCat, paramData); + if (replaceMap.isEmpty()) + { + request.setResponseError("未匹配到有效参数"); + return; + } + + log.info("解析订单[" + designId + "]客户文本数据成功,replaceMap:" + replaceMap); + + for (long mediaId : mediaIdList) + { + // 替换素材参数值 + List exList = ORM.get(ZView.class).list(MediaMaterialParamEx.class, new Selector("mediaId", mediaId)); + for (MediaMaterialParamEx ex : exList) + { + MediaMaterialParamEx ext = TemplateDao.replaceMaterialParam(ex, replaceMap); + + Updater updater = new Updater(); + updater.addMust("mediaId", mediaId); + updater.addMust("bid", ext.getBid()); + updater.addMust("mid", ext.getMid()); + updater.addField("source", ext.getSource()); + + ORM.get(ZTable.class).update(MediaMaterial.class, updater); + } + + // 替换效果图 + String mediaUrl = MediaDao.createMediaEffect(mediaId); + Updater mupdater = new Updater(); + mupdater.addMust("mediaId", mediaId); + mupdater.addField("mediaUrl", mediaUrl); + mupdater.addField("updateTime", DateTimes.getDateTimeString()); + ORM.get(ZTable.class).update(MediaCanvas.class, mupdater); + } + + // svg展示图 + Map svgMap = TemplateDao.getTemplatePreview(mediaIdList); + HashMapSO jsonMap = new HashMapSO(); + jsonMap.put("svgMap", svgMap); + jsonMap.put("paramCat", paramCat); + jsonMap.put("designOrder", order); + jsonMap.put("sizeItem", sizeItem); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/des/presenter/templatePreviewInfo.zml", jsonMap); + request.setResponseResult(ret); + } + + /** + * 上传待识别图片 + * + * @param request + * @throws Exception + */ + public static void doUploadOcrImage(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("data", "请选择图片")); + request.addValidate(new IsNotEmpty("suffix", "扩展名不能为空")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + String data = request.getParameter("data"); + String suffix = request.getParameter("suffix"); + + int idx = data.indexOf(","); + byte[] bytes = Base64.decode(data.substring(idx + 1)); + + String curDate = DateTimes.getDateTime8String(); + String filePath = MediaPathDao.getTempLocalPre(curDate) + Ids.longId13() + "." + suffix; + + boolean isSuccess = Files.write(filePath, bytes); + if (!isSuccess) + { + request.setResponseError("图片保存失败,请重新上传"); + return; + } + + List dataList = BaiduDao.generalOcr(filePath); + if (dataList.isEmpty()) + { + request.setResponseError("未识别到有效文字"); + return; + } + + request.setResponseResult(Lists.toString(dataList, "\r\n")); + } + + /** + * 保存识别文本 + * + * @param request + * @throws Exception + */ + public static void doSaveOcrText(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("designId", "订单ID不能为空")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long designId = request.getParameterLong("designId"); + String ocrText = request.getParameter("ocrText"); + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + } + + DesTemplateOrder desOrder = ORM.get(ZTable.class).item(DesTemplateOrder.class, designId); + if (desOrder == null) + { + desOrder = new DesTemplateOrder(); + desOrder.setDesignId(designId); + desOrder.setOcrText(ocrText); + desOrder.setTypeId(order.getTypeId()); + desOrder.setIndustryId(order.getIndustryId()); + + ORM.get(ZTable.class).insert(desOrder); + } + else + { + Updater paramUpdater = new Updater(); + paramUpdater.addMust("designId", designId); + paramUpdater.addField("ocrText", ocrText); + ORM.get(ZTable.class).update(DesTemplateOrder.class, paramUpdater); + } + } + + /** + * 根据订单id获取行业名称 + * + * @param request + * @throws Exception + */ + public static void doReFreshIndustryInfo(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + } + String industryName = Global.get(DesignIndustryCache.class).getIndustryName(order.getIndustryId()); + request.setResponseResult(Jsons.toString(industryName)); + + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/UploadFilePresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/UploadFilePresenter.java new file mode 100644 index 0000000..30e56ea --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/UploadFilePresenter.java @@ -0,0 +1,790 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.imageio.ImageIO; + +import org.icepdf.core.pobjects.Document; +import org.icepdf.core.pobjects.Page; +import org.icepdf.core.util.GraphicsRenderingHints; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.httpclient.HttpDownload; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Day; +import org.zhiqim.kernel.schedule.Scheduler; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.uploadlarge.ZulConstants; +import org.zhiqim.uploadlarge.dbo.UpllFile; + +import com.itextpdf.text.pdf.PdfReader; +import com.itextpdf.text.pdf.parser.PdfTextExtractor; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OrderCheckDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.utils.BaseUtil; +import com.zhiqim.yangcai.design.task.TempFileDeleteTask; + +/** + * 上传ajax处理 + * + * @author zhouwenbin + * + */ +@AnAlias("UploadFilePresenter") +@AnIntercept("chkZmrLogin") +public class UploadFilePresenter implements ZulConstants +{ + public static final String TEMP_FOLDER = "./temp/"; + private static final Log log = LogFactory.getLog(UploadFilePresenter.class); + private static TempFileDeleteTask deleteTempFileTask = TempFileDeleteTask.getInstance(); + public static float MM = 2.83464579439252f;// pdf尺寸转毫米的系数 + + /** + * 上传处理 + * + * @param request + * @param oid + * @param fileId + * @throws Exception + */ + public static void doUplaodFile(HttpRequest request, long designId, String fileId, String fileType) throws Exception + { + if (!FileTypeConstants.isExist(fileType)) + { + request.setResponseError("不支持上传" + fileType); + return; + } + + UpllFile file = ORM.get(ZTable.class).item(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + String fileName = file.getFileName(); + String fileExt = Files.getFileExt(fileName); + if (Validates.isEmpty(fileExt)) + { + request.setResponseError("请检查文件扩展名是否正确,扩展名:" + fileExt); + return; + } + + long attaId = Ids.longId(); + int count = doFileCount(designId, fileName, fileType); + if (count == 0) + { + // 插入订单附属表 + DesignAtta atta = new DesignAtta(); + atta.setAttaId(attaId); + atta.setAttaModul(fileType); + atta.setDesignId(designId); + atta.setFileName(file.getFileName()); + atta.setFileType(file.getFileExt()); + atta.setFileSize(file.getFileLength()); + atta.setSavePath(file.getFilePath()); + atta.setUploadTime(Sqls.nowTimestamp()); + atta.setOperatorCode(request.getSessionName()); + atta.setFileid(fileId); + + ORM.get(ZTable.class).insert(atta); + + // 插入日志 + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "上传" + FileTypeConstants.getName(fileType) + "文件", + EventConstants.ORDER_16.value()); + if (FileTypeConstants.FILE_END.value().equals(fileType) && "pdf".equals(file.getFileExt())) + {// 成品文件检测 + String ret = OrderCheckDao.doCheckFile(designId, fileName, fileType); + if (Validates.isNotEmpty(ret)) + { + OrderCheckDao.doDeleteEndFile(atta); + OrderLogDao.saveOrderOperateLog(designId, request.getSessionName(), "文件审核失败自动删除", EventConstants.ORDER_16.value()); + + request.setResponseError(ret); + return; + } + } + } + + // 订单客户文件 + Selector selector = new Selector(); + selector.addMust("designId", designId); + selector.addMust("attaModul", fileType); + List tlist = ORM.get(ZTable.class).list(DesignAtta.class, selector); + + Map jsonMap = new HashMap(); + jsonMap.put("attaList", tlist); + jsonMap.put("uploadAttaId", attaId); + + request.setResponseResult(Jsons.toString(jsonMap)); + } + + /*** + * 下载 + * + * @param request + * @throws Exception + * @editor HuangZhiGao + * @date 2020/3/3 15:18 + * @description 当订单号(designId)和下载文件的类型(fileType)不为空时,下载对应订单对应类型的文件 + */ + public static void doDownloadFile(HttpRequest request) throws Exception + { + long designId = request.getParameterLong("designId"); + String fileType = request.getParameter("fileType", ""); + + if (designId != -1L && Validates.isNotEmptyBlank(fileType)) + { + Selector selector = new Selector("designId", designId); + selector.addMust("attaModul", fileType); + List fileList = ORM.get(ZTable.class).list(DesignAtta.class, selector); + + if (Validates.isEmpty(fileList) || fileList.size() == 0) + { + request.setResponseError("当前订单没有" + FileTypeConstants.get(fileType).desc()); + return; + } + else + { + StringBuffer attaIdsBf = new StringBuffer(""); + for (DesignAtta file : fileList) + { + attaIdsBf.append(file.getAttaId()).append(","); + } + String attaIds = Strings.trimRight(attaIdsBf.toString(), ","); + + MapSO attrMap = new HashMapSO(); + attrMap.put("attaIds", attaIds); + HttpResponse response = request.getResponse(); + response.print(Jsons.toString(attrMap)); + + doDowloadFile(attaIds); + } + } + else + { + doDowloadFile(request.getParameter("attaId")); + } + + // 启动临时文件删除任务 每天早上在 5:29:59 执行 + if (!deleteTempFileTask.isRunning()) + { + Scheduler scheduler = Global.getWithoutNew(Scheduler.class); + scheduler.create(); + scheduler.addTask(new Day(deleteTempFileTask, 5, 29, 59)); + deleteTempFileTask.setRunning(true); + } + } + + private static void doDowloadFile(String attaIds) throws Exception + { + List attaIdList = Lists.toStringList(attaIds); + Iterator iterator = attaIdList.iterator(); + while (iterator.hasNext()) + {// 不是整形 + if (!Validates.isNumeric(iterator.next())) + { + iterator.remove(); + } + } + + if (attaIdList.size() == 0) + { + return; + } + + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector().addMustInLong("attaId", Arrays.toLongArray(Lists.toString(attaIdList)))); + for (DesignAtta atta : attaList) + { + // 1.查看临时文件 + String tempFileDir = UploadFilePresenter.getCurrentTempFolder(Strings.addEndsWith(atta.getAttaModul(), "/")); + File tempFile = new File(tempFileDir + atta.getAttaId() + Strings.addStartsWith(atta.getFileType(), ".")); + if (tempFile.exists() && tempFile.isFile()) + { + continue; + } + + // 2.查看本地文件 + if (Validates.isNotEmptyBlank(atta.getSavePath())) + { + File file = new File(atta.getSavePath()); + if (file.exists() && file.isFile()) + { + continue; + } + } + + // 3.查看网络文件 + if (Validates.isUrl(atta.getOssUrl())) + { + HttpDownload download = new HttpDownload(atta.getOssUrl()); + download.setConnectTimeout(30); + download.setReadTimeout(50 * 60); + download.setFileDir(tempFileDir); + download.setFileName(tempFile.getName()); + download.execute(); + } + } + + } + + /** + * 文件是否已上传 + * + * @param request + * @param fileId + * @return + * @throws Exception + */ + public static int doFileCount(long designId, String fileName, String attaModul) throws Exception + { + int status = 0; + + Selector selector = new Selector(); + selector.addMust("designId", designId); + selector.addMust("attaModul", attaModul); + if (!FileTypeConstants.FILE_END.value().equals(attaModul)) + { + selector.addMust("fileName", fileName); + } + if (ORM.get(ZTable.class).count(DesignAtta.class, selector) > 0) + { + status = 1; + } + + return status; + } + + /** + * 删除文件 + * + * @param str + * @return + * @throws Exception + */ + public static void doDeleteFile(HttpRequest request, String strs) throws Exception + { + long[] attaidArr = Arrays.toLongArray(strs); + if (attaidArr.length <= 0) + { + request.setResponseError("删除文件数据不存在"); + return; + } + + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, new Selector().addMustInLong("attaId", attaidArr)); + for (DesignAtta atta : attaList) + { + long designId = atta.getDesignId(); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单不存在"); + return; + } + + if (order.getStatus() >= StatusConstants.ORDER_60.value() && !atta.getAttaModul().equals(FileTypeConstants.FILE_AFTE_COMPLAIN_EVIDENCE.value())) + {// 非售后 凭证文件不允许删除 + request.setResponseError("订单已审,不允许删除订单文件"); + return; + } + + OrderCheckDao.doDeleteAttaFile(atta); + OrderLogDao.saveOrderOperateLog(atta.getDesignId(), request.getSessionName(), "删除上传的[" + atta.getAttaModul() + "]文件", + EventConstants.ORDER_20.value()); + } + + request.setResponseResult("删除成功"); + } + + /** + * 文件命名检测 + * + * @param request + * @param billId + * @param fileType + * @param fileName + * @throws Exception + */ + public static void doCheckFileName(HttpRequest request, long designId, String fileType, String fileName) throws Exception + { + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + request.setResponseError("订单不存在-" + designId); + return; + } + + if (FileTypeConstants.FILE_END.value().equals(fileType)) + { + Int ret = OrderCheckDao.checkFileName(fileName, "" + designId, order.getBuyerNick(), order.getUserContact()); + if (ret.value() == -1) + { + request.setResponseError(ret.desc()); + return; + } + } + else + {// 非成品文件不允许重复上传 + int count = doFileCount(designId, fileName, fileType); + if (count > 0) + { + request.setResponseError("文件已上传,无需重复上传"); + return; + } + } + + } + + /** + * + * [简要描述] 成品文件选择回调校验:
            + * [详细描述]:
            + * + * @author gjx + */ + public static String doEndFileSelectedCheck(DesignOrder order, String path) + { + if (order == null) + { + return "订单不存在"; + } + + long designId = order.getDesignId(); + if (path == null) + { + return "文件审核失败,系统找不到指定的文件"; + } + + File file = new File(path); + if (!file.exists()) + { + return "文件审核失败,系统找不到指定的文件"; + } + + PdfReader readerN = null; + try + { + // 文字转曲判断 + readerN = new PdfReader(path); + int nrPages = readerN.getNumberOfPages(); + for (int i = 1; i < nrPages; i++) + { + String text = PdfTextExtractor.getTextFromPage(readerN, i); + if (text != null && !"".equals(text)) + { + return ("文件审核失败,第" + i + "页有文字未转曲!"); + } + } + } + catch (Exception e) + { + log.error("文件审核异常[" + designId + "]:" + e.getMessage(), e); + return "文件审核失败,有文字未转曲或编码异常!"; + } + catch (Error e) + { + log.error("文件审核异常[" + designId + "]:" + e.getMessage(), e); + return "文件审核失败,有文字未转曲或编码异常!"; + } + finally + { + if (readerN != null) + { + readerN.close(); + } + } + + // 透明PVC,并且是印白墨后加工的情况,不判断版面数量,因为有白墨版,比较特殊 --caohong + if (order.getTypeId() == 1806070857392601L && order.getAfterNames() != null && order.getAfterNames().contains("印白墨")) + { + return ""; + } + + int pageValue = order.getDesignPage(); + double stdWidth = order.getDesignWidth(); + double stdHeight = order.getDesignHeight(); + + // 优惠券产品需要特殊处理,由于录单去掉了模位计算操作,审核的时候需要使用名片标准尺寸来检查内容。--caohong 2019-11-12 + if ("1710131129568467".equals(String.valueOf(order.getTypeId()))) + { + stdWidth = 92; + stdHeight = 56; + + double tmpWidth = order.getDesignWidth(); + double tmpHeight = order.getDesignHeight(); + if (order.getPrintWidth() > 0 && order.getPrintHeight() > 0) + { + tmpWidth = order.getPrintWidth(); + tmpHeight = order.getPrintHeight(); + } + // 临时计算模位用于计算检测 + int ms; + try + { + ms = BaseUtil.calcMod("92X56", new Double(tmpWidth).intValue(), new Double(tmpHeight).intValue(), 0); + order.setPrintMs(ms); + } + catch (Exception e) + { + log.error("文件审核异常[" + designId + "]:" + e.getMessage(), e); + return "优惠券产品计算模数失败"; + } + + } + + // 画册产品不需要检查内容,比较复杂 + if (!"3".equals(String.valueOf(order.getTypeId()))) + { + Document document = new Document(); + try + { + document.setFile(path); + int pageTotal = document.getNumberOfPages(); + if (pageTotal < 1) + { + return "文件审核失败,成品文件无页面"; + } + + // 总页数%单或双面 + if (pageTotal % pageValue != 0) + { + return "文件审核失败,成品文件页数错误"; + } + + float firstWidth = 0f, firstHeight = 0f; + + boolean flag = false; + float scale = 1f; + float rotation = 0f; + + // 获取第一条文件尺寸 + BufferedImage oneImage = document.getPageImage(0, GraphicsRenderingHints.SCREEN, Page.BOUNDARY_CROPBOX, rotation, scale); + firstWidth = oneImage.getWidth() / MM; + firstHeight = oneImage.getHeight() / MM; + + for (int i = 1; i < pageTotal; i++) + { + BufferedImage image = document.getPageImage(i, GraphicsRenderingHints.SCREEN, Page.BOUNDARY_CROPBOX, rotation, scale); + if (Math.abs(image.getWidth() / MM - firstWidth) >= 0.1) + { + return "文件审核失败,第" + i + "页,尺寸错误,实际宽:" + firstWidth + ",期望宽:" + stdWidth; + } + + if (Math.abs(image.getHeight() / MM - firstHeight) >= 0.1) + { + return "文件审核失败,第" + i + "页,尺寸错误,实际高:" + firstHeight + ",期望高:" + stdHeight; + } + } + + // 误差不超过0.1,则收为整数 + firstWidth = Math.round(firstWidth); + firstHeight = Math.round(firstHeight); + + // 根据面积判断是否符合规则 92*56 3款2模 92*56*6 + float rate = (float) Math + .abs((firstWidth * firstHeight * pageTotal / pageValue) - (stdWidth * stdHeight * order.getPrintMs() * order.getPrintKs())); + if (rate < 0.1) + { + flag = true; + } + + if (!flag) + { + return "文件审核失败,尺寸或模数错误"; + } + } + catch (Exception e) + { + log.error("[订单" + designId + "]成品文件审核异常," + e.getMessage(), e); + return "文件审核异常,请重新上传."; + } + finally + { + document.dispose(); + } + } + return null; + + } + + /** 获取OSS文件网络路径 */ + public static void doGetOssFileUrl(HttpRequest request) throws Exception + { + long attaid = request.getParameterLong("attaId", 0); + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, new Selector("attaId", attaid)); + String viewFileUrl = ""; + if (atta != null && Validates.isNotEmptyBlank(atta.getOssUrl())) + { + viewFileUrl = atta.getOssUrl(); + } + + request.setResponseResult(viewFileUrl); + } + + /** + * 获取成品文件pdf页数 + * + * @param request + * @throws Exception + */ + public static void getPdfPages(HttpRequest request) throws Exception + { + long attaId = request.getParameterLong("attaId", 0); + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, attaId); + if (atta == null) + { + request.setResponseError("文件不存在"); + return; + } + + int pages = getPdfThumbnailPages(atta); + request.setResponseResult("" + pages); + } + + /*** + * 创建成品文件缩略图 + * + * @param atta 附件信息 + * @return 返回缩略图 页数数 + * @throws Exception + */ + public static int getPdfThumbnailPages(DesignAtta atta) throws Exception + { + int page = 0; + if (!"pdf".equalsIgnoreCase(atta.getFileType())) + { + return page; + } + + page = getThumFileNames(atta).size(); + if (page > 0) + { + return page; + } + + // 1.本地存在 临时文件 + String tempFilePath = Strings.addEndsWith(getCurrentTempFolder(Strings.addEndsWith(FileTypeConstants.FILE_END.value(), "/")), "/") + atta.getAttaId() + + Strings.addStartsWith(atta.getFileType(), "."); + File tempFile = new File(tempFilePath); + if (tempFile.exists() && tempFile.isFile()) + { + return crateTempThumbnail(atta.getAttaId(), tempFile); + } + + // 2.本地 存储路径文件 + if (Validates.isNotEmptyBlank(atta.getSavePath())) + { + File file = new File(atta.getSavePath()); + if (file.exists() && file.isFile()) + { + return crateTempThumbnail(atta.getAttaId(), file); + } + } + + // 3.下载一份 + if (Validates.isNotEmptyBlank(atta.getOssUrl())) + { + doDowloadFile("" + atta.getAttaId()); + tempFile = new File(tempFilePath); + if (tempFile.exists() && tempFile.isFile()) + { + return crateTempThumbnail(atta.getAttaId(), tempFile); + } + } + + // 启动临时文件删除任务 每天早上在 5:29:59 执行 + if (!deleteTempFileTask.isRunning()) + { + Scheduler scheduler = Global.getWithoutNew(Scheduler.class); + scheduler.create(); + scheduler.addTask(new Day(deleteTempFileTask, 5, 29, 59)); + deleteTempFileTask.setRunning(true); + } + + return page; + } + + /*** + * 获取缩略图 + * + * @param atta 附件信息 + * @return 返回附件对应的缩略图文件名列表 + * @throws Exception + */ + public static List getThumFileNames(DesignAtta atta) throws Exception + { + File fileFolder = new File(Strings.addEndsWith(getCurrentTempFolder(Strings.addEndsWith(FileTypeConstants.FILE_THUMFILE.value(), "/")), "/")); + + List list = new ArrayList(); + if (!fileFolder.exists()) + { + return list; + } + + if (fileFolder.isDirectory()) + { + File[] files = fileFolder.listFiles(); + if (null != files) + { + for (File tempFile : files) + { + String tempFileName = Files.getFileName(tempFile.getCanonicalPath()); + String prefix = atta.getAttaId() + Strings.addStartsWith(FileTypeConstants.FILE_THUMFILE.value(), "-"); + if (Strings.startsWith(tempFileName, prefix)) + { + list.add(tempFileName); + } + } + } + } + + return list; + } + + /*** + * 生成临时 缩略图 + * + * @param attaId 附件编号 + * @param file pdf文件 + * @return pdf 页数 + * @throws Exception 异常 + */ + private static int crateTempThumbnail(long attaId, File file) throws Exception + { + int page = 0; + if (file == null || !file.exists() || file.isDirectory()) + { + return page; + } + if (!"pdf".equalsIgnoreCase(Files.getFileExt(file.getCanonicalPath()))) + { + return page; + } + + if (file.exists()) + {// 生成缩略图 + Document document = new Document(); + document.setFile(file.getCanonicalPath()); + int totalPage = document.getNumberOfPages(); + + float scale = 2f; + float rotation = 0f; + + String thumFilePath = Strings.addEndsWith(getCurrentTempFolder(FileTypeConstants.FILE_THUMFILE.value()), "/"); + for (int i = 0; i < totalPage; i++) + { + + String thumFileName = thumFilePath + attaId + "-" + FileTypeConstants.FILE_THUMFILE.value() + "-" + (i + 1) + ".png"; + try + { + BufferedImage image = document.getPageImage(i, GraphicsRenderingHints.SCREEN, Page.BOUNDARY_CROPBOX, rotation, scale); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ImageIO.write(image, "png", out); + byte[] imgb = out.toByteArray(); + Files.write(thumFileName, imgb); + page++; + } + catch (Exception e) + { + log.error("订单[" + attaId + "]缩略图page=" + i + "生成异常:", e); + } + } + } + + return page; + } + + /*** + * 获取当天临时文件目录 + * + * @return 例:./temp/20180112/ + */ + public static String getCurrentTempFolder(String fileModel) + { + String date = DateTimes.getDateTime8String(); + String folder = Strings.addEndsWith(TEMP_FOLDER, "/") + date; + folder = Strings.addEndsWith(folder, "/"); + if (Validates.isNotEmptyBlank(fileModel)) + { + folder = folder + Strings.addEndsWith(fileModel, "/"); + } + + File folderFile = new File(folder); + if (!folderFile.exists()) + { + Files.mkDirectory(folder); + } + + return folder; + } + + /**** + * 获取未上传到Oss的附件列表 + * + * @param request + * @param startDate 上传开始时间 + * @param endDate 上传结束时间 + * @return 返回Map 的json数据 String error = map.get("error") 不为空字符串则表示有错误,List dataList + * = map.get("dataList")表示 数据列表 + * @throws Exception + */ + public static String getOSSNotExsistsAtta(HttpRequest request, String startDate, String endDate) + { + String error = ""; + Map jsonMap = new HashMap(); + if (!Validates.isDate(startDate) || Validates.isDate(startDate)) + { + error = "参数[]或者[]不是yyyy-MM-dd 格式"; + jsonMap.put("error", error); + return Jsons.toString(jsonMap); + } + List dataList = new ArrayList(); + Selector selector = new Selector(); + selector.addMustIsNull("ossUrl"); + selector.addMustThenGE("uploadTime", Sqls.toTimestamp(startDate, "00:00:00")); + selector.addMustThenLE("uploadTime", Sqls.toTimestamp(endDate, "23:59:59")); + selector.addOrderbyDesc("uploadTime"); + + try + { + dataList.addAll(ORM.get(ZTable.class).list(DesignAtta.class, selector)); + } + catch (ORMException | SQLException e) + { + error = e.getMessage(); + jsonMap.put("error", error); + return Jsons.toString(jsonMap); + } + + return Jsons.toString(jsonMap); + } + +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/UserMaterialPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/UserMaterialPresenter.java new file mode 100644 index 0000000..8733779 --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/UserMaterialPresenter.java @@ -0,0 +1,164 @@ +package com.zhiqim.yangcai.design.presenter; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnFilterNot; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.media.dbo.MaterialSvg; +import com.zhiqim.media.service.dao.MediaDao; +import com.zhiqim.media.service.dao.MediaPathDao; +import com.zhiqim.media.service.util.SvgUtil; +import com.zhiqim.yangcai.design.dbo.template.UserMaterial; + +/** + * 用户素材管理 + * + * @version v1.0.0 @author zhouwenbin 2018-9-12 新建与整理 + */ +@AnAlias("UserMaterialPresenter") +@AnIntercept("chkZmrLogin") +public class UserMaterialPresenter +{ + /** + * 添加用户素材 + * + * @param request + * @throws Exception + */ + public static void doAddUserMaterial(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("typeCode", "素材类型不能为空")); + request.addValidate(new IsNotEmpty("catCode", "素材分类不能为空")); + request.addValidate(new IsNotEmpty("svgCode", "素材内容不能为空")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + String typeCode = request.getParameter("typeCode"); + String catCode = request.getParameter("catCode"); + String keywords = request.getParameter("keywords"); + String svgCode = request.getParameterNoFilter("svgCode"); + + String designer = request.getSessionName(); + int svgSeq = ORM.get(ZTable.class).count(UserMaterial.class, new Selector().addMust("designer", designer)) + 1; + UserMaterial data = new UserMaterial(); + data.setSvgId(Ids.longId13()); + data.setCatCode(catCode); + data.setTypeCode(typeCode); + data.setSvgCode(svgCode); + data.setSvgSeq(svgSeq); + data.setKeywords(keywords); + data.setDesigner(request.getSessionName()); + + ORM.get(ZTable.class).insert(data); + } + + /** + * 查询用户素材 + * + * @param request + * @throws Exception + */ + public static void doQueryUserMaterial(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + String typeCode = request.getParameter("typeCode"); + String catCode = request.getParameter("catCode"); + + String designer = request.getSessionName(); + + Selector sel = new Selector(); + sel.addMust("designer", designer); + sel.addMaybe("typeCode", typeCode); + sel.addMaybe("catCode", catCode); + sel.addOrderbyDesc("svgSeq"); + PageResult result = ORM.get(ZTable.class).page(UserMaterial.class, page, 30, sel); + + request.setResponseResult(Jsons.toString(result.list())); + } + + /** 获取用户素材 */ + @AnFilterNot + public static void getUserMaterialSvg(HttpRequest request, long svgId) throws Exception + { + UserMaterial item = ORM.get(ZTable.class).item(UserMaterial.class, svgId); + request.setResponseResult(item.toString()); + } + + /** 删除用户素材 */ + public static void doDelUserMaterial(HttpRequest request, long svgId) throws Exception + { + ORM.get(ZTable.class).delete(UserMaterial.class, svgId); + } + + /** 用户素材选为系统素材 */ + public static void doApplySysMaterial(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("svgId", "素材Id不能为空")); + request.addValidate(new IsNotEmpty("typeCode", "素材类型不能为空")); + request.addValidate(new IsNotEmpty("catCode", "素材分类不能为空")); + + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long svgId = request.getParameterLong("svgId"); + String typeCode = request.getParameter("typeCode"); + String catCode = request.getParameter("catCode"); + String keywords = request.getParameter("keywords"); + int svgSeq = request.getParameterInt("svgSeq", 1); + + if (ORM.get(ZTable.class).count(MaterialSvg.class, new Selector().addMust("svgId", svgId)) > 0) + { + request.setResponseError("该素材已添加,无须重复添加"); + return; + } + + UserMaterial userMaterial = ORM.get(ZTable.class).item(UserMaterial.class, svgId); + + // TODO 暂共享图片,不复制 + String svgCode = userMaterial.getSvgCode(); + + String thumbnailName = svgId + "_thumbnail.png"; + String thumbnailPath = MediaPathDao.getSysMaterialLocalPre(catCode + "/thumbnail") + thumbnailName; + String svgThumbnail = MediaPathDao.getSysMaterialUrlPre(catCode + "/thumbnail") + thumbnailName; + + try + {// 生成缩略图 + String prePath = MediaPathDao.MEDIA_URL_PRE; + String source = MediaDao.addPrePath(svgCode, prePath); // 添加访问前缀 + SvgUtil.svg2Png(source, thumbnailPath, 150, 0); + } + catch (Exception e) + { + request.setResponseError("素材缩略图生成失败," + e.getMessage()); + return; + } + + MaterialSvg item = new MaterialSvg(); + item.setSvgId(svgId); + item.setTypeCode(typeCode); + item.setIsEdit(0); + item.setIsUpload(1);// 上传 + item.setCatCode(catCode); + item.setKeywords(keywords); + item.setSvgStatus(0); + item.setSvgSeq(svgSeq); + item.setSvgThumbnail(svgThumbnail); + item.setSvgCode(svgCode); + + ORM.get(ZTable.class).insert(item); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/WorksPresenter.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/WorksPresenter.java new file mode 100644 index 0000000..ca63b0b --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/WorksPresenter.java @@ -0,0 +1,1468 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.imageio.ImageIO; + +import org.icepdf.core.pobjects.Document; +import org.icepdf.core.pobjects.Page; +import org.icepdf.core.util.GraphicsRenderingHints; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.ones.IsSelect; +import org.zhiqim.httpd.validate.onex.IsInteger; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.Base64; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.uploadlarge.dbo.UpllFile; + +import com.zhiqim.media.dbo.MediaCanvas; +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.cache.DesignTypeCache; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.KeywordDao; +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dao.WorksDao; +import com.zhiqim.yangcai.design.dbo.DesLabelAttribute; +import com.zhiqim.yangcai.design.dbo.DesLabelIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; +import com.zhiqim.yangcai.design.dbo.works.DesMaterialCont; +import com.zhiqim.yangcai.design.dbo.works.DesWorksEvent; +import com.zhiqim.yangcai.design.dbo.works.DesWorksEventView; +import com.zhiqim.yangcai.design.dbo.works.DesWorksFile; +import com.zhiqim.yangcai.util.SolrUtil; + +/** + * 作品库Presenter + * + * @version 1.0 @author caohong 2019-9-5 新建与整理 + */ +@AnAlias("WorksPresenter") +@AnIntercept("chkZmrLogin") +public class WorksPresenter implements SignConstants +{ + private static Log log = LogFactory.getLog(WorksPresenter.class); + + /** + * 作品查询 + * + * @param request + * @param indIdarr + * @param prdIdarr + * @throws Exception + */ + public static void doWorksSearch(HttpRequest request) throws Exception + { + ZmrSessionUser user = request.getSessionUser(ZmrSessionUser.class); + + int page = request.getParameterInt("page", 1); + int pageSize = 20; + + String prdIdarr = request.getParameter("prdIdarr"); + String indIdarr = request.getParameter("indIdarr"); + String urlParam = request.getParameter("urlParam"); + String[] deptStr = Arrays.toStringArray(user.getOperator().getOperatorDeptAll()); + + Selector selector = new Selector(); + selector.addOrderbyDesc("createTime"); + selector.addMustIsNotNull("pdfPath"); + + if (Validates.isNotEmpty(prdIdarr)) + { + selector.addMustInLong("prdTypeId", Arrays.toLongArray(prdIdarr)); + } + + if (Validates.isNotEmpty(indIdarr)) + { + selector.addMustInLong("industryId", Arrays.toLongArray(indIdarr)); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("BEST")) + { + selector.addMustIn("worksType", 1, 4); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("GROUP")) + { + selector.addMaybeLike("designGroupId", user.getOperator().getOperatorDept()); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("MY")) + { + selector.addMust("designer", user.getOperatorCode()); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("COLLECT")) + { + selector.addMust("operatorCode", user.getOperatorCode()); + selector.addMust("eventType", 2); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("MYBEST")) + { + selector.addMust("designer", user.getOperatorCode()); + selector.addMustIn("worksType", 1, 4); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("SHARE")) + { + if (Validates.isNotEmpty(user.getOperator().getOperatorDeptAll())) + { + if (deptStr.length == 1) + { + selector.addMustLike("deptId", deptStr[0]); + } + else if (deptStr.length > 1) + { + Selector sel = new Selector(); + for (String dept : deptStr) + { + sel.addMustLike("deptId", dept); + } + selector.addOr(sel); + } + } + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("AUDIT")) + { + selector.addMust("worksType", 2); + } + + MapSO attrMap = new HashMapSO(); + if (Validates.isNotEmpty(urlParam) && urlParam.equals("COLLECT")) + { + PageResult pageResult = ORM.get(ZView.class).page(DesWorksEventView.class, page, pageSize, selector); + attrMap.put("pageResult", pageResult); + } + else + { + PageResult pageResult = ORM.get(ZTable.class).page(DesWorksFile.class, page, pageSize, selector); + attrMap.put("pageResult", pageResult); + } + attrMap.put("prdIdarrs", Lists.toLongList(prdIdarr)); + attrMap.put("prdIdarr", prdIdarr); + attrMap.put("indIdarr", indIdarr); + if (Validates.isNotEmpty(urlParam) && urlParam.equals("AUDIT")) + { + attrMap.put("param", "AUDIT"); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("BEST")) + { + attrMap.put("apple", "BEST"); + } + + String ret = ZmlContexts.parseZmlPath(request, "/zview/works/presenter/worksInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * 删除作品库 + * + * @param worksId + * @throws Exception + */ + public static void doWorksDelete(long worksId) throws Exception + { + DesWorksFile works = ORM.get(ZTable.class).item(DesWorksFile.class, worksId); + if (works != null && works.getUploadType() == 1) + { + // 手动上传作品 + // 1.删除源文件 + String srcPath = works.getCdrPath(); + if (Validates.isUrl(srcPath)) + {// 已经上传到OSS + int ind = srcPath.indexOf("/works/"); + String fileKey = Strings.trim(OssFileDao.getPrefix_dir(), "/", "/") + "/" + srcPath.substring(ind + 1); + log.info("删除cdr:" + OssFileDao.deleteOssFile(fileKey)); + } + // 2.删除pdf文件 + String pdfPath = works.getPdfPath(); + if (Validates.isUrl(pdfPath)) + {// 已经上传到OSS + int ind = pdfPath.indexOf("/works/"); + String fileKey = Strings.trim(OssFileDao.getPrefix_dir(), "/", "/") + "/" + pdfPath.substring(ind + 1); + log.info("删除pdf:" + OssFileDao.deleteOssFile(fileKey)); + } + + // 3.删除缩略图 + List list = Lists.toStringList(works.getThumbImagePath()); + for (String ossUrl : list) + { + int ind = ossUrl.indexOf("/works/"); + String fileKey = Strings.trim(OssFileDao.getPrefix_dir(), "/", "/") + "/" + ossUrl.substring(ind + 1); + log.info("删除缩略图:" + OssFileDao.deleteOssFile(fileKey)); + } + } + + ORM.get(ZTable.class).delete(DesWorksFile.class, worksId); + } + + /** + * 取消精品 + * + * @param worksId + * @throws Exception + */ + public static void doWorksCancel(long worksId) throws Exception + { + Updater updater = new Updater(); + updater.addMust("worksId", worksId); + updater.addField("worksType", 0); + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + + /** + * 申请精品 + * + * @param request + * @param worksId + * @throws Exception + */ + public static void doWorksAdd(HttpRequest request, long worksId) throws Exception + { + DesWorksFile works = ORM.get(ZTable.class).item(DesWorksFile.class, worksId); + if (works.getWorksType() == 2) + { + request.setResponseError("该作品正处于精品待审"); + return; + } + + Updater updater = new Updater(); + updater.addMust("worksId", worksId); + updater.addField("worksType", 2); + + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + + /** + * 精品审核 + * + * @param worksId + * @throws Exception + */ + public static void doWorksAudit(long worksId, String type) throws Exception + { + Updater updater = new Updater(); + updater.addMust("worksId", worksId); + if ("yes".equals(type)) + { + updater.addField("worksType", 1); + } + else + { + updater.addField("worksType", 0); + } + + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + + /** + * 申请模板 + * + * @param works + * @throws Exception + */ + public static void doTemplateAdd(String works) throws Exception + { + String[] worksStr = works.split(","); + for (String worksId : worksStr) + { + Updater updater = new Updater(); + updater.addMust("worksId", Long.parseLong(worksId)); + updater.addField("worksType", 3); + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + } + + /** + * 模板审核通过 + * + * @param worksId + * @throws Exception + */ + public static void doTemplateAudit(long worksId, String type) throws Exception + { + Updater updater = new Updater(); + updater.addMust("worksId", worksId); + if ("yes".equals(type)) + { + updater.addField("worksType", 4); + } + else + { + updater.addField("worksType", 1); + } + + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + + /** + * 作品库分享 + * + * @param worksId + * @param deptId + * @throws Exception + */ + public static void doWorksShare(long worksId, String deptId) throws Exception + { + DesWorksFile works = ORM.get(ZTable.class).item(DesWorksFile.class, worksId); + Updater updater = new Updater(); + updater.addMust("worksId", worksId); + if (Validates.isNotEmpty(works.getDeptId())) + { + if (works.getDeptId().contains(deptId)) + { + List strList = new ArrayList(); + String[] deptStr = works.getDeptId().split(","); + for (String str : deptStr) + { + if (str.equals(deptId)) + { + continue; + } + + strList.add(str); + } + + updater.addField("deptId", Lists.toString(strList)); + } + else + { + String dept = works.getDeptId() + "," + deptId; + updater.addField("deptId", dept); + } + } + else + { + updater.addField("deptId", deptId); + } + + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + + /** + * 获取子行业名称 + * + * @param industrySubIds + * @return + * @throws Exception + */ + public static String doIndustrySubName(String industrySubIds) throws Exception + { + String subsName = ""; + for (String subs : industrySubIds.split(",")) + { + DesLabelIndustry industry = ORM.get(ZTable.class).item(DesLabelIndustry.class, Long.parseLong(subs)); + if (industry == null) + { + continue; + } + + subsName += industry.getIndustrySubName() + " "; + } + + return subsName.substring(0, subsName.length() - 1); + } + + /** + * 获取属性名称 + * + * @param attributeIds + * @return + * @throws Exception + */ + public static String doAttributeName(String attributeIds) throws Exception + { + String attributeName = ""; + for (String subs : attributeIds.split(",")) + { + DesLabelAttribute attr = ORM.get(ZTable.class).item(DesLabelAttribute.class, Long.parseLong(subs)); + if (attr == null) + { + continue; + } + + attributeName += attr.getAttributeName() + " "; + } + + return attributeName.substring(0, attributeName.length() - 1); + } + + /** + * 浏览事件 + * + * @param worksId + * @throws Exception + */ + public static void doWorksBrowse(long worksId) throws Exception + { + DesWorksEvent event = new DesWorksEvent(); + event.setEventId(Ids.longId19()); + event.setWorksId(worksId); + event.setEventType(1); + event.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(event); + } + + /** + * 我收藏的 + * + * @param request + * @param worksId + * @throws Exception + */ + public static String doWorksCollect(HttpRequest request, long worksId, String eventId) throws Exception + { + ZmrSessionUser user = request.getSessionUser(ZmrSessionUser.class); + int count = 0; + if (Long.parseLong(eventId) > 0) + { + ORM.get(ZTable.class).delete(DesWorksEvent.class, Long.parseLong(eventId)); + + count = ORM.get(ZTable.class).count(DesWorksEvent.class, new Selector("worksId", worksId).addMust("eventType", 2)); + return String.valueOf(count + ""); + } + else + { + long eventIds = Ids.longId19(); + DesWorksEvent event = new DesWorksEvent(); + event.setEventId(eventIds); + event.setWorksId(worksId); + event.setEventType(2); + event.setOperatorCode(user.getOperatorCode()); + event.setCreateTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(event); + + count = ORM.get(ZTable.class).count(DesWorksEvent.class, new Selector("worksId", worksId).addMust("eventType", 2)); + return String.valueOf(count + "+" + eventIds); + } + } + + /** + * 设计文件上传 + * + * @param request + * @param worksId + * @param prdTypeId + * @return + * @throws Exception + */ + @AnTransaction + public static void doWorksDesignLoad(HttpRequest request, String fileId, long prdTypeId, long industryId, String keywordName, String worksName, + String industrySubIds) throws Exception + { + ZmrSessionUser user = request.getSessionUser(ZmrSessionUser.class); + UpllFile file = ORM.get(ZTable.class).item(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + File designFile = new File(file.getFilePath()); + if (!designFile.exists()) + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("filePath", file.getFilePath()).addReplace("id", null)); + request.setResponseError("文件上传失败,请重试"); + return; + } + + // 上传到 OSS + long worksId = Ids.longId(); + String fileName = worksId + Strings.addStartsWith(file.getFileExt(), "."); + String fileKey = WorksDao.getWorksOssFilekey(WorksDao.WORK_DESIGN, fileName); + String ossUrl = null; + if (file.getFileLength() > 20 * MiB) + { + ossUrl = OssFileDao.uploadBreak(designFile, fileKey); + } + else + { + ossUrl = OssFileDao.uploadFile(designFile, fileKey); + } + + if (ossUrl == null) + {// 上传失败 + designFile.delete(); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + request.setResponseError("文件OSS转储失败,请稍后重试"); + return; + } + else + { + // 上传成功删除垃圾文件 + designFile.delete(); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + } + + String industrySubName = KeywordDao.doIndustrySubName(industrySubIds); + DesWorksFile works = new DesWorksFile(); + works.setWorksId(worksId); + works.setPrdTypeId(prdTypeId); + works.setIndustryId(industryId); + works.setCdrFileName(file.getFileName()); + works.setCdrPath(ossUrl); + works.setWorksType(0); + works.setUploadType(1);// 手工上传 + works.setDesigner(request.getSessionName()); + works.setDesignGroupId(user.getOperator().getOperatorDept()); + works.setCreateTime(Sqls.nowTimestamp()); + works.setOssStatus(1); + works.setWorksName(worksName); + String keyName = keywordName + " " + industrySubName; + works.setKeywordName(keyName.replace(" ", ",")); + works.setIndustrySubIds(industrySubIds); + works.setIndustrySubName(industrySubName); + ORM.get(ZTable.class).insert(works); + + // 响应 + request.setResponseResult(String.valueOf(worksId)); + + } + + /** + * 设计文件上传 + * + * @param request + * @param worksId + * @param prdTypeId + * @return + * @throws Exception + */ + @AnTransaction + public static void dotemplateExternalDesignLoad(HttpRequest request, String fileId, long mediaId) throws Exception + { + ZmrSessionUser user = request.getSessionUser(ZmrSessionUser.class); + UpllFile file = ORM.get(ZTable.class).item(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + File designFile = new File(file.getFilePath()); + if (!designFile.exists()) + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("filePath", file.getFilePath()).addReplace("id", null)); + request.setResponseError("文件上传失败,请重试"); + return; + } + // 存在该类型文件则删除重新上传 + DesWorksFile desFile = ORM.get(ZTable.class).item(DesWorksFile.class, new Selector("templateId", mediaId).addMust("fileType", file.getFileExt())); + if (desFile != null) + { + String delFileName = desFile.getWorksId() + Strings.addStartsWith(file.getFileExt(), "."); + String fileKey = WorksDao.getWorksOssFilekey(WorksDao.WORK_DESIGN, delFileName); + OssFileDao.deleteOssFile(OssFileDao.designExternalFilePackageKey(fileKey));// oss文件删除 + + ORM.get(ZTable.class).delete(DesWorksFile.class, desFile.getWorksId());// 删除作品库数据 + } + + // 上传到 OSS + long worksId = Ids.longId(); + String fileName = worksId + Strings.addStartsWith(file.getFileExt(), "."); + String fileKey = WorksDao.getWorksOssFilekey(WorksDao.WORK_DESIGN, fileName); + String ossUrl = null; + if (file.getFileLength() > 20 * MiB) + { + ossUrl = OssFileDao.uploadBreak(designFile, fileKey); + } + else + { + ossUrl = OssFileDao.uploadFile(designFile, fileKey); + } + + if (ossUrl == null) + {// 上传失败 + designFile.delete(); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + request.setResponseError("文件OSS转储失败,请稍后重试"); + return; + } + else + { + // 上传成功删除垃圾文件 + designFile.delete(); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + } + + MediaTemplateView mediaView = ORM.get(ZView.class).item(MediaTemplateView.class, new Selector("mediaId", mediaId)); + String fileType = file.getFileExt().toLowerCase(); + DesWorksFile works = new DesWorksFile(); + works.setWorksId(worksId); + works.setPrdTypeId(mediaView.getTypeId()); + works.setIndustryId(mediaView.getIndustryId()); + works.setCdrFileName(file.getFileName()); + works.setCdrPath(ossUrl); + works.setWorksType(0); + works.setUploadType(1);// 手工上传 + works.setDesigner(request.getSessionName()); + works.setDesignGroupId(user.getOperator().getOperatorDept()); + works.setCreateTime(Sqls.nowTimestamp()); + works.setOssStatus(1); + StringBuilder keyNameBuilder = new StringBuilder(); + String typeName = DesignTypeDao.name(mediaView.getTypeId()); + keyNameBuilder.append(Validates.isNotEmpty(typeName) ? typeName + " " : ""); + String industryName = Global.get(DesignIndustryCache.class).getIndustryName(mediaView.getIndustryId()); + keyNameBuilder.append(Validates.isNotEmpty(industryName) ? industryName + " " : ""); + String[] subsNames = Arrays.toStringArray(mediaView.getIndustrySubName()); + for (int i = 0; i < subsNames.length; i++) + { + keyNameBuilder.append(subsNames[i] + " "); + } + String[] attributes = Arrays.toStringArray(mediaView.getAttributeName()); + for (int i = 0; i < attributes.length; i++) + { + keyNameBuilder.append(attributes[i] + " "); + } + works.setKeywordId(mediaView.getKeywordId()); + works.setKeywordName(keyNameBuilder.toString()); + works.setIndustrySubIds(mediaView.getIndustrySubIds()); + works.setIndustrySubName(mediaView.getIndustrySubName()); + works.setAttributeIds(mediaView.getAttributeIds()); + works.setAttributeName(mediaView.getAttributeName()); + works.setFileType(fileType); + works.setTemplateId(mediaView.getMediaId()); + if (desFile != null) + { + works.setPdfFileName(desFile.getPdfFileName()); + works.setPdfPath(desFile.getPdfPath()); + works.setThumbImagePath(desFile.getThumbImagePath()); + works.setThumbImagePhyPath(desFile.getThumbImagePhyPath()); + } + + ORM.get(ZTable.class).insert(works); + + Updater upd = new Updater(); + upd.addMust("mediaId", mediaView.getMediaId()); + upd.addField("fileType", Validates.isNotEmpty(mediaView.getFileType()) ? mediaView.getFileType() + "," + fileType : fileType); + ORM.get(ZTable.class).update(MediaTemplate.class, upd); + // 添加solr数据 + SolrUtil.updateWorksData(worksId); + // 响应 + request.setResponseResult(String.valueOf(worksId)); + + } + + /** + * 成品文件上传 + * + * @param worksId + * @throws Exception + */ + public static void doWorksEndLoad(HttpRequest request, String fileId, long worksId, String thumPath) throws Exception + { + DesWorksFile work = ORM.get(ZTable.class).item(DesWorksFile.class, worksId); + if (work == null) + { + request.setResponseError("作品不存在,请先上传设计文件"); + return; + } + + UpllFile file = ORM.get(ZTable.class).item(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + if (!file.getFileExt().equalsIgnoreCase("pdf")) + { + request.setResponseError("印刷文件必须是pdf文件"); + return; + } + + if (!new File(file.getFilePath()).exists()) + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("filePath", file.getFilePath()).addReplace("id", null)); + request.setResponseError("文件上传失败,请重试"); + return; + } + + List imgList = new ArrayList<>(); + List urlList = new ArrayList<>(); + String rootDir = Strings.trimRight(request.getContext().getAttributeString("upload.large.rootDir"), "/"); + + String savePath = Strings.addEndsWith(rootDir, "/") + Strings.trimLeft(thumPath, "/"); + String fileName = worksId + ".png"; + String suffix = Files.getFileExt(fileName); + String name = fileName.substring(0, fileName.lastIndexOf(".")); + Document document = new Document(); + document.setFile(file.getFilePath()); + float scale = 1f; + float rotation = 0f; + int pageTotal = document.getNumberOfPages(); + if (pageTotal == 0) + { + document.dispose(); + return; + } + + for (int n = 0; n < pageTotal; n++) + { + String tempName = name + "-" + n + Strings.addStartsWith(suffix, "."); + String filePath = savePath + "/" + tempName; + String thumbUrl = "/service/upl/" + Base64.encodeFileUrlUTF8(thumPath) + "/" + tempName; + try + { + BufferedImage image = document.getPageImage(n, GraphicsRenderingHints.SCREEN, Page.BOUNDARY_CROPBOX, rotation, scale); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ImageIO.write(image, "png", out); + byte[] imgb = out.toByteArray(); + Files.write(filePath, imgb); + + imgList.add(filePath); + urlList.add(thumbUrl); + } + catch (Exception e) + { + log.error("作品[%s]生成缩略图异常", e); + } + } + document.dispose(); + + List ossList = new ArrayList(); + for (String imgPath : imgList) + { + File imgFile = new File(imgPath); + if (!imgFile.exists()) + { + continue; + } + + String fileKey = WorksDao.getWorksOssFilekey(WorksDao.WORK_THUMB, imgFile.getName()); + String ossUrl = null; + if (file.getFileLength() > 20 * MiB) + { + ossUrl = OssFileDao.uploadBreak(imgFile, fileKey); + } + else + { + ossUrl = OssFileDao.uploadFile(imgFile, fileKey); + } + + imgFile.delete();// 上传成功删除垃圾文件 + if (ossUrl == null) + { + continue; + } + + ossList.add(ossUrl); + } + + String endFilePath = file.getFilePath(); + String fileKey = WorksDao.getWorksOssFilekey(WorksDao.WORK_END, worksId + Strings.addStartsWith(file.getFileExt(), ".")); + String endUrl = null; + if (file.getFileLength() > 20 * MiB) + { + endUrl = OssFileDao.uploadBreak(new File(endFilePath), fileKey); + } + else + { + endUrl = OssFileDao.uploadFile(new File(endFilePath), fileKey); + } + + Files.deleteFile(file.getFilePath()); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + + if (endUrl == null) + { + request.setResponseError("文件转储失败,请稍后重试"); + return; + } + + if (ossList.size() != imgList.size()) + { + request.setResponseError("生成作品缩略图异常"); + return; + } + + Updater updater = new Updater(); + updater.addMust("worksId", worksId); + updater.addField("pdfFileName", file.getFileName()); + updater.addField("pdfPath", endUrl); + updater.addField("thumbImagePath", Lists.toString(ossList)); + updater.addField("thumbImagePhyPath", Lists.toString(imgList)); + + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + + /** + * 缩略图上传 + * + * @param worksId + * @throws Exception + */ + @AnTransaction + public static void doTemplateExternalEndLoad(HttpRequest request, String fileId, long worksId, String thumPath) throws Exception + { + DesWorksFile work = ORM.get(ZTable.class).item(DesWorksFile.class, worksId); + if (work == null) + { + request.setResponseError("作品不存在,请先上传设计文件"); + return; + } + + String[] fileIds = fileId.split(","); + File thumbFile = null; + String ossThumbUrl = ""; + MediaTemplate template = null; + UpllFile file = null; + String fileIdName = ""; + for (String fileIda : fileIds) + { + fileIdName = fileIda; + file = ORM.get(ZTable.class).item(UpllFile.class, new Selector("fileId", fileIda).addReplace("id", null)); + if (!file.getFileExt().equalsIgnoreCase("jpg") && !file.getFileExt().equalsIgnoreCase("png")) + { + request.setResponseError("缩略图必须是jpg、png文件"); + return; + } + + if (!new File(file.getFilePath()).exists()) + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("filePath", file.getFilePath()).addReplace("id", null)); + request.setResponseError("文件上传失败,请重试"); + return; + } + + template = ORM.get(ZTable.class).item(MediaTemplate.class, new Selector("mediaId", work.getTemplateId())); + if (template == null) + { + request.setResponseError("模板订单不存在,无法完成操作!"); + return; + } + + thumbFile = new File(file.getFilePath()); + String fileKey = WorksDao.getWorksOssFilekey(WorksDao.WORK_THUMB, thumbFile.getName()); + if (thumbFile.length() > 20 * MiB) + { + if (fileIds.length > 1) + { + ossThumbUrl += OssFileDao.uploadBreak(thumbFile, fileKey) + ","; + } + else + { + ossThumbUrl = OssFileDao.uploadBreak(thumbFile, fileKey); + } + + } + else + { + if (fileIds.length > 1) + { + ossThumbUrl += OssFileDao.uploadFile(thumbFile, fileKey) + ","; + } + else + { + ossThumbUrl = OssFileDao.uploadFile(thumbFile, fileKey); + } + } + + String dbThumbImagePath = work.getThumbImagePath(); + if (Validates.isNotEmpty(dbThumbImagePath) && Validates.isUrl(dbThumbImagePath) && !dbThumbImagePath.equals(ossThumbUrl)) + {// oss原缩略图删除 + int matchIndex = dbThumbImagePath.indexOf(OssFileDao.ossEndpoint) + OssFileDao.ossEndpoint.length() + 1; + if (matchIndex != -1) + { + OssFileDao.deleteOssFile(dbThumbImagePath.substring(matchIndex)); + } + } + + // 上传成功删除垃圾文件 + thumbFile.delete(); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", fileIdName).addReplace("id", null)); + } + + Updater upd = new Updater(); + upd.addMust("mediaId", template.getMediaId()); + upd.addField("fileType", Validates.isNotEmpty(template.getFileType()) ? template.getFileType() + "," + file.getFileExt() : file.getFileExt()); + ORM.get(ZTable.class).update(MediaTemplate.class, upd); + + Updater canvesUp = new Updater(); + canvesUp.addMust("mediaId", template.getMediaId()); + canvesUp.addField("mediaUrl", ossThumbUrl); + canvesUp.addField("updateTime", DateTimes.getDateTimeString()); + ORM.get(ZTable.class).update(MediaCanvas.class, canvesUp); + + Updater updater = new Updater(); + updater.addMust("worksId", worksId); + updater.addField("pdfFileName", file.getFileName()); + // updater.addField("pdfPath", endUrl); + updater.addField("thumbImagePath", ossThumbUrl); + updater.addField("thumbImagePhyPath", file.getFileName()); + + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + // 更新solr数据 + SolrUtil.updateWorksData(worksId); + SolrUtil.updateMediaData(template.getMediaId()); + } + + /** + * 上传作品素材 + * + * @param request + * @throws Exception + */ + public static void doUploadWorksMaterial(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("fileId", "请选择上传文件")); + request.addValidate(new IsSelect("catId", "请选择素材分类")); + request.addValidate(new IsSelect("materialStatus", "请选择状态")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + String fileId = request.getParameter("fileId"); + long catId = request.getParameterLong("catId"); + int materialStatus = request.getParameterInt("materialStatus", 0); + String keywords = request.getParameter("keywords"); + + UpllFile file = ORM.get(ZTable.class).item(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + if (file == null) + { + request.setResponseError("上传的素材不存在,请重新上传"); + return; + } + + if (!Files.exists(file.getFilePath())) + { + request.setResponseError("上传的素材不存在,请重新上传"); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("filePath", file.getFilePath()).addReplace("id", null)); + return; + } + + // 上传到 OSS + long mid = Ids.longId13(); + String fileKey = WorksDao.getWorksOssFilekey(WorksDao.WORK_MATERIAL, mid + Strings.addStartsWith(file.getFileExt(), ".")); + String ossUrl = null; + if (file.getFileLength() > 20 * MiB) + { + ossUrl = OssFileDao.uploadBreak(new File(file.getFilePath()), fileKey); + } + else + { + ossUrl = OssFileDao.uploadFile(new File(file.getFilePath()), fileKey); + } + + if (ossUrl == null) + {// 上传失败 + new File(file.getFilePath()).delete(); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + request.setResponseError("文件OSS转储失败,请稍后重试"); + return; + } + else + { + // 上传成功删除垃圾文件 + new File(file.getFilePath()).delete(); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + } + + int num = ORM.get(ZTable.class).count(DesMaterialCont.class); + DesMaterialCont item = new DesMaterialCont(); + item.setMid(mid); + item.setCatId(catId); + item.setMaterialPath(file.getFilePath()); + item.setMaterialUrl(ossUrl); + item.setMaterialStatus(materialStatus); + item.setMaterialSeq(num + 1); + item.setMaterialSuffix(file.getFileExt()); + item.setKeywords(keywords); + item.setUploader(request.getSessionName()); + item.setUploadTime(DateTimes.getDateTimeString()); + item.setOssStatus(1); + + if ("jpg".equalsIgnoreCase(file.getFileExt()) || "png".equalsIgnoreCase(file.getFileExt()) || "jpeg".equalsIgnoreCase(file.getFileExt())) + { + item.setThumbPath(file.getFilePath()); + item.setThumbUrl(ossUrl); + } + + ORM.get(ZTable.class).insert(item); + request.setResponseResult("" + mid); + } + + /** + * 上传作品素材缩略图 + * + * @param request + * @throws Exception + */ + public static void doUploadWorksMaterialThumb(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mid", "请选择")); + request.addValidate(new IsNotEmpty("fileId", "请选择上传文件")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long mid = request.getParameterLong("mid"); + String fileId = request.getParameter("fileId"); + + UpllFile file = ORM.get(ZTable.class).item(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + if (file == null) + { + request.setResponseError("上传的素材缩略图不存在,请重新上传"); + return; + } + + if (!Files.exists(file.getFilePath())) + { + request.setResponseError("上传的素材缩略图不存在,请重新上传"); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("filePath", file.getFilePath()).addReplace("id", null)); + } + + // 上传到 OSS + String fileKey = WorksDao.getWorksOssFilekey(WorksDao.WORK_MATERIAL_THUMB, mid + Strings.addStartsWith(file.getFileExt(), ".")); + String ossUrl = null; + if (file.getFileLength() > 20 * MiB) + { + ossUrl = OssFileDao.uploadBreak(new File(file.getFilePath()), fileKey); + } + else + { + ossUrl = OssFileDao.uploadFile(new File(file.getFilePath()), fileKey); + } + + if (ossUrl == null) + {// 上传失败 + new File(file.getFilePath()).delete(); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + request.setResponseError("文件OSS转储失败,请稍后重试"); + return; + } + else + { + // 上传成功删除垃圾文件 + new File(file.getFilePath()).delete(); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", fileId).addReplace("id", null)); + } + + Updater updater = new Updater().addMust("mid", mid).addField("thumbPath", file.getFilePath()).addField("thumbUrl", ossUrl).addField("ossStatus", 1); + ORM.get(ZTable.class).update(DesMaterialCont.class, updater); + } + + /** + * 删除作品素材 + * + * @param request + * @throws Exception + */ + public static void doDeleteWorksMaterial(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mid", "请选择")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long mid = request.getParameterLong("mid"); + DesMaterialCont item = ORM.get(ZTable.class).item(DesMaterialCont.class, mid); + + Files.deleteFile(item.getMaterialPath()); + if (Validates.isNotEmpty(item.getThumbPath())) + {// 缩略图 + Files.deleteFile(item.getThumbPath()); + ORM.get(ZTable.class).delete(UpllFile.class, new Selector().addMust("filePath", item.getThumbPath()).addReplace("id", null)); + } + + ORM.get(ZTable.class).delete(UpllFile.class, new Selector().addMust("filePath", item.getMaterialPath()).addReplace("id", null)); + ORM.get(ZTable.class).delete(DesMaterialCont.class, mid); + + int ind = item.getMaterialUrl().indexOf("/works/"); + if (ind != -1) + { + String fileKey = Strings.trim(OssFileDao.getPrefix_dir(), "/", "/") + "/" + item.getMaterialUrl().substring(ind + 1); + OssFileDao.deleteOssFile(fileKey); + } + + if (item.getMaterialSuffix().toLowerCase().endsWith("cdr")) + { + int ind2 = item.getThumbUrl().indexOf("/works/"); + if (ind2 != -1) + { + String fileKey = Strings.trim(OssFileDao.getPrefix_dir(), "/", "/") + "/" + item.getThumbUrl().substring(ind2 + 1); + OssFileDao.deleteOssFile(fileKey); + } + } + } + + /** 更新作品素材关键字 */ + public static void doUpdateMaterialKeywords(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mid", "请选择")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long mid = request.getParameterLong("mid"); + String keywords = request.getParameter("keywords"); + if (Validates.isEmpty(keywords)) + { + return; + } + + ORM.get(ZTable.class).update(DesMaterialCont.class, new Updater().addMust("mid", mid).addField("keywords", keywords)); + } + + /** 更新作品素材状态 */ + public static void doUpdateMaterialStatus(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mid", "请选择")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long mid = request.getParameterLong("mid"); + int materialStatus = request.getParameterInt("materialStatus", 0); + + ORM.get(ZTable.class).update(DesMaterialCont.class, new Updater().addMust("mid", mid).addField("materialStatus", materialStatus)); + } + + /** 更新作品素材序号 */ + public static void doUpdateMaterialSeq(HttpRequest request) throws Exception + { + request.addValidate(new IsInteger("mid", "请选择")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + long mid = request.getParameterLong("mid"); + int materialSeq = request.getParameterInt("materialSeq", 0); + + ORM.get(ZTable.class).update(DesMaterialCont.class, new Updater().addMust("mid", mid).addField("materialSeq", materialSeq)); + } + + /** + * 关键词查询作品 + * + * @param request + * @throws Exception + */ + public static void doWorksKeywordSearch(HttpRequest request) throws Exception + { + ZmrSessionUser user = request.getSessionUser(ZmrSessionUser.class); + String[] deptStr = Arrays.toStringArray(user.getOperator().getOperatorDeptAll()); + + int page = request.getParameterInt("page", 1); + int pageSize = 20; + + String keyword = request.getParameter("keyword", ""); + String urlParam = request.getParameter("urlParam"); + long prdTypeId = request.getParameterLong("prdTypeId"); + long industryId = request.getParameterLong("industryId"); + + Selector selector = new Selector(); + selector.addOrderbyDesc("createTime"); + + if (prdTypeId != -1) + { + if (prdTypeId == 10086) + { + List prdtypeList = Global.get(DesignTypeCache.class).getList(); + List prdList = new ArrayList(); + for (DesignType type : prdtypeList) + { + prdList.add(type.getTypeId()); + } + + selector.addMustInLong("prdTypeId", Arrays.toArrayLong(prdList)); + } + else + { + selector.addMust("prdTypeId", prdTypeId); + } + } + + if (industryId != -1) + { + if (industryId == 10087) + { + List indList = Global.get(DesignIndustryCache.class).getIndustryList(); + List inList = new ArrayList(); + for (DesignIndustry ind : indList) + { + inList.add(ind.getIndustryId()); + } + + selector.addMustInLong("industryId", Arrays.toArrayLong(inList)); + } + else + { + selector.addMust("industryId", industryId); + } + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("BEST")) + { + selector.addMustIn("worksType", 1, 4); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("GROUP")) + { + selector.addMaybeLike("designGroupId", user.getOperator().getOperatorDept()); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("MY")) + { + selector.addMust("designer", user.getOperatorCode()); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("COLLECT")) + { + selector.addMust("operatorCode", user.getOperatorCode()); + selector.addMust("eventType", 2); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("MYBEST")) + { + selector.addMust("designer", user.getOperatorCode()); + selector.addMustIn("worksType", 1, 4); + } + + if (Validates.isNotEmpty(urlParam) && urlParam.equals("SHARE")) + { + if (Validates.isNotEmpty(user.getOperator().getOperatorDeptAll())) + { + if (deptStr.length == 1) + { + selector.addMustLike("deptId", deptStr[0]); + } + else if (deptStr.length > 1) + { + Selector sel = new Selector(); + for (String dept : deptStr) + { + sel.addMustLike("deptId", dept); + } + selector.addOr(sel); + } + } + } + + // 输入全数字,查询id + Pattern pattern = Pattern.compile("^\\d+$"); + Matcher isNum = pattern.matcher(Strings.trim(keyword)); + if (isNum.matches()) + { + selector.addMust("worksId", Long.valueOf(Strings.trim(keyword))); + } + else + { + String[] word = keyword.split(" "); + for (int i = 0; i < word.length; i++) + { + if (Validates.isEmptyBlank(word[i])) + { + continue; + } + + selector.addMaybeLike("keywordName", word[i]); + } + } + + MapSO attrMap = new HashMapSO(); + if (Validates.isNotEmpty(urlParam) && urlParam.equals("COLLECT")) + { + PageResult pageResult = ORM.get(ZView.class).page(DesWorksEventView.class, page, pageSize, selector); + attrMap.put("pageResult", pageResult); + } + else + { + PageResult pageResult = ORM.get(ZTable.class).page(DesWorksFile.class, page, pageSize, selector); + attrMap.put("pageResult", pageResult); + } + + attrMap.put("keyword", keyword); + attrMap.put("prdTypeId", prdTypeId); + attrMap.put("industryId", industryId); + attrMap.put("urlParam", urlParam); + + String ret = ZmlContexts.parseZmlPath(request, "/zview/works/presenter/worksSearchInfo.zml", attrMap); + request.setResponseResult(ret); + } + + /** + * 作品关联标签 + * + * @param worksId + * @param parIdarr + * @param catIdarr + * @param labIdarr + * @throws Exception + */ + @AnTransaction + public static void doWorksLabelExec(long worksId, long prdTypeId, long industryId, String industrySubIds, String attributeIds) throws Exception + { + DesWorksFile works = ORM.get(ZTable.class).item(DesWorksFile.class, worksId); + String oldPrdTypeName = Global.get(DesignTypeCache.class).getName(works.getPrdTypeId()); + String oldIndustryName = Global.get(DesignIndustryCache.class).getIndustryName(works.getIndustryId()); + String oldIndustrySubName = KeywordDao.doIndustrySubName(works.getIndustrySubIds()); + String oldAttributeName = KeywordDao.doAttributeName(works.getAttributeIds()); + String oldLabelName = oldPrdTypeName + " " + oldIndustryName + " " + oldIndustrySubName + " " + oldAttributeName; + + String prdTypeName = Global.get(DesignTypeCache.class).getName(prdTypeId); + String industryName = Global.get(DesignIndustryCache.class).getIndustryName(industryId); + String industrySubName = KeywordDao.doIndustrySubName(industrySubIds); + String attributeName = KeywordDao.doAttributeName(attributeIds); + String labelName = prdTypeName + " " + industryName + " " + industrySubName + " " + attributeName; + + if (Validates.isEmpty(works.getKeywordName()) || Validates.isEmpty(works.getIndustrySubIds()) && Validates.isEmpty(works.getAttributeIds())) + { + Updater updater = new Updater(); + updater.addMust("worksId", worksId); + updater.addField("industryId", industryId); + updater.addField("industrySubIds", industrySubIds); + updater.addField("industrySubName", industrySubName); + updater.addField("attributeIds", attributeIds); + updater.addField("attributeName", attributeName); + + if (Validates.isNotEmpty(works.getKeywordName())) + { + updater.addField("keywordName", works.getKeywordName() + "," + labelName + "," + works.getDesigner()); + } + else + { + updater.addField("keywordName", labelName + "," + works.getDesigner()); + } + + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + else + { + String keywordName = ""; + // 1.关键词中是否包含标签 + if (works.getKeywordName().contains(oldLabelName)) + { + if (!oldLabelName.equals(labelName)) + { + String[] newLabelNameStr = works.getKeywordName().split(","); + for (String newLabelName : newLabelNameStr) + { + if (oldLabelName.contains(newLabelName)) + { + keywordName += labelName + ","; + } + else + { + keywordName += newLabelName + ","; + } + } + + Updater updater = new Updater(); + updater.addMust("worksId", worksId); + updater.addField("industryId", industryId); + updater.addField("industrySubIds", industrySubIds); + updater.addField("industrySubName", industrySubName); + updater.addField("attributeIds", attributeIds); + updater.addField("attributeName", attributeName); + updater.addField("keywordName", keywordName.substring(0, keywordName.length() - 1)); + + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + } + else + { + keywordName += labelName + ","; + String[] newLabelNameStr = works.getKeywordName().split(","); + for (String newLabelName : newLabelNameStr) + { + if (oldLabelName.contains(newLabelName)) + { + continue; + } + + keywordName += newLabelName + ","; + } + + Updater updater = new Updater(); + updater.addMust("worksId", worksId); + updater.addField("industryId", industryId); + updater.addField("industrySubIds", industrySubIds); + updater.addField("industrySubName", industrySubName); + updater.addField("attributeIds", attributeIds); + updater.addField("attributeName", attributeName); + updater.addField("keywordName", keywordName.substring(0, keywordName.length() - 1)); + + ORM.get(ZTable.class).update(DesWorksFile.class, updater); + } + } + } + + /** + * + * [简要描述]根据模板id与设计文件后缀查看是否上传 :
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @param templateId + * @param fileType + * @throws Exception + */ + public static void isUploadDesignExternalFile(HttpRequest request, long templateId, String fileType) throws Exception + { + DesWorksFile worksFile = ORM.get(ZTable.class).item(DesWorksFile.class, + new Selector("templateId", templateId).addMust("fileType", Validates.isNotEmpty(fileType) ? fileType.toLowerCase() : fileType)); + if (worksFile == null) + { + request.setResponseResult(Jsons.toString("请先上传【" + fileType + "】类型的设计文件")); + } + else + { + request.setResponseResult(Jsons.toString(worksFile.getWorksId())); + } + + } + + /** + * + * [简要描述] 查看操作员最新模板:
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doQueryOperatorTemplateDesc(HttpRequest request) throws Exception + { + MediaTemplateView templateView = ORM.get(ZView.class).item(MediaTemplateView.class, + new Selector("designer", request.getSessionName()).addOrderbyDesc("createTime")); + if (templateView == null) + { + request.setResponseResult(Jsons.toString(0)); + return; + } + request.setResponseResult(Jsons.toString(templateView.getMediaId())); + } +} diff --git a/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/WorksPresenterForPC.java b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/WorksPresenterForPC.java new file mode 100644 index 0000000..670626c --- /dev/null +++ b/Yangcai365_web/src/manage/com/zhiqim/yangcai/design/presenter/WorksPresenterForPC.java @@ -0,0 +1,81 @@ +package com.zhiqim.yangcai.design.presenter; + +import java.util.HashMap; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; + +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateSolrModel; +import com.zhiqim.yangcai.util.SolrUtil; + +/** + * 作品库对外Presenter + * + * @version 1.0 @author caohong 2019-9-5 新建与整理 + */ +@AnAlias("WorksPresenterForPC") +public class WorksPresenterForPC implements SignConstants +{ + private static Log log = LogFactory.getLog(WorksPresenterForPC.class); + + /** + * 外部公共作品查询 + * + * @param request + * @param indIdarr + * @param prdIdarr + * @throws Exception + */ + public static void doWorksSearchForPC(HttpRequest request) + { + int page = request.getParameterInt("page", 1); + int pageSize = 20; + + String keyword = request.getParameter("keyword"); + String prdTypeId = request.getParameter("prdTypeId"); + String industryId = request.getParameter("industryId"); + String sort = request.getParameter("sort"); + String oddEven = request.getParameter("oddEven") == null ? "-1" : request.getParameter("oddEven"); + + Map param = new HashMap<>(); + param.put("keyword", keyword); + param.put("typeId", prdTypeId); + param.put("industryId", industryId); + param.put("sort", sort); + param.put("oddEven", oddEven); + + MapSO attrMap = new HashMapSO(); + try + { + PageResult pageResult = SolrUtil.queryAllTemplate(page, pageSize, param); + attrMap.put("pageResult", pageResult); + String ret = ZmlContexts.parseZmlPath(request, "/zview/works/presenter/pcWorksInfo.zml", attrMap); + request.setResponseResult(ret); + } + catch (Exception e) + { + log.error("对外作品查询异常," + e.getMessage(), e); + } + + } + + /** + * 外部关键词查询作品 + * + * @param request + * @throws Exception + */ + public static void doWorksKeywordSearchForPC(HttpRequest request) + { + doWorksSearchForPC(request); + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiConstants.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiConstants.java new file mode 100644 index 0000000..d6d00af --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiConstants.java @@ -0,0 +1,69 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.server; + +import org.zhiqim.kernel.util.consts.Str; + +/**** + * 设计独立平台 接口方法常量类 + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public interface ApiConstants +{ + /******************************/ + // ****订单部分 + /******************************/ + /*** 创建订单接口 */ + public final static Str ORDER_CREATE = new Str("design.order.create", "创建订单"); + /*** 订单同步接口 */ + public final static Str ORDER_SYN = new Str("design.order.syn", "同步订单");; + /*** 创建补单接口 */ + public final static Str ORDER_RE_CREATE = new Str("design.order.recreate", "创建补单"); + + /*** 订单审核退回 */ + public final static Str ORDER_CHECK_BACK = new Str("design.order.check.back", "订单审核退回"); + + /*** 取消订单接口 */ + public final static Str ORDER_CANCEL = new Str("design.order.cancel", "取消订单"); + + /** 修改订单规格 */ + public final static Str ORDER_UPDATE_SPECIFICATION = new Str("design.order.update.specification", "修改订单规格"); + /** 更换客户文件资料 **/ + public final static Str ORDER_UPDATE_CUSTOM_FILE = new Str("design.order.update.custom.file", "更换客户文件资料"); + /** 修改订单文字资料 */ + public final static Str ORDER_UPDATE_TEXT_INFO = new Str("design.order.update.text.info", "修改订单文字资料"); + /** 订单信息修改 **/ + public final static Str ORDER_UPDATE_INFO = new Str("design.order.update.info", "订单信息修改"); + + /** 订单退款 **/ + public final static Str ORDER_UPDATE_REFUND= new Str("design.order.refund", "订单退款同步"); + /******************************/ + // ****售后部分 + /******************************/ + /*** 创建订单接口 */ + public final static Str AFTER_CREATE = new Str("design.after.create", "创建售后单"); + /*** 更新订单接口 */ + public final static Str AFTER_UPDATE = new Str("design.after.update", "更新售后单"); + /*** 售后同步接口 */ + public final static Str AFTER_SYN = new Str("design.after.syn", "同步售后单"); + /*** 售后取消接口 */ + public final static Str AFTER_CANCEL = new Str("design.after.cancel", "取消售后单"); + /*** 申诉退回接口 */ + public final static Str AFTER_COMPLAIN_RETURN = new Str("design.after.complain.return", "售后申诉退回"); + /*** 申诉通过信息同步接口 */ + public final static Str AFTER_COMPLAIN_PERSON = new Str("design.after.complain.person", "售后通过审核信息修改"); + + /******************************/ + // ****投诉单部分 + /******************************/ + /*** 投诉单同步接口 */ + public final static Str COMPLAIN_SYN = new Str("design.complain.syn", "投诉单同步"); +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiErrorCodes.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiErrorCodes.java new file mode 100644 index 0000000..8b7531a --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiErrorCodes.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server; + +import org.zhiqim.kernel.util.consts.Int; + +/**** + * 设计师平台 错误编码 + * + * @version v1.0.0 @author longguizhi 2018-12-10 新建与整理 + */ +public class ApiErrorCodes +{ + /** 接口rest 错误 */ + public static final Int ERROR_API_REST = new Int(700, "no input param"); + /*** 调用系统接口时没有提交内容 **/ + public static final Int ERROR_API_NO_REQUEST_CONTENT = new Int(701, "no input param"); + + /*** 调用系统接口时必要参数错误 */ + public static final Int ERROR_API_SYS_MUST_PARAM = new Int(702, "系统基本参数格式不正确。"); + + /*** 调用系统接口时方法错误 */ + public static final Int ERROR_API_METHOD = new Int(703, "调用接口[method]有误。"); + + /*** 调用接口时客户端时间错误 */ + public static final Int ERROR_API_CLIENT_TIMESTAMP = new Int(704, "输入系统参数[timestamp]有误,误差只允许在10分钟以内。"); + + /*** 调用接口时商户编号或者停用 */ + public static final Int ERROR_API_DESIGN_MERCHANT = new Int(705, "无效商户或者已停用。"); + + /*** 调用接口时客户端签名错误 */ + public static final Int ERROR_API_REQUEST_SIGN = new Int(706, "请求签名不正确。"); + + /*** 调用系统接口时服务端发生异常 **/ + public static final Int ERROR_API_SERVER = new Int(707, "调用接口时服务端发成异常。"); + + /*** 调用系统接口时服务端处理请求发生异常 **/ + public static final Int ERROR_API_SERVER_PROCESS = new Int(708, "调用接口时服务处理失败。"); + + /*** 不支持数据类型 **/ + public static final Int ERROR_API_SUPPORT_DATA = new Int(709, "不支持数据。"); + + /*** 参数格式不正确 **/ + public static final Int ERROR_API_PARAM_FORMAT = new Int(710, "参数格式不正确。"); + + /*** 参数类型不正确, 原因: 客户端为遵循 这几平台 参数规则协议 传递数据 **/ + public static final Int ERROR_API_PARAM_TYPE = new Int(711, "参数类型错误。"); + + /*** 参数内容超长 **/ + public static final Int ERROR_API_PARAM_TO_LONG = new Int(712, "参数内容超长。"); + + /*** 参数解析 错误, 原因: 客户端参数格式 不正确导致 服务端解析异常 **/ + public static final Int ERROR_API_PARAM_ANALYSIS = new Int(713, "参数解析错误。"); + + /*** 时间跨度超长 **/ + public static final Int ERROR_API_LONG_TIME_SPAN = new Int(714, "时间跨度超长。"); + + /*** 非空或空白参数 **/ + public static final Int ERROR_API_NOT_EMPTY_BLANK = new Int(715, "参数不能为空。"); + + /*** 设计订单不存在 **/ + public static final Int ERROR_API_NOT_DESIGN_ORDER = new Int(716, "设计订单不存在。"); + + /*** 接口文件参数错误 */ + public static final Int ERROR_API_FILE_PARAM = new Int(717, "接口文件参数错误。"); + + /** 售后订单不存在 **/ + public static final Int ERROR_API_NOT_AFTER_ORDER = new Int(718, "售后单不存在。"); + + /** 业务不支持 **/ + public static final Int ERROR_API_NOT_SUPPORT_BY_BUSINESS = new Int(719, "业务不支持。"); + + /** 参数数据不正确 原因:客户端数据内容在服务端业务不支持或者与服务端数据比匹配 **/ + public static final Int ERROR_API_PARAM_DATA = new Int(720, "参数数据不正确。"); + + /** 数据已存在 **/ + public static final Int ERROR_API_DATA_BE_EXISTS = new Int(721, "数据已存在。"); + + /** 当前状态不允许操作 **/ + public static final Int ERROR_API_ILLEGAL_STATUS = new Int(722, "当前状态不允许操作。"); +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiErrorResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiErrorResponse.java new file mode 100644 index 0000000..95ca32b --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiErrorResponse.java @@ -0,0 +1,103 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server; + +import org.zhiqim.kernel.json.Jsons; + +/**** + * 全局错误响应 + * TODO:类功能介绍 + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public class ApiErrorResponse +{ + private String errorId; + private int code; + private String msg; + private Throwable throwable; + public ApiErrorResponse(){this.throwable = new Exception();} + + public ApiErrorResponse(String errorId, int code, String msg) + { + this.errorId = errorId; + this.throwable = new Exception(msg); + this.code = code; + this.msg = msg; + } + + public ApiErrorResponse(String errorId, int code, String msg, Throwable e) + { + this.errorId = errorId; + this.throwable = e == null ? null : e; + this.code = code; + this.msg = msg; + } + + public void setError(String errorId, int code, String msg, Throwable e) + { + this.errorId = errorId; + this.throwable = e == null ? null : e; + this.code = code; + this.msg = msg; + } + + public void setError(String errorId, int code, String msg) + { + this.errorId = errorId; + this.throwable = new Exception(msg); + this.code = code; + this.msg = msg; + } + + public int getCode() + { + return code; + } + + public String getMsg() + { + return msg; + } + + public String getErrorId() + { + return errorId; + } + + public void setErrorId(String errorId) + { + this.errorId = errorId; + } + + public String toString() + { + ApiErrorResponse temp = new ApiErrorResponse(null, this.code, this.msg, null); + return "{error:" + Jsons.toString(temp) + "}"; + } + + /**获取错误堆栈信息**/ + public String getStackTrace() + { + if (throwable == null) + return null; + StackTraceElement[] stackTraces = throwable.getStackTrace(); + StringBuilder sb = new StringBuilder(throwable.toString()).append("\r\n"); + for (int i = 0; i < stackTraces.length; i++) { + StackTraceElement stacktrace = stackTraces[i]; + sb.append("\tat ").append(stacktrace).append("\r\n"); + } + + String stacktrace = sb.toString().trim(); + return "".endsWith(stacktrace) ? null : stacktrace; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiRequest.java new file mode 100644 index 0000000..5022a50 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiRequest.java @@ -0,0 +1,184 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server; + +import java.util.TreeMap; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; + +public abstract class ApiRequest +{ + protected static Log log = LogFactory.getLog(ApiRequest.class); + private ApiErrorResponse err; + private T response; + + private String method; + private String timestamp; + private String appKey;// merchantId 将替换成 appKey + private String sign; + + /** + * 解析请求参数 + * + * @param paramMap 参数表 + * @param sign 验证码 + * @param err 有错误返回 + * @return =true表示成功,=false表示有错误 + */ + public boolean parse(TreeMap paramMap, String sign, ApiErrorResponse err) + { + this.method = paramMap.get("method"); + this.timestamp = paramMap.get("timestamp"); + this.sign = sign; + this.appKey = paramMap.get("appKey"); + + // 验证参数 + boolean valid = validateParam(paramMap, err); + // 子类解析主体参数 + return valid ? parseBody(paramMap, err) : false; + } + + /** + * 设置错误响应 + * + * @param code 错误码 + * @param message 错误信息 + */ + public void setError(String errorId, int code, String message) + { + this.err = new ApiErrorResponse(errorId, code, message); + } + + public void setError(String errorId, int code, String message, Throwable e) + { + this.err = new ApiErrorResponse(errorId, code, message, e); + } + + /** + * 设置成功响应 + * + * @param response 响应 + */ + public void setResponse(T response) + { + this.response = response; + } + + /** 获取错误响应 */ + public ApiErrorResponse getError() + { + return err; + } + + /** 获取成功响应 */ + public T getResponse() + { + return response; + } + + /********************************************************/ + // 以下为子类必须实现方法 + /********************************************************/ + + /** + * 子类必须定义请求对应的响应类 + * + * @return 响应类 + */ + public abstract T newResponse(); + + /** + * 子类必须实现验证参数业务 + * + * @param paramMap 参数表 + * @param err 有错误返回 + * @return =true表示成功,=false表示有错误 + */ + protected abstract boolean validateParam(TreeMap paramMap, ApiErrorResponse err); + + /**** + * 提供给子类 调用的方法 + * + * @param key + * @param value + * @return "参数:["+key+"]值:["+value+"]"; + */ + public String biuldKeyValueString(String key, Object... values) + { + StringBuilder sb = new StringBuilder(" 参数:[" + key + "]"); + sb.append("值:["); + for (int i = 0; i < values.length; i++) + { + Object value = values[i]; + if (i > 0) + { + sb.append(", "); + } + sb.append(value == null ? null : value.toString()); + } + + sb.append("]"); + + return sb.toString(); + } + + /** + * 子类必须实现解析业务参数 + * + * @param paramMap 参数表 + * @param err 有错误返回 + * @return =true表示成功,=false表示有错误 + */ + protected abstract boolean parseBody(TreeMap paramMap, ApiErrorResponse err); + + public String getMethod() + { + return method; + } + + public void setMethod(String method) + { + this.method = method; + } + + public String getTimestamp() + { + return timestamp; + } + + public void setTimestamp(String timestamp) + { + this.timestamp = timestamp; + } + + public String getSign() + { + return sign; + } + + public void setSign(String sign) + { + this.sign = sign; + } + + public String getAppKey() + { + return appKey; + } + + public void setAppKey(String appKey) + { + this.appKey = appKey; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiResponse.java new file mode 100644 index 0000000..5551768 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ApiResponse.java @@ -0,0 +1,37 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server; + +/*** + * 全局接口包 响应基类 + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public abstract class ApiResponse +{ + /** 生成响应字符串 */ + public String buildResponse() + { + return new StringBuilder("{response:").append(buildBody()).append("}").toString(); + } + + /********************************************************/ + // 以下为子类必须实现方法 + /********************************************************/ + + /** + * 子类必须实现生成业务参数对应的数据 + * + * @return 业务参数JSON + */ + protected abstract String buildBody(); +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/DesignController.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/DesignController.java new file mode 100644 index 0000000..c931356 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/DesignController.java @@ -0,0 +1,290 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.server; + +import java.lang.reflect.ParameterizedType; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.Servicer; +import org.zhiqim.kernel.config.Group; +import org.zhiqim.kernel.config.Item; +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.MD5; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.kernel.util.consts.Str; + +import com.zhiqim.yangcai.design.server.request.after.DesignAfterCancelRequest; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterComplainPersonRequest; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterComplainReturnRequest; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterCreateRequest; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterSynRequest; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterUpdateRequest; +import com.zhiqim.yangcai.design.server.request.complain.DesignComplainSynRequest; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderCheckBackRequest; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderCreateRequest; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderRecreateRequest; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderRefundRequest; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderSynRequest; +import com.zhiqim.yangcai.design.server.request.order.update.DesignOrderUpdateInfoRequest; +import com.zhiqim.yangcai.design.server.request.order.update.DesignOrderUpdateSpecificationRequest; +import com.zhiqim.yangcai.design.server.request.order.update.DesignOrderUpdateTextInfoRequest; +import com.zhiqim.yangcai.design.server.request.order.update.ReplaceCustomFileRequest; + +/** + * 接口调用controller + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public class DesignController extends Servicer implements ApiConstants +{ + /** 客户端与服务端时间差 */ + public static final int TEN_MINUTE = 10 * 60 * 1000;// 十分钟误差 + private static final Log log = LogFactory.getLog(DesignController.class); + private static final TreeMap> requests = new TreeMap>(); + private static final Map apiMap = new LinkedHashMap(); + private static final LinkedHashMap, Handler>> handlers = new LinkedHashMap, Handler>>(); + + @Override + @SuppressWarnings("unchecked") + public boolean create() throws Exception + { + init(); + Group group = Global.getGroup(getId()); + for (Item item : group.list()) + { + String requestClassName = item.getKey(); + String handlerClassName = item.getString(); + try + { + // 1.检查处理类是否 为 Handler子类 + Class handlerClass = Global.getClassLoader().loadClass(handlerClassName); + Object handler = handlerClass.newInstance(); + if (!(handler instanceof Handler)) + { + log.error("HandlerController添加配置时[%s]类未实现Handler接口", handlerClassName); + return false; + } + + // 2.检查处理类是否 为 ApiRequest子类 + Class requestClass = Global.getClassLoader().loadClass(requestClassName); + Object request = requestClass.newInstance(); + if (!(request instanceof ApiRequest)) + { + log.error("HandlerController添加配置时[%s]类不是com.yangcai.design.server.DesignRequest>的子类", requestClassName); + return false; + } + + // 3.检查处理类 处理参数类,与配置请求参数 类是否相同 + Class parameterClass = (Class) ((ParameterizedType) handlerClass.getGenericInterfaces()[0]).getActualTypeArguments()[0]; + if (!requestClass.getName().equals(parameterClass.getName())) + { + log.error("HandlerController添加配置时处理参数类型与请求接口类型不一致\r\n requestClass:[%s] \r\nhandlerRequestClass:[%s]", requestClass.getName(), + parameterClass.getName()); + return false; + } + + // 4.激活接口 + Class> requestClazz = (Class>) requestClass; + Class>> handlerClazz = (Class>>) handlerClass; + doApiActivation(requestClazz, handlerClazz); + } + catch (Exception e) + { + log.error("HandlerController添加配置时[%s][%s]类的配置不正确", e, requestClassName, handlerClassName); + return false; + } + } + + for (Str api : getActivationApiList()) + { + log.info("API[%s][%s]已激活", api.desc(), api.value()); + } + + return true; + } + + private static void doApiActivation(Class requestClass, Class>> handlerClazz) throws Exception + { + handlers.put(requestClass, handlerClazz.newInstance()); + } + + /** 初始化接口 */ + public static void init() + { + // ************************ + // *********订单接口******* + // ************************ + doLoadApi(ApiConstants.ORDER_CREATE, DesignOrderCreateRequest.class); + doLoadApi(ApiConstants.ORDER_RE_CREATE, DesignOrderRecreateRequest.class); + doLoadApi(ApiConstants.ORDER_SYN, DesignOrderSynRequest.class); + doLoadApi(ApiConstants.ORDER_UPDATE_SPECIFICATION, DesignOrderUpdateSpecificationRequest.class); + doLoadApi(ApiConstants.ORDER_UPDATE_CUSTOM_FILE, ReplaceCustomFileRequest.class); + doLoadApi(ApiConstants.ORDER_UPDATE_TEXT_INFO, DesignOrderUpdateTextInfoRequest.class); + doLoadApi(ApiConstants.ORDER_UPDATE_INFO, DesignOrderUpdateInfoRequest.class); + doLoadApi(ApiConstants.ORDER_CHECK_BACK, DesignOrderCheckBackRequest.class); + doLoadApi(ApiConstants.ORDER_UPDATE_REFUND, DesignOrderRefundRequest.class); + // ************************ + // *********售后接口******* + // ************************ + doLoadApi(ApiConstants.AFTER_CREATE, DesignAfterCreateRequest.class); + doLoadApi(ApiConstants.AFTER_UPDATE, DesignAfterUpdateRequest.class); + doLoadApi(ApiConstants.AFTER_SYN, DesignAfterSynRequest.class); + doLoadApi(ApiConstants.AFTER_CANCEL, DesignAfterCancelRequest.class); + doLoadApi(ApiConstants.AFTER_COMPLAIN_RETURN, DesignAfterComplainReturnRequest.class); + doLoadApi(ApiConstants.AFTER_COMPLAIN_PERSON, DesignAfterComplainPersonRequest.class); + + // ************************ + // *********投诉单接口******* + // ************************ + doLoadApi(ApiConstants.COMPLAIN_SYN, DesignComplainSynRequest.class); + } + + /*** 激活接口 **/ + public static void doLoadApi(Str api, Class clazz) + { + requests.put(api.value(), clazz); + apiMap.put(api.value(), api); + // log.info("API[%s][%s]已加载", api.desc(), api.value()); + } + + /** 获取接口所有方法 */ + public static List getApiList() + { + List list = new ArrayList(); + for (Str str : apiMap.values()) + { + list.add(str); + } + return list; + } + + /** 获取已经激活的API **/ + public static Str getActivationApi(String method) + { + ApiRequest req = DesignController.getRequest(method); + if (req == null) + { + return null; + } + + Handler> handler = DesignController.getHandler(req); + + if (handler == null) + { + return null; + } + + return apiMap.get(method); + } + + /** 查询以已经激活的API **/ + public static List getActivationApiList() + { + List list = new ArrayList(); + for (Str api : getApiList()) + { + if (getActivationApi(api.value()) != null) + { + list.add(api); + } + } + + return list; + } + + /** 根据接口方法 获取接口请求类 **/ + @SuppressWarnings("unchecked") + public static ApiRequest getRequest(String method) + { + Class clazz = requests.get(method); + try + { + return (ApiRequest) clazz.newInstance(); + } + catch (Exception e) + { + log.error("获取API接口异常:", e); + return null; + } + } + + /** + * 根据请求类获取对应的处理器 + * + * @param req 请求 + * @return Handler + */ + public static Handler> getHandler(ApiRequest req) + { + return handlers.get(req.getClass()); + } + + /*** + * + * @param error 错误相应 + * @param method 接口方法 + * @param timestamp 客户端时间 + * @param merchantId 订单商户编号 + * @param sign 客户端签名 + * @return =true 表示验证成功, =false 表示失败 + */ + public static boolean validateSysMustParam(ApiErrorResponse error, String method, String timestamp, String merchantId, String sign) + { + if (Validates.isEmpty(method) || !Validates.isDateTime(timestamp) || Validates.isEmptyBlank(merchantId) || !Validates.isNumericLen(merchantId, 2, 20) + || !Validates.isMD5String(sign)) + { + Int code = ApiErrorCodes.ERROR_API_SYS_MUST_PARAM; + error.setError(null, code.value(), code.desc()); + return false; + } + + if (!requests.containsKey(method.trim())) + { + Int code = ApiErrorCodes.ERROR_API_METHOD; + error.setError(null, code.value(), code.desc()); + return false; + } + + long diffTime = System.currentTimeMillis() - DateTimes.toLong(timestamp); + if ((diffTime > 0 && diffTime > TEN_MINUTE) || (diffTime < 0 && diffTime < -TEN_MINUTE)) + { + Int code = ApiErrorCodes.ERROR_API_CLIENT_TIMESTAMP; + error.setError(null, code.value(), code.desc()); + return false; + } + + return true; + } + + /*** + * 构建签名 (商户 密码+接口方法名+请求时间+商户编号+商户密码 )的md5码 + * + * @param method 接口方法 + * @param timestamp 客户端时间 + * @param merchantId 订单商户编号 + * @param merchantSecret 订单商户秘钥 + * @return + */ + public static String biuldSignMD5(String method, String timestamp, String merchantId, String merchantSecret) + { + StringBuffer strb = new StringBuffer(); + strb.append(merchantSecret).append(method).append(timestamp).append(merchantId).append(merchantSecret); + return MD5.encodeUTF8(strb.toString()); + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/DiansanService.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/DiansanService.java new file mode 100644 index 0000000..2d1421f --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/DiansanService.java @@ -0,0 +1,725 @@ +package com.zhiqim.yangcai.design.server; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URLEncoder; +import java.security.GeneralSecurityException; +import java.security.MessageDigest; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TreeMap; + +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Validates; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.util.HttpClientUtilNew; + +/** + * [简要描述]:点三平台服务接口
            + * + * @version 1.0 @author caohong 2021-6-30 新建与整理 + */ +public class DiansanService +{ + private static final Log log = LogFactory.getLog(DiansanService.class); + + private static final String APP_KEY = "221116"; + private static final String APP_SECRET = "s6ab5v0pq69tx6oupw3qnbjye7dr49uy"; + // 测试环境 + // private static final String API_URL = "http://open_3rd.dev.diansan.com/open/oms/router"; + // 正式环境 + private static final String API_URL = "http://open_3rd.product.diansan.com/open/oms/router"; + + /** + * api接口参数签名
            + * 1.对所有API请求URL中的参数(除去sign参数和byte[]类型的参数),根据参数名称的ASCII码表的顺序排序。
            + * 2.将排序好的URL中的参数的参数名和参数值拼装在一起,后面机上body参数
            + * 3.把拼装好的字符串采用utf-8编码,在上一步拼装的字符串前后加上APP_SECRET后,再进行摘要
            + * 4.将摘要得到的字节流结果使用十六进制表示
            + * + * @author caohong + * @param params urlquery参数 + * @param jsonParamsMap body 参数 + * @param secret 秘钥 + */ + private static String buildSign(Map params, String secret, LinkedHashMap bodyParamsMap) throws IOException + { + // 1.参数排序 + String[] keys = params.keySet().toArray(new String[0]); + Arrays.sort(keys); + + // 2.把所有参数名和参数值串在一起 + StringBuilder query = new StringBuilder(); + // 3. 拼接秘钥 + query.append(secret); + for (String key : keys) + { + String value = params.get(key); + if (isNotEmpty(key) && isNotEmpty(value)) + { + query.append(key).append(value); + } + } + + // 4.拼接 body参数 + if (null != bodyParamsMap) + { + query.append(JSONObject.toJSONString(bodyParamsMap)); + } + + // 5.使用MD5加密 + query.append(secret); + byte[] bytes = encryptMD5(query.toString()); + + // 6.把二进制转化为大写的十六进制 + return byte2hex(bytes); + } + + /** + * 对字符串采用UTF-8编码后,用MD5进行摘要。 + */ + private static byte[] encryptMD5(String data) throws IOException + { + return encryptMD5(data.getBytes("utf-8")); + } + + /** + * 对字节流进行MD5摘要。 + */ + private static byte[] encryptMD5(byte[] data) throws IOException + { + byte[] bytes = null; + try + { + MessageDigest md = MessageDigest.getInstance("MD5"); + bytes = md.digest(data); + } + catch (GeneralSecurityException gse) + { + throw new IOException(gse.toString()); + } + return bytes; + } + + /** + * 把字节流转换为十六进制表示方式。 + */ + private static String byte2hex(byte[] bytes) + { + StringBuilder sign = new StringBuilder(); + for (int i = 0; i < bytes.length; i++) + { + String hex = Integer.toHexString(bytes[i] & 0xFF); + if (hex.length() == 1) + { + sign.append("0"); + } + sign.append(hex.toUpperCase()); + } + return sign.toString(); + } + + private static boolean isNotEmpty(String value) + { + int strLen; + if (value == null || (strLen = value.length()) == 0) + { + return false; + } + for (int i = 0; i < strLen; i++) + { + if ((Character.isWhitespace(value.charAt(i)) == false)) + { + return true; + } + } + return false; + } + + /** + * [简要描述]:一键添加授权店铺
            + * + * @author caohong + * @return + * @throws Exception + */ + public static String getAuthUrl() throws Exception + { + StringBuilder requestAuthUrl = new StringBuilder(""); + requestAuthUrl.append("https://d3.diansan.com/app-web/open/auth/third/add/store/tb?"); + TreeMap urlParams = new TreeMap(); + urlParams.put("appKey", APP_KEY); + urlParams.put("timestamp", String.valueOf(System.currentTimeMillis())); + urlParams.put("redirectUrl", URLEncoder.encode("http://hf.tmallprint.com/authRest.htm", "UTF-8")); + urlParams.put("codeType", "NICK"); + LinkedHashMap bodyParamsMap = null; + String sign = DiansanService.buildSign(urlParams, APP_SECRET, bodyParamsMap); + + Iterator> it = urlParams.entrySet().iterator(); + while (it.hasNext()) + { + Map.Entry entry = it.next(); + requestAuthUrl.append(entry.getKey() + "=" + entry.getValue() + "&"); + } + requestAuthUrl.append("sign=" + sign); + // System.out.println(requestAuthUrl.toString()); + return requestAuthUrl.toString(); + } + + /** + * [简要描述]:查询点三平台订单详细
            + * + * @author caohong + * @param tid + * @return TbTradeDto + */ + public static String orderQuery(String tids) + { + + DesignOrder order = null; + String str = ""; + try + { + LinkedHashMap bodyParams = new LinkedHashMap(); + bodyParams.put("refOid", tids); + + TreeMap urlParams = new TreeMap(); + urlParams.put("appKey", APP_KEY); + urlParams.put("method", "ds.omni.erp.third.order.query"); + urlParams.put("timestamp", String.valueOf(System.currentTimeMillis())); + urlParams.put("sign", DiansanService.buildSign(urlParams, APP_SECRET, bodyParams)); + + String result = HttpClientUtilNew.sendJsonPost(API_URL, urlParams, bodyParams); + List list = Jsons.getList(result, "content"); + return result; + } + catch (Exception e) + { + log.error("查询点三平台订单" + tids + "异常:" + e.getMessage(), e); + } + + return str; + } + + /** + * [简要描述]:查询点三平台订单详细
            + * + * @author caohong + * @param tid + * @return TbTradeDto + */ + public static DesignOrder designOrderReturn(String tids) + { + DesignOrder designOrder = new DesignOrder(); + try + { + String[] tidArr = tids.split(","); + int count = 0; + for (int i = 0; i < tidArr.length; i++) { + String tid = tidArr[i]; + LinkedHashMap bodyParams = new LinkedHashMap(); + bodyParams.put("refOid", tid); + + TreeMap urlParams = new TreeMap(); + urlParams.put("appKey", APP_KEY); + urlParams.put("method", "ds.omni.erp.third.order.query"); + urlParams.put("timestamp", String.valueOf(System.currentTimeMillis())); + urlParams.put("sign", DiansanService.buildSign(urlParams, APP_SECRET, bodyParams)); + + String result = HttpClientUtilNew.sendJsonPost(API_URL, urlParams, bodyParams); + List list = Jsons.getList(result, "content"); + if (list.size() > 0) + { + String content = list.get(0); + String status = Jsons.getString(content, "status"); + //DELETED-已删除,CLOSE-已关闭,CANCEL-已取消 + if("CLOSE".equals(status) || "DELETED".equals(status) || "CANCEL".equals(status)) { + //根据淘宝订单修改 + count++; + } + } + } + if(count == tidArr.length) {//如果所有淘宝单号都是退款的,那就把这个订单改成退款 + designOrder.setStatus(StatusConstants.ORDER_34.value()); + designOrder.setReturnMsg("淘宝已退货"); + }else if(count > 0) { + designOrder.setReturnMsg("淘宝部分订单已退货,请联系客服确认是否需要退货"); + } + } + catch (Exception e) + { + log.error("查询点三平台订单" + tids + "异常:" + e.getMessage(), e); + } + + return designOrder; + } + + /** + * [简要描述]:获取商家物流列表
            + * + * @author caohong + * @return + * @throws Exception + */ + public static String queryLogisticsList() throws Exception + { + LinkedHashMap bodyParams = new LinkedHashMap(); + bodyParams.put("status", "VALID"); + + TreeMap urlParams = new TreeMap(); + urlParams.put("appKey", APP_KEY); + urlParams.put("method", "ds.omni.basedata.logistics.query"); + urlParams.put("timestamp", String.valueOf(System.currentTimeMillis())); + urlParams.put("sign", buildSign(urlParams, APP_SECRET, bodyParams)); + + String result = HttpClientUtilNew.sendJsonPost(API_URL, urlParams, bodyParams); + System.out.println(result); + return result; + } + + /** + * [简要描述]:申请电子面单号
            + * + * @author caohong + * @param cpCode 点三OMS商家物流编码 + * @param orderId 业务订单号 + * @param posCode 提供面单服务的店铺名称 + * @param tid 电商平台订单号,和收件地址参数不能同时为空 + * @param receiptMap 收件地址为空时,自动取电商平台地址 + * @return + * @throws Exception + */ + public static String getWaybillCode(String cpCode, String orderId, String posCode, String tid, Map receiptMap) throws Exception + { + if (Validates.isEmpty(orderId)) + { + orderId = String.valueOf(Ids.longId13()); + } + + LinkedHashMap bodyParams = new LinkedHashMap(); + bodyParams.put("cpCode", cpCode);// OMS商家物流编码 + + // 这里菜鸟平台无实际作用,写死即可,最终在面单数据里面替换 + Map sendMap = new HashMap(); + sendMap.put("detail", "中电软件园"); + sendMap.put("mobile", "18888888888"); + sendMap.put("name", "秒绘"); + sendMap.put("province", "湖南省"); + sendMap.put("city", "长沙市"); + sendMap.put("district", "岳麓区"); + bodyParams.put("send", sendMap);// 发件人信息 + + Map packagesMap = new HashMap();// 包裹信息 + packagesMap.put("outerCode", orderId);// 外面业务单号 + packagesMap.put("posCode", posCode);// 电商单号对应店铺 + if (Validates.isNotEmpty(tid)) + { + packagesMap.put("refOid", tid);// 电商平台单号,和收件人信息为时取电商订单收件地址 + } + + Map itemsMap = new HashMap();// 商品信息,无实际作用,写死即可 + itemsMap.put("name", "商品"); + + itemsMap.put("num", "1"); + packagesMap.put("items", itemsMap); + + // Map receiptMap = new HashMap();// 收件人信息,电商单号为空时,需要指定 + // receiptMap.put("province", "湖南省"); + // receiptMap.put("city", "常德市"); + // receiptMap.put("district", "鼎城区"); + // receiptMap.put("town", ""); + // receiptMap.put("detail", "企业广场F2栋"); + // receiptMap.put("name", "孙悟空"); + // receiptMap.put("mobile", "13888888888"); + // receiptMap.put("phone", ""); + if (!receiptMap.isEmpty()) + { + packagesMap.put("receipt", receiptMap);// 收件人信息,电商单号为空时,需要指定 + } + + bodyParams.put("packages", packagesMap);// 包裹信息 + + TreeMap urlParams = new TreeMap(); + urlParams.put("appKey", APP_KEY); + urlParams.put("method", "ds.omni.erp.waybill.third.get"); + urlParams.put("timestamp", String.valueOf(System.currentTimeMillis())); + urlParams.put("sign", buildSign(urlParams, APP_SECRET, bodyParams)); + System.out.println(Jsons.toString(urlParams)); + System.out.println(Jsons.toString(bodyParams)); + String result = HttpClientUtilNew.sendJsonPost(API_URL, urlParams, bodyParams); + log.info("订单[" + orderId + "]申请电子面单号:" + result); + return result; + } + + /** + * [简要描述]:取消电子面单
            + * + * @author caohong + * @param waybillCode 电子面单号 + * @return + * @throws Exception + */ + public static String cancelWaybill(String waybillCode) throws Exception + { + LinkedHashMap bodyParams = new LinkedHashMap(); + bodyParams.put("waybillCode", waybillCode); + + TreeMap urlParams = new TreeMap(); + urlParams.put("appKey", APP_KEY); + urlParams.put("method", "ds.omni.erp.waybill.third.cancel"); + urlParams.put("timestamp", String.valueOf(System.currentTimeMillis())); + urlParams.put("sign", buildSign(urlParams, APP_SECRET, bodyParams)); + + String result = HttpClientUtilNew.sendJsonPost(API_URL, urlParams, bodyParams); + log.info("电子面单号[" + waybillCode + "]取消:" + result); + return result; + } + + /** + * [简要描述]:通过面单号获取电子面单打印数据
            + * + * @author caohong + * @return + * @throws Exception + */ + public static String getPrintdata(String waybillCode) throws Exception + { + LinkedHashMap bodyParams = new LinkedHashMap(); + bodyParams.put("waybillCode", waybillCode); + + TreeMap urlParams = new TreeMap(); + urlParams.put("appKey", APP_KEY); + urlParams.put("method", "ds.omni.erp.waybill.printdata.get"); + urlParams.put("timestamp", String.valueOf(System.currentTimeMillis())); + urlParams.put("sign", buildSign(urlParams, APP_SECRET, bodyParams)); + + String result = HttpClientUtilNew.sendJsonPost(API_URL, urlParams, bodyParams); + // System.out.println(result); + return result; + } + + /** + * [简要描述]::淘宝订单发货接口
            + * + * @author caohong + * @param tid 淘宝单号 + * @param posCode 订单对应店铺编码 + * @param expressNo 物流面单号 + * @param companyCode 物流商编码 + * @throws Exception + */ + public static String orderSend(String tid, String posCode, String expressNo, String companyCode) throws Exception + { + if ("SFK".equals(companyCode)) + { + companyCode = "SF"; + } + + LinkedHashMap bodyParams = new LinkedHashMap(); + bodyParams.put("refOid", tid); + bodyParams.put("posCode", posCode); + Map packages = new HashMap(); + packages.put("outSid", expressNo); + packages.put("companyCode", companyCode); + bodyParams.put("packages", packages); + + TreeMap urlParams = new TreeMap(); + urlParams.put("appKey", APP_KEY); + urlParams.put("method", "ds.omni.erp.third.order.send"); + urlParams.put("timestamp", String.valueOf(System.currentTimeMillis())); + urlParams.put("sign", DiansanService.buildSign(urlParams, APP_SECRET, bodyParams)); + + String result = HttpClientUtilNew.sendJsonPost(API_URL, urlParams, bodyParams); + log.info("淘宝平台订单[" + tid + "][" + posCode + "][" + companyCode + "][" + expressNo + "]发货:" + result); + return result; + } + + /** + * [简要描述]:虚拟发货
            + * + * @author caohong + * @param tid 淘宝单号 + * @param posCode 店铺编码 + * @throws Exception + */ + public static String dummySend(String tid, String posCode) throws Exception + { + LinkedHashMap bodyParams = new LinkedHashMap(); + bodyParams.put("refOid", tid); + bodyParams.put("posCode", posCode); + + TreeMap urlParams = new TreeMap(); + urlParams.put("appKey", APP_KEY); + urlParams.put("method", "ds.omni.erp.third.order.dummy.send"); + urlParams.put("timestamp", String.valueOf(System.currentTimeMillis())); + urlParams.put("sign", buildSign(urlParams, APP_SECRET, bodyParams)); + + String result = HttpClientUtilNew.sendJsonPost(API_URL, urlParams, bodyParams); + log.info("淘宝平台订单[" + tid + "][" + posCode + "]虚拟发货:" + result); + return result; + } + + /** + * [简要描述]:手工修复发货
            + * 1909637966166701232 印品荟 STO 773107129384725,773107128885905 + * + * @author caohong + * @throws Exception + */ + public static void diySendOffline() throws Exception + { + String fileName = "D:\\tb.txt"; + String line = ""; + try + { + BufferedReader in = new BufferedReader(new FileReader(fileName)); + line = in.readLine(); + while (line != null) + { + String[] segments = line.split("-"); + if (segments.length >= 3) + { + DiansanService.orderSend(segments[0], segments[1], segments[3], segments[2]); + } + + line = in.readLine(); + } + + in.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + public static void main(String[] args) throws Exception + { + + Map receiptMap = new HashMap(); + // receiptMap.put("province", "山东省"); + // receiptMap.put("city", "烟台市"); + // receiptMap.put("district", "莱州市"); + // receiptMap.put("town", ""); + // receiptMap.put("detail", "文昌路街道府东街北头路东60号醉骨大叔店"); + // receiptMap.put("name", "王沐佳"); + // receiptMap.put("mobile", "13854533345"); + // receiptMap.put("phone", ""); + // DiansanService.getWaybillCode("POSTB-yc-001", "2129333432796", "th办公旗舰店", + // "2307664260449526482", receiptMap); + // TbTradeDto tradeDto = DiansanService.orderQuery("1349805865534653798"); + // System.out.println(Jsons.toString(tradeDto)); + // DiansanService.queryLogisticsList(); + // DiansanService.cancelWaybill("9883797185469"); + // + //DiansanService.diySendOffline(); + // DiansanService.orderSend("1596975492422819487", "th办公旗舰店", "75892240055327", "ZTO"); + // DiansanService.dummySend("2458977770701420051", "th办公旗舰店"); + + //queryLogisticsList(); + //DiansanService.getWaybillCode1("ZTO-th-73698", "2129333432796", "简奈旗舰店","2307664260449526482", receiptMap); + + // System.out.println(getPrintdata("78716204411609")); + + + System.out.println("===================================1345401735015086681订单查询ds.omni.erp.third.order.query=================================================="); + String str = orderQuery("1961348594956654998"); + System.out.println(str); + //List list = Jsons.getList(str, "content"); + //if (list.size() > 0) + //{ + // String content = list.get(0); + // String status = Jsons.getString(content, "status"); + // System.out.println("订单状态" + status); + //DELETED-已删除,CLOSE-已关闭,CANCEL-已取消 + // } + + //System.out.println("===================================根据订单号查询ds.omni.erp.third.order.after.refund.query=================================================="); + //designOrderReturn1("", "" , "3462046956323960601"); + //System.out.println("===================================根据时间段查询ds.omni.erp.third.order.after.refund.query=================================================="); + //designOrderReturn1("2023-08-01 00:00:00", "2023-08-31 00:00:00" , ""); + } + + + public static void designOrderReturn1(String startTime, String endTime,String orderId) throws IOException, URISyntaxException + { + + LinkedHashMap bodyParams = new LinkedHashMap(); + + if(null != orderId && "".equals(orderId)) { + bodyParams.put("refOid", orderId); + }else { + bodyParams.put("startTime", startTime); + bodyParams.put("endTime", endTime); + } + + + TreeMap urlParams = new TreeMap(); + urlParams.put("appKey", APP_KEY); + urlParams.put("method", "ds.omni.erp.third.order.after.refund.query"); + urlParams.put("timestamp", String.valueOf(System.currentTimeMillis())); + urlParams.put("sign", DiansanService.buildSign(urlParams, APP_SECRET, bodyParams)); + + String result = HttpClientUtilNew.sendJsonPost(API_URL, urlParams, bodyParams); + System.out.println("请求参head:" + urlParams.toString()); + System.out.println("请求参body:" + bodyParams.toString()); + System.out.println("result:" + result); + List list = Jsons.getList(result, "content"); + //System.out.println("content:" + list.toString()); + } + + /** + * [简要描述]:申请电子面单号
            + * + * @author caohong + * @param cpCode 点三OMS商家物流编码 + * @param orderId 业务订单号 + * @param posCode 提供面单服务的店铺名称 + * @param tid 电商平台订单号,和收件地址参数不能同时为空 + * @param receiptMap 收件地址为空时,自动取电商平台地址 + * @return + * @throws Exception + */ + public static String getWaybillCode1(String cpCode, String orderId, String posCode, String tid, Map receiptMap) throws Exception + { + String str = "{\r\n" + + " \"cpCode\": \"ZTO-th-37151\",\r\n" + + " \"templateUrl\": \"\",\r\n" + + " \"send\": {\r\n" + + " \"province\": \"湖南省\",\r\n" + + " \"city\": \"长沙市\",\r\n" + + " \"district\": \"天心区\",\r\n" + + " \"town\": \"向右街道\",\r\n" + + " \"detail\": \"安馨新区8栋1502\",\r\n" + + " \"mobile\": \"18785462317\",\r\n" + + " \"phone\": \"020118100\",\r\n" + + " \"name\": \"余三水\"\r\n" + + " },\r\n" + + " \"orders\": [\r\n" + + " {\r\n" + + " \"orderInfo\": {\r\n" + + " \"posCode\": \"th办公旗舰店\",\r\n" + + " \"refOid\": \"123456789\",\r\n" + + " \"payNo\": \"1356462\",\r\n" + + " \"payment\": \"100.00\",\r\n" + + " \"receivedPayment\": \"100.00\",\r\n" + + " \"postFee\": \"5.00\",\r\n" + + " \"serviceFee\": \"0.00\",\r\n" + + " \"receiverName\": \"张三\",\r\n" + + " \"receiverCountry\": \"中国\",\r\n" + + " \"receiverState\": \"湖南省\",\r\n" + + " \"receiverCity\": \"长沙市\",\r\n" + + " \"receiverDistrict\": \"岳麓区\",\r\n" + + " \"receiverTown\": \"麓谷小镇\",\r\n" + + " \"receiverAddress\": \"中电软件园二期B2栋\",\r\n" + + " \"receiverMobile\": \"13526458457\",\r\n" + + " \"receiverPhone\": \"0745156254\",\r\n" + + " \"receiverZip\": \"6542145\",\r\n" + + " \"orderTime\": \"2021-06-17 12:00:00\",\r\n" + + " \"modifyTime\": \"2021-06-17 12:00:00\",\r\n" + + " \"openBuyerId\": \"5364612\",\r\n" + + " \"openBuyerNick\": \"逆流的鱼\",\r\n" + + " \"payTime\": \"2021-06-17 12:00:00\",\r\n" + + " \"shippingTime\": \"2021-06-17 12:00:00\",\r\n" + + " \"status\": \"NOT_SHIPPED\",\r\n" + + " \"refundStatus\": \"NO_REFUND\",\r\n" + + " \"flag\": \"1\",\r\n" + + " \"sellerMemo\": \"尽快安排发货\",\r\n" + + " \"buyerMemo\": \"尽快发货\",\r\n" + + " \"lines\": {\r\n" + + " \"refSpuId\": \"545684\",\r\n" + + " \"refSkuId\": \"1356462\",\r\n" + + " \"sellPrice\": \"100.00\",\r\n" + + " \"price\": \"100.00\",\r\n" + + " \"totalSellPrice\": \"100.00\",\r\n" + + " \"totalPrice\": \"100.00\",\r\n" + + " \"num\": \"1\",\r\n" + + " \"title\": \"笔记本电脑包\",\r\n" + + " \"outerId\": \"1654215\",\r\n" + + " \"standards\": \"黑色 \",\r\n" + + " \"refOlId\": \"20210618001\",\r\n" + + " \"refundStatus\": \"NO_REFUND\",\r\n" + + " \"discountFee\": \"1\",\r\n" + + " \"status\": \"NOT_SHIPPED\"\r\n" + + " }\r\n" + + " },\r\n" + + " \"packages\": [\r\n" + + " {\r\n" + + " \"items\": [\r\n" + + " {\r\n" + + " \"name\": \"80克阿莫西林\",\r\n" + + " \"num\": \"1\"\r\n" + + " }\r\n" + + " ],\r\n" + + " \"channelType\": \"OTHERS\",\r\n" + + " \"totalPackagesCount\": \"2\",\r\n" + + " \"declaredValue\": \"100.26\",\r\n" + + " \"volume\": \"100\",\r\n" + + " \"weight\": \"45\",\r\n" + + " \"packageId\": \"1\"\r\n" + + " }\r\n" + + " ]\r\n" + + " }\r\n" + + " ]\r\n" + + "}"; + JSONObject jsonObject = JSONObject.parseObject(str); + TreeMap urlParams = new TreeMap(); + urlParams.put("appKey", APP_KEY); + urlParams.put("method", "ds.omni.erp.waybill.offline.get"); + urlParams.put("timestamp", String.valueOf(System.currentTimeMillis())); + urlParams.put("sign", buildSign(urlParams, APP_SECRET, jsonObject)); + System.out.println(Jsons.toString(urlParams)); + System.out.println(Jsons.toString(jsonObject)); + String result = HttpClientUtilNew.sendJsonPost1(API_URL, urlParams, jsonObject.toString()); + log.info("订单[" + orderId + "]申请电子面单号:" + result); + return result; + } + + private static String buildSign(Map params, String secret, JSONObject bodyParamsMap) throws IOException + { + // 1.参数排序 + String[] keys = params.keySet().toArray(new String[0]); + Arrays.sort(keys); + + // 2.把所有参数名和参数值串在一起 + StringBuilder query = new StringBuilder(); + // 3. 拼接秘钥 + query.append(secret); + for (String key : keys) + { + String value = params.get(key); + if (isNotEmpty(key) && isNotEmpty(value)) + { + query.append(key).append(value); + } + } + + // 4.拼接 body参数 + if (null != bodyParamsMap) + { + query.append(JSONObject.toJSONString(bodyParamsMap)); + } + + // 5.使用MD5加密 + query.append(secret); + byte[] bytes = encryptMD5(query.toString()); + + // 6.把二进制转化为大写的十六进制 + return byte2hex(bytes); + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ErpClassService.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ErpClassService.java new file mode 100644 index 0000000..301fdab --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/ErpClassService.java @@ -0,0 +1,121 @@ +package com.zhiqim.yangcai.design.server; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.TreeMap; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.httpclient.HttpPost; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.codes.MD5; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.util.HttpClientUtilNew; + +public class ErpClassService { + + private static final String BASE_URL = "http://47.114.150.226:88/Handler/apiDesign.ashx"; +// private static final String BASE_URL = "http://localhost:911/Handler/apiDesign.ashx"; + private static final String ADD_LOG_PARAMS = "DesignSys_AddLog"; + private static final String CHANGE_STATUS_PARAMS = "DesignSys_OrderStateChange"; + private static final String CREATE_ACCOUNT = "create_erp_account"; + + public enum statusEnum { + + TO_BE_DESIGNED(3, "待设计"), TO_BE_DESIGNEDING(4, "设计中"), TO_BE_DESIGNED_COM(5, "设计完成"),; + + Integer code; + String value; + + statusEnum(Integer code, String value) { + this.code = code; + this.value = value; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getValue() { + return value; + } + + public void setgetValue(String value) { + this.value = value; + } + + } + + /** + * 改状态 + * + * @param tid + * @param userName + * @param orderState + */ + public ErpClassService(String tid, String userName, Integer orderState) { + this.changeStatus(tid, userName, orderState); + } + + /** + * 添加日志 + * + * @param tid + * @param userName + * @param orderState + * @param con + */ + public ErpClassService(String tid, String userName, Integer orderState, String con) { + this.addLog(tid, userName, orderState, con); + } + + public void addAccount(String name) { + Map bodyParams = new HashMap(); + bodyParams.put("name", name); + bodyParams.put("pwd", "123456"); + + sendUrl(bodyParams, CREATE_ACCOUNT); + } + + public void changeStatus(String tid, String userName, Integer orderState) { + Map bodyParams = new HashMap(); + bodyParams.put("tid", tid); + bodyParams.put("userName", userName); + bodyParams.put("orderState", orderState); + + sendUrl(bodyParams, CHANGE_STATUS_PARAMS); + } + + public void addLog(String tid, String userName, Integer orderState, String con) { + Map bodyParams = new HashMap(); + bodyParams.put("tid", tid); + bodyParams.put("userName", userName); + bodyParams.put("orderState", orderState); + bodyParams.put("con", con); + + sendUrl(bodyParams, ADD_LOG_PARAMS); + } + + private static void sendUrl(Map paramMap, String method) { + TreeMap urlParamsMap = new TreeMap(); + urlParamsMap.put("t", method); + LinkedHashMap bodyParamsMap = new LinkedHashMap(paramMap); + try { + String result = HttpClientUtilNew.sendErpPost(BASE_URL, urlParamsMap, bodyParamsMap); + System.out.println(result); + } catch (URISyntaxException | IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/module/ApiFile.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/module/ApiFile.java new file mode 100644 index 0000000..44118a3 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/module/ApiFile.java @@ -0,0 +1,110 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.server.module; + +import java.io.Serializable; + +import org.zhiqim.kernel.json.Jsons; + +/**** + * 文件对象 + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public class ApiFile implements Serializable +{ + private static final long serialVersionUID = 1L; + + private long designId; // 1设计订单号 + private long attaId; // 2附件编号 + private String attaModule; // 3附件类型 + private String fileName; // 4文件名,接口请求必须字段 + private String fileExt; // 5文件后缀名 ,接口请求必须字段 + private long fileSize; // 6文件大小,接口请求必须字段 + private String downUrl; // 7下载地址,接口请求必须字段 + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public long getAttaId() + { + return attaId; + } + + public void setAttaId(long attaId) + { + this.attaId = attaId; + } + + public String getAttaModule() + { + return attaModule; + } + + public void setAttaModule(String attaModule) + { + this.attaModule = attaModule; + } + + public String getFileName() + { + return fileName; + } + + public void setFileName(String fileName) + { + this.fileName = fileName; + } + + public String getFileExt() + { + return fileExt; + } + + public void setFileExt(String fileExt) + { + this.fileExt = fileExt; + } + + public long getFileSize() + { + return fileSize; + } + + public void setFileSize(long fileSize) + { + this.fileSize = fileSize; + } + + public String getDownUrl() + { + return downUrl; + } + + public void setDownUrl(String downUrl) + { + this.downUrl = downUrl; + } + + @Override + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterCancelRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterCancelRequest.java new file mode 100644 index 0000000..1d0c584 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterCancelRequest.java @@ -0,0 +1,128 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.after; + +import java.util.TreeMap; + +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +public class DesignAfterCancelRequest extends ApiRequest +{ + // 字段类型 接口字段 长度 是否必须 字段描述 + private long merchantId;// 是 商户标号 + private long designAfsId;// 64 是 设计平台售后单号 + private String cancelNote;// 300 是 问题描述 + + public DesignAfterCancelResponse newResponse() + { + return new DesignAfterCancelResponse(); + } + + /**** + * 验证参数 + */ + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + String merchantId = paramMap.get("merchantId"); + String designAfsId = paramMap.get("designAfsId"); + if (!Validates.isNumericLen(merchantId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + + + if (!Validates.isNumericLen(designAfsId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("designAfsId", designAfsId)); + return false; + } + + String cancelNote = paramMap.get("cancelNote"); + if (Validates.isEmptyBlank(cancelNote)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("cancelNote", cancelNote)); + return false; + } + + if (!Validates.isLen(Strings.trim(cancelNote), 1, 300)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("cancelNote", cancelNote) +", 最大限制 300个字符"); + return false; + } + + return true; + } + + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + String designAfsId = paramMap.get("designAfsId"); + try + { + setMerchantId(Longs.toLong(paramMap.get("merchantId"))); + setDesignAfsId(Longs.toLong(designAfsId)); + setCancelNote(Strings.trim(paramMap.get("cancelNote"))); + } + catch (Exception e) + { + log.error("售后取消接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(designAfsId, code.value(), code.desc(), e); + return false; + } + return true; + } + + + /******************************************/ + /******************参数设置****************/ + /*****************************************/ + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + public long getDesignAfsId() + { + return designAfsId; + } + + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + + public String getCancelNote() + { + return cancelNote; + } + + public void setCancelNote(String cancelNote) + { + this.cancelNote = cancelNote; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterCancelResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterCancelResponse.java new file mode 100644 index 0000000..5d4f3aa --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterCancelResponse.java @@ -0,0 +1,36 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.after; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +public class DesignAfterCancelResponse extends ApiResponse +{ + private boolean isCanceled;// 是否已取消 + + protected String buildBody() + { + return Jsons.toString(this); + } + + public boolean isCanceled() + { + return isCanceled; + } + + public void setCanceled(boolean isCanceled) + { + this.isCanceled = isCanceled; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterComplainPersonRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterComplainPersonRequest.java new file mode 100644 index 0000000..3677141 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterComplainPersonRequest.java @@ -0,0 +1,133 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignAfterComplainPassHandlerAlterRequest.java + * 创建人 :高佳新 + * 创建时间:2019-5-29 + */ + +package com.zhiqim.yangcai.design.server.request.after; + +import java.util.TreeMap; + +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +/** + * + * 设计平台处理erp申诉通过信息同步请求类 + * + * @version 1.0 @author 高佳新 2019-5-30 新建与整理 + */ +public class DesignAfterComplainPersonRequest extends ApiRequest +{ + // 字段类型 接口字段 长度 是否必须 字段描述 + private long merchantId;// 是 商户标号 + private long designAfsId;// 64 是 设计平台售后单号 + private String afsLosser;// 20 是 指定责任人 + + @Override + public DesignAfterComplainPersonResponse newResponse() + { + return new DesignAfterComplainPersonResponse(); + } + + /**** + * 验证参数 + */ + @Override + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + String merchantId = paramMap.get("merchantId"); + String designAfsId = paramMap.get("designAfsId"); + if (!Validates.isNumericLen(merchantId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + if (!Validates.isNumericLen(designAfsId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("designAfsId", designAfsId)); + return false; + } + + String afsLosser = paramMap.get("afsLosser"); + if (Validates.isEmptyBlank(afsLosser)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("afsLosser", afsLosser)); + return false; + } + + if (!Validates.isLen(Strings.trim(afsLosser), 1, 300)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("afsLosser", afsLosser) + ", 处理人长度过长"); + return false; + } + + return true; + } + + @Override + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + String designAfsId = paramMap.get("designAfsId"); + try + { + setMerchantId(Longs.toLong(paramMap.get("merchantId"))); + setDesignAfsId(Longs.toLong(designAfsId)); + setAfsLosser(Strings.trim(paramMap.get("afsLosser"))); + } + catch (Exception e) + { + log.error("售后审核通过接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(designAfsId, code.value(), code.desc(), e); + return false; + } + return true; + } + + /******************************************/ + /****************** 参数设置 ****************/ + /*****************************************/ + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignAfsId() + { + return designAfsId; + } + + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + + public String getAfsLosser() + { + return afsLosser; + } + + public void setAfsLosser(String afsLosser) + { + this.afsLosser = afsLosser; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterComplainPersonResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterComplainPersonResponse.java new file mode 100644 index 0000000..5a2d441 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterComplainPersonResponse.java @@ -0,0 +1,40 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignAfterComplainPassHandlerAlterResponse.java + * 创建人 :高佳新 + * 创建时间:2019-5-29 + */ + +package com.zhiqim.yangcai.design.server.request.after; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +/** + * + * 设计平台申诉通过信息响应状态 + * + * @version 1.0 @author 高佳新 2019-5-30 新建与整理 + */ +public class DesignAfterComplainPersonResponse extends ApiResponse +{ + private boolean isHandlerAlter; // 信息是否修改成功 + + @Override + protected String buildBody() + { + return Jsons.toString(this); + } + + public boolean isHandlerAlter() + { + return isHandlerAlter; + } + + public void setHandlerAlter(boolean isHandlerAlter) + { + this.isHandlerAlter = isHandlerAlter; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterComplainReturnRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterComplainReturnRequest.java new file mode 100644 index 0000000..e9601ba --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterComplainReturnRequest.java @@ -0,0 +1,131 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.after; + +import java.util.TreeMap; + +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +/*** + * 售后申诉退回 + * + * @version v1.0.0 @author lgz 2019-1-10 新建与整理 + */ +public class DesignAfterComplainReturnRequest extends ApiRequest +{ + // 字段类型 接口字段 长度 是否必须 字段描述 + private long merchantId;// 是 商户标号 + private long designAfsId;// 64 是 设计平台售后单号 + private String returnNote;// 300 是 问题描述 + + public DesignAfterComplainReturnResponse newResponse() + { + return new DesignAfterComplainReturnResponse(); + } + + /**** + * 验证参数 + */ + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + String merchantId = paramMap.get("merchantId"); + String designAfsId = paramMap.get("designAfsId"); + if (!Validates.isNumericLen(merchantId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + if (!Validates.isNumericLen(designAfsId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("designAfsId", designAfsId)); + return false; + } + + String returnNote = paramMap.get("returnNote"); + if (Validates.isEmptyBlank(returnNote)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("returnNote", returnNote)); + return false; + } + + if (!Validates.isLen(Strings.trim(returnNote), 1, 300)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("returnNote", returnNote) +", 最大限制 300个字符"); + return false; + } + + return true; + } + + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + String designAfsId = paramMap.get("designAfsId"); + try + { + setMerchantId(Longs.toLong(paramMap.get("merchantId"))); + setDesignAfsId(Longs.toLong(designAfsId)); + setReturnNote(Strings.trim(paramMap.get("returnNote"))); + } + catch (Exception e) + { + log.error("售后申诉退回接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(designAfsId, code.value(), code.desc(), e); + return false; + } + return true; + } + + + /******************************************/ + /******************参数设置****************/ + /*****************************************/ + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + public long getDesignAfsId() + { + return designAfsId; + } + + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + + public String getReturnNote() + { + return returnNote; + } + + public void setReturnNote(String returnNote) + { + this.returnNote = returnNote; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterComplainReturnResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterComplainReturnResponse.java new file mode 100644 index 0000000..7a1619e --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterComplainReturnResponse.java @@ -0,0 +1,37 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.after; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +public class DesignAfterComplainReturnResponse extends ApiResponse +{ + private boolean isReturned;// 是否拒绝 + + protected String buildBody() + { + return Jsons.toString(this); + } + + public boolean isReturned() + { + return isReturned; + } + + public void setReturned(boolean isReturned) + { + this.isReturned = isReturned; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterCreateRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterCreateRequest.java new file mode 100644 index 0000000..83248a9 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterCreateRequest.java @@ -0,0 +1,341 @@ +package com.zhiqim.yangcai.design.server.request.after; + +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; +import com.zhiqim.yangcai.design.server.module.ApiFile; + +/** + * [简要描述]:创建售后订单
            + * [详细描述]:
            + * + * @version 1.0 @author caohong 2020年11月5日 新建与整理 + */ +public class DesignAfterCreateRequest extends ApiRequest +{ + private long merchantId;// 是 商户标号 + private long designId;// 是 那条设计订单 出的售后 + private long newDesignId;// 是 那条设计订单 出的售后 + private String outAfsId;// 是 外部售后单号 + private String problemDesc;// 售后问题原因描述 + private double lossAmount;// 售后金额 + private List aipFiles;// 否 售后文件 + private Long picTypeId;// 否 售后原因 + private String afterBlamer;// 否 责任人 + private String afterHandler; // 否 处理人 (指派责任的人) + private String problemReason; // 是 售后问题原因 + + @Override + public DesignAfterCreateResponse newResponse() + { + return new DesignAfterCreateResponse(); + } + + /**** + * 验证参数 + */ + @Override + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + String merchantId = paramMap.get("merchantId"); + String designId = paramMap.get("designId"); + if (!Validates.isNumericLen(merchantId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + + if (!Validates.isNumericLen(designId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designId", designId)); + return false; + } + String newDesignId = paramMap.get("newDesignId"); + if (Validates.isNotEmptyBlank(newDesignId) && !Validates.isNumericLen(newDesignId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("newDesignId", newDesignId)); + return false; + } + + String outAfsId = paramMap.get("outAfsId"); + if (Validates.isEmptyBlank(outAfsId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("outAfsId", outAfsId)); + return false; + } + + if (!Validates.isLen(outAfsId, 1, 64)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("outAfsId", outAfsId) + ", 最大限制 64个字符"); + return false; + } + + String problemDesc = paramMap.get("problemDesc"); + if (Validates.isEmptyBlank(problemDesc)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("problemDesc", problemDesc)); + return false; + } + + String problemReason = paramMap.get("problemReason"); + if (Validates.isEmptyBlank(problemReason)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("problemReason", problemReason)); + return false; + } + + if (!Validates.isLen(Strings.trim(problemDesc), 1, 300)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("problemDesc", problemDesc) + ", 最大限制 300个字符"); + return false; + } + + String lossAmount = paramMap.get("lossAmount"); + if (Validates.isNotEmptyBlank(lossAmount) && !Validates.isAmount2R(lossAmount)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("lossAmount", lossAmount)); + return false; + } + + // 文件有性 检查 + List aipFiles = Jsons.toList(paramMap.get("aipFiles"), ApiFile.class); + for (ApiFile apiFile : aipFiles) + { + + // designId; //1设计订单号 + // attaId; //2附件编号 + // attaModule; //3附件类型 + // fileName; //4文件名,接口请求必须字段 + // fileExt; //5文件后缀名 ,接口请求必须字段 + // fileSize; //6文件大小,接口请求必须字段 + // downUrl; //7下载地址,接口请求必须字段 + + if (Validates.isEmptyBlank(apiFile.getFileName())) + { + Int code = ApiErrorCodes.ERROR_API_FILE_PARAM; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("fileName", apiFile.getFileName()) + ", 接口文件名不能为空"); + return false; + } + + if (!Validates.isLen(apiFile.getFileName(), 1, 200)) + { + Int code = ApiErrorCodes.ERROR_API_FILE_PARAM; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("fileName", apiFile.getFileName()) + ", 接口文件名最大限制 200 字符"); + return false; + } + + if (Validates.isEmptyBlank(apiFile.getFileExt())) + { + Int code = ApiErrorCodes.ERROR_API_FILE_PARAM; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("fileExt", apiFile.getFileExt()) + ", 接口文件后缀名"); + return false; + } + + if (!Validates.isLen(apiFile.getFileExt(), 1, 10)) + { + Int code = ApiErrorCodes.ERROR_API_FILE_PARAM; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("fileExt", apiFile.getFileExt()) + ", 接口文件后缀名最大限制 10 字符"); + return false; + } + + if (Validates.isEmptyBlank(apiFile.getDownUrl())) + { + Int code = ApiErrorCodes.ERROR_API_FILE_PARAM; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("downUrl", apiFile.getDownUrl()) + ", 接口文件下载地址不能为空"); + return false; + } + + if (!Validates.isLen(apiFile.getDownUrl(), 1, 200)) + { + Int code = ApiErrorCodes.ERROR_API_FILE_PARAM; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("downUrl", apiFile.getDownUrl()) + ", 接口文件名最大限制 400 字符"); + return false; + } + } + return true; + } + + @Override + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + String designId = Strings.trim(paramMap.get("designId")); + try + { + setMerchantId(Longs.toLong(paramMap.get("merchantId"))); + setDesignId(Longs.toLong(designId)); + setOutAfsId(Strings.trim(paramMap.get("outAfsId"))); + setProblemDesc(Strings.trim(paramMap.get("problemDesc"))); + setProblemReason(Strings.trim(paramMap.get("problemReason"))); + String lossAmount = paramMap.get("lossAmount"); + if (Validates.isNotEmptyBlank(lossAmount)) + { + setLossAmount(Double.valueOf(lossAmount)); + } + + String newDesignId = paramMap.get("newDesignId"); + if (Validates.isNotEmptyBlank(newDesignId) && !Validates.isNumericLen(newDesignId, 1, 20)) + { + setNewDesignId(Longs.toLong(newDesignId)); + } + + aipFiles = Jsons.toList(paramMap.get("aipFiles"), ApiFile.class); + aipFiles = aipFiles != null ? aipFiles : new ArrayList(); + setAipFiles(aipFiles); + String afterBlamer = paramMap.get("afterBlamer"); + String picTypeId = paramMap.get("picTypeId"); + String afterHandler = paramMap.get("afterHandler"); + + if (Validates.isNotEmpty(afterBlamer)) + { + setAfterBlamer(Strings.trim(afterBlamer)); + } + if (Validates.isNotEmpty(picTypeId)) + { + setPicTypeId(Longs.toLong(picTypeId)); + } + if (Validates.isNotEmpty(afterHandler)) + { + setAfterHandler(Strings.trim(afterHandler)); + } + + } + catch (Exception e) + { + log.error("售后创建接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(designId, code.value(), code.desc(), e); + return false; + } + return true; + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public long getNewDesignId() + { + return newDesignId; + } + + public void setNewDesignId(long newDesignId) + { + this.newDesignId = newDesignId; + } + + public String getOutAfsId() + { + return outAfsId; + } + + public void setOutAfsId(String outAfsId) + { + this.outAfsId = outAfsId; + } + + public String getProblemDesc() + { + return problemDesc; + } + + public void setProblemDesc(String problemDesc) + { + this.problemDesc = problemDesc; + } + + public double getLossAmount() + { + return lossAmount; + } + + public void setLossAmount(double lossAmount) + { + this.lossAmount = lossAmount; + } + + public List getAipFiles() + { + return aipFiles; + } + + public void setAipFiles(List aipFiles) + { + this.aipFiles = aipFiles; + } + + public Long getPicTypeId() + { + return picTypeId; + } + + public void setPicTypeId(Long picTypeId) + { + this.picTypeId = picTypeId; + } + + public String getAfterBlamer() + { + return afterBlamer; + } + + public void setAfterBlamer(String afterBlamer) + { + this.afterBlamer = afterBlamer; + } + + public String getAfterHandler() + { + return afterHandler; + } + + public void setAfterHandler(String afterHandler) + { + this.afterHandler = afterHandler; + } + + public String getProblemReason() + { + return problemReason; + } + + public void setProblemReason(String problemReason) + { + this.problemReason = problemReason; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterCreateResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterCreateResponse.java new file mode 100644 index 0000000..244e3e5 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterCreateResponse.java @@ -0,0 +1,37 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.after; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +public class DesignAfterCreateResponse extends ApiResponse +{ + //写参数字段 + private long designAfsId;// 设计盘平台的售后单号 + + protected String buildBody() + { + return Jsons.toString(this); + } + + public long getDesignAfsId() + { + return designAfsId; + } + + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterModule.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterModule.java new file mode 100644 index 0000000..ecadfbb --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterModule.java @@ -0,0 +1,112 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.after; + +import java.sql.Timestamp; + + +/*** + * 设计是平台 售后订单 模型 + * TODO:类功能介绍 + * + * @version v1.0.0 @author longguizhi 2018-12-15 新建与整理 + */ +public class DesignAfterModule +{ + /****************************************/ + /****************服务端数据***************/ + /****************************************/ + private long designId; //那条设计订单 出的售后 + private long designAfsId; //设计盘平台的售后单号 + private int afterStatus; //处理状态 + private int problemType; //问题类型 + private String problemDesc; //问题描述 + private Timestamp createTime; + private Timestamp modifyTime; + private long merchantId; + private long outAfsId; + public long getDesignId() + { + return designId; + } + public void setDesignId(long designId) + { + this.designId = designId; + } + public long getDesignAfsId() + { + return designAfsId; + } + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + public int getAfterStatus() + { + return afterStatus; + } + public void setAfterStatus(int afterStatus) + { + this.afterStatus = afterStatus; + } + public int getProblemType() + { + return problemType; + } + public void setProblemType(int problemType) + { + this.problemType = problemType; + } + public String getProblemDesc() + { + return problemDesc; + } + public void setProblemDesc(String problemDesc) + { + this.problemDesc = problemDesc; + } + public Timestamp getCreateTime() + { + return createTime; + } + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + public Timestamp getModifyTime() + { + return modifyTime; + } + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + public long getMerchantId() + { + return merchantId; + } + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + public long getOutAfsId() + { + return outAfsId; + } + public void setOutAfsId(long outAfsId) + { + this.outAfsId = outAfsId; + } + + + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterSynRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterSynRequest.java new file mode 100644 index 0000000..b2a0a64 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterSynRequest.java @@ -0,0 +1,169 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.after; + +import java.sql.Timestamp; +import java.util.TreeMap; + +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +public class DesignAfterSynRequest extends ApiRequest +{ + // 字段类型 接口字段 长度 是否必须 字段描述 + private long merchantId;// 是 >0 该商户的 订单的出现的售后 + private String outAfsId;// 否 >0 设计订单号 表示 该订单号出的售后 + private long designAfsId;//售后类型 否 售后类型, + private Timestamp startModifyTime;// 是 售后单变更开始时间 + private Timestamp endModifyTime;// 是 售后单变更结束时间 + + public DesignAfterSynResponse newResponse() + { + return new DesignAfterSynResponse(); + } + + /**** + * 验证参数 + */ + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + String merchantId = paramMap.get("merchantId"); + String designAfsId = Strings.trim(paramMap.get("designAfsId")); + if (!Validates.isNumericLen(merchantId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + + + if (Validates.isNotEmptyBlank(outAfsId) && !Validates.isNumericLen(designAfsId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("designAfsId", designAfsId)); + return false; + } + + String startModifyTime = paramMap.get("startModifyTime"); + if (!Validates.isDateTime(startModifyTime)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("startModifyTime", startModifyTime)); + return false; + } + + String endModifyTime = paramMap.get("endModifyTime"); + if (!Validates.isDateTime(endModifyTime)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("endModifyTime", endModifyTime)); + return false; + } + + int diff = DateTimes.compareHour(endModifyTime, startModifyTime); + if (Math.abs(diff) > 24) + { + Int code = ApiErrorCodes.ERROR_API_LONG_TIME_SPAN; + err.setError(designAfsId, code.value(), code.desc() + "[startModifyTime][endModifyTime]时间跨度不能操作 24小时"); + return false; + } + + return true; + } + + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + String designAfsId = Strings.trim(paramMap.get("designAfsId")); + try + { + setMerchantId(Longs.toLong(paramMap.get("merchantId"))); + setOutAfsId(Strings.trim(paramMap.get("outAfsId"))); + setDesignAfsId(Longs.toLong(paramMap.get("designAfsId"), -1)); + setStartModifyTime(Sqls.toTimestamp(Strings.trim(paramMap.get("startModifyTime")))); + setEndModifyTime(Sqls.toTimestamp(Strings.trim(paramMap.get("endModifyTime")))); + + } + catch (Exception e) + { + + log.error("售后同步接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(designAfsId, code.value(), code.desc(), e); + return false; + } + + return true; + } + + + /******************************************/ + /******************参数设置****************/ + /*****************************************/ + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public String getOutAfsId() + { + return outAfsId; + } + + public void setOutAfsId(String outAfsId) + { + this.outAfsId = outAfsId; + } + + public long getDesignAfsId() + { + return designAfsId; + } + + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + + public Timestamp getStartModifyTime() + { + return startModifyTime; + } + + public void setStartModifyTime(Timestamp startModifyTime) + { + this.startModifyTime = startModifyTime; + } + + public Timestamp getEndModifyTime() + { + return endModifyTime; + } + + public void setEndModifyTime(Timestamp endModifyTime) + { + this.endModifyTime = endModifyTime; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterSynResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterSynResponse.java new file mode 100644 index 0000000..7b40f42 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterSynResponse.java @@ -0,0 +1,39 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.after; + +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +public class DesignAfterSynResponse extends ApiResponse +{ + + private List afterList; + + protected String buildBody() + { + return Jsons.toString(this); + } + + public List getAfterList() + { + return afterList; + } + + public void setAfterList(List afterList) + { + this.afterList = afterList; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterUpdateRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterUpdateRequest.java new file mode 100644 index 0000000..ca47497 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterUpdateRequest.java @@ -0,0 +1,257 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.server.request.after; + +import java.util.TreeMap; + +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +public class DesignAfterUpdateRequest extends ApiRequest +{ + // 字段类型 接口字段 长度 是否必须 字段描述 + private long designAfterId;// 是 售后单id + private long merchantId;// 是 商户标号 + private long designId;// 是 那条设计订单 出的售后 + private long newDesignId;// 是 那条设计订单 出的售后 + private String outAfsId;// 64 是 第三方售后单号 + private String problemDesc;// 300 是 问题描述 + private double lossAmount; + private Long picTypeId;// 否 售后原因 + private String afterBlamer;// 是 责任人 + + public DesignAfterUpdateResponse newResponse() + { + return new DesignAfterUpdateResponse(); + } + + /**** + * 验证参数 + */ + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + String designAfterId = paramMap.get("designAfterId"); + String merchantId = paramMap.get("merchantId"); + String designId = paramMap.get("designId"); + if (!Validates.isNumericLen(designAfterId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designAfterId", designAfterId)); + return false; + } + if (!Validates.isNumericLen(merchantId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + + if (!Validates.isNumericLen(designId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designId", designId)); + return false; + } + String newDesignId = paramMap.get("newDesignId"); + if (Validates.isNotEmptyBlank(newDesignId) && !Validates.isNumericLen(newDesignId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("newDesignId", newDesignId)); + return false; + } + + String outAfsId = paramMap.get("outAfsId"); + if (Validates.isEmptyBlank(outAfsId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("outAfsId", outAfsId)); + return false; + } + + String picTypeId = paramMap.get("picTypeId"); + if (Validates.isEmptyBlank(picTypeId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("picTypeId", picTypeId)); + return false; + } + + if (!Validates.isLen(outAfsId, 1, 64)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("outAfsId", outAfsId) + ", 最大限制 64个字符"); + return false; + } + + String problemDesc = paramMap.get("problemDesc"); + if (Validates.isEmptyBlank(problemDesc)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("problemDesc", problemDesc)); + return false; + } + + if (!Validates.isLen(Strings.trim(problemDesc), 1, 300)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("problemDesc", problemDesc) + ", 最大限制 300个字符"); + return false; + } + + String lossAmount = paramMap.get("lossAmount"); + if (Validates.isNotEmptyBlank(lossAmount) && !Validates.isAmount2R(lossAmount)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("lossAmount", lossAmount)); + return false; + } + + String afterBlamer = paramMap.get("afterBlamer"); + if (Validates.isEmptyBlank(afterBlamer)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("afterBlamer", afterBlamer)); + return false; + } + + return true; + } + + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + String designId = Strings.trim(paramMap.get("designId")); + try + { + setMerchantId(Longs.toLong(paramMap.get("merchantId"))); + setDesignAfterId(Longs.toLong(paramMap.get("designAfterId"))); + setDesignId(Longs.toLong(designId)); + setOutAfsId(Strings.trim(paramMap.get("outAfsId"))); + setProblemDesc(Strings.trim(paramMap.get("problemDesc"))); + String lossAmount = paramMap.get("lossAmount"); + if (Validates.isNotEmptyBlank(lossAmount)) + setLossAmount(Double.valueOf(lossAmount)); + + String newDesignId = paramMap.get("newDesignId"); + if (Validates.isNotEmptyBlank(newDesignId) && !Validates.isNumericLen(newDesignId, 1, 20)) + setNewDesignId(Longs.toLong(newDesignId)); + + setAfterBlamer(Strings.trim(paramMap.get("afterBlamer"))); + setPicTypeId(Longs.toLong(paramMap.get("picTypeId"))); + } + catch (Exception e) + { + log.error("售后更新接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(designId, code.value(), code.desc(), e); + return false; + } + return true; + } + + /******************************************/ + /****************** 参数设置 ****************/ + /*****************************************/ + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public long getNewDesignId() + { + return newDesignId; + } + + public void setNewDesignId(long newDesignId) + { + this.newDesignId = newDesignId; + } + + public String getOutAfsId() + { + return outAfsId; + } + + public void setOutAfsId(String outAfsId) + { + this.outAfsId = outAfsId; + } + + public String getProblemDesc() + { + return problemDesc; + } + + public void setProblemDesc(String problemDesc) + { + this.problemDesc = problemDesc; + } + + public double getLossAmount() + { + return lossAmount; + } + + public void setLossAmount(double lossAmount) + { + this.lossAmount = lossAmount; + } + + public Long getPicTypeId() + { + return picTypeId; + } + + public void setPicTypeId(Long picTypeId) + { + this.picTypeId = picTypeId; + } + + public String getAfterBlamer() + { + return afterBlamer; + } + + public void setAfterBlamer(String afterBlamer) + { + this.afterBlamer = afterBlamer; + } + + public long getDesignAfterId() + { + return designAfterId; + } + + public void setDesignAfterId(long designAfterId) + { + this.designAfterId = designAfterId; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterUpdateResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterUpdateResponse.java new file mode 100644 index 0000000..dd0d94a --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/DesignAfterUpdateResponse.java @@ -0,0 +1,37 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.after; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +public class DesignAfterUpdateResponse extends ApiResponse +{ + //写参数字段 + private long designAfsId;// 设计盘平台的售后单号 + + protected String buildBody() + { + return Jsons.toString(this); + } + + public long getDesignAfsId() + { + return designAfsId; + } + + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/RespAfter.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/RespAfter.java new file mode 100644 index 0000000..a3939f5 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/after/RespAfter.java @@ -0,0 +1,151 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.after; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +import com.zhiqim.yangcai.design.server.module.ApiFile; + + +/*** + * 设计是平台 售后订单 相应 + * TODO:类功能介绍 + * + * @version v1.0.0 @author longguizhi 2018-12-15 新建与整理 + */ +public class RespAfter +{ + /****************************************/ + /****************服务端数据***************/ + /****************************************/ + private long designId; //那条设计订单 出的售后 + private long designAfsId; //设计盘平台的售后单号 + private int afterStatus; //处理状态 + private long problemType; //问题类型 + private String problemDesc; //问题描述 + private Timestamp createTime; + private Timestamp modifyTime; + private long merchantId; + private String outAfsId; + private String designerComplainReason; //设计师申诉原因 + private String designComplainCheckNote; //售后申诉审核备注 + private String afterFinishNote; //售后完成备注 + private List apiFiles; + + public long getDesignId() + { + return designId; + } + public void setDesignId(long designId) + { + this.designId = designId; + } + public long getDesignAfsId() + { + return designAfsId; + } + public void setDesignAfsId(long designAfsId) + { + this.designAfsId = designAfsId; + } + public int getAfterStatus() + { + return afterStatus; + } + public void setAfterStatus(int afterStatus) + { + this.afterStatus = afterStatus; + } + public long getProblemType() + { + return problemType; + } + public void setProblemType(long problemType) + { + this.problemType = problemType; + } + public String getProblemDesc() + { + return problemDesc; + } + public void setProblemDesc(String problemDesc) + { + this.problemDesc = problemDesc; + } + public Timestamp getCreateTime() + { + return createTime; + } + public void setCreateTime(Timestamp createTime) + { + this.createTime = createTime; + } + public Timestamp getModifyTime() + { + return modifyTime; + } + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + public long getMerchantId() + { + return merchantId; + } + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + public String getOutAfsId() + { + return outAfsId; + } + public void setOutAfsId(String outAfsId) + { + this.outAfsId = outAfsId; + } + public List getApiFiles() + { + return apiFiles; + } + public void setApiFiles(List apiFiles) + { + this.apiFiles = apiFiles != null ? apiFiles : new ArrayList(); + } + public String getDesignerComplainReason() + { + return designerComplainReason; + } + public void setDesignerComplainReason(String designerComplainReason) + { + this.designerComplainReason = designerComplainReason; + } + public String getDesignComplainCheckNote() + { + return designComplainCheckNote; + } + public void setDesignComplainCheckNote(String designComplainCheckNote) + { + this.designComplainCheckNote = designComplainCheckNote; + } + public String getAfterFinishNote() + { + return afterFinishNote; + } + public void setAfterFinishNote(String afterFinishNote) + { + this.afterFinishNote = afterFinishNote; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/complain/ComplainSyn.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/complain/ComplainSyn.java new file mode 100644 index 0000000..a41aa39 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/complain/ComplainSyn.java @@ -0,0 +1,141 @@ +/** + * 扬彩印刷设计 + * 文件名 :ComplainSyn.java + * 创建人 :gjx + * 创建时间:2019-8-17 + */ + +package com.zhiqim.yangcai.design.server.request.complain; + + + +/** + * 设计平台 投诉单信息同步 响应 + * + * @version 1.0 @author gjx 2019-8-17 新建与整理 + */ +public class ComplainSyn +{ + private long complainId; // 投诉单ID + private long designId; // 设计单号 + private String complainStatus; // 投诉状态 + private String finishImgPath; // 投诉单完结图片路径 + private String assistPerson; // 协助人 + private long assistOrg; // 协助组织 + private String undertakeOrgName; // 责任组织 + private String assistDeptManager; // 协助主管 + private String assistOrgName; // 协助组织名称 + private String undertakeDeptManager; // 责任主管 + private long undertakeOrg; // 责任组织 + + public long getComplainId() + { + return complainId; + } + + public void setComplainId(long complainId) + { + this.complainId = complainId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getComplainStatus() + { + return complainStatus; + } + + public void setComplainStatus(String complainStatus) + { + this.complainStatus = complainStatus; + } + + public String getFinishImgPath() + { + return finishImgPath; + } + + public void setFinishImgPath(String finishImgPath) + { + this.finishImgPath = finishImgPath; + } + + public String getAssistPerson() + { + return assistPerson; + } + + public void setAssistPerson(String assistPerson) + { + this.assistPerson = assistPerson; + } + + public long getAssistOrg() + { + return assistOrg; + } + + public void setAssistOrg(long assistOrg) + { + this.assistOrg = assistOrg; + } + + public String getUndertakeOrgName() + { + return undertakeOrgName; + } + + public void setUndertakeOrgName(String undertakeOrgName) + { + this.undertakeOrgName = undertakeOrgName; + } + + public String getAssistDeptManager() + { + return assistDeptManager; + } + + public void setAssistDeptManager(String assistDeptManager) + { + this.assistDeptManager = assistDeptManager; + } + + public String getAssistOrgName() + { + return assistOrgName; + } + + public void setAssistOrgName(String assistOrgName) + { + this.assistOrgName = assistOrgName; + } + + public String getUndertakeDeptManager() + { + return undertakeDeptManager; + } + + public void setUndertakeDeptManager(String undertakeDeptManager) + { + this.undertakeDeptManager = undertakeDeptManager; + } + + public long getUndertakeOrg() + { + return undertakeOrg; + } + + public void setUndertakeOrg(long undertakeOrg) + { + this.undertakeOrg = undertakeOrg; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/complain/DesignComplainSynRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/complain/DesignComplainSynRequest.java new file mode 100644 index 0000000..82bb56a --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/complain/DesignComplainSynRequest.java @@ -0,0 +1,130 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignComplainSynRequest.java + * 创建人 :gjx + * 创建时间:2019-8-17 + */ + +package com.zhiqim.yangcai.design.server.request.complain; + +import java.sql.Timestamp; +import java.util.TreeMap; + +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +/** + * + * @version 1.0 @author gjx 2019-8-17 新建与整理 + */ +public class DesignComplainSynRequest extends ApiRequest +{ + private long merchantId;// 是 订单商户编号 + private Timestamp startModifyTime;// 是 设计平台的订单开始变更时间,默认十分钟前 + private Timestamp endModifyTime;// 是 设计平台的订单结束时间,默认当前时间 + + @Override + public DesignComplainSynResponse newResponse() + { + return new DesignComplainSynResponse(); + } + + @Override + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + String merchantId = paramMap.get("merchantId"); + String designAfsId = Strings.trim(paramMap.get("designAfsId")); + if (!Validates.isNumericLen(merchantId, 1, 20)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + String startModifyTime = paramMap.get("startModifyTime"); + if (!Validates.isDateTime(startModifyTime)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("startModifyTime", startModifyTime)); + return false; + } + + String endModifyTime = paramMap.get("endModifyTime"); + if (!Validates.isDateTime(endModifyTime)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + err.setError(designAfsId, code.value(), code.desc() + biuldKeyValueString("endModifyTime", endModifyTime)); + return false; + } + + int diff = DateTimes.compareHour(endModifyTime, startModifyTime); + if (Math.abs(diff) > 24) + { + Int code = ApiErrorCodes.ERROR_API_LONG_TIME_SPAN; + err.setError(designAfsId, code.value(), code.desc() + "[startModifyTime][endModifyTime]时间跨度不能操作 24小时"); + return false; + } + + return true; + } + + @Override + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + try + { + setMerchantId(Longs.toLong(paramMap.get("merchantId"))); + setStartModifyTime(Sqls.toTimestamp(Strings.trim(paramMap.get("startModifyTime")))); + setEndModifyTime(Sqls.toTimestamp(Strings.trim(paramMap.get("endModifyTime")))); + + } + catch (Exception e) + { + + log.error("投诉单同步接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError("", code.value(), code.desc(), e); + return false; + } + + return true; + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public Timestamp getStartModifyTime() + { + return startModifyTime; + } + + public void setStartModifyTime(Timestamp startModifyTime) + { + this.startModifyTime = startModifyTime; + } + + public Timestamp getEndModifyTime() + { + return endModifyTime; + } + + public void setEndModifyTime(Timestamp endModifyTime) + { + this.endModifyTime = endModifyTime; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/complain/DesignComplainSynResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/complain/DesignComplainSynResponse.java new file mode 100644 index 0000000..afe7541 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/complain/DesignComplainSynResponse.java @@ -0,0 +1,46 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignComplainSynResponse.java + * 创建人 :gjx + * 创建时间:2019-8-17 + */ + +package com.zhiqim.yangcai.design.server.request.complain; + +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +/** + * 设计平台 投诉单信息同步 响应 + * + * @version 1.0 @author gjx 2019-8-17 新建与整理 + */ +public class DesignComplainSynResponse extends ApiResponse +{ + private List complainList; + + @Override + protected String buildBody() + { + return Jsons.toString(this); + } + + public List getComplainList() + { + return complainList; + } + + public void setComplainList(List complainList) + { + this.complainList = complainList; + } + + @Override + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderCheckBackRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderCheckBackRequest.java new file mode 100644 index 0000000..2241274 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderCheckBackRequest.java @@ -0,0 +1,167 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order; + +import java.util.TreeMap; + +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +/**** + * 印前退回 + * + * @version v1.0.0 @author lgz 2019-4-16 新建与整理 + */ +public class DesignOrderCheckBackRequest extends ApiRequest +{ + // 数据类型 字段名 非空 数据长度 字段描述 + private long merchantId;// 是 订单商户编号 + private long designId;// 是 订单编号 + private String backReason;// 否 1000 退回原因 + private String imgUrl;// 否 500 退回截图路径 + + public DesignOrderCheckBackResponse newResponse() + { + return new DesignOrderCheckBackResponse(); + } + + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + //必须参数 + String merchantId = paramMap.get("merchantId");//需要外部调用判断 参数真实性 + String designId = paramMap.get("designId"); + String backReason = paramMap.get("backReason");//退回原因 + String imgUrl = paramMap.get("imgUrl");//退回截图路径 + //1.商户编号 + if (Validates.isEmptyBlank(merchantId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + + if (!Validates.isNumeric(Strings.trim(merchantId)) || Longs.toLong(Strings.trim(merchantId)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + + //2.外部系统单号 + if (Validates.isEmptyBlank(designId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designId", designId)); + return false; + } + if (!Validates.isNumeric(Strings.trim(designId)) || Longs.toLong(Strings.trim(designId)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designId", designId)); + return false; + } + //3.退回原因 + if (Validates.isEmptyBlank(backReason)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("backReason", backReason)); + return false; + } + if (backReason.length() > 1000) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("backReason", backReason)); + return false; + } + + //4.退回截图 + if (Validates.isNotEmptyBlank(imgUrl) && !Validates.isUrl(imgUrl)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("imgUrl", imgUrl)+"不是url!"); + return false; + } + + return true;//最后 返回true + } + + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + String merchantId = paramMap.get("merchantId");//需要外部调用判断 参数真实性 + String designId = paramMap.get("designId"); + String backReason = paramMap.get("backReason");//退回原因 + String imgUrl = paramMap.get("imgUrl");//退回截图路径 + + try + { + setMerchantId(Longs.toLong(merchantId)); + setDesignId(Longs.toLong(designId)); + setBackReason(Strings.trim(backReason)); + setImgUrl(Strings.trim(imgUrl)); + } + catch (Exception e) + { + log.error("订单创建接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(designId, code.value(), code.desc(), e); + return false; + } + + return true; + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getBackReason() + { + return backReason; + } + + public void setBackReason(String backReason) + { + this.backReason = backReason; + } + + public String getImgUrl() + { + return imgUrl; + } + + public void setImgUrl(String imgUrl) + { + this.imgUrl = imgUrl; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderCheckBackResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderCheckBackResponse.java new file mode 100644 index 0000000..352b1b3 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderCheckBackResponse.java @@ -0,0 +1,38 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +public class DesignOrderCheckBackResponse extends ApiResponse +{ + private boolean isSuccess; + protected String buildBody() + { + return Jsons.toString(this); + } + public String toString() + { + return Jsons.toString(this); + } + public boolean isSuccess() + { + return isSuccess; + } + public void setSuccess(boolean isSuccess) + { + this.isSuccess = isSuccess; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderCreateRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderCreateRequest.java new file mode 100644 index 0000000..cfdab7d --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderCreateRequest.java @@ -0,0 +1,981 @@ +package com.zhiqim.yangcai.design.server.request.order; + +import java.util.List; +import java.util.TreeMap; + +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.complain.DesignComplainView; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; +import com.zhiqim.yangcai.design.server.module.ApiFile; + +/**** + * 订单创建接口 + * + * @version v1.0.0 @author lgz 2018-12-18 新建与整理 + */ +public class DesignOrderCreateRequest extends ApiRequest { + // 数据类型 字段名 非空 数据长度 字段描述 + private long merchantId;// 是 订单商户编号 + private String outId;// 是 外部系统单号 + private long designType;// 是 产品类型,由设计平台提供,业务方适配。 + private long industryId;// 是 行业编号,由设计平台提供,业务方适配。 + private int draftType;// 是 稿件类型,0:自来稿,1:改稿自来稿,2:普通设计,3:高级设计 + private int designPage;// 是 设计面数,单面为1,双面为2 + private int printKs;// 是 设计款数 + private int printMs;// 是 设计模数 + private double designWidth;// 是 设计宽度,单位mm,最多两位小数,含出血 + private double designHeight;// 是 设计高度,单位mm,最多两位小数,含出血 + private double designSide;// 否 设计侧面长度,单位mm,最多两位小数,含出血 + private double printWidth;// 否 特殊尺寸宽度,单位mm,最多两位小数, 不含出血(用户尺寸) + private double printHeight;// 否 特殊尺寸高度,单位mm,最多两位小数, 不含出血(用户尺寸) + private double amount;// 否 金额最多支持两位小数 + private boolean isUrgent;// 是 是否加急,。 + private String userContact;// 否 100 联系人 + private String userMobile;// 是 64 联系电话 + private String buyerNick;// 否 100 买家昵称 + private String userQq;// 否 64 买家联系QQ + private String userWx;// 否 64 买家联系微信号 + private String orderText;// 否 200 产品全称,最多200个字符 + private String afterNames;// 否 500 后加工 多个逗号隔开 + private String printSpecial;// 否 100 特殊工艺,最多100个字符 + private String userText;// 否 4000 客户文本,最多4000个字符 + private String userNotice;// 否 1000 设计注意事项,最多1000个字符 + private String shopNick;// 否 32 店铺名 最多32字符 + private String servicesMessage;// 否 500 客服留言 最多500字符 + private int designCopies;// 否 设计费份数 + private String receiverName; // 否 50 收货人的姓名 + private String receiverMobile;// 否 40 收货人的手机号码 + private String receiverState; // 否 20 收货人的所在省份 + private String receiverCity; // 否 20 收货人的所在城市 + private String receiverDistrict; // 否 20 收货人的所在区县 + private String receiverAddress; // 是 100 收货人的详细地址 + private String expressCode;// 否 20 物流code + private String creater;// 是 20 录单人 + private int orderSrc; // 是 订单来源 + private String tids; // 是 200 淘宝单号,多个逗号分隔 + private String tid; // 是 200 淘宝单号,多个逗号分隔 + private boolean isOnlyDesign; // 是否仅设计 + private boolean isHighQualityOrder; // 是否优质订单 + private String designer;// 设计师 + private List apiFiles;// 否 用户文件资料 + private int showRedMark; // 淘宝申请退款时显示红色感叹号[0-不显示,1-显示] + private String customerQrcodeUrl;// 否 服务群二维码 + private long designAmount;// 否 设计费用 + private long productAmount;// 否 产品费用 + + @Override + public DesignOrderCreateResponse newResponse() { + return new DesignOrderCreateResponse(); + } + + @Override + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) { + // 必须参数 + String merchantId = paramMap.get("merchantId");// 需要外部调用判断 参数真实性 + String outId = paramMap.get("outId"); + String designType = paramMap.get("designType");// 需要外部调用判断 参数真实性 + // String industryId = paramMap.get("industryId");// 需要外部调用判断 参数真实性 + String draftType = paramMap.get("draftType");// 需要外部调用判断 参数真实性 + String designPage = paramMap.get("designPage"); + String orderText = paramMap.get("orderText"); + String afterNames = paramMap.get("afterNames"); + String printSpecial = paramMap.get("printSpecial"); + String designWidth = paramMap.get("designWidth"); + String designHeight = paramMap.get("designHeight"); + String printKs = paramMap.get("printKs"); + String printMs = paramMap.get("printMs"); + String printWidth = paramMap.get("printWidth"); + String printHeight = paramMap.get("printHeight"); + String amount = paramMap.get("amount"); + String isUrgent = paramMap.get("isUrgent"); + String userContact = paramMap.get("userContact"); + String userMobile = paramMap.get("userMobile"); + String userQq = paramMap.get("userQq"); + String userWx = paramMap.get("userWx"); + String userText = paramMap.get("userText"); + String userNotice = paramMap.get("userNotice"); + String servicesMessage = paramMap.get("servicesMessage"); + String shopNick = paramMap.get("shopNick"); + String buyerNick = paramMap.get("buyerNick"); + String apiFiles = paramMap.get("apiFiles"); + String designCopies = paramMap.get("designCopies"); + String receiverName = paramMap.get("receiverName"); + String receiverMobile = paramMap.get("receiverMobile"); + String receiverState = paramMap.get("receiverState"); + String receiverCity = paramMap.get("receiverCity"); + String receiverDistrict = paramMap.get("receiverDistrict"); + String receiverAddress = paramMap.get("receiverAddress"); + String expressCode = paramMap.get("expressCode"); + String creater = paramMap.get("creater"); + String orderSrc = paramMap.get("orderSrc"); + String tids = paramMap.get("tids"); + String tid = paramMap.get("tid"); + String isOnlyDesign = paramMap.get("isOnlyDesign"); + + // 1.商户编号 + if (Validates.isEmptyBlank(merchantId)) { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + if (!Validates.isNumeric(Strings.trim(merchantId)) || Longs.toLong(Strings.trim(merchantId)) <= 0) { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + + // 2.外部系统单号 + if (Validates.isEmptyBlank(outId)) { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("outId", outId)); + return false; + } + if (!Validates.isNumeric(Strings.trim(outId)) || Longs.toLong(Strings.trim(outId)) <= 0) { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("outId", outId)); + return false; + } + + // 3.设计类型 + if (Validates.isEmptyBlank(designType)) { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("designType", designType)); + return false; + } + if (!Validates.isNumeric(Strings.trim(designType)) || Longs.toLong(Strings.trim(designType)) <= 0) { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("designType", designType)); + return false; + } + + // 4.行业类型 + + // 5.稿件类型 + if (Validates.isEmptyBlank(draftType)) { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("draftType", draftType)); + return false; + + } + if (!Validates.isNumeric(Strings.trim(draftType)) || Longs.toLong(Strings.trim(draftType)) < 0) { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("draftType", draftType)); + return false; + } + + // 6.订单面数 + if (Validates.isEmptyBlank(designPage)) { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("designPage", designPage)); + return false; + } + if (!Validates.isNumeric(Strings.trim(designPage)) || Longs.toLong(Strings.trim(designPage)) <= 0) { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("designPage", designPage)); + return false; + } + + // 7.订单规格描述 + if (Validates.isEmptyBlank(orderText)) { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("orderText", orderText)); + return false; + } + + if (!Validates.isLen(orderText, 1, 200)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("orderText", orderText) + ",最大限制200字符"); + return false; + } + // 8.后加工信息 + if (Validates.isNotEmptyBlank(afterNames) && !Validates.isLen(orderText, 1, 1000)) {// 后加工超出1000字符 + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), + code.desc() + biuldKeyValueString("afterNames", afterNames) + ",最大限制1000字符"); + return false; + } + // 9.特殊工艺 +// if (Validates.isNotEmptyBlank(printSpecial) && !Validates.isLen(printSpecial, 1, 100)) +// {// 后加工超出1000字符 +// Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; +// err.setError(outId, code.value(), code.desc() + biuldKeyValueString("printSpecial", printSpecial) + ",最大限制100字符"); +// return false; +// } + +// // 10.订单印刷宽 +// if (Validates.isEmptyBlank(designWidth) || !Validates.isFloat(designWidth) +// || Double.valueOf(designWidth) <= 0) { +// Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; +// err.setError(outId, code.value(), code.desc() + biuldKeyValueString("designWidth", designWidth)); +// return false; +// } +// // 11.订单印刷高 +// if (Validates.isEmptyBlank(designHeight) || !Validates.isFloat(designHeight) +// || Double.valueOf(designHeight) <= 0) { +// Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; +// err.setError(outId, code.value(), code.desc() + biuldKeyValueString("designHeight", designHeight)); +// return false; +// } + + // 12.订单款数 + if (Validates.isEmptyBlank(printKs) || !Validates.isNumeric(printKs) || Longs.toLong(printKs) <= 0) { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("printKs", printKs)); + return false; + } + +// // 13.订单模数 +// if (Validates.isEmptyBlank(printMs) || !Validates.isNumeric(printMs) || Longs.toLong(printMs) <= 0) { +// Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; +// err.setError(outId, code.value(), code.desc() + biuldKeyValueString("printMs", printMs)); +// return false; +// } +// +// // 14.自定义印刷宽 +// if (Validates.isNotEmptyBlank(printWidth) +// && (!Validates.isFloat(printWidth) || Double.valueOf(printWidth) < 0)) { +// Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; +// err.setError(outId, code.value(), code.desc() + biuldKeyValueString("printWidth", printWidth)); +// return false; +// } +// // 15.自定义印刷高 +// if (Validates.isNotEmptyBlank(printHeight) +// && (!Validates.isFloat(printHeight) || Double.valueOf(printHeight) < 0)) { +// Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; +// err.setError(outId, code.value(), code.desc() + biuldKeyValueString("printHeight", printHeight)); +// return false; +// } + +// if ((Validates.isNotEmptyBlank(printWidth) && Double.valueOf(printWidth) <= 0 +// && Validates.isNotEmptyBlank(printHeight) && Double.valueOf(printHeight) > 0)) {// printWidth <= 0 & +// // printHeight>0 +// Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; +// err.setError(outId, code.value(), code.desc() +// + biuldKeyValueString("printWidth,printHeight", printWidth, printHeight) + "必须两者 > 0 或者两者 = 0"); +// return false; +// } +// +// if ((Validates.isNotEmptyBlank(printHeight) && Double.valueOf(printHeight) <= 0 +// && Validates.isNotEmptyBlank(printWidth) && Double.valueOf(printWidth) > 0)) {// printHeight <= 0 & +// // printWidth>0 +// Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; +// err.setError(outId, code.value(), code.desc() +// + biuldKeyValueString("printWidth,printHeight", printWidth, printHeight) + "必须两者 > 0 或者两者 = 0"); +// return false; +// } + + // 16.订单金额 + if (Validates.isNotEmptyBlank(amount) && !Validates.isFloat(Strings.trim(amount))) { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("amount", amount)); + return false; + } + + // 17订单加急 + if (Validates.isEmptyBlank(isUrgent) && !Validates.isBoolean(Strings.trim(isUrgent).toLowerCase())) { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("isUrgent", isUrgent)); + return false; + } + + // 18.订单联系人 + if (Validates.isEmptyBlank(userContact)) { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("userContact", userContact)); + return false; + } + if (!Validates.isLen(Strings.trim(userContact), 1, 100)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), + code.desc() + biuldKeyValueString("userContact", userContact) + ",最大限制100字符"); + return false; + } + // 19订单联系人手机 +// if (Validates.isEmptyBlank(userMobile)) { +// Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; +// err.setError(outId, code.value(), code.desc() + biuldKeyValueString("userMobile", userMobile)); +// return false; +// } +// if (!Validates.isLen(Strings.trim(userMobile), 1, 64)) { +// Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; +// err.setError(outId, code.value(), +// code.desc() + biuldKeyValueString("userMobile", userMobile) + ",最大限制64字符"); +// return false; +// } + + // 20联系QQ + if (Validates.isNotEmptyBlank(userQq) && !Validates.isLen(Strings.trim(userQq), 1, 64)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("userQq", userQq) + ",最大限制64字符"); + return false; + } + + // 21.联系微信 + if (Validates.isNotEmptyBlank(userWx) && !Validates.isLen(Strings.trim(userWx), 1, 64)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("userWx", userWx) + ",最大限制64字符"); + return false; + } + + // 22用户文字资料 + if (Validates.isNotEmptyBlank(userText) && !Validates.isLen(Strings.trim(userText), 1, 4000)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("userText", userText) + ",最大限制4000字符"); + return false; + } + + // 23用户注意事项 + if (Validates.isNotEmptyBlank(userNotice) && !Validates.isLen(Strings.trim(userNotice), 1, 1000)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), + code.desc() + biuldKeyValueString("userNotice", userNotice) + ",最大限制1000字符"); + return false; + } + + // 24.客服留言servicesMessage + if (Validates.isNotEmptyBlank(servicesMessage) && !Validates.isLen(Strings.trim(servicesMessage), 1, 500)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), + code.desc() + biuldKeyValueString("servicesMessage", servicesMessage) + ",最大限制500字符"); + return false; + } + // 25.店铺shopNick + if (Validates.isNotEmptyBlank(shopNick) && !Validates.isLen(Strings.trim(shopNick), 1, 32)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("shopNick", shopNick) + ",最大限制32字符"); + return false; + } + // 26.旺旺号buyerNick + if (Validates.isNotEmptyBlank(buyerNick) && !Validates.isLen(Strings.trim(buyerNick), 1, 100)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("buyerNick", buyerNick) + ",最大限制100字符"); + return false; + } + // 27.文件资料 + List apiFileList = Jsons.toList(apiFiles, ApiFile.class); + for (ApiFile apiFile : apiFileList) { + if (apiFile != null) { + String downUrl = apiFile.getDownUrl(); + String fileName = apiFile.getFileName(); + String fileExt = apiFile.getFileExt(); + if (!Validates.isUrl(downUrl)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_DATA; + err.setError(outId, code.value(), + code.desc() + ",附件资料包含无效下载地址" + biuldKeyValueString("downUrl", downUrl)); + return false; + } + if (Validates.isEmptyBlank(fileName)) { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(outId, code.value(), + code.desc() + ",附件资料包含无效文件名" + biuldKeyValueString("fileName", fileName)); + return false; + } + if (Validates.isEmptyBlank(fileExt) || Validates.isEmptyBlank(Strings.replaceAll(fileExt, "\\.", ""))) { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(outId, code.value(), + code.desc() + "附件资料包含未知文件名扩展名" + biuldKeyValueString("fileExt", fileExt)); + return false; + } + } + } + // 28.设计费份数 +// if (Validates.isEmptyBlank(designCopies) || !Validates.isNumeric(designCopies) +// || Longs.toLong(designCopies) < 0) {// designCopies 补单为0 +// Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; +// err.setError(outId, code.value(), code.desc() + biuldKeyValueString("designCopies", designCopies)); +// return false; +// } + // 29.收货人名称receiverName + if (Validates.isNotEmptyBlank(receiverName) && !Validates.isLen(Strings.trim(receiverName), 1, 50)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), + code.desc() + biuldKeyValueString("receiverName", receiverName) + ",最大限制50字符"); + return false; + } + // 30.收货人电话号码receiverMobile + if (Validates.isNotEmptyBlank(receiverMobile) && !Validates.isLen(Strings.trim(receiverMobile), 1, 40)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), + code.desc() + biuldKeyValueString("receiverMobile", receiverMobile) + ",最大限制40字符"); + return false; + } + // 31.收货人所在省份receiverState + if (Validates.isNotEmptyBlank(receiverState) && !Validates.isLen(Strings.trim(receiverState), 1, 20)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), + code.desc() + biuldKeyValueString("receiverState", receiverState) + ",最大限制20字符"); + return false; + } + // 32.收货人所在城市receiverCity + if (Validates.isNotEmptyBlank(receiverCity) && !Validates.isLen(Strings.trim(receiverCity), 1, 20)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), + code.desc() + biuldKeyValueString("receiverCity", receiverCity) + ",最大限制20字符"); + return false; + } + // 33.收货人所在区县receiverDistrict + if (Validates.isNotEmptyBlank(receiverDistrict) && !Validates.isLen(Strings.trim(receiverDistrict), 1, 20)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), + code.desc() + biuldKeyValueString("receiverDistrict", receiverDistrict) + ",最大限制20字符"); + return false; + } + // 34.收货人的详细地址receiverAddress + if (Validates.isNotEmptyBlank(receiverAddress) && !Validates.isLen(Strings.trim(receiverAddress), 1, 100)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), + code.desc() + biuldKeyValueString("receiverAddress", receiverAddress) + ",最大限制100字符"); + return false; + } + // 35.物流编码expressCode + if (Validates.isNotEmptyBlank(expressCode) && !Validates.isLen(Strings.trim(expressCode), 1, 20)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), + code.desc() + biuldKeyValueString("expressCode", expressCode) + ",最大限制20字符"); + return false; + } + // 36.录单人creater + if (Validates.isNotEmptyBlank(creater) && !Validates.isLen(Strings.trim(creater), 1, 20)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("creater", creater) + ",最大限制20字符"); + return false; + } + + // 37.订单来源orderSrc + if (Validates.isEmptyBlank(orderSrc)) { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("orderSrc", orderSrc)); + return false; + } + + // 38.淘宝单号,多个逗号分隔tids + if (Validates.isNotEmptyBlank(tids) && !Validates.isLen(Strings.trim(tids), 1, 200)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("tids", tids) + ",最大限制200字符"); + return false; + } + // 38.淘宝单号,多个逗号分隔tids + if (Validates.isNotEmptyBlank(tid) && !Validates.isLen(Strings.trim(tid), 1, 200)) { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("tid", tid) + ",最大限制200字符"); + return false; + } + // 39是否仅设计 + if (Validates.isEmptyBlank(isOnlyDesign) && !Validates.isBoolean(Strings.trim(isOnlyDesign).toLowerCase())) { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("isOnlyDesign", isOnlyDesign)); + return false; + } + return true;// 最后 返回true + } + + @Override + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) { + String merchantId = Strings.trim(paramMap.get("merchantId"));// 需要外部调用判断 参数真实性 + String outId = Strings.trim(paramMap.get("outId")); + String designType = Strings.trim(paramMap.get("designType"));// 需要外部调用判断 参数真实性 +// String industryId = Strings.trim(paramMap.get("industryId"));// 需要外部调用判断 参数真实性 + String draftType = Strings.trim(paramMap.get("draftType"));// 需要外部调用判断 参数真实性 + String designPage = Strings.trim(paramMap.get("designPage")); + String orderText = Strings.trim(paramMap.get("orderText")); + String afterNames = Strings.trim(paramMap.get("afterNames")); + String printSpecial = Strings.trim(paramMap.get("printSpecial")); + String designWidth = Strings.trim(paramMap.get("designWidth")); + String designHeight = Strings.trim(paramMap.get("designHeight")); +// String designSide = Strings.trim(paramMap.get("designSide")); + String printKs = Strings.trim(paramMap.get("printKs")); + String printMs = Strings.trim(paramMap.get("printMs")); + String printWidth = Strings.trim(paramMap.get("printWidth")); + String printHeight = Strings.trim(paramMap.get("printHeight")); + String amount = Strings.trim(paramMap.get("amount")); + String isUrgent = Strings.trim(paramMap.get("isUrgent"), "").toLowerCase(); + String userContact = Strings.trim(paramMap.get("userContact")); + String userMobile = Strings.trim(paramMap.get("userMobile")); + String userQq = Strings.trim(paramMap.get("userQq")); + String userWx = Strings.trim(paramMap.get("userWx")); + String userText = Strings.trim(paramMap.get("userText")); + String userNotice = Strings.trim(paramMap.get("userNotice")); + String servicesMessage = Strings.trim(paramMap.get("servicesMessage")); + String shopNick = Strings.trim(paramMap.get("shopNick")); + String buyerNick = Strings.trim(paramMap.get("buyerNick")); +// String designCopies = Strings.trim(paramMap.get("designCopies")); + String receiverName = Strings.trim(paramMap.get("receiverName")); + String receiverMobile = Strings.trim(paramMap.get("receiverMobile")); + String receiverState = Strings.trim(paramMap.get("receiverState")); + String receiverCity = Strings.trim(paramMap.get("receiverCity")); + String receiverDistrict = Strings.trim(paramMap.get("receiverDistrict")); + String receiverAddress = Strings.trim(paramMap.get("receiverAddress")); + String apiFiles = Strings.trim(paramMap.get("apiFiles")); + String expressCode = Strings.trim(paramMap.get("expressCode")); + String creater = Strings.trim(paramMap.get("creater")); + String orderSrc = Strings.trim(paramMap.get("orderSrc")); + String tids = Strings.trim(paramMap.get("tids")); + String tid = Strings.trim(paramMap.get("tid")); + String isOnlyDesign = Strings.trim(paramMap.get("isOnlyDesign"), "").toLowerCase(); + String isHighQualityOrder = Strings.trim(paramMap.get("isHighQualityOrder"), "").toLowerCase(); + String showRedMark = Strings.trim(paramMap.get("showRedMark"), "0"); + String designer = Strings.trim(paramMap.get("designer")); + String customerQrcodeUrl = Strings.trim(paramMap.get("customerQrcodeUrl")); + String designAmount = Strings.trim(paramMap.get("designAmount")); + if (Validates.isEmpty(designAmount)) { + designAmount = "0"; + } + String productAmount = Strings.trim(paramMap.get("productAmount")); + if (Validates.isEmpty(productAmount)) { + productAmount = "0"; + } + + try { + setMerchantId(Longs.toLong(merchantId)); + setOutId(outId); + setDesignType(Longs.toLong(designType)); +// setIndustryId(Longs.toLong(industryId)); + setDraftType(Ints.toInt(draftType)); + setDesignPage(Ints.toInt(designPage)); + setOrderText(orderText); + setAfterNames(afterNames); + setPrintSpecial(printSpecial); + setDesignWidth(Double.valueOf(designWidth)); + setDesignHeight(Double.valueOf(designHeight)); +// setDesignSide(Double.valueOf(designSide)); + setPrintKs(Ints.toInt(printKs)); + setPrintMs(Ints.toInt(printMs)); + setPrintWidth(Validates.isFloat(printWidth) ? Double.valueOf(printWidth) : 0); + setPrintHeight(Validates.isFloat(printHeight) ? Double.valueOf(printHeight) : 0); + setAmount(Validates.isFloat(amount) ? Double.valueOf(amount) : 0); + setUrgent("true".equalsIgnoreCase(isUrgent)); + setUserContact(userContact); + setUserMobile(userMobile); + setUserQq(userQq); + setUserWx(userWx); + setUserText(userText); + setUserNotice(userNotice); + setServicesMessage(servicesMessage); + setShopNick(shopNick); + setBuyerNick(buyerNick); +// setDesignCopies(Ints.toInt(designCopies)); + setReceiverName(receiverName); + setReceiverMobile(receiverMobile); + setReceiverState(receiverState); + setReceiverCity(receiverCity); + setReceiverDistrict(receiverDistrict); + setReceiverAddress(receiverAddress); + setExpressCode(expressCode); + setOrderSrc(Integer.valueOf(orderSrc)); + setTids(tids); + setTid(tid); + setCreater(creater); + setOnlyDesign("true".equalsIgnoreCase(isOnlyDesign)); + setHighQualityOrder("true".equalsIgnoreCase(isHighQualityOrder)); + setApiFiles(Jsons.toList(apiFiles, ApiFile.class)); + setShowRedMark(Integer.valueOf(showRedMark)); + setDesigner(designer); + setCustomerQrcodeUrl(customerQrcodeUrl); + setDesignAmount(Long.parseLong(designAmount)); + setProductAmount(Long.parseLong(productAmount)); + } catch (Exception e) { + log.error("订单创建接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(outId, code.value(), code.desc(), e); + return false; + } + + return true; + } + + + public String getTid() { + return tid; + } + + public void setTid(String tid) { + this.tid = tid; + } + + public long getMerchantId() { + return merchantId; + } + + public void setMerchantId(long merchantId) { + this.merchantId = merchantId; + } + + public String getOutId() { + return outId; + } + + public void setOutId(String outId) { + this.outId = outId; + } + + public long getDesignType() { + return designType; + } + + public void setDesignType(long designType) { + this.designType = designType; + } + + public long getIndustryId() { + return industryId; + } + + public void setIndustryId(long industryId) { + this.industryId = industryId; + } + + public int getDraftType() { + return draftType; + } + + public void setDraftType(int draftType) { + this.draftType = draftType; + } + + public int getDesignPage() { + return designPage; + } + + public void setDesignPage(int designPage) { + this.designPage = designPage; + } + + public int getPrintKs() { + return printKs; + } + + public void setPrintKs(int printKs) { + this.printKs = printKs; + } + + public int getPrintMs() { + return printMs; + } + + public void setPrintMs(int printMs) { + this.printMs = printMs; + } + + public double getDesignWidth() { + return designWidth; + } + + public void setDesignWidth(double designWidth) { + this.designWidth = designWidth; + } + + public double getDesignHeight() { + return designHeight; + } + + public void setDesignHeight(double designHeight) { + this.designHeight = designHeight; + } + + public double getDesignSide() { + return designSide; + } + + public void setDesignSide(double designSide) { + this.designSide = designSide; + } + + public double getPrintWidth() { + return printWidth; + } + + public void setPrintWidth(double printWidth) { + this.printWidth = printWidth; + } + + public double getPrintHeight() { + return printHeight; + } + + public void setPrintHeight(double printHeight) { + this.printHeight = printHeight; + } + + public double getAmount() { + return amount; + } + + public void setAmount(double amount) { + this.amount = amount; + } + + public boolean isUrgent() { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) { + this.isUrgent = isUrgent; + } + + public String getUserContact() { + return userContact; + } + + public void setUserContact(String userContact) { + this.userContact = userContact; + } + + public String getUserMobile() { + return userMobile; + } + + public void setUserMobile(String userMobile) { + this.userMobile = userMobile; + } + + public String getBuyerNick() { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) { + this.buyerNick = buyerNick; + } + + public String getUserQq() { + return userQq; + } + + public void setUserQq(String userQq) { + this.userQq = userQq; + } + + public String getUserWx() { + return userWx; + } + + public void setUserWx(String userWx) { + this.userWx = userWx; + } + + public String getOrderText() { + return orderText; + } + + public void setOrderText(String orderText) { + this.orderText = orderText; + } + + public String getAfterNames() { + return afterNames; + } + + public void setAfterNames(String afterNames) { + this.afterNames = afterNames; + } + + public String getPrintSpecial() { + return printSpecial; + } + + public void setPrintSpecial(String printSpecial) { + this.printSpecial = printSpecial; + } + + public String getUserText() { + return userText; + } + + public void setUserText(String userText) { + if ("null".equals(userText)) { + userText = ""; + } + this.userText = userText; + } + + public String getUserNotice() { + return userNotice; + } + + public void setUserNotice(String userNotice) { + if ("null".endsWith(userNotice)) { + userNotice = ""; + } + this.userNotice = userNotice; + } + + public String getShopNick() { + return shopNick; + } + + public void setShopNick(String shopNick) { + this.shopNick = shopNick; + } + + public String getServicesMessage() { + return servicesMessage; + } + + public void setServicesMessage(String servicesMessage) { + this.servicesMessage = servicesMessage; + } + + public int getDesignCopies() { + return designCopies; + } + + public void setDesignCopies(int designCopies) { + this.designCopies = designCopies; + } + + public String getReceiverName() { + return receiverName; + } + + public void setReceiverName(String receiverName) { + this.receiverName = receiverName; + } + + public String getReceiverState() { + return receiverState; + } + + public void setReceiverState(String receiverState) { + this.receiverState = receiverState; + } + + public String getReceiverCity() { + return receiverCity; + } + + public void setReceiverCity(String receiverCity) { + this.receiverCity = receiverCity; + } + + public String getReceiverDistrict() { + return receiverDistrict; + } + + public void setReceiverDistrict(String receiverDistrict) { + this.receiverDistrict = receiverDistrict; + } + + public String getReceiverAddress() { + return receiverAddress; + } + + public void setReceiverAddress(String receiverAddress) { + this.receiverAddress = receiverAddress; + } + + public List getApiFiles() { + return apiFiles; + } + + public void setApiFiles(List apiFiles) { + this.apiFiles = apiFiles; + } + + public String getReceiverMobile() { + return receiverMobile; + } + + public void setReceiverMobile(String receiverMobile) { + this.receiverMobile = receiverMobile; + } + + public String getExpressCode() { + return expressCode; + } + + public void setExpressCode(String expressCode) { + this.expressCode = expressCode; + } + + public String getCreater() { + return creater; + } + + public void setCreater(String creater) { + this.creater = creater; + } + + public int getOrderSrc() { + return orderSrc; + } + + public void setOrderSrc(int orderSrc) { + this.orderSrc = orderSrc; + } + + public String getTids() { + return tids; + } + + public void setTids(String tids) { + this.tids = tids; + } + + public boolean isOnlyDesign() { + return isOnlyDesign; + } + + public void setOnlyDesign(boolean isOnlyDesign) { + this.isOnlyDesign = isOnlyDesign; + } + + public boolean isHighQualityOrder() { + return isHighQualityOrder; + } + + public void setHighQualityOrder(boolean isHighQualityOrder) { + this.isHighQualityOrder = isHighQualityOrder; + } + + public int getShowRedMark() { + return showRedMark; + } + + public void setShowRedMark(int showRedMark) { + this.showRedMark = showRedMark; + } + + public String getDesigner() { + return designer; + } + + public void setDesigner(String designer) { + this.designer = designer; + } + + public String getCustomerQrcodeUrl() { + return customerQrcodeUrl; + } + + public void setCustomerQrcodeUrl(String customerQrcodeUrl) { + this.customerQrcodeUrl = customerQrcodeUrl; + } + + public long getDesignAmount() { + return designAmount; + } + + public void setDesignAmount(long designAmount) { + this.designAmount = designAmount; + } + + public long getProductAmount() { + return productAmount; + } + + public void setProductAmount(long productAmount) { + this.productAmount = productAmount; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderCreateResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderCreateResponse.java new file mode 100644 index 0000000..5af66b3 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderCreateResponse.java @@ -0,0 +1,47 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +public class DesignOrderCreateResponse extends ApiResponse +{ + private long merchantId; + private long designId; + protected String buildBody() + { + return Jsons.toString(this); + } + public long getMerchantId() + { + return merchantId; + } + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + public long getDesignId() + { + return designId; + } + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderRecreateRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderRecreateRequest.java new file mode 100644 index 0000000..2aa6437 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderRecreateRequest.java @@ -0,0 +1,166 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.server.request.order; + +import java.util.TreeMap; + +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +/**** + * 订单创建接口 + * @version v1.0.0 @author lgz 2018-12-18 新建与整理 + */ +public class DesignOrderRecreateRequest extends ApiRequest +{ + // 数据类型 字段名 非空 数据长度 字段描述 + private long merchantId;// 是 订单商户编号 + private String newOutId;// 是 第三方新订单号 + private long designSrcId;// 是 设计平台原订单号。 + private String redesignReason;// 否 300 重新设计原因 + + public DesignOrderRecreateResponse newResponse() + { + return new DesignOrderRecreateResponse(); + } + + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + + // 必须参数 + String merchantId = paramMap.get("merchantId");// 需要外部调用判断 参数真实性 + String newOutId = paramMap.get("newOutId"); + String designSrcId = paramMap.get("designSrcId");// 需要外部调用判断 参数真实性 + String redesignReason = paramMap.get("redesignReason"); + + // 1.商户编号 + if (Validates.isEmptyBlank(merchantId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(newOutId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + if (! Validates.isNumeric(Strings.trim(merchantId)) || Longs.toLong(Strings.trim(merchantId)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(newOutId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + // 2.外部系统单号 + if (Validates.isEmptyBlank(newOutId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(newOutId, code.value(), code.desc() + biuldKeyValueString("newOutId", newOutId)); + return false; + } + if (! Validates.isNumeric(Strings.trim(newOutId)) || Longs.toLong(Strings.trim(newOutId)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(newOutId, code.value(), code.desc() + biuldKeyValueString("newOutId", newOutId)); + return false; + } + + // 3.原设计单号 + if (Validates.isEmptyBlank(designSrcId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(newOutId, code.value(), code.desc() + biuldKeyValueString("designSrcId", designSrcId)); + return false; + } + if (! Validates.isNumeric(Strings.trim(designSrcId)) || Longs.toLong(Strings.trim(designSrcId)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(newOutId, code.value(), code.desc() + biuldKeyValueString("designSrcId", designSrcId)); + return false; + } + + // 4.重新设计原因 + if (Validates.isNotEmptyBlank(redesignReason) && ! Validates.isLen(redesignReason, 1, 200)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(newOutId, code.value(), code.desc() + biuldKeyValueString("redesignReason", redesignReason) + ",最大限制200字符"); + return false; + } + + return true;// 最后 返回true + } + + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + String merchantId = Strings.trim(paramMap.get("merchantId"));// 需要外部调用判断 参数真实性 + String newOutId = Strings.trim(paramMap.get("newOutId")); + String designSrcId = Strings.trim(paramMap.get("designSrcId"));// 需要外部调用判断 参数真实性 + String redesignReason = Strings.trim(paramMap.get("redesignReason")); + try + { + setMerchantId(Longs.toLong(merchantId)); + setNewOutId(newOutId); + setDesignSrcId(Longs.toLong(designSrcId)); + setRedesignReason(redesignReason); + } + catch (Exception e) + { + log.error("补单单创建接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(newOutId, code.value(), code.desc(), e); + return false; + } + + return true; + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public String getNewOutId() + { + return newOutId; + } + + public void setNewOutId(String newOutId) + { + this.newOutId = newOutId; + } + + public long getDesignSrcId() + { + return designSrcId; + } + + public void setDesignSrcId(long designSrcId) + { + this.designSrcId = designSrcId; + } + + public String getRedesignReason() + { + return redesignReason; + } + + public void setRedesignReason(String redesignReason) + { + this.redesignReason = redesignReason; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderRecreateResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderRecreateResponse.java new file mode 100644 index 0000000..98b7e91 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderRecreateResponse.java @@ -0,0 +1,47 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +public class DesignOrderRecreateResponse extends ApiResponse +{ + private long merchantId; + private long newDesignId; + protected String buildBody() + { + return Jsons.toString(this); + } + public long getMerchantId() + { + return merchantId; + } + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + public long getNewDesignId() + { + return newDesignId; + } + public void setNewDesignId(long newDesignId) + { + this.newDesignId = newDesignId; + } + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderRefundRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderRefundRequest.java new file mode 100644 index 0000000..9aa56ef --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderRefundRequest.java @@ -0,0 +1,148 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order; + +import java.util.TreeMap; + +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +/**** + * 印前退回 + * + * @version v1.0.0 @author lgz 2019-4-16 新建与整理 + */ +public class DesignOrderRefundRequest extends ApiRequest +{ + // 数据类型 字段名 非空 数据长度 字段描述 + private long merchantId;// 是 订单商户编号 + private long designId;// 是 订单编号 + private String backReason;// 否 1000 退回原因 + private String imgUrl;// 否 500 退回截图路径 + private String tids; + public DesignOrderRefundResponse newResponse() + { + return new DesignOrderRefundResponse(); + } + + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + //必须参数 + String merchantId = paramMap.get("merchantId");//需要外部调用判断 参数真实性 + String designId = paramMap.get("designId"); + String backReason = paramMap.get("backReason");//退回原因 + String imgUrl = paramMap.get("imgUrl");//退回截图路径 + String tids = paramMap.get("tids");//退回截图路径 + //1.商户编号 + if (Validates.isEmptyBlank(merchantId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + + if (!Validates.isNumeric(Strings.trim(merchantId)) || Longs.toLong(Strings.trim(merchantId)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + if (!Validates.isNumeric(Strings.trim(tids)) || Longs.toLong(Strings.trim(tids)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("ctid", tids)); + return false; + } + + return true;//最后 返回true + } + + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + String merchantId = paramMap.get("merchantId");//需要外部调用判断 参数真实性 + String designId = paramMap.get("designId"); + String backReason = paramMap.get("backReason");//退回原因 + String imgUrl = paramMap.get("imgUrl");//退回截图路径 + String tids = paramMap.get("tids");//退回截图路径 + try + { + setMerchantId(Longs.toLong(merchantId)); + setTids(tids); + + } + catch (Exception e) + { + log.error("订单创建接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(designId, code.value(), code.desc(), e); + return false; + } + + return true; + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getBackReason() + { + return backReason; + } + + public void setBackReason(String backReason) + { + this.backReason = backReason; + } + + public String getImgUrl() + { + return imgUrl; + } + + public void setImgUrl(String imgUrl) + { + this.imgUrl = imgUrl; + } + + public String getTids() { + return tids; + } + + public void setTids(String tids) { + this.tids = tids; + } + + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderRefundResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderRefundResponse.java new file mode 100644 index 0000000..98adb76 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderRefundResponse.java @@ -0,0 +1,38 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +public class DesignOrderRefundResponse extends ApiResponse +{ + private boolean isSuccess; + protected String buildBody() + { + return Jsons.toString(this); + } + public String toString() + { + return Jsons.toString(this); + } + public boolean isSuccess() + { + return isSuccess; + } + public void setSuccess(boolean isSuccess) + { + this.isSuccess = isSuccess; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderSynRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderSynRequest.java new file mode 100644 index 0000000..143592a --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderSynRequest.java @@ -0,0 +1,196 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order; + +import java.sql.Timestamp; +import java.util.TreeMap; + +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +/** + * 订单同步接口 + * + * @version v1.0.0 @author lgz 2018-12-18 新建与整理 + */ +public class DesignOrderSynRequest extends ApiRequest +{ + // 数据类型 字段名 非空 数据长度 字段描述 + + private long merchantId;// 是 订单商户编号 + private long designId;// 否 设计订单号 + private long outId;// 否 外部系统单号 + private Timestamp startModifyTime;// 否 设计平台的订单开始变更时间,默认十分钟前 + private Timestamp endModifyTime;// 否 设计平台的订单结束时间,默认当前时间 + + + public DesignOrderSynResponse newResponse() + { + return new DesignOrderSynResponse(); + } + + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + String merchantId = paramMap.get("merchantId"); + if (Validates.isEmptyBlank(merchantId) || !Validates.isNumeric(merchantId)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(null, code.value(), code.desc()+biuldKeyValueString("merchantId", merchantId)); + return false; + } + + String designId = paramMap.get("designId"); + if (!Validates.isEmptyBlank(designId) && !Validates.isNumeric(designId)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + + err.setError(null, code.value(), code.desc()+biuldKeyValueString("designId", designId)); + return false; + } + + String outId = paramMap.get("outId"); + if (!Validates.isEmptyBlank(outId) && !Validates.isNumeric(outId)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(null, code.value(), code.desc()+biuldKeyValueString("outId", outId)); + return false; + } + + String startModifyTime = paramMap.get("startModifyTime"); + if (Validates.isNotEmptyBlank(startModifyTime) && !Validates.isDateTime(Strings.trim(startModifyTime))) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + err.setError(null, code.value(), code.desc()+biuldKeyValueString("startModifyTime", "values")); + return false; + } + + String endModifyTime = paramMap.get("endModifyTime"); + if (Validates.isNotEmptyBlank(endModifyTime) && !Validates.isDateTime(Strings.trim(endModifyTime))) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + err.setError(null, code.value(), code.desc()+biuldKeyValueString("endModifyTime", endModifyTime)); + return false; + } + + if (DateTimes.compareHour(endModifyTime, startModifyTime) > 24) + {// + Int code = ApiErrorCodes.ERROR_API_LONG_TIME_SPAN; + err.setError(null, code.value(), code.desc()+"[startModifyTime][endModifyTime]"+code.desc()+"时间不能超过 24 小时"); + return false; + } + + //最后 返回true + return true; + } + + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + + try + { + setMerchantId(Longs.toLong(paramMap.get("merchantId"))); + + String designId = paramMap.get("designId"); + if (!Validates.isEmptyBlank(designId) || Validates.isNumeric(designId)) + setDesignId(Longs.toLong(paramMap.get("designId"))); + + String outId = paramMap.get("outId"); + if (!Validates.isEmptyBlank(outId) || Validates.isNumeric(outId)) + setDesignId(Longs.toLong(paramMap.get("outId"))); + + String startModifyTime = paramMap.get("startModifyTime"); + String endModifyTime = paramMap.get("endModifyTime"); + + if (Validates.isEmptyBlank(startModifyTime)) + startModifyTime = DateTimes.getPreviousDateTimeStringBySecond(10*60); + + if (Validates.isEmptyBlank(endModifyTime)) + endModifyTime = DateTimes.getDateTimeString(); + + setStartModifyTime(Sqls.toTimestamp(startModifyTime)); + setEndModifyTime(Sqls.toTimestamp(endModifyTime)); + } + catch (Exception e) + { + log.error("订单同步接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(null, code.value(), code.desc(), e); + return false; + } + + + return true; + } + + /***************************************************/ + /*******************参数设置********************/ + /***************************************************/ + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getOutId() + { + return outId; + } + + public void setOutId(long outId) + { + this.outId = outId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public Timestamp getStartModifyTime() + { + return startModifyTime; + } + + public void setStartModifyTime(Timestamp startModifyTime) + { + this.startModifyTime = startModifyTime; + } + + public Timestamp getEndModifyTime() + { + return endModifyTime; + } + + public void setEndModifyTime(Timestamp endModifyTime) + { + this.endModifyTime = endModifyTime; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderSynResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderSynResponse.java new file mode 100644 index 0000000..b8c4d3c --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/DesignOrderSynResponse.java @@ -0,0 +1,50 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +public class DesignOrderSynResponse extends ApiResponse +{ + private long merchantId; + private List orderList = new ArrayList(); + protected String buildBody() + { + return Jsons.toString(this); + } + public long getMerchantId() + { + return merchantId; + } + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public String toString() + { + return Jsons.toString(this); + } + public List getOrderList() + { + return orderList; + } + public void setOrderList(List orderList) + { + this.orderList = orderList; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/RespOrder.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/RespOrder.java new file mode 100644 index 0000000..5de7f49 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/RespOrder.java @@ -0,0 +1,383 @@ +package com.zhiqim.yangcai.design.server.request.order; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.module.ApiFile; + +/**** + * 订单相应对象 + * + * @version v1.0.0 @author lgz 2018-12-18 新建与整理 + */ +public class RespOrder +{ + private long merchantId; // 1.订单商户编号 + private long designId; // 2.设订单编号,设计平台独立编号 + private int status; // 3.订单状态 + private long industryId; // 4.所属行业 + private String designer; // 32.设计师 + private Timestamp designReceiveTime; // 33.设计师领单时间 + private Timestamp designBeginTime; // 34.设计师开始设计时间 + private Timestamp designDraftTime; // 35.设计师初稿时间 + private Timestamp designEndTime; // 36.设计师定稿时间 + private String designPauseReason; // 37.设计师暂停原因(新增字段) + private Timestamp designPauseTime; // 38.设计师暂停时间 + private String designExclude; // 39.设计师排除,多个逗号分隔 + private String designRequestReason; // 40.设计师请求主管支援原由 + private Timestamp requestTime; // 41.设计师请求主管支援 时间 + private String designRejectReason; // 42.主管支援拒绝原因 + private int designKeepDuration; // 43.设计师保留时长,单位分钟 + private int receiveType; // 44.设计师保留时长,单位分钟 + private String requestRefoundAcceptReason; // 45.请求退款原因 + private String canceler; // 46.取消人 + private Timestamp cancelTime; // 47.取消时间 + private String cancelReason; // 48.取消原因 + private Timestamp modifyTime; // 49.修改时间 + private String checker; // 56.审核人员 + private Timestamp orgReceiveTime;// 57.组织分拣完成时间 + private List apiFiles = new ArrayList();// 相应的文件 + + private String progressNote; // 淘印通同步使用的进度备注 + + // ***************************稳定后删除****************************** + private String endFileUrl;// 订单完成后 成品文件 下载路径 + private String endFileExt;// 订单完成后 成品扩展名 + private long endFileLength;// 订单完成后 文件大小 + + private String designFileUrl;// 订单完成后 设计文件 下载路径 + private String designFileExt;// 订单完成后 设计成品扩展名 + private long designFileLength;// 订单完成后 设计文件大小 + + // ********************************************************** + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public Timestamp getDesignReceiveTime() + { + return designReceiveTime; + } + + public void setDesignReceiveTime(Timestamp designReceiveTime) + { + this.designReceiveTime = designReceiveTime; + } + + public Timestamp getDesignBeginTime() + { + return designBeginTime; + } + + public void setDesignBeginTime(Timestamp designBeginTime) + { + this.designBeginTime = designBeginTime; + } + + public Timestamp getDesignDraftTime() + { + return designDraftTime; + } + + public void setDesignDraftTime(Timestamp designDraftTime) + { + this.designDraftTime = designDraftTime; + } + + public Timestamp getDesignEndTime() + { + return designEndTime; + } + + public void setDesignEndTime(Timestamp designEndTime) + { + this.designEndTime = designEndTime; + } + + public String getDesignPauseReason() + { + return designPauseReason; + } + + public void setDesignPauseReason(String designPauseReason) + { + this.designPauseReason = designPauseReason; + } + + public Timestamp getDesignPauseTime() + { + return designPauseTime; + } + + public void setDesignPauseTime(Timestamp designPauseTime) + { + this.designPauseTime = designPauseTime; + } + + public String getDesignExclude() + { + return designExclude; + } + + public void setDesignExclude(String designExclude) + { + this.designExclude = designExclude; + } + + public String getDesignRequestReason() + { + return designRequestReason; + } + + public void setDesignRequestReason(String designRequestReason) + { + this.designRequestReason = designRequestReason; + } + + public Timestamp getRequestTime() + { + return requestTime; + } + + public void setRequestTime(Timestamp requestTime) + { + this.requestTime = requestTime; + } + + public String getDesignRejectReason() + { + return designRejectReason; + } + + public void setDesignRejectReason(String designRejectReason) + { + this.designRejectReason = designRejectReason; + } + + public int getDesignKeepDuration() + { + return designKeepDuration; + } + + public void setDesignKeepDuration(int designKeepDuration) + { + this.designKeepDuration = designKeepDuration; + } + + public int getReceiveType() + { + return receiveType; + } + + public void setReceiveType(int receiveType) + { + this.receiveType = receiveType; + } + + public String getRequestRefoundAcceptReason() + { + return requestRefoundAcceptReason; + } + + public void setRequestRefoundAcceptReason(String requestRefoundAcceptReason) + { + this.requestRefoundAcceptReason = requestRefoundAcceptReason; + } + + public String getCanceler() + { + return canceler; + } + + public void setCanceler(String canceler) + { + this.canceler = canceler; + } + + public Timestamp getCancelTime() + { + return cancelTime; + } + + public void setCancelTime(Timestamp cancelTime) + { + this.cancelTime = cancelTime; + } + + public String getCancelReason() + { + return cancelReason; + } + + public void setCancelReason(String cancelReason) + { + this.cancelReason = cancelReason; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + + public String getChecker() + { + return checker; + } + + public void setChecker(String checker) + { + this.checker = checker; + } + + public List getApiFiles() + { + return apiFiles; + } + + public void setApiFiles(List apiFiles) + { + this.apiFiles = apiFiles; + } + + public String getProgressNote() + { + return progressNote; + } + + public void setProgressNote(String progressNote) + { + this.progressNote = progressNote; + } + + public String getEndFileUrl() + { + return endFileUrl; + } + + public void setEndFileUrl(String endFileUrl) + { + this.endFileUrl = endFileUrl; + } + + public String getEndFileExt() + { + return endFileExt; + } + + public void setEndFileExt(String endFileExt) + { + this.endFileExt = endFileExt; + } + + public long getEndFileLength() + { + return endFileLength; + } + + public void setEndFileLength(long endFileLength) + { + this.endFileLength = endFileLength; + } + + public String getDesignFileUrl() + { + return designFileUrl; + } + + public void setDesignFileUrl(String designFileUrl) + { + this.designFileUrl = designFileUrl; + } + + public String getDesignFileExt() + { + return designFileExt; + } + + public void setDesignFileExt(String designFileExt) + { + this.designFileExt = designFileExt; + } + + public long getDesignFileLength() + { + return designFileLength; + } + + public void setDesignFileLength(long designFileLength) + { + this.designFileLength = designFileLength; + } + + public Timestamp getOrgReceiveTime() + { + return orgReceiveTime; + } + + public void setOrgReceiveTime(Timestamp orgReceiveTime) + { + this.orgReceiveTime = orgReceiveTime; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateInfoRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateInfoRequest.java new file mode 100644 index 0000000..205552e --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateInfoRequest.java @@ -0,0 +1,336 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.server.request.order.update; + +import java.util.TreeMap; + +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +/*** + * 订单文字信息修改处理器 自主上传 + * + * @version v1.0.0 @author lgz 2019-1-17 新建与整理 + */ +public class DesignOrderUpdateInfoRequest extends ApiRequest { + // 数据类型 字段名 非空 数据长度 字段描述 + private long merchantId;// 是 + private long designId;// 是 + private long industryId;// 是 + private boolean isUrgent;// 是 + + private String userMobile;// 否 64 + private String userQq;// 否 64 + private String userWx;// 否 64 + private String printSpecial;// 否 100 + private String servicesMessage;// 否 500 + private String isHighQualityOrder;// 否 + private String customerQrcodeUrl;// 否 服务群二维码 + private String orderText;// 订单备注 + private String outId;// 订单id + private boolean isChange;// 是否改稿 + private boolean isBack;// 是否打回 + private String returnReason;// 打回理由 + + @Override + public DesignOrderUpdateInfoResponse newResponse() { + return new DesignOrderUpdateInfoResponse(); + } + + @Override + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) { + String merchantId = paramMap.get("merchantId"); + String outId = paramMap.get("outId"); + String industryId = paramMap.get("industryId"); + String isUrgent = paramMap.get("isUrgent"); + + String userMobile = paramMap.get("userMobile"); + String userQq = paramMap.get("userQq"); + String userWx = paramMap.get("userWx"); + String printSpecial = paramMap.get("printSpecial"); + String servicesMessage = paramMap.get("servicesMessage"); + + // 1.设计单号 + if (Validates.isEmptyBlank(outId)) { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("designId", designId)); + return false; + } + + // 2.商户号 + if (Validates.isEmptyBlank(merchantId)) { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + if (!Validates.isNumeric(Strings.trim(merchantId)) || Longs.toLong(Strings.trim(merchantId)) <= 0) { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + + err.setError(outId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + + // 3.行业 +// if (Validates.isEmptyBlank(industryId)) +// { +// Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; +// +// err.setError(designId, code.value(), code.desc() + biuldKeyValueString("industryId", industryId)); +// return false; +// } +// if (!Validates.isNumeric(Strings.trim(industryId)) || Longs.toLong(Strings.trim(industryId)) < 0) +// { +// Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; +// +// err.setError(designId, code.value(), code.desc() + biuldKeyValueString("industryId", industryId)); +// return false; +// } + +// // 4.加急 +// if (Validates.isEmptyBlank(isUrgent)) +// { +// Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; +// err.setError(designId, code.value(), code.desc() + biuldKeyValueString("isUrgent", isUrgent)); +// return false; +// } +// if (!Validates.isBoolean(Strings.trim(isUrgent).toLowerCase())) +// { +// Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; +// err.setError(designId, code.value(), code.desc() + biuldKeyValueString("isUrgent", isUrgent)); +// return false; +// } + +// // 5.对稿手机 +// if (Validates.isNotEmptyBlank(userMobile) && !Validates.isLen(Strings.trim(userMobile), 1, 64)) +// { +// Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; +// err.setError(designId, code.value(), code.desc() + biuldKeyValueString("userMobile", userMobile) + ",最大限制64字符"); +// return false; +// } +// // 6联系QQ +// if (Validates.isNotEmptyBlank(userQq) && !Validates.isLen(Strings.trim(userQq), 1, 64)) +// { +// Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; +// err.setError(designId, code.value(), code.desc() + biuldKeyValueString("userQq", userQq) + ",最大限制64字符"); +// return false; +// } +// +// // 7.联系微信 +// if (Validates.isNotEmptyBlank(userWx) && !Validates.isLen(Strings.trim(userWx), 1, 64)) +// { +// Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; +// err.setError(designId, code.value(), code.desc() + biuldKeyValueString("userWx", userWx) + ",最大限制64字符"); +// return false; +// } + +// // 8.特殊工艺 +// if (Validates.isNotEmptyBlank(printSpecial) && !Validates.isLen(Strings.trim(printSpecial), 1, 100)) +// { +// Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; +// err.setError(designId, code.value(), code.desc() + biuldKeyValueString("printSpecial", printSpecial) + ",最大限制100字符"); +// return false; +// } +// +// // 9.客服留言 +// if (Validates.isNotEmptyBlank(servicesMessage) && !Validates.isLen(Strings.trim(servicesMessage), 1, 500)) +// { +// Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; +// err.setError(designId, code.value(), code.desc() + biuldKeyValueString("servicesMessage", servicesMessage) + ",最大限制500字符"); +// return false; +// } + + return true; + } + + @Override + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) { + String merchantId = paramMap.get("merchantId"); + String outId = paramMap.get("outId"); + String isUrgent = paramMap.get("isUrgent"); + + String userMobile = paramMap.get("userMobile"); + String userQq = paramMap.get("userQq"); + String userWx = paramMap.get("userWx"); + String printSpecial = paramMap.get("printSpecial"); + String servicesMessage = paramMap.get("servicesMessage"); + String isHighQualityOrder = paramMap.get("isHighQualityOrder"); + String customerQrcodeUrl = paramMap.get("customerQrcodeUrl"); + String isChange = paramMap.get("isChange"); + String orderText = paramMap.get("orderText"); + String isBack = paramMap.get("isBack"); + String returnReason = paramMap.get("returnReason"); + try { + setMerchantId(Longs.toLong(Strings.trim(merchantId))); + setUrgent("true".equalsIgnoreCase(Strings.trim(isUrgent))); + setUserMobile(Strings.trim(userMobile)); + setUserQq(Strings.trim(userQq)); + setUserWx(Strings.trim(userWx)); + setPrintSpecial(Strings.trim(printSpecial)); + setServicesMessage(Strings.trim(servicesMessage)); + setHighQualityOrder(Strings.trim(isHighQualityOrder)); + setCustomerQrcodeUrl(Strings.trim(customerQrcodeUrl)); + setOrderText(Strings.trim(orderText)); + setOutId(outId); + if (!Validates.isEmptyBlank(isChange)) { + setChange("true".equalsIgnoreCase(Strings.trim(isChange))); + } + if (!Validates.isEmptyBlank(isBack)) { + setBack("true".equalsIgnoreCase(Strings.trim(isBack))); + } + if (!Validates.isEmptyBlank(returnReason)) { + setReturnReason(returnReason); + } + } catch (Exception e) { + log.error("用户文字信息修改接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(outId, code.value(), code.desc(), e); + return false; + } + return true; + } + + public long getMerchantId() { + return merchantId; + } + + public void setMerchantId(long merchantId) { + this.merchantId = merchantId; + } + + public long getDesignId() { + return designId; + } + + public void setDesignId(long designId) { + this.designId = designId; + } + + public long getIndustryId() { + return industryId; + } + + public void setIndustryId(long industryId) { + this.industryId = industryId; + } + + public boolean isUrgent() { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) { + this.isUrgent = isUrgent; + } + + public String getUserMobile() { + return userMobile; + } + + public void setUserMobile(String userMobile) { + this.userMobile = userMobile; + } + + public String getUserQq() { + return userQq; + } + + public void setUserQq(String userQq) { + this.userQq = userQq; + } + + public String getUserWx() { + return userWx; + } + + public void setUserWx(String userWx) { + this.userWx = userWx; + } + + public String getPrintSpecial() { + return printSpecial; + } + + public void setPrintSpecial(String printSpecial) { + this.printSpecial = printSpecial; + } + + public String getServicesMessage() { + return servicesMessage; + } + + public void setServicesMessage(String servicesMessage) { + this.servicesMessage = servicesMessage; + } + + public String isHighQualityOrder() { + return isHighQualityOrder; + } + + public void setHighQualityOrder(String isHighQualityOrder) { + this.isHighQualityOrder = isHighQualityOrder; + } + + public String getCustomerQrcodeUrl() { + return customerQrcodeUrl; + } + + public void setCustomerQrcodeUrl(String customerQrcodeUrl) { + this.customerQrcodeUrl = customerQrcodeUrl; + } + + public String getOrderText() { + return orderText; + } + + public void setOrderText(String orderText) { + this.orderText = orderText; + } + + public String getOutId() { + return outId; + } + + public void setOutId(String outId) { + this.outId = outId; + } + + public boolean isChange() { + return isChange; + } + + public void setChange(boolean isChange) { + this.isChange = isChange; + } + + public boolean isBack() { + return isBack; + } + + public void setBack(boolean isBack) { + this.isBack = isBack; + } + + public String getReturnReason() { + return returnReason; + } + + public void setReturnReason(String returnReason) { + this.returnReason = returnReason; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateInfoResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateInfoResponse.java new file mode 100644 index 0000000..ddce2ea --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateInfoResponse.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order.update; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +/*** + * 自主文字填写响应 + * + * @version v1.0.0 @author lgz 2019-1-17 新建与整理 + */ +public class DesignOrderUpdateInfoResponse extends ApiResponse +{ + private boolean isUpdated; + protected String buildBody() + { + return Jsons.toString(this); + } + public String toString() + { + return Jsons.toString(this); + } + public boolean isUpdated() + { + return isUpdated; + } + public void setUpdated(boolean isUpdated) + { + this.isUpdated = isUpdated; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateSpecificationRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateSpecificationRequest.java new file mode 100644 index 0000000..5ee652d --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateSpecificationRequest.java @@ -0,0 +1,658 @@ +package com.zhiqim.yangcai.design.server.request.order.update; + +import java.util.TreeMap; + +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +/**** + * 订单更新接口 + * + * @version v1.0.0 @author lgz 2018-12-18 新建与整理 + */ +public class DesignOrderUpdateSpecificationRequest extends ApiRequest +{ + // 数据类型 字段名 非空 数据长度 字段描述 + + private long designId;// 是 设计订单编号 + private long merchantId;// 是 订单商户编号 + private long typeId; // 是 设计类型,名片、彩页、等等 + private String orderText;// 否 200 产品全称,最多200个字符 + private String afterNames;// 否 500 后加工 多个逗号隔开 + private String printSpecial;// 否 100 特殊工艺,最多100个字符 + private double amount;// 否 金额最多支持两位小数 + private boolean isUrgent;// 是 是否加急,。 + private int draftType;// 是 稿件类型,0:自来稿,1:改稿自来稿,2:普通设计,3:高级设计 + private long industryId;// 是 行业编号,由设计平台提供,业务方适配。 + private double designWidth;// 是 设计宽度,单位mm,最多两位小数,含出血 + private double designHeight;// 是 设计高度,单位mm,最多两位小数,含出血 + private int designPage;// 是 设计面数,单面为1,双面为2 + private double printWidth;// 否 特殊尺寸宽度,单位mm,最多两位小数, 不含出血(用户尺寸) + private double printHeight;// 否 特殊尺寸高度,单位mm,最多两位小数, 不含出血(用户尺寸) + private int printKs;// 是 设计款数 + private int printMs;// 是 设计模数 + private String buyerNick;// 否 100 买家昵称 + private String userContact;// 否 100 联系人 + private String userMobile;// 是 64 联系电话 + private String userQq;// 否 64 买家联系QQ + private String userWx;// 否 64 买家联系微信号 + private String servicesMessage;// 否 500 留言给设计师 + private String tids;// 是 淘宝单号 + private int designCopies;// 否 设计费份数 + private boolean isOnlyDesign; // 是否仅设计 + private boolean isHighQualityOrder; // 是否是优质订单 + + @Override + public DesignOrderUpdateSpecificationResponse newResponse() + { + return new DesignOrderUpdateSpecificationResponse(); + } + + @Override + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + // 1.设计单号 + String designId = paramMap.get("designId"); + if (Validates.isEmptyBlank(designId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designId", designId)); + return false; + } + if (!Validates.isNumeric(Strings.trim(designId)) || Longs.toLong(Strings.trim(designId)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designId", designId)); + return false; + } + // 2.商户号 + String merchantId = paramMap.get("merchantId"); + if (Validates.isEmptyBlank(merchantId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + if (!Validates.isNumeric(Strings.trim(merchantId)) || Longs.toLong(Strings.trim(merchantId)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + + // 验证产品 + String typeId = paramMap.get("typeId"); + if (Validates.isEmptyBlank(typeId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("typeId", typeId)); + return false; + } + + if (!Validates.isNumeric(Strings.trim(typeId)) || Longs.toLong(Strings.trim(typeId)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("typeId", typeId)); + return false; + } + + // 4.订单信息 + String orderText = paramMap.get("orderText"); + if (Validates.isEmptyBlank(orderText)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("orderText", orderText)); + return false; + } + if (Strings.trim(orderText).length() > 200) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("orderText", orderText) + ",最大限制200字符"); + return false; + } + // 5.后加工信息 + String afterNames = paramMap.get("afterNames"); + if (Validates.isNotEmptyBlank(afterNames) && Strings.trim(afterNames).length() > 600) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("afterNames", orderText) + ",最大限制600字符"); + return false; + } + // 6.特殊工艺 + String printSpecial = paramMap.get("printSpecial"); + if (Validates.isNotEmptyBlank(printSpecial) && Strings.trim(printSpecial).length() > 100) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("printSpecial", orderText) + ",最大限制100字符"); + return false; + } + // 7.订单金额 + String amount = paramMap.get("amount"); + if (Validates.isNotEmptyBlank(amount) && !Validates.isAmount2R(Strings.trim(amount))) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("amount", amount)); + return false; + } + // 8.是否加急 + String isUrgent = paramMap.get("isUrgent"); + if (Validates.isNotEmptyBlank(isUrgent) && !Validates.isBoolean(Strings.trim(isUrgent).toLowerCase())) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("isUrgent", isUrgent)); + return false; + } + // 9.稿件类型 + String draftType = paramMap.get("draftType"); + if (Validates.isEmptyBlank(draftType)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("draftType", draftType)); + return false; + } + if (!Validates.isNumeric(Strings.trim(draftType)) || Longs.toLong(Strings.trim(draftType)) < 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("draftType", draftType)); + return false; + } + // 10.行业编号 + String industryId = paramMap.get("industryId"); + if (Validates.isEmptyBlank(industryId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("industryId", industryId)); + return false; + } + if (!Validates.isNumeric(Strings.trim(industryId)) || Longs.toLong(Strings.trim(industryId)) < 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("industryId", industryId)); + return false; + } + + // 11.订单印刷标准宽度 + String designWidth = paramMap.get("designWidth"); + if (Validates.isEmptyBlank(designWidth)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designWidth", designWidth)); + return false; + } + if (!Validates.isFloat(Strings.trim(designWidth)) || Float.valueOf(Strings.trim(designWidth)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designWidth", designWidth)); + return false; + } + + // 11.订单印刷标准高度 + String designHeight = paramMap.get("designHeight"); + if (Validates.isEmptyBlank(designHeight)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designHeight", designHeight)); + return false; + } + if (!Validates.isFloat(Strings.trim(designHeight)) || Float.valueOf(Strings.trim(designHeight)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designHeight", designHeight)); + return false; + } + // 12.设计面数 + String designPage = paramMap.get("designPage"); + if (Validates.isEmptyBlank(designPage)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designPage", designPage)); + return false; + } + if (!Validates.isNumeric(Strings.trim(designPage)) || Longs.toLong(Strings.trim(designPage)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designPage", designPage)); + return false; + } + + // 13.款 + String printKs = paramMap.get("printKs"); + if (Validates.isEmptyBlank(Strings.trim(printKs)) || !Validates.isNumeric(Strings.trim(printKs)) || Longs.toLong(Strings.trim(printKs)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("printKs", printKs)); + return false; + } + // 14.模 + String printMs = paramMap.get("printMs"); + if (Validates.isEmptyBlank(Strings.trim(printMs)) || !Validates.isNumeric(Strings.trim(printMs)) || Longs.toLong(Strings.trim(printMs)) <= 0) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("printMs", printMs)); + return false; + } + + // 15.自定义 宽 + String printWidth = paramMap.get("printWidth"); + if (Validates.isNotEmptyBlank(Strings.trim(printWidth)) + && (!Validates.isFloat(Strings.trim(printWidth)) || Float.valueOf(Strings.trim(printWidth)) < 0)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("printWidth", printWidth)); + return false; + } + // 16.自定义 高 + String printHeight = paramMap.get("printHeight"); + if (Validates.isNotEmptyBlank(Strings.trim(printHeight)) + && (!Validates.isFloat(Strings.trim(printHeight)) || Float.valueOf(Strings.trim(printHeight)) < 0)) + { + Int code = ApiErrorCodes.ERROR_API_SUPPORT_DATA; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("printHeight", printHeight)); + return false; + } + + if ((Validates.isNotEmptyBlank(printWidth) && Validates.isNotEmptyBlank(printHeight) && Double.valueOf(Strings.trim(printWidth)) <= 0 + && Double.valueOf(Strings.trim(printHeight)) > 0)) + {// printWidth <= 0 & printHeight>0 + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("printWidth,printHeight", printWidth, printHeight) + "必须两者 > 0 或者两者 = 0"); + return false; + } + if ((Validates.isNotEmptyBlank(printHeight) && Validates.isNotEmptyBlank(printWidth) && Double.valueOf(Strings.trim(printHeight)) <= 0 + && Double.valueOf(Strings.trim(printWidth)) > 0)) + {// printHeight <= 0 & printWidth>0 + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("printWidth,printHeight", printWidth, printHeight) + "必须两者 > 0 或者两者 = 0"); + return false; + } + + // 17.买家昵称 + String buyerNick = paramMap.get("buyerNick"); + if (Validates.isNotEmptyBlank(buyerNick) && Strings.trim(buyerNick).length() > 100) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("buyerNick", buyerNick) + "最大限制100字符"); + return false; + } + // 18.联系人 + String userContact = paramMap.get("userContact"); + if (Validates.isNotEmptyBlank(userContact) && Strings.trim(userContact).length() > 100) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("userContact", userContact) + "最大限制100字符"); + return false; + } + // 19.联系电话 + String userMobile = paramMap.get("userMobile"); + if (Validates.isNotEmptyBlank(userMobile) && Strings.trim(userMobile).length() > 64) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("userMobile", userMobile) + "最大限制64字符"); + return false; + } + // 20.QQ + String userQq = paramMap.get("userQq"); + if (Validates.isNotEmptyBlank(userQq) && Strings.trim(userQq).length() > 64) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("userQq", userQq) + "最大限制64字符"); + return false; + } + // 21.wx + String userWx = paramMap.get("userWx"); + if (Validates.isNotEmptyBlank(userWx) && Strings.trim(userWx).length() > 64) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("userWx", userWx) + "最大限制64字符"); + return false; + } + // 22.客服留言 + String servicesMessage = paramMap.get("servicesMessage"); + if (Validates.isNotEmptyBlank(servicesMessage) && Strings.trim(servicesMessage).length() > 500) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("servicesMessage", servicesMessage) + "最大限制500字符"); + return false; + } + // 23.淘宝单号 + String tids = paramMap.get("tids"); + if (Validates.isNotEmptyBlank(tids) && Strings.trim(tids).length() > 200) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("tids", tids) + "最大限制200字符"); + return false; + } + + // 最后 返回true + return true; + } + + @Override + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + String designId = paramMap.get("designId"); + try + { + setDesignId(Longs.toLong(Strings.trim(designId))); + setMerchantId(Longs.toLong(Strings.trim(paramMap.get("merchantId")))); + setTypeId(Longs.toLong(Strings.trim(paramMap.get("typeId")))); + setOrderText(Strings.trim(paramMap.get("orderText"))); + setAfterNames(Strings.trim(paramMap.get("afterNames"))); + setPrintSpecial(Strings.trim(paramMap.get("printSpecial"))); + setAmount(Double.valueOf(Strings.trim(paramMap.get("amount"), "0"))); + setUrgent("true".equals(Strings.trim(paramMap.get("isUrgent")).toLowerCase())); + setDraftType(Ints.toInt(Strings.trim(paramMap.get("draftType"), "0"), 0)); + setIndustryId(Longs.toLong(Strings.trim(paramMap.get("industryId")))); + setDesignWidth(Double.valueOf(Strings.trim(paramMap.get("designWidth"), "0"))); + setDesignHeight(Double.valueOf(Strings.trim(paramMap.get("designHeight"), "0"))); + setDesignPage(Ints.toInt(Strings.trim(paramMap.get("designPage"), "0"), 0)); + setPrintKs(Ints.toInt(Strings.trim(paramMap.get("printKs"), "0"), 0)); + setPrintMs(Ints.toInt(Strings.trim(paramMap.get("printMs"), "0"), 0)); + setPrintWidth(Double.valueOf(Strings.trim(paramMap.get("printWidth"), "0"))); + setPrintHeight(Double.valueOf(Strings.trim(paramMap.get("printHeight"), "0"))); + setBuyerNick(Strings.trim(paramMap.get("buyerNick"))); + setUserContact(Strings.trim(paramMap.get("userContact"))); + setUserMobile(Strings.trim(paramMap.get("userMobile"))); + setUserQq(Strings.trim(paramMap.get("userQq"))); + setUserWx(Strings.trim(paramMap.get("userWx"))); + setServicesMessage(Strings.trim(paramMap.get("servicesMessage"))); + setTids(Strings.trim(paramMap.get("tids"))); + setDesignCopies(Ints.toInt(Strings.trim(paramMap.get("designCopies"), "0"), 0)); + setOnlyDesign("true".equals(Strings.trim(paramMap.get("isOnlyDesign")).toLowerCase())); + setHighQualityOrder("true".equals(Strings.trim(paramMap.get("isHighQualityOrder")).toLowerCase())); + } + catch (Exception e) + { + log.error("订单规格修改接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(designId, code.value(), code.desc(), e); + return false; + } + + // 最后返回true + return true; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId <= 0 ? 0 : designId; + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId <= 0 ? 0 : merchantId; + } + + public long getTypeId() + { + return typeId; + } + + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + + public String getOrderText() + { + return orderText; + } + + public void setOrderText(String orderText) + { + this.orderText = orderText; + } + + public String getAfterNames() + { + return afterNames; + } + + public void setAfterNames(String afterNames) + { + this.afterNames = afterNames; + } + + public String getPrintSpecial() + { + return printSpecial; + } + + public void setPrintSpecial(String printSpecial) + { + this.printSpecial = printSpecial; + } + + public double getAmount() + { + return amount; + } + + public void setAmount(double amount) + { + this.amount = amount; + } + + public boolean isUrgent() + { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) + { + this.isUrgent = isUrgent; + } + + public int getDraftType() + { + return draftType; + } + + public void setDraftType(int draftType) + { + this.draftType = draftType; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public double getDesignWidth() + { + return designWidth; + } + + public void setDesignWidth(double designWidth) + { + this.designWidth = designWidth; + } + + public double getDesignHeight() + { + return designHeight; + } + + public void setDesignHeight(double designHeight) + { + this.designHeight = designHeight; + } + + public int getDesignPage() + { + return designPage; + } + + public void setDesignPage(int designPage) + { + this.designPage = designPage; + } + + public double getPrintWidth() + { + return printWidth; + } + + public void setPrintWidth(double printWidth) + { + this.printWidth = printWidth; + } + + public double getPrintHeight() + { + return printHeight; + } + + public void setPrintHeight(double printHeight) + { + this.printHeight = printHeight; + } + + public int getPrintKs() + { + return printKs; + } + + public void setPrintKs(int printKs) + { + this.printKs = printKs; + } + + public int getPrintMs() + { + return printMs; + } + + public void setPrintMs(int printMs) + { + this.printMs = printMs; + } + + public String getUserContact() + { + return userContact; + } + + public void setUserContact(String userContact) + { + this.userContact = userContact; + } + + public String getUserMobile() + { + return userMobile; + } + + public void setUserMobile(String userMobile) + { + this.userMobile = userMobile; + } + + public String getBuyerNick() + { + return buyerNick; + } + + public void setBuyerNick(String buyerNick) + { + this.buyerNick = buyerNick; + } + + public String getUserQq() + { + return userQq; + } + + public void setUserQq(String userQq) + { + this.userQq = userQq; + } + + public String getUserWx() + { + return userWx; + } + + public void setUserWx(String userWx) + { + this.userWx = userWx; + } + + public String getServicesMessage() + { + return servicesMessage; + } + + public void setServicesMessage(String servicesMessage) + { + this.servicesMessage = servicesMessage; + } + + public String getTids() + { + return tids; + } + + public void setTids(String tids) + { + this.tids = tids; + } + + public int getDesignCopies() + { + return designCopies; + } + + public void setDesignCopies(int designCopies) + { + this.designCopies = designCopies; + } + + public boolean isOnlyDesign() + { + return isOnlyDesign; + } + + public void setOnlyDesign(boolean isOnlyDesign) + { + this.isOnlyDesign = isOnlyDesign; + } + + public boolean isHighQualityOrder() + { + return isHighQualityOrder; + } + + public void setHighQualityOrder(boolean isHighQualityOrder) + { + this.isHighQualityOrder = isHighQualityOrder; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateSpecificationResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateSpecificationResponse.java new file mode 100644 index 0000000..e3cc605 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateSpecificationResponse.java @@ -0,0 +1,52 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order.update; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +/**** + * 修改规格 + * + * @version v1.0.0 @author lgz 2019-1-10 新建与整理 + */ +public class DesignOrderUpdateSpecificationResponse extends ApiResponse +{ + private long merchantId; + private long designId; + protected String buildBody() + { + return Jsons.toString(this); + } + public long getMerchantId() + { + return merchantId; + } + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + public long getDesignId() + { + return designId; + } + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateTextInfoRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateTextInfoRequest.java new file mode 100644 index 0000000..79a0090 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateTextInfoRequest.java @@ -0,0 +1,226 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order.update; + +import java.util.TreeMap; + +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; + +/*** + * 订单文字信息修改处理器 + * 自主上传 + * + * @version v1.0.0 @author lgz 2019-1-17 新建与整理 + */ +public class DesignOrderUpdateTextInfoRequest extends ApiRequest +{ + // 数据类型 字段名 非空 数据长度 字段描述 + private long merchantId;// 是 + private long designId;// 是 + + private String userText;// 否 4000 + private String userNotice;// 否 1000 + private String userMobile;// 否 64 + private String userQq;// 否 64 + private String userWx;// 否 64 + + public DesignOrderUpdateTextInfoResponse newResponse() + { + return new DesignOrderUpdateTextInfoResponse(); + } + + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + String merchantId = paramMap.get("merchantId"); + String designId = paramMap.get("designId"); + String userText = paramMap.get("userText"); + String userNotice = paramMap.get("userNotice"); + String userMobile = paramMap.get("userMobile"); + String userQq = paramMap.get("userQq"); + String userWx = paramMap.get("userWx"); + + //1.设计单号 + if (Validates.isEmptyBlank(designId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designId", designId)); + return false; + } + if (!Validates.isNumeric(Strings.trim(designId)) || Longs.toLong(Strings.trim(designId)) < 0) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designId", designId)); + return false; + } + //2.商户号 + if (Validates.isEmptyBlank(merchantId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + if (!Validates.isNumeric(Strings.trim(merchantId)) || Longs.toLong(Strings.trim(merchantId)) < 0) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + + //3用户文字资料 + if (Validates.isNotEmptyBlank(userText) && !Validates.isLen(Strings.trim(userText), 1, 4000)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("userText", userText)+",最大限制4000字符"); + return false; + } + //4.用户注意事项 + if (Validates.isNotEmptyBlank(userNotice) && !Validates.isLen(Strings.trim(userNotice), 1, 1000)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("userNotice", userNotice)+",最大限制1000字符"); + return false; + } + + //5.对稿手机 + if (Validates.isNotEmptyBlank(userMobile) && !Validates.isLen(Strings.trim(userMobile), 1, 64)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("userMobile", userMobile)+",最大限制64字符"); + return false; + } + + //6联系QQ + if (Validates.isNotEmptyBlank(userQq) && !Validates.isLen(Strings.trim(userQq), 1, 64)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("userQq", userQq)+",最大限制64字符"); + return false; + } + + //7.联系微信 + if (Validates.isNotEmptyBlank(userWx) && !Validates.isLen(Strings.trim(userWx), 1, 64)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("userWx", userWx)+",最大限制64字符"); + return false; + } + return true; + } + + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + String merchantId = paramMap.get("merchantId"); + String designId = paramMap.get("designId"); + String userText = paramMap.get("userText"); + String userNotice = paramMap.get("userNotice"); + String userMobile = paramMap.get("userMobile"); + String userQq = paramMap.get("userQq"); + String userWx = paramMap.get("userWx"); + try + { + setMerchantId(Longs.toLong(Strings.trim(merchantId))); + setDesignId(Longs.toLong(Strings.trim(designId))); + setUserText(Strings.trim(userText)); + setUserNotice(Strings.trim(userNotice)); + setUserMobile(Strings.trim(userMobile)); + setUserQq(Strings.trim(userQq)); + setUserWx(Strings.trim(userWx)); + } + catch (Exception e) + { + log.error("用户文字信息修改接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(designId, code.value(), code.desc(), e); + return false; + } + return true; + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public String getUserText() + { + return userText; + } + + public void setUserText(String userText) + { + this.userText = userText; + } + + public String getUserNotice() + { + return userNotice; + } + + public void setUserNotice(String userNotice) + { + this.userNotice = userNotice; + } + + public String getUserQq() + { + return userQq; + } + + public void setUserQq(String userQq) + { + this.userQq = userQq; + } + + public String getUserWx() + { + return userWx; + } + + public void setUserWx(String userWx) + { + this.userWx = userWx; + } + + public String getUserMobile() + { + return userMobile; + } + + public void setUserMobile(String userMobile) + { + this.userMobile = userMobile; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateTextInfoResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateTextInfoResponse.java new file mode 100644 index 0000000..74b734a --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/DesignOrderUpdateTextInfoResponse.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order.update; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +/*** + * 自主文字填写响应 + * + * @version v1.0.0 @author lgz 2019-1-17 新建与整理 + */ +public class DesignOrderUpdateTextInfoResponse extends ApiResponse +{ + private boolean isUpdated; + protected String buildBody() + { + return Jsons.toString(this); + } + public String toString() + { + return Jsons.toString(this); + } + public boolean isUpdated() + { + return isUpdated; + } + public void setUpdated(boolean isUpdated) + { + this.isUpdated = isUpdated; + } +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/ReplaceCustomFileRequest.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/ReplaceCustomFileRequest.java new file mode 100644 index 0000000..26357f0 --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/ReplaceCustomFileRequest.java @@ -0,0 +1,156 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order.update; + +import java.util.List; +import java.util.TreeMap; + +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ApiErrorResponse; +import com.zhiqim.yangcai.design.server.ApiRequest; +import com.zhiqim.yangcai.design.server.module.ApiFile; + +/**** + * 替换客户文件 + * + * @version v1.0.0 @author lgz 2019-1-17 新建与整理 + */ +public class ReplaceCustomFileRequest extends ApiRequest +{ + private long merchantId; + private long designId; + private List apiFiles; + public ReplaceCustomFileResponse newResponse() + { + return new ReplaceCustomFileResponse(); + } + + protected boolean validateParam(TreeMap paramMap, ApiErrorResponse err) + { + //1.设计单号 + String designId = paramMap.get("designId"); + if (Validates.isEmptyBlank(designId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designId", designId)); + return false; + } + if (!Validates.isNumeric(Strings.trim(designId)) || Longs.toLong(Strings.trim(designId)) < 0) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("designId", designId)); + return false; + } + //2.商户号 + String merchantId = paramMap.get("merchantId"); + if (Validates.isEmptyBlank(merchantId)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + if (!Validates.isNumeric(Strings.trim(merchantId)) || Longs.toLong(Strings.trim(merchantId)) < 0) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_FORMAT; + + err.setError(designId, code.value(), code.desc() + biuldKeyValueString("merchantId", merchantId)); + return false; + } + + List apiFiles = Jsons.toList(paramMap.get("apiFiles"), ApiFile.class); + for (ApiFile apiFile : apiFiles) + { + String downUrl = apiFile.getDownUrl(); + String fileName = apiFile.getFileName(); + String fileExt = apiFile.getFileExt(); + if (!Validates.isUrl(downUrl)) + { + Int code = ApiErrorCodes.ERROR_API_PARAM_DATA; + err.setError(designId, code.value(), code.desc() + ",附件资料包含无效下载地址"+biuldKeyValueString("downUrl", downUrl)); + return false; + } + if (Validates.isEmptyBlank(fileName)) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + ",附件资料包含无效文件名"+biuldKeyValueString("fileName", fileName)); + return false; + } + if (Validates.isEmptyBlank(fileExt) || Validates.isEmptyBlank(Strings.replaceAll(fileExt, "\\.", ""))) + { + Int code = ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK; + err.setError(designId, code.value(), code.desc() + "附件资料包含未知文件名扩展名"+biuldKeyValueString("fileExt", fileExt)); + return false; + } + } + return true; + } + + protected boolean parseBody(TreeMap paramMap, ApiErrorResponse err) + { + String designId = paramMap.get("designId"); + try + { + setDesignId(Longs.toLong(Strings.trim(designId))); + setMerchantId(Longs.toLong(Strings.trim(paramMap.get("merchantId")))); + List apiFiles = Jsons.toList(paramMap.get("apiFiles"), ApiFile.class); + setApiFiles(apiFiles); + } + catch (Exception e) + { + log.error("刷新客户文件接口参数解析异常", e); + Int code = ApiErrorCodes.ERROR_API_PARAM_ANALYSIS; + err.setError(designId, code.value(), code.desc(), e); + return false; + } + + //最后返回true + return true; + } + + public List getApiFiles() + { + return apiFiles; + } + + public void setApiFiles(List apiFiles) + { + this.apiFiles = apiFiles; + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + +} diff --git a/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/ReplaceCustomFileResponse.java b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/ReplaceCustomFileResponse.java new file mode 100644 index 0000000..761274b --- /dev/null +++ b/Yangcai365_web/src/server/com/zhiqim/yangcai/design/server/request/order/update/ReplaceCustomFileResponse.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.server.request.order.update; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.ApiResponse; + +/**** + * 客户文件刷新相应 + * + * @version v1.0.0 @author lgz 2019-1-17 新建与整理 + */ +public class ReplaceCustomFileResponse extends ApiResponse +{ + private boolean isReplaced; + protected String buildBody() + { + return Jsons.toString(this); + } + public boolean isReplaced() + { + return isReplaced; + } + public void setReplaced(boolean isReplaced) + { + this.isReplaced = isReplaced; + } + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/CustomerTypeCache.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/CustomerTypeCache.java new file mode 100644 index 0000000..5351824 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/CustomerTypeCache.java @@ -0,0 +1,139 @@ +/** + * 扬彩印刷设计 + * 文件名 :CustomerTypeCache.java + * 创建人 :gjx + * 创建时间:2019-12-23 + */ + +package com.zhiqim.yangcai.cache; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.json.parser.ArrayParser; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Validates; + +import com.zhiqim.yangcai.design.constants.BaseConstants; +import com.zhiqim.yangcai.design.model.CustomerTypeCacheModel; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +/** + * [简要描述]客户类型缓存 :
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-12-23 新建与整理 + */ +@AnAlias("CustomerTypeCache") +public class CustomerTypeCache +{ + private static final Log log = LogFactory.getLog(CustomerTypeCache.class); + private List customerTypeAll = new ArrayList<>();// 全部客户类型 + private List customerTypeList = new ArrayList<>();// 可用客户类型 + + /** 获取全部客户类型列表 */ + public List getCustomerTypeCacheAll() + { + return customerTypeAll; + } + + /** 获取可用客户类型列表 */ + public List getCustomerTypeCacheList() + { + return customerTypeList; + } + + /** 获取客户类型名称 */ + public String getCustomerTypeName(int customerTypeId) + { + for (CustomerTypeCacheModel param : customerTypeAll) + { + if (customerTypeId == param.getCustomerTypeId()) + { + return param.getCustomerTypeName(); + } + } + + return ""; + } + + /** 获取客户类型对象 */ + public CustomerTypeCacheModel getCustomerType(int customerTypeId) + { + for (CustomerTypeCacheModel param : customerTypeAll) + { + if (customerTypeId == param.getCustomerTypeId()) + { + return param; + } + } + + return null; + } + + /** 获取客户类型 map格式 */ + public Map map() throws Exception + { + Map map = new LinkedHashMap<>(); + List list = Global.get(CustomerTypeCache.class).getCustomerTypeCacheAll(); + for (CustomerTypeCacheModel customerType : list) + { + map.put(customerType.getCustomerTypeId(), customerType); + } + + return map; + } + + /** + * 刷新缓存数据 + * + * @return + */ + public CustomerTypeCache doRefresh() + { + try + { + String access_token = BusinessPlatformClientUtil.getAccessToken(); + // 获取行业配置数据 + String resultText = BusinessPlatformClientUtil.getDicKeyParamValue(BaseConstants.CUSTOMER_TYPE_KEY_CODE, access_token); + MapSO customerTypeMap = Jsons.toMapSO(resultText); + if (Validates.isNotEmpty(customerTypeMap)) + { + String data = String.valueOf(customerTypeMap.get("data")); + List industrys = ArrayParser.toFieldList(data); + customerTypeList.clear(); + customerTypeAll.clear(); + for (String field : industrys) + { + HashMapSS mapSS = Jsons.toMapSS(field); + boolean isEnabled = "1".equals(mapSS.get("state")) ? true : false; + CustomerTypeCacheModel customerType = new CustomerTypeCacheModel(); + customerType.setCustomerTypeId(Integer.valueOf(mapSS.get("code"))); + customerType.setCustomerTypeName(mapSS.get("name")); + + customerTypeAll.add(customerType); + if (isEnabled) + {// 可用行业 + customerTypeList.add(customerType); + } + } + } + + } + catch (Exception e) + { + log.error("初始化客户类型数据失败", e); + } + + return this; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesMaterialCatCache.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesMaterialCatCache.java new file mode 100644 index 0000000..bfc39ab --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesMaterialCatCache.java @@ -0,0 +1,75 @@ +package com.zhiqim.yangcai.cache; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.works.DesMaterialCat; + +/** + * [简要描述]:作品素材分类缓存
            + * + * @version 1.0 @author caohong 2019-9-5 新建与整理 + */ +@AnAlias("DesMaterialCatCache") +public class DesMaterialCatCache +{ + private static final Log log = LogFactory.getLog(DesMaterialCatCache.class); + private List materialList = new ArrayList(); + private Map catMap = new HashMap(); + + public List list() + { + return this.materialList; + } + + public DesMaterialCat get(long catId) + { + return catMap.get(catId); + } + + public String name(long catId) + { + if (Validates.isEmpty(catId)) + { + return ""; + } + + return catMap.get(catId).getCatName(); + } + + public synchronized DesMaterialCatCache doRefresh() + { + try + { + materialList.clear(); + catMap.clear(); + + Selector selector = new Selector(); + selector.addOrderbyAsc("catSeq"); + selector.addMust("catStatus", 0); + materialList = ORM.get(ZTable.class).list(DesMaterialCat.class, selector); + + for (DesMaterialCat cat : materialList) + { + + catMap.put(cat.getCatId(), cat); + } + } + catch (Exception e) + { + log.error("刷新作品素材分类缓存异常", e); + } + + return this; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesignIndustryCache.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesignIndustryCache.java new file mode 100644 index 0000000..b558a50 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesignIndustryCache.java @@ -0,0 +1,209 @@ +package com.zhiqim.yangcai.cache; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.json.parser.ArrayParser; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Validates; + +import com.zhiqim.yangcai.design.constants.BaseConstants; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +/** + * 行业信息缓存 + * + * @version v1.0.0 @author caohong 2019-9-6 10:24:51 新建与整理 + * @version v1.0.1 @author gjx 2019-9-23 淘印通接口替换行业数据 + */ +@AnAlias("DesignIndustryCache") +public class DesignIndustryCache +{ + private static final Log log = LogFactory.getLog(DesignIndustryCache.class); + private List industrieListAll = new ArrayList<>();// 全部行业 + private List industryList = new ArrayList();// 可用行业 + + /** 获取全部行业列表 */ + public List getIndustryListAll() + { + return industrieListAll; + } + + /** 获取可用行业列表 */ + public List getIndustryList() + { + return industryList; + } + + /** 获取行业名 */ + public String getIndustryName(long industryId) + { + for (DesignIndustry param : industrieListAll) + { + if (industryId == param.getIndustryId()) + { + return param.getIndustryName(); + } + } + + return ""; + } + + /** 获取行业对象 */ + public DesignIndustry getIndustry(long industryId) + { + for (DesignIndustry param : industrieListAll) + { + if (industryId == param.getIndustryId()) + { + return param; + } + } + + return null; + } + + /** 获取行业 map格式 */ + public Map map() throws Exception + { + Map map = new LinkedHashMap<>(); + List list = Global.get(DesignIndustryCache.class).getIndustryList(); + for (DesignIndustry industry : list) + { + map.put(industry.getIndustryId(), industry); + } + + return map; + } + + /** 获取所有行业 map格式 */ + public Map mapAll() throws Exception + { + Map map = new LinkedHashMap<>(); + List list = Global.get(DesignIndustryCache.class).getIndustryListAll(); + for (DesignIndustry industry : list) + { + map.put(industry.getIndustryId(), industry); + } + + return map; + } + + /** 根据行业名查找行业 */ + public DesignIndustry queryIndustryByName(String industryName) throws Exception + { + DesignIndustry designIndustry = new DesignIndustry(); + List list = Global.get(DesignIndustryCache.class).getIndustryListAll(); + for (DesignIndustry industry : list) + { + if (Validates.isNotEmpty(industryName) && industryName.equals(industry.getIndustryName())) + { + designIndustry = industry; + } + } + if (designIndustry != null && designIndustry.getIndustryId() <= 0) + { + return null; + } + return designIndustry; + } + + /** + * 刷新缓存数据 + * + * @return + */ + public static void doRefreshIndustry() + { + // 设计行业分类 + DesignIndustryCache dic = Global.get(DesignIndustryCache.class); + dic = dic != null ? dic : new DesignIndustryCache(); + Global.remove(DesignIndustryCache.class); + Global.add(DesignIndustryCache.class, dic.doRefresh()); + } + + /** + * 刷新缓存数据 + * + * @return + */ + public DesignIndustryCache doRefresh() + { + try + { + String access_token = BusinessPlatformClientUtil.getAccessToken(); + // 获取行业配置数据 + String resultText = BusinessPlatformClientUtil.getDicKeyParamValue(BaseConstants.INDUSTRY_DIC_KEY_CODE, access_token); + MapSO industryMap = Jsons.toMapSO(resultText); + if (Validates.isNotEmpty(industryMap)) + { + String data = String.valueOf(industryMap.get("data")); + List industrys = ArrayParser.toFieldList(data); + industryList.clear(); + industrieListAll.clear(); + for (String field : industrys) + { + HashMapSS mapSS = Jsons.toMapSS(field); + boolean isEnabled = "1".equals(mapSS.get("state")) ? true : false; + + DesignIndustry industry = new DesignIndustry(); + industry.setIndustryId(Long.valueOf(mapSS.get("code"))); + industry.setIndustryName(mapSS.get("name")); + industry.setIndustryKeywords(mapSS.get("remark")); + industry.setEnabled(isEnabled); + industry.setIndustrySeq(Integer.valueOf(mapSS.get("seq"))); + + industrieListAll.add(industry); + if (isEnabled) + {// 可用行业 + industryList.add(industry); + } + } + } + sortList(industrieListAll); + sortList(industryList); + + } + catch (Exception e) + { + log.error("初始化行业类型数据失败", e); + } + + return this; + } + + /** + * + * 排序 + * + * @author gjx + * @param list + */ + public static void sortList(List list) + { + + List sortList = null; + for (int g = 0; g < list.size() - 1; g++) + { // 冒泡按指定条件升序 + for (int d = 0; d < list.size() - 1 - g; d++) + { + if (list.get(d).getIndustrySeq() > list.get(d + 1).getIndustrySeq()) + { + sortList = new ArrayList<>(); + sortList.add(0, list.get(d)); + list.set(d, list.get(d + 1)); + list.set(d + 1, sortList.get(0)); + } + } + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesignMerchantCache.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesignMerchantCache.java new file mode 100644 index 0000000..326cb17 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesignMerchantCache.java @@ -0,0 +1,79 @@ +package com.zhiqim.yangcai.cache; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; + +/*** + * 商户信息缓存 + * + * @version v1.0.0 @author caohong 2019-8-28 新建与整理 + */ +@AnAlias("DesignMerchantCache") +public class DesignMerchantCache +{ + private static final Log log = LogFactory.getLog(DesignMerchantCache.class); + private List listAll = new ArrayList(); + private final List list = new ArrayList(); + private final Map mapAll = new HashMap(); + + public List getList() + { + return list; + } + + public List getListAll() + { + return listAll; + } + + public DesignMerchant get(long merchantId) + { + return mapAll.get(merchantId); + } + + public String getName(long merchantId) + { + DesignMerchant merchant = mapAll.get(merchantId); + + return merchant == null ? "" : merchant.getMerchantName(); + } + + public DesignMerchantCache doRefresh() + { + try + { + mapAll.clear(); + list.clear(); + listAll.clear(); + listAll = ORM.get(ZTable.class).list(DesignMerchant.class); + Iterator iterator = listAll.iterator(); + while (iterator.hasNext()) + { + DesignMerchant merchant = iterator.next(); + this.mapAll.put(merchant.getMerchantId(), merchant); + + if (merchant.isEnabled()) + { + this.list.add(merchant); + } + } + } + catch (Exception e) + { + log.error("商户信息刷新异常", e); + } + + return this; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesignOrderRefundReasonCache.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesignOrderRefundReasonCache.java new file mode 100644 index 0000000..e2a7523 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesignOrderRefundReasonCache.java @@ -0,0 +1,74 @@ +package com.zhiqim.yangcai.cache; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrderRefundReason; + +/*** + * 退款问题配置缓存 + * + * @version v1.0.0 @author 谢盼 2021-06-03 新建与整理 + */ +@AnAlias("DesignOrderRefundReasonCache") +public class DesignOrderRefundReasonCache +{ + private static final Log log = LogFactory.getLog(DesignOrderRefundReason.class); + private List listAll = new ArrayList(); + private final List list = new ArrayList(); + private final Map mapAll = new HashMap(); + + public List getList() + { + return list; + } + + public List getListAll() + { + return listAll; + } + + public DesignOrderRefundReason get(long id) + { + return mapAll.get(id); + } + + public String getName(long id) + { + DesignOrderRefundReason reason = mapAll.get(id); + + return reason == null ? "" : reason.getTitle(); + } + + public DesignOrderRefundReasonCache doRefresh() + { + try + { + mapAll.clear(); + list.clear(); + listAll.clear(); + listAll = ORM.get(ZTable.class).list(DesignOrderRefundReason.class); + Iterator iterator = listAll.iterator(); + while (iterator.hasNext()) + { + DesignOrderRefundReason reason = iterator.next(); + this.mapAll.put(reason.getId(), reason); + } + } + catch (Exception e) + { + log.error("退款问题配置刷新异常", e); + } + + return this; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesignTypeCache.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesignTypeCache.java new file mode 100644 index 0000000..d5c3f3c --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/DesignTypeCache.java @@ -0,0 +1,119 @@ +package com.zhiqim.yangcai.cache; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/** + * 产品类型缓存 + * + * @author caohong + * + */ +@AnAlias("DesignTypeCache") +public class DesignTypeCache +{ + private static final Log log = LogFactory.getLog(DesignTypeCache.class); + + private List productTypeList = new ArrayList<>();// 可用的 + private Map typeMap = new HashMap();// 可用的 + private List productTypeListAll = new ArrayList<>();// 可用的 + private Map typeMapAll = new HashMap();// 所有的 + + /** + * 获取可用的产品类型列表 + * + * @return + */ + public List getList() + { + return productTypeList; + } + + /** + * 获取可用的产品类型map + * + * @return + */ + public Map getMap() + { + return typeMap; + } + + /** + * 获取所有产品类型列表 + * + * @return + */ + public List getListAll() + { + return productTypeListAll; + } + + public DesignType get(long productTypeId) + { + return typeMapAll.get(productTypeId); + } + + /** + * 获取产品类型名称 + * + * @param productTypeId + * @return + */ + public String getName(long productTypeId) + { + DesignType temp = typeMapAll.get(productTypeId); + if (temp == null) + { + return ""; + } + + return temp.getTypeName(); + } + + /** + * 刷新缓存数据 + * + * @return + */ + public DesignTypeCache doRefresh() + { + try + { + productTypeList.clear(); + typeMap.clear(); + productTypeListAll.clear(); + typeMapAll.clear(); + + productTypeListAll = ORM.get(ZTable.class).list(DesignType.class, new Selector().addOrderbyAsc("typeSeq")); + for (DesignType temp : productTypeListAll) + { + if (temp.isEnabled()) + { + typeMap.put(temp.getTypeId(), temp); + productTypeList.add(temp); + } + + typeMapAll.put(temp.getTypeId(), temp); + } + + } + catch (Exception e) + { + log.error("缓存产品类型列表时异常", e); + } + + return this; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/IndustryLabelCache.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/IndustryLabelCache.java new file mode 100644 index 0000000..fb0a085 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/IndustryLabelCache.java @@ -0,0 +1,189 @@ +/** + * 扬彩印刷设计 + * 文件名 :IndustryLabelCache.java + * 创建人 :jiangbin + * 创建时间:2019-12-16 + */ +package com.zhiqim.yangcai.cache; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.httpclient.HttpGet; +import org.zhiqim.kernel.httpclient.HttpResult; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.json.parser.ArrayParser; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Validates; + +import com.zhiqim.yangcai.design.model.IndustryLabelModel; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +/** + * [简要描述]:行业标签缓存
            + * [详细描述]:
            + * + * @version 1.0 @author jiangbin 2019-12-16 新建与整理 + */ +@AnAlias("IndustryLabelCache") +public class IndustryLabelCache +{ + private static final Log log = LogFactory.getLog(IndustryLabelCache.class); + private List industryLabelAll = new ArrayList<>();// 全部标签 + private List industryLabelList = new ArrayList();// 可用标签 + + public List getIndustryLabelAll() + { + return industryLabelAll; + } + + public List getIndustryLabelList() + { + return industryLabelList; + } + + /** 获取行业标签名 */ + public String getIndustryLabelName(long industryLabelId) + { + for (IndustryLabelModel param : industryLabelAll) + { + if (industryLabelId == param.getId()) + { + return param.getLabelName(); + } + } + return ""; + } + + /** 获取行业标签对象 */ + public IndustryLabelModel getIndustryLabel(long industryLabelId) + { + for (IndustryLabelModel param : industryLabelAll) + { + if (industryLabelId == param.getId()) + { + return param; + } + } + return null; + } + + /** 获取可用行业标签 map格式 */ + public Map map() throws Exception + { + Map map = new LinkedHashMap<>(); + List list = Global.get(IndustryLabelCache.class).getIndustryLabelList(); + for (IndustryLabelModel label : list) + { + map.put(label.getId(), label); + } + return map; + } + + /** 获取全部行业标签 map格式 */ + public Map mapAll() throws Exception + { + Map map = new LinkedHashMap<>(); + List list = Global.get(IndustryLabelCache.class).getIndustryLabelAll(); + for (IndustryLabelModel label : list) + { + map.put(label.getId(), label); + } + return map; + } + + /** + * 刷新行业标签缓存数据 + * + * @return + */ + public static void doRefreshIndustryLabelCache() + { + IndustryLabelCache ilc = Global.get(IndustryLabelCache.class); + ilc = ilc != null ? ilc : new IndustryLabelCache(); + Global.remove(IndustryLabelCache.class); + Global.add(IndustryLabelCache.class, ilc.doRefresh()); + } + + /** + * 刷新 + * + * @return + */ + public IndustryLabelCache doRefresh() + { + try + { + String access_token = BusinessPlatformClientUtil.getAccessToken(); + // 获取行业标签数据 + String url = Global.getString("businessPlatform", "gatewayUrl"); + StringBuffer buffer = new StringBuffer(url); + buffer.append("api-conf/industrylabel/list?access_token="); + buffer.append(access_token); + HttpGet get = new HttpGet(buffer.toString()); + get.setConnectTimeout(3); + get.setReadTimeout(3); + get.execute(); + HttpResult result = get.getResult(); + if (result.isSuccess()) + { + String resultText = result.getResponseText(); + MapSO industryMap = Jsons.toMapSO(resultText); + if (Validates.isNotEmpty(industryMap)) + { + String data = String.valueOf(industryMap.get("data")); + List industrys = ArrayParser.toFieldList(data); + industryLabelList.clear(); + industryLabelAll.clear(); + for (String string : industrys) + { + HashMapSS mapSS = Jsons.toMapSS(string); + if (Validates.isEmpty(mapSS.get("id")) || Validates.isEmpty(mapSS.get("industryCode")) + || Validates.isEmpty(mapSS.get("state"))) + { + continue; + } + IndustryLabelModel model = new IndustryLabelModel(); + model.setId(Long.valueOf(mapSS.get("id"))); + model.setIndustryId(Long.valueOf(mapSS.get("industryCode"))); + model.setDimensionId(mapSS.get("dimensionCode")); + model.setLabelName(mapSS.get("labelName")); + model.setState(Integer.valueOf(mapSS.get("state"))); + industryLabelAll.add(model); + if ("1".equals(mapSS.get("state"))) + { + industryLabelList.add(model); + } + } + } + } + } + catch (Exception e) + { + log.error("初始化行业标签数据失败", e); + } + + return this; + } + + public static void main(String[] args) + { + String industryCode = null; + if (Validates.isEmpty(industryCode)) + { + System.out.println("空"); + } + else + { + System.out.println(Long.valueOf("industryCode")); + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/LabelDimensionCache.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/LabelDimensionCache.java new file mode 100644 index 0000000..7e5b94f --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/LabelDimensionCache.java @@ -0,0 +1,163 @@ +/** + * 扬彩印刷设计 + * 文件名 :LabelDimensionCache.java + * 创建人 :jiangbin + * 创建时间:2019-12-18 + */ +package com.zhiqim.yangcai.cache; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.json.parser.ArrayParser; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Validates; + +import com.zhiqim.yangcai.design.constants.BaseConstants; +import com.zhiqim.yangcai.design.model.LabelDimensionModel; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +/** + * [简要描述]:标签维度缓存
            + * [详细描述]:
            + * + * @version 1.0 @author jiangbin 2019-12-18 新建与整理 + */ +@AnAlias("LabelDimensionCache") +public class LabelDimensionCache +{ + private static final Log log = LogFactory.getLog(LabelDimensionCache.class); + private List dimensionAll = new ArrayList<>();// 全部维度 + private List dimensionList = new ArrayList();// 可用维度 + + public List getDimensionAll() + { + return dimensionAll; + } + + public List getDimensionList() + { + return dimensionList; + } + + /** 获取维度名 */ + public String getDimensionName(String dimensionId) + { + for (LabelDimensionModel param : dimensionAll) + { + if (dimensionId.equals(param.getDimensionId())) + { + return param.getDimensionName(); + } + } + + return ""; + } + + /** 获取维度对象 */ + public LabelDimensionModel getDimension(String dimensionId) + { + for (LabelDimensionModel param : dimensionAll) + { + if (dimensionId.equals(param.getDimensionId())) + { + return param; + } + } + + return null; + } + + /** 获取标签维度 map格式 */ + public Map map() throws Exception + { + Map map = new LinkedHashMap<>(); + List list = Global.get(LabelDimensionCache.class).getDimensionList(); + for (LabelDimensionModel dimension : list) + { + map.put(dimension.getDimensionId(), dimension); + } + + return map; + } + + /** 获取所有标签维度 map格式 */ + public Map mapAll() throws Exception + { + Map map = new LinkedHashMap<>(); + List list = Global.get(LabelDimensionCache.class).getDimensionAll(); + for (LabelDimensionModel dimension : list) + { + map.put(dimension.getDimensionId(), dimension); + } + + return map; + } + + /** + * 刷新维度缓存数据 + * + * @return + */ + public static void doRefreshLabelDimensionCache() + { + LabelDimensionCache ldc = Global.get(LabelDimensionCache.class); + ldc = ldc != null ? ldc : new LabelDimensionCache(); + Global.remove(LabelDimensionCache.class); + Global.add(LabelDimensionCache.class, ldc.doRefresh()); + } + + /** + * 刷新 + * + * @return + */ + public LabelDimensionCache doRefresh() + { + try + { + String access_token = BusinessPlatformClientUtil.getAccessToken(); + // 获取标签维度数据 + String resultText = BusinessPlatformClientUtil.getDicKeyParamValue(BaseConstants.DIMENSION_DIC_KEY_CODE, access_token); + MapSO industryMap = Jsons.toMapSO(resultText); + if (Validates.isNotEmpty(industryMap)) + { + String data = String.valueOf(industryMap.get("data")); + List industrys = ArrayParser.toFieldList(data); + dimensionAll.clear(); + dimensionList.clear(); + for (String field : industrys) + { + HashMapSS mapSS = Jsons.toMapSS(field); + boolean isEnabled = "1".equals(mapSS.get("state")) ? true : false; + LabelDimensionModel dimension = new LabelDimensionModel(); + dimension.setDimensionId(mapSS.get("code")); + dimension.setDimensionName(mapSS.get("name")); + dimension.setRemark(mapSS.get("remark")); + dimension.setEnabled(isEnabled); + dimension.setDimensionSeq(Integer.valueOf(mapSS.get("seq"))); + + dimensionAll.add(dimension); + if (isEnabled) + {// 可用维度 + dimensionList.add(dimension); + } + } + } + } + catch (Exception e) + { + log.error("初始化标签维度数据失败", e); + } + + return this; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/OrgCache.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/OrgCache.java new file mode 100644 index 0000000..655ba43 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/OrgCache.java @@ -0,0 +1,110 @@ +package com.zhiqim.yangcai.cache; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +/** + * 组织缓存 + */ +@AnAlias("OrgCache") +public class OrgCache +{ + private static final Log log = LogFactory.getLog(OrgCache.class); + private List orgList = new ArrayList<>(); + private List orgAllList = new ArrayList<>(); + + /** 获取组织列表 */ + public List list() + { + return orgList; + } + + /** 获取所有组织列表 */ + public List listAll() + { + return orgAllList; + } + + /** 获取组织名 */ + public String name(long orgId) + { + for (ZmrOrg param : orgAllList) + { + if (orgId == param.getOrgId()) + { + return param.getOrgName(); + } + } + + return ""; + } + + /** 获取组织对象 */ + public ZmrOrg get(long orgId) + { + for (ZmrOrg param : orgAllList) + { + if (orgId == param.getOrgId()) + { + return param; + } + } + + return null; + } + + /** + * 获取根组织 + * + * @return + */ + public ZmrOrg getRootOrg() + { + for (ZmrOrg param : orgAllList) + { + if (param.getOrgLevel() == 0) + { + return param; + } + } + + return null; + } + + /** + * 刷新缓存数据 + * + * @return + */ + public OrgCache doRefresh() + { + try + { + orgAllList.clear(); + orgList.clear(); + + orgAllList = ORM.get(ZTable.class).list(ZmrOrg.class, new Selector().addOrderbyAsc("orgLevel,orgSeq")); + for (ZmrOrg temp : orgAllList) + { + if (temp.getOrgStatus() == 0) + { + orgList.add(temp); + } + } + } + catch (Exception e) + { + log.error("查询组织列表时失败", e); + } + + return this; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/ProductConvertCache.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/ProductConvertCache.java new file mode 100644 index 0000000..02e1e77 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/cache/ProductConvertCache.java @@ -0,0 +1,119 @@ +/** + * 扬彩印刷设计 + * 文件名 :ProductConvertCache.java + * 创建人 :gjx + * 创建时间:2021年3月6日 +*/ + +package com.zhiqim.yangcai.cache; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.design.ProductDesignPriceView; + +/** + * + * [简要描述]: 产品单价缓存
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年3月6日 新建与整理 + */ +@AnAlias("ProductConvertCache") +public class ProductConvertCache +{ + private static final Log log = LogFactory.getLog(ProductConvertCache.class); + + private List productConvertList = new ArrayList(); + private Map> prdTypeConvertMap = new HashMap>();// 产品对应的单价计算规则 + + public List getProductConvertList() + { + return productConvertList; + } + + /** + * * + * [简要描述]: 获取产品单价list
            + * [详细描述]:
            + * + * @author gjx + * @param prdTypeId + * @return + */ + public List getProductLeverPriceList(long prdTypeId) + { + + return prdTypeConvertMap.get(Long.valueOf(prdTypeId)); + } + + /** + * + * [简要描述]: 添加产品单价缓存
            + * [详细描述]:
            + * + * @author gjx + * @return + */ + public ProductConvertCache doRefresh() + { + try + { + productConvertList.clear(); + prdTypeConvertMap.clear(); + + productConvertList = ORM.get(ZView.class).list(ProductDesignPriceView.class, new Selector().addOrderbyAsc("prdTypeId").addMust("status", 1)); + for (ProductDesignPriceView prdCvt : productConvertList) + { + long prdTypeId = prdCvt.getPrdTypeId(); + + if (!prdTypeConvertMap.containsKey(Long.valueOf(prdTypeId))) + { + prdTypeConvertMap.put(prdTypeId, new ArrayList()); + } + + List valueList = prdTypeConvertMap.get(Long.valueOf(prdTypeId)); + valueList.add(prdCvt); + + } + + for (Entry> item : prdTypeConvertMap.entrySet()) + { + Collections.sort(item.getValue(), new Comparator() + { + @Override + public int compare(ProductDesignPriceView o1, ProductDesignPriceView o2) + { + int o1Seq = o1.getSeq(); + int o2Seq = o2.getSeq(); + + if (String.valueOf(o1Seq).length() == String.valueOf(o2Seq).length()) + {// 序号长度一样 + return (o1.getPrdSizeWidth() + o1.getPrdSizeHeight()) - (o2.getPrdSizeWidth() + o2.getPrdSizeHeight()); + } + + return o2Seq - o1Seq; + } + }); + } + + } + catch (Exception e) + { + log.error("缓存产品单价规则异常", e); + } + return this; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/Main.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/Main.java new file mode 100644 index 0000000..1242491 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/Main.java @@ -0,0 +1,14 @@ +package com.zhiqim.yangcai.design; + +import org.zhiqim.kernel.Servicer; + +public class Main extends Servicer +{ + @Override + public boolean create() throws Exception + { + MediaDesignBootstrap.initCache(); // 业务公共配置初始化数据 + return true; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/AfterConstants.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/AfterConstants.java new file mode 100644 index 0000000..cfca253 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/AfterConstants.java @@ -0,0 +1,109 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.constants; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.consts.Int; + +/*** + * 售后相关常量 + * + * @version v1.0.0 @author longguizhi 2018-12-16 新建与整理 + */ +@AnAlias("AfterConstants") +public class AfterConstants +{ + /***************************************/ + // 售后状态部分 + /***************************************/ + private static final Map statusMap = new HashMap(); + private static final List statusList = new ArrayList(); + + /** 系统撤销 外部系统撤销 ***/ + public static final Int CS_F120 = new Int(-120, "系统撤销");// 外部系统撤销 + /** 申诉成功 **/ + public static final Int CS_F100 = new Int(-100, "申诉成功");// 申诉成功 + /** 未分配 未分配 责任 **/ + public static final Int CS_0 = new Int(0, "未分配");// 未分配 责任 + + /** 设计师有异议申诉 退回 **/ + public static final Int CS_100 = new Int(100, "异议申诉"); + /** 售后待审 **/ + public static final Int CS_200 = new Int(200, "售后待审"); + /** 售后处理中 **/ + public static final Int CS_300 = new Int(300, "售后处理中"); + /** 售后完结 **/ + public static final Int CS_400 = new Int(400, "售后完结"); + /** 申诉拒绝 **/ + public static final Int CS_500 = new Int(500, "申诉拒绝"); + + public static List getStatusList() + { + return statusList; + } + + /** 获取状态HTML 代码 **/ + public static String statusHtml(int status) + { + return statusMap.containsKey(status) ? statusMap.get(status) : ""; + } + + public static Int statusItem(int status) + { + for (Int item : statusList) + { + if (item.value() == status) + { + return item; + } + } + + return null; + } + + static + { + statusMap.clear(); + statusMap.put(CS_F120.value(), "" + + CS_F120.desc() + ""); + statusMap.put(CS_F100.value(), "" + + CS_F100.desc() + ""); + statusMap.put(CS_0.value(), "" + CS_0.desc() + + ""); + statusMap.put(CS_100.value(), "" + CS_100.desc() + + ""); + statusMap.put(CS_200.value(), "" + CS_200.desc() + + ""); + statusMap.put(CS_300.value(), "" + CS_300.desc() + + ""); + statusMap.put(CS_400.value(), "" + CS_400.desc() + + ""); + statusMap.put(CS_500.value(), "" + CS_500.desc() + + ""); + + statusList.clear(); + statusList.add(CS_F120); + statusList.add(CS_F100); + statusList.add(CS_0); + statusList.add(CS_100); + statusList.add(CS_200); + statusList.add(CS_300); + statusList.add(CS_400); + statusList.add(CS_500); + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/AwardedTypeConstants.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/AwardedTypeConstants.java new file mode 100644 index 0000000..9bf3e0b --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/AwardedTypeConstants.java @@ -0,0 +1,85 @@ +/** + * 扬彩印刷设计 + * 文件名 :AwardedType.java + * 创建人 :高佳新 + * 创建时间:2019-5-20 + */ + +package com.zhiqim.yangcai.design.constants; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; + +import com.zhiqim.yangcai.design.dbo.qc.QcAwardedType; + +/** + * + * 质检加分类型抽象数据提供类 + * + * @version 1.0 @author 高佳新 2019-5-20 新建与整理 + */ +@AnAlias("AwardedTypeConstants") +public class AwardedTypeConstants +{ + /** + * + * 质检加分类型列表 + * + * @author 高佳新 + * @return + * @throws Exception + */ + public static List getAwardedTypeList() throws Exception + { + List awardedTypeList = new ArrayList<>(); + QcAwardedType qcAwardedType; + StringBuffer awardedBuffer = new StringBuffer(); + awardedBuffer.append("select QC_TYPE_ID,QC_AWARDED_NAME,QC_SCORE from QC_AWARDED_TYPE"); + List awardedList; + String sql = awardedBuffer.toString(); + awardedList = ORM.get(ZSQL.class).executeQuery(sql); + for (LinkedMapSO awardedType : awardedList) + { + qcAwardedType = new QcAwardedType(); + qcAwardedType.setQcTypeId((Long) awardedType.get("QC_TYPE_ID")); + qcAwardedType.setQcAwardedName(String.valueOf(awardedType.get("QC_AWARDED_NAME"))); + qcAwardedType.setQcScore(((BigDecimal) awardedType.get("QC_SCORE")).doubleValue()); + awardedTypeList.add(qcAwardedType); + } + return awardedTypeList; + } + + /** + * + * 通过加分类型id获取名称 + * + * @author 高佳新 + * @param qcTypeId + * @return + */ + public static String getAwardedTypeId(long qcTypeId) + { + StringBuffer awardedBuffer = new StringBuffer(); + awardedBuffer.append("select QC_TYPE_ID,QC_AWARDED_NAME,QC_SCORE from QC_AWARDED_TYPE where QC_TYPE_ID = " + qcTypeId); + List awardedList; + try + { + awardedList = ORM.get(ZSQL.class).executeQuery(awardedBuffer.toString()); + for (LinkedMapSO awardedType : awardedList) + { + return String.valueOf(awardedType.get("QC_AWARDED_NAME")); + } + } + catch (Exception e) + { + e.printStackTrace(); + } + return ""; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/BaseConstants.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/BaseConstants.java new file mode 100644 index 0000000..1289f48 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/BaseConstants.java @@ -0,0 +1,143 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.constants; + +import org.zhiqim.kernel.annotation.AnAlias; + +/** + * 常用常量 + * + * @author zhouwenbin + * + */ +@AnAlias("BaseConstants") +public class BaseConstants +{ + + // 线下付款类型 + /** 线下付款类型 */ + + /** 现金支付 */ + public static int PAYMENT_TYPE_CASH = 1; // 现金支付 + + /** 支付宝转账 */ + public static int PAYMENT_TYPE_ALIPAY = 2; // 支付宝转账 + + /** 微信转账 */ + public static int PAYMENT_TYPE_WECHAT = 3; // 微信转账 + + /** 银行转账 */ + public static int PAYMENT_TYPE_BLANK = 4; // 银行卡转账 + + /** 转账客户账号 */ + public static String TRANSFER_ACCOUNTS = "转账客户"; // 转账客户; + /** 售后客户账号 */ + public static String TRANSFER_AFS_ACCOUNTS = "售后客户"; // 售后客户; + /** 寄存单所属店铺、寄存客户 */ + public static String CONSIGN_ACCOUNTS = "寄存客户"; // 寄存客户; + /** 微商拓展 */ + public static String WEISHANG_ACCOUNTS = "微商拓展"; // 微商拓展; + + /** 售前部门ID */ + public static long DEPT_ID_PRESALE = 1708182010080003L; // 客服部门ID + + /** 设计部门ID */ + public static long DEPT_ID_DESIGN = 1708182010230004L; // 设计部门ID; + + /** 设计助理部门ID */ + public static long DEPT_ID_ASSISTANT = 1709041736040001L; // 设计助理部门ID; + + /** 督导组ID */ + public static long DEPT_ID_SUPERVISION = 1709121557500001L; // 督导组; + + /** 仓库组 */ + public static long DEPT_ID_STORE = 1709051550440002L; // 仓库组; + + /** 印前部 */ + public static long DEPT_ID_BEFORE = 1803011802247667L; // 印前部; + + // -----SYS_FIELD表中的FIELD_CAT字段对应常量 ----------- + public static String ROCS = "rocs"; // 客服等级参数键 + + /** 售后问题类型 */ + public static String FIELD_AFTER_QUESTION = "售后问题类型"; + + /** 售后处理方式 */ + public static String FIELD_AFTER_METHOD = "售后处理方式"; + + /** 责任部门 */ + public static String FIELD_DUTY = "责任部门"; + + /** 售后类型 */ + public static String FIELD_AFTER_TYPE = "售后类型"; + + /** 售后类型组 */ + public static String FIELD_AFTER_TYPE_GROUP = "FIELD_AFTER_TYPE_GROUP"; + + /** 字段公共组 */ + public static String FIELD_COM = "FIELD_COM"; + + /** 处理方案 */ + public static String FIELD_HANDLE = "处理方案"; + + /** 后加工类型 */ + public static String FIELD_POLICY_TYPE = "后加工类型"; + + /** 订单来源,0:原订单 */ + public static int ORDER_SRC_0 = 0; + + /** 订单来源,1:补印单 */ + public static int ORDER_SRC_1 = 1; + + /** 订单来源,2:赠送单 */ + public static int ORDER_SRC_2 = 2; + + /** 订单来源,3:微商订单 */ + public static int ORDER_SRC_3 = 3; + + /** 订单来源,4:免费赠送订单 */ + public static int ORDER_FEE_4 = 4; + + /* 产品类型id */ + /** 名片 */ + public static final long CARD_ID = 1L; + + /** 彩页 */ + public static final long COLOR_PAGE_ID = 2L; + + /** 画册 */ + public static final long ALBUM_ID = 3L; + + public static final long PICTURE_ALBUM = 3; // 产品类型画册id; + + /** 展架 */ + public static final long RACK_ID = 4L; + + /** 不干胶 */ + public static final long STICK_ID = 5245L; + + /** 喷绘 */ + public static final long PENHUI_ID = 13879L; + + /** 联单 */ + public static final long SINGLE_ID = 5244L; + + /** 条幅 */ + public static final long BANNERS_ID = 174928L; + + /** 运营平台配置中心数据字典:行业数据配置keycode */ + public static final String INDUSTRY_DIC_KEY_CODE = "industry_type"; + + /** 运营平台配置中心数据字典:标签维度数据配置keycode */ + public static final String DIMENSION_DIC_KEY_CODE = "industry_dimension"; + + /** 运营平台配置中心数据字典:客户类型数据配置keycode */ + public static final String CUSTOMER_TYPE_KEY_CODE = "customer_type"; +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/ComplainConstants.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/ComplainConstants.java new file mode 100644 index 0000000..79dc771 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/ComplainConstants.java @@ -0,0 +1,96 @@ +/** + * 扬彩印刷设计 + * 文件名 :ComplainConstants.java + * 创建人 :gjx + * 创建时间:2019-8-10 + */ +package com.zhiqim.yangcai.design.constants; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.consts.Str; + +/** + * 投诉状态 + * + * @version 1.0 @author gjx 2019-8-10 新建与整理 + */ +@AnAlias("ComplainConstants") +public class ComplainConstants +{ + public static Map statusHtmlMap = new LinkedHashMap<>(); + public static Map statusMap = new LinkedHashMap<>(); + + /** 状态:投诉处理中 */ + public static final Str TX_10 = new Str("10", "处理中"); + /** 状态:投诉待确认 */ + public static final Str TX_20 = new Str("20", "待完结"); + /** 状态:投诉退回 */ + public static final Str TX_30 = new Str("30", "投诉退回"); + /** 状态:投诉完结 */ + public static final Str TX_40 = new Str("40", "投诉完结"); + + static + { + statusMap.clear(); + statusHtmlMap.clear(); + statusHtmlMap.put(TX_10.value(), "" + TX_10.desc() + + ""); + statusHtmlMap.put(TX_20.value(), "" + TX_20.desc() + + ""); + statusHtmlMap.put(TX_30.value(), "" + TX_30.desc() + + ""); + statusHtmlMap.put(TX_40.value(), "" + TX_40.desc() + + ""); + statusMap.put(TX_10.value(), TX_10); + statusMap.put(TX_20.value(), TX_20); + statusMap.put(TX_30.value(), TX_30); + statusMap.put(TX_40.value(), TX_40); + } + + public static List getList() + { + List list = new ArrayList<>(); + for (Str str : statusMap.values()) + { + list.add(str); + } + return list; + + } + + public static String getStatus(String key) + { + if (!statusHtmlMap.containsKey(key)) + { + return ""; + + } + return statusHtmlMap.get(key); + } + + public static String getDesc(String key) + { + if (!statusMap.containsKey(key)) + { + return ""; + + } + return statusMap.get(key).desc(); + } + + public static Str item(String key) + { + + if (!statusMap.containsKey(key)) + { + return null; + + } + return statusMap.get(key); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/DesignerWorkStatus.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/DesignerWorkStatus.java new file mode 100644 index 0000000..0f801e8 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/DesignerWorkStatus.java @@ -0,0 +1,21 @@ +package com.zhiqim.yangcai.design.constants; + +/**** + * 设计师上班状态 + * + * @version v1.0.0 @author longguizhi 2018-12-10 新建与整理 + */ +public class DesignerWorkStatus +{ + /** 已经登录服务器 **/ + public static final int LOGIN_ED = 0;// 已经登录系统 + + /** 正在上班, 接单中 **/ + public static final int ON_DUTY = 1;// 正在上班, 接单中 + + /** 停止接单, 下班 **/ + public static final int OFF_DUTY = 2;// 停止接单, 下班 + + /** 退出浏览器 **/ + public static final int LOGOUT = 3;// 退出浏览器 +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/DraftConstants.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/DraftConstants.java new file mode 100644 index 0000000..bfd10ca --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/DraftConstants.java @@ -0,0 +1,83 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.constants; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.consts.Int; + +/** + * 稿件类型常量 + * + * @version v1.0.0 @author zhouwenbin 2017-8-4 新建与整理 + */ +@AnAlias("DraftConstants") +public class DraftConstants +{ + /** 标准自来稿 */ + public static Int DRAFT_STANDARD = new Int(0, "标准自来稿"); + + /** 改稿自来稿 */ + public static Int DRAFT_TEMPLATE = new Int(1, "改稿自来稿"); + + /** 普通设计 */ + public static Int DRAFT_COMMON_DESIGN = new Int(2, "普通设计"); + + /** 资深设计,折页设计 */ + public static Int DRAFT_PAGE_DESIGN = new Int(3, "资深设计"); + + /** 现货 */ + public static Int DRAFT_ACTUALS = new Int(4, "现货"); + + private static List draftList = new ArrayList<>(); + static + { + draftList.add(DRAFT_STANDARD); + draftList.add(DRAFT_TEMPLATE); + draftList.add(DRAFT_COMMON_DESIGN); + draftList.add(DRAFT_PAGE_DESIGN); + draftList.add(DRAFT_ACTUALS); + } + + public static List getList() + { + return draftList; + } + + public static String get(int key) + { + for (Int draft : draftList) + { + if (draft.value() == key) + { + return draft.desc(); + } + } + + return ""; + } + + public static Int getTypeItem(int key) + { + for (Int draft : draftList) + { + if (draft.value() == key) + { + return draft; + } + } + return null; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/EventConstants.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/EventConstants.java new file mode 100644 index 0000000..bcf0344 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/EventConstants.java @@ -0,0 +1,149 @@ +package com.zhiqim.yangcai.design.constants; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.consts.Int; + +/** + * 事件类型常量 + * + * @version v1.0.0 @author Deng 2017-10-11 新建与整理 + */ + +@AnAlias("EventConstants") +public class EventConstants +{ + /** 订单取消 */ + public static final Int ORDER_F10 = new Int(-10, "订单取消"); + + /** 订单状态, 已设计取消(由于设计原因 产生的重新设计单) */ + public static final Int ORDER_F20 = new Int(-20, "已设计取消"); + + /** 印前退回 */ + public static final Int ORDER_F30 = new Int(-30, "印前退回"); + + /** 订单退回组织 */ + public static final Int ORDER_F40 = new Int(-40, "订单退回组织"); + + /** 订单退回erp */ + public static final Int ORDER_F50 = new Int(-50, "退回ERP"); + + /** 订单未分拣 */ + public static final Int ORDER_1 = new Int(1, "订单未分拣"); + + /** 订单分拣完成 */ + public static final Int ORDER_2 = new Int(2, "等待设计"); + + /** 订单正在设计 */ + public static final Int ORDER_3 = new Int(3, "订单正在设计"); + + /** 请求主管支援 */ + public static final Int ORDER_4 = new Int(4, "主管支援"); + + /** 请求退款 */ + public static final Int ORDER_5 = new Int(5, "请求退款"); + + /** 暂停设计 */ + public static final Int ORDER_6 = new Int(6, "补全资料"); + + /** 订单已初稿 */ + public static final Int ORDER_7 = new Int(7, "订单已初稿"); + + /** 订单初稿被领取 */ + public static final Int ORDER_8 = new Int(8, "订单初稿被领取"); + + /** 订单已定稿 */ + public static final Int ORDER_9 = new Int(9, "订单已定稿"); + + /** 订单印前审核退回 */ + public static final Int ORDER_10 = new Int(10, "订单审核退回"); + + /** 订单审核通过 */ + public static final Int ORDER_11 = new Int(11, "订单审核通过"); + + /** 订单状态, 已审-文件OSS 上传中 */ + public static final Int ORDER_12 = new Int(12, "正在存储中"); + + /** 订单初稿审核退回 */ + public static final Int ORDER_13 = new Int(13, "订单审核退回"); + + /** 订单定稿审核退回 */ + public static final Int ORDER_14 = new Int(14, "订单审核退回"); + + /** 订单状态, 已审-准备印刷(等待下单) */ + public static final Int ORDER_15 = new Int(15, "设计完成");// 等待创建 下单发货 订单及文件下载中(已上传到OSS) + + /** 文件审核 */ + public static final Int ORDER_16 = new Int(16, "文件审核"); + + /** 售后补单 */ + public static final Int ORDER_17 = new Int(17, "售后补单"); + + /** 订单信息修改 */ + public static final Int ORDER_20 = new Int(20, "订单信息修改"); + + /** 提交选版 */ + public static final Int ORDER_21 = new Int(21, "提交选版"); + + /** 提交排版 */ + public static final Int ORDER_22 = new Int(22, "提交排版"); + + /** 退回排版 */ + public static final Int ORDER_23 = new Int(23, "退回排版"); + + /** 创建自来稿订单 */ + public static final Int ORDER_24 = new Int(24, "创建自来稿订单"); + + /** 取消自来稿订单 */ + public static final Int ORDER_25 = new Int(25, "取消自来稿订单"); + + /** 历史取消自来稿订单 */ + public static final Int ORDER_26 = new Int(26, "历史取消自来稿订单"); + + /** 自来稿已领取 */ + public static final Int ORDER_27 = new Int(27, "自来稿已领取"); + + /** 自来稿已定稿 */ + public static final Int ORDER_28 = new Int(28, "自来稿已定稿"); + + /** 自来稿被领取 */ + public static final Int ORDER_29 = new Int(29, "自来稿被领取"); + + /** 创建设计订单 */ + public static final Int ORDER_30 = new Int(30, "创建设计订单"); + + /** 标签修改 */ + public static final Int ORDER_31 = new Int(31, "标签修改"); + + /** 工厂排产退回 */ + public static final Int ORDER_32 = new Int(32, "工厂排产退回"); + + /** 客服手动退回订单 */ + public static final Int ORDER_33 = new Int(33, "客服手动退回订单"); + + /** 订单催稿 */ + public static final Int ORDER_34 = new Int(34, "订单催稿"); + + /** 考核素材上传 */ + public static final Int ORDER_35 = new Int(35, "客户素材上传"); + + /** 设计师考核设计文件上传 */ + public static final Int ORDER_36 = new Int(36, "设计师考核设计文件上传"); + + /** 设计师考核印刷文件上传 */ + public static final Int ORDER_37 = new Int(37, "设计师考核印刷文件上传 "); + + /** 设计师放弃订单 */ + public static final Int ORDER_38 = new Int(38, "设计师放弃订单"); + /** 退款订单审核通过 */ + public static final Int ORDER_39 = new Int(39, "退款订单审核通过"); + /** 退款订单审核驳回 */ + public static final Int ORDER_40 = new Int(40, "退款订单审核驳回"); + /** 设计单价重算 */ + public static final Int ORDER_41 = new Int(41, "设计单价重算"); + /** 订单单价修改 */ + public static final Int ORDER_42 = new Int(42, "订单单价修改"); + /** 订单加急费修改 */ + public static final Int ORDER_43 = new Int(43, "订单加急费修改"); + /** 修改订单售后赔付比 */ + public static final Int ORDER_44 = new Int(44, "修改订单售后赔付比"); +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/FileTypeConstants.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/FileTypeConstants.java new file mode 100644 index 0000000..68d2b95 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/FileTypeConstants.java @@ -0,0 +1,142 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.constants; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.consts.Str; + +/** + * 文件路径常量类 + * + * @version v1.0.0 @author zhouwenbin 2017-8-8 新建与整理 + */ +@AnAlias("FileTypeConstants") +public class FileTypeConstants +{ + /** 客户素材 */ + public static final Str FILE_CUSTOM = new Str("CustomFile", "客户素材"); + + /** 模板文件 */ + public static final Str FILE_TEMPLATE = new Str("TemplateFile", "模板文件"); + + /** 设计文件 */ + public static final Str FILE_DESGIN = new Str("DesginFile", "设计文件"); + + /** 印刷文件 */ + public static final Str FILE_END = new Str("EndFile", "印刷文件"); + + public static final Str FILE_TBZ = new Str("TbzFile", "编辑器文件"); + + /** 定稿凭证 */ + public static final Str END_VOUCHER = new Str("EndVoucher", "定稿凭证"); + + /** 初稿缩略图 */ + public static final Str FILE_FIRSTTHUMFILE = new Str("FristThumFile", "初稿缩略图"); + + /** 缩略图 */ + public static final Str FILE_THUMFILE = new Str("ThumFile", "缩略图"); + + /** 后加工文件 */ + public static final Str FILE_WORK = new Str("WorkFile", "后加工文件"); + + /** 退款申诉截图 **/ + public static final Str FILE_COMPLAINT = new Str("ComplaintFile", "退款申诉截图"); + + /** 质检违规凭证 **/ + public static final Str FILE_QC_JUDGE = new Str("QcJudgeFile", "质检违规凭证"); + + /** 质检加分凭证 **/ + public static final Str FILE_QC_APPLY = new Str("QcApplyScoreFile", "质检加分凭证"); + + /** 审核退回图片 */ + public static final Str FILE_CHECK_BACK = new Str("CheckBackFile", "审核退回图"); + + /*******************************/ + // 售后部分 + /*******************************/ + /** 售后文件 */ + public static final Str FILE_AFTERSALE = new Str("AftersaleFile", "售后文件"); + + /** 售后申诉凭证文件 */ + public static final Str FILE_AFTE_COMPLAIN_EVIDENCE = new Str("AfterComplainEvidenceFile", "申诉凭证"); + + /** 申请退款截图 */ + public static final Str FILE_REFUND = new Str("ApplyRefundFile", "申请退款截图"); + + /** 投诉单完结图片 */ + public static final Str FILE_COMPLAIN_END = new Str("ComplainEnd", "投诉单完结图"); + + public static Map fileMap = new LinkedHashMap<>(); + + static + { + fileMap.put(FILE_CUSTOM.value(), FILE_CUSTOM); + fileMap.put(FILE_DESGIN.value(), FILE_DESGIN); + fileMap.put(FILE_END.value(), FILE_END); + fileMap.put(FILE_FIRSTTHUMFILE.value(), FILE_FIRSTTHUMFILE); + fileMap.put(FILE_THUMFILE.value(), FILE_THUMFILE); + fileMap.put(FILE_WORK.value(), FILE_WORK); + fileMap.put(FILE_TBZ.value(), FILE_TBZ); + fileMap.put(FILE_TEMPLATE.value(), FILE_TEMPLATE); + fileMap.put(FILE_COMPLAINT.value(), FILE_COMPLAINT); + + fileMap.put(FILE_QC_JUDGE.value(), FILE_QC_JUDGE); + fileMap.put(FILE_QC_APPLY.value(), FILE_QC_APPLY); + + fileMap.put(FILE_CHECK_BACK.value(), FILE_CHECK_BACK); + fileMap.put(FILE_AFTERSALE.value(), FILE_AFTERSALE); + fileMap.put(FILE_AFTE_COMPLAIN_EVIDENCE.value(), FILE_AFTE_COMPLAIN_EVIDENCE); + fileMap.put(FILE_REFUND.value(), FILE_REFUND); + fileMap.put(FILE_COMPLAIN_END.value(), FILE_COMPLAIN_END); + } + + public static List getFileTypeList() + { + List list = new ArrayList(); + for (Str str : fileMap.values()) + { + list.add(str); + } + + return list; + } + + public static boolean isExist(String fileType) + { + return fileMap.containsKey(fileType); + } + + public static Str get(String fileType) + { + if (fileMap.containsKey(fileType)) + { + return fileMap.get(fileType); + } + + return null; + } + + public static String getName(String fileType) + { + if (fileMap.containsKey(fileType)) + { + return fileMap.get(fileType).desc(); + } + + return ""; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/MessageThemeConstants.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/MessageThemeConstants.java new file mode 100644 index 0000000..d973fcf --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/MessageThemeConstants.java @@ -0,0 +1,70 @@ +/** + * 扬彩印刷设计 + * 文件名 :MessageThemeConstants.java + * 创建人 :gjx + * 创建时间:2020年8月15日 +*/ + +package com.zhiqim.yangcai.design.constants; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Str; + +/** + * + * [简要描述]: 业务消息主题
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年8月15日 新建与整理 + */ +@AnAlias("MessageThemeConstants") +public class MessageThemeConstants +{ + /** 订单催稿/定稿 */ + public static Str MSG_ORDER_REMINDER = new Str("orderReminder", "订单催稿/定稿"); + + /** 更换/指定设计师/订单加急 */ + public static Str MSG_CHANGE_DESIGNER = new Str("changeDesigner", "更换/指定设计师/订单加急"); + + /** 订单审核/排产退回 */ + public static Str MSG_ORDER_RETURN = new Str("orderReturn", "订单审核/排产退回"); + + public static Str PLATFORM_TYPE_DESIGN = new Str("DESIGN", "设计平台"); + public static Str PLATFORM_TYPE_ERP = new Str("ERP", "ERP"); + public static Str PLATFORM_TYPE_CONSIGNMENT = new Str("CONSIGNMENT", "发货平台"); + + public static final List topicList = new ArrayList(); + static + { + topicList.add(MSG_ORDER_REMINDER); + topicList.add(MSG_CHANGE_DESIGNER); + topicList.add(MSG_ORDER_RETURN); + } + + public static List getTopicList() + { + return topicList; + } + + /** 获取名称 */ + public static String getName(String value) + { + if (Validates.isEmpty(value)) + { + return ""; + } + for (Str str : topicList) + { + if (value.equalsIgnoreCase(str.value())) + { + return str.desc(); + } + } + return ""; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/StatusConstants.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/StatusConstants.java new file mode 100644 index 0000000..99ada50 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/constants/StatusConstants.java @@ -0,0 +1,151 @@ +package com.zhiqim.yangcai.design.constants; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.consts.Int; + +@AnAlias("StatusConstants") +public class StatusConstants +{ + private static List statusList = new ArrayList(); + private static Map statusTextMap = new HashMap(); + private static Map statusMap = new HashMap(); + + /** 订单状态, 已完结(滞留单场景) */ + public static final Int ORDER_F130 = new Int(-130, "已完结"); + + /** 订单状态, 已设计取消(由于设计原因产生) */ + public static final Int ORDER_F110 = new Int(-110, "已设计取消"); + + /** 订单状态, 已取消 */ + public static final Int ORDER_F100 = new Int(-100, "已取消"); + + /** 订单状态, 未分拣 (等待分拣到组织) */ + public static final Int ORDER_10 = new Int(10, "未分拣"); + + /** 订单状态, 等待设计(已分拣到组织,等待分派到设计师) */ + public static final Int ORDER_20 = new Int(20, "等待设计"); + + /** 订单状态, 正在设计 */ + public static final Int ORDER_30 = new Int(30, "正在设计"); + + /** 订单状态, 请求退款 */ + public static final Int ORDER_34 = new Int(34, "请求退款"); + + /** 订单状态, 暂停设计 */ + public static final Int ORDER_36 = new Int(36, "补全资料"); + + /** 订单状态, 联系不上 */ + public static final Int ORDER_37 = new Int(37, "联系不上"); + + /** 订单状态, 初稿待审 */ + public static final Int ORDER_40 = new Int(40, "初稿待审"); + + /** 订单状态, 已初稿 */ + public static final Int ORDER_50 = new Int(50, "已初稿"); + + /** 订单状态, 定稿待审 */ + public static final Int ORDER_52 = new Int(52, "定稿待审"); + + /** 订单状态, 已定稿(等待印前审核) */ + public static final Int ORDER_55 = new Int(55, "已定稿"); + + /** 订单状态, 印前已审核(等待成品文件上传oss) */ + public static final Int ORDER_60 = new Int(60, "已审核"); + + /** 订单状态, 成品文件上传OSS中 */ + public static final Int ORDER_62 = new Int(62, "云端存储"); + + /** 订单状态, 设计完成(文件上传oss,准备下单印刷) */ + public static final Int ORDER_70 = new Int(70, "设计完成"); + + static + { + statusList.add(ORDER_10); + statusList.add(ORDER_20); + statusList.add(ORDER_30); + statusList.add(ORDER_34); + statusList.add(ORDER_36); + statusList.add(ORDER_37); + statusList.add(ORDER_40); + statusList.add(ORDER_50); + statusList.add(ORDER_52); + statusList.add(ORDER_55); + statusList.add(ORDER_60); + statusList.add(ORDER_62); + statusList.add(ORDER_70); + statusList.add(ORDER_F110); + statusList.add(ORDER_F100); + + for (Int item : statusList) + { + statusMap.put(item.value(), item); + } + + statusTextMap.put(ORDER_F130.value(), "
            " + ORDER_F130.desc() + "
            "); + statusTextMap.put(ORDER_F110.value(), "
            " + ORDER_F110.desc() + "
            "); + statusTextMap.put(ORDER_F100.value(), "
            " + ORDER_F100.desc() + "
            "); + statusTextMap.put(ORDER_10.value(), "
            " + ORDER_10.desc() + "
            "); + statusTextMap.put(ORDER_20.value(), "
            " + ORDER_20.desc() + "
            "); + statusTextMap.put(ORDER_30.value(), "
            " + ORDER_30.desc() + "
            "); + statusTextMap.put(ORDER_34.value(), "
            " + ORDER_34.desc() + "
            "); + statusTextMap.put(ORDER_36.value(), "
            " + ORDER_36.desc() + "
            "); + statusTextMap.put(ORDER_37.value(), "
            " + ORDER_37.desc() + "
            "); + statusTextMap.put(ORDER_40.value(), "
            " + ORDER_40.desc() + "
            "); + statusTextMap.put(ORDER_50.value(), "
            " + ORDER_50.desc() + "
            "); + statusTextMap.put(ORDER_52.value(), "
            " + ORDER_52.desc() + "
            "); + statusTextMap.put(ORDER_55.value(), "
            " + ORDER_55.desc() + "
            "); + statusTextMap.put(ORDER_60.value(), "
            " + ORDER_60.desc() + "
            "); + statusTextMap.put(ORDER_62.value(), "
            " + ORDER_62.desc() + "
            "); + statusTextMap.put(ORDER_70.value(), "
            " + ORDER_70.desc() + "
            "); + + } + + /** + * 获取订单状态 + * + * @param status + * @return + */ + public static String getStatus(int status) + { + if (statusTextMap.containsKey(status)) + { + return statusTextMap.get(status); + } + else + { + return ""; + } + } + + /** + * 获取订单状列表 + * + * @param status + * @return + */ + public static List getOrderStatusList() + { + return statusList; + } + + /** 获取状态 */ + public static Int getOrderStatusItem(int status) + { + for (Int Int : statusList) + { + if (Int.value() == status) + { + return Int; + } + } + + return new Int(0, ""); + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/BuyerDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/BuyerDao.java new file mode 100644 index 0000000..2f89c7a --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/BuyerDao.java @@ -0,0 +1,100 @@ +/* + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ + +package com.zhiqim.yangcai.design.dao; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.user.BuyerUser; + +/*** + * 买家相关 + * + * @version v1.0.0 @author lgz 2019-3-29 新建与整理 + */ +@AnAlias("BuyerDao") +public class BuyerDao +{ + /*** + * 获取买家 购买次数 + * + * @param buyerCode + * @return + */ + public static int getOrderCount(String buyerCode) throws Exception + { + if (Validates.isEmptyBlank(buyerCode)) + { + return 0; + } + + BuyerUser user = getBuyerUser(buyerCode); + return user == null ? 0 : user.getOrderCount(); + } + + /**** + * 获取购买用户 + * + * @param buyerCode + * @return + * @throws Exception + */ + public static BuyerUser getBuyerUser(String buyerCode) throws Exception + { + if (Validates.isEmptyBlank(buyerCode)) + { + return null; + } + + return ORM.get(ZTable.class).item(BuyerUser.class, new Selector("buyerCode", buyerCode)); + } + + /**** + * 添加或者修改买家购买次数 + * + * @param buyerCode + * @return 返回 购买次数 + * @throws Exception + */ + public static int doAddOrUpdateOrderCount(String buyerCode, int orderCount) throws Exception + { + if (Validates.isEmptyBlank(buyerCode)) + { + return orderCount; + } + + BuyerUser user = getBuyerUser(buyerCode); + if (user == null) + {// 添加 + user = new BuyerUser(); + user.setOrderCount(orderCount); + user.setBuyerCode(buyerCode); + ORM.get(ZTable.class).insert(user); + + return orderCount; + } + else + {// 修改 + + int count = orderCount + user.getOrderCount(); + Updater updater = new Updater(); + updater.addMust("buyerCode", buyerCode); + updater.addField("orderCount", count); + + ORM.get(ZTable.class).update(BuyerUser.class, updater); + return count; + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/DesignOrderMeritsDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/DesignOrderMeritsDao.java new file mode 100644 index 0000000..78a6030 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/DesignOrderMeritsDao.java @@ -0,0 +1,49 @@ +package com.zhiqim.yangcai.design.dao; + +import java.sql.SQLException; + +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.design.dbo.order.DesignOrderMerits; + +public class DesignOrderMeritsDao { + /** + * 记录订单操作日志 + * + * @author caohong + * @param designId 订单id + * @param type 类型 + * @param oldData 老数据 + * @param newData 新数据 + * @param addUser 操作人 + * @throws ORMException + * @throws SQLException + */ + public static void saveDesignOrderMerits(long designId, String type, String oldData, String newData, String addUser, String designer, long typeId, + int status, String orderText, long oldPrice, long newPrice) + throws ORMException, SQLException + { + if(null == designer || "".equals(designer)) { + designer = "修改时无设计师"; + } + DesignOrderMerits designOrderMerits = new DesignOrderMerits(); + designOrderMerits.setMeritsId(Ids.longId()); + designOrderMerits.setDesignId(designId); + designOrderMerits.setType(type); + designOrderMerits.setOldData(oldData); + designOrderMerits.setNewData(newData); + designOrderMerits.setOldPrice(oldPrice); + designOrderMerits.setNewPrice(newPrice); + designOrderMerits.setAddUser(addUser); + designOrderMerits.setAddTime(Sqls.nowTimestamp()); + designOrderMerits.setDesigner(designer); + designOrderMerits.setTypeId(typeId); + designOrderMerits.setStatus(status); + designOrderMerits.setOrderText(orderText); + ORM.get(ZTable.class).insert(designOrderMerits); + } +} \ No newline at end of file diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/DesignSizeDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/DesignSizeDao.java new file mode 100644 index 0000000..22503a6 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/DesignSizeDao.java @@ -0,0 +1,132 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dao; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.design.DesignSize; + +/*** + * + * 设计 尺寸 数据访问dao + * + * @version v1.0.0 @author longguizhi 2018-9-4 新建与整理 + */ +@AnAlias("DesignSizeDao") +public class DesignSizeDao +{ + public static DesignSize get(long sizeId) throws Exception + { + if (sizeId <= 0) + return null; + + return ORM.get(ZTable.class).item(DesignSize.class, sizeId); + } + + public static DesignSize get(long designType, double sizeWidth, double sizeHeight) throws Exception + { + if (designType <= 0 || sizeWidth <= 0 || sizeHeight <= 0) + return null; + + return ORM.get(ZTable.class).item(DesignSize.class, + new Selector("typeId", designType).addMust("sizeWidth", sizeWidth).addMust("sizeHeight", sizeHeight)); + + } + + public static DesignSize get(long designType, double sizeWidth, double sizeHeight, double sizeSide) throws Exception + { + // yixin 2019-06-06 侧边长度为0则走原来流程 + if (sizeSide == 0) + { + return get(designType, sizeWidth, sizeHeight); + } + if (designType <= 0 || sizeWidth <= 0 || sizeHeight <= 0) + return null; + + return ORM.get(ZTable.class).item(DesignSize.class, + new Selector("typeId", designType).addMust("sizeWidth", sizeWidth).addMust("sizeHeight", sizeHeight).addMust("sizeSide", sizeSide)); + + } + + /**** + * 获取行业名称 + * + * @param industryId + * @return + * @throws Exception + */ + public static String name(long sizeId) throws Exception + { + DesignSize item = get(sizeId); + return name(item); + } + + private static String name(DesignSize item) + { + return item == null ? "" : item.getSizeWidth() + "x" + item.getSizeHeight() + "mm"; + } + + /**** + * 获取 尺寸名 + 出血 + * + * 例: 90x54mm 出血: 2.12mm + * + * @param designType + * @param sizeWidth + * @param sizeHeight + * @return + * @throws Exceptio + */ + public static String name_bleed(long designType, double sizeWidth, double sizeHeight) throws Exception + { + DesignSize item = get(designType, sizeWidth, sizeHeight); + if (item == null) + return ""; + + return name(item) + " 出血:" + item.getSizeBleed() + " mm"; + } + + /*** + * 获取所有 类型列表 + * + * @return + * @throws Exception + */ + public static List listAll() throws Exception + { + return ORM.get(ZTable.class).list(DesignSize.class, new Selector().addOrderbyAsc("sizeSeq")); + } + + /*** + * 获取可用 类型列表 + * + * @return + * @throws Exception + */ + public static List list() throws Exception + { + List itemList = new ArrayList(); + + for (DesignSize item : listAll()) + { + if (item.getSizeStatus() == 0) + itemList.add(item); + } + + return itemList; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/DesignTypeDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/DesignTypeDao.java new file mode 100644 index 0000000..95f8f3a --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/DesignTypeDao.java @@ -0,0 +1,180 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dao; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.design.DesignType; + +/**** + * 设计订单类型 数据访问dao + * + * @version v1.0.0 @author longguizhi 2018-9-4 新建与整理 + */ +@AnAlias("DesignTypeDao") +public class DesignTypeDao +{ + + /**** + * 查询 订单类型 + * + * @param ordTypeId + * @return + * @throws Exception + */ + public static DesignType get(long designType) throws Exception + { + if (designType <= 0) + { + return null; + } + + DesignType item = ORM.get(ZTable.class).item(DesignType.class, designType); + return item; + } + + /**** + * *获取类型名称 + * + * @param industryId + * @return + * @throws Exception + */ + public static String name(long designType) throws Exception + { + DesignType item = get(designType); + + return item == null ? "" : item.getTypeName(); + } + + /*** + * *获取所有 类型列表 + * + * @return + * @throws Exception + */ + public static List listAll() throws Exception + { + return ORM.get(ZTable.class).list(DesignType.class, new Selector().addOrderbyAsc("typeSeq")); + } + + /*** + ** 获取模板产品类型列表 + * + * @return + * @throws Exception + */ + public static List listTemmplate() throws Exception + { + String[] showTypeArr = + { + "普通名片", "彩页", "代金券", "PVC名片", "透明PVC", "特种纸名片", "LOGO设计", "体验券", "售后卡", "积分卡", "外卖卡", "门票", "抽奖券", "合格证", "保修卡", "邀请函", "停车卡" + }; + return ORM.get(ZTable.class).list(DesignType.class, new Selector().addMustIn("typeName", showTypeArr).addOrderbyAsc("typeSeq")); + } + + /*** + * *获取可用 类型列表 + * + * @return + * @throws Exception + */ + public static List list() throws Exception + { + List itemList = new ArrayList(); + + for (DesignType item : listAll()) + { + if (item.isEnabled()) + { + itemList.add(item); + } + } + + return itemList; + } + + /*** + * 获取可用 类型列表 + * + * @return //画册排在第一个 + * @throws Exception + */ + public static List listByPicture() throws Exception + { + List itemList = new ArrayList(); + + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("select * from design_type dt order BY dt.TYPE_ID=3 desc"); + List list = ORM.get(ZSQL.class).executeQuery(stringBuffer.toString(), DesignType.class); + + for (DesignType item : list) + { + if (item.isEnabled()) + { + itemList.add(item); + } + } + + return itemList; + } + + /** 获取类型 map格式 */ + public static Map map() throws Exception + { + Map map = new LinkedHashMap<>(); + List list = list(); + for (DesignType industry : list) + { + map.put(industry.getTypeId(), industry); + } + + return map; + } + + /** 获取所有类型 map格式 */ + public static Map mapAll() throws Exception + { + Map map = new LinkedHashMap<>(); + List list = listAll(); + for (DesignType industry : list) + { + map.put(industry.getTypeId(), industry); + } + + return map; + } + + /*** + * 获取初稿时效统计列表要展示的产品类型列表 + * + * @return + * @throws Exception + */ + public static List listDraftOrderTimelinessShowType() throws Exception + { + String[] showTypeArr = + { + "名片", "彩页", "优惠券", "PVC名片", "透明PVC名片", "不干胶", "精品特种纸", "会员卡", "展架" + }; + return ORM.get(ZTable.class).list(DesignType.class, new Selector().addMustIn("typeName", showTypeArr)); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/IndustryDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/IndustryDao.java new file mode 100644 index 0000000..357c29f --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/IndustryDao.java @@ -0,0 +1,107 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dao; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; + +/*** + * + * 设计 行业 数据访问dao + * + * @version v1.0.0 @author longguizhi 2018-9-4 新建与整理 + */ +@AnAlias("IndustryDao") +public class IndustryDao +{ + public static DesignIndustry get(long industryId) throws Exception + { + if (industryId <= 0) + return null; + DesignIndustry item = ORM.get(ZTable.class).item(DesignIndustry.class, industryId); + return item; + } + + /**** + * 获取行业名称 + * + * @param industryId + * @return + * @throws Exception + */ + public static String name(long industryId) throws Exception + { + DesignIndustry item = get(industryId); + + return item == null ? "" : item.getIndustryName(); + } + + + /*** + * 获取所有 类型列表 + * @return + * @throws Exception + */ + public static List listAll() throws Exception + { + return ORM.get(ZTable.class).list(DesignIndustry.class, new Selector().addOrderbyAsc("industrySeq")); + } + + /*** + * 获取可用 类型列表 + * @return + * @throws Exception + */ + public static List list() throws Exception + { + List itemList = new ArrayList(); + + for (DesignIndustry item : listAll()) + { + if (item.isEnabled()) + itemList.add(item); + } + + return itemList; + } + + /**获取行业 map格式*/ + public static Map map() throws Exception + { + Map map = new LinkedHashMap<>(); + List list = list(); + for (DesignIndustry industry : list) + map.put(industry.getIndustryId(), industry); + + return map; + } + + /**获取所有行业 map格式*/ + public static Map mapAll() throws Exception + { + Map map = new LinkedHashMap<>(); + List list = listAll(); + for (DesignIndustry industry : list) + map.put(industry.getIndustryId(), industry); + + return map; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/MerchantDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/MerchantDao.java new file mode 100644 index 0000000..8a8b866 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/MerchantDao.java @@ -0,0 +1,38 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dao; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; + +/*** + * 订单商户访问 数据 dao + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +@AnAlias("MerchantDao") +public class MerchantDao +{ + /*** + * 通过 商户编号 获取商户 + * @param merchantId + * @return + * @throws Exception + */ + public static DesignMerchant get(long merchantId) throws Exception + { + return ORM.get(ZTable.class).item(DesignMerchant.class, merchantId < 0 ? 0 : merchantId); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/OperatorDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/OperatorDao.java new file mode 100644 index 0000000..e7bed68 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/OperatorDao.java @@ -0,0 +1,435 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dao; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.BaseConstants; + +/** + * 操作员dao + * + * @version v1.0.0 @author zhouwenbin 2017-8-25 新建与整理 + */ +@AnAlias("OperatorDao") +public class OperatorDao +{ + + /** + * 查询组织selector + * + * @param request + * @param selector + * @param fieldName + * @throws Exception + */ + public static void getOrgSelector(HttpRequest request, Selector selector) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + + ZmrOrg org = ZmrBootstrap.table(request).item(ZmrOrg.class, orgId); + if (org.getOrgLevel() > 0) + { + selector.addMust("orgId", orgId); + return; + } + } + + /** + * 查询组织下有权限查看的所有操作员 + * + * @param orgId + * @param selector + * @param fieldName + * @param operatorCode + * @throws Exception + */ + public static void getOrgOperatorSelector(HttpRequest request, long orgId, Selector selector, String fieldName, String operatorCode) throws Exception + { + if (Validates.isEmpty(fieldName) || Validates.isEmpty(operatorCode)) + { + throw new Exception("fieldName||operatorCode都不能为空"); + } + + ZmrOrg org = ZmrOrgDao.getOrg(request, orgId); + if (org.getOrgLevel() > 0) + { + String tempFieldName = "orgId"; + if ("undertakePerson".equals(fieldName)) + { + tempFieldName = "undertakeOrg"; + } + else if ("afterBlamer".equals(fieldName)) + { + tempFieldName = "picOrgId"; + } + selector.addMust(tempFieldName, orgId); + } + + ZmrOperator operator = ZmrBootstrap.table(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + selector.addMaybe(fieldName, operatorCode); + return; + } + // 总组织人员查看所有 + if (ZmrOrgDao.getOrgRootId(request) == operator.getOrgId()) + { + return; + } + + if (operator.getOperatorType() <= 1) + {// 管理员 + return; + } + + List deptList = ZmrBootstrap.table(request).list(ZmrDept.class, + new Selector().addOr(new Selector().addMust("deptManager", operatorCode).addMustLike("deptSubManager", operatorCode))); + if (deptList.isEmpty()) + {// 非部门负责人,查看自己 + selector.addMaybe(fieldName, operatorCode); + return; + } + + // 负责人查询所有负责部门 + List dataList = getDeptOperatorCodeList(request, operatorCode, true); + selector.addMaybeIn(fieldName, Arrays.toArray(dataList, String.class)); + } + + /** + * 查询有权限查看的所有操作员 + * + * @param operatorCode + * @return + */ + public static void getOperatorSelector(HttpRequest request, Selector selector, String fieldName, String operatorCode) throws Exception + { + ZmrOperator operator = ZmrBootstrap.table(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + selector.addMaybe(fieldName, operatorCode); + return; + } + + if (operator.getOperatorType() <= 1) + {// 管理员 + return; + } + + ZmrOrg org = ZmrBootstrap.table(request).item(ZmrOrg.class, operator.getOrgId()); + if (org.getOrgLevel() == 0) + {// 总公司 + return; + } + + String operatorDept = operator.getOperatorDeptAll(); + if (Validates.isNotEmpty(operatorDept) && operatorDept.contains("" + BaseConstants.DEPT_ID_SUPERVISION)) + {// 督导组 + return; + } + + List deptList = ZmrBootstrap.table(request).list(ZmrDept.class, + new Selector().addOr(new Selector().addMust("deptManager", operatorCode).addMustLike("deptSubManager", operatorCode))); + if (deptList.isEmpty()) + {// 非部门负责人,查看自己 + selector.addMaybe(fieldName, operatorCode); + return; + } + + // 负责人查询所有负责部门 + List dataList = getDeptOperatorCodeList(request, operatorCode, true); + selector.addMaybeIn(fieldName, Arrays.toArray(dataList, String.class)); + } + + /** + * 获取部门经理下属操作员编码列表 + * + * @param request 请求对象 + * @param operatorCode 部门经理编码 + * @param recursion 是否向在递归 + * @return 下属操作员列表 + * @throws Exception 异常 + */ + public static List getDeptOperatorCodeList(HttpRequest request, String operatorCode, boolean recursion) throws Exception + { + Asserts.assertNotEmpty(operatorCode, "操作员编码不允许为空"); + + List deptList = ZmrBootstrap.table(request).list(ZmrDept.class, + new Selector().addOr(new Selector().addMust("deptManager", operatorCode).addMustLike("deptSubManager", operatorCode))); + if (deptList.isEmpty()) + { + return new ArrayList<>(); + } + + List list = new ArrayList<>(); + List operatorList = ZmrBootstrap.tableOpr(request).list(ZmrOperator.class); + opr: for (ZmrOperator operator : operatorList) + { + String deptAll = recursion ? operator.getOperatorDeptAll() : operator.getOperatorDept(); + for (ZmrDept dept : deptList) + { + if (Validates.isContain(deptAll, ",", dept.getDeptId())) + { + list.add(operator.getOperatorCode()); + continue opr; + } + } + } + + return list; + } + + /** 获取指定部门下的所有员工 */ + public static List getDeptOperatorList(long deptId) throws Exception + { + List operatorList = ORM.get(ZTable.class).list(ZmrOperator.class, new Selector().addMustNotEqual("operatorType", 0)); + + List oplist = new ArrayList<>(); + for (ZmrOperator op : operatorList) + { + if (Validates.isNotEmpty(op.getOperatorDeptAll()) && op.getOperatorDeptAll().contains("" + deptId)) + { + oplist.add(op); + } + } + + return oplist; + } + + /** + * 查询组织权限下的所有操作员 + * + * @param operatorCode + * @return + * @throws Exception + */ + public static List getOrgOperatorList(HttpRequest request, long orgId, String operatorCode) throws Exception + { + List oplist = new ArrayList<>(); + if (Validates.isEmpty(operatorCode)) + { + return oplist; + } + + ZmrOperator operator = ZmrBootstrap.table(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + return oplist; + } + + ZmrOrg curOrg = ZmrOrgDao.getOrg(request, orgId); // 当前已选组织 + if (curOrg.getOrgLevel() == 0 || operator.getOperatorType() <= 1) + {// 总公司或管理员 + Selector sel = new Selector("operatorStatus", 0); + if (curOrg.getOrgLevel() > 0) + { + sel.addMust("orgId", orgId); + } + + sel.addMustThenGE("operatorType", 1); + oplist = ZmrBootstrap.table(request).list(ZmrOperator.class, sel); + return oplist; + } + + ZmrOrg org = ZmrBootstrap.table(request).item(ZmrOrg.class, operator.getOrgId());// 操作员所属组织 + if (org.getOrgLevel() == 0) + {// 操作员属于总公司 + return getOrgOperatorAllList(orgId); + } + + List deptList = ZmrBootstrap.table(request).list(ZmrDept.class, + new Selector().addOr(new Selector().addMust("deptManager", operatorCode).addMustLike("deptSubManager", operatorCode))); + if (deptList.isEmpty()) + {// 非部门负责人,查看自己 + oplist.add(operator); + return oplist; + } + + // 负责人查询所有负责部门 + oplist = getDeptOperatorList(request, operatorCode, true); + return oplist; + } + + /** + * 获取部门经理下属操作员列表 + * + * @param request 请求对象 + * @param operatorCode 部门经理编码 + * @param recursion 是否向在递归 + * @return 下属操作员列表 + * @throws Exception 异常 + */ + public static List getDeptOperatorList(HttpRequest request, String operatorCode, boolean recursion) throws Exception + { + Asserts.assertNotEmpty(operatorCode, "操作员编码不允许为空"); + + List deptList = ZmrBootstrap.table(request).list(ZmrDept.class, + new Selector().addOr(new Selector().addMust("deptManager", operatorCode).addMustLike("deptSubManager", operatorCode))); + if (deptList.isEmpty()) + { + return new ArrayList<>(); + } + + List list = new ArrayList<>(); + List operatorList = ZmrBootstrap.tableOpr(request).list(ZmrOperator.class); + opr: for (ZmrOperator operator : operatorList) + { + String deptAll = recursion ? operator.getOperatorDeptAll() : operator.getOperatorDept(); + for (ZmrDept dept : deptList) + { + if (Validates.isContain(deptAll, ",", dept.getDeptId())) + { + list.add(operator); + continue opr; + } + } + } + + return list; + } + + /** + * 查询权限下的所有操作员 + * + * @param operatorCode + * @return + * @throws Exception + */ + public static List getOperatorList(HttpRequest request, String operatorCode) throws Exception + { + List oplist = new ArrayList<>(); + ZmrOperator operator = ZmrBootstrap.table(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + return oplist; + } + + if (operator.getOperatorType() <= 1) + {// 管理员 + oplist = ZmrBootstrap.table(request).list(ZmrOperator.class, new Selector("operatorStatus", 0).addMustThenGE("operatorType", 1)); + return oplist; + } + + ZmrOrg org = ZmrBootstrap.table(request).item(ZmrOrg.class, operator.getOrgId()); + if (org.getOrgLevel() == 0) + {// 总公司 + oplist = ZmrBootstrap.table(request).list(ZmrOperator.class, new Selector("operatorStatus", 0).addMustThenGE("operatorType", 1)); + return oplist; + } + + String operatorDept = operator.getOperatorDeptAll(); + if (Validates.isNotEmpty(operatorDept) && operatorDept.contains("" + BaseConstants.DEPT_ID_SUPERVISION)) + {// 督导组 + oplist = ZmrBootstrap.table(request).list(ZmrOperator.class, new Selector("operatorStatus", 0).addMustThenGE("operatorType", 1)); + return oplist; + } + List deptList = ZmrBootstrap.table(request).list(ZmrDept.class, + new Selector().addOr(new Selector().addMust("deptManager", operatorCode).addMustLike("deptSubManager", operatorCode))); + if (deptList.isEmpty()) + {// 非部门负责人,查看自己 + oplist.add(operator); + return oplist; + } + + // 负责人查询所有负责部门 + oplist = getDeptOperatorList(request, operatorCode, true); + return oplist; + } + + /** + * 获取操作员可选组织 + * + * @param operatorCode + * @param isContainRootOrg true包含,false不包含 + * @return + * @throws Exception + */ + public static List getOperatorOrgList(HttpRequest request, String operatorCode, boolean isContainRootOrg) throws Exception + { + ZmrOperator operator = ZmrBootstrap.table(request).item(ZmrOperator.class, operatorCode); + ZmrOrg org = ZmrBootstrap.table(request).item(ZmrOrg.class, operator.getOrgId()); + if (org.getOrgLevel() == 0) + { + if (isContainRootOrg) + { + return ZmrOrgDao.list(request); + } + else + { + return ZmrOrgDao.levelList(request, 1); + } + } + else + { + List orgList = new ArrayList<>(); + orgList.add(org); + + return orgList; + } + } + + /** + * 获取组织下的所有操作员 + * + * @param operatorCode + * @return + * @throws Exception + */ + public static List getOrgOperatorAllList(long orgId) throws Exception + { + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if (org.getOrgLevel() == 0) + { + return ORM.get(ZTable.class).list(ZmrOperator.class, new Selector("operatorStatus", 0).addMustThenGE("operatorType", 1)); + } + else + { + return ORM.get(ZTable.class).list(ZmrOperator.class, new Selector("operatorStatus", 0).addMust("orgId", orgId).addMustThenGE("operatorType", 1)); + } + } + + /** 获取组织名 */ + public static String getOrgName(long orgId) throws Exception + { + if (orgId == -1) + { + return ""; + } + + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, orgId); + if (org != null) + { + return org.getOrgName(); + } + else + { + return ""; + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/OrderCheckDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/OrderCheckDao.java new file mode 100644 index 0000000..b8e2832 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/OrderCheckDao.java @@ -0,0 +1,754 @@ +package com.zhiqim.yangcai.design.dao; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.icepdf.core.pobjects.Document; +import org.icepdf.core.pobjects.Page; +import org.icepdf.core.util.GraphicsRenderingHints; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.uploadlarge.dbo.UpllFile; + +import com.itextpdf.text.pdf.PdfReader; +import com.itextpdf.text.pdf.parser.PdfTextExtractor; +import com.zhiqim.yangcai.cache.DesignTypeCache; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.utils.BaseUtil; + +/** + * 文件审核相关方法 + * + * @version v1.0.0 @author zhouwenbin 2017-9-6 新建与整理 + * @version v1.1.0 @author caohong 2020-8-27 1.增加公共订单审核方法 2.增加后工文件检测方法 + */ +public class OrderCheckDao +{ + private static final Log log = LogFactory.getLog(OrderCheckDao.class); + private static final Map checkingMap = new HashMap();// 正在审核的文件 + public static float MM = 2.83464579439252f;// pdf尺寸转毫米的系数 + + /** + * 检测文件命名是否正确 + * + * @param fileName + * @param designId + * @param wangwang + * @param receiveName + * @return + */ + public static Int checkFileName(String fileName, String designId, String wangwang, String receiveName) throws Exception + { + if (Validates.isEmpty(fileName)) + { + return new Int(-1, "文件名不能为空"); + } + + String fileExt = Files.getFileExt(fileName); + if (Validates.isEmpty(fileExt)) + { + return new Int(-1, "文件扩展名不正确,扩展名:" + fileExt); + } + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, Long.valueOf(designId)); + if (order == null) + { + return new Int(-1, "订单不存在-" + designId); + } + Int ret = checkEndFileFormat(order.getTypeId(), fileExt);// 成品文件格式判断 + if (ret.value() == -1) + { + return new Int(-1, ret.desc()); + } + + if (!fileName.contains("-")) + { + return new Int(-1, "文件名错误,请以'订单号-旺旺名'定义文件名称"); + } + + fileName = fileName.substring(0, fileName.lastIndexOf(".")); + + String subOid = fileName.substring(0, fileName.indexOf("-")); +// if (!subOid.equals(designId)) +// {// 第一项必须是订单号 +// return new Int(-1, "文件命名第一项订单号不正确"); +// } + String subWangwang = fileName.substring(fileName.indexOf("-") + 1, fileName.length()); + if (Validates.isNotEmptyBlank(subWangwang)) + { + subWangwang = Strings.trim(subWangwang); + } +// if (!subWangwang.equals(wangwang)) +// { +// return new Int(-1, "文件命名第二项不是旺旺号"); +// } + + return new Int("成功"); + } + + /*** + * 判断文件是否正在审核 + * + * @param attaId 附件ID + * @return 返回=true 表示正在审核 + */ + public static boolean isChecking(long attaId) + { + return checkingMap.containsKey(attaId); + } + + /** + * 成品文件审核 + * + * @param oid 订单编号 + * @param fileName 文件名 + * @param attaModul 附件标识 + * @return 错误信息 + * @throws Exception + */ + public static String doCheckFile(long designId, String fileName, String attaModul) throws Exception + { + if (designId == -1) + { + return "订单不存在-" + designId; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + if (order == null) + { + return "订单不存在-" + designId; + } + + Selector selector = new Selector("designId", designId); + selector.addMust("fileName", fileName); + selector.addMust("attaModul", attaModul); + selector.addOrderbyDesc("uploadTime"); + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, selector); + if (atta == null) + { + return "文件审核失败,成品文件不存在"; + } + + File file = new File(atta.getSavePath()); + if (!file.exists()) + { + return "文件审核失败,系统找不到指定的文件"; + } + + if (!"pdf".equalsIgnoreCase(atta.getFileType())) + { + return ""; + } + + String error = ""; + try + { + checkingMap.put(atta.getAttaId(), true);// 标记正在检测文件 + error = checkEndFile(order, atta); + } + catch (Exception e) + { + error = "文件内容检测异常"; + log.error("订单[" + designId + "]文件审核异常:" + e.getMessage(), e); + } + finally + { + checkingMap.remove(atta.getAttaId());// 检测完毕 + } + + return error; + } + + /*** + * 删除删除成品文件 + * + * @param atta + * @throws Exception + */ + public static void doDeleteEndFile(DesignAtta atta) throws Exception + { + doDeleteAttaFile(atta); + } + + /** 删除附件数据 */ + public static void doDeleteAttaFile(DesignAtta atta) throws Exception + { + if (atta == null) + { + return; + } + + if (!Validates.isUrl(atta.getOssUrl())) + { + File file = new File(atta.getSavePath()); + if (file.exists()) + { + Files.deleteFile(atta.getSavePath()); + } + } + + ORM.get(ZTable.class).delete(DesignAtta.class, atta.getAttaId()); + if (Validates.isNotEmpty(atta.getFileid())) + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", atta.getFileid()).addReplace("id", null)); + } + + // 删除OSS文件 + if (Validates.isNotEmptyBlank(atta.getOssUrl()) && Validates.isUrl(atta.getOssUrl())) + { + OssFileDao.deleteOssFile(atta); + } + } + + /** + * 删除成品文件 + * + * @param designId 设计订单Id + * @throws Exception + */ + public static void doDeleteEndFile(long designId) throws Exception + { + if (designId <= 0) + { + return; + } + + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, + new Selector("designId", designId).addMust("attaModul", FileTypeConstants.FILE_END.value())); + doDeleteEndFile(atta); + } + + /** + * 成品文件审核 + * + * @param order 订单对象 + * @param attaModul 附件标识 + * @return 错误信息 + * @throws Exception + */ + private static String checkEndFile(DesignOrder order, DesignAtta atta) throws Exception + { + if (order == null) + { + return "订单不存在"; + } + + if (atta == null) + { + return "文件审核失败,印刷文件不存在"; + } + + File file = new File(atta.getSavePath()); + if (!file.exists()) + { + return "文件审核失败,系统找不到指定的文件"; + } + + PdfReader readerN = null; + try + { + // 文字转曲判断 --caohong 2020-4-20 + readerN = new PdfReader(atta.getSavePath()); + int nrPages = readerN.getNumberOfPages(); + for (int i = 1; i <= nrPages; i++) + { + String text = PdfTextExtractor.getTextFromPage(readerN, i); + if (text != null && !"".equals(text)) + { + return ("文件审核失败,第" + i + "页有文字未转曲!"); + } + } + } + catch (Exception e) + { + log.error("订单[" + order.getDesignId() + "]文件审核异常:" + e.getMessage(), e); + return "文件审核失败,有文字未转曲或编码异常!"; + } + catch (Error e) + { + log.error("订单[" + order.getDesignId() + "]文件审核异常:" + e.getMessage(), e); + return "文件审核失败,有文字未转曲或编码异常!"; + } + finally + { + if (readerN != null) + { + readerN.close(); + } + } + + // 透明PVC,并且是印白墨后加工的情况,不判断版面数量,因为有白墨版,比较特殊 --caohong + if (order.getTypeId() == 1806070857392601L && order.getAfterNames() != null && order.getAfterNames().contains("印白墨")) + { + return ""; + } + + int pageValue = order.getDesignPage(); + double stdWidth = order.getDesignWidth(); + double stdHeight = order.getDesignHeight(); + + // 优惠券产品需要特殊处理,由于录单去掉了模位计算操作,审核的时候需要使用名片标准尺寸来检查内容。--caohong 2019-11-12 + if ("1710131129568467".equals(String.valueOf(order.getTypeId()))) + { + stdWidth = 92; + stdHeight = 56; + double tmpWidth = order.getDesignWidth(); + double tmpHeight = order.getDesignHeight(); + if (order.getPrintWidth() > 0 && order.getPrintHeight() > 0) + { + tmpWidth = order.getPrintWidth(); + tmpHeight = order.getPrintHeight(); + } + // 临时计算模位用于计算检测 + int ms = BaseUtil.calcMod("92X56", new Double(tmpWidth).intValue(), new Double(tmpHeight).intValue(), 0); + order.setPrintMs(ms); + } + + // 画册产品不需要检查内容,比较复杂 + if (!"3".equals(String.valueOf(order.getTypeId()))) + { + Document document = new Document(); + document.setFile(atta.getSavePath()); + int pageTotal = document.getNumberOfPages(); + if (pageTotal < 1) + { + return "文件审核失败,印刷文件无页面"; + } + + // 总页数%单或双面 + if (pageTotal % pageValue != 0) + { + return "文件审核失败,印刷文件页数错误"; + } + + float firstWidth = 0f, firstHeight = 0f; + try + { + boolean flag = false; + float scale = 1f; + float rotation = 0f; + + // 获取第一条文件尺寸 + BufferedImage oneImage = document.getPageImage(0, GraphicsRenderingHints.SCREEN, Page.BOUNDARY_CROPBOX, rotation, scale); + firstWidth = oneImage.getWidth() / MM; + firstHeight = oneImage.getHeight() / MM; + for (int i = 1; i < pageTotal; i++) + { + BufferedImage image = document.getPageImage(i, GraphicsRenderingHints.SCREEN, Page.BOUNDARY_CROPBOX, rotation, scale); + if (Math.abs(image.getWidth() / MM - firstWidth) >= 0.1) + { + return "文件审核失败,第" + i + "页,尺寸错误,实际宽:" + firstWidth + ",期望宽:" + stdWidth; + } + + if (Math.abs(image.getHeight() / MM - firstHeight) >= 0.1) + { + return "文件审核失败,第" + i + "页,尺寸错误,实际高:" + firstHeight + ",期望高:" + stdHeight; + } + } + + // 误差不超过0.1,则收为整数 + firstWidth = Math.round(firstWidth); + firstHeight = Math.round(firstHeight); + + // 根据面积判断是否符合规则 92*56 3款2模 92*56*6 + float rate = (float) Math + .abs((firstWidth * firstHeight * pageTotal / pageValue) - (stdWidth * stdHeight * order.getPrintMs() * order.getPrintKs())); + if (rate < 0.1) + { + flag = true; + } + + if (!flag) + { + return "文件审核失败,尺寸或模数错误"; + } + } + catch (Exception e) + { + log.error("[订单" + order.getDesignId() + "]印刷文件审核异常," + e.getMessage(), e); + return "文件审核异常,请重新上传."; + } + finally + { + document.dispose(); + } + } + + return ""; + } + + /*** + * 订单是否自动审核通过 + * + * @author caohong + * @param order + * @return true=自动审单通过,false=需要人工审单 + */ + public static boolean isAutoCheck(DesignOrder order) + { + boolean autoCheckMeet = false; + if (order != null) + { + // 只设计不印刷订单自动审核通过 + if (order.isOnlyDesign()) + { + autoCheckMeet = true; + log.info("订单:" + order.getDesignId() + " 只设计不印刷订单自动审核通过"); + } +// else if ((order.getTypeId() == 1 || order.getTypeId() == 2) && order.getAmount() <= 200 * 100 && Validates.isEmpty(order.getAfterNames()) +// && order.getPrintWidth() == 0 && order.getPrintHeight() == 0) +// { +// // 名片、彩页订单,不含后加工,不是特殊尺寸订单,金额小于等于200元订单自动审核通过 +// autoCheckMeet = true; +// log.info("订单:" + order.getDesignId() + " 名片、彩页订单,不含后加工,不是特殊尺寸订单,金额小于等于200元订单自动审核通过"); +// } + } + + return autoCheckMeet; + } + + /** + * [简要描述]:订单后加工文件检测
            + * [详细描述]:
            + * + * @author caohong 2020-8-27 14:16:06 + * @param DesignOrder + * @return false 检查无问题,true 后工文件不合格 + */ + public static String isAfterFileCheck(DesignOrder order) + { + if (null == order) + { + return ""; + } + + // 如果有后加工,需要判断后加工文件,折页都需要后工文件,默认圆角不做检查,不需要后工图 + if ("1804102013509964".equals(String.valueOf(order.getTypeId())) + || (Validates.isNotEmpty(order.getAfterNames()) && !order.getAfterNames().contains("圆角"))) + { + try + { + Selector workSelector = new Selector(); + workSelector.addMust("designId", order.getDesignId()); + String[] attaModul = new String[] + { + FileTypeConstants.FILE_END.value(), FileTypeConstants.FILE_WORK.value() + }; + workSelector.addMustIn("attaModul", attaModul); + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, workSelector); + if (attaList.size() > 0) + { + List endList = new ArrayList(); + List workList = new ArrayList(); + for (DesignAtta atta : attaList) + { + if (FileTypeConstants.FILE_WORK.value().equals(atta.getAttaModul())) + { + workList.add(atta.getFileType()); + } + else + { + endList.add(atta.getFileType()); + } + } + + // 成品文件是pdf格式才需要单独的后工文件 + if (endList.size() > 0 && endList.contains("pdf")) + { + if (workList.size() > 2) + { + return "后加工文件不符合规则,最多一个后工文件+一个后工图。"; + } + + if (workList.size() > 0) + { + // 有压型(定制形状),烫金的后加工必须有1个pdf文件+1个后工图 + if (Validates.isNotEmpty(order.getAfterNames()) && order.getAfterNames().contains("压型") || order.getAfterNames().contains("定制形状") + || order.getAfterNames().contains("烫金")) + { + if (workList.size() == 1) + { + return "后加工文件不符合规则,该后工类型需要一个后工文件+一个后工图。"; + } + + if (!workList.contains("pdf")) + { + return "后加工文件不符合规则,该后工类型至少需要一个pdf后工文件。"; + } + + if (!workList.contains("jpg") && !workList.contains("png")) + { + return "后加工文件不符合规则,该后工类型至少需要一个jpg或者png格式后工图。"; + } + } + else + { + if (workList.size() > 1 || (!workList.contains("jpg") && !workList.contains("png"))) + { + return "后加工文件不符合规则,该后工类型只需要一个jpg或者png格式后工图。"; + } + } + } + else + { + return "后加工文件不符合规则,不能为空"; + } + } + } + } + catch (Exception e) + { + log.error("订单[" + order.getDesignId() + "]后工文件检测异常," + e.getMessage(), e); + } + } + + return ""; + } + + /** + * + * [简要描述]产品类型支持成品文件格式判断:
            + * [详细描述]:
            + * + * @author gjx + * @param prdTypeId 产品id + * @param fileExt 文件后缀 + * @return + */ + private static Int checkEndFileFormat(long prdTypeId, String fileExt) + { + String fileSuffixs = fileExt; + Int content = new Int("成功"); + switch (String.valueOf(prdTypeId)) + { + case "1806070857392601":// PVC名片 + String[] suffixs_1 = + { + "CDR", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_1, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_1) + "格式文件!"); + } + break; + case "3":// 画册 + String[] suffixs_2 = + { + "PDF", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_2, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_2) + "格式文件!"); + } + break; + case "174928":// 条幅 + String[] suffixs_3 = + { + "CDR", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_3, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_3) + "格式文件!"); + } + break; + case "4":// 展架 + String[] suffixs_4 = + { + "JPG", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_4, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_4) + "格式文件!"); + } + break; + case "13879":// 喷绘 + String[] suffixs_5 = + { + "JPG", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_5, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_5) + "格式文件!"); + } + break; + case "1807131630136416":// 透明PVC + String[] suffixs_6 = + { + "CDR", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_6, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_6) + "格式文件!"); + } + break; + case "5245":// 不干胶 + String[] suffixs_7 = + { + "PDF", "CDR", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_7, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_7) + "格式文件!"); + } + break; + case "1710131129568467":// 优惠券 + String[] suffixs_8 = + { + "PDF", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_8, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_8) + "格式文件!"); + } + break; + case "1712081121019542":// 会员卡 + String[] suffixs_9 = + { + "CDR", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_9, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_9) + "格式文件!"); + } + break; + case "1":// 名片 + String[] suffixs_10 = + { + "PDF", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_10, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_10) + "格式文件!"); + } + break; + case "1709262303143794":// 特种纸 + String[] suffixs_11 = + { + "CDR", "ZIP", "RAR", "PDF" + }; + if (!Validates.isContain(suffixs_11, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_11) + "格式文件!"); + } + break; + + case "2":// 双胶纸 + String[] suffixs_12 = + { + "PDF", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_12, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_12) + "格式文件!"); + } + break; + + case "1804102013509964":// 折页 + String[] suffixs_13 = + { + "PDF", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_13, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_13) + "格式文件!"); + } + break; + case "1711301155490562":// 台历 + String[] suffixs_14 = + { + "CDR", "ZIP" + }; + if (!Validates.isContain(suffixs_14, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_14) + "格式文件!"); + } + break; + case "1805161033477027":// 广告扇 + String[] suffixs_15 = + { + "CDR", "ZIP" + }; + if (!Validates.isContain(suffixs_15, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_15) + "格式文件!"); + } + break; + case "1807050917081078":// 亚克力桌牌 + String[] suffixs_16 = + { + "CDR", "ZIP" + }; + if (!Validates.isContain(suffixs_16, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_16) + "格式文件!"); + } + break; + case "1712071237353505":// 手提袋 + String[] suffixs_17 = + { + "CDR", "ZIP" + }; + if (!Validates.isContain(suffixs_17, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_17) + "格式文件!"); + } + break; + case "5244":// 联单 + String[] suffixs_18 = + { + "CDR", "ZIP", "RAR" + }; + if (!Validates.isContain(suffixs_18, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_18) + "格式文件!"); + } + break; + case "1801231002421959":// 工作证 + String[] suffixs_19 = + { + "CDR", "ZIP" + }; + if (!Validates.isContain(suffixs_19, fileExt.toUpperCase())) + { + content = new Int(-1, "产品类型【" + Global.get(DesignTypeCache.class).getName(prdTypeId) + "】不支持上传【" + fileSuffixs + "】格式文件,请传" + + Arrays.toString(suffixs_19) + "格式文件!"); + } + break; + + } + return content; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/OrderLogDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/OrderLogDao.java new file mode 100644 index 0000000..dafc471 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/OrderLogDao.java @@ -0,0 +1,106 @@ +package com.zhiqim.yangcai.design.dao; + +import java.sql.SQLException; + +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.aliyuncs.utils.StringUtils; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdOprLog; +import com.zhiqim.yangcai.design.server.ErpClassService; +import com.zhiqim.yangcai.design.server.ErpClassService.statusEnum; + +public class OrderLogDao { + + /** + * 记录订单操作日志 + * + * @author caohong + * @param designId + * @param designer 设计师 + * @param status 操作之后的状态 + * @param operatorCode 操作人 + * @param itemDesc 描述 + * @param eventType 事件类型 + * @throws ORMException + * @throws SQLException + */ + public static void saveOrderOperateLog(long designId, String designer, int status, String operatorCode, + String itemDesc, int eventType) throws ORMException, SQLException { + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + + OrdOprLog orderlog = new OrdOprLog(); + orderlog.setLogId(Ids.longId()); + orderlog.setDesignId(designId); + orderlog.setStatus(status); + orderlog.setOperatorCode(operatorCode); + orderlog.setDesigner(designer); + orderlog.setOperateDesc(itemDesc); + orderlog.setEventType(eventType); + orderlog.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(orderlog); + if (StringUtils.isNotEmpty(order.getTids())) { + new ErpClassService(order.getTids(), order.getDesigner(), statusEnum.TO_BE_DESIGNEDING.getCode(), itemDesc); + } + } + + public static void saveOrderOperateLog(long designId, String operatorCode, String itemDesc, int eventType) + throws ORMException, SQLException { + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId)); + if (order == null) { + return; + } + + ORM.get(ZTable.class).update(DesignOrder.class, + new Updater().addMust("designId", designId).addField("modifyTime", Sqls.nowTimestamp())); + OrdOprLog orderlog = new OrdOprLog(); + orderlog.setLogId(Ids.longId()); + orderlog.setDesignId(designId); + orderlog.setStatus(order.getStatus()); + orderlog.setOperatorCode(operatorCode); + orderlog.setDesigner(order.getDesigner()); + orderlog.setOperateDesc(itemDesc); + orderlog.setEventType(eventType); + orderlog.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(orderlog); + + if (StringUtils.isNotEmpty(order.getTids())) { + new ErpClassService(order.getTids(), order.getDesigner(), statusEnum.TO_BE_DESIGNEDING.getCode(), itemDesc); + } + } + + public static void saveOrderOperateLog(DesignOrder order, String operatorCode, String itemDesc, int eventType) + throws ORMException, SQLException { + if (order == null) { + return; + } + + ORM.get(ZTable.class).update(DesignOrder.class, + new Updater().addMust("designId", order.getDesignId()).addField("modifyTime", Sqls.nowTimestamp())); + OrdOprLog orderlog = new OrdOprLog(); + orderlog.setLogId(Ids.longId()); + orderlog.setDesignId(order.getDesignId()); + orderlog.setStatus(order.getStatus()); + orderlog.setOperatorCode(operatorCode); + orderlog.setDesigner(order.getDesigner()); + orderlog.setOperateDesc(itemDesc); + orderlog.setEventType(eventType); + orderlog.setCreateTime(Sqls.nowTimestamp()); + + ORM.get(ZTable.class).insert(orderlog); + + if (StringUtils.isNotEmpty(order.getTids())) { + new ErpClassService(order.getTids(), order.getDesigner(), statusEnum.TO_BE_DESIGNEDING.getCode(), itemDesc); + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/OssFileDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/OssFileDao.java new file mode 100644 index 0000000..43a5157 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/OssFileDao.java @@ -0,0 +1,461 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.dao; + +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.UUID; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Maths; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.oss.service.oss.OssService; +import com.zhiqim.oss.service.oss.OssUploadService; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignAttaView; +import com.zhiqim.yangcai.design.dbo.utils.BaseUtil; +import com.zhiqim.yangcai.util.QiyeWechatUtil; + +/*** + * oss文件上传 + * + * @version v1.0.0 @author longguizhi 2018-1-19 新建与整理 + */ +public class OssFileDao { + private static final Log log = LogFactory.getLog(OssFileDao.class); + private static String bucketName = Global.getString("oss", "yangcai_bucketName"); + private static String prefix_dir = Global.getString("oss", "prefix_dir"); + private static boolean isInternal = "true".equalsIgnoreCase(Global.getString("oss", "isInternal")) ? true : false; + public static String ossEndpoint = "oss-89-taobao.oss-cn-shenzhen.aliyuncs.com"; + + /** 获取oss前缀目录 **/ + public static String getPrefix_dir() { + String dir = Strings.trim(prefix_dir); + dir = Strings.trim(dir, "/", "/"); + return Strings.trim(dir); + } + + /*** + * 文件上传到OSS + * + * @param atta 附件对象 + * @return 返回 =true 表示上传成功 + */ + public static boolean uploadFile(DesignAtta atta) { + if (Validates.isNotEmptyBlank(atta.getOssUrl())) { + return true; + } + + try { + File file = new File(atta.getSavePath()); + if (!file.exists() || file.isDirectory()) {// 文件不存在 + Updater updater = new Updater(); + updater.addMust("attaId", atta.getAttaId()); + updater.addField("ossType", -1); + ORM.get(ZTable.class).update(DesignAtta.class, updater); + + if ("EndFile".equals(atta.getAttaModul())) { + String msg = "订单[" + atta.getDesignId() + "]附件[" + atta.getAttaModul() + "]路径[" + atta.getSavePath() + + "]文件不存在,流程阻塞。"; + log.error(msg); + QiyeWechatUtil.sendMsgToQiyeWechat("设计平台订单文件OSS云端存储失败告警:\n" + msg); + } + + return false; + } + + if (Validates.isEmptyBlank(bucketName)) { + log.error("订单[" + atta.getDesignId() + "]附件[" + atta.getAttaModul() + "]上传到OSS时,bucketName参数未配置"); + return false; + } + + long statTime = System.currentTimeMillis(); + + String fileKey = getUploadFileKey(atta); + OssUploadService ossUploadService = Global.get(OssUploadService.class); + String ossUrl = ossUploadService.uploadFile(bucketName, fileKey, atta.getSavePath(), isInternal); + + atta.setOssUrl(ossUrl); + atta.setOssType(1); + + Updater updater = new Updater(); + updater.addMust("attaId", atta.getAttaId()); + updater.addField("ossUrl", ossUrl); + updater.addField("ossType", 1); + ORM.get(ZTable.class).update(DesignAtta.class, updater); + + long endTime = System.currentTimeMillis(); + log.info("订单[" + atta.getDesignId() + "]附件[" + atta.getAttaModul() + "]上传到OSS完成,耗时:" + + Maths.division(endTime - statTime, 1000, 2) + "秒"); + + } catch (Exception e) { + log.error("订单[" + atta.getDesignId() + "]附件[" + atta.getAttaModul() + "]上传到OSS异常," + e.getMessage(), e); + return false; + } + + return true; + } + + /**** + * 上传文件 + * + * @param file + * @param fileKey + * @return 返回 null表示失败,正确返回Oss访问地址 + */ + public static String uploadFile(File file, String fileKey) { + if (file == null) { + return null; + } + + if (!file.exists() || file.isDirectory()) {// 文件不存在 + log.error("OssFileDao 文件[" + file + "]上传到OSS时文件不存在"); + return null; + } + + if (Validates.isEmptyBlank(bucketName)) { + log.error("OssFileDao 文件[" + file + "]上传到OSS时,bucketName参数未配置"); + return null; + } + + if (Validates.isEmptyBlank(fileKey) || Validates.isEmptyBlank(Strings.trimLeft(fileKey, "/"))) { + log.error("OssFileDao 文件[" + file + "]上传到OSS时,fileKey不能为空"); + return null; + } + + fileKey = Strings.trimLeft(fileKey, "/"); + if (Validates.isNotEmptyBlank(prefix_dir)) { + fileKey = Strings.addStartsWith(fileKey, Strings.trim(prefix_dir, "/", "/") + "/"); + } + + long statTime = System.currentTimeMillis(); + OssUploadService ossUploadService = Global.get(OssUploadService.class); + + try { + String ossUrl = ossUploadService.uploadFile(bucketName, fileKey, file.getPath(), isInternal); + log.info("OssFileDao 附件[" + file + "]文件上传完成,共计[%s]毫秒", System.currentTimeMillis() - statTime); + return ossUrl; + } catch (Exception e) { + log.error("OssFileDao 附件[" + file + "]文件上传失败", e); + return null; + } + } + + /*** + * 文件断点续传上传到OSS + * + * @param atta 附件对象 + * @return 返回 =true 表示上传成功 + */ + public static boolean uploadBreak(DesignAtta atta) { + if (Validates.isNotEmptyBlank(atta.getOssUrl())) { + return true; + } + + try { + File file = new File(atta.getSavePath()); + if (!file.exists() || file.isDirectory()) {// 文件不存在 + Updater updater = new Updater(); + updater.addMust("attaId", atta.getAttaId()); + updater.addField("ossType", -1); + ORM.get(ZTable.class).update(DesignAtta.class, updater); + + if ("EndFile".equals(atta.getAttaModul())) { + String msg = "订单[" + atta.getDesignId() + "]附件[" + atta.getAttaModul() + "]路径[" + atta.getSavePath() + + "]文件不存在,流程阻塞。"; + log.error(msg); + QiyeWechatUtil.sendMsgToQiyeWechat("设计平台订单文件OSS云端存储失败告警:\n" + msg); + } + return false; + } + + if (Validates.isEmptyBlank(bucketName)) { + log.error("订单[" + atta.getDesignId() + "]附件[" + atta.getAttaModul() + "]上传到OSS时,bucketName参数未配置"); + return false; + } + + long statTime = System.currentTimeMillis(); + + String fileKey = getUploadFileKey(atta); + OssUploadService ossUploadService = Global.get(OssUploadService.class); + + String ossUrl = ossUploadService.uploadFileBreak(bucketName, fileKey, atta.getSavePath(), isInternal); + + atta.setOssUrl(ossUrl); + atta.setOssType(1); + Updater updater = new Updater(); + updater.addMust("attaId", atta.getAttaId()); + updater.addField("ossUrl", ossUrl); + updater.addField("ossType", 1); + + ORM.get(ZTable.class).update(DesignAtta.class, updater); + + long endTime = System.currentTimeMillis(); + log.info("订单[" + atta.getDesignId() + "]附件[" + atta.getAttaModul() + "]上传到OSS完成,耗时:" + + Maths.division(endTime - statTime, 1000, 2) + "秒"); + } catch (Exception e) { + Path savePath = Paths.get(atta.getSavePath()); + log.error("订单[" + atta.getDesignId() + "]附件[" + atta.getAttaModul() + "]上传到OSS异常," + e.getMessage(), e); + return false; + } + + return true; + } + + /**** + * 断点上传文件 + * + * @param file + * @param fileKey + * @return 返回 null表示失败,正确返回Oss访问地址 + */ + public static String uploadBreak(File file, String fileKey) { + if (file == null) { + return null; + } + + if (!file.exists() || file.isDirectory()) {// 文件不存在 + log.error("OssFileDao 文件[" + file + "]上传到OSS时文件不存在"); + return null; + } + + if (Validates.isEmptyBlank(bucketName)) { + log.error("OssFileDao 文件[" + file + "]上传到OSS时,bucketName参数未配置"); + return null; + } + + if (Validates.isEmptyBlank(fileKey) || Validates.isEmptyBlank(Strings.trimLeft(fileKey, "/"))) { + log.error("OssFileDao 文件[" + file + "]上传到OSS时,fileKey不能为空"); + return null; + } + + fileKey = Strings.trimLeft(fileKey, "/"); + if (Validates.isNotEmptyBlank(prefix_dir)) { + fileKey = Strings.addStartsWith(fileKey, Strings.trim(prefix_dir, "/", "/") + "/"); + } + + long statTime = System.currentTimeMillis(); + log.info("OssFileDao 附件[" + file + "]文件大小[" + BaseUtil.getPrintSize(file.length()) + "]上传到OSS开始..."); + OssUploadService ossUploadService = Global.get(OssUploadService.class); + + try { + String ossUrl = ossUploadService.uploadFileBreak(bucketName, fileKey, file.getPath(), isInternal); + log.info("OssFileDao 附件[" + file + "]文件上传完成,共计[%s]毫秒", System.currentTimeMillis() - statTime); + return ossUrl; + } catch (Exception e) { + log.error("OssFileDao 附件[" + file + "]文件上传失败", e); + return null; + } + } + + /*** + * 删除Oss文件 + * + * @param atta 附件对象 + * @return 返回 =true 表示上传成功 + */ + public static boolean deleteOssFile(DesignAtta atta) { + if (atta == null || Validates.isEmptyBlank(atta.getOssUrl())) { + return true; + } + + if (atta.getAttaFlag() == 1) { + return true;// 接口上传的不删除 + } + + String fileKey = getUploadFileKey(atta); + if (Validates.isEmptyBlank(fileKey)) { + return false; + } + + try { + + String bucketName = Global.getString("oss", "yangcai_bucketName"); + + if (Validates.isEmptyBlank(bucketName)) { + log.error("OssFileDao 附件[" + fileKey + "]从OSS删除,bucketName参数未配置"); + return false; + } + + OssService ossService = Global.get(OssService.class); + ossService.deleteFile(bucketName, fileKey); + + return true; + } catch (Exception e) { + log.error("从OSS删除时异常fileKey:[" + fileKey + "]:", e); + return false; + } + } + + /*** + * 删除Oss文件 + * + * @param fileKey + * @return 返回 =true 表示上传成功 + */ + public static boolean deleteOssFile(String fileKey) { + + if (Validates.isEmptyBlank(fileKey)) { + return false; + } + + try { + + String bucketName = Global.getString("oss", "yangcai_bucketName"); + if (Validates.isEmptyBlank(bucketName)) { + log.error("OssFileDao 附件[" + fileKey + "]从OSS删除,bucketName参数未配置"); + return false; + } + + OssService ossService = Global.get(OssService.class); + ossService.deleteFile(bucketName, fileKey); + return true; + } catch (Exception e) { + log.error("从OSS删除时异常fileKey:[" + fileKey + "]:", e); + return false; + } + } + + /** + * + * [简要描述]: 拷贝文件
            + * [详细描述]:
            + * + * @author gjx + * @param sourceKey + * @param destinationKey + */ + public static boolean copyObject(String sourceKey, String destinationKey) { + // 创建OSSClient实例。 + OssService ossService = Global.get(OssService.class); + try { + ossService.doCopy(bucketName, sourceKey, bucketName, destinationKey); + return Boolean.TRUE; + } catch (Exception e) { + log.error("拷贝文件异常:bucketName:" + bucketName + ",sourceKey:[" + sourceKey + "],destinationKey:[" + + destinationKey + "]", e); + } + return Boolean.FALSE; + } + + /*** + * 获取组装文件在OSS上的key + * + * @param atta 附件对象 + * @return 返回 文件的key + */ + public static String getUploadFileKey(DesignAtta atta) { + // 模拟文件夹 + if (atta == null) { + return null; + } + + String date = Sqls.toDateString(atta.getUploadTime()).replace("-", ""); + String attaModul = atta.getAttaModul(); + String folder = Strings.addEndsWith(date, "/") + Strings.addEndsWith(attaModul, "/"); + String fileKey = folder + atta.getAttaId() + Strings.addStartsWith(atta.getFileType(), "."); + + if (Validates.isNotEmptyBlank(atta.getOssUrl()) && Validates.isNotEmptyBlank(getPrefix_dir()) + && atta.getOssUrl().indexOf(getPrefix_dir()) == -1) { + return fileKey;// 老数据 已经上传过了 + } + + if (Validates.isNotEmptyBlank(getPrefix_dir())) { + fileKey = Strings.addEndsWith(getPrefix_dir(), "/") + fileKey; + } + + return fileKey; + } + + /** + * + * 组装图片在OSS上的key + * + * @author gjx + * @param id + * @return 返回 文件的key + */ + public static String getUploadFileKey(long id) { + if (id <= 0) { + return null; + } + + String date = DateTimes.getDateString().replace("-", ""); + String fileType = FileTypeConstants.FILE_COMPLAIN_END.value(); + String folder = Strings.addEndsWith(date, "/") + Strings.addEndsWith(fileType, "/"); + + String fileKey = folder + id + Strings.addStartsWith("png", "."); + String prefix = Strings.addEndsWith(Strings.trim(prefix_dir, "/", "/"), "/"); + + return Strings.isEmpty(prefix) ? fileKey : Strings.addStartsWith(fileKey, prefix); + } + + /** + * + * 组装图片在OSS上的key + * + * @author coahong + * @param id + * @param filePathName 目录名称 + * @return 返回 文件的key + */ + public static String getUploadFileKey(long id, String filePathName) { + if (id <= 0) { + return null; + } + if (filePathName == null) { + return null; + } + + String date = DateTimes.getDateString().replace("-", ""); + String fileType = filePathName; + String folder = Strings.addEndsWith(date, "/") + Strings.addEndsWith(fileType, "/"); + + String fileKey = folder + id + Strings.addStartsWith("png", "."); + String prefix = Strings.addEndsWith(Strings.trim(prefix_dir, "/", "/"), "/"); + + return Strings.isEmpty(prefix) ? fileKey : Strings.addStartsWith(fileKey, prefix); + } + + public static boolean uploadBreak(DesignAttaView atta) { + return uploadBreak(Objects.copyDeep(atta, new DesignAtta())); + } + + public static boolean uploadFile(DesignAttaView atta) { + return uploadFile(Objects.copyDeep(atta, new DesignAtta())); + } + + public static String designExternalFilePackageKey(String fileKey) { + if (Validates.isEmptyBlank(fileKey) || Validates.isEmptyBlank(Strings.trimLeft(fileKey, "/"))) { + return null; + } + + fileKey = Strings.trimLeft(fileKey, "/"); + if (Validates.isNotEmptyBlank(prefix_dir)) { + fileKey = Strings.addStartsWith(fileKey, Strings.trim(prefix_dir, "/", "/") + "/"); + } + return fileKey; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/ParamDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/ParamDao.java new file mode 100644 index 0000000..14a6a7f --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/ParamDao.java @@ -0,0 +1,166 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.dao; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrParam; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.util.DesignUtil; + +/** 管理台参数获取dao **/ +@AnAlias("ParamDao") +public class ParamDao implements SignConstants +{ + /** + * 获取后加工参数组成列表 + * + * @throws SQLException + * @throws ORMException + **/ + public static List doGetAfterNameParam() throws Exception + { + ZmrParam paramAfters = ORM.get(ZTable.class).item(ZmrParam.class, + new Selector("paramGroup", "yangcai.design").addMust("paramKey", "designOrgMerAfters")); + List designAfters = new ArrayList(); + if (paramAfters != null) + { + StringBuilder sb = new StringBuilder(); + String v = paramAfters.getParamValue(); + for (int i = 0; i < v.length(); i++) + { + char c = v.charAt(i); + if (c < _SPACE_ || c == _SPACE_ZH_ || c == _SPACE_BOM_) + { + continue; + } + + if (c == ',') + { + sb.append(','); + continue; + } + sb.append(c); + } + + for (String after : Lists.toStringList(sb.toString())) + { + if (Validates.isNotEmptyBlank(after)) + { + designAfters.add(after); + } + } + } + + return designAfters; + } + + /****/ + public static List doGetShopNameParam() throws Exception + { + ZmrParam shopParam = ORM.get(ZTable.class).item(ZmrParam.class, new Selector("paramGroup", "yangcai.design").addMust("paramKey", "orderShop")); + List shopList = new ArrayList<>(); + if (shopParam != null && Validates.isNotEmptyBlank(shopParam.getParamValue())) + { + String shops = shopParam.getParamValue().replaceAll(",", ","); + shops = DesignUtil.removeBlank(shops); + shopList.addAll(Lists.toStringList(shops)); + } + + return shopList; + } + + /**** + * 获取String参数 + * + * @param paramGrpup + * @param paramKey + * @return + * @throws SQLException + * @throws ORMException + */ + public static String getString(String paramGroup, String paramKey) throws Exception + { + if (Validates.isEmptyBlank(paramGroup) || Validates.isEmptyBlank(paramKey)) + { + return null; + } + + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, new Selector("paramGroup", paramGroup).addMust("paramKey", paramKey)); + if (param == null) + { + return null; + } + + String value = param.getParamValue(); + return Validates.isEmptyBlank(value) ? null : Strings.trim(value); + } + + /** + * + * @param paramGrpup + * @param paramKey + * @param paramValue + * @throws Exception + */ + public static void doUpdateParam(String paramGroup, String paramKey, String paramValue) throws Exception + { + Updater updater = new Updater(); + updater.addMust("paramGroup", paramGroup); + updater.addMust("paramKey", paramKey); + updater.addField("paramValue", paramValue); + ORM.get(ZTable.class).update(ZmrParam.class, updater); + } + + /** + * + * [简要描述]: 获取业务参数
            + * [详细描述]:
            + * + * @author gjx + * @return + * @throws Exception + */ + public static LinkedHashMap> doQueryBusinessParam() throws Exception + { + LinkedHashMap> groupMap = new LinkedHashMap<>(); + + List paramList = ORM.get(ZTable.class).list(ZmrParam.class, + new Selector("paramType", "business").addMustNotEqual("paramType", "private").addOrderbyAsc("paramGroup,paramSeq")); + for (ZmrParam param : paramList) + { + LinkedHashMap paramMap = groupMap.get(param.getParamGroup()); + if (paramMap == null) + { + paramMap = new LinkedHashMap(); + groupMap.put(param.getParamGroup(), paramMap); + } + + paramMap.put(param.getParamKey(), param); + } + return groupMap; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/PerformanceParamDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/PerformanceParamDao.java new file mode 100644 index 0000000..0fdee42 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/PerformanceParamDao.java @@ -0,0 +1,123 @@ +/* + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ + +package com.zhiqim.yangcai.design.dao; + +import org.zhiqim.kernel.annotation.AnAlias; + +import com.zhiqim.yangcai.design.dbo.stat.PerformanceParam; + +@AnAlias("PerformanceParamDao") +public class PerformanceParamDao +{ + + public static void getValidPerformanceParam(long orgId) throws Exception + { +// ZmrOrgDao.getOrgName(request, orgId) + + + } + + /**** + * 获取 统计参数价格 + * @param param 价格参数 + * @param count 订单数 + * @return + */ + public static long getValidPerformanceParamPrice(PerformanceParam param, int count) + { + if (param == null) + return 0; + if (count <= 0) + return param.getPriceLevel1(); + + if (count <= param.getLevel1MaxCount()) + return param.getPriceLevel1(); + + else if(count <= param.getLevel2MaxCount()) + return param.getPriceLevel2(); + + else if(count <= param.getLevel3MaxCount()) + return param.getPriceLevel3(); + + else if(count <= param.getLevel4MaxCount()) + return param.getPriceLevel4(); + + else if(count <= param.getLevel5MaxCount()) + return param.getPriceLevel5(); + + else if(count <= param.getLevel6MaxCount()) + return param.getPriceLevel6(); + else + {//大于上限值 则取上限值 + if (param.getLevel6MaxCount() != 0 ) + return param.getPriceLevel6(); + + else if(param.getLevel5MaxCount() != 0 ) + return param.getPriceLevel5(); + + else if(param.getLevel4MaxCount() != 0 ) + return param.getPriceLevel4(); + + else if(param.getLevel3MaxCount() != 0 ) + return param.getPriceLevel3(); + + else if(param.getLevel2MaxCount() != 0 ) + return param.getPriceLevel2(); + + else if(param.getLevel1MaxCount() != 0 ) + return param.getPriceLevel1(); + + else + return 0; + } + + } + +// public static void main(String[] args) +// { +// +// +// int level1MaxCount = 299; +// int level2MaxCount = 399; +// int level3MaxCount = 499; +// int level4MaxCount = 0; +// int level5MaxCount = 0; +// int level6MaxCount = 0; +// +// PerformanceParam parameter = new PerformanceParam(); +// parameter.setValidDate(DateTimes.getFirstMonthDay()); +// parameter.setOrgId(0); +// parameter.setPriceType(0); +// +// +// long priceLevel1 = 299; +// long priceLevel2 = 399; +// long priceLevel3 = 499; +// long priceLevel4 = 599; +// long priceLevel5 = 699; +// long priceLevel6 = 1000000; +// parameter.setPriceLevel1(priceLevel1); +// parameter.setPriceLevel2(priceLevel2); +// parameter.setPriceLevel3(priceLevel3); +// parameter.setPriceLevel4(priceLevel4); +// parameter.setPriceLevel5(priceLevel5); +// parameter.setPriceLevel6(priceLevel6); +// +// parameter.setLevel1MaxCount(level1MaxCount); +// parameter.setLevel2MaxCount(level2MaxCount); +// parameter.setLevel3MaxCount(level3MaxCount); +// parameter.setLevel4MaxCount(level4MaxCount); +// parameter.setLevel5MaxCount(level5MaxCount); +// parameter.setLevel6MaxCount(level6MaxCount); +// +// System.out.println(getValidPerformanceParamPrice(parameter, 600)); +// } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/ShopDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/ShopDao.java new file mode 100644 index 0000000..3648bdd --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/dao/ShopDao.java @@ -0,0 +1,52 @@ +/** + * 扬彩印刷设计 + * 文件名 :ShopDao.java + * 创建人 :高佳新 + * 创建时间:2019-7-17 + */ + +package com.zhiqim.yangcai.design.dao; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.manager.dbo.ZmrParam; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +/** + * + * 店铺信息dao + * + * @version 1.0 @author gjx 2019-7-17 新建与整理 + */ +@AnAlias("ShopDao") +public class ShopDao +{ + /** + * + * 得到店铺信息 + * + * @author gjx + * @return + * @throws Exception + */ + public static List getShopList() throws Exception + { + List shopList = ORM.get(ZTable.class).list(ZmrParam.class, new Selector().addMust("paramKey", "orderShop")); + for (ZmrParam zmrParam : shopList) + { + String shopValue = zmrParam.getParamValue(); + if (shopValue != null) + { + String[] shopValueArray = shopValue.split(","); + return new ArrayList<>(Arrays.asList(shopValueArray)); + } + } + return new ArrayList(); + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/listener/KeyExpiredListener.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/listener/KeyExpiredListener.java new file mode 100644 index 0000000..efd394b --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/listener/KeyExpiredListener.java @@ -0,0 +1,71 @@ +package com.zhiqim.yangcai.design.listener; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +import redis.clients.jedis.JedisPubSub; + +/** + * + * [简要描述]:redis监听器处理过期key
            + * [详细描述]:
            + * + * @version 1.0 @author hc 2021年10月21日 新建与整理 + */ +public class KeyExpiredListener extends JedisPubSub +{ + private static final Log log = LogFactory.getLog(KeyExpiredListener.class); + + // @Override + // public void onPSubscribe(String patten, int subscribedChannels) + // { + // System.out.println("onPSubscribe:" + patten + " " + subscribedChannels); + // } + + @Override + public void onPMessage(String patten, String channel, String message) + { + // message = "UrgentPrice:" + designId + // 前置不为UrgentPrice则退出 + String[] split = message.split(":"); + if (!split[0].equals("UrgentPrice")) + { + return; + } + long designId = Long.parseLong(split[1]); + DesignOrder order = null; + try + { + order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", designId)); + if (Validates.isEmpty(order)) + { + return; + } + if (order.getStatus() > StatusConstants.ORDER_10.value()) + { + return; + } + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("isUrgent", false); // 加急 + updater.addField("urgentPrice", 0); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + // 记录日志 + OrderLogDao.saveOrderOperateLog(designId, "系统", "30分钟未领单系统取消订单加急费", EventConstants.ORDER_43.value()); + } + catch (Exception e) + { + log.error("订单:" + designId + "加急费操作失败", e); + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/CopyTemplateModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/CopyTemplateModel.java new file mode 100644 index 0000000..7b97cd5 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/CopyTemplateModel.java @@ -0,0 +1,54 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +import java.util.List; + +import com.zhiqim.media.dbo.MediaBg; +import com.zhiqim.media.dbo.MediaCanvas; +import com.zhiqim.media.dbo.MediaCoverMaterial; +import com.zhiqim.media.dbo.MediaImageUse; +import com.zhiqim.media.dbo.MediaMaterialParamEx; +import com.zhiqim.media.service.model.MediaModel; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; + +/** + * 复制模板model类 + * @version v1.0.0 @author zhouwenbin 2017-12-28 新建与整理 + */ +public class CopyTemplateModel extends MediaModel +{ + public CopyTemplateModel(MediaCanvas canvas, List bgList, List materialList, List coverMaterialList) + { + super(canvas, bgList, materialList, coverMaterialList); + } + + private MediaTemplate template; + private List refList; + + public MediaTemplate getTemplate() + { + return template; + } + public void setTemplate(MediaTemplate template) + { + this.template = template; + } + public List getRefList() + { + return refList; + } + public void setRefList(List refList) + { + this.refList = refList; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/PrdNumberModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/PrdNumberModel.java new file mode 100644 index 0000000..38c1da4 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/PrdNumberModel.java @@ -0,0 +1,85 @@ +/** + * 扬彩印刷设计 + * 文件名 :PrdNumberModel.java + * 创建人 :gjx + * 创建时间:2019-11-7 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * [简要描述]产品数量Model:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-11-7 新建与整理 + */ +public class PrdNumberModel +{ + private long prdNumberId; // 1.数量ID + private long prdTypeId; // 2.产品类型 + private int prdNumberStatus; // 3.状态, 0:正常,1:停用 + private String prdNumberName; // 4.名称 + private int prdNumberValue; // 5.数量值 + private int prdNumberSeq; // 6.序号 + + public long getPrdNumberId() + { + return prdNumberId; + } + + public void setPrdNumberId(long prdNumberId) + { + this.prdNumberId = prdNumberId; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public int getPrdNumberStatus() + { + return prdNumberStatus; + } + + public void setPrdNumberStatus(int prdNumberStatus) + { + this.prdNumberStatus = prdNumberStatus; + } + + public String getPrdNumberName() + { + return prdNumberName; + } + + public void setPrdNumberName(String prdNumberName) + { + this.prdNumberName = prdNumberName; + } + + public int getPrdNumberValue() + { + return prdNumberValue; + } + + public void setPrdNumberValue(int prdNumberValue) + { + this.prdNumberValue = prdNumberValue; + } + + public int getPrdNumberSeq() + { + return prdNumberSeq; + } + + public void setPrdNumberSeq(int prdNumberSeq) + { + this.prdNumberSeq = prdNumberSeq; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/PrdProductModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/PrdProductModel.java new file mode 100644 index 0000000..4a942ca --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/PrdProductModel.java @@ -0,0 +1,184 @@ +/** + * 扬彩印刷设计 + * 文件名 :PrdProductModel.java + * 创建人 :gjx + * 创建时间:2019-11-7 + */ + +package com.zhiqim.yangcai.design.model; + +/** + * [简要描述]产品model:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-11-7 新建与整理 + */ +public class PrdProductModel +{ + private long productId; // 1.产品ID + private String productName; // 2.产品名称 + private long prdTypeId; // 3.产品类型 + private long prdPaperId; // 4.纸张ID + private long prdPageId; // 5.面数ID + private long prdNumberId; // 6.数量ID + private long prdSizeId; // 7.尺寸ID + private int productStatus; // 8.状态, 0:正常,1:停用 + private long productPrice; // 9.产品价格,单位分 + private int productShipTime; // 10.出货时间,单位小时 + private boolean productCheck; // 11.是否审核 + private String productExpress; // 12.默认快递公司 + private long productSupplier; // 13.默认供应商 + private String productPolicyJson; // 14.后加工策略json + private int productSeq; // 15.序号 + + public long getProductId() + { + return productId; + } + + public void setProductId(long productId) + { + this.productId = productId; + } + + public String getProductName() + { + return productName; + } + + public void setProductName(String productName) + { + this.productName = productName; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public long getPrdPaperId() + { + return prdPaperId; + } + + public void setPrdPaperId(long prdPaperId) + { + this.prdPaperId = prdPaperId; + } + + public long getPrdPageId() + { + return prdPageId; + } + + public void setPrdPageId(long prdPageId) + { + this.prdPageId = prdPageId; + } + + public long getPrdNumberId() + { + return prdNumberId; + } + + public void setPrdNumberId(long prdNumberId) + { + this.prdNumberId = prdNumberId; + } + + public long getPrdSizeId() + { + return prdSizeId; + } + + public void setPrdSizeId(long prdSizeId) + { + this.prdSizeId = prdSizeId; + } + + public int getProductStatus() + { + return productStatus; + } + + public void setProductStatus(int productStatus) + { + this.productStatus = productStatus; + } + + public long getProductPrice() + { + return productPrice; + } + + public void setProductPrice(long productPrice) + { + this.productPrice = productPrice; + } + + public int getProductShipTime() + { + return productShipTime; + } + + public void setProductShipTime(int productShipTime) + { + this.productShipTime = productShipTime; + } + + public boolean isProductCheck() + { + return productCheck; + } + + public void setProductCheck(boolean productCheck) + { + this.productCheck = productCheck; + } + + public String getProductExpress() + { + return productExpress; + } + + public void setProductExpress(String productExpress) + { + this.productExpress = productExpress; + } + + public long getProductSupplier() + { + return productSupplier; + } + + public void setProductSupplier(long productSupplier) + { + this.productSupplier = productSupplier; + } + + public String getProductPolicyJson() + { + return productPolicyJson; + } + + public void setProductPolicyJson(String productPolicyJson) + { + this.productPolicyJson = productPolicyJson; + } + + public int getProductSeq() + { + return productSeq; + } + + public void setProductSeq(int productSeq) + { + this.productSeq = productSeq; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/PrintMsSize.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/PrintMsSize.java new file mode 100644 index 0000000..05dc966 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/PrintMsSize.java @@ -0,0 +1,78 @@ +package com.zhiqim.yangcai.design.model; + +import org.zhiqim.kernel.json.Jsons; + +/**** + * 订单 模数 对应尺寸对象 + * + * @version v1.0.0 @author lgz 2019-1-11 新建与整理 + */ +public class PrintMsSize implements Comparable +{ + private int printMs;// 印刷模数 + private double printWidth;// 印刷尺寸宽 + private double printHeight;// 印刷尺寸高 + private double printSide;// 印刷侧边长度 + + /*** 印刷模数 **/ + public int getPrintMs() + { + return printMs; + } + + /** 印刷模数 **/ + public void setPrintMs(int printMs) + { + this.printMs = printMs; + } + + /** 印刷尺寸宽 **/ + public double getPrintWidth() + { + return printWidth; + } + + /** 印刷尺寸宽 **/ + public void setPrintWidth(double printWidth) + { + this.printWidth = printWidth; + } + + /** 印刷尺寸高 **/ + public double getPrintHeight() + { + return printHeight; + } + + /** 印刷尺寸高 */ + public void setPrintHeight(double printHeight) + { + this.printHeight = printHeight; + } + + public double getPrintSide() + { + return printSide; + } + + public void setPrintSide(double printSide) + { + this.printSide = printSide; + } + + @Override + public String toString() + { + return Jsons.toString(this); + } + + @Override + public int compareTo(PrintMsSize o) + { + int res = this.getPrintMs() - o.getPrintMs(); + int r = (int) (this.printWidth * this.printHeight); + int r1 = (int) (o.printWidth * o.printHeight); + + return res != 0 ? res : r - r1; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/TemplatePreviewModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/TemplatePreviewModel.java new file mode 100644 index 0000000..7c7ade0 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/TemplatePreviewModel.java @@ -0,0 +1,111 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.model; + +import java.util.ArrayList; +import java.util.List; + +import com.zhiqim.media.service.model.MediaBgModel; + +/** + * 模板预览model + * @version v1.0.0 @author zhouwenbin 2018-1-3 新建与整理 + */ +public class TemplatePreviewModel +{ + private long mediaId; + private int totalPage; + private int mediaScore; + private double width; + private double height; +// private List svgList = new ArrayList<>(); + private List bgList = new ArrayList<>(); //新增字段,处理订单模板需要bid问题 + + public TemplatePreviewModel(long mediaId, int totalPage, int mediaScore, double width, double height) + { + this.mediaId = mediaId; + this.totalPage = totalPage; + this.mediaScore = mediaScore; + this.width = width; + this.height = height; + } + + public int getTotalPage() + { + return totalPage; + } + + public void setTotalPage(int totalPage) + { + this.totalPage = totalPage; + } + + public int getMediaScore() + { + return mediaScore; + } + + public void setMediaScore(int mediaScore) + { + this.mediaScore = mediaScore; + } + + public long getMediaId() + { + return mediaId; + } + + public void setMediaId(long mediaId) + { + this.mediaId = mediaId; + } + + public double getWidth() + { + return width; + } + + public void setWidth(double width) + { + this.width = width; + } + + public double getHeight() + { + return height; + } + + public void setHeight(double height) + { + this.height = height; + } + +// public List getSvgList() +// { +// return svgList; +// } +// +// public void setSvgList(List svgList) +// { +// this.svgList = svgList; +// } + + public List getBgList() + { + return bgList; + } + + public void setBgList(List bgList) + { + this.bgList = bgList; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/ZmrOrgModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/ZmrOrgModel.java new file mode 100644 index 0000000..058273a --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/model/ZmrOrgModel.java @@ -0,0 +1,88 @@ +/** + * 扬彩印刷设计 + * 文件名 :ZmrOrgModel.java + * 创建人 :jiangfan + * 创建时间:2020-09-09 + */ + +package com.zhiqim.yangcai.design.model; + +import org.zhiqim.manager.dbo.ZmrOrg; + +/** + * [简要描述]组织model:
            + * [详细描述]:
            + * + * @version 1.0 @author jiangfan 2020-09-09 新建与整理 + */ +public class ZmrOrgModel extends ZmrOrg +{ + private static final long serialVersionUID = 1L; + private int operatorNum; // 总人数 + private int subscribeOperatorNum; // 预约人数 + private int subscribeSum; // 预约总量 + private int finishSum; // 接单量 + private int dingGaoSum; // 定稿量 + private String finishRate; // 完成率 + + public int getOperatorNum() + { + return operatorNum; + } + + public void setOperatorNum(int operatorNum) + { + this.operatorNum = operatorNum; + } + + public int getSubscribeOperatorNum() + { + return subscribeOperatorNum; + } + + public void setSubscribeOperatorNum(int subscribeOperatorNum) + { + this.subscribeOperatorNum = subscribeOperatorNum; + } + + public int getSubscribeSum() + { + return subscribeSum; + } + + public void setSubscribeSum(int subscribeSum) + { + this.subscribeSum = subscribeSum; + } + + public int getFinishSum() + { + return finishSum; + } + + public void setFinishSum(int finishSum) + { + this.finishSum = finishSum; + } + + public int getDingGaoSum() + { + return dingGaoSum; + } + + public void setDingGaoSum(int dingGaoSum) + { + this.dingGaoSum = dingGaoSum; + } + + public String getFinishRate() + { + return finishRate; + } + + public void setFinishRate(String finishRate) + { + this.finishRate = finishRate; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/DesignRmiServer.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/DesignRmiServer.java new file mode 100644 index 0000000..b023690 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/DesignRmiServer.java @@ -0,0 +1,3542 @@ +package com.zhiqim.yangcai.design.rmi; + +import java.net.URL; +import java.net.URLConnection; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.media.dbo.MediaCanvas; +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.client.YangcaiApiFile; +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.constant.VirtualAccountConstants; +import com.zhiqim.yangcai.design.constants.BaseConstants; +import com.zhiqim.yangcai.design.constants.ComplainConstants; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.MessageThemeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.BuyerDao; +import com.zhiqim.yangcai.design.dao.DesignSizeDao; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.MerchantDao; +import com.zhiqim.yangcai.design.dao.OrderCheckDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.ScoreDesignerRecordDao; +import com.zhiqim.yangcai.design.dao.VirtualAccountDao; +import com.zhiqim.yangcai.design.dbo.complain.DesignComplain; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; +import com.zhiqim.yangcai.design.dbo.design.DesignSize; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.dispatch.DesWorkSearchLog; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; +import com.zhiqim.yangcai.design.dbo.order.OrderMessage; +import com.zhiqim.yangcai.design.dbo.order.SelfOrder; +import com.zhiqim.yangcai.design.dbo.retention.RetentionDetails; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordDetail; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateOrder; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.dbo.utils.CalculationUtil; +import com.zhiqim.yangcai.design.model.DersignerOrgOrderView; +import com.zhiqim.yangcai.design.model.DesignOrderCreateModel; +import com.zhiqim.yangcai.design.rmi.module.OrderDesignerModule; +import com.zhiqim.yangcai.design.rmi.module.OrderModule; +import com.zhiqim.yangcai.design.rmi.module.RmiError; +import com.zhiqim.yangcai.design.rmi.module.RmiResult; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.module.ApiFile; +import com.zhiqim.yangcai.dispatch.dao.DispatchTaskDao; + +@AnAlias("DesignRmiServer") +public class DesignRmiServer { + private static final Log log = LogFactory.getLog(DesignRmiServer.class); + + /**** + * 序号 key 类型 必填 说明 1 merId long 是 商家编号,由设计平台提供 2 merSecret String 是 商户秘钥 3 outId + * long 是 业务方订单号,业务方唯一 4 userContact String 否 联系人,最多30个字符 5 userMobile String 是 + * 买家联系方式,最多20个字符 6 buyerNick String 否 买家旺旺号,最多100个字符 7 userQq String 否 + * 买家联系QQ,最多20个字符 8 userWx String 否 买家联系微信号,最多20个字符 9 orderText String 是 + * 产品全称,最多200个字符 10 draftType int 是 稿件类型,0:自来稿,1:改稿自来稿,2:普通设计,3:高级设计 11 + * designType long 是 产品类型,由设计平台提供,业务方适配。 12 industryId long 是 + * 所属行业,由设计平台提供,业务方适配。 13 isUrgent boolean 是 是否加急,true:加急,false:普通 14 + * designWidth double 是 设计宽度,单位mm,最多两位小数 15 designHeight double 是 + * 设计高度,单位mm,最多两位小数 16 printWidth double 否 特殊尺寸宽度,单位mm,最多两位小数,暂不支持 17 + * printHeight double 否 特殊尺寸高度,单位mm,最多两位小数,暂不支持 18 designPage int 是 + * 设计面数,单面为1,双面为2 19 printKs int 是 设计款数 20 printMs int 是 设计模数 21 printSpecial + * String 否 特殊工艺,最多100个字符 22 userText String 否 客户文本,最多4000个字符 23 userNotice + * String 否 设计注意事项,最多1000个字符 24 userFile String 否 客户资料,多个逗号分隔,url地址必须网络可访问 每个地址 + * url 后面必须添加 fileName (文件名)和fileExt(文件扩展名参数) 25 amount double 否 金额最多支持两位小数 26 + * shopNick String 否 店铺名 最多32字符 27 afterNames String 否 后加工 多个逗号隔开 28 fileModules + * Json数组 {fileName:"11211212-客户名.jpg", fileSize:2564, fileUrl: + * "http://oss-89-taobao.oss-cn-shenzhen.aliyuncs.com/20181121/EndFile/1811211932221464.pdf"} + * + * @param request + * @throws Exception + * + * 已停用 该方法 + */ + @AnTransaction + public static void doSendDesignOrder(HttpRequest request) throws Exception { + String error_preText = "Rmi创建订单参数错误 :"; + // 必须参数 + long merId = request.getParameterLong("merId"); + merId = merId < 0 ? 0 : merId; + String merSecret = request.getParameter("merSecret", ""); + String outId = request.getParameter("outId"); + String orderText = request.getParameter("orderText"); + orderText = "null".equalsIgnoreCase(orderText) ? null : orderText; + int draftType = request.getParameterInt("draftType");// 仅支持 1:改稿自来稿,2:普通设计,3:高级设计 + long typeId = request.getParameterLong("designType"); + long industryId = request.getParameterLong("industryId"); + boolean isUrgent = request.getParameterBoolean("isUrgent"); + double designWidth = Double.valueOf(Amounts.toYuanMustRadix(request.getParameterAmount2R("designWidth")));// 标准宽 + double designHeight = Double.valueOf(Amounts.toYuanMustRadix(request.getParameterAmount2R("designHeight")));// 标准高 + int designPage = request.getParameterInt("designPage"); + int printKs = request.getParameterInt("printKs"); + int printMs = request.getParameterInt("printMs"); + String userContact = request.getParameter("userContact");// 30字符 + userContact = "null".equalsIgnoreCase(userContact) ? null : userContact; + String userMobile = request.getParameter("userMobile");// 20字符 + userMobile = "null".equalsIgnoreCase(userMobile) ? null : userMobile; + + // 验证 商户 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError()); + return; + } + + if (Validates.isEmptyBlank(outId)) {// 商户单号错误,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_OUT_ID)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + if (Validates.isEmptyBlank(orderText) || "null".equalsIgnoreCase(orderText) || orderText.length() > 200) {// 商户订单信息错误,订单信息不能为空且,不能超过200个字符 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_TEXT)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + if (Validates.isEmptyBlank(userMobile) || "null".equalsIgnoreCase(userMobile) || userMobile.length() > 20) {// 商户 + // 稿件参数错误 + // 不支持的稿件类型 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_USER_MOBILE)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + if (draftType != 1 && draftType != 2 && draftType != 3) {// 商户 稿件参数错误 不支持的稿件类型 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_DRAFT_TYPE)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + + } + + DesignType type = DesignTypeDao.get(typeId); + if (type == null) {// 商户 设计参数错误 不支持的设计类型 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_DESIGN_TYPE)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + DesignIndustry industry = Global.get(DesignIndustryCache.class).getIndustry(industryId); + if (industry == null) {// 商户 行业参数错误 不支持的行业 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_INDUSTRY)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + DesignSize designSize = DesignSizeDao.get(typeId, designWidth, designHeight); + if (designSize == null || designSize.getSizeStatus() == 1) {// 商户 尺寸参数错误 不支持的设计尺寸 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_SIZE)); + request.setResponseResult(result.toString()); + log.error("%s:" + error_preText + "[%s][%s][%s]:[%s]" + ",商户订单号:[%s]", merchant.getMerchantName(), typeId, + designWidth, designHeight, result.getError(), outId); + return; + } + + if (designPage <= 0) {// 商户 尺寸参数错误 不支持的设计尺寸 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_PAGE_LE_ZERO)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + if (printKs <= 0 || printMs <= 0) {// 商户 款模参数错误 款数/模数错误, 必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_KS_MS_LE_ZERO)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + if (Validates.isEmptyBlank(userContact) || userContact.length() > 100) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("联系人", 100))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + // 非必须部分 + String buyerNick = request.getParameter("buyerNick");// 100 + buyerNick = "null".equalsIgnoreCase(buyerNick) ? null : buyerNick; + + String userQq = request.getParameter("userQq");// 20 + userQq = "null".equalsIgnoreCase(userQq) ? null : userQq; + + String userWx = request.getParameter("userWx");// 20 + userWx = "null".equalsIgnoreCase(userWx) ? null : userWx; + + String userText = request.getParameter("userText");// 4000 + userText = "null".equalsIgnoreCase(userText) ? null : userText; + + String userNotice = request.getParameter("userNotice"); + userNotice = "null".equalsIgnoreCase(userNotice) ? null : userNotice; + + String userFile = request.getParameterNoFilter("userFile"); + userFile = "null".equalsIgnoreCase(userFile) ? null : userFile; + + String shopNick = request.getParameterNoFilter("shopNick"); + shopNick = "null".equalsIgnoreCase(shopNick) ? null : shopNick; + + String afterNames = request.getParameterNoFilter("afterNames"); + afterNames = "null".equalsIgnoreCase(afterNames) ? null : afterNames; + + String servicesMessage = request.getParameter("servicesMessage"); + servicesMessage = "null".equalsIgnoreCase(servicesMessage) ? null : servicesMessage; + + double printWidth = Double.valueOf(Amounts.toYuanMustRadix(request.getParameterAmount2R("printWidth")));// 特殊尺寸宽 + printWidth = printWidth <= 0 ? 0 : printWidth; + double printHeight = Double.valueOf(Amounts.toYuanMustRadix(request.getParameterAmount2R("printHeight")));// 特殊尺寸高 + printHeight = printHeight <= 0 ? 0 : printHeight; + + String printSpecial = request.getParameter("printSpecial");// 100 + printSpecial = "null".equalsIgnoreCase(printSpecial) ? null : printSpecial; + long amount = request.getParameterAmount2R("amount", 0); + + if (Validates.isNotEmptyBlank(buyerNick) && buyerNick.length() > 100) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("买家昵称", 100))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + if (Validates.isNotEmptyBlank(printSpecial) && printSpecial.length() > 100) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("特殊工艺", 100))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + if (Validates.isNotEmptyBlank(userQq) && userQq.length() > 20) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("用户QQ", 20))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + if (Validates.isNotEmptyBlank(userText) && userText.length() > 4000) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("用户内容文本", 4000))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + if (Validates.isNotEmptyBlank(userWx) && userWx.length() > 20) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("用户微信", 20))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + if (Validates.isNotEmptyBlank(userNotice) && userNotice.length() > 1000) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("用户注意事项", 1000))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + if (Validates.isNotEmptyBlank(shopNick) && shopNick.length() > 32) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("店铺信息", 32))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + DesignOrder order = new DesignOrder(); + order.setAmount(amount); + order.setBuyerNick(buyerNick); + order.setCreateTime(Sqls.nowTimestamp()); + order.setDesignWidth(designWidth); + order.setDesignHeight(designHeight); + order.setDesignPage(designPage); + order.setIndustryId(industryId); + order.setDraftType(draftType); + order.setMerchantId(merId); + order.setModifyTime(Sqls.nowTimestamp()); + order.setOrderText(orderText); + order.setOutId(outId); + order.setPrintWidth(printWidth); + order.setPrintHeight(printHeight); + order.setPrintKs(printKs); + order.setPrintMs(printMs); + order.setPrintSpecial(printSpecial); + order.setStatus(StatusConstants.ORDER_10.value()); + order.setTypeId(typeId); + order.setUrgent(isUrgent); + order.setUserContact(userContact); + order.setUserMobile(userMobile); + order.setUserNotice(userNotice); + order.setUserQq(userQq); + order.setUserText(userText); + order.setUserWx(userWx); + order.setShopNick(shopNick); + order.setAfterNames(Validates.isEmptyBlank(afterNames) ? null : afterNames); + order.setServicesMessage(servicesMessage); + +// order.setDesignId(outId);// 与erp 单号保持一致 + + // 创建订单时判断是否是老用户 + String designer = DispatchTaskDao.isOldUserOrder(order); + if (Validates.isNotEmpty(designer)) { + order.setOrderFlag(1); + // order.setDesignId(OrderDao.newDesignId(outId)); + // if (ORM.get(ZTable.class).count(DesignOrder.class, new Selector("designId", + // order.getDesignId()).addMust("merchantId", merId)) > 0) + // { + // RmiResult result = new RmiResult(new + // RmiError(RmiConstants.ERROR_ORD_EXSISTS)); + // request.setResponseResult(result.toString()); + // log.error(merchant.getMerchantName()+":"+error_preText + result.getError() + + // ",商户订单号:"+outId); + // return; + // } + } + + List listUserFiles = Lists.toStringList(userFile); + RmiError error = doCreateOrUpdateAtta(merchant.getMerchantName(), order.getDesignId(), listUserFiles); + if (error != null) { + RmiResult result = new RmiResult(error); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + ORM.get(ZTable.class).replace(order); + + // 将原来地订单模板设为可编辑 + DesTemplateOrder tOrder = ORM.get(ZTable.class).item(DesTemplateOrder.class, order.getDesignId()); + if (tOrder != null) { + // 3.更新模板为可编辑状态 + Updater cUpdater = new Updater(); + cUpdater.addMust("mediaId", tOrder.getDesignMediaId()); + cUpdater.addField("isEdit", 0); // 不可编辑 + cUpdater.addField("updateTime", DateTimes.getDateTimeString()); + ORM.get(ZTable.class).update(MediaCanvas.class, cUpdater); + + // 4 更新模板 状态 80 为 20 + Updater mUpdater = new Updater(); + mUpdater.addMust("mediaId", tOrder.getDesignMediaId()); + mUpdater.addField("templateType", 20); // 我的模板 + ORM.get(ZTable.class).update(MediaTemplate.class, mUpdater); + } + + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + jsonMap.put("outId", order.getOutId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", "商户【" + merchant.getMerchantName() + "】创建订单", + EventConstants.ORDER_1.value()); + log.info("[" + merchant.getMerchantName() + "]Rmi创建设计订单[" + order.getDesignId() + "]成功"); + request.setResponseResult(result.toString()); + } + + /*** 创建订单 */ + public static void doSendOrder(HttpRequest request) throws Exception { + + // DesignOrder order = new DesignOrder(); + // order.setAmount(amount); + // order.setBuyerNick(buyerNick); + // order.setCreateTime(Sqls.nowTimestamp()); + // order.setDesignWidth(designWidth); + // order.setDesignHeight(designHeight); + // order.setDesignPage(designPage); + // order.setIndustryId(industryId); + // order.setDraftType(draftType); + // order.setMerchantId(merId); + // order.setModifyTime(Sqls.nowTimestamp()); + // order.setOrderText(orderText); + // order.setOutId(outId); + // order.setPrintWidth(printWidth); + // order.setPrintHeight(printHeight); + // order.setPrintKs(printKs); + // order.setPrintMs(printMs); + // order.setPrintSpecial(printSpecial); + // order.setStatus(StatusConstants.ORDER_10.value()); + // order.setTypeId(typeId); + // order.setUrgent(isUrgent); + // order.setUserContact(userContact); + // order.setUserMobile(userMobile); + // order.setUserNotice(userNotice); + // order.setUserQq(userQq); + // order.setUserText(userText); + // order.setUserWx(userWx); + // order.setShopNick(shopNick); + // order.setAfterNames(afterNames); + // + // order.setDesignId(outId);//与erp 单号保持一致 + } + + /*** + * 设计重印 下单 1 merId long 是 设计平台分配的id,设计平台唯一 2 merSecret String 是 商户秘钥 3 + * designSrcId long 是 原来的设计订单号 4 reDesignReason String 是 重新设计原因 最多200 字符 + * + * 已停用 该方法 + */ + @AnTransaction + public static void doSendReDesignOrder(HttpRequest request) throws Exception { + String error_preText = "Rmi创建重新设计订单参数错误 :"; + // 必须参数 + long merId = request.getParameterLong("merId"); + merId = merId < 0 ? 0 : merId; + String merSecret = request.getParameter("merSecret", ""); + long designSrcId = request.getParameterLong("designSrcId"); + String outId = request.getParameter("outId"); + String reDesignReason = request.getParameter("reDesignReason"); + + // 验证 商户 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",原设计订单号:" + designSrcId); + return; + } + + if (designSrcId <= 0) {// 商户单号错误,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",原设计订单号:" + designSrcId); + return; + } + + DesignOrder src_order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("merchantId", merchant.getMerchantId()).addMust("designId", designSrcId)); + if (src_order == null) {// 商户单号错误 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",原设计订单号:" + designSrcId); + return; + } + + if (Validates.isEmptyBlank(reDesignReason) || "null".equalsIgnoreCase(reDesignReason) + || reDesignReason.length() > 200) {// 商户订单信息错误,订单信息不能为空且,不能超过200个字符 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_REASON)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",原设计订单号:" + designSrcId); + return; + } + + // long reDesignId = OrderDao.newDesignId(src_order.getOutId()); +// long reDesignId = outId;// 与erp 单号保持一致 + + DesignOrder reOrder = new DesignOrder(); + Objects.copyDeep(src_order, reOrder); + reOrder.setDesignId(Ids.longId()); + reOrder.setCreateTime(Sqls.nowTimestamp()); + reOrder.setModifyTime(Sqls.nowTimestamp()); + reOrder.setStatus(StatusConstants.ORDER_30.value()); // 正在设计 + reOrder.setDesigner(src_order.getDesigner()); // 设置设计师 + reOrder.setDesignReceiveTime(Sqls.nowTimestamp()); // 设置领单时间 + reOrder.setDesignBeginTime(Sqls.nowTimestamp()); // 设置开始设计时间 + reOrder.setDesignExclude(src_order.getDesignExclude()); // 需要排除的设计师 + reOrder.setReDesignCreateNote("由于原因【" + reDesignReason + "】,原订单[" + src_order.getDesignId() + "]重新设计");// 创建重新设计原因 + reOrder.setReDesignSrcId(designSrcId); + reOrder.setOutId(outId); + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector("designId", src_order.getDesignId())); + for (DesignAtta designAtta : attaList) { + designAtta.setAttaId(Ids.longId()); + designAtta.setDesignId(reOrder.getDesignId()); + } + + // 订单入库 设计原订单不取消 + // Updater updater = new Updater(); + // updater.addMust("designId", src_order.getDesignId()); + // updater.addField("status", StatusConstants.ORDER_F110.value()); + // updater.addField("modifyTime", Sqls.nowTimestamp()); + // + // ORM.get(ZTable.class).update(DesignOrder.class, updater); + + ORM.get(ZTable.class).replace(reOrder); + ORM.get(ZTable.class).replaceBatch(attaList); + + OrderLogDao.saveOrderOperateLog(src_order.getDesignId(), "系统", + "[接收到补单]由于原因【" + reDesignReason + "】需要重新设计,新设计单号: " + outId, EventConstants.ORDER_17.value()); + OrderLogDao.saveOrderOperateLog(reOrder.getDesignId(), "系统", + "[接收到补单]由于原因【" + reDesignReason + "】,原订单[" + src_order.getDesignId() + "]重新设计", + EventConstants.ORDER_3.value()); + + Map jsonMap = new HashMap(); + jsonMap.put("designId", reOrder.getDesignId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + + log.info("[" + merchant.getMerchantName() + "]Rmi重新设计,创建订单成功"); + request.setResponseResult(result.toString()); + + } + + /*** + * 订单修改 序号 key 类型 必填 说明 1 merId long 是 设计平台分配的id,设计平台唯一 2 merSecret String 是 + * 商户秘钥 3 designId long 是 服务端设计单id 4 orderText String 是 产品全称 5 userContact + * String 否 联系人 6 userMobile String 是 买家联系方式 7 buyerNick String 否 买家旺旺号 8 + * printSpecial String 否 特殊工艺 9 userText String 否 客户文本 10 userFile String 否 + * 客户资料,多个逗号分隔,地址必须网络可访问 11 userQq String 否 买家联系QQ 12 userWx String 否 买家联系微信号 13 + * userNotice String 否 设计注意事项 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doUpdateDesignOrder(HttpRequest request) throws Exception { + String error_preText = "Rmi修改订单信息参数错误:"; + long merId = request.getParameterLong("merId"); + merId = merId < 0 ? 0 : merId; + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError()); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchant.getMerchantId())); + if (order == null) {// 商户单订单不存在,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + // 非必须部分 + String orderText = request.getParameter("orderText"); + orderText = "null".equals(orderText) ? null : orderText; + if (Validates.isNotEmptyBlank(orderText) && orderText.length() > 200) {// 商户订单信息错误,订单信息不能为空且,不能超过200个字符 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_TEXT)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + String userContact = request.getParameter("userContact");// 30字符 + userContact = "null".equalsIgnoreCase(userContact) ? null : userContact; + + String userMobile = request.getParameter("userMobile"); + userMobile = "null".equalsIgnoreCase(userMobile) ? null : userMobile; + + String buyerNick = request.getParameter("buyerNick");// 100 + buyerNick = "null".equalsIgnoreCase(buyerNick) ? null : buyerNick; + + String printSpecial = request.getParameter("printSpecial");// 100 + printSpecial = "null".equalsIgnoreCase(printSpecial) ? null : printSpecial; + + String userText = request.getParameter("userText");// 4000 + userText = "null".equalsIgnoreCase(userText) ? null : userText; + + String userFile = request.getParameterNoFilter("userFile"); + userFile = "null".equalsIgnoreCase(userFile) ? null : userFile; + + String userQq = request.getParameter("userQq");// 20 + userQq = "null".equalsIgnoreCase(userQq) ? null : userQq; + + String userWx = request.getParameter("userWx");// 20 + userWx = "null".equalsIgnoreCase(userWx) ? null : userWx; + + String userNotice = request.getParameter("userNotice"); + userNotice = "null".equalsIgnoreCase(userNotice) ? null : userNotice;// 设计注意事项 + + String servicesMessage = request.getParameter("servicesMessage");// 客服留言 + servicesMessage = "null".equalsIgnoreCase(servicesMessage) ? null : servicesMessage; + + String payAmount = request.getParameter("payAmount");// 订单金额 + payAmount = "null".equalsIgnoreCase(payAmount) ? null : payAmount; + + String customerQrcodeUrl = request.getParameter("customerQrcodeUrl");// 服务器二维码 + customerQrcodeUrl = "null".equalsIgnoreCase(customerQrcodeUrl) ? null : customerQrcodeUrl; + + if (Validates.isNotEmptyBlank(userContact) && userContact.length() > 30) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("联系人", 30))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + if (Validates.isNotEmptyBlank(userMobile) && userMobile.length() > 20) {// 商户 稿件参数错误 不支持的稿件类型 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_USER_MOBILE)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + if (Validates.isNotEmptyBlank(buyerNick) && buyerNick.length() > 100) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("买家昵称", 100))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + if (Validates.isNotEmptyBlank(printSpecial) && printSpecial.length() > 100) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("特殊工艺", 100))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + if (Validates.isNotEmptyBlank(userQq) && userQq.length() > 20) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("用户QQ", 20))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + if (Validates.isNotEmptyBlank(userText) && userText.length() > 4000) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("用户内容文本", 4000))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + if (Validates.isNotEmptyBlank(userWx) && userWx.length() > 20) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("用户微信", 20))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + if (Validates.isNotEmptyBlank(userNotice) && userNotice.length() > 1000) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("用户注意事项", 1000))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + if (Validates.isNotEmptyBlank(customerQrcodeUrl) && customerQrcodeUrl.length() > 1000) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("服务器二维码", 200))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + List listUserFiles = Lists.toStringList(userFile); + RmiError error = doCreateOrUpdateAtta(merchant.getMerchantName(), designId, listUserFiles); + if (error != null) { + RmiResult result = new RmiResult(error); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + Updater updater = new Updater(); + updater.addMust("designId", order.getDesignId()); + updater.addMust("merchantId", order.getMerchantId()); + updater.addField("merchantId", order.getMerchantId());// 添加一个必须修改 信息 + + if (Validates.isNotEmptyBlank(orderText)) { + updater.addField("orderText", orderText); + } + + if (Validates.isNotEmptyBlank(userContact)) { + updater.addField("userContact", userContact); + } + + if (Validates.isNotEmptyBlank(userMobile)) { + updater.addField("userMobile", userMobile); + } + + if (Validates.isNotEmptyBlank(buyerNick)) { + updater.addField("buyerNick", buyerNick); + } + + if (Validates.isNotEmptyBlank(printSpecial)) { + updater.addField("printSpecial", printSpecial); + } + + if (Validates.isNotEmptyBlank(servicesMessage)) { + updater.addField("servicesMessage", servicesMessage); + } + + if (Validates.isNotEmptyBlank(payAmount)) { + updater.addField("amount", Long.parseLong(payAmount)); + } + + if (Validates.isNotEmptyBlank(userQq)) { + updater.addField("userQq", userQq); + } + + if (Validates.isNotEmptyBlank(userWx)) { + updater.addField("userWx", userWx); + } + + if (Validates.isNotEmptyBlank(userText)) { + updater.addField("userText", userText); + } + + if (Validates.isNotEmptyBlank(userNotice)) { + updater.addField("userNotice", userNotice); + } + + if (Validates.isNotEmptyBlank(customerQrcodeUrl)) { + ORM.get(ZTable.class).update(SelfOrder.class, new Updater().addMust("designId", order.getDesignId()) + .addField("customerQrcodeUrl", customerQrcodeUrl)); + } + + // 行业 + long industryId = request.getParameterLong("industryId"); + if (industryId > 0) {// 行业错误 + if (Global.get(DesignIndustryCache.class).getIndustry(industryId) == null) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_INDUSTRY)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + + order.getOutId()); + return; + } + + updater.addField("industryId", industryId); + } + + // //加急 + // boolean isUrgent = request.getParameterBoolean("isUrgent"); + // updater.addField("isUrgent", isUrgent); + + // ***************************************************************** + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", "[接收到商户修改订单信息]", EventConstants.ORDER_20.value()); + log.info("[" + merchant.getMerchantName() + "]Rmi修改订单[" + order.getDesignId() + "]信息成功"); + + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + jsonMap.put("outId", order.getOutId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + request.setResponseResult(result.toString()); + } + + /**** + * 修改 客户资料 + * + * @param merchantName + * @param designId + * @param userUrlList + * @return + * @throws Exception + */ + private static RmiError doCreateOrUpdateAtta(String merchantName, long designId, List userUrlList) + throws Exception { + if (userUrlList.size() == 0) { + return null; + } + List attaList = new ArrayList(); + List errorUrlList = new ArrayList(); + for (int i = 0; i < userUrlList.size(); i++) { + String fileUrl = userUrlList.get(i); + if (!Validates.isUrl(fileUrl)) { + String note = "资料文件【" + fileUrl + "】不是url地址" + "\r\n"; + errorUrlList.add(note); + continue; + } + + String fileName = Urls.get(fileUrl, "fileName"); + fileName = Strings.trim(fileName); + + if (Validates.isEmptyBlank(fileName)) { + String note = "资料文件【" + fileUrl + "】未知文件名参数" + "\r\n"; + errorUrlList.add(note); + continue; + } + + String fileExt = ""; + if (fileName.lastIndexOf(".") > 0) { + fileExt = fileName.substring(fileName.lastIndexOf(".") + 1); + } + + if (Validates.isEmptyBlank(fileExt)) { + String note = "资料文件【" + fileUrl + "】未知文件名扩展名" + "\r\n"; + errorUrlList.add(note); + continue; + } + + long fileLength = 0; + try { + URLConnection uc = new URL(fileUrl).openConnection(); + fileLength = uc.getContentLengthLong(); + } catch (Exception e) { + String note = "资料文件【" + fileUrl + "】文件不可访问" + "\r\n"; + errorUrlList.add(note); + continue; + } + + // if (fileLength == 0) + // { + // String note = "("+fileUrl+")文件不可访问"+"\r\n"; + // errorUrlList.add(note); + // continue; + // } + + DesignAtta atta = new DesignAtta(); + atta.setAttaId(Ids.longId()); + atta.setAttaModul(FileTypeConstants.FILE_CUSTOM.value()); + atta.setDesignId(designId); + // atta.setFileid(fileid); + atta.setFileName(fileName); + atta.setFileType(fileExt); + atta.setFileSize(fileLength); + atta.setOperatorCode(merchantName); + atta.setOssType(1); + atta.setOssUrl(fileUrl); + atta.setAttaFlag(1); + // atta.setSavePath(savePath); + atta.setUploadTime(Sqls.nowTimestamp()); + attaList.add(atta); + } + + if (errorUrlList.size() > 0) { + return new RmiError(RmiConstants.ERROR_FILE_URL.value(), + RmiConstants.ERROR_FILE_URL.desc() + Lists.toString(errorUrlList)); + } + + if (attaList.size() > 0) { + ORM.get(ZTable.class).delete(DesignAtta.class, new Selector("designId", designId).addMust("attaFlag", 1)); + ORM.get(ZTable.class).insertBatch(attaList); + } + + return null; + } + + /** + * 订单取消 序号 key 类型 必填 说明 1 merId long 是 设计平台分配的id,设计平台唯一 2 designId long 是 + * 服务端设计单id 3 cancelReason String 是 取消原因 不能为空 且不能超过 200字符 + * + * @editor HuangZhiGao + * @date 2020/3/31 14:42 4 forceCancel 是否为强制取消[用于根据淘宝退款记录关闭系统订单后续流程] + */ + @AnTransaction + public static void doCancelDesignOrder(HttpRequest request) throws Exception { + String error_preText = "取消设计平台订单参数错误 :"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String cancelReason = request.getParameter("cancelReason"); + + // 是否为强制取消 + Boolean forceCancel = Boolean.FALSE; + if (Validates.isNotEmpty(request.getParameter("forceCancel"))) { + forceCancel = new Boolean(request.getParameter("forceCancel")); + } + cancelReason = "null".equals(cancelReason) ? null : cancelReason; + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchant.getMerchantId())); + if (order == null) {// 商户单订单不存在,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + if (order.getStatus() < 0) {// 已经取消了 + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + log.info("[" + merchant.getMerchantName() + "]设计订单[" + order.getDesignId() + "]取消成功"); + request.setResponseResult(result.toString()); + return; + } + if (order.getStatus() == StatusConstants.ORDER_34.value()) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_STATUS_IS_NOTBE34)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + if (!forceCancel) {// 设计单 + if (order.getStatus() != StatusConstants.ORDER_10.value() + && order.getStatus() != StatusConstants.ORDER_20.value() + && order.getStatus() != StatusConstants.ORDER_34.value()) {// + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_BY_STATUS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + } + if (Validates.isEmptyBlank(cancelReason) || cancelReason.length() > 200) {// 商户订单信息错误,订单信息不能为空且,不能超过200个字符 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_REASON)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + Updater updater = new Updater().addMust("designId", designId); + int eventType = EventConstants.ORDER_F10.value(); + int status = StatusConstants.ORDER_F100.value(); + if (Validates.isNotEmpty(order.getDesigner())) { + status = StatusConstants.ORDER_F110.value(); + eventType = EventConstants.ORDER_F20.value(); + updater.addField("refundTime", DateTimes.getDateTimeString()); + + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_106.value())); + scoreDesignerRecordDetail.setOperatorCode(order.getDesigner()); + scoreDesignerRecordDetail.setOrderId(order.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + + updater.addField("status", status); + updater.addField("canceler", "系统"); + updater.addField("cancelReason", cancelReason); + updater.addField("cancelTime", Sqls.nowTimestamp()); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + OrderLogDao.saveOrderOperateLog(designId, "系统", "接收到售前客服取消:" + cancelReason, eventType); + + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + log.info("[" + merchant.getMerchantName() + "]设计订单[" + order.getDesignId() + "]取消成功"); + request.setResponseResult(result.toString()); + } + + /** + * 在淘宝退款记录操作关闭系统订单时
            + * 取消设计平台订单要单独考虑标准自来稿订单 + * + * 1 outId erp订单id 2 cancelReason 取消原因 + * + * @return boolean + * @author HuangZhiGao + * @date 2020/4/1 14:35 + */ + @AnTransaction + public static void doCancelDraftStandard(HttpRequest request) throws Exception { + String error_preText = "Rmi取消订单参数错误 :"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long outId = request.getParameterLong("outId"); + String cancelReason = request.getParameter("cancelReason"); + cancelReason = "null".equals(cancelReason) ? null : cancelReason; + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",外部订单号:" + outId); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("outId", outId <= 0 ? 0 : outId).addMust("merchantId", merchant.getMerchantId())); + if (order == null) {// 商户单订单不存在,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",外部订单号:" + outId); + return; + } + + if (order.getStatus() < 0) {// 已经取消了 + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + log.info("[" + merchant.getMerchantName() + "]Rmi设计平台标准自来稿订单[" + order.getDesignId() + "]取消成功"); + request.setResponseResult(result.toString()); + return; + } + + if (Validates.isEmptyBlank(cancelReason) || cancelReason.length() > 200) {// 商户订单信息错误,订单信息不能为空且,不能超过200个字符 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_REASON)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + + order.getDesignId()); + return; + } + Updater updater = new Updater().addMust("outId", outId); + int eventType = EventConstants.ORDER_F10.value(); + int status = StatusConstants.ORDER_F100.value(); + if (Validates.isNotEmpty(order.getDesigner())) { + status = StatusConstants.ORDER_F110.value(); + eventType = EventConstants.ORDER_F20.value(); + updater.addField("refundTime", DateTimes.getDateTimeString()); + + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_106.value())); + scoreDesignerRecordDetail.setOperatorCode(order.getDesigner()); + scoreDesignerRecordDetail.setOrderId(order.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + + updater.addField("status", status); + updater.addField("canceler", "系统"); + updater.addField("cancelReason", cancelReason); + updater.addField("cancelTime", Sqls.nowTimestamp()); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", "店铺已退款取消操作:" + cancelReason, eventType); + + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + log.info("[" + merchant.getMerchantName() + "]Rmi设计平台标准自来稿订单[" + order.getDesignId() + "]取消成功"); + request.setResponseResult(result.toString()); + } + + /*** + * 订单查询 序号 key 类型 必填 说明 1 merId long 是 设计平台分配的id,设计平台唯一 2 merSecret String 是 + * 商户秘钥 3 designId long 否 服务端设计单id + * + * @param request + * @throws Exception + * + * 已停用 该方法 + */ + public static void doQueryDesignOrder(HttpRequest request) throws Exception { + String error_preText = "Rmi查询订单参数错误 :"; + long merId = request.getParameterLong("merId"); + merId = merId < 0 ? 0 : merId; + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + Selector selector = new Selector("merchantId", merId); + if (designId > 0) { + selector.addMaybe("designId", designId); + } + + selector.addMustThenGE("modifyTime", Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringBySecond(10 * 60)));// 10分钟前 + selector.addOrderbyDesc("modifyTime"); + + List designOrderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + List orderList = new ArrayList(); + for (DesignOrder order : designOrderList) { + OrderModule module = new OrderModule(); + Objects.copyDeep(order, module); + + if (order.getStatus() == StatusConstants.ORDER_70.value()) { + + String[] attaModuls = new String[] { FileTypeConstants.FILE_END.value(), + FileTypeConstants.FILE_DESGIN.value(), FileTypeConstants.FILE_WORK.value() }; + + List apiFiles = new ArrayList<>(); + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector("designId", order.getDesignId()).addMustIn("attaModul", attaModuls)); + for (DesignAtta atta : attaList) { + if (FileTypeConstants.FILE_END.value().equalsIgnoreCase(atta.getAttaModul())) {// 成品文件 + module.setEndFileUrl(atta.getOssUrl()); + module.setEndFileExt(atta.getFileType()); + module.setEndFileLength(atta.getFileSize()); + } else if (FileTypeConstants.FILE_DESGIN.value().equalsIgnoreCase(atta.getAttaModul())) {// 设计文件 + module.setDesignFileUrl(atta.getOssUrl()); + module.setDesignFileExt(atta.getFileType()); + module.setDesignFileLength(atta.getFileSize()); + } + + ApiFile apiFile = new ApiFile(); + apiFile.setAttaId(atta.getAttaId()); + apiFile.setDesignId(atta.getDesignId()); + apiFile.setAttaModule(atta.getAttaModul()); + apiFile.setDownUrl(atta.getOssUrl()); + apiFile.setFileName(atta.getFileName()); + apiFile.setFileExt(atta.getFileType()); + apiFile.setFileSize(atta.getFileSize()); + + module.setApiFiles(apiFiles); + } + } + + orderList.add(module); + } + RmiResult result = new RmiResult(Jsons.toString(orderList)); + request.setResponseResult(result.toString()); + } + + /** + * 印前退回 序号 key 类型 必填 说明 1 merId long 是 设计平台分配的id,设计平台唯一 2 merSecret String 是 + * 商户秘钥 3 designId long 是 设计订单号 4 prepressBackReason String 是 退回设计原因 最多200 字符 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doPrepressBack(HttpRequest request) throws Exception { + String error_preText = "Rmi印前退回参数错误 :"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String prepressBackReason = request.getParameter("prepressBackReason"); + prepressBackReason = "null".equals(prepressBackReason) ? null : prepressBackReason; + + // 验证 商户 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + // 1.查询订单 + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchant.getMerchantId())); + if (order == null) {// 商户单订单不存在,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + // 2.检查状态 + if (order.getStatus() != StatusConstants.ORDER_70.value()) {// 不是已完成的的订单不允许退回 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_BY_STATUS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + // 3.检查参数 + if (Validates.isEmptyBlank(prepressBackReason) || prepressBackReason.length() > 200) {// 商户订单信息错误,订单信息不能为空且,不能超过200个字符 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_REASON)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + // 操作订单表 + Updater updater = new Updater().addMust("designId", designId); + updater.addField("status", StatusConstants.ORDER_55.value()); + updater.addField("prepressBackReason", prepressBackReason); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 日志信息 + OrderLogDao.saveOrderOperateLog(designId, "系统", "[接收到印前退回]:" + prepressBackReason, + EventConstants.ORDER_F30.value()); + + // 响应信息 + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + log.info("[" + merchant.getMerchantName() + "]Rmi印前设计订单[" + order.getDesignId() + "]退回成功"); + request.setResponseResult(result.toString()); + } + + /** + * 审稿退回 序号 key 类型 必填 说明 1 merId long 是 设计平台分配的id,设计平台唯一 2 merSecret String 是 + * 商户秘钥 3 designId long 是 设计订单号 4 backReason String 是 退回设计原因 最多200 字符 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void doCheckback(HttpRequest request) throws Exception { + String error_preText = "Rmi审稿退回参数错误 :"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String backReason = request.getParameter("backReason"); + backReason = "null".equals(backReason) ? null : backReason; + String url = request.getParameter("url"); + url = "null".equals(url) ? null : url; + + // 验证 商户 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + // 1.查询订单 + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchant.getMerchantId())); + if (order == null) {// 商户单订单不存在,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + // 2.检查状态 + if (order.getStatus() < StatusConstants.ORDER_55.value())// 未定稿 不能退回 + {// 不是已完成的的订单不允许退回 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_BY_STATUS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + // 3.检查参数 + if (Validates.isEmptyBlank(backReason) || backReason.length() > 1000) {// 商户订单信息错误,订单信息不能为空且,不能超过200个字符 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_REASON)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + // 操作订单表 + Updater updater = new Updater().addMust("designId", designId); + updater.addField("status", StatusConstants.ORDER_30.value()); + updater.addField("checkBackReason", backReason); + updater.addField("checkBackPictureUrl", url); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + DesTemplateOrder tOrder = ORM.get(ZTable.class).item(DesTemplateOrder.class, designId); + if (tOrder != null) { + // 3.更新模板为可编辑状态 + Updater cUpdater = new Updater(); + cUpdater.addMust("mediaId", tOrder.getDesignMediaId()); + cUpdater.addField("isEdit", 0); // 不可编辑 + cUpdater.addField("updateTime", DateTimes.getDateTimeString()); + ORM.get(ZTable.class).update(MediaCanvas.class, cUpdater); + + // 4 更新模板 状态 80 为 20 + Updater mUpdater = new Updater(); + mUpdater.addMust("mediaId", tOrder.getDesignMediaId()); + mUpdater.addField("templateType", 20); // 我的模板 + ORM.get(ZTable.class).update(MediaTemplate.class, mUpdater); + } + // 日志信息 + OrderLogDao.saveOrderOperateLog(designId, "系统", "[接收到审稿退回]:" + backReason, EventConstants.ORDER_10.value()); + + // 响应信息 + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + log.info("[" + merchant.getMerchantName() + "]Rmi审稿订单[" + order.getDesignId() + "]退回成功"); + request.setResponseResult(result.toString()); + } + + /**** + * 拒绝退款 序号 key 类型 必填 说明 1 merId long 是 设计平台分配的id,设计平台唯一 2 merSecret String 是 + * 商户秘钥 3 designId long 是 设计订单号 4 rejectReason String 是 拒绝原因 最多200 字符 + */ + public static void doRejectRefund(HttpRequest request) throws Exception { + String error_preText = "Rmi印前退回参数错误 :"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String rejectReason = request.getParameter("rejectReason"); + rejectReason = "null".equals(rejectReason) ? null : rejectReason; + + // 验证 商户 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + // 1.查询订单 + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchant.getMerchantId())); + if (order == null) {// 商户单订单不存在,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + // 2.检查状态 + if (order.getStatus() != StatusConstants.ORDER_34.value()) {// 不是请求退款的订单不允许操作 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_BY_STATUS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + // 3.检查参数 + if (Validates.isEmptyBlank(rejectReason) || rejectReason.length() > 200) {// 商户订单信息错误,订单信息不能为空且,不能超过200个字符 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_REASON)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + // 操作订单表 + Updater updater = new Updater().addMust("designId", designId); + updater.addField("status", StatusConstants.ORDER_30.value()); + updater.addField("modifyTime", Sqls.nowTimestamp()); + if (Validates.isEmpty(order.getDesignDraftTime())) { + updater.addField("designBeginTime", Sqls.nowTimestamp()); + } else { + updater.addField("designBeginTime", order.getDesignBeginTime()); + } + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 日志信息 + OrderLogDao.saveOrderOperateLog(designId, "系统", "[接收到拒绝退款,备注:" + rejectReason, EventConstants.ORDER_5.value()); + // 响应信息 + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + log.info("[" + merchant.getMerchantName() + "]Rmi设计订单[" + order.getDesignId() + "]拒绝退款成功"); + request.setResponseResult(result.toString()); + + } + + /*** + * 基础参数 查询 + */ + + public static void doQueryDesignTypeList(HttpRequest request) throws Exception { + List list = ORM.get(ZTable.class).list(DesignType.class, + new Selector("isEnabled").addOrderbyAsc("typeSeq")); + request.setResponseResult(Jsons.toString(list)); + } + + public static void doQueryDesignIndustryList(HttpRequest request) throws Exception { + List list = Global.get(DesignIndustryCache.class).getIndustryListAll(); + request.setResponseResult(Jsons.toString(list)); + } + + /** + * 修改订单规格 参数 描述 必须 数据类型 + * + * merId 商户编号 是 long merSecret 商户秘钥 是 String designId 设计平台订单号 是 long orderText + * 订单信息 是 Stirng (orderText + policy 不能超过200字符) policy 后加工信息 否 String (orderText + * + policy 不能超过200字符) designPage 设计面数 是 int draftType 稿件类型 是 int 0,1,2,3 + * printWidth 自定义设计宽 否 double 最多支持2位小数 printHeight 自定义设计高 否 double 最多支持2位小数 + * printKs 设计款 否 int printMs 设计模 否 int industryId 行业编号 否 long isUrgent 是否加急 否 + * boolean + * + * @param request + * @throws Exception + * + * 已停用 该方法 + */ + public static void doUpdateOrderSpecification(HttpRequest request) throws Exception { + String error_preText = "Rmi修改订单信息参数错误:"; + long merId = request.getParameterLong("merId"); + merId = merId < 0 ? 0 : merId; + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError()); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchant.getMerchantId())); + if (order == null) {// 商户单订单不存在,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + // ***************************************************************** + // *************************修改报价部分******************************* + // ***************************************************************** + + // 尺寸 + // double designWidth = + // Double.valueOf(Amounts.toYuanMustRadix(request.getParameterAmount2R("designWidth")));//标准宽 + // double designHeight = + // Double.valueOf(Amounts.toYuanMustRadix(request.getParameterAmount2R("designHeight")));//标准高 + + Updater updater = new Updater(); + updater.addMust("designId", designId); + + // 面数 + int designPage = request.getParameterInt("designPage"); + if (designPage > 0) { + updater.addField("designPage", designPage); + } + + // 订单信息 && 后加工 + String orderText = request.getParameter("orderText"); + String policy = request.getParameter("policy"); + orderText = "null".equals(orderText) ? null : Validates.isEmptyBlank(orderText) ? null : orderText; + + String afterNames = request.getParameterNoFilter("afterNames"); + afterNames = "null".equalsIgnoreCase(afterNames) ? null : afterNames; + + if (Validates.isNotEmptyBlank(policy)) { + orderText += " " + policy; + } + + if (Validates.isNotEmptyBlank(orderText)) { + if (orderText.length() > 200) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_TEXT)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + + order.getOutId()); + return; + } + + updater.addField("orderText", orderText); + } + + // 自定义尺寸 + double printWidth = Double.valueOf(Amounts.toYuanMustRadix(request.getParameterAmount2R("printWidth")));// 特殊尺寸宽 + printWidth = printWidth <= 0 ? 0 : printWidth; + double printHeight = Double.valueOf(Amounts.toYuanMustRadix(request.getParameterAmount2R("printHeight")));// 特殊尺寸高 + printHeight = printHeight <= 0 ? 0 : printHeight; + + updater.addField("printWidth", printWidth); + updater.addField("printHeight", printHeight); + + // 款模 + int printKs = request.getParameterInt("printKs"); + int printMs = request.getParameterInt("printMs"); + if (printKs > 0 && printMs > 0) { + updater.addField("printKs", printKs); + updater.addField("printMs", printMs); + } + + // 行业 + long industryId = request.getParameterLong("industryId"); + if (industryId > 0) { + if (industryId > 0 && Global.get(DesignIndustryCache.class).getIndustry(industryId) == null) {// 行业错误 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_INDUSTRY)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + + order.getOutId()); + return; + } + + updater.addField("industryId", industryId); + } + + // 加急 + boolean isUrgent = request.getParameterBoolean("isUrgent"); + updater.addField("isUrgent", isUrgent); + + // 客服留言 + String servicesMessage = request.getParameter("servicesMessage"); + servicesMessage = "null".equalsIgnoreCase("servicesMessage") ? null : servicesMessage; + updater.addField("servicesMessage", servicesMessage); + + // 稿件类型 如果 被改成了 自来稿 则取消订单 + boolean iscancel = false; + int draftType = request.getParameterInt("draftType");// 仅支持 1:改稿自来稿,2:普通设计,3:高级设计 + + if (draftType != DraftConstants.DRAFT_PAGE_DESIGN.value() + && draftType != DraftConstants.DRAFT_COMMON_DESIGN.value()) { + iscancel = true; + } + + updater.addField("afterNames", Validates.isEmptyBlank(afterNames) ? null : afterNames); + // ***************************************************************** + if (iscancel) { + String canceler = request.getParameter("operatorCode"); + if (Validates.isEmptyBlank(canceler) || "null".equalsIgnoreCase(canceler)) { + canceler = null; + } + + updater.addField("status", StatusConstants.ORDER_F100.value()); + updater.addField("canceler", "系统"); + updater.addField("cancelReason", + "订单稿件由【" + DraftConstants.get(order.getDraftType()) + "】改成【" + DraftConstants.get(draftType) + "】"); + updater.addField("cancelTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", "[接收到 订单规格修改,订单取消,订单稿件由【" + + DraftConstants.get(order.getDraftType()) + "】改成【" + DraftConstants.get(draftType) + "】", + EventConstants.ORDER_F10.value()); + } else { + ORM.get(ZTable.class).update(DesignOrder.class, updater); + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", + "[接收到 订单规格修改,订单规格,由【" + order.getOrderText() + "】改成【" + orderText + "】", + EventConstants.ORDER_20.value()); + } + + log.info("[" + merchant.getMerchantName() + "]Rmi修改订单规格"); + + // 相应数据 + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + jsonMap.put("outId", order.getOutId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + request.setResponseResult(result.toString()); + } + + /**** + * erp 订单列表 信息修改 接口 + * + * @param request + * @throws Exception + * + * 已停用 该方法, 但未上线 + */ + public static void doUpdateOrderInfo(HttpRequest request) throws Exception { + String error_preText = "Rmi 订单信息修改:"; + long merId = request.getParameterLong("merId"); + merId = merId < 0 ? 0 : merId; + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String userMobile = request.getParameter("userMobile"); + String userQq = request.getParameter("userQq"); + String userWx = request.getParameter("userWx"); + String printSpecial = request.getParameter("printSpecial"); + String servicesMessage = request.getParameter("servicesMessage"); + long industryId = request.getParameterLong("industryId"); + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError()); + return; + } + + // 订单验证 + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchant.getMerchantId())); + if (order == null) {// 商户单订单不存在,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + String outId = order.getOutId(); + + userMobile = "null".equals(userMobile) ? null : userMobile; + userQq = "null".equals(userQq) ? null : userQq; + userWx = "null".equals(userWx) ? null : userWx; + printSpecial = "null".equals(printSpecial) ? null : printSpecial; + servicesMessage = "null".equals(servicesMessage) ? null : servicesMessage; + + boolean isUrgent = request.getParameterBoolean("isUrgent", order.isUrgent()); + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("isUrgent", isUrgent); + if (industryId > 0) { + DesignIndustry industry = Global.get(DesignIndustryCache.class).getIndustry(industryId); + if (industry == null) {// 商户 行业参数错误 不支持的行业 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_INDUSTRY)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + updater.addField("industryId", industryId); + } + + if (Validates.isNotEmptyBlank(userMobile)) { + if (userMobile.length() > 64) {// 商户 稿件参数错误 不支持的稿件类型 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_USER_MOBILE)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + updater.addField("userMobile", userMobile); + } + + if (Validates.isNotEmptyBlank(printSpecial)) { + if (printSpecial.length() > 100) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("特殊工艺", 100))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + + updater.addField("printSpecial", printSpecial); + } + + if (Validates.isNotEmptyBlank(userQq)) { + if (userQq.length() > 64) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("用户QQ", 20))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + updater.addField("userQq", userQq); + } + + if (Validates.isNotEmptyBlank(userWx)) { + if (userWx.length() > 64) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_TO_LONG("用户微信", 20))); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",商户订单号:" + outId); + return; + } + updater.addField("userWx", userWx); + } + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + OrderLogDao.saveOrderOperateLog(designId, "系统", "[订单信息修改]", EventConstants.ORDER_20.value()); + // 响应数据 + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + jsonMap.put("outId", order.getOutId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + request.setResponseResult(result.toString()); + } + + /** + * portal 自助上传 修改文字信息 + * + * @param merId + * @param merSecret + * @param designId + * @param userText + * @param userNotice + * @param userQq + * @param userWx + * @param userMobile + * @param request + * @throws Exception + * + * 已停用 该方法, 但未上线 + */ + public static void doUpdateTextInfo(HttpRequest request) throws Exception { + String error_preText = "Rmi 订单文字信息修改:"; + long merId = request.getParameterLong("merId"); + merId = merId < 0 ? 0 : merId; + String merSecret = request.getParameter("merSecret", ""); + + long designId = request.getParameterLong("designId"); + String userText = request.getParameter("userText"); + String userNotice = request.getParameter("userNotice"); + String userQq = request.getParameter("userQq"); + String userWx = request.getParameter("userWx"); + String userMobile = request.getParameter("userMobile"); + + userText = "null".equals(userText) ? null : userText; + userNotice = "null".equals(userNotice) ? null : userNotice; + userQq = "null".equals(userQq) ? null : userQq; + userWx = "null".equals(userWx) ? null : userWx; + userMobile = "null".equals(userMobile) ? null : userMobile; + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError()); + return; + } + + // 订单验证 + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchant.getMerchantId())); + if (order == null) {// 商户单订单不存在,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("userText", userText); + updater.addField("userNotice", userNotice); + updater.addField("userQq", userQq); + updater.addField("userWx", userWx); + + if (Validates.isNotEmptyBlank(userMobile)) { + updater.addField("userMobile", userMobile); + } + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 响应数据 + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + jsonMap.put("outId", order.getOutId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + request.setResponseResult(result.toString()); + + log.info("doUpdateTextInfo 修改信息完成"); + } + + /*** + * 刷新文件资料,添加或者删除 + * + * @param merId + * @param merSecret + * @param designId + * @param userFile userFile 每个网络路径必须 包含 fileName 参数 + * + * 已停用 该方法, 但未上线 + */ + public static void doRefreshFileMaterials(HttpRequest request) throws Exception { + String error_preText = "Rmi刷新客户资料:"; + long merId = request.getParameterLong("merId"); + merId = merId < 0 ? 0 : merId; + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError()); + return; + } + + // 订单验证 + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchant.getMerchantId())); + if (order == null) {// 商户单订单不存在,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError()); + return; + } + + String fileUrls = request.getParameterNoFileterOnCNT("userFile"); + List listUserFiles = Lists.toStringList(fileUrls); + + List attaList = new ArrayList(); + List errorUrlList = new ArrayList(); + Map fileMap = new HashMap<>(); + for (int i = 0; i < listUserFiles.size(); i++) { + String fileUrl = listUserFiles.get(i); + if (!Validates.isUrl(fileUrl)) { + String note = "资料文件【" + fileUrl + "】不是url地址" + "\r\n"; + errorUrlList.add(note); + continue; + } + + String fileName = Urls.get(fileUrl, "fileName"); + fileName = Strings.trim(fileName); + + if (Validates.isEmptyBlank(fileName)) { + String note = "资料文件【" + fileUrl + "】未知文件名参数" + "\r\n"; + errorUrlList.add(note); + continue; + } + + String fileExt = ""; + if (fileName.lastIndexOf(".") > 0) { + fileExt = fileName.substring(fileName.lastIndexOf(".") + 1); + } + + if (Validates.isEmptyBlank(fileExt)) { + String note = "资料文件【" + fileUrl + "】未知文件名扩展名" + "\r\n"; + errorUrlList.add(note); + continue; + } + + long fileLength = 0; + try { + URLConnection uc = new URL(fileUrl).openConnection(); + fileLength = uc.getContentLengthLong(); + } catch (Exception e) { + String note = "资料文件【" + fileUrl + "】文件不可访问" + "\r\n"; + errorUrlList.add(note); + continue; + } + + DesignAtta atta = new DesignAtta(); + atta.setAttaId(Ids.longId()); + atta.setAttaModul(FileTypeConstants.FILE_CUSTOM.value()); + atta.setDesignId(designId); + // atta.setFileid(fileid); + atta.setFileName(fileName); + atta.setFileType(fileExt); + atta.setFileSize(fileLength); + atta.setOperatorCode("系统"); + atta.setOssType(1); + atta.setOssUrl(fileUrl); + atta.setAttaFlag(1); + // atta.setSavePath(savePath); + atta.setUploadTime(Sqls.nowTimestamp()); + attaList.add(atta); + + fileMap.put("fileUrl", Strings.valueOf(atta.getAttaId())); + } + + if (errorUrlList.size() > 0)// 有错误 + { + request.setResponseError(new RmiError(RmiConstants.ERROR_FILE_URL.value(), + RmiConstants.ERROR_FILE_URL.desc() + Lists.toString(errorUrlList)).toString()); + return; + } + + // 删除文件信息 接口文件信息 + ORM.get(ZTable.class).delete(DesignAtta.class, new Selector("designId", designId).addMust("attaFlag", 1)); + if (attaList.size() > 0) { + ORM.get(ZTable.class).insertBatch(attaList); + } + + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + jsonMap.put("outId", order.getOutId()); + jsonMap.put("fileMap", Jsons.toString(fileMap)); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + request.setResponseResult(result.toString()); + + log.info("订单商户[" + merchant.getMerchantName() + "]刷新订单[" + designId + "]文件资料信息成功"); + } + + /** + * + * 设计平台订单、滞留单处理 + * + * @author gjx + * @param merId + * @param merSecret + * @param designId 设计订单 + * @param retentDealName 滞留单处理人 + * @param retentDealWay 滞留单处理方式 + * @param retentFollowFlag 设计师跟进情况 + * @param retentRemark 滞留单处理备注 + * @throws Exception + */ + @AnTransaction + public static void doDesignOrderEnd(HttpRequest request) throws Exception { + String error_preText = "Rmi设计平台订单完结参数错误"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String retentDealName = request.getParameter("retentDealName"); + int retentDealWay = request.getParameterInt("retentDealWay"); + int retentFollowFlag = request.getParameterInt("retentFollowFlag"); + String retentRemark = request.getParameter("retentRemark"); + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchant.getMerchantId())); + if (order == null) {// 商户单订单不存在,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + retentDealName = "null".equals(retentDealName) ? null : retentDealName; + retentRemark = "null".equals(retentRemark) ? null : retentRemark; + + RetentionDetails retentionDetails = ORM.get(ZTable.class).item(RetentionDetails.class, + new Selector().addMust("designId", order.getDesignId())); + if (retentionDetails == null) { + RetentionDetails reDetails = new RetentionDetails(); + reDetails.setDesignId(order.getDesignId()); + reDetails.setRetentDealName(retentDealName); + reDetails.setRetentDealWay(retentDealWay); + reDetails.setRetentFollowFlag(retentFollowFlag); + reDetails.setRetentionEndTime(Sqls.nowTimestamp()); + reDetails.setRetentRemark(retentRemark); + + ORM.get(ZTable.class).insert(reDetails); + } else { + Updater updater = new Updater(); + updater.addMust("designId", order.getDesignId()); + updater.addField("retentDealName", retentDealName); + updater.addField("retentDealWay", retentDealWay); + updater.addField("retentFollowFlag", retentFollowFlag); + updater.addField("retentionEndTime", Sqls.nowTimestamp()); + updater.addField("retentRemark", retentRemark); + + ORM.get(ZTable.class).update(RetentionDetails.class, updater); + } + + int status = StatusConstants.ORDER_F130.value(); + + // 插入日志 + String retentDealWayChar = ""; + if (retentDealWay == 0) { + retentDealWayChar = "寄存、订单状态已完结"; + } else if (retentDealWay == 1) { + retentDealWayChar = "退款、订单状态已取消"; + status = StatusConstants.ORDER_F100.value(); + + if (Validates.isNotEmpty(order.getDesigner())) { + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_106.value())); + scoreDesignerRecordDetail.setOperatorCode(order.getDesigner()); + scoreDesignerRecordDetail.setOrderId(order.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + } + + Updater up = new Updater(); + up.addMust("designId", order.getDesignId()); + up.addField("status", status); + up.addField("modifyTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(DesignOrder.class, up); + + OrderLogDao.saveOrderOperateLog(designId, retentDealName, retentDealWayChar, EventConstants.ORDER_20.value()); + + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + request.setResponseResult(result.toString()); + + log.info("设计订单[" + order.getDesignId() + "]、滞留单完结信息修改成功"); + + } + + /** + * + * 滞留单处理退款 + * + * @author gjx + * @param merId + * @param merSecret + * @param designId long 设计订单 + * @param cancelReason String 是 取消原因 不能为空 且不能超过 200字符 + * @return + * @throws Exception + */ + @AnTransaction + public static void doRetentionCancelDesignOrder(HttpRequest request) throws Exception { + String error_preText = "Rmi滞留单取消订单参数错误 :"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String cancelReason = request.getParameter("cancelReason"); + String retentDealName = request.getParameter("retentDealName"); + cancelReason = "null".equals(cancelReason) ? null : cancelReason; + retentDealName = "null".equals(retentDealName) ? null : retentDealName; + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchant.getMerchantId())); + if (order == null) {// 商户单订单不存在,单号必须大于0 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + if (Validates.isEmptyBlank(cancelReason) || cancelReason.length() > 200) {// 商户订单信息错误,订单信息不能为空且,不能超过200个字符 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_REASON)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + if (Validates.isEmptyBlank(retentDealName)) {// 滞留单处理人不能为空 + RmiResult result = new RmiResult(new RmiError(RmiConstants.RETENTI_DEAL_NAME)); + request.setResponseResult(result.toString()); + log.error(merchant.getMerchantName() + ":" + error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + + Updater updater = new Updater().addMust("designId", designId); + if (Validates.isNotEmpty(order.getDesigner())) { + updater.addField("status", StatusConstants.ORDER_F110.value()); + updater.addField("refundTime", DateTimes.getDateTimeString()); + + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_106.value())); + scoreDesignerRecordDetail.setOperatorCode(order.getDesigner()); + scoreDesignerRecordDetail.setOrderId(order.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } else { + updater.addField("status", StatusConstants.ORDER_F100.value()); + } + updater.addField("canceler", retentDealName); + updater.addField("cancelReason", cancelReason); + updater.addField("cancelTime", Sqls.nowTimestamp()); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 插入日志 + OrderLogDao.saveOrderOperateLog(designId, retentDealName, cancelReason, EventConstants.ORDER_F10.value()); + + Map jsonMap = new HashMap(); + jsonMap.put("designId", order.getDesignId()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + log.info("[" + merchant.getMerchantName() + "]Rmi滞留设计订单[" + order.getDesignId() + "]取消成功"); + request.setResponseResult(result.toString()); + } + + /** + * + * 查询设计平台操作员 + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doQueryDesignDeptOperator(HttpRequest request) throws Exception { + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + return; + } + + List operatorList = ORM.get(ZTable.class).list(ZmrOperator.class, + new Selector("operatorStatus", 0).addMustNotEqual("operatorType", 0)); + RmiResult result = new RmiResult(Jsons.toString(operatorList)); + log.info("ERP--RMI查询设计平台操作员"); + request.setResponseResult(result.toString()); + } + + /** + * + * 创建投诉单 + * + * @author gjx + * @param request + * @return + * @throws Exception + */ + @AnTransaction + public static void doCreateComplain(HttpRequest request) throws Exception { + String error_preText = "设计平台【RMI】创建投诉单参数错误:"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String complainStatus = request.getParameter("complainStatus"); + String complainType = request.getParameter("complainType"); + String disposeProject = request.getParameter("disposeProject"); + int shopPunishScore = request.getParameterInt("shopPunishScore"); + String undertakeDept = request.getParameter("undertakeDept"); + String undertakePerson = request.getParameter("undertakePerson"); + String isSatrapAssist = request.getParameter("isSatrapAssist"); + String complainSpecificText = request.getParameter("complainSpecificText"); + String disposeImgPath = request.getParameter("disposeImgPath"); + String complainAddName = request.getParameter("complainAddName"); + String complainAddTime = request.getParameter("complainAddTime"); + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + DesignOrder designOrder = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector().addMust("designId", designId)); + if (designOrder == null) {// 响应回去 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",设计订单号:" + designId); + return; + } + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, + new Selector().addMust("operatorCode", undertakePerson)); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, new Selector().addMust("orgId", operator.getOrgId())); + String soleId = String.valueOf(Ids.longId13()); + long complainId = Long.valueOf(soleId.substring(4)); + DesignComplain complain = new DesignComplain(); + complain.setComplainId(complainId); + complain.setDesignId(designId); + complain.setComplainStatus(complainStatus); + complain.setComplainType(complainType); + complain.setDisposeProject(disposeProject); + complain.setShopPunishScore(shopPunishScore); + complain.setUndertakeDept(undertakeDept); + complain.setUndertakePerson(undertakePerson); + complain.setSatrapAssist(Boolean.parseBoolean(isSatrapAssist)); + complain.setComplainSpecificText(complainSpecificText); + complain.setDisposeImgPath(disposeImgPath); + complain.setComplainAddName(complainAddName); + complain.setComplainAddTime(Sqls.toTimestamp(complainAddTime)); + complain.setComplainModifyTime(Sqls.nowTimestamp()); + complain.setUndertakeOrg(operator.getOrgId()); + complain.setUndertakeOrgName(org.getOrgName()); + complain.setUndertakeDeptManager(CalculationUtil.operatorGetDeptSatrap(operator.getOperatorCode())); + + ORM.get(ZTable.class).insert(complain); + request.setResponseResult(Jsons.toString(complain.getComplainId())); + } + + /** + * + * 设计平台投诉单完结通过 + * + * @author gjx + * @param request + * @throws Exception + */ + @AnTransaction + public static void doCompainDealFinish(HttpRequest request) throws Exception { + String error_preText = "设计平台【RMI】修改投诉单状态参数错误:"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long complainId = request.getParameterLong("complainId"); + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + return; + } + + DesignComplain designComplain = ORM.get(ZTable.class).item(DesignComplain.class, + new Selector().addMust("complainId", complainId)); + if (designComplain == null) {// 响应回去 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",投诉单号:" + complainId); + return; + } + Updater updater = new Updater(); + updater.addMust("complainId", complainId); + updater.addField("complainStatus", ComplainConstants.TX_40.value()); + updater.addField("complainModifyTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(DesignComplain.class, updater); + + if ("设计部".equals(designComplain.getUndertakeDept()) && null != designComplain.getUndertakePerson()) { + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_105.value())); + scoreDesignerRecordDetail.setOperatorCode(designComplain.getUndertakePerson()); + scoreDesignerRecordDetail.setOrderId(designComplain.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + + OrderLogDao.saveOrderOperateLog(complainId, request.getSessionName(), "投诉单处理完结", + EventConstants.ORDER_20.value()); + } + + /** + * + * 设计平台投诉单退回 + * + * @author gjx + * @param request + * @throws Exception + */ + @AnTransaction + public static void doCompainDealBack(HttpRequest request) throws Exception { + String error_preText = "设计平台【RMI】修改投诉单状态参数错误:"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long complainId = request.getParameterLong("complainId"); + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + return; + } + + DesignComplain designComplain = ORM.get(ZTable.class).item(DesignComplain.class, + new Selector().addMust("complainId", complainId)); + if (designComplain == null) {// 响应回去 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",投诉单号:" + complainId); + return; + } + Updater updater = new Updater(); + updater.addMust("complainId", complainId); + updater.addField("complainStatus", ComplainConstants.TX_30.value()); + updater.addField("complainModifyTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(DesignComplain.class, updater); + + OrderLogDao.saveOrderOperateLog(complainId, request.getSessionName(), "投诉单退回", EventConstants.ORDER_20.value()); + } + + /** + * + * [简要描述]淘印通订单取消退回:
            + * [详细描述]:
            + * + * @author gjx + * @param request + */ + @AnTransaction + public static void doTaoYinTongOrderCancelReturned(HttpRequest request) throws Exception { + String error_Text = "设计平台【RMI】订单取消退回参数错误:"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + return; + } + DesignOrder designOrder = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector().addMust("designId", designId)); + if (designOrder == null) {// 响应回去 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(error_Text + result.getError() + ",设计订单号:" + designId); + return; + } + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("status", StatusConstants.ORDER_30.value()); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + OrderLogDao.saveOrderOperateLog(designId, "系统", "订单取消退回", EventConstants.ORDER_20.value()); + + } + + /** + * + * [简要描述]淘印通订单取消通过:
            + * [详细描述]:
            + * + * @author gjx + * @param request + */ + @AnTransaction + public static void doTaoYinTongOrderCancelPass(HttpRequest request) throws Exception { + String error_Text = "设计平台【RMI】订单取消通过参数错误:"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + return; + } + DesignOrder designOrder = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector().addMust("designId", designId)); + if (designOrder == null) {// 响应回去 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(error_Text + result.getError() + ",设计订单号:" + designId); + return; + } + + Updater updater = new Updater(); + updater.addMust("designId", designId); + int eventType = EventConstants.ORDER_F10.value(); + int status = StatusConstants.ORDER_F100.value(); + if (Validates.isNotEmpty(designOrder.getDesigner())) { + status = StatusConstants.ORDER_F110.value(); + eventType = EventConstants.ORDER_F20.value(); + updater.addField("refundTime", DateTimes.getDateTimeString()); + + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_106.value())); + scoreDesignerRecordDetail.setOperatorCode(designOrder.getDesigner()); + scoreDesignerRecordDetail.setOrderId(designOrder.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + updater.addField("status", status); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + OrderLogDao.saveOrderOperateLog(designId, "系统", "淘印通订单取消成功", eventType); + } + + /** + * + * 查询设计平台操作员部门和组织负责人 + * + * @author yixin + * @param request + * @throws Exception + */ + public static void doQueryDesignDeptAndOrgOperator(HttpRequest request) throws Exception { + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + String operatorCode = request.getParameter("operatorCode", ""); + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + return; + } + if (operatorCode == null || operatorCode.isEmpty()) {// 参数不能为空 + RmiResult result = new RmiResult(new RmiError(ApiErrorCodes.ERROR_API_NOT_EMPTY_BLANK)); + request.setResponseResult(result.toString()); + return; + } + + Selector selector = new Selector("operatorStatus", 0); + selector.addMustNotEqual("operatorType", 0); + selector.addMust("operatorCode", operatorCode); + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, selector); + if (operator == null) { + // 操作员code无效 + RmiResult result = new RmiResult(new RmiError(ApiErrorCodes.ERROR_API_PARAM_DATA)); + request.setResponseResult(result.toString()); + return; + } + + Map map = new HashMap(5); + map.put(operatorCode, operator); + long orgId = operator.getOrgId(); + ZmrOrg org = ORM.get(ZTable.class).item(ZmrOrg.class, new Selector("orgId", orgId)); + String orgOperatorCode = org.getOrgManager(); + String deptOperatorCode = CalculationUtil.operatorGetDeptSatrap(operatorCode); + if (Validates.isNotEmptyBlank(orgOperatorCode)) { + ZmrOperator orgOperator = ORM.get(ZTable.class).item(ZmrOperator.class, + new Selector("operatorStatus", 0).addMust("operatorCode", orgOperatorCode)); + if (orgOperator != null) { + map.put(orgOperator.getOperatorCode(), orgOperator); + } + } + if (Validates.isNotEmptyBlank(deptOperatorCode)) { + ZmrOperator deptOperator = ORM.get(ZTable.class).item(ZmrOperator.class, + new Selector("operatorStatus", 0).addMust("operatorCode", deptOperatorCode)); + + if (deptOperator != null) { + map.put(deptOperator.getOperatorCode(), deptOperator); + } + } + + List operatorList = new ArrayList(map.values()); + RmiResult result = new RmiResult(Jsons.toString(operatorList)); + request.setResponseResult(result.toString()); + } + + /** + * 用于ERP定时任务自动同意淘宝申请退款时 将不满足自动退款的订单对应的设计平台订单 改为显示红色感叹号 + * + * @param request + * @return void + * @author HuangZhiGao + * @date 2019/11/22 15:02 + */ + @AnTransaction + public static void doUpdateDesignOrdShowRedMark(HttpRequest request) throws Exception { + long designId = request.getParameterLong("designId"); + int showRedMark = request.getParameterInt("showRedMark"); + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("showRedMark", showRedMark); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + } + + /** + * 用于ERP标准自来稿在设计平台创建待审订单或设计完成订单
            + * + * @param request + * @description jsonOrder JSON格式的订单 + * @description createType 创建的订单类型[0:待审核; 1:设计完成] + * @return void + * @author HuangZhiGao + * @date 2020/2/13 15:36 + */ + @AnTransaction + public static void doCreateDesignPlatformReviewOrder(HttpRequest request) throws Exception { + String jsonOrder = request.getParameter("jsonOrder"); + int createType = request.getParameterInt("createType"); + String logDesc = request.getParameter("logDesc", "创建订单"); + + DesignOrderCreateModel designOrderCreateModel = Jsons.toObject(jsonOrder, DesignOrderCreateModel.class); + try { + // long merchantId = designOrderCreateModel.getMerchantId(); + long industryId = designOrderCreateModel.getIndustryId(); + long designType = designOrderCreateModel.getDesignType(); + int draftType = designOrderCreateModel.getDraftType(); + // 1. 验证商户 + DesignMerchant mer = MerchantDao.get(designOrderCreateModel.getMerchantId()); + if (mer == null || !mer.isEnabled()) { + return; + } + // 2.验证订单类型 + DesignType type = DesignTypeDao.get(designType); + if (type == null) {// 商户 设计参数错误 不支持的设计类型 + return; + } + + // 3.稿件类型 + Int draft = DraftConstants.getTypeItem(draftType); + if (draft == null) {// 商户 稿件参数错误 不支持的稿件类型 + return; + } + if (Validates.isNotEmptyBlank(designOrderCreateModel.getAfterNames())) { + designOrderCreateModel.setAfterNames(designOrderCreateModel.getAfterNames().replace("@", ",")); + } + + // 订单接口请求数据信息 + DesignOrder order = new DesignOrder(); + order.setMerchantId(designOrderCreateModel.getMerchantId()); + order.setOutId(designOrderCreateModel.getOutId()); + order.setTypeId(designType); + order.setIndustryId(industryId > 0 ? industryId : 1980727080001L); // 自来稿值其它行业ID + order.setDraftType(draftType); + order.setDesignPage(designOrderCreateModel.getDesignPage()); + if (Validates.isNotEmptyBlank(designOrderCreateModel.getOrderText())) { + designOrderCreateModel.setOrderText(designOrderCreateModel.getOrderText().replace("@", ",")); + } + order.setOrderText(designOrderCreateModel.getOrderText()); + order.setAfterNames(Validates.isEmptyBlank(designOrderCreateModel.getAfterNames()) ? null + : Strings.trim(designOrderCreateModel.getAfterNames(), null)); + order.setPrintSpecial(designOrderCreateModel.getPrintSpecial()); + order.setDesignWidth(designOrderCreateModel.getDesignWidth());// 包含出血 + order.setDesignHeight(designOrderCreateModel.getDesignHeight());// 包含出血 + order.setPrintKs(designOrderCreateModel.getPrintKs()); + order.setPrintMs(designOrderCreateModel.getPrintMs()); + order.setPrintWidth(designOrderCreateModel.getPrintWidth());// 不包含出血 + order.setPrintHeight(designOrderCreateModel.getPrintHeight());// 不包含出血 + order.setAmount(Amounts.toFen(Strings.valueOf(designOrderCreateModel.getAmount()), 0)); + order.setUrgent(designOrderCreateModel.isUrgent()); + order.setUserContact(designOrderCreateModel.getUserContact()); + order.setUserMobile(designOrderCreateModel.getUserMobile()); + order.setUserQq(designOrderCreateModel.getUserQq()); + order.setUserWx(designOrderCreateModel.getUserWx()); + if (Validates.isNotEmptyBlank(designOrderCreateModel.getUserText())) { + designOrderCreateModel.setUserText(designOrderCreateModel.getUserText().replace("@", ",")); + } + order.setUserText(designOrderCreateModel.getUserText()); + order.setUserNotice(designOrderCreateModel.getUserNotice()); + order.setShopNick(designOrderCreateModel.getShopNick()); + order.setBuyerNick(designOrderCreateModel.getBuyerNick()); + if (Validates.isNotEmptyBlank(designOrderCreateModel.getServicesMessage())) { + designOrderCreateModel + .setServicesMessage(designOrderCreateModel.getServicesMessage().replace("@", ",")); + } + order.setServicesMessage(designOrderCreateModel.getServicesMessage()); + order.setDesignCopies(designOrderCreateModel.getDesignCopies()); + order.setReceiverName(designOrderCreateModel.getReceiverName()); + order.setReceiverMobile(designOrderCreateModel.getReceiverMobile()); + order.setReceiverState(designOrderCreateModel.getReceiverState()); + order.setReceiverCity(designOrderCreateModel.getReceiverCity()); + order.setReceiverDistrict(designOrderCreateModel.getReceiverDistrict()); + order.setReceiverAddress(designOrderCreateModel.getReceiverAddress()); + order.setOrgReceiveTime(Sqls.nowTimestamp()); + order.setCreateTime(Sqls.nowTimestamp()); + order.setModifyTime(Sqls.nowTimestamp()); + order.setDesignBeginTime(Sqls.nowTimestamp()); + order.setDesignReceiveTime(Sqls.nowTimestamp()); + order.setDesignDraftTime(Sqls.nowTimestamp()); + order.setDesignEndTime(Sqls.nowTimestamp()); + order.setReceiveType(2); + // 根据createType设置订单状态,设计完成的订单需要一并设置审核时间 + if (createType == 0) { + order.setStatus(StatusConstants.ORDER_55.value()); + } + if (createType == 1) { + order.setStatus(StatusConstants.ORDER_70.value()); + order.setCheckTime(Sqls.nowTimestamp()); + } +// order.setDesignId(designOrderCreateModel.getOutId());// 与外部业务系统单号保持一致 + order.setDesignId(Ids.longId());// 与外部业务系统单号保持一致 + order.setCreater(designOrderCreateModel.getCreater()); + order.setOrgId(2018280240394L);// 印前改稿 + if (Validates.isNotEmptyBlank(designOrderCreateModel.getTids())) { + designOrderCreateModel.setTids(designOrderCreateModel.getTids().replace("@", ",")); + } + order.setTids(designOrderCreateModel.getTids()); + order.setOrderSrc(designOrderCreateModel.getOrderSrc()); + order.setExpressCode(designOrderCreateModel.getExpressCode()); + order.setOnlyDesign(designOrderCreateModel.isOnlyDesign()); + + List apiFiles = Jsons.toList(designOrderCreateModel.getApiFiles().toString(), + YangcaiApiFile.class); // 附件数据 + List attaList = new ArrayList(); + for (YangcaiApiFile apiFile : apiFiles) { + DesignAtta atta = new DesignAtta(); + atta.setAttaId(Ids.longId()); + atta.setDesignId(order.getDesignId()); + atta.setAttaFlag(1);// 接口上传 + atta.setAttaModul(apiFile.getAttaModule()); + if (Validates.isNotEmptyBlank(apiFile.getFileName())) { + atta.setFileName(apiFile.getFileName().replace("@", ",")); + } + atta.setFileName(Strings.addEndsWith(Strings.trim(apiFile.getFileName()), + Strings.addStartsWith(apiFile.getFileExt(), "."))); + atta.setFileType(Strings.trimLeft(Strings.trim(apiFile.getFileExt()), ".")); + atta.setFileSize(apiFile.getFileSize()); + atta.setOperatorCode("系统"); + atta.setOssType(1);// OSS任务无需上传 + atta.setOssUrl(apiFile.getDownUrl()); + atta.setUploadTime(Sqls.nowTimestamp()); + atta.setFileid(null); + atta.setSavePath(null); + + attaList.add(atta); + } + + // 创建订单时判断是否是老用户 + String designer = DispatchTaskDao.isOldUserOrder(order); + if (Validates.isNotEmpty(designer)) { + order.setOrderFlag(1); + } + + // 插入用户订单数 + if (Validates.isNotEmptyBlank(designOrderCreateModel.getBuyerNick())) { + int orderCount = BuyerDao.getOrderCount(designOrderCreateModel.getBuyerNick()); + order.setIsOldUser(orderCount > 0 ? 1 : 0); + BuyerDao.doAddOrUpdateOrderCount(designOrderCreateModel.getBuyerNick(), orderCount + 1); + } + + // 数据插入 + ORM.get(ZTable.class).replace(order); + SelfOrder selfOrder = new SelfOrder(); + selfOrder.setDesignId(order.getDesignId()); + selfOrder.setDefaultLabel(true); + // 标准自来稿订单设置为客服负责 + selfOrder.setKfDraftStandard(Boolean.TRUE); + ORM.get(ZTable.class).replace(selfOrder); + + // 附件数据插入 先删除 客户端所有 通过接口传的数据,在重新插入 + ORM.get(ZTable.class).delete(DesignAtta.class, new Selector("designId", order.getDesignId()) + .addMust("attaModul", FileTypeConstants.FILE_CUSTOM.value()).addMust("attaFlag", 1)); + ORM.get(ZTable.class).delete(DesignAtta.class, new Selector("designId", order.getDesignId()) + .addMust("attaModul", FileTypeConstants.FILE_END.value())); + ORM.get(ZTable.class).delete(DesignAtta.class, new Selector("designId", order.getDesignId()) + .addMust("attaModul", FileTypeConstants.FILE_WORK.value())); + if (attaList.size() > 0) { + ORM.get(ZTable.class).insertBatch(attaList); + } + + OrderLogDao.saveOrderOperateLog(order.getDesignId(), designOrderCreateModel.getCreater(), logDesc, + EventConstants.ORDER_1.value()); + log.info("[%s]订单[%s]创建成功", mer.getMerchantName(), order.getDesignId()); + } catch (Exception e) { + log.error("创建订单异常", e); + } + + } + + /** + * + * [简要描述]售后类型重印审核通过需要向设计平台创建补单:
            + * [详细描述]之前创建补单接口无法满足需求:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doCreateAfterDesignPlatformOrder(HttpRequest request) throws Exception { + String error_preText = "设计平台【RMI】创建售后补单错误:"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long reDesignSrcId = request.getParameterLong("reDesignSrcId");// 导致售后补单的原订单id + int status = request.getParameterInt("status");// 订单状态 + String reDesignCreateNote = request.getParameter("reDesignCreateNote");// 补单原因 + String newOutId = request.getParameter("newOutId");// 新订单号 + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + return; + } + + // 2.验证原订单号 + DesignSelfView src_order = ORM.get(ZView.class).item(DesignSelfView.class, + new Selector().addMust("designId", reDesignSrcId)); + if (src_order == null) {// 商户单号错误 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",订单号:" + reDesignSrcId); + return; + } + + // 订单扩展表 + SelfOrder selfOrder = new SelfOrder(); + Objects.copyDeep(src_order, selfOrder); + + // 设计订单表 + DesignOrder reOrder = new DesignOrder(); + Objects.copyDeep(src_order, reOrder); + reOrder.setDesignId(Ids.longId());// 新订单号 + reOrder.setShopNick(BaseConstants.TRANSFER_AFS_ACCOUNTS);// 补单售后店铺 + reOrder.setCreateTime(Sqls.nowTimestamp()); + reOrder.setModifyTime(Sqls.nowTimestamp()); + reOrder.setStatus(status);// 订单状态由调用方提供 + String srcDesigner = src_order.getDesigner(); + if (Validates.isEmpty(srcDesigner)) { + ZmrOrg zmrOrg = ORM.get(ZTable.class).item(ZmrOrg.class, 2018280240394L); + if (zmrOrg == null || Validates.isEmpty(zmrOrg.getOrgManager())) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORG_MANAGE_IS_NULL)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",印前改稿组织负责人未配置"); + return; + } + srcDesigner = zmrOrg.getOrgManager(); + } + reOrder.setDesigner(srcDesigner); // 设置设计师 + reOrder.setDesignReceiveTime(Sqls.nowTimestamp()); // 设置领单时间 + reOrder.setDesignBeginTime(Sqls.nowTimestamp()); // 设置开始设计时间 + reOrder.setDesignExclude(src_order.getDesignExclude()); // 需要排除的设计师 + reOrder.setOrderSrc(BaseConstants.ORDER_SRC_1);// 补单 + reOrder.setShowRedMark(0);// 淘宝退款标记 + reOrder.setReDesignCreateNote( + "由于原因【" + reDesignCreateNote + "】,原订单[" + src_order.getDesignId() + "]重新设计, 新单[" + newOutId + "]");// 创建重新设计原因 + reOrder.setReDesignSrcId(reDesignSrcId); + reOrder.setOutId(newOutId); + + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector("designId", src_order.getDesignId())); + for (DesignAtta designAtta : attaList) { + designAtta.setAttaId(Ids.longId()); + designAtta.setDesignId(reOrder.getDesignId()); + } + selfOrder.setDesignId(reOrder.getDesignId());// 新订单号 + ORM.get(ZTable.class).replace(selfOrder); + ORM.get(ZTable.class).replace(reOrder); + ORM.get(ZTable.class).replaceBatch(attaList); + + OrderLogDao.saveOrderOperateLog(src_order.getDesignId(), "系统", + "[接收到补单]由于原因【" + reDesignCreateNote + "】需要重新设计,新设计单号: " + newOutId, EventConstants.ORDER_17.value()); + + int logStatus = EventConstants.ORDER_3.value(); + OrderLogDao.saveOrderOperateLog(reOrder.getDesignId(), "系统", + "[接收到补单]由于原因【" + reDesignCreateNote + "】,原订单[" + src_order.getDesignId() + "]重新设计", logStatus); + + // 响应数据 + log.info("补单[%s]创建成功", reOrder.getDesignId()); + + } + + /** + * + * [简要描述] 订单排产退回:
            + * [详细描述]:下单发货平台发起退回
            + * + * @author gjx + * @param request + * @throws Exception + */ + @AnTransaction + public static void doOrderSchedulingBack(HttpRequest request) throws Exception { + String error_preText = "设计平台【RMI】排产退回错误:"; + + long designId = request.getParameterLong("designId"); + String backReason = request.getParameter("backReason"); + String backOperatorName = request.getParameter("backOperatorName"); + + Selector selelct = new Selector("designId", designId <= 0 ? 0 : designId); + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, selelct); + if (order == null) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",订单号:" + designId); + return; + } + + if (order.getStatus() < StatusConstants.ORDER_55.value()) {// 未定稿订单不允许退回 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_BY_STATUS)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",订单号:" + designId); + return; + } + + // 操作订单表,改稿自来稿+设计订单全部退回到正在设计状态 + Updater updater = new Updater().addMust("designId", designId); + updater.addField("status", StatusConstants.ORDER_30.value()); + updater.addField("checkBackReason", backReason); + updater.addField("modifyTime", Sqls.nowTimestamp()); + if (order.getDraftType() == DraftConstants.DRAFT_STANDARD.value() && Validates.isEmpty(order.getDesigner())) {// 打回,标准自来稿+设计师为空,直接打回给印前组织负责人账号名下 + ZmrOrg zmrOrg = ORM.get(ZTable.class).item(ZmrOrg.class, 2018280240394L); + if (zmrOrg == null || Validates.isEmpty(zmrOrg.getOrgManager())) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORG_MANAGE_IS_NULL)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",印前改稿组织负责人未配置"); + return; + } + updater.addField("designer", zmrOrg.getOrgManager()); + order.setDesigner(zmrOrg.getOrgManager()); + } + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + OrderMessage message = new OrderMessage(); + message.setDesignId(designId); + message.setBuyerNick(order.getBuyerNick()); + message.setCreateTime(Sqls.nowTimestamp()); + message.setMessageType(1); // 消息类型(0:催稿,1:订单审核、排产退回) + message.setTopic(MessageThemeConstants.MSG_ORDER_RETURN.value());// 主题 + message.setProductionCode(backOperatorName);// 生产者 + message.setProductionTime(Sqls.nowTimestamp());// 生产时间 + message.setMessageBody("您有一条订单(" + designId + "," + backReason + ")工厂退回,请及时查看原因并处理!");// 消息内容 + message.setConsumerCodeType(0);// 消费者类型 0:普通操作员、1:协调人 + message.setConsumerPlatformType(MessageThemeConstants.PLATFORM_TYPE_DESIGN.value());// 消费平台 + message.setConsumerCode(order.getDesigner());// 消费者 + message.setConsumerState(0);// 消费状态,0:未消费 + // message.setRemark(); + + ORM.get(ZTable.class).insert(message); + + // 删除成品文件 + Selector attaSel = new Selector(); + attaSel.addMust("designId", designId); + attaSel.addMust("attaModul", FileTypeConstants.FILE_END.value()); + DesignAtta designAtta = ORM.get(ZTable.class).item(DesignAtta.class, attaSel); + if (designAtta != null) { + OrderCheckDao.doDeleteEndFile(designAtta); + } + + DesTemplateOrder tOrder = ORM.get(ZTable.class).item(DesTemplateOrder.class, designId); + if (tOrder != null) { + // 3.更新模板为可编辑状态 + Updater cUpdater = new Updater(); + cUpdater.addMust("mediaId", tOrder.getDesignMediaId()); + cUpdater.addField("isEdit", 0); // 不可编辑 + ORM.get(ZTable.class).update(MediaCanvas.class, cUpdater); + + // 4 更新模板 状态 80 为 20 + Updater mUpdater = new Updater(); + mUpdater.addMust("mediaId", tOrder.getDesignMediaId()); + mUpdater.addField("templateType", 20); // 我的模板 + ORM.get(ZTable.class).update(MediaTemplate.class, mUpdater); + } + + // 日志信息 + OrderLogDao.saveOrderOperateLog(designId, backOperatorName, "【工厂排产退回】:" + backReason, + EventConstants.ORDER_10.value()); + + // 退回触发设计师虚拟账户资金计算 + if (order.getDraftType() < DraftConstants.DRAFT_TEMPLATE.value() + || order.getDraftType() > DraftConstants.DRAFT_PAGE_DESIGN.value()) {// 排除标准自来稿 + return; + } + + boolean finishDesign = true; + + // 本月完成的订单退回 直接走退回 + if (order.getDesignEndTime().getTime() >= DateTimes.toCalendar(DateTimes.getFirstMonthDay() + " 00:00:00") + .getTime().getTime()) { + finishDesign = VirtualAccountDao.finishDesign(order, order.getDesigner(), + Integer.parseInt(VirtualAccountConstants.TRANSACTION_STATUS_6.value())); + } // 订单非本月完成,需扣除完成该单的用户的可用金额并删除历史绩效统计表 + else if (order.getDesignEndTime().getTime() <= DateTimes.toCalendar(DateTimes.getFirstMonthDay() + " 00:00:00") + .getTime().getTime()) { + finishDesign = VirtualAccountDao.finishDesign(order, order.getDesigner(), + Integer.parseInt(VirtualAccountConstants.TRANSACTION_STATUS_7.value())); + } + if (!finishDesign) { + request.setResponseError(order.getDesigner() + ":【" + order.getDesignId() + "】订单退回减少账户收入失败"); + log.error(order.getDesigner() + ":【" + order.getDesignId() + "】同步资金账户信息失败" + "【订单退回】"); + } + } + + /*** + * 消息Model查询 序号 key 类型 必填 说明 1 merId long 是 设计平台分配的id,设计平台唯一 2 merSecret String + * 是 商户秘钥 + * + * @param request + * @throws Exception + * + * + */ + public static void doQueryOrderDesignerModule(HttpRequest request) throws Exception { + String oids = request.getParameter("oids"); + if (Validates.isEmpty(oids)) { + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_TEXT)); + request.setResponseResult(result.toString()); + log.error("参数oids不能为空," + result.getError()); + return; + } + long[] oidsArray = Arrays.toLongArray(oids); + List dersignerOrgOrderViews = ORM.get(ZView.class).list(DersignerOrgOrderView.class, + new Selector().addMustInLong("designId", oidsArray)); + List list = new ArrayList<>(); + for (long oid : oidsArray) { + OrderDesignerModule orderDesignerModule = new OrderDesignerModule(); + orderDesignerModule.setOrderId(oid); + for (DersignerOrgOrderView view : dersignerOrgOrderViews) { + if (view.getDesignId() == oid) { + orderDesignerModule.setDesignerCode(view.getDesigner()); + orderDesignerModule.setDesignerName(view.getDesignerName()); + orderDesignerModule.setDesignerOrgId(view.getDesignerOrgId()); + orderDesignerModule.setDesignerOrgName(view.getDesignerOrgName()); + } + } + list.add(orderDesignerModule); + } + RmiResult result = new RmiResult(Jsons.toString(list)); + request.setResponseResult(result.toString()); + } + + /** + * + * [简要描述]: 地址修改
            + * [详细描述]:
            + * + * @author gjx + * @param request + * @throws Exception + */ + public static void doDesignPlatformAddressUpdate(HttpRequest request) throws Exception { + String error_preText = "设计平台【RMI】设计平台订单收件地址修改:"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String sessionName = request.getParameter("sessionName"); + String receiverName = request.getParameter("receiverName"); + String receiverMobile = request.getParameter("receiverMobile"); + String receiverState = request.getParameter("receiverState"); + String receiverCity = request.getParameter("receiverCity"); + String receiverDistrict = request.getParameter("receiverDistrict"); + String receiverAddress = request.getParameter("receiverAddress"); + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + return; + } + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, + new Selector().addMust("designId", designId)); + if (order == null) {// 响应回去 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",订单号:" + designId); + return; + } + + Updater updaterOrder = new Updater(); + updaterOrder.addMust("designId", designId); + updaterOrder.addField("receiverName", receiverName); + updaterOrder.addField("receiverMobile", receiverMobile); + updaterOrder.addField("receiverState", receiverState); + updaterOrder.addField("receiverCity", receiverCity); + updaterOrder.addField("receiverDistrict", receiverDistrict); + updaterOrder.addField("receiverAddress", receiverAddress); + ORM.get(ZTable.class).update(DesignOrder.class, updaterOrder); + + OrderLogDao.saveOrderOperateLog( + order.getDesignId(), sessionName, "订单地址修改成【" + receiverName + "|" + receiverMobile + "|" + receiverState + + "|" + receiverCity + "|" + receiverDistrict + "|" + receiverAddress + "】", + EventConstants.ORDER_20.value()); + } + + /** + * + * [简要描述]: 现货稿件设计平台状态变更
            + * [详细描述]:
            + * + * @author gjx + * @param oid + * @return + */ + public static void doActualsDraftPlatformStatusChange(HttpRequest request) throws Exception { + String error_preText = "设计平台【RMI】现货稿件设计平台状态修改:"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String sessionName = request.getParameter("sessionName"); + + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + return; + } + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, + new Selector().addMust("designId", designId)); + if (order == null) {// 响应回去 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",订单号:" + designId); + return; + } + + Updater updaterOrder = new Updater(); + updaterOrder.addMust("designId", designId); + updaterOrder.addField("status", StatusConstants.ORDER_F100.value()); + ORM.get(ZTable.class).update(DesignOrder.class, updaterOrder); + + OrderLogDao.saveOrderOperateLog(order.getDesignId(), sessionName, + "订单稿件类型由【" + DraftConstants.get(order.getDraftType()) + "】变更【现货】,订单流程结束", + EventConstants.ORDER_20.value()); + } + + /** + * + * [简要描述]: 平台状态变更
            + * [详细描述]:
            + * + * @author gjx + * @param request + */ + public static void doDesignPlatormOrderStatusUpdate(HttpRequest request) { + String error_preText = "【RMI】设计平台状态变更失败:"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + int status = request.getParameterInt("status"); + String itemDesc = request.getParameter("itemDesc", "滞留订单淘宝交易完成,系统自动完成"); + try { + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, + new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + return; + } + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector().addMust("designId", designId)); + if (order == null) {// 订单不存在 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)); + request.setResponseResult(result.toString()); + log.error(error_preText + result.getError() + ",订单号:" + designId); + return; + } + + // 如果设计平台当前是未分拣状态,并且目标修改状态为正在设计,该场景需要忽略掉 --caohong + if (order.getStatus() == StatusConstants.ORDER_10.value() && status == StatusConstants.ORDER_30.value()) { + return; + } + + Updater updater = new Updater().addMust("designId", designId); + updater.addField("status", status); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + OrderLogDao.saveOrderOperateLog(designId, "系统", itemDesc, EventConstants.ORDER_15.value()); + } catch (Exception e) { + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_UPDATE_INFO)).toString()); + return; + } + } + + /** + * + * [简要描述]: 取消设计平台订单:请求退款
            + * [详细描述]:如果开始设计则修改状态为申请退款,否则直接取消
            + * + * @author caohong + * @param request + */ + public static void doForceCancelDesignPlatormOrder(HttpRequest request) { + String error_preText = "【RMI】强制取消设计平台订单失败:"; + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String cancelDesc = request.getParameter("cancelDesc"); + try { + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, + new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + RmiResult result = new RmiResult(new RmiError(RmiConstants.ERROR_MER)); + request.setResponseResult(result.toString()); + return; + } + DesignSelfView order = ORM.get(ZView.class).item(DesignSelfView.class, + new Selector().addMust("designId", designId)); + if (order == null) {// 订单不存在 + return; + } + + // 请求退款状态 + if (order.getStatus() == StatusConstants.ORDER_34.value()) { + return; + } + + // 已取消 + if (order.getStatus() < StatusConstants.ORDER_10.value()) { + return; + } + Updater updater = new Updater().addMust("designId", designId); + // 未开始设计 + if (order.getStatus() == StatusConstants.ORDER_10.value()) { + int status = StatusConstants.ORDER_F100.value(); + int eventType = EventConstants.ORDER_F10.value(); + updater.addField("refundTime", DateTimes.getDateTimeString()); + updater.addField("status", status); + updater.addField("canceler", "系统"); + updater.addField("cancelReason", cancelDesc); + updater.addField("cancelTime", Sqls.nowTimestamp()); + updater.addField("modifyTime", Sqls.nowTimestamp()); + updater.addField("refundTime", DateTimes.getDateTimeString()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + if (Validates.isNotEmptyBlank(order.getDesigner())) { + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_106.value())); + scoreDesignerRecordDetail.setOperatorCode(order.getDesigner()); + scoreDesignerRecordDetail.setOrderId(order.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + + OrderLogDao.saveOrderOperateLog(designId, "系统", cancelDesc, eventType); + } else { + int status = StatusConstants.ORDER_34.value(); + int eventType = EventConstants.ORDER_5.value(); + updater.addField("status", status); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + OrderLogDao.saveOrderOperateLog(designId, order.getDesigner(), status, "系统", cancelDesc, eventType); + + if (order.getStatus() >= StatusConstants.ORDER_55.value()) { + // 直接取消,同步计算设计佣金 + boolean finishDesign = true; + // 本月完成的订单退回 直接走退回 + if (order.getDesignEndTime().getTime() >= DateTimes + .toCalendar(DateTimes.getFirstMonthDay() + " 00:00:00").getTime().getTime()) { + finishDesign = VirtualAccountDao.finishDesign(order, order.getDesigner(), + Integer.parseInt(VirtualAccountConstants.TRANSACTION_STATUS_6.value())); + } // 订单非本月完成,需扣除完成该单的用户的可用金额并删除历史绩效统计表 + else if (order.getDesignEndTime().getTime() <= DateTimes + .toCalendar(DateTimes.getFirstMonthDay() + " 00:00:00").getTime().getTime()) { + finishDesign = VirtualAccountDao.finishDesign(order, order.getDesigner(), + Integer.parseInt(VirtualAccountConstants.TRANSACTION_STATUS_7.value())); + } + if (!finishDesign) { + request.setResponseError("请求退款失败,设计费计算错误"); + log.error(request.getSessionName() + ":【" + order.getDesignId() + "】请求退款失败,设计费计算错误"); + return; + } + } + } + } catch (Exception e) { + log.error(error_preText + ",订单号:" + designId + e.getMessage(), e); + return; + } + } + + /** + * + * [简要描述]: 催稿信息创建
            + * [详细描述]:
            + * + * @author gjx + * @param request + */ + public static void doCreateOrderReminderMessage(HttpRequest request) { + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long id = request.getParameterLong("id");// 催稿单号 + long designId = request.getParameterLong("designId");// 订单号 + String productionCode = request.getParameter("productionCode");// 生产者 + String coordinaters = request.getParameter("coordinaters");// 协调人 + String topic = request.getParameter("topic");// 催稿主题 + String remark = request.getParameter("remark");// 备注 + try { + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, + new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_MER)).toString()); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector().addMust("designId", designId)); + if (order == null) {// 订单不存在 + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)).toString()); + return; + } + int status = order.getStatus(); + if (status >= StatusConstants.ORDER_55.value() || status < 0) {// 待审定稿 + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_BY_STATUS)).toString()); + return; + } + + OrderMessage orderMessage = ORM.get(ZTable.class).item(OrderMessage.class, + new Selector("designId", designId).addMust("messageType", 0).addOrderbyDesc("createTime")); + if (orderMessage != null + && orderMessage.getCreateTime().after(new Timestamp(System.currentTimeMillis() - 5 * 60 * 1000))) {// 同条订单,五分钟内不可再次发起催稿 + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_REMINDER_TOO)).toString()); + return; + } + if (id > 0) {// erp催稿列表点击再次发送 + OrderMessage message = ORM.get(ZTable.class).item(OrderMessage.class, id); + if (message != null) { + designId = message.getDesignId(); + productionCode = message.getProductionCode(); + coordinaters = message.getConsumerCode(); + topic = message.getTopic(); + remark = message.getRemark(); + } + } + + String consumerCode = null;// 消费者code,多个逗号分隔 + String messageBody = null;// 提醒内容 + int consumerCodeType = 0;// 消费者类型(0:操作员 1:协调人)。默认为0 + if (MessageThemeConstants.MSG_ORDER_REMINDER.value().equalsIgnoreCase(topic)) {// 催稿 + if (status >= StatusConstants.ORDER_10.value() && status <= StatusConstants.ORDER_20.value()) {// 还没派到设计师 + consumerCodeType = 1; + consumerCode = coordinaters; + + messageBody = new StringBuilder("订单 ").append(order.getDesignId() + ",") + .append(order.getBuyerNick() + "(旺旺号)正在催稿、请尽快联系并安排设计师!").toString(); + } + if (status >= StatusConstants.ORDER_30.value() && status < StatusConstants.ORDER_55.hashCode()) {// 分配设计师未完稿 + String designer = order.getDesigner(); + if (ORM.get(ZTable.class).count(OrderMessage.class, new Selector("designId", designId) + .addMust("messageType", 0).addMust("consumerCode", designer)) > 0) {// 同一个订单,同一个设计师有催稿 提醒协调人 + consumerCodeType = 1; + consumerCode = coordinaters; + } else {// 提醒设计师 + consumerCodeType = 0; + consumerCode = designer; + } + + messageBody = new StringBuilder("订单 ").append(order.getDesignId() + ",") + .append(order.getBuyerNick() + "(旺旺号)正在催稿、请尽快联系!").toString(); + } + } else if (MessageThemeConstants.MSG_CHANGE_DESIGNER.value().equalsIgnoreCase(topic)) {// 更换/指定设计师/订单加急 + // 提醒协调人 + consumerCodeType = 1; + consumerCode = coordinaters; + + messageBody = new StringBuilder("订单 ").append(order.getDesignId() + ",") + .append(order.getBuyerNick() + "(旺旺号)该订单客户要求更换设计师,请尽快安排!").toString(); + } + + List messageList = new ArrayList(); + String[] consumerCodes = consumerCode.replace(",", ",").split(","); + for (int i = 0; i < consumerCodes.length; i++) { + OrderMessage message = new OrderMessage(); + message.setDesignId(order.getDesignId()); + message.setBuyerNick(order.getBuyerNick()); + message.setCreateTime(Sqls.nowTimestamp()); + message.setMessageType(0); // 消息类型(0:催稿,1:订单审核、排产退回) + message.setTopic(topic);// 主题 + message.setProductionCode(productionCode);// 生产者 + message.setProductionTime(Sqls.nowTimestamp());// 生产时间 + message.setMessageBody(messageBody);// 消息内容 + message.setConsumerCodeType(consumerCodeType);// 消费者类型 0:普通操作员、1:协调人 + message.setConsumerPlatformType(MessageThemeConstants.PLATFORM_TYPE_DESIGN.value());// 消费平台 + message.setConsumerCode(consumerCodes[i]);// 消费者 + message.setConsumerState(0);// 消费状态,0:未消费 + message.setRemark(remark); + + messageList.add(message); + } + + ORM.get(ZTable.class).insertBatch(messageList);// 消息插入 + + // 插入日志 + OrderLogDao.saveOrderOperateLog(designId, productionCode, + MessageThemeConstants.getName(topic) + (Validates.isEmpty(remark) ? "" : ",备注:" + remark), + EventConstants.ORDER_34.value()); + + request.setResponseResult(new RmiResult("催稿成功").toString()); + } catch (Exception e) { + request.setResponseResult(new RmiResult(700, "查询异常").toString()); + return; + } + } + + /** + * + * [简要描述]: 催稿信息查询接口
            + * [详细描述]:
            + * + * @author gjx + * @param request + */ + public static void doQueryOrderReminderMessage(HttpRequest request) { + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long id = request.getParameterLong("id"); + long designId = request.getParameterLong("designId"); + String buyerNick = request.getParameter("buyerNick"); + String createTimeStart = request.getParameter("createTimeStart"); + String createTimeEnd = request.getParameter("createTimeEnd"); + String productionCode = request.getParameter("productionCode"); + String topic = request.getParameter("topic"); + int consumerState = request.getParameterInt("consumerState"); + boolean steer = request.getParameterBoolean("steer"); + String productionCodes = request.getParameter("productionCodes"); + int page = request.getParameterInt("page", 1); + int pageSize = request.getParameterInt("pageSize", 12); + boolean asc = request.getParameterBoolean("asc"); + try { + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, + new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_MER)).toString()); + return; + } + + Selector selector = new Selector("messageType", 0); + selector.addMaybe("id", id); + selector.addMaybe("designId", designId); + selector.addMaybe("buyerNick", buyerNick); + if (steer && Validates.isNotEmpty(productionCodes)) {// 管理员 + selector.addMustIn("productionCode", Arrays.toStringArray(productionCodes)); + } + selector.addMaybe("productionCode", productionCode); + selector.addMaybe("topic", topic); + selector.addMaybe("consumerState", consumerState); + if (Validates.isNotEmpty(createTimeStart) && Validates.isNotEmpty(createTimeEnd)) { + selector.addMustThenGE("createTime", Sqls.toTimestamp(createTimeStart)); + selector.addMustThenLE("createTime", Sqls.toTimestamp(createTimeEnd)); + } + if (asc) { + selector.addOrderbyAsc("consumerState"); + selector.addOrderbyAsc("createTime"); + } else { + selector.addOrderbyDesc("createTime"); + } + + PageResult pageResult = ORM.get(ZTable.class).page(OrderMessage.class, page, pageSize, + selector); + + Map jsonMap = new HashMap(); + jsonMap.put("msgList", pageResult.list()); + jsonMap.put("total", pageResult.total()); + RmiResult result = new RmiResult(Jsons.toString(jsonMap)); + request.setResponseResult(result.toString()); + } catch (Exception e) { + request.setResponseResult(new RmiResult(700, "查询异常").toString()); + return; + } + } + + /** + * + * [简要描述]:查询设计师
            + * [详细描述]:
            + * + * @author gjx + * @param request + */ + public static void doQueryDesignerOperator(HttpRequest request) { + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + String operatorCode = request.getParameter("operatorCode"); + try { + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, + new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_MER)).toString()); + return; + } + + Selector selector = new Selector("operatorStatus", 0); + selector.addMustNotEqual("operatorType", 0); + selector.addMust("operatorCode", operatorCode); + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, selector); + if (operator == null) {// 操作员不存在 + request.setResponseResult(new RmiResult(404, "设计师不存在").toString()); + return; + } + } catch (Exception e) { + request.setResponseResult(new RmiResult(700, "查询异常,请稍后重试").toString()); + return; + } + } + + /** + * + * [简要描述]: 查询当天有接单日志操作记录的设计师
            + * [详细描述]:
            + * + * @author gjx + * @param request + */ + public static void doQueryOnlineDesigner(HttpRequest request) { + // long merId = request.getParameterLong("merId"); + // String merSecret = request.getParameter("merSecret", ""); + try { + Selector selector = new Selector(); + selector.addFields("operatorCode"); + selector.addMustThenGE("createTime", Sqls.toTimestampBegin(DateTimes.getDateString())); + selector.addMustThenLE("createTime", Sqls.toTimestampEnd(DateTimes.getDateString())); + selector.addGroupbyFields("operatorCode"); + + List designerList = new ArrayList(); + List logList = ORM.get(ZTable.class).list(DesWorkSearchLog.class, selector); + for (DesWorkSearchLog log : logList) { + designerList.add(log.getOperatorCode()); + } + + request.setResponseResult(Jsons.toString(designerList)); + } catch (Exception e) { + request.setResponseResult(new RmiResult(700, "查询异常,请稍后重试").toString()); + return; + } + } + + /** + * + * [简要描述]: 订单指定设计师
            + * [详细描述]:
            + * + * @author gjx + * @param request + */ + public static void doOrderAssignDesigner(HttpRequest request) { + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String creater = request.getParameter("creater"); + String designer = request.getParameter("designer"); + + try { + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, + new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_MER)).toString()); + return; + } + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector().addMust("designId", designId)); + if (order == null) {// 订单不存在 + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_ORD_NOT_EXSISTS)).toString()); + return; + } + + if (StatusConstants.ORDER_10.value() != order.getStatus()) {// 仅限未分拣状态支持指单 + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_BY_STATUS)).toString()); + return; + } + + if (Validates.isNotEmpty(order.getDesigner())) { + request.setResponseResult( + new RmiResult(new RmiError(RmiConstants.ERROR_ORDER_EXIST_DESIGNER)).toString()); + return; + } + + Selector selector = new Selector(); + selector.addMustThenGE("createTime", Sqls.toTimestampBegin(DateTimes.getDateString())); + selector.addMustThenLE("createTime", Sqls.toTimestampEnd(DateTimes.getDateString())); + selector.addMust("operatorCode", designer); + + DesWorkSearchLog log = ORM.get(ZTable.class).item(DesWorkSearchLog.class, selector); + if (null == log) { + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_DESIGNER_OFF_LINE)).toString()); + return; + } + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("designer", designer); + updater.addField("status", StatusConstants.ORDER_30.value()); + updater.addField("orgReceiveTime", Sqls.nowTimestamp()); + updater.addField("designReceiveTime", Sqls.nowTimestamp()); + updater.addField("designBeginTime", Sqls.nowTimestamp()); + updater.addField("receiveType", 2); + updater.addField("orgId", ORM.get(ZTable.class).item(ZmrOperator.class, designer).getOrgId()); + updater.addField("modifyTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + OrderLogDao.saveOrderOperateLog(order.getDesignId(), creater, + "客服【" + creater + "】指定订单给设计师【" + designer + "】", EventConstants.ORDER_3.value()); + + request.setResponseResult(new RmiResult("操作成功").toString()); + } catch (Exception e) { + request.setResponseResult(new RmiResult(700, "查询异常").toString()); + return; + } + } + + /** + * + * [简要描述]: 设计平台同步更新进度备注
            + * [详细描述]:
            + * + * @author gjx + * @param request + */ + public static void doOrdProgressNote(HttpRequest request) { + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String noteJson = request.getParameter("noteJson"); + + try { + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, + new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_MER)).toString()); + return; + } + + OrdProgressNote ordProgressNote = Jsons.toObject(noteJson, OrdProgressNote.class); + if (ordProgressNote != null) { + ordProgressNote.setDesignId(designId); + ORM.get(ZTable.class).insert(ordProgressNote); + } + } catch (Exception e) { + log.error(designId + "同步更新进度备注失败" + e.getMessage(), e); + } + } + + /** + * + * [简要描述]: 设计平台同步更新客户备注
            + * [详细描述]:
            + * + * @author jf + * @param request + */ + public static void doOrdProgressUserText(HttpRequest request) { + long merId = request.getParameterLong("merId"); + String merSecret = request.getParameter("merSecret", ""); + long designId = request.getParameterLong("designId"); + String userText = request.getParameter("userText", ""); + + try { + // 验证 + DesignMerchant merchant = ORM.get(ZTable.class).item(DesignMerchant.class, + new Selector("merchantId", merId)); + if (merchant == null || !merSecret.equals(merchant.getMerchantSecret()) || !merchant.isEnabled()) {// 商户参数错误 + // -商户未开通,或者已停用 + request.setResponseResult(new RmiResult(new RmiError(RmiConstants.ERROR_MER)).toString()); + return; + } + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("userText", userText); + updater.addField("modifyTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + } catch (Exception e) { + log.error(designId + "同步更新客户备注失败" + e.getMessage(), e); + } + } + + /** + * + * [简要描述]: 查询当天有接单日志操作记录的设计师
            + * [详细描述]:
            + * + * @author gjx + * @param request + */ + public static void doQueryOrderDesignStatus(HttpRequest request) { + // long merId = request.getParameterLong("merId"); + // String merSecret = request.getParameter("merSecret", ""); + try { + long designId = request.getParameterLong("designId"); + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, designId); + String status = "0"; + if (order != null) { + status = String.valueOf(order.getStatus()); + } + request.setResponseResult(status); + } catch (Exception e) { + request.setResponseResult(new RmiResult(700, "查询异常,请稍后重试").toString()); + return; + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/RmiConstants.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/RmiConstants.java new file mode 100644 index 0000000..b9dae22 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/RmiConstants.java @@ -0,0 +1,109 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.rmi; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +/*** + * rmi 常量 + * + * @version v1.0.0 @author longguizhi 2018-9-14 新建与整理 + */ +public class RmiConstants +{ + /** 商户参数错误 -商户未开通,或者已停用 **/ + public static Int ERROR_MER = new Int(701, "商户或者秘钥不正确,或者已停用"); + + /** 商户单号错误,单号必须大于0 **/ + public static Int ERROR_OUT_ID = new Int(702, "商户单号错误,单号必须大于0"); + + /** 商户订单信息错误,订单信息不能为空且,不能超过200个字符 **/ + public static Int ERROR_ORD_TEXT = new Int(703, "订单信息错误,订单信息不能为空且,不能超过200个字符"); + + /** 商户 用户手机参数错误 不能为空且不能超过20个字符 **/ + public static Int ERROR_USER_MOBILE = new Int(704, "用户手机参数错误 不能为空且不能超过20个字符"); + + /** 商户 稿件参数错误 不支持的稿件类型 **/ + public static Int ERROR_DRAFT_TYPE = new Int(705, "不支持的稿件类型"); + + /** 商户 设计参数错误 不支持的设计类型 **/ + public static Int ERROR_DESIGN_TYPE = new Int(706, "不支持的设计类型"); + + /** 商户 行业参数错误 不支持的行业 **/ + public static Int ERROR_INDUSTRY = new Int(707, "不支持的行业"); + + /** 商户 尺寸参数错误 不支持的设计尺寸 **/ + public static Int ERROR_SIZE = new Int(708, "不支持的设计尺寸"); + + /** 商户 面数参数错误 面数必须大于0 **/ + public static Int ERROR_PAGE_LE_ZERO = new Int(709, "面数参数错误, 必须大于0"); + + /** 商户 款模参数错误 款数/模数错误, 必须大于0 **/ + public static Int ERROR_KS_MS_LE_ZERO = new Int(710, "款数、模数错误, 必须大于0"); + + public static Int ERROR_TO_LONG = new Int(711, "数据内容过长"); + + /*** 参数内容过长 指定字段 构造内容过长信息 */ + public static Int ERROR_TO_LONG(String fieldName) + { + return ERROR_TO_LONG(fieldName, 0); + } + + /*** 参数内容过长 指定字段 构造内容过长信息和字数信息 */ + public static Int ERROR_TO_LONG(String fieldName, int maxLen) + { + return new Int(ERROR_TO_LONG.value(), (Validates.isEmptyBlank(fieldName) ? "" : "[" + Strings.trim(fieldName) + "]") + ERROR_TO_LONG.desc() + + (maxLen > 0 ? (Validates.isNotEmptyBlank(fieldName) ? ",数据不能超过" + maxLen + "个字符" : "") : "")); + } + + /** 商户 订单已存在 **/ + public static Int ERROR_ORD_EXSISTS = new Int(712, "订单已存在"); + + /** 商户 订单不存在 **/ + public static Int ERROR_ORD_NOT_EXSISTS = new Int(713, "订单不存在"); + + /** 文件URL地址 错误 没有后缀名, **/ + public static Int ERROR_FILE_URL = new Int(714, "文件URL地址错误! "); + + /** 商户 取消原因,设计重印原因,拒绝退款原因 原因不能为空且不能超过200个字符 **/ + public static Int ERROR_REASON = new Int(715, "原因不能为空且不能超过200个字符"); + + /** 商户操作设计订单, 由于状态 原因 被拒绝 **/ + public static Int ERROR_BY_STATUS = new Int(716, "当前订单状态,不允许该项操作"); + + /** 滞留单处理人不能为空 **/ + public static Int RETENTI_DEAL_NAME = new Int(717, "滞留单处理人不能为空"); + + /** 修改信息失败 */ + public static Int ERROR_UPDATE_INFO = new Int(718, "修改信息失败"); + + /** 商户操作订单,由于稿件类型 原因 被拒绝 */ + public static Int ERROR_NONSUPPORT_DRAFT_TYPE = new Int(719, "不支持操作的稿件类型"); + + /** 催稿太频繁 被拒绝 */ + public static Int ERROR_REMINDER_TOO = new Int(720, "催稿太频繁,请稍后操作"); + + /** 设计师不在线 */ + public static Int ERROR_DESIGNER_OFF_LINE = new Int(721, "设计师不在线"); + + /** 订单已分派设计师 */ + public static Int ERROR_ORDER_EXIST_DESIGNER = new Int(722, "订单已分派设计师"); + + /** 印前改稿组织负责人未配置 */ + public static Int ERROR_ORG_MANAGE_IS_NULL = new Int(723, "印前改稿组织负责人未配置"); + + /** 订单状态:请求退款不能强制取消 */ + public static Int ERROR_ORD_STATUS_IS_NOTBE34 = new Int(724, "请求退款状态不允许取消"); + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/erp/ErpRmiService.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/erp/ErpRmiService.java new file mode 100644 index 0000000..51a162b --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/erp/ErpRmiService.java @@ -0,0 +1,420 @@ +/** + * 扬彩印刷设计 + * 文件名 :ErpRmiService.java + * 创建人 :gjx + * 创建时间:2019-11-7 + */ + +package com.zhiqim.yangcai.design.rmi.erp; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.json.JSONObject; +import org.zhiqim.kernel.httpclient.HttpRMI; +import org.zhiqim.kernel.httpclient.HttpResult; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrParam; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.model.StatSelfdraftDayModel; +import com.zhiqim.yangcai.design.model.StatSelfraftListingModel; +import com.zhiqim.yangcai.design.rmi.module.RmiResult; + +/** + * [简要描述]ERP RMI接口类:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-11-7 新建与整理 + */ +public class ErpRmiService +{ + private static final Log log = LogFactory.getLog(ErpRmiService.class); + + /** + * + * [简要描述]RMI 远程调用参数初始化:
            + * [详细描述]:
            + * + * @author gjx + * @param className 类名 + * @param methodName 方法名 + * @return + * @throws Exception + */ + private static HttpRMI getClient(String className, String methodName) throws Exception + { + + // //接口主机 + ZmrParam designHost = ORM.get(ZTable.class).item(ZmrParam.class, new Selector("paramGroup", "yangcai.erp").addMust("paramKey", "erpHost")); + if (designHost == null) + { + throw new Exception("ERP【主机地址】参数未配置"); + } + + // rmi key + ZmrParam rmiKey = ORM.get(ZTable.class).item(ZmrParam.class, new Selector("paramGroup", "yangcai.erp").addMust("paramKey", "rmiKey")); + ZmrParam rmiSecret = ORM.get(ZTable.class).item(ZmrParam.class, new Selector("paramGroup", "yangcai.erp").addMust("paramKey", "rmiSecret")); + + if (rmiKey == null || rmiSecret == null || Validates.isEmptyBlank(rmiKey.getParamValue()) || Validates.isEmptyBlank(rmiSecret.getParamValue())) + { + throw new Exception("ERP【RMI】参数未配置"); + } + + String url = designHost.getParamValue(); + url = Strings.endsWith(url, "/service/rmi") ? url : Strings.addEndsWith(Strings.trimRight(url, "/"), "/service/rmi"); + HttpRMI client = new HttpRMI(url); + + client.setConnectTimeout(10); + client.setReadTimeout(30 * 60); + client.setKeySecret(rmiKey.getParamValue(), rmiSecret.getParamValue()); + client.setClassName(className); + client.setMethodName(methodName); + return client; + } + + /** + * + * [简要描述]:
            + * [详细描述]:
            + * + * @author gjx + * @param deptId 部门id + * @return + * @throws Exception + */ + public static Map doQueryPrdFeePercentageInfo(long deptId) throws Exception + { + HttpRMI rmi = getClient("ErpRmiServer", "doQueryPrdFeePercentageInfo"); + rmi.addParam("deptId", deptId); + rmi.execute(); + + Map map = new HashMap(); + HttpResult result = rmi.getResult(); + if (!result.isSuccess()) + { + throw new Exception("Rmi 查询部门提成系数信息失败:" + result.getResponseText()); + } + // 非通信问题 + RmiResult rmiResult = Jsons.toObject(result.getResponseText(), RmiResult.class); + if (!rmiResult.isSuccess()) + { + log.error("Rmi 查询部门提成系数信息失败:" + rmiResult); + throw new Exception(rmiResult.toString()); + } + + JSONObject obj = new JSONObject(rmiResult.getResultText()); + map.put("fee", obj.get("fee").toString()); + return map; + } + + /** + * + * [简要描述]根据订单号查询产品信息:
            + * [详细描述]:
            + * + * @author gjx + * @param prdId 产品类型id + * @throws Exception + */ + public static Map doQueryOrderProductInfo(long designId) throws Exception + { + HttpRMI rmi = getClient("ErpRmiServer", "doQueryOrderProductInfo"); + rmi.addParam("designId", designId); + rmi.execute(); + + Map map = new HashMap(); + HttpResult result = rmi.getResult(); + if (!result.isSuccess()) + { + throw new Exception("Rmi 查询产品信息失败:" + result.getResponseText()); + } + // 非通信问题 + RmiResult rmiResult = Jsons.toObject(result.getResponseText(), RmiResult.class); + if (!rmiResult.isSuccess()) + { + log.error("Rmi 查询产品信息失败:" + rmiResult); + throw new Exception(rmiResult.toString()); + } + + JSONObject obj = new JSONObject(rmiResult.getResultText()); + map.put("product", obj.get("product").toString()); + map.put("number", obj.get("number").toString()); + return map; + } + + /** + * + * [简要描述] 修改淘宝订单旗帜:
            + * [详细描述]:
            + * + * @author gjx + * @param sellerNick 店铺名称 + * @param tid 淘宝交易id + * @param flag 旗帜标记 + * @param memo 描述 + * @return + * @throws Exception + */ + public static boolean doUpdateTaobaoOrderFlag(String sellerNick, String tid, int flag, String memo) throws Exception + { + HttpRMI rmi = getClient("ErpRmiServer", "doUpdateTaobaoOrderFlag"); + rmi.addParam("sellerNick", sellerNick); + rmi.addParam("tid", tid); + rmi.addParam("flag", flag); + rmi.addParam("memo", memo); + rmi.execute(); + + HttpResult result = rmi.getResult(); + if (!result.isSuccess()) + { + throw new Exception("Rmi 修改淘宝旗帜失败:" + result.getResponseText()); + } + // 非通信问题 + RmiResult rmiResult = Jsons.toObject(result.getResponseText(), RmiResult.class); + if (!rmiResult.isSuccess()) + { + log.error("Rmi 修改淘宝旗帜失败:" + rmiResult); + throw new Exception(rmiResult.toString()); + } + return true; + } + + /** + * + * [简要描述]审核退回补单直接取消:
            + * [详细描述]:
            + * + * @author gjx + * @param designId 设计订单id + * @param cancelName 取消人 + * @param cancelNote 取消原因 + * @return + * @throws Exception + */ + public static boolean doCheckBackCancelOrder(long designId, String cancelName, String cancelNote) throws Exception + { + HttpRMI rmi = getClient("ErpRmiServer", "doCheckBackCancelOrder"); + rmi.addParam("designId", designId); + rmi.addParam("cancelName", cancelName); + rmi.addParam("cancelNote", cancelNote); + rmi.execute(); + + HttpResult result = rmi.getResult(); + if (!result.isSuccess()) + { + throw new Exception("Rmi 取消订单失败:" + result.getResponseText()); + } + // 非通信问题 + RmiResult rmiResult = Jsons.toObject(result.getResponseText(), RmiResult.class); + if (!rmiResult.isSuccess()) + { + log.error("Rmi 取消订单失败:" + rmiResult); + throw new Exception(rmiResult.toString()); + } + return true; + } + + /** + * + * [简要描述]ERP订单快照日志表增加自来稿操作记录供报表使用:
            + * [详细描述]:
            + * + * @author gjx + * @param designId 订单id + * @param eventType 事件类型 + * @return + */ + public static boolean doOrdLogInsertSelfLogInfo(long designId, String eventType) throws Exception + { + HttpRMI rmi = getClient("ErpRmiServer", "doOrdLogInsertSelfLogInfo"); + rmi.addParam("designId", designId); + rmi.addParam("eventType", eventType); + rmi.execute(); + + HttpResult result = rmi.getResult(); + if (!result.isSuccess()) + { + throw new Exception("Rmi OrdLog日志快照表增加自来稿操作日志信息失败:" + result.getResponseText()); + } + // 非通信问题 + RmiResult rmiResult = Jsons.toObject(result.getResponseText(), RmiResult.class); + if (!rmiResult.isSuccess()) + { + log.error("Rmi OrdLog日志快照表增加自来稿操作日志信息失败:" + rmiResult); + throw new Exception(rmiResult.toString()); + } + return true; + } + + /** + * + * [简要描述]查询自来稿订单详情统计信息:
            + * [详细描述]:
            + * + * @author gjx + * @param dayCode 日期 yyyy-MM-dd + * @return + * @throws Exception + */ + public static List doStatSelfdraftDayInfo(String dayCode) throws Exception + { + HttpRMI rmi = getClient("ErpRmiServer", "doStatSelfdraftDayInfo"); + rmi.addParam("dayCode", dayCode); + rmi.execute(); + + HttpResult result = rmi.getResult(); + if (!result.isSuccess()) + { + throw new Exception("Rmi 查询自来稿订单详情统计信息失败:" + result.getResponseText()); + } + // 非通信问题 + RmiResult rmiResult = Jsons.toObject(result.getResponseText(), RmiResult.class); + if (!rmiResult.isSuccess()) + { + log.error("Rmi 查询自来稿订单详情统计信息失败:" + rmiResult); + throw new Exception(rmiResult.toString()); + } + + JSONObject obj = new JSONObject(rmiResult.getResultText()); + List statList = Jsons.toList(obj.get("selfDay").toString(), StatSelfdraftDayModel.class); + return statList; + } + + /** + * + * [简要描述]RMI 查询自来稿订单详情清单:
            + * [详细描述]:
            + * + * @author gjx + * @param dayCode 日期 yyyy-MM-dd + * @param operatorCode 操作员CODE + * @param statType 统计类型 + * @return + * @throws Exception + */ + public static List doSelfDraftOrderStatDetailInfo(String dayCode, String operatorCode, String statType) throws Exception + { + HttpRMI rmi = getClient("ErpRmiServer", "doSelfDraftOrderStatDetailInfo"); + rmi.addParam("dayCode", dayCode); + rmi.addParam("operatorCode", operatorCode); + rmi.addParam("statType", statType); + rmi.execute(); + + HttpResult result = rmi.getResult(); + if (!result.isSuccess()) + { + throw new Exception("Rmi 查询自来稿订单详情清单:" + result.getResponseText()); + } + // 非通信问题 + RmiResult rmiResult = Jsons.toObject(result.getResponseText(), RmiResult.class); + if (!rmiResult.isSuccess()) + { + log.error("Rmi 查询自来稿订单详情清单:" + rmiResult); + throw new Exception(rmiResult.toString()); + } + + JSONObject obj = new JSONObject(rmiResult.getResultText()); + List statList = Jsons.toList(obj.get("selfDetailDay").toString(), StatSelfraftListingModel.class); + return statList; + } + + /** + * + * [简要描述]添加订单的售后留言:
            + * [详细描述]:
            + * + * @author gjx + * @param designId 设计订单id + * @param cancelName 取消人 + * @param cancelNote 取消原因 + * @return + * @throws Exception + */ + public static boolean doAddAfterMessage(long oid, String creater, String createTime, String complainFlag, String note) throws Exception + { + HttpRMI rmi = getClient("ErpRmiServer", "doAddAfterMessage"); + rmi.addParam("oid", oid); + rmi.addParam("creater", creater); + rmi.addParam("createTime", createTime); + rmi.addParam("complainFlag", complainFlag); + rmi.addParam("note", note); + rmi.execute(); + + HttpResult result = rmi.getResult(); + if (!result.isSuccess()) + { + throw new Exception("Rmi 添加订单的售后留言失败:" + result.getResponseText()); + } + // 非通信问题 + RmiResult rmiResult = Jsons.toObject(result.getResponseText(), RmiResult.class); + if (!rmiResult.isSuccess()) + { + log.error("Rmi 加订单的售后留言失败:" + rmiResult); + throw new Exception(rmiResult.toString()); + } + return true; + } + + /** + * + * [简要描述]: ERP、设计平台同步更新进度备注
            + * [详细描述]:
            + * + * @author gjx + * @param designId + * @param noteJson + * @throws Exception + */ + public static void doOrdProgressNote(long designId, String noteJson) throws Exception + { + HttpRMI client = getClient("ErpRmiServer", "doOrdProgressNote"); + client.addParam("designId", designId); + client.addParam("noteJson", noteJson); + client.execute(); + + HttpResult result = client.getResult(); + if (!result.isSuccess()) + { + log.error("订单[" + designId + "]ERP同步更新进度备注失败"); + } + } + + public static boolean doSynOrder(long designId, String designer) throws Exception + { + HttpRMI client = getClient("ErpRmiServer", "doSynOrder"); + client.addParam("designId", designId); + client.addParam("designer", designer); + client.execute(); + + HttpResult result = client.getResult(); + if (!result.isSuccess()) + { + log.error("订单[" + designId + "]同步ERP状态:[请求退款]失败"); + return false; + } + return true; + } + + public static boolean doSynOrderCancel(long designId) throws Exception + { + HttpRMI client = getClient("ErpRmiServer", "doSynOrderCancel"); + client.addParam("designId", designId); + client.execute(); + + HttpResult result = client.getResult(); + if (!result.isSuccess()) + { + log.error("订单[" + designId + "]同步ERP状态:[已取消]失败"); + return false; + } + return true; + } +} \ No newline at end of file diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/DesignAttaModule.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/DesignAttaModule.java new file mode 100644 index 0000000..3905a09 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/DesignAttaModule.java @@ -0,0 +1,92 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.rmi.module; + +import org.zhiqim.kernel.json.Jsons; + + +/**** + * 文件对象 + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public class DesignAttaModule +{ + private long designId; //设计订单号 + private long attaId; //附件编号 + private String attaModule; //附件类型 + private String fileName; //文件名 + private long fileExt; //文件后缀名 + private long fileSize; //文件大小 + private String downUrl; //下载地址 + public long getDesignId() + { + return designId; + } + public void setDesignId(long designId) + { + this.designId = designId; + } + public long getAttaId() + { + return attaId; + } + public void setAttaId(long attaId) + { + this.attaId = attaId; + } + public String getAttaModule() + { + return attaModule; + } + public void setAttaModule(String attaModule) + { + this.attaModule = attaModule; + } + public String getFileName() + { + return fileName; + } + public void setFileName(String fileName) + { + this.fileName = fileName; + } + public long getFileExt() + { + return fileExt; + } + public void setFileExt(long fileExt) + { + this.fileExt = fileExt; + } + public long getFileSize() + { + return fileSize; + } + public void setFileSize(long fileSize) + { + this.fileSize = fileSize; + } + public String getDownUrl() + { + return downUrl; + } + public void setDownUrl(String downUrl) + { + this.downUrl = downUrl; + } + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/OrderDesignerModule.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/OrderDesignerModule.java new file mode 100644 index 0000000..c630b02 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/OrderDesignerModule.java @@ -0,0 +1,69 @@ +package com.zhiqim.yangcai.design.rmi.module; + +import java.io.Serializable; + +/**** + * 订单设计师相关 + * + * @version v1.0.0 @author jiangbin 2020-5-7 新建与整理 + */ +public class OrderDesignerModule implements Serializable +{ + private static final long serialVersionUID = 1L; + + private long orderId;// 订单ID + private String designerCode;// 设计师code + private String designerName;// 设计师名称 + private long designerOrgId;// 设计师所属组织ID + private String designerOrgName;// 设计师所属组织名称 + + public long getOrderId() + { + return orderId; + } + + public void setOrderId(long orderId) + { + this.orderId = orderId; + } + + public String getDesignerCode() + { + return designerCode; + } + + public void setDesignerCode(String designerCode) + { + this.designerCode = designerCode; + } + + public String getDesignerName() + { + return designerName; + } + + public void setDesignerName(String designerName) + { + this.designerName = designerName; + } + + public long getDesignerOrgId() + { + return designerOrgId; + } + + public void setDesignerOrgId(long designerOrgId) + { + this.designerOrgId = designerOrgId; + } + + public String getDesignerOrgName() + { + return designerOrgName; + } + + public void setDesignerOrgName(String designerOrgName) + { + this.designerOrgName = designerOrgName; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/OrderModule.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/OrderModule.java new file mode 100644 index 0000000..d964f84 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/OrderModule.java @@ -0,0 +1,405 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.rmi.module; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.server.module.ApiFile; + +/** + * 订单表 对应表《DESIGN_ORDER》 + */ +public class OrderModule implements Serializable, Comparable +{ + private static final long serialVersionUID = 1L; + + private long merchantId; // 2.订单商户编号 + private long designId; // 1.设订单编号,设计平台独立编号 + private int status; // 4.订单状态 + private long orgId; // 28.操作员组织编号 + private Timestamp orgReceiveTime; // 29.订单分拣至商户时间 + private int receiveType; // 30.订单领取类型,0手动领单, 1 自动派单,2 手工指定 + private int orderFlag; // 31.订单标记,0:正常订单,1:老用户订单(不计时效),2:老用户订单(计时效) + private String designer; // 32.设计师 + private Timestamp designReceiveTime; // 33.设计师领单时间 + private Timestamp designBeginTime; // 34.设计师开始设计时间 + private Timestamp designDraftTime; // 35.设计师初稿时间 + private Timestamp designEndTime; // 36.设计师定稿时间 + private String designPauseReason; // 37.设计师暂停原因(新增字段) + private Timestamp designPauseTime; // 38.设计师暂停时间 + private String designExclude; // 39.设计师排除,多个逗号分隔 + private String designRequestReason; // 40.设计师请求主管支援原由 + private Timestamp requestTime; // 41.设计师请求主管支援 时间 + private String designRejectReason; // 42.主管支援拒绝原因 + private int designKeepDuration; // 43.设计师保留时长,单位分钟 + private String requestRefoundAcceptReason; // 44.请求退款原因 + private String canceler; // 49.取消人 + private Timestamp cancelTime; // 50.取消时间 + private String cancelReason; // 51.取消原因 + + private Timestamp modifyTime; // 53.修改时间 + + private String endFileUrl;// 订单完成后 成品文件 下载路径 + private String endFileExt;// 订单完成后 成品扩展名 + private long endFileLength;// 订单完成后 文件大小 + + private String designFileUrl;// 订单完成后 设计文件 下载路径 + private String designFileExt;// 订单完成后 设计成品扩展名 + private long designFileLength;// 订单完成后 设计文件大小 + + private List apiFiles = new ArrayList<>();// 附件信息 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getMerchantId() + { + return merchantId; + } + + public void setMerchantId(long merchantId) + { + this.merchantId = merchantId; + } + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public Timestamp getOrgReceiveTime() + { + return orgReceiveTime; + } + + public void setOrgReceiveTime(Timestamp orgReceiveTime) + { + this.orgReceiveTime = orgReceiveTime; + } + + public int getReceiveType() + { + return receiveType; + } + + public void setReceiveType(int receiveType) + { + this.receiveType = receiveType; + } + + public int getOrderFlag() + { + return orderFlag; + } + + public void setOrderFlag(int orderFlag) + { + this.orderFlag = orderFlag; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public Timestamp getDesignReceiveTime() + { + return designReceiveTime; + } + + public void setDesignReceiveTime(Timestamp designReceiveTime) + { + this.designReceiveTime = designReceiveTime; + } + + public Timestamp getDesignBeginTime() + { + return designBeginTime; + } + + public void setDesignBeginTime(Timestamp designBeginTime) + { + this.designBeginTime = designBeginTime; + } + + public Timestamp getDesignDraftTime() + { + return designDraftTime; + } + + public void setDesignDraftTime(Timestamp designDraftTime) + { + this.designDraftTime = designDraftTime; + } + + public Timestamp getDesignEndTime() + { + return designEndTime; + } + + public void setDesignEndTime(Timestamp designEndTime) + { + this.designEndTime = designEndTime; + } + + public String getDesignPauseReason() + { + return designPauseReason; + } + + public void setDesignPauseReason(String designPauseReason) + { + this.designPauseReason = designPauseReason; + } + + public Timestamp getDesignPauseTime() + { + return designPauseTime; + } + + public void setDesignPauseTime(Timestamp designPauseTime) + { + this.designPauseTime = designPauseTime; + } + + public String getDesignExclude() + { + return designExclude; + } + + public void setDesignExclude(String designExclude) + { + this.designExclude = designExclude; + } + + public String getDesignRequestReason() + { + return designRequestReason; + } + + public void setDesignRequestReason(String designRequestReason) + { + this.designRequestReason = designRequestReason; + } + + public Timestamp getRequestTime() + { + return requestTime; + } + + public void setRequestTime(Timestamp requestTime) + { + this.requestTime = requestTime; + } + + public String getDesignRejectReason() + { + return designRejectReason; + } + + public void setDesignRejectReason(String designRejectReason) + { + this.designRejectReason = designRejectReason; + } + + public int getDesignKeepDuration() + { + return designKeepDuration; + } + + public void setDesignKeepDuration(int designKeepDuration) + { + this.designKeepDuration = designKeepDuration; + } + + public String getRequestRefoundAcceptReason() + { + return requestRefoundAcceptReason; + } + + public void setRequestRefoundAcceptReason(String requestRefoundAcceptReason) + { + this.requestRefoundAcceptReason = requestRefoundAcceptReason; + } + + public String getCanceler() + { + return canceler; + } + + public void setCanceler(String canceler) + { + this.canceler = canceler; + } + + public Timestamp getCancelTime() + { + return cancelTime; + } + + public void setCancelTime(Timestamp cancelTime) + { + this.cancelTime = cancelTime; + } + + public String getCancelReason() + { + return cancelReason; + } + + public void setCancelReason(String cancelReason) + { + this.cancelReason = cancelReason; + } + + public Timestamp getModifyTime() + { + return modifyTime; + } + + public void setModifyTime(Timestamp modifyTime) + { + this.modifyTime = modifyTime; + } + + public String getEndFileUrl() + { + return endFileUrl; + } + + public void setEndFileUrl(String endFileUrl) + { + this.endFileUrl = endFileUrl; + } + + public String getEndFileExt() + { + return endFileExt; + } + + public void setEndFileExt(String endFileExt) + { + this.endFileExt = endFileExt; + } + + public long getEndFileLength() + { + return endFileLength; + } + + public void setEndFileLength(long endFileLength) + { + this.endFileLength = endFileLength; + } + + public String getDesignFileUrl() + { + return designFileUrl; + } + + public void setDesignFileUrl(String designFileUrl) + { + this.designFileUrl = designFileUrl; + } + + public String getDesignFileExt() + { + return designFileExt; + } + + public void setDesignFileExt(String designFileExt) + { + this.designFileExt = designFileExt; + } + + public long getDesignFileLength() + { + return designFileLength; + } + + public void setDesignFileLength(long designFileLength) + { + this.designFileLength = designFileLength; + } + + public List getApiFiles() + { + return apiFiles; + } + + public void setApiFiles(List apiFiles) + { + this.apiFiles = apiFiles; + } + + @Override + public int compareTo(OrderModule o) + { + + if (o == null) + { + return 1; + } + if (this.modifyTime == null || o.getModifyTime() == null) + { + return 0; + } + + long flag = this.modifyTime.getTime() - o.getModifyTime().getTime(); + + if (flag == 0L) + { + return 0; + } + + return flag > 0 ? 1 : -1; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/RmiError.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/RmiError.java new file mode 100644 index 0000000..7e12f25 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/RmiError.java @@ -0,0 +1,45 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.rmi.module; + +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.consts.Int; + +public class RmiError +{ + private Int error; + public RmiError(Int error) + { + this.error = error; + } + + public RmiError(int error_code, String error_msg) + { + this.error = new Int(error_code, error_msg); + } + + public int getErrorCode() + { + return error.value(); + } + + public String getErrorMsg() + { + return error.desc(); + } + + public String toString() + { + return Jsons.toString("error_code", error.value(), "error_msg", error.desc()); + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/RmiResult.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/RmiResult.java new file mode 100644 index 0000000..dbede27 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/rmi/module/RmiResult.java @@ -0,0 +1,85 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.rmi.module; + +import org.zhiqim.kernel.json.Jsons; + +/** + * Rmi 结果对象 + * + * @version v1.0.0 @author longguizhi 2018-9-14 新建与整理 + */ +public class RmiResult +{ + private int error_code; + private String error_msg; + private String resultText; + + public RmiResult(){} + + public RmiResult(String resultText) + { + this.resultText = resultText; + } + + public RmiResult(RmiError error) + { + this.error_code = error.getErrorCode(); + this.error_msg = error.getErrorMsg(); + } + + public RmiResult(int error_code, String error_msg) + { + this.error_code = error_code; + this.error_msg = error_msg; + } + + public int getError_code() + { + return error_code; + } + public void setError_code(int error_code) + { + this.error_code = error_code; + } + public String getError_msg() + { + return error_msg; + } + public void setError_msg(String error_msg) + { + this.error_msg = error_msg; + } + public String getResultText() + { + return resultText; + } + public void setResultText(String resultText) + { + this.resultText = resultText; + } + + public boolean isSuccess() + { + return error_code == 0; + } + + + public RmiError getError() + { + return isSuccess() ? null : new RmiError(error_code, error_msg); + } + public String toString() + { + return this.isSuccess() ? Jsons.toString("resultText", this.resultText) : this.getError().toString(); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/service/ContendOrderService.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/service/ContendOrderService.java new file mode 100644 index 0000000..45986c9 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/service/ContendOrderService.java @@ -0,0 +1,480 @@ +package com.zhiqim.yangcai.design.service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.aliyuncs.utils.StringUtils; +import com.zhiqim.yangcai.cache.DesignTypeCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DispatchDao; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatchValue; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupValue; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupView; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.profile.DesignerCourse; +import com.zhiqim.yangcai.design.server.ErpClassService; +import com.zhiqim.yangcai.design.server.ErpClassService.statusEnum; +import com.zhiqim.yangcai.util.RedisUtils; + +import redis.clients.jedis.Jedis; + +/** + * + * [简要描述]:抢单Service
            + * [详细描述]:
            + * + * @version 1.0 @author hc 2021年6月2日 新建与整理 + */ + +public class ContendOrderService { + private static final Log log = LogFactory.getLog(ContendOrderService.class); + + /** + * + * [简要描述]:是否有已完善个人信息
            + * [详细描述]:
            + * + * @author hc + * @param operatorCode + * @return + * @throws Exception + */ + public static boolean isOrderAuthority(String operatorCode) throws Exception { + DesignerCourse designerCourseResult = ORM.get(ZTable.class).item(DesignerCourse.class, operatorCode); + if (designerCourseResult == null) { + return false; + } + + return true; + } + + /** + * + * [简要描述]:是否有权限接受此单
            + * [详细描述]:
            + * + * @author hc + * @param designId + * @param operatorCode + * @param designerGroupDispatchResult + * @return + * @throws Exception + */ + public static Map isPassMuster(long designId, String operatorCode, + DesignerGroupDispatch designerGroupDispatchResult) throws Exception { + Map mapResult = new HashMap(); + + DesignerGroupView result = ORM.get(ZView.class).item(DesignerGroupView.class, + new Selector().addMaybe("operatorCode", operatorCode)); + DesignOrder designOrderResult = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector().addMust("designId", designId)); + + // 是否有设计师组或设计师接单规则 + if (result == null) { + // mapResult.put("nullError", "抱歉,无设计师组或无设计师接单规则,不能接此订单。"); + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【无设计师组或无设计师接单规则】"); + return mapResult; + } + + // 订单信息是否为空 + if (designOrderResult == null) { + // mapResult.put("nullError", "抱歉,无订单信息,不能接此订单。"); + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【无订单信息】"); + return mapResult; + } + + // 是否有设计师接单规则 + if (designerGroupDispatchResult == null) { + // mapResult.put("designerGroupError", "抱歉,无设计师接单规则,不能接此订单。"); + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【无设计师接单规则】"); + return mapResult; + } + + // 是否支持优质订单 + boolean designHighQualityOrder = designOrderResult.isHighQualityOrder(); + if (designHighQualityOrder) { + boolean groupHighQualityOrder = result.isHighQualityOrder(); + boolean designerHighQualityOrder = result.isDesignerHighQualityOrder(); + if (!groupHighQualityOrder && !designerHighQualityOrder) { + // mapResult.put("highQualityOrderError", "抱歉,您不能接优质订单,不能接此订单。"); + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【不能接优质订单】"); + return mapResult; + } + } + + // 是否支持加急订单 + boolean designUrgent = designOrderResult.isUrgent(); + if (designUrgent) { + boolean groupUrgent = result.isUrgent(); + boolean designerUrgent = result.isDesignerUrgent(); + if (!groupUrgent && !designerUrgent) { + // mapResult.put("urgentError", "抱歉,您不能接加急订单,不能接此订单。"); + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【不能接加急订单】"); + return mapResult; + } + } + + // 是否支持大金额订单 + long designAmount = designOrderResult.getAmount(); + if (designAmount > 30000) { + boolean groupLargeAmount = result.isLargeAmount(); + boolean designerLargeAmount = result.isDesignerLargeAmount(); + if (!groupLargeAmount && !designerLargeAmount) { + // mapResult.put("amountError", "抱歉,您不能接大金额订单,不能接此订单。"); + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【不能接大金额订单】"); + return mapResult; + } + } + + // 是否支持 仅设计订单 + boolean designOnlyDesign = designOrderResult.isOnlyDesign(); + if (designOnlyDesign) { + boolean groupDesign = result.isDesign(); + boolean designerDesign = result.isDesignerDesign(); + if (!groupDesign && !designerDesign) { + // mapResult.put("designError", "抱歉,您不能接仅设计订单,不能接此订单。"); + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【不能接仅设计订单】"); + return mapResult; + } + } + + // 是否支持异形单 + if ((designOrderResult.getPrintWidth() > 0 || designOrderResult.getPrintHeight() > 0)) { + if (!result.isSpecial() && !result.isDesignerSpecial()) { + // mapResult.put("specialError", "抱歉,您不能接异形订单,不能接此订单。"); + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【不能接异形订单】"); + return mapResult; + } + } + + // 未完成订单是否已满 + int orderNumber = DispatchDao.getUnCompleteOrderNumber(operatorCode); + if (result != null) { + int maxOrderNum = result.getDesignerMaxOrderNum(); + if (maxOrderNum == 0) { + maxOrderNum = result.getMaxOrderNum(); + } + if (orderNumber >= maxOrderNum) { + mapResult.put("maxOrderNum", "你的未完成订单数量已满,请完成订单后再来抢单哦!"); + return mapResult; + } + } + + // 是否支持后加工类型 + String groupAfterNames = result.getAfterNames(); + String designAfterNames = designOrderResult.getAfterNames(); + String designerAfterNames = result.getDesignerAfterNames(); + String[] groupSplit = null; + String[] designSplit = null; + String[] designerSplit = null; + List designSplitList = null; + int size = 0; + if (designAfterNames != null) { + if (groupAfterNames == null && designerAfterNames == null) { + // mapResult.put("afterNamesError", "抱歉,您不支持此后加工类型,不能接此订单。"); + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【不支持后加工类型】"); + return mapResult; + } + if (Validates.isNotEmpty(groupAfterNames)) { + groupSplit = groupAfterNames.split(","); + } + if (Validates.isNotEmpty(designAfterNames)) { + designSplit = designAfterNames.split(","); + + // Arrays.asList继承的AbstractList + // add,remove会出现java.lang.UnsupportedOperationException异常 + designSplitList = new ArrayList(Arrays.asList(designSplit)); + size = designSplitList.size(); + } + if (Validates.isNotEmpty(designerAfterNames)) { + designerSplit = designerAfterNames.split(","); + } + int designSplitLength = 0; + int flagDesign = 0; + int flagDesigner = 0; + if (Validates.isNotEmpty(designSplit)) { + designSplitLength = designSplit.length; + } + // 设计师组 后加工匹配 + if (Validates.isNotEmpty(designSplitList) && Validates.isNotEmpty(groupSplit)) { + re: for (int i = 0; i <= size - 1; i++) { + for (String groupAfterName : groupSplit) { + if (designSplitList.isEmpty()) { + break; + } + if (designSplitList.get(i).equals(groupAfterName)) { + flagDesign++; + designSplitList.remove(i); + i--; + size--; + continue re; + } + } + } + } + // 设计师个人 后加工匹配 + if (Validates.isNotEmpty(designSplitList) && Validates.isNotEmpty(designerSplit)) { + for (String designAfterName : designSplitList) { + for (String designerAfterName : designerSplit) { + if (designerAfterName.equals(designAfterName)) { + flagDesigner++; + } + } + } + } + if (flagDesign != designSplitLength && flagDesigner != designSplitLength + && (flagDesign + flagDesigner) != designSplitLength) { + // mapResult.put("afterNamesError", "抱歉,您不支持此后加工类型,不能接此订单。"); + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【不支持后加工类型】"); + return mapResult; + } + } + + // 是否支持稿件类型/产品 + // 设计师个人属性 + List designerGroupDispatchValueResult = ORM.get(ZTable.class).list( + DesignerGroupDispatchValue.class, + new Selector().addMaybe("operatorCode", operatorCode).addMustNotEqual("relatedType", 5));// 排除免检产品 + // 设规则组属性 + long designerGroupId = designerGroupDispatchResult.getDesignerGroupId(); + List designerGroupValueList = ORM.get(ZTable.class).list(DesignerGroupValue.class, + new Selector().addMust("designerGroupId", designerGroupId)); + if (designerGroupDispatchValueResult == null && designerGroupValueList == null) { + // mapResult.put("designerGroupError", "抱歉,规则组和设计师个人等级暂时不匹配,不能接此订单。"); + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【不支持稿件类型/产品类型】"); + return mapResult; + } + + boolean draftTypes = ContendOrderService.isDraftTypes(designId, operatorCode, mapResult, + designerGroupDispatchValueResult, designerGroupValueList, designOrderResult); + if (!draftTypes) { + // mapResult.put("designerGroupError", "抱歉,规则组和设计师个人等级暂时不匹配,不能接此订单。"); + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【不支持稿件类型/产品类型】"); + return mapResult; + } + + // 是否支持订单渠道 + boolean ifRelevance = DispatchDao.ifRelevance(designOrderResult, operatorCode); + if (!ifRelevance) { + mapResult.put("nullError", "抱歉,您的等级暂时不匹配,不能接此订单。"); + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】失败" + ":【不支持该渠道订单】"); + return mapResult; + } + + mapResult.put("true", "通过"); + return mapResult; + + } + + /** + * + * [简要描述]:并发抢单处理
            + * [详细描述]:
            + * + * @author hc + * @param designId + * @param operatorCode + * @param designerGroupDispatchResult + * @return + */ + public static String isContendOrderSuccess(long designId, String operatorCode, + DesignerGroupDispatch designerGroupDispatchResult) { + Jedis jedis = RedisUtils.getConn(); + // 唯一key + String lockKey = "ContendOrder:" + designId + "_lock"; + String designIdString = designId + ""; + try { + // 无则创建返回1,有则返回0 + Long setnx = jedis.setnx(lockKey, operatorCode); + if (setnx == 1) { + // 过期时间 单位 秒 + jedis.expire(lockKey, 30); + } + if (setnx == 1) { + // 模拟队列,左进右出 + jedis.lpush(designIdString, operatorCode); + String rpop = jedis.rpop(designIdString); + // 接受订单 + long orgId = designerGroupDispatchResult.getOrgId(); + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("designer", rpop); + updater.addField("designReceiveTime", Sqls.nowTimestamp()); + updater.addField("designBeginTime", Sqls.nowTimestamp()); + updater.addField("receiveType", 0); + updater.addField("status", StatusConstants.ORDER_30.value()); + updater.addField("orgId", orgId); + updater.addField("orgReceiveTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + Selector selelct = new Selector("designId", designId <= 0 ? 0 : designId); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, selelct); + if (!StringUtils.isEmpty(order.getTids())) { + new ErpClassService(order.getTids(), rpop, statusEnum.TO_BE_DESIGNEDING.getCode()); + } + + // 更新未完成接单量 + DispatchDao.doUpdateDesignerOrderNum(rpop); + + return "success"; + } + } catch (Exception e) { + log.error("订单【" + designId + "】:抢单出现异常!", e); + return "error"; + } finally { + jedis.del(designIdString); + jedis.del(lockKey); + jedis.close(); + } + return "error"; + } + + // [简要描述]:是否支持稿件类型/产品 + public static boolean isDraftTypes(long designId, String operatorCode, Map mapResult, + List designerGroupDispatchValueResult, + List designerGroupValueList, DesignOrder designOrderResult) throws Exception { + // 设计师组 稿件类型匹配 + boolean typeP = false; + int type = 0; + for (DesignerGroupValue relatedValue : designerGroupValueList) { + if (Validates.isNotEmpty(relatedValue.getRelatedType())) { + switch (relatedValue.getRelatedType()) { + // case: 当前设计平台设计师组合设计师个人类型 0标准自来稿,1普通设计,2资深设计,4改稿自来稿 + // type: 原始ERP平台订单类型 0标准自来稿,1改稿自来稿,2普通设计,3资深设计 + case 0: + type = 0; + if (ContendOrderService.designerGroupDraftTypes(designId, operatorCode, type, designOrderResult, + relatedValue)) { + return true; + } + break; + case 1: + type = 2; + if (ContendOrderService.designerGroupDraftTypes(designId, operatorCode, type, designOrderResult, + relatedValue)) { + return true; + } + break; + case 2: + type = 3; + if (ContendOrderService.designerGroupDraftTypes(designId, operatorCode, type, designOrderResult, + relatedValue)) { + return true; + } + break; + case 4: + type = 1; + if (ContendOrderService.designerGroupDraftTypes(designId, operatorCode, type, designOrderResult, + relatedValue)) { + return true; + } + break; + } + } + typeP = true; + } + // 设计师个人 稿件类型匹配 + for (DesignerGroupDispatchValue relatedValue : designerGroupDispatchValueResult) { + if (Validates.isNotEmpty(relatedValue.getRelatedType())) { + switch (relatedValue.getRelatedType()) { + // case: 当前设计平台设计师组合设计师个人类型 0标准自来稿,1普通设计,2资深设计,4改稿自来稿 + // type: 原始ERP平台订单类型 0标准自来稿,1改稿自来稿,2普通设计,3资深设计 + case 0: + type = 0; + if (ContendOrderService.designerDraftTypes(designId, operatorCode, type, designOrderResult, + relatedValue)) { + return true; + } + continue; + case 1: + type = 2; + if (ContendOrderService.designerDraftTypes(designId, operatorCode, type, designOrderResult, + relatedValue)) { + return true; + } + continue; + case 2: + type = 3; + if (ContendOrderService.designerDraftTypes(designId, operatorCode, type, designOrderResult, + relatedValue)) { + return true; + } + continue; + case 4: + type = 1; + if (ContendOrderService.designerDraftTypes(designId, operatorCode, type, designOrderResult, + relatedValue)) { + return true; + } + continue; + } + } + if (type == designOrderResult.getDraftType()) { + if (designOrderResult.getTypeId() == relatedValue.getRelatedValue()) { + return true; + } + } + typeP = true; + } + if (typeP) { + return false; + } + + return false; + } + + // [简要描述]:是否支持稿件类型/产品 + public static boolean designerGroupDraftTypes(Long designId, String operatorCode, int type, + DesignOrder designOrderResult, DesignerGroupValue relatedValue) throws Exception { + if (type == designOrderResult.getDraftType()) { + if (designOrderResult.getTypeId() == relatedValue.getRelatedValue()) { + return true; + } + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】,设计师组类型:【" + DraftConstants.get(type) + ":" + + Global.get(DesignTypeCache.class).getName(designOrderResult.getTypeId()) + "】,订单稿件类型:【" + + Global.get(DesignTypeCache.class).getName(relatedValue.getRelatedValue()) + "】"); + } + return false; + } + + // [简要描述]:是否支持稿件类型/产品 + public static boolean designerDraftTypes(Long designId, String operatorCode, int type, + DesignOrder designOrderResult, DesignerGroupDispatchValue relatedValue) throws Exception { + if (type == designOrderResult.getDraftType()) { + if (designOrderResult.getTypeId() == relatedValue.getRelatedValue()) { + return true; + } + log.error("设计师【" + operatorCode + "】抢单【" + designId + "】,设计师个人类型:【" + DraftConstants.get(type) + ":" + + Global.get(DesignTypeCache.class).getName(designOrderResult.getTypeId()) + "】,订单稿件类型:【" + + Global.get(DesignTypeCache.class).getName(relatedValue.getRelatedValue()) + "】"); + } + return false; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/service/DesOnliceTimeLogCallable.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/service/DesOnliceTimeLogCallable.java new file mode 100644 index 0000000..87613da --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/service/DesOnliceTimeLogCallable.java @@ -0,0 +1,85 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesOnliceTimeLogCallable.java + * 创建人 :gjx + * 创建时间:2020年9月3日 +*/ + +package com.zhiqim.yangcai.design.service; + +import java.sql.Timestamp; +import java.util.List; +import java.util.concurrent.Callable; + +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.dispatch.DesWorkSearchLog; +import com.zhiqim.yangcai.design.model.DesOnliceTimeLogModel; + +/** + * + * [简要描述]: 设计平台在线时长多线程实现方式业务逻辑类
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020年9月4日 新建与整理 + */ +public class DesOnliceTimeLogCallable implements Callable +{ + private Selector selector = new Selector(); + + public DesOnliceTimeLogCallable(Selector selector) + { + this.selector = selector; + } + + @Override + public Object call() throws Exception + { + int onlineTime = 0; + List logList = ORM.get(ZTable.class).list(DesWorkSearchLog.class, selector); + DesOnliceTimeLogModel model = null; + Timestamp previousTime = null; + for (int i = 0; i < logList.size(); i++) + {// logType 1=开启接单,2=停止接单/退出浏览器 + DesWorkSearchLog log = logList.get(i); + Timestamp createTime = log.getCreateTime(); + String dayCode1 = DateTimes.toDateString(createTime); + int logType = log.getLogType(); + if (model == null) + { + model = new DesOnliceTimeLogModel(dayCode1, log.getOperatorCode()); + } + if (i == 0 && logType == 2) + {// 第一条日志为停止接单/退出浏览器 接单时间从0点算 + onlineTime += DateTimes.compareMinute(createTime, Sqls.toTimestamp(dayCode1, "00:00:00")); + continue; + } + + if (!DateTimes.getDateString().equals(dayCode1) && i == logList.size() - 1 && logType == 1) + {// 非当天最后一条日志为开启接单,停止接单时间为晚上12点 + onlineTime += DateTimes.compareMinute(Sqls.toTimestamp(dayCode1, "23:59:59"), createTime); + continue; + } + if (logType == 1) + { + previousTime = createTime; + } + if (logType == 2 && previousTime != null) + { + onlineTime += DateTimes.compareMinute(createTime, previousTime); + continue; + } + if (DateTimes.getDateString().equals(dayCode1) && logType == 1 && i == logList.size() - 1) + {// 当天最后一条日志为开启接单,取当前时间 + onlineTime += DateTimes.compareMinute(Sqls.nowTimestamp(), createTime); + continue; + } + } + model.setOnlineTime(onlineTime); + return model; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/service/MediaDesignEmployee.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/service/MediaDesignEmployee.java new file mode 100644 index 0000000..4e698d3 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/service/MediaDesignEmployee.java @@ -0,0 +1,133 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.service; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; + +import com.zhiqim.media.dbo.MediaCanvas; +import com.zhiqim.media.service.Employer; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +/** + * 素材保存回调实现类 + * @version v1.0.0 @author zhouwenbin 2017-10-26 新建与整理 + */ +public class MediaDesignEmployee implements Employer +{ + private final Log log = LogFactory.getLog(MediaDesignEmployee.class); + + @Override + @AnTransaction + public void execute(HttpRequest request, long mediaId, String param) + { + try + { + if (mediaId == -1) + { + log.error("回传参数异常:mediaId=" + mediaId + ",param=" + param); + return; + } + + MediaCanvas canvas = ORM.get(ZTable.class).item(MediaCanvas.class, mediaId); + if (canvas == null) + { + log.error("媒体画布查询不存在:mediaId=" + mediaId + ",param=" + param); + return; + } + + MediaTemplate template = ORM.get(ZTable.class).item(MediaTemplate.class, mediaId); + if (template == null) + {//新增 + if (Validates.isEmpty(param)) + { + log.error("新增模板时参数为空:mediaId=" + mediaId + ",param=" + param); + return; + } + +// long prdTypeId = Jsons.getLong(param, "prdTypeId"); +// long designTypeId = Jsons.getLong(param, "designTypeId"); +// int template_page = Jsons.getInt(param, "page"); +// String width_str = Jsons.getString(param, "width"); +// String height_str = Jsons.getString(param, "height"); +// +// if (!Validates.isFloat(width_str) || !Validates.isFloat(height_str)) +// { +// log.error("新增模板时,回传产品尺寸参数属性参数不正确:mediaId=" + mediaId + ",param=" + param); +// return; +// } +// +// double width = Double.valueOf(width_str); +// double height = Double.valueOf(height_str); +// +// if (width <= 0 || height <= 0) +// { +// log.error("新增模板时,回传产品尺寸参数属性参数不正确:mediaId=" + mediaId + ",param=" + param); +// return; +// } +// +// if(designTypeId <=0 || template_page <= 0) +// { +// log.error("新增模板时,回传产品属性参数不正确:mediaId=" + mediaId + ",param=" + param); +// return; +// } +// +// long industryId = Jsons.getLong(param, "industryId"); +// long worksId = Jsons.getLong(param, "worksId"); +// String designer = Jsons.getString(param, "designer"); +// if (Validates.isEmpty(designer)) +// { +// log.error("新增模板时,回传参数中缺少设计师字段:mediaId=" + mediaId + ",param=" + param); +// return; +// } +// +// //查询操作员属性 +// ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, new Selector("operatorCode", designer)); +// +// template = new MediaTemplate(); +// template.setMediaId(mediaId); +// template.setDesignTypeId(designTypeId); +// template.setPageValue(template_page); +// template.setMediaTemplateWidth(width); +// template.setMediaTemplateHeight(height); +// template.setTemplateType(10); +// template.setTemplateStatus(0); +// template.setDesigner(designer); +// template.setTemplateGroup(operator.getOperatorDeptAll()); +// +// if (industryId != -1) +// template.setIndustryId(industryId); +// +// +// ORM.get(ZTable.class).insert(template); + } + else + {//修改 +// Updater updater = new Updater(); +// updater.addMust("mediaId", mediaId); +// updater.addField("releaseStatus", 0); +// updater.addField("releaseTime", null); +// ORM.get(ZTable.class).update(MediaTemplate.class, updater); + } + } + catch (Exception e) + { + log.error("模板实现类异常:mediaId=" + mediaId + ",param=" + param, e); + } + + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/AfterStatisticModule.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/AfterStatisticModule.java new file mode 100644 index 0000000..a3565a5 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/AfterStatisticModule.java @@ -0,0 +1,174 @@ +/* + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ + +package com.zhiqim.yangcai.design.stat.model; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterStatisticDetail; + +/**** + * 售后统计 module + * + * @version v1.0.0 @author lgz 2019-3-13 新建与整理 + */ +public class AfterStatisticModule implements Comparable +{ + private String afterBlamer;// 责任人 + private int afterCount;// 售后单数 + private double lostAmount;// 损失总金额 + private double compensateAmount;// 赔付总金额 + private double lossAmountCanceled;// 已经取消&申请售后通过 的订单损失金额 + private long totalOrderAmount;// 订单金额 + private List afterDetail; + private List canceledDetail;// 申诉成功列表 + private String problemReason;// 问题原因 + private int orderEnds;// 定稿数 + private double afterRatio;// 售后率 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public String getAfterBlamer() + { + return afterBlamer; + } + + public void setAfterBlamer(String afterBlamer) + { + this.afterBlamer = afterBlamer; + } + + public int getAfterCount() + { + return afterCount; + } + + public double getLostAmount() + { + return lostAmount; + } + + public void setLostAmount(double lostAmount) + { + this.lostAmount = lostAmount; + } + + public double getLossAmountCanceled() + { + return lossAmountCanceled; + } + + public void setLossAmountCanceled(double lossAmountCanceled) + { + this.lossAmountCanceled = lossAmountCanceled; + } + + public double getTotalOrderAmount() + { + return totalOrderAmount; + } + + public void setTotalOrderAmount(long totalOrderAmount) + { + this.totalOrderAmount = totalOrderAmount; + } + + public List getAfterDetail() + { + return afterDetail; + } + + public List getCanceledDetail() + { + return canceledDetail; + } + + public AfterStatisticModule() + { + this.afterDetail = new ArrayList(); + this.canceledDetail = new ArrayList(); + } + + public void addAfterDetail(DesignAfterStatisticDetail detail) + { + this.afterDetail.add(detail); + if (detail.getAfterStatus() == AfterConstants.CS_F100.value() || detail.getAfterStatus() == AfterConstants.CS_F120.value()) + { + this.canceledDetail.add(detail); + this.lossAmountCanceled += detail.getLossAmount(); + } + + this.setAfterBlamer(detail.getAfterBlamer()); + this.afterCount++; + this.lostAmount += detail.getLossAmount(); + this.compensateAmount += detail.getCompensateAmount(); + this.totalOrderAmount += detail.getAmount(); + } + + public String getProblemReason() + { + return problemReason; + } + + public void setProblemReason(String problemReason) + { + this.problemReason = problemReason; + } + + public void setAfterCount(int afterCount) + { + this.afterCount = afterCount; + } + + public int getOrderEnds() + { + return orderEnds; + } + + public void setOrderEnds(int orderEnds) + { + this.orderEnds = orderEnds; + } + + public double getAfterRatio() + { + return afterRatio; + } + + public void setAfterRatio(double afterRatio) + { + this.afterRatio = afterRatio; + } + + @Override + public int compareTo(AfterStatisticModule o) + { + return this.afterCount - o.getAfterCount(); + } + + public double getCompensateAmount() + { + return compensateAmount; + } + + public void setCompensateAmount(double compensateAmount) + { + this.compensateAmount = compensateAmount; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DesignGroupPerformanceStatisModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DesignGroupPerformanceStatisModel.java new file mode 100644 index 0000000..a83a36a --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DesignGroupPerformanceStatisModel.java @@ -0,0 +1,88 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.stat.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.dbo.stat.DesignGroup; +import com.zhiqim.yangcai.design.dbo.stat.PerformanceStatistics; + + +/**** + * 小组绩效module + * + * @version v1.0.0 @author lgz 2019-4-9 新建与整理 + */ +public class DesignGroupPerformanceStatisModel +{ + private DesignGroup group; + private PerformanceStatistics groupLeader ; + private List members = new ArrayList(); + private double groupCompleteSum; //设计组总定稿数 + private double groupCompleteAvgCount; //设计组平均定稿数 + private long groupPerformanceAmount; //设计组绩效 + public PerformanceStatistics getGroupLeader() + { + return groupLeader; + } + public List getMembers() + { + return members != null ? members : new ArrayList(); + } + public void AddMember(PerformanceStatistics member, DesignGroup group, boolean isLeader) + { + if (member == null) + return; + this.group = group; + if (isLeader) + this.groupLeader = member; + else + this.members.add(member); + } + public double getGroupCompleteSum() + { + return groupCompleteSum; + } + public double getGroupCompleteAvgCount() + { + return groupCompleteAvgCount; + } + public long getGroupPerformanceAmount() + { + return groupPerformanceAmount; + } + public void setGroupCompleteSum(double groupCompleteSum) + { + this.groupCompleteSum = new BigDecimal(groupCompleteSum).setScale(2, BigDecimal.ROUND_UP).doubleValue();; + } + public void setGroupCompleteAvgCount(double groupCompleteAvgCount) + { + this.groupCompleteAvgCount = new BigDecimal(groupCompleteAvgCount).setScale(2, BigDecimal.ROUND_UP).doubleValue(); + } + public void setGroupPerformanceAmount(long groupPerformanceAmount) + { + this.groupPerformanceAmount = groupPerformanceAmount; + } + public DesignGroup getGroup() + { + return group; + } + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftDayStatModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftDayStatModel.java new file mode 100644 index 0000000..8d74cf0 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftDayStatModel.java @@ -0,0 +1,100 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.stat.model; + +/** + * 初稿统计DTO + * + * @version v1.0.0 @author Deng 2017-6-16 新建与整理 + */ +public class DraftDayStatModel implements Comparable +{ + private String designName; // 1.设计师名称 + private double draftCount; // 2.初搞折算订单数 + private double draftTemplateCount; // 3.改稿自来稿初搞订单数 + private int draftOrderCount; // 4.初搞订单数 + private int endOrderCount; // 5.定稿订单数 + + public DraftDayStatModel(String designName, double draftCount, int draftOrderCount, int endOrderCount) + { + this.designName = designName; + this.draftCount = draftCount; + this.draftOrderCount = draftOrderCount; + this.endOrderCount = endOrderCount; + } + + public String getDesignName() + { + return designName; + } + + public void setDesignName(String designName) + { + this.designName = designName; + } + + public double getDraftCount() + { + return draftCount; + } + + public void setDraftCount(double draftCount) + { + this.draftCount = draftCount; + } + + public double getDraftTemplateCount() + { + return draftTemplateCount; + } + + public void setDraftTemplateCount(double draftTemplateCount) + { + this.draftTemplateCount = draftTemplateCount; + } + + public int getDraftOrderCount() + { + return draftOrderCount; + } + + public void setDraftOrderCount(int draftOrderCount) + { + this.draftOrderCount = draftOrderCount; + } + + public int getEndOrderCount() + { + return endOrderCount; + } + + public void setEndOrderCount(int endOrderCount) + { + this.endOrderCount = endOrderCount; + } + + @Override + public int compareTo(DraftDayStatModel o1) + { + if (o1.getDraftCount() > this.getDraftCount()) + { + return 1; + } + else if (o1.getDraftCount() < this.getDraftCount()) + { + return -1; + } + else + { + return 0; + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftOrgTimelinessModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftOrgTimelinessModel.java new file mode 100644 index 0000000..97e2a63 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftOrgTimelinessModel.java @@ -0,0 +1,90 @@ +/** + * 扬彩印刷设计 + * 文件名 :DraftOrgTimelinessModel.java + * 创建人 :jiangbin + * 创建时间:2020-6-19 + */ +package com.zhiqim.yangcai.design.stat.model; + +import java.util.HashMap; + +/** + * 初稿时效统计Model(组织) + * + * @version v1.0.0 @author jiangbin 2020-6-19 新建与整理 + */ +public class DraftOrgTimelinessModel +{ + private long orgId;// 组织ID + private String orgName; // 组织名称 + private int allCount; // 总数量 + private int allTime; // 总耗时 + private HashMap numberMap = new HashMap(); // <产品类型, 数量> + private HashMap timeMap = new HashMap(); // <产品类型, 总耗时(分钟)> + + public DraftOrgTimelinessModel(long orgId, String orgName) + { + this.orgId = orgId; + this.orgName = orgName; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public int getAllCount() + { + return allCount; + } + + public void setAllCount(int allCount) + { + this.allCount = allCount; + } + + public int getAllTime() + { + return allTime; + } + + public void setAllTime(int allTime) + { + this.allTime = allTime; + } + + public HashMap getNumberMap() + { + return numberMap; + } + + public void setNumberMap(HashMap numberMap) + { + this.numberMap = numberMap; + } + + public HashMap getTimeMap() + { + return timeMap; + } + + public void setTimeMap(HashMap timeMap) + { + this.timeMap = timeMap; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftStatusOrderStatModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftStatusOrderStatModel.java new file mode 100644 index 0000000..7111f02 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftStatusOrderStatModel.java @@ -0,0 +1,78 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.stat.model; + +public class DraftStatusOrderStatModel +{ + private String designer; // 设计师 + private int sumCount; // 总初搞订单数 + private int dayCount; // 48小时内 + private int weekCount; // 3-7天内 + private int monthCount; // 8-30天内 + private int otherCount; // 30天以上 + + public DraftStatusOrderStatModel(String designer) + { + this.designer = designer; + this.sumCount = 0; + this.dayCount = 0; + this.weekCount = 0; + this.monthCount = 0; + this.otherCount = 0; + } + + public String getDesigner() + { + return designer; + } + public int getSumCount() + { + return sumCount; + } + public void setSumCount(int sumCount) + { + this.sumCount = sumCount; + } + public int getDayCount() + { + return dayCount; + } + public void setDayCount(int dayCount) + { + this.dayCount = dayCount; + } + public int getWeekCount() + { + return weekCount; + } + public void setWeekCount(int weekCount) + { + this.weekCount = weekCount; + } + public int getMonthCount() + { + return monthCount; + } + public void setMonthCount(int monthCount) + { + this.monthCount = monthCount; + } + public int getOtherCount() + { + return otherCount; + } + public void setOtherCount(int otherCount) + { + this.otherCount = otherCount; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftTimelinessModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftTimelinessModel.java new file mode 100644 index 0000000..ae8c0c0 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftTimelinessModel.java @@ -0,0 +1,73 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.stat.model; + +import java.util.HashMap; + +/** + * 初稿时效统计 + * @version v1.0.0 @author zzy 2017-10-25 新建与整理 + */ +public class DraftTimelinessModel +{ + private String designer; //设计师名称 + private int allCount; //总数量 + private int allTime; //总耗时 + private HashMap numberMap = new HashMap(); //<产品类型, 数量> + private HashMap timeMap = new HashMap(); //<产品类型, 总耗时(分钟)> + + public DraftTimelinessModel(String designer) + { + this.designer = designer; + } + + public String getDesigner() + { + return designer; + } + public void setDesigner(String designer) + { + this.designer = designer; + } + public int getAllCount() + { + return allCount; + } + public void setAllCount(int allCount) + { + this.allCount = allCount; + } + public int getAllTime() + { + return allTime; + } + public void setAllTime(int allTime) + { + this.allTime = allTime; + } + public HashMap getNumberMap() + { + return numberMap; + } + public void setNumberMap(HashMap numberMap) + { + this.numberMap = numberMap; + } + public HashMap getTimeMap() + { + return timeMap; + } + public void setTimeMap(HashMap timeMap) + { + this.timeMap = timeMap; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftTypeTimelinessModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftTypeTimelinessModel.java new file mode 100644 index 0000000..a3f3a68 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/DraftTypeTimelinessModel.java @@ -0,0 +1,56 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.stat.model; + + +/** + * 初稿订单类型时效统计 + * @version v1.0.0 @author zzy 2017-10-25 新建与整理 + */ +public class DraftTypeTimelinessModel +{ + private long typeId; //类型编号 + private int count; //数量 + private int time; //耗时 + + public DraftTypeTimelinessModel(long typeId) + { + this.typeId = typeId; + } + + public long getTypeId() + { + return typeId; + } + public void setTypeId(long typeId) + { + this.typeId = typeId; + } + public int getCount() + { + return count; + } + public void setCount(int count) + { + this.count = count; + } + public int getTime() + { + return time; + } + public void setTime(int time) + { + this.time = time; + } + + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/OrderCountStatModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/OrderCountStatModel.java new file mode 100644 index 0000000..e0e26b3 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/OrderCountStatModel.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.stat.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * 订单数量统计MODEL + * + * @version v1.0.0 @author zzy 2018-6-29 新建与整理 + */ +public class OrderCountStatModel +{ + private String date; //日期 + private int sumCount; //总订单数 + private int elseCount; //其他订单数 + private Map typeMap; //<类型|数量> + + public OrderCountStatModel(String date) + { + this.date = date; + this.sumCount = 0; + this.elseCount = 0; + this.typeMap = new HashMap(); + } + + public String getDate() + { + return date; + } + public void setDate(String date) + { + this.date = date; + } + public int getSumCount() + { + return sumCount; + } + public void setSumCount(int sumCount) + { + this.sumCount = sumCount; + } + public int getElseCount() + { + return elseCount; + } + public void setElseCount(int elseCount) + { + this.elseCount = elseCount; + } + public Map getTypeMap() + { + return typeMap; + } + public void setTypeMap(Map typeMap) + { + this.typeMap = typeMap; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/PrdFeePercentageModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/PrdFeePercentageModel.java new file mode 100644 index 0000000..605d466 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/PrdFeePercentageModel.java @@ -0,0 +1,127 @@ +/* + * 版权所有 (C) 2015 知启蒙(WWW.ZHIQIM.COM) 保留所有权利。 + * + * Download http://www.zhiqim.com/fadfox/ 欢迎加盟[凡狐]兴趣小组。 + * + * 由数据库字典自动生成的类文件,修改请使用数据库字典编辑器修改。 + */ +package com.zhiqim.yangcai.design.stat.model; + +import java.io.Serializable; + +import org.zhiqim.kernel.json.Jsons; + +/** + * 产品提成系数表 对应erp的表《PRD_FEE_PERCENTAGE》 + */ +public class PrdFeePercentageModel implements Serializable +{ + private static final long serialVersionUID = 1L; + + private long deptId; // 1.部门ID + private long prdTypeId; // 2.产品类型 + private int feeValid; // 3.规定时间,单位分钟 + private int feeHigh; // 4.高提成,单位‰(千分制) + private int feeLow; // 5.低提成,单位‰(千分制) + private int feeDisabled; // 6.失效时间,单位分钟 + private int feeType; // 7.计费类型,0:按单量,1:按比例, + private long feeDiscountAmount; // 8.折算金额,单位分 + private int feeDiscountMethod; // 9.折算方式,0:不启用,1:金额,2:系数 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getDeptId() + { + return deptId; + } + + public void setDeptId(long deptId) + { + this.deptId = deptId; + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public int getFeeValid() + { + return feeValid; + } + + public void setFeeValid(int feeValid) + { + this.feeValid = feeValid; + } + + public int getFeeHigh() + { + return feeHigh; + } + + public void setFeeHigh(int feeHigh) + { + this.feeHigh = feeHigh; + } + + public int getFeeLow() + { + return feeLow; + } + + public void setFeeLow(int feeLow) + { + this.feeLow = feeLow; + } + + public int getFeeDisabled() + { + return feeDisabled; + } + + public void setFeeDisabled(int feeDisabled) + { + this.feeDisabled = feeDisabled; + } + + public int getFeeType() + { + return feeType; + } + + public void setFeeType(int feeType) + { + this.feeType = feeType; + } + + public long getFeeDiscountAmount() + { + return feeDiscountAmount; + } + + public void setFeeDiscountAmount(long feeDiscountAmount) + { + this.feeDiscountAmount = feeDiscountAmount; + } + + public int getFeeDiscountMethod() + { + return feeDiscountMethod; + } + + public void setFeeDiscountMethod(int feeDiscountMethod) + { + this.feeDiscountMethod = feeDiscountMethod; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/PrdTypeModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/PrdTypeModel.java new file mode 100644 index 0000000..9086dc7 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/PrdTypeModel.java @@ -0,0 +1,116 @@ +/* + * 版权所有 (C) 2015 知启蒙(WWW.ZHIQIM.COM) 保留所有权利。 + * + * Download http://www.zhiqim.com/fadfox/ 欢迎加盟[凡狐]兴趣小组。 + * + * 由数据库字典自动生成的类文件,修改请使用数据库字典编辑器修改。 + */ +package com.zhiqim.yangcai.design.stat.model; + +import java.io.Serializable; + +import org.zhiqim.kernel.json.Jsons; + +/** + * 产品类型表 对应erp的表《PRD_TYPE》 + */ +public class PrdTypeModel implements Serializable +{ + private static final long serialVersionUID = 1L; + + private long prdTypeId; // 1.产品类型 + private String prdTypeName; // 2.分类名称 + private long prdTypeUrgentFee; // 3.分类 加急费 + private int prdTypeStatus; // 4.分类状态 0:正常,1:停用 + private String prdPolicyIds; // 5.产品类型支持的后加工策略,多个逗号分隔 + private int prdEffectiveTime; // 6.时效 + private int prdTypeSeq; // 7.序号 + private long designType; // 8.设计类型编号 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getPrdTypeId() + { + return prdTypeId; + } + + public void setPrdTypeId(long prdTypeId) + { + this.prdTypeId = prdTypeId; + } + + public String getPrdTypeName() + { + return prdTypeName; + } + + public void setPrdTypeName(String prdTypeName) + { + this.prdTypeName = prdTypeName; + } + + public long getPrdTypeUrgentFee() + { + return prdTypeUrgentFee; + } + + public void setPrdTypeUrgentFee(long prdTypeUrgentFee) + { + this.prdTypeUrgentFee = prdTypeUrgentFee; + } + + public int getPrdTypeStatus() + { + return prdTypeStatus; + } + + public void setPrdTypeStatus(int prdTypeStatus) + { + this.prdTypeStatus = prdTypeStatus; + } + + public String getPrdPolicyIds() + { + return prdPolicyIds; + } + + public void setPrdPolicyIds(String prdPolicyIds) + { + this.prdPolicyIds = prdPolicyIds; + } + + public int getPrdEffectiveTime() + { + return prdEffectiveTime; + } + + public void setPrdEffectiveTime(int prdEffectiveTime) + { + this.prdEffectiveTime = prdEffectiveTime; + } + + public int getPrdTypeSeq() + { + return prdTypeSeq; + } + + public void setPrdTypeSeq(int prdTypeSeq) + { + this.prdTypeSeq = prdTypeSeq; + } + + public long getDesignType() + { + return designType; + } + + public void setDesignType(long designType) + { + this.designType = designType; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/QcPerformanceStatModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/QcPerformanceStatModel.java new file mode 100644 index 0000000..e7f4bd1 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/QcPerformanceStatModel.java @@ -0,0 +1,49 @@ +package com.zhiqim.yangcai.design.stat.model; + +/** + * 质检统计model + * + * @version v1.0.0 @author liuhu 2019-1-28 新建与整理 + */ +public class QcPerformanceStatModel +{ + private String designer; // 设计师 + private double punishScore; // 扣罚分数 + private double rewardScore; // 奖励分数 + + public QcPerformanceStatModel(String designer) + { + this.designer = designer; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public double getPunishScore() + { + return punishScore; + } + + public void setPunishScore(double punishScore) + { + this.punishScore = punishScore; + } + + public double getRewardScore() + { + return rewardScore; + } + + public void setRewardScore(double rewardScore) + { + this.rewardScore = rewardScore; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/RefundRateModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/RefundRateModel.java new file mode 100644 index 0000000..2a23930 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/RefundRateModel.java @@ -0,0 +1,135 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.stat.model; + +/** + * 退款率MODEL + * + * @version v1.0.0 @author zzy 2018-6-29 新建与整理 + */ +public class RefundRateModel implements Comparable +{ + private String designer; // 设计师 + private long industryId; // 行业编号 + private int refundCount; // 退款单数 + private int sumCount; // 设计单数 + private long finalizeMoneySum; // 设计单金额 + private long refundRate; // 退款率 + private long refundMoneySum; // 退款单金额 + private long amount; // 奖罚金额 + + public RefundRateModel(String designer) + { + this.designer = designer; + this.industryId = 0; + this.refundCount = 0; + this.sumCount = 0; + this.refundMoneySum = 0; + this.finalizeMoneySum = 0; + } + + public RefundRateModel(long industryId) + { + this.industryId = industryId; + this.refundCount = 0; + this.sumCount = 0; + this.refundMoneySum = 0; + this.finalizeMoneySum = 0; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public long getIndustryId() + { + return industryId; + } + + public void setIndustryId(long industryId) + { + this.industryId = industryId; + } + + public int getRefundCount() + { + return refundCount; + } + + public void setRefundCount(int refundCount) + { + this.refundCount = refundCount; + } + + public int getSumCount() + { + return sumCount; + } + + public void setSumCount(int sumCount) + { + this.sumCount = sumCount; + } + + public long getRefundRate() + { + return refundRate; + } + + public void setRefundRate(long refundRate) + { + this.refundRate = refundRate; + } + + public long getAmount() + { + return amount; + } + + public void setAmount(long amount) + { + this.amount = amount; + } + + @Override + public int compareTo(RefundRateModel o) + { + return -(int) (this.refundRate - o.refundRate); + } + + public long getRefundMoneySum() + { + return refundMoneySum; + } + + public void setRefundMoneySum(long refundMoneySum) + { + this.refundMoneySum = refundMoneySum; + } + + public long getFinalizeMoneySum() + { + return finalizeMoneySum; + } + + public void setFinalizeMoneySum(long finalizeMoneySum) + { + this.finalizeMoneySum = finalizeMoneySum; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/StatDesignModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/StatDesignModel.java new file mode 100644 index 0000000..84a0e12 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/stat/model/StatDesignModel.java @@ -0,0 +1,126 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.stat.model; + +/** + * 设计师提成MODEL + * + * @version v1.0.0 @author Deng 2017-10-10 新建与整理 + */ +public class StatDesignModel +{ + private String operatorCode; // 1.设计师 + private long cardAmount; // 2.名片金额 + private long colorpageAmount; // 3.彩页金额 + private long stickAmount; // 4.不干胶金额 + private long albumAmount; // 5.画册金额 + private long rackAmount; // 6.展架金额 + private long penhuiAmount; // 7.喷会金额 + private long singleAmount; // 8.联单金额 + private long bannersAmount; // 9.条辐金额 + + public StatDesignModel(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getCardAmount() + { + return cardAmount; + } + + public void setCardAmount(long cardAmount) + { + this.cardAmount = cardAmount; + } + + public long getColorpageAmount() + { + return colorpageAmount; + } + + public void setColorpageAmount(long colorpageAmount) + { + this.colorpageAmount = colorpageAmount; + } + + public long getStickAmount() + { + return stickAmount; + } + + public void setStickAmount(long stickAmount) + { + this.stickAmount = stickAmount; + } + + public long getAlbumAmount() + { + return albumAmount; + } + + public void setAlbumAmount(long albumAmount) + { + this.albumAmount = albumAmount; + } + + public long getRackAmount() + { + return rackAmount; + } + + public void setRackAmount(long rackAmount) + { + this.rackAmount = rackAmount; + } + + public long getPenhuiAmount() + { + return penhuiAmount; + } + + public void setPenhuiAmount(long penhuiAmount) + { + this.penhuiAmount = penhuiAmount; + } + + public long getSingleAmount() + { + return singleAmount; + } + + public void setSingleAmount(long singleAmount) + { + this.singleAmount = singleAmount; + } + + public long getBannersAmount() + { + return bannersAmount; + } + + public void setBannersAmount(long bannersAmount) + { + this.bannersAmount = bannersAmount; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/AutoCheckOrderTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/AutoCheckOrderTask.java new file mode 100644 index 0000000..4b69aa0 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/AutoCheckOrderTask.java @@ -0,0 +1,146 @@ +package com.zhiqim.yangcai.design.task; + +import java.io.File; +import java.sql.Timestamp; +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constant.TemplateScoreConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OrderCheckDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.TemplateDao; +import com.zhiqim.yangcai.design.dao.TemplateScoreDao; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateOrder; + +/*** + * 对待审订单自动审核(定稿5分钟订单) + * + * @author caohong 2019-8-29 15:50:42 + */ +public class AutoCheckOrderTask implements Task, SignConstants +{ + private static final Log log = LogFactory.getLog(AutoCheckOrderTask.class); + private int checkNum = 0;// 手工审核 + private int autoNum = 0;// 自动审核 + + @Override + public void execute() + { + checkNum = 0; + autoNum = 0; + + log.info("订单自动审核任务开始..."); + try + { + Timestamp time = Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringBySecond(5 * 60)); + + Selector sel = new Selector(); + sel.addMust("status", StatusConstants.ORDER_55.value()); + sel.addMustThenLE("designEndTime", time); + sel.addOrderbyAsc("designEndTime"); + List orderList = ORM.get(ZView.class).list(DesignSelfView.class, sel); + + for (DesignSelfView order : orderList) + { + processOrder(order); + } + + log.info("订单自动审核任务结束,共[" + orderList.size() + "]条,自动审核[" + autoNum + "]条,需手工审核[" + checkNum + "]条."); + } + catch (Exception e) + { + log.error("订单自动审核任务异常", e); + } + + } + + private void processOrder(DesignSelfView order) + { + long designId = order.getDesignId(); + log.info("订单:" + designId + " 开始执行自动审核匹配逻辑..."); + try + { + // 印刷订单需要检查印刷文件是否存在 + if (!order.isOnlyDesign()) + { + Selector attaSel = new Selector(); + attaSel.addMust("designId", designId); + attaSel.addMust("attaModul", FileTypeConstants.FILE_END.value()); + DesignAtta atta = ORM.get(ZTable.class).item(DesignAtta.class, attaSel); + if (atta == null) + { + return; + } + + // 访问地址 为空 或者不是访问地址 + if (Validates.isEmptyBlank(atta.getOssUrl()) || !Validates.isUrl(atta.getOssUrl())) + { + // 3.检查文件是否存在 + File file = new File(atta.getSavePath()); + if (!file.exists() || file.isDirectory()) + { + return; + } + } + } + + boolean autoCheckMeet = OrderCheckDao.isAutoCheck(order); + if (autoCheckMeet) + { + log.info("订单:" + designId + " 自动审核通过,修改订单状态"); + // 修改订单信息 + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addField("status", StatusConstants.ORDER_60.value()); + updater.addField("checker", "系统"); + updater.addField("checkTime", Sqls.nowTimestamp()); + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 插入日志 + OrderLogDao.saveOrderOperateLog(designId, "系统", "订单定稿(自动审核通过)", EventConstants.ORDER_11.value()); + + DesTemplateOrder temOrder = ORM.get(ZTable.class).item(DesTemplateOrder.class, designId); + if (temOrder != null) + { + // 模板状态改为订单模板80及修改模板为不可编辑相关操作,电子名片除外 + if (order.getTypeId() != 2023207561256L) + { + TemplateDao.doTemplateOrderCompleteExec(designId, temOrder.getDesignMediaId()); + } + TemplateScoreDao.doTemplateSaleScore(temOrder.getMediaId(), TemplateScoreConstants.TEMPLATE_FINAL.value());// 模板销售分计算 + } + + autoNum += 1; + } + else + { + log.info("订单:" + designId + " 不符合自动审核通过条件"); + checkNum += 1; + } + } + catch (Exception e) + { + log.error("订单自动审核任务, 订单[" + designId + "]审核异常:" + e.getMessage(), e); + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/AutoFinishAfterTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/AutoFinishAfterTask.java new file mode 100644 index 0000000..0a34a12 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/AutoFinishAfterTask.java @@ -0,0 +1,139 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.design.task; + +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrParam; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dao.ScoreDesignerRecordDao; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordDetail; + +/**** + * 售后自动完结任务 + * + * @version v1.0.0 @author lgz 2018-12-29 新建与整理 + */ +public class AutoFinishAfterTask implements Task, SignConstants +{ + private static final Log log = LogFactory.getLog(AutoFinishAfterTask.class); + + @Override + public void execute() + { + log.info("售后单自动同意责任任务..."); + try + { + int hour = 120; + ZmrParam autoAccessBlameTimeSpan = ORM.get(ZTable.class).item(ZmrParam.class, + new Selector("paramGroup", "yangcai.yangcai365_design_after").addMust("paramKey", "autoAccessBlameTimeSpan")); + if (autoAccessBlameTimeSpan != null) + { + if (Validates.isNumeric(autoAccessBlameTimeSpan.getParamValue())) + { + int value = Ints.toInt(autoAccessBlameTimeSpan.getParamValue()); + if (value >= 5) + { + hour = value; + } + } + } + Selector selector = new Selector("afterStatus", AfterConstants.CS_300.value());// 处理中 + selector.addExpressionThenL("afterCreateTime", "SUBDATE(now(),INTERVAL (%s) HOUR)".replace("%s", Strings.valueOf(hour))); + List orderList = ORM.get(ZTable.class).list(DesignAfterOrder.class, selector); + + Selector selector2 = new Selector("afterStatus", AfterConstants.CS_500.value());// 申诉拒绝 + selector2.addExpressionThenL("afterBlameReturnTime", "SUBDATE(now(),INTERVAL (%s) HOUR)".replace("%s", Strings.valueOf(hour))); + orderList.addAll(ORM.get(ZTable.class).list(DesignAfterOrder.class, selector2)); + int count = 0; + for (DesignAfterOrder order : orderList) + { + try + { + processOrder(order, hour); + count++; + } + catch (Exception e) + { + log.error("售后单自动同意责任任务处理售后单[%s][%s][%s]异常", e, order.getDesignAfsId(), order.getDesignId(), order.getOutAfsId()); + } + } + + log.info("售后单自动同意责任任务结束,共[%s]条, 有效[%s]条", orderList.size(), count); + } + catch (Exception e) + { + log.error("售后单自动同意责任任务异常", e); + } + } + + private void processOrder(DesignAfterOrder afterOrder, int hour) throws Exception + { + // 申诉文件 上传到OSS + Selector attaSelect = new Selector("designId", afterOrder.getDesignId()); + attaSelect.addMust("attaModul", FileTypeConstants.FILE_AFTE_COMPLAIN_EVIDENCE.value()); + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, attaSelect); + for (DesignAtta afterAtta : attaList) + { + boolean result = OssFileDao.uploadFile(afterAtta); + if (!result) + { + throw new Exception("申诉文件OSS转储失败"); + } + // 删除文件 + Files.deleteFile(afterAtta.getSavePath()); + } + + Updater updater = new Updater(); + updater.addMust("designAfsId", afterOrder.getDesignAfsId()); + updater.addField("afterModifyTime", Sqls.nowTimestamp()); + + updater.addField("afterStatus", AfterConstants.CS_400.value()); + updater.addField("afterFinishNote", "超出" + hour + "未处理,系统自动完成"); + updater.addField("afterFinishTime", Sqls.nowTimestamp()); + updater.addField("afterBlameReturnNote", null); + updater.addField("afterBlameReturnTime", null); + ORM.get(ZTable.class).update(DesignAfterOrder.class, updater); + OrderLogDao.saveOrderOperateLog(afterOrder.getDesignId(), "系统", "售后单[" + afterOrder.getOutAfsId() + "]自责任指派时间到现在超出[" + hour + "]系统自动完成", + EventConstants.ORDER_20.value()); + + if (afterOrder.getAfterBlamer() != null) + { + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_104.value())); + scoreDesignerRecordDetail.setOperatorCode(afterOrder.getAfterBlamer()); + scoreDesignerRecordDetail.setOrderId(afterOrder.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/CacheRefreshTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/CacheRefreshTask.java new file mode 100644 index 0000000..e496dfb --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/CacheRefreshTask.java @@ -0,0 +1,51 @@ +/** + * 扬彩印刷设计 + * 文件名 :CacheRefreshTask.java + * 创建人 :gjx + * 创建时间:2019-12-27 + */ + +package com.zhiqim.yangcai.design.task; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.schedule.Task; + +import com.zhiqim.yangcai.cache.CustomerTypeCache; +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.cache.IndustryLabelCache; +import com.zhiqim.yangcai.cache.LabelDimensionCache; + +/** + * [简要描述]:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2019-12-27 新建与整理 + */ +public class CacheRefreshTask implements Task +{ + + @Override + public void execute() + { + + // 设计行业分类 + DesignIndustryCache dic = Global.get(DesignIndustryCache.class); + dic = dic != null ? dic : new DesignIndustryCache(); + Global.add(DesignIndustryCache.class, dic.doRefresh()); + + // 行业标签缓存 + IndustryLabelCache idl = Global.get(IndustryLabelCache.class); + idl = idl != null ? idl : new IndustryLabelCache(); + Global.add(IndustryLabelCache.class, idl.doRefresh()); + + // 标签维度缓存 + LabelDimensionCache lbd = Global.get(LabelDimensionCache.class); + lbd = lbd != null ? lbd : new LabelDimensionCache(); + Global.add(LabelDimensionCache.class, lbd.doRefresh()); + + // 客户类型缓存 + CustomerTypeCache ctt = Global.get(CustomerTypeCache.class); + ctt = ctt != null ? ctt : new CustomerTypeCache(); + Global.add(CustomerTypeCache.class, ctt.doRefresh()); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/CheckedOrderFileUploadTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/CheckedOrderFileUploadTask.java new file mode 100644 index 0000000..026703d --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/CheckedOrderFileUploadTask.java @@ -0,0 +1,159 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.task; + +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.aliyun.oss.common.utils.StringUtils; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignAttaView; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrdOprLog; +import com.zhiqim.yangcai.design.server.ErpClassService; +import com.zhiqim.yangcai.design.server.ErpClassService.statusEnum; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +/*** + * 设计订单文件OSS上传任务 + * + * @version v1.0.0 @author longguizhi 2018-9-21 新建与整理 + */ +public class CheckedOrderFileUploadTask implements Task, SignConstants { + private static final Log log = LogFactory.getLog(CheckedOrderFileUploadTask.class); + + @Override + public void execute() { + log.info("设计已审订单成品文件OSS上传任务开始..."); + int succUpload = 0; + int count = 0; + try { + // 重新上传 6.2 状态订单,由于 6.2 状态的订单 是被重启工程导致 订单状态停止在6.2状态 + ORM.get(ZTable.class).update(DesignOrder.class, + new Updater().addMust("status", StatusConstants.ORDER_62.value()).addField("status", + StatusConstants.ORDER_60.value())); + Selector sel = new Selector(); + sel.addMust("status", StatusConstants.ORDER_60.value()); + sel.addMustIsNotNull("checkTime"); + // 7天前已审 的单 + sel.addMustThenGE("checkTime", Sqls.toTimestamp(DateTimes.getPreviousDateTimeString(7))); + sel.addOrderbyAsc("checkTime"); + + // 1.查询订单 + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, sel); + count = orderList.size(); + for (DesignOrder order : orderList) { + // 4.修改订单状态为正在上传中 状态 + ORM.get(ZTable.class).update(DesignOrder.class, + new Updater().addMust("designId", order.getDesignId()) + .addMust("status", StatusConstants.ORDER_60.value()) + .addField("status", StatusConstants.ORDER_62.value())); + + Selector selector = new Selector("designId", order.getDesignId()); + selector.addMust("status", StatusConstants.ORDER_62.value()); + OrdOprLog opr_log = ORM.get(ZTable.class).item(OrdOprLog.class, selector); + if (opr_log != null) { + // 更新操作时间 + Updater updater_log = new Updater(); + updater_log.addMust("logId", opr_log.getLogId()); + updater_log.addMust("designId", opr_log.getDesignId()); + updater_log.addField("createTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(OrdOprLog.class, updater_log); + } else { + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", "印刷文件云端存储中", + EventConstants.ORDER_12.value());// 保存日志 + } + + // 2.检查成品文件 并设置 model的 netUrl + Selector attaSel = new Selector(); + attaSel.addMust("designId", order.getDesignId()); + attaSel.addMustIn("attaModul", FileTypeConstants.FILE_END.value(), + FileTypeConstants.FILE_DESGIN.value(), FileTypeConstants.FILE_WORK.value());// 设计文件 + // 和 + List attaList = ORM.get(ZView.class).list(DesignAttaView.class, attaSel); + + for (DesignAttaView atta : attaList) { + // 5.上传操作 + long fileSize = atta.getFileSize();// 用来标记是否需要断点续传 + long uploadSize = 10 * MiB;// 大于10M标记用断点续传 + boolean uploaded = false; + if (fileSize > uploadSize) { + uploaded = OssFileDao.uploadBreak(atta);// 断点续传 + } else { + uploaded = OssFileDao.uploadFile(atta); + } + + // 6.上传完成 + if (uploaded) {// 上传成功 + // 仅设计订单不需要判断印刷文件 + if (order.isOnlyDesign()) { + ORM.get(ZTable.class).update(DesignOrder.class, + new Updater().addMust("designId", order.getDesignId()) + .addMust("status", StatusConstants.ORDER_62.value()) + .addField("status", StatusConstants.ORDER_70.value())); + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", "印刷文件云端存储完成", + EventConstants.ORDER_12.value());// 保存日志 + succUpload++; + + } else { + if (FileTypeConstants.FILE_END.value().equalsIgnoreCase(atta.getAttaModul())) { + ORM.get(ZTable.class).update(DesignOrder.class, + new Updater().addMust("designId", order.getDesignId()) + .addMust("status", StatusConstants.ORDER_62.value()) + .addField("status", StatusConstants.ORDER_70.value())); + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", "印刷文件云端存储完成", + EventConstants.ORDER_12.value());// 保存日志 + succUpload++; + + } + } + if (order != null && !StringUtils.isNullOrEmpty(order.getTids())) { +// new ErpClassService(order.getTids(), order.getDesigner(), statusEnum.TO_BE_DESIGNED_COM.getCode()); + } + } else {// 上传失败 修改订单为已审 + if (FileTypeConstants.FILE_END.value().equalsIgnoreCase(atta.getAttaModul())) {// + ORM.get(ZTable.class).update(DesignOrder.class, + new Updater().addMust("designId", order.getDesignId()) + .addMust("status", StatusConstants.ORDER_62.value()) + .addField("status", StatusConstants.ORDER_70.value())); + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", "印刷文件云端存储失败(状态变回已审)", + EventConstants.ORDER_12.value());// 保存日志 + } + } + } + } + } catch (Exception e) { + log.error("设计订单印刷文件OSS上传任务异常", e); + } + + log.info("设计订单印刷文件OSS上传任务结束,共[" + count + "]条,有效[" + succUpload + "]条"); + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/DesignOrderReturnTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/DesignOrderReturnTask.java new file mode 100644 index 0000000..3d1c0cf --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/DesignOrderReturnTask.java @@ -0,0 +1,74 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.task; + +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.server.DiansanService; + +/*** + * 退款订单查询 + * + * @version v1.0.0 @author longguizhi 2018-9-21 新建与整理 + */ +public class DesignOrderReturnTask implements Task, SignConstants +{ + private static final Log log = LogFactory.getLog(DesignOrderReturnTask.class); + + @Override + public void execute() + { + log.info("退款订单查询同步任务开始..."); + int succUpload = 0; + int count = 0; + try + { + Selector selector = new Selector(); + selector.addMustThenGE("status", StatusConstants.ORDER_10.value()); + selector.addMustThenLE("status", StatusConstants.ORDER_62.value()); + selector.addMustNotLike("status", StatusConstants.ORDER_34.value()); + selector.addMustIsNotNull("tids"); + List list = ORM.get(ZTable.class).list(DesignOrder.class, selector); + System.out.println("===============================退款订单查询同步任务==========================================" + list.toString()); + for (int i = 0; i < list.size(); i++) { + DesignOrder designOrder = list.get(i); + String tids = designOrder.getTids(); + DesignOrder designOrder1 = DiansanService.designOrderReturn(tids); + if(null != designOrder1) { + Updater exUpdater = new Updater(); + exUpdater.addMust("designId", designOrder.getDesignId()); + if(0 != designOrder1.getStatus() && designOrder1.getStatus() >= 10) { + exUpdater.addField("status", designOrder1.getStatus()); + } + exUpdater.addField("returnMsg", designOrder1.getReturnMsg()); + ORM.get(ZTable.class).update(DesignOrder.class, exUpdater); + } + } + } + catch (Exception e) + { + log.error("退款订单查询同步任务异常", e); + } + log.info("退款订单查询同步任务结束,共[" + count + "]条,有效[" + succUpload + "]条"); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/DesignerPerformanceTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/DesignerPerformanceTask.java new file mode 100644 index 0000000..68fd77b --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/DesignerPerformanceTask.java @@ -0,0 +1,350 @@ +package com.zhiqim.yangcai.design.task; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.ProductConvertCache; +import com.zhiqim.yangcai.design.constant.VirtualAccountConstants; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.ParamDao; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.account.VirtualAccount; +import com.zhiqim.yangcai.design.dbo.account.VirtualAccountDetails; +import com.zhiqim.yangcai.design.dbo.account.VirtualTransactionDetails; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.model.ComparisonMoneyModel; +import com.zhiqim.yangcai.util.QiyeWechatUtil; + +/** + * 账户中心刷新设计师绩效定时任务: + * 场景:修改绩效配置不匹配时可考虑运行(临时) + * 时间:自定义 + * 作用:订单绩效不匹配绩效参数配置时,可重新计算所有设计师订单绩效。 + * 注意:会修改之前已完成订单对应的配置绩效为当前配置的绩效,谨慎使用。 + */ +public class DesignerPerformanceTask implements Task +{ + private static final Log log = LogFactory.getLog(DesignerPerformanceTask.class); + + @Override + public void execute() + { + log.info("设计师账户资金稽核开始。。。。。。"); + + try + { + // designerPerformance(); + // factoryBack(); + // afterSale(); + comparison(); + // lastMonthComparison(); + // designerAfterSale(); + } + catch (Exception e) + { + log.error("设计师账户资金稽核异常:" + e.getMessage(), e); + } + + log.info("设计师账户资金稽核结束。。。。。。"); + } + + public static void designerPerformance() throws Exception + { + // 当月第一天 + Date startDate = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getFirstMonthDay()); + String startDateString = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(startDate); + + List list = ORM.get(ZTable.class).list(VirtualAccount.class, new Selector().addMust("operatorStatus", 1)); + + for (VirtualAccount va : list) + { + // 本月该设计师已完成订单 + List designOrderList = ORM.get(ZView.class).list(DesignSelfView.class, + new Selector().addMustThenGE("designEndTime", Sqls.toTimestamp(startDateString)).addMust("designer", va.getOperatorCode()) + .addMustThenGE("status", StatusConstants.ORDER_55.value()).addOrderbyAsc("designEndTime") + .addMustNotEqual("draftType", DraftConstants.DRAFT_STANDARD.value())// 标准自来稿 + .addMustNotEqual("draftType", DraftConstants.DRAFT_ACTUALS.value()));// 现货 + + if (designOrderList.isEmpty()) + { + log.info("设计师" + va.getOperatorCode() + "本月无定稿订单"); + continue; + } + + // 刷新缓存 + Global.get(ProductConvertCache.class).doRefresh(); + + // 重置该设计师账户表 + Updater vaUpdater = new Updater(); + vaUpdater.addMust("operatorCode", va.getOperatorCode()); + vaUpdater.addField("freezeMoney", 0); + vaUpdater.addField("sumMoney", 0); + ORM.get(ZTable.class).update(VirtualAccount.class, vaUpdater); + ORM.get(ZTable.class).delete(VirtualAccountDetails.class, new Selector().addMust("operatorCode", va.getOperatorCode()) + .addMust("transactionStatus", 4).addMustThenGE("operatorTime", Sqls.toTimestamp(startDateString))); + ORM.get(ZTable.class).delete(VirtualTransactionDetails.class, new Selector().addMust("operatorCode", va.getOperatorCode()) + .addMust("transactionStatus", 4).addMustThenGE("transactionTime", Sqls.toTimestamp(startDateString))); + + long usableMoney = 0L; + long freezeMoney = 0L; + long sumMoney = 0L; + for (DesignSelfView designOrder : designOrderList) + { + // 获取该设计师虚拟账户表 + VirtualAccount vacc = ORM.get(ZTable.class).item(VirtualAccount.class, new Selector().addMust("operatorCode", va.getOperatorCode())); + long money = StatDao.calculateOrderPerformance(designOrder); + + usableMoney = vacc.getUsableMoney(); + freezeMoney = vacc.getFreezeMoney() + money; + sumMoney = usableMoney + freezeMoney; + + VirtualAccountDetails virtualAccountDetails = new VirtualAccountDetails(); + VirtualTransactionDetails virtualTransactionDetails = new VirtualTransactionDetails(); + + // 同步虚拟账户表 + Updater virtualAccountUpdater = new Updater(); + virtualAccountUpdater.addMust("operatorCode", va.getOperatorCode()); + virtualAccountUpdater.addField("usableMoney", usableMoney); + virtualAccountUpdater.addField("freezeMoney", freezeMoney); + virtualAccountUpdater.addField("sumMoney", sumMoney); + ORM.get(ZTable.class).update(VirtualAccount.class, virtualAccountUpdater); + + long accountBlotter = Ids.longId(); + long transactionBlotter = Ids.longId(); + // 同步虚拟账户明细表 + virtualAccountDetails.setOperatorCode(va.getOperatorCode()); + virtualAccountDetails.setAccountBlotter(accountBlotter); + virtualAccountDetails.setTransactionBlotter(transactionBlotter); + virtualAccountDetails.setTransactionStatus(4); + virtualAccountDetails.setUsableMoneyAdd(0); + virtualAccountDetails.setUsableMoneyDown(0); + virtualAccountDetails.setFreezeMoneyAdd(money); + virtualAccountDetails.setFreezeMoneyDown(0); + virtualAccountDetails.setOperatorTime(designOrder.getDesignEndTime()); + virtualAccountDetails.setUsableMoney(usableMoney); + virtualAccountDetails.setFreezeMoney(freezeMoney); + virtualAccountDetails.setSumMoney(sumMoney); + ORM.get(ZTable.class).insert(virtualAccountDetails); + + // 同步虚拟交易明细表 + virtualTransactionDetails.setOperatorCode(va.getOperatorCode()); + virtualTransactionDetails.setDesignId(designOrder.getDesignId()); + virtualTransactionDetails.setTransactionBlotter(transactionBlotter); + virtualTransactionDetails.setOrderText(designOrder.getOrderText()); + virtualTransactionDetails.setEndTime(designOrder.getDesignEndTime()); + virtualTransactionDetails.setTransactionTime(designOrder.getDesignEndTime()); + virtualTransactionDetails.setTransactionStatus(4); + virtualTransactionDetails.setOrderMoney(money); + ORM.get(ZTable.class).insert(virtualTransactionDetails); + } + } + } + + /** + * //当月绩效与账号金额核对 + **/ + public static void comparison() throws Exception + { + Date parseHead = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getFirstMonthDay()); + String formatHead = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(parseHead); + + List vaList = ORM.get(ZTable.class).list(VirtualAccount.class); + HashMap map = new HashMap(); + long designerOrdCost = 0L; + for (VirtualAccount va : vaList) + { + ComparisonMoneyModel cmModel = new ComparisonMoneyModel(); + + Selector selector = new Selector(); + selector.addMustThenGE("designEndTime", Sqls.toTimestamp(formatHead)); + selector.addMust("designer", va.getOperatorCode()); + selector.addMustThenGE("status", StatusConstants.ORDER_55.value()); + selector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + selector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + selector.addOrderbyAsc("createTime"); + List orderList = ORM.get(ZView.class).list(DesignSelfView.class, selector); + + // 先更新产品单价缓存,防止数据未同步 + Global.get(ProductConvertCache.class).doRefresh(); + + for (DesignSelfView order : orderList) + { + designerOrdCost += order.getDesignPrice(); + designerOrdCost += order.getUrgentPrice(); + } + cmModel.setDesignerOrdCost(designerOrdCost); + cmModel.setMoney(va.getFreezeMoney()); + + if (designerOrdCost != va.getFreezeMoney()) + { + map.put(va.getOperatorCode(), cmModel); + } + designerOrdCost = 0L; + } + + if (!map.isEmpty()) + { + QiyeWechatUtil.sendMsgToQiyeWechat("设计师账户资金稽核结果异常:\n" + Jsons.toString(map), Boolean.TRUE); + } + else + { + QiyeWechatUtil.sendMsgToQiyeWechat("设计师账户资金稽核结果正常.", Boolean.TRUE); + } + } + + /** + * // 上月绩效与账号金额核对 + */ + public static void lastMonthComparison() throws Exception + { + String startDate = DateTimes.getPreviousMonthFirstDay() + " 00:00:00"; + String endDate = DateTimes.getPreviousMonthLastDay() + " 23:59:59"; + + List vaList = ORM.get(ZTable.class).list(VirtualAccount.class); + HashMap map = new HashMap(); + long designerOrdCost = 0L; + for (VirtualAccount va : vaList) + { + ComparisonMoneyModel cmModel = new ComparisonMoneyModel(); + StringBuilder sqlStr = new StringBuilder("SELECT sum(order_designer_fee) as designerOrdCost from designer_order_performance_stat s "); + sqlStr.append("where s.designer='designerStr' and s.design_end_time >= 'startDateStr' and s.design_end_time <= 'endDateStr'"); + + String sql = sqlStr.toString().replace("startDateStr", startDate).replace("endDateStr", endDate).replace("designerStr", va.getOperatorCode()); + List list = ORM.get(ZSQL.class).executeQuery(sql); + LinkedMapSO so = list.get(0); + if (null != so.get("designerOrdCost")) + { + designerOrdCost = Long.parseLong(String.valueOf(so.get("designerOrdCost"))); + } + cmModel.setDesignerOrdCost(designerOrdCost); + cmModel.setMoney(va.getUsableMoney()); + if (designerOrdCost != va.getUsableMoney()) + { + map.put(va.getOperatorCode(), cmModel); + } + + designerOrdCost = 0L; + } + + if (!map.isEmpty()) + { + QiyeWechatUtil.sendMsgToQiyeWechat("设计师账户上个月资金稽核结果异常:\n" + Jsons.toString(map), Boolean.TRUE); + } + else + { + QiyeWechatUtil.sendMsgToQiyeWechat("设计师账户上个月资金稽核结果正常.", Boolean.TRUE); + } + } + + /** + * [简要描述]:售后处理,出现扣除多次售后特殊处理 + * + * @author 海川 + * @throws Exception + */ + public static void designerAfterSale() throws Exception + { + /** + * 设置多扣除几次 , + * 例:1 为多扣除了1次 + */ + int saleFrequency = 1; + + // 获取上个月第一天 + Date parseHead = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getPreviousMonthFirstDay()); + String formatHead = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(parseHead); + // 当月第一天00:00:00 + Date parseEnd = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getFirstMonthDay()); + String formatEnd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(parseEnd); + + // 查询正常状态账户 + List vaLists = ORM.get(ZTable.class).list(VirtualAccount.class, new Selector().addMust("operatorStatus", 1)); + for (VirtualAccount va : vaLists) + { + // 查询售后订单信息 + Selector selector = new Selector(); + selector.addMust("afterBlamer", va.getOperatorCode()); + selector.addMustThenGE("afterHandelTime", Sqls.toTimestamp(formatHead)); + selector.addMustThenLE("afterHandelTime", Sqls.toTimestamp(formatEnd)); + selector.addMustThenG("afterStatus", 0); // 产生了售后 + List daoList = ORM.get(ZTable.class).list(DesignAfterOrder.class, selector); + + for (DesignAfterOrder dao : daoList) + { + // 查订单信息 + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", dao.getDesignId())); + + // 售后损失金额 + long lossAmount = 0L; + + if (DateTimes.getCurrentYear() > 2021 || (DateTimes.getCurrentYear() >= 2021 && DateTimes.getCurrentMonth() >= 11)) // 执行时间大于2021.11. + { + String AfterPayProportion = ParamDao.getString("yangcai.web", "AfterPayProportion"); + lossAmount = new Double(dao.getLossAmount() * Long.parseLong(AfterPayProportion)).longValue(); + } + else + { + lossAmount = new Double(dao.getLossAmount() * 100).longValue(); + } + + VirtualAccount account = ORM.get(ZTable.class).item(VirtualAccount.class, new Selector().addMust("operatorCode", va.getOperatorCode())); + + for (int i = 1; i <= saleFrequency; i++) + { + // 同步账户总表 + Updater vaUpdater = new Updater(); + vaUpdater.addMust("operatorCode", va.getOperatorCode()); + vaUpdater.addField("usableMoney", account.getUsableMoney() + lossAmount); + vaUpdater.addField("sumMoney", account.getSumMoney() + lossAmount); + ORM.get(ZTable.class).update(VirtualAccount.class, vaUpdater); + + // 同步账户交易明细表 + long longId = Ids.longId(); + VirtualTransactionDetails vtd = new VirtualTransactionDetails(); + vtd.setDesignId(dao.getDesignId()); + vtd.setEndTime(Sqls.nowTimestamp()); + vtd.setOperatorCode(dao.getAfterBlamer()); + vtd.setOrderMoney(lossAmount); + vtd.setOrderText(order.getOrderText()); + vtd.setTransactionBlotter(longId); + vtd.setTransactionStatus(Integer.parseInt(VirtualAccountConstants.ABNORMALAUDIT.value()));// 系统核算 + vtd.setTransactionTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(vtd); + + // 同步账户明细表 + VirtualAccountDetails vad = new VirtualAccountDetails(); + vad.setAccountBlotter(Ids.longId()); + vad.setUsableMoneyAdd(lossAmount); + vad.setUsableMoney(account.getUsableMoney() + lossAmount); // 还原扣除 + vad.setOperatorCode(dao.getAfterBlamer()); + vad.setOperatorTime(Sqls.nowTimestamp()); + vad.setSumMoney(account.getSumMoney() + lossAmount);// 还原扣除 + vad.setTransactionBlotter(longId); + vad.setTransactionStatus(Integer.parseInt(VirtualAccountConstants.ABNORMALAUDIT.value()));// 系统核算 + ORM.get(ZTable.class).insert(vad); + } + } + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/DesignerWorkStatusUpdateTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/DesignerWorkStatusUpdateTask.java new file mode 100644 index 0000000..72bcbe7 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/DesignerWorkStatusUpdateTask.java @@ -0,0 +1,74 @@ +package com.zhiqim.yangcai.design.task; + +import java.util.List; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Maths; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dao.DesignerDao; +import com.zhiqim.yangcai.design.dbo.dispatch.DesOnline; + +/** + * 设计师接单工作状态刷新 + * + * @version 1.0 @author caohong 2020-11-27 14:34:59 + */ +public class DesignerWorkStatusUpdateTask implements Task +{ + + private static Log log = LogFactory.getLog(DesignerWorkStatusUpdateTask.class); + + @Override + public void execute() + { + log.info("刷新设计师接单工作状态任务开始..."); + long beginTime = System.currentTimeMillis(); + int count = 0; + try + { + Selector selector = new Selector(); + selector.addMust("onlineStatus", 1); + List listResult = ORM.get(ZTable.class).list(DesOnline.class, selector); + if (listResult != null && listResult.size() > 0) + { + count = listResult.size(); + updateStatus(listResult); + } + } + catch (Exception e) + { + log.info("刷新设计师接单工作状态任务异常," + e.getMessage(), e); + } + + long endTime = System.currentTimeMillis(); + log.info("刷新设计师接单工作状态任务结束,共更新:" + count + " 条记录,耗时[%s]", Maths.division((endTime - beginTime), 1000, 3)); + } + + /** + * [简要描述]:检查并更新设计师接单状态
            + * [详细描述]:如果设计师正在接单,状态更新时间超过5分钟,则强制更新为停止接单状态
            + * + * @author caohong + * @param listResult + * @throws Exception + */ + private void updateStatus(List listResult) throws Exception + { + for (DesOnline online : listResult) + { + int time = DateTimes.compareMinute(Sqls.nowTimestamp(), online.getLastUpdateTime()); + if (online.getLastUpdateTime() == null || time > 5) + { + DesignerDao.stopWorkExec(online.getOrgId(), online.getOperatorCode(), "客户端异常退出,停止接单"); + } + + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/OssUploadTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/OssUploadTask.java new file mode 100644 index 0000000..4670287 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/OssUploadTask.java @@ -0,0 +1,121 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.task; + +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignAttaView; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +/**** + * 附件Oss上传任务 + * + * @version v1.0.0 @author longguizhi 2018-9-21 新建与整理 + */ +public class OssUploadTask implements Task, SignConstants +{ + private static final Log log = LogFactory.getLog(OssUploadTask.class); + + @Override + public void execute() + { + int pageSize = 500; + int succUpload = 0; + int allCount = 0; + try + { + log.info("附件Oss上传任务开始..."); + // 上传 已定稿的文件 + // String date = DateTimes.getPreviousDateString(7); + Selector selector = new Selector(); + // selector.addMustIsNotNull("savePath");//上传地址都为空 + selector.addMustIsNull("ossUrl");// 未上传的 + selector.addOrderbyDesc("createTime"); + selector.addMust("ossType", 0); + selector.addMustThenGE("status", StatusConstants.ORDER_70.value()); + + List list = ORM.get(ZView.class).page(DesignAttaView.class, 1, pageSize, selector).list(); + allCount = list.size(); + succUpload += processList(list); + + // 上传取消订单 + Selector selector2 = new Selector(); + // selector.addMustIsNotNull("savePath");//上传地址都为空 + selector2.addMustIsNull("ossUrl");// 未上传的 + selector2.addOrderbyDesc("createTime"); + selector2.addMust("ossType", 0); + selector2.addMustThenL("status", StatusConstants.ORDER_10.value()); + + PageResult pageResult = ORM.get(ZView.class).page(DesignAttaView.class, 1, pageSize, selector2); + for (int i = 2; i < pageResult.totalPages(); i++) + { + List list3 = ORM.get(ZView.class).page(DesignAttaView.class, 1, pageSize, selector2).list(); + if (list3.size() == 0) + { + break; + } + + allCount += list3.size(); + succUpload += processList(list3); + } + } + catch (Exception e) + { + log.error("附件Oss上传任务异常", e); + } + + log.info("附件Oss上传任务结束,成功上传[" + succUpload + "]条,失败[" + (allCount - succUpload) + "]条,共[" + allCount + "]条数据"); + } + + private int processList(List list) + { + int c = 0; + for (DesignAttaView atta : list) + { + + long fileSize = atta.getFileSize(); + long uploadSize = 10 * MiB;// 大于10M标记用断点续传 + boolean uploaded = false; + if (fileSize > uploadSize) + { + uploaded = OssFileDao.uploadBreak(atta);// 断点续传 + } + else + { + uploaded = OssFileDao.uploadFile(atta); + } + + if (!uploaded) + { + log.error("OssUploadTask 订单[" + atta.getDesignId() + "]上传附件[" + atta.getAttaModul() + "]失败"); + } + c += uploaded ? 1 : 0; + } + return c; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/OssUploadedDeleteTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/OssUploadedDeleteTask.java new file mode 100644 index 0000000..ac1d62a --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/OssUploadedDeleteTask.java @@ -0,0 +1,133 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.task; + +import java.io.File; +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.uploadlarge.dbo.UpllFile; + +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; + +/**** + * 已上传到oss 文件删除任务 + * + * @version v1.0.0 @author lgz 2019-2-13 新建与整理 + */ +public class OssUploadedDeleteTask implements Task, SignConstants +{ + private static Log log = LogFactory.getLog(OssUploadedDeleteTask.class); + + @Override + public void execute() + { + log.info("已上传到oss文件删除任务开始..."); + int pageSize = 1000; + int count = 0; + int total = 0; + Selector selector = new Selector("ossType", 1);// 已经上传到OSS + selector.addMust("attaFlag", 0);// 用户登录系统上传的 + selector.addMust("notExistsLocalFile", 1);// 未被标记的 + selector.addOrderbyDesc("uploadTime"); + try + { + PageResult pageResult = ORM.get(ZTable.class).page(DesignAtta.class, 1, pageSize, selector); + count += processList(pageResult.list()); + total = pageResult.total(); + if (count > 0) + { + log.info("已上传到oss 文件删除任务,已处理[%s],共[%s]", count, total); + } + + for (int i = 2; i <= pageResult.totalPages(); i++) + { + pageResult = ORM.get(ZTable.class).page(DesignAtta.class, 1, pageSize, selector); + count += processList(pageResult.list()); + + log.info("已上传到oss 文件删除任务,已处理[%s],共[%s]", count, total); + } + } + catch (Exception e) + { + log.error("已上传到oss文件删除任务异常,", e); + } + + log.info("已上传到oss文件删除任务结束,共[%s]有效,总共[%s]", count, total); + } + + private int processList(List list) + { + int count = 0; + for (DesignAtta atta : list) + { + if (Validates.isEmptyBlank(atta.getOssUrl())) + {// 未上传到OSS + log.error("附件[%s]未上传到OSS,本地文件不做删除处理", atta.getAttaId()); + continue; + } + File file = new File(atta.getSavePath()); + Updater updater = new Updater(); + updater.addMust("attaId", atta.getAttaId()); + boolean deleted = false; + if (file.exists() && file.isFile()) + { + deleted = file.delete(); + if (deleted) + { + log.info("附件[%s]本地文件已删除", atta.getAttaId()); + count++; + updater.addField("notExistsLocalFile", 2); + if (Validates.isNotEmptyBlank(atta.getFileid())) + { + try + { + ORM.get(ZTable.class).delete(UpllFile.class, new Selector("fileId", atta.getFileid()).addReplace("id", null)); + } + catch (Exception e) + { + log.error("已上传到oss 文件删除任务,表UpllFile,fileId=[%s]删除异常", e, atta.getFileid()); + } + } + File currDir = file.getParentFile(); + if (currDir != null && currDir.isDirectory()) + { + currDir.delete();// 删除当前目录 + } + } + } + else + { + updater.addField("notExistsLocalFile", 2); + } + + try + { + ORM.get(ZTable.class).update(DesignAtta.class, updater); + } + catch (Exception e) + { + log.error("已上传到oss 文件删除任务,附件[%s]处理异常:", e, atta.getAttaId()); + } + } + return count; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/OssUploadedPreDeleteTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/OssUploadedPreDeleteTask.java new file mode 100644 index 0000000..71502f7 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/OssUploadedPreDeleteTask.java @@ -0,0 +1,105 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.design.task; + +import java.io.File; +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; + +/**** + * 已上传到oss文件删除标记任务 + * + * @version v1.0.0 @author lgz 2019-2-13 新建与整理 + */ +public class OssUploadedPreDeleteTask implements Task, SignConstants +{ + + private static Log log = LogFactory.getLog(OssUploadedPreDeleteTask.class); + + @Override + public void execute() + { + log.info("oss 文件删除标记任务开始..."); + int pageSize = 1000; + Selector selector = new Selector("ossType", 1);// 已经上传到OSS + selector.addMust("attaFlag", 0);// 用户登录系统上传的 + selector.addOr(new Selector("notExistsLocalFile", 0).addMustIsNull("notExistsLocalFile"));// 未被标记的 + selector.addOrderbyDesc("uploadTime"); + + int count = 0; + int total = 0; + try + { + PageResult pageResult = ORM.get(ZTable.class).page(DesignAtta.class, 1, pageSize, selector); + count += processList(pageResult.list()); + total = pageResult.total(); + if (count > 0) + { + log.info("oss 文件删除标记任务,已标记[%s],共[%s]", count, total); + } + + for (int i = 2; i <= pageResult.totalPages(); i++) + { + pageResult = ORM.get(ZTable.class).page(DesignAtta.class, 1, pageSize, selector); + count += processList(pageResult.list()); + + log.info("oss 文件删除标记任务,已标记[%s],共[%s]", count, total); + } + } + catch (Exception e) + { + log.error("oss 文件删除标记任务异常:", e); + } + log.info("oss 文件删除标记任务结束。共[%s]有效,总共[%s]", count, total); + } + + private int processList(List list) + { + int count = 0; + for (DesignAtta atta : list) + { + File file = new File(atta.getSavePath()); + Updater updater = new Updater(); + updater.addMust("attaId", atta.getAttaId()); + if (file.exists() && file.isFile()) + { + updater.addField("notExistsLocalFile", 1); + } + else + { + updater.addField("notExistsLocalFile", 2); + } + + try + { + ORM.get(ZTable.class).update(DesignAtta.class, updater); + count += 1; + } + catch (Exception e) + { + log.error("oss 文件删除标记任务,附件[%s]标记异常:", e, atta.getAttaId()); + } + } + return count; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/PerformanceOutStatTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/PerformanceOutStatTask.java new file mode 100644 index 0000000..847e1a7 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/PerformanceOutStatTask.java @@ -0,0 +1,409 @@ +package com.zhiqim.yangcai.design.task; + +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.ProductConvertCache; +import com.zhiqim.yangcai.design.constant.VirtualAccountConstants; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.account.VirtualAccount; +import com.zhiqim.yangcai.design.dbo.account.VirtualAccountDetails; +import com.zhiqim.yangcai.design.dbo.account.VirtualTransactionDetails; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrder; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.stat.DesignerOrderPerformanceStat; + +/** + * + * [简要描述]: 设计师绩效统计
            + * + * @version 1.0 @author gjx 2021年3月5日 新建与整理 + */ +public class PerformanceOutStatTask implements Task +{ + private static final Log log = LogFactory.getLog(PerformanceOutStatTask.class); + + @Override + public void execute() + { + // 1、1-8号,每天统计计算上个月的绩效 + // 2、只统计有配置接单规则的设计师 + log.info("设计师绩效统计/解冻开始。。。"); + long beginTime = System.currentTimeMillis(); + try + { + if (DateTimes.getCurrentDay() > 8) + { + log.info("设计师绩效统计日期超过8号不执行"); + return; + } + + // 先更新产品单价缓存,防止数据未同步 + Global.get(ProductConvertCache.class).doRefresh(); + + // 设计师绩效 + List designerList = ORM.get(ZTable.class).list(DesignerGroupDispatch.class, new Selector("status", 1)); + for (DesignerGroupDispatch designer : designerList) + { + calculateDesignerPerformance(designer.getOperatorCode()); + } + + if (DateTimes.getCurrentDay() == 1) + { + // 解冻资金 + Transaction tx = null; + try + { + tx = TransactionManager.beginTransaction(); + unfreezeMoney(); + tx.commit(); + } + catch (Exception e) + { + if (tx != null) + { + tx.rollback(); + } + log.error("设计师账户资金解冻异常:" + e.getMessage(), e); + } + finally + { + if (tx != null) + { + tx.close(); + } + } + + } + if (DateTimes.getCurrentDay() == 8) + { + // 售后处理 + afterSale(); + } + } + catch (Exception e) + { + log.error("设计师绩效统计/解冻异常:" + e.getMessage(), e); + } + + long endTime = System.currentTimeMillis(); + log.info("设计师绩效统计/解冻结束,用时:" + (endTime - beginTime) / 1000 + " 秒"); + } + + /** + * + * [简要描述] 计算外部设计师绩效:
            + * [详细描述]:
            + * + * @author gjx + * @param designer + */ + private static void calculateDesignerPerformance(String designer) throws Exception + { + String startDate = DateTimes.getPreviousMonthFirstDay(); + String endDate = DateTimes.getPreviousMonthLastDay(); + + Selector selector = new Selector(); + selector.addMustThenGE("designEndTime", Sqls.toTimestampBegin(startDate)); + selector.addMustThenLE("designEndTime", Sqls.toTimestampEnd(endDate)); + selector.addMust("designer", designer); + selector.addMustThenGE("status", StatusConstants.ORDER_55.value()); + selector.addOrderbyAsc("designEndTime"); + selector.addMustThenGE("draftType", DraftConstants.DRAFT_TEMPLATE.value()); + selector.addMustThenLE("draftType", DraftConstants.DRAFT_PAGE_DESIGN.value()); + + List statList = new ArrayList(); + List orderList = ORM.get(ZView.class).list(DesignSelfView.class, selector); + for (DesignSelfView order : orderList) + { + int printKs = order.getPrintKs(); + int designCopies = order.getDesignCopies(); + int draftType = order.getDraftType(); + + DesignerOrderPerformanceStat stat = new DesignerOrderPerformanceStat(order.getDesignId(), designer, order.getOrgId()); + stat.setPrintKs(printKs); + stat.setDesignCopies(designCopies); + stat.setDesignEndTime(order.getDesignEndTime()); + stat.setAddTime(Sqls.nowTimestamp()); + + long designPrice = 0L; + if (order.getDesignPrice() == 0) + { + designPrice = StatDao.calculateOrderPerformance(order); + } + else + { + designPrice = order.getDesignPrice(); + } + long urgentPrice = 0L; + if (order.isUrgent() && Validates.isNotEmpty(order.getUrgentPrice())) + { + urgentPrice = order.getUrgentPrice(); + designPrice += urgentPrice; + } + + if (draftType == DraftConstants.DRAFT_TEMPLATE.value()) + { + stat.setTemplateDraftFee(StatDao.calculateTemplateDraftProductPrice(order)); + stat.setOrderDesignerFee(designPrice); + } + else + { + stat.setPrdConvertFee(StatDao.calculateOrderProductPerformance(order)); + stat.setMultiKsFee(Amounts.toFen(String.valueOf((printKs - 1) * 0.5), 0L));// (款数-1)*0.5(多款海报产品永远为0) + stat.setOrderDesignerFee(designPrice); + } + + statList.add(stat); + + if (statList.size() >= 20) + {// 满20条插入一次 + ORM.get(ZTable.class).replaceBatch(statList); + statList.clear(); + } + } + + if (!statList.isEmpty()) + { + ORM.get(ZTable.class).replaceBatch(statList); + } + } + + /** + * + * [简要描述]:解冻设计师虚拟账户资金
            + * [详细描述]:
            + * + * @author hc + * @throws Exception + */ + public void unfreezeMoney() throws Exception + { + Date parseHead = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getPreviousMonthFirstDay()); + Date parseEnd = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getFirstMonthDay()); + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String formatHead = simpleDateFormat.format(parseHead); + String formatEnd = simpleDateFormat.format(parseEnd); + + List virtualAccountList = ORM.get(ZTable.class).list(VirtualAccount.class, new Selector().addMust("operatorStatus", 1)); + + if (Validates.isNotEmpty(virtualAccountList)) + { + for (VirtualAccount va : virtualAccountList) + { + if (va.getOperatorStatus() == 0) + { + log.info("设计师:【" + va.getOperatorCode() + "】为停用状态!"); + continue; + } + + if (va.getFreezeMoney() <= 0) + { + log.info("设计师:【" + va.getOperatorCode() + "】解冻失败,可解冻金额小于0!"); + continue; + } + + // 判断设计师当月是否已经解冻可解冻余额 + Selector selector = new Selector(); + selector.addMust("operatorCode", va.getOperatorCode()); + selector.addMust("transactionStatus", Long.parseLong(VirtualAccountConstants.UNFREEZE.value())); + selector.addMustThenGE("operatorTime", Sqls.toTimestamp(formatEnd)); + List virtualAccountDetailsList = ORM.get(ZTable.class).list(VirtualAccountDetails.class, selector); + if (virtualAccountDetailsList.size() != 0) + { + log.info("设计师:【" + va.getOperatorCode() + "】当月已解冻了可解冻资金"); + continue; + } + + List list = ORM.get(ZView.class).list(DesignSelfView.class, + new Selector().addMust("designer", va.getOperatorCode()).addMustThenGE("designEndTime", Sqls.toTimestamp(formatHead)) + .addMustThenLE("designEndTime", Sqls.toTimestamp(formatEnd)).addMustThenGE("status", StatusConstants.ORDER_55.value()) + .addMustThenG("draftType", 0)); + + List vtdList = ORM.get(ZTable.class).list(VirtualTransactionDetails.class, + new Selector().addMust("operatorCode", va.getOperatorCode()) + .addMust("transactionStatus", Long.parseLong(VirtualAccountConstants.TRANSACTION_STATUS_1.value())) + .addMustThenGE("transactionTime", Sqls.toTimestamp(formatHead)).addMustThenLE("transactionTime", Sqls.toTimestamp(formatEnd))); + + if (list.isEmpty() && vtdList.isEmpty()) + { + log.info("设计师:【" + va.getOperatorCode() + "】无可解冻资金"); + continue; + } + + // 加急费同步流水信息 + for (VirtualTransactionDetails vtd : vtdList) + { + currentCount(ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", vtd.getDesignId())), va.getOperatorCode(), + vtd.getOrderMoney()); + } + + // 同步流水信息 + for (DesignSelfView sumFreezeMoney : list) + { + long moneyAdd = 0L; + if (sumFreezeMoney.getDesignPrice() == 0L)// 设计佣金 + { + moneyAdd = StatDao.calculateOrderPerformance(sumFreezeMoney); + } + else + { + moneyAdd = sumFreezeMoney.getDesignPrice(); + } + currentCount(sumFreezeMoney, va.getOperatorCode(), moneyAdd); + } + } + } + } + + /** + * [简要描述]:售后处理,集中处理上个月的售后损失,从个人可用账户中扣除
            + * + * @author 海川 + * @throws Exception + */ + public static void afterSale() throws Exception + { + // 获取上个月第一天 + Date parseHead = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getPreviousMonthFirstDay()); + String formatHead = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(parseHead); + // 当月第一天00:00:00 + Date parseEnd = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getFirstMonthDay()); + String formatEnd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(parseEnd); + + // 查询正常状态账户 + List vaLists = ORM.get(ZTable.class).list(VirtualAccount.class, new Selector().addMust("operatorStatus", 1)); + for (VirtualAccount va : vaLists) + { + // 查询售后订单信息 + Selector selector = new Selector(); + selector.addMust("afterBlamer", va.getOperatorCode()); + selector.addMustThenGE("afterHandelTime", Sqls.toTimestamp(formatHead)); + selector.addMustThenLE("afterHandelTime", Sqls.toTimestamp(formatEnd)); + selector.addMustThenG("afterStatus", 0); // 产生了售后 + List daoList = ORM.get(ZTable.class).list(DesignAfterOrder.class, selector); + + for (DesignAfterOrder dao : daoList) + { + // 查订单信息 + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", dao.getDesignId())); + + // 售后损失金额 + long lossAmount = 0L; + + long dateTime = dao.getAfterCreateTime().getTime(); + long lDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2021-10-01 00:00:00").getTime(); + if (dateTime >= lDateTime) // 售后单于2021.10.01后创建 + { + lossAmount = new Double(dao.getCompensateAmount() * 100).longValue(); + } + else + { + lossAmount = new Double(dao.getLossAmount() * 100).longValue(); + } + + VirtualAccount account = ORM.get(ZTable.class).item(VirtualAccount.class, new Selector().addMust("operatorCode", va.getOperatorCode())); + + // 同步账户总表 + Updater vaUpdater = new Updater(); + vaUpdater.addMust("operatorCode", va.getOperatorCode()); + vaUpdater.addField("usableMoney", account.getUsableMoney() - lossAmount); + vaUpdater.addField("sumMoney", account.getSumMoney() - lossAmount); + ORM.get(ZTable.class).update(VirtualAccount.class, vaUpdater); + + // 同步账户交易明细表 + long longId = Ids.longId(); + VirtualTransactionDetails vtd = new VirtualTransactionDetails(); + vtd.setDesignId(dao.getDesignId()); + vtd.setEndTime(Sqls.nowTimestamp()); + vtd.setOperatorCode(dao.getAfterBlamer()); + vtd.setOrderMoney(-lossAmount); + vtd.setOrderText(order.getOrderText()); + vtd.setTransactionBlotter(longId); + vtd.setTransactionStatus(5);// 售后 + vtd.setTransactionTime(Sqls.nowTimestamp()); + ORM.get(ZTable.class).insert(vtd); + + // 同步账户明细表 + VirtualAccountDetails vad = new VirtualAccountDetails(); + vad.setAccountBlotter(Ids.longId()); + vad.setUsableMoneyDown(-lossAmount); + vad.setUsableMoney(account.getUsableMoney() - lossAmount); // 扣除可用 + vad.setOperatorCode(dao.getAfterBlamer()); + vad.setOperatorTime(Sqls.nowTimestamp()); + vad.setSumMoney(account.getSumMoney() - lossAmount);// 扣除总金额 + vad.setTransactionBlotter(longId); + vad.setTransactionStatus(5); + ORM.get(ZTable.class).insert(vad); + } + } + } + + // 账户流水 + public static void currentCount(DesignOrder sumFreezeMoney, String operatorCode, long moneyAdd) throws Exception + { + + // 同步虚拟账户表 + VirtualAccount item = ORM.get(ZTable.class).item(VirtualAccount.class, new Selector().addMust("operatorCode", operatorCode)); + + Updater virtualAccountUpdater = new Updater(); + virtualAccountUpdater.addMust("operatorCode", item.getOperatorCode()); + virtualAccountUpdater.addField("usableMoney", item.getUsableMoney() + moneyAdd); + virtualAccountUpdater.addField("freezeMoney", item.getFreezeMoney() - moneyAdd); + virtualAccountUpdater.addField("sumMoney", item.getSumMoney()); + ORM.get(ZTable.class).update(VirtualAccount.class, virtualAccountUpdater); + + long longId = Ids.longId(); + Timestamp nowTimestamp = Sqls.nowTimestamp(); + // 同步虚拟账户 账户明细表 + VirtualAccountDetails virtualAccountDetails = new VirtualAccountDetails(); + virtualAccountDetails.setOperatorCode(item.getOperatorCode()); + virtualAccountDetails.setAccountBlotter(Ids.longId()); + virtualAccountDetails.setTransactionBlotter(longId); + virtualAccountDetails.setTransactionStatus(Integer.parseInt(VirtualAccountConstants.UNFREEZE.value())); + virtualAccountDetails.setUsableMoneyAdd(moneyAdd); + virtualAccountDetails.setFreezeMoneyDown(-moneyAdd); + virtualAccountDetails.setOperatorTime(nowTimestamp); + virtualAccountDetails.setUsableMoney(item.getUsableMoney() + moneyAdd); + virtualAccountDetails.setFreezeMoney(item.getFreezeMoney() - moneyAdd); + virtualAccountDetails.setSumMoney(item.getSumMoney()); + ORM.get(ZTable.class).insert(virtualAccountDetails); + + // 同步虚拟账户 交易明细表 + VirtualTransactionDetails virtualTransactionDetails = new VirtualTransactionDetails(); + virtualTransactionDetails.setOperatorCode(item.getOperatorCode()); + virtualTransactionDetails.setTransactionBlotter(longId); + virtualTransactionDetails.setOrderText(sumFreezeMoney.getOrderText()); + virtualTransactionDetails.setDesignId(sumFreezeMoney.getDesignId()); + virtualTransactionDetails.setEndTime(sumFreezeMoney.getDesignEndTime()); + virtualTransactionDetails.setTransactionTime(nowTimestamp); + virtualTransactionDetails.setTransactionStatus(Integer.parseInt(VirtualAccountConstants.UNFREEZE.value())); + virtualTransactionDetails.setOrderMoney(-moneyAdd); + ORM.get(ZTable.class).insert(virtualTransactionDetails); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/RefreshDesignPriceTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/RefreshDesignPriceTask.java new file mode 100644 index 0000000..3d8394d --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/RefreshDesignPriceTask.java @@ -0,0 +1,111 @@ +package com.zhiqim.yangcai.design.task; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.design.DesignPrice; +import com.zhiqim.yangcai.design.dbo.design.ProductConvert; + +/** + * + * [简要描述]:每月1号刷新设计单价定时任务
            + * [详细描述]:
            + * + * @version 1.0 @author hc 2021年8月16日 新建与整理 + */ +public class RefreshDesignPriceTask implements Task +{ + private static final Log log = LogFactory.getLog(RefreshDesignPriceTask.class); + + @Override + public void execute() + { + log.info("刷新设计单价定时任务开始。。。"); + if (DateTimes.getCurrentDay() > 1) + { + log.info("设计单价刷新只在1号执行"); + return; + } + try + { + refreshDesignPrice(); + } + catch (Exception e) + { + log.info("刷新设计单价定时任务失败。。。", e); + } + + log.info("刷新设计单价定时任务结束。。。"); + } + + // 刷新设计单价 + public static void refreshDesignPrice() throws Exception + { + List pcList = ORM.get(ZTable.class).list(ProductConvert.class); + for (ProductConvert pc : pcList) + { + long priceId2 = 0L; + long priceId1 = 0L; + List dpList = ORM.get(ZTable.class).list(DesignPrice.class, new Selector().addMust("convertId", pc.getConvertId())); + Date effectTimeSta = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getFirstMonthDay()); + Date effectTimeEnd = new SimpleDateFormat("yyyy-MM-dd").parse(DateTimes.getNextMonthFirstDay()); + long effectTimeStaLong = Sqls.toTimestamp(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(effectTimeSta)).getTime(); + long effectTimeEndLong = Sqls.toTimestamp(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(effectTimeEnd)).getTime(); + for (DesignPrice dp : dpList) + { + if (dp.getStatus() == 1) + { + if (dp.getDraftType() == 2) + { // 普通设计 + priceId2 = dp.getPriceId(); + } + else if (dp.getDraftType() == 1) + {// 改稿设计 + priceId1 = dp.getPriceId(); + } + + } + + long time = dp.getEffectTime().getTime(); + if (time >= effectTimeStaLong && time < effectTimeEndLong) + { + if (dp.getDraftType() == 2) + { // 普通设计 + Updater failureUp = new Updater(); + failureUp.addMust("priceId", priceId2); + failureUp.addField("status", 0);// 失效 + ORM.get(ZTable.class).update(DesignPrice.class, failureUp); + + Updater effectUp = new Updater(); + effectUp.addMust("priceId", dp.getPriceId()); + effectUp.addField("status", 1);// 生效 + ORM.get(ZTable.class).update(DesignPrice.class, effectUp); + } + else if (dp.getDraftType() == 1) + {// 改稿设计 + Updater failureUp = new Updater(); + failureUp.addMust("priceId", priceId1); + failureUp.addField("status", 0);// 失效 + ORM.get(ZTable.class).update(DesignPrice.class, failureUp); + + Updater effectUp = new Updater(); + effectUp.addMust("priceId", dp.getPriceId()); + effectUp.addField("status", 1);// 生效 + ORM.get(ZTable.class).update(DesignPrice.class, effectUp); + } + } + } + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/RefreshWaiveNumTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/RefreshWaiveNumTask.java new file mode 100644 index 0000000..bee4216 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/RefreshWaiveNumTask.java @@ -0,0 +1,61 @@ +package com.zhiqim.yangcai.design.task; + +import java.util.List; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.dbo.design.DesignerGroup; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; + +/** + * + * [简要描述]:可放弃最大订单数定时任务
            + * [详细描述]:
            + * + * @version 1.0 @author Administrator 2021年6月9日 新建与整理 + */ +public class RefreshWaiveNumTask implements Task +{ + private static final Log log = LogFactory.getLog(RefreshWaiveNumTask.class); + + @Override + public void execute() + { + log.info("刷新最大放弃订单数量开始......"); + + try + { + this.updateWaiveNum(); + } + catch (Exception e) + { + log.error("可放弃最大订单数定时任务失败", e); + } + log.info("刷新最大放弃订单数量结束......"); + } + + public void updateWaiveNum() throws Exception + { + List designerGroupList = ORM.get(ZTable.class).list(DesignerGroup.class); + List designerGroupDispatchList = ORM.get(ZTable.class).list(DesignerGroupDispatch.class); + + for (DesignerGroup designerGroup : designerGroupList) + { + for (DesignerGroupDispatch designerGroupDispatch : designerGroupDispatchList) + { + if (designerGroup.getDesignerGroupId() == designerGroupDispatch.getDesignerGroupId()) + { + Updater updater = new Updater(); + updater.addMust("designerGroupId", designerGroup.getDesignerGroupId()); + updater.addField("waiveNum", designerGroup.getMaxWaiveNum()); + ORM.get(ZTable.class).update(DesignerGroupDispatch.class, updater); + } + } + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/RestoreDataTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/RestoreDataTask.java new file mode 100644 index 0000000..f946f32 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/RestoreDataTask.java @@ -0,0 +1,66 @@ +package com.zhiqim.yangcai.design.task; + +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.Maths; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.media.dbo.MediaBg; +import com.zhiqim.media.dbo.MediaCanvas; +import com.zhiqim.media.dbo.MediaCoverMaterial; +import com.zhiqim.media.dbo.MediaMaterial; +import com.zhiqim.media.dbo.MediaMaterialParam; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateView; + +/** + * 恢数据临时修复任务 + * + */ +public class RestoreDataTask implements Task, SignConstants +{ + private static final Log log = LogFactory.getLog(RestoreDataTask.class); + + @Override + public void execute() + { + try + { + log.info("模板库数据清理任务开始"); + long beginTime = System.currentTimeMillis(); + + Selector select = new Selector(); + select.addMust("templateType", 80); + select.addMustThenLE("createTime", "2020-01-01"); + PageResult pageResult = ORM.get(ZView.class).page(MediaTemplateView.class, 1, 2000, select); + List list = pageResult.list(); + for (MediaTemplateView media : list) + { + long mediaId = media.getMediaId(); + ORM.get(ZTable.class).delete(MediaTemplate.class, new Selector("mediaId", mediaId)); + ORM.get(ZTable.class).delete(MediaCoverMaterial.class, new Selector("mediaId", mediaId)); + ORM.get(ZTable.class).delete(MediaBg.class, new Selector("mediaId", mediaId)); + ORM.get(ZTable.class).delete(MediaCanvas.class, new Selector("mediaId", mediaId)); + ORM.get(ZTable.class).delete(MediaMaterial.class, new Selector("mediaId", mediaId)); + ORM.get(ZTable.class).delete(MediaMaterialParam.class, new Selector("mediaId", mediaId)); + } + + long endTime = System.currentTimeMillis(); + log.info("模板库数据清理任务结束,共删除记录:" + list.size() + ",耗时[%s]秒", Maths.division((endTime - beginTime), 1000, 3)); + } + catch (Exception e) + { + log.error("模模板库数据清理任务异常,", e); + } + + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/ScoreDesignerRecordTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/ScoreDesignerRecordTask.java new file mode 100644 index 0000000..cbd1245 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/ScoreDesignerRecordTask.java @@ -0,0 +1,123 @@ +package com.zhiqim.yangcai.design.task; + +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Maths; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.media.manage.utils.CollectionUtils; +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.ScoreDesignerRecordDao; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrderMessage; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordDetail; + +/** + * 设计师积分定时任务 + * + * @version v1.0.0 @author jiangfan 2020-12-24 新建与整理 + */ +public class ScoreDesignerRecordTask implements Task, SignConstants +{ + private static final Log log = LogFactory.getLog(ScoreDesignerRecordTask.class); + + @Override + public void execute() + { + try + { + log.info("设计师积分定时任务开始..."); + long beginTime = System.currentTimeMillis(); + unFinish48Hour();// 场景:48小时未定稿 + unConsumer12Hour();// 场景:代办事项12小时内未处理 + long endTime = System.currentTimeMillis(); + log.info("设计师积分定时任务结束,耗时[%s]秒", Maths.division((endTime - beginTime), 1000, 3)); + } + catch (Exception e) + { + log.error("设计师积分定时任务异常,", e); + } + } + + /** + * 场景:48小时未定稿 + * + * @throws ORMException + * @throws SQLException + */ + public static void unFinish48Hour() throws ORMException, SQLException + { + try + { + Selector selector = new Selector(); + selector.addMustThenGE("createTime", Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringByMonth(1))); + selector.addMustThenLE("designReceiveTime", Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringByHour(48))); + selector.addMustIn("status", StatusConstants.ORDER_30.value(), StatusConstants.ORDER_36.value(), StatusConstants.ORDER_50.value()); + selector.addOrderbyAsc("createTime"); + List designOrderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + if (!CollectionUtils.isEmpty(designOrderList)) + { + for (DesignOrder designOrder : designOrderList) + { + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_101.value())); + scoreDesignerRecordDetail.setOperatorCode(designOrder.getDesigner()); + scoreDesignerRecordDetail.setOrderId(designOrder.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + } + } + catch (Exception e) + { + log.error("场景:48小时未定稿异常", e); + } + } + + /** + * 场景:代办事项12小时内未处理 + * + * @throws ORMException + * @throws SQLException + */ + public static void unConsumer12Hour() throws ORMException, SQLException + { + try + { + Selector selector = new Selector(); + selector.addMust("consumerPlatformType", "DESIGN"); + selector.addMust("consumerCodeType", 0); + selector.addMustThenGE("createTime", Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringByMonth(1))); + selector.addMustThenLE("productionTime", Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringByHour(12))); + selector.addMust("consumerState", 0); + selector.addOrderbyAsc("createTime"); + List orderMessageList = ORM.get(ZTable.class).list(OrderMessage.class, selector); + if (!CollectionUtils.isEmpty(orderMessageList)) + { + for (OrderMessage orderMessage : orderMessageList) + { + ScoreDesignerRecordDetail scoreDesignerRecordDetail = new ScoreDesignerRecordDetail(); + scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants.SCORE_TYPE_102.value())); + scoreDesignerRecordDetail.setOperatorCode(orderMessage.getConsumerCode()); + scoreDesignerRecordDetail.setOrderId(orderMessage.getDesignId()); + ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail); + } + } + } + catch (Exception e) + { + log.error("场景:代办事项12小时内未处理异常", e); + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/SolrDataRefreshTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/SolrDataRefreshTask.java new file mode 100644 index 0000000..1048311 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/SolrDataRefreshTask.java @@ -0,0 +1,35 @@ +package com.zhiqim.yangcai.design.task; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; + +import com.zhiqim.yangcai.util.SolrUtil; + +/*** + * solr数据刷新定时任务 + * + * @author yixin 2020-04-07 15:50:42 + */ +public class SolrDataRefreshTask implements Task, SignConstants +{ + private static final Log log = LogFactory.getLog(SolrDataRefreshTask.class); + + @Override + public void execute() + { + log.info("solr数据刷新定时任务开始..."); + try + { + SolrUtil.refreshSolrData(); + log.info("solr数据刷新定时任务结束"); + } + catch (Exception e) + { + log.error("solr数据刷新定时任务异常", e); + } + + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/SyncRefundDesignOrderTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/SyncRefundDesignOrderTask.java new file mode 100644 index 0000000..39466cb --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/SyncRefundDesignOrderTask.java @@ -0,0 +1,48 @@ +package com.zhiqim.yangcai.design.task; + +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +public class SyncRefundDesignOrderTask implements Task +{ + private static final Log log = LogFactory.getLog(RefreshDesignPriceTask.class); + + @Override + public void execute() + { + log.info("同步订单退款状态定时任务开始。。。"); + try + { + syncRefundDesignOrder(); + } + catch (Exception e) + { + log.error("同步订单退款状态定时任务失败。。。", e); + } + + log.info("同步订单退款状态定时任务结束。。。"); + } + + private void syncRefundDesignOrder() throws Exception{ + Selector selector = new Selector(); + //获取正常状态订单,拿这些订单去查询 + int[] statusArr = {StatusConstants.ORDER_F130.value(),StatusConstants.ORDER_F110.value(),StatusConstants.ORDER_F100.value() + ,StatusConstants.ORDER_34.value(),StatusConstants.ORDER_70.value()}; + selector.addMustNotIn("status", statusArr); // 等待设计 + //selector.addMustThenGE("createTime", timestamp); + selector.addOrderbyAsc("createTime"); + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + } +} \ No newline at end of file diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/TempFileDeleteTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/TempFileDeleteTask.java new file mode 100644 index 0000000..c6c4e27 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/TempFileDeleteTask.java @@ -0,0 +1,117 @@ +package com.zhiqim.yangcai.design.task; + +import java.io.File; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Maths; +import org.zhiqim.kernel.util.Strings; + +import com.zhiqim.yangcai.design.presenter.UploadFilePresenter; + +/*** + * web服务临时文件删除任务,业务场景中触发添加到定时任务池,不需要单独运行 + * + * @version v1.0.0 @author longguizhi 2018-1-15 新建与整理 + */ +public class TempFileDeleteTask implements Task, SignConstants +{ + private static final Log log = LogFactory.getLog(TempFileDeleteTask.class); + + private static TempFileDeleteTask deleteTempFileTask; + private boolean isRunning = false; + + private TempFileDeleteTask() + { + } + + public static TempFileDeleteTask getInstance() + { + synchronized (TempFileDeleteTask.class) + { + if (deleteTempFileTask == null) + { + deleteTempFileTask = new TempFileDeleteTask(); + } + } + return deleteTempFileTask; + } + + public boolean isRunning() + { + return isRunning; + } + + public void setRunning(boolean isRunning) + { + this.isRunning = isRunning; + } + + @Override + public void execute() + { + log.info("临时文件删除任务执行开始..."); + long beginTime = System.currentTimeMillis(); + + int day = Global.getInt("project", "tempFileKeepDay", 0); + int currDate = Ints.toInt(DateTimes.getDateTime8String()); + + File tempRoot = new File(UploadFilePresenter.TEMP_FOLDER); + if (!tempRoot.exists()) + { + return; + } + + try + { + if (tempRoot.isFile()) + { + tempRoot.delete(); + return; + } + + if (tempRoot.isDirectory()) + { + File[] files = tempRoot.listFiles(); + if (null != files) + { + for (File file : files) + { + if (file.isDirectory()) + { + String fileName = file.getName(); + String fileDate = Strings.replace(fileName, UploadFilePresenter.TEMP_FOLDER, ""); + int tempFolderDate = Ints.toInt(fileDate); + if (day == 0) + { + Files.deleteDirectory(file); + } + else if (tempFolderDate < (currDate - day)) + { + Files.deleteDirectory(file); + } + } + else + { + file.delete(); + } + } + } + } + + } + catch (Exception e) + { + log.error("临时文件删除任务执行异常," + e.getMessage(), e); + } + + long endTime = System.currentTimeMillis(); + log.info("临时文件删除任务执行结束,共耗时[%s]秒", Maths.division((endTime - beginTime), 1000, 3)); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/TimeOutRemindTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/TimeOutRemindTask.java new file mode 100644 index 0000000..8df796a --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/design/task/TimeOutRemindTask.java @@ -0,0 +1,217 @@ +package com.zhiqim.yangcai.design.task; + +import java.time.LocalDate; +import java.time.temporal.TemporalAdjusters; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.aliyun.oss.common.utils.StringUtils; +import com.zhiqim.yangcai.design.constant.ScoreConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DispatchDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.ScoreDesignerRecordDao; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.OrderBacklog; +import com.zhiqim.yangcai.design.dbo.score.ScoreDesignerRecordDetail; +import com.zhiqim.yangcai.design.messagebox.ZqmMessageProducerHandler; + +import yangcai.messagebox.constant.MessageSysType; +import yangcai.messagebox.constant.MessageTopicType; +import yangcai.messagebox.model.MessageBusi; +import yangcai.messagebox.model.MessageResult; +import yangcai.messagebox.model.MessageResult.CodeEnum; + +/*** + * 设计订单超时提醒任务 + * + * @author yixin 2019-11-20 15:50:42 + */ +public class TimeOutRemindTask implements Task, SignConstants { + private static final Log log = LogFactory.getLog(TimeOutRemindTask.class); + + @Override + public void execute() { + log.info("设计订单超时提醒任务开始..."); + try { + + /* + * MessageBusi messageBusi = new MessageBusi(); + * messageBusi.setId(String.valueOf(Ids.longId13_4())); + * messageBusi.setProducerOperateType("1"); + * messageBusi.setProducerOperateCode("系统"); + * messageBusi.setProducerOperateName("系统"); + * messageBusi.setConsumerPlatformType(MessageSysType.DESIGN_CODE); + * messageBusi.setConsumerOperateCode(designOrder.getDesigner()); + * messageBusi.setConsumerOperateName(designOrder.getDesigner()); + * messageBusi.setConsumerOperateType("1"); messageBusi.setMessageType(3); + * messageBusi.setOrderId(String.valueOf(designOrder.getDesignId())); + * messageBusi.setTopic(MessageTopicType.TIMEOUT_ORDER); + * messageBusi.setMessageBody("您有一条订单(" + designOrder.getDesignId() + + * ")即将超时,请尽快查看处理!"); HashMap propertyMap = new HashMap(); propertyMap.put("designId", + * String.valueOf(designOrder.getDesignId())); propertyMap.put("title", + * "订单超时提醒"); propertyMap.put("sender", "系统"); // 创建并发送消息 MessageResult + * result = ZqmMessageProducerHandler.sendMessage(messageBusi, propertyMap); if + * (result.getCode().intValue() == CodeEnum.SUCCESS.getCode().intValue()) { + * + * ORM.get(ZTable.class).update(DesignOrder.class, new + * Updater().addMust("designId", + * designOrder.getDesignId()).addField("isTimeOutRemind", true)); + * + * } + */ + doQueryIsShowCost(30); + /* doQueryIsShowCost(50); */ + log.info("设计订单超时提醒任务结束..."); + } catch (Exception e) { + log.error("设计订单超时提醒任务异常", e); + } + + } + + public void doQueryIsShowCost(int num) throws Exception { + + LocalDate today = LocalDate.now(); + + // 获取两个月前的日期 + LocalDate twoMonthsAgo = today.minusMonths(2); + String status = ""; + String tiamName = ""; + if (num == 30) { + status = "初稿"; + tiamName = "DESIGN_BEGIN_TIME"; + } + if (num == 50) { + status = "定稿"; + tiamName = "DESIGN_DRAFT_TIME"; + } + + // 获取两个月前月份的第一天 + LocalDate firstDayOfTwoMonthsAgo = twoMonthsAgo.with(TemporalAdjusters.firstDayOfMonth()); + String sql = "SELECT * FROM design_order WHERE TIMESTAMPDIFF(HOUR, " + tiamName + + ", NOW()) >= 12 and status = " + num + + " and status != 37 and status != 36 and DESIGN_ID not in (select DESIGN_ID from order_backlog where CONSUMER_STATE = " + + num + " and MESSAGE_TYPE = 1 and CREATE_TIME > " + firstDayOfTwoMonthsAgo + + ") and CHECK_BACK_REASON is null and BACK_REASON is null and CREATE_TIME > " + + firstDayOfTwoMonthsAgo; + List afterOrdOrderList = ORM.get(ZSQL.class).executeQuery(sql, DesignOrder.class); + if (afterOrdOrderList != null && !afterOrdOrderList.isEmpty()) { + for (DesignOrder designOrder : afterOrdOrderList) { + + OrderBacklog oreder = new OrderBacklog(); + oreder.setId(Ids.longId13_4()); + oreder.setDesignId(designOrder.getDesignId()); + oreder.setCreateTime(Sqls.nowTimestamp()); + oreder.setMessageType(1); + oreder.setProductionCode(""); + oreder.setMessageBody("您的订单" + designOrder.getDesignId() + "已经超过23小时未" + status + "!!! 请尽快查看处理!"); + oreder.setConsumerCodeType(1); + oreder.setConsumerCode(designOrder.getDesigner()); + oreder.setConsumerState(num); + ORM.get(ZTable.class).insert(oreder); + + } + } + + String sql2 = "SELECT * FROM design_order WHERE TIMESTAMPDIFF(HOUR, " + tiamName + + ", NOW()) > 24 and status != 37 and status != 36 and DESIGN_ID in (select DESIGN_ID from order_backlog where CONSUMER_STATE = " + + num + " and MESSAGE_TYPE = 1 and CREATE_TIME > " + firstDayOfTwoMonthsAgo + + ") and CHECK_BACK_REASON is null and BACK_REASON is null and CREATE_TIME > " + + firstDayOfTwoMonthsAgo; + List afterOrdOrderList2 = ORM.get(ZSQL.class).executeQuery(sql2, DesignOrder.class); + if (afterOrdOrderList2 != null && !afterOrdOrderList2.isEmpty()) { + + for (DesignOrder designOrder : afterOrdOrderList2) { + + OrderBacklog oreder = new OrderBacklog(); + oreder.setId(Ids.longId13_4()); + oreder.setDesignId(designOrder.getDesignId()); + oreder.setCreateTime(Sqls.nowTimestamp()); + oreder.setMessageType(10); + oreder.setProductionCode(""); + oreder.setMessageBody( + "您的订单" + designOrder.getDesignId() + "已经超过48小时未定" + status + "! 已被系统回收!扣除设计师10积分,低于0分无法接单!"); + oreder.setConsumerCodeType(10); + oreder.setConsumerCode(designOrder.getDesigner()); + oreder.setConsumerState(10); + ORM.get(ZTable.class).insert(oreder); + + Updater updater = new Updater(); + updater.addMust("designId", oreder.getDesignId()); + updater.addField("designer", ""); + updater.addField("status", StatusConstants.ORDER_10.value()); + updater.addField("orgId", 0); + ORM.get(ZTable.class).update(DesignOrder.class, updater);// 重置 + + String operatorCode = oreder.getConsumerCode(); + String logItem = "设计师超时,放弃订单"; + + DispatchDao.doUpdateDesignerOrderNum(operatorCode); + + // 扣除积分 + /* + * if(operatorCode.length()>0){ + * + * ScoreDesignerRecordDetail scoreDesignerRecordDetail = new + * ScoreDesignerRecordDetail(); + * scoreDesignerRecordDetail.setScoreType(Long.valueOf(ScoreConstants. + * SCORE_TYPE_108.value())); + * scoreDesignerRecordDetail.setOperatorCode(operatorCode); + * scoreDesignerRecordDetail.setCreateOperator("系统"); + * scoreDesignerRecordDetail.setRemark("设计师设计超时,放弃订单"); + * scoreDesignerRecordDetail.setScore(-10); + * scoreDesignerRecordDetail.setOrderId(designOrder.getDesignId()); + * ScoreDesignerRecordDao.addScoreDesignerRecordDetail(scoreDesignerRecordDetail + * ); + * + * OrderLogDao.saveOrderOperateLog(oreder.getDesignId(), + * oreder.getConsumerCode(), logItem, EventConstants.ORDER_38.value()); + * + * } + */ + } + + } + + String sql1 = "select * from order_backlog where CONSUMER_STATE = " + num + + " and MESSAGE_TYPE = 1 and DESIGN_ID in (SELECT DESIGN_ID FROM design_order WHERE status > " + + num + " or status =10 and status != 37 and status != 36 and CREATE_TIME > " + firstDayOfTwoMonthsAgo + + ") and CREATE_TIME > " + firstDayOfTwoMonthsAgo; + // 状态为处理完成 + List afterOrdOrderList1 = ORM.get(ZSQL.class).executeQuery(sql1, OrderBacklog.class); + if (afterOrdOrderList1 != null && !afterOrdOrderList1.isEmpty()) { + List ids = new ArrayList<>(); + for (OrderBacklog orderBacklog : afterOrdOrderList1) { + ids.add(String.valueOf(orderBacklog.getDesignId())); + + } + String inClause = String.join(",", ids); + + String update1 = "update order_backlog set MESSAGE_TYPE = 2 where DESIGN_ID in (" + inClause + ")"; + ORM.get(ZSQL.class).executeUpdate(update1); + + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/dao/DesignerGroupDispatchAnalysisDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/dao/DesignerGroupDispatchAnalysisDao.java new file mode 100644 index 0000000..4e2e2f9 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/dao/DesignerGroupDispatchAnalysisDao.java @@ -0,0 +1,726 @@ +package com.zhiqim.yangcai.dispatch.dao; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.cache.DesignMerchantCache; +import com.zhiqim.yangcai.cache.OrgCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignOrgMer; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.dispatch.model.AnalysisResult; +import com.zhiqim.yangcai.dispatch.model.DesignOrgMerModule; +import com.zhiqim.yangcai.dispatch.model.DesignerGroupAnalysisResult; +import com.zhiqim.yangcai.dispatch.model.DesignerGroupMerDispatchAnalysisModule; +import com.zhiqim.yangcai.dispatch.model.DesignerScoreModel; +import com.zhiqim.yangcai.dispatch.model.MerDispatchAnalysisModule; +import com.zhiqim.yangcai.dispatch.model.ReceiveTimeModel; +import com.zhiqim.yangcai.util.DesignerGroupDispatchUtil; + +/** + * [简要描述]:订单分拣派单分析
            + * [详细描述]:
            + * + * @version 1.0 @author yixin 2020-11-21 新建与整理 + */ +@AnAlias("DesignerGroupDispatchAnalysisDao") +public class DesignerGroupDispatchAnalysisDao +{ + private static final Log log = LogFactory.getLog(DesignerGroupDispatchAnalysisDao.class); + + /** + * 订单分拣派单分析 + * + * @param order + * @param merModuleAllList + * @return + * @throws Exception + */ + public static DesignerGroupAnalysisResult doAnalysis(DesignOrder order, List merList) throws Exception + { + OrgCache orgCache = Global.get(OrgCache.class); + orgCache = orgCache != null ? orgCache : new OrgCache(); + + DesignerGroupAnalysisResult orderResult = new DesignerGroupAnalysisResult(); + orderResult.setDesignId(order.getDesignId()); + List list = new ArrayList(); + Map merMap = new LinkedHashMap(); + orderResult.setMerAnalysisList(list); + + // 0. 分析组织维度接单规则是否匹配 + List successMerModuleList = new ArrayList(); + for (DesignOrgMerModule mer : merList) + { + DesignerGroupMerDispatchAnalysisModule module = DesignerGroupDispatchUtil.isMerchantSupport(order, mer); + list.add(module); + if (module.isSuccess()) + { + module.setMerMsg("商户匹配成功"); + successMerModuleList.add(module.getOrgId()); + } + else + { + log.info("分拣分析:订单号【" + order.getDesignId() + "】分拣商户" + mer.getOrgName() + "失败:" + Jsons.toString(module.getResultList())); + } + + merMap.put(mer.getOrgId(), module); + } + + if (Validates.isEmpty(successMerModuleList)) + { + return orderResult; + } + + // 1. AB单设计师匹配,和老用户订单规则类似,差异如下: + // a.匹配12小时之内是否有设计师接单记录 + // b.匹配设计师如果在线直接派单,不考虑其他规则 + ZmrOperator abUser = DesignerGroupDispatchUtil.isABOrder(order); + if (abUser != null) + { + // 设置派送结果 + orderResult.setDesigner(abUser.getOperatorCode()); + orderResult.setDispatchMerOrgId(abUser.getOrgId()); + orderResult.setOldUser(true); + orderResult.setDispatchMsg("订单[" + order.getDesignId() + "]通过[AB单]分析派送给[" + orgCache.name(abUser.getOrgId()) + "]设计师:" + abUser.getOperatorCode()); + return orderResult; + } + else + { + log.info("分拣分析:订单号【" + order.getDesignId() + "】非AB单或设计师不在线"); + } + + // 2.获取到所有符合接单条件的设计师 + String orgIds = StringUtils.join(successMerModuleList, ","); + String sql = DesignerGroupDispatchUtil.getEligibleDesignerSql(orgIds, order); + List resultList = ORM.get(ZSQL.class).executeQuery(sql, String.class); + + // 3. 老用户设计师匹配,查询12小时之外的历史订单,并匹配接单规则 + ZmrOperator oldUser = DesignerGroupDispatchUtil.isOldUserOrder(order); + if (oldUser != null && resultList.contains(oldUser.getOperatorCode())) + { + // 设置派送结果 + orderResult.setDesigner(oldUser.getOperatorCode()); + orderResult.setDispatchMerOrgId(oldUser.getOrgId()); + orderResult.setOldUser(true); + orderResult + .setDispatchMsg("订单[" + order.getDesignId() + "]通过[老用户]分析派送给[" + orgCache.name(oldUser.getOrgId()) + "]设计师:" + oldUser.getOperatorCode()); + return orderResult; + } + else + { + log.info("分拣分析:订单号【" + order.getDesignId() + "】未通过[老用户]分拣派送"); + } + + // 4.接单量匹配 + if (Validates.isNotEmpty(resultList)) + { + List designerScores = DesignerGroupDispatchUtil.doOrderNumberFilter(resultList, merMap, order); + if (Validates.isNotEmpty(designerScores) && designerScores.get(0).isSuccess()) + { + // 成功后设置派送结果 + DesignerScoreModel score = designerScores.get(0); + orderResult.setDispatchMerOrgId(score.getOrgId()); + orderResult.setDesigner(score.getOperatorCode()); + orderResult + .setDispatchMsg("订单[" + order.getDesignId() + "]通过[自动派单]分析派送给[" + orgCache.name(score.getOrgId()) + "]设计师:" + score.getOperatorCode()); + } + else if (Validates.isNotEmpty(designerScores)) + { + String failedMsg = ""; + for (DesignerScoreModel designerScoreModel : designerScores) + { + failedMsg += Jsons.toString(designerScoreModel.getResultList()); + } + log.info("分拣分析:订单号【" + order.getDesignId() + "】未找到符合派送条件设计师,原因:" + failedMsg); + } + } + + // 设置组织分析列表 + orderResult.setMerAnalysisList(list); + return orderResult; + } + + /**** + * 商户分拣分析基础方法 + * + * @param order 订单对象 + * @param sysAfterList 系统后加工 + * @param sysShopList 系统店铺 + * @param analysisMer 需要与订单匹配的接单商户 + * @param orgName 组织名 + * @param otherMsg 其他描述信息 + * @return + * @throws Exception + */ + public static MerDispatchAnalysisModule doAnalysisMer(DesignOrder order, DesignOrgMerModule analysisMer, String orgName, String otherMsg) throws Exception + { + String industryName = Global.get(DesignIndustryCache.class).getIndustryName(order.getIndustryId()); + String typeName = DesignTypeDao.name(order.getTypeId()); + MerDispatchAnalysisModule module = new MerDispatchAnalysisModule(); + module.setOrgName(orgName); + module.setAnalysisMer(analysisMer); + + // 1商户是否停用 + if (analysisMer.getMerStatus() == 1) + { + AnalysisResult result = new AnalysisResult(false, "商户停用"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户正常使用"); + module.addResult(result); + } + + // 是否支持优质客户订单 + if (order.isHighQualityOrder() && !analysisMer.isHighQualityOrder()) + { + AnalysisResult result = new AnalysisResult(false, "商户不支持优质客户订单"); + module.addResult(result); + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else if (order.isHighQualityOrder() && analysisMer.isHighQualityOrder()) + { + AnalysisResult result = new AnalysisResult(true, "商户支持优质客户订单"); + module.addResult(result); + } + + // 1.5商户是支持订单稿件类型 + if (order.getDraftType() == DraftConstants.DRAFT_STANDARD.value() && analysisMer.isNormDraftOrder()) + { + AnalysisResult result = new AnalysisResult(true, "商户支持标准自来稿"); + module.addResult(result); + } + else if (order.getDraftType() == DraftConstants.DRAFT_TEMPLATE.value() && analysisMer.isDraftOrder()) + { + AnalysisResult result = new AnalysisResult(true, "商户支持改稿自来稿"); + module.addResult(result); + } + else if (order.getDraftType() == DraftConstants.DRAFT_COMMON_DESIGN.value() && analysisMer.isDesignOrder()) + { + AnalysisResult result = new AnalysisResult(true, "商户支持普通设计稿"); + module.addResult(result); + } + else if (order.getDraftType() == DraftConstants.DRAFT_PAGE_DESIGN.value() && analysisMer.isSeniorDesignOrder()) + { + AnalysisResult result = new AnalysisResult(true, "商户支持资深设计稿"); + module.addResult(result); + } + else + { + AnalysisResult result = new AnalysisResult(false, "商户不支持的稿件类型"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + + // 2.检查商户是否是 停止接单 + if (analysisMer.isPauseRecieive()) + { + AnalysisResult result = new AnalysisResult(false, "商户停止接单"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户正在接单中"); + module.addResult(result); + } + + // //是否在接单时间内 [] + if (Validates.isNotEmpty(analysisMer.getRecieiveTime())) + { + if (!isRecieiveTime(analysisMer)) + { + AnalysisResult result = new AnalysisResult(false, "当前时间不在商户接单时间内"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + } + + // 3.商户最大金额 + if (order.getAmount() > analysisMer.getMaxOrderAmount()) + { + AnalysisResult result = new AnalysisResult(false, "订单金额[" + Amounts.toYuanMustRadix(order.getAmount()) + "]超出" + + (Validates.isNotEmptyBlank(otherMsg) ? otherMsg : "") + "接单商户最大金额[" + Amounts.toYuanMustRadix(analysisMer.getMaxOrderAmount()) + "]"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else if (order.getAmount() < analysisMer.getMinOrderAmount()) + { + AnalysisResult result = new AnalysisResult(false, "订单金额[" + Amounts.toYuanMustRadix(order.getAmount()) + "]低于" + + (Validates.isNotEmptyBlank(otherMsg) ? otherMsg : "") + "接单商户最小金额[" + Amounts.toYuanMustRadix(analysisMer.getMinOrderAmount()) + "]"); + module.addResult(result); + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "订单金额[" + Amounts.toYuanMustRadix(order.getAmount()) + "]在商户订单金额[" + + Amounts.toYuanMustRadix(analysisMer.getMinOrderAmount()) + "-" + Amounts.toYuanMustRadix(analysisMer.getMaxOrderAmount()) + "]限制范围内"); + module.addResult(result); + } + + // 4.加急单 + if (order.isUrgent()) + { + if (!analysisMer.isUrgent()) + { + AnalysisResult result = new AnalysisResult(false, "不支持[加急]单"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户当前支持[加急]单"); + module.addResult(result); + } + } + + // 5.不支持异形订单、多模、超过3款,查找下一家 系统不分拣,订单 款x模 > 20,即:多模、超过10款订单 + if ((order.getPrintWidth() > 0 || order.getPrintHeight() > 0)) + { + if (!analysisMer.isSpecial()) + { + AnalysisResult result = new AnalysisResult(false, "接单商户不支持异形"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户当前支持异形"); + module.addResult(result); + } + } + + // 7.店铺支持判断 + List shopList = Lists.toStringList(analysisMer.getOrderShop()); + boolean flag = false; + String shopNick = order.getShopNick(); + String businessMerchantIds = Global.getString("businessPlatform", "ids"); + // 淘印的订单,当做一个店铺来匹配派送规则 + String tmpMerchantId = "," + order.getMerchantId() + ","; + if (businessMerchantIds.indexOf(tmpMerchantId) > -1) + { + // 生产环境:1920862616055,测试环境:1823193227002 + DesignMerchantCache merchantCache = Global.get(DesignMerchantCache.class); + merchantCache = merchantCache != null ? merchantCache : new DesignMerchantCache(); + shopNick = merchantCache.getName(order.getMerchantId()); + } + + for (String shop : shopList) + { + if (Strings.trim(shop).equals(shopNick)) + { + flag = true; + break; + } + } + + if (!flag) + { // 不支持店铺 查找下一家 + AnalysisResult result = new AnalysisResult(false, + "不支持订单店铺[" + Strings.trim(shopNick, "") + "]当前商户支持的店铺[" + Strings.trim(analysisMer.getOrderShop(), "") + "]"); + module.addResult(result); + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户支持订单店铺[" + Strings.trim(shopNick, "") + "]"); + module.addResult(result); + } + + // 8.产品类型判断 + boolean typeflag = false; + for (Long tempId : Lists.toLongList(analysisMer.getDesignTypeIds())) + { + if (tempId == order.getTypeId()) + { + typeflag = true; + break; + } + } + + if (!typeflag) + { + AnalysisResult result = new AnalysisResult(false, "接单商户不支持[" + typeName + "]类型订单"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户支持[" + typeName + "]类型订单"); + module.addResult(result); + } + + // 9.行业判断 + boolean industryflag = false; + for (Long tempId : Lists.toLongList(analysisMer.getIndustryIds())) + { + if (tempId == order.getIndustryId()) + { + industryflag = true; + break; + } + } + + if (!industryflag) + { + AnalysisResult result = new AnalysisResult(false, "接单商户不支持[" + industryName + "]订单行业"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户支持[" + industryName + "]行业订单"); + module.addResult(result); + } + + // 9.超出最大遗留数 不派送,老客户不考虑该条件 + // 查询订单遗留数 + int leaveOverCount = getPrevMerLeaveOverCount(analysisMer); + // 获取 商户接单时间段 + int defaultNum = analysisMer.getMerMaxWaitOrder(); + + int receiveTimeNum = -1; + String msg = ""; + ReceiveTimeModel receiveTimeModel = getRecieiveTimeMaxLeave(analysisMer); + + if (receiveTimeModel != null) + { + receiveTimeNum = receiveTimeModel.getReceiveTimeNum(); + msg = "(当前最大限制取商户在[" + receiveTimeModel.getReceiveTimeBegin() + "-" + receiveTimeModel.getReceiveTimeEnd() + "]时段限制数)"; + } + else + { + msg = "(当前最大限制取商户最大遗留数)"; + receiveTimeNum = defaultNum; + } + + long oldMerId = getOldMer(order); + boolean isOldUser = analysisMer.getOrgId() == oldMerId; + if (isOldUser) + {// 超出最大遗留数 不派送,老客户不考虑该条件 + AnalysisResult result = new AnalysisResult(true, "老用户组织不考虑订单遗留数,当前遗留数[" + leaveOverCount + "]在正常范围内,最大限制[" + receiveTimeNum + "]" + msg); + module.addResult(result); + } + else + { + if (leaveOverCount >= receiveTimeNum) + { + AnalysisResult result = new AnalysisResult(false, "接单商户超出或等于最大未领数,当前遗留数:[" + leaveOverCount + "]最大限制[" + receiveTimeNum + "] " + msg); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + // 不是加急订单时判断普通订单是否已满 + else if (!order.isUrgent()) + { + // 当前普通订单遗留单量 + int ordinaryLeaveOverCount = getPrevMerLeaveOrdinaryOverCount(analysisMer); + int merMaxOrdinaryOrder = analysisMer.getMerMaxOrdinaryOrder(); + if (ordinaryLeaveOverCount >= merMaxOrdinaryOrder) + { + AnalysisResult result = new AnalysisResult(false, + "接单商户普通订单超出或等于最大未领数,当前遗留数:[" + ordinaryLeaveOverCount + "]最大限制[" + merMaxOrdinaryOrder + "] "); + module.addResult(result); + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户当前普通订单未领(未领)数[" + ordinaryLeaveOverCount + "]在正常范围内,最大限制[" + merMaxOrdinaryOrder + "]"); + module.addResult(result); + } + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户当前未领(未领)数[" + leaveOverCount + "]在正常范围内,最大限制[" + receiveTimeNum + "]" + msg); + module.addResult(result); + } + } + + // 10.超出最大接单量 不派送,老客户不考虑该条件 + List molist = getCurMerOrderList(analysisMer); + if (isOldUser) + {// 老用户 组织不考虑 + AnalysisResult result = new AnalysisResult(true, "老用户组织不考虑接单量条件,当前接单量[" + molist.size() + "]在正常范围内,最大预约单量[" + analysisMer.getMerMaxOrder() + "]"); + module.addResult(result); + } + else + { + + if (analysisMer.getOnlineDesignerCount() == 0) + { + AnalysisResult result = new AnalysisResult(false, "接单商户无设计师在线"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else if (molist.size() >= analysisMer.getMerMaxOrder()) + { + AnalysisResult result = new AnalysisResult(false, "接单商户超出或等于最大预约单量[" + analysisMer.getMerMaxOrder() + "]当前商户单量:" + molist.size()); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户当前接单量[" + molist.size() + "]在正常范围内,最大预约单量[" + analysisMer.getMerMaxOrder() + "]"); + module.addResult(result); + } + } + + // 11.后加工判断 + List orderAfters = Lists.toStringList(order.getAfterNames()); + List unafter = new ArrayList(); + String merAfter = analysisMer.getAfterNames(); + if (Validates.isNotEmptyBlank(order.getAfterNames())) + { + if (Validates.isEmptyBlank(merAfter)) + { + unafter.addAll(orderAfters); + } + else + { + for (String after : orderAfters) + { + + if (merAfter.indexOf(after) == -1) + { + unafter.add(after); + } + } + } + } + + if (unafter.size() > 0) + {// 又不支持的 后加工 + AnalysisResult result = new AnalysisResult(false, + "接单商户不支持后加工[" + Lists.toString(unafter) + "]当前商户后加工[" + merAfter + "]订单后加工[" + order.getAfterNames() + "]"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + + if (orderAfters.size() > 0 && unafter.size() == 0) + { + AnalysisResult result = new AnalysisResult(true, "商户支持订单后加工[" + order.getAfterNames() + "]当前商户后加工[" + merAfter + "]"); + module.addResult(result); + } + + // 12.判断是否成功匹配 + boolean endflag = true;// 默认是成功的 + List resutList = module.getResultList(); + for (AnalysisResult result : resutList) + { + if (!result.isSuccess()) + { + endflag = false; + break; + } + } + + module.setMerMsg(otherMsg + "[" + orgName + "]" + (endflag == true ? "成功匹配" : "匹配失败"));// 成功描述 + module.setSuccess(endflag);// 最后结果 + return module; + } + + /**** + * 获取老用户组织 + * + * @param order + * @throws SQLException + * @throws ORMException + */ + public static long getOldMer(DesignOrder order) throws Exception + { + Selector selector = new Selector(); + selector.addMustThenG("orgId", 0); + selector.addMust("buyerNick", order.getBuyerNick()); + selector.addMustNotEqual("designId", order.getDesignId()); // 排除自己 + selector.addOrderbyDesc("createTime"); + PageResult result = ORM.get(ZTable.class).page(DesignOrder.class, 1, 10, selector); + if (result.isEmpty()) + { + return -1; + } + + for (DesignOrder ord : result.list()) + { + if (ord.getTypeId() == order.getTypeId()) + { + return ord.getOrgId(); + } + } + + return result.list().get(0).getOrgId(); + } + + /*** + * 查询接单商户订单遗留订单数 + * + * @throws SQLException + * @throws ORMException + */ + public static int getPrevMerLeaveOverCount(DesignOrgMer mer) throws Exception + { + Selector selector = new Selector(); + selector.addMust("orgId", mer.getOrgId()); + selector.addMust("status", StatusConstants.ORDER_20.value()); + selector.addMustIsNull("designer");// 没有设计师 + selector.addMustIsNull("designReceiveTime");// 领单时间为空 + return ORM.get(ZTable.class).count(DesignOrder.class, selector); + } + + /*** + * 查询接单商户普通订单遗留订单数 + * + * @throws SQLException + * @throws ORMException + */ + public static int getPrevMerLeaveOrdinaryOverCount(DesignOrgMer mer) throws Exception + { + Selector selector = new Selector(); + selector.addMust("orgId", mer.getOrgId()); + selector.addMust("status", StatusConstants.ORDER_20.value()); + selector.addOr(new Selector().addMaybeIsEmpty("isUrgent").addMaybeNotIn("isUrgent", 1)); + selector.addMustIsNull("designer");// 没有设计师 + selector.addMustIsNull("designReceiveTime");// 领单时间为空 + return ORM.get(ZTable.class).count(DesignOrder.class, selector); + } + + /** + * 查询当天商户订单列表 + * + * @throws SQLException + * @throws ORMException + */ + public static List getCurMerOrderList(DesignOrgMer mer) throws Exception + { + Selector selector = new Selector(); + selector.addMust("orgId", mer.getOrgId()); + selector.addMustThenGE("orgReceiveTime", Sqls.toTimestamp(DateTimes.getDateString(), "00:00:00")); + selector.addMustThenLE("orgReceiveTime", Sqls.toTimestamp(DateTimes.getDateString(), "23:59:59")); + selector.addOrderbyAsc("orgReceiveTime"); + return ORM.get(ZTable.class).list(DesignOrder.class, selector); + } + + /** + * 判断是否在接单时间段 + * + * @param mer 接单商户 + * @return 没设置 返回 true + */ + public static boolean isRecieiveTime(DesignOrgMer mer) + { + if (Validates.isNotEmpty(mer.getRecieiveTime())) + {// 设置了时间段 + int curTime = DateTimes.getCurrentHour() * 100 + DateTimes.getCurrentMinute(); + + List modelList = Jsons.toList(mer.getRecieiveTime(), ReceiveTimeModel.class); + for (ReceiveTimeModel model : modelList) + { + int timeBegin = Ints.toInt(model.getReceiveTimeBegin().replace(":", "")); + int timeEnd = Ints.toInt(model.getReceiveTimeEnd().replace(":", "")); + + if (timeBegin < curTime && curTime < timeEnd) + { + return true; + } + } + + if (modelList.size() == 0) + { + return true; + } + else + { + return false; + } + } + else + { + return true; + } + } + + /*** + * 查询商户接单时间段的最大接遗留单量 model 对象 + * + * @param mer 接单商户 + * @return 返回 -1 表示 该商户没有配置 阶段时间段 + */ + public static ReceiveTimeModel getRecieiveTimeMaxLeave(DesignOrgMer mer) + { + if (Validates.isNotEmpty(mer.getRecieiveTime())) + { + int curTime = DateTimes.getCurrentHour() * 100 + DateTimes.getCurrentMinute(); + + List modelList = Jsons.toList(mer.getRecieiveTime(), ReceiveTimeModel.class); + for (ReceiveTimeModel model : modelList) + { + int timeBegin = Ints.toInt(model.getReceiveTimeBegin().replace(":", "")); + int timeEnd = Ints.toInt(model.getReceiveTimeEnd().replace(":", "")); + + if (timeBegin < curTime && curTime <= timeEnd && model.getReceiveTimeNum() > 0) + { + return model; + } + } + } + + return null; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/dao/DispatchParamDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/dao/DispatchParamDao.java new file mode 100644 index 0000000..5926928 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/dao/DispatchParamDao.java @@ -0,0 +1,226 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.dispatch.dao; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrParam; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.dbo.design.DesignOrgMer; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + + +/** + * 查询配置参数Dao + * + * @version v1.0.0 @author Deng 2018-1-25 新建与整理 + */ +public class DispatchParamDao +{ + /** + * 判断是否需要待指定订单 + * @param order + * @return + * @throws Exception + */ + public static boolean isOrderStay(DesignOrder order)throws Exception + { + Selector selector = new Selector(); + selector.addMust("paramGroup", "yangcai.design"); + selector.addMust("paramKey", "stayIndustry"); + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, selector); + if (param == null) + return false; + + if (Validates.isEmpty(param.getParamValue())) + return false; + + String[] indStr = param.getParamValue().split(","); + for (String ind : indStr) + { + if (ind.equals("" + order.getIndustryId())) + return true; + } + + return false; + } + + /** + * 派单最大值 + * @return + * @throws Exception + */ + public static int maxOrderNumber(long orgId)throws Exception + { + DesignOrgMer mer = ORM.get(ZTable.class).item(DesignOrgMer.class, orgId); + if(mer == null) + return 0; + + return mer.getPersonalMaxOrder(); + } + + /** + * 主产品类型基础分 + * @return + * @throws Exception + */ + public static int majorTypeScore()throws Exception + { + + Selector selector = new Selector(); + selector.addMust("paramGroup", "yangcai.design"); + selector.addMust("paramKey", "majorTypeScore"); + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, selector); + + return Integer.parseInt(param.getParamValue()); + } + + /** + * 副产品类型基础分 + * @return + * @throws Exception + */ + public static int secondaryTypeScore()throws Exception + { + + Selector selector = new Selector(); + selector.addMust("paramGroup", "yangcai.design"); + selector.addMust("paramKey", "secondaryTypeScore"); + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, selector); + + return Integer.parseInt(param.getParamValue()); + } + + /** + * 单量评分最大值 + * @return + * @throws Exception + */ + public static int orderNumberMaxScore()throws Exception + { + + Selector selector = new Selector(); + selector.addMust("paramGroup", "yangcai.design"); + selector.addMust("paramKey", "orderNumberMaxScore"); + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, selector); + + return Integer.parseInt(param.getParamValue()); + } + + /** + * 单量评分最小值 + * @return + * @throws Exception + */ + public static int orderNumberMinScore()throws Exception + { + + Selector selector = new Selector(); + selector.addMust("paramGroup", "yangcai.design"); + selector.addMust("paramKey", "orderNumberMinScore"); + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, selector); + + return Integer.parseInt(param.getParamValue()); + } + + /** + * 单量变化因子(向下变化,减小) + * @return + * @throws Exception + */ + public static String orderNumberFactor()throws Exception + { + + Selector selector = new Selector(); + selector.addMust("paramGroup", "yangcai.design"); + selector.addMust("paramKey", "orderNumberFactor"); + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, selector); + + return param.getParamValue(); + } + + /** + * 主行业基础分 + * @return + * @throws Exception + */ + public static int majorIndustryScore()throws Exception + { + + Selector selector = new Selector(); + selector.addMust("paramGroup", "yangcai.design"); + selector.addMust("paramKey", "majorIndustryScore"); + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, selector); + + return Integer.parseInt(param.getParamValue()); + } + + /** + * 副行业基础分 + * @return + * @throws Exception + */ + public static int secondaryIndustryScore()throws Exception + { + + Selector selector = new Selector(); + selector.addMust("paramGroup", "yangcai.design"); + selector.addMust("paramKey", "secondaryIndustryScore"); + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, selector); + + return Integer.parseInt(param.getParamValue()); + } + + /** + * 设计师联系客户时间 + * @return + * @throws Exception + */ + public static int designerContactTime()throws Exception + { + Selector selector = new Selector(); + selector.addMust("paramGroup", "yangcai.design"); + selector.addMust("paramKey", "designerContactTime"); + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, selector); + + return Integer.parseInt(param.getParamValue()); + } + + /**商户订单分拣 普通订单是否按录单时间升序 未设置参数时返回 false*/ + public static boolean isGeneralOrderMerDispatchOrderByCreateTimeAsc()throws Exception + { + Selector selector = new Selector(); + selector.addMust("paramGroup", "yangcai.design"); + selector.addMust("paramKey", "generalOrdMerDisIsCreateTimeAsc"); + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, selector); + if (param == null) + return false; + + return "true".equalsIgnoreCase(Strings.trim(param.getParamValue())); + } + + /**设计师派单 普通订单是否按录单时间升序, 未设置参数时返回 false*/ + public static boolean isGeneralOrderDesignerDispatchOrderByCreateTimeAsc()throws Exception + { + Selector selector = new Selector(); + selector.addMust("paramGroup", "yangcai.design"); + selector.addMust("paramKey", "generalOrdDesDisIsCreateTimeAsc"); + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, selector); + if (param == null) + return false; + + return "true".equalsIgnoreCase(Strings.trim(param.getParamValue())); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/dao/DispatchTaskDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/dao/DispatchTaskDao.java new file mode 100644 index 0000000..103875d --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/dao/DispatchTaskDao.java @@ -0,0 +1,86 @@ +package com.zhiqim.yangcai.dispatch.dao; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.httpclient.HttpRMI; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * + * 派单任务Dao + * + * @version v1.0.0 @author Deng 2017-9-14 新建与整理 + */ +public class DispatchTaskDao +{ + /** + * 查询老用户订单 + * + * @param order + * @param orgId + * @return 设计师 + * @throws Exception + */ + public static String isOldUserOrder(DesignOrder order) throws Exception + { + Selector selector = new Selector(); + selector.addMust("buyerNick", order.getBuyerNick()); + selector.addMustIsNotNull("designer"); + selector.addMustNotEqual("designId", order.getDesignId()); // 排除自己 + selector.addMustThenGE("status", StatusConstants.ORDER_30.value()); + selector.addOrderbyDesc("createTime"); + PageResult result = ORM.get(ZTable.class).page(DesignOrder.class, 1, 10, selector); + if (result.isEmpty()) + { + return ""; + } + + for (DesignOrder ord : result.list()) + { + if (ord.getTypeId() == order.getTypeId()) + { + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, ord.getDesigner()); + // 订单对应的设计师判断:找不到对应的操作员信息,或者操作员被停用 + if (operator == null || operator.getOperatorStatus() == 1) + { + continue; + } + else + { + return ord.getDesigner(); + } + } + } + return ""; + } + + /** + * websocket下发通知(notification方式)消息 + * + * @param sessionUserList + * @param operatorCode + * @param orderBill + */ + public static void doDispatchSendMsg(String sessionId, DesignOrder orderBill) + { + String text = "你有新的订单:\n" + orderBill.getOrderText(); + String rmiIp = Global.getString("dispatch", "rmi_dispatch"); + + HttpRMI conn = new HttpRMI(rmiIp); + conn.setConnectTimeout(10); + conn.setReadTimeout(30); + conn.setKeySecret("designer", "root"); + conn.setClassName("DesignerNoticePresenter"); + conn.setMethodName("doDispatchNotice"); + conn.addParam(sessionId); + conn.addParam(text); + conn.execute(); + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/dao/MerDispatchAnalysisDao.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/dao/MerDispatchAnalysisDao.java new file mode 100644 index 0000000..065a840 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/dao/MerDispatchAnalysisDao.java @@ -0,0 +1,707 @@ +package com.zhiqim.yangcai.dispatch.dao; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.cache.DesignMerchantCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dbo.design.DesignOrgMer; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.dispatch.model.AnalysisOrderResult; +import com.zhiqim.yangcai.dispatch.model.AnalysisResult; +import com.zhiqim.yangcai.dispatch.model.DesignOrgMerModule; +import com.zhiqim.yangcai.dispatch.model.MerDispatchAnalysisModule; +import com.zhiqim.yangcai.dispatch.model.ReceiveTimeModel; + +/** 分拣分析dao 类 **/ +@AnAlias("MerDispatchAnalysisDao") +public class MerDispatchAnalysisDao +{ + + /**** + * 订单分拣 分析 + * + * @param order + * @param merModuleAllList + * @return + * @throws Exception + */ + public static AnalysisOrderResult doAnalysis(DesignOrder order, List merList) throws Exception + { + Map merMap = new LinkedHashMap(); + for (DesignOrgMerModule mer : merList) + { + merMap.put(mer.getOrgId(), mer); + } + + List merModuleList = new ArrayList(); + for (DesignOrgMerModule mer : merMap.values()) + { + DesignOrgMerModule m = new DesignOrgMerModule(); + Objects.copyDeep(mer, m); + merModuleList.add(m); + } + // 0.将商户 分拣优先级排序升序 + Collections.sort(merModuleList); + + boolean isNormDraftTemplate = false; + if (order.getDraftType() == DraftConstants.DRAFT_STANDARD.value()) + {// 标准自来稿 + isNormDraftTemplate = true; + } + + boolean isDraftTemplate = false; + if (order.getDraftType() == DraftConstants.DRAFT_TEMPLATE.value()) + {// 改稿自来稿 + isDraftTemplate = true; + } + + AnalysisOrderResult orderResult = new AnalysisOrderResult(); + orderResult.setDesignId(order.getDesignId()); + + // 1.查询订单对应的老用户商户 + List list = new ArrayList(); + long merId = getOldMer(order);// 判断是不是老用户订单 + DesignOrgMerModule oldMer = null; + Iterator it = merModuleList.iterator(); + while (it.hasNext()) + { + DesignOrgMerModule t = it.next(); + // 如果支持该类型的订单 + if ((isNormDraftTemplate && t.isNormDraftOrder()) || (isDraftTemplate && t.isDraftOrder()) + || (!isNormDraftTemplate && !isDraftTemplate && t.isDesignOrder())) + { + // 非优质订单或者组织支持优质订单 + if (!order.isHighQualityOrder() || (order.isHighQualityOrder() && t.isHighQualityOrder())) + { + if (t.getOrgId() == merId) + {// 查找老组织从列表剔除 + oldMer = t; + it.remove(); + } + } + } + } + + // 1.1先匹配老用户 组织 + if (oldMer != null) + { + MerDispatchAnalysisModule module = doAnalysisMer(order, oldMer, oldMer.getOrgName(), "[老用户组织]"); + list.add(module); + if (module.isSuccess()) + { + orderResult.setDispatchMsg("订单[" + order.getDesignId() + "]通过分析,派送给老用户组织[" + oldMer.getOrgName() + "]"); + orderResult.setDispatchMer(oldMer);// 设置商户派单商户 + // 设置商户分析列表 + orderResult.setMerAnalysisList(list); + return orderResult; + } + } + + // 2.匹配其他商户组织 + for (DesignOrgMerModule analysisMer : merModuleList) + { + MerDispatchAnalysisModule module = doAnalysisMer(order, analysisMer, analysisMer.getOrgName(), "[普通组织]"); + list.add(module); + + // 订单 已经有派送给其他组织商户 + if (orderResult.getDispatchMer() != null) + { + continue; + } + + if (module.isSuccess()) + {// 成功分析 + orderResult.setDispatchMsg("订单[" + order.getDesignId() + "]通过分析,派送普通组织[" + analysisMer.getOrgName() + "]"); + orderResult.setDispatchMer(analysisMer);// 设置商户派单商户 + break; + } + } + // 设置商户分析列表 + orderResult.setMerAnalysisList(list); + return orderResult; + } + + /**** + * 商户分拣分析基础方法 + * + * @param order 订单对象 + * @param sysAfterList 系统后加工 + * @param sysShopList 系统店铺 + * @param analysisMer 需要与订单匹配的接单商户 + * @param orgName 组织名 + * @param otherMsg 其他描述信息 + * @return + * @throws Exception + */ + public static MerDispatchAnalysisModule doAnalysisMer(DesignOrder order, DesignOrgMerModule analysisMer, String orgName, String otherMsg) throws Exception + { + String industryName = Global.get(DesignIndustryCache.class).getIndustryName(order.getIndustryId()); + String typeName = DesignTypeDao.name(order.getTypeId()); + MerDispatchAnalysisModule module = new MerDispatchAnalysisModule(); + module.setOrgName(orgName); + module.setAnalysisMer(analysisMer); + + // 1商户是否停用 + if (analysisMer.getMerStatus() == 1) + { + AnalysisResult result = new AnalysisResult(false, "商户停用"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户正常使用"); + module.addResult(result); + } + + // 是否支持优质客户订单 + + if (order.isHighQualityOrder() && !analysisMer.isHighQualityOrder()) + { + AnalysisResult result = new AnalysisResult(false, "商户不支持优质客户订单"); + module.addResult(result); + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else if (order.isHighQualityOrder() && analysisMer.isHighQualityOrder()) + { + AnalysisResult result = new AnalysisResult(true, "商户支持优质客户订单"); + module.addResult(result); + } + + // 1.5商户是支持订单稿件类型 + if (order.getDraftType() == DraftConstants.DRAFT_STANDARD.value() && analysisMer.isNormDraftOrder()) + { + AnalysisResult result = new AnalysisResult(true, "商户支持标准自来稿"); + module.addResult(result); + } + else if (order.getDraftType() == DraftConstants.DRAFT_TEMPLATE.value() && analysisMer.isDraftOrder()) + { + AnalysisResult result = new AnalysisResult(true, "商户支持改稿自来稿"); + module.addResult(result); + } + else if (order.getDraftType() == DraftConstants.DRAFT_COMMON_DESIGN.value() && analysisMer.isDesignOrder()) + { + AnalysisResult result = new AnalysisResult(true, "商户支持普通设计稿"); + module.addResult(result); + } + else if (order.getDraftType() == DraftConstants.DRAFT_PAGE_DESIGN.value() && analysisMer.isSeniorDesignOrder()) + { + AnalysisResult result = new AnalysisResult(true, "商户支持资深设计稿"); + module.addResult(result); + } + else + { + AnalysisResult result = new AnalysisResult(false, "商户不支持的稿件类型"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + + // 2.检查商户是否是 停止接单 + if (analysisMer.isPauseRecieive()) + { + AnalysisResult result = new AnalysisResult(false, "商户停止接单"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户正在接单中"); + module.addResult(result); + } + + // //是否在接单时间内 [] + if (Validates.isNotEmpty(analysisMer.getRecieiveTime())) + { + if (!isRecieiveTime(analysisMer)) + { + AnalysisResult result = new AnalysisResult(false, "当前时间不在商户接单时间内"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + } + + // 3.商户最大金额 + if (order.getAmount() > analysisMer.getMaxOrderAmount()) + { + AnalysisResult result = new AnalysisResult(false, "订单金额[" + Amounts.toYuanMustRadix(order.getAmount()) + "]超出" + + (Validates.isNotEmptyBlank(otherMsg) ? otherMsg : "") + "接单商户最大金额[" + Amounts.toYuanMustRadix(analysisMer.getMaxOrderAmount()) + "]"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else if (order.getAmount() < analysisMer.getMinOrderAmount()) + { + AnalysisResult result = new AnalysisResult(false, "订单金额[" + Amounts.toYuanMustRadix(order.getAmount()) + "]低于" + + (Validates.isNotEmptyBlank(otherMsg) ? otherMsg : "") + "接单商户最小金额[" + Amounts.toYuanMustRadix(analysisMer.getMinOrderAmount()) + "]"); + module.addResult(result); + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "订单金额[" + Amounts.toYuanMustRadix(order.getAmount()) + "]在商户订单金额[" + + Amounts.toYuanMustRadix(analysisMer.getMinOrderAmount()) + "-" + Amounts.toYuanMustRadix(analysisMer.getMaxOrderAmount()) + "]限制范围内"); + module.addResult(result); + } + + // 4.加急单 + if (order.isUrgent()) + { + if (!analysisMer.isUrgent()) + { + AnalysisResult result = new AnalysisResult(false, "不支持[加急]单"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户当前支持[加急]单"); + module.addResult(result); + } + } + + // 5.不支持异形订单、多模、超过3款,查找下一家 系统不分拣,订单 款x模 > 20,即:多模、超过10款订单 + if ((order.getPrintWidth() > 0 || order.getPrintHeight() > 0)) + { + if (!analysisMer.isSpecial()) + { + AnalysisResult result = new AnalysisResult(false, "接单商户不支持异形"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户当前支持异形"); + module.addResult(result); + } + } + + // 7.店铺支持判断 + List shopList = Lists.toStringList(analysisMer.getOrderShop()); + boolean flag = false; + String shopNick = order.getShopNick(); + String businessMerchantIds = Global.getString("businessPlatform", "ids"); + // 淘印的订单,当做一个店铺来匹配派送规则 + String tmpMerchantId = "," + order.getMerchantId() + ","; + if (businessMerchantIds.indexOf(tmpMerchantId) > -1) + { + // 生产环境:1920862616055,测试环境:1823193227002 + DesignMerchantCache merchantCache = Global.get(DesignMerchantCache.class); + merchantCache = merchantCache != null ? merchantCache : new DesignMerchantCache(); + shopNick = merchantCache.getName(order.getMerchantId()); + } + + for (String shop : shopList) + { + if (Strings.trim(shop).equals(shopNick)) + { + flag = true; + break; + } + } + + if (!flag) + { // 不支持店铺 查找下一家 + AnalysisResult result = new AnalysisResult(false, + "不支持订单店铺[" + Strings.trim(shopNick, "") + "]当前商户支持的店铺[" + Strings.trim(analysisMer.getOrderShop(), "") + "]"); + module.addResult(result); + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户支持订单店铺[" + Strings.trim(shopNick, "") + "]"); + module.addResult(result); + } + + // 8.产品类型判断 + boolean typeflag = false; + for (Long tempId : Lists.toLongList(analysisMer.getDesignTypeIds())) + { + if (tempId == order.getTypeId()) + { + typeflag = true; + break; + } + } + + if (!typeflag) + { + AnalysisResult result = new AnalysisResult(false, "接单商户不支持[" + typeName + "]类型订单"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户支持[" + typeName + "]类型订单"); + module.addResult(result); + } + + // 9.行业判断 + boolean industryflag = false; + for (Long tempId : Lists.toLongList(analysisMer.getIndustryIds())) + { + if (tempId == order.getIndustryId()) + { + industryflag = true; + break; + } + } + + if (!industryflag) + { + AnalysisResult result = new AnalysisResult(false, "接单商户不支持[" + industryName + "]订单行业"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户支持[" + industryName + "]行业订单"); + module.addResult(result); + } + + // 9.超出最大遗留数 不派送,老客户不考虑该条件 + // 查询订单遗留数 + int leaveOverCount = getPrevMerLeaveOverCount(analysisMer); + // 获取 商户接单时间段 + int defaultNum = analysisMer.getMerMaxWaitOrder(); + + int receiveTimeNum = -1; + String msg = ""; + ReceiveTimeModel receiveTimeModel = getRecieiveTimeMaxLeave(analysisMer); + + if (receiveTimeModel != null) + { + receiveTimeNum = receiveTimeModel.getReceiveTimeNum(); + msg = "(当前最大限制取商户在[" + receiveTimeModel.getReceiveTimeBegin() + "-" + receiveTimeModel.getReceiveTimeEnd() + "]时段限制数)"; + } + else + { + msg = "(当前最大限制取商户最大遗留数)"; + receiveTimeNum = defaultNum; + } + + long oldMerId = getOldMer(order); + boolean isOldUser = analysisMer.getOrgId() == oldMerId; + if (isOldUser) + {// 超出最大遗留数 不派送,老客户不考虑该条件 + AnalysisResult result = new AnalysisResult(true, "老用户组织不考虑订单遗留数,当前遗留数[" + leaveOverCount + "]在正常范围内,最大限制[" + receiveTimeNum + "]" + msg); + module.addResult(result); + } + else + { + if (leaveOverCount >= receiveTimeNum) + { + AnalysisResult result = new AnalysisResult(false, "接单商户超出或等于最大未领数,当前遗留数:[" + leaveOverCount + "]最大限制[" + receiveTimeNum + "] " + msg); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + // 不是加急订单时判断普通订单是否已满 + else if (!order.isUrgent()) + { + // 当前普通订单遗留单量 + int ordinaryLeaveOverCount = getPrevMerLeaveOrdinaryOverCount(analysisMer); + int merMaxOrdinaryOrder = analysisMer.getMerMaxOrdinaryOrder(); + if (ordinaryLeaveOverCount >= merMaxOrdinaryOrder) + { + AnalysisResult result = new AnalysisResult(false, + "接单商户普通订单超出或等于最大未领数,当前遗留数:[" + ordinaryLeaveOverCount + "]最大限制[" + merMaxOrdinaryOrder + "] "); + module.addResult(result); + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户当前普通订单未领(未领)数[" + ordinaryLeaveOverCount + "]在正常范围内,最大限制[" + merMaxOrdinaryOrder + "]"); + module.addResult(result); + } + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户当前未领(未领)数[" + leaveOverCount + "]在正常范围内,最大限制[" + receiveTimeNum + "]" + msg); + module.addResult(result); + } + } + + // 10.超出最大接单量 不派送,老客户不考虑该条件 + List molist = getCurMerOrderList(analysisMer); + if (isOldUser) + {// 老用户 组织不考虑 + AnalysisResult result = new AnalysisResult(true, "老用户组织不考虑接单量条件,当前接单量[" + molist.size() + "]在正常范围内,最大预约单量[" + analysisMer.getMerMaxOrder() + "]"); + module.addResult(result); + } + else + { + + if (analysisMer.getOnlineDesignerCount() == 0) + { + AnalysisResult result = new AnalysisResult(false, "接单商户无设计师在线"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else if (molist.size() >= analysisMer.getMerMaxOrder()) + { + AnalysisResult result = new AnalysisResult(false, "接单商户超出或等于最大预约单量[" + analysisMer.getMerMaxOrder() + "]当前商户单量:" + molist.size()); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "商户当前接单量[" + molist.size() + "]在正常范围内,最大预约单量[" + analysisMer.getMerMaxOrder() + "]"); + module.addResult(result); + } + } + + // 11.后加工判断 + List orderAfters = Lists.toStringList(order.getAfterNames()); + List unafter = new ArrayList(); + String merAfter = analysisMer.getAfterNames(); + if (Validates.isNotEmptyBlank(order.getAfterNames())) + { + if (Validates.isEmptyBlank(merAfter)) + { + unafter.addAll(orderAfters); + } + else + { + for (String after : orderAfters) + { + + if (merAfter.indexOf(after) == -1) + { + unafter.add(after); + } + } + } + } + + if (unafter.size() > 0) + {// 又不支持的 后加工 + AnalysisResult result = new AnalysisResult(false, + "接单商户不支持后加工[" + Lists.toString(unafter) + "]当前商户后加工[" + merAfter + "]订单后加工[" + order.getAfterNames() + "]"); + module.addResult(result); + + module.setSuccess(result.isSuccess());// 最后结果 + return module; + } + + if (orderAfters.size() > 0 && unafter.size() == 0) + { + AnalysisResult result = new AnalysisResult(true, "商户支持订单后加工[" + order.getAfterNames() + "]当前商户后加工[" + merAfter + "]"); + module.addResult(result); + } + + // 12.判断是否成功匹配 + boolean endflag = true;// 默认是成功的 + List resutList = module.getResultList(); + for (AnalysisResult result : resutList) + { + if (!result.isSuccess()) + { + endflag = false; + break; + } + } + + module.setMerMsg(otherMsg + "[" + orgName + "]" + (endflag == true ? "成功匹配" : "匹配失败"));// 成功描述 + module.setSuccess(endflag);// 最后结果 + return module; + } + + /**** + * 获取老用户组织 + * + * @param order + * @throws SQLException + * @throws ORMException + */ + public static long getOldMer(DesignOrder order) throws Exception + { + Selector selector = new Selector(); + selector.addMustThenG("orgId", 0); + selector.addMust("buyerNick", order.getBuyerNick()); + selector.addMustNotEqual("designId", order.getDesignId()); // 排除自己 + selector.addOrderbyDesc("createTime"); + PageResult result = ORM.get(ZTable.class).page(DesignOrder.class, 1, 10, selector); + if (result.isEmpty()) + { + return -1; + } + + for (DesignOrder ord : result.list()) + { + if (ord.getTypeId() == order.getTypeId()) + { + return ord.getOrgId(); + } + } + + return result.list().get(0).getOrgId(); + } + + /*** + * 查询接单商户订单遗留订单数 + * + * @throws SQLException + * @throws ORMException + */ + public static int getPrevMerLeaveOverCount(DesignOrgMer mer) throws Exception + { + Selector selector = new Selector(); + selector.addMust("orgId", mer.getOrgId()); + selector.addMust("status", StatusConstants.ORDER_20.value()); + selector.addMustIsNull("designer");// 没有设计师 + selector.addMustIsNull("designReceiveTime");// 领单时间为空 + return ORM.get(ZTable.class).count(DesignOrder.class, selector); + } + + /*** + * 查询接单商户普通订单遗留订单数 + * + * @throws SQLException + * @throws ORMException + */ + public static int getPrevMerLeaveOrdinaryOverCount(DesignOrgMer mer) throws Exception + { + Selector selector = new Selector(); + selector.addMust("orgId", mer.getOrgId()); + selector.addMust("status", StatusConstants.ORDER_20.value()); + selector.addOr(new Selector().addMaybeIsEmpty("isUrgent").addMaybeNotIn("isUrgent", 1)); + selector.addMustIsNull("designer");// 没有设计师 + selector.addMustIsNull("designReceiveTime");// 领单时间为空 + return ORM.get(ZTable.class).count(DesignOrder.class, selector); + } + + /** + * 查询当天商户订单列表 + * + * @throws SQLException + * @throws ORMException + */ + public static List getCurMerOrderList(DesignOrgMer mer) throws Exception + { + Selector selector = new Selector(); + selector.addMust("orgId", mer.getOrgId()); + selector.addMustThenGE("orgReceiveTime", Sqls.toTimestamp(DateTimes.getDateString(), "00:00:00")); + selector.addMustThenLE("orgReceiveTime", Sqls.toTimestamp(DateTimes.getDateString(), "23:59:59")); + selector.addOrderbyAsc("orgReceiveTime"); + return ORM.get(ZTable.class).list(DesignOrder.class, selector); + } + + /** + * 判断是否在接单时间段 + * + * @param mer 接单商户 + * @return 没设置 返回 true + */ + public static boolean isRecieiveTime(DesignOrgMer mer) + { + if (Validates.isNotEmpty(mer.getRecieiveTime())) + {// 设置了时间段 + int curTime = DateTimes.getCurrentHour() * 100 + DateTimes.getCurrentMinute(); + + List modelList = Jsons.toList(mer.getRecieiveTime(), ReceiveTimeModel.class); + for (ReceiveTimeModel model : modelList) + { + int timeBegin = Ints.toInt(model.getReceiveTimeBegin().replace(":", "")); + int timeEnd = Ints.toInt(model.getReceiveTimeEnd().replace(":", "")); + + if (timeBegin < curTime && curTime < timeEnd) + { + return true; + } + } + + if (modelList.size() == 0) + { + return true; + } + else + { + return false; + } + } + else + { + return true; + } + } + + /*** + * 查询商户接单时间段的最大接遗留单量 model 对象 + * + * @param mer 接单商户 + * @return 返回 -1 表示 该商户没有配置 阶段时间段 + */ + public static ReceiveTimeModel getRecieiveTimeMaxLeave(DesignOrgMer mer) + { + if (Validates.isNotEmpty(mer.getRecieiveTime())) + { + int curTime = DateTimes.getCurrentHour() * 100 + DateTimes.getCurrentMinute(); + + List modelList = Jsons.toList(mer.getRecieiveTime(), ReceiveTimeModel.class); + for (ReceiveTimeModel model : modelList) + { + int timeBegin = Ints.toInt(model.getReceiveTimeBegin().replace(":", "")); + int timeEnd = Ints.toInt(model.getReceiveTimeEnd().replace(":", "")); + + if (timeBegin < curTime && curTime <= timeEnd && model.getReceiveTimeNum() > 0) + { + return model; + } + } + } + + return null; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/AnalysisOrderResult.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/AnalysisOrderResult.java new file mode 100644 index 0000000..8c4d5aa --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/AnalysisOrderResult.java @@ -0,0 +1,72 @@ +package com.zhiqim.yangcai.dispatch.model; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.dbo.design.DesignOrgMer; + +/**** + * 订单分拣分析结果 + * + * @version v1.0.0 @author longguizhi 2018-11-23 新建与整理 + */ +public class AnalysisOrderResult +{ + private long designId;// 订单 + private DesignOrgMer dispatchMer;// 成功分析派送的商户 + private String dispatchMsg;// 分拣描述 + private List merAnalysisList; + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public DesignOrgMer getDispatchMer() + { + return dispatchMer; + } + + public void setDispatchMer(DesignOrgMer dispatchMer) + { + this.dispatchMer = dispatchMer; + } + + public String getDispatchMsg() + { + return dispatchMsg; + } + + public void setDispatchMsg(String dispatchMsg) + { + this.dispatchMsg = dispatchMsg; + } + + public List getMerAnalysisList() + { + return merAnalysisList; + } + + public void setMerAnalysisList(List merAnalysisList) + { + this.merAnalysisList = this.merAnalysisList != null ? this.merAnalysisList : new ArrayList(); + + if (merAnalysisList != null && merAnalysisList.size() > 0) + { + this.merAnalysisList = merAnalysisList; + } + } + + @Override + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/AnalysisResult.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/AnalysisResult.java new file mode 100644 index 0000000..3f9385c --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/AnalysisResult.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.dispatch.model; + +import org.zhiqim.kernel.json.Jsons; + +/**** + * 分拣分析结果对象 + * + * @version v1.0.0 @author longguizhi 2018-11-23 新建与整理 + */ + +public class AnalysisResult implements Comparable +{ + private int succ; + private String conditionMsg; + public AnalysisResult(){} + + public AnalysisResult(boolean isSuccess, String msg) + { + super(); + this.succ = isSuccess == true ? 1 : 0; + this.conditionMsg = msg; + + } + + public boolean isSuccess() + { + return succ == 1; + } + + public String getConditionMsg() + { + return conditionMsg; + } + + public void setConditionMsg(String conditionMsg) + { + this.conditionMsg = conditionMsg; + } + + public int compareTo(AnalysisResult o) + { + return this.succ - o.succ; + } + + public int getSucc() + { + return succ; + } + + public void setSucc(int succ) + { + this.succ = succ; + } + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignOrgMerModule.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignOrgMerModule.java new file mode 100644 index 0000000..5647946 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignOrgMerModule.java @@ -0,0 +1,68 @@ +package com.zhiqim.yangcai.dispatch.model; + +import org.zhiqim.kernel.json.Jsons; + +import com.zhiqim.yangcai.design.dbo.design.DesignOrgMer; + +/** 接单商户扩展类 **/ +public class DesignOrgMerModule extends DesignOrgMer implements Comparable +{ + private static final long serialVersionUID = 1L; + + private String orgName;// 组织名 + private String orgManager;// 组织负责人 + private int onlineDesignerCount;// 设计师在线人数 + private int tempQuota;// 组织临时额度 + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public String getOrgManager() + { + return orgManager; + } + + public void setOrgManager(String orgManager) + { + this.orgManager = orgManager; + } + + public int getOnlineDesignerCount() + { + return onlineDesignerCount; + } + + public void setOnlineDesignerCount(int onlineDesignerCount) + { + this.onlineDesignerCount = onlineDesignerCount; + } + + public int getTempQuota() + { + return tempQuota; + } + + public void setTempQuota(int tempQuota) + { + this.tempQuota = tempQuota; + } + + @Override + public String toString() + { + return Jsons.toString(this); + } + + @Override + public int compareTo(DesignOrgMerModule o) + {// 排序 + return this.getMerLevel() - o.getMerLevel(); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignerGroupAnalysisResult.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignerGroupAnalysisResult.java new file mode 100644 index 0000000..ec6647b --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignerGroupAnalysisResult.java @@ -0,0 +1,92 @@ +package com.zhiqim.yangcai.dispatch.model; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; + +/**** + * 设计师组订单分拣分析结果 + * + * @version v1.0.0 @author yixin 2020-11-23 新建与整理 + */ +public class DesignerGroupAnalysisResult +{ + private long designId;// 订单 + private long dispatchMerOrgId;// 成功分析派送的商户 + private String designer;// 成功分析派送的设计师 + private String dispatchMsg;// 分拣描述 + private boolean isOldUser;// 是否是老用户派单 + private List merAnalysisList; + + public long getDesignId() + { + return designId; + } + + public void setDesignId(long designId) + { + this.designId = designId; + } + + public long getDispatchMerOrgId() + { + return dispatchMerOrgId; + } + + public void setDispatchMerOrgId(long dispatchMerOrgId) + { + this.dispatchMerOrgId = dispatchMerOrgId; + } + + public String getDesigner() + { + return designer; + } + + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getDispatchMsg() + { + return dispatchMsg; + } + + public void setDispatchMsg(String dispatchMsg) + { + this.dispatchMsg = dispatchMsg; + } + + public boolean isOldUser() + { + return isOldUser; + } + + public void setOldUser(boolean isOldUser) + { + this.isOldUser = isOldUser; + } + + public List getMerAnalysisList() + { + return merAnalysisList; + } + + public void setMerAnalysisList(List merAnalysisList) + { + this.merAnalysisList = this.merAnalysisList != null ? this.merAnalysisList : new ArrayList(); + + if (merAnalysisList != null && merAnalysisList.size() > 0) + { + this.merAnalysisList = merAnalysisList; + } + } + + @Override + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignerGroupDataModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignerGroupDataModel.java new file mode 100644 index 0000000..17c7fd6 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignerGroupDataModel.java @@ -0,0 +1,290 @@ +package com.zhiqim.yangcai.dispatch.model; + +import java.util.List; + +import org.zhiqim.kernel.util.Validates; + +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroup; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatchValue; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupValue; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 设计师组数据model + * TODO:类功能介绍 + * + * @version v1.0.0 @author yixin 2020年11月25日 新建与整理 + */ +public class DesignerGroupDataModel +{ + /** + * 设计师组 + */ + private DesignerGroup designerGroup; + /** + * 设计师组关联属性数据 + */ + private List designerGroupValueList; + /** + * 临时设计师额外配置 + */ + private DesignerGroupDispatch tempDesignerGroupDispatch; + /** + * 临时设计师额外属性配置 + */ + private List tempDesignerGroupDispatchValueList; + + public DesignerGroup getDesignerGroup() + { + return designerGroup; + } + + public void setDesignerGroup(DesignerGroup designerGroup) + { + this.designerGroup = designerGroup; + } + + public List getDesignerGroupValueList() + { + return designerGroupValueList; + } + + public void setDesignerGroupValueList(List designerGroupValueList) + { + this.designerGroupValueList = designerGroupValueList; + } + + public DesignerGroupDispatch getTempDesignerGroupDispatch() + { + return tempDesignerGroupDispatch; + } + + public void setTempDesignerGroupDispatch(DesignerGroupDispatch tempDesignerGroupDispatch) + { + this.tempDesignerGroupDispatch = tempDesignerGroupDispatch; + } + + public List getTempDesignerGroupDispatchValueList() + { + return tempDesignerGroupDispatchValueList; + } + + public void setTempDesignerGroupDispatchValueList(List tempDesignerGroupDispatchValueList) + { + this.tempDesignerGroupDispatchValueList = tempDesignerGroupDispatchValueList; + } + + /** + * 是否支持加急订单 + * + * @return + */ + public boolean isUrgent() + { + if (designerGroup != null) + { + return designerGroup.isUrgent() || (tempDesignerGroupDispatch != null && tempDesignerGroupDispatch.isUrgent()); + } + return false; + } + + /** + * 是否支持优质订单 + * + * @return + */ + public boolean isHighQualityOrder() + { + if (designerGroup != null) + { + return designerGroup.isHighQualityOrder() || (tempDesignerGroupDispatch != null && tempDesignerGroupDispatch.isHighQualityOrder()); + } + return false; + } + + /** + * 是否支持大金额订单 + * + * @return + */ + public boolean isLargeAmount() + { + if (designerGroup != null) + { + return designerGroup.isLargeAmount() || (tempDesignerGroupDispatch != null && tempDesignerGroupDispatch.isLargeAmount()); + } + return false; + } + + /** + * 是否支持仅设计订单 + * + * @return + */ + public boolean isDesign() + { + if (designerGroup != null) + { + return designerGroup.isDesign() || (tempDesignerGroupDispatch != null && tempDesignerGroupDispatch.isDesign()); + } + return false; + } + + /** + * 是否支持异形订单 + * + * @return + */ + public boolean isSpecial() + { + if (designerGroup != null) + { + return designerGroup.isSpecial() || (tempDesignerGroupDispatch != null && tempDesignerGroupDispatch.isSpecial()); + } + return false; + } + + /** + * 是否支持订单金额范围 + * + * @return + */ + public boolean isOrderAmountRange(DesignOrder order) + { + if (order == null) + { + return false; + } + long maxOrderAmount, minOrderAmount, orderAmount = order.getAmount(); + if (designerGroup != null) + { + maxOrderAmount = designerGroup.getMaxOrderAmount(); + minOrderAmount = designerGroup.getMinOrderAmount(); + if (minOrderAmount <= orderAmount && orderAmount <= maxOrderAmount) + { + return true; + } + else if (tempDesignerGroupDispatch != null) + { + maxOrderAmount = tempDesignerGroupDispatch.getMaxOrderAmount(); + minOrderAmount = tempDesignerGroupDispatch.getMinOrderAmount(); + return minOrderAmount <= orderAmount && orderAmount <= maxOrderAmount; + } + } + return false; + } + + /** + * 是否支持对应稿件类型 + * + * @param order + * @return + */ + public boolean isSupportDraftType(DesignOrder order) + { + if (order == null) + { + return false; + } + int draftType = order.getDraftType(); + long relatedValue = order.getTypeId(); + int relatedType; + if (draftType == DraftConstants.DRAFT_STANDARD.value()) + { + relatedType = 0; + } + else if (draftType == DraftConstants.DRAFT_TEMPLATE.value()) + { + relatedType = 4; + } + else if (draftType == DraftConstants.DRAFT_COMMON_DESIGN.value()) + { + relatedType = 1; + } + else if (draftType == DraftConstants.DRAFT_PAGE_DESIGN.value()) + { + relatedType = 2; + } + else + { + return false; + } + + return isSupportConfigValue(relatedType, relatedValue); + } + + /** + * 判断是否支持该后加工 + * + * @param afterName + * @return + */ + public boolean isAfterNames(String afterName) + { + if (Validates.isNotEmpty(afterName)) + { + boolean flag = false; + if (designerGroup != null && Validates.isNotEmpty(designerGroup.getAfterNames())) + { + String afterNames = "," + designerGroup.getAfterNames() + ","; + flag = flag || afterNames.indexOf("," + afterName + ",") > -1; + } + if (tempDesignerGroupDispatch != null && Validates.isNotEmpty(tempDesignerGroupDispatch.getAfterNames())) + { + String afterNames = "," + tempDesignerGroupDispatch.getAfterNames() + ","; + flag = flag || afterNames.indexOf("," + afterName + ",") > -1; + } + return flag; + } + return true; + } + + /** + * 是否支持对应稿件类型 + * + * @param order + * @return + */ + public boolean isIndustryType(DesignOrder order) + { + if (order == null) + { + return false; + } + long relatedValue = order.getIndustryId(); + int relatedType = 3; + return isSupportConfigValue(relatedType, relatedValue); + } + + /** + * 判断配置属性是否支持 + * + * @param relatedType + * @param relatedValue + * @return + */ + private boolean isSupportConfigValue(int relatedType, long relatedValue) + { + for (DesignerGroupValue designerGroupValue : designerGroupValueList) + { + if (designerGroupValue.getRelatedType() == relatedType && designerGroupValue.getRelatedValue() == relatedValue) + { + return true; + } + } + if (tempDesignerGroupDispatch != null) + { + for (DesignerGroupDispatchValue dispatchValue : tempDesignerGroupDispatchValueList) + { + if (dispatchValue.getRelatedType() == relatedType && dispatchValue.getRelatedValue() == relatedValue) + { + return true; + } + } + } + return false; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignerGroupMerDispatchAnalysisModule.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignerGroupMerDispatchAnalysisModule.java new file mode 100644 index 0000000..9306baf --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignerGroupMerDispatchAnalysisModule.java @@ -0,0 +1,151 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.dispatch.model; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.DateTimes; + +/**** + * 分拣分析结果处理 + * + * @version v1.0.0 @author longguizhi 2018-11-22 新建与整理 + */ +public class DesignerGroupMerDispatchAnalysisModule +{ + private boolean isSuccess;// 是否分拣成功 + private String merMsg; // 分拣成功日志描述 + private long orgId; + private String orgName; + private String analysisTime; + private DesignOrgMerModule analysisMer; + private List resultList; + private List designerScoreList; + + public DesignerGroupMerDispatchAnalysisModule() + { + this.analysisTime = DateTimes.getDateTimeString(); + this.resultList = new ArrayList(); + this.designerScoreList = new ArrayList(); + } + + public boolean isSuccess() + { + return isSuccess; + } + + public void setSuccess(boolean isSuccess) + { + this.isSuccess = isSuccess; + } + + public String getMerMsg() + { + return merMsg; + } + + public void setMerMsg(String merMsg) + { + this.merMsg = merMsg; + } + + public DesignOrgMerModule getAnalysisMer() + { + return analysisMer; + } + + public void setAnalysisMer(DesignOrgMerModule analysisMer) + { + this.orgId = analysisMer.getOrgId(); + this.analysisMer = analysisMer; + } + + public void setAnalysisTime(String analysisTime) + { + this.analysisTime = analysisTime; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public List getResultList() + { + return resultList; + } + + public void setResultList(List resultList) + { + if (resultList != null && resultList.size() > 0) + { + this.resultList = resultList; + } + } + + public void addResult(AnalysisResult result) + { + if (result != null) + { + this.resultList.add(result); + } + } + + public List getDesignerScoreList() + { + return designerScoreList; + } + + public void setDesignerResultList(List designerScoreList) + { + if (designerScoreList != null && designerScoreList.size() > 0) + { + this.designerScoreList = designerScoreList; + } + } + + public void addDesignerScore(DesignerScoreModel score) + { + if (score != null) + { + this.designerScoreList.add(score); + } + } + + public String getAnalysisTime() + { + return analysisTime; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + @Override + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignerScoreModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignerScoreModel.java new file mode 100644 index 0000000..5a693e1 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/DesignerScoreModel.java @@ -0,0 +1,272 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.dispatch.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * TODO:评分辅助类 + * + * @version v1.0.0 @author admin 2017-6-15 新建与整理 + */ +public class DesignerScoreModel +{ + /** + * 全部未完成单量,用于优先级排序和单量规则判断 + */ + private int score; + + /** + * 设计中的订单数量 + */ + private int orderNumber; + + /** + * 设计师个人配置最大接单量(正在设计中的订单) + */ + private int desOrderNum; + + /** + * 普通订单数量,非加急订单 + */ + private int qualityOrderNumber; + + /** + * 是否接取设计订单 + */ + private boolean isDesignOrder; + /** + * 是否接取改稿自来稿 + */ + private boolean isDraftOrder; + /** + * 是否接取标准自来稿 + */ + private boolean isNormDraftOrder; + /** + * 是否支持优质订单 + */ + private boolean isHighQualityOrder; + /** + * 最大预约单量 当天预约数量+临时额度(如果临时额度开启) + */ + private int maxSubscribeNum; + /** + * 是否支持加急 + */ + private boolean isUrgent; + /** + * 设计师等级 0:普通, 1:高级,2:cdr设计师 + */ + private int designerLevel; + + private String operatorCode; + private String sessionId; + /** + * 设计师所属组织id + */ + private long orgId; + /** + * 分析日志 + */ + private List resultList; + /** + * 是否匹配成功 + */ + private boolean isSuccess; + + public String getSessionId() + { + return sessionId; + } + + public void setSessionId(String sessionId) + { + this.sessionId = sessionId; + } + + public int getOrderNumber() + { + return orderNumber; + } + + public void setOrderNumber(int orderNumber) + { + this.orderNumber = orderNumber; + } + + public int getQualityOrderNumber() + { + return qualityOrderNumber; + } + + public void setQualityOrderNumber(int qualityOrderNumber) + { + this.qualityOrderNumber = qualityOrderNumber; + } + + public boolean isDesignOrder() + { + return isDesignOrder; + } + + public void setDesignOrder(boolean isDesignOrder) + { + this.isDesignOrder = isDesignOrder; + } + + public boolean isDraftOrder() + { + return isDraftOrder; + } + + public void setDraftOrder(boolean isDraftOrder) + { + this.isDraftOrder = isDraftOrder; + } + + public boolean isNormDraftOrder() + { + return isNormDraftOrder; + } + + public void setNormDraftOrder(boolean isNormDraftOrder) + { + this.isNormDraftOrder = isNormDraftOrder; + } + + public int getDesignerLevel() + { + return designerLevel; + } + + public void setDesignerLevel(int designerLevel) + { + this.designerLevel = designerLevel; + } + + public int getScore() + { + return score; + } + + public void setScore(int score) + { + this.score = score; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public boolean isHighQualityOrder() + { + return isHighQualityOrder; + } + + public void setHighQualityOrder(boolean isHighQualityOrder) + { + this.isHighQualityOrder = isHighQualityOrder; + } + + public int getMaxSubscribeNum() + { + return maxSubscribeNum; + } + + public void setMaxSubscribeNum(int maxSubscribeNum) + { + this.maxSubscribeNum = maxSubscribeNum; + } + + public boolean isUrgent() + { + return isUrgent; + } + + public void setUrgent(boolean isUrgent) + { + this.isUrgent = isUrgent; + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public List getResultList() + { + return resultList; + } + + public void setResultList(List resultList) + { + if (resultList != null && resultList.size() > 0) + { + this.resultList = resultList; + } + } + + public boolean isSuccess() + { + return isSuccess; + } + + public void setSuccess(boolean isSuccess) + { + this.isSuccess = isSuccess; + } + + public void addResult(AnalysisResult result) + { + if (result != null) + { + resultList.add(result); + } + } + + public DesignerScoreModel(int score, String operatorCode) + { + super(); + this.score = score; + this.operatorCode = operatorCode; + this.resultList = new ArrayList(); + } + + public DesignerScoreModel() + { + super(); + this.resultList = new ArrayList(); + } + + public int getDesOrderNum() + { + return desOrderNum; + } + + public void setDesOrderNum(int desOrderNum) + { + this.desOrderNum = desOrderNum; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/MerDispatchAnalysisModule.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/MerDispatchAnalysisModule.java new file mode 100644 index 0000000..1955f99 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/MerDispatchAnalysisModule.java @@ -0,0 +1,114 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.dispatch.model; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.DateTimes; + +import com.zhiqim.yangcai.design.dbo.design.DesignOrgMer; + +/**** + * 分拣分析结果处理 + * + * @version v1.0.0 @author longguizhi 2018-11-22 新建与整理 + */ +public class MerDispatchAnalysisModule +{ + private boolean isSuccess;//是否分拣成功 + private String merMsg; //分拣成功日志描述 + private long orgId; + private String orgName; + private String analysisTime; + private DesignOrgMer analysisMer; // + private List resultList; + public MerDispatchAnalysisModule() + { + this.analysisTime = DateTimes.getDateTimeString(); + this.resultList = new ArrayList(); + } + public boolean isSuccess() + { + return isSuccess; + } + public void setSuccess(boolean isSuccess) + { + this.isSuccess = isSuccess; + } + + + public String getMerMsg() + { + return merMsg; + } + public void setMerMsg(String merMsg) + { + this.merMsg = merMsg; + } + public DesignOrgMer getAnalysisMer() + { + return analysisMer; + } + public void setAnalysisMer(DesignOrgMer analysisMer) + { + this.orgId = analysisMer.getOrgId(); + this.analysisMer = analysisMer; + } + public void setAnalysisTime(String analysisTime) + { + this.analysisTime = analysisTime; + } + public String getOrgName() + { + return orgName; + } + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + public List getResultList() + { + return resultList; + } + public void setResultList(List resultList) + { + if (resultList != null && resultList.size() > 0) + this.resultList = resultList; + } + + public void addResult(AnalysisResult result) + { + if (result != null) + resultList.add(result); + } + public String getAnalysisTime() + { + return analysisTime; + } + + public long getOrgId() + { + return orgId; + } + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/ReceiveTimeModel.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/ReceiveTimeModel.java new file mode 100644 index 0000000..716cf93 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/model/ReceiveTimeModel.java @@ -0,0 +1,66 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.dispatch.model; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; + +/** + * 收货时间段MODEL + * + * @version v1.0.0 @author zzy 2018-9-15 新建与整理 + */ +@AnAlias("ReceiveTimeModel") +public class ReceiveTimeModel +{ + private String receiveTimeBegin; + private String receiveTimeEnd; + private int receiveTimeNum; + + public ReceiveTimeModel(){} + public ReceiveTimeModel(String receiveTimeBegin, String receiveTimeEnd, int receiveTimeNum) + { + this.receiveTimeBegin = receiveTimeBegin; + this.receiveTimeEnd = receiveTimeEnd; + this.receiveTimeNum = receiveTimeNum; + } + + public String getReceiveTimeBegin() + { + return receiveTimeBegin; + } + public void setReceiveTimeBegin(String receiveTimeBegin) + { + this.receiveTimeBegin = receiveTimeBegin; + } + public String getReceiveTimeEnd() + { + return receiveTimeEnd; + } + public void setReceiveTimeEnd(String receiveTimeEnd) + { + this.receiveTimeEnd = receiveTimeEnd; + } + public int getReceiveTimeNum() + { + return receiveTimeNum; + } + public void setReceiveTimeNum(int receiveTimeNum) + { + this.receiveTimeNum = receiveTimeNum; + } + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/task/DesignerGroupDispatchOrderTask.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/task/DesignerGroupDispatchOrderTask.java new file mode 100644 index 0000000..6f7ea38 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/dispatch/task/DesignerGroupDispatchOrderTask.java @@ -0,0 +1,301 @@ +package com.zhiqim.yangcai.dispatch.task; + +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.aliyuncs.utils.StringUtils; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DispatchDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.design.DesignOrgMer; +import com.zhiqim.yangcai.design.dbo.dispatch.DesOnline; +import com.zhiqim.yangcai.design.dbo.dispatch.DesignerGroupDispatchLog; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.server.ErpClassService; +import com.zhiqim.yangcai.design.server.ErpClassService.statusEnum; +import com.zhiqim.yangcai.dispatch.dao.DesignerGroupDispatchAnalysisDao; +import com.zhiqim.yangcai.dispatch.model.DesignOrgMerModule; +import com.zhiqim.yangcai.dispatch.model.DesignerGroupAnalysisResult; +import com.zhiqim.yangcai.util.BusinessPlatformClientUtil; + +/** + * 新接单规则组订单分拣派单任务 + * + * @version v1.0.0 @author yixin 2020-11-21 新建与整理 + */ +public class DesignerGroupDispatchOrderTask implements Task, SignConstants { + private static final Log log = LogFactory.getLog(DesignerGroupDispatchOrderTask.class); + private static Map orgMap = new HashMap(); + private static List merModules = new ArrayList(); + + @Override + public void execute() { + log.info("订单分拣派单任务开始..."); + long l = System.currentTimeMillis(); + try { + // 初始化组织接单规则信息 + List orgList = ORM.get(ZTable.class).list(ZmrOrg.class, + new Selector().addMust("orgStatus", 0).addOrderbyAsc("orgLevel,orgSeq,orgId")); + for (ZmrOrg org : orgList) { + orgMap.put(org.getOrgId(), org); + } + + Selector sel = new Selector(); + sel.addMust("merStatus", 0);// 组织状态正常 + sel.addMust("isPauseRecieive", false);// 接单状态正常 + sel.addOrderbyAsc("merLevel"); + List tempList = ORM.get(ZTable.class).list(DesignOrgMer.class, sel); + merModules.clear(); + for (DesignOrgMer mer : tempList) { + ZmrOrg org = orgMap.get(mer.getOrgId()); + if (org == null) { + // 组织停用了,接单规则未停用场景 + continue; + } + + DesignOrgMerModule module = new DesignOrgMerModule(); + Objects.copyDeep(mer, module); + + // 查询临时额度 + // SubscribeOrgTempQuota subscribeOrgTempQuota = + // ORM.get(ZTable.class).item(SubscribeOrgTempQuota.class, + // new Selector("orgId", mer.getOrgId()).addMust("state", 1)); + // if (subscribeOrgTempQuota != null) + // { + // module.setTempQuota(subscribeOrgTempQuota.getTempQuota()); + // } + module.setOrgName(org.getOrgName()); + merModules.add(module); + } + } catch (Exception e) { + log.error("订单分拣派单任务初始化信息失败," + e.getMessage(), e); + return; + } + + /** + * 1.派单规则优先级:加急单 > 大金额订单 > 普通订单 > 电子名片订单 2.系统只分配5分钟之内的订单,超过5分钟则放入抢单大厅 + */ + try { + // 加急单 + doDispatchUrgentOrder(); + } catch (Exception e) { + log.error("[订单分拣]加急订单派送异常:", e); + } + + try { + // 大金额订单 >= 300元视为大金额订单 + doDispatchLargeAmountOrder(); + } catch (Exception e) { + log.error("[订单分拣]大金额订单派送异常:", e); + } + + try { + // 普通订单 老流程 + doDispatchOrder(); + } catch (Exception e) { + log.error("[订单分拣]普通订单派送异常:", e); + } + + try { + // 电子名片订单 + doDispatchElectronicsOrder(); + } catch (Exception e) { + log.error("[订单分拣]电子名片订单派送异常:", e); + } + + log.info("订单分拣派单任务结束,耗时[%s]秒", (System.currentTimeMillis() - l * 1.0) / 1000); + return; + } + + /** + * 加急单 + * + * @throws SQLException + * @throws ORMException + */ + private void doDispatchUrgentOrder() throws Exception { + // Timestamp timestamp = + // Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringBySecond(300)); + Selector selector = new Selector(); + selector.addMust("status", StatusConstants.ORDER_10.value()); // 未分拣 + // selector.addMustThenGE("createTime", timestamp); + selector.addMust("isUrgent", false); // true加急 false不加急 + selector.addMustNotEqual("typeId", 2023207561256L); + selector.addOr(new Selector("orgId", 0).addMustIsNull("orgId")); // 未派单给组织 + selector.addOrderbyAsc("createTime"); + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + for (DesignOrder order : orderList) { + dispatchOrder(order); + } + + } + + /** + * 普通订单 + * + * @throws SQLException + * @throws ORMException + */ + private void doDispatchOrder() throws Exception { + // Timestamp timestamp = + // Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringBySecond(300)); + Selector selector = new Selector(); + selector.addMust("status", StatusConstants.ORDER_10.value()); // 未分拣 + // selector.addMustThenGE("createTime", timestamp); + selector.addMustNotEqual("typeId", 2023207561256L); + selector.addOr(new Selector("orgId", 0).addMustIsNull("orgId")); // 未派单给组织 + selector.addOrderbyAsc("createTime"); + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + for (DesignOrder order : orderList) { + dispatchOrder(order); + } + } + + /** + * 电子名片订单 + * + * @throws SQLException + * @throws ORMException + */ + private void doDispatchElectronicsOrder() throws Exception { + // Timestamp timestamp = + // Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringBySecond(300)); + Selector selector = new Selector(); + selector.addMust("status", StatusConstants.ORDER_10.value()); // 未分拣 + // selector.addMustThenGE("createTime", timestamp); + selector.addMust("typeId", 2023207561256L); + selector.addOr(new Selector("orgId", 0).addMustIsNull("orgId")); // 未派单给组织 + selector.addOrderbyAsc("createTime"); + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + for (DesignOrder order : orderList) { + dispatchOrder(order); + } + } + + /** 大金额订单 客单价超过300的订单标识为“大”,优先派发 **/ + private void doDispatchLargeAmountOrder() throws Exception { + // Timestamp timestamp = + // Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringBySecond(300)); + Selector selector = new Selector(); + selector.addMust("status", StatusConstants.ORDER_10.value()); // 等待设计 + // selector.addMustThenGE("createTime", timestamp); + selector.addMustThenGE("amount", Amounts.toFen("300", 0L)); // 客单价超过300 + selector.addMustNotEqual("typeId", 2023207561256L); + selector.addOr(new Selector("orgId", 0).addMustIsNull("orgId")); // 未派单给组织 + selector.addOrderbyAsc("createTime"); + List orderList = ORM.get(ZTable.class).list(DesignOrder.class, selector); + for (DesignOrder order : orderList) { + dispatchOrder(order); + } + + } + + /*** + * 单条订单派送 + * + * @param order + * @return 返回商户 =null 表示没有找到对应商户 + * @throws Exception + */ + private void dispatchOrder(DesignOrder order) throws Exception { + DesignerGroupAnalysisResult analysisResult = DesignerGroupDispatchAnalysisDao.doAnalysis(order, merModules); + if (Validates.isNotEmpty(analysisResult.getDesigner()) && analysisResult.getDispatchMerOrgId() != 0) { + // 有匹配到设计师 + doDispatchUpdate(order, analysisResult); + } else { + log.info("[订单分拣]订单[" + order.getDesignId() + "]未匹配到设计师"); + } + + } + + /** + * 执行派单操作 + * + * @author yixin + * @throws SQLException + * @throws ORMException + */ + @AnTransaction + private void doDispatchUpdate(DesignOrder order, DesignerGroupAnalysisResult analysisResult) { + String info = analysisResult.getDispatchMsg(); + try { + String operatorCode = analysisResult.getDesigner(); + DesOnline online = DispatchDao.getOnlineDesigner(operatorCode); + if (online == null) { + log.info("[订单分拣]订单[" + order.getDesignId() + "]派送失败,设计师:" + operatorCode + " 不在线"); + return; + } + + boolean ifRelevance = DispatchDao.ifRelevance(order, operatorCode); + if (!ifRelevance) { + log.info("[订单分拣]订单[" + order.getDesignId() + "]派送失败,设计师:" + operatorCode + " 关联渠道不匹配"); + return; + } + + // 修改订单状态和分配设计师 + Updater updater = new Updater(); + updater.addMust("designId", order.getDesignId()); + updater.addField("orgReceiveTime", Sqls.nowTimestamp()); + updater.addField("orgId", analysisResult.getDispatchMerOrgId()); + updater.addField("status", StatusConstants.ORDER_30.value()); + updater.addField("designer", operatorCode); + updater.addField("designReceiveTime", Sqls.nowTimestamp()); + updater.addField("designBeginTime", Sqls.nowTimestamp()); + updater.addField("receiveType", 1); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 录入分拣日志 + DesignerGroupDispatchLog dispatchLog = new DesignerGroupDispatchLog(); + dispatchLog.setOrgId(analysisResult.getDispatchMerOrgId()); + dispatchLog.setDesignId(order.getDesignId()); + dispatchLog.setDesTime(Sqls.nowTimestamp()); + dispatchLog.setDisDesc("自动分拣," + info); + dispatchLog.setAnalysisText(Jsons.toString(analysisResult)); + ORM.get(ZTable.class).insert(dispatchLog); + + // 更新预约完成数量 + // DispatchDao.doUpdateSubscribeDesignerQuotaRecordFinishedNum(operatorCode); + + // 更新设计师未完成订单数 + DispatchDao.doUpdateDesignerOrderNum(operatorCode); + if (!StringUtils.isEmpty(order.getTids())) { + new ErpClassService(order.getTids(), operatorCode, statusEnum.TO_BE_DESIGNEDING.getCode()); + } + + // 录入订单日志 + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", "订单派送任务," + info, + EventConstants.ORDER_3.value()); + + // 发送通知 + // DispatchTaskDao.doDispatchSendMsg(online.getSessionId(), order); + + log.info("[订单分拣]" + info); + } catch (Exception e) { + log.error("[订单分拣]" + info + "]异常", e); + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterCancelRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterCancelRequestHandler.java new file mode 100644 index 0000000..d13ff24 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterCancelRequestHandler.java @@ -0,0 +1,80 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.server.handler.after; + + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrder; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterCancelRequest; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterCancelResponse; + +public class DesignAfterCancelRequestHandler extends ApiErrorCodes implements Handler +{ + private static final Log log = LogFactory.getLog(DesignAfterCancelRequestHandler.class); + public void process(DesignAfterCancelRequest request) + { + DesignAfterCancelResponse response = request.newResponse(); + try + { + long designAfsId = request.getDesignAfsId(); + + Selector selector = new Selector("designAfsId", designAfsId); + //查询是否有未处理完成的售后单 非取消 或者 已完成售后单 不处理 + DesignAfterOrder after = ORM.get(ZTable.class).item(DesignAfterOrder.class, selector); + if(after == null) + {//响应回去 + Int code = ERROR_API_NOT_AFTER_ORDER; + request.setError(Strings.toString(request.getDesignAfsId()), code.value(), code.desc()); + return; + } + + if (AfterConstants.CS_F120.value() != after.getAfterStatus() && AfterConstants.CS_400.value() != after.getAfterStatus()) + {//未退回的单 + Updater updater = new Updater(); + updater.addMust("designAfsId", after.getDesignAfsId()); + updater.addField("afterModifyTime", Sqls.nowTimestamp()); + updater.addField("afterStatus", AfterConstants.CS_F120.value()); + updater.addField("afterCanceler", "系统"); + updater.addField("afterCancelTime", Sqls.nowTimestamp()); + updater.addField("afterCancelNote", request.getCancelNote()); + + ORM.get(ZTable.class).update(DesignAfterOrder.class, updater); + OrderLogDao.saveOrderOperateLog(after.getDesignId(), "系统", "外部系统撤销售后单["+ request.getCancelNote() +"]", EventConstants.ORDER_20.value()); + } + //处理通过 + response.setCanceled(true); + request.setResponse(response); + } + catch (Exception e) + { + log.error("创建订单异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignAfsId()), code.value(), code.desc(), e); + } + } + + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterComplainPersonRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterComplainPersonRequestHandler.java new file mode 100644 index 0000000..46671e1 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterComplainPersonRequestHandler.java @@ -0,0 +1,118 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignAfterComplainPassHandlerAlterRequestHandler.java + * 创建人 :高佳新 + * 创建时间:2019-5-30 + */ + +package com.zhiqim.yangcai.server.handler.after; + +import java.util.List; + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dao.OrderCheckDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterComplainPersonRequest; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterComplainPersonResponse; + +/** + * + * erp申诉审核通过信息同步 + * + * @version 1.0 @author 高佳新 2019-5-30 新建与整理 + */ +public class DesignAfterComplainPersonRequestHandler extends ApiErrorCodes implements Handler +{ + private static final Log log = LogFactory.getLog(DesignAfterComplainPersonRequestHandler.class); + + @Override + public void process(DesignAfterComplainPersonRequest request) + { + DesignAfterComplainPersonResponse response = request.newResponse(); + try + { + long designAfsId = request.getDesignAfsId(); + String afsLosser = request.getAfsLosser(); + Selector selector = new Selector("designAfsId", designAfsId); + // 查询是否有未处理完成的售后单 非取消 或者 已完成售后单 不处理 + DesignAfterOrder after = ORM.get(ZTable.class).item(DesignAfterOrder.class, selector); + if (after == null) + {// 响应回去 + Int code = ERROR_API_NOT_AFTER_ORDER; + request.setError(Strings.toString(request.getDesignAfsId()), code.value(), code.desc()); + return; + } + + if (AfterConstants.CS_400.value() == after.getAfterStatus() || AfterConstants.CS_300.value() == after.getAfterStatus()) + { + Int code = ERROR_API_NOT_SUPPORT_BY_BUSINESS; + request.setError(Strings.toString(request.getDesignAfsId()), code.value(), code.desc() + "[" + AfterConstants.CS_400.desc() + "]退回"); + return; + } + + if (after.getAfterStatus() < AfterConstants.CS_400.value()) + {// 状态不能为申诉拒绝以及售后完结 + + // 删除之前的申诉内容及文件 + List blameAttaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector("designId", after.getDesignId()).addMust("attaModul", FileTypeConstants.FILE_AFTE_COMPLAIN_EVIDENCE.value())); + for (DesignAtta atta : blameAttaList) + { + OrderCheckDao.doDeleteAttaFile(atta); + } + Updater updater = new Updater(); + // 未填则申述成功 + if (Validates.isEmpty(afsLosser) || "null".equals(afsLosser)) + { + updater.addMust("designAfsId", after.getDesignAfsId()); + updater.addField("afterStatus", AfterConstants.CS_F100.value()); + ORM.get(ZTable.class).update(DesignAfterOrder.class, updater); + + OrderLogDao.saveOrderOperateLog(after.getDesignId(), "系统", "erp审核通过售后单责任属于erp,设计平台售后单修改状态为已取消", EventConstants.ORDER_20.value()); + } + else + { + // 填写后重新指定设计师 + updater.addMust("designAfsId", after.getDesignAfsId()); + updater.addField("afterStatus", AfterConstants.CS_300.value()); + updater.addField("afterBlamer", afsLosser); + updater.addField("afterHandelTime", Sqls.nowTimestamp()); + updater.addField("afterModifyTime", Sqls.nowTimestamp()); + updater.addField("afterBlameReturnNote", null); + updater.addField("afterBlameReturnTime", null); + ORM.get(ZTable.class).update(DesignAfterOrder.class, updater); + OrderLogDao.saveOrderOperateLog(after.getDesignId(), "系统", "erp审核异议申述成功", EventConstants.ORDER_20.value()); + } + + } + // 处理通过 + response.setHandlerAlter(true); + request.setResponse(response); + } + catch (Exception e) + { + log.error("erp审核通过修改责任人信息异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignAfsId()), code.value(), code.desc(), e); + } + + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterComplainReturnRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterComplainReturnRequestHandler.java new file mode 100644 index 0000000..82db58b --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterComplainReturnRequestHandler.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.server.handler.after; + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrder; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterComplainReturnRequest; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterComplainReturnResponse; + +/**** + * 申诉单退回 + * + * @version v1.0.0 @author lgz 2019-1-3 新建与整理 + */ +public class DesignAfterComplainReturnRequestHandler extends ApiErrorCodes implements Handler +{ + private static final Log log = LogFactory.getLog(DesignAfterComplainReturnRequestHandler.class); + + @Override + public void process(DesignAfterComplainReturnRequest request) + { + DesignAfterComplainReturnResponse response = request.newResponse(); + try + { + long designAfsId = request.getDesignAfsId(); + + Selector selector = new Selector("designAfsId", designAfsId); + // 查询是否有未处理完成的售后单 非取消 或者 已完成售后单 不处理 + DesignAfterOrder after = ORM.get(ZTable.class).item(DesignAfterOrder.class, selector); + if (after == null) + {// 响应回去 + Int code = ERROR_API_NOT_AFTER_ORDER; + request.setError(Strings.toString(request.getDesignAfsId()), code.value(), code.desc()); + return; + } + + if (AfterConstants.CS_400.value() == after.getAfterStatus()) + { + Int code = ERROR_API_NOT_SUPPORT_BY_BUSINESS; + request.setError(Strings.toString(request.getDesignAfsId()), code.value(), code.desc() + "[" + AfterConstants.CS_400.desc() + "]退回"); + return; + } + + if (after.getAfterStatus() < AfterConstants.CS_400.value()) + {// 还没有售后完结以及申诉拒绝的订单 + Updater updater = new Updater(); + updater.addMust("designAfsId", after.getDesignAfsId()); + updater.addField("afterStatus", AfterConstants.CS_500.value()); + updater.addField("afterReturnNote", request.getReturnNote()); + updater.addField("afterModifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignAfterOrder.class, updater); + OrderLogDao.saveOrderOperateLog(after.getDesignId(), "系统", "申诉单[" + after.getDesignAfsId() + "]退回,备注:[" + request.getReturnNote() + "]", + EventConstants.ORDER_20.value()); + } + // 处理通过 + response.setReturned(true); + request.setResponse(response); + } + catch (Exception e) + { + log.error("创建订单异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignAfsId()), code.value(), code.desc(), e); + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterCreateRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterCreateRequestHandler.java new file mode 100644 index 0000000..b977755 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterCreateRequestHandler.java @@ -0,0 +1,150 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.server.handler.after; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.ParamDao; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.module.ApiFile; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterCreateRequest; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterCreateResponse; + +public class DesignAfterCreateRequestHandler extends ApiErrorCodes implements Handler +{ + private static final Log log = LogFactory.getLog(DesignAfterCreateRequestHandler.class); + + @Override + public void process(DesignAfterCreateRequest request) + { + DesignAfterCreateResponse response = request.newResponse(); + try + { + long merchantId = request.getMerchantId(); + long designId = request.getDesignId(); + String outAfsId = request.getOutAfsId(); + String problemDesc = request.getProblemDesc();// 售后原因描述 + List aipFiles = request.getAipFiles(); + Long picTypeId = request.getPicTypeId() == null ? 0 : request.getPicTypeId(); + String afterBlamer = request.getAfterBlamer();// 责任人 + String afterHandler = request.getAfterHandler();// 处理人 (指派责任的人) + String problemReason = request.getProblemReason();// 售后原因分类 + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId).addMust("merchantId", merchantId)); + if (order == null) + { + Int code = ERROR_API_NOT_DESIGN_ORDER; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc()); + return; + } + + // 查询是否有未处理完成的售后单 非取消 或者 已完成售后单 不处理 + DesignAfterOrder after = ORM.get(ZTable.class).item(DesignAfterOrder.class, new Selector("designId", designId) + .addMustThenGE("afterStatus", AfterConstants.CS_0.value()).addMustThenLE("afterStatus", AfterConstants.CS_300.value())); + if (after != null) + {// 响应回去 + response.setDesignAfsId(after.getDesignAfsId()); + request.setResponse(response); + return; + } + + after = new DesignAfterOrder(); + after.setDesignAfsId(Ids.longId()); + after.setAfterStatus(AfterConstants.CS_0.value()); + after.setAfterCreateTime(Sqls.nowTimestamp()); + after.setAfterModifyTime(Sqls.nowTimestamp()); + after.setLossAmount(request.getLossAmount()); + after.setCompensateAmount(request.getLossAmount() * Long.parseLong(ParamDao.getString("yangcai.web", "AfterPayProportion")) / 100); + // 接口参数 + after.setOutAfsId(outAfsId); + after.setProblemDesc(problemDesc); + after.setDesignId(designId); + after.setNewDesignId(request.getNewDesignId()); + after.setProblemReason(problemReason); + + // 已分配的售后单 + if (Validates.isNotEmptyBlank(afterBlamer)) + { + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, new Selector("operatorCode", afterBlamer)); + if (operator != null) + { + after.setAfterBlamer(afterBlamer); + after.setAfterStatus(AfterConstants.CS_300.value()); + after.setPicOrgId(operator.getOrgId()); + after.setPicType(1901091445480138L); + after.setProblemType(picTypeId); + after.setAfterHandler(afterHandler);// 处理人 (指派责任的人) + after.setAfterHandelTime(Sqls.nowTimestamp());// 指派责任时间 + after.setAfterModifyTime(Sqls.nowTimestamp());// 外部系统同步使用 + } + } + + List attaList = new ArrayList(); + for (ApiFile apiFile : aipFiles) + { + DesignAtta atta = new DesignAtta(); + atta.setAttaId(Ids.longId()); + atta.setAttaFlag(1);// 接口上传 + atta.setDesignId(designId); + atta.setAttaModul(FileTypeConstants.FILE_AFTERSALE.value()); + atta.setFileName(Strings.addEndsWith(apiFile.getFileName(), Strings.addStartsWith(apiFile.getFileExt(), "."))); + atta.setFileType(Strings.trimLeft(apiFile.getFileExt(), ".")); + atta.setFileSize(apiFile.getFileSize()); + atta.setOperatorCode("系统"); + atta.setOssType(1); + atta.setOssUrl(apiFile.getDownUrl()); + atta.setUploadTime(Sqls.nowTimestamp()); + + atta.setSavePath(null); + atta.setFileid(null); + attaList.add(atta); + } + + ORM.get(ZTable.class).insert(after); + if (attaList.size() > 0) + { + ORM.get(ZTable.class).insertBatch(attaList); + } + + OrderLogDao.saveOrderOperateLog(designId, "系统", "创建售后单[" + after.getDesignAfsId() + "]", EventConstants.ORDER_20.value()); + // 设置响应 + response.setDesignAfsId(after.getDesignAfsId()); + request.setResponse(response); + } + catch (Exception e) + { + log.error("创建售后订单异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc(), e); + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterSynRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterSynRequestHandler.java new file mode 100644 index 0000000..bdd72a0 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterSynRequestHandler.java @@ -0,0 +1,117 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.server.handler.after; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrderView; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.module.ApiFile; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterSynRequest; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterSynResponse; +import com.zhiqim.yangcai.design.server.request.after.RespAfter; + +public class DesignAfterSynRequestHandler extends ApiErrorCodes implements Handler +{ + private static final Log log = LogFactory.getLog(DesignAfterSynRequestHandler.class); + + @Override + public void process(DesignAfterSynRequest request) + { + DesignAfterSynResponse response = request.newResponse(); + try + { + Selector selector = new Selector("merchantId", request.getMerchantId()); + selector.addMustThenGE("afterModifyTime", request.getStartModifyTime()); + selector.addMustThenLE("afterModifyTime", request.getEndModifyTime()); + if (Validates.isNotEmptyBlank(request.getOutAfsId())) + { + selector.addMustThenLE("outAfsId", request.getOutAfsId()); + } + + if (request.getDesignAfsId() > 0) + { + selector.addMustThenLE("designAfsId", request.getDesignAfsId()); + } + + List afterList = new ArrayList(); + List orderList = ORM.get(ZView.class).list(DesignAfterOrderView.class, selector); + for (DesignAfterOrderView order : orderList) + { + RespAfter after = new RespAfter(); + after.setAfterStatus(order.getAfterStatus()); + after.setCreateTime(order.getAfterCreateTime()); + after.setDesignAfsId(order.getDesignAfsId()); + after.setDesignId(order.getDesignId()); + after.setMerchantId(order.getMerchantId()); + after.setModifyTime(order.getAfterModifyTime()); + after.setOutAfsId(order.getOutAfsId()); + after.setProblemDesc(order.getProblemDesc()); + after.setProblemType(order.getProblemType()); + after.setAfterFinishNote(order.getAfterFinishNote()); + after.setDesignComplainCheckNote(order.getAfterComplainCheckNote()); + after.setDesignerComplainReason(order.getAfterBlameReturnNote()); + // 申诉文件 + String[] attaModuls = new String[] + { + FileTypeConstants.FILE_AFTE_COMPLAIN_EVIDENCE.value() + }; + List apiFiles = new ArrayList<>(); + Selector attaSelect = new Selector("designId", order.getDesignId()); + attaSelect.addMustIn("attaModul", attaModuls); + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, attaSelect); + for (DesignAtta atta : attaList) + { + ApiFile apiFile = new ApiFile(); + apiFile.setAttaId(atta.getAttaId()); + apiFile.setDesignId(atta.getDesignId()); + apiFile.setAttaModule(atta.getAttaModul()); + apiFile.setDownUrl(atta.getOssUrl()); + apiFile.setFileName(atta.getFileName()); + apiFile.setFileExt(atta.getFileType()); + apiFile.setFileSize(atta.getFileSize()); + + if (Validates.isNotEmptyBlank(atta.getOssUrl())) + { + apiFiles.add(apiFile);// 已经转储的文件才能 做响应数据 + } + } + + after.setApiFiles(apiFiles); + afterList.add(after); + } + response.setAfterList(afterList); + request.setResponse(response); + } + catch (Exception e) + { + log.error("创建订单异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignAfsId()), code.value(), code.desc(), e); + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterUpdateRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterUpdateRequestHandler.java new file mode 100644 index 0000000..1fb23a5 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/after/DesignAfterUpdateRequestHandler.java @@ -0,0 +1,110 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.server.handler.after; + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.AfterConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.ParamDao; +import com.zhiqim.yangcai.design.dbo.after.DesignAfterOrder; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterUpdateRequest; +import com.zhiqim.yangcai.design.server.request.after.DesignAfterUpdateResponse; + +public class DesignAfterUpdateRequestHandler extends ApiErrorCodes implements Handler +{ + private static final Log log = LogFactory.getLog(DesignAfterUpdateRequestHandler.class); + + @Override + public void process(DesignAfterUpdateRequest request) + { + DesignAfterUpdateResponse response = request.newResponse(); + try + { + + long designAfsId = request.getDesignAfterId(); + long merchantId = request.getMerchantId(); + long designId = request.getDesignId(); + String outAfsId = request.getOutAfsId(); + String problemDesc = request.getProblemDesc(); + Long picTypeId = request.getPicTypeId(); + String afterBlamer = request.getAfterBlamer(); + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, new Selector("designId", designId).addMust("merchantId", merchantId)); + if (order == null) + { + Int code = ERROR_API_NOT_DESIGN_ORDER; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc()); + return; + } + + DesignAfterOrder after = ORM.get(ZTable.class).item(DesignAfterOrder.class, new Selector("designAfsId", designAfsId)); + + if (after == null) + { + Int code = ERROR_API_NOT_AFTER_ORDER; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc()); + return; + } + + after.setAfterStatus(AfterConstants.CS_300.value()); + after.setAfterModifyTime(Sqls.nowTimestamp()); + after.setLossAmount(request.getLossAmount()); + after.setCompensateAmount(request.getLossAmount() * Long.parseLong(ParamDao.getString("yangcai.web", "AfterPayProportion"))); + // 接口参数 + after.setOutAfsId(outAfsId); + after.setProblemDesc(problemDesc); + after.setDesignId(designId); + // after.setNewDesignId(request.getNewDesignId()); + + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, new Selector("operatorName", afterBlamer)); + if (operator != null) + { + after.setAfterBlamer(afterBlamer); + after.setAfterStatus(AfterConstants.CS_300.value()); + after.setPicOrgId(operator.getOrgId()); + after.setPicType(1901091445480138L); + after.setProblemType(picTypeId); + } + else + { + Int code = ERROR_API_NOT_EMPTY_BLANK; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc()); + return; + } + + ORM.get(ZTable.class).update(after); + + OrderLogDao.saveOrderOperateLog(designId, "系统", "更新售后单[" + after.getDesignAfsId() + "]", EventConstants.ORDER_20.value()); + // 设置响应 + response.setDesignAfsId(after.getDesignAfsId()); + request.setResponse(response); + } + catch (Exception e) + { + log.error("创建订单异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc(), e); + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/complain/DesignComplainSynRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/complain/DesignComplainSynRequestHandler.java new file mode 100644 index 0000000..92afdec --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/complain/DesignComplainSynRequestHandler.java @@ -0,0 +1,77 @@ +/** + * 扬彩印刷设计 + * 文件名 :DesignComplainSynRequestHandler.java + * 创建人 :gjx + * 创建时间:2019-8-17 + */ + +package com.zhiqim.yangcai.server.handler.complain; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.ComplainConstants; +import com.zhiqim.yangcai.design.dbo.complain.DesignComplainView; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.request.complain.ComplainSyn; +import com.zhiqim.yangcai.design.server.request.complain.DesignComplainSynRequest; +import com.zhiqim.yangcai.design.server.request.complain.DesignComplainSynResponse; + +/** + * 投诉单同步处理 + * + * @version 1.0 @author gjx 2019-8-17 新建与整理 + */ +public class DesignComplainSynRequestHandler extends ApiErrorCodes implements Handler +{ + private static final Log log = LogFactory.getLog(DesignComplainSynRequestHandler.class); + + @Override + public void process(DesignComplainSynRequest request) + { + DesignComplainSynResponse response = request.newResponse(); + + try + { + Selector selector = new Selector("merchantId", request.getMerchantId()); + selector.addMustThenGE("complainModifyTime", request.getStartModifyTime()); + selector.addMustThenLE("complainModifyTime", request.getEndModifyTime()); + selector.addMust("complainStatus", ComplainConstants.TX_20.value()); + + List respList = new ArrayList<>(); + List complainList = ORM.get(ZView.class).list(DesignComplainView.class, selector); + for (DesignComplainView comp : complainList) + { + ComplainSyn complain = new ComplainSyn(); + complain.setComplainId(comp.getComplainId()); + complain.setDesignId(comp.getDesignId()); + complain.setComplainStatus(comp.getComplainStatus()); + complain.setFinishImgPath(comp.getFinishImgPath()); + complain.setAssistPerson(comp.getAssistPerson()); + complain.setAssistOrg(comp.getAssistOrg()); + complain.setAssistDeptManager(comp.getAssistDeptManager()); + complain.setAssistOrgName(comp.getAssistOrgName()); + complain.setUndertakeOrgName(comp.getUndertakeOrgName()); + complain.setUndertakeDeptManager(comp.getUndertakeDeptManager()); + complain.setUndertakeOrg(comp.getUndertakeOrg()); + respList.add(complain); + } + response.setComplainList(respList); + request.setResponse(response); + } + catch (Exception e) + { + log.error("创建订单异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError("", code.value(), code.desc(), e); + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderCheckBackRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderCheckBackRequestHandler.java new file mode 100644 index 0000000..5ce91fc --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderCheckBackRequestHandler.java @@ -0,0 +1,147 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.server.handler.order; + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.aliyuncs.utils.StringUtils; +import com.zhiqim.media.dbo.MediaCanvas; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.MerchantDao; +import com.zhiqim.yangcai.design.dao.OrderCheckDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateOrder; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ErpClassService; +import com.zhiqim.yangcai.design.server.ErpClassService.statusEnum; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderCheckBackRequest; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderCheckBackResponse; + +/*** + * 订单退回接口 + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public class DesignOrderCheckBackRequestHandler extends ApiErrorCodes implements Handler { + private static final Log log = LogFactory.getLog(DesignOrderCheckBackRequestHandler.class); + + @Override + public void process(DesignOrderCheckBackRequest request) { + DesignOrderCheckBackResponse response = request.newResponse(); + long merchantId = request.getMerchantId(); + long designId = request.getDesignId(); + String backReason = request.getBackReason(); + String imgUrl = request.getImgUrl(); + + try { + // 1. 验证商户 + DesignMerchant mer = MerchantDao.get(request.getMerchantId()); + if (mer == null || !mer.isEnabled()) { + Int code = ApiErrorCodes.ERROR_API_DESIGN_MERCHANT; + request.setError(Strings.toString(designId), code.value(), + code.desc() + request.biuldKeyValueString("merchantId", merchantId)); + return; + } + + // 1.查询订单 + Selector selelct = new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", + mer.getMerchantId()); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, selelct); + if (order == null) {// 商户单订单不存在,单号必须大于0 + + Int code = ApiErrorCodes.ERROR_API_NOT_DESIGN_ORDER; + request.setError(Strings.toString(designId), code.value(), + code.desc() + request.biuldKeyValueString("designId", designId)); + return; + } + + // 2.检查状态 ERROR_API_NOT_SUPPORT_BY_BUSINESS + if (order.getStatus() < StatusConstants.ORDER_55.value())// 未定稿 不能退回 + {// 不是已完成的的订单不允许退回 + Int code = ApiErrorCodes.ERROR_API_NOT_SUPPORT_BY_BUSINESS; + request.setError(Strings.toString(designId), code.value(), + code.desc() + request.biuldKeyValueString("designId", designId)); + return; + } + + // 3.检查参数 + if (Validates.isEmptyBlank(backReason) || backReason.length() > 1000) {// 商户订单信息错误,订单信息不能为空且,不能超过200个字符 + + Int code = ApiErrorCodes.ERROR_API_PARAM_TO_LONG; + request.setError(Strings.toString(designId), code.value(), + code.desc() + request.biuldKeyValueString("backReason", backReason)); + return; + } + + // 操作订单表 + Updater updater = new Updater().addMust("designId", designId); + updater.addField("status", StatusConstants.ORDER_30.value()); + updater.addField("checkBackReason", backReason); + updater.addField("checkBackPictureUrl", imgUrl); + updater.addField("modifyTime", Sqls.nowTimestamp()); + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 删除成品文件 + Selector attaSel = new Selector(); + attaSel.addMust("designId", designId); + attaSel.addMust("attaModul", FileTypeConstants.FILE_END.value()); + DesignAtta designAtta = ORM.get(ZTable.class).item(DesignAtta.class, attaSel); + if (designAtta != null) { + OrderCheckDao.doDeleteEndFile(designAtta); + } + + DesTemplateOrder tOrder = ORM.get(ZTable.class).item(DesTemplateOrder.class, designId); + if (tOrder != null) { + // 3.更新模板为可编辑状态 + Updater cUpdater = new Updater(); + cUpdater.addMust("mediaId", tOrder.getDesignMediaId()); + cUpdater.addField("isEdit", 0); // 不可编辑 + cUpdater.addField("updateTime", DateTimes.getDateTimeString()); + ORM.get(ZTable.class).update(MediaCanvas.class, cUpdater); + + // 4 更新模板 状态 80 为 20 + Updater mUpdater = new Updater(); + mUpdater.addMust("mediaId", tOrder.getDesignMediaId()); + mUpdater.addField("templateType", 20); // 我的模板 + ORM.get(ZTable.class).update(MediaTemplate.class, mUpdater); + } + if (!StringUtils.isEmpty(order.getTids())) { + new ErpClassService(order.getTids(), order.getDesigner(), statusEnum.TO_BE_DESIGNEDING.getCode()); + } + // 日志信息 + OrderLogDao.saveOrderOperateLog(designId, "系统", "[接收到审稿退回]:" + backReason, EventConstants.ORDER_10.value()); + + // 响应数据 + response.setSuccess(true); + request.setResponse(response); + } catch (Exception e) { + log.error("订单审核退回异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc(), e); + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderCreateRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderCreateRequestHandler.java new file mode 100644 index 0000000..94d101e --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderCreateRequestHandler.java @@ -0,0 +1,320 @@ +package com.zhiqim.yangcai.server.handler.order; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.BuyerDao; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.MerchantDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.SelfOrder; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.module.ApiFile; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderCreateRequest; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderCreateResponse; +import com.zhiqim.yangcai.dispatch.dao.DispatchTaskDao; +import com.zhiqim.yangcai.util.RedisUtils; + +import redis.clients.jedis.Jedis; + +/*** + * 创建订单处理器 + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public class DesignOrderCreateRequestHandler extends ApiErrorCodes implements Handler { + private static final Log log = LogFactory.getLog(DesignOrderCreateRequestHandler.class); + + @Override + public void process(DesignOrderCreateRequest request) { + DesignOrderCreateResponse response = request.newResponse(); + try { + long merchantId = request.getMerchantId(); + long industryId = request.getIndustryId(); + long designType = request.getDesignType(); + int draftType = request.getDraftType(); + // 1. 验证商户 + DesignMerchant mer = MerchantDao.get(request.getMerchantId()); + if (mer == null || !mer.isEnabled()) { + Int code = ApiErrorCodes.ERROR_API_DESIGN_MERCHANT; + request.setError(Strings.toString(request.getOutId()), code.value(), + code.desc() + request.biuldKeyValueString("merchantId", merchantId)); + return; + } + // 2.验证订单类型 + DesignType type = DesignTypeDao.get(designType); + if (type == null) {// 商户 设计参数错误 不支持的设计类型 + Int code = ERROR_API_PARAM_DATA; + request.setError(Strings.toString(request.getOutId()), code.value(), + code.desc() + request.biuldKeyValueString("designType", designType)); + return; + } + + // 3.稿件类型 + Int draft = DraftConstants.getTypeItem(draftType); + if (draft == null) {// 商户 稿件参数错误 不支持的稿件类型 + Int code = ERROR_API_PARAM_DATA; + request.setError(Strings.toString(request.getOutId()), code.value(), + code.desc() + request.biuldKeyValueString("draftType", draftType)); + return; + } + Jedis jedis = RedisUtils.getConn(); + String lockKey = "CreateOrder:" + request.getTids() + "_lock"; + + try { + Long setnx = jedis.setnx(lockKey, "1"); + if (setnx == 1) { + // 过期时间 单位 秒 + jedis.expire(lockKey, 30); + } else { + Int code = ERROR_API_DATA_BE_EXISTS; + request.setError(Strings.toString(request.getTids()), code.value(), + code.desc() + request.biuldKeyValueString("tids", request.getTids())); + return; + } + } catch (Exception e) { + log.error("订单创建【" + request.getTids() + "】:创建订单出现异常!", e); + return; + } finally { + jedis.close(); + } + DesignOrder order1 = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector().addMust("merchantId", merchantId).addMust("tids", request.getTids())); + if (order1 != null) {// 商户单订单存在 + Int code = ERROR_API_DATA_BE_EXISTS; + request.setError(Strings.toString(request.getTids()), code.value(), + code.desc() + request.biuldKeyValueString("tids", request.getTids())); + return; + } + // 4.行业 + /* + * if (industryId > 0L) { DesignIndustry industry = + * Global.get(DesignIndustryCache.class).getIndustry(industryId); if (industry + * == null) {// 商户 行业参数错误 不支持的行业 Int code = ERROR_API_PARAM_DATA; + * request.setError(Strings.toString(request.getOutId()), code.value(), + * code.desc() + request.biuldKeyValueString("industryId", industryId)); return; + * } } + */ + + /* + * // 5.尺寸 DesignSize designSize = DesignSizeDao.get(designType, + * request.getDesignWidth(), request.getDesignHeight(), + * request.getDesignSide()); if (designSize == null) { Int code = + * ERROR_API_PARAM_DATA; request.setError(Strings.toString(request.getOutId()), + * code.value(), code.desc() + "不支持的尺寸," + + * request.biuldKeyValueString("designWidth, designHeight", + * request.getDesignWidth(), request.getDesignHeight())); return; } + */ + + String designer = request.getDesigner(); + // 判断订单是否已经存在 + + // 订单接口请求数据信息 + DesignOrder order = new DesignOrder(); + order.setMerchantId(request.getMerchantId()); + order.setOutId(request.getOutId()); + order.setTypeId(designType); + order.setIndustryId(industryId > 0 ? industryId : 1980727080001L); + order.setDraftType(draftType); + order.setDesignPage(request.getDesignPage()); + order.setOrderText(request.getOrderText()); + order.setPrintSpecial(request.getPrintSpecial()); + order.setDesignWidth(request.getDesignWidth());// 包含出血 + order.setDesignHeight(request.getDesignHeight());// 包含出血 + order.setPrintKs(request.getPrintKs()); + order.setPrintMs(request.getPrintMs()); + order.setPrintWidth(request.getPrintWidth());// 不包含出血 + order.setPrintHeight(request.getPrintHeight());// 不包含出血 + order.setAmount(Amounts.toFen(Strings.valueOf(request.getAmount()), 0)); + order.setUrgent(request.isUrgent()); + order.setUserContact(request.getUserContact()); + order.setUserMobile(request.getUserMobile()); + order.setUserQq(request.getUserQq()); + order.setUserWx(request.getUserWx()); + order.setUserText(request.getUserText()); + order.setUserNotice(request.getUserNotice()); + order.setShopNick(request.getShopNick()); + order.setBuyerNick(request.getBuyerNick()); + order.setServicesMessage(request.getServicesMessage()); + order.setDesignCopies(request.getDesignCopies()); + order.setReceiverName(request.getReceiverName()); + order.setReceiverMobile(request.getReceiverMobile()); + order.setReceiverState(request.getReceiverState()); + order.setReceiverCity(request.getReceiverCity()); + order.setReceiverDistrict(request.getReceiverDistrict()); + order.setReceiverAddress(request.getReceiverAddress()); + order.setCreateTime(Sqls.nowTimestamp()); + order.setModifyTime(Sqls.nowTimestamp()); + order.setStatus(StatusConstants.ORDER_10.value());// 默认未分拣状态 +// order.setDesignId(request.getOutId());// 与外部业务系统单号保持一致 + order.setDesignId(Ids.longId());// 与外部业务系统单号保持一致 +// order.setCreater(request.getCreater()); + order.setTids(request.getTids()); + order.setTid(request.getTid()); + order.setOrderSrc(request.getOrderSrc()); +// order.setExpressCode(request.getExpressCode()); + order.setOnlyDesign(request.isOnlyDesign()); + order.setHighQualityOrder(request.isHighQualityOrder()); + order.setShowRedMark(request.getShowRedMark()); + if (Validates.isNotEmpty(designer)) {// 指定设计师 + order.setDesigner(designer); + order.setStatus(StatusConstants.ORDER_30.value()); + order.setOrgReceiveTime(Sqls.nowTimestamp()); + order.setDesignReceiveTime(Sqls.nowTimestamp()); + order.setDesignBeginTime(Sqls.nowTimestamp()); + order.setReceiveType(2); + order.setOrgId(ORM.get(ZTable.class).item(ZmrOperator.class, designer).getOrgId()); + } + + List apiFiles = request.getApiFiles(); // 附件数据 + List attaList = new ArrayList(); + for (ApiFile apiFile : apiFiles) { + if (apiFile != null) { + DesignAtta atta = new DesignAtta(); + atta.setAttaId(Ids.longId()); + atta.setDesignId(order.getDesignId()); + atta.setAttaFlag(1);// 接口上传 + atta.setAttaModul(FileTypeConstants.FILE_CUSTOM.value()); + atta.setFileName(Strings.addEndsWith(Strings.trim(apiFile.getFileName()), + Strings.addStartsWith(apiFile.getFileExt(), "."))); + atta.setFileType(Strings.trimLeft(Strings.trim(apiFile.getFileExt()), ".")); + atta.setFileSize(apiFile.getFileSize()); + atta.setOperatorCode("系统"); + atta.setOssType(1);// OSS任务无需上传 + atta.setOssUrl(apiFile.getDownUrl()); + atta.setUploadTime(Sqls.nowTimestamp()); + atta.setFileid(null); + atta.setSavePath(null); + + attaList.add(atta); + } + } + + // 创建订单时判断是否是老用户 + if (Validates.isNotEmpty(DispatchTaskDao.isOldUserOrder(order))) { + order.setOrderFlag(1); + } + + // 插入用户订单数 + if (Validates.isNotEmptyBlank(request.getBuyerNick())) { + int orderCount = BuyerDao.getOrderCount(request.getBuyerNick()); + order.setIsOldUser(orderCount > 0 ? 1 : 0); + BuyerDao.doAddOrUpdateOrderCount(request.getBuyerNick(), orderCount + 1); + } + + // 插入设计单价 + // 排除标准自来稿 + + if (Validates.isNotEmpty(order.getOrderText())) { + try { + String regex = "\\b(\\d+x\\d+(mm|cm))\\b"; + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(order.getOrderText()); + if (matcher.find()) { + String match = matcher.group(0); + double designWidth = 0.00; + double designHeight = 0.00; + if (match.contains("cm")) { + match = match.replace("cm", ""); + String[] a = match.split("x"); + designWidth = Double.valueOf(a[0]) * 10; + designHeight = Double.valueOf(a[1]) * 10; + } + if (match.contains("mm")) { + match = match.replace("mm", ""); + String[] a = match.split("x"); + designWidth = Double.valueOf(a[0]); + designHeight = Double.valueOf(a[1]); + } + order.setDesignWidth(designWidth); + order.setDesignHeight(designHeight); + } + String regex2 = "(\\d+)款"; + pattern = Pattern.compile(regex2); + matcher = pattern.matcher(order.getOrderText()); + if (matcher.find()) { + String match = matcher.group(1); + order.setDesignCopies(Integer.valueOf(match)); + } + } catch (Exception e) { + log.error("设置订单设计尺寸异常" + order.getOrderText(), e); + } + } + if (draftType != DraftConstants.DRAFT_STANDARD.value()) { + long designPrice = StatDao.calculateOrderPerformance(order); + order.setDesignPrice(designPrice); + } + // 数据插入 + ORM.get(ZTable.class).replace(order); + SelfOrder selfOrder = new SelfOrder(); + selfOrder.setDesignId(order.getDesignId()); + selfOrder.setDefaultLabel(true); + selfOrder.setCustomerQrcodeUrl(request.getCustomerQrcodeUrl()); + if (request.isOnlyDesign()) // 仅设计取产品费,否则取设计费 + { + if (Validates.isNotEmpty(request.getDesignAmount())) { + selfOrder.setDesignCost(request.getDesignAmount()); + } else { + selfOrder.setDesignCost(request.getProductAmount()); + } + } else { + selfOrder.setDesignCost(request.getDesignAmount()); + } + ORM.get(ZTable.class).replace(selfOrder); + + // 附件数据插入 先删除 客户端所有 通过接口传的数据,在重新插入 + ORM.get(ZTable.class).delete(DesignAtta.class, new Selector("designId", order.getDesignId()) + .addMust("attaModul", FileTypeConstants.FILE_CUSTOM.value()).addMust("attaFlag", 1)); + if (attaList.size() > 0) { + ORM.get(ZTable.class).insertBatch(attaList); + } + + // 响应数据 + response.setMerchantId(order.getMerchantId()); + response.setDesignId(order.getDesignId()); + request.setResponse(response); + + if (Validates.isNotEmpty(designer)) {// 指定设计师 + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", + "创建订单,客服【" + order.getCreater() + "】指定订单给设计师【" + designer + "】", + EventConstants.ORDER_3.value()); + } else { + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", "创建订单", EventConstants.ORDER_1.value()); + } + + log.info("[%s]订单[%s]创建成功", mer.getMerchantName(), order.getDesignId()); + } catch (Exception e) { + log.error("创建订单异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getOutId()), code.value(), code.desc(), e); + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderRecreateRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderRecreateRequestHandler.java new file mode 100644 index 0000000..e1a86a9 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderRecreateRequestHandler.java @@ -0,0 +1,146 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.server.handler.order; + +import java.util.List; + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.aliyuncs.utils.StringUtils; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.MerchantDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ErpClassService; +import com.zhiqim.yangcai.design.server.ErpClassService.statusEnum; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderRecreateRequest; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderRecreateResponse; + +/*** + * 创建补单处理 + * + * @version v1.0.0 @author longguizui 2019-1-13 新建与整理 + */ +public class DesignOrderRecreateRequestHandler extends ApiErrorCodes implements Handler { + private static final Log log = LogFactory.getLog(DesignOrderRecreateRequestHandler.class); + + @Override + public void process(DesignOrderRecreateRequest request) { + DesignOrderRecreateResponse response = request.newResponse(); + try { + long merchantId = request.getMerchantId(); + String newOutId = request.getNewOutId(); + long designSrcId = request.getDesignSrcId(); + String redesignReason = request.getRedesignReason(); + // 1. 验证商户 + DesignMerchant mer = MerchantDao.get(request.getMerchantId()); + if (mer == null || !mer.isEnabled()) { + Int code = ApiErrorCodes.ERROR_API_DESIGN_MERCHANT; + request.setError(Strings.toString(request.getNewOutId()), code.value(), + code.desc() + request.biuldKeyValueString("merchantId", merchantId)); + return; + } + // 2.验证原订单号 + DesignOrder src_order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("merchantId", mer.getMerchantId()).addMust("designId", designSrcId)); + if (src_order == null) {// 商户单号错误 + Int code = ApiErrorCodes.ERROR_API_NOT_DESIGN_ORDER; + request.setError(Strings.toString(request.getNewOutId()), code.value(), code.desc() + + request.biuldKeyValueString("merchantId, designSrcId", mer.getMerchantId(), designSrcId)); + return; + } + + DesignOrder newOrder = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("merchantId", mer.getMerchantId()).addMust("designId", newOutId)); + if (newOrder != null) { + Int code = ApiErrorCodes.ERROR_API_DATA_BE_EXISTS; + request.setError(Strings.toString(request.getNewOutId()), code.value(), + code.desc() + request.biuldKeyValueString("newOutId", newOutId)); + return; + } + +// long redesignId = newOutId; + DesignOrder reOrder = new DesignOrder(); + Objects.copyDeep(src_order, reOrder); + reOrder.setCheckBackReason(null); + reOrder.setCheckBackPictureUrl(null); + reOrder.setChecker(null); + reOrder.setDesignId(Ids.longId()); + reOrder.setCreateTime(Sqls.nowTimestamp()); + reOrder.setModifyTime(Sqls.nowTimestamp()); + reOrder.setStatus(StatusConstants.ORDER_30.value()); // 正在设计 + reOrder.setDesigner(src_order.getDesigner()); // 设置设计师 + reOrder.setDesignReceiveTime(Sqls.nowTimestamp()); // 设置领单时间 + reOrder.setDesignBeginTime(Sqls.nowTimestamp()); // 设置开始设计时间 + reOrder.setDesignExclude(src_order.getDesignExclude()); // 需要排除的设计师 + reOrder.setReDesignCreateNote( + "由于原因【" + redesignReason + "】,原订单[" + src_order.getDesignId() + "]重新设计, 新单[" + newOutId + "]");// 创建重新设计原因 + reOrder.setReDesignSrcId(designSrcId); + reOrder.setOutId(newOutId); + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector("designId", src_order.getDesignId())); + for (DesignAtta designAtta : attaList) { + designAtta.setAttaId(Ids.longId()); + designAtta.setDesignId(reOrder.getDesignId()); + } + + // 插入设计单价 + // 排除标准自来稿 + if (Validates.isNotEmpty(reOrder.getDraftType())) { + if (reOrder.getDraftType() != DraftConstants.DRAFT_STANDARD.value()) { + long designPrice = StatDao.calculateOrderPerformance(reOrder); + reOrder.setDesignPrice(designPrice); + } + } else { + reOrder.setDesignPrice(0L); + } + + ORM.get(ZTable.class).replace(reOrder); + ORM.get(ZTable.class).replaceBatch(attaList); + if (!StringUtils.isEmpty(reOrder.getTids())) { + new ErpClassService(reOrder.getTids(), reOrder.getDesigner(), statusEnum.TO_BE_DESIGNEDING.getCode()); + } + OrderLogDao.saveOrderOperateLog(src_order.getDesignId(), "系统", + "[接收到补单]由于原因【" + redesignReason + "】需要重新设计,新设计单号: " + newOutId, EventConstants.ORDER_17.value()); + OrderLogDao.saveOrderOperateLog(reOrder.getDesignId(), "系统", + "[接收到补单]由于原因【" + redesignReason + "】,原订单[" + src_order.getDesignId() + "]重新设计", + EventConstants.ORDER_3.value()); + + // 响应数据 + response.setMerchantId(reOrder.getMerchantId()); + response.setNewDesignId(reOrder.getDesignId()); + request.setResponse(response); + log.info("[%s]补单[%s]创建成功", mer.getMerchantName(), reOrder.getDesignId()); + } catch (Exception e) { + log.error("创建订单异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getNewOutId()), code.value(), code.desc(), e); + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderRefundRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderRefundRequestHandler.java new file mode 100644 index 0000000..33a9cc4 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderRefundRequestHandler.java @@ -0,0 +1,116 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.server.handler.order; + +import java.util.List; +import java.util.TreeMap; + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.aliyuncs.utils.StringUtils; +import com.zhiqim.media.dbo.MediaCanvas; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.MerchantDao; +import com.zhiqim.yangcai.design.dao.OrderCheckDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.design.DesignMerchant; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.template.DesTemplateOrder; +import com.zhiqim.yangcai.design.dbo.template.MediaTemplate; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.ErpClassService; +import com.zhiqim.yangcai.design.server.ErpClassService.statusEnum; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderCheckBackRequest; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderCheckBackResponse; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderRefundRequest; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderRefundResponse; + +/*** + * 订单退回接口 + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public class DesignOrderRefundRequestHandler extends ApiErrorCodes implements Handler { + private static final Log log = LogFactory.getLog(DesignOrderRefundRequestHandler.class); + + @Override + public void process(DesignOrderRefundRequest request) { + DesignOrderRefundResponse response = request.newResponse(); + long merchantId = request.getMerchantId(); + long designId = request.getDesignId(); + String backReason = request.getBackReason(); + String imgUrl = request.getImgUrl(); + String ctid = request.getTids(); + + try { + // 1. 验证商户 + DesignMerchant mer = MerchantDao.get(request.getMerchantId()); + if (mer == null || !mer.isEnabled()) { + Int code = ApiErrorCodes.ERROR_API_DESIGN_MERCHANT; + request.setError(Strings.toString(designId), code.value(), + code.desc() + request.biuldKeyValueString("merchantId", merchantId)); + return; + } + + // 1.查询订单 + + Selector selelct = new Selector().addMaybeLike("orderText", + ctid); + /*tids*/ + List order = ORM.get(ZTable.class).list(DesignOrder.class, selelct); + + if (order.size()<0) {// 商户单订单不存在,单号必须大于0 + + Int code = ApiErrorCodes.ERROR_API_NOT_DESIGN_ORDER; + request.setError(Strings.toString(designId), code.value(), + code.desc() + request.biuldKeyValueString("designId", designId)); + return; + }else{ + for (DesignOrder designOrder : order) { + Updater updater = new Updater(); + updater.addMust("designId", designOrder.getDesignId()); + updater.addField("status", StatusConstants.ORDER_34.value()); + designOrder.setStatus(-100); + ORM.get(ZTable.class).update(DesignOrder.class,updater); + + } + // 日志信息 + OrderLogDao.saveOrderOperateLog(designId, "系统", "[退款订单同步]:" + backReason, EventConstants.ORDER_39.value()); + + // 响应数据 + response.setSuccess(true); + request.setResponse(response); + return; + + } + + + + } catch (Exception e) { + log.error("退款订单同步出错", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc(), e); + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderSynRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderSynRequestHandler.java new file mode 100644 index 0000000..73937cf --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/DesignOrderSynRequestHandler.java @@ -0,0 +1,163 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.server.handler.order; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignSelfView; +import com.zhiqim.yangcai.design.dbo.order.OrdProgressNote; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.module.ApiFile; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderSynRequest; +import com.zhiqim.yangcai.design.server.request.order.DesignOrderSynResponse; +import com.zhiqim.yangcai.design.server.request.order.RespOrder; + +/*** + * 订单查询处理器 + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public class DesignOrderSynRequestHandler extends ApiErrorCodes implements Handler +{ + private static final Log log = LogFactory.getLog(DesignOrderSynRequestHandler.class); + + @Override + public void process(DesignOrderSynRequest request) + { + DesignOrderSynResponse response = request.newResponse(); + try + { + List orderList = new ArrayList(); + Selector selector = new Selector(); + selector.addMust("merchantId", request.getMerchantId()); + if (request.getDesignId() > 0) + { + selector.addMust("designId", request.getDesignId()); + } + + if (request.getOutId() > 0) + { + selector.addMust("outId", request.getOutId()); + } + + selector.addMustThenGE("modifyTime", request.getStartModifyTime()); + selector.addMustThenLE("modifyTime", request.getEndModifyTime()); + List list = ORM.get(ZView.class).list(DesignSelfView.class, selector); + for (DesignSelfView t : list) + { + // 订单 + RespOrder o = new RespOrder(); + o.setCanceler(t.getCanceler()); + o.setCancelReason(t.getCancelReason()); + o.setCancelTime(t.getCancelTime()); + o.setDesignBeginTime(t.getDesignBeginTime()); + o.setDesignDraftTime(t.getDesignDraftTime()); + o.setDesignEndTime(t.getDesignEndTime()); + o.setDesigner(t.getDesigner()); + o.setDesignExclude(o.getDesignExclude()); + o.setDesignId(t.getDesignId()); + o.setDesignKeepDuration(t.getDesignKeepDuration()); + o.setDesignPauseReason(t.getDesignPauseReason()); + o.setDesignPauseTime(t.getDesignPauseTime()); + o.setDesignReceiveTime(t.getDesignReceiveTime()); + o.setDesignRejectReason(t.getDesignRejectReason()); + o.setDesignRequestReason(t.getDesignRequestReason()); + o.setMerchantId(t.getMerchantId()); + o.setModifyTime(t.getModifyTime()); + o.setRequestRefoundAcceptReason(t.getRequestRefoundAcceptReason()); + o.setRequestTime(t.getRequestTime()); + o.setStatus(t.getStatus()); + o.setReceiveType(t.getReceiveType()); + o.setIndustryId(t.getIndustryId()); + o.setOrgReceiveTime(t.getOrgReceiveTime()); + o.setChecker(t.getChecker()); + + // 进度备注 + OrdProgressNote note = ORM.get(ZTable.class).item(OrdProgressNote.class, + new Selector("designId", t.getDesignId()).addOrderbyDesc("createTime")); + o.setProgressNote(note == null ? "" : note.getOrdProgressNote()); + // 文件 + + if (o.getStatus() == StatusConstants.ORDER_70.value()) + { + + String[] attaModuls = new String[] + { + FileTypeConstants.FILE_END.value(), FileTypeConstants.FILE_DESGIN.value(), FileTypeConstants.FILE_WORK.value() + }; + + List apiFiles = new ArrayList<>(); + List attaList = ORM.get(ZTable.class).list(DesignAtta.class, + new Selector("designId", o.getDesignId()).addMustIn("attaModul", attaModuls)); + for (DesignAtta atta : attaList) + { + if (FileTypeConstants.FILE_END.value().equalsIgnoreCase(atta.getAttaModul())) + {// 成品文件 + o.setEndFileUrl(atta.getOssUrl()); + o.setEndFileExt(atta.getFileType()); + o.setEndFileLength(atta.getFileSize()); + } + else if (FileTypeConstants.FILE_DESGIN.value().equalsIgnoreCase(atta.getAttaModul())) + {// 设计文件 + o.setDesignFileUrl(atta.getOssUrl()); + o.setDesignFileExt(atta.getFileType()); + o.setDesignFileLength(atta.getFileSize()); + } + + ApiFile apiFile = new ApiFile(); + apiFile.setAttaId(atta.getAttaId()); + apiFile.setDesignId(atta.getDesignId()); + apiFile.setAttaModule(atta.getAttaModul()); + apiFile.setDownUrl(atta.getOssUrl()); + apiFile.setFileName(atta.getFileName()); + apiFile.setFileExt(atta.getFileType()); + apiFile.setFileSize(atta.getFileSize()); + + // 已经上传到OSS 的文件 + if (!Validates.isEmptyBlank(atta.getOssUrl())) + { + apiFiles.add(apiFile); + } + } + + o.setApiFiles(apiFiles); + } + + orderList.add(o); + } + // 响应数据 + response.setMerchantId(request.getMerchantId()); + response.setOrderList(orderList); + request.setResponse(response); + } + catch (Exception e) + { + log.error("同步异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc(), e); + } + + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/update/DesignOrderUpdateInfoRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/update/DesignOrderUpdateInfoRequestHandler.java new file mode 100644 index 0000000..562a20a --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/update/DesignOrderUpdateInfoRequestHandler.java @@ -0,0 +1,188 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.server.handler.order.update; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.design.DesignIndustry; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.dbo.order.SelfOrder; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.request.order.update.DesignOrderUpdateInfoRequest; +import com.zhiqim.yangcai.design.server.request.order.update.DesignOrderUpdateInfoResponse; + +/*** + * 订单信息修改处理器 订单列表 + * + * @version v1.0.0 @author lgz 2019-1-17 新建与整理 + */ +public class DesignOrderUpdateInfoRequestHandler extends ApiErrorCodes + implements Handler { + private static final Log log = LogFactory.getLog(DesignOrderUpdateInfoRequestHandler.class); + + @Override + public void process(DesignOrderUpdateInfoRequest request) { + DesignOrderUpdateInfoResponse response = request.newResponse(); + try { + // 查询条件 + long merchantId = request.getMerchantId();// 是 +// long designId = order.getDesignId();// 是 + String outId = request.getOutId(); + long industryId = request.getIndustryId();// 是 + boolean isUrgent = request.isUrgent();// 是 + + String userMobile = request.getUserMobile();// 否 64 + String userQq = request.getUserQq();// 否 64 + String userWx = request.getUserWx();// 否 64 + String printSpecial = request.getPrintSpecial();// 否 100 + String servicesMessage = request.getServicesMessage();// 否 500 + String isHighQualityOrder = request.isHighQualityOrder();// 否 + String customerQrcodeUrl = request.getCustomerQrcodeUrl();// 否 群服务二维码 + String orderText = request.getOrderText();// 订单备注 + boolean isChange = request.isChange();// 是否改稿 + boolean isBack = request.isBack();// 是否改稿 + String returnReason = request.getReturnReason(); + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("tids", outId).addMust("merchantId", merchantId)); + if (order == null) {// 商户单订单不存在,单号必须大于0 + Int code = ERROR_API_NOT_DESIGN_ORDER; + request.setError(Strings.toString(request.getDesignId()), code.value(), + code.desc() + request.biuldKeyValueString("designId,merchantId", outId, merchantId)); + return; + } + long designId = order.getDesignId();// 是 + // 不是修改优质订单信息时判断行业 + if (Validates.isEmpty(isHighQualityOrder)) { + /* + * DesignIndustry industry = + * Global.get(DesignIndustryCache.class).getIndustry(industryId); if (industry + * == null) {// 商户 行业参数错误 不支持的行业 Int code = ERROR_API_PARAM_DATA; + * request.setError(Strings.toString(request.getDesignId()), code.value(), + * code.desc() + request.biuldKeyValueString("industryId", industryId)); return; + * } + */ + } + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addMust("merchantId", merchantId); + String updateMsg; + // 修改优质订单时不修改其他数据 + if (Validates.isNotEmpty(isHighQualityOrder)) { + if ("true".equalsIgnoreCase(isHighQualityOrder)) { + updater.addField("isHighQualityOrder", true); + updateMsg = "订单修改优质订单"; + } else { + updater.addField("isHighQualityOrder", false); + updateMsg = "订单取消优质订单"; + } + } else { + updater.addField("isUrgent", isUrgent); + if (Validates.isNotEmptyBlank(orderText)) { + updater.addField("orderText", orderText); + try { + String regex = "\\b(\\d+x\\d+(mm|cm))\\b"; + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(orderText); + if (matcher.find()) { + String match = matcher.group(0); + double designWidth = 0.00; + double designHeight = 0.00; + if (match.contains("cm")) { + match = match.replace("cm", ""); + String[] a = match.split("x"); + designWidth = Double.valueOf(a[0]) * 10; + designHeight = Double.valueOf(a[1]) * 10; + } + if (match.contains("mm")) { + match = match.replace("mm", ""); + String[] a = match.split("x"); + designWidth = Double.valueOf(a[0]); + designHeight = Double.valueOf(a[1]); + } + updater.addField("designWidth", designWidth); + updater.addField("designHeight", designHeight); + order.setDesignWidth(designWidth); + order.setDesignHeight(designHeight); + } + String regex2 = "(\\d+)款"; + pattern = Pattern.compile(regex2); + matcher = pattern.matcher(orderText); + if (matcher.find()) { + String match = matcher.group(1); + updater.addField("designCopies", Integer.valueOf(match)); + order.setDesignCopies(Integer.valueOf(match)); + } + if (order.getDraftType() != DraftConstants.DRAFT_STANDARD.value()) { + long designPrice = StatDao.calculateOrderPerformance(order); + updater.addField("designPrice", designPrice); + } + } catch (Exception e) { + log.error("设置订单设计尺寸异常" + orderText, e); + } + + } + if (Validates.isNotEmpty(isChange)) { + updater.addField("isChange", isChange); + } + if (Validates.isNotEmpty(isBack)) { + updater.addField("isBack", isBack); + } + if (Validates.isNotEmpty(isBack) && isBack) { + updater.addField("status", StatusConstants.ORDER_30.value()); + } + if (Validates.isNotEmpty(returnReason)) { + updater.addField("returnReason", returnReason); + } + updateMsg = "订单信息修改"; + } + if (Validates.isNotEmptyBlank(userMobile)) { + updater.addField("userMobile", userMobile); + } + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + Updater updater1 = new Updater(); + updater1.addMust("designId", designId); + updater1.addField("customerQrcodeUrl", customerQrcodeUrl); + ORM.get(ZTable.class).update(SelfOrder.class, updater1); + + OrderLogDao.saveOrderOperateLog(designId, "系统", updateMsg, EventConstants.ORDER_20.value()); + // 响应数据 + response.setUpdated(true); + request.setResponse(response); + } catch (Exception e) { + log.error("[" + request.getMerchantId() + "][" + request.getMethod() + "]更新订单信息异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc(), e); + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/update/DesignOrderUpdateSpecificationRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/update/DesignOrderUpdateSpecificationRequestHandler.java new file mode 100644 index 0000000..a688f71 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/update/DesignOrderUpdateSpecificationRequestHandler.java @@ -0,0 +1,386 @@ +package com.zhiqim.yangcai.server.handler.order.update; + +import java.util.HashMap; +import java.util.List; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DesignTypeDao; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dao.StatDao; +import com.zhiqim.yangcai.design.dbo.design.DesignType; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroup; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatchValue; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupValue; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.messagebox.ZqmMessageProducerHandler; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.request.order.update.DesignOrderUpdateSpecificationRequest; +import com.zhiqim.yangcai.design.server.request.order.update.DesignOrderUpdateSpecificationResponse; +import com.zhiqim.yangcai.dispatch.model.AnalysisResult; +import com.zhiqim.yangcai.dispatch.model.DesignerGroupDataModel; +import com.zhiqim.yangcai.dispatch.model.DesignerScoreModel; +import com.zhiqim.yangcai.util.DesignerGroupDispatchUtil; + +import yangcai.messagebox.constant.MessageSysType; +import yangcai.messagebox.constant.MessageTopicType; +import yangcai.messagebox.model.MessageBusi; + +/*** + * 订单信息修改处理器 + * + * @version v1.0.0 @author longguizhi 2018-12-1 新建与整理 + */ +public class DesignOrderUpdateSpecificationRequestHandler extends ApiErrorCodes implements Handler +{ + private static final Log log = LogFactory.getLog(DesignOrderUpdateSpecificationRequestHandler.class); + + @Override + public void process(DesignOrderUpdateSpecificationRequest request) + { + DesignOrderUpdateSpecificationResponse response = request.newResponse(); + try + { + // 查询条件 + long designId = request.getDesignId(); + long merchantId = request.getMerchantId(); + long typeId = request.getTypeId(); + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchantId)); + if (order == null) + {// 商户单订单不存在,单号必须大于0 + Int code = ERROR_API_NOT_DESIGN_ORDER; + request.setError(Strings.toString(request.getDesignId()), code.value(), + code.desc() + request.biuldKeyValueString("designId,merchantId", designId, merchantId)); + return; + } + + if (order.getStatus() < StatusConstants.ORDER_10.value() || order.getStatus() > StatusConstants.ORDER_50.value()) + {// 当前状态不允许操作 + Int code = ERROR_API_ILLEGAL_STATUS; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc() + request.biuldKeyValueString("status", order.getStatus())); + return; + } + + // 2.验证订单类型 + DesignType type = DesignTypeDao.get(typeId); + if (type == null) + {// 商户 设计参数错误 不支持的设计类型 + Int code = ERROR_API_PARAM_DATA; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc() + request.biuldKeyValueString("typeId", typeId)); + return; + } + + // 稿件类型 + int draftType = request.getDraftType();// 仅支持 0:标准自来稿,1:改稿自来稿,2:普通设计,3:高级设计 + if (DraftConstants.getTypeItem(draftType) == null) + { + Int code = ERROR_API_PARAM_DATA; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc() + request.biuldKeyValueString("draftType", draftType)); + return; + + } + + // ***************************************************************** + // *************************修改报价部分******************************* + // ***************************************************************** + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addMust("merchantId", merchantId); + + DesignOrder changeOrder = new DesignOrder(); + Objects.copyDeep(order, changeOrder); + + // 尺寸 + double designWidth = request.getDesignWidth();// 标准宽 + double designHeight = request.getDesignHeight();// 标准高 + if (designWidth > 0) + { + updater.addField("designWidth", designWidth); + changeOrder.setDesignWidth(designWidth); + } + if (designHeight > 0) + { + updater.addField("designHeight", designHeight); + changeOrder.setDesignHeight(designHeight); + } + + // 自定一尺寸 不含出血 + double printWidth = request.getPrintWidth();// 特殊尺寸宽 + double printHeight = request.getPrintHeight();// 特殊尺寸高 + printWidth = printWidth <= 0 ? 0 : printWidth; + printHeight = printHeight <= 0 ? 0 : printHeight; + updater.addField("printWidth", printWidth); + updater.addField("printHeight", printHeight); + + // 款模 + int printKs = request.getPrintKs(); + int printMs = request.getPrintMs(); + if (printKs > 0) + { + updater.addField("printKs", printKs); + changeOrder.setPrintKs(printKs); + } + if (printMs > 0) + { + updater.addField("printMs", printMs); + changeOrder.setPrintMs(printMs); + } + + // 面数 + int designPage = request.getDesignPage(); + if (designPage > 0) + { + updater.addField("designPage", designPage); + changeOrder.setDesignPage(designPage); + } + + // 订单信息 && 后加工 + String orderText = request.getOrderText(); + String afterNames = request.getAfterNames(); + orderText = "null".equals(orderText) ? null : Validates.isEmptyBlank(orderText) ? null : orderText; + afterNames = "null".equalsIgnoreCase(afterNames) ? null : afterNames; + updater.addField("orderText", orderText); + updater.addField("afterNames", Validates.isEmptyBlank(afterNames) ? null : afterNames); + + // 行业 + + long industryId = request.getIndustryId(); + /** if (industryId > 0 && + Global.get(DesignIndustryCache.class).getIndustry(industryId) == null) {//行业错误 + Int code = ERROR_API_PARAM_DATA; + request.setError(Strings.toString(request.getDesignId()), code.value(), + code.desc() + request.biuldKeyValueString("industryId", industryId)); + return; + }**/ + + updater.addField("industryId", industryId > 0 ? industryId : 1980727080001L); + + // 加急 + updater.addField("isUrgent", request.isUrgent()); + + // 客服留言 + String servicesMessage = request.getServicesMessage(); + servicesMessage = "null".equalsIgnoreCase("servicesMessage") ? null : servicesMessage; + updater.addField("servicesMessage", servicesMessage); + + // 订单总金额 + double amount = request.getAmount(); + updater.addField("amount", Amounts.toFen(String.valueOf(amount), 0L)); + + int updDraftType = request.getDraftType(); + updater.addField("draftType", updDraftType); + updater.addField("typeId", typeId); + updater.addField("printSpecial", request.getPrintSpecial()); + updater.addField("tids", request.getTids()); + updater.addField("designCopies", request.getDesignCopies()); + updater.addField("isOnlyDesign", request.isOnlyDesign()); + updater.addField("isHighQualityOrder", request.isHighQualityOrder()); + // 设置订单属性 用于判断设计师是否能够接单 + changeOrder.setPrintWidth(printWidth); + changeOrder.setPrintHeight(printHeight); + changeOrder.setOrderText(orderText); + changeOrder.setAfterNames(Validates.isEmptyBlank(afterNames) ? null : afterNames); + changeOrder.setIndustryId(industryId > 0 ? industryId : 1980727080001L); + changeOrder.setUrgent(request.isUrgent()); + changeOrder.setServicesMessage(servicesMessage); + changeOrder.setAmount(Amounts.toFen(String.valueOf(amount), 0L)); + changeOrder.setDraftType(updDraftType); + changeOrder.setTypeId(typeId); + changeOrder.setPrintSpecial(request.getPrintSpecial()); + changeOrder.setTids(request.getTids()); + changeOrder.setDesignCopies(request.getDesignCopies()); + changeOrder.setOnlyDesign(request.isOnlyDesign()); + changeOrder.setHighQualityOrder(request.isHighQualityOrder()); + + String logItem = "[接收到 订单规格修改,订单规格,由【" + order.getOrderText() + "】改成【" + orderText + "】"; + int ordDraftType = order.getDraftType(); + if (ordDraftType != updDraftType) + { + logItem += ",稿件由【" + DraftConstants.get(ordDraftType) + "】变更【" + DraftConstants.get(updDraftType) + "】"; + } + long updTypeId = request.getTypeId(); + String designer = order.getDesigner(); + if (order.getTypeId() != updTypeId || ordDraftType != updDraftType) + {// 产品类型或稿件发生变化 + + if (Validates.isNotEmpty(designer)) + {// 查看设计师是否支持设计该产品 + boolean restartDispatch = false; + DesignerScoreModel score = new DesignerScoreModel(0, designer); + DesignerGroupDataModel model = new DesignerGroupDataModel(); + DesignerGroup designerGroup = null; + DesignerGroupDispatch designerGroupDispatch = ORM.get(ZTable.class).item(DesignerGroupDispatch.class, + new Selector().addMust("operatorCode", designer).addMust("status", 1)); + if (designerGroupDispatch == null) + { + restartDispatch = true; + logItem += ",原有设计师【" + designer + "】未关联接单条件组或已停用,订单重新分拣派发"; + } + else + { + List dispatchValues = ORM.get(ZTable.class).list(DesignerGroupDispatchValue.class, + new Selector().addMust("operatorCode", designer)); + model.setTempDesignerGroupDispatch(designerGroupDispatch); + model.setTempDesignerGroupDispatchValueList(dispatchValues); + designerGroup = ORM.get(ZTable.class).item(DesignerGroup.class, + new Selector().addMust("designerGroupId", designerGroupDispatch.getDesignerGroupId()).addMust("status", 1)); + if (designerGroup != null) + { + List designerGroupValueList = ORM.get(ZTable.class).list(DesignerGroupValue.class, + new Selector().addMust("designerGroupId", designerGroupDispatch.getDesignerGroupId())); + model.setDesignerGroup(designerGroup); + model.setDesignerGroupValueList(designerGroupValueList); + } + + } + if (designerGroup == null) + { + restartDispatch = true; + logItem += ",原有设计师【" + designer + "】接单条件组不存在或已停用,订单重新分拣派发"; + } + else if (!DesignerGroupDispatchUtil.isDeliverByOrderType(changeOrder, score, model)) + { + restartDispatch = true; + } + else if (!DesignerGroupDispatchUtil.isOrderAmountRange(changeOrder, score, model)) + { + restartDispatch = true; + } + else if (!DesignerGroupDispatchUtil.isIndustryType(changeOrder, score, model)) + { + restartDispatch = true; + } + else if (!DesignerGroupDispatchUtil.isAfterNames(changeOrder, score, model)) + { + restartDispatch = true; + } + + if (restartDispatch) + {// 设计师不支持修改报价之后的产品或稿件 + updater.addField("orgId", 0L); + updater.addField("status", StatusConstants.ORDER_10.value()); + updater.addField("orgReceiveTime", null); + updater.addField("designer", null); + updater.addField("designReceiveTime", null); + updater.addField("designBeginTime", null); + updater.addField("receiveType", 0); + + List resultList = score.getResultList(); + if (Validates.isNotEmpty(resultList)) + { + AnalysisResult result = resultList.get(resultList.size() - 1); + if (!result.isSuccess()) + { + logItem += ",原有设计师【" + designer + "】" + result.getConditionMsg() + ""; + logItem += ",订单重新分拣派发"; + } + } + + // 消息盒子提醒 + try + { + // 订单审核退回消息提醒 + MessageBusi messageBusi = new MessageBusi(); + messageBusi.setId(String.valueOf(Ids.longId13_4())); + messageBusi.setProducerOperateType("1"); + messageBusi.setProducerOperateCode("系统"); + messageBusi.setProducerOperateName("系统"); + messageBusi.setConsumerPlatformType(MessageSysType.DESIGN_CODE); + messageBusi.setConsumerOperateCode(designer); + messageBusi.setConsumerOperateName(designer); + messageBusi.setConsumerOperateType("1"); + messageBusi.setMessageType(3); + messageBusi.setOrderId(String.valueOf(designId)); + messageBusi.setTopic(MessageTopicType.ORDER_INFO_MODIFY); + messageBusi.setMessageBody("订单(" + order.getDesignId() + ")被客服修改了规格,由于不满足新的设计要求,订单已退回订单池"); + HashMap propertyMap = new HashMap(); + propertyMap.put("designId", String.valueOf(designId)); + propertyMap.put("title", "订单退回"); + propertyMap.put("sender", "系统"); + ZqmMessageProducerHandler.sendMessage(messageBusi, propertyMap); + } + catch (Exception e) + { + // 推送消息失败 + log.error(e.getMessage(), e); + } + } + } + } + else if (Validates.isNotEmpty(designer)) + { // 产品跟稿件没有变更,订单有设计师就消息盒子提醒 + // 消息盒子提醒 + try + { + // 订单审核退回消息提醒 + MessageBusi messageBusi = new MessageBusi(); + messageBusi.setId(String.valueOf(Ids.longId13_4())); + messageBusi.setProducerOperateType("1"); + messageBusi.setProducerOperateCode("系统"); + messageBusi.setProducerOperateName("系统"); + messageBusi.setConsumerPlatformType(MessageSysType.DESIGN_CODE); + messageBusi.setConsumerOperateCode(designer); + messageBusi.setConsumerOperateName(designer); + messageBusi.setConsumerOperateType("1"); + messageBusi.setMessageType(3); + messageBusi.setOrderId(String.valueOf(designId)); + messageBusi.setTopic(MessageTopicType.ORDER_INFO_MODIFY); + messageBusi.setMessageBody("订单(" + designId + ")客服刚刚修改过规格信息,请仔细确认"); + HashMap propertyMap = new HashMap(); + propertyMap.put("designId", String.valueOf(designId)); + propertyMap.put("title", "订单消息修改"); + propertyMap.put("sender", "系统"); + ZqmMessageProducerHandler.sendMessage(messageBusi, propertyMap); + } + catch (Exception e) + { + // 推送消息失败 + log.error(e.getMessage(), e); + } + } + + // 执行数据保存 + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + DesignOrder item = ORM.get(ZTable.class).item(DesignOrder.class, new Selector().addMust("designId", order.getDesignId())); + + // 修改单价 + ORM.get(ZTable.class).update(DesignOrder.class, + new Updater().addMust("designId", order.getDesignId()).addField("designPrice", StatDao.calculateOrderPerformance(item))); + + OrderLogDao.saveOrderOperateLog(order.getDesignId(), "系统", logItem, EventConstants.ORDER_20.value()); + + log.info("[" + request.getMerchantId() + "][" + request.getMethod() + "]修改订单规格完成"); + // 响应数据 + response.setMerchantId(order.getMerchantId()); + response.setDesignId(order.getDesignId()); + request.setResponse(response); + } + catch (Exception e) + { + log.error("[" + request.getMerchantId() + "][" + request.getMethod() + "]修改订单规格异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc(), e); + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/update/DesignOrderUpdateTextInfoRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/update/DesignOrderUpdateTextInfoRequestHandler.java new file mode 100644 index 0000000..787f3e5 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/update/DesignOrderUpdateTextInfoRequestHandler.java @@ -0,0 +1,96 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.server.handler.order.update; + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.request.order.update.DesignOrderUpdateTextInfoRequest; +import com.zhiqim.yangcai.design.server.request.order.update.DesignOrderUpdateTextInfoResponse; + +/** + * 订单文字信息修改处理器 + * 自主上传 + * + * @version v1.0.0 @author lgz 2019-1-17 新建与整理 + */ +public class DesignOrderUpdateTextInfoRequestHandler extends ApiErrorCodes implements Handler +{ + private static final Log log = LogFactory.getLog(DesignOrderUpdateTextInfoRequestHandler.class); + + @Override + public void process(DesignOrderUpdateTextInfoRequest request) + { + DesignOrderUpdateTextInfoResponse response = request.newResponse(); + try + { + // 查询条件 + long designId = request.getDesignId(); + long merchantId = request.getMerchantId(); + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchantId)); + if (order == null) + {// 商户单订单不存在,单号必须大于0 + Int code = ERROR_API_NOT_DESIGN_ORDER; + request.setError(Strings.toString(request.getDesignId()), code.value(), + code.desc() + request.biuldKeyValueString("designId,merchantId", designId, merchantId)); + return; + } + + if (order.getStatus() >= StatusConstants.ORDER_55.value()) + { + Int code = ERROR_API_ILLEGAL_STATUS; + request.setError(Strings.toString(request.getDesignId()), code.value(), + code.desc() + request.biuldKeyValueString("designId,merchantId", designId, merchantId)); + return; + } + + Updater updater = new Updater(); + updater.addMust("designId", designId); + updater.addMust("merchantId", merchantId); + + updater.addField("userText", request.getUserText()); + updater.addField("userNotice", request.getUserNotice()); + updater.addField("userQq", request.getUserQq()); + updater.addField("userWx", request.getUserWx()); + + if (Validates.isNotEmptyBlank(request.getUserMobile())) + { + updater.addField("userMobile", request.getUserMobile()); + } + + ORM.get(ZTable.class).update(DesignOrder.class, updater); + + // 响应数据 + response.setUpdated(true); + request.setResponse(response); + } + catch (Exception e) + { + log.error("[" + request.getMerchantId() + "][" + request.getMethod() + "]订单文字信息异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc(), e); + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/update/ReplaceCustomFileRequestHandler.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/update/ReplaceCustomFileRequestHandler.java new file mode 100644 index 0000000..1b7aa41 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/server/handler/order/update/ReplaceCustomFileRequestHandler.java @@ -0,0 +1,117 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.server.handler.order.update; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.control.Handler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.design.constants.EventConstants; +import com.zhiqim.yangcai.design.constants.FileTypeConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.OrderLogDao; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.design.server.ApiErrorCodes; +import com.zhiqim.yangcai.design.server.module.ApiFile; +import com.zhiqim.yangcai.design.server.request.order.update.ReplaceCustomFileRequest; +import com.zhiqim.yangcai.design.server.request.order.update.ReplaceCustomFileResponse; + +/*** + * 刷新客户文件处理器 + * + * @version v1.0.0 @author lgz 2019-1-17 新建与整理 + */ +public class ReplaceCustomFileRequestHandler extends ApiErrorCodes implements Handler +{ + private static final Log log = LogFactory.getLog(ReplaceCustomFileRequestHandler.class); + + @Override + public void process(ReplaceCustomFileRequest request) + { + ReplaceCustomFileResponse response = request.newResponse(); + try + { + // 查询条件 + long designId = request.getDesignId(); + long merchantId = request.getMerchantId(); + + DesignOrder order = ORM.get(ZTable.class).item(DesignOrder.class, + new Selector("designId", designId <= 0 ? 0 : designId).addMust("merchantId", merchantId)); + if (order == null) + {// 商户单订单不存在,单号必须大于0 + Int code = ERROR_API_NOT_DESIGN_ORDER; + request.setError(Strings.toString(request.getDesignId()), code.value(), + code.desc() + request.biuldKeyValueString("designId,merchantId", designId, merchantId)); + return; + } + + if (order.getStatus() >= StatusConstants.ORDER_55.value()) + {// 素材更新操作 订单已经定稿就不能更新 + Int code = ERROR_API_ILLEGAL_STATUS; + request.setError(Strings.toString(request.getDesignId()), code.value(), + code.desc() + request.biuldKeyValueString("designId,merchantId", designId, merchantId)); + return; + } + + List apiFiles = request.getApiFiles(); // 附件数据 + List attaList = new ArrayList(); + for (ApiFile apiFile : apiFiles) + { + DesignAtta atta = new DesignAtta(); + atta.setAttaId(Ids.longId()); + atta.setDesignId(order.getDesignId()); + atta.setAttaFlag(1);// 接口上传 + atta.setAttaModul(FileTypeConstants.FILE_CUSTOM.value()); + atta.setFileName(Strings.addEndsWith(Strings.trim(apiFile.getFileName()), Strings.addStartsWith(apiFile.getFileExt(), "."))); + atta.setFileType(Strings.trimLeft(Strings.trim(apiFile.getFileExt()), ".")); + atta.setFileSize(apiFile.getFileSize()); + atta.setOperatorCode("系统"); + atta.setOssType(1);// OSS任务无需上传 + atta.setOssUrl(apiFile.getDownUrl()); + atta.setUploadTime(Sqls.nowTimestamp()); + atta.setFileid(null); + atta.setSavePath(null); + + attaList.add(atta); + } + // 附件数据插入 先删除 客户端所有 通过接口传的数据,在重新插入 + ORM.get(ZTable.class).delete(DesignAtta.class, + new Selector("designId", order.getDesignId()).addMust("attaModul", FileTypeConstants.FILE_CUSTOM.value()).addMust("attaFlag", 1)); + if (attaList.size() > 0) + { + ORM.get(ZTable.class).insertBatch(attaList); + } + + OrderLogDao.saveOrderOperateLog(designId, "系统", "更新或删除客户文件", EventConstants.ORDER_20.value()); + // 响应数据 + response.setReplaced(true); + request.setResponse(response); + } + catch (Exception e) + { + log.error("[" + request.getMerchantId() + "][" + request.getMethod() + "]刷新客户文件异常", e); + Int code = ERROR_API_SERVER_PROCESS; + request.setError(Strings.toString(request.getDesignId()), code.value(), code.desc(), e); + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/BusinessPlatformClientUtil.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/BusinessPlatformClientUtil.java new file mode 100644 index 0000000..3d7f6b3 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/BusinessPlatformClientUtil.java @@ -0,0 +1,367 @@ +/** + * 扬彩印刷设计 + * 文件名 :BusinessPlatformClientUtil.java + * 创建人 :caohong + * 创建时间:2019-12-03 + */ + +package com.zhiqim.yangcai.util; + +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; + +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.httpclient.HttpGet; +import org.zhiqim.kernel.httpclient.HttpPost; +import org.zhiqim.kernel.httpclient.HttpResult; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; + +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.design.dbo.order.DesignAtta; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; + +/** + * 运营平台公共接口调用工具类 + * + * @version 1.0 @author caohong 2019-12-03 新建与整理 + */ +public class BusinessPlatformClientUtil +{ + private static final Log log = LogFactory.getLog(BusinessPlatformClientUtil.class); + + /** 运营平台网关URL地址 */ + public static final String GATE_WAY_URL = Global.getString("businessPlatform", "gatewayUrl"); + public static final String YZM_GATE_WAY_URL = Global.getString("businessPlatform", "yzmGatewayUrl"); + + /** + * [简要描述]:运营平台接口调用,POST接口
            + * + * @author caohong + * @param url 接口url + * @param paramMap 请求参数 + * @return {"code":0/1,"msg":"","data":object} + */ + public static String sendPost(String url, TreeMap paramMap) + { + /* + * String queryString = buildQueryString(paramMap); HttpPost conn = new + * HttpPost(url); conn.setQueryString(queryString, "UTF-8"); + * conn.setConnectTimeout(3); conn.setReadTimeout(6); conn.execute(); + * + * HttpResult result = conn.getResult(); int responseStatus = + * conn.getResponseStatus(); String responseText = conn.getResponseText(); + * + * if (!result.isSuccess()) { log.error("运营平台接口调用失败,[Rescode:" + responseStatus + * + " ][ResText:" + responseText + " ]"); log.error("接口调用URL:[" + url + + * "][Param:" + paramMap.toString() + "]"); } + * + * return responseText; + */ + return ""; + } + + /** + * [简要描述]:请求参数拼接
            + * + * @author caohong + * @param paramMap 接口请求参数 + * @return url请求参数拼接 + */ + private static String buildQueryString(TreeMap paramMap) + { + StringBuffer strb = new StringBuffer(); + for (Map.Entry entry : paramMap.entrySet()) + { + String value = Urls.encodeUTF8(entry.getValue()); + strb.append("&").append(entry.getKey()).append("=").append(value); + } + + return strb.toString(); + } + + /** + * + * [简要描述]:获取运营平台接口设计平台访问token令牌
            + * + * @author caohong + * @return token + */ + public static String getAccessToken() + { + TreeMap paramMap = new TreeMap(); + String url = GATE_WAY_URL + "admin-auth/oauth/token"; + paramMap.put("username", ""); + paramMap.put("password", ""); + paramMap.put("grant_type", ""); + paramMap.put("scope", ""); + paramMap.put("client_id", ""); + paramMap.put("client_secret", ""); + + String access_token = ""; + String resultText = BusinessPlatformClientUtil.sendPost(url, paramMap); + MapSO map = Jsons.toMapSO(resultText); + if (Validates.isNotEmpty(map)) + { + access_token = String.valueOf(map.get("access_token")); + } + return access_token; + + } + + /** + * + * [简要描述]:获取运营平台数据字典配置数据
            + * + * @author gjx + * @param dicKeyCode 数据字典keyCode + * @param access_token token + * @return json + */ + public static String getDicKeyParamValue(String dicKeyCode, String access_token) + { + if (Validates.isEmpty(dicKeyCode) || Validates.isEmpty(Validates.isEmpty(access_token))) + { + throw new IllegalArgumentException("非法请求参数"); + } + + StringBuilder builder = new StringBuilder(BusinessPlatformClientUtil.GATE_WAY_URL + "api-admin-sys/dicvalue/list"); + builder.append("?dicKeyCode=" + dicKeyCode); + builder.append("&access_token=" + access_token); + + HttpGet get = new HttpGet(builder.toString()); + get.setConnectTimeout(3); + get.setReadTimeout(3); + get.execute(); + + HttpResult result = get.getResult(); + int responseStatus = result.getResponseStatus(); + String resultText = result.getResponseText(); + + if (!result.isSuccess()) + { +// log.error("获取运营平台数据字典配置数据失败,HttpCode[ " + responseStatus + " ]resText[" + resultText + " ]"); + } + + return resultText; + } + + /** + * + * [简要描述]:添加运营平台打标签的日志
            + * + * @author jiangbin + * @return boolean true:成功 false:失败 + */ + public static boolean addUserOrderTagLog(long designId, String wholeTag, String addUserName) + { + boolean flag = false; + TreeMap paramMap = new TreeMap(); + String access_token = getAccessToken(); + StringBuffer buffer = new StringBuffer(GATE_WAY_URL); + buffer.append("api-busi/userordertaglog/saveFromOthers?access_token="); + buffer.append(access_token); + paramMap.put("userOrderId", String.valueOf(designId)); + paramMap.put("wholeTag", wholeTag); + paramMap.put("operatorCode", addUserName); + String resultText = sendPost(buffer.toString(), paramMap); + log.info("订单[" + designId + "]增加标签日志:" + resultText); + MapSS resultMap = Jsons.toMapSS(resultText); + if (Validates.isNotEmpty(resultMap)) + { + if (resultMap.get("code") != null && "0".equals(resultMap.get("code"))) + { + flag = true; + } + } + return flag; + } + + /** + * + * [简要描述]:添加淘印通订单标签
            + * + * @author jiangbin + * @return boolean true:成功 false:失败 + */ + public static boolean addUserOrderTag(long designId, long industryId, int consumerType, long subIndustryId, long applicationScenarioId, long designStyleId, + String operatorCode) + { + boolean flag = false; + TreeMap paramMap = new TreeMap(); + String access_token = getAccessToken(); + StringBuffer buffer = new StringBuffer(GATE_WAY_URL); + buffer.append("api-busi/userordertag/saveOrUpdateFromOthers?access_token="); + buffer.append(access_token); + paramMap.put("userOrderId", String.valueOf(designId)); + paramMap.put("industryId", String.valueOf(industryId)); + paramMap.put("consumerType", String.valueOf(consumerType)); + paramMap.put("subIndustryId", String.valueOf(subIndustryId)); + paramMap.put("applicationScenarioId", String.valueOf(applicationScenarioId)); + paramMap.put("designStyleId", String.valueOf(designStyleId)); + paramMap.put("operatorCode", operatorCode); + + String resultText = sendPost(buffer.toString(), paramMap); + log.info("订单[" + designId + "]增加标签:" + resultText); + MapSS resultMap = Jsons.toMapSS(resultText); + if (Validates.isNotEmpty(resultMap)) + { + if (resultMap.get("code") != null && "0".equals(resultMap.get("code"))) + { + flag = true; + } + } + return flag; + } + + /** + * + * [简要描述]: 运营平台同步订单设计备注
            + * [详细描述]:
            + * + * @author gjx + * @param designId + * @param reamrk + * @throws Exception + */ + public static void doOrdProgressNote(long designId, String reamrk) throws Exception + { + Map paramMap = new HashMap(); + paramMap.put("id", designId); + paramMap.put("progressNote", reamrk); + + String url = GATE_WAY_URL + "api-busi/order/update?access_token=" + getAccessToken(); + + // 创建默认的httpClient实例. + CloseableHttpClient httpclient = HttpClients.createDefault(); + + org.apache.http.client.methods.HttpPost httpPost = new org.apache.http.client.methods.HttpPost(url); + httpPost.setHeader("Content-Type", "application/json;charset=UTF-8"); + StringEntity s = new StringEntity(Jsons.toString(paramMap), "UTF-8"); + httpPost.setEntity(s); + + httpclient.execute(httpPost); + } + + /** + * + * [简要描述]: 运营平台同步状态
            + * [详细描述]:
            + * + * @author xiepan + * @param order + * @throws Exception + */ + public static boolean synStatus(DesignOrder order) throws Exception + { + String url = GATE_WAY_URL + "api-busi/order/synDesignOrderStatusApi?access_token=" + getAccessToken(); + + // 创建默认的httpClient实例. + CloseableHttpClient httpclient = HttpClients.createDefault(); + + org.apache.http.client.methods.HttpPost httpPost = new org.apache.http.client.methods.HttpPost(url); + httpPost.setHeader("Content-Type", "application/json;charset=UTF-8"); + StringEntity s = new StringEntity(JSONObject.toJSONString(order), "UTF-8"); + httpPost.setEntity(s); + CloseableHttpResponse response = httpclient.execute(httpPost); + int status = response.getStatusLine().getStatusCode(); + if (status != 200) + { + return false; + } + return true; + } + + /** + * + * [简要描述]: 运营平台同步设计师
            + * [详细描述]:
            + * + * @author zzq + * @param order + * @throws Exception + */ + public static boolean synOrderDesigner(DesignOrder order) throws Exception + { + String url = YZM_GATE_WAY_URL + "api-busi/order/syncOrderDesignerApi?access_token=" + getAccessToken(); + + // 创建默认的httpClient实例. + CloseableHttpClient httpclient = HttpClients.createDefault(); + + org.apache.http.client.methods.HttpPost httpPost = new org.apache.http.client.methods.HttpPost(url); + httpPost.setHeader("Content-Type", "application/json;charset=UTF-8"); + StringEntity s = new StringEntity(JSONObject.toJSONString(order), "UTF-8"); + httpPost.setEntity(s); + CloseableHttpResponse response = httpclient.execute(httpPost); + int status = response.getStatusLine().getStatusCode(); + if (status != 200) + { + return false; + } + return true; + } + + /** + * + * [简要描述]: 运营平台同步状态
            + * [详细描述]:
            + * + * @author zzq + * @param order + * @throws Exception + */ + public static boolean synOrderStatus(DesignOrder order) throws Exception + { + String url = YZM_GATE_WAY_URL + "api-busi/order/syncOrderStatusApi?access_token=" + getAccessToken(); + + // 创建默认的httpClient实例. + CloseableHttpClient httpclient = HttpClients.createDefault(); + + org.apache.http.client.methods.HttpPost httpPost = new org.apache.http.client.methods.HttpPost(url); + httpPost.setHeader("Content-Type", "application/json;charset=UTF-8"); + StringEntity s = new StringEntity(JSONObject.toJSONString(order), "UTF-8"); + httpPost.setEntity(s); + CloseableHttpResponse response = httpclient.execute(httpPost); + int status = response.getStatusLine().getStatusCode(); + if (status != 200) + { + return false; + } + return true; + } + + /** + * 修改文件路径 + * @param designAtta + * @return + * @throws Exception + */ + public static boolean syncUpdateOrderAtta(DesignAtta designAtta) throws Exception{ + String url = YZM_GATE_WAY_URL + "api-busi/order/synUpdateOrderAttaApi?access_token=" + getAccessToken(); + + // 创建默认的httpClient实例. + CloseableHttpClient httpclient = HttpClients.createDefault(); + + org.apache.http.client.methods.HttpPost httpPost = new org.apache.http.client.methods.HttpPost(url); + httpPost.setHeader("Content-Type", "application/json;charset=UTF-8"); + StringEntity s = new StringEntity(JSONObject.toJSONString(designAtta), "UTF-8"); + httpPost.setEntity(s); + CloseableHttpResponse response = httpclient.execute(httpPost); + int status = response.getStatusLine().getStatusCode(); + if (status != 200) + { + return false; + } + return true; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/BusinessTbzBjqUtil.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/BusinessTbzBjqUtil.java new file mode 100644 index 0000000..b71f6b9 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/BusinessTbzBjqUtil.java @@ -0,0 +1,161 @@ +package com.zhiqim.yangcai.util; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.HashMap; +import java.util.Map; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zhiqim.yangcai.util.http.HttpClientResult; +import com.zhiqim.yangcai.util.http.HttpClientUtils; + +/** + * 编辑器调用 + * @author zzqzz + * + */ +public class BusinessTbzBjqUtil { + private static final Log log = LogFactory.getLog(BusinessPlatformClientUtil.class); + + private static final String loginUrl = "https://apidiy.lingtao8.com/open/open-login"; + private static final String appid = "126q17817q000i77"; + private static final String appSecret = "Dk3XPGpnrBJr7DmReczFjXCGe3cZtpzm"; + private static final String getPinleiListUrl = "https://apidiy.lingtao8.com/v1/open-api/classify-list"; + + /** + * 获取token + * @param username 用户名 + * @param uid 用户id + * @param expireAt pc过期时间戳 + * @param expireAtM 移动过期时间戳 + * @param headImg 用户头像 + * @param mobile 用户手机号码 + * @return + * @throws Exception + */ + public static String getAccessToken(String username, int uid, long expireAt, long expireAtM, String headImg, String mobile) throws Exception { + Map map = new HashMap<>(); + long timestamp = System.currentTimeMillis(); + map.put("app_id", appid);// + map.put("timestamp", timestamp);// + map.put("uid", uid);// + map.put("username", username);// + String sign = generateSignParam(appid, timestamp, uid, username, appSecret); + map.put("sign", sign);// + map.put("expire_at", expireAt); + map.put("expire_at_m",expireAtM); + map.put("head_img",headImg); + map.put("mobile",mobile); + JSONObject json = new JSONObject(map); + + String result = HttpClientUtils.doPostWithJson(loginUrl, json.toJSONString()); + JSONObject resultJson = JSONObject.parseObject(result); + if(resultJson.getInteger("code") == 200) { + return resultJson.getString("loginCode"); + } + return ""; + } + + public void toSyncFile(String token, int uid, String headImg, String mobile) { + //获取token + //跳入编辑器 + + } + + /** + * 获取品类列表 + * @throws Exception + */ + public static JSONArray getPinleiList() throws Exception { + //获取封装sign + int uid = 1004; + String username = "zhangsan";// + Map map = new HashMap<>(); + long timestamp = System.currentTimeMillis(); + map.put("app_id", appid);// + map.put("timestamp", timestamp);// + map.put("uid", uid);// + map.put("username", username);// + String sign = generateSignParam(appid, timestamp, uid, username, appSecret); + map.put("sign", sign);// + + Map headers = new HashMap<>(); + headers.put("client", "tubangzhu_web"); + headers.put("tubangzhuCooperation", JSONObject.toJSONString(map)); + //获取品类列表数据 + HttpClientResult result = HttpClientUtils.doGet(getPinleiListUrl, headers, null); + if(result.getCode() == 200) {//访问成功 + String data = result.getData(); + JSONObject jsonObject = JSONObject.parseObject(data); + JSONArray dataJsonObject = jsonObject.getJSONArray("data"); + System.out.print("result:" + dataJsonObject.toJSONString()); + + return dataJsonObject; + } + return new JSONArray(); + } + + private static String generateSignParam(String appid, long timestamp, int uid, String userName,String appSecret) throws Exception{ + String sign = appSecret + "app_id" + appid + "timestamp" + timestamp + "uid" + uid + "username" + userName + appSecret;//expire_atexpire_at_mhead_imgmobile + return sha1(sign); + } + + /** + */ + private static String sha1(String input) throws NoSuchAlgorithmException { + MessageDigest mDigest = MessageDigest.getInstance("SHA1"); + byte[] result = mDigest.digest(input.getBytes()); + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < result.length; i++) { + sb.append(Integer.toString((result[i] & 0xff) + 0x100, 16).substring(1)); + } + + return sb.toString().toUpperCase(); + + } + + + + public static void main(String[] args) throws Exception + { + getPinleiList(); + /** String appid = "126q17817q000i77"; + + + + int uid = 1004; + String username = "张三";// + long timestamp = System.currentTimeMillis(); + long timestamp1 = System.currentTimeMillis(); + String mobile = "18570412824"; + String headImg = "https://yzmschtoss.shanghaidisanji.com/taoyin/xcx/order/2358102540001/2358102540001-17324177.jpeg"; + String appSecret = "Dk3XPGpnrBJr7DmReczFjXCGe3cZtpzm"; + getAccessToken(username, uid, 0L, 0L, headImg, mobile); + System.out.println("token:" + getAccessToken(username, uid, 0L, 0L, headImg, mobile));**/ + /* + * String head_img = ""; String appSecret = ""; String mobile = ""; Timestamp + * timestamp1 = null; + */ + /** String sign2 = generateSignParam(appid, timestamp, timestamp1, uid, userName, appSecret, mobile, head_img); + + Map map = new HashMap<>(); + map.put("app_id", appid);// + map.put("timestamp", timestamp);// + map.put("uid", uid);// + + map.put("username", userName);// + map.put("sign", sign2);// + map.put("expire_at",timestamp1); + map.put("expire_at_m",timestamp1); + map.put("head_img",head_img); + map.put("mobile",mobile); + JSONObject json2 = new JSONObject(map);//TubangzhuCooperation + System.out.println("json2:" + json2);*/ + } + + +} \ No newline at end of file diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/CdrToPngUtil.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/CdrToPngUtil.java new file mode 100644 index 0000000..a1b29f6 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/CdrToPngUtil.java @@ -0,0 +1,47 @@ +package com.zhiqim.yangcai.util; + +import java.io.File; + +import com.aspose.imaging.Color; +import com.aspose.imaging.Image; +import com.aspose.imaging.SmoothingMode; +import com.aspose.imaging.TextRenderingHint; +import com.aspose.imaging.fileformats.png.PngColorType; +import com.aspose.imaging.imageoptions.PngOptions; +import com.aspose.imaging.imageoptions.VectorRasterizationOptions; +import com.aspose.imaging.internal.Exceptions.Exception; + +public class CdrToPngUtil { + + public static String convert(String path) { + path = "G:\\\\_YangCai\\\\upload\\\\20240106\\\\(240118-037193072262850)-108x70mm-500张-卡片300克铜板纸双面印刷覆哑膜裁切-jyys--安徽省-小光.cdr"; + if (path.indexOf(".cdr") > -1) { + try { + String outName = path.replace(".cdr", ".png"); + + File file = new File(path); + if (!file.exists()) { + throw new Exception("文件不存在"); + } + + Image image = Image.load(path); + PngOptions options = new PngOptions(); + options.setColorType(PngColorType.Grayscale); + VectorRasterizationOptions defaultOptions = (VectorRasterizationOptions) image + .getDefaultOptions(new Object[] { Color.getWhite(), image.getWidth(), image.getHeight() }); + options.setVectorRasterizationOptions(defaultOptions); + defaultOptions.setTextRenderingHint(TextRenderingHint.SingleBitPerPixel); + defaultOptions.setSmoothingMode(SmoothingMode.None); + defaultOptions.setBackgroundColor(Color.getBlack()); + image.save(outName, options); + return outName; + } catch (Exception e) { + throw new Exception("格式转换出错"); + } + } + throw new Exception("暂不支持转换其他格式"); + } + public static void main(String[] args) { + convert(""); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/CodeEnum.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/CodeEnum.java new file mode 100644 index 0000000..4b0f678 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/CodeEnum.java @@ -0,0 +1,23 @@ +package com.zhiqim.yangcai.util; + +public enum CodeEnum +{ + SUCCESS(0), ERROR(1); + + private Integer code; + + CodeEnum(Integer code) + { + this.code = code; + } + + public Integer getCode() + { + return code; + } + + public void setCode(Integer code) + { + this.code = code; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/DesignUtil.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/DesignUtil.java new file mode 100644 index 0000000..3e39651 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/DesignUtil.java @@ -0,0 +1,58 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.util; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.util.Validates; + +public class DesignUtil implements SignConstants +{ + /** + * 删除s中空白,多个空格间 只保留一个空格 (包括空格以下(0x00-0x20)之间的所有字符,包括\t,\r,\n,\b等) + * + * 举例: s = " a\tb\rc d ";得到结果是:returnString = "abcd"; + * + * @param s 原字符串 + * @return 删除空白之后的字符串 + */ + public static String removeBlank(String s) + { + if (Validates.isEmpty(s)) + { + return s; + } + + StringBuilder strb = new StringBuilder(); + for (int i = 0; i < s.length(); i++) + { + char c = s.charAt(i); + if (c < _SPACE_ || c == _SPACE_ZH_ || c == _SPACE_BOM_) + { + continue; + } + + if (c == _SPACE_) + { + if (strb.charAt(strb.length() - 1) != _SPACE_) + { + strb.append(c);// 当前是空格,上一个符也不是空格,则保留当前空格 + } + } + else + { + strb.append(c); + } + } + + return strb.toString(); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/DesignerGroupDispatchUtil.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/DesignerGroupDispatchUtil.java new file mode 100644 index 0000000..0afe927 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/DesignerGroupDispatchUtil.java @@ -0,0 +1,887 @@ +package com.zhiqim.yangcai.util; + +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.Validatex; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; + +import com.zhiqim.yangcai.cache.DesignIndustryCache; +import com.zhiqim.yangcai.cache.DesignTypeCache; +import com.zhiqim.yangcai.design.constants.DraftConstants; +import com.zhiqim.yangcai.design.constants.StatusConstants; +import com.zhiqim.yangcai.design.dao.DispatchDao; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroup; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatch; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupDispatchValue; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupValue; +import com.zhiqim.yangcai.design.dbo.design.DesignerGroupView; +import com.zhiqim.yangcai.design.dbo.dispatch.DesOnline; +import com.zhiqim.yangcai.design.dbo.order.DesignOrder; +import com.zhiqim.yangcai.dispatch.model.AnalysisResult; +import com.zhiqim.yangcai.dispatch.model.DesignOrgMerModule; +import com.zhiqim.yangcai.dispatch.model.DesignerGroupDataModel; +import com.zhiqim.yangcai.dispatch.model.DesignerGroupMerDispatchAnalysisModule; +import com.zhiqim.yangcai.dispatch.model.DesignerScoreModel; + +/** + * 设计师组订单派送工具类 + * + * @version v1.0.0 @author yixin 2020年11月23日 新建与整理 + */ +public class DesignerGroupDispatchUtil +{ + + /** + * 业务条件 判断是否匹配组织接单规则 + * + * @author yixin + * + * @param order + * @param merModule + * @return + */ + public static DesignerGroupMerDispatchAnalysisModule isMerchantSupport(DesignOrder order, DesignOrgMerModule merModule) + { + DesignerGroupMerDispatchAnalysisModule module = new DesignerGroupMerDispatchAnalysisModule(); + module.setOrgId(merModule.getOrgId()); + module.setOrgName(merModule.getOrgName()); + module.setAnalysisMer(merModule); + + // 1.组织是否停用 + if (merModule.getMerStatus() == 1) + { + AnalysisResult result = new AnalysisResult(false, "组织已停用"); + module.addResult(result); + module.setSuccess(result.isSuccess()); + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "组织正常使用"); + module.addResult(result); + module.setSuccess(result.isSuccess()); + } + + // 2.检查组织是否是 停止接单 + if (merModule.isPauseRecieive()) + { + AnalysisResult result = new AnalysisResult(false, "组织停止接单"); + module.addResult(result); + module.setSuccess(result.isSuccess()); + return module; + } + else + { + AnalysisResult result = new AnalysisResult(true, "组织正在接单中"); + module.addResult(result); + module.setSuccess(result.isSuccess()); + } + + return module; + } + + /** + * 单个组织订单派送分析(未派送订单分析) + * + * @param module + * @param order + * @param modelMap + * @return + * @throws SQLException + * @throws ORMException + */ + public static List doOrgMerAnalysis(DesignerGroupMerDispatchAnalysisModule module, DesignOrder order, + Map modelMap) throws Exception + { + long orgId = module.getOrgId(); + List operatorCodeList = ORM.get(ZTable.class).list(DesOnline.class, new Selector().addMust("orgId", orgId).addMust("onlineStatus", 1)); + + if (Validates.isNotEmpty(operatorCodeList)) + { + List scoreList = new ArrayList(); + for (DesOnline operator : operatorCodeList) + { + // 构建设计师分数 + String operatorCode = operator.getOperatorCode(); + DesignOrgMerModule orgMer = module.getAnalysisMer(); + int orderNumber = DispatchDao.getUnCompleteOrderNumber(operatorCode); + DesignerScoreModel score = new DesignerScoreModel(orderNumber, operatorCode); + score.setOrderNumber(orderNumber); + score.setOrgId(operator.getOrgId()); + scoreList.add(score); + DesignerGroupDataModel mode = isDesignerGroupMember(score, modelMap); + // 未查询到设计组关系则跳出 + if (mode == null) + { + continue; + } + if (!isDeliverByOrderType(order, score, mode)) + { + continue; + } + if (!isOrderAmountRange(order, score, mode)) + { + continue; + } + if (!isIndustryType(order, score, mode)) + { + continue; + } + if (!isAfterNames(order, score, mode)) + { + continue; + } + if (!hasOrderNumber(score, orgMer, order)) + { + continue; + } + // 全部通过设置成功 + score.setSuccess(Boolean.TRUE); + } + // 根据分数二次排序 然后返回 + Collections.sort(scoreList, getDesignerListComparator()); + return scoreList; + } + return null; + } + + /** + * 判断是否关联了设计师组 + * + * @param score + * @param modelMap + * @return + * @throws Exception + */ + private static DesignerGroupDataModel isDesignerGroupMember(DesignerScoreModel designerScore, Map modelMap) throws Exception + { + String operatorCode = designerScore.getOperatorCode(); + DesignerGroupDispatch designerGroupDispatch = ORM.get(ZTable.class).item(DesignerGroupDispatch.class, + new Selector().addMust("operatorCode", operatorCode).addMust("status", 1)); + if (designerGroupDispatch != null) + { + List dispatchValues = ORM.get(ZTable.class).list(DesignerGroupDispatchValue.class, + new Selector().addMust("operatorCode", operatorCode)); + DesignerGroupDataModel model = modelMap.get(designerGroupDispatch.getDesignerGroupId()); + if (model != null) + { + model.setTempDesignerGroupDispatch(designerGroupDispatch); + model.setTempDesignerGroupDispatchValueList(dispatchValues); + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "设计师已关联接单条件组[" + model.getDesignerGroup().getDesignerGroupName() + "]"); + designerScore.addResult(result); + return model; + } + } + AnalysisResult result = new AnalysisResult(Boolean.FALSE, "设计师未关联接单条件组或已停用"); + designerScore.addResult(result); + designerScore.setSuccess(Boolean.FALSE); + return null; + } + + /** + * 判断是否支持该订单类型(稿件类型,是否加急,是否大金额,是否优质订单,是否只设计部印刷.是否异形订单) + * + * @param order + * @param property + * @return + */ + public static boolean isDeliverByOrderType(DesignOrder order, DesignerScoreModel score, DesignerGroupDataModel mode) + { + // 判断加急订单 + if (!order.isUrgent()) + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "非加急单"); + score.addResult(result); + } + else + { + if (mode.isUrgent()) + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "支持加急单"); + score.addResult(result); + } + else + { + AnalysisResult result = new AnalysisResult(Boolean.FALSE, "不支持加急单"); + score.addResult(result); + return Boolean.FALSE; + } + } + + // 判断优质订单 + if (!order.isHighQualityOrder()) + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "非优质订单"); + score.addResult(result); + } + else + { + if (mode.isHighQualityOrder()) + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "支持优质订单"); + score.addResult(result); + } + else + { + AnalysisResult result = new AnalysisResult(Boolean.FALSE, "不支持优质订单"); + score.addResult(result); + return Boolean.FALSE; + } + } + + // 判断大金额订单 + if (order.getAmount() < Amounts.toFen("300", 0L)) + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "非大金额订单"); + score.addResult(result); + } + else + { + if (mode.isLargeAmount()) + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "支持大金额订单"); + score.addResult(result); + } + else + { + AnalysisResult result = new AnalysisResult(Boolean.FALSE, "不支持大金额订单"); + score.addResult(result); + return Boolean.FALSE; + } + } + + // 判断仅设计订单 + if (!order.isOnlyDesign()) + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "非仅设计订单"); + score.addResult(result); + } + else + { + if (mode.isDesign()) + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "支持仅设计订单"); + score.addResult(result); + } + else + { + AnalysisResult result = new AnalysisResult(Boolean.FALSE, "不支持仅设计订单"); + score.addResult(result); + return Boolean.FALSE; + } + } + + // 判断异形订单 + if ((order.getPrintWidth() > 0 || order.getPrintHeight() > 0)) + { + if (mode.isSpecial()) + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "支持异形订单"); + score.addResult(result); + } + else + { + AnalysisResult result = new AnalysisResult(Boolean.FALSE, "不支持异形订单"); + score.addResult(result); + return Boolean.FALSE; + } + } + else + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "非异形订单"); + score.addResult(result); + } + + // 判断稿件类型是否支持 + String tmpMsg = "支持"; + if (order.getDraftType() == DraftConstants.DRAFT_STANDARD.value()) + { + tmpMsg += "标准自来稿"; + } + else if (order.getDraftType() == DraftConstants.DRAFT_TEMPLATE.value()) + { + tmpMsg += "改稿自来稿"; + } + else if (order.getDraftType() == DraftConstants.DRAFT_COMMON_DESIGN.value()) + { + tmpMsg += "普通设计稿"; + } + else if (order.getDraftType() == DraftConstants.DRAFT_PAGE_DESIGN.value()) + { + tmpMsg += "资深设计稿"; + } + tmpMsg += "的" + Global.get(DesignTypeCache.class).getName(order.getTypeId()) + "类型"; + if (mode.isSupportDraftType(order)) + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, tmpMsg); + score.addResult(result); + } + else + { + AnalysisResult result = new AnalysisResult(Boolean.FALSE, "不" + tmpMsg); + score.addResult(result); + return Boolean.FALSE; + } + + return Boolean.TRUE; + } + + /** + * 判断订单金额范围 + * + * @param order + * @param score + * @param mode + * @return + */ + public static boolean isOrderAmountRange(DesignOrder order, DesignerScoreModel score, DesignerGroupDataModel mode) + { + String amount = Amounts.toYuanMustRadix(order.getAmount()); + if (mode.isOrderAmountRange(order)) + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "订单金额" + amount + "元在接单范围内"); + score.addResult(result); + } + else + { + AnalysisResult result = new AnalysisResult(Boolean.FALSE, "订单金额" + amount + "元不在接单范围内"); + score.addResult(result); + return Boolean.FALSE; + } + return Boolean.TRUE; + } + + /** + * 判断是否支持行业 + * + * @param order + * @param score + * @param mode + * @return + */ + public static boolean isIndustryType(DesignOrder order, DesignerScoreModel score, DesignerGroupDataModel mode) + { + long industryId = order.getIndustryId(); + String industryName = Global.get(DesignIndustryCache.class).getIndustryName(industryId); + if (mode.isIndustryType(order)) + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "支持行业" + industryName); + score.addResult(result); + } + else + { + AnalysisResult result = new AnalysisResult(Boolean.FALSE, "不支持行业" + industryName); + score.addResult(result); + return Boolean.FALSE; + } + return Boolean.TRUE; + } + + /** + * 判断是否支持后加工 + * + * @param order + * @param score + * @param mode + * @return + */ + public static boolean isAfterNames(DesignOrder order, DesignerScoreModel score, DesignerGroupDataModel mode) + { + // 没有后加工直接跳出 + if (Validates.isEmpty(order.getAfterNames())) + { + return Boolean.TRUE; + } + List orderAfters = Lists.toStringList(order.getAfterNames()); + for (String afterName : orderAfters) + { + if (!mode.isAfterNames(afterName)) + { + AnalysisResult result = new AnalysisResult(false, "不支持订单后加工[" + afterName + "]"); + score.addResult(result); + score.setSuccess(Boolean.FALSE); + return Boolean.FALSE; + } + } + AnalysisResult result = new AnalysisResult(true, "支持订单后加工[" + order.getAfterNames() + "]"); + score.addResult(result); + return Boolean.TRUE; + } + + /** + * yixin 业务提交 通过单量过滤 + * + * @param operatorCodeList + * @param merMap + * @param isUrgent + * @throws Exception + */ + public static List doOrderNumberFilter(List operatorCodeList, Map merMap, + DesignOrder order) throws Exception + { + List designerList = new ArrayList(); + for (String operatorCode : operatorCodeList) + { + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, new Selector().addMaybe("operatorCode", operatorCode)); + DesignerGroupMerDispatchAnalysisModule analysisModule = merMap.get(operator.getOrgId()); + DesignOrgMerModule orgMer = analysisModule.getAnalysisMer(); + // 判断订单数量,获取设计师所有未完成的订单数量 + int score = DispatchDao.getUnCompleteOrderNumber(operatorCode); + int orderNumber = DispatchDao.getDesignOrderNumber(operatorCode); + int desOrderNum = 0;// 设计师自己配置接单量 + if (Validates.isNotEmptyBlank(operator.getOperatorParam()) && Validatex.isIntegerNonnegative(operator.getOperatorParam(), false)) + { + desOrderNum = Integer.parseInt(operator.getOperatorParam()); + } + + DesignerScoreModel designerScore = new DesignerScoreModel(score, operatorCode); + designerScore.setOrderNumber(orderNumber); + designerScore.setOrgId(operator.getOrgId()); + designerScore.setDesOrderNum(desOrderNum); + designerList.add(designerScore); + analysisModule.addDesignerScore(designerScore); + if (!hasOrderNumber(designerScore, orgMer, order)) + { + continue; + } + // 全部通过设置成功 + designerScore.setSuccess(Boolean.TRUE); + } + + // 根据分数二次排序 然后返回 + Collections.sort(designerList, getDesignerListComparator()); + return designerList; + } + + /** + * 判断单量是否符合 + * + * @param designerScore + * @param orgMer + * @param order + * @return + * @throws Exception + */ + private static boolean hasOrderNumber(DesignerScoreModel designerScore, DesignOrgMerModule orgMer, DesignOrder order) throws Exception + { + int score = designerScore.getScore();// 设计师名下所有未完成订单 + int orderNumber = designerScore.getOrderNumber();// 设计师名下所有正在设计订单 + int desOrderNum = designerScore.getDesOrderNum();// 设计师自己配置接单量 + String operatorCode = designerScore.getOperatorCode(); + + // 设计师有配置个人接单数量,只有自动派单才需要判断 + if (desOrderNum > 0) + { + if (orderNumber >= desOrderNum) + { + AnalysisResult result = new AnalysisResult(Boolean.FALSE, "设计师[" + operatorCode + "]正在设计订单已满,最大[" + desOrderNum + "],当前[" + orderNumber + "]"); + designerScore.addResult(result); + designerScore.setSuccess(Boolean.FALSE); + return Boolean.FALSE; + } + else + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "设计师[" + operatorCode + "]正在设计订单量符合,最大[" + desOrderNum + "],当前[" + orderNumber + "]"); + designerScore.addResult(result); + } + } + + // 系统运营配置:派单规则最大接单量 + int maxOrderNum = 0; + Selector sel = new Selector(); + sel.addMust("operatorCode", operatorCode); + sel.addMust("status", 1); + sel.addMust("designerStatus", 1); + DesignerGroupView designerGroup = ORM.get(ZView.class).item(DesignerGroupView.class, sel); + if (designerGroup != null) + { + maxOrderNum = designerGroup.getDesignerMaxOrderNum(); + if (maxOrderNum == 0) + { + // 个人没有配置独立规则,则获取对应规则组的数据 + maxOrderNum = designerGroup.getMaxOrderNum(); + } + } + else + { + AnalysisResult result = new AnalysisResult(Boolean.FALSE, "设计师[" + operatorCode + "]未配置接单规则"); + designerScore.addResult(result); + designerScore.setSuccess(Boolean.FALSE); + return Boolean.FALSE; + } + + // 判断全部未完成订单数量 + if (score >= maxOrderNum) + { + AnalysisResult result = new AnalysisResult(Boolean.FALSE, "设计师[" + operatorCode + "]未完成订单已满,最大[" + maxOrderNum + "],当前[" + score + "]"); + designerScore.addResult(result); + designerScore.setSuccess(Boolean.FALSE); + return Boolean.FALSE; + } + else + { + AnalysisResult result = new AnalysisResult(Boolean.TRUE, "设计师[" + operatorCode + "]未完成订单量符合,最大[" + maxOrderNum + "],当前[" + score + "]"); + designerScore.addResult(result); + } + + return Boolean.TRUE; + } + + /** + * yixin 获取组织下符合条件的所有设计师 + * + * @param orgIds + * @return + */ + public static String getEligibleDesignerSql(String orgIds, DesignOrder order) + { + StringBuffer buffer = new StringBuffer(); + buffer.append(getInitSql(orgIds)); + buffer.append(isSupportHighQualityOrder(order)); + buffer.append(isSupportLargeAmount(order)); + buffer.append(isSupportUrgentOrder(order)); + buffer.append(isSupportOnlyDesignOrder(order)); + buffer.append(isSupportSpecialOrder(order)); + buffer.append(isSupportOrderAmount(order)); + buffer.append(isSupportAfterNames(order)); + buffer.append(isSupportConfigValue(order)); + return buffer.toString(); + } + + /** + * yixin 获取组织下符合条件的所有设计师 + * + * @param orgIds + * @return + */ + public static String getInitSql(String orgIds) + { + StringBuffer buffer = new StringBuffer(); + buffer.append("SELECT deso.OPERATOR_CODE FROM des_online deso "); + buffer.append("LEFT JOIN designer_group_dispatch dgd ON dgd.OPERATOR_CODE = deso.OPERATOR_CODE "); + buffer.append("LEFT JOIN designer_group dg ON dg.DESIGNER_GROUP_ID = dgd.DESIGNER_GROUP_ID "); + buffer.append("WHERE deso.ORG_ID IN ("); + buffer.append(orgIds); + buffer.append(") AND deso.ONLINE_STATUS = 1 "); + buffer.append("AND dgd.STATUS = 1 "); + buffer.append("AND dg.STATUS = 1 "); + return buffer.toString(); + } + + /** + * yixin 查询条件 判断是否匹配优质订单 + * + * @param order + * @param merModule + * @return + */ + public static String isSupportHighQualityOrder(DesignOrder order) + { + if (order.isHighQualityOrder()) + { + return "AND (dg.IS_HIGH_QUALITY_ORDER = 1 OR dgd.IS_HIGH_QUALITY_ORDER = 1) "; + } + return ""; + } + + /** + * yixin 业务条件 判断是否匹配大金额订单 + * + * @param order + * @param merModule + * @return + */ + public static String isSupportLargeAmount(DesignOrder order) + { + if (order.getAmount() >= Amounts.toFen("300", 0L)) + { + return "AND (dg.IS_LARGE_AMOUNT = 1 OR dgd.IS_LARGE_AMOUNT = 1) "; + } + return ""; + } + + /** + * yixin 查询条件 判断是否匹配加急订单 + * + * @param order + * @param merModule + * @return + */ + public static String isSupportUrgentOrder(DesignOrder order) + { + if (order.isUrgent()) + { + return "AND (dg.IS_URGENT = 1 OR dgd.IS_URGENT = 1) "; + } + return ""; + } + + /** + * yixin 查询条件 判断是否匹配只设计不印刷订单 + * + * @param order + * @param merModule + * @return + */ + public static String isSupportOnlyDesignOrder(DesignOrder order) + { + if (order.isOnlyDesign()) + { + return "AND (dg.IS_DESIGN = 1 OR dgd.IS_DESIGN = 1) "; + } + return ""; + } + + /** + * yixin 查询条件 判断是否匹配异形订单 + * + * @param order + * @param merModule + * @return + */ + public static String isSupportSpecialOrder(DesignOrder order) + { + if ((order.getPrintWidth() > 0 || order.getPrintHeight() > 0)) + { + return "AND (dg.IS_SPECIAL = 1 OR dgd.IS_SPECIAL = 1) "; + } + return ""; + } + + /** + * yixin 查询条件 判断是否匹配订单金额范围 + * + * @param order + * @param merModule + * @return + */ + public static String isSupportOrderAmount(DesignOrder order) + { + long amount = order.getAmount(); + return "AND ((" + amount + " BETWEEN dg.MIN_ORDER_AMOUNT AND dg.MAX_ORDER_AMOUNT ) OR (" + amount + + " BETWEEN dgd.MIN_ORDER_AMOUNT AND dgd.MAX_ORDER_AMOUNT)) "; + } + + /** + * yixin 查询条件 判断是否匹配订单后加工 + * + * @param order + * @param merModule + * @return + */ + public static String isSupportAfterNames(DesignOrder order) + { + if (Validates.isNotEmpty(order.getAfterNames())) + { + StringBuffer buffer = new StringBuffer(); + List afterNames = Lists.toStringList(order.getAfterNames()); + for (String afterName : afterNames) + { + buffer.append("AND (FIND_IN_SET('" + afterName + "', dgd.AFTER_NAMES) OR FIND_IN_SET('" + afterName + "', dg.AFTER_NAMES)) "); + } + return buffer.toString(); + } + return ""; + } + + /** + * yixin 查询提交 判断是否符合配置条件(稿件类型和产品类型配置 行业配置) + * + * @param order + * @return + */ + public static String isSupportConfigValue(DesignOrder order) + { + StringBuffer buffer = new StringBuffer(); + StringBuffer slq = new StringBuffer(); + buffer.append("AND ("); + buffer.append("EXISTS(SELECT 1 FROM designer_group_value dgv WHERE dg.DESIGNER_GROUP_ID = dgv.DESIGNER_GROUP_ID "); + buffer.append("AND dgv.RELATED_TYPE = relatedType "); + buffer.append("AND dgv.RELATED_VALUE = relatedValue)or("); + buffer.append("EXISTS(SELECT 1 FROM designer_group_dispatch_value dgdv WHERE dgd.OPERATOR_CODE = dgdv.OPERATOR_CODE "); + buffer.append("AND dgdv.RELATED_TYPE = relatedType "); + buffer.append("AND dgdv.RELATED_VALUE = relatedValue))) "); + String tmp = buffer.toString(); + // 判断改稿自来稿 + if (order.getDraftType() == DraftConstants.DRAFT_STANDARD.value()) + { + tmp = tmp.replaceAll("relatedType", "0"); + } + // 判断标准自来稿 + else if (order.getDraftType() == DraftConstants.DRAFT_TEMPLATE.value()) + { + tmp = tmp.replaceAll("relatedType", "4"); + } + // 判断普通设计稿 + else if (order.getDraftType() == DraftConstants.DRAFT_COMMON_DESIGN.value()) + { + tmp = tmp.replaceAll("relatedType", "1"); + } + // 判断资深设计稿 + else if (order.getDraftType() == DraftConstants.DRAFT_PAGE_DESIGN.value()) + { + tmp = tmp.replaceAll("relatedType", "2"); + } + tmp = tmp.replaceAll("relatedValue", String.valueOf(order.getTypeId())); + slq.append(tmp); + tmp = buffer.toString(); + // 判断行业 + // slq.append(tmp.replaceAll("relatedType", "3").replaceAll("relatedValue", + // String.valueOf(order.getIndustryId()))); + return slq.toString(); + } + + /** + * 查询老用户订单 + * + * @author caohong + * @param order + * @return 设计师 + * @throws Exception + */ + public static ZmrOperator isOldUserOrder(DesignOrder order) throws Exception + { + Selector selector = new Selector(); + selector.addMust("buyerNick", order.getBuyerNick()); + selector.addMustIsNotNull("designer"); + selector.addMustNotEqual("designId", order.getDesignId()); // 排除自己 + selector.addMustThenGE("status", StatusConstants.ORDER_30.value()); + Timestamp time = Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringByHour(12)); + selector.addMustThenLE("createTime", time);// 12小时之内算ab单规则 + selector.addOrderbyDesc("createTime"); + PageResult result = ORM.get(ZTable.class).page(DesignOrder.class, 1, 10, selector); + if (result.isEmpty()) + { + return null; + } + + for (DesignOrder ord : result.list()) + { + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, ord.getDesigner()); + // 订单对应的设计师判断:找不到对应的操作员信息,或者操作员被停用 + if (operator == null || operator.getOperatorStatus() == 1) + { + continue; + } + else + { + return operator; + } + } + + return null; + } + + /** + * 查询AB订单设计师 + * + * @author caohong + * @param order + * @return 设计师 + * @throws Exception + */ + public static ZmrOperator isABOrder(DesignOrder order) throws Exception + { + Selector selector = new Selector(); + selector.addMust("buyerNick", order.getBuyerNick()); + selector.addMustIsNotNull("designer"); + selector.addMustNotEqual("designId", order.getDesignId()); // 排除自己 + selector.addMustThenGE("status", StatusConstants.ORDER_30.value()); + Timestamp time = Sqls.toTimestamp(DateTimes.getPreviousDateTimeStringByHour(12)); + selector.addMustThenGE("createTime", time);// 12小时之内算ab单规则,直接派单 + selector.addOrderbyDesc("createTime"); + PageResult result = ORM.get(ZTable.class).page(DesignOrder.class, 1, 10, selector); + if (result.isEmpty()) + { + return null; + } + + for (DesignOrder ord : result.list()) + { + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, ord.getDesigner()); + // 订单对应的设计师判断:找不到对应的操作员信息,或者操作员被停用 + if (operator == null || operator.getOperatorStatus() == 1) + { + continue; + } + else + { + return operator; + } + } + + return null; + } + + /** + * 获取设计师组的map集合数据 + * + * @return + * @throws Exception + */ + public static Map getDesignerGroupDataModelMap() throws Exception + { + Map map = new HashMap(); + List designerGroupList = ORM.get(ZTable.class).list(DesignerGroup.class, new Selector().addMust("status", 1)); + for (DesignerGroup designerGroup : designerGroupList) + { + DesignerGroupDataModel model = new DesignerGroupDataModel(); + List designerGroupValues = ORM.get(ZTable.class).list(DesignerGroupValue.class, + new Selector().addMust("designerGroupId", designerGroup.getDesignerGroupId())); + model.setDesignerGroup(designerGroup); + model.setDesignerGroupValueList(designerGroupValues); + map.put(designerGroup.getDesignerGroupId(), model); + } + return map; + } + + /** + * yixin 获取排序方式 匹配成功的设计师单量越少优先级越高 + * + * @return + */ + private static Comparator getDesignerListComparator() + { + Comparator comparator = new Comparator() + { + @Override + public int compare(DesignerScoreModel designerScore1, DesignerScoreModel designerScore2) + { + if (designerScore1.isSuccess() && !designerScore2.isSuccess()) + { + return -1; + } + else if (!designerScore1.isSuccess() && designerScore2.isSuccess()) + { + return 1; + } + else + { + // 单量低的排在最前 + return designerScore1.getScore() - designerScore2.getScore(); + } + } + }; + return comparator; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/DingdingUtil.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/DingdingUtil.java new file mode 100644 index 0000000..a153d8f --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/DingdingUtil.java @@ -0,0 +1,54 @@ +package com.zhiqim.yangcai.util; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; + +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.DingTalkClient; +import com.dingtalk.api.request.OapiRobotSendRequest; +import com.taobao.api.ApiException; + +/** + * [简要描述]:钉钉消息通知工具类
            + * + * @version 1.0 @author caohong 2019-11-2 新建与整理 + */ +public class DingdingUtil +{ + private static final Log log = LogFactory.getLog(DingdingUtil.class); + + /** + * 钉钉群机器人消息推送地址,需要再群里面配置 + */ + private static String msgUrl = "https://oapi.dingtalk.com/robot/send?access_token=f7a6388882c013358c89750876c2f23611c7ab94c762b6f896a3092dfb26f89e"; + + /** + * [简要描述]:钉钉群消息推送
            + * 当前推送到研发部门群里面 + * + * @param content 推送消息内容 + * @author caohong + */ + public static void sendMsgToDingding(String content) + { + DingTalkClient client = new DefaultDingTalkClient(msgUrl); + OapiRobotSendRequest request = new OapiRobotSendRequest(); + request.setMsgtype("text"); + OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text(); + text.setContent(content); + request.setText(text); + // OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); + // at.setAtMobiles(Arrays.asList("17346884115")); + // request.setAt(at); + + try + { + client.execute(request); + } + catch (ApiException e) + { + log.error("消息推送钉钉异常," + e.getMessage(), e); + } + + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/ExportUtils.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/ExportUtils.java new file mode 100644 index 0000000..51a6015 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/ExportUtils.java @@ -0,0 +1,329 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 + */ +package com.zhiqim.yangcai.util; + +import java.io.OutputStream; +import java.net.URLEncoder; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.util.Validates; + +import jxl.Workbook; +import jxl.format.Alignment; +import jxl.format.Border; +import jxl.format.BorderLineStyle; +import jxl.format.Colour; +import jxl.format.PageOrientation; +import jxl.format.VerticalAlignment; +import jxl.write.Label; +import jxl.write.Number; +import jxl.write.NumberFormat; +import jxl.write.WritableCellFormat; +import jxl.write.WritableFont; +import jxl.write.WritableSheet; +import jxl.write.WritableWorkbook; + +/** + * 报表导出工具类 + */ +public class ExportUtils +{ + /** + * 导出excel + * + * @param response + * @param report + * @throws Exception + */ + public static void exportExcel(HttpRequest request, Report report) throws Exception + { + if (report.size() > (255 * 255)) + { + throw new Exception("数据太大超过限制,数据总记录不能超过" + (255 * 255)); + } + + request.setCharacterEncoding("UTF-8"); + request.getResponse().setContentType("application/msexcel"); + + String agent = request.getHeader("USER-AGENT").toLowerCase(); + if (agent.indexOf("firefox") != -1) + { + request.getResponse().addHeader("Content-Disposition", "attachment;filename=" + report.getFileName()); + } + else + { + request.getResponse().addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(report.getFileName(), "UTF-8")); + } + + OutputStream os = request.getResponse().getOutputStream(); + WritableWorkbook wwb = Workbook.createWorkbook(os); + WritableSheet ws = wwb.createSheet(report.getTitle(), 0); + ws.getSettings().setLeftMargin(0.25); + ws.getSettings().setRightMargin(0.25); + ws.getSettings().setTopMargin(0.5); + ws.getSettings().setBottomMargin(0.5); + if (report.getExcelPageType() == 1) + { + ws.setPageSetup(PageOrientation.LANDSCAPE); + } + + // 设置行高 + ws.setRowView(0, 800);// 标题行 + ws.setRowView(1, 400);// 列头行 + for (int i = 0; i < report.size(); i++) + { + ws.setRowView(i + 2, report.getHeight());// 数据行 + } + ws.setRowView(report.size() + 2, 400);// 脚注行 + + // 标题行 + WritableFont titleFont = new WritableFont(WritableFont.TIMES, 16, WritableFont.BOLD); + WritableCellFormat titleFormat = new WritableCellFormat(titleFont); + titleFormat.setBorder(Border.ALL, BorderLineStyle.THIN); + titleFormat.setAlignment(Alignment.CENTRE);// 水平居中 + titleFormat.setVerticalAlignment(VerticalAlignment.CENTRE);// 垂直居中 + Label titleLab = new Label(0, 0, report.getTitle(), titleFormat); + ws.addCell(titleLab); + ws.mergeCells(0, 0, report.length() - 1, 0); + + // 列头行 + WritableFont headerFont = new WritableFont(WritableFont.TIMES, 12, WritableFont.NO_BOLD); + WritableCellFormat headerFormat = new WritableCellFormat(headerFont); + headerFormat.setAlignment(Alignment.LEFT); // 水平对齐 + headerFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐 + headerFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 设置边框 + headerFormat.setBackground(Colour.GRAY_25); + headerFormat.setWrap(true); + + for (int i = 0; i < report.length(); i++) + { + ws.setColumnView(i, report.getWidths()[i]); + String hearder[] = report.getHearder(); + Label lable = new Label(i, 1, hearder[i], headerFormat); + ws.addCell(lable); + } + + // 数据行 + if (!report.isEmpty()) + { + WritableFont dataFont = new WritableFont(WritableFont.TIMES, 12, WritableFont.NO_BOLD); + WritableCellFormat dataStringFormat = new WritableCellFormat(dataFont); + dataStringFormat.setAlignment(Alignment.LEFT); // 水平对齐 + dataStringFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐 + dataStringFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 设置边框 + dataStringFormat.setWrap(true); + + NumberFormat numberFormat = new NumberFormat("##0"); // 设置数值格式,保留0 + WritableCellFormat dataNumberFormat = new WritableCellFormat(numberFormat); // 设置表单格式 + dataNumberFormat.setAlignment(Alignment.LEFT); // 水平对齐 + dataNumberFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐 + dataNumberFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 设置边框 + dataNumberFormat.setWrap(true); + + NumberFormat amountFormat = new NumberFormat("¥#,##0.00;¥-#,##0.00"); // 设置金额格式,保留0.00 + WritableCellFormat dataAmountFormat = new WritableCellFormat(amountFormat); // 设置表单格式 + dataAmountFormat.setAlignment(Alignment.LEFT); // 水平对齐 + dataAmountFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐 + dataAmountFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 设置边框 + dataAmountFormat.setWrap(true); + + for (int i = 0; i < report.size(); i++) + { + String[] data = report.get(i); + for (int j = 0; j < report.length(); j++) + { + if (report.isNumber(j)) + { + ws.addCell(new Number(j, i + 2, Long.parseLong(data[j]), dataNumberFormat)); + } + else if (report.isMoney(j)) + { + ws.addCell(new Number(j, i + 2, Double.parseDouble(data[j]), dataAmountFormat)); + } + else + { + ws.addCell(new Label(j, i + 2, data[j], dataStringFormat)); + } + } + } + } + + // 脚注行 + if (report.getFooter() != null) + { + WritableFont footerFont = new WritableFont(WritableFont.TIMES, 12, WritableFont.NO_BOLD); + WritableCellFormat footerFormat = new WritableCellFormat(footerFont); + footerFormat.setAlignment(Alignment.RIGHT); // 水平对齐 + footerFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐 + footerFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 设置边框 + footerFormat.setWrap(true); + + Label footerLabel = new Label(0, report.size() + 2, report.getFooter(), footerFormat); + ws.addCell(footerLabel); + ws.mergeCells(0, report.size() + 2, report.length() - 1, report.size() + 2); + } + + // 写入文件 + wwb.write(); + wwb.close(); + os.flush(); + os.close(); + } + + /** + * 导出多工作簿的excel + * + * @param response + * @param report + * @param fileName + * @throws Exception + */ + public static void exportExcel(HttpRequest request, List reports, String fileName) throws Exception + { + if (Validates.isEmpty(reports)) + { + throw new Exception("数据列表为空"); + } + else if (Validates.isEmpty(fileName)) + { + throw new Exception("文件名不能为空"); + } + request.setCharacterEncoding("UTF-8"); + request.getResponse().setContentType("application/msexcel"); + + String agent = request.getHeader("USER-AGENT").toLowerCase(); + if (agent.indexOf("firefox") != -1) + { + request.getResponse().addHeader("Content-Disposition", "attachment;filename=" + fileName); + } + else + { + request.getResponse().addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); + } + + OutputStream os = request.getResponse().getOutputStream(); + WritableWorkbook wwb = Workbook.createWorkbook(os); + for (Report report : reports) + { + WritableSheet ws = wwb.createSheet(report.getTitle(), reports.indexOf(report)); + ws.getSettings().setLeftMargin(0.25); + ws.getSettings().setRightMargin(0.25); + ws.getSettings().setTopMargin(0.5); + ws.getSettings().setBottomMargin(0.5); + if (report.getExcelPageType() == 1) + { + ws.setPageSetup(PageOrientation.LANDSCAPE); + } + + // 设置行高 + ws.setRowView(0, 800);// 标题行 + ws.setRowView(1, 400);// 列头行 + for (int i = 0; i < report.size(); i++) + { + ws.setRowView(i + 2, report.getHeight());// 数据行 + } + ws.setRowView(report.size() + 2, 400);// 脚注行 + + // 标题行 + WritableFont titleFont = new WritableFont(WritableFont.TIMES, 16, WritableFont.BOLD); + WritableCellFormat titleFormat = new WritableCellFormat(titleFont); + titleFormat.setBorder(Border.ALL, BorderLineStyle.THIN); + titleFormat.setAlignment(Alignment.CENTRE);// 水平居中 + titleFormat.setVerticalAlignment(VerticalAlignment.CENTRE);// 垂直居中 + Label titleLab = new Label(0, 0, report.getTitle(), titleFormat); + ws.addCell(titleLab); + ws.mergeCells(0, 0, report.length() - 1, 0); + + // 列头行 + WritableFont headerFont = new WritableFont(WritableFont.TIMES, 12, WritableFont.NO_BOLD); + WritableCellFormat headerFormat = new WritableCellFormat(headerFont); + headerFormat.setAlignment(Alignment.LEFT); // 水平对齐 + headerFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐 + headerFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 设置边框 + headerFormat.setBackground(Colour.GRAY_25); + headerFormat.setWrap(true); + + for (int i = 0; i < report.length(); i++) + { + ws.setColumnView(i, report.getWidths()[i]); + String hearder[] = report.getHearder(); + Label lable = new Label(i, 1, hearder[i], headerFormat); + ws.addCell(lable); + } + + // 数据行 + if (!report.isEmpty()) + { + WritableFont dataFont = new WritableFont(WritableFont.TIMES, 12, WritableFont.NO_BOLD); + WritableCellFormat dataStringFormat = new WritableCellFormat(dataFont); + dataStringFormat.setAlignment(Alignment.LEFT); // 水平对齐 + dataStringFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐 + dataStringFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 设置边框 + dataStringFormat.setWrap(true); + + NumberFormat numberFormat = new NumberFormat("##0"); // 设置数值格式,保留0 + WritableCellFormat dataNumberFormat = new WritableCellFormat(numberFormat); // 设置表单格式 + dataNumberFormat.setAlignment(Alignment.LEFT); // 水平对齐 + dataNumberFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐 + dataNumberFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 设置边框 + dataNumberFormat.setWrap(true); + + NumberFormat amountFormat = new NumberFormat("¥#,##0.00;¥-#,##0.00"); // 设置金额格式,保留0.00 + WritableCellFormat dataAmountFormat = new WritableCellFormat(amountFormat); // 设置表单格式 + dataAmountFormat.setAlignment(Alignment.LEFT); // 水平对齐 + dataAmountFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐 + dataAmountFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 设置边框 + dataAmountFormat.setWrap(true); + + for (int i = 0; i < report.size(); i++) + { + String[] data = report.get(i); + for (int j = 0; j < report.length(); j++) + { + if (report.isNumber(j)) + { + ws.addCell(new Number(j, i + 2, Long.parseLong(data[j]), dataNumberFormat)); + } + else if (report.isMoney(j)) + { + ws.addCell(new Number(j, i + 2, Double.parseDouble(data[j]), dataAmountFormat)); + } + else + { + ws.addCell(new Label(j, i + 2, data[j], dataStringFormat)); + } + } + } + } + + // 脚注行 + if (report.getFooter() != null) + { + WritableFont footerFont = new WritableFont(WritableFont.TIMES, 12, WritableFont.NO_BOLD); + WritableCellFormat footerFormat = new WritableCellFormat(footerFont); + footerFormat.setAlignment(Alignment.RIGHT); // 水平对齐 + footerFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐 + footerFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 设置边框 + footerFormat.setWrap(true); + + Label footerLabel = new Label(0, report.size() + 2, report.getFooter(), footerFormat); + ws.addCell(footerLabel); + ws.mergeCells(0, report.size() + 2, report.length() - 1, report.size() + 2); + } + } + + // 写入文件 + wwb.write(); + wwb.close(); + os.flush(); + os.close(); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/FileTransferUtil.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/FileTransferUtil.java new file mode 100644 index 0000000..258d5b8 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/FileTransferUtil.java @@ -0,0 +1,95 @@ +package com.zhiqim.yangcai.util; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.TreeMap; + +import org.apache.http.HttpEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.mime.HttpMultipartMode; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; + +import com.alibaba.fastjson.JSON; +import com.aspose.imaging.internal.Exceptions.Exception; +import com.sun.javafx.collections.MappingChange.Map; + +public class FileTransferUtil { + private static final String TEST_URL = "http://localhost:54673/uploadFile.aspx"; + private static final String URL = "http://183.250.143.56:8088/uploadFile.aspx"; + + private static final Integer USER_ID = 2125; + + private static final Integer ORG_ID = 4; + + public static class Response { + String res; + String msg; + + public String getRes() { + return res; + } + + public void setRes(String res) { + this.res = res; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + } + + public static Response sendFile(String path) { + File file = new File(path); + if (!file.exists()) { + throw new Exception("文件不存在"); + } + CloseableHttpResponse response = null; + try { + String fileName = file.getName(); + + CloseableHttpClient httpClient = HttpClients.createDefault(); + URIBuilder uriBuilder = new URIBuilder(URL); + TreeMap urlParamsMap = new TreeMap(); + urlParamsMap.put("userid", USER_ID.toString()); + urlParamsMap.put("orgid", ORG_ID.toString()); + // 设置地址栏请求参数 + uriBuilder = HttpClientUtilNew.setUriBuilderParameters(uriBuilder, urlParamsMap); + URI uri = uriBuilder.build(); + HttpPost httpPost = new HttpPost(uri); + byte[] fileBytes = Files.readAllBytes(Paths.get(file.getAbsolutePath())); + + MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create() + .setMode(HttpMultipartMode.RFC6532) + .addBinaryBody("Fdata", fileBytes, ContentType.MULTIPART_FORM_DATA, fileName); + HttpEntity requestEntity = multipartEntityBuilder.build(); + httpPost.setEntity(requestEntity); + response = httpClient.execute(httpPost); + try { + response.close(); + } catch (Exception e) { + // TODO: handle exception + } + String json = EntityUtils.toString(response.getEntity()); + Response response2 = JSON.parseObject(json, Response.class); + return response2; + } catch (java.lang.Exception e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/HttpClientUtilNew.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/HttpClientUtilNew.java new file mode 100644 index 0000000..8d6cdee --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/HttpClientUtilNew.java @@ -0,0 +1,357 @@ +package com.zhiqim.yangcai.util; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.charset.Charset; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +import org.apache.commons.codec.CharEncoding; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.protocol.HTTP; +import org.apache.http.util.EntityUtils; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; + +/** + * Apache HttpClient工具类
            + * 注:异常统一向上抛出由最终调用方捕获处理
            + * + * @author caohong + * @date 2021-6-30 11:29:13 + */ +public class HttpClientUtilNew { + + /** + * 默认RequestConfig,默认设置连接超时时间10秒 + */ + private static RequestConfig defaultRequestConfig = RequestConfig.custom().setConnectTimeout(10000) + .setConnectionRequestTimeout(10000).setSocketTimeout(10000).build(); + + /** + * 设置地址栏url参数
            + * + * @param uriBuilder + * @param urlParamsMap 地址栏参数map + * @return org.apache.http.client.utils.URIBuilder + */ + @SuppressWarnings("rawtypes") + static URIBuilder setUriBuilderParameters(URIBuilder uriBuilder, TreeMap urlParamsMap) { + if (Validates.isNotEmpty(urlParamsMap)) { + Set> entrySet = urlParamsMap.entrySet(); + for (Map.Entry entry : entrySet) { + if (entry != null) { + if (entry.getValue() == null) { + continue; + } + String tempKey = (String) entry.getKey(); + String tempValue = (String) entry.getValue(); + uriBuilder.addParameter(tempKey, tempValue); + } + } + } + return uriBuilder; + } + + /** + * 追加设置GET请求 请求头组
            + * + * @param httpGet + * @param headersMap 请求头组map + * @return org.apache.http.client.methods.HttpGet + */ + @SuppressWarnings("rawtypes") + private static HttpGet addAllHeadersOfGet(HttpGet httpGet, TreeMap headersMap) { + if (Validates.isNotEmpty(headersMap)) { + Set> entrySet = headersMap.entrySet(); + for (Map.Entry entry : entrySet) { + if (entry != null) { + if (entry.getValue() == null) { + continue; + } + String tempKey = (String) entry.getKey(); + String tempValue = (String) entry.getValue(); + httpGet.addHeader(tempKey, tempValue); + } + } + } + return httpGet; + } + + /** + * 追加设置POST请求 请求头组
            + * + * @param httpPost + * @param headersMap 请求头组map + * @return org.apache.http.client.methods.HttpGet + */ + @SuppressWarnings("rawtypes") + private static HttpPost addAllHeadersOfPost(HttpPost httpPost, TreeMap headersMap) { + if (Validates.isNotEmpty(headersMap)) { + Set> entrySet = headersMap.entrySet(); + for (Map.Entry entry : entrySet) { + if (entry != null) { + if (entry.getValue() == null) { + continue; + } + String tempKey = (String) entry.getKey(); + String tempValue = (String) entry.getValue(); + httpPost.addHeader(tempKey, tempValue); + } + } + } + return httpPost; + } + + /** + * 设置POST请求body参数
            + * + * @param httpPost + * @param bodyParamsMap 请求体body参数map + * @return org.apache.http.client.methods.HttpPost + */ + private static HttpPost setPostJsonEntity(HttpPost httpPost, LinkedHashMap bodyParamsMap) + throws UnsupportedEncodingException { + if (Validates.isNotEmpty(bodyParamsMap)) { + StringEntity stringEntity = new StringEntity(JSON.toJSONString(bodyParamsMap), + Charset.forName(CharEncoding.UTF_8)); + stringEntity.setContentType("application/json"); + stringEntity.setContentEncoding(CharEncoding.UTF_8); + httpPost.setEntity(stringEntity); + } + return httpPost; + } + + private static HttpPost setPostJsonEntity1(HttpPost httpPost, String bodyParamsMap) + throws UnsupportedEncodingException { + if (Validates.isNotEmpty(bodyParamsMap)) { + StringEntity stringEntity = new StringEntity(bodyParamsMap, Charset.forName(CharEncoding.UTF_8)); + stringEntity.setContentType("application/json"); + stringEntity.setContentEncoding(CharEncoding.UTF_8); + httpPost.setEntity(stringEntity); + } + return httpPost; + } + + /** + * 设置POST请求body参数
            + * + * @param httpPost + * @param bodyParamsMap 请求体body参数map + * @return org.apache.http.client.methods.HttpPost + */ + private static HttpPost setPostErpEntity(HttpPost httpPost, LinkedHashMap bodyParamsMap) + throws UnsupportedEncodingException { + if (Validates.isNotEmpty(bodyParamsMap)) { + StringEntity stringEntity = new StringEntity(buildQueryString(bodyParamsMap), + Charset.forName(CharEncoding.UTF_8)); + httpPost.setEntity(stringEntity); + } + return httpPost; + } + + /** + * 统一关闭CloseableHttpClient和CloseableHttpResponse
            + * + * @param httpClient + * @param httpResponse + * @return void + */ + private static void doClose(CloseableHttpClient httpClient, CloseableHttpResponse httpResponse) throws IOException { + if (httpClient != null) { + httpClient.close(); + } + + if (httpResponse != null) { + httpResponse.close(); + } + } + + /** + * 发起GET请求
            + * + * @param url 请求地址 + * @param urlParamsMap 地址栏参数map + * @param headersMap 请求头组map + * @return java.lang.String + */ + public static String sendGet(String url, TreeMap urlParamsMap, TreeMap headersMap) + throws URISyntaxException, IOException { + CloseableHttpClient httpClient = HttpClients.createDefault(); + CloseableHttpResponse httpResponse = null; + String result = ""; + + URIBuilder uriBuilder = new URIBuilder(url); + if (Validates.isNotEmpty(urlParamsMap)) { + // 设置地址栏请求参数 + uriBuilder = setUriBuilderParameters(uriBuilder, urlParamsMap); + } + URI uri = uriBuilder.build(); + + HttpGet httpGet = new HttpGet(uri); + if (Validates.isNotEmpty(headersMap)) { + // 设置请求头组 + httpGet = addAllHeadersOfGet(httpGet, headersMap); + } + + // 设置RequestConfig + httpGet.setConfig(defaultRequestConfig); + + httpResponse = httpClient.execute(httpGet); + result = EntityUtils.toString(httpResponse.getEntity(), CharEncoding.UTF_8); + doClose(httpClient, httpResponse); + return result; + } + + /** + * 发起POST请求
            + * + * @param url 请求地址 + * @param urlParamsMap 地址栏参数map + * @param bodyParamsMap 请求体参数map + * @return java.lang.String + */ + public static String sendJsonPost(String url, TreeMap urlParamsMap, + LinkedHashMap bodyParamsMap) throws URISyntaxException, IOException { + CloseableHttpClient httpClient = HttpClients.createDefault(); + CloseableHttpResponse httpResponse = null; + String result = ""; + + URIBuilder uriBuilder = new URIBuilder(url); + if (Validates.isNotEmpty(urlParamsMap)) { + // 设置地址栏请求参数 + uriBuilder = setUriBuilderParameters(uriBuilder, urlParamsMap); + } + URI uri = uriBuilder.build(); + + HttpPost httpPost = new HttpPost(uri); + // 设置请求头组 + TreeMap headersMap = new TreeMap<>(); + headersMap.put(HTTP.CONTENT_TYPE, "application/json"); + httpPost = addAllHeadersOfPost(httpPost, headersMap); + + // 设置RequestConfig + httpPost.setConfig(defaultRequestConfig); + + if (Validates.isNotEmpty(bodyParamsMap)) { + // 设置请求体json参数 + httpPost = setPostJsonEntity(httpPost, bodyParamsMap); + } + + httpResponse = httpClient.execute(httpPost); + result = EntityUtils.toString(httpResponse.getEntity(), CharEncoding.UTF_8); + doClose(httpClient, httpResponse); + return result; + } + + public static String sendJsonPost1(String url, TreeMap urlParamsMap, String bodyParamsMap) + throws URISyntaxException, IOException { + CloseableHttpClient httpClient = HttpClients.createDefault(); + CloseableHttpResponse httpResponse = null; + String result = ""; + + URIBuilder uriBuilder = new URIBuilder(url); + if (Validates.isNotEmpty(urlParamsMap)) { + // 设置地址栏请求参数 + uriBuilder = setUriBuilderParameters(uriBuilder, urlParamsMap); + } + URI uri = uriBuilder.build(); + + HttpPost httpPost = new HttpPost(uri); + // 设置请求头组 + TreeMap headersMap = new TreeMap<>(); + headersMap.put(HTTP.CONTENT_TYPE, "application/json"); + httpPost = addAllHeadersOfPost(httpPost, headersMap); + + // 设置RequestConfig + httpPost.setConfig(defaultRequestConfig); + + if (Validates.isNotEmpty(bodyParamsMap)) { + // 设置请求体json参数 + httpPost = setPostJsonEntity1(httpPost, bodyParamsMap); + } + + httpResponse = httpClient.execute(httpPost); + result = EntityUtils.toString(httpResponse.getEntity(), CharEncoding.UTF_8); + doClose(httpClient, httpResponse); + return result; + } + + /** + * 发起POST请求
            + * + * @param url 请求地址 + * @param urlParamsMap 地址栏参数map + * @param bodyParamsMap 请求体参数map + * @return java.lang.String + */ + public static String sendErpPost(String url, TreeMap urlParamsMap, + LinkedHashMap bodyParamsMap) throws URISyntaxException, IOException { + CloseableHttpClient httpClient = HttpClients.createDefault(); + CloseableHttpResponse httpResponse = null; + String result = ""; + + URIBuilder uriBuilder = new URIBuilder(url); + if (Validates.isNotEmpty(urlParamsMap)) { + // 设置地址栏请求参数 + uriBuilder = setUriBuilderParameters(uriBuilder, urlParamsMap); + } + URI uri = uriBuilder.build(); + + HttpPost httpPost = new HttpPost(uri); + // 设置请求头组 + TreeMap headersMap = new TreeMap<>(); + headersMap.put(HTTP.CONTENT_TYPE, "application/x-www-form-urlencoded"); + httpPost = addAllHeadersOfPost(httpPost, headersMap); + + // 设置RequestConfig + httpPost.setConfig(defaultRequestConfig); + + if (Validates.isNotEmpty(bodyParamsMap)) { + // 设置请求体json参数 + httpPost = setPostErpEntity(httpPost, bodyParamsMap); + } + + httpResponse = httpClient.execute(httpPost); + result = EntityUtils.toString(httpResponse.getEntity(), CharEncoding.UTF_8); + doClose(httpClient, httpResponse); + return result; + } + + private static String buildQueryString(Map paramMap) { + StringBuffer strb = new StringBuffer(""); + boolean first = true; + for (Map.Entry entry : paramMap.entrySet()) { + String value = null; + if (entry.getValue() == null) { + value = ""; + } else { + value = Urls.encodeUTF8(String.valueOf(entry.getValue())); + } + if (first) { + strb.append(entry.getKey()).append("=").append(value); + first = false; + } else { + + strb.append("&").append(entry.getKey()).append("=").append(value); + } + } + + return strb.toString(); + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/HttpDiansanResult.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/HttpDiansanResult.java new file mode 100644 index 0000000..ad7fe5a --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/HttpDiansanResult.java @@ -0,0 +1,45 @@ +package com.zhiqim.yangcai.util; +import org.zhiqim.kernel.json.Jsons; +public class HttpDiansanResult { + + private Boolean success; + private Long timestamp; + private String msg; + private Object data; + private Integer code; + private static final long serialVersionUID = 1L; + @Override + public String toString() { + return Jsons.toString(this); + } + public Boolean getSuccess() { + return success; + } + public void setSuccess(Boolean success) { + this.success = success; + } + public Long getTimestamp() { + return timestamp; + } + public void setTimestamp(Long timestamp) { + this.timestamp = timestamp; + } + public String getMsg() { + return msg; + } + public void setMsg(String msg) { + this.msg = msg; + } + public Object getData() { + return data; + } + public void setData(Object data) { + this.data = data; + } + public Integer getCode() { + return code; + } + public void setCode(Integer code) { + this.code = code; + } + } \ No newline at end of file diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/QiyeWechatUtil.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/QiyeWechatUtil.java new file mode 100644 index 0000000..1ad9319 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/QiyeWechatUtil.java @@ -0,0 +1,271 @@ +/** + * 扬彩印刷设计 + * 文件名 :QiyeWechatUtil.java + * 创建人 :gjx + * 创建时间:2020-1-7 + */ + +package com.zhiqim.yangcai.util; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.net.URL; +import java.net.URLConnection; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.manager.dbo.ZmrParam; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +/** + * [简要描述] 企业微信消息通知工具类:
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2020-1-7 新建与整理 + */ +public class QiyeWechatUtil +{ + private static final Log log = LogFactory.getLog(QiyeWechatUtil.class); + + /** 研发告警消息群 */ + private static String msgUrl = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=b95ba297-c750-46e3-8b12-65676f7124dc"; + + /** 淘印告警消息群 */ + private static String taoyin = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=d2062e11-ace2-434a-b954-41dafa4384d7"; + + /** 印前告警消息群 */ + private static String yinqian = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=893a9e99-7446-4106-8c56-11e6a7d8cb7b"; + + /** + * + * [简要描述]: 往研发中心推送告警信息
            + * [详细描述]:
            + * + * @author gjx + * @param content + */ + public static void sendMsgToQiyeWechat(String content) + { + try + { + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, new Selector("paramKey", "openQiyeWechatPush")); + if (param != null && Boolean.valueOf(param.getParamValue())) + { + sendMsgToQiyeWechat(content, Boolean.TRUE); + } + } + catch (Exception e) + { + log.error("消息推送企业微信异常," + e.getMessage(), e); + } + + } + + /** + * + * [简要描述]: 往研发中心推送告警信息
            + * [详细描述]:
            + * + * @author gjx + * @param content + * @param push + */ + public static void sendMsgToQiyeWechat(String content, boolean push) + { + if (content != null) + { + content = content.replace("\"", ""); + } + String jsonData = "{\"msgtype\": \"text\"," + " \"text\": {\"content\": \"" + content + "\"}}"; + try + { + if (push) + { + sendPost(msgUrl, jsonData); + if (content.contains("淘印") || content.contains("淘印通")) + {// 往淘印企业微信群推 + sendPost(taoyin, jsonData); + } + if (content.contains("扬彩") || content.contains("扬彩印刷")) + {// 往印前企业微信群推 + sendPost(yinqian, jsonData); + } + } + } + catch (Exception e) + { + log.error("消息推送企业微信异常," + e.getMessage(), e); + } + + } + + /** + * [简要描述]:淘印通业务告警提醒
            + * + * @author caohong + * @param content + */ + public static void sendErrorMsg2Taoyin(String content) + { + try + { + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, new Selector("paramKey", "openQiyeWechatPush")); + if (param != null && Boolean.valueOf(param.getParamValue())) + { + sendErrorMsg2Taoyin(content, Boolean.TRUE); + } + + } + catch (Exception e) + { + log.error("消息推送企业微信异常," + e.getMessage(), e); + } + } + + /** + * + * [简要描述]: 淘印通业务告警提醒
            + * [详细描述]:
            + * + * @author gjx + * @param content + * @param push + */ + public static void sendErrorMsg2Taoyin(String content, boolean push) + { + if (content != null) + { + content = content.replace("\"", ""); + } + String jsonData = "{\"msgtype\": \"text\"," + " \"text\": {\"content\": \"" + content + "\"}}"; + try + { + if (push) + { + sendPost(taoyin, jsonData); + } + + } + catch (Exception e) + { + log.error("消息推送企业微信异常," + e.getMessage(), e); + } + } + + /** + * [简要描述]:印前业务告警提醒
            + * + * @author caohong + * @param content + */ + public static void sendErrorMsg2yinQian(String content) + { + try + { + ZmrParam param = ORM.get(ZTable.class).item(ZmrParam.class, new Selector("paramKey", "openQiyeWechatPush")); + if (param != null && Boolean.valueOf(param.getParamValue())) + { + sendErrorMsg2yinQian(content, Boolean.TRUE); + } + } + catch (Exception e) + { + log.error("消息推送企业微信异常," + e.getMessage(), e); + } + } + + /** + * + * [简要描述]:印前业务告警提醒
            + * [详细描述]:
            + * + * @author gjx + * @param content + * @param push + */ + public static void sendErrorMsg2yinQian(String content, boolean push) + { + if (content != null) + { + content = content.replace("\"", ""); + } + String jsonData = "{\"msgtype\": \"text\"," + " \"text\": {\"content\": \"" + content + "\"}}"; + try + { + if (push) + { + sendPost(yinqian, jsonData); + } + + } + catch (Exception e) + { + log.error("消息推送企业微信异常," + e.getMessage(), e); + } + } + + /** + * + * [简要描述] 发送Post请求:
            + * [详细描述]:
            + * + * @author gjx + * @param url + * @param param + * @throws Exception + */ + public static void sendPost(String url, String param) throws Exception + { + PrintWriter out = null; + BufferedReader in = null; + try + { + URL realUrl = new URL(url); + // 打开和URL之间的连接 + URLConnection conn = realUrl.openConnection(); + // 发送POST请求必须设置如下两行 + conn.setDoOutput(true); + conn.setDoInput(true); + // conn.addRequestProperty("Cookie", + // "stay_login=1 + // smid=DumpWzWQSaLmKlFY1PgAtURdV_u3W3beoei96zsXkdSABwjVCRrnnNBsnH1wGWI0-VIflgvMaZAfli9H2NGtJg + // id=EtEWf1XZRLIwk1770NZN047804");//设置获取的cookie + // 获取URLConnection对象对应的输出流(设置请求编码为UTF-8) + out = new PrintWriter(new OutputStreamWriter(conn.getOutputStream(), "UTF-8")); + // 发送请求参数 + out.print(param); + // flush输出流的缓冲 + out.flush(); + // 获取请求返回数据(设置返回数据编码为UTF-8) + in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); + } + catch (IOException e) + { + log.error("消息推送企业微信异常,post请求异常:" + e); + } + finally + { + try + { + if (out != null) + { + out.close(); + } + if (in != null) + { + in.close(); + } + } + catch (IOException ex) + { + log.error("消息推送企业微信异常,post请求关闭流异常:" + ex); + } + } + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/RRxAPIUtils.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/RRxAPIUtils.java new file mode 100644 index 0000000..4bc62dd --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/RRxAPIUtils.java @@ -0,0 +1,262 @@ +package com.zhiqim.yangcai.util; + +import java.security.MessageDigest; +import java.util.Arrays; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +import org.zhiqim.kernel.httpclient.HttpGet; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Urls; + +/** + * [简要描述]:人人秀平台对接
            + * + * @version 1.0 @author caohong 2020年6月6日 新建与整理 + */ +public class RRxAPIUtils +{ + private static final Log log = LogFactory.getLog(RRxAPIUtils.class); + + public static final String AppKey = "f69eb8fc683c36e0feba86a06909f29a"; + public static final String AppSecret = "b73THgcfcA9Ga5qC73fqF1c4b1lb7RvK"; + + /** + * [简要描述]:http get请求
            + * + * @author caohong + * @param url + * @return + */ + public static String sendGet(String url, TreeMap paramMap) + { + String queryString = buildQueryString(paramMap); + HttpGet conn = new HttpGet(url + queryString); + conn.setConnectTimeout(10); + conn.setReadTimeout(30); + conn.setConnectionClose(); + conn.execute(); + + int responseStatus = conn.getResponseStatus(); + String responseText = conn.getResponseText(); + if (responseStatus != 200) + { + log.error("RRX接口调用失败:" + responseStatus + "," + responseText); + } + return responseText; + } + + /** + * [简要描述]:请求参数拼接
            + * + * @author caohong + * @param paramMap 接口请求参数 + * @return url请求参数拼接 + */ + private static String buildQueryString(TreeMap paramMap) + { + StringBuffer strb = new StringBuffer(); + for (Map.Entry entry : paramMap.entrySet()) + { + String value = Urls.encodeUTF8(entry.getValue()); + if (strb.length() > 0) + { + strb.append("&").append(entry.getKey()).append("=").append(value); + } + else + { + strb.append("?").append(entry.getKey()).append("=").append(value); + } + } + + return strb.toString(); + } + + public static void getH5List() + { + TreeMap paramMap = new TreeMap(); + paramMap.put("app_key", AppKey); + paramMap.put("time_stamp", System.currentTimeMillis() + ""); + paramMap.put("sign", ""); + paramMap.put("page", "1"); + paramMap.put("limit", "20"); + paramMap.put("start_time", "2020-06-03 10:28:19"); + paramMap.put("end_time", "2020-06-06 10:28:19"); + String sign = generateSignature(paramMap, AppSecret); + paramMap.put("sign", sign); + + String url = "https://api.rrx.cn/v1/h5/getList"; + String resultText = RRxAPIUtils.sendGet(url, paramMap); + System.out.println(resultText); + } + + /** + * [简要描述]:活动信息
            + * + */ + public static void getH5Info() + { + TreeMap paramMap = new TreeMap(); + paramMap.put("app_key", AppKey); + paramMap.put("time_stamp", System.currentTimeMillis() + ""); + paramMap.put("sign", ""); + paramMap.put("h5_guid", "0yxzen"); + String sign = generateSignature(paramMap, AppSecret); + paramMap.put("sign", sign); + + String url = "https://api.rrx.cn/v1/h5/get"; + String resultText = RRxAPIUtils.sendGet(url, paramMap); + System.out.println(resultText); + } + + // 参与人记录接口 + public static void getActivityInfo() + { + TreeMap paramMap = new TreeMap(); + paramMap.put("app_key", AppKey); + paramMap.put("time_stamp", System.currentTimeMillis() + ""); + paramMap.put("sign", ""); + paramMap.put("activity_guid", "c616e74d986961537073ba543dc9cf4f"); + paramMap.put("page", "1"); + paramMap.put("limit", "50"); + paramMap.put("start_time", "2020-05-12 10:28:19"); + paramMap.put("end_time", "2020-05-16 12:28:19"); + String sign = generateSignature(paramMap, AppSecret); + paramMap.put("sign", sign); + + String url = "https://api.rrx.cn/v1/player/getList"; + String resultText = RRxAPIUtils.sendGet(url, paramMap); + System.out.println(resultText); + } + + // 活动互动数据接口 + public static void getActivityInfoList() + { + TreeMap paramMap = new TreeMap(); + paramMap.put("app_key", AppKey); + paramMap.put("time_stamp", System.currentTimeMillis() + ""); + paramMap.put("sign", ""); + paramMap.put("activity_guid", "c616e74d986961537073ba543dc9cf4f"); + paramMap.put("page", "1"); + paramMap.put("limit", "50"); + paramMap.put("start_time", "2020-05-12 10:28:19"); + paramMap.put("end_time", "2020-05-16 18:28:19"); + String sign = generateSignature(paramMap, AppSecret); + paramMap.put("sign", sign); + + String url = "https://api.rrx.cn/v2/data/getList"; + String resultText = RRxAPIUtils.sendGet(url, paramMap); + System.out.println(resultText); + } + + /** + * [简要描述]:免登录URL
            + * [详细描述]:通过调用该接口自动登录人人秀
            + * + * @author caohong + * @param account 登录账号 + * @param nickname 昵称 + */ + public static String loginRRX(String account, String nickname) + { + TreeMap paramMap = new TreeMap(); + paramMap.put("app_key", AppKey); + paramMap.put("time_stamp", System.currentTimeMillis() + ""); + paramMap.put("sign", ""); + paramMap.put("account_id", account); + paramMap.put("nickname", nickname); + String sign = generateSignature(paramMap, AppSecret); + paramMap.put("sign", sign); + + String url = "https://api.rrx.cn/v1/user/login"; + String reqParam = buildQueryString(paramMap); + + return url + reqParam; + } + + /** + * 生成签名. 注意,若含有sign_type字段,必须和signType参数保持一致。 + * + * @param data 待签名数据 + * @param key API密钥 + * @return 签名 + */ + public static String generateSignature(final TreeMap data, String key) + { + Set keySet = data.keySet(); + String[] keyArray = keySet.toArray(new String[keySet.size()]); + Arrays.sort(keyArray); + StringBuilder sb = new StringBuilder(); + for (String k : keyArray) + { + if (k.equals("sign")) + { + continue; + } + + if (data.get(k).trim().length() > 0) + { + sb.append(k).append("=").append(data.get(k).trim()).append("&"); + } + } + + sb.append("app_secret=").append(key); + String sgin = MD5(sb.toString()).toUpperCase(); + return sgin; + + } + + /** + * 生成 MD5 + * + * @param data 待处理数据 + * @return MD5结果 + */ + public static String MD5(String data) + { + StringBuilder sb = new StringBuilder(); + try + { + java.security.MessageDigest md = MessageDigest.getInstance("MD5"); + byte[] array = md.digest(data.getBytes("UTF-8")); + + for (byte item : array) + { + sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3)); + } + } + catch (Exception e) + { + log.error(e.getMessage(), e); + } + + return sb.toString().toUpperCase(); + } + + public static void main(String[] args) throws Exception + { + // TreeMap paramMap = new TreeMap(); + // paramMap.put("app_key", "96c84928b1dce057d110ea3b3880fc83"); + // paramMap.put("time_stamp", "1543999047492"); + // paramMap.put("openid", "ot1UbuBBzlE6IjEDWfyXQW3dy2S4"); + // paramMap.put("transaction_no", "69201704060281699381"); + // paramMap.put("nonce_str", "ibuaiVcKdpRxkhJA"); + // paramMap.put("order_no", "19201704060281699381"); + // + // RrxAPTRestTest.generateSignature(paramMap, "eRdLi88c6I6L95PFSX1Nq69Y84xLcD3T"); + String url = RRxAPIUtils.loginRRX("暖阳", "暖阳"); + System.out.println(url); + // String ascii = + // "#\\u5206\\u4eab\\u4eba\\u6635\\u79f0##\\u5206\\u4eab\\u6570#\\u97e9\\u56fdleim"; + // StringBuffer sbu = new StringBuffer(); + // String[] chars = ascii.split("\\"); + // for (int i = 0; i < chars.length; i++) + // { + // sbu.append((char) Integer.parseInt(chars[i])); + // } + // System.out.println(sbu.toString()); + + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/RandomUtil.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/RandomUtil.java new file mode 100644 index 0000000..413b229 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/RandomUtil.java @@ -0,0 +1,34 @@ +/** + * 扬彩印刷设计 + * 文件名 :RandomUtil.java + * 创建人 :gjx + * 创建时间:2021年4月22日 +*/ + +package com.zhiqim.yangcai.util; + +import org.zhiqim.kernel.util.Randoms; + +/** + * + * [简要描述]: 随机数工具类
            + * [详细描述]:
            + * + * @version 1.0 @author gjx 2021年4月22日 新建与整理 + */ +public class RandomUtil +{ + /** + * + * [简要描述]: 生产不包含0 指定长度随机数字
            + * [详细描述]:
            + * + * @author gjx + * @param length + * @return + */ + public static String randomLengthDigit(int length) + { + return Randoms.random(length, "123456789"); + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/RedisUtils.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/RedisUtils.java new file mode 100644 index 0000000..50a344e --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/RedisUtils.java @@ -0,0 +1,94 @@ +package com.zhiqim.yangcai.util; + +import java.util.List; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Validates; + +import com.zhiqim.yangcai.design.listener.KeyExpiredListener; + +import redis.clients.jedis.Jedis; +import redis.clients.jedis.JedisPool; +import redis.clients.jedis.JedisPoolConfig; + +/** + * + * [简要描述]:redis工具类
            + * [详细描述]:
            + * + * @version 1.0 @author hc 2021年6月2日 新建与整理 + * @version 1.1 @author hc 2021年10月21日 新增过期key监控 + */ +public class RedisUtils +{ + private static final Log log = LogFactory.getLog(RedisUtils.class); + + public static final String redisHost = Global.getString("redis", "redisHost"); + public static final int redisPort = Global.getInt("redis", "redisPort"); + public static final String redisPassword = Global.getString("redis", "redisPassword"); + public static JedisPool pool = null; + public static JedisPoolConfig config = new JedisPoolConfig(); + + // 初始化redis连接池 + public static Jedis getConn() + { + try + { + if (pool == null) + { + config = new JedisPoolConfig(); + // 最大连接数 + config.setMaxTotal(20); + // 最大空闲数 + config.setMaxIdle(2); + + if (Validates.isNotEmptyBlank(redisPassword)) + { + pool = new JedisPool(config, redisHost, redisPort, 10000, redisPassword); + } + else + { + pool = new JedisPool(config, redisHost, redisPort, 10000); + } + } + } + catch (Exception e) + { + log.error("redis初始化连接池失败!", e); + } + + return pool.getResource(); + } + + // 初始化异步开启key过期监控 + static + { + Thread thread = new Thread(new Runnable() + { + @Override + public void run() + { + Jedis jedis = RedisUtils.getConn(); + jedis = RedisUtils.getConn(); + config(jedis);// 最重要的部分 + jedis.psubscribe(new KeyExpiredListener(), "__key*__:*"); + } + }); + + thread.start(); + + } + + // 没开启过时事件自动开启 + private static void config(Jedis jedis) + { + String parameter = "notify-keyspace-events"; + List notify = jedis.configGet(parameter); + if (!notify.get(1).equals("Ex")) + { + jedis.configSet(parameter, "Ex"); // 过时事件 + } + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/Report.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/Report.java new file mode 100644 index 0000000..05cf8be --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/Report.java @@ -0,0 +1,172 @@ +/* + * 版权所有 (C) 2018 知启蒙(ZHIQIM) 保留所有权利。 + * + * 欢迎到知启蒙网站(https://www.zhiqim.com)购买正版软件,知启蒙还提供许多开源框架和软件。 + * + * 1、本软件产品所有源代码受《中华人民共和国著作权法》和其他有关法律、法规的保护,其所有知识产权归湖南知启蒙科技有限公司所有; + * 2、禁止复制和修改。不得复制修改、翻译或改编本软件所有源代码,或者基于本软件产品创作衍生作品; + * 3、禁止进行逆向工程。不得对本软件的源代码进行逆向工程、反编译或试图以其他方式发现软件的源代码; + * 4、个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得知启蒙的书面授权和许可; + * 5、保留权利:本注释未明示授权的其他一切权利仍归知启蒙所有,任何人使用其他权利时必须获得知启蒙的书面同意。 +*/ +package com.zhiqim.yangcai.util; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class Report implements Serializable +{ + private static final long serialVersionUID = 1L; + + public static final int A3 = 3; + public static final int A4 = 4; + public static final int Horizontal = 1;// 横向 + public static final int Vertical = 2; + + /** 导出文件名 */ + private String fileName; + + /** 导出标题 */ + private String title; + + private int[] widths;// 列宽度数组,每个数字表示占页面总宽度的百分比 + private int height = 400; + private int[] formats;// 数据格式,0表示字符串,1表示数,2表示金额 + + private String[] hearder;// 导出表格头部定义 + private List dataList = new ArrayList();// 数据列表 + private String footer;// 页脚 + private int pageSize;// PDF页面类型:A3,A4,Horizontal(横向) + private int excelPageType;// EXCEL页面类型,0纵向,1横向 + + public String getFileName() + { + return fileName; + } + + public void setFileName(String fileName) + { + this.fileName = fileName; + } + + public String getTitle() + { + return title; + } + + public void setTitle(String title) + { + this.title = title; + } + + public String[] getHearder() + { + return hearder; + } + + public void setHearder(String[] hearder) + { + this.hearder = hearder; + } + + public List getDataList() + { + return dataList; + } + + public void addData(String[] data) + { + this.dataList.add(data); + } + + public String getFooter() + { + return footer; + } + + public void setFooter(String footer) + { + this.footer = footer; + } + + public int getPageSize() + { + return pageSize; + } + + public void setPageSize(int pageSize) + { + this.pageSize = pageSize; + } + + public int[] getWidths() + { + return widths; + } + + public void setWidths(int[] widths) + { + this.widths = widths; + } + + public int[] getFormats() + { + return formats; + } + + public void setFormats(int[] formats) + { + this.formats = formats; + } + + public int getHeight() + { + return height; + } + + public void setHeight(int height) + { + this.height = height; + } + + public int getExcelPageType() + { + return excelPageType; + } + + public void setExcelPageType(int excelPageType) + { + this.excelPageType = excelPageType; + } + + public boolean isEmpty() + { + return dataList.isEmpty(); + } + + public int size() + { + return dataList.size(); + } + + public int length() + { + return hearder.length; + } + + public String[] get(int i) + { + return dataList.get(i); + } + + public boolean isNumber(int i) + { + return formats[i] == 1; + } + + public boolean isMoney(int i) + { + return formats[i] == 2; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/ResponseData.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/ResponseData.java new file mode 100644 index 0000000..e2ad3ab --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/ResponseData.java @@ -0,0 +1,96 @@ +package com.zhiqim.yangcai.util; + +/** + * [简要描述]:响应数据体
            + * [详细描述]:
            + * + * @version 1.0 @author caohong 2020年6月12日 新建与整理 + * @param + */ +public class ResponseData +{ + /*** 数据 */ + private T data; + private Integer code; + private String msg; + private String totalCount; + + private ResponseData(Integer code, T data) + { + this.code = code; + this.data = data; + this.msg = ""; + this.totalCount = ""; + } + + private ResponseData(Integer code, String msg) + { + this.code = code; + this.msg = msg; + this.totalCount = ""; + } + + private ResponseData(Integer code, T data, String msg) + { + this.code = code; + this.data = data; + this.msg = msg; + + } + + public static ResponseData out(Integer code, String msg) + { + return new ResponseData<>(code, msg); + } + + public static ResponseData out(Integer code, T data) + { + return new ResponseData<>(code, data); + } + + public static ResponseData out(Integer code, T data, String msg) + { + return new ResponseData<>(code, data, msg); + } + + public T getData() + { + return data; + } + + public void setData(T data) + { + this.data = data; + } + + public Integer getCode() + { + return code; + } + + public void setCode(Integer code) + { + this.code = code; + } + + public String getMsg() + { + return msg; + } + + public void setMsg(String msg) + { + this.msg = msg; + } + + public String getTotalCount() + { + return totalCount; + } + + public void setTotalCount(String totalCount) + { + this.totalCount = totalCount; + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/SmsUtils.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/SmsUtils.java new file mode 100644 index 0000000..d20a681 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/SmsUtils.java @@ -0,0 +1,165 @@ +package com.zhiqim.yangcai.util; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.regex.Pattern; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Validates; + +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; +import com.zhiqim.yangcai.design.constant.DesignConstants; + +/** + * 阿里云短信发送服务 + * + * @version V1.2.0 @author caohong 2020-12-26 增加阿里云短信服务 + */ +public class SmsUtils +{ + private static final Log log = LogFactory.getLog(SmsUtils.class); + + // 产品名称:云通信短信API产品,开发者无需替换 + public static final String product = "Dysmsapi"; + // 产品域名,开发者无需替换 + public static final String domain = "dysmsapi.aliyuncs.com"; + public static final String accessKeyId = Global.getString("aliyun.sms", "accessKeyId"); + public static final String accessKeySecret = Global.getString("aliyun.sms", "accessKeySecret"); + + /** + * [简要描述]:面向前端短信验证码服务
            + * + * @author caohong + * @param request HttpRequest + * @param mobile 手机号 + * @param templateCode 内容模板code
            + * SMS_174195343 身份验证验证码:验证码${code},您正在进行身份验证,打死不要告诉别人哦!
            + * SMS_174195340 用户注册验证码:验证码${code},您正在注册成为新用户,感谢您的支持!
            + * SMS_174195339 修改密码验证码:验证码${code},您正在尝试修改登录密码,请妥善保管账户信息。
            + * @throws Exception + */ + public static void sendSms(HttpRequest request) throws Exception + { + String mobile = request.getParameter("mobile"); + String templateCode = request.getParameter("templateCode"); + if (Validates.isEmpty(mobile)) + { + request.setResponseError("手机号码不能为空"); + return; + } + + if (Validates.isNotEmpty(mobile)) + { + boolean isMatch = Pattern.matches(DesignConstants.ZMR_MOBILE, mobile); + if (!isMatch) + { + request.setResponseError("请输入正确的手机号"); + return; + } + } + + if (Validates.isEmpty(templateCode)) + { + templateCode = "SMS_174195343"; + } + + // 生成短信验证码 + int smsCode = 123456; + if (isProdSystem(request)) + { + smsCode = (int) ((Math.random() * 9 + 1) * 100000); + } + + // 发送短信 + doSendSms(mobile, smsCode, templateCode); + + // 会话中保存手机短信验证码 + request.setSessionAttribute("_smscode_", String.valueOf(smsCode)); + + // 获取验证方式 + // String sessionSmsCodeSession = request.getSessionAttributeString("_smscode_"); + } + + /** + * [简要描述]:阿里云短信验证码接口
            + * + * @author caohong + * @param mobile 手机号 + * @param smsCode 验证码 + * @param templateCode 内容模板code
            + * SMS_174195343 身份验证验证码:验证码${code},您正在进行身份验证,打死不要告诉别人哦!
            + * SMS_174195340 用户注册验证码:验证码${code},您正在注册成为新用户,感谢您的支持!
            + * SMS_174195339 修改密码验证码:验证码${code},您正在尝试修改登录密码,请妥善保管账户信息。
            + * @throws Exception + */ + @SuppressWarnings("deprecation") + private static void doSendSms(String mobile, int smsCode, String templateCode) throws Exception + { + if (Validates.isEmpty(templateCode)) + { + templateCode = "SMS_174195343"; + } + + // 设置超时时间-可自行调整 + System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); + System.setProperty("sun.net.client.defaultReadTimeout", "10000"); + + // 初始化ascClient,暂时不支持多region(请勿修改) + IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKeyId, accessKeySecret); + DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", product, domain); + IAcsClient acsClient = new DefaultAcsClient(profile); + // 组装请求对象 + SendSmsRequest request = new SendSmsRequest(); + // 使用post提交 + // 必填:待发送手机号。支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式; + request.setPhoneNumbers(mobile); + // 必填:短信签名-可在短信控制台中找到 + request.setSignName("秒绘科技"); + // 必填:短信内容模板 + request.setTemplateCode(templateCode); + // 可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时 + request.setTemplateParam("{\"code\":\"" + smsCode + "\"}"); + // 请求失败这里会抛ClientException异常 + SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request); + if (sendSmsResponse.getCode() != null && sendSmsResponse.getCode().equals("OK")) + { + // log.info("手机号【" + mobile + "】发送短信验证码【" + smsCode + "】成功"); + } + else + { + log.error("手机号【" + mobile + "】发送短信验证码【" + smsCode + "】失败," + sendSmsResponse.getMessage()); + } + } + + /** + * 是否生产环境 + * + * @author caohong + * @param request + * @return + */ + private static boolean isProdSystem(HttpRequest request) + { + try + { + URI uri = new URI(request.getRequestURL().toString()); + if (!uri.getHost().startsWith("localhost") && !uri.getHost().startsWith("127") && !uri.getHost().startsWith("192")) + { + return true; + } + } + catch (URISyntaxException e) + { + log.error(e.getMessage(), e); + } + return false; + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/SolrUtil.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/SolrUtil.java new file mode 100644 index 0000000..860b7e2 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/SolrUtil.java @@ -0,0 +1,669 @@ +package com.zhiqim.yangcai.util; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import org.apache.solr.client.solrj.SolrQuery; +import org.apache.solr.client.solrj.impl.HttpSolrClient; +import org.apache.solr.client.solrj.response.QueryResponse; +import org.apache.solr.common.SolrDocumentList; +import org.apache.solr.common.SolrInputDocument; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.httpclient.HttpGet; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZSQL; + +import com.zhiqim.yangcai.design.dbo.template.MediaTemplateSolrModel; + +public class SolrUtil +{ + /** + * solr服务器地址 + */ + private static final String SOLR_PATH = Global.getString("solr", "path"); + + private static final Log log = LogFactory.getLog(SolrUtil.class); + + /** + * 查询我的模板 + * + * @param + * + * @param page + * @param pageSize + * @param param + * @return + */ + public static PageResult queryMyTemplate(int page, int pageSize, Map param) + { + HttpSolrClient solrServer = buildMediaCoreServer(); + SolrQuery query = new SolrQuery(); + StringBuffer q = new StringBuffer(); + String typeId = param.get("typeId"); + String industryId = param.get("industryId"); + String designer = param.get("designer"); + String fileType = param.get("fileType"); + // 未传入设计师返回null + if (Validates.isEmpty(designer)) + { + return null; + } + addTypeId(q, typeId); + addIndustryId(q, industryId); + addDesigner(q, designer); + addFileType(q, fileType); + + // 我的模板限定模板类型 + String define = "(templateType:10 and templateType:20 and templateType:100 and templateType:110)"; + + if (q.length() > 0) + { + q.append(define); + query.set("q", q.toString()); + } + else + { + query.set("q", define); + } + query.setStart((page - 1) * pageSize); + query.setRows(pageSize); + + return returnSolrData(solrServer, query, page, pageSize); + } + + /** + * 查询收藏模板 + * + * @param page + * @param pageSize + * @param param + * @return + */ + public static PageResult queryCollectTemplate(int page, int pageSize, Map param) + { + HttpSolrClient solrServer = buildMediaCoreServer(); + SolrQuery query = new SolrQuery(); + StringBuffer q = new StringBuffer(); + String typeId = param.get("typeId"); + String industryId = param.get("industryId"); + String operatorCode = param.get("operatorCode"); + // 未传入操作员code返回null + if (Validates.isEmpty(operatorCode)) + { + return null; + } + addTypeId(q, typeId); + addIndustryId(q, industryId); + + // 收藏模板限定查询模板事件表 + String define = "collector:" + operatorCode; + + if (q.length() > 0) + { + q.append(define); + query.set("q", q.toString()); + } + else + { + query.set("q", define); + } + query.setStart((page - 1) * pageSize); + query.setRows(pageSize); + + return returnSolrData(solrServer, query, page, pageSize); + } + + /** + * 更新模板数据 + * + * @param eventId + */ + public static void updateMediaData(long mediaId) + { + if (mediaId < 0) + { + return; + } + HttpSolrClient solrServer = null; + try + { + final String sql = "SELECT mt.media_id id,mt.media_id mediaId,mt.type_id typeId,mt.designer,mt.industry_id industryId,mt.industry_sub_name industrySubName,mt.attribute_name attributeName,mt.keyword_name keywordName,mt.template_type templateType,mc.ODD_EVEN oddEven,mt.template_status templateStatus,mt.file_type fileType,mt.share_dept shareDept,mt.page_value pageValue,mc.media_url mediaUrl,mc.width,mc.height,mc.width_mm widthMm,mc.height_mm heightMm,mc.bleed_size bleedSize,mc.dpi,mc.create_time createTime, ifnull(dts.FLOAT_SCORE + dts.SALE_SCORE + dts.USER_SCORE, 0 ) score FROM media_template mt LEFT JOIN MEDIA_CANVAS mc ON mt.MEDIA_ID = mc.MEDIA_ID LEFT JOIN DES_TEMPLATE_SCORE dts ON dts.MEDIA_ID = mt.MEDIA_ID WHERE mc.create_time IS NOT NULL AND mc.MEDIA_ID = "; + List modelList = ORM.get(ZSQL.class).executeQuery(sql + mediaId); + if (Validates.isNotEmpty(modelList)) + { + LinkedMapSO mapModel = modelList.get(0); + solrServer = buildMediaCoreServer(); + solrServer.add(getUpdateSolrMediaData(mapModel)); + solrServer.commit(); + } + } + catch (Exception e) + { + log.error("根据模板id[" + mediaId + "]更新solr模板数据失败", e); + } + finally + { + if (solrServer != null) + { + try + { + solrServer.close(); + } + catch (IOException e) + { + log.error("更新solr模板数据后关闭solrServer失败", e); + } + } + } + + } + + /** + * 更新作品数据 + * + * @param eventId + */ + public static void updateWorksData(long worksId) + { + if (worksId < 0) + { + return; + } + HttpSolrClient solrServer = null; + try + { + final String sql = "SELECT works_id id,works_id worksId,template_id templateId,file_type fileType,cdr_file_name cdrFileName,pdf_file_name pdfFileName,cdr_path cdrPath,pdf_path pdfPath,thumb_image_path thumbImagePath,thumb_image_phy_path thumbImagePhyPath,create_time createTime FROM des_works_file WHERE works_id = "; + List modelList = ORM.get(ZSQL.class).executeQuery(sql + worksId); + if (Validates.isNotEmpty(modelList)) + { + LinkedMapSO mapModel = modelList.get(0); + solrServer = buildWorksCoreServer(); + solrServer.add(getUpdateSolrWorksData(mapModel)); + solrServer.commit(); + } + } + catch (Exception e) + { + log.error("根据作品id[" + worksId + "]更新solr作品数据失败", e); + } + finally + { + if (solrServer != null) + { + try + { + solrServer.close(); + } + catch (IOException e) + { + log.error("更新solr作品数据后关闭solrServer失败", e); + } + } + } + + } + + private static SolrInputDocument getUpdateSolrMediaData(LinkedMapSO mapModel) + { + if (mapModel == null) + { + return null; + } + String[] field = + { + "id", "mediaId", "typeId", "industryId", "designer", "industrySubName", "attributeName", "keywordName", "templateType", "templateStatus", + "fileType", "shareDept", "pageValue", "mediaUrl", "width", "height", "widthMm", "heightMm", "bleedSize", "dpi", "createTime", "score" + }; + SolrInputDocument doc = new SolrInputDocument(); + for (int i = 0; i < field.length; i++) + { + if (mapModel.get(field[i]) != null) + { + String value = String.valueOf(mapModel.get(field[i])); + doc.addField(field[i], value); + } + } + + doc.addField("oddEven", Integer.parseInt(mapModel.get("oddEven").toString())); + return doc; + } + + private static SolrInputDocument getUpdateSolrWorksData(LinkedMapSO mapModel) + { + if (mapModel == null) + { + return null; + } + String[] field = + { + "id", "worksId", "templateId", "fileType", "cdrFileName", "pdfFileName", "cdrPath", "pdfPath", "thumbImagePath", "thumbImagePhyPath", + "createTime" + }; + SolrInputDocument doc = new SolrInputDocument(); + for (int i = 0; i < field.length; i++) + { + if (mapModel.get(field[i]) != null) + { + String value = String.valueOf(mapModel.get(field[i])); + doc.addField(field[i], value); + } + } + return doc; + } + + /** + * 查询分享模板 + * + * @param page + * @param pageSize + * @param param + * @return + */ + public static PageResult queryShareTemplate(int page, int pageSize, Map param) + { + HttpSolrClient solrServer = buildMediaCoreServer(); + SolrQuery query = new SolrQuery(); + StringBuffer q = new StringBuffer(); + String typeId = param.get("typeId"); + String industryId = param.get("industryId"); + String operatorCode = param.get("operatorCode"); + // 未传入操作员code返回null + if (Validates.isEmpty(operatorCode)) + { + return null; + } + + addTypeId(q, typeId); + addIndustryId(q, industryId); + + // 分享模板限定为自己 + String define = "shareDept:*," + operatorCode + ",*"; + + if (q.length() > 0) + { + q.append(define); + query.set("q", q.toString()); + } + else + { + query.set("q", define); + } + query.setStart((page - 1) * pageSize); + query.setRows(pageSize); + + return returnSolrData(solrServer, query, page, pageSize); + } + + /** + * 查询全部模板 + * + * @param page + * @param pageSize + * @param param + * @return + */ + public static PageResult queryAllTemplate(int page, int pageSize, Map param) + { + HttpSolrClient solrServer = buildMediaCoreServer(); + SolrQuery query = new SolrQuery(); + StringBuffer q = new StringBuffer(); + String keyword = param.get("keyword"); + String typeId = param.get("typeId"); + String fileType = param.get("fileType"); + String sort = param.get("sort"); + String industryId = param.get("industryId"); + String mediaUrl = param.get("mediaUrl"); + + addTypeId(q, typeId); + addIndustryId(q, industryId); + addFileType(q, fileType); + addKeyword(q, keyword); + addMediaUrl(q, mediaUrl); + + if (typeId.equals("3")) + { + String oddEven = param.get("oddEven"); + if (!oddEven.equals("-1")) + { + addOddEven(q, oddEven); + } + } + + addSort(query, sort); + + // 所有模板选定查询系统模板和精品模板 + String define = "(templateType:110 and templateType:100)"; + + if (q.length() > 0) + { + q.append(define); + query.set("q", q.toString()); + } + else + { + query.set("q", define); + } + query.setStart((page - 1) * pageSize); + query.setRows(pageSize); + query.setSort(new SolrQuery.SortClause("createTime", "desc")); + + return returnSolrData(solrServer, query, page, pageSize); + } + + /** + * 根据id删除模板 + * + * @param mediaId + */ + public static void deleteTemplateById(String mediaId) + { + if (Validates.isNotEmpty(mediaId)) + { + HttpSolrClient solrServer = null; + try + { + solrServer = buildMediaCoreServer(); + solrServer.deleteByQuery("mediaId:" + mediaId); + solrServer.commit(); + } + catch (Exception e) + { + log.error("根据模板id[" + mediaId + "]删除solr模板数据失败", e); + } + finally + { + if (solrServer != null) + { + try + { + solrServer.close(); + } + catch (IOException e) + { + log.error("更新solr模板分数后关闭solrServer失败", e); + } + } + } + } + } + + /** + * 根据id删除作品 + * + * @param mediaId + */ + public static void deleteWorksById(String worksId) + { + if (Validates.isNotEmpty(worksId)) + { + HttpSolrClient solrServer = null; + try + { + solrServer = buildWorksCoreServer(); + solrServer.deleteByQuery("worksId:" + worksId); + solrServer.commit(); + } + catch (Exception e) + { + log.error("根据作品id[" + worksId + "]删除solr作品数据失败", e); + } + finally + { + if (solrServer != null) + { + try + { + solrServer.close(); + } + catch (IOException e) + { + log.error("更新solr模板分数后关闭solrServer失败", e); + } + } + } + } + } + + public static void refreshSolrData() + { + try + { + HttpGet worksGet = new HttpGet( + SOLR_PATH + "works_core/dataimport?command=full-import&clean=true&commit=true&core=works_core&entity=des_works_file&name=dataimport"); + worksGet.execute(); + + HttpGet mediaGet = new HttpGet( + SOLR_PATH + "media_core/dataimport?command=full-import&clean=true&commit=true&core=media_core&entity=media_template&name=dataimport"); + mediaGet.execute(); + } + catch (Exception e) + { + log.error("刷新solr数据失败", e); + } + } + + /** + * 添加设计类型 + * + * @param q + * @param typeId + */ + private static void addTypeId(StringBuffer q, String typeId) + { + if (Validates.isNotEmpty(typeId) && !"-1".equals(typeId)) + { + q.append("typeId:"); + q.append(typeId); + q.append(" && "); + } + } + + /** + * 添加行业 + * + * @param q + * @param industryId + */ + private static void addIndustryId(StringBuffer q, String industryId) + { + if (Validates.isNotEmpty(industryId) && !"-1".equals(industryId)) + { + q.append("industryId:"); + q.append(industryId); + q.append(" && "); + } + } + + /** + * 添加设计师 + * + * @param q + * @param designer + */ + private static void addDesigner(StringBuffer q, String designer) + { + if (Validates.isNotEmpty(designer)) + { + q.append("designer:"); + q.append(designer); + q.append(" && "); + } + } + + /** + * 添加文件类型 + * + * @param q + * @param fileType + */ + private static void addFileType(StringBuffer q, String fileType) + { + if (Validates.isNotEmpty(fileType)) + { + fileType = fileType.toLowerCase(); + if (!"pdf".equals(fileType)) + { + q.append("("); + q.append("{!join fromIndex=works_core toIndex=media_core from=templateId to=mediaId}fileType:"); + q.append(fileType); + q.append(")"); + q.append(" && "); + } + } + } + + /** + * 添加关键字 + * + * @param q + * @param keyword + */ + private static void addKeyword(StringBuffer q, String keyword) + { + if (Validates.isNotEmpty(keyword)) + { + if (Validates.isNumeric(keyword)) + { + q.append("mediaId:"); + q.append(keyword); + } + else + { + q.append("("); + q.append("keywordName:"); + q.append(keyword); + q.append(" & "); + q.append("attributeName:"); + q.append(keyword); + q.append(" & "); + q.append("industrySubName:"); + q.append(keyword); + q.append(")"); + } + q.append(" && "); + } + } + + /** + * 添加图片后缀过滤 + * + * @param q + * @param keyword + */ + private static void addMediaUrl(StringBuffer q, String mediaUrl) + { + if (Validates.isNotEmpty(mediaUrl)) + { + q.append("mediaUrl:"); + q.append(mediaUrl); + q.append(" && "); + } + } + + /** + * 添加排序 + * + * @param query + * @param sort + */ + private static void addSort(SolrQuery query, String sort) + { + if (Validates.isNotEmpty(sort)) + { + switch (sort) + { + case "1":// 时间降序 + query.setSort("createTime", SolrQuery.ORDER.desc); + break; + case "2":// id升序 + query.setSort("id", SolrQuery.ORDER.asc); + break; + case "3":// 评分最高 + query.setSort("product(score,1)", SolrQuery.ORDER.desc); + break; + case "4":// 精品优先 + query.setSort("product(templateType,1)", SolrQuery.ORDER.desc); + break; + default: + break; + } + } + } + + /** + * + * [简要描述]:添加模板
            + * [详细描述]:
            + * + * @author hc + * @param q + * @param oddEven + */ + private static void addOddEven(StringBuffer q, String oddEven) + { + if (Validates.isNotEmpty(oddEven)) + { + q.append("oddEven:"); + q.append(oddEven); + q.append(" && "); + } + } + + /** + * 根据solrServer和查询条件返回查询数据 + * + * @param solrServer + * @param query + * @param page + * @param pageSize + * @return + */ + private static PageResult returnSolrData(HttpSolrClient solrServer, SolrQuery query, int page, int pageSize) + { + try + { + QueryResponse response = solrServer.query(query); + SolrDocumentList solrDocumentList = response.getResults(); + int total = (int) solrDocumentList.getNumFound(); + List list = response.getBeans(MediaTemplateSolrModel.class); + PageResult pageResult = PageBuilder.newResult(total, page, pageSize, list); + return pageResult; + } + catch (Exception e) + { + return null; + } + finally + { + if (solrServer != null) + { + try + { + solrServer.close(); + } + catch (IOException e) + { + log.error("查询后关闭solrServer失败", e); + } + } + } + } + + private static HttpSolrClient buildMediaCoreServer() + { + return new HttpSolrClient.Builder(SOLR_PATH + "media_core/").build(); + } + + private static HttpSolrClient buildWorksCoreServer() + { + return new HttpSolrClient.Builder(SOLR_PATH + "works_core/").build(); + } + +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/Test.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/Test.java new file mode 100644 index 0000000..7e6f676 --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/Test.java @@ -0,0 +1,137 @@ +package com.zhiqim.yangcai.util; + +import java.net.URLEncoder; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import org.apache.batik.apps.svgbrowser.PNGOptionPanel; +import org.zhiqim.kernel.httpclient.HttpPost; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.codes.MD5; +import org.zhiqim.orm.ORM; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.aspose.imaging.Color; +import com.aspose.imaging.Image; +import com.aspose.imaging.SmoothingMode; +import com.aspose.imaging.TextRenderingHint; +import com.aspose.imaging.fileformats.png.PngColorType; +import com.aspose.imaging.imageoptions.PngOptions; +import com.aspose.imaging.imageoptions.VectorRasterizationOptions; +import com.zhiqim.yangcai.design.dao.OssFileDao; +import com.zhiqim.yangcai.design.server.ErpClassService; +import com.zhiqim.yangcai.design.server.ErpClassService.statusEnum; + +public class Test { + public static void main(String[] args) throws Exception { + +// String timestamp = DateTimes.getDateTimeString(); +// Map paramMap = new HashMap<>(); +// +// paramMap.put("appKey", "1823193185001");// 店铺key,在运维平台查看 +// paramMap.put("merchantId", "1823193185001");// 店铺密钥,在运维平台查看 +// +// paramMap.put("timestamp", timestamp); +// paramMap.put("method", "design.order.update.info");// public final static String DESIGN_ORDER_CREATE = +// // "design.order.create"; +// String a = buildQueryString(paramMap, timestamp, "design.order.update.info"); +// +// HttpPost conn = new HttpPost("http://127.0.0.1:8999/designRest.htm"); +// +// conn.setQueryString(a, "UTF-8"); +// +// conn.execute(); +// +// int responseStatus = conn.getResponseStatus(); +// String responseText = conn.getResponseText(); +// JSONObject responseObj = JSON.parseObject(conn.getResponseText()); +// JSONObject error = responseObj.getJSONObject("error"); +// if (responseStatus != 200 || error != null) { +// throw new Exception(responseText); +// } else { +// // 成功后更新订单状态 +// +// } + +// System.out.println(a); + +// new ErpClassService("N_20220822101741", "测试用户", statusEnum.TO_BE_DESIGNED.getCode(), "测试"); +// String cdrName = "C:\\Users\\231010\\Downloads\\(3664661329391847611)-85x54mm-4款各500张-83x54mm-500张-85x56.6mm-500张-85x59mm-500张-73.5x59mm-500张-82x59mm-500张-卡片300克铜板纸单面印刷覆哑膜异形模切-ZS-吖垚的宝宝-河南省-小杭 最终定稿转曲 改改.png"; +// try { +// System.out.println(CdrToPngUtil.convert(cdrName)); +// } catch (Exception e) { +// System.out.println(e); +// } + + } + + private static String buildQueryString(Map paramMap, String timestamp, String method) { + StringBuffer strb = new StringBuffer("sign="); + String merId = String.valueOf(paramMap.get("merchantId")); + String merSecret = "D8FF9498A5A2E6A6B4CB6EF88DB1DC35"; + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(merSecret).append(method).append(timestamp).append(merId).append(merSecret); + strb.append(MD5.encodeUTF8(stringBuffer.toString())); + for (Map.Entry entry : paramMap.entrySet()) { + String value = null; + if (entry.getValue() == null) { + value = ""; + } else { + value = Urls.encodeUTF8(String.valueOf(entry.getValue())); + } + strb.append("&").append(entry.getKey()).append("=").append(value); + } + + return strb.toString(); + } + + private static String generateSignParam(String appid, long timestamp, long timestamp1, int uid, String userName, + String appSecret, String mobile, String head_img) throws Exception { + String sign = appSecret + "app_id" + appid + "timestamp" + timestamp + "uid" + uid + "username" + userName + + appSecret; + System.out.println("generateSignParam :" + sign); + return sha1(sign); + // "expire_atexpire_at_mhead_imgmobile" + + // + + // "expire_at"+timestamp1+"expire_at_m"+timestamp1+"head_img"+head_img+"mobile" + // +mobile + } + + public static String str2Unicode(String s) { + String str = ""; + if ((s == null) || (s.trim().equals(""))) + return str; + for (int i = 0; i < s.length(); i++) { + byte[] bytes = String.valueOf(s.charAt(i)).getBytes(); + String s4; + if (bytes.length == 1) { + s4 = String.valueOf(s.charAt(i)); + } else { + int ch = s.charAt(i); + s4 = "\\u" + Integer.toHexString(ch); + } + str = str + s4; + } + return str; + } + + private static String sha1(String input) throws NoSuchAlgorithmException { + MessageDigest mDigest = MessageDigest.getInstance("SHA1"); + byte[] result = mDigest.digest(input.getBytes()); + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < result.length; i++) { + sb.append(Integer.toString((result[i] & 0xff) + 0x100, 16).substring(1)); + } + + return sb.toString().toUpperCase(); + + } +} diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/http/HttpClientResult.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/http/HttpClientResult.java new file mode 100644 index 0000000..976f0df --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/http/HttpClientResult.java @@ -0,0 +1,48 @@ +package com.zhiqim.yangcai.util.http; + +import java.io.Serializable; + +public class HttpClientResult implements Serializable { + /** + * 响应状态码 + */ + private int code; + + /** + * 响应数据 + */ + private String data; + + public HttpClientResult() { + } + + public HttpClientResult(int code) { + this.code = code; + } + + public HttpClientResult(int code, String data) { + this.code = code; + this.data = data; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + + @Override + public String toString() { + return "HttpClientResult [code=" + code + ", data=" + data + "]"; + } +} \ No newline at end of file diff --git a/Yangcai365_web/src/service/com/zhiqim/yangcai/util/http/HttpClientUtils.java b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/http/HttpClientUtils.java new file mode 100644 index 0000000..8d9211e --- /dev/null +++ b/Yangcai365_web/src/service/com/zhiqim/yangcai/util/http/HttpClientUtils.java @@ -0,0 +1,437 @@ +package com.zhiqim.yangcai.util.http; +import org.apache.http.HttpStatus; +import org.apache.http.NameValuePair; +import org.apache.http.client.ResponseHandler; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.*; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.BasicResponseHandler; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.*; + +public class HttpClientUtils { + + // 编码格式。发送编码格式统一用UTF-8 + private static final String ENCODING = "GBK"; + + // 设置连接超时时间,单位毫秒。 + private static final int CONNECT_TIMEOUT = 6000; + + // 请求获取数据的超时时间(即响应时间),单位毫秒。 + private static final int SOCKET_TIMEOUT = 6000; + + /** + * 发送get请求;不带请求头和请求参数 + * + * @param url 请求地址 + * @return + * @throws Exception + */ + public static HttpClientResult doGet(String url) throws Exception { + return doGet(url, null, null); + } + + /** + * 发送get请求;带请求参数 + * + * @param url 请求地址 + * @param params 请求参数集合 + * @return + * @throws Exception + */ + public static HttpClientResult doGet(String url, Map params) throws Exception { + return doGet(url, null, params); + } + + /** + * 发送get请求;带请求头和请求参数 + * + * @param url 请求地址 + * @param headers 请求头集合 + * @param params 请求参数集合 + * @return + * @throws Exception + */ + public static HttpClientResult doGet(String url, Map headers, Map params) throws Exception { + // 创建httpClient对象 + CloseableHttpClient httpClient = HttpClients.createDefault(); + + // 创建访问的地址 + URIBuilder uriBuilder = new URIBuilder(url); + if (params != null) { + Set> entrySet = params.entrySet(); + for (Map.Entry entry : entrySet) { + uriBuilder.setParameter(entry.getKey(), entry.getValue()); + } + } + + // 创建http对象 + HttpGet httpGet = new HttpGet(uriBuilder.build()); + /** + * setConnectTimeout:设置连接超时时间,单位毫秒。 + * setConnectionRequestTimeout:设置从connect Manager(连接池)获取Connection + * 超时时间,单位毫秒。这个属性是新加的属性,因为目前版本是可以共享连接池的。 + * setSocketTimeout:请求获取数据的超时时间(即响应时间),单位毫秒。 如果访问一个接口,多少时间内无法返回数据,就直接放弃此次调用。 + */ + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(CONNECT_TIMEOUT).setSocketTimeout(SOCKET_TIMEOUT).build(); + httpGet.setConfig(requestConfig); + + // 设置请求头 + packageHeader(headers, httpGet); + + // 创建httpResponse对象 + CloseableHttpResponse httpResponse = null; + + try { + // 执行请求并获得响应结果 + return getHttpClientResult(httpResponse, httpClient, httpGet); + } finally { + // 释放资源 + release(httpResponse, httpClient); + } + } + + /** + * 发送post请求;不带请求头和请求参数 + * + * @param url 请求地址 + * @return + * @throws Exception + */ + public static HttpClientResult doPost(String url) throws Exception { + return doPost(url, null, null); + } + + /** + * 发送post请求;带请求参数 + * + * @param url 请求地址 + * @param params 参数集合 + * @return + * @throws Exception + */ + public static HttpClientResult doPost(String url, Map params) throws Exception { + return doPost(url, null, params); + } + + /** + * 发送post请求;带请求头和请求参数 + * + * @param url 请求地址 + * @param headers 请求头集合 + * @param params 请求参数集合 + * @return + * @throws Exception + */ + public static HttpClientResult doPost(String url, Map headers, Map params) throws Exception { + // 创建httpClient对象 + CloseableHttpClient httpClient = HttpClients.createDefault(); + + // 创建http对象 + HttpPost httpPost = new HttpPost(url); + /** + * setConnectTimeout:设置连接超时时间,单位毫秒。 + * setConnectionRequestTimeout:设置从connect Manager(连接池)获取Connection + * 超时时间,单位毫秒。这个属性是新加的属性,因为目前版本是可以共享连接池的。 + * setSocketTimeout:请求获取数据的超时时间(即响应时间),单位毫秒。 如果访问一个接口,多少时间内无法返回数据,就直接放弃此次调用。 + */ + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(CONNECT_TIMEOUT).setSocketTimeout(SOCKET_TIMEOUT).build(); + httpPost.setConfig(requestConfig); + // 设置请求头 + /*httpPost.setHeader("Cookie", ""); + httpPost.setHeader("Connection", "keep-alive"); + httpPost.setHeader("Accept", "application/json"); + httpPost.setHeader("Accept-Language", "zh-CN,zh;q=0.9"); + httpPost.setHeader("Accept-Encoding", "gzip, deflate, br"); + httpPost.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36");*/ + packageHeader(headers, httpPost); + + // 封装请求参数 + packageParam(params, httpPost); + // 创建httpResponse对象 + CloseableHttpResponse httpResponse = null; + + try { + // 执行请求并获得响应结果 + return getHttpClientResult(httpResponse, httpClient, httpPost); + } finally { + // 释放资源 + release(httpResponse, httpClient); + } + } + + /** + * 发送post请求;带请求头和请求参数 + * + * @param url 请求地址 + * @param headers 请求头集合 + * @param params 请求参数集合 + * @return + * @throws Exception + */ + public static HttpClientResult doPostObject(String url, Map headers, Map params) throws Exception { + // 创建httpClient对象 + CloseableHttpClient httpClient = HttpClients.createDefault(); + + // 创建http对象 + HttpPost httpPost = new HttpPost(url); + /** + * setConnectTimeout:设置连接超时时间,单位毫秒。 + * setConnectionRequestTimeout:设置从connect Manager(连接池)获取Connection + * 超时时间,单位毫秒。这个属性是新加的属性,因为目前版本是可以共享连接池的。 + * setSocketTimeout:请求获取数据的超时时间(即响应时间),单位毫秒。 如果访问一个接口,多少时间内无法返回数据,就直接放弃此次调用。 + */ + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(CONNECT_TIMEOUT).setSocketTimeout(SOCKET_TIMEOUT).build(); + httpPost.setConfig(requestConfig); + // 设置请求头 + /*httpPost.setHeader("Cookie", ""); + httpPost.setHeader("Connection", "keep-alive"); + httpPost.setHeader("Accept", "application/json"); + httpPost.setHeader("Accept-Language", "zh-CN,zh;q=0.9"); + httpPost.setHeader("Accept-Encoding", "gzip, deflate, br"); + httpPost.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36");*/ + //packageHeader(headers, httpPost); + httpPost.setHeader("", ""); + // 封装请求参数 + //packageParam(params, httpPost); + // 创建httpResponse对象 + CloseableHttpResponse httpResponse = null; + + try { + // 执行请求并获得响应结果 + return getHttpClientResult(httpResponse, httpClient, httpPost); + } finally { + // 释放资源 + release(httpResponse, httpClient); + } + } + + public static String doPostWithJson(String url,String json) { + return doPostWithJson(url,null,json); + } + + public static String doPostWithJson(String url,Map headers,String json) { + String returnValue = ""; + CloseableHttpClient httpClient = HttpClients.createDefault(); + ResponseHandler responseHandler = new BasicResponseHandler(); + try{ + httpClient = HttpClients.createDefault(); + HttpPost httpPost = new HttpPost(url); + StringEntity requestEntity = new StringEntity(json,"utf-8"); + requestEntity.setContentEncoding("UTF-8"); + httpPost.setHeader("Content-type", "application/json"); + packageHeader(headers,httpPost); + httpPost.setEntity(requestEntity); + + //第四步:发送HttpPost请求,获取返回值 + returnValue = httpClient.execute(httpPost,responseHandler); //调接口获取返回值时,必须用此方法 + + } + catch(Exception e) + { + e.printStackTrace(); + } + + finally { + try { + httpClient.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + //第五步:处理返回值 + return returnValue; + } + + public static String doPostWithXml(String url,String xml) { + CloseableHttpClient client = null; + CloseableHttpResponse resp = null; + try { + HttpPost httpPost = new HttpPost(url); + httpPost.setHeader("Content-Type", "text/xml; charset=UTF-8"); + client = HttpClients.createDefault(); + StringEntity entityParams = new StringEntity(xml, "utf-8"); + httpPost.setEntity(entityParams); + client = HttpClients.createDefault(); + resp = client.execute(httpPost); + String resultMsg = EntityUtils.toString(resp.getEntity(), "utf-8"); + return resultMsg; + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (client != null) { + client.close(); + } + if (resp != null) { + resp.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + return null; + } + + /** + * 发送put请求;不带请求参数 + * + * @param url 请求地址 + * @return + * @throws Exception + */ + public static HttpClientResult doPut(String url) throws Exception { + return doPut(url); + } + + /** + * 发送put请求;带请求参数 + * + * @param url 请求地址 + * @param params 参数集合 + * @return + * @throws Exception + */ + public static HttpClientResult doPut(String url, Map params) throws Exception { + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpPut httpPut = new HttpPut(url); + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(CONNECT_TIMEOUT).setSocketTimeout(SOCKET_TIMEOUT).build(); + httpPut.setConfig(requestConfig); + + packageParam(params, httpPut); + CloseableHttpResponse httpResponse = null; + + try { + return getHttpClientResult(httpResponse, httpClient, httpPut); + } finally { + release(httpResponse, httpClient); + } + } + + /** + * 发送delete请求;不带请求参数 + * + * @param url 请求地址 + * @return + * @throws Exception + */ + public static HttpClientResult doDelete(String url) throws Exception { + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpDelete httpDelete = new HttpDelete(url); + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(CONNECT_TIMEOUT).setSocketTimeout(SOCKET_TIMEOUT).build(); + httpDelete.setConfig(requestConfig); + + CloseableHttpResponse httpResponse = null; + try { + return getHttpClientResult(httpResponse, httpClient, httpDelete); + } finally { + release(httpResponse, httpClient); + } + } + + /** + * 发送delete请求;带请求参数 + * + * @param url 请求地址 + * @param params 参数集合 + * @return + * @throws Exception + */ + public static HttpClientResult doDelete(String url, Map params) throws Exception { + if (params == null) { + params = new HashMap(); + } + + params.put("_method", "delete"); + return doPost(url, params); + } + + /** + * Description: 封装请求头 + * @param params + * @param httpMethod + */ + public static void packageHeader(Map params, HttpRequestBase httpMethod) { + // 封装请求头 + if (params != null) { + Set> entrySet = params.entrySet(); + for (Map.Entry entry : entrySet) { + // 设置到请求头到HttpRequestBase对象中 + httpMethod.setHeader(entry.getKey(), entry.getValue()); + } + } + } + + /** + * Description: 封装请求参数 + * + * @param params + * @param httpMethod + * @throws UnsupportedEncodingException + */ + public static void packageParam(Map params, HttpEntityEnclosingRequestBase httpMethod) + throws UnsupportedEncodingException { + // 封装请求参数 + if (params != null) { + List nvps = new ArrayList(); + Set> entrySet = params.entrySet(); + for (Map.Entry entry : entrySet) { + nvps.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); + } + + // 设置到请求的http对象中 + httpMethod.setEntity(new UrlEncodedFormEntity(nvps, ENCODING)); + } + } + + /** + * Description: 获得响应结果 + * + * @param httpResponse + * @param httpClient + * @param httpMethod + * @return + * @throws Exception + */ + public static HttpClientResult getHttpClientResult(CloseableHttpResponse httpResponse, + CloseableHttpClient httpClient, HttpRequestBase httpMethod) throws Exception { + // 执行请求 + httpResponse = httpClient.execute(httpMethod); + + // 获取返回结果 + if (httpResponse != null && httpResponse.getStatusLine() != null) { + String content = ""; + if (httpResponse.getEntity() != null) { + content = EntityUtils.toString(httpResponse.getEntity(), ENCODING); + } + return new HttpClientResult(httpResponse.getStatusLine().getStatusCode(), content); + } + return new HttpClientResult(HttpStatus.SC_INTERNAL_SERVER_ERROR); + } + + /** + * Description: 释放资源 + * + * @param httpResponse + * @param httpClient + * @throws IOException + */ + public static void release(CloseableHttpResponse httpResponse, CloseableHttpClient httpClient) throws IOException { + // 释放资源 + if (httpResponse != null) { + httpResponse.close(); + } + if (httpClient != null) { + httpClient.close(); + } + } +} \ No newline at end of file diff --git a/Yangcai365_web/temp/20230818/TbzFile/2308171639040005.zip b/Yangcai365_web/temp/20230818/TbzFile/2308171639040005.zip new file mode 100644 index 0000000..058aec6 Binary files /dev/null and b/Yangcai365_web/temp/20230818/TbzFile/2308171639040005.zip differ diff --git a/Yangcai365_web/temp/20230818/TbzFile/2308171639100007.pdf b/Yangcai365_web/temp/20230818/TbzFile/2308171639100007.pdf new file mode 100644 index 0000000..942c70d Binary files /dev/null and b/Yangcai365_web/temp/20230818/TbzFile/2308171639100007.pdf differ diff --git a/Yangcai365_web/temp/20230818/TbzFile/2308171639100008.zip b/Yangcai365_web/temp/20230818/TbzFile/2308171639100008.zip new file mode 100644 index 0000000..85be23a Binary files /dev/null and b/Yangcai365_web/temp/20230818/TbzFile/2308171639100008.zip differ diff --git a/Yangcai365_web/temp/20230818/zip/2308181347300001.zip b/Yangcai365_web/temp/20230818/zip/2308181347300001.zip new file mode 100644 index 0000000..606aa49 Binary files /dev/null and b/Yangcai365_web/temp/20230818/zip/2308181347300001.zip differ diff --git a/sql/after_pic.sql b/sql/after_pic.sql new file mode 100644 index 0000000..573e0dd --- /dev/null +++ b/sql/after_pic.sql @@ -0,0 +1,2578 @@ +/* + Navicat Premium Data Transfer + + Source Server : localhost + Source Server Type : MySQL + Source Server Version : 50738 + Source Host : localhost:3306 + Source Schema : yangcai_design + + Target Server Type : MySQL + Target Server Version : 50738 + File Encoding : 65001 + + Date: 29/11/2023 08:38:16 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for after_pic_type +-- ---------------------------- +DROP TABLE IF EXISTS `after_pic_type`; +CREATE TABLE `after_pic_type` ( + `PIC_TYPE` bigint(20) NOT NULL, + `PIC_TYPE_NAME` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PIC_STATUS` int(11) NOT NULL, + PRIMARY KEY (`PIC_TYPE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for after_problem_type +-- ---------------------------- +DROP TABLE IF EXISTS `after_problem_type`; +CREATE TABLE `after_problem_type` ( + `PIC_TYPE` bigint(20) NOT NULL, + `PROBLEM_TYPE` bigint(20) NOT NULL, + `PROBLEM_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PROBLEM_STATUS` int(11) NOT NULL, + PRIMARY KEY (`PROBLEM_TYPE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for api_invoke_log +-- ---------------------------- +DROP TABLE IF EXISTS `api_invoke_log`; +CREATE TABLE `api_invoke_log` ( + `INVOKE_LOG_ID` bigint(20) NOT NULL, + `REMOTE_IP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `STATUS_CODE` int(11) NOT NULL, + `REMOTE_USER` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ERROR_ID` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `API_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `INVOKE_MESSAGE` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `INVOKE_STACK_TRACE` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`INVOKE_LOG_ID`) USING BTREE, + INDEX `IX_INVOCK_IP`(`REMOTE_IP`) USING BTREE, + INDEX `IX_REMOTE_USER`(`REMOTE_USER`) USING BTREE, + INDEX `IX_API_NAME`(`API_NAME`) USING BTREE, + INDEX `IX_USER_STATUS_TIME`(`REMOTE_USER`, `STATUS_CODE`, `CREATE_TIME`) USING BTREE, + INDEX `IX_STATUS_CODE`(`STATUS_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for buyer_user +-- ---------------------------- +DROP TABLE IF EXISTS `buyer_user`; +CREATE TABLE `buyer_user` ( + `BUYER_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ORDER_COUNT` int(11) NOT NULL, + PRIMARY KEY (`BUYER_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for check_back_reason +-- ---------------------------- +DROP TABLE IF EXISTS `check_back_reason`; +CREATE TABLE `check_back_reason` ( + `REASON_ID` bigint(20) NOT NULL COMMENT '原因编号', + `IS_REASON_TYPE` tinyint(1) NOT NULL COMMENT '1 原因分类 0具体原因项', + `REASON_PARENT` bigint(20) NOT NULL COMMENT '具体原因项 所属分类', + `REASON_TEXT` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '原因内容', + PRIMARY KEY (`REASON_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '印前原因预录' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for complete_order_stat +-- ---------------------------- +DROP TABLE IF EXISTS `complete_order_stat`; +CREATE TABLE `complete_order_stat` ( + `DESIGNER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `COMPLETE_DATE` varchar(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ORDER_PASS_ID` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ORDER_BACK_ID` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ORDER_PASS_SUM` int(11) NOT NULL, + `ORDER_BACK_SUM` int(11) NOT NULL, + `PASS_CONVERT_SUM` double(15, 1) NULL DEFAULT NULL, + `BACK_CONVERT_SUM` double(15, 1) NULL DEFAULT NULL, + PRIMARY KEY (`DESIGNER`, `COMPLETE_DATE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定稿统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for config_questions +-- ---------------------------- +DROP TABLE IF EXISTS `config_questions`; +CREATE TABLE `config_questions` ( + `QUESTIONS_ID` bigint(20) NOT NULL, + `DESIGN_REQUIREMENTS` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设计要求', + `MODIFICATION_TIME` datetime(0) NOT NULL COMMENT '最后修改时间', + `UPDATE_OPERATOR` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作员', + PRIMARY KEY (`QUESTIONS_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统考试题库' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_dispatch_order_log +-- ---------------------------- +DROP TABLE IF EXISTS `des_dispatch_order_log`; +CREATE TABLE `des_dispatch_order_log` ( + `DESIGN_ID` bigint(20) NOT NULL, + `DES_TIME` datetime(0) NOT NULL, + `DIS_TYPE` tinyint(4) NOT NULL, + `DIS_ORDER_STATUS` tinyint(4) NOT NULL, + `OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ORG_ID` bigint(20) NOT NULL, + `INDUSTRY_ID` bigint(20) NOT NULL, + `MONTH_CODE` varchar(6) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DAY_CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ORDER_TEXT` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DIS_DESC` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DRAFT_TYPE` int(11) NOT NULL DEFAULT 2 COMMENT '稿件类型', + PRIMARY KEY (`DESIGN_ID`, `DES_TIME`) USING BTREE, + INDEX `idx_OPERATOR_CODE_status`(`DIS_ORDER_STATUS`, `OPERATOR_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_dispatch_property +-- ---------------------------- +DROP TABLE IF EXISTS `des_dispatch_property`; +CREATE TABLE `des_dispatch_property` ( + `OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ORG_ID` bigint(20) NOT NULL, + `MAJOR_TYPE` bigint(20) NOT NULL, + `SECONDARY_TYPES` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `MAJOR_INDUSTRY` bigint(20) NOT NULL, + `SECONDARY_INDUSTRYS` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `MAX_ORDER` int(11) NULL DEFAULT NULL, + `DESIGNER_LEVEL` int(11) NOT NULL, + `CONTACT` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ACCEPT_SUPPORT_ORDER` tinyint(4) NULL DEFAULT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL, + `SHOP_NICK` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `TYPESETTER` tinyint(4) NULL DEFAULT NULL COMMENT '是否为排版设计师 0为是', + `TYPESET_AUDITOR` tinyint(4) NULL DEFAULT NULL COMMENT '是否为排版审核人 0为是', + `FIRST_TYPESET_AUDITOR` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '第一排版审核人', + `IS_DESIGN_ORDER` tinyint(1) NULL DEFAULT 1 COMMENT '是否支持设计订单', + `IS_NORM_DRAFT_ORDER` tinyint(1) NULL DEFAULT 0 COMMENT '是否接取标准自来稿', + `IS_DRAFT_ORDER` tinyint(1) NULL DEFAULT 0 COMMENT '是否支持改稿自来稿', + `IS_HIGH_QUALITY_ORDER` tinyint(1) NULL DEFAULT NULL COMMENT '是否优质订单', + `IS_URGENT` tinyint(1) NOT NULL, + PRIMARY KEY (`OPERATOR_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师接单规则表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_keyword +-- ---------------------------- +DROP TABLE IF EXISTS `des_keyword`; +CREATE TABLE `des_keyword` ( + `CAT_ID` bigint(20) NULL DEFAULT NULL, + `KEYWORD_ID` bigint(20) NOT NULL, + `KEYWORD_NAME` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `KEYWORD_TYPE` int(11) NOT NULL, + `OPERATOR_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`KEYWORD_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_keyword_cat +-- ---------------------------- +DROP TABLE IF EXISTS `des_keyword_cat`; +CREATE TABLE `des_keyword_cat` ( + `CAT_ID` bigint(20) NOT NULL, + `CAT_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`CAT_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_keyword_core +-- ---------------------------- +DROP TABLE IF EXISTS `des_keyword_core`; +CREATE TABLE `des_keyword_core` ( + `KEYWORD_NAME` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `KEYWORD_HOT` int(11) NOT NULL, + `KEYWORD_NUM` int(11) NOT NULL, + `KEYWORD_SCORE` int(11) NOT NULL, + INDEX `idx_KEYWORD_NAME`(`KEYWORD_NAME`(255)) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_keyword_core_log +-- ---------------------------- +DROP TABLE IF EXISTS `des_keyword_core_log`; +CREATE TABLE `des_keyword_core_log` ( + `LOG_ID` bigint(20) NOT NULL, + `DAY_CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `MONTH_CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `KEYWORD_NAME` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `KEYWORD_HOT` int(11) NULL DEFAULT NULL, + `KEYWORD_NUM` int(11) NULL DEFAULT NULL, + PRIMARY KEY (`LOG_ID`) USING BTREE, + INDEX `IDX_MONTH_CODE`(`MONTH_CODE`) USING BTREE, + INDEX `IDX_DAY_CODE`(`DAY_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_keyword_core_stat +-- ---------------------------- +DROP TABLE IF EXISTS `des_keyword_core_stat`; +CREATE TABLE `des_keyword_core_stat` ( + `DAY_CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `KEYWORD_NAME` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `MONTH_CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `KEYWORD_HOT` int(11) NOT NULL, + `KEYWORD_NUM` int(11) NOT NULL, + `KEYWORD_NUM_RANK` int(11) NOT NULL, + `KEYWORD_HOT_RANK` int(11) NOT NULL, + INDEX `idx_MONTH_CODE`(`MONTH_CODE`) USING BTREE, + INDEX `idx_KEYWORD_NAME`(`KEYWORD_NAME`(255)) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_keyword_index +-- ---------------------------- +DROP TABLE IF EXISTS `des_keyword_index`; +CREATE TABLE `des_keyword_index` ( + `MEDIA_ID` bigint(20) NOT NULL, + `LABEL_KEYWORD` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `CUSTOM_LABEL_KEYWORD` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `LONG_TAIL_KEYWORD` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `MEDIA_SCORE` int(11) NULL DEFAULT 0, + PRIMARY KEY (`MEDIA_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_keyword_industry +-- ---------------------------- +DROP TABLE IF EXISTS `des_keyword_industry`; +CREATE TABLE `des_keyword_industry` ( + `INDUSTRY_ID` bigint(20) NOT NULL, + `INDUSTRY_SUB_ID` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `INDUSTRY_KEYWORD` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_keyword_log +-- ---------------------------- +DROP TABLE IF EXISTS `des_keyword_log`; +CREATE TABLE `des_keyword_log` ( + `LOG_ID` bigint(20) NOT NULL, + `KEYWORD_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + `SEARCH_COUNT` int(11) NULL DEFAULT 0, + PRIMARY KEY (`LOG_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_label_attribute +-- ---------------------------- +DROP TABLE IF EXISTS `des_label_attribute`; +CREATE TABLE `des_label_attribute` ( + `ATTRIBUTE_ID` bigint(20) NOT NULL, + `ATTRIBUTE_CAT_ID` bigint(20) NOT NULL, + `INDUSTRY_ID` bigint(20) NOT NULL, + `ATTRIBUTE_NAME` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`ATTRIBUTE_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_label_attribute_cat +-- ---------------------------- +DROP TABLE IF EXISTS `des_label_attribute_cat`; +CREATE TABLE `des_label_attribute_cat` ( + `ATTRIBUTE_CAT_ID` bigint(20) NOT NULL, + `INDUSTRY_ID` bigint(20) NOT NULL, + `ATTRIBUTE_CAT_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`ATTRIBUTE_CAT_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_label_industry +-- ---------------------------- +DROP TABLE IF EXISTS `des_label_industry`; +CREATE TABLE `des_label_industry` ( + `INDUSTRY_ID` bigint(20) NOT NULL, + `INDUSTRY_SUB_ID` bigint(20) NOT NULL, + `INDUSTRY_SUB_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`INDUSTRY_SUB_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_material_cat +-- ---------------------------- +DROP TABLE IF EXISTS `des_material_cat`; +CREATE TABLE `des_material_cat` ( + `CAT_ID` bigint(20) NOT NULL, + `CAT_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CAT_STATUS` tinyint(4) NOT NULL, + `CAT_SEQ` int(11) NOT NULL, + PRIMARY KEY (`CAT_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_mer_dispatch_log +-- ---------------------------- +DROP TABLE IF EXISTS `des_mer_dispatch_log`; +CREATE TABLE `des_mer_dispatch_log` ( + `ORG_ID` bigint(20) NOT NULL, + `DESIGN_ID` bigint(20) NOT NULL, + `DES_TIME` datetime(0) NOT NULL, + `DIS_DESC` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ANALYSIS_TEXT` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '分拣分析结果内容', + PRIMARY KEY (`DESIGN_ID`, `DES_TIME`) USING BTREE, + INDEX `IX_DESIGN_ID`(`DESIGN_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_online +-- ---------------------------- +DROP TABLE IF EXISTS `des_online`; +CREATE TABLE `des_online` ( + `ORG_ID` bigint(20) NOT NULL, + `OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ONLINE_STATUS` int(11) NOT NULL, + `ORDER_NUM` int(11) NOT NULL, + `SESSION_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `SESSION_TIME` datetime(0) NULL DEFAULT NULL, + `LAST_DRAFT_TYPE` bigint(20) NOT NULL, + `LAST_DRAFT_TIME` datetime(0) NULL DEFAULT NULL, + `DESIGNER_LEVEL` int(11) NULL DEFAULT NULL, + `LAST_UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '接单状态更新时间', + PRIMARY KEY (`OPERATOR_CODE`) USING BTREE, + INDEX `IDX_ONLINE_STATUS`(`ONLINE_STATUS`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师接单状态表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_online_time +-- ---------------------------- +DROP TABLE IF EXISTS `des_online_time`; +CREATE TABLE `des_online_time` ( + `DAY_CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ORG_ID` bigint(20) NOT NULL, + `OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ONLINE_TIME` int(11) NOT NULL, + PRIMARY KEY (`DAY_CODE`, `OPERATOR_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_score_param +-- ---------------------------- +DROP TABLE IF EXISTS `des_score_param`; +CREATE TABLE `des_score_param` ( + `SCORE_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SCORE_TYPE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_ID` bigint(20) NOT NULL, + `PARAM_TYPE` int(11) NULL DEFAULT NULL, + `PARAM_KEY` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_VALUE` int(11) NOT NULL, + PRIMARY KEY (`PARAM_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_score_weight +-- ---------------------------- +DROP TABLE IF EXISTS `des_score_weight`; +CREATE TABLE `des_score_weight` ( + `SCORE_ID` bigint(20) NOT NULL, + `SCORE_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `DAY_CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SCORE_TYPE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SCORE_WEIGHT` int(11) NOT NULL, + `SCORE_VALUE` int(11) NULL DEFAULT NULL, + PRIMARY KEY (`SCORE_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_template_event +-- ---------------------------- +DROP TABLE IF EXISTS `des_template_event`; +CREATE TABLE `des_template_event` ( + `EVENT_ID` bigint(20) NOT NULL, + `MEDIA_ID` bigint(20) NOT NULL, + `EVENT_TYPE` int(11) NOT NULL, + `OPERATOR_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`EVENT_ID`) USING BTREE, + INDEX `idx_MEDIA_ID`(`MEDIA_ID`) USING BTREE, + INDEX `idx_OPERATOR_CODE`(`OPERATOR_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_template_log +-- ---------------------------- +DROP TABLE IF EXISTS `des_template_log`; +CREATE TABLE `des_template_log` ( + `LOG_ID` bigint(20) NOT NULL, + `MEDIA_ID` bigint(20) NOT NULL, + `OPERATOR_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `LOG_DESC` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`LOG_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_template_order +-- ---------------------------- +DROP TABLE IF EXISTS `des_template_order`; +CREATE TABLE `des_template_order` ( + `DESIGN_ID` bigint(20) NOT NULL, + `MEDIA_ID` bigint(20) NULL DEFAULT NULL, + `OLD_PARAM_TEXT` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OCR_TEXT` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `PARAM_TEXT` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `QR_CODE_PATH` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `FILE_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DESIGN_MEDIA_ID` bigint(20) NULL DEFAULT NULL, + `TYPE_ID` bigint(20) NULL DEFAULT NULL, + `INDUSTRY_ID` bigint(20) NULL DEFAULT NULL, + `OPERATOR_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`DESIGN_ID`) USING BTREE, + INDEX `idx_MEDIA_ID`(`MEDIA_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单模板参数表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_template_score +-- ---------------------------- +DROP TABLE IF EXISTS `des_template_score`; +CREATE TABLE `des_template_score` ( + `MEDIA_ID` bigint(20) NOT NULL, + `BASE_SCORE` int(11) NOT NULL, + `FLOAT_SCORE` int(11) NOT NULL, + `SALE_SCORE` int(11) NOT NULL, + `USER_SCORE` int(11) NOT NULL, + PRIMARY KEY (`MEDIA_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_template_score_log +-- ---------------------------- +DROP TABLE IF EXISTS `des_template_score_log`; +CREATE TABLE `des_template_score_log` ( + `LOG_ID` bigint(20) NOT NULL, + `MEDIA_ID` bigint(20) NOT NULL, + `SCORE_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `SCORE_TYPE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_TYPE` int(11) NOT NULL, + `PARAM_KEY` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_VALUE` int(11) NOT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`LOG_ID`) USING BTREE, + INDEX `IDX_CREATE_TIME`(`CREATE_TIME`) USING BTREE, + INDEX `IDX_MEDIA_ID`(`MEDIA_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_work_search_log +-- ---------------------------- +DROP TABLE IF EXISTS `des_work_search_log`; +CREATE TABLE `des_work_search_log` ( + `LOG_ID` bigint(20) NOT NULL, + `OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ORG_ID` bigint(20) NOT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + `OPR_DESC` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `LOG_TYPE` int(11) NULL DEFAULT NULL COMMENT '操作日志类型, 0=登录系统, 1=停止接单,2 正在接单,3=退出浏览器', + PRIMARY KEY (`LOG_ID`) USING BTREE, + INDEX `IDX_CREATE_TIME`(`CREATE_TIME`) USING BTREE, + INDEX `IDX_OPERATOR_CODE`(`OPERATOR_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_works_event +-- ---------------------------- +DROP TABLE IF EXISTS `des_works_event`; +CREATE TABLE `des_works_event` ( + `EVENT_ID` bigint(20) NOT NULL, + `WORKS_ID` bigint(20) NOT NULL, + `EVENT_TYPE` int(11) NOT NULL, + `OPERATOR_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`EVENT_ID`) USING BTREE, + INDEX `indx_EVENT_TYPE`(`EVENT_TYPE`) USING BTREE, + INDEX `indx_WORKS_ID`(`WORKS_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_works_file +-- ---------------------------- +DROP TABLE IF EXISTS `des_works_file`; +CREATE TABLE `des_works_file` ( + `WORKS_ID` bigint(20) NOT NULL, + `INDUSTRY_ID` bigint(20) NULL DEFAULT NULL, + `PRD_TYPE_ID` bigint(20) NOT NULL, + `WORKS_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `WORKS_TYPE` int(11) NULL DEFAULT NULL, + `CDR_FILE_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PDF_FILE_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CDR_PATH` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PDF_PATH` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DESIGNER` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `DESIGN_GROUP_ID` varchar(850) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DEPT_ID` varchar(850) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `THUMB_IMAGE_PATH` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `CREATE_TIME` datetime(0) NOT NULL, + `PRD_PAGE_ID` bigint(20) NULL DEFAULT NULL, + `PRD_SIZE_ID` bigint(20) NULL DEFAULT NULL, + `TEMPLATE_ID` bigint(20) NULL DEFAULT NULL, + `INDUSTRY_SUB_IDS` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `INDUSTRY_SUB_NAME` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ATTRIBUTE_IDS` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ATTRIBUTE_NAME` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `KEYWORD_ID` bigint(20) NULL DEFAULT NULL, + `KEYWORD_NAME` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `THUMB_IMAGE_PHY_PATH` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `THUMB_IMAGE_OSS_URL` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `UPLOAD_TYPE` int(11) NULL DEFAULT NULL, + `OSS_STATUS` int(11) NULL DEFAULT NULL, + `FILE_TYPE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设计文件类型后缀。pdf、cdr、ai', + PRIMARY KEY (`WORKS_ID`) USING BTREE, + INDEX `indx_DESIGNER`(`DESIGNER`) USING BTREE, + INDEX `indx_CREATE_TIME`(`CREATE_TIME`) USING BTREE, + INDEX `indx_INDUSTRY_ID`(`INDUSTRY_ID`) USING BTREE, + INDEX `indx_PRD_TYPE_ID`(`PRD_TYPE_ID`) USING BTREE, + INDEX `IDX_TEMPLATE_ID`(`TEMPLATE_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_works_file_keyword +-- ---------------------------- +DROP TABLE IF EXISTS `des_works_file_keyword`; +CREATE TABLE `des_works_file_keyword` ( + `WORKS_ID` bigint(20) NOT NULL, + `KEYWORD_ID` bigint(20) NOT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`WORKS_ID`, `KEYWORD_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_works_file_label +-- ---------------------------- +DROP TABLE IF EXISTS `des_works_file_label`; +CREATE TABLE `des_works_file_label` ( + `WORKS_ID` bigint(20) NOT NULL, + `PRD_TYPE_ID` bigint(20) NOT NULL, + `INDUSTRY_ID` bigint(20) NOT NULL, + `KEYWORD_ID` bigint(20) NULL DEFAULT NULL, + `INDUSTRY_SUB_IDS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `ATTRIBUTE_IDS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`WORKS_ID`) USING BTREE, + INDEX `WORKS_ID`(`WORKS_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_works_keyword +-- ---------------------------- +DROP TABLE IF EXISTS `des_works_keyword`; +CREATE TABLE `des_works_keyword` ( + `CAT_ID` bigint(20) NULL DEFAULT NULL, + `KEYWORD_ID` bigint(20) NOT NULL, + `KEYWORD_NAME` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `KEYWORD_TYPE` int(11) NOT NULL, + `OPERATOR_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`KEYWORD_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_works_keyword_cat +-- ---------------------------- +DROP TABLE IF EXISTS `des_works_keyword_cat`; +CREATE TABLE `des_works_keyword_cat` ( + `CAT_ID` bigint(20) NOT NULL, + `CAT_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`CAT_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for des_works_label +-- ---------------------------- +DROP TABLE IF EXISTS `des_works_label`; +CREATE TABLE `des_works_label` ( + `LABEL_ID` bigint(20) NOT NULL, + `LABEL_PARENT_ID` bigint(20) NOT NULL, + `LABEL_NAME` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `LABEL_TYPE` int(11) NOT NULL, + `LABEL_LEVEL` int(11) NOT NULL, + `LABEL_CREATER` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `LABEL_ORDER` int(11) NOT NULL, + PRIMARY KEY (`LABEL_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_after_order +-- ---------------------------- +DROP TABLE IF EXISTS `design_after_order`; +CREATE TABLE `design_after_order` ( + `DESIGN_AFS_ID` bigint(20) NOT NULL, + `OUT_AFS_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `DESIGN_ID` bigint(20) NOT NULL, + `LOSS_AMOUNT` decimal(6, 2) NOT NULL, + `COMPENSATE_AMOUNT` decimal(6, 2) NULL DEFAULT NULL COMMENT '赔付金额', + `AFTER_STATUS` int(11) NOT NULL, + `NEW_DESIGN_ID` bigint(20) NULL DEFAULT NULL, + `PIC_ORG_ID` bigint(20) NULL DEFAULT NULL, + `PIC_TYPE` bigint(20) NULL DEFAULT NULL, + `PROBLEM_TYPE` bigint(20) NULL DEFAULT NULL, + `PROBLEM_REASON` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '售后问题原因', + `PROBLEM_DESC` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '售后问题详细描述', + `AFTER_CREATE_TIME` datetime(0) NOT NULL, + `AFTER_MODIFY_TIME` datetime(0) NOT NULL, + `AFTER_BLAMER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_RETURN_NOTE` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_BLAME_RETURN_NOTE` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_BLAME_RETURN_TIME` datetime(0) NULL DEFAULT NULL, + `AFTER_HANDLER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_HANDEL_TIME` datetime(0) NULL DEFAULT NULL, + `AFTER_FINISH_NOTE` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_FINISH_TIME` datetime(0) NULL DEFAULT NULL, + `AFTER_CANCELER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_CANCEL_TIME` datetime(0) NULL DEFAULT NULL, + `AFTER_CANCEL_NOTE` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_COMPLAIN_CHECK_NOTE` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`DESIGN_AFS_ID`) USING BTREE, + INDEX `IX_DESIGN_ID`(`DESIGN_ID`) USING BTREE, + INDEX `IX_PROBLEM_REASON`(`PROBLEM_REASON`) USING BTREE, + INDEX `IX_AFTER_CREATE_TIME`(`AFTER_CREATE_TIME`, `AFTER_STATUS`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '售后订单总表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_after_statistic_detail +-- ---------------------------- +DROP TABLE IF EXISTS `design_after_statistic_detail`; +CREATE TABLE `design_after_statistic_detail` ( + `START_DATE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `DESIGN_AFS_ID` bigint(20) NOT NULL, + `OUT_AFS_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `DESIGN_ID` bigint(20) NOT NULL, + `LOSS_AMOUNT` decimal(6, 2) NOT NULL, + `AFTER_STATUS` int(11) NOT NULL, + `NEW_DESIGN_ID` bigint(20) NULL DEFAULT NULL, + `PIC_ORG_ID` bigint(20) NULL DEFAULT NULL, + `PIC_TYPE` bigint(20) NULL DEFAULT NULL, + `PROBLEM_TYPE` bigint(20) NULL DEFAULT NULL, + `PROBLEM_DESC` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `AFTER_CREATE_TIME` datetime(0) NOT NULL, + `AFTER_MODIFY_TIME` datetime(0) NOT NULL, + `AFTER_BLAMER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_RETURN_NOTE` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_BLAME_RETURN_NOTE` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_BLAME_RETURN_TIME` datetime(0) NULL DEFAULT NULL, + `AFTER_HANDLER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_HANDEL_TIME` datetime(0) NULL DEFAULT NULL, + `AFTER_FINISH_NOTE` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_FINISH_TIME` datetime(0) NULL DEFAULT NULL, + `AFTER_CANCELER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_CANCEL_TIME` datetime(0) NULL DEFAULT NULL, + `AFTER_CANCEL_NOTE` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_COMPLAIN_CHECK_NOTE` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `MERCHANT_ID` bigint(20) NOT NULL, + `ORG_ID` bigint(20) NOT NULL, + `OUT_ID` bigint(20) NOT NULL, + `ORDER_TEXT` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_NAMES` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AMOUNT` bigint(20) NOT NULL, + `PRINT_SPECIAL` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `TYPE_ID` bigint(20) NOT NULL, + `SHOP_NICK` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DESIGNER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `BUYER_NICK` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `USER_CONTACT` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `USER_MOBILE` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `USER_QQ` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `USER_WX` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`START_DATE`, `DESIGN_AFS_ID`) USING BTREE, + INDEX `IX_AFTER_FINISH_TIME`(`AFTER_FINISH_TIME`) USING BTREE, + INDEX `IX_DESIGN_ID`(`DESIGN_ID`) USING BTREE, + INDEX `IX_ORG_ID`(`ORG_ID`) USING BTREE, + INDEX `IX_AFTER_BLAMER`(`AFTER_BLAMER`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_atta +-- ---------------------------- +DROP TABLE IF EXISTS `design_atta`; +CREATE TABLE `design_atta` ( + `ATTA_ID` bigint(20) NOT NULL, + `DESIGN_ID` bigint(20) NOT NULL, + `ATTA_MODUL` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FILE_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FILE_TYPE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SAVE_PATH` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OSS_TYPE` int(11) NOT NULL, + `ATTA_FLAG` int(11) NOT NULL, + `OSS_URL` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `FILE_SIZE` bigint(20) NOT NULL, + `FILEID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATOR_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `UPLOAD_TIME` datetime(0) NOT NULL, + `NOT_EXISTS_LOCAL_FILE` int(11) NULL DEFAULT NULL COMMENT '是否存在本地文件 =0或者=null 表示本地文件存在 =1 表示不存在', + PRIMARY KEY (`ATTA_ID`) USING BTREE, + INDEX `IX_DESIGN_ID`(`DESIGN_ID`) USING BTREE, + INDEX `ix_ATTA_MODUL`(`ATTA_MODUL`) USING BTREE, + INDEX `IX_OSS_TYPE_EXISTS_FILE`(`OSS_TYPE`, `ATTA_FLAG`, `NOT_EXISTS_LOCAL_FILE`) USING BTREE, + INDEX `IX_UPLOAD_TIME`(`UPLOAD_TIME`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_complain +-- ---------------------------- +DROP TABLE IF EXISTS `design_complain`; +CREATE TABLE `design_complain` ( + `COMPLAIN_ID` bigint(20) NOT NULL COMMENT '投诉id', + `DESIGN_ID` bigint(20) NOT NULL COMMENT '设计订单编号', + `COMPLAIN_STATUS` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '投诉状态', + `COMPLAIN_TYPE` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '投诉类型', + `DISPOSE_PROJECT` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '处理方案', + `SHOP_PUNISH_SCORE` int(11) NULL DEFAULT NULL COMMENT '店铺扣罚分数', + `UNDERTAKE_DEPT` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '责任部门', + `UNDERTAKE_PERSON` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '责任人', + `UNDERTAKE_DEPT_MANAGER` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '责任主管', + `UNDERTAKE_ORG` bigint(20) NULL DEFAULT 0 COMMENT '责任组织', + `UNDERTAKE_ORG_NAME` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '责任组织名称', + `ASSIST_PERSON` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '协助人', + `ASSIST_DEPT_MANAGER` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '协助主管', + `ASSIST_ORG` bigint(20) NULL DEFAULT 0 COMMENT '协助组织', + `ASSIST_ORG_NAME` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '协助组织名称', + `IS_SATRAP_ASSIST` tinyint(1) NULL DEFAULT NULL COMMENT '是否需要主管协助,0不需要,1需要', + `COMPLAIN_SPECIFIC_TEXT` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '投诉具体描述', + `DISPOSE_IMG_PATH` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '投诉单处理图片路径', + `FINISH_IMG_PATH` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '投诉单完结图片路径', + `COMPLAIN_ADD_NAME` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '投诉单受理人', + `COMPLAIN_ADD_TIME` datetime(0) NOT NULL COMMENT '投诉单受理时间', + `COMPLAIN_MODIFY_TIME` datetime(0) NULL DEFAULT NULL COMMENT '最新修改时间', + PRIMARY KEY (`COMPLAIN_ID`) USING BTREE, + INDEX `idex_DESIGN_ID`(`DESIGN_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '投诉单表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_editor_user +-- ---------------------------- +DROP TABLE IF EXISTS `design_editor_user`; +CREATE TABLE `design_editor_user` ( + `editor_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编辑器id', + `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_520_ci NULL DEFAULT NULL COMMENT '用户名', + `mobile` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_520_ci NULL DEFAULT NULL COMMENT '用户手机号码', + `head_img` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_520_ci NULL DEFAULT NULL COMMENT '头像地址', + `type` int(11) NULL DEFAULT NULL COMMENT '1设计平台用户,2手机端用户', + PRIMARY KEY (`editor_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 3003 CHARACTER SET = utf8 COLLATE = utf8_unicode_520_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_group +-- ---------------------------- +DROP TABLE IF EXISTS `design_group`; +CREATE TABLE `design_group` ( + `GROUP_ID` bigint(20) NOT NULL, + `ORG_ID` bigint(20) NOT NULL, + `GROUP_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `GROUP_LEADER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `GROUP_SEQ` int(11) NOT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`GROUP_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_industry +-- ---------------------------- +DROP TABLE IF EXISTS `design_industry`; +CREATE TABLE `design_industry` ( + `INDUSTRY_ID` bigint(20) NOT NULL, + `INDUSTRY_NAME` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `INDUSTRY_KEYWORDS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `INDUSTRY_SEQ` int(11) NOT NULL, + `IS_ENABLED` tinyint(4) NULL DEFAULT NULL, + PRIMARY KEY (`INDUSTRY_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_merchant +-- ---------------------------- +DROP TABLE IF EXISTS `design_merchant`; +CREATE TABLE `design_merchant` ( + `MERCHANT_ID` bigint(20) NOT NULL, + `MERCHANT_NAME` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `MERCHANT_SECRET` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `IS_ENABLED` tinyint(1) NOT NULL, + PRIMARY KEY (`MERCHANT_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_notice +-- ---------------------------- +DROP TABLE IF EXISTS `design_notice`; +CREATE TABLE `design_notice` ( + `id` bigint(20) NOT NULL, + `title` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `content` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `add_user` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `add_time` datetime(0) NULL DEFAULT NULL, + `update_user` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `update_time` datetime(0) NULL DEFAULT NULL, + `create_user` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `status` int(1) NULL DEFAULT NULL COMMENT '状态:草稿=0;已发布=1;已下线=2;', + `finsh_time` datetime(0) NULL DEFAULT NULL COMMENT '发布时间', + `finsh_user` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '公告管理表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_order +-- ---------------------------- +DROP TABLE IF EXISTS `design_order`; +CREATE TABLE `design_order` ( + `DESIGN_ID` bigint(20) NOT NULL, + `MERCHANT_ID` bigint(20) NOT NULL, + `OUT_ID` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `STATUS` int(11) NOT NULL, + `SHOW_RED_MARK` int(11) NULL DEFAULT 0 COMMENT '淘宝申请退款显示红色感叹号[0-不显示,1-显示]', + `ORDER_TEXT` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `AMOUNT` bigint(20) NOT NULL, + `TYPE_ID` bigint(20) NOT NULL, + `INDUSTRY_ID` bigint(20) NULL DEFAULT NULL, + `DRAFT_TYPE` int(11) NOT NULL, + `IS_URGENT` tinyint(1) NOT NULL, + `DESIGN_PAGE` int(11) NOT NULL, + `DESIGN_WIDTH` decimal(10, 2) NOT NULL, + `DESIGN_HEIGHT` decimal(10, 2) NOT NULL, + `PRINT_WIDTH` decimal(10, 2) NOT NULL, + `PRINT_HEIGHT` decimal(10, 2) NOT NULL, + `PRINT_KS` int(11) NOT NULL, + `PRINT_MS` int(11) NOT NULL, + `USER_CONTACT` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `USER_MOBILE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `AFTER_NAMES` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `PRINT_SPECIAL` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `BUYER_NICK` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `USER_TEXT` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `USER_NOTICE` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `USER_QQ` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `USER_WX` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `USER_TEXT_REPLACE` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `REMINDER_NUM` int(11) NOT NULL, + `SHOP_NICK` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ORG_ID` bigint(20) NULL DEFAULT NULL, + `ORG_RECEIVE_TIME` datetime(0) NULL DEFAULT NULL, + `RECEIVE_TYPE` int(11) NULL DEFAULT NULL, + `ORDER_FLAG` int(11) NOT NULL, + `DESIGNER` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DESIGN_RECEIVE_TIME` datetime(0) NULL DEFAULT NULL, + `DESIGN_BEGIN_TIME` datetime(0) NULL DEFAULT NULL, + `DESIGN_DRAFT_TIME` datetime(0) NULL DEFAULT NULL, + `DESIGN_END_TIME` datetime(0) NULL DEFAULT NULL, + `DESIGN_PAUSE_REASON` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DESIGN_PAUSE_TIME` datetime(0) NULL DEFAULT NULL, + `DESIGN_EXCLUDE` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DESIGN_REQUEST_REASON` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `REQUEST_TIME` datetime(0) NULL DEFAULT NULL, + `DESIGN_REJECT_REASON` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DESIGN_KEEP_DURATION` int(11) NOT NULL, + `REQUEST_REFOUND_ACCEPT_REASON` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `REFUND_TIME` varchar(19) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CHECKER` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CHECK_TIME` datetime(0) NULL DEFAULT NULL, + `CHECK_BACK_REASON` varchar(1200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CHECK_BACK_PICTURE_URL` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `PREPRESS_BACK_REASON` varchar(1200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CANCELER` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CANCEL_TIME` datetime(0) NULL DEFAULT NULL, + `CANCEL_REASON` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + `MODIFY_TIME` datetime(0) NOT NULL, + `RE_DESIGN_SRC_ID` bigint(20) NULL DEFAULT NULL, + `RE_DESIGN_CREATE_NOTE` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `COMPLAINT_REASON` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `COMPLAINT_FLAG` int(11) NOT NULL DEFAULT 0, + `COMPLAINT_BACK_REASON` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `SERVICES_MESSAGE` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `QC_TIME` datetime(0) NULL DEFAULT NULL, + `QC_FLAG` int(1) NULL DEFAULT 0, + `IS_OLD_USER` int(11) NULL DEFAULT NULL COMMENT '是否老用户', + `DESIGN_COPIES` int(11) NULL DEFAULT 0 COMMENT '设计费份数', + `RECEIVER_NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人名称', + `RECEIVER_MOBILE` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人的手机号码', + `RECEIVER_STATE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人所在省份', + `RECEIVER_CITY` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人所在城市', + `RECEIVER_DISTRICT` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人所在区县', + `RECEIVER_ADDRESS` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人详细地址', + `TYPESET_AUDITOR` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '排版审核人', + `GOTO_TYPESET_TIME` datetime(0) NULL DEFAULT NULL COMMENT '前去排版时间', + `SUBMIT_TYPESET_TIME` datetime(0) NULL DEFAULT NULL COMMENT '提交排版时间', + `EXPRESS_CODE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '物流code', + `CREATER` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '录单人', + `ORDER_SRC` int(11) NULL DEFAULT 0 COMMENT '订单来源,0:原订单,1:售后补单,2:售后赠单,3:微商单', + `TIDS` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '淘宝单号,多个逗号分隔', + `IS_ONLY_DESIGN` tinyint(1) NOT NULL COMMENT '是否仅设计', + `IS_HIGH_QUALITY_ORDER` tinyint(1) NULL DEFAULT NULL COMMENT '是否优质订单', + `IS_TIME_OUT_REMIND` int(4) NULL DEFAULT 0 COMMENT '是否已进行设计订单超时提醒', + `DESIGN_PRICE` bigint(20) NULL DEFAULT 0 COMMENT '设计师佣金', + `TEMPLATE_ID` int(11) NULL DEFAULT NULL COMMENT '编辑器模板id', + `FILE_FAIL_MSG` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件错误原因', + `RETURN_MSG` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '退货信息', + `RETURN_MSG_TIME` datetime(0) NULL DEFAULT NULL COMMENT '退货信息时间', + `RETURN_AFTER_STATUS` int(255) NULL DEFAULT NULL, + `IS_CHANGE` tinyint(1) NULL DEFAULT NULL COMMENT '是否改稿', + `IS_BACK` tinyint(1) NULL DEFAULT NULL COMMENT '是否退回', + `ROOM_ID` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`DESIGN_ID`) USING BTREE, + INDEX `IDX_STATUS_CREATE_TIME`(`CREATE_TIME`, `STATUS`, `ORG_ID`) USING BTREE, + INDEX `IDX_DESIGN_END_TIME`(`STATUS`, `DESIGN_END_TIME`) USING BTREE, + INDEX `IDX_OUT_ID`(`OUT_ID`) USING BTREE, + INDEX `IDX_USER_MOBILE`(`USER_MOBILE`) USING BTREE, + INDEX `IDX_CHECK_TIME`(`STATUS`, `CHECK_TIME`) USING BTREE, + INDEX `IDX_ORG_ID_STATUS_DESIGNER_RECEIVETIME`(`DESIGN_RECEIVE_TIME`, `STATUS`, `ORG_ID`, `DESIGNER`) USING BTREE, + INDEX `IDX_BUYER_NICK`(`BUYER_NICK`) USING BTREE, + INDEX `IDX_DESIGN_DRAFT_TIME`(`STATUS`, `DESIGN_DRAFT_TIME`) USING BTREE, + INDEX `IDX_REFUND_TIME`(`REFUND_TIME`, `DESIGNER`, `CREATE_TIME`) USING BTREE, + INDEX `IDX_DESIGNER`(`DESIGNER`) USING BTREE, + INDEX `IDX_DESIGN_BEGIN_TIME`(`DESIGN_BEGIN_TIME`) USING BTREE, + INDEX `IDX_MODIFY_TIME`(`MODIFY_TIME`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计订单表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_order_merits +-- ---------------------------- +DROP TABLE IF EXISTS `design_order_merits`; +CREATE TABLE `design_order_merits` ( + `merits_id` bigint(20) NOT NULL COMMENT 'id', + `DESIGN_ID` bigint(20) NOT NULL COMMENT '设订单编号,设计平台独立编号', + `type` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_520_ci NOT NULL COMMENT '修改绩效类型1:设计份数;2:重置佣金;3:修改佣金;4:修改加急费;5:修改稿件类型6:修改稿件类型时候重新算价', + `old_data` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_520_ci NULL DEFAULT NULL COMMENT '老数据', + `new_data` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_520_ci NULL DEFAULT NULL COMMENT '现数据', + `add_user` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_520_ci NOT NULL COMMENT '添加人', + `add_time` datetime(0) NOT NULL COMMENT '添加时间', + `designer` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_520_ci NULL DEFAULT NULL COMMENT '设计师', + `STATUS` int(11) NOT NULL COMMENT '订单状态', + `ORDER_TEXT` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '订单描述', + `TYPE_ID` bigint(20) NOT NULL COMMENT '设计类型,名片、彩页、等等', + `old_price` bigint(20) NULL DEFAULT NULL COMMENT '老价格', + `new_price` bigint(20) NULL DEFAULT NULL COMMENT '新价格', + PRIMARY KEY (`merits_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_unicode_520_ci COMMENT = '订单修改绩效记录保存' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_order_refund_reason +-- ---------------------------- +DROP TABLE IF EXISTS `design_order_refund_reason`; +CREATE TABLE `design_order_refund_reason` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `title` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '退款原因', + `update_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0), + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计订单退款原因配置表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_org_mer +-- ---------------------------- +DROP TABLE IF EXISTS `design_org_mer`; +CREATE TABLE `design_org_mer` ( + `ORG_ID` bigint(20) NOT NULL, + `MER_STATUS` int(11) NOT NULL, + `DESIGN_TYPE_IDS` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `INDUSTRY_IDS` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `MER_MAX_ORDER` int(11) NOT NULL, + `MER_MAX_WAIT_ORDER` int(11) NOT NULL, + `PERSONAL_MAX_ORDER` int(11) NOT NULL, + `MAX_ORDER_AMOUNT` bigint(20) NOT NULL, + `MIN_ORDER_AMOUNT` bigint(20) NULL DEFAULT 0 COMMENT '订单最小金额', + `MER_LEVEL` int(11) NOT NULL, + `MER_DESPATCH_TYPE` int(11) NULL DEFAULT NULL, + `IS_URGENT` tinyint(1) NOT NULL, + `IS_PAUSE_RECIEIVE` tinyint(1) NOT NULL, + `POLICY_JSONS` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `PAPER_JSONS` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `AFTER_NAMES` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `IS_DESIGN_ORDER` tinyint(1) NULL DEFAULT 1 COMMENT '是否接取普通设计订单', + `IS_SENIOR_DESIGN_ORDER` tinyint(1) NULL DEFAULT 0 COMMENT '是否接取资深设计订单', + `IS_NORM_DRAFT_ORDER` tinyint(1) NULL DEFAULT 0 COMMENT '是否接取标准自来稿', + `IS_DRAFT_ORDER` tinyint(1) NULL DEFAULT NULL COMMENT '是否支持改稿自来稿', + `DRAFT_MAX_ORDER` int(11) NULL DEFAULT NULL COMMENT '自来稿同时最大接单量', + `IS_HIGH_QUALITY_ORDER` tinyint(1) NULL DEFAULT NULL COMMENT '是否优质订单', + `MER_MAX_ORDINARY_ORDER` int(11) NULL DEFAULT NULL COMMENT '商户普通订单最大未领单量', + `PERSONAL_MAX_ORDINARY_ORDER` int(11) NULL DEFAULT NULL COMMENT '个人普通订单最大接单量', + `MODIFY_OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `MODIFY_TIME` datetime(0) NULL DEFAULT NULL, + `IS_SPECIAL` tinyint(1) NULL DEFAULT NULL COMMENT '是否支持异型订单', + `MER_DEFULT` tinyint(4) NULL DEFAULT NULL COMMENT '默认接单商户=0 否(默认) =1 是', + `SEND_SMS` tinyint(4) NULL DEFAULT NULL COMMENT '发送短信 =0 不发送(默认) =1 发送', + `CONTACT` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系方式: QQ,旺旺', + `RECIEIVE_TIME` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ORDER_SHOP` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商户支持的店铺', + PRIMARY KEY (`ORG_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '组织接单规则表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_performance +-- ---------------------------- +DROP TABLE IF EXISTS `design_performance`; +CREATE TABLE `design_performance` ( + `PERFORMANCE_ID` bigint(20) NOT NULL, + `ORG_ID` bigint(20) NOT NULL, + `IS_GROUP_LEADER` tinyint(4) NOT NULL, + `AMOUNT_LEVEL_1` bigint(20) NOT NULL, + `AMOUNT_LEVEL_2` bigint(20) NOT NULL, + `AMOUNT_LEVEL_3` bigint(20) NOT NULL, + `AMOUNT_LEVEL_4` bigint(20) NOT NULL, + `AMOUNT_LEVEL_5` bigint(20) NOT NULL, + `AMOUNT_LEVEL_6` bigint(20) NOT NULL, + PRIMARY KEY (`PERFORMANCE_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_pinlei +-- ---------------------------- +DROP TABLE IF EXISTS `design_pinlei`; +CREATE TABLE `design_pinlei` ( + `ID` bigint(20) NOT NULL, + `NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CLASSIFY_ID` bigint(20) NULL DEFAULT NULL, + `TYPE_ID` bigint(20) NULL DEFAULT NULL, + `TYPE_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_price +-- ---------------------------- +DROP TABLE IF EXISTS `design_price`; +CREATE TABLE `design_price` ( + `price_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '设计单价ID', + `convert_id` bigint(20) NOT NULL COMMENT '产品单价id', + `prd_type_id` bigint(20) NULL DEFAULT NULL COMMENT '产品类型编号', + `draft_type` int(4) NULL DEFAULT NULL COMMENT '稿件类型', + `design_price_money` bigint(11) NULL DEFAULT NULL COMMENT '设计单价金额', + `effect_time` datetime(0) NULL DEFAULT NULL COMMENT '生效时间', + `status` int(4) NULL DEFAULT NULL COMMENT '设计单价状态(0失效,1生效)', + PRIMARY KEY (`price_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 512 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计单价表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_size +-- ---------------------------- +DROP TABLE IF EXISTS `design_size`; +CREATE TABLE `design_size` ( + `TYPE_ID` bigint(20) NOT NULL, + `SIZE_ID` bigint(20) NOT NULL, + `SIZE_STATUS` int(11) NOT NULL, + `SIZE_WIDTH` decimal(10, 2) NOT NULL, + `SIZE_HEIGHT` decimal(10, 2) NOT NULL, + `SIZE_BLEED` decimal(10, 2) NOT NULL, + `SIZE_SEQ` int(11) NOT NULL, + `SIZE_SIDE` decimal(10, 0) NULL DEFAULT NULL COMMENT '侧面长度', + PRIMARY KEY (`SIZE_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for design_type +-- ---------------------------- +DROP TABLE IF EXISTS `design_type`; +CREATE TABLE `design_type` ( + `TYPE_ID` bigint(20) NOT NULL AUTO_INCREMENT, + `TYPE_NAME` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类型名, 例如:名片、彩页、画册', + `IS_ENABLED` tinyint(4) NOT NULL COMMENT '状态 1=正常、0=停用', + `MER_DISPATCH_EFFECTIVE_TIME` int(11) NOT NULL COMMENT '分拣时效(分拣时间),单位分钟', + `DISPATCH_ORDER_EFFECTIVE_TIME` int(11) NOT NULL COMMENT '派单时效(派单时间),单位分钟', + `TYPE_SEQ` int(11) NOT NULL COMMENT '排序功能', + `EFFECTIVE_TIME` int(11) NOT NULL COMMENT '初稿时效(初稿时间),单位分钟', + `EFFECTIVE_END_TIME` int(11) NOT NULL COMMENT '定稿时效(定稿时间),单位分钟', + `SIZE_M_WIDTH` decimal(8, 2) NULL DEFAULT NULL, + `SIZE_M_HEIGHT` decimal(8, 2) NULL DEFAULT NULL, + `DESIGN_FILE_TYPE` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设计文件类型', + `PRINTING_FILE_TYPE` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '印刷文件类型', + `BLEEDING` decimal(8, 2) NULL DEFAULT NULL COMMENT '产品出血', + `DPI` decimal(8, 2) NULL DEFAULT NULL COMMENT '产品分辨率', + PRIMARY KEY (`TYPE_ID`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1916 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计平台产品类型表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for designer_course +-- ---------------------------- +DROP TABLE IF EXISTS `designer_course`; +CREATE TABLE `designer_course` ( + `designer` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设计师', + `work_experience` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工作经历', + `skill_scope` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '软件能力', + `design_type` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '擅长设计', + `work_duration` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工作时长', + `work_status` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '在职情况', + `receive_type` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '收款方式', + `receive_account` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '收款账号、收款信息', + `designer_remark` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + `previous_end_count` int(11) NULL DEFAULT 0 COMMENT '上月订单数量', + `previous_performance` bigint(20) NULL DEFAULT 0 COMMENT '上月绩效', + `last_onlime_time` datetime(0) NULL DEFAULT NULL COMMENT '最后上线时间', + `add_operator` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '添加人', + `add_time` datetime(0) NOT NULL COMMENT '添加时间', + `update_operator` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`designer`) USING BTREE, + INDEX `IDX_WORK_STATUS`(`work_status`) USING BTREE, + INDEX `IDX_ADD_TIME`(`add_time`) USING BTREE, + INDEX `IDX_WORK_DURATION`(`work_duration`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师个人信息扩展表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for designer_group +-- ---------------------------- +DROP TABLE IF EXISTS `designer_group`; +CREATE TABLE `designer_group` ( + `DESIGNER_GROUP_ID` bigint(20) NOT NULL COMMENT '设计师组id', + `DESIGNER_GROUP_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设计师组名称', + `MAX_ORDER_AMOUNT` bigint(20) NOT NULL COMMENT '最大接单金额', + `MIN_ORDER_AMOUNT` bigint(20) NULL DEFAULT 0 COMMENT '最小接单金额', + `IS_HIGH_QUALITY_ORDER` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否优质订单', + `IS_LARGE_AMOUNT` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否支持大金额订单', + `IS_URGENT` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否支持加急订单', + `IS_DESIGN` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否支持只设计不印刷', + `IS_SPECIAL` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否支持异型订单', + `AFTER_NAMES` varchar(4000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `MERCHANT_IDS` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关联渠道ID', + `REMARK` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', + `STATUS` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:0失效,1失效', + `MODIFY_OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `MODIFY_TIME` datetime(0) NULL DEFAULT NULL, + `MAX_ORDER_NUM` tinyint(4) NOT NULL DEFAULT 0 COMMENT '最大接单量(老用户除外)', + `MAX_WAIVE_NUM` tinyint(4) NOT NULL DEFAULT 0 COMMENT '订单可放弃最大次数', + PRIMARY KEY (`DESIGNER_GROUP_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师接单规则组表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for designer_group_dispatch +-- ---------------------------- +DROP TABLE IF EXISTS `designer_group_dispatch`; +CREATE TABLE `designer_group_dispatch` ( + `OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作员', + `ORG_ID` bigint(20) NULL DEFAULT NULL, + `DESIGNER_GROUP_ID` bigint(20) NOT NULL COMMENT '设计师组id', + `MAX_ORDER_AMOUNT` bigint(20) NOT NULL COMMENT '最大接单金额', + `MIN_ORDER_AMOUNT` bigint(20) NULL DEFAULT 0 COMMENT '最小接单金额', + `IS_HIGH_QUALITY_ORDER` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否优质订单', + `IS_LARGE_AMOUNT` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否支持大金额订单', + `IS_URGENT` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否支持加急订单', + `IS_DESIGN` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否支持只设计不印刷', + `IS_SPECIAL` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否支持异型订单', + `AFTER_NAMES` varchar(4000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `MERCHANT_IDS` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关联渠道ID', + `STATUS` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:0失效,1正常', + `MODIFY_OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `MODIFY_TIME` datetime(0) NULL DEFAULT NULL, + `MAX_ORDER_NUM` tinyint(4) NULL DEFAULT 0 COMMENT '最大接单量(老用户除外)', + `WAIVE_NUM` tinyint(4) NOT NULL DEFAULT 0 COMMENT '设计师每月可放弃订单次数', + `IS_SHOW_QDDT` tinyint(1) NULL DEFAULT NULL COMMENT '是否抢单大厅:0不显示,1显示', + `IS_SHOW_COST` tinyint(1) NULL DEFAULT NULL COMMENT '是否显示佣金:0不显示,1显示', + PRIMARY KEY (`OPERATOR_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师接单规则表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for designer_group_dispatch_log +-- ---------------------------- +DROP TABLE IF EXISTS `designer_group_dispatch_log`; +CREATE TABLE `designer_group_dispatch_log` ( + `ORG_ID` bigint(20) NOT NULL, + `DESIGN_ID` bigint(20) NOT NULL, + `DES_TIME` datetime(0) NOT NULL, + `DIS_DESC` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ANALYSIS_TEXT` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '分拣分析结果内容', + PRIMARY KEY (`DESIGN_ID`, `DES_TIME`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单自动分拣派单日志' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for designer_group_dispatch_value +-- ---------------------------- +DROP TABLE IF EXISTS `designer_group_dispatch_value`; +CREATE TABLE `designer_group_dispatch_value` ( + `DESIGNER_GROUP_DISPATCH_VALUE_ID` bigint(20) NOT NULL COMMENT '主键id', + `OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作员', + `RELATED_TYPE` int(11) NOT NULL COMMENT '关联类型:0标准/改稿自来稿,1普通设计,2资深设计,3行业', + `RELATED_VALUE` bigint(20) NOT NULL COMMENT '关联的值', + PRIMARY KEY (`DESIGNER_GROUP_DISPATCH_VALUE_ID`) USING BTREE, + INDEX `IND_CODE_TYPE_VALUE`(`OPERATOR_CODE`, `RELATED_TYPE`, `RELATED_VALUE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师接单规则关联属性值表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for designer_group_value +-- ---------------------------- +DROP TABLE IF EXISTS `designer_group_value`; +CREATE TABLE `designer_group_value` ( + `DESIGNER_GROUP_VALUE_ID` bigint(20) NOT NULL COMMENT '主键id', + `DESIGNER_GROUP_ID` bigint(20) NOT NULL COMMENT '设计师组id', + `RELATED_TYPE` int(11) NOT NULL COMMENT '关联类型:0标准/改稿自来稿,1普通设计,2资深设计,3行业', + `RELATED_VALUE` bigint(20) NOT NULL COMMENT '关联的值', + PRIMARY KEY (`DESIGNER_GROUP_VALUE_ID`) USING BTREE, + INDEX `IND_GROUP_TYPE_VALUE`(`DESIGNER_GROUP_ID`, `RELATED_TYPE`, `RELATED_VALUE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师接单组关联的属性值表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for designer_order_performance_stat +-- ---------------------------- +DROP TABLE IF EXISTS `designer_order_performance_stat`; +CREATE TABLE `designer_order_performance_stat` ( + `design_id` bigint(20) NOT NULL COMMENT '订单编号', + `designer` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设计师', + `org_id` bigint(20) NOT NULL COMMENT '组织编号', + `print_ks` int(11) NULL DEFAULT 0 COMMENT '款数', + `template_draft_fee` bigint(20) NOT NULL COMMENT '改稿价格(改稿自来稿设计费一律按0.5元*款数计算,不区分产品)', + `prd_convert_fee` bigint(20) NOT NULL COMMENT '产品单价', + `multi_ks_fee` bigint(20) NOT NULL COMMENT '多款费用((款数-1)*0.5)', + `multi_ms_fee` bigint(20) NOT NULL COMMENT ' 多模费用(订单模数≥3一律加三元)', + `design_copies` int(8) NOT NULL COMMENT '设计份数', + `order_designer_fee` bigint(20) NOT NULL COMMENT '订单设计师费用', + `design_end_time` datetime(0) NOT NULL COMMENT '设计师定稿时间', + `add_time` datetime(0) NOT NULL COMMENT '添加时间', + PRIMARY KEY (`design_id`) USING BTREE, + INDEX `IDX_DESIGN_END_TIME`(`design_end_time`) USING BTREE, + INDEX `IDX_DESIGNER`(`designer`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师订单绩效表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for designer_profile +-- ---------------------------- +DROP TABLE IF EXISTS `designer_profile`; +CREATE TABLE `designer_profile` ( + `OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作员', + `PERSONAL_PROFILE` varchar(350) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '个人简介', + `LABELS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '标签', + `STATE` tinyint(4) NULL DEFAULT NULL COMMENT '状态: 0未提交 1未审核 2审核退回 3审核通过', + `ADD_TIME` datetime(0) NULL DEFAULT NULL COMMENT '提交时间', + PRIMARY KEY (`OPERATOR_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师个人信息' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for designer_works +-- ---------------------------- +DROP TABLE IF EXISTS `designer_works`; +CREATE TABLE `designer_works` ( + `DESIGNER_WORKS_ID` bigint(20) NOT NULL COMMENT '作品id', + `OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作员', + `IMG_PATH` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '图片路径', + `IMG_KEY` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'OSS文件key', + `STATE` tinyint(4) NULL DEFAULT NULL COMMENT '状态: 0未审核 1审核退回 2审核通过 ', + `ADD_TIME` datetime(0) NULL DEFAULT NULL COMMENT '提交时间', + PRIMARY KEY (`DESIGNER_WORKS_ID`) USING BTREE, + INDEX `IDX_OPERATOR_CODE`(`OPERATOR_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师个人作品' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for dzmp_design_element +-- ---------------------------- +DROP TABLE IF EXISTS `dzmp_design_element`; +CREATE TABLE `dzmp_design_element` ( + `ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `MEDIA_ID` bigint(20) NOT NULL COMMENT '模板ID', + `ELE_JSON` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设计元素JSON字符串', + `MODIFY_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + INDEX `IDX_MEDIA_ID`(`MEDIA_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '电子名片设计元素表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for dzmp_image_storage +-- ---------------------------- +DROP TABLE IF EXISTS `dzmp_image_storage`; +CREATE TABLE `dzmp_image_storage` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `type` tinyint(4) NOT NULL COMMENT '类型:1=个人相册;2=公司相册;', + `user_card_id` bigint(20) NULL DEFAULT NULL COMMENT '电子名片id', + `company_id` bigint(20) NULL DEFAULT NULL COMMENT '公司id', + `img_url` varchar(350) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图片url', + `sort` int(11) NULL DEFAULT 1000 COMMENT '排序', + `state` tinyint(4) NOT NULL COMMENT '状态:0=失效;1=生效', + `add_operator_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '添加人code', + `add_time` datetime(0) NOT NULL COMMENT '添加时间', + `update_operator_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人code', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '电子名片-名片对应的图片临时数据表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for dzmp_user_card_storage +-- ---------------------------- +DROP TABLE IF EXISTS `dzmp_user_card_storage`; +CREATE TABLE `dzmp_user_card_storage` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `design_id` bigint(20) NOT NULL COMMENT '设计平台订单ID', + `media_id` bigint(20) NULL DEFAULT NULL COMMENT '媒体编号', + `user_id` bigint(20) NULL DEFAULT NULL COMMENT '电子名片用户ID', + `user_card_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户真名', + `user_remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '个人介绍', + `company_alias` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '公司别名', + `position` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '职位', + `card_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '名片URL', + `region` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所在省份', + `city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所在城市', + `district` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所在区县', + `address` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址', + `latitude` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '纬度', + `longitude` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '经度', + `wxcode` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '微信号', + `user_qq` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'QQ', + `user_email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '电子邮箱', + `mobile` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号码', + `landline` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '座机', + `user_fax` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '传真', + `website_url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网址', + `card_avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '名片头像', + `card_background` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '名片背景头像', + `card_background_type` tinyint(4) NULL DEFAULT NULL COMMENT '背景图片类型:0=系统;1=自定义', + `card_layout_id` bigint(20) NULL DEFAULT NULL COMMENT '名片版式id', + `remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `state` tinyint(4) NOT NULL DEFAULT 1 COMMENT '名片状态:0=失效;1=生效', + `use_state` tinyint(4) NOT NULL DEFAULT 0 COMMENT '用户是否已使用:0=未使用;1=已使用', + `add_operator_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '添加人code', + `add_time` datetime(0) NOT NULL COMMENT '添加时间', + `update_operator_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人code', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '电子名片-用户名片的临时数据表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for group_members +-- ---------------------------- +DROP TABLE IF EXISTS `group_members`; +CREATE TABLE `group_members` ( + `START_DATE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `USER_CODE` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `END_DATE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `GROUP_ID` bigint(20) NOT NULL, + `IS_GROUP_LEADER` int(11) NOT NULL, + PRIMARY KEY (`START_DATE`, `USER_CODE`) USING BTREE, + INDEX `IX_START_DATE_END_DATE`(`START_DATE`, `END_DATE`) USING BTREE, + INDEX `IX_GROUP_ID`(`GROUP_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for material_cat +-- ---------------------------- +DROP TABLE IF EXISTS `material_cat`; +CREATE TABLE `material_cat` ( + `CAT_CODE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `TYPE_CODE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CAT_NAME` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CAT_STATUS` tinyint(4) NOT NULL, + `CAT_LABEL` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CAT_SEQ` int(11) NOT NULL, + PRIMARY KEY (`CAT_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for material_svg +-- ---------------------------- +DROP TABLE IF EXISTS `material_svg`; +CREATE TABLE `material_svg` ( + `SVG_ID` bigint(20) NOT NULL, + `SVG_STATUS` tinyint(4) NOT NULL, + `SVG_CODE` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SVG_SEQ` int(11) NOT NULL, + `IS_EDIT` tinyint(4) NOT NULL, + `IS_UPLOAD` tinyint(4) NOT NULL, + `TYPE_CODE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CAT_CODE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SVG_THUMBNAIL` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `KEYWORDS` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`SVG_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for media_bg +-- ---------------------------- +DROP TABLE IF EXISTS `media_bg`; +CREATE TABLE `media_bg` ( + `MEDIA_ID` bigint(20) NOT NULL, + `BID` int(11) NOT NULL, + `ODD_EVEN` bigint(11) NULL DEFAULT NULL, + `FILE_ID` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `SOURCE` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `BG_URL` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `BG_MIN_URL` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`MEDIA_ID`, `BID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for media_canvas +-- ---------------------------- +DROP TABLE IF EXISTS `media_canvas`; +CREATE TABLE `media_canvas` ( + `MEDIA_ID` bigint(20) NOT NULL, + `MEDIA_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `STATUS` tinyint(4) NOT NULL, + `MEDIA_TYPE` bigint(20) NULL DEFAULT NULL, + `IS_EDIT` tinyint(1) NULL DEFAULT NULL, + `WIDTH` decimal(16, 8) NOT NULL, + `HEIGHT` decimal(16, 8) NOT NULL, + `WIDTH_MM` decimal(16, 8) NOT NULL, + `HEIGHT_MM` decimal(16, 8) NOT NULL, + `DPI` int(11) NOT NULL, + `BLEED_SIZE` double(16, 8) NOT NULL, + `CREATE_MODE` tinyint(4) NOT NULL COMMENT '创建方式,0:mm,1:像素', + `IS_MODIFY` tinyint(1) NOT NULL, + `ODD_EVEN` bigint(11) NULL DEFAULT NULL, + `MEDIA_URL` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `CREATE_TIME` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `UPDATE_TIME` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `EDIT_TIME` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `FULL_WIDTH` decimal(16, 8) NULL DEFAULT NULL, + `FULL_HEIGHT` decimal(16, 8) NULL DEFAULT NULL, + `FULL_WIDTH_MM` decimal(16, 8) NULL DEFAULT NULL, + `FULL_HEIGHT_MM` decimal(16, 8) NULL DEFAULT NULL, + `BASE_WIDTH_MM` decimal(16, 8) NULL DEFAULT NULL, + `BASE_HEIGHT_MM` decimal(16, 8) NULL DEFAULT NULL, + PRIMARY KEY (`MEDIA_ID`) USING BTREE, + INDEX `IX_MEDIA_CANVAS_CREATE_TIME`(`CREATE_TIME`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for media_cover_material +-- ---------------------------- +DROP TABLE IF EXISTS `media_cover_material`; +CREATE TABLE `media_cover_material` ( + `MEDIA_ID` bigint(20) NOT NULL, + `BID` int(11) NOT NULL, + `MID` int(11) NOT NULL, + `SOURCE` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`MEDIA_ID`, `BID`, `MID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for media_font +-- ---------------------------- +DROP TABLE IF EXISTS `media_font`; +CREATE TABLE `media_font` ( + `FONT_INDEX` int(11) NOT NULL, + `FONT_NAME` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FILE_NAME` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `FONT_STATUS` tinyint(4) NOT NULL, + `FONT_SVG` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FONT_PATH` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`FONT_NAME`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for media_image_use +-- ---------------------------- +DROP TABLE IF EXISTS `media_image_use`; +CREATE TABLE `media_image_use` ( + `FILE_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `URL` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `NUM` int(11) NOT NULL, + `OPERATE_TIME` varchar(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`FILE_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for media_material +-- ---------------------------- +DROP TABLE IF EXISTS `media_material`; +CREATE TABLE `media_material` ( + `MEDIA_ID` bigint(20) NOT NULL, + `BID` int(11) NOT NULL, + `MID` int(11) NOT NULL, + `POS` int(11) NOT NULL, + `TYPE` tinyint(4) NOT NULL, + `STATUS` tinyint(4) NOT NULL, + `FILE_ID` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `SOURCE` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`MEDIA_ID`, `BID`, `MID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for media_material_param +-- ---------------------------- +DROP TABLE IF EXISTS `media_material_param`; +CREATE TABLE `media_material_param` ( + `MEDIA_ID` bigint(20) NOT NULL, + `BID` int(11) NOT NULL, + `MID` int(11) NOT NULL, + `PARAM_KEY` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_TYPE` tinyint(4) NOT NULL, + PRIMARY KEY (`MEDIA_ID`, `BID`, `MID`, `PARAM_KEY`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for media_param +-- ---------------------------- +DROP TABLE IF EXISTS `media_param`; +CREATE TABLE `media_param` ( + `PARAM_INDEX` int(11) NOT NULL, + `PARAM_CAT` bigint(20) NOT NULL, + `PARAM_TYPE` tinyint(4) NOT NULL, + `PARAM_KEY` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_VALUE` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `PARAM_DESC` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`PARAM_CAT`, `PARAM_KEY`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for media_temp_image +-- ---------------------------- +DROP TABLE IF EXISTS `media_temp_image`; +CREATE TABLE `media_temp_image` ( + `ID` bigint(20) NOT NULL, + `MEDIA_ID` bigint(20) NOT NULL, + `FILE_ID` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `TYPE` tinyint(4) NOT NULL, + `CREATE_TIME` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`ID`) USING BTREE, + INDEX `IDX_MEDIA_ID`(`MEDIA_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for media_template +-- ---------------------------- +DROP TABLE IF EXISTS `media_template`; +CREATE TABLE `media_template` ( + `MEDIA_ID` bigint(20) NOT NULL, + `TEMPLATE_TYPE` int(11) NOT NULL, + `TEMPLATE_STATUS` int(11) NOT NULL, + `DESIGNER` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `TYPE_ID` bigint(20) NOT NULL, + `PAGE_VALUE` int(11) NOT NULL, + `INDUSTRY_ID` bigint(20) NULL DEFAULT NULL, + `ATTRIBUTE_ID` bigint(20) NULL DEFAULT NULL, + `INDUSTRY_SUB_IDS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `INDUSTRY_SUB_NAME` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `ATTRIBUTE_IDS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `ATTRIBUTE_NAME` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `TEMPLATE_GROUP` varchar(850) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `SHARE_DEPT` varchar(850) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DESIGN_ID` bigint(20) NULL DEFAULT NULL, + `THEME_COLOR` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `KEYWORD_ID` bigint(20) NULL DEFAULT NULL, + `KEYWORD_NAME` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `KEYWORDS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `TEMPLATE_SRC` bigint(20) NULL DEFAULT NULL, + `RELEASE_STATUS` tinyint(4) NOT NULL, + `RELEASE_TIME` varchar(19) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `FILE_TYPE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模板外部稿件后缀格式pdf、cdr、ai,多个分隔符连接', + `CREATE_CHANNEL` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建方式', + PRIMARY KEY (`MEDIA_ID`) USING BTREE, + INDEX `IX_MEDIA_TEMPLATE_TYPE_STATUS`(`TEMPLATE_TYPE`, `TEMPLATE_STATUS`) USING BTREE, + INDEX `ix_DESIGN_ID`(`DESIGN_ID`) USING BTREE, + INDEX `ix_DESIGNER`(`DESIGNER`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for ord_opr_log +-- ---------------------------- +DROP TABLE IF EXISTS `ord_opr_log`; +CREATE TABLE `ord_opr_log` ( + `LOG_ID` bigint(20) NOT NULL, + `DESIGN_ID` bigint(20) NOT NULL, + `STATUS` int(11) NOT NULL, + `OPERATOR_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `OPERATE_DESC` varchar(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + `EVENT_TYPE` int(11) NULL DEFAULT NULL COMMENT '事件类型', + `DESIGNER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设计师', + PRIMARY KEY (`LOG_ID`) USING BTREE, + INDEX `IX_CREATE_TIME_DESIGNER_EVENT_TYPE`(`CREATE_TIME`, `EVENT_TYPE`, `DESIGNER`) USING BTREE, + INDEX `IDX_CREATE_TIME`(`CREATE_TIME`) USING BTREE, + INDEX `idenx_designid`(`DESIGN_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for ord_progress_note +-- ---------------------------- +DROP TABLE IF EXISTS `ord_progress_note`; +CREATE TABLE `ord_progress_note` ( + `DESIGN_ID` bigint(20) NULL DEFAULT NULL, + `ORD_PROGRESS_NOTE` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `OPERATE_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CREATE_TIME` datetime(0) NOT NULL, + INDEX `idx_DESIGN_ID`(`DESIGN_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for order_convert +-- ---------------------------- +DROP TABLE IF EXISTS `order_convert`; +CREATE TABLE `order_convert` ( + `CONVERT_ID` bigint(20) NOT NULL, + `CONVERT_TYPE` int(11) NOT NULL, + `CONVERT_NUM` decimal(10, 2) NOT NULL, + `PRD_TYPE_ID` bigint(20) NOT NULL, + `PRD_TYPE_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CONVERT_MODULUS` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CONVERT_MODULUS_NUM` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `MODIFY_TIME` datetime(0) NOT NULL, + PRIMARY KEY (`CONVERT_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for order_message +-- ---------------------------- +DROP TABLE IF EXISTS `order_message`; +CREATE TABLE `order_message` ( + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键id', + `design_id` bigint(20) NOT NULL COMMENT '订单号', + `buyer_nick` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '旺旺号', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `message_type` int(2) NOT NULL COMMENT '消息类型(订单审核、排产退回,催稿)', + `topic` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT ' 主题,(催稿大类,orderReminder:订单催稿/定稿,changeDesigner:更换/指定设计师/订单加急)', + `production_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '生产者code', + `production_time` datetime(0) NOT NULL COMMENT '生产时间', + `message_body` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '消息内容', + `consumer_code_type` int(2) NOT NULL COMMENT '消费者类型(0:操作员 1:协调人)。默认为0', + `consumer_platform_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '消费平台:ERP,DESIGN,CONSIGNMENT', + `consumer_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '消费者code', + `consumer_state` int(1) NOT NULL COMMENT '消费状态,0:未消费,1:已消费', + `consumer_time` datetime(0) NULL DEFAULT NULL COMMENT '消费时间', + `remark` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + INDEX `idx_create_time`(`create_time`) USING BTREE, + INDEX `idx_production_code`(`production_code`) USING BTREE, + INDEX `idx_consumer_code`(`consumer_code`) USING BTREE, + INDEX `idx_buyer_nick`(`buyer_nick`) USING BTREE, + INDEX `idx_design_id`(`design_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '平台消息表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for order_questions +-- ---------------------------- +DROP TABLE IF EXISTS `order_questions`; +CREATE TABLE `order_questions` ( + `QUESTIONS_ID` bigint(20) NOT NULL COMMENT '考试订单id', + `DESIGN_REQUIREMENTS` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设计要求', + `STATUS` tinyint(4) NOT NULL COMMENT '考试状态:10 未提交 20 等待审核 30 审核通过 40 审核拒绝', + `DESIGNER` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设计师', + `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', + `DESIGN_END_TIME` datetime(0) NULL DEFAULT NULL COMMENT '设计完成时间', + `REMARKS` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注说明', + `MOBILE` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`QUESTIONS_ID`) USING BTREE, + INDEX `IDX_DESIGNER`(`DESIGNER`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师考试订单表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for order_token +-- ---------------------------- +DROP TABLE IF EXISTS `order_token`; +CREATE TABLE `order_token` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `token_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_520_ci NULL DEFAULT NULL COMMENT 'token名', + `context` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_520_ci NULL DEFAULT NULL COMMENT '内容', + `add_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '添加时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_unicode_520_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for order_type_stat +-- ---------------------------- +DROP TABLE IF EXISTS `order_type_stat`; +CREATE TABLE `order_type_stat` ( + `DESIGNER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `DATE` varchar(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ORG_ID` bigint(20) NOT NULL, + `ORDER_SUM` int(11) NOT NULL, + `MULTIPLE3_5` int(11) NOT NULL, + `MULTIPLE6_8` int(11) NOT NULL, + `MULTIPLE9_11` int(11) NOT NULL, + `MULTIPLE12` int(11) NOT NULL, + `NORMAL_PROCESSING` int(11) NOT NULL, + `SPECIAL_PROCESSING` int(11) NOT NULL, + `APPLY_ORDER` int(11) NOT NULL, + `AMOUNT100_150` int(11) NOT NULL, + `AMOUNT150_200` int(11) NOT NULL, + `AMOUNT200_250` int(11) NOT NULL, + `AMOUNT250_300` int(11) NOT NULL, + `AMOUNT300_350` int(11) NOT NULL, + `AMOUNT350_400` int(11) NOT NULL, + `AMOUNT400_450` int(11) NOT NULL, + `AMOUNT450_500` int(11) NOT NULL, + `AMOUNT500` int(11) NOT NULL, + PRIMARY KEY (`DESIGNER`, `DATE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单类型统计表 ' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for performance_param +-- ---------------------------- +DROP TABLE IF EXISTS `performance_param`; +CREATE TABLE `performance_param` ( + `VALID_DATE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ORG_ID` bigint(20) NOT NULL, + `PRICE_TYPE` int(11) NOT NULL, + `PRICE_LEVEL_1` bigint(20) NOT NULL, + `PRICE_LEVEL_2` bigint(20) NOT NULL, + `PRICE_LEVEL_3` bigint(20) NOT NULL, + `PRICE_LEVEL_4` bigint(20) NOT NULL, + `PRICE_LEVEL_5` bigint(20) NOT NULL, + `PRICE_LEVEL_6` bigint(20) NOT NULL, + `LEVEL_1_MAX_COUNT` int(11) NOT NULL, + `LEVEL_2_MAX_COUNT` int(11) NOT NULL, + `LEVEL_3_MAX_COUNT` int(11) NOT NULL, + `LEVEL_4_MAX_COUNT` int(11) NOT NULL, + `LEVEL_5_MAX_COUNT` int(11) NOT NULL, + `LEVEL_6_MAX_COUNT` int(11) NOT NULL, + PRIMARY KEY (`VALID_DATE`, `ORG_ID`, `PRICE_TYPE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for performance_parameter +-- ---------------------------- +DROP TABLE IF EXISTS `performance_parameter`; +CREATE TABLE `performance_parameter` ( + `PARAMETER_ID` bigint(20) NOT NULL, + `ORG_ID` bigint(20) NOT NULL, + `ROLE` tinyint(4) NOT NULL, + `AMOUNT_LEVEL_1` bigint(20) NOT NULL, + `AMOUNT_LEVEL_2` bigint(20) NOT NULL, + `AMOUNT_LEVEL_3` bigint(20) NOT NULL, + `AMOUNT_LEVEL_4` bigint(20) NOT NULL, + `AMOUNT_LEVEL_5` bigint(20) NOT NULL, + `AMOUNT_LEVEL_6` bigint(20) NOT NULL, + PRIMARY KEY (`PARAMETER_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for performance_stat +-- ---------------------------- +DROP TABLE IF EXISTS `performance_stat`; +CREATE TABLE `performance_stat` ( + `STAT_ID` bigint(20) NOT NULL, + `DESIGNER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `IS_GROUP_LEADER` tinyint(4) NOT NULL DEFAULT 0, + `STAT_DATE` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `DESIGN_COMPLETE_SUM` decimal(15, 1) NOT NULL, + `DESIGN_AMOUNT` bigint(20) NOT NULL, + `ORDER_TYPE_SUM` int(11) NOT NULL, + `ORDER_TYPE_AMOUNT` bigint(20) NOT NULL, + `REFUND_SUM` int(11) NOT NULL, + `DESIGN_BEGIN_SUM` int(11) NOT NULL, + `REFUND_RATE` bigint(20) NOT NULL, + `REFUND_AMOUNT` bigint(20) NOT NULL, + PRIMARY KEY (`STAT_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for performance_statistics +-- ---------------------------- +DROP TABLE IF EXISTS `performance_statistics`; +CREATE TABLE `performance_statistics` ( + `STAT_DATE` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `DESIGNER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `IS_GROUP_LEADER` tinyint(4) NOT NULL, + `DESIGN_COMPLETE_SUM` decimal(15, 1) NOT NULL, + `DESIGN_AMOUNT` bigint(20) NOT NULL, + `ORDER_TYPE_SUM` int(11) NOT NULL, + `ORDER_TYPE_AMOUNT` bigint(20) NOT NULL, + `REFUND_SUM` int(11) NOT NULL, + `DESIGN_COUNT` int(11) NOT NULL, + `REFUND_RATE` bigint(20) NOT NULL, + `REFUND_AMOUNT` bigint(20) NOT NULL, + `AFTER_LOSS_AMOUNT` bigint(20) NOT NULL, + `AFTER_LOSS_AMOUNT_CANCELED` bigint(20) NOT NULL, + `AFTER_COUNT` int(11) NULL DEFAULT NULL COMMENT '售后单数', + `QC_SCORE` decimal(10, 0) NULL DEFAULT NULL COMMENT '质检分数', + `QC_AMOUNT` bigint(20) NULL DEFAULT NULL COMMENT '质检金额', + PRIMARY KEY (`STAT_DATE`, `DESIGNER`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for product_convert +-- ---------------------------- +DROP TABLE IF EXISTS `product_convert`; +CREATE TABLE `product_convert` ( + `convert_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '产品单价id', + `prd_type_id` bigint(20) NOT NULL COMMENT '产品类型编号', + `prd_size_width` int(11) NOT NULL COMMENT '尺寸范围宽度', + `prd_size_height` int(11) NOT NULL COMMENT '尺寸范围高度', + `prd_page_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '面数名称', + `add_operator` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '添加人', + `add_time` datetime(0) NOT NULL COMMENT '添加时间', + `update_operator` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime(0) NOT NULL COMMENT '更新时间', + `seq` int(11) NOT NULL COMMENT '序号', + `alias` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品别名', + PRIMARY KEY (`convert_id`) USING BTREE, + INDEX `IDX_PRD_TYPE_ID`(`prd_type_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品单价表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for product_convert_copy +-- ---------------------------- +DROP TABLE IF EXISTS `product_convert_copy`; +CREATE TABLE `product_convert_copy` ( + `convert_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '产品单价id', + `prd_type_id` bigint(20) NOT NULL COMMENT '产品类型编号', + `prd_size_width` int(11) NOT NULL COMMENT '尺寸范围宽度', + `prd_size_height` int(11) NOT NULL COMMENT '尺寸范围高度', + `prd_page_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '面数名称', + `add_operator` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '添加人', + `add_time` datetime(0) NOT NULL COMMENT '添加时间', + `update_operator` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime(0) NOT NULL COMMENT '更新时间', + `seq` int(11) NOT NULL COMMENT '序号', + `alias` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品别名', + PRIMARY KEY (`convert_id`) USING BTREE, + INDEX `IDX_PRD_TYPE_ID`(`prd_type_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品单价表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for qc_apply_score +-- ---------------------------- +DROP TABLE IF EXISTS `qc_apply_score`; +CREATE TABLE `qc_apply_score` ( + `APPLY_ID` bigint(20) NOT NULL, + `DESIGNER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ORG_ID` bigint(20) NOT NULL, + `APPLY_REASON` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `APPLY_IMG_PATH` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `APPLY_TIME` datetime(0) NOT NULL, + `SCORE` decimal(10, 1) NOT NULL, + `APPLY_FLAG` int(11) NOT NULL, + `APPLY_BACK_REASON` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `QC_TYPE_ID` bigint(20) NULL DEFAULT NULL COMMENT '加分类型', + `QC_AWARDED_AUDITOR` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '审核人', + `QC_AWARDED_AUDITOR_TIME` datetime(0) NULL DEFAULT NULL COMMENT '审核时间', + PRIMARY KEY (`APPLY_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '质检加分表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for qc_awarded_type +-- ---------------------------- +DROP TABLE IF EXISTS `qc_awarded_type`; +CREATE TABLE `qc_awarded_type` ( + `QC_TYPE_ID` bigint(20) NOT NULL COMMENT '质检加分类型id', + `QC_AWARDED_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '质检加分类型名称', + `QC_SCORE` decimal(10, 1) NULL DEFAULT NULL COMMENT '质检加分对应分数', + PRIMARY KEY (`QC_TYPE_ID`) USING BTREE, + UNIQUE INDEX `idx_QC_AWARDED_NAME`(`QC_AWARDED_NAME`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '质检加分类型表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for qc_parameter +-- ---------------------------- +DROP TABLE IF EXISTS `qc_parameter`; +CREATE TABLE `qc_parameter` ( + `PARAMETER_ID` bigint(20) NOT NULL, + `FLAG` tinyint(4) NOT NULL, + `CONTENT` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SCORE` decimal(15, 1) NULL DEFAULT NULL, + PRIMARY KEY (`PARAMETER_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for qc_performance_param +-- ---------------------------- +DROP TABLE IF EXISTS `qc_performance_param`; +CREATE TABLE `qc_performance_param` ( + `QC_PERFORMANCE_ID` bigint(20) NOT NULL COMMENT '质检绩效参数编号', + `STANDARD_QC_SCORE` bigint(20) NOT NULL COMMENT '标准质检分数', + `REWARD_SCORE` bigint(20) NOT NULL COMMENT '奖励分', + `PUNISH_SCORE` bigint(20) NOT NULL COMMENT '扣罚分', + `REWARD_AMOUNT` bigint(20) NOT NULL COMMENT '奖励金额(单位元)', + `PUNISH_AMOUNT` bigint(20) NOT NULL COMMENT '扣罚金额(单位元)', + `REWARD_AMOUNT_MAX` bigint(20) NOT NULL COMMENT '最大奖励金额(单位元)', + `PUNISH_AMOUNT_MAX` bigint(20) NOT NULL COMMENT '最大扣罚金额(单位元)', + PRIMARY KEY (`QC_PERFORMANCE_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '质检绩效参数' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for qc_record +-- ---------------------------- +DROP TABLE IF EXISTS `qc_record`; +CREATE TABLE `qc_record` ( + `DESIGN_ID` bigint(20) NOT NULL, + `ORG_ID` bigint(20) NOT NULL, + `DESIGNER` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `REASON` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DESCRIPTION` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `SCORE` decimal(15, 1) NULL DEFAULT NULL, + `IMG_PATH` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATOR_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `QC_TIME` datetime(0) NOT NULL, + `QC_FLAG` int(11) NOT NULL, + PRIMARY KEY (`DESIGN_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for questions_atta +-- ---------------------------- +DROP TABLE IF EXISTS `questions_atta`; +CREATE TABLE `questions_atta` ( + `ATTA_ID` bigint(20) NOT NULL, + `QUESTIONS_ID` bigint(20) NOT NULL COMMENT '考试订单id', + `ATTA_MODUL` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '附件标示:CustomFile 客户素材,DesginFile 设计文件,EndFile 印刷文件,ExamVoucher 考试凭证', + `FILE_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件名称', + `FILE_TYPE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件格式', + `SAVE_PATH` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保存路径', + `FILE_URL` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '访问链接', + `FILE_SIZE` bigint(20) NOT NULL COMMENT '大小', + `OPERATOR_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '上传人', + `UPLOAD_TIME` datetime(0) NOT NULL COMMENT '上传时间', + `FILEID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`ATTA_ID`) USING BTREE, + INDEX `IDX_QUESTIONS_ID`(`QUESTIONS_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '考试订单附件表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for refund_parameter +-- ---------------------------- +DROP TABLE IF EXISTS `refund_parameter`; +CREATE TABLE `refund_parameter` ( + `REFUND_PARAMETER_ID` bigint(20) NOT NULL, + `STANDARD_REFUND_RATE_FLOOR` bigint(20) NOT NULL, + `STANDARD_REFUND_RATE` bigint(20) NOT NULL, + `STANDARD_REFUND_RATE_CEIL` bigint(20) NOT NULL, + `REWARD_DOT` bigint(20) NOT NULL, + `PUNISH_DOT` bigint(20) NOT NULL, + `REWARD_AMOUNT` bigint(20) NOT NULL, + `PUNISH_AMOUNT` bigint(20) NOT NULL, + `REWARD_AMOUNT_MAX` bigint(20) NOT NULL, + `PUNISH_AMOUNT_MAX` bigint(20) NOT NULL, + PRIMARY KEY (`REFUND_PARAMETER_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for retention_details +-- ---------------------------- +DROP TABLE IF EXISTS `retention_details`; +CREATE TABLE `retention_details` ( + `DESIGN_ID` bigint(20) NOT NULL COMMENT '订单id', + `IS_RETENT_DEAL` int(11) NULL DEFAULT NULL COMMENT '设计师是否处理过滞留单,0否、1处理过', + `RETENT_DEAL_TIME` datetime(0) NULL DEFAULT NULL COMMENT '滞留单自行处理时间', + `RETENT_DEAL_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '滞留单处理人', + `RETENT_DEAL_WAY` int(11) NULL DEFAULT NULL COMMENT '滞留单处理方式0:寄存、1:退款', + `RETENT_FOLLOW_FLAG` int(11) NULL DEFAULT NULL COMMENT '设计师跟进情况:0:较好、1:一般、2:差', + `RETENT_REMARK` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '滞留单处理备注', + `RETENTION_END_TIME` datetime(0) NULL DEFAULT NULL COMMENT '滞留单处理时间', + PRIMARY KEY (`DESIGN_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '滞留单详情表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for score_designer_lever +-- ---------------------------- +DROP TABLE IF EXISTS `score_designer_lever`; +CREATE TABLE `score_designer_lever` ( + `designer_lever_id` bigint(20) NOT NULL COMMENT '设计师等级id', + `designer_lever` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设计师等级名称', + `min_score` int(11) NOT NULL COMMENT '分数下限', + `max_score` int(11) NOT NULL COMMENT '分数上限', + `state` tinyint(4) NOT NULL COMMENT '状态:0=失效;1=生效;', + `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + `LAST_OPERATOR_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '最后操作人', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `modify_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`designer_lever_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师积分等级配置' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for score_designer_month_record +-- ---------------------------- +DROP TABLE IF EXISTS `score_designer_month_record`; +CREATE TABLE `score_designer_month_record` ( + `record_id` bigint(20) NOT NULL COMMENT '记录id', + `operator_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设计师', + `org_id` bigint(20) NULL DEFAULT NULL COMMENT '设计师所在组织id', + `duty_time` int(11) NOT NULL COMMENT '月份(比如201812)', + `designer_lever_id` bigint(20) NULL DEFAULT NULL COMMENT '当时设计师等级id', + `designer_lever` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当时设计师等级', + `busi_sum` int(11) NULL DEFAULT NULL COMMENT '业务量(定稿总数量)', + `after_order_sum` int(11) NULL DEFAULT NULL COMMENT '售后总数量', + `refund_rate` decimal(10, 2) NULL DEFAULT NULL COMMENT '退款率', + `after_order_rate` decimal(10, 2) NULL DEFAULT NULL COMMENT '退款金额占比', + `qc_score` int(11) NULL DEFAULT NULL COMMENT '质检分', + `out_time_rate` decimal(10, 2) NULL DEFAULT NULL COMMENT '超时占比', + `finish_rate` decimal(10, 2) NULL DEFAULT NULL COMMENT '预约达成率', + `template_sum` int(11) NULL DEFAULT NULL COMMENT '附件分(上传模板数量)', + `score` decimal(10, 2) NULL DEFAULT NULL COMMENT '得分', + `state` tinyint(4) NOT NULL COMMENT '状态:0=失效;1=生效;', + `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `modify_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`record_id`) USING BTREE, + INDEX `OPERATOR_CODE_INDEX`(`operator_code`) USING BTREE, + INDEX `DUTY_TIME_INDEX`(`duty_time`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '评分-设计师当月评分记录' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for score_designer_record +-- ---------------------------- +DROP TABLE IF EXISTS `score_designer_record`; +CREATE TABLE `score_designer_record` ( + `record_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '记录id', + `operator_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设计师', + `org_id` bigint(20) NULL DEFAULT NULL COMMENT '设计师所在组织id', + `state` tinyint(4) NOT NULL COMMENT '状态:0=失效;1=生效;', + `score` int(11) NULL DEFAULT NULL COMMENT '得分', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `last_modify_time` datetime(0) NULL DEFAULT NULL COMMENT '最后更新时间', + `last_modify_score` int(11) NULL DEFAULT NULL COMMENT '最后更新积分', + `last_score_type` bigint(20) NULL DEFAULT NULL COMMENT '最后更新积分细则', + `order_id` bigint(20) NULL DEFAULT NULL COMMENT '涉及设计单', + `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`record_id`) USING BTREE, + INDEX `INDEX_STATE`(`state`) USING BTREE, + INDEX `OPERATOR_CODE_INDEX`(`operator_code`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师虚拟积分账户' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for score_designer_record_detail +-- ---------------------------- +DROP TABLE IF EXISTS `score_designer_record_detail`; +CREATE TABLE `score_designer_record_detail` ( + `record_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '记录id', + `operator_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设计师', + `state` tinyint(4) NOT NULL COMMENT '状态:0=失效;1=生效;', + `score_type` bigint(20) NULL DEFAULT NULL COMMENT '积分细则ID', + `score` int(11) NULL DEFAULT NULL COMMENT '得分', + `order_id` bigint(20) NULL DEFAULT NULL COMMENT '涉及设计单', + `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `create_operator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设计师', + `modify_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`record_id`) USING BTREE, + INDEX `OPERATOR_CODE_INDEX`(`operator_code`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设计师积分账户交易详情' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for score_type +-- ---------------------------- +DROP TABLE IF EXISTS `score_type`; +CREATE TABLE `score_type` ( + `type_id` bigint(20) NOT NULL COMMENT '类型id', + `type_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '细则名称', + `value` int(11) NOT NULL COMMENT '积分值', + `state` tinyint(4) NOT NULL COMMENT '状态:0=失效;1=生效;', + `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + `LAST_OPERATOR_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '最后操作人', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `modify_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`type_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '评分细则' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for self_order +-- ---------------------------- +DROP TABLE IF EXISTS `self_order`; +CREATE TABLE `self_order` ( + `DESIGN_ID` bigint(20) NOT NULL COMMENT '设计订单编号', + `LABEL_IDS` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标签ID', + `CONSUMER_TYPE` int(11) NULL DEFAULT 0 COMMENT '客户类型', + `DEFAULT_LABEL` tinyint(1) NULL DEFAULT 1 COMMENT '是否默认原订单行业标签', + `KF_DRAFT_STANDARD` tinyint(1) NULL DEFAULT 0 COMMENT '是否为客服负责的标准自来稿订单[0-否,1-是]', + `CUSTOMER_QRCODE_URL` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '群服务二维码', + `DESIGNER_REFUND_REASON` bigint(20) NULL DEFAULT NULL COMMENT '退款原因', + `DRAFT_CHECKER` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '初稿审核人', + `DRAFT_BACK_REASON` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '初稿审核退回原因', + `DRAFT_BACK_REASON_PIC_URL` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '初稿审核退回原因截图', + `DRAFT_BACK_TIME` datetime(0) NULL DEFAULT NULL COMMENT '初稿审核退回时间', + `END_CHECKER` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '定稿审核人', + `END_BACK_REASON` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '定稿审核退回原因', + `END_BACK_REASON_PIC_URL` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '定稿审核退回原因截图', + `END_BACK_TIME` datetime(0) NULL DEFAULT NULL COMMENT '定稿审核退回时间', + `URGENT_PRICE` bigint(11) NULL DEFAULT 0 COMMENT '加急费', + `DESIGN_COST` bigint(11) NULL DEFAULT 0 COMMENT '业务端设计费用', + PRIMARY KEY (`DESIGN_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单扩展表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for sms_log +-- ---------------------------- +DROP TABLE IF EXISTS `sms_log`; +CREATE TABLE `sms_log` ( + `LOG_ID` bigint(20) NOT NULL, + `MOBILE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CONTENT` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SEND_TIME` varchar(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SEND_STATUS` int(11) NOT NULL, + `DESIGN_ID` bigint(20) NULL DEFAULT NULL, + `RET_STATUS` int(11) NULL DEFAULT NULL, + `RET_DESC` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`LOG_ID`) USING BTREE, + INDEX `idx_DESIGN_ID`(`DESIGN_ID`) USING BTREE, + INDEX `idx_MOBILE`(`MOBILE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for special_order_type +-- ---------------------------- +DROP TABLE IF EXISTS `special_order_type`; +CREATE TABLE `special_order_type` ( + `SPECIAL_TYPE_ID` bigint(20) NOT NULL, + `SPECIAL_ORDER_DESCRIBE` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SPECIAL_ORDER_TYPE` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SPECIAL_ORDER_AMOUNT` bigint(20) NOT NULL, + PRIMARY KEY (`SPECIAL_TYPE_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for subscribe_designer_quota_record +-- ---------------------------- +DROP TABLE IF EXISTS `subscribe_designer_quota_record`; +CREATE TABLE `subscribe_designer_quota_record` ( + `record_id` bigint(20) NOT NULL COMMENT '预约记录id', + `operator_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设计师', + `designer_lever_id` bigint(20) NULL DEFAULT NULL COMMENT '当时设计师等级id', + `designer_lever` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当时设计师等级', + `min_quota` int(11) NULL DEFAULT NULL COMMENT '当时预约额度下限(作废)', + `max_quota` int(11) NULL DEFAULT NULL COMMENT '当时预约额度上限(仅用于记录)', + `max_drafted` int(11) NULL DEFAULT NULL COMMENT '当时未定稿额度上限(作废)', + `org_id` bigint(20) NOT NULL COMMENT '所属组织id', + `duty_time` int(11) NOT NULL COMMENT '预约日期(格式20190101)', + `duty_id` bigint(20) NULL DEFAULT NULL COMMENT '预约班次', + `duty_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '预约班次名称', + `subscribe_state` tinyint(4) NOT NULL COMMENT '预约状态:1=未预约;2=已预约', + `subscribe_num` int(11) NULL DEFAULT NULL COMMENT '预约数量', + `finished_num` int(11) NULL DEFAULT NULL COMMENT '完成数量', + `finished_old_order_num` int(11) NULL DEFAULT NULL COMMENT '完成的老订单数量', + `state` tinyint(4) NOT NULL COMMENT '状态:0=失效;1=生效;', + `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `modify_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`record_id`) USING BTREE, + INDEX `ORG_ID_INDEX`(`org_id`) USING BTREE, + INDEX `OPERATOR_CODE_INDEX`(`operator_code`) USING BTREE, + INDEX `DUTY_TIME_INDEX`(`duty_time`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '预约-设计师预约记录' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for subscribe_org_temp_quota +-- ---------------------------- +DROP TABLE IF EXISTS `subscribe_org_temp_quota`; +CREATE TABLE `subscribe_org_temp_quota` ( + `org_id` bigint(20) NOT NULL COMMENT '组织id', + `temp_quota` int(11) NOT NULL COMMENT '临时额度', + `safe_line` int(11) NOT NULL COMMENT '安全线(当前未分配订单数超安全线设置时自动使用临时额度)', + `state` tinyint(4) NOT NULL COMMENT '状态:0=失效;1=生效;', + `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `modify_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`org_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '预约-组织临时额度配置' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for sys_field +-- ---------------------------- +DROP TABLE IF EXISTS `sys_field`; +CREATE TABLE `sys_field` ( + `FIELD_CAT` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FIELD_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FIELD_GROUP` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `FIELD_STATUS` tinyint(4) NOT NULL, + `FIELD_SEQ` int(11) NOT NULL, + PRIMARY KEY (`FIELD_CAT`, `FIELD_NAME`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for timeliness_parameter +-- ---------------------------- +DROP TABLE IF EXISTS `timeliness_parameter`; +CREATE TABLE `timeliness_parameter` ( + `TIMELINESS_PARAMETER_ID` bigint(20) NOT NULL COMMENT '时效参数编号', + `PRD_TYPE_ID` bigint(20) NOT NULL COMMENT '产品类型id', + `REWARD_AMOUNT` bigint(20) NOT NULL COMMENT '奖励金额', + PRIMARY KEY (`TIMELINESS_PARAMETER_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '时效参数表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for upll_chunk +-- ---------------------------- +DROP TABLE IF EXISTS `upll_chunk`; +CREATE TABLE `upll_chunk` ( + `FILE_MD5` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CHUNK_SIZE` int(11) NOT NULL, + `CHUNK_NUM` int(11) NOT NULL, + `CHUNK_NO` int(11) NOT NULL, + `CHUNK_TIME` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FILE_NAME` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FILE_EXT` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FILE_PATH` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FILE_ROOT_DIR` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `FILE_UPLOAD_PATH` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`FILE_MD5`, `CHUNK_SIZE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for upll_file +-- ---------------------------- +DROP TABLE IF EXISTS `upll_file`; +CREATE TABLE `upll_file` ( + `FILE_ID` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FILE_MD5` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `FILE_NAME` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FILE_EXT` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FILE_LENGTH` int(11) NOT NULL, + `FILE_PATH` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FILE_URL` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `FILE_TIME` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CONTENT_TYPE` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CONTENT_ENCODING` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `CACHE_CONTROL` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `FILE_ROOT_DIR` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `FILE_UPLOAD_PATH` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`FILE_ID`) USING BTREE, + INDEX `IX_UPLL_FILE_NAME`(`FILE_NAME`(255)) USING BTREE, + INDEX `IX_UPLL_FILE_MD5`(`FILE_MD5`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for user_material +-- ---------------------------- +DROP TABLE IF EXISTS `user_material`; +CREATE TABLE `user_material` ( + `SVG_ID` bigint(20) NOT NULL, + `TYPE_CODE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CAT_CODE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SVG_SEQ` int(11) NOT NULL, + `DESIGNER` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `SVG_CODE` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `KEYWORDS` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`SVG_ID`) USING BTREE, + INDEX `IDX_DESIGNER`(`DESIGNER`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for virtual_account +-- ---------------------------- +DROP TABLE IF EXISTS `virtual_account`; +CREATE TABLE `virtual_account` ( + `operator_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作员名称', + `operator_status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '操作员状态 1,启用 2,停用 (默认为1)', + `usable_money` bigint(16) NOT NULL DEFAULT 0 COMMENT '账户可用余额', + `freeze_money` bigint(16) NOT NULL DEFAULT 0 COMMENT '账户冻结金额', + `sum_money` bigint(20) NOT NULL DEFAULT 0 COMMENT '总金额 (可用余额+冻结余额)', + `remark` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`operator_code`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '虚拟账户表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for virtual_account_20210809 +-- ---------------------------- +DROP TABLE IF EXISTS `virtual_account_20210809`; +CREATE TABLE `virtual_account_20210809` ( + `operator_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作员名称', + `operator_status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '操作员状态 1,启用 2,停用 (默认为1)', + `usable_money` bigint(16) NOT NULL DEFAULT 0 COMMENT '账户可用余额', + `freeze_money` bigint(16) NOT NULL DEFAULT 0 COMMENT '账户冻结金额', + `sum_money` bigint(20) NOT NULL DEFAULT 0 COMMENT '总金额 (可用余额+冻结余额)', + `remark` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`operator_code`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '虚拟账户表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for virtual_account_details +-- ---------------------------- +DROP TABLE IF EXISTS `virtual_account_details`; +CREATE TABLE `virtual_account_details` ( + `account_blotter` bigint(16) NOT NULL COMMENT '账户流水', + `operator_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作员名称', + `transaction_blotter` bigint(20) NOT NULL COMMENT '交易流水', + `transaction_status` tinyint(4) NOT NULL COMMENT '交易类型 0,订单量奖励 1,加急单奖励 2,时效奖励 3,老客户奖励 4,完成订单奖励 5,售后处理 6,订单退回', + `usable_money_add` bigint(8) NOT NULL DEFAULT 0 COMMENT '可用余额增加余额', + `usable_money_down` bigint(8) NOT NULL DEFAULT 0 COMMENT '可用余额减少余额', + `freeze_money_add` bigint(8) NOT NULL DEFAULT 0 COMMENT '冻结余额增加余额', + `freeze_money_down` bigint(8) NOT NULL DEFAULT 0 COMMENT '冻结余额减少余额', + `operator_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '操作时间', + `usable_money` bigint(16) NOT NULL DEFAULT 0 COMMENT '账户可用余额', + `freeze_money` bigint(16) NOT NULL DEFAULT 0 COMMENT '账户冻结金额', + `sum_money` bigint(20) NOT NULL DEFAULT 0 COMMENT '总金额 (可用余额+冻结余额)', + `operator_remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作备注', + PRIMARY KEY (`account_blotter`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '虚拟账户明细表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for virtual_account_type +-- ---------------------------- +DROP TABLE IF EXISTS `virtual_account_type`; +CREATE TABLE `virtual_account_type` ( + `type_id` int(8) NOT NULL COMMENT '交易类型', + `type_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '交易类型名', + `last_operator_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '最后操作员', + `create_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '创建时间', + `modify_time` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间', + PRIMARY KEY (`type_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '虚拟账户类型表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for virtual_transaction_details +-- ---------------------------- +DROP TABLE IF EXISTS `virtual_transaction_details`; +CREATE TABLE `virtual_transaction_details` ( + `operator_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作员', + `transaction_blotter` bigint(20) NOT NULL COMMENT '交易流水', + `design_id` bigint(16) NULL DEFAULT NULL COMMENT '订单号', + `ORDER_TEXT` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品类型', + `END_TIME` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '设计师定稿时间', + `transaction_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '交易时间', + `transaction_status` tinyint(4) NOT NULL COMMENT '交易类型 0,订单量奖励 1,加急单奖励 2,时效奖励 3,老客户奖励 4,完成订单奖励 5,售后处理 6,订单退回', + `order_money` bigint(8) NULL DEFAULT NULL COMMENT '订单金额', + PRIMARY KEY (`transaction_blotter`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '虚拟交易明细表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for virtual_transaction_details_20210809 +-- ---------------------------- +DROP TABLE IF EXISTS `virtual_transaction_details_20210809`; +CREATE TABLE `virtual_transaction_details_20210809` ( + `operator_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作员', + `transaction_blotter` bigint(20) NOT NULL COMMENT '交易流水', + `design_id` bigint(16) NULL DEFAULT NULL COMMENT '订单号', + `ORDER_TEXT` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品类型', + `END_TIME` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '设计师定稿时间', + `transaction_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '交易时间', + `transaction_status` tinyint(4) NOT NULL COMMENT '交易类型 0,订单量奖励 1,加急单奖励 2,时效奖励 3,老客户奖励 4,完成订单奖励 5,售后处理 6,订单退回', + `order_money` bigint(8) NULL DEFAULT NULL COMMENT '订单金额', + PRIMARY KEY (`transaction_blotter`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '虚拟交易明细表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for virtual_transaction_details_20221205 +-- ---------------------------- +DROP TABLE IF EXISTS `virtual_transaction_details_20221205`; +CREATE TABLE `virtual_transaction_details_20221205` ( + `operator_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作员', + `transaction_blotter` bigint(20) NOT NULL COMMENT '交易流水', + `design_id` bigint(16) NULL DEFAULT NULL COMMENT '订单号', + `ORDER_TEXT` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品类型', + `END_TIME` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '设计师定稿时间', + `transaction_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '交易时间', + `transaction_status` tinyint(4) NOT NULL COMMENT '交易类型 0,订单量奖励 1,加急单奖励 2,时效奖励 3,老客户奖励 4,完成订单奖励 5,售后处理 6,订单退回', + `order_money` bigint(8) NULL DEFAULT NULL COMMENT '订单金额', + PRIMARY KEY (`transaction_blotter`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '虚拟交易明细表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yq_article +-- ---------------------------- +DROP TABLE IF EXISTS `yq_article`; +CREATE TABLE `yq_article` ( + `CATEGORY_ID` bigint(20) NOT NULL, + `ARTICLE_ID` bigint(20) NOT NULL, + `ARTICLE_NUMBER` int(11) NOT NULL, + `ARTICLE_TITLE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ARTICLE_STATUS` tinyint(4) NOT NULL, + `ARTICLE_TIME` datetime(0) NOT NULL, + `ARTICLE_CONTENT` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`ARTICLE_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for yq_category +-- ---------------------------- +DROP TABLE IF EXISTS `yq_category`; +CREATE TABLE `yq_category` ( + `PARENT_ID` bigint(20) NOT NULL, + `CATEGORY_ID` bigint(20) NOT NULL, + `CATEGORY_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `CATEGORY_LEVEL` int(11) NOT NULL, + `CATEGORY_STATUS` tinyint(4) NOT NULL, + `CATEGORY_SEQ` int(11) NOT NULL, + PRIMARY KEY (`CATEGORY_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_avatar +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_avatar`; +CREATE TABLE `zmr_avatar` ( + `AVATAR_ID` bigint(20) NOT NULL, + `AVATAR_TYPE` tinyint(4) NOT NULL, + `AVATAR_TIME` bigint(20) NOT NULL, + `AVATAR_50` mediumblob NOT NULL, + `AVATAR_100` mediumblob NOT NULL, + `AVATAR_150` mediumblob NOT NULL, + PRIMARY KEY (`AVATAR_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_dept +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_dept`; +CREATE TABLE `zmr_dept` ( + `PARENT_ID` bigint(20) NOT NULL, + `DEPT_ID` bigint(20) NOT NULL, + `DEPT_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `DEPT_LEVEL` int(11) NOT NULL, + `DEPT_STATUS` tinyint(4) NOT NULL, + `DEPT_SEQ` int(11) NOT NULL, + `DEPT_PARENT_ALL` varchar(850) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `DEPT_MANAGER` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DEPT_SUB_MANAGER` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `DEPT_DESC` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ORG_ID` bigint(20) NULL DEFAULT NULL COMMENT '组织编号', + PRIMARY KEY (`DEPT_ID`) USING BTREE, + INDEX `IX_PARENT_ID`(`PARENT_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_dept_rule +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_dept_rule`; +CREATE TABLE `zmr_dept_rule` ( + `DEPT_ID` bigint(20) NOT NULL, + `MENU_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`DEPT_ID`, `MENU_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_menu +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_menu`; +CREATE TABLE `zmr_menu` ( + `PARENT_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `MENU_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `MENU_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `MENU_NAME_ABBR` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `MENU_LEVEL` tinyint(4) NOT NULL, + `MENU_TYPE` tinyint(4) NOT NULL, + `MENU_STATUS` tinyint(4) NOT NULL, + `MENU_ICON` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `MENU_URL` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `MENU_DESC` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`MENU_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_operator +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_operator`; +CREATE TABLE `zmr_operator` ( + `OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `OPERATOR_PASS` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `OPERATOR_PASS_SALT` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `OPERATOR_STATUS` tinyint(4) NOT NULL, + `OPERATOR_TYPE` tinyint(4) NOT NULL, + `OPERATOR_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATOR_BALANCE` bigint(20) NOT NULL DEFAULT 0, + `OPERATOR_AVATAR` bigint(20) NULL DEFAULT NULL, + `OPERATOR_DEPT` varchar(850) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATOR_DEPT_ALL` varchar(1700) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATOR_ROLE` varchar(850) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATOR_MOBILE` varchar(21) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATOR_EMAIL` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATOR_WXCODE` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '个人微信', + `OPERATOR_SKIN` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATOR_IP` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATOR_URL` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATOR_PARAM` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATOR_CREATED` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `OPERATOR_MODIFIED` char(19) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ORG_ID` bigint(20) NULL DEFAULT NULL COMMENT '组织编号', + `OPERATOR_WANGWANG` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPEN_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `INITIAL_PASSWORD` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '初始密码', + `WKWECHAT_ACCOUNT` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业微信code', + PRIMARY KEY (`OPERATOR_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '操作员账号表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_operator_log +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_operator_log`; +CREATE TABLE `zmr_operator_log` ( + `ORG_ID` bigint(20) NOT NULL, + `OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `OPERATE_TIME` datetime(0) NOT NULL, + `OPERATE_URL` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATE_DESC` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATE_IP` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `OPERATE_FEATURE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + INDEX `IX_ZMR_OPERATOR_LOG_ORG_TIME`(`ORG_ID`, `OPERATE_TIME`) USING BTREE, + INDEX `IDX_OPERATOR_CODE`(`OPERATOR_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_operator_param +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_operator_param`; +CREATE TABLE `zmr_operator_param` ( + `PARAM_KEY` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_DESC` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`PARAM_KEY`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_operator_rule +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_operator_rule`; +CREATE TABLE `zmr_operator_rule` ( + `OPERATOR_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `MENU_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`OPERATOR_CODE`, `MENU_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_org +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_org`; +CREATE TABLE `zmr_org` ( + `ORG_ID` bigint(20) NOT NULL, + `ORG_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ORG_LEVEL` int(11) NOT NULL, + `ORG_STATUS` tinyint(4) NOT NULL, + `ORG_MANAGER` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `ORG_SEQ` int(11) NOT NULL, + `ORG_DESC` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `NEED_COORDINATER` tinyint(4) NULL DEFAULT NULL COMMENT '是否需要协调(0表示不需要,1表示需要)', + `ORG_MANAGER_ARR` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '负责人集合', + PRIMARY KEY (`ORG_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_org_rule +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_org_rule`; +CREATE TABLE `zmr_org_rule` ( + `ORG_ID` bigint(20) NOT NULL, + `MENU_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`ORG_ID`, `MENU_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_param +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_param`; +CREATE TABLE `zmr_param` ( + `PARAM_GROUP` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_KEY` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_SEQ` int(11) NOT NULL, + `PARAM_VALUE` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `PARAM_TYPE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_VALIDATE` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `PARAM_DESC` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`PARAM_GROUP`, `PARAM_KEY`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_param_operator +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_param_operator`; +CREATE TABLE `zmr_param_operator` ( + `PARAM_KEY` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `PARAM_DESC` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`PARAM_KEY`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_role +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_role`; +CREATE TABLE `zmr_role` ( + `ROLE_ID` bigint(20) NOT NULL, + `ROLE_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `ROLE_STATUS` tinyint(4) NOT NULL, + `ROLE_SEQ` int(11) NOT NULL, + `ORG_ID` bigint(20) NULL DEFAULT NULL COMMENT '组织编号', + PRIMARY KEY (`ROLE_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for zmr_role_rule +-- ---------------------------- +DROP TABLE IF EXISTS `zmr_role_rule`; +CREATE TABLE `zmr_role_rule` ( + `ROLE_ID` bigint(20) NOT NULL, + `MENU_CODE` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`ROLE_ID`, `MENU_CODE`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/zhiqim_httpd/.classpath b/zhiqim_httpd/.classpath new file mode 100644 index 0000000..e30fe3b --- /dev/null +++ b/zhiqim_httpd/.classpath @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/zhiqim_httpd/.gitignore b/zhiqim_httpd/.gitignore new file mode 100644 index 0000000..a7ff651 --- /dev/null +++ b/zhiqim_httpd/.gitignore @@ -0,0 +1,6 @@ +/bin +/resource/file +/database/zhiqim.db +/database +/uploadlarge +/logs diff --git a/zhiqim_httpd/.project b/zhiqim_httpd/.project new file mode 100644 index 0000000..7cd21d3 --- /dev/null +++ b/zhiqim_httpd/.project @@ -0,0 +1,17 @@ + + + zhiqim_httpd + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/zhiqim_httpd/.settings/org.eclipse.core.resources.prefs b/zhiqim_httpd/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/zhiqim_httpd/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/zhiqim_httpd/.settings/org.eclipse.jdt.core.prefs b/zhiqim_httpd/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..a7f04bb --- /dev/null +++ b/zhiqim_httpd/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,301 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=1 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=160 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/zhiqim_httpd/.settings/org.eclipse.jdt.ui.prefs b/zhiqim_httpd/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..bbd29a1 --- /dev/null +++ b/zhiqim_httpd/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,9 @@ +eclipse.preferences.version=1 +formatter_profile=_redxyz_formatter +formatter_settings_version=12 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/zhiqim_httpd/LICENSE b/zhiqim_httpd/LICENSE new file mode 100644 index 0000000..5cc63c2 --- /dev/null +++ b/zhiqim_httpd/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. [http://fsf.org/] + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/zhiqim_httpd/README.md b/zhiqim_httpd/README.md new file mode 100644 index 0000000..ddf2856 --- /dev/null +++ b/zhiqim_httpd/README.md @@ -0,0 +1,119 @@ +### 什么是“知启蒙WEB容器”? +--------------------------------------- +      “知启蒙WEB容器(zhiqim_httpd)”是Zhiqim Development Kit面向WEB开发的多例服务,提供更简洁配置、积木式组件模块和天然的模型模板设计,适用于各种大型负载均衡WEB服务群集、中小型组件模板化WEB工程和微型嵌入式HTTP/WEB服务。 + +
            + +### 知启蒙WEB容器的优点 +--------------------------------------- +1、ZhiqimHttpd仅依赖JDK1.7+和ZhiqimKernel、ZhiqimZML。15年自主研发和创新的坚持,值得信赖。
            +2、纯Java的WEB容器,比Tomcat/Jetty更轻量级的HTTP服务器,继承ZhiqimKernel的简洁配置和多例服务的能力。
            +3、抛弃Servlet/JSP规范,基于ZhiqimKernel/ZhiqimZML创新型的WEB容器规范,集成MVC/MVP架构,简单许多框架的学习成本。
            +4、在开发调试阶段,以ZhiqimKernel启动服务,无需依赖Tomcat/Jetty等容器,简化ZhiqimStudio/Eclipse中开发调试配置。
            +5、工程打包发布后,以ZhiqimKernel配置启动,只需配置JRE路径,简化Tomcat/Jetty/Jboss等学习成本和部署成本。
            +6、自主创新的积木式组件模型,提供包括数据库表、页面和功能一起打包的组件开发模式,更彻底的模块化解藕,使得大中型项目积木式搭建、众包协同成为可能。
            +7、适应复杂部署的能力,多端口监听、多服务配置、多虚拟目录配置、负载均衡、群集模式等(Nginx + 知启蒙WEB容器群集 + Redis)各种部署。
            +8、嵌入式WEB开发最佳应用,比JDK自带Http Server功能更完善,比Jetty等WEB容器更轻量简便。支持零配置注解方式和规约配置两种方案
            +9、兼容Servet容器,通过zhiqim_servlet.jar适配到Tomcat/Jboss等容器中一样简单(不损耗知启蒙服务和知启蒙组件的支持),项目迁移影响极小。
            +
            + + +### 知启蒙WEB工程目录结构                                                                                           下载留言本示例 +--------------------------------------- +![知启蒙WEB工程目录结构](https://images.gitee.com/uploads/images/2018/0913/115034_b075df06_2103954.png "知启蒙WEB工程目录结构") +
            + + +### 知启蒙WEB容器简要配置说明 +--------------------------------------- + +``` +1、在[./conf/zhiqim.xml]的[config]项中增加多文件配置key=httpd,value=./conf/httpd.xml
            +2、在[./conf/zhiqim.xml]的[service]项中配置key=httpd,value=org.zhiqim.httpd.HttpServer的HTTP服务
            +3、在[./conf/httpd.xml]文件中配置[httpd]项目中,并包括监听和上下文件环境的配置。
            +``` + +**一、[./conf/zhiqim.xml]配置如下:** + + +``` + + + + + + + +``` + +**二、[./conf/httpd.xml]配置如下:** + + +``` + + + + + + + + + + + + + + + + + + + + + + + + +``` + +
            + +### 知启蒙WEB容器上下文配置 +``` + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +
            + + + +### 知启蒙技术框架与交流 +--------------------------------------- +![知启蒙技术框架架构图](https://images.gitee.com/uploads/images/2018/0907/101431_93f5c39d_2103954.jpeg "知启蒙技术框架架构图.jpg")

            +QQ群:加入QQ交流群,请点击[【458171582】](https://jq.qq.com/?_wv=1027&k=5DWlB3b)

            +教程:欲知更多知启蒙WEB容器,[【请戳这里】](https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd/tutorial/index.htm) diff --git a/zhiqim_httpd/conf/http/httpd.xml b/zhiqim_httpd/conf/http/httpd.xml new file mode 100644 index 0000000..30f2fb7 --- /dev/null +++ b/zhiqim_httpd/conf/http/httpd.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/conf/http_all/httpd.xml b/zhiqim_httpd/conf/http_all/httpd.xml new file mode 100644 index 0000000..0ac50a9 --- /dev/null +++ b/zhiqim_httpd/conf/http_all/httpd.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/conf/http_double/httpd.xml b/zhiqim_httpd/conf/http_double/httpd.xml new file mode 100644 index 0000000..4247420 --- /dev/null +++ b/zhiqim_httpd/conf/http_double/httpd.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/conf/http_multi/httpd.xml b/zhiqim_httpd/conf/http_multi/httpd.xml new file mode 100644 index 0000000..c2251a7 --- /dev/null +++ b/zhiqim_httpd/conf/http_multi/httpd.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/conf/https/httpd.xml b/zhiqim_httpd/conf/https/httpd.xml new file mode 100644 index 0000000..9dee24e --- /dev/null +++ b/zhiqim_httpd/conf/https/httpd.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/conf/https/t2018.zhiqim.com.jks b/zhiqim_httpd/conf/https/t2018.zhiqim.com.jks new file mode 100644 index 0000000..6331c86 Binary files /dev/null and b/zhiqim_httpd/conf/https/t2018.zhiqim.com.jks differ diff --git a/zhiqim_httpd/conf/https_all/httpd.xml b/zhiqim_httpd/conf/https_all/httpd.xml new file mode 100644 index 0000000..9367cc7 --- /dev/null +++ b/zhiqim_httpd/conf/https_all/httpd.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/conf/https_all/keystore.jks b/zhiqim_httpd/conf/https_all/keystore.jks new file mode 100644 index 0000000..9f40be4 Binary files /dev/null and b/zhiqim_httpd/conf/https_all/keystore.jks differ diff --git a/zhiqim_httpd/conf/https_all/truststore.jks b/zhiqim_httpd/conf/https_all/truststore.jks new file mode 100644 index 0000000..5402201 Binary files /dev/null and b/zhiqim_httpd/conf/https_all/truststore.jks differ diff --git a/zhiqim_httpd/conf/https_trust/httpd.xml b/zhiqim_httpd/conf/https_trust/httpd.xml new file mode 100644 index 0000000..353e79b --- /dev/null +++ b/zhiqim_httpd/conf/https_trust/httpd.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/conf/https_trust/keystore.jks b/zhiqim_httpd/conf/https_trust/keystore.jks new file mode 100644 index 0000000..9f40be4 Binary files /dev/null and b/zhiqim_httpd/conf/https_trust/keystore.jks differ diff --git a/zhiqim_httpd/conf/https_trust/truststore.jks b/zhiqim_httpd/conf/https_trust/truststore.jks new file mode 100644 index 0000000..5402201 Binary files /dev/null and b/zhiqim_httpd/conf/https_trust/truststore.jks differ diff --git a/zhiqim_httpd/conf/logging.xml b/zhiqim_httpd/conf/logging.xml new file mode 100644 index 0000000..a92c2a9 --- /dev/null +++ b/zhiqim_httpd/conf/logging.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/conf/zhiqim.ini b/zhiqim_httpd/conf/zhiqim.ini new file mode 100644 index 0000000..70cbbf6 --- /dev/null +++ b/zhiqim_httpd/conf/zhiqim.ini @@ -0,0 +1,12 @@ +[boot] +name=ZhiqimHttpd +version=1.2 +port=50080 + +[config] +logging=./conf/logging.xml +httpd=./conf/httpd.xml + +[service] +logging=com.zhiqim.kernel.logging.LogServer +httpd=org.zhiqim.httpd.HttpServer diff --git a/zhiqim_httpd/conf/zhiqim.xml b/zhiqim_httpd/conf/zhiqim.xml new file mode 100644 index 0000000..76a44d4 --- /dev/null +++ b/zhiqim_httpd/conf/zhiqim.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/document/export/V1.5.0.exp.xml b/zhiqim_httpd/document/export/V1.5.0.exp.xml new file mode 100644 index 0000000..bbaeacc --- /dev/null +++ b/zhiqim_httpd/document/export/V1.5.0.exp.xml @@ -0,0 +1,15 @@ + +
            +
            + + + + + + + + + + +
            +
            diff --git a/zhiqim_httpd/document/metainfo/MANIFEST.MF b/zhiqim_httpd/document/metainfo/MANIFEST.MF new file mode 100644 index 0000000..d7f585f --- /dev/null +++ b/zhiqim_httpd/document/metainfo/MANIFEST.MF @@ -0,0 +1,29 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: ZhiqimHttpd +Bundle-SymbolicName: zhiqim_httpd +Bundle-Version: 1.5.0 +Export-Package: org.zhiqim.httpd, + org.zhiqim.httpd.aio, + org.zhiqim.httpd.bio, + org.zhiqim.httpd.constants, + org.zhiqim.httpd.context, + org.zhiqim.httpd.context.annotation, + org.zhiqim.httpd.context.config, + org.zhiqim.httpd.context.core, + org.zhiqim.httpd.context.extend, + org.zhiqim.httpd.context.returns, + org.zhiqim.httpd.context.rule, + org.zhiqim.httpd.context.service, + org.zhiqim.httpd.context.util, + org.zhiqim.httpd.entities, + org.zhiqim.httpd.nio, + org.zhiqim.httpd.resources, + org.zhiqim.httpd.sessioner, + org.zhiqim.httpd.util, + org.zhiqim.httpd.validate, + org.zhiqim.httpd.validate.ones, + org.zhiqim.httpd.validate.onex, + org.zhiqim.httpd.validate.two +Require-Bundle: zhiqim,zhiqim_ml +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/zhiqim_httpd/document/metainfo/version.txt b/zhiqim_httpd/document/metainfo/version.txt new file mode 100644 index 0000000..73c387b --- /dev/null +++ b/zhiqim_httpd/document/metainfo/version.txt @@ -0,0 +1,185 @@ +V1.0.1.R2014022701 + 1)版本创建、整理 + 2)版本内部发布测试 + 3)内部测试完成,发布 +V1.0.4.R2014060901 + 1)fadfox.jar调整了Stringx类路径,有影响,要求版本在V1.0.4R2014060901以上 + 2)增加HttpSessionUser两个字段created和accessed +V1.0.5.R2014071601 + 1)fadfox.jar增加JSON功能和HTTPC功能,涉及到HTTPD要求调整 + 2)增加foxpaper功能,对页面信息进行解析 + 3)修改文件上传实现类HttpUpload为HttpUploader,以防止和httpclient中HttpUpload同名,不好理解 +V1.0.6.R2014081901 + 1)增加fadtemplate模块 + 2)调整StringBuffer成StringBuilder + 3)增加AjaxClass中响应的一种新模式,支持{"responseStatus":0,"responseText":"成功"}格式 + 4)修改ErrorMsg和SuccessMsg不支持http://跳转问题 + 5)修改_Var增加变量顺序为,如果没有局部作用域,放置到page作用域,如果有局部作用域,查询局部作用域列表有定义则赋值,否则则最内层局部作用域赋值 +V1.0.6.R2015011201 + 1)fadfox.jar调整DateTimes类方法,有影响,要求版本在V1.0.6R2015011201以上; + 2)调整模板输出不支持空行 + 3)支持默认flex读起跨域文件crossdomain.xml为none + 4)去除模板中Hmtlx,Stringx,Listx,Validatex的调用,因为Htmls,Strings,Lists,Validates已继承这几个类 +V1.0.6.R2015031401 + 1)对context.xml的action的return参数改为redirect,重新定义return表示是否转向=true表示不处理template和redirect + 2)对ActionForward和FoxHandler作了一下调整,增加强制处理错误和成功信息的判断 +V1.0.7.R2015040901 + 1)计划增加fadfox.js,统一版本到1.0.7 + 2)支持ajax,window,tooltips,drag,input等 +v1.0.7.R2015042101 + 1)修改AjaxClass中原来"未知错误"的BUG + 2)修改AjaxClass支持先判断class是不是Action,如果是直接取Action的单例 + 3)发布fadfox_1.0.3R2015042101.js和对应的fadfox_ajax.js,fadfox_calendar.js,fadfox_dialog.js,fadfox_tooltip.js,fadfox_input.js等 + 4)删除原来的successMsg.fox和errorMsg.fox的定义,直接在FoxHandler中处理 + 5)Styles.bodyOverflowHidden改为Styles.htmlOverflowHidden,增加Styles.htmlOverflowScroll表示overflow-y:scroll +V1.0.7.R2015052001 + 1)修改AjaxClass支持对Interceptor中设置redirect,在fadfox_ajax.js中重定向 + 2)增加request.setAttributeAjaxResult中responseStatus不支持小于0和不支持100-699之间 +V1.0.7.R2015052501 + 1)支持多个配置*context.xml文件和多个宏*macro.ftl文件 + 2)FVariable支持instance=new/global,global表示读取Global中的实例,这样可以保证单例 +V1.0.7.R2015060101 + 1)修改HttpSessionUser原为interface,改为class +V1.0.8R2015060901 + 1)整理成V1.0.8 + 2)增加组件的支持 + 3)修改context.xml和格式,支持配置组件、宏定义和多个context.xml文件 + 4)修改HttpAccessLog中目录创建,改成递归创建 +V1.0.8.R2015061701 + 1)修改Scripts.isNumericLen()方法中的BUG + 2)在HttpSessionUser上增加参数列表,通过getValues,getValue,setValue,removeValue,hasValue进行管理 +V1.1.0.R2015072901 + 1)修改cookie设置的BUG + 2)调整server,listner,支持虚拟主机的配置 + 3)拆离template出来,成立新的项目fadfox_template.jar + 4)修改原*.fox为/service/*目录,方便nginx等对路径进行转化 +V1.1.0.R2015082501 + 1)增加HttpResponse中的addCookie方法 + 2)增加@RmiAnnotation,对RMIService和AjaxService进行改造 + 3)根据fadfox.jar整理成该版本 +V1.1.1.R2015091401 + 1)使用JDK1.7编译 + 2)增加在RMI/AJAX时,先使用@ClassShortName检查是不是类简称 +V1.1.2.R2015093001 + 1)要求使用V1.1.2版本的fadfox.jar + 2)删除Variable,Rule的配置,暂时没有删dtd的说明 + 3)修改for调用方式,合并Documents到Xmlx中,删除dtd的说明,改为v1.1.0,增加forward +V1.1.3.R2015112501 + 1)整理版本,用于生产系统 + 2)根据FTimer改动修改的版本 + 3)修改fadfox_drag.js +V1.1.3.R2016010701版本: + 1)修改查找Action顺序的BUG,改为按getContextListAll()进行查找 + 2)修改fadfox_dialog.js中F.prompt方法中$input获取路径错误的BUG + 3)修改fadfox.js中Draggable中callback未传值时回调的BUG + 4)优化fadfox_drag.js + 5)修改fadfox.css中radio在IE浏览器中高度和背景为白色的BUG + 6)修改IE11,两次请求user_agent不同导致session无法保存问题 +V1.1.4.R2016020301 + 1)春节前整理版本号 + 2)修改fadfox_clipboard.js支持增加offsetLeft,offsetTop,offsetWidth,offsetHeight,background等属性 + 3)修改fadfox.js对offsetLeftAbs,offsetTopAbs修改支持IE和chrome加边框 +V1.1.5.R2016050301 + 1)把资源部分拆出到fadfox_res.jar中,方便和fadfox_servlet.jar共享 +V1.2.0.R2016072101版本: + 1)调整包名com.zhiqim.fadfox.fadhttpd为com.zhiqim.fadfox.httpd,原来的fadhttp不好理解,现在正式使用httpd作为该产品的名称 + 2)调整包名com.zhiqim.fadfox.foxcontext为com.zhiqim.fadfox.httpd.context,表示context是httpd的一部分,原来分为两部分不好理解 + 3)增加HttpConnection, HttpContext, HttpRequest,HttpResponse修改成接口 + 4)调整原实现HttpConnection, HttpContext, HttpRequest,HttpResponse到bio包内,修改为HttpBioConnection等,为后续增加aio作准备 + 5)增加HttpHeader、HttpSender和HttpBioHeader、HttpBioSender,用于静态文件时无需创建复制的HttpRequest和HttpResponse的session,cookie,parameter等 + 6)调整包com.zhiqim.fadfox.http.context.validate到fadfox.jar中,并删除Validate类中的HttpRequest关联 + 7)删除ActionForward文件,修改Action类的execute方法只有HttpRequest一个参数,ActionForward的功能并入到HttpRequest。HttpResponse不大常用,如果需要用,可以从request.getResponse获取。 + 8)修改原FoxContext等命名为FtmlContext,统一使用Ftml命名,表示该上下文环境是FTML的上下文环境,原HttpContext改为StaticContext表示静态文件上下文环境 + 9)增加Context的接口,为fadfox_httpd_servlet.jar作适配用,如果需要把工程放置到Tomcat等容器下,只需增加fadfox_httpd_servlet.jar即可 + 10)增加@AnAction的支持,在Action类上,或SwitchAction的子类的方法上定义@AnAction,设置好actionPackage属性即可作到无需context.xml实现零配置,当然规约上还是要求context.xml的 + 11)修改原@RmiInterceptor为@AnInterceptor,@RmiNotFilter为@AnFilterNot等。支持配置在类和方法上,当类上有时,方法上可以不需要定义,如果方法不需支持类的,则加上@AnInterceptorNot作为例外设置 +V1.2.1.R2016100801 + 1)删除ActionExecutor和ViewExecutor,合并到FtmlExecutor + 2)修改原定义的viewExt配置为patternUrl,默认值修改为*.ftml,*.ftm,*.htm + 3)修改验证码/service/vcode.jpg的展示,调整验证码sessionName原为vcode,修改为_vode_ + 4)增加action中配置include字段,用于嵌套模板 +V1.2.2.R2017010101 + 1)配合fadfox.jar调整HashMap为FHashMapSO + 3)增加只提供RMI服务时无需配置resourceType,resourcePath + 4)全面调整配置文件中配置项的规范,包括修改serverName为listen.domain,并支持多个 + 5)全面优化配置文件中加载顺序和管理,新增类FtmlConfig + 6)优化Attribute读取顺序,优先顶级配置,再次根context.ftml配置,再次根context.xml,再次组件context.xml + 7)优化Action读取顺序,优先根context.xml配置,再次根actionPackaget,再倒序循环组件 + 8)控制断点续传后的文件访问时最大不超时8M + 9)删除AnStatic的支持 + 10)修改sendRedirect时也写入sessionId到cookie +V1.3.0.R2017022701 + 1)调整验证码功能,默认高度和f-input相等28px + 2)增加request.setValidateConfirm和request.setValidateGray设置验证确认信息和是否提交变灰 + 3)修改request中验证,默认非firefox变回不需要回退,firefox需要F && F.onload时才支持变灰 + 4)修改AnInterceptor,AnInterceptorNot为AnIntercept,AnInterceptNot,预留AnInterceptor用于拦截器定义 + 5)修改Session.getSessionValidateCode为Session.getSessionVerificationCode,单词VerificationCode更准确 + 6)删除validateScript的变量支持,请使用request.getValidateScript()方法 + 7)删除request.setAttributeNoHtmlFilter方法,修改request.setAttribute为不作过滤,过滤任务在模板中使用#{} + 8)修改响应头reason增加Urls.encodeUTF8(reason) + 9)增加/service/rmi和/service/ajax对表单方式的提交处理 + 10)迁移/service/upload(原大文件断点续传)和FadfoxUploader组件中,并修改为/service/uploadlarge,同时调整修改原/service/uploadone为/service/upload + 11)修改SwitchAction,从V1.2.0开始三参数变一参数时的BUG +V1.3.1.R2017052801 + 1)修改Asserts.asserts为Asserts.as()方法,使用三目运算断言,防止断言为真时需要初始化无意义的断言失败字符串 + 2)修改HttpRequest方法getSessionUser(Class),增加约束 +V1.3.2.R2017080501 + 1)增加Chunked支持,配置最大2M/最小4K,采用chunked时暂不支持gzip + 2)修改大文件下载时浏览器停止、关闭导致SocketException时,错误日志没必要打印,影响业务定位问题 + 3)修改RmiService针对form表单提交不作字段检查密码#号AJAX使用form表单时不能修改BUG + 4)修改context.ftml中的变量定义支持完整表达式,原来只支持原型表达式和变量表达式 + 5)修改returnCloseDiaolog时,配置fadfox_res.jar作立即关闭,防止闪屏 + 6)增加f-call-iframe的支持,通过iframe提交表单和访问URL,保障有出错信息时,本页面不变化。 + 7)配合20170927的fadfox.jar版本,支持(F || window).alert + 8)修改f-call-iframe中form参数frameTarget为fCallFrame=true,formIndex为fFormIndex + 9)增加对话框中的请求识别,参数为fDialogFrame=true + 10)增加request.setContentTypeNoCharset方法,表明contentType只支持mimeType,不需要charset +V1.3.3.R2017110601 + 1)增加/service/rmi的处理中内置对象(context、session、sessionUser、log)的处理 + 2)修改UploadService中文件上传时指定目录的BUG + 3)增加对Action方法上AnTransaction的检查 + 4)修改request.addParam(String, String)为request.addParam(String, Object) +V1.4.0.R2018010101 + 1)正式启用ZhiqimHttpd名称,原所有Fadfox改为Zhiqim,原所有fadfox改为zhiqim,原所有FADFOX改为ZHIQIM,原com.zhiqim.fadfox改为org.zhiqim.kernel + 2)转移Scripts,Scriptx,Styles到org.zhiqim.httpd.util + 3)转移org.zhiqim.kernel.validate到org.zhiqim.httpd.validate + 4)优化returnFrame页面,这里不需要zhiqim.js的支持,取parent.Z + 5)转移bootstrap的处理,由原来在httpd.xml中配置,修改为在context.xml中配置,当前如果未配置取最后一个组件的bootstrap + 6)转移websocket的处理,由原来在httpd.xml中配置,修改为在context.xml中配置,组件内websocket配置独立,通过@AnAlias(protocol)对应websocket类 + 7)增加对/zres/*的处理,表示组件内的资源文件,优先于context.xml的处理 + 8)增加对HTTP上下文中的contextXml的配置 + 9)增加上传时HttpUploader回传参数到cntParamMap中 + 10)增加Scripts.doReloadParent等方法 + 11)增加对成功和失败的消息判断 + 12)整理对ZhiqimML的支持,统一使用ZML代替Template的定义 + 13)增加getAttribute时,当为_Var支持ZmlVarRuntime运行时读数据 + 14)修改一个监听对应的所有HttpServer都关闭的时候,没有关闭监听的BUG + 15)Class.forName修改成Classes.forName,防止ClassLoader不准确 + 16)修改zhiqim_context.xml组件配置resourcePath为path,删除actionPackage,改在context.xml配置属性,类似于bootstrap和websocket的配置 + 17)修改为只有根context才加载组件,组件不检查依赖组件 + 18)修改HttpSender对非chunked时重设contentlength,FileResourceEntity,ClassResourceEntity设置contentlength + 19)增加request.isMicroMessager()判断是否是微信中的浏览器 + 20)增加request.isMobile()对MicroMessager的判断,如果有,也认为是mobile + 21)增加request.getZhiqimClientType()和setAttribute("zhiqimClientType", "www":"mobile")方法 + 22)修改ZmlContext中initContext方法中,config.create失败的情况下,退出程序 + 23)增加HttpSessionManager中public List getSessionUserList(Class clazz);public PageResult getSessionUserPage(int pageNo, int pageSize, Class clazz);方法 + 24)增加对isMobile时zhiqim.mobile.css/js的检查,修改action加载时出错未退出工程的BUG + 25)修改if (F && Z.onload)的判断未改到的F的BUG +V1.4.1.R2018052801 + 1)增加静态文件过期时长配置expire + 2)增加cookie.domain/cookie.port/cookie.path的配置,以支持虚拟目录/子域名使用相同的COOKIE + 3)修改配置命名useCookie修改为cookie.use,matchType修改为pathExactPrior,sessionManager/sessionIdName/sessionTimeout/sessionParameter修改为session.manager/session.idName/session.timeout/session.parameter +V1.5.0.R2019010101 + 1)修改工程名为zhiqim_httpd,采用zhiqim_kernel_v1.5.0_r2019010101库 + 2)修改默认配置文件名为/conf/config.xml和/conf/config.zml + 3)增加配置文件中sessionUser列表,和action中增加tips,sessionUser项,修改alert为success + 4)增加request.getParameterMatch(index)对应的方法 + 5)删除AIO的处理方式,整理BIO/NIO公共方法到抽象类中,默认BIO,使用Nginx作代理时,建议配置成BIO,因为Nginx默认采用HTTP/1.0协议 + 6)全面优化websocket在BIO/NIO三种IO下的处理方式 + 7)修改request.getSessionUser()当session中只有一个sessionUser时返回该值,多个时返回null + 8)修改action,允许不指定sessionUser,默认取只有一个sessionUser的情况,多个时抛异常 + 9)增加加载config.xml时异常抛出异常和文件路径 + 10)整理HttpRequest/HttpResponse公开的方法,修改BIO合并NIO时的未关闭连接的BUG + 11)修复HttpWebsocketMessage/HttpWebsocketMessageAsync中的对mask=false的BUG和length可能为0时isClose无内部的BUG + 12)修改为Threadx处理方式,修改Tasker的继承为实现Task,定时任务Timer/Every改为Interval等 + 13)执行程序和源码分开打包 \ No newline at end of file diff --git a/zhiqim_httpd/document/设计原理.txt b/zhiqim_httpd/document/设计原理.txt new file mode 100644 index 0000000..ee85c37 --- /dev/null +++ b/zhiqim_httpd/document/设计原理.txt @@ -0,0 +1 @@ +1. \ No newline at end of file diff --git a/zhiqim_httpd/lib/zhiqim.jar b/zhiqim_httpd/lib/zhiqim.jar new file mode 100644 index 0000000..5c710ad Binary files /dev/null and b/zhiqim_httpd/lib/zhiqim.jar differ diff --git a/zhiqim_httpd/lib/zhiqim_zml.jar b/zhiqim_httpd/lib/zhiqim_zml.jar new file mode 100644 index 0000000..0e2aa82 Binary files /dev/null and b/zhiqim_httpd/lib/zhiqim_zml.jar differ diff --git a/zhiqim_httpd/libext/zhiqim_manager.jar b/zhiqim_httpd/libext/zhiqim_manager.jar new file mode 100644 index 0000000..7917115 Binary files /dev/null and b/zhiqim_httpd/libext/zhiqim_manager.jar differ diff --git a/zhiqim_httpd/libext/zhiqim_orm.jar b/zhiqim_httpd/libext/zhiqim_orm.jar new file mode 100644 index 0000000..2e4dcef Binary files /dev/null and b/zhiqim_httpd/libext/zhiqim_orm.jar differ diff --git a/zhiqim_httpd/libext/zhiqim_sqlite3.8.6_native.jar b/zhiqim_httpd/libext/zhiqim_sqlite3.8.6_native.jar new file mode 100644 index 0000000..fe91f24 Binary files /dev/null and b/zhiqim_httpd/libext/zhiqim_sqlite3.8.6_native.jar differ diff --git a/zhiqim_httpd/libext/zhiqim_ui.jar b/zhiqim_httpd/libext/zhiqim_ui.jar new file mode 100644 index 0000000..304a00d Binary files /dev/null and b/zhiqim_httpd/libext/zhiqim_ui.jar differ diff --git a/zhiqim_httpd/libext/zhiqim_upload_large.jar b/zhiqim_httpd/libext/zhiqim_upload_large.jar new file mode 100644 index 0000000..53b6123 Binary files /dev/null and b/zhiqim_httpd/libext/zhiqim_upload_large.jar differ diff --git a/zhiqim_httpd/libsrc/zhiqim-src.jar b/zhiqim_httpd/libsrc/zhiqim-src.jar new file mode 100644 index 0000000..08461ed Binary files /dev/null and b/zhiqim_httpd/libsrc/zhiqim-src.jar differ diff --git a/zhiqim_httpd/libsrc/zhiqim_zml-src.jar b/zhiqim_httpd/libsrc/zhiqim_zml-src.jar new file mode 100644 index 0000000..bf03d29 Binary files /dev/null and b/zhiqim_httpd/libsrc/zhiqim_zml-src.jar differ diff --git a/zhiqim_httpd/manage/conf/config.xml b/zhiqim_httpd/manage/conf/config.xml new file mode 100644 index 0000000..59bb62f --- /dev/null +++ b/zhiqim_httpd/manage/conf/config.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/manage/conf/config.zml b/zhiqim_httpd/manage/conf/config.zml new file mode 100644 index 0000000..4e5b648 --- /dev/null +++ b/zhiqim_httpd/manage/conf/config.zml @@ -0,0 +1,3 @@ +<#--变量定义--> +<#var abc="context.zmlfff22333"/> +<#var abcd="context.zml"/> \ No newline at end of file diff --git a/zhiqim_httpd/manage/index.htm b/zhiqim_httpd/manage/index.htm new file mode 100644 index 0000000..c1e8ab0 --- /dev/null +++ b/zhiqim_httpd/manage/index.htm @@ -0,0 +1,18 @@ + + + +${context.getContextName()} + + + + + + + + + +${abc} + + \ No newline at end of file diff --git a/zhiqim_httpd/manage/zview/abc.zml b/zhiqim_httpd/manage/zview/abc.zml new file mode 100644 index 0000000..a8a081b --- /dev/null +++ b/zhiqim_httpd/manage/zview/abc.zml @@ -0,0 +1 @@ +hi,abc \ No newline at end of file diff --git a/zhiqim_httpd/resource/abc.htm b/zhiqim_httpd/resource/abc.htm new file mode 100644 index 0000000..eba5cfd --- /dev/null +++ b/zhiqim_httpd/resource/abc.htm @@ -0,0 +1,39 @@ + + + +${context.getContextName()} + + + + + + + + + +ddffdds在在在 +${abc} + + \ No newline at end of file diff --git a/zhiqim_httpd/resource/conf/config.xml b/zhiqim_httpd/resource/conf/config.xml new file mode 100644 index 0000000..1953efc --- /dev/null +++ b/zhiqim_httpd/resource/conf/config.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/resource/conf/config.zml b/zhiqim_httpd/resource/conf/config.zml new file mode 100644 index 0000000..bd9227d --- /dev/null +++ b/zhiqim_httpd/resource/conf/config.zml @@ -0,0 +1,64 @@ +<#--左边区域自定义块--> +<#function zhiqim_manager_topnav_left_defined()> +${zhiqim_announcement_onload()} + + +<#--公告加载--> +<#function zhiqim_announcement_onload()> + + diff --git a/zhiqim_httpd/resource/conf/zmr.menu.sql b/zhiqim_httpd/resource/conf/zmr.menu.sql new file mode 100644 index 0000000..67bbfae --- /dev/null +++ b/zhiqim_httpd/resource/conf/zmr.menu.sql @@ -0,0 +1,57 @@ +-- --------------------------------------------------- +-- 知启蒙大文件上传功能菜单 +-- --------------------------------------------------- + + +truncate table ZMR_MENU; +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('ROOT', 'MENU', '系统功能根菜单', '', 0, 0, 0, '', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU', 'MENU_010', '系统配置', '系统', 1, 0, 1, 'z-config', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_010', '系统基础设置', '', 2, 0, 1, 'z-setting', '/${zhiqim_manager}/menu.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_010', '增加系统菜单', '', 3, 0, 2, '', '/${zhiqim_manager}/menuAdd.htm,/${zhiqim_manager}/menuInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_020', '修改系统菜单', '', 3, 0, 2, '', '/${zhiqim_manager}/menuModify.htm,/${zhiqim_manager}/menuUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_030', '删除系统菜单', '', 3, 0, 2, '', '/${zhiqim_manager}/menuDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_100', '系统头像管理', '', 3, 0, 2, '', '/${zhiqim_manager}/avatar.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_110', '增加系统头像', '', 3, 0, 2, '', '/${zhiqim_manager}/avatarAdd.htm,/${zhiqim_manager}/avatarInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_120', '修改系统头像', '', 3, 0, 2, '', '/${zhiqim_manager}/avatarModify.htm,/${zhiqim_manager}/avatarUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_130', '删除系统头像', '', 3, 0, 2, '', '/${zhiqim_manager}/avatarDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_200', '系统配置管理', '', 3, 0, 2, '', '/${zhiqim_manager}/config.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_300', '系统参数设置', '', 3, 0, 2, '', '/${zhiqim_manager}/param.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_310', '首页主题设置', '', 3, 0, 2, '', '/${zhiqim_manager}/themeIndex.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_320', '主页主题设置', '', 3, 0, 2, '', '/${zhiqim_manager}/themeMain.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_050', '部门角色管理', '', 2, 0, 1, 'z-apps', '/${zhiqim_manager}/dept.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_010', '增加部门', '', 3, 0, 2, '', '/${zhiqim_manager}/deptAdd.htm,/${zhiqim_manager}/deptInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_020', '修改部门', '', 3, 0, 2, '', '/${zhiqim_manager}/deptModify.htm,/${zhiqim_manager}/deptUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_030', '删除部门', '', 3, 0, 2, '', '/${zhiqim_manager}/deptDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_040', '部门成员', '', 3, 0, 2, '', '/${zhiqim_manager}/deptOperator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_050', '部门权限', '', 3, 0, 2, '', '/${zhiqim_manager}/deptRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_100', '角色管理', '', 3, 0, 2, '', '/${zhiqim_manager}/role.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_110', '增加角色', '', 3, 0, 2, '', '/${zhiqim_manager}/roleAdd.htm,/${zhiqim_manager}/roleInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_120', '修改角色', '', 3, 0, 2, '', '/${zhiqim_manager}/roleModify.htm,/${zhiqim_manager}/roleUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_130', '删除角色', '', 3, 0, 2, '', '/${zhiqim_manager}/roleDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_140', '角色成员', '', 3, 0, 2, '', '/${zhiqim_manager}/roleOperator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_150', '角色权限', '', 3, 0, 2, '', '/${zhiqim_manager}/roleRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_110', '操作员管理', '', 2, 0, 1, 'z-customer', '/${zhiqim_manager}/operator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_010', '增加操作员', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorAdd.htm,/${zhiqim_manager}/operatorInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_020', '修改操作员', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorModify.htm,/${zhiqim_manager}/operatorUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_030', '删除操作员', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_040', '查看操作员权限', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorRuleView.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_050', '设置操作员独立权限 ', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_060', '设置操作员部门', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorDept.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_070', '设置操作员角色', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorRole.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_150', '操作日志查询', '', 2, 0, 1, 'z-text', '/${zhiqim_manager}/operateLog.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_150', 'MENU_010_150_100', '操作员在线列表', '', 3, 0, 1, '', '/${zhiqim_manager}/operatorOnline.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_220', '文件上传管理', '', 2, 0, 1, 'z-folder', '/zhiqim_upload_large/fileList.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_220', 'MENU_010_210_010', '文件上传', '', 3, 0, 2, '', '/zhiqim_upload_large/fileUpload.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_220', 'MENU_010_210_020', '文件修改', '', 3, 0, 2, '', '/zhiqim_upload_large/fileModify.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_220', 'MENU_010_210_030', '文件删除', '', 3, 0, 2, '', '/zhiqim_upload_large/fileDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_220', 'MENU_010_210_040', '文件碎片查看', '', 3, 0, 2, '', '/zhiqim_upload_large/fileChunkList.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_220', 'MENU_010_210_050', '文件碎片删除', '', 3, 0, 2, '', '/zhiqim_upload_large/fileChunkDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU', 'MENU_020', '办公自动化', '办公', 1, 0, 1, 'z-box', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020', 'MENU_020_010', '公告信息管理', '', 2, 0, 1, 'z-setting', '/${zhiqim_announcement}/announcement.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020_010', 'MENU_020_010_010', '增加删除公告', '', 3, 0, 2, '', '/${zhiqim_announcement}/announcementAdd.htm,/${zhiqim_announcement}/announcementInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020_010', 'MENU_020_010_020', '删除回收站公告', '', 3, 0, 2, '', '/${zhiqim_announcement}/announcementRecyleDelete.htm', ''); +commit; + +-- --------------------------------------------------- +-- 知启蒙大文件上传功能菜单创建完成 +-- --------------------------------------------------- diff --git a/zhiqim_httpd/resource/index.abc b/zhiqim_httpd/resource/index.abc new file mode 100644 index 0000000..6ffeb59 --- /dev/null +++ b/zhiqim_httpd/resource/index.abc @@ -0,0 +1 @@ +hi.abc,哈哈 \ No newline at end of file diff --git a/zhiqim_httpd/resource/index.htm b/zhiqim_httpd/resource/index.htm new file mode 100644 index 0000000..67ed400 --- /dev/null +++ b/zhiqim_httpd/resource/index.htm @@ -0,0 +1,19 @@ + + + +${context.getContextName()} + + + + + + + + +index.htm +

            +ws.htm + +下载 + + \ No newline at end of file diff --git a/zhiqim_httpd/resource/index.jsp b/zhiqim_httpd/resource/index.jsp new file mode 100644 index 0000000..d53a010 --- /dev/null +++ b/zhiqim_httpd/resource/index.jsp @@ -0,0 +1 @@ +hi.jsp \ No newline at end of file diff --git a/zhiqim_httpd/resource/index.zml b/zhiqim_httpd/resource/index.zml new file mode 100644 index 0000000..6ad2a07 --- /dev/null +++ b/zhiqim_httpd/resource/index.zml @@ -0,0 +1,18 @@ + + + +${context.getContextName()} + + + + + + + + + +hi,ftm,我来了 + + \ No newline at end of file diff --git a/zhiqim_httpd/resource/ws.htm b/zhiqim_httpd/resource/ws.htm new file mode 100644 index 0000000..dc666c7 --- /dev/null +++ b/zhiqim_httpd/resource/ws.htm @@ -0,0 +1,39 @@ + + + +${context.getContextName()} + + + + + +${Scripts.src("/zinc/zhiqim_v1.4.0.r2018010101.min.js")} + + + + +index.htm +

            +abc.htm + +下载 + + \ No newline at end of file diff --git a/zhiqim_httpd/resource/zview/zhiqim_announcement/announcement.zml b/zhiqim_httpd/resource/zview/zhiqim_announcement/announcement.zml new file mode 100644 index 0000000..0df5e9b --- /dev/null +++ b/zhiqim_httpd/resource/zview/zhiqim_announcement/announcement.zml @@ -0,0 +1,63 @@ + + +${zhiqim_manager_breadcrumb("公告信息")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + +${zhiqim_manager_tr_no_record(result, 6, "没有公告信息")} +<#for item : result.list()> + + + + + + + + + +
            公告类型公告标题发布人发布时间已读/未读操作
            <#if item.getAnnouncementType()==1>行政公告<#if item.getAnnouncementType()==2>假日公告<#if item.getAnnouncementType()==3>会议公告${item.getAnnouncementTitle()}${item.getAnnouncementPublisher()}${Sqls.toDateTimeString(item.getAnnouncementTime())}<#if item.getOperatorCode() == null>未读<#else>已读 + + +
            +${zhiqim_manager_paging (result)} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_httpd/resource/zview/zhiqim_announcement/announcementAdd.zml b/zhiqim_httpd/resource/zview/zhiqim_announcement/announcementAdd.zml new file mode 100644 index 0000000..6689c97 --- /dev/null +++ b/zhiqim_httpd/resource/zview/zhiqim_announcement/announcementAdd.zml @@ -0,0 +1,39 @@ +<#def designatedPath="/"+zhiqim_announcement+"/announcement.htm"/> +${request.getValidateScript()} +${zhiqim_manager_history("announcement.htm")} +${Scripts.onload("document.theForm.announcementTitle.focus();")} + +${zhiqim_manager_breadcrumb_parent("announcement.htm", "公告信息", "增加公告")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + +
            增加公告
            公告标题:(公告标题不能为空,[1, 64]范围) *
            公告类型:(请选择) + +  * +
            +
            公告内容:(不能为空,但最长不能超过1024个字符) *
            +
            + +
            +
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_httpd/resource/zview/zhiqim_announcement/announcementItem.zml b/zhiqim_httpd/resource/zview/zhiqim_announcement/announcementItem.zml new file mode 100644 index 0000000..ef76a75 --- /dev/null +++ b/zhiqim_httpd/resource/zview/zhiqim_announcement/announcementItem.zml @@ -0,0 +1,35 @@ +<#def designatedPath="/"+zhiqim_announcement+"/announcement.htm"/> +${zhiqim_manager_history("announcement.htm")} + +${zhiqim_manager_breadcrumb_parent("announcement.htm", "公告信息", "公告详情")} +${zhiqim_manager_content()} +<#-- 办公公告详情 ---> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            公告详情
            公告标题:${item.getAnnouncementTitle()}公告类型:<#if item.getAnnouncementType()==1>行政公告<#if item.getAnnouncementType()==2>假日公告<#if item.getAnnouncementType()==3>会议公告
            发布时间:${Sqls.toDateTimeString(item.getAnnouncementTime())}发布者:${item.getAnnouncementPublisher()}公告状态:<#if item.getAnnouncementStatus()==0>正常<#if item.getAnnouncementStatus()==1>已删除
            公告详情内容
            公告正文#{item.getAnnouncementContent()}
            返回上一页
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_httpd/resource/zview/zhiqim_announcement/announcementReaderList.zml b/zhiqim_httpd/resource/zview/zhiqim_announcement/announcementReaderList.zml new file mode 100644 index 0000000..968d3b2 --- /dev/null +++ b/zhiqim_httpd/resource/zview/zhiqim_announcement/announcementReaderList.zml @@ -0,0 +1,39 @@ +${Styles.htmlOverflowHidden()} + + +<#-- 查询 --> +
            +
            + + +
            +
            + +<#-- 列表 --> +
            + + + + + + +${zhiqim_manager_tr_no_record(result, 3, "没有阅读人员信息")} +<#for item : result.list()> + + + + + + +
            操作员头像操作员编码操作员姓名
            ${item.getOperatorCode()}${item.getOperatorName()}
            +
            + +<#-- 操作 --> +
            + +
            \ No newline at end of file diff --git a/zhiqim_httpd/resource/zview/zhiqim_announcement/announcementRecycle.zml b/zhiqim_httpd/resource/zview/zhiqim_announcement/announcementRecycle.zml new file mode 100644 index 0000000..fe0e76d --- /dev/null +++ b/zhiqim_httpd/resource/zview/zhiqim_announcement/announcementRecycle.zml @@ -0,0 +1,42 @@ +<#def designatedPath="/"+zhiqim_announcement+"/announcement.htm"/> +${zhiqim_manager_breadcrumb("公告回收站")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + +${zhiqim_manager_tr_no_record(result, 6, "没有公告信息")} +<#for item : result.list()> + + + + + + + + +
            公告类型公告标题发布人发布时间操作
            <#if item.getAnnouncementType()==1>行政公告<#if item.getAnnouncementType()==2>假日公告<#if item.getAnnouncementType()==3>会议公告${item.getAnnouncementTitle()}${item.getAnnouncementPublisher()}${Sqls.toDateTimeString(item.getAnnouncementTime())} + <#if ZmrAdminRule.check(request)> + + <#else> + -- + +
            +${zhiqim_manager_paging(result)} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpCertificate.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpCertificate.java new file mode 100644 index 0000000..b026552 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpCertificate.java @@ -0,0 +1,51 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.security.cert.X509Certificate; + +/** + * HTTP证书对象 + * + * @version v1.0.0 @author zouzhigang 2016-7-13 新建与整理 + */ +public class HttpCertificate +{ + private final String _sslSessionId; + private final X509Certificate[] _certs; + + public HttpCertificate(String sslSessionId, X509Certificate[] certs) + { + this._sslSessionId = sslSessionId; + this._certs = certs; + } + + public String getSessionId() + { + return _sslSessionId; + } + + public X509Certificate[] getCerts() + { + return _certs; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpChannel.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpChannel.java new file mode 100644 index 0000000..7c6d4c6 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpChannel.java @@ -0,0 +1,51 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; +import java.nio.ByteBuffer; + +/** + * HTTP AIO/BIO连接通道接口 + * + * @version v1.0.0 @author zouzhigang 2018-11-16 新建与整理 + */ +public interface HttpChannel +{ + /** + * 从连接通道中获取缓冲 + * + * @param buf 缓冲 + * @return 读取到的数目 + * @throws Exception 异常 + */ + public int read(ByteBuffer buf) throws IOException; + + /** + * 写入缓冲到连接通道中 + * + * @param buf 缓冲 + * @return 写入到的数目 + * @throws Exception 异常 + */ + public int write(ByteBuffer buf) throws IOException; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpConnection.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpConnection.java new file mode 100644 index 0000000..92e0fe7 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpConnection.java @@ -0,0 +1,88 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.seqs.Sequence; + +/** + * HTTP连接接口定义 + * + * @version v1.0.0 @author zouzhigang 2016-7-18 新建与整理 + */ +public interface HttpConnection extends HttpdConstants +{ + public Log log = LogFactory.getLog(HttpConnection.class); + public Sequence sequence = new Sequence(6); + + /********************************************************************/ + //连接中状态 + /********************************************************************/ + + /** 是否活动 */ + public boolean isActive(); + + /** 是否超时 */ + public boolean isOvertime(); + + /** 是否已关闭 */ + public boolean isClosed(); + + /********************************************************************/ + //连接中的websocket + /********************************************************************/ + + /** 是否是websocket连接 */ + public boolean isWebsocket(); + + /** 升级为Websocket连接 */ + public void doWebsocket(HttpContext context, String protocol, String sessionId); + + /********************************************************************/ + //连接中write&close + /********************************************************************/ + + /** 写入数据 */ + public void write(byte[] data) throws IOException; + + /** 写入数据 */ + public void write(byte[] data, int off, int len) throws IOException; + + /** 关闭连接 */ + public void close(); + + /********************************************************************/ + //连接中的相关连的 id & listener + /********************************************************************/ + + /** 连接编号 */ + public String getId(); + + /** 连接对应的监听器 */ + public HttpListener getListener(); + + /** 获取远程地址 */ + public String getRemoteAddr(); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpContext.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpContext.java new file mode 100644 index 0000000..b73fe4d --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpContext.java @@ -0,0 +1,234 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; +import java.util.List; + +import org.zhiqim.kernel.config.Group; +import org.zhiqim.kernel.control.Configurable; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.HashSetS; + +/** + * HTTP上下文环境接口定义 + * + * @version v1.0.0 @author zouzhigang 2016-7-15 新建与整理 + */ +public interface HttpContext extends Configurable +{ + /*********************************************************************/ + //创建 & 销毁 + /*********************************************************************/ + + /** 上下文环境编号 */ + public String getId(); + + /** 是否运行中 */ + public boolean isRunning(); + + /** 资源是否在类路径中 */ + public boolean isClasspath(); + + /** 创建 */ + public boolean create(Group group)throws Exception; + + /** 销毁 */ + public void destroy()throws Exception; + + /** 设置服务 */ + public void setServer(HttpServer server); + + /** 获取服务 */ + public HttpServer getServer(); + + /** 获取上行最大内容长度 */ + public int getMaxContentLength(); + + /** 获取设置的分块大小 */ + public int getChunkSize(); + + /** 获取静态文件有效期 */ + public int getExpires(); + + /** 判断是否是过滤的地址 */ + public boolean isFilterPath(String pathInContext); + + /** 获取匹配的处理器 */ + public HttpHandler getMatchHandler(String pathInContext); + + /** + * 公共处理文件资源,该方法可以在匹配到的Handler中发现子匹配失败时回跳到文件资源处理中再检查一次 + * + * @param request 请求 + * @param response 响应 + * @exception HttpException HTTP异常 + * @exception IOException IO异常 + */ + public void handleResource(HttpHeader header, HttpSender sender)throws HttpException, IOException; + + /** + * 默认处理请求,子类可以重写,默认查询Handler,如果查到对应由Handler处理,否则认为由ResourceHandler处理 + * + * @param request 请求 + * @param response 响应 + * @exception HttpException HTTP异常 + * @exception IOException IO异常 + */ + public void handle(HttpRequest request, HttpResponse response)throws HttpException, IOException; + + /*********************************************************************/ + //上下文环境基本属性相关方法 + /*********************************************************************/ + + /** 判断是否有上下文环境域名 */ + public HashSetS getContextDomains(); + + /** 获取上下文环境路径 */ + public String getContextPath(); + + /** 获取缺省编码 */ + public String getDefaultEncoding(); + + /** 获取上下文环境资源路径 */ + public String getResourcePath(); + + /** 获取上下文环境对应的真实路径 */ + public String getRealPath(String path); + + /** 获取上下文环境下绝对路径转为根环境下的绝对路径,如contextPath=/doc,path=/index.htm,得到/doc/index.htm */ + public String getRootPath(String path); + + /** 获取上下文环境欢迎页 */ + public String getWelcomeUrl(); + + /** 获取上下文环境404页跳转页 */ + public String getNotFoundUrl(); + + /** 获取上下文环境404页处理器 */ + public HttpEntity getNotFoundHandler(); + + /** 获取上下文环境会话管理器 */ + public HttpSessionManager getSessionManager(); + + /** 设置指定的会话失效 */ + public void invalidateSession(String sessionId); + + /** 是否使用Cookie */ + public boolean isCookieUse(); + + /** 获取使用Cookie时保存的域名 */ + public String getCookieDomain(); + + /** 获取使用Cookie时保存的路径 */ + public String getCookiePath(); + + /** 获取使用Cookie时保存的端口 */ + public int getCookiePort(); + + /** + * 获取该资源内的资源字符串 + * + * @param path 请求 + * @return =null表示不在该资源内,!=null表示在该资源内并读取到内容 + * @throws IOException 异常 + */ + public String getResourceString(String path) throws IOException; + + /** + * 获取该资源内的资源字符串 + * + * @param path 请求 + * @param encoding 编码 + * @return =null表示不在该资源内,!=null表示在该资源内并读取到内容 + * @throws IOException 异常 + */ + public String getResourceString(String path, String encoding) throws IOException; + + /** + * 读取资源目录下的文件名和目录名,目录名以/结尾,用于显示目录下列表 + * + * @param folderPath 目录地址 + * @return 名称列表 + * @throws IOException 异常 + */ + public List getResourceNameList(String folderPath) throws IOException; + + /*********************************************************************/ + //上下文环境自定义属性相关方法 + /*********************************************************************/ + + /** 设置属性 */ + public void setAttribute(String key, Object value); + + /** 设置属性(通过类结构) */ + public void setAttribute(Class key, T value); + + /** 是否有该属性 */ + public boolean hasAttribute(String key); + + /** 获取属性表 */ + public HashMapSO getAttributes(); + + /** 获取属性 */ + public Object getAttribute(String key); + + /** 获取上属性(通过类结构) */ + public T getAttribute(Class key); + + /** 获取属性,如果属性不存在则使用缺省值 */ + public Object getAttribute(String key, Object defaultValue); + + /** 获取上下文环境名称 */ + public String getContextName(); + + /** 获取上下文环境版本 */ + public String getContextVersion(); + + /** 获取字符串 */ + public String getAttributeString(String key); + + /** 获取字符串 ,如果属性不存在则使用缺省值*/ + public String getAttributeString(String key, String defaultValue); + + /** 获取整型 */ + public int getAttributeInt(String key); + + /** 获取整型 ,如果属性不存在则使用缺省值 */ + public int getAttributeInt(String key, int defaultValue); + + /** 获取长整型 */ + public long getAttributeLong(String key); + + /** 获取长整型 ,如果属性不存在则使用缺省值 */ + public long getAttributeLong(String key, long defaultValue); + + /** 获取布尔型 ,如果属性不存在则使用缺省值 */ + public boolean getAttributeBoolean(String key, boolean defaultValue); + + /*********************************************************************/ + //上下文环境Websocket相关方法 + /*********************************************************************/ + + /** 获取Websocket管理器 */ + public HttpWebsocketManager getWebsocketManager(); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpContextLoader.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpContextLoader.java new file mode 100644 index 0000000..0150ed4 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpContextLoader.java @@ -0,0 +1,115 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.net.URL; +import java.net.URLClassLoader; + +/** + * HTTP 上下文环境的ClassLoader + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpContextLoader extends URLClassLoader +{ + private static final String[] _SYSTEM_CLASSES_ = new String [] {"java.","javax.xml.","org.xml.","org.w3c.","org.zhiqim."}; + + private ClassLoader _parent; + + public HttpContextLoader(ClassLoader parent) + { + super(new URL[0], parent); + this._parent = parent; + } + + public Class loadClass(String name) throws ClassNotFoundException + { + return loadClass(name, false); + } + + protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException + { + Class c = findLoadedClass(name); + if (c != null) + return c; + + ClassNotFoundException ex= null; + try{c = this.findClass(name);}catch (ClassNotFoundException e){ex = e;} + + if (c == null && _parent != null) + try{c = _parent.loadClass(name);}catch (ClassNotFoundException e){ex = e;} + + if (c == null) + throw ex; + + if (resolve) + resolveClass(c); + + return c; + } + + public URL getResource(String name) + { + URL url = null; + boolean triedParent = false; + if (isSystemPath(name)) + { + triedParent = true; + url = _parent.getResource(name); + } + + if (url == null) + { + url = this.findResource(name); + if (url == null && name.startsWith("/")) + url = this.findResource(name.substring(1)); + } + + if (url == null && !triedParent) + url = _parent.getResource(name); + + return url; + } + + /** 是否指定为系统路径 */ + public boolean isSystemPath(String name) + { + name = name.replace('/','.'); + while(name.startsWith(".")) + name = name.substring(1); + + for (String c : _SYSTEM_CLASSES_) + { + if (c.endsWith(".")) + {//类前缀 + if (name.startsWith(c)) + return true; + } + else if (name.equals(c)) + {//类全称 + return true; + } + } + + return false; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpCookie.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpCookie.java new file mode 100644 index 0000000..d035e4e --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpCookie.java @@ -0,0 +1,158 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; + +/** + * HTTP Cookie类 + * 1.name Cookie名称 + * 2.value Cookie值 + * 3.Version Cookie遵循的版本 + * 4.Max-Age Cookie有效期,为0表示不设置关闭浏览器即失效,单位:秒,替换Expires字段,告之浏览器保留时间,而不是到期时间 + * 5.Discard Cookie有效期,是否在会话结束后丢弃该 Cookie 项,默认为 fasle + * 6.Domain Cookie指定的域,如果有域建议添加 + * 7.Port Cookie指定的端口列表,多个逗号隔开,我们这里只支持一个,Version=1时引入,不过多大还不支持该属性 + * 8.Path Cookie的虚拟目录,取值为contextPath,由HttpServer决定,不需要传入 + * 9.Secure Cookie安全SSL时才传送 + * 10.HttpOnly Cookie仅HTTP使用,由IE引入,大多都支持,强制填写 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpCookie implements HttpdConstants +{ + private String name; + private String value; + private int maxAge; + private boolean secure; + + public HttpCookie(String name, String value) + { + this.name = name; + this.value = value; + } + + public HttpCookie(String name, String value, int maxAge) + { + this.name = name; + this.value = value; + this.maxAge = maxAge; + } + + public String getName() + { + return name; + } + + public String getValue() + { + return value; + } + + public int getMaxAge() + { + return maxAge; + } + + public void setMaxAge(int maxAge) + { + this.maxAge = maxAge; + } + + public void setName(String name) + { + this.name = name; + } + + public void setValue(String value) + { + this.value = value; + } + + public void setSecure(boolean secure) + { + this.secure = secure; + } + + public boolean isSecure() + { + return secure; + } + + /**************************************************************/ + //以下为自定义方法 + /**************************************************************/ + + /** + * 响应Cookie,支持PATH,DOMAIN和PORT + * + * @param contextPath 上下文路径 + * @param domain 域名 + * @param port 端口 + * @return Cookie响应 + */ + public String getResponse(String contextPath, String domain, int port) + { + return new StringBuilder(_SET_COOKIE_).append(_COLON_).append(getResponseValue(contextPath, domain, port)).toString(); + } + + /** + * 响应Cookie,支持PATH,DOMAIN和PORT + * + * @param contextPath 上下文路径 + * @param domain 域名 + * @param port 端口 + * @return Cookie响应 + */ + public String getResponseValue(String contextPath, String domain, int port) + { + StringBuilder strb = new StringBuilder(); + //强制规定采用UTF8进行URL编码,读取时解码,保证统一,防止更换编码时读取异常 + strb.append(name).append("=").append(Urls.encodeUTF8(value)); + strb.append(";").append(_COOKIE_VERSION_).append("=").append(1); + + //默认不设置有效期即浏览器关闭即失效,如果有设置要求,则加入 + if (maxAge == 0) + strb.append(";").append(_COOKIE_DISCARD_).append("=").append("\"true\""); + else + strb.append(";").append(_COOKIE_MAX_AGE_).append("=").append(maxAge); + + //强制加上域和端口 + if (domain != null) + strb.append(";").append(_COOKIE_DOMAIN_).append("=").append(domain); + + if (port != -1) + strb.append(";").append(_COOKIE_PORT_).append("=").append(port); + + //强制加上路径 + strb.append(";").append(_COOKIE_PATH_).append("=").append(Strings.addEndsWith(contextPath, "/")); + + //默认不增加SSL时才传递 + if (secure) + strb.append(";").append(_COOKIE_SECURE_); + + //强制加上仅HTTP操作 + strb.append(";").append(_COOKIE_HTTP_ONLY); + return strb.toString(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpEntity.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpEntity.java new file mode 100644 index 0000000..c36f1ca --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpEntity.java @@ -0,0 +1,47 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; + +/** + * 对应HTTP一个处理的实体,和HttpHandler不同的是: + * 1.只需消息头内容 + * 2.对应实际的一个文件或处理,无其他业务逻辑 + * 3.处理完成后即发送 + * + * 用于静态文件等,无需创建复杂的HttpRequest和HttpResponse + * + * @see HttpExecutor 业务处理器 + * @version v1.0.0 @author zouzhigang 2016-7-19 新建与整理 + */ +public interface HttpEntity extends HttpHandler +{ + /** + * 处理HTTP请求, 来自GET,POST方法 + * + * @param header 请求头 + * @param sender 响应发送者 + * @throws IOException 异常 + */ + public void handle(HttpHeader header, HttpSender sender) throws IOException; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpException.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpException.java new file mode 100644 index 0000000..9f86f09 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpException.java @@ -0,0 +1,80 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; + +import org.zhiqim.httpd.constants.HttpStatus; + + +/** + * 定义HTTP级错误,捕捉时直接返回错误信息 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpException extends IOException +{ + private static final long serialVersionUID = 1L; + + private int code; + + public int getCode() + { + return code; + } + + public HttpException() + { + code = HttpdConstants._400_BAD_REQUEST_; + } + + public HttpException(String message) + { + super(message); + code = HttpdConstants._503_SERVER_UNAVAILABLE_; + } + + public HttpException(int code) + { + this.code=code; + } + + public HttpException(int code, String message) + { + super(message); + this.code=code; + } + + public String getReason() + { + return HttpStatus.getStatusMsg(code); + } + + public String toString() + { + String message = getMessage(); + String reason = getReason(); + return "HttpException("+code+","+reason+","+message+")"; + } + +} + diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpExecutor.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpExecutor.java new file mode 100644 index 0000000..ed2d41f --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpExecutor.java @@ -0,0 +1,45 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; + +/** + * 定义HTTP业务处理器,和HttpEntity不同的是: + * 1.创建完善的HttpRequest和HttpResponse用于业务处理 + * 2.支持HttpSession和Validate等业务形态 + * 3.支持view,redirect,forward等业务形态 + * + * @see HttpEntity 实体处理器 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface HttpExecutor extends HttpHandler +{ + /** + * 处理HTTP请求, 来自GET,POST方法 + * + * @param request 请求 + * @param response 响应 + * @throws IOException IO异常 + */ + public void handle(HttpRequest request, HttpResponse response) throws IOException; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpHandler.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpHandler.java new file mode 100644 index 0000000..129374d --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpHandler.java @@ -0,0 +1,35 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + + +/** + * 定义HTTP业务处理器,和两种处理器 + * @see HttpEntity 实体处理器,用于资源静态文件和错误处理等,没有session/cookie也不需要解析内容 + * @see HttpExecutor 逻辑处理器,用于业务处理,初始化数据比较多,要求解析内容和session/cookie/parameter/validate等 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface HttpHandler extends HttpdConstants +{ + public boolean isMatch(String pathInContext); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpHeader.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpHeader.java new file mode 100644 index 0000000..ab6de78 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpHeader.java @@ -0,0 +1,136 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import org.zhiqim.kernel.control.Configurable; +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.logging.Log; + +public interface HttpHeader extends HttpdConstants, Configurable +{ + /** 获取日志对象 */ + public Log getLog(); + + /** 获取对应的HTTP监听器监听端口 */ + public int getListenerPort(); + + /** 获取发送器 */ + public HttpSender getSender(); + + /** 获取客户端IP地址 */ + public String getRemoteAddr(); + + /** 获取请求正在处理的上下文环境 */ + public HttpContext getContext(); + + /** 获取在上下文环境下的路径 */ + public String getPathInContext(); + + /** 获取资源文件下绝对路径 */ + public String getPathOnResource(); + + /***********************************************************************/ + //获取和判断请求行信息,包括协议、方法、版本、URI等 + /***********************************************************************/ + + /** 获取请求行 */ + public String getHeaderLine(); + + /** 获取请求版本 */ + public String getVersion(); + + /** 获取URI路径,以/开头,如/test.html,如果没有文件后缀则为'/' */ + public String getPath(); + + /** 获取请求方法 */ + public String getMethod(); + + /** 是否是HEAD方法 */ + public boolean isMethodHead(); + + /** 是否是GET方法 */ + public boolean isMethodGet(); + + /** 是否是POST方法 */ + public boolean isMethodPost(); + + /** 是否需要响应内容 */ + public boolean isMethodResponseContent(); + + /** 是否WebSocket */ + public boolean isWebSocket(); + + /** 获取查询串 */ + public String getQueryString(); + + /** 获取HOST:PORT */ + public String getHostPort(); + + /** 如果有PORT只仅HOST */ + public String getHostOnly(); + + /** 获取浏览器代理 */ + public String getUserAgent(); + + /** 获取URI虚拟目录信息 */ + public String getVirtualDirectory(); + + /***********************************************************************/ + //获取和判断请求头部信息 + /***********************************************************************/ + + /** 获取头部信息 */ + public HashMapSS getHeaders(); + + /** 获取请求头属性 */ + public String getHeader(String key); + + /** 获取请求内容长度 */ + public int getContentLength(); + + /** 获取请求内容类型 */ + public String getContentType(); + + /** 获取请求要求的类型 */ + public String getMimeType(); + + /** 判断是否表单提交 */ + public boolean isMimeForm(); + + /** 判断是否文本请求 */ + public boolean isMimeTextPlain(); + + /** 设置请求的编码格式 */ + public void setCharacterEncoding(String characterEncoding); + + /** 获取请求要求的编码,如果未设置默认UTF-8 */ + public String getCharacterEncoding(); + + /** 获取请求头中的编码,如果未设置默认null */ + public String getCharacterEncodingHeader(); + + /** 是否请求内容GZIP */ + public boolean isRequestGZip(); + + /** 是否响应支持GZIP */ + public boolean isResponseGZip(); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpHeaderAbs.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpHeaderAbs.java new file mode 100644 index 0000000..3709b93 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpHeaderAbs.java @@ -0,0 +1,971 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.EOFException; +import java.io.IOException; +import java.net.SocketException; +import java.net.SocketTimeoutException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; +import java.util.Map.Entry; + +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLHandshakeException; + +import org.zhiqim.httpd.constants.HttpStep; +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Bytes; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.URI; +import org.zhiqim.kernel.util.seqs.Sequence; + +/** + * HTTP头部抽象类 + * + * @version v1.0.0 @author zouzhigang 2018-9-11 新建与整理 + */ +public abstract class HttpHeaderAbs extends HttpHeaderInner implements HttpHeader +{ + private static final Log log = LogFactory.getLog("http.request"); + private static final Sequence sequence = new Sequence(6); + + //连接&监听&输入输出流&发送器 + private HttpConnection conn; + private HttpListener listener; + private HttpServer server; + + private HttpInputStream input; + private HttpOutputStream output; + private HttpSenderImpl sender; + + //编号&步骤&时间 + private String requestId; + private int requestStep; + private long requestTimeMillis; + + //状态 + private String statusLine; + private String method; + private URI uri; + private String version; + + //属性 + private HashMapSS headerMap; + private String x_Forwarded_For; + private String mimeType; + private String characterEncoding; + private X509Certificate[] certs; + + //关联对象 + private HttpContext context; + + //请求&响应&处理器 + private HttpRequestAbs request; + private HttpResponseImpl response; + private HttpHandler handler; + + //临时路径值 + private transient String pathInContext; + private transient String pathOnResource; + + //解释头 + private List headerList; + private byte[] headerBuf = new byte[_MAX_LINE_LEN_ * 2]; + private boolean isCR=false,isLF=false,isCR2=false; + private int pos=0, totalPos=0; + + /** 构造函数 */ + public HttpHeaderAbs (HttpConnection conn, HttpInputStream input, SSLEngine sslEngine) + { + this.conn = conn; + this.listener = conn.getListener(); + this.server = listener.getServer(); + this.input = input; + this.output = new HttpOutputStream(conn); + this.sender = newSender(); + + this.requestId = conn.getId() + sequence.nextString(); + this.requestStep = _01_CREATE_; + this.requestTimeMillis = System.currentTimeMillis(); + + this.headerList = new ArrayList(); + this.headerMap = new HashMapSS(); + } + + /*****************************************************************************/ + //子类必须实现的抽象方法 + /*****************************************************************************/ + + /** 创建发送器 */ + public abstract HttpSenderImpl newSender(); + + /** 创建请求 */ + public abstract HttpRequestAbs newRequest(); + + /** 是否BIO */ + public abstract boolean isBio(); + + /*****************************************************************************/ + //子类必须实现的抽象方法 + /*****************************************************************************/ + + public HttpServer getServer() + { + return server; + } + + public HttpContext getContext() + { + return context; + } + + public HttpInputStream getInputStream() + { + return input; + } + + public HttpOutputStream getOutputStream() + { + return output; + } + + public String getId() + { + return requestId; + } + + public long getReceiveTimeMillis() + { + return requestTimeMillis; + } + + public HttpListener getListener() + { + return listener; + } + + public HttpResponse getResponse() + { + return response; + } + + @Override /** 获取连接中的日志对象 */ + public Log getLog() + { + return log; + } + + @Override /** 获取发送器 */ + public HttpSender getSender() + { + return sender; + } + + @Override /** 读取可配置值 */ + public String getConfiguration() + { + return context.getConfiguration(); + } + + /*****************************************************************************/ + //执行请求 + /*****************************************************************************/ + + /** + * 执行缓冲请求 + * + * @exception HttpException HTTP异常 + * @exception IOException IO异常 + */ + public boolean execute() throws HttpException, IOException + { + try + { + //2.第二步,从流中解析消息头 + if (requestStep < _02_PARSE_HEADER_) + { + if (!parseHeaderStream()) + return true;//解析未完成情况,等待下次execute + + setStep(_02_PARSE_HEADER_); + } + + //3.第三步,检查消息头 + if (requestStep < _03_CHECK_HEADER_) + { + parseHeader(); + sender.setVersion(getVersion()); + if (!isBio()) + {//非BIO根据请求来判断 + sender.setHeader(_CONNECTION_, getHeader(_CONNECTION_)); + } + setStep(_03_CHECK_HEADER_); + } + + //4.第五步,查询上下文环境 + if (requestStep < _04_QUERY_CONTEXT_) + { + String host = getHostOnly(); + if (Validates.isEmpty(host)) + throw new HttpException(_412_PRECONDITION_FAILED_); + + String path = getPath(); + + //4.1检查完全匹配,如http://www.zhiqim.com/example 对应到/example上下文环境 + context = server.getContext(host, path); + if (context != null && !"/".equals(path)) + {//如果找到Context,则认为path是虚拟目录/example,重定向到Context的根http://example.zhiqim.com/ + sender.sendRedirect(path+"/"); + return true; + } + + if (context == null) + {//4.2检查是否有虚拟目录上下文环境 + String maybe = getVirtualDirectory();//虚拟目录 + context = server.getContext(host, maybe); + if (context == null) + {//不是虚拟目录上下文环境 + context = server.getContext(host, "/"); + } + } + + if (context == null) + {//4.3未找到则表示未配置该上下文环境,返回未找到 + sender.sendError(_404_NOT_FOUND_); + return true; + } + + setStep(_04_QUERY_CONTEXT_); + } + + //5.第五步,在上下文环境中查找处理器 + if (requestStep < _05_QUERY_HANDLER_) + { + parsePathInContext(context); + String pathInContext = getPathInContext(); + if ("/".equals(pathInContext)) + {//5.1路径为根路径,但没匹配到欢迎页,返回未找到 + sender.sendError(_404_NOT_FOUND_); + return true; + } + + if (context.isFilterPath(pathInContext)) + {//5.2路径为过滤地址,返回禁止访问 + sender.sendError(_403_FORBIDDEN_); + return true; + } + + //指定输出块大小 + output.setChunkSize(context.getChunkSize()); + + handler = context.getMatchHandler(pathInContext); + if (handler == null) + {//5.3未找到匹配的处理器 + context.handleResource(this, sender); + return true; + } + + if (isMethodHead()) + {//5.4针对HEAD的请求直接返回成功即可 + sender.sendHeader(_200_OK_); + return true; + } + + if (handler instanceof HttpEntity) + {//5.5找到是实体处理器 + ((HttpEntity)handler).handle(this, sender); + return true; + } + + setStep(_05_QUERY_HANDLER_); + } + + //6.第六步,解析GET,POST COOKIE,SESSION和内容等信息 + if (requestStep < _06_PARSE_CONTENT_) + { + if (request == null) + request = newRequest(); + + if (response == null) + response = new HttpResponseImpl(this.request); + + request.parseHeaderByContextOK(); + request.parseGetPostCookieSession(); + if (!request.parseContent()) + return true; + + setStep(_06_PARSE_CONTENT_); + } + + //7.第七步,转入处理器进行处理 + if (requestStep < _07_HANDLER_BEGIN_) + { + //BEGIN + setStep(_07_HANDLER_BEGIN_); + + HttpExecutor executor = (HttpExecutor)handler; + executor.handle(request, response); + + //END + if (requestStep < _10_HANDLER_END_) + setStep(_10_HANDLER_END_); + } + + //12.第十二步,提交 + if (!isCommitted()) + { + if (response != null) + response.commit(); + else + sender.commit(); + } + + return !isWebSocket(); + } + catch (SSLHandshakeException e) + {//SSL握手异常 + close(); + return false; + } + catch(EOFException e) + {//没读到消息 + try{sender.sendError(_400_BAD_REQUEST_);}catch(Exception e2){close();} + return false; + } + catch(SocketTimeoutException | SocketException e) + {//SOCKET异常 + try{sender.sendError(_408_REQUEST_TIMEOUT_);}catch(Exception e2){close();} + return false; + } + catch(HttpException e) + {//HTTP异常 + if (e.getCode() == _444_INTERRUPT_) + close();//直接关闭 + else + try{sender.sendError(e.getCode());}catch(Exception e2){close();} + return false; + } + catch(IOException e) + {//IO异常 + close(); + return false; + } + catch(Throwable e) + {//未知服务端异常 + log.error(e); + try{sender.sendError(_500_INTERNAL_SERVER_ERROR_);}catch(Exception e2){close();} + return false; + } + finally + { + if (isCommitted()) + {//已提交和关闭状态的清理及日志打印 + setStep(_12_FINISHED_); + + listener.finished(this); + + destroy(); + + if (sender != null){ + sender.destroy(); + } + + if (request != null){ + request.destroy(); + } + if (response != null){ + response.destroy(); + } + } + } + } + + /** 解析全路径path,生成上下文环境中绝对路径 */ + public void parsePathInContext(HttpContext context) + { + this.context = context; + String contextPath = context.getContextPath(); + + if ("/".equals(contextPath)) + pathInContext = uri.getPath(); + else + pathInContext = uri.getPath().substring(contextPath.length()); + pathInContext = Strings.addStartsWith(pathInContext, "/"); + + if ("/".equals(pathInContext)) + {//如果是根地址,则加上可能的welcomeUrl + if (Validates.isNotEmptyBlank(context.getWelcomeUrl())) + pathInContext = context.getWelcomeUrl(); + } + + //设置编码格式 + if (Validates.isEmptyBlank(characterEncoding)) + characterEncoding = context.getDefaultEncoding(); + + if (Validates.isEmptyBlank(characterEncoding)) + characterEncoding = _UTF_8_; + } + + /** + * 分析请求行和请求头信息 + * + * @param headerList 消息头列表,不为空 + * @exception EOFException 流结束异常 + * @exception HttpException HTTP请求异常 + */ + public void parseHeader() throws EOFException, HttpException + { + //第一步,读头部流,得到头部列表 + if (headerList.isEmpty()) + throw new EOFException(); + + //第二步,检查首行格式,得到HTTP版本,方法和URL,如GET /index.htm HTTP/1.1 + String line = statusLine = headerList.get(0).trim(); + if (line.length() > _MAX_LINE_LEN_) + throw new HttpException(_414_REQUEST_URL_TOO_LARGE_); + + int ind = line.indexOf(' '); + if (ind == -1) + throw new HttpException(_400_BAD_REQUEST_); + + //2.1,判断方法是不是仅支持的GET,POST和HEAD + method = line.substring(0, ind); + if (!(_GET_.equalsIgnoreCase(method) || _POST_.equalsIgnoreCase(method) || _HEAD_.equalsIgnoreCase(method))) + throw new HttpException(_405_METHOD_NOT_ALLOWD_); + method = method.toUpperCase(); + + line = line.substring(ind+1).trim(); + ind = line.indexOf(' '); + if (ind == -1) + throw new HttpException(_400_BAD_REQUEST_); + + //2.2,读取URL + String url = line.substring(0, ind); + if (url == null || url.trim().length()<1) + throw new HttpException(_400_BAD_REQUEST_); + + if (!url.startsWith("/") || url.indexOf("/..") != -1 || url.indexOf("../") != -1)//如果出现目录相关的,直接拒绝 + throw new HttpException(_400_BAD_REQUEST_); + + //2.3,解析URL成URI + uri = new URI(); + if (!uri.parseUri(url.trim())) + throw new HttpException(_400_BAD_REQUEST_); + + //2.4,判断HTTP版本是否是支持的1.0/1.1 + version = line.substring(ind+1).trim(); + if (!_HTTP_1_1_.equals(version) && !_HTTP_1_0_.equals(version)) + throw new HttpException(_505_VERSION_NOT_SUPPORTED_); + + //第三步,读取其他头部信息 + for (int i=1;i=0) + { + int i2 = contentType.indexOf(";", i1); + if (i2 == -1) + characterEncoding = contentType.substring(i1 + 8); + else + characterEncoding = contentType.substring(i1 + 8, i2).trim(); + } + } + } + } + + + /** 分析头部流 */ + private boolean parseHeaderStream() throws HttpException, IOException + { + int b = input.read(); + while (b != -1) + { + if (totalPos > _MAX_LINE_LEN_ * _MAX_HEADER_LINE_)//头部总大小不超过128行最大值 + throw new HttpException(_414_REQUEST_URL_TOO_LARGE_); + + if (pos > _MAX_LINE_LEN_)//单行总大小不超过8192 + throw new HttpException(_414_REQUEST_URL_TOO_LARGE_); + + if (b == _CR_) + {//回车 + pos = 0;//指定回首位置 + String line = Bytes.BI.getString(headerBuf, 0, (byte)0); + if (line != null && line.trim().length() > 0) + headerList.add(line); + + Bytes.fillBytes(headerBuf, 0, (byte)0, _MAX_LINE_LEN_ * 2); + if (isCR) + isCR2 = true; + else + isCR = true; + } + else if (b== _LF_) + {//换行 + if (isCR && isLF && isCR2) + break;//头部结束 + else + isLF = true; + } + else + { + isCR = isLF = isCR2 = false;//恢复标志 + headerBuf[pos++] = (byte)b; + totalPos++; + } + + b = input.read(); + } + + return (isCR && isLF && isCR2); + } + + /*******************************************************************************/ + //步骤 + /*******************************************************************************/ + + public void setStep(int step) + { + if (this.requestStep >= step) + return; + + this.requestStep = step; + } + + public int getStep() + { + return requestStep; + } + + public String getStepDesc() + { + return HttpStep.getStatusMsg(requestStep); + } + + public boolean isRead() + {//头部已读 + return requestStep > _03_CHECK_HEADER_; + } + + public boolean isParsed() + {//内部已读 + return requestStep > _06_PARSE_CONTENT_; + } + + public boolean isHandled() + {//处理完成 + return requestStep >= _10_HANDLER_END_; + } + + public boolean isCommitted() + {//提交完成 + return requestStep >= _11_COMMITTED_; + } + + public boolean isEditable() + {//正在提交即不可编辑 + return !isCommitted(); + } + + /** 关闭连接 */ + public void close() + {//由sender回调 + if (!isCommitted()) + setStep(_11_COMMITTED_); + + conn.close(); + } + + /***********************************************************************/ + //获取和判断请求行信息,包括协议、方法、版本、URI等 + /***********************************************************************/ + + @Override /** 获取客户端IP地址 */ + public String getRemoteAddr() + { + //如果是代理,取代理第一个IP + if (x_Forwarded_For != null) + return x_Forwarded_For.split(",")[0]; + else//否则取连接 + return conn.getRemoteAddr(); + } + + @Override + public int getListenerPort() + { + return conn.getListener().getPort(); + } + + @Override /** 获取请求行 */ + public String getHeaderLine() + { + return statusLine; + } + + @Override /** 获取请求版本 */ + public String getVersion() + { + return version; + } + + @Override /** 获取请求方法 */ + public String getMethod() + { + return method; + } + + @Override /** 是否是HEAD方法 */ + public boolean isMethodHead() + { + return _HEAD_.equals(method); + } + + @Override /** 是否是GET方法 */ + public boolean isMethodGet() + { + return _GET_.equals(method); + } + + @Override /** 是否是POST方法 */ + public boolean isMethodPost() + { + return _POST_.equals(method); + } + + @Override /** 判断是否需要响应内容 */ + public boolean isMethodResponseContent() + {//GET,POST,其他的PUT,DELETE认为是增加和删除,只响应状态 + return _GET_.equals(method) || _POST_.equals(method); + } + + /** 获取URI信息 */ + public URI getUri() + { + return uri; + } + + @Override /** 获取URI路径,以/开头,如/test.html,如果没有文件后缀则为'/' */ + public String getPath() + { + return (uri == null)?"":uri.getPath(); + } + + @Override /** 获取查询串 */ + public String getQueryString() + { + return uri.getQuery(); + } + + @Override /** 获取URI虚拟目录信息 */ + public String getVirtualDirectory() + { + return uri.getVirtualDirectory(); + } + + @Override /** 获取头部信息 */ + public HashMapSS getHeaders() + { + return headerMap; + } + + /** 设置头部信息,KEY统一使用小写 */ + public void setHeader(String key, String value) + { + headerMap.put(key.toLowerCase(), value); + } + + @Override /** 获取请求头属性 */ + public String getHeader(String key) + { + return headerMap.get(key.toLowerCase()); + } + + @Override /** 获取请求头中的编码,如果未设置默认null */ + public String getCharacterEncodingHeader() + { + String contentType= getHeader(_CONTENT_TYPE_); + if (Validates.isEmptyBlank(contentType)) + return null; + + contentType = contentType.toLowerCase(); + int i1 = contentType.indexOf("charset="); + if (i1 == -1) + return null; + + int i2 = contentType.indexOf(";", i1); + if (i2 == -1) + return contentType.substring(i1 + 8); + else + return contentType.substring(i1 + 8, i2).trim(); + } + + /** 获取请求内容长度 */ + public int getContentLength() + { + String sLen = getHeader(_CONTENT_LENGTH_); + if (!Validates.isInteger(sLen)) + return 0; + return Integer.parseInt(sLen); + } + + /** 获取请求内容类型 */ + public String getContentType() + { + return getHeader(_CONTENT_TYPE_); + } + + /** 获取请求要求的类型 */ + public String getMimeType() + { + return mimeType; + } + + /** 判断是否表单提交 */ + public boolean isMimeForm() + { + return _APPLICATION_X_WWW_FORM_.equals(mimeType); + } + + /** 判断是否文本请求 */ + public boolean isMimeTextPlain() + { + return _TEXT_PLAIN_.equals(mimeType); + } + + /** 设置请求的编码格式 */ + public void setCharacterEncoding(String characterEncoding) + { + if (Validates.isEmptyBlank(characterEncoding)) + return;//不支持设置空白编码格式 + + this.characterEncoding = characterEncoding; + } + + /** 获取请求要求的编码,如果未设置默认UTF-8 */ + public String getCharacterEncoding() + { + return characterEncoding; + } + + /** 获取HOST:PORT */ + public String getHostPort() + { + return getHeader(_HOST_); + } + + /** 如果有PORT仅取HOST */ + public String getHostOnly() + { + String hostPort = getHostPort(); + if (Validates.isEmpty(hostPort)) + return null; + + int ind = hostPort.indexOf(":"); + if (ind == -1) + return hostPort; + else//去除:之间的空格 + return Strings.trim(hostPort.substring(0, ind)); + } + + /** 获取浏览器代理 */ + public String getUserAgent() + { + return getHeader(_USER_AGENT_); + } + + /** 是否请求内容GZIP */ + public boolean isRequestGZip() + { + String contentEncoding = getHeader(_CONTENT_ENCODING_); + return _ENCODING_GZIP_.equalsIgnoreCase(contentEncoding); + } + + /** 是否响应支持GZIP */ + public boolean isResponseGZip() + { + String acceptEncoding = getHeader(_ACCEPT_ENCODING_); + if (Validates.isEmpty(acceptEncoding) || acceptEncoding.indexOf(_ENCODING_GZIP_) == -1) + return false; + + String userAgent = getUserAgent(); + if (Validates.isEmpty(userAgent) || userAgent.toLowerCase().indexOf("msie 6.0") > -1) + return false;//IE6,有部分浏览器有问题可能不支持GZIP + + return true; + } + + public String getXForwardedFor() + { + return x_Forwarded_For; + } + + public void setCertificates(X509Certificate[] certs) + { + this.certs = certs; + } + + public X509Certificate[] getCertificates() + { + return certs; + } + + /** 是否是Websocket协议 */ + public boolean isWebSocket() + { + return _WEBSOCKET_.equalsIgnoreCase(getHeader(_UPGRADE_)) && Strings.contains(getHeader(_CONNECTION_).toLowerCase(), _UPGRADE_.toLowerCase()); + } + + /** 由转向时设置新的地址 */ + public void setPathInContext(String pathInContext) + { + pathInContext = Strings.addStartsWith(pathInContext, "/"); + + if ("/".equals(pathInContext)) + {//如果是根地址,则加上可能的welcomeUrl + if (Validates.isNotEmptyBlank(context.getWelcomeUrl())) + pathInContext = context.getWelcomeUrl(); + } + + this.pathInContext = pathInContext; + } + + + /***********************************************************************/ + //在找到HttpContext时才有效 + /***********************************************************************/ + + /** 获取HTTP连接 */ + public HttpConnection getConnection() + { + return conn; + } + + /** 获取在上下文环境下的路径 */ + public String getPathInContext() + { + return pathInContext; + } + + /***********************************************************************/ + //由ClassResourceHandler和FileResourceHandler处理的资源临时文件路径 + /***********************************************************************/ + + /** 获取资源文件下绝对路径 */ + public String getPathOnResource() + { + return pathOnResource; + } + + /** 设置资源文件下绝对路径 ,由context回调 */ + public void setPathOnResource(String pathOnResource) + { + this.pathOnResource = pathOnResource; + } + + /***********************************************************************/ + //toString & destroy + /***********************************************************************/ + + public String toString() + { + StringBuilder strb = new StringBuilder(); + strb.append(statusLine).append(_BR_); + if (headerMap != null) + { + for (Entry entry : headerMap.entrySet()) + { + strb.append(entry.getKey()).append(_COLON_).append(entry.getValue()).append(_BR_); + } + strb.append(_BR_); + } + return strb.toString(); + } + + private void destroy() + { + if (headerMap != null) + { + headerMap.clear(); + headerMap = null; + } + + if (headerList != null) + { + headerList.clear(); + headerList = null; + } + + //引用置空 + statusLine = null; + method = null; + uri = null; + version = null; + x_Forwarded_For = null; + mimeType = null; + characterEncoding = null; + + conn = null; + context = null; + pathInContext = null; + pathOnResource = null; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpHeaderInner.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpHeaderInner.java new file mode 100644 index 0000000..7f8f7aa --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpHeaderInner.java @@ -0,0 +1,33 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +/** + * HTTP请求头内部接口 + * + * @version v1.0.0 @author zouzhigang 2018-9-22 新建与整理 + */ +public abstract class HttpHeaderInner +{ + /** 设置资源文件下绝对路径 ,由context回调 */ + public abstract void setPathOnResource(String pathOnResource); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpInputStream.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpInputStream.java new file mode 100644 index 0000000..b1c7570 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpInputStream.java @@ -0,0 +1,151 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.BufferUnderflowException; +import java.nio.ByteBuffer; + +import org.zhiqim.kernel.util.Asserts; + +/** + * HTTP阻塞式输入流 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpInputStream extends InputStream +{ + private InputStream input; + private ByteBuffer buffer; + + public HttpInputStream() + { + } + + public HttpInputStream(InputStream input) + { + this.input = input; + } + + /*****************************************************************************/ + //NIO使用的缓冲 + /*****************************************************************************/ + + /** + * 增加缓冲数据,检查是否在起始位置,不在会作flip + * + * @param buf 字节缓冲 + */ + public synchronized void addBuffer(ByteBuffer buf) + { + Asserts.as(input == null?null:"已有输入流,不支持增加缓冲数据"); + + if (buf.position() != 0) + {//新增加的没作flip操作的 + buf.flip(); + } + + if (!buf.hasRemaining()) + {//没有数据不处理 + return; + } + + if (buffer == null) + { + buffer = ByteBuffer.allocate(buf.remaining()); + buffer.put(buf).flip(); + } + else + { + ByteBuffer nBuf = ByteBuffer.allocate(buffer.remaining() + buf.remaining()); + nBuf.put(buffer).put(buf).flip(); + buffer = nBuf; + } + } + + public synchronized byte[] read(int len) + { + Asserts.as(input == null?null:"已有输入流,不支持该方法调用"); + + if (buffer == null) + return new byte[0]; + + int length = buffer.remaining(); + if (length <= 0) + return new byte[0]; + + int count = length <= len?length:len; + byte[] buf = new byte[count]; + buffer.get(buf); + return buf; + } + + /*****************************************************************************/ + //NIO/BIO共用的InputStream方法 + /*****************************************************************************/ + + public synchronized int read() throws IOException + { + if (input != null) + return input.read(); + + if (buffer == null || !buffer.hasRemaining()) + return -1; + + try{return buffer.get();}catch(BufferUnderflowException e){return -1;} + } + + public synchronized int read(byte[] b, int off, int len) throws IOException + { + if (input != null) + return input.read(b, off, len); + + if (buffer == null || !buffer.hasRemaining()) + return -1; + + int pos = buffer.position(); + buffer.get(b, off, len); + return buffer.position() - pos; + } + + public synchronized int read(byte[] b) throws IOException + { + if (input != null) + return input.read(b); + + if (buffer == null || !buffer.hasRemaining()) + return -1; + + int pos = buffer.position(); + buffer.get(b); + return buffer.position() - pos; + } + + public synchronized int available() + { + if (input != null) + try{return input.available();}catch(IOException e){throw Asserts.exception(e);} + + return buffer==null?-1:buffer.remaining(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpListener.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpListener.java new file mode 100644 index 0000000..7d5e2d9 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpListener.java @@ -0,0 +1,389 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.bio.HttpBioConnection; +import org.zhiqim.httpd.nio.HttpNioConnection; +import org.zhiqim.kernel.config.Group; +import org.zhiqim.kernel.control.Queue; +import org.zhiqim.kernel.control.ThreaderController; +import org.zhiqim.kernel.control.Threadx; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Interval; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.Asserts; + +/** + * HTTP监听器接口定义 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class HttpListener extends Threadx implements Task, HttpdConstants +{ + protected static final Log log = LogFactory.getLog(HttpListener.class); + + private final HttpServer server; //服务器 + private final List connList; //连接列表 + + protected Group listenerGroup; //监听参数 + protected String listenerName; //监听名称 + protected int listenerPort; //监听端口 + protected String listenerIp; //监听网卡IP地址 + + protected int soTimeoutMs; //套接字等待连接时长,单位毫秒,等待60*1000秒 + protected int soLingerS; //套接字关闭连接时长,(TIME_WAIT和操作系统有关),单位秒,最大65535,即默认2MSL + protected int soRecvBuf; //套接字接收缓冲区大小,默认KiB + protected int soSendBuf; //套接字接收缓冲区大小,默认128KiB + protected int soIdleTimeMs; //套接字长连接最大空闲时长,单位毫秒,默认53*1000毫秒 + + protected int poMinSize; //线程池最小值 + protected int poMaxSize; //线程池最大值 + protected int poIdleTime; //线程池线程空闲时长 + protected int poQueueSize; //线程池队列大小 + + protected ThreaderController controller; //线程池控制器 + protected Log logger; //日志记录器 + + private Interval interval; //定时器,检查超时连接 + + public HttpListener(HttpServer server) + { + this.server = server; + this.connList = new ArrayList<>(); + } + + public void setGroup(Group group) + { + this.listenerGroup = group; + } + + @Override /** 线程名 */ + protected String getThreadName() + { + return listenerName; + } + + @Override /** 线程开启前 */ + protected boolean openBefore() + { + listenerName = listenerGroup.getId(); + listenerIp = listenerGroup.getString(_LISTEN_IP_ADDRESS_); + listenerPort = listenerGroup.getInt(_LISTEN_PORT_); + Asserts.as((listenerPort >= 1 && listenerPort <= 65535)?null:"未配置[%s]的port配置项,或配置的值不是端口值[1-65535]"); + + soTimeoutMs = listenerGroup.getInt(_LISTEN_SO_ITMEOUT_, 60) * 1000; + soLingerS = listenerGroup.getInt(_LISTEN_SO_LINGER_, -1); + soRecvBuf = listenerGroup.getInt(_LISTEN_SO_RECV_BUF_, KiB); + soSendBuf = listenerGroup.getInt(_LISTEN_SO_SEND_BUF_, 128 * KiB); + soIdleTimeMs = listenerGroup.getInt(_LISTEN_SO_IDLE_TIME_, 53) * 1000; + + poMinSize = listenerGroup.getInt(_LISTEN_PO_MIN_SIZE_, 20); + poMaxSize = listenerGroup.getInt(_LISTEN_PO_MAX_SIZE_, 200); + poIdleTime = listenerGroup.getInt(_LISTEN_PO_IDLE_TIME_, 600); + poQueueSize = listenerGroup.getInt(_LISTEN_PO_QUEUE_SIZE_, poMaxSize * 3); + + if (listenerGroup.isTrue(_LISTEN_ACCESS_LOG_)) + {//创建访问日志 + logger = LogFactory.getLog(listenerName); + } + + if (soIdleTimeMs > 0) + {//配置的Socket时长则作定时检查 + interval = Interval.shedule(this, soIdleTimeMs); + } + + //初始化线程控制器 + controller = new ThreaderController(); + controller.set(poMinSize, poMaxSize, poIdleTime, poQueueSize); + controller.setThreadName(listenerName); + controller.create(); + return true; + } + + @Override /** 线程关闭后 */ + protected void closeAfter() + { + //1.关闭定时任务 + if (interval != null) + { + interval.close(); + interval = null; + } + + //2.关闭处理控制器 + if (controller != null) + { + controller.close(); + controller = null; + } + + //3.清理线程池 + connList.clear(); + + //4.打印退出日志 + log.info(toString() + "退出"); + } + + /**************************************************************************/ + //通用实现方法 + /**************************************************************************/ + + /** 服务 */ + public HttpServer getServer() + { + return server; + } + + /** 协议 */ + public String getScheme() + { + return _HTTP_; + } + + /** 监听端口 */ + public int getPort() + { + return listenerPort; + } + + /** 监听名 */ + public String getName() + { + return listenerName; + } + + /** 监听网卡地址 */ + public String getIpAddress() + { + return listenerIp; + } + + /**************************************************************************/ + //Socket参数 + /**************************************************************************/ + + /** Socket连接超时时长 */ + public int getSoTimeoutMs() + { + return soTimeoutMs; + } + + /** Socket接收缓冲大小 */ + public int getSoRecvBuf() + { + return soRecvBuf; + } + + /** Socket发送缓冲大小 */ + public int getSoSendBuf() + { + return soSendBuf; + } + + /** Socket长连接空闲时长 */ + public int getSoIdleTimeMs() + { + return soIdleTimeMs; + } + + /**************************************************************************/ + //线程池参数,主要用于监控,请谨慎调用 + /**************************************************************************/ + + /** 线程池允许的最大值 */ + public int getPoMaxSize() + { + return poMaxSize; + } + + /** 线程池定义的最小值 */ + public int getPoMinSize() + { + return poMinSize; + } + + /** 线程池允许的最大队列数 */ + public int getPoQueueSize() + { + return poQueueSize; + } + + /** 线程池线程允许的空闲时长 */ + public int getPoIdleTime() + { + return poIdleTime; + } + + /** 线程池控制器 */ + public ThreaderController getController() + { + return controller; + } + + /** 线程池中当前活动数 */ + public int getThreaderActiveSize() + { + return controller.getThreaderActiveSize(); + } + + /** 线程池当前大小 */ + public int getThreaderSize() + { + return controller.getThreaderSize(); + } + + /** 线程池总完成数 */ + public long getCompletedCount() + { + return controller.getCompletedCount(); + } + + /** 线程池当前队列 */ + public Queue getQueue() + { + return controller.getQueue(); + } + + /** 线程池当前队列数 */ + public int getQueueSize() + { + return controller.size(); + } + + /**************************************************************************/ + //监听下的连接完成 + /**************************************************************************/ + + /** 删除连接 */ + public void remove(HttpConnection conn) + { + synchronized (connList) + { + connList.remove(conn); + } + } + + /** 增加连接 */ + protected HttpNioConnection add(HttpNioConnection conn) + { + synchronized (connList) + { + connList.add(conn); + } + return conn; + } + + /** 删除连接 */ + protected HttpBioConnection add(HttpBioConnection conn) + { + synchronized (connList) + { + connList.add(conn); + } + return conn; + } + + /** 线程池处理完记录日志 */ + public void finished(HttpHeader header) + { + if (logger == null) + return; + + //打印日志 + HttpSender sender = header.getSender(); + + String remoteAddr = header.getRemoteAddr(); + String headerLine = header.getHeaderLine(); + int listenerPort = header.getListenerPort(); + int status = sender.getStatus(); + + long length = 0; + if (sender instanceof HttpSenderImpl) + length = ((HttpSenderImpl)sender).getFlushLength(); + else if (sender instanceof HttpResponseImpl) + length = ((HttpResponseImpl)sender).getFlushLength(); + + String message = new StringBuilder() + .append("[").append(remoteAddr).append("]") + .append(" [").append(status).append("]") + .append(" [").append(listenerPort).append("]") + .append(" [").append(length).append("]") + .append(" [").append(headerLine).append("]") + .toString(); + + logger.info(message); + } + + /**************************************************************************/ + //连接检查 + /**************************************************************************/ + + @Override /** 定义检查 */ + public void execute() + { + int wsNum = 0, activeNum = 0; + List list = new ArrayList<>(); + synchronized (connList) + { + for (HttpConnection conn : connList) + list.add(conn); + } + + for (HttpConnection conn : list) + { + if (conn.isWebsocket()) + { + wsNum++; + continue; + } + + if (conn.isActive()) + { + activeNum++; + continue; + } + + if (conn.isOvertime()) + { + log.debug("连接[%s]空闲过长,正常关闭", conn.getId()); + conn.close(); + } + } + + int totalNum = list.size(), idleNum = totalNum - wsNum - activeNum; + list.clear();list = null; + log.info("允许最大连接[%s],当前总连接[%s]=WS[%s]+活动[%s]+空闲[%s],允许空闲[%s]秒", poMaxSize, totalNum, wsNum, activeNum, idleNum, soIdleTimeMs/1000); + } + + @Override + public String toString() + { + return new StringBuilder(getScheme()).append("监听:[") + .append("name:").append(listenerName).append(";") + .append("port:").append(listenerPort).append("]") + .toString(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpOutputStream.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpOutputStream.java new file mode 100644 index 0000000..fe0d64b --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpOutputStream.java @@ -0,0 +1,233 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Zips; + + +/** + * HTTP阻塞式输入流,通过ByteArrayOutputStream实现header和content分隔 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpOutputStream extends OutputStream implements HttpdConstants +{ + private final HttpOutputStreamWrap output; + private int chunkSize = _MAX_CHUNKED_SIZE_; + + private HttpSenderImpl sender; + private ByteArrayOutputStream content; + + private boolean chunked; + private boolean headed; + + public HttpOutputStream(HttpConnection conn) + { + this.output = new HttpOutputStreamWrap(conn); + this.content = new ByteArrayOutputStream(); + } + + public void setSender(HttpSenderImpl sender) + { + this.sender = sender; + } + + public void setChunkSize(int chunkSize) + { + if (chunkSize < 4 * KiB) + this.chunkSize = 4 * KiB; + else if (chunkSize > _MAX_CHUNKED_SIZE_) + this.chunkSize = _MAX_CHUNKED_SIZE_; + else + this.chunkSize = chunkSize; + } + + /*************************************************************************************/ + //继承和实现的方法 + /*************************************************************************************/ + + public void write(int b) throws IOException + { + if (sender.isCommitted()) + return; + + if (content.size() >= chunkSize) + {//上次最后满一次分块 + flush(); + } + + content.write(b); + } + + public void write(byte[] b, int off, int len) throws IOException + { + if (sender.isCommitted()) + return; + + if (content.size() >= chunkSize) + {//上次最后满一次分块 + flush(); + } + + if (content.size() + len <= chunkSize) + {//不足或刚好一次分块,直接添加即可 + content.write(b, off, len); + return; + } + + //超过分块数 + int page = (content.size() + len - 1) / chunkSize + 1; + + //先写第一块,并刷入 + int firstLen = chunkSize - content.size(); + content.write(b, off, firstLen); + flush(); + + //后续块 + int length = firstLen; + for (int i=1;i= chunkSize) + {//满即刷入 + flush(); + } + } + } + + public void flush() throws IOException + { + if (!headed) + { + output.write(sender.buildChunkedHeader(true)); + headed = true; + } + + writeChunked(); + } + + /*************************************************************************************/ + //内部调用的方法 + /*************************************************************************************/ + + /** 重置内容,如前面有写入缓冲,但未提交发现错误 */ + public void reset() + { + content.reset(); + } + + /** 提交流 */ + public void commit() throws IOException + { + if (!chunked) + {//未分块,写入头和内容 + output.write(sender.buildChunkedHeader(false)); + content.writeTo(output); + output.flush(); + } + else + {//分块,写入最后块和结尾 + if (content.size() > 0){ + writeChunked(); + } + + writeChunkedEnd(); + } + } + + /** 关闭流 */ + public void finished() throws IOException + { + if (content != null) + { + content.close(); + content = null; + } + + output.close(); + } + + /*************************************************************************************/ + //整包写入 + /*************************************************************************************/ + + public boolean isChunked() + { + return chunked; + } + + public boolean processGZipCompress() + { + try + { + content = Zips.gzip(content); + return true; + } + catch (Exception ex) + { + return false; + } + } + + /** 获取写入的长度 */ + public long getOutputLength() + { + return output.length(); + } + + public int getContentLength() + { + return content.size(); + } + + /*************************************************************************************/ + //写入分块数据 + /*************************************************************************************/ + + private void writeChunked() throws IOException + { + output.write(Ints.toBytesHex(content.size())); + output.write(_CRLF_); + content.writeTo(output); + output.write(_CRLF_); + output.flush(); + + content.reset(); + chunked = true; + } + + private void writeChunkedEnd() throws IOException + { + output.write(_0_); + output.write(_CRLF_); + output.write(_CRLF_); + output.flush(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpOutputStreamWrap.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpOutputStreamWrap.java new file mode 100644 index 0000000..0f2ba9e --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpOutputStreamWrap.java @@ -0,0 +1,60 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; +import java.io.OutputStream; + +/** + * 记录输出流长度流封装类 + * + * @version v1.0.0 @author zouzhigang 2017-6-14 新建与整理 + */ +public class HttpOutputStreamWrap extends OutputStream +{ + private final HttpConnection conn; + private long length; + + public HttpOutputStreamWrap(HttpConnection conn) + { + this.conn = conn; + } + + @Override + public void write(int b) throws IOException + { + byte[] buf = new byte[]{(byte)b}; + write(buf, 0, 1); + } + + @Override + public void write(byte[] b, int off, int len) throws IOException + { + conn.write(b, off, len); + length += len; + } + + public long length() + { + return length; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpRequest.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpRequest.java new file mode 100644 index 0000000..7108296 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpRequest.java @@ -0,0 +1,891 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; +import java.io.InputStream; +import java.security.cert.X509Certificate; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.httpd.validate.Validate; + +/** + * HTTP请求接口定义 + * + * @version v1.0.0 @author zouzhigang 2016-7-15 新建与整理 + */ +public interface HttpRequest extends HttpHeader +{ + /** 获取请求编号 */ + public String getId(); + + /** 获取产生时间戳 */ + public long getTimeMillis(); + + /***********************************************************************/ + //请求状态处理和判断 + /***********************************************************************/ + + /** 设置拦截中 */ + public void setStepInterceptor(); + + /** 设置Action处理中 */ + public void setStepAction(); + + /** 获取当前处理环节 */ + public int getStep(); + + /** 获取当前处理环节描述 */ + public String getStepDesc(); + + /** 是否可读,已读头部之后可读 */ + public boolean isRead(); + + /** 是否可编辑,提交之前可编辑 */ + public boolean isEditable(); + + /** 是否已提交,提交之后不允许再操作request和response */ + public boolean isCommitted(); + + /***********************************************************************/ + //获取和判断请求行信息,包括协议、方法、版本、URI等 + /***********************************************************************/ + + /** 获取协议格式 */ + public String getScheme(); + + /** 获取端口信息 */ + public int getPort(); + + /** 获取URI信息 */ + public String getRequestURI(); + + /** 获取URL信息 */ + public String getRequestURL(); + + /***********************************************************************/ + //获取和判断请求头部信息 + /***********************************************************************/ + + /** 获取消息头名称迭代器 */ + public Iterator getHeaderNames(); + + /** 获取请求头字符串 */ + public String getHeaderString(); + + /** 获取请求头属性 */ + public String getHeader(String key, String defaultValue); + + /** 获取请求头属性整型值 */ + public int getHeaderInt(String key); + + /** 获取请求头属性整型值 */ + public int getHeaderInt(String key, int defaultValue); + + /** 获取请求头属性长整型值 */ + public long getHeaderLong(String key); + + /** 获取请求头属性长整型值 */ + public long getHeaderLong(String key, long defaultValue); + + /** 获取组装内容类型 */ + public String getContentTypeMimeEncoding(); + + /** 获取来源地址 */ + public String getReferer(); + + /** 获取知启蒙定义的客户端类型(mobile|www),该值也会设置到request的属性中 */ + public String getZhiqimClientType(); + + /** 是否是异isXMLHttpRequest */ + public boolean isXMLHttpRequest(); + + /** 是否手机端 */ + public boolean isMobile(); + + /** 是否微信 */ + public boolean isMicroMessenger(); + + /** 是否IE浏览器 */ + public boolean isIE(); + + /** 是否是火狐浏览器 */ + public boolean isFirefox(); + + /** 是否是Webkit浏览器 */ + public boolean isWebkit(); + + /** 是否是chrome浏览器 */ + public boolean isChrome(); + + /** 是否是Safari浏览器 */ + public boolean isSafari(); + + /***********************************************************************/ + //获取监听、服务器、上下文环境、响应、会话相关 + /***********************************************************************/ + + /** 获取请求对应的响应对象 */ + public HttpResponse getResponse(); + + /** 获取请求所在的服务 */ + public HttpServer getServer(); + + /** 获取上下文环境路径 */ + public String getContextPath(); + + /** 获取上下文环境名称 */ + public String getContextName(); + + /** 获取上下文环境版本 */ + public String getContextVersion(); + + /** 设置上下文环境属性 */ + public void setContextAttribute(String key, Object value); + + /** 设置上下文环境属性值(通过类结构) */ + public void setContextAttribute(Class key, T value); + + /** 获取上下文环境属性值 */ + public Object getContextAttribute(String key); + + /** 获取上下文环境属性值(通过类结构) */ + public T getContextAttribute(Class key); + + /** 获取上下文环境属性值 */ + public Object getContextAttribute(String key, Object defaultValue); + + /** 获取上下文环境属性值字符串 */ + public String getContextAttributeString(String key); + + /** 获取上下文环境属性值字符串 */ + public String getContextAttributeString(String key, String defaultValue); + + /** 获取上下文环境属性值整型 */ + public int getContextAttributeInt(String key); + + /** 获取上下文环境属性值整型 */ + public int getContextAttributeInt(String key, int defaultValue); + + /** 获取上下文环境属性值长整型 */ + public long getContextAttributeLong(String key); + + /** 获取上下文环境属性值长整型 */ + public long getContextAttributeLong(String key, long defaultValue); + + /** 获取上下文环境属性值布尔型 */ + public boolean getContextAttributeBoolean(String key, boolean defaultValue); + + /** 判断上下文环境是否有属性值 */ + public boolean hasContextAttribute(String key); + + /** 获取当前WEB目录根目录,注意没有/结尾 */ + public String getResourcePath(); + + /** 获取上下文环境下绝对路径转为根环境下的绝对路径,如contextPath=/doc,path=/index.htm,得到/doc/index.htm */ + public String getRootPath(String path); + + /** 获取当前WEB目录路径转换成绝对路径 */ + public String getRealPath(String path); + + /** 获取SSL证书 */ + public X509Certificate[] getCertificates(); + + /***********************************************************************/ + //设置和获取Session中属性 + /***********************************************************************/ + + /** 获取请求用户名 */ + public String getRequestName(); + + /** 设置请求用户名 */ + public void setRequestName(String name); + + /** 获取会话编号 */ + public String getSessionId(); + + /** 获取请求对应的会话环境 */ + public HttpSession getSession(); + + /** 删除会话 */ + public void invalidateSession(); + + /** 判断是否绑定了登录用户 */ + public boolean hasSessionUser(); + + /** 绑定会话登录用户 */ + public void bindSessionUser(HttpSessionUser sessionUser); + + /** 解除绑定会话登录用户 */ + public void unbindSessionUser(); + + /** 判断是否绑定了登录用户,且指定的会话用户类(HttpSessionUser子类) */ + public boolean hasSessionUser(Class clazz); + + /** 获取会话用户信息,且指定的会话用户类(HttpSessionUser子类) */ + public T getSessionUser(Class clazz); + + /** 获取会话默认的用户信息 */ + public HttpSessionUser getSessionUser(); + + /** 获取会话默认的登录名 */ + public String getSessionName(); + + /** 设置会话属性 */ + public void setSessionAttribute(String name, Object value); + + /** 获取会话属性值 */ + public Object getSessionAttribute(String name); + + /** 获取会话属性值 */ + public Object getSessionAttribute(String name, Object defaultValue); + + /** 获取会话属性值字符串 */ + public String getSessionAttributeString(String name); + + /** 获取会话属性值字符串 */ + public String getSessionAttributeString(String name, String defaultValue); + + /** 获取会话属性值整型 */ + public int getSessionAttributeInt(String name); + + /** 获取会话属性值整型 */ + public int getSessionAttributeInt(String name, int defaultValue); + + /** 获取会话属性值长整型 */ + public long getSessionAttributeLong(String name); + + /** 获取会话属性值长整型 */ + public long getSessionAttributeLong(String name, long defaultValue); + + /** 判断会话是否有属性值 */ + public boolean hasSessionAttribute(String name); + + /***********************************************************************/ + //获取Cookie数据或数组 + /***********************************************************************/ + + /** 获取指定名称的Cookie */ + public String getCookie(String name); + + /** 获取Cookie,如果没有值或值为空字符串返回缺省值 */ + public String getCookie(String name, String defaultValue); + + /** 获取请求中Cookie数组 */ + public HttpCookie[] getCookies(); + + /** 删除请求中的Cookie值 */ + public void removeCookie(String name); + + /** 增加Cookie到响应中 */ + public void addCookieToResponse(String name, String value); + + /** 增加Cookie到响应中 */ + public void addCookieToResponse(String name, String value, int seconds); + + /** 增加Cookie到响应中 */ + public void addCookieToResponse(HttpCookie cookie); + + /** 删除Cookie到响应中 */ + public void removeCookieToResponse(String name); + + /***********************************************************************/ + //获取请求中URL匹配的参数 + /***********************************************************************/ + + /** 获取通配符参数列表 */ + public List getParameterMatch(); + + /** + * 获取通配符参数值 + * + * @param index 参数匹配位置 + * @return 有过滤的参数值 + */ + public String getParameterMatch(int index); + + /** + * 获取通配符参数值 + * + * @param index 参数匹配位置 + * @return 有过滤的参数值 + */ + public long getParameterMatchLong(int index); + + /** + * 获取通配符参数值 + * + * @param index 参数匹配位置 + * @return 有过滤的参数值 + */ + public int getParameterMatchInt(int index); + + /***********************************************************************/ + //获取请求中URL和Content中的数据,包括URL和Content中的数据 + /***********************************************************************/ + + /** + * 获取参数哈唏表(未安全过滤),先填入url中参数表,再用content参数表覆盖,得到全部参数表 + * + * @return 得到全部参数表 + */ + public HashMap getParameterMap(); + + /** 判断是否有参数 */ + public boolean hasParameter(String name); + + /** + * 获取参数值并安全过滤,优先检查content中是否存在,如果不存在才检查url中 + * + * @param name 参数名 + * @return 有过滤的参数值 + */ + public String getParameter(String name); + + /** + * 获取动态参数对象信息 + * + * @param clazz 类结构 + * @return 返回赋值后的对象 + * @throws 异常需要捕捉 + */ + public T getParameter(Class clazz) throws IllegalAccessException; + + /** + * 获取参数值(未过滤),优先检查content中是否存在,如果不存在才检查url中 + * + * @param name 参数名 + * @return 有过滤的参数值 + */ + public String getParameterNoFilter(String name); + + /** + * 获取参数值并安全过滤,优先检查content中是否存在,如果不存在才检查url中,都不存在或值为空白返回缺省值 + * + * @param name 参数名 + * @param defaultValue 不存在或为空时的缺省值 + * @return 有过滤的参数值 + */ + public String getParameter(String name, String defaultValue); + + /** + * 获取参数值(未过滤),优先检查content中是否存在,如果不存在才检查url中,都不存在或值为空白返回缺省值 + * + * @param name 参数名 + * @param defaultValue 不存在或为空时的缺省值 + * @return 有过滤的参数值 + */ + public String getParameterNoFilter(String name, String defaultValue); + + /** + * 获取参数整型,非整型返回-1的值 + * + * @param name 参数名 + * @return 整数值 + */ + public int getParameterInt(String name); + + /** + * 获取参数整型,非整型返回缺省值 + * + * @param name 参数名 + * @param defaultValue 缺省值 + * @return 整数值 + */ + public int getParameterInt(String name, int defaultValue); + + /** + * 获取参数长整型,非整型返回-1的值 + * + * @param name 参数名 + * @return 长整型 + */ + public long getParameterLong(String name); + + /** + * 获取参数长整型,非整型返回-1的值 + * + * @param name 参数名 + * @param defaultValue 缺省值 + * @return 长整型 + */ + public long getParameterLong(String name, long defaultValue); + + /** + * 获取参数布尔型,非布尔型返回false的值 + * + * @param name 参数名 + * @return 布尔型 + */ + public boolean getParameterBoolean(String name); + + /** + * 获取参数布尔型,非布尔型返回false的值 + * + * @param name 参数名 + * @param defaultValue 缺省值 + * @return 布尔型 + */ + public boolean getParameterBoolean(String name, boolean defaultValue); + + /** + * 获取两位小数的金额值,格式不对返回-1 + * + * @param name 参数名 + * @return 金额值,如果从请求中获取的格式不对,则返回-1 + */ + public int getParameterAmount2R(String name); + + /** + * 获取两位小数的金额值 + * + * @param name 参数名 + * @param defaultValue 缺省值 + * @return 金额值,如果从请求中获取的格式不对,则返回缺省值 + */ + public int getParameterAmount2R(String name, int defaultValue); + + /** + * 获取两位小数的金额值长整型,格式不对返回-1 + * + * @param name 参数名 + * @param defaultValue 缺省值 + * @return 金额值,如果从请求中获取的格式不对,则返回-1 + */ + public long getParameterAmount2RLong(String name); + + /** + * 获取两位小数的金额值长整型 + * + * @param name 参数名 + * @param defaultValue 缺省值 + * @return 金额值,如果从请求中获取的格式不对,则返回缺省值 + */ + public long getParameterAmount2R(String name, long defaultValue); + + /** + * 获取参数值并安全过滤,并转化为数组(逗号格式),优先检查content中是否存在,如果不存在才检查url中 + * + * @param name 参数名 + * @return 有过滤后的逗号格式数组值 + */ + public String[] getParameterValues(String name); + + /** + * 获取参数值(未过滤),并转化为数组(逗号格式),优先检查content中是否存在,如果不存在才检查url中 + * + * @param name 参数名 + * @return 有过滤后的逗号格式数组值 + */ + public String[] getParameterValuesNoFilter(String name); + + /***********************************************************************/ + //获取请求中URL中的数据 + /***********************************************************************/ + + /** 获取URL参数哈唏表(值未过滤) */ + public HashMap getParameterMapOnURL(); + + /** 判断是否有URL参数 */ + public boolean hasParameterOnURL(String name); + + /** 获取URL参数值,并安全过滤 */ + public String getParameterOnURL(String name); + + /** 获取URL参数值,并安全过滤 */ + public String getParameterOnURL(String name, String defaultValue); + + /** 获取URL参数值(未过滤) */ + public String getParameterNoFilterOnURL(String name); + + /** 获取URL参数值(未过滤) */ + public String getParameterNoFilterOnURL(String name, String defaultValue); + + /** 获取URL参数整型,非整型返回-1的值 */ + public int getParameterIntOnURL(String name); + + /** 获取URL参数整型,非整型返回缺省值 */ + public int getParameterIntOnURL(String name, int defaultValue); + + /** 获取URL参数长整型,非整型返回-1的值 */ + public long getParameterLongOnURL(String name); + + /** 获取URL参数长整型,非整型返回-1的值 */ + public long getParameterLongOnURL(String name, long defaultValue); + + /** 获取两位小数的金额值 */ + public int getParameterAmount2ROnURL(String name, int defaultValue); + + /** 获取两位小数的金额值长整型 */ + public long getParameterAmount2ROnURL(String name, long defaultValue); + + /** 获取URL参数值数组,并安全过滤 */ + public String[] getParameterValuesOnURL(String name); + + /***********************************************************************/ + //获取请求中Content中的数据 + /***********************************************************************/ + + /** 获取内容输入流 */ + public InputStream getInputStream(); + + /** 获取内容输入流字符串 */ + public String getInputStreamString(); + + /** 获取内容参数哈唏表(值未过滤) */ + public HashMap getParameterMapOnCNT(); + + /** 判断是否有内容参数 */ + public boolean hasParameterOnCNT(String name); + + /** 获取内容参数值,并安全过滤 */ + public String getParameterOnCNT(String name); + + /** 获取内容参数值,并安全过滤 */ + public String getParameterOnCNT(String name, String defaultValue); + + /** 获取内容参数值(未过滤) */ + public String getParameterNoFileterOnCNT(String name); + + /** 获取内容参数值(未过滤) */ + public String getParameterNoFileterOnCNT(String name, String defaultValue); + + /** 获取内容参数整型,非整型返回-1的值 */ + public int getParameterIntOnCNT(String name); + + /** 获取内容参数整型,非整型返回缺省值 */ + public int getParameterIntOnCNT(String name, int defaultValue); + + /** 获取内容参数长整型,非整型返回-1的值 */ + public long getParameterLongOnCNT(String name); + + /** 获取内容参数长整型,非整型返回-1的值 */ + public long getParameterLongOnCNT(String name, long defaultValue); + + /** 获取内容参数两位小数的金额值 */ + public int getParameterAmount2ROnCNT(String name, int defaultValue); + + /** 获取内容参数两位小数的金额值长整型 */ + public long getParameterAmount2ROnCNT(String name, long defaultValue); + + /** 获取内容参数值数组 */ + public String[] getParameterValuesOnCNT(String name); + + /** 设置参数值到URL表中 */ + public void setParameterOnURL(String name, Object value); + + /** 设置参数值到CNT表中 */ + public void setParameterOnCNT(String name, Object value); + + /***********************************************************************/ + //设置和获取请求中属性 + /***********************************************************************/ + + /** 获取属性列表 */ + public Map getAttributeMap(); + + /** 获取属性值 */ + public Object getAttribute(String name); + + /** 获取属性值,如果无该属性则返回缺省值 */ + public Object getAttribute(String name, Object defaultValue); + + /** 获取属性值字符串 */ + public String getAttributeString(String name); + + /** 获取属性值字符串,如果无该属性则返回缺省值 */ + public String getAttributeString(String name, String defaultValue); + + /** 获取属性值整型 */ + public int getAttributeInt(String name); + + /** 获取属性值整型,如果无该属性则返回缺省值 */ + public int getAttributeInt(String name, int defaultValue); + + /** 获取属性值整型 */ + public long getAttributeLong(String name); + + /** 获取属性值整型,如果无该属性则返回缺省值 */ + public long getAttributeLong(String name, int defaultValue); + + /** 判断属性是否存在 */ + public boolean hasAttribute(String name); + + /** 设置属性 */ + public void setAttribute(String name, Object value); + + /***********************************************************************/ + //获取请求/会话/上下文环境中嵌套属性,有则返回 + /***********************************************************************/ + + /** 获取属性值 */ + public Object getNestAttribute(String name); + + /** 获取属性值,如果无该属性则返回缺省值 */ + public Object getNestAttribute(String name, Object defaultValue); + + /** 获取属性值字符串 */ + public String getNestAttributeString(String name); + + /** 获取属性值字符串,如果无该属性则返回缺省值 */ + public String getNestAttributeString(String name, String defaultValue); + + /** 获取属性值整型 */ + public int getNestAttributeInt(String name); + + /** 获取属性值整型,如果无该属性则返回缺省值 */ + public int getNestAttributeInt(String name, int defaultValue); + + /** 获取属性值整型 */ + public long getNestAttributeLong(String name); + + /** 获取属性值整型,如果无该属性则返回缺省值 */ + public long getNestAttributeLong(String name, int defaultValue); + + /** 判断属性是否存在 */ + public boolean hasNestAttribute(String name); + + /***********************************************************************/ + //内部重定向请求和上下文环境下绝对路径 + /***********************************************************************/ + + /** + * 内部重定向请求,支持从一个Action内部转到新的Action处理 + * + * @param pathInContext 上下文内部路径,即对应的新Action的配置路径 + * @throws IOException IO异常 + * @throws HttpException HTTP异常 + */ + public void forwardTo(String pathInContext) throws HttpException, IOException; + + /** 是否已标志为已内部重定向 */ + public boolean hasForward(); + + /***********************************************************************/ + //以下为响应相关配置 + /***********************************************************************/ + + + /***********************************************************************/ + //从请求中设置属性到响应中 + /***********************************************************************/ + + /** + * 设置响应配置信息 + * + * @param view 转向到视图页 + * @param include 转向到视图页的嵌套地址 + * @param forward 转向到新的路径 + * @param redirect 重定向到新的路径 + * @param method 执行类的方法 + * @param alert 执行后的警告信息 + */ + public void setResponseConfig(String view, String include, String forward, String redirect, String method, String alert); + + /** 设置响应私用缓存 */ + public void setResponsePrivateCache(); + + /** 设置响应头不缓存 */ + public void setResponseNoCache(); + + /** 设置响应为UTF8编码*/ + public void setResponseEncodingUTF8(); + + /***********************************************************************/ + //设置响应的配置信息 + /***********************************************************************/ + + /** 修改为是否转向 */ + public void setReturn(boolean isReturn); + + /** 设置成功失败信息 */ + public void setAlertMsg(String errorMsg); + + /** 修改视图页和嵌套地址,和转向页互斥 */ + public void setView(String view, String include); + + /** 修改为内部转向地址 */ + public void setForward(String forwardTo); + + /** 修改重定向,状态码为602 */ + public void setRedirect(String redirect); + + /** 修改重定向,和视图页互斥,但不改变responseStatus值 */ + public void setRedirectInner(String redirect); + + /** 修改父页重定向,状态码为601 */ + public void setRedirectParent(String redirect); + + /** 修改顶页重定向 ,状态码为603*/ + public void setRedirectTop(String redirect); + + /** 修改重定向前提示错误,状态码为602 */ + public void setRedirect(String redirect, String error); + + /** 修改父页重定向前提示错误,状态码为601 */ + public void setRedirectParent(String redirect, String error); + + /** 修改顶页重定向前提示错误,状态码为603 */ + public void setRedirectTop(String redirect, String error); + + /***********************************************************************/ + //从请求中设置响应状态和文本属性 + /***********************************************************************/ + + /** 获取响应属性码 */ + public int getResponseStatus(); + + /** 获取响应属性文本 */ + public String getResponseText(); + + /** 判断响应属性是不是成功 */ + public boolean isResponseSuccess(); + + /** 判断响应属性是不是重定向 */ + public boolean isResponseRedirect(); + + /** 设置响应结果属性,指定状态码但不能小于0,不能填70-699之间已知的状态码 */ + public void setResponseResult(int responseStatus, String responseText); + + /** 设置响应结果属性,指定状态码但不能小于0,不能填70-699之间已知的状态码 */ + public void setResponseResult(Int result); + + /** 设置响应结果属性,状态码为0,表示成功 */ + public void setResponseResult(String responseText); + + /** 设置响应结果属性,状态码为699,表示通用的失败 */ + public void setResponseError(String responseText); + + /**********************************************/ + //加上四个常用特性方法,用于运行时修改设置 + /**********************************************/ + + /** 增加一个返回上一页快捷方式 */ + public void returnHistory(); + + /** 增加一个错误返回上一页并提示错误的快捷方式 */ + public void returnHistory(String errorMsg); + + /** 增加一个弹出窗口时关闭快捷方式 */ + public void returnCloseWindow(); + + /** 增加一个弹出窗口时关闭并提示错误的快捷方式 */ + public void returnCloseWindow(String errorMsg); + + /** 增加一个弹出对话框时关闭快捷方式 */ + public void returnCloseDialog(); + + /** 增加一个弹出对话框时关闭并提示错误的快捷方式 */ + public void returnCloseDialog(String errorMsg); + + /** 增加参数 */ + public void addParam(String key, Object value); + + /*******************************************************************************/ + //转向控制字段相关属性 + /*******************************************************************************/ + + /** + * 检查是否转向,两种情况

            + * + * 1、当设置成强制不转向时,即不转向
            + * 2、当为转向时,检查视图页和转向页是否存在,存在一个即转向,否则不转向
            + */ + public boolean isReturn(); + + /** 获取Action在execute中转向的方法名 */ + public String getExecuteMethod(); + + /** 获取转向定制的提示信息 */ + public String getAlertMsg(); + + /** 获取视图信息 */ + public String getView(); + + /** 获取视图信息嵌套地址 */ + public String getInclude(); + + /** 获取内转向地址 */ + public String getForward(String encoding); + + /** 获取重定向地址 */ + public String getRedirect(String encoding); + + /** 获取重定向内部定义的地址 */ + public String getRedirectInner(); + + /***********************************************/ + //以下判断是否强制要求转向 + /***********************************************/ + + /** + * 是否强制转向 + * + * 1.如果有失败提示或成功提示,需强制转向 + * 2.由业务指定返回上一页或关闭,需强制转向 + */ + public boolean isForceReturn(); + + /** + * 获取强制转向类型 + * + * 1.返回上一页 + * 2.关闭当前窗口 + * 3.关闭对话框 + * 4.调用Javascript + * 0.表示正常连接 + * @return int 类型 + */ + public int getForceReturnType(); + + /*******************************************************************************/ + //验证相关属性 + /*******************************************************************************/ + + /** 获取验证列表 */ + public List getValidateList(); + + /** 获取验证脚本 */ + public String getValidateScript(); + + /** 获取验证提交脚本 */ + public String getValidateSubmitScript(); + + /** 增加验证信息 */ + public void addValidate(Validate validate); + + /** 清除所有的验证信息 */ + public void clearValidate(); + + /** 检查验证信息 */ + public boolean chkValidate(); + + /** 设置验证确认信息 */ + public void setValidateConfirm(String confirm); + + /** 设置验证提交时是否按钮变灰,默认变灰 */ + public void setValidateGray(boolean isGray); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpRequestAbs.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpRequestAbs.java new file mode 100644 index 0000000..52de43b --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpRequestAbs.java @@ -0,0 +1,1783 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.util.Amounts; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Htmls; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; + +/** + * HTTP请求抽象类

            + * 1、把公共方法集中在抽象类
            + * 2、隔离内部方法(仅公开HttpRequest接口)
            + * + * @version v1.5.0 @author zouzhigang 2018-9-12 新建与整理 + */ +public abstract class HttpRequestAbs extends HttpRequestResponse +{ + //相关类 + protected HttpHeaderAbs header; + protected HttpConnection conn; + protected HttpServer server; + protected HttpContext context; + protected InputStream input; + + //四种键值表 + protected HashMapSS urlParamMap; + protected HashMapSS cntParamMap; + protected HashMapSS cookieMap; + protected HashMapSO attributeMap; + + //内容流 + protected ByteArrayInputStream bis; + + //会话相关参数 + protected HttpSession session; + protected String requestName; + + protected transient boolean hasForward; + + public HttpRequestAbs(HttpHeaderAbs header) + { + this.header = header; + this.conn = header.getConnection(); + this.server = header.getServer(); + this.context = header.getContext(); + this.input = header.getInputStream(); + + this.urlParamMap = new HashMapSS(); + this.cntParamMap = new HashMapSS(); + this.cookieMap = new HashMapSS(); + this.attributeMap = new HashMapSO(); + } + + public abstract boolean parseContent() throws IOException; + + /***********************************************************************/ + //解析请求头、内容、会话和证书等 + /***********************************************************************/ + + /** + * 解析内容类型、URL和Cookies等,该部分需在context设置之后操作,从parseHeader中分离出来,如果Context没找到,解析也没意义 + */ + public void parseHeaderByContextOK() throws HttpException + { + //第七步,检查最大内容长度,如果配置为0表示不检查,>0表示检查大小,默认8M + int maxContentLength = context.getMaxContentLength(); + if (maxContentLength > 0) + { + int cLen = getContentLength(); + if (cLen > maxContentLength) + throw new HttpException(_413_REQUEST_ENTITY_TOO_LARGE_); + } + + //第八步,如果是HTTPS代理,有证书则还原证书,&设置客户端类型 + String sslCert = getHeader(_SSL_CERT_); + if (Validates.isNotEmpty(sslCert)) + parseHeaderCert(sslCert); + + setAttribute(_ZHIQIM_CLIENT_TYPE_, getZhiqimClientType()); + + //第九步,获取?之后的GET参数,并放置到getParams表中 + String queryString = header.getUri().getQuery(); + Urls.toMap(queryString, urlParamMap.instance(), header.getCharacterEncoding()); + + //第十步,解析Cookies,并放置到cookies表中 + String cookieString = getHeader(_COOKIE_); + if (cookieString != null) + { + String[] cookieArray = cookieString.split(";"); + for (String cookieInfo : cookieArray) + { + String[] cookieNameValue = cookieInfo.split("="); + if (cookieNameValue.length < 2) + continue; + + String name = cookieNameValue[0].trim(); + if (cookieMap.containsKey(name)) + continue;//已有表示前面的更符合规则,如/admin/下的jsessionid时,同时也会传/下的jsessionid,此时以前面的为准 + + String value = cookieNameValue[1].trim(); + cookieMap.put(name, Urls.decodeUTF8(value));//强制规定UTF8编码,防止切换编码时读取异常 + } + } + } + + /** + * 解析Get|Post|Cookie|Session信息,解析必须在context有效之后 + * + * @throws IOException IO异常 + */ + public void parseGetPostCookieSession() throws IOException + { + //第十一步,解析sesionId,组装session + HttpSessionManager sessionManager = context.getSessionManager(); + if (sessionManager == null) + return; + + String sessionId = null; + if (!context.isCookieUse()) + sessionId = urlParamMap.get(sessionManager.getSessionIdName()); + else + sessionId = cookieMap.get(sessionManager.getSessionIdName()); + + if (Validates.isEmptyBlank(sessionId) || !sessionManager.hasSession(sessionId)) + {//无会话标志或已过期或不一致,新建会话 + + session = sessionManager.newSession(Ids.uuid()); + session.setSessionIp(getRemoteAddr()); + session.setUserAgent(getUserAgent()); + + //创建时设置到会话管理器中,如果有浸入式更换sessionId,HttpResponse会重设置 + sessionManager.setSession(session); + } + else + {//有会话标志,设置最后访问时间 + + session = sessionManager.getSession(sessionId); + session.updateInfo(getRemoteAddr(), getUserAgent()); + } + } + + /** 解析Nginx的证书 */ + private void parseHeaderCert(String sslCert) + { + try + { + sslCert = sslCert.replaceAll("\t", "\n"); + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + ByteArrayInputStream bis = new ByteArrayInputStream(sslCert.getBytes()); + X509Certificate cert = (X509Certificate)cf.generateCertificate(bis); + header.setCertificates(new X509Certificate[]{cert}); + } + catch (CertificateException e) + { + //不处理 + } + } + + /***********************************************************************/ + //获取监听、服务器、上下文环境、响应、会话相关 + /***********************************************************************/ + + /** 获取连接中的日志对象 */ + public Log getLog() + { + return header.getLog(); + } + + /** 获取发送器 */ + public HttpSender getSender() + { + return header.getSender(); + } + + /** 获取请求编号 */ + public String getId() + { + return header.getId(); + } + + /** 获取产生时间戳 */ + public long getTimeMillis() + { + return header.getReceiveTimeMillis(); + } + + /** 获取对应的HTTP监听器 */ + public HttpListener getListener() + { + return header.getListener(); + } + + /** 获取对应的HTTP监听器监听端口 */ + public int getListenerPort() + { + return header.getListener().getPort(); + } + + /** 获取对应的HTTP服务器,注意只有host有效时才有 */ + public HttpServer getServer() + { + return server; + } + + /** 获取HTTP连接 */ + public HttpConnection getConnection() + { + return header.getConnection(); + } + + /** 判断是否WebSocket */ + public boolean isWebSocket() + { + return header.isWebSocket(); + } + + /** 获取请求对应的响应对象 */ + public HttpResponse getResponse() + { + return header.getResponse(); + } + + @Override /** 读取可配置值 */ + public String getConfiguration() + { + return context.getConfiguration(); + } + + /** 获取请求正在处理的上下文环境 */ + public HttpContext getContext() + { + return context; + } + + /** 获取上下文环境路径 */ + public String getContextPath() + { + return context.getContextPath(); + } + + /** 获取上下文环境名称 */ + public String getContextName() + { + return context.getContextName(); + } + + /** 获取上下文环境版本 */ + public String getContextVersion() + { + return context.getContextVersion(); + } + + /** 设置上下文环境属性 */ + public void setContextAttribute(String key, Object value) + { + context.setAttribute(key, value); + } + + /** 设置上下文环境属性值(通过类结构) */ + public void setContextAttribute(Class key, T value) + { + context.setAttribute(key, value); + } + + /** 获取上下文环境属性值 */ + public Object getContextAttribute(String key) + { + return context.getAttribute(key); + } + + /** 获取上下文环境属性值(通过类结构) */ + public T getContextAttribute(Class key) + { + return context.getAttribute(key); + } + + /** 获取上下文环境属性值 */ + public Object getContextAttribute(String key, Object defaultValue) + { + return context.getAttribute(key, defaultValue); + } + + /** 获取上下文环境属性值字符串 */ + public String getContextAttributeString(String key) + { + return context.getAttributeString(key); + } + + /** 获取上下文环境属性值字符串 */ + public String getContextAttributeString(String key, String defaultValue) + { + return context.getAttributeString(key, defaultValue); + } + + /** 获取上下文环境属性值整型 */ + public int getContextAttributeInt(String key) + { + return context.getAttributeInt(key); + } + + /** 获取上下文环境属性值整型 */ + public int getContextAttributeInt(String key, int defaultValue) + { + return context.getAttributeInt(key, defaultValue); + } + + /** 获取上下文环境属性值长整型 */ + public long getContextAttributeLong(String key) + { + return context.getAttributeLong(key); + } + + /** 获取上下文环境属性值长整型 */ + public long getContextAttributeLong(String key, long defaultValue) + { + return context.getAttributeLong(key, defaultValue); + } + + /** 获取上下文环境属性值布尔型 */ + public boolean getContextAttributeBoolean(String key, boolean defaultValue) + { + return context.getAttributeBoolean(key, defaultValue); + } + + /** 判断上下文环境是否有属性值 */ + public boolean hasContextAttribute(String key) + { + return context.hasAttribute(key); + } + + @Override/** 获取当前WEB目录根目录,注意没有/结尾 */ + public String getResourcePath() + { + return context.getResourcePath(); + } + + @Override/** 获取当前WEB目录路径转换成绝对路径 */ + public String getRealPath(String path) + { + return context.getRealPath(path); + } + + @Override/** 获取上下文环境下绝对路径转为根环境下的绝对路径,如contextPath=/doc,path=/index.htm,得到/doc/index.htm */ + public String getRootPath(String path) + { + return context.getRootPath(path); + } + + @Override + public X509Certificate[] getCertificates() + { + return header.getCertificates(); + } + + /***********************************************************************/ + //请求状态处理和判断 + /***********************************************************************/ + + @Override /** 是否可读,已读头部之后可读 */ + public boolean isRead() + { + return header.isRead(); + } + + @Override /** 是否可编辑,提交之前可编辑 */ + public boolean isEditable() + { + return header.isEditable(); + } + + @Override /** 是否已提交,提交之后不允许再操作request和response */ + public boolean isCommitted() + { + return header.isCommitted(); + } + + @Override /** 设置拦截中 */ + public void setStepInterceptor() + { + header.setStep(_08_INTERCEPTOR_); + } + + @Override /** 设置Action处理中 */ + public void setStepAction() + { + header.setStep(_09_ACTION_); + } + + @Override /** 获取当前处理环节 */ + public int getStep() + { + return header.getStep(); + } + + @Override /** 获取当前处理环节描述 */ + public String getStepDesc() + { + return header.getStepDesc(); + } + + /***********************************************************************/ + //设置和获取Session中属性 + /***********************************************************************/ + + /** 获取请求用户名 */ + public String getRequestName() + { + return requestName; + } + + /** 设置请求用户名 */ + public void setRequestName(String name) + { + this.requestName = name; + } + + /** 获取请求对应的会话环境 */ + public HttpSession getSession() + { + return session; + } + + /** 删除会话 */ + public void invalidateSession() + { + if (session != null) + context.invalidateSession(session.getId()); + session = null; + } + + /** 判断是否绑定了登录用户 */ + public boolean hasSessionUser() + { + return session != null && session.hasSessionUser(); + } + + /** 绑定会话登录用户 */ + public void bindSessionUser(HttpSessionUser sessionUser) + { + if (session != null){ + session.bindSessionUser(sessionUser); + } + } + + /** 解绑会话登录用户 */ + public void unbindSessionUser() + { + if (session != null){ + session.unbindSessionUser(); + } + } + + /** 获取会话默认的用户信息 */ + public HttpSessionUser getSessionUser() + { + return session == null?null:session.getSessionUser(); + } + + /** 获取会话默认的登录名 */ + public String getSessionName() + { + return session == null?null:session.getSessionName(); + } + + /** 判断是否绑定了登录用户,且指定的会话用户类(HttpSessionUser子类) */ + public boolean hasSessionUser(Class clazz) + { + return session == null?null:session.hasSessionUser(clazz); + } + + /** 获取会话用户信息,且指定的会话用户类(HttpSessionUser子类) */ + public T getSessionUser(Class clazz) + { + return session == null?null:session.getSessionUser(clazz); + } + + /** 获取会话编号 */ + public String getSessionId() + { + assertSession(); + return session.getId(); + } + + /** 设置会话属性 */ + public void setSessionAttribute(String name, Object value) + { + assertSession(); + session.setAttribute(name, value); + } + + /** 获取上下文环境属性值 */ + public Object getSessionAttribute(String name) + { + assertSession(); + return session.getAttribute(name); + } + + /** 获取上下文环境属性值 */ + public Object getSessionAttribute(String name, Object defaultValue) + { + assertSession(); + return session.getAttribute(name, defaultValue); + } + + /** 获取上下文环境属性值字符串 */ + public String getSessionAttributeString(String name) + { + assertSession(); + return session.getAttributeString(name); + } + + /** 获取上下文环境属性值字符串 */ + public String getSessionAttributeString(String name, String defaultValue) + { + assertSession(); + return session.getAttributeString(name, defaultValue); + } + + /** 获取上下文环境属性值整型 */ + public int getSessionAttributeInt(String name) + { + assertSession(); + return session.getAttributeInt(name); + } + + /** 获取上下文环境属性值整型 */ + public int getSessionAttributeInt(String name, int defaultValue) + { + assertSession(); + return session.getAttributeInt(name, defaultValue); + } + + /** 获取上下文环境属性值长整型 */ + public long getSessionAttributeLong(String name) + { + assertSession(); + return session.getAttributeLong(name); + } + + /** 获取上下文环境属性值长整型 */ + public long getSessionAttributeLong(String name, long defaultValue) + { + assertSession(); + return session.getAttributeLong(name, defaultValue); + } + + /** 判断会话是否有属性值 */ + public boolean hasSessionAttribute(String name) + { + assertSession(); + return session.hasAttribute(name); + } + + /** 诊断会话是否存在 */ + private void assertSession() + { + Asserts.as(session != null?null:"[HttpSession]未创建或已删除,不允许调用"); + } + + /***********************************************************************/ + //获取Cookie数据或数组 + /***********************************************************************/ + + /** 获取指定名称的Cookie值 */ + public String getCookie(String name) + { + return cookieMap.get(name); + } + + /** 获取Cookie,如果没有值或值为空字符串返回缺省值 */ + public String getCookie(String name, String defaultValue) + { + String value = cookieMap.get(name); + return Validates.isEmpty(value)?defaultValue:value; + } + + /** 获取请求中Cookie数组 */ + public HttpCookie[] getCookies() + { + HttpCookie[] cookieArr = new HttpCookie[cookieMap.size()]; + int i = 0; + for (Entry entry : cookieMap.entrySet()) + { + HttpCookie cookie = new HttpCookie(entry.getKey(), entry.getValue()); + cookieArr[i++] = cookie; + } + return cookieArr; + } + + /** 删除请求中的Cookie值 */ + public void removeCookie(String name) + { + cookieMap.remove(name); + } + + /** 增加Cookie到响应中 */ + public void addCookieToResponse(String name, String value) + { + getResponse().addCookie(name, value); + } + + /** 增加Cookie到响应中 */ + public void addCookieToResponse(String name, String value, int seconds) + { + getResponse().addCookie(name, value, seconds); + } + + /** 增加Cookie到响应中 */ + public void addCookieToResponse(HttpCookie cookie) + { + getResponse().addCookie(cookie); + } + + /** 删除Cookie到响应中 */ + public void removeCookieToResponse(String name) + { + getResponse().removeCookie(name); + } + + /***********************************************************************/ + //获取和判断请求行信息,包括协议、方法、版本、URI等 + /***********************************************************************/ + + /** 获取请求行 */ + public String getHeaderLine() + { + return header.getHeaderLine(); + } + + /** 获取请求版本 */ + public String getVersion() + { + return header.getVersion(); + } + + /** 获取URI路径,以/开头,如/test.html,如果没有文件后缀则为'/' */ + public String getPath() + { + return header.getPath(); + } + + /** 获取请求方法 */ + public String getMethod() + { + return header.getMethod(); + } + + /** 是否是HEAD方法 */ + public boolean isMethodHead() + { + return header.isMethodHead(); + } + + /** 是否是GET方法 */ + public boolean isMethodGet() + { + return header.isMethodGet(); + } + + /** 是否是POST方法 */ + public boolean isMethodPost() + { + return header.isMethodPost(); + } + + /** 判断是否需要响应内容 */ + public boolean isMethodResponseContent() + { + return header.isMethodResponseContent(); + } + + /** 获取客户端IP地址 */ + public String getRemoteAddr() + { + return header.getRemoteAddr(); + } + + /** 获取URI信息 */ + public String getRequestURI() + { + return header.getUri().toString(); + } + + /** 获取URL信息 */ + public String getRequestURL() + { + String scheme = getScheme(); + String hostPort = getHostPort(); + + return new StringBuilder() + .append(scheme).append("://") + .append(hostPort).append(getRequestURI()) + .toString(); + } + + /** 获取查询串 */ + public String getQueryString() + { + return header.getQueryString(); + } + + /** 获取协议格式 */ + public String getScheme() + { + String proxy = getHeader(_X_FORWARDED_PROTO_); + return (Validates.isEmpty(proxy))?server.getScheme():proxy; + } + + /** 获取HOST:PORT */ + public String getHostPort() + { + return header.getHostPort(); + } + + /** 获取端口信息 */ + public int getPort() + { + String scheme = getScheme(); + int defaultPort = _HTTPS_.equalsIgnoreCase(scheme)?443:80; + String hostPort = getHostPort(); + if (Validates.isEmpty(hostPort) || hostPort.indexOf(":") == -1) + return defaultPort; + + int ind = hostPort.indexOf(":"); + return Ints.toInt(Strings.trim(hostPort.substring(ind+1)), defaultPort); + } + + /** 获取URI虚拟主机信息 */ + public String getHostOnly() + { + return header.getHostOnly(); + } + + /** 获取URI虚拟目录信息 */ + public String getVirtualDirectory() + { + return header.getVirtualDirectory(); + } + + /***********************************************************************/ + //获取和判断请求头部信息 + /***********************************************************************/ + + /** 获取头部信息 */ + public HashMapSS getHeaders() + { + return header.getHeaders(); + } + + /** 获取消息头名称迭代器 */ + public Iterator getHeaderNames() + { + return header.getHeaders().keySet().iterator(); + } + + /** 获取请求头字符串 */ + public String getHeaderString() + { + StringBuilder strb = new StringBuilder(); + for (Map.Entry entry : header.getHeaders().entrySet()) + { + strb.append(entry.getKey()).append(_EQUAL_).append(entry.getValue()).append(_BR_); + } + return strb.toString(); + } + + /** 获取请求头属性 */ + public String getHeader(String key) + { + return header.getHeader(key.toLowerCase()); + } + + /** 获取请求头属性 */ + public String getHeader(String key, String defaultValue) + { + String value = getHeader(key); + return Validates.isEmptyBlank(value)?defaultValue:value; + } + + /** 获取请求头属性整型值 */ + public int getHeaderInt(String key) + { + return getHeaderInt(key, -1); + } + + /** 获取请求头属性整型值 */ + public int getHeaderInt(String key, int defaultValue) + { + String value = getHeader(key); + return Validates.isInteger(value)?Ints.toInt(value):defaultValue; + } + + /** 获取请求头属性长整型值 */ + public long getHeaderLong(String key) + { + return getHeaderLong(key, -1); + } + + /** 获取请求头属性长整型值 */ + public long getHeaderLong(String key, long defaultValue) + { + String value = getHeader(key); + return Validates.isInteger(value)?Longs.toLong(value):defaultValue; + } + + /** 获取请求内容长度 */ + public int getContentLength() + { + String sLen = getHeader(_CONTENT_LENGTH_); + if (!Validates.isInteger(sLen)) + return 0; + return Integer.parseInt(sLen); + } + + /** 获取请求内容类型 */ + public String getContentType() + { + return getHeader(_CONTENT_TYPE_); + } + + /** 获取请求要求的类型 */ + public String getMimeType() + { + return header.getMimeType(); + } + + /** 判断是否表单提交 */ + public boolean isMimeForm() + { + return header.isMimeForm(); + } + + /** 判断是否文本请求 */ + public boolean isMimeTextPlain() + { + return header.isMimeTextPlain(); + } + + /** 设置请求的编码格式 */ + public void setCharacterEncoding(String characterEncoding) + { + header.setCharacterEncoding(characterEncoding); + } + + /** 获取请求要求的编码,如果未设置默认UTF-8 */ + public String getCharacterEncoding() + { + return header.getCharacterEncoding(); + } + + /** 获取请求头中的编码,如果未设置默认null */ + public String getCharacterEncodingHeader() + { + return header.getCharacterEncodingHeader(); + } + + /** 获取组装内容类型 */ + public String getContentTypeMimeEncoding() + { + return header.getMimeType() + "; charset=" + header.getCharacterEncoding(); + } + + /** 获取来源地址 */ + public String getReferer() + { + return getHeader(_REFERER_); + } + + /** 获取知启蒙定义的客户端类型(mobile|www),该值也会设置到request的属性中 */ + public String getZhiqimClientType() + { + return isMobile()?_MOBILE_:_WWW_; + } + + /** 是否请求内容GZIP */ + public boolean isRequestGZip() + { + return header.isRequestGZip(); + } + + /** 是否响应支持GZIP */ + public boolean isResponseGZip() + { + return header.isResponseGZip(); + } + + /** 是否是异isXMLHttpRequest */ + public boolean isXMLHttpRequest() + { + return _XML_HTTP_REQUEST_.equalsIgnoreCase(getHeader(_X_REQUESTED_WITH_)); + } + + /** 获取浏览器终端标识 */ + public String getUserAgent() + { + return header.getUserAgent(); + } + + /** 是否手机端(含微信客户端) */ + public boolean isMobile() + { + String userAgent = getUserAgent(); + if (Validates.isEmpty(userAgent)) + return false; + + return userAgent.toLowerCase().contains(_MOBILE_) || userAgent.toLowerCase().contains(_MICROMESSAGER_); + } + + /** 是否微信 */ + public boolean isMicroMessenger() + { + String userAgent = getUserAgent(); + if (Validates.isEmpty(userAgent)) + return false; + + return userAgent.toLowerCase().contains(_MICROMESSAGER_); + } + + /** 是否IE浏览器 */ + public boolean isIE() + { + String userAgent = getUserAgent(); + if (Validates.isEmpty(userAgent)) + return false; + + userAgent = userAgent.toLowerCase(); + return userAgent.contains(_MSIE_) || userAgent.contains(_MSTRIDENT_); + } + + /** 是否火狐浏览器 */ + public boolean isFirefox() + { + String userAgent = getUserAgent(); + if (Validates.isEmpty(userAgent)) + return false; + + return userAgent.toLowerCase().contains(_FIREFOX_); + } + + /** 是否是Webkit浏览器 */ + public boolean isWebkit() + { + String userAgent = getUserAgent(); + if (Validates.isEmpty(userAgent)) + return false; + + return userAgent.toLowerCase().contains(_WEBKIT_); + } + + /** 是否是chrome浏览器 */ + public boolean isChrome() + { + String userAgent = getUserAgent(); + if (Validates.isEmpty(userAgent)) + return false; + + return userAgent.toLowerCase().contains(_CHROME_); + } + + /** 是否是Safari浏览器 */ + public boolean isSafari() + { + String userAgent = getUserAgent(); + if (Validates.isEmpty(userAgent)) + return false; + + userAgent = userAgent.toLowerCase(); + return userAgent.contains(_SAFARI_) && !userAgent.contains(_CHROME_); + } + + /***********************************************************************/ + //获取请求中URL匹配的参数 + /***********************************************************************/ + + /** 获取通配符参数列表 */ + @SuppressWarnings("unchecked") + public List getParameterMatch() + { + return (List)getAttribute(_HTTP_REQUEST_PARAM_MATCH_); + } + + /** + * 获取通配符参数值 + * + * @param index 参数匹配位置 + * @return 有过滤的参数值 + */ + public String getParameterMatch(int index) + { + return getParameterMatch().get(index); + } + + /** + * 获取通配符参数值 + * + * @param index 参数匹配位置 + * @return 有过滤的参数值 + */ + public long getParameterMatchLong(int index) + { + return Longs.toLong(getParameterMatch().get(index)); + } + + /** + * 获取通配符参数值 + * + * @param index 参数匹配位置 + * @return 有过滤的参数值 + */ + public int getParameterMatchInt(int index) + { + return Ints.toInt(getParameterMatch().get(index)); + } + + /***********************************************************************/ + //获取请求中URL和Content中的数据,包括URL和Content中的数据 + /***********************************************************************/ + + /** + * 获取参数哈唏表(未安全过滤),先填入url中参数表,再用content参数表覆盖,得到全部参数表 + * + * @return 得到全部参数表 + */ + public HashMap getParameterMap() + { + HashMap paramMap = new HashMap(); + paramMap.putAll(urlParamMap.instance()); + paramMap.putAll(cntParamMap.instance()); + return paramMap; + } + + /** 判断是否有参数 */ + public boolean hasParameter(String name) + { + return cntParamMap.containsKey(name) || urlParamMap.containsKey(name); + } + + /** + * 获取参数值并安全过滤,优先检查content中是否存在,如果不存在才检查url中 + * + * @param name 参数名 + * @return 有过滤的参数值 + */ + public String getParameter(String name) + { + return Htmls.filterAll(hasParameterOnCNT(name)?cntParamMap.get(name):urlParamMap.get(name)); + } + + /** + * 获取动态参数对象信息 + * + * @param clazz 类结构 + * @return 返回赋值后的对象 + * @throws 异常需要捕捉 + */ + public T getParameter(Class clazz) throws IllegalAccessException + { + return Classes.newInstance(clazz, getParameterMap()); + } + + /** + * 获取参数值(未过滤),优先检查content中是否存在,如果不存在才检查url中 + * + * @param name 参数名 + * @return 有过滤的参数值 + */ + public String getParameterNoFilter(String name) + { + return Strings.trim(hasParameterOnCNT(name)?cntParamMap.get(name):urlParamMap.get(name)); + } + + /** + * 获取参数值并安全过滤,优先检查content中是否存在,如果不存在才检查url中,都不存在或值为空白返回缺省值 + * + * @param name 参数名 + * @param defaultValue 不存在或为空时的缺省值 + * @return 有过滤的参数值 + */ + public String getParameter(String name, String defaultValue) + { + String value = getParameter(name); + return Validates.isEmpty(value)?defaultValue:value; + } + + /** + * 获取参数值(未过滤),优先检查content中是否存在,如果不存在才检查url中,都不存在或值为空白返回缺省值 + * + * @param name 参数名 + * @param defaultValue 不存在或为空时的缺省值 + * @return 有过滤的参数值 + */ + public String getParameterNoFilter(String name, String defaultValue) + { + String value = getParameterNoFilter(name); + return Validates.isEmpty(value)?defaultValue:value; + } + + /** + * 获取参数整型,非整型返回-1的值 + * + * @param name 参数名 + * @return 整数值 + */ + public int getParameterInt(String name) + { + return Ints.toInt(getParameter(name), -1); + } + + /** + * 获取参数整型,非整型返回缺省值 + * + * @param name 参数名 + * @param defaultValue 缺省值 + * @return 整数值 + */ + public int getParameterInt(String name, int defaultValue) + { + return Ints.toInt(getParameter(name), defaultValue); + } + + /** + * 获取参数长整型,非整型返回-1的值 + * + * @param name 参数名 + * @return 长整型 + */ + public long getParameterLong(String name) + { + return Longs.toLong(getParameter(name), -1); + } + + /** + * 获取参数长整型,非整型返回-1的值 + * + * @param name 参数名 + * @param defaultValue 缺省值 + * @return 长整型 + */ + public long getParameterLong(String name, long defaultValue) + { + return Longs.toLong(getParameter(name), defaultValue); + } + + /** + * 获取参数布尔型,!="true"(equalsIgnoreCase)的返回false + * + * @param name 参数名 + * @return 布尔型 + */ + public boolean getParameterBoolean(String name) + { + return _TRUE_.equalsIgnoreCase(getParameter(name)); + } + + /** + * 获取参数布尔型,!="true" && !="false"(equalsIgnoreCase)返回defaultValue + * + * @param name 参数名 + * @param defaultValue 缺省值 + * @return 布尔型 + */ + public boolean getParameterBoolean(String name, boolean defaultValue) + { + String value = getParameter(name); + if (Validates.isEmptyBlank(value)) + return defaultValue; + + if (_TRUE_.equalsIgnoreCase(value)) + return true; + else if (_FALSE_.equalsIgnoreCase(value)) + return false; + else + return defaultValue; + } + + /** + * 获取两位小数的金额值,格式不对返回-1 + * + * @param name 参数名 + * @return 金额值,如果从请求中获取的格式不对,则返回-1 + */ + public int getParameterAmount2R(String name) + { + return Amounts.toFen(getParameter(name), -1); + } + + /** + * 获取两位小数的金额值 + * + * @param name 参数名 + * @param defaultValue 缺省值 + * @return 金额值,如果从请求中获取的格式不对,则返回缺省值 + */ + public int getParameterAmount2R(String name, int defaultValue) + { + return Amounts.toFen(getParameter(name), defaultValue); + } + + /** + * 获取两位小数的金额值长整型,格式不对返回-1 + * + * @param name 参数名 + * @param defaultValue 缺省值 + * @return 金额值,如果从请求中获取的格式不对,则返回-1 + */ + public long getParameterAmount2RLong(String name) + { + return Amounts.toFen(getParameter(name), -1L); + } + + /** + * 获取两位小数的金额值长整型 + * + * @param name 参数名 + * @param defaultValue 缺省值 + * @return 金额值,如果从请求中获取的格式不对,则返回缺省值 + */ + public long getParameterAmount2R(String name, long defaultValue) + { + return Amounts.toFen(getParameter(name), defaultValue); + } + + /** + * 获取参数值并安全过滤,并转化为数组(逗号格式),优先检查content中是否存在,如果不存在才检查url中 + * + * @param name 参数名 + * @return 有过滤后的逗号格式数组值 + */ + public String[] getParameterValues(String name) + { + String value = getParameter(name); + return (value == null)?null:Arrays.toStringArray(value); + } + + /** + * 获取参数值(未过滤),并转化为数组(逗号格式),优先检查content中是否存在,如果不存在才检查url中 + * + * @param name 参数名 + * @return 有过滤后的逗号格式数组值 + */ + public String[] getParameterValuesNoFilter(String name) + { + String value = getParameterNoFilter(name); + return (value == null)?null:Arrays.toStringArray(value); + } + + /***********************************************************************/ + //获取请求中URL中的数据 + /***********************************************************************/ + + /** 获取URL参数哈唏表(值未过滤) */ + public HashMap getParameterMapOnURL() + { + HashMap paramMap = new HashMap(urlParamMap.size()); + paramMap.putAll(urlParamMap.instance()); + return paramMap; + } + + /** 判断是否有URL参数 */ + public boolean hasParameterOnURL(String name) + { + return urlParamMap.containsKey(name); + } + + /** 获取URL参数值,并安全过滤 */ + public String getParameterOnURL(String name) + { + return Htmls.filterAll(urlParamMap.get(name)); + } + + /** 获取URL参数值,并安全过滤 */ + public String getParameterOnURL(String name, String defaultValue) + { + String value = getParameterOnURL(name); + return Validates.isEmptyBlank(value)?defaultValue:value; + } + + /** 获取URL参数值(未过滤) */ + public String getParameterNoFilterOnURL(String name) + { + return Strings.trim(urlParamMap.get(name)); + } + + /** 获取URL参数值(未过滤) */ + public String getParameterNoFilterOnURL(String name, String defaultValue) + { + String value = getParameterNoFilterOnURL(name); + return Validates.isEmptyBlank(value)?defaultValue:value; + } + + /** 获取URL参数整型,非整型返回-1的值 */ + public int getParameterIntOnURL(String name) + { + return Ints.toInt(getParameterOnURL(name), -1); + } + + /** 获取URL参数整型,非整型返回缺省值 */ + public int getParameterIntOnURL(String name, int defaultValue) + { + return Ints.toInt(getParameterOnURL(name), defaultValue); + } + + /** 获取URL参数长整型,非整型返回-1的值 */ + public long getParameterLongOnURL(String name) + { + return Longs.toLong(getParameterOnURL(name), -1); + } + + /** 获取URL参数长整型,非整型返回-1的值 */ + public long getParameterLongOnURL(String name, long defaultValue) + { + return Longs.toLong(getParameterOnURL(name), defaultValue); + } + + /** 获取两位小数的金额值 */ + public int getParameterAmount2ROnURL(String name, int defaultValue) + { + return Amounts.toFen(getParameterOnURL(name), defaultValue); + } + + /** 获取两位小数的金额值长整型 */ + public long getParameterAmount2ROnURL(String name, long defaultValue) + { + return Amounts.toFen(getParameterOnURL(name), defaultValue); + } + + /** 获取URL参数值数组,并安全过滤 */ + public String[] getParameterValuesOnURL(String name) + { + String value = getParameterOnURL(name); + return (value == null)?null:Arrays.toStringArray(value); + } + + /** 设置参数值到URL表中 */ + public void setParameterOnURL(String name, Object value) + { + urlParamMap.put(name, value == null?null:String.valueOf(value)); + } + + /** 设置参数值到CNT表中 */ + public void setParameterOnCNT(String name, Object value) + { + cntParamMap.put(name, value == null?null:String.valueOf(value)); + } + + /***********************************************************************/ + //获取请求中Content中的数据 + /***********************************************************************/ + + /** 获取内容输入流 */ + public InputStream getInputStream() + { + return bis; + } + + /** 获取内容输入流字符串 */ + public String getInputStreamString() + { + int len = getContentLength(); + if (len == 0) + return ""; + + try + { + byte[] buffer = new byte[len]; + bis.read(buffer); + return new String(buffer, getCharacterEncoding()); + } + catch (Exception e) + { + throw Asserts.exception("解析请求内容时异常:"+e.getMessage()); + } + } + + /** 获取内容参数哈唏表(值未过滤) */ + public HashMap getParameterMapOnCNT() + { + HashMap paramMap = new HashMap<>(cntParamMap.size()); + paramMap.putAll(cntParamMap.instance()); + return paramMap; + } + + /** 判断是否有内容参数 */ + public boolean hasParameterOnCNT(String name) + { + return cntParamMap.containsKey(name); + } + + /** 获取内容参数值,并安全过滤 */ + public String getParameterOnCNT(String name) + { + return Htmls.filterAll(cntParamMap.get(name)); + } + + /** 获取内容参数值,并安全过滤 */ + public String getParameterOnCNT(String name, String defaultValue) + { + String value = getParameterOnCNT(name); + return Validates.isEmptyBlank(value)?defaultValue:value; + } + + /** 获取内容参数值(未过滤) */ + public String getParameterNoFileterOnCNT(String name) + { + return Strings.trim(cntParamMap.get(name)); + } + + /** 获取内容参数值(未过滤) */ + public String getParameterNoFileterOnCNT(String name, String defaultValue) + { + String value = getParameterNoFileterOnCNT(name); + return Validates.isEmptyBlank(value)?defaultValue:value; + } + + /** 获取内容参数整型,非整型返回-1的值 */ + public int getParameterIntOnCNT(String name) + { + return Ints.toInt(getParameterOnCNT(name), -1); + } + + /** 获取内容参数整型,非整型返回缺省值 */ + public int getParameterIntOnCNT(String name, int defaultValue) + { + return Ints.toInt(getParameterOnCNT(name), defaultValue); + } + + /** 获取内容参数长整型,非整型返回-1的值 */ + public long getParameterLongOnCNT(String name) + { + return Longs.toLong(getParameterOnCNT(name), -1); + } + + /** 获取内容参数长整型,非整型返回-1的值 */ + public long getParameterLongOnCNT(String name, long defaultValue) + { + return Longs.toLong(getParameterOnCNT(name), defaultValue); + } + + /** 获取内容参数两位小数的金额值 */ + public int getParameterAmount2ROnCNT(String name, int defaultValue) + { + return Amounts.toFen(getParameterOnCNT(name), defaultValue); + } + + /** 获取内容参数两位小数的金额值长整型 */ + public long getParameterAmount2ROnCNT(String name, long defaultValue) + { + return Amounts.toFen(getParameterOnCNT(name), defaultValue); + } + + /** 获取内容参数值数组 */ + public String[] getParameterValuesOnCNT(String name) + { + String value = getParameterOnCNT(name); + return (value == null)?null:Arrays.toStringArray(value); + } + + /***********************************************************************/ + //设置和获取请求中属性 + /***********************************************************************/ + + /** 获取属性列表 */ + public Map getAttributeMap() + { + return attributeMap.instance(); + } + + /** 获取属性值 */ + public Object getAttribute(String name) + { + return attributeMap.get(name); + } + + /** 获取属性值,如果无该属性则返回缺省值 */ + public Object getAttribute(String name, Object defaultValue) + { + return (hasAttribute(name))?getAttribute(name):defaultValue; + } + + /** 获取属性值字符串*/ + public String getAttributeString(String name) + { + return getAttributeString(name, null); + } + + /** 获取属性值字符串,如果无该属性则返回缺省值*/ + public String getAttributeString(String name, String defaultValue) + { + Object value = attributeMap.get(name); + return (value == null)?defaultValue:String.valueOf(value); + } + + /** 获取属性值整型*/ + public int getAttributeInt(String name) + { + return Ints.toInt(attributeMap.get(name), -1); + } + + /** 获取属性值整型,如果无该属性则返回缺省值*/ + public int getAttributeInt(String name, int defaultValue) + { + return Ints.toInt(attributeMap.get(name), defaultValue); + } + + /** 获取属性值整型*/ + public long getAttributeLong(String name) + { + return Longs.toLong(attributeMap.get(name), -1); + } + + /** 获取属性值整型,如果无该属性则返回缺省值*/ + public long getAttributeLong(String name, int defaultValue) + { + return Longs.toLong(attributeMap.get(name), defaultValue); + } + + /** 判断属性是否存在 */ + public boolean hasAttribute(String name) + { + return attributeMap.containsKey(name); + } + + /** 设置属性 */ + public void setAttribute(String name, Object value) + { + attributeMap.put(name, value); + } + + /***********************************************************************/ + //获取请求/会话/上下文环境中嵌套属性,有则返回 + /***********************************************************************/ + + /** 获取属性值 */ + public Object getNestAttribute(String name) + { + boolean exists = hasAttribute(name); + if (exists) + return getAttribute(name); + + exists = hasSessionAttribute(name); + if (exists) + return getSessionAttribute(name); + + exists = hasContextAttribute(name); + return exists?getContextAttribute(name):null; + } + + /** 获取属性值,如果无该属性则返回缺省值 */ + public Object getNestAttribute(String name, Object defaultValue) + { + return hasNestAttribute(name)?getNestAttribute(name):defaultValue; + } + + /** 获取属性值字符串 */ + public String getNestAttributeString(String name) + { + return getNestAttributeString(name, null); + } + + /** 获取属性值字符串,如果无该属性则返回缺省值 */ + public String getNestAttributeString(String name, String defaultValue) + { + if (!hasNestAttribute(name)) + return defaultValue; + + Object val = getNestAttribute(name); + return (val == null)?null:Strings.valueOf(val); + } + + /** 获取属性值整型 */ + public int getNestAttributeInt(String name) + { + return getNestAttributeInt(name, -1); + } + + /** 获取属性值整型,如果无该属性则返回缺省值 */ + public int getNestAttributeInt(String name, int defaultValue) + { + return Ints.toInt(getNestAttribute(name), defaultValue); + } + + /** 获取属性值整型 */ + public long getNestAttributeLong(String name) + { + return getNestAttributeLong(name, -1); + } + + /** 获取属性值整型,如果无该属性则返回缺省值 */ + public long getNestAttributeLong(String name, int defaultValue) + { + return Longs.toLong(getNestAttribute(name), defaultValue); + } + + /** 判断属性是否存在 */ + public boolean hasNestAttribute(String name) + { + boolean exists = hasAttribute(name); + if (exists) + return true; + + exists = hasSessionAttribute(name); + if (exists) + return true; + + return hasContextAttribute(name); + } + + /***********************************************************************/ + //从请求中设置属性到响应中 + /***********************************************************************/ + + /** 设置响应头不缓存 */ + public void setResponseNoCache() + { + HttpResponse response = getResponse(); + response.setHeader(_PRAGMA_, _NO_CACHE_); + response.setHeader(_CACHE_CONTROL_, _NO_CACHE_MUST_RV_NO_STORE_); + response.setHeader(_P3P_, _P3P_CP_CAO_PSA_OUR_); + response.setDateHeader(_EXPIRES_, 0); + } + + /** 设置响应头私有缓存 */ + public void setResponsePrivateCache() + { + getResponse().setCacheControlPrivate(); + } + + /** 设置响应为UTF8编码*/ + public void setResponseEncodingUTF8() + { + HttpResponse response = getResponse(); + response.setCharacterEncoding(_UTF_8_); + } + + /***********************************************************************/ + //内部重定向请求和上下文环境下绝对路径 + /***********************************************************************/ + + /** + * 内部重定向请求,支持从一个Action内部转到新的Action处理 + * + * @param pathInContext 上下文内部路径,即对应的新Action的配置路径 + * @throws IOException IO异常 + * @throws HttpException HTTP异常 + */ + public void forwardTo(String pathInContext) throws HttpException, IOException + { + int ind = pathInContext.indexOf("?"); + if (ind == -1){ + header.setPathInContext(pathInContext); + }else{ + Map paramMap = Urls.toMapNoEncoded(pathInContext); + this.urlParamMap.putAll(paramMap); + header.setPathInContext(pathInContext.substring(0, ind)); + } + + HttpResponse response = getResponse(); + HttpContext context = getContext(); + context.handle(this, response); + + //处理完标志为已重定向,并立即提交,不再处理后续数据传送 + hasForward = true; + response.commit(); + } + + /** 是否已标志为已内部重定向 */ + public boolean hasForward() + { + return hasForward; + } + + /** 获取上下文环境下绝对路径 */ + public String getPathInContext() + { + return header.getPathInContext(); + } + + /** 获取资源文件下绝对路径 */ + public String getPathOnResource() + { + return header.getPathOnResource(); + } + + /** 设置资源文件下绝对路径 */ + public void setPathOnResource(String pathOnResource) + { + header.setPathOnResource(pathOnResource); + } + + /***********************************************************************/ + //toString & destroy + /***********************************************************************/ + + public String toString() + { + return header.toString(); + } + + /** 销毁 */ + public void destroy() + { + super.destroy(); + + if (bis != null) + { + try{bis.close();}catch(IOException e){} + bis = null; + } + + //map + if (urlParamMap != null) + { + urlParamMap.clear(); + urlParamMap = null; + } + if (cntParamMap != null) + { + cntParamMap.clear(); + cntParamMap = null; + } + if (cookieMap != null) + { + cookieMap.clear(); + cookieMap = null; + } + if (attributeMap != null) + { + attributeMap.clear(); + attributeMap = null; + } + + //引用置空 + header = null; + server = null; + conn = null; + context = null; + input = null; + session = null; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpRequestResponse.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpRequestResponse.java new file mode 100644 index 0000000..0c3b2fb --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpRequestResponse.java @@ -0,0 +1,477 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.consts.Int; + +/** + * HTTP请求响应抽象类,把响应相关的处理的放在该类中 + * + * @version v1.0.0 @author zouzhigang 2016-7-15 新建与整理 + */ +public abstract class HttpRequestResponse extends HttpRequestValidate +{ + private boolean isReturn; //是否转向,=false时[tempalte|forward|redirect]无效 + + //用于在请求中设置响应属性 + private int responseStatus; //601-603表示重定向 + + //三项为Action配置的转向控制字段 + private String forward; //转向到新的path + private String redirect; //重定向到新path + private String view; //加载视图信息 + private String include; //加载视图嵌套信息 + private String executeMethod; //内部通过execute转向到该方法 + private String alertMsg; //提示信息 + + //一项为转向时的可选配置字段 + private List paramList; //重定向参数列表 + + /** + * 设置响应配置信息 + * + * @param view 转向到视图页 + * @param include 转向到视图页的嵌套地址 + * @param forward 转向到新的路径 + * @param redirect 重定向到新的路径 + * @param method 执行类的方法 + * @param alert 执行后的警告信息 + */ + public void setResponseConfig(String view, String include, String forward, String redirect, String method, String alert) + { + this.isReturn = !Validates.isEmptyBlank(view) || !Validates.isEmptyBlank(forward) || !Validates.isEmptyBlank(redirect); + + this.view = view; + this.include = include; + this.forward = forward; + this.redirect = redirect; + + this.executeMethod = method; + this.alertMsg = alert; + } + + /**********************************************/ + //加上标准SET方法,用于运行时修改设置 + /**********************************************/ + + /** 修改为是否转向 */ + public void setReturn(boolean isReturn) + { + this.isReturn = isReturn; + } + + /** 修改视图页和嵌套地址,和转向页互斥 */ + public void setView(String view, String include) + { + this.responseStatus = 0; + + this.view = view; + this.include = include; + this.forward = null; + this.redirect = null; + this.isReturn = true; + } + + /** 修改为是否内部转向 */ + public void setForward(String forwardTo) + { + this.responseStatus = 0; + + this.forward = forwardTo; + this.view = null; + this.redirect = null; + this.isReturn = true; + } + + /** 修改重定向,和视图页互斥 */ + public void setRedirect(String redirect) + { + this.responseStatus = _602_REDIRECT_; + + setRedirectInner(redirect); + } + + /** 修改重定向,和视图页互斥,但不改变responseStatus值 */ + public void setRedirectInner(String redirect) + { + this.redirect = redirect; + this.view = null; + this.forward = null; + this.isReturn = true; + } + + /** 增加参数,内转向和重定向时有效 */ + public void addParam(String key, Object value) + { + if (value == null) + value = ""; + + if (paramList == null) + paramList = new ArrayList<>(2); + + paramList.add(new String[]{key, String.valueOf(value)}); + } + + /** 设置警告信息 */ + public void setAlertMsg(String alert) + { + this.alertMsg = alert; + } + + /*******************************************************************************/ + //转向控制字段相关属性 + /*******************************************************************************/ + + /** 获取Action在execute中转向的方法名 */ + public String getExecuteMethod() + { + return executeMethod; + } + + /** 获取转向定制的提示信息 */ + public String getAlertMsg() + { + return alertMsg; + } + + /** + * 检查是否转向,两种情况

            + * + * 1、当设置成强制不转向时,即不转向
            + * 2、当为转向时,检查视图页和转向页是否存在,存在一个即转向,否则不转向
            + */ + public boolean isReturn() + { + return isReturn?(Validates.isNotEmpty(view) || Validates.isNotEmpty(forward) || Validates.isNotEmpty(redirect)):false; + } + + /** 获取视图信息 */ + public String getView() + { + return view; + } + + /** 获取视图信息嵌套信息 */ + public String getInclude() + { + return include; + } + + /** 获取内转向地址 */ + public String getForward(String encoding) + { + if (Validates.isEmpty(paramList)) + return forward; + + //加参数 + for (String[] param : paramList) + { + String value = Urls.encode(param[1], encoding); + forward = Urls.add(forward, param[0], value); + } + return forward; + } + + /** 获取重定向内部定义的地址 */ + public String getRedirectInner() + { + return redirect; + } + + /** 获取重定向地址 */ + public String getRedirect(String encoding) + { + if (redirect == null) + return redirect; + + if (_REDIRECT_HISTORY_.equals(redirect)) + return redirect; + + if (_REDIRECT_CLOSE_WINDOW_.equals(redirect)) + return redirect; + + if (_REDIRECT_CLOSE_DIALOG_.equals(redirect)) + return redirect; + + if (Strings.startsWith(redirect, "javascript:")) + return redirect; + + if (Validates.isEmpty(paramList)) + return redirect; + + //加参数 + for (String[] param : paramList) + { + String value = Urls.encode(param[1], encoding); + redirect = Urls.add(redirect, param[0], value); + } + return redirect; + } + + /**********************************************/ + //加上四个常用特性方法,用于运行时修改设置 + /**********************************************/ + + /** 增加一个返回上一页快捷方式 */ + public void returnHistory() + { + setRedirect(_REDIRECT_HISTORY_); + } + + /** 增加一个错误返回上一页并提示错误的快捷方式 */ + public void returnHistory(String errorMsg) + { + setRedirect(_REDIRECT_HISTORY_); + setAlertMsg(errorMsg); + } + + /** 增加一个弹出窗口时关闭快捷方式 */ + public void returnCloseWindow() + { + setRedirect(_REDIRECT_CLOSE_WINDOW_); + } + + /** 增加一个弹出窗口时关闭并提示错误的快捷方式 */ + public void returnCloseWindow(String errorMsg) + { + setRedirect(_REDIRECT_CLOSE_WINDOW_); + setAlertMsg(errorMsg); + } + + /** 增加一个弹出对话框时关闭快捷方式 */ + public void returnCloseDialog() + { + setRedirect(_REDIRECT_CLOSE_DIALOG_); + } + + /** 增加一个弹出对话框时关闭并提示错误的快捷方式 */ + public void returnCloseDialog(String errorMsg) + { + setRedirect(_REDIRECT_CLOSE_DIALOG_); + setAlertMsg(errorMsg); + } + + /***********************************************/ + //以下判断是否强制要求转向(通过JS转向的) + /***********************************************/ + + /** + * 是否强制转向 + * + * 1.如果有失败提示或成功提示,需强制转向 + * 2.由业务指定返回上一页或关闭,需强制转向 + */ + public boolean isForceReturn() + { + //要提示信息要求alert + if (Validates.isNotEmpty(alertMsg)) + return true; + + //当要求返回上一页、关闭当前页和关闭当前对话框时需强制转向 + if (_REDIRECT_HISTORY_.equals(redirect) || _REDIRECT_CLOSE_WINDOW_.equals(redirect) || _REDIRECT_CLOSE_DIALOG_.equals(redirect)) + return true; + + //当要求执行一段javascript代码时 + if (Strings.startsWith(redirect, "javascript:")) + return true; + + //parent.location和top.location两种必须强制转向 + if (responseStatus == _601_REDIRECT_PARENT_ || responseStatus == _603_REDIRECT_TOP_) + return true; + + //在iframe中的提交,要强制转向 + if (getParameterBoolean(_PARAM_CALL_FRAME_)) + return true; + + return false; + } + + /** + * 获取强制转向类型 + * + * 1.返回上一页 + * 2.关闭当前窗口 + * 3.关闭对话框 + * 4.调用Javascript + * 0.表示正常连接 + * @return int 类型 + */ + public int getForceReturnType() + { + //当要求返回上一页、关闭当前页和关闭当前对话框时需强制转向 + if (redirect == null) + return -1; + if (_REDIRECT_HISTORY_.equals(redirect)) + return 1; + else if(_REDIRECT_CLOSE_WINDOW_.equals(redirect)) + return 2; + else if(_REDIRECT_CLOSE_DIALOG_.equals(redirect)) + return 3; + else if (Strings.startsWith(redirect, "javascript:")) + return 4; + else + return 0; + } + + /***********************************************************************/ + //从请求中设置响应状态和文本属性 + /***********************************************************************/ + + /** 获取响应属性码 */ + public int getResponseStatus() + { + return responseStatus; + } + + /** 获取响应属性文本 */ + public String getResponseText() + { + if (!isResponseRedirect()) + {//不是重定向,直接返回提示信息 + return alertMsg; + } + else + {//重定向则为redirect#alertMsg + if (Validates.isEmptyBlank(alertMsg)) + return getRedirect(_UTF_8_); + else + return getRedirect(_UTF_8_) + "#" + alertMsg; + } + } + + /** 判断响应属性是不是成功 */ + public boolean isResponseSuccess() + { + return responseStatus == _0_SUCCESS_; + } + + /** 判断响应属性是不是重定向 */ + public boolean isResponseRedirect() + { + return responseStatus >= _601_REDIRECT_PARENT_ && responseStatus <= _603_REDIRECT_TOP_; + } + + /** 设置响应结果属性,指定状态码但不能小于0,不能填70-699之间已知的状态码 */ + public void setResponseResult(int responseStatus, String responseText) + { + if (responseStatus < 0 || (responseStatus >= 70 && responseStatus <= 699)) + throw new RuntimeException("响应状态码不允许在(小于0和100-300和 304-699)之间数"); + + this.responseStatus = responseStatus; + setAlertMsg(responseText); + } + + /** 设置响应结果属性,指定状态码但不能小于0,不能填70-699之间已知的状态码 */ + public void setResponseResult(Int result) + { + this.setResponseResult(result.value(), result.desc()); + } + + /** 设置响应结果属性,状态码为0,表示成功 */ + public void setResponseResult(String responseText) + { + this.responseStatus = _0_SUCCESS_; + setAlertMsg(responseText); + } + + /** 设置响应结果属性,状态码为699,表示通用的失败 */ + public void setResponseError(String responseText) + { + this.responseStatus = _699_ERROR_; + setAlertMsg(responseText); + } + + /** 设置响应父页重定向,状态码为601 */ + public void setRedirectParent(String redirect) + { + this.responseStatus = _601_REDIRECT_PARENT_; + setRedirectInner(redirect); + } + + /** 设置响应顶页重定向 ,状态码为603*/ + public void setRedirectTop(String redirect) + { + this.responseStatus = _603_REDIRECT_TOP_; + setRedirectInner(redirect); + } + + /** 设置响应重定向前提示错误,状态码为602 */ + public void setRedirect(String redirect, String error) + { + if (Validates.isEmptyBlank(error)){ + setRedirect(redirect); + return; + } + + setRedirect(redirect); + setAlertMsg(error); + } + + /** 设置响应父页重定向前提示错误,状态码为601 */ + public void setRedirectParent(String redirect, String error) + { + if (Validates.isEmptyBlank(error)){ + setRedirectParent(redirect); + return; + } + + this.responseStatus = _601_REDIRECT_PARENT_; + setRedirectInner(redirect); + setAlertMsg(error); + } + + /** 设置响应顶页重定向前提示错误,状态码为603 */ + public void setRedirectTop(String redirect, String error) + { + if (Validates.isEmptyBlank(error)){ + setRedirectTop(redirect); + return; + } + + this.responseStatus = _603_REDIRECT_TOP_; + setRedirectInner(redirect); + setAlertMsg(error); + } + + protected void destroy() + { + super.destroy(); + + if (paramList != null) + { + paramList.clear(); + paramList = null; + } + + forward = null; + redirect = null; + view = null; + executeMethod = null; + alertMsg = null; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpRequestValidate.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpRequestValidate.java new file mode 100644 index 0000000..f88e662 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpRequestValidate.java @@ -0,0 +1,249 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.httpd.validate.TwoValidate; +import org.zhiqim.httpd.validate.Validate; + +/** + * 请求中的验证信息 + * 1.支持在Action/view中增加验证项: request.addValidate(new IsNotEmpty("field", "该字估不允许为空")); + * 2.支持设置验证提交后,按钮设置成disabled,因此按钮尽可能使用button来提交,以保证disabled可用 + * 3.支持验证成功后,弹出确认信息,请设置confirm值 + * + * @version v1.0.0 @author zouzhigang 2016-7-18 新建与整理 + */ +public abstract class HttpRequestValidate extends HttpHeaderInner implements HttpRequest +{ + private String confirm = null; //form提交前确认信息,不为空白表示有效,生成if (confirm(""))此类代码 + private boolean isGray = true; //form提交后按钮是否为灰色,默认变灰,防止多次提交 + private List validateList; //form表单字段验证列表 + + /** 设置确认信息 */ + public void setValidateConfirm(String confirm) + { + this.confirm = confirm; + } + + /** 使提交按钮变灰 */ + public void setValidateGray(boolean isGray) + { + this.isGray = isGray; + } + + /** 获取验证列表 */ + public List getValidateList() + { + return (validateList==null)?new ArrayList():validateList; + } + + /** 增加验证信息 */ + public void addValidate(Validate validate) + { + if (validateList == null) + validateList = new ArrayList<>(5); + + validateList.add(validate); + } + + /** 检查验证信息 */ + public boolean chkValidate() + { + if (validateList == null) + return true; + + for (Validate validate : validateList) + { + if (validate instanceof OneValidate) + { + OneValidate one = (OneValidate)validate; + String value = getParameter(one.getField()); + if (!one.validate(value)) + { + setAlertMsg(one.getAlertMsg()); + return false; + } + } + else if (validate instanceof TwoValidate) + { + TwoValidate two = (TwoValidate)validate; + String value1 = getParameter(two.getField()); + String value2 = getParameter(two.getField2()); + if (!two.validate(value1, value2)) + { + setAlertMsg(two.getAlertMsg()); + return false; + } + } + } + return true; + } + + /** 清除所有的验证信息 */ + public void clearValidate() + { + if (validateList != null) + validateList.clear(); + } + + /** 获取验证字符串 */ + public String getValidateScript() + { + StringBuilder strb = new StringBuilder(); + strb.append(Scripts.head()); + strb.append(Scripts.SCRIPT_HEAD_VALIDATE); + + //创建一个HashMap,利用HashMap不允许重复的约束,使得调用的函数唯一 + HashMapSS functionMap = new HashMapSS(); + if (!Validates.isEmpty(validateList)) + { + for (Validate validate : validateList) + { + strb.append(validate.getScript()); + functionMap.put(validate.getName(), validate.getFunction()); + } + } + + if (!Validates.isEmpty(confirm)) + {//增加确认提示 + strb.append(Scripts.getConfirm(confirm)); + } + + if (isGray) + {// 使提交按钮变灰 + strb.append(Scripts.getGraySubmit(isFirefox())); + } + + strb.append(Scripts.SCRIPT_TAIL_VALIDATE); + + //变灰和恢复两个函数 + strb.append(Scripts.setFormButtonGray()); + strb.append(Scripts.setFormButtonResume()); + + //验证函数 + for (String function : functionMap.values()) + { + strb.append(function); + } + + if (strb.length() >= 4 && "\r\n\r\n".equals(strb.substring(strb.length() - 4))) + {//去掉可能的最后是两个\r\n的一个\r\n + strb.setLength(strb.length()-2); + } + + strb.append(Scripts.tail()); + return strb.toString(); + } + + /** 获取验证提交脚本 */ + public String getValidateSubmitScript() + { + StringBuilder strb = new StringBuilder(); + strb.append(Scripts.head()); + strb.append(Scripts.SCRIPT_HEAD_SUBMIT); + + //创建一个HashMap,利用HashMap不允许重复的约束,使得调用的函数唯一 + HashMapSS functionMap = new HashMapSS(); + if (!Validates.isEmpty(validateList)) + { + for (Validate validate : validateList) + { + strb.append(validate.getScript()); + functionMap.put(validate.getName(), validate.getFunction()); + } + } + + if (Validates.isEmpty(confirm)) + { + if (isGray) + {// 使提交按钮变灰 + strb.append(Scripts.getGraySubmit(isFirefox())); + } + + strb.append(_FOUR_).append("form.submit();").append(_BR_); + } + else + {//增加确认提示 + strb.append(_FOUR_).append("Z.confirm(\"").append(confirm).append("\", function()").append(_BR_); + strb.append(_FOUR_).append("{").append(_BR_); + + if (isGray) + { + if (!isFirefox()) + {//非火狐直接变灰 + strb.append(_FOUR_).append(_FOUR_).append("setFormButtonGray(form);").append(_BR_); + } + else + {//火狐检查是否有F && Z.onload,否则回退没办法恢复 + strb.append(_FOUR_).append(_FOUR_).append("if (Z && Z.onload)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("{//firefox要求F && Z.onload时才支持提交变灰和回退恢复").append(_BR_).append(_BR_) + //变灰 + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("setFormButtonGray(form);").append(_BR_) + //回退 + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("Z.onload(function(form){setFormButtonResume(form);}, form);").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("}").append(_BR_).append(_BR_); + } + } + + strb.append(_FOUR_).append(_FOUR_).append("form.submit();").append(_BR_); + strb.append(_FOUR_).append("});").append(_BR_); + } + + strb.append(Scripts.SCRIPT_TAIL_SUBMIT); + + //变灰和恢复两个函数 + strb.append(Scripts.setFormButtonGray()); + strb.append(Scripts.setFormButtonResume()); + + //验证函数 + for (String function : functionMap.values()) + { + strb.append(function); + } + + if (strb.length() >= 4 && "\r\n\r\n".equals(strb.substring(strb.length() - 4))) + {//去掉可能的最后是两个\r\n的一个\r\n + strb.setLength(strb.length()-2); + } + + strb.append(Scripts.tail()); + return strb.toString(); + } + + protected void destroy() + { + if (validateList != null) + { + validateList.clear(); + validateList = null; + } + + confirm = null; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpResource.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpResource.java new file mode 100644 index 0000000..f1d0294 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpResource.java @@ -0,0 +1,295 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; + +import org.zhiqim.httpd.entities.ClassResourceEntity; +import org.zhiqim.httpd.entities.FileResourceEntity; + +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Resources; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; + +/** + * HTTP资源,包括资源索引,资源类型和资源路径 + * + * 以便HttpContext支持多个资源目录,从而实现资源组件化 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpResource implements HttpdConstants +{ + public static final HttpResourceCompor _resourceCompor = new HttpResourceCompor(); + public static final FileResourceEntity _fileResource = new FileResourceEntity(); + public static final ClassResourceEntity _classResource = new ClassResourceEntity(); + + private int resourceIndex; + private String resourceType;//classpath|directory + private String resourcePath; + + public HttpResource(String resourceType, String resourcePath) + { + this.resourceType = resourceType; + this.resourcePath = Strings.removeEndsWith(resourcePath, "/"); + } + + public HttpResource(int resourceIndex, String resourceType, String resourcePath) + { + this.resourceIndex = resourceIndex; + this.resourceType = resourceType; + this.resourcePath = Strings.removeEndsWith(resourcePath, "/"); + } + + public boolean isValid() + { + return Validates.isNotEmpty(resourcePath) && (_CLASSPATH_.equals(resourceType) || _DIRECTORY_.equals(resourceType)); + } + + /********************************************************************/ + //业务处理等方法 + /********************************************************************/ + + /** + * 在该资源内处理请求 + * + * @param header 请求头 + * @param sender 响应发送器 + * @return =true表示处理到,=false表示不在该资源内 + * @throws IOException 异常 + */ + public boolean handleResource(HttpHeader header, HttpSender sender) throws IOException + { + //1.如果未配置资源直接返回false + if (resourceType == null || resourcePath == null) + return false; + + //2.先查找资源是否存在 + String path = resourcePath + header.getPathInContext(); + path = URLDecoder.decode(path, header.getCharacterEncoding()); + + if (isClasspath()) + {//classpath + if (!Resources.exists(HttpResource.class, path)) + return false; + + if (header.isMethodHead()) + {//如果HEAD,直接返回成功 + sender.sendHeader(_200_OK_); + return true; + } + + ((HttpHeaderInner)header).setPathOnResource(path); + _classResource.handle(header, sender); + return true; + } + else + {//dir + if (!Files.isFile(path)) + return false; + + if (header.isMethodHead()) + {//如果HEAD,直接返回成功 + sender.sendHeader(_200_OK_); + return true; + } + + ((HttpHeaderInner)header).setPathOnResource(path); + _fileResource.handle(header, sender); + return true; + } + } + + /** + * 获取该资源内的资源字符串 + * + * @param path 请求 + * @return =null表示不在该资源内,!=null表示在该资源内并读取到内容 + * @throws IOException 异常 + */ + public String getResourceString(String path) throws IOException + { + return getResourceString(path, _UTF_8_); + } + + /** + * 获取该资源内的资源字符串 + * + * @param path 请求 + * @param encoding 编码 + * @return =null表示不在该资源内,!=null表示在该资源内并读取到内容 + * @throws IOException 异常 + */ + public String getResourceString(String path, String encoding) throws IOException + { + if (resourcePath == null) + return null; + + path = resourcePath + "/" + Strings.removeStartsWith(path, "/"); + if (isClasspath()) + { + if (!Resources.exists(HttpResource.class, path)) + return null; + + return Resources.getResourceString(HttpResource.class, path, encoding); + } + else + { + if (!Files.isFile(path)) + return null; + + return Files.read(path, encoding); + } + } + + /** + * 读取资源目录下的文件名和目录名,目录名以/结尾,用于显示目录下列表 + * + * @param folderPath 目录地址 + * @return 名称列表 + * @throws IOException 异常 + */ + public List getResourceNameList(String folderPath) throws IOException + { + if (resourcePath == null) + return new ArrayList<>(0); + + folderPath = resourcePath + "/" + Strings.removeStartsWith(folderPath, "/"); + if (isClasspath()) + { + if (!Resources.exists(HttpResource.class, folderPath)) + return new ArrayList<>(0); + + return Resources.getResourceNameList(HttpResource.class, folderPath); + } + else + { + if (!Files.isDirectory(folderPath)) + return new ArrayList<>(0); + + File folder = new File(folderPath); + File[] files = folder.listFiles(new FileFilter(){public boolean accept(File file){return !file.isHidden();}}); + if (files == null) + return new ArrayList<>(0); + + List nameList = new ArrayList<>(); + for (File file : files) + { + if (file.isDirectory()) + nameList.add(file.getName()+"/"); + else + nameList.add(file.getName()); + } + + return nameList; + } + } + + /********************************************************************/ + //属性 get & set 等方法 + /********************************************************************/ + + public boolean isClasspath() + { + return _CLASSPATH_.equals(resourceType); + } + + public int getResourceIndex() + { + return resourceIndex; + } + public void setResourceIndex(int resourceIndex) + { + this.resourceIndex = resourceIndex; + } + public String getResourceType() + { + return resourceType; + } + public void setResourceType(String resourceType) + { + this.resourceType = resourceType; + } + public String getResourcePath() + { + return resourcePath; + } + public void setResourcePath(String resourcePath) + { + this.resourcePath = resourcePath; + } + + /********************************************************************/ + //定义HTTP资源等resourcePath & resourceType都相等时即对象相等 + /********************************************************************/ + + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((resourcePath == null) ? 0 : resourcePath.hashCode()); + result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode()); + return result; + } + + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + HttpResource other = (HttpResource) obj; + if (resourcePath == null) + { + if (other.resourcePath != null) + return false; + } + else if (!resourcePath.equals(other.resourcePath)) + return false; + if (resourceType == null) + { + if (other.resourceType != null) + return false; + } + else if (!resourceType.equals(other.resourceType)) + return false; + return true; + } + + /** 按索引排序 */ + private static class HttpResourceCompor implements Comparator + { + public int compare(HttpResource o1, HttpResource o2) + { + return o1.getResourceIndex() - o2.getResourceIndex(); + } + + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpResponse.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpResponse.java new file mode 100644 index 0000000..3492837 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpResponse.java @@ -0,0 +1,102 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + + +/** + * HTTP响应接口定义 + * + * @version v1.0.0 @author zouzhigang 2016-7-19 新建与整理 + */ +public interface HttpResponse extends HttpSender +{ + /***********************************************************************/ + // 关联连接信息 + /***********************************************************************/ + + /** 获取连接编号 */ + public String getId(); + + /** 获取当前请求 */ + public HttpRequest getRequest(); + + /** 获取上下文环境 */ + public HttpContext getContext(); + + /***********************************************************************/ + // 状态处理和判断 + /***********************************************************************/ + + /** 是否已提交 */ + public boolean isCommitted(); + + /** 是否可编辑 */ + public boolean isEditable(); + + /***********************************************************************/ + // 设置状态或,或重定向,或错误重定向 + /***********************************************************************/ + + /** 编码URL,增加非useCookie时有可能的jsessionid,在URL跳转时需要 */ + public String encodeURL(String url); + + /***********************************************************************/ + // 设置头部信息 + /***********************************************************************/ + + /** 设置缓存控制域 */ + public void setCacheControl(String value); + + /** 设置缓存控制域为私有 */ + public void setCacheControlPrivate(); + + /** 删除头部域 */ + public void removeHeader(String key); + + /** 获取头部域 */ + public String getHeader(String key); + + /** 判断是否有头部域 */ + public boolean hasHeader(String key); + + /** 获取编码格式 */ + public String getCharacterEncoding(); + + /***********************************************************************/ + // 设置Cookie + /***********************************************************************/ + + /** 增加cookie值,浏览器关闭即失效 */ + public void addCookie(String name, String value); + + /** 增加cookie值,指定保存时间 */ + public void addCookie(String name, String value, int seconds); + + /** 增加Cookie值 */ + public void addCookie(HttpCookie cookie); + + /** 删除Cookie值 */ + public void removeCookie(String name); + + /** 清空Cookie */ + public void clearCookie(); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpResponseImpl.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpResponseImpl.java new file mode 100644 index 0000000..e7a300a --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpResponseImpl.java @@ -0,0 +1,533 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Validates; + +/** + * HTTP响应类 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpResponseImpl implements HttpResponse +{ + private HttpRequestAbs request; + private HttpSenderImpl sender; + private HttpContext context; + private List cookies; + + private boolean addSessionIdToCookie; + private boolean addCookieToSender; + + public HttpResponseImpl(HttpRequestAbs request) + { + this.request = request; + this.sender = (HttpSenderImpl)request.getSender(); + this.context = request.getContext(); + + this.cookies = new ArrayList(); + } + + /***********************************************************************/ + // 关联连接信息 + /***********************************************************************/ + + /** 获取连接编号 */ + public String getId() + { + return request.getId(); + } + + /** 获取当前请求 */ + public HttpRequest getRequest() + { + return request; + } + + /** 获取上下文环境 */ + public HttpContext getContext() + { + return context; + } + + /***********************************************************************/ + // 状态处理和判断 + /***********************************************************************/ + + /** 是否可编辑 */ + public boolean isEditable() + { + return request != null && request.isEditable(); + } + + /** 是否已提交 */ + public boolean isCommitted() + { + return request == null || request.isCommitted(); + } + + /***********************************************************************/ + // 设置状态或,或重定向,或错误重定向 + /***********************************************************************/ + + /** + * 单独设置状态,通过setStatus,write和commit完成操作 + */ + public void setStatus(int code) + { + sender.setStatus(code); + } + + /** + * 发生错误,返回错误码和标准的错误信息 + * + * @param code 错误码 + * @throws IOException 可能的异常 + */ + public void sendError(int code) throws IOException + { + sendError(code, null); + } + + /** + * 发生错误,返回错误状态和一句错误描述,如果描述为null,则取标准错误描述 + * + * @param code 错误码 + * @param message 错误信息 + * @throws IOException 可能的异常 + */ + public void sendError(int code, String message) throws IOException + { + sender.sendError(code, message); + } + + /** + * 发送错误信息,内容为HTML格式 + * + * @param code 响应码 + * @throws IOException 可能的异常 + */ + public void sendErrorHTML(int code) throws IOException + { + sender.sendErrorHTML(code); + } + + /** + * 发送错误信息,内容为HTML格式 + * + * @param code 响应码 + * @param reason 响应原因 + * @throws IOException 可能的异常 + */ + public void sendErrorHTML(int code, String reason) throws IOException + { + sender.sendErrorHTML(code, reason); + } + + /** + * 客户端重定向,将资源指身一个永久URI,采用302把URI写在location消息头中 + * + * @param location 重定向连接地址 + * @throws IOException 可能的异常 + */ + public void sendRedirect(String location) throws IOException + { + Asserts.asState(!isCommitted()?null:"已提交不允许再提交"); + + this.addCookieSessionId(); + this.addCookieToSender(); + sender.sendRedirect(encodeURL(location)); + } + + /** + * 只返回消息头,如304等,会清空内容 + * + * @param code 响应码,可以是200表示成功 + * @throws IOException 可能的异常 + */ + public void sendHeader(int code) throws IOException + { + this.addCookieSessionId(); + this.addCookieToSender(); + sender.sendHeader(code); + } + + /** + * 一般用于返回200-207的成功码和提示的一个内容,和sendError不同的是sendError的reason=content,而sendSuccess的reason=默认值 + * + * @param code 成功码 + * @param content 内容 + * @throws IOException 可能的异常 + */ + public void sendContent(int code, String content) throws IOException + { + this.addCookieSessionId(); + this.addCookieToSender(); + sender.sendContent(code, content); + } + + /** 编码URL,增加非useCookie时有可能的jsessionid,在URL跳转时需要 */ + public String encodeURL(String url) + { + if (context == null) + return url; + + HttpSessionManager sessionManager = context.getSessionManager(); + if (sessionManager == null) + return url; + + if (context.isCookieUse()) + return url; + + HttpSession session = getRequest().getSession(); + if (session == null) + return url; + + String sessionId = session.getId(); + if (sessionId == null) + return url; + + int ind = url.indexOf("?"); + if (ind == -1) + url = url + "?"+sessionManager.getSessionIdName()+"=" + sessionId; + else//存在参数 + url = url + "&"+sessionManager.getSessionIdName()+"=" + sessionId; + return url; + } + + /** 获取响应状态码 */ + public int getStatus() + { + return sender.getStatus(); + } + + /** 获取状态描述 */ + public String getReason() + { + return sender.getReason(); + } + + /***********************************************************************/ + // 设置头部信息 + /***********************************************************************/ + + /** 设置头部域 */ + public void setHeader(String key, Object value) + { + sender.setHeader(key, value); + } + + /** 设置头部日期格式域 */ + public void setDateHeader(String key, long value) + { + sender.setDateHeader(key, value); + } + + /** 设置缓存控制域 */ + public void setCacheControl(String value) + { + setHeader(_CACHE_CONTROL_, value); + } + + /** 设置缓存控制域为私有 */ + public void setCacheControlPrivate() + { + setHeader(_PRAGMA_, _PRIVATE_); + setHeader(_CACHE_CONTROL_, _PRIVATE_); + } + + /** 设置头部域,增加一个属性 */ + public void addHeader(String key, Object value) + { + sender.addHeader(key, value); + } + + /** 设置头部日期格式域,增加一个日期类型的属性 */ + public void addDateHeader(String key, long value) + { + sender.addDateHeader(key, value); + } + + /** 删除头部域 */ + public void removeHeader(String key) + { + sender.removeHeader(key); + } + + /** 获取头部域 */ + public String getHeader(String key) + { + return sender.getHeader(key); + } + + /** 判断是否有头部域 */ + public boolean hasHeader(String key) + { + return sender.hasHeader(key); + } + + /** 设置编码格式 */ + public void setCharacterEncoding(String encoding) + { + sender.setCharacterEncoding(encoding); + } + + /** 获取编码格式 */ + public String getCharacterEncoding() + { + String encoding = sender.getCharacterEncoding(); + if (Validates.isEmptyBlank(encoding)) + encoding = getRequest().getCharacterEncoding(); + + return Validates.isEmptyBlank(encoding)?_UTF_8_:encoding; + } + + /** + * 设置内容类型,会增加默认的字符集到消息头中 + * + * @param contentType 内容类型 + */ + public void setContentType(String contentType) + { + sender.setContentType(contentType); + } + + /** + * 设置内容类型,不设置字符集到消息头中 + * + * @param contentType 内容类型 + */ + public void setContentTypeNoCharset(String contentType) + { + sender.setContentTypeNoCharset(contentType); + } + + /** 获取内容长度 */ + public long getFlushLength() + { + return sender.getFlushLength(); + } + + /***********************************************************************/ + // 设置Cookie + /***********************************************************************/ + + /** 增加cookie值,浏览器关闭即失效 */ + public void addCookie(String name, String value) + { + cookies.add(new HttpCookie(name, value)); + } + /** + * 增加cookie值 + * + * @param name 名称 + * @param value 值 + * @param seconds 存活时间,单位:秒 + */ + public void addCookie(String name, String value, int seconds) + { + HttpCookie cookie = new HttpCookie(name, value); + cookie.setMaxAge(seconds); + + addCookie(cookie); + } + + /** 增加Cookie值 */ + public void addCookie(HttpCookie cookie) + { + cookies.add(cookie); + } + + /** 删除Cookie值 */ + public void removeCookie(String name) + { + for (Iterator it = cookies.iterator();it.hasNext();) + { + HttpCookie cookie = it.next(); + if (name.equals(cookie.getName())) + it.remove(); + } + + addCookie(name, null, -1); + } + + /** 清空Cookie */ + public void clearCookie() + { + cookies.clear(); + } + + /** 把cookie写入到sender */ + private void addCookieToSender() + { + if (addCookieToSender || cookies.isEmpty() || context == null || !context.isCookieUse()) + return; + + //要求Cookies不为空,且当context != null 时约定使用Cookie; + String host = context.getCookieDomain(); + if (Validates.isEmpty(host)) + host = getRequest().getHostOnly(); + + String path = context.getCookiePath(); + if (Validates.isEmpty(path)) + path = context.getContextPath(); + + int port = context.getCookiePort(); + if (port == 0) + port = getRequest().getPort(); + + for (HttpCookie cookie : cookies) + { + sender.addMultiHeader(_SET_COOKIE_, cookie.getResponseValue(path, host, port)); + } + + addCookieToSender = true; + } + + /** 把sessionId组装成cookie */ + private void addCookieSessionId() + { + if (addSessionIdToCookie || context == null || !context.isCookieUse()) + return; + + HttpSessionManager sessionManager = context.getSessionManager(); + if (sessionManager == null) + return; + + HttpSession session = request.getSession(); + if (session == null) + return; + + //有会话要求维持时,放置到Cookies中 + String sessionId = session.getId(); + addCookie(new HttpCookie(sessionManager.getSessionIdName(), sessionId)); + + //如果有浸入式修改了sessionId,则清理老会话,设置新会话 + String oldSessionId = session.getOldSessionId(); + if (oldSessionId != null) + { + if (!sessionId.equals(oldSessionId)) + sessionManager.invalidateSession(oldSessionId); + session.clearOldSessionId(); + sessionManager.setSession(session); + } + + addSessionIdToCookie = true; + } + + /***********************************************************************/ + // 数据流处理,包括写入、打印和提交等 + /***********************************************************************/ + + /** 获取输出流 */ + public OutputStream getOutputStream() + { + return sender.getOutputStream(); + } + + /** 写内容字节方式 */ + public void write(byte[] b) throws IOException + { + addCookieSessionId(); + addCookieToSender(); + + sender.write(b); + } + + /** 写内容加回车换行 */ + public void println(String str) throws IOException + { + addCookieSessionId(); + addCookieToSender(); + + sender.println(str); + } + + /** 写回车换行 */ + public void println() throws IOException + { + addCookieSessionId(); + addCookieToSender(); + + sender.println(); + } + + /** 写内容,无回车换行 */ + public void print(String str) throws IOException + { + addCookieSessionId(); + addCookieToSender(); + + sender.print(str); + } + + /** 提交响应 */ + public void commit() throws IOException + { + if (isCommitted()) + return; + + addCookieSessionId(); + addCookieToSender(); + sender.commit(); + } + + /***********************************************************************/ + // toString + /***********************************************************************/ + + public String toString() + { + return sender.toString(); + } + + /***********************************************************************/ + // 内部调用的方法,不通过HttpResponse公开 + /***********************************************************************/ + + /** 销毁 */ + void destroy() + { + if (cookies != null) + { + cookies.clear(); + cookies = null; + } + + //引用置空 + request = null; + sender = null; + context = null; + } + + byte[] buildChunkedHeader(boolean chunked) + { + return sender.buildChunkedHeader(chunked); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpSender.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSender.java new file mode 100644 index 0000000..1bfaaea --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSender.java @@ -0,0 +1,160 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; +import java.io.OutputStream; + +/** + * HTTP发送器 + * + * @version v1.0.0 @author zouzhigang 2014-2-27 新建与整理 + */ +public interface HttpSender extends HttpdConstants +{ + /** 设置状态 */ + public void setStatus(int code); + + /** 设置编码格式 */ + public void setCharacterEncoding(String encoding); + + /** 获取响应状态 */ + public int getStatus(); + + /** 获取响应原因 */ + public String getReason(); + + /***********************************************************************/ + // 设置头部信息 + /***********************************************************************/ + + /** 设置头部域 */ + public void setHeader(String key, Object value); + + /** 设置头部日期格式域 */ + public void setDateHeader(String key, long value); + + /** 设置头部域,增加一个属性 */ + public void addHeader(String key, Object value); + + /** 设置头部日期格式域,增加一个日期类型的属性 */ + public void addDateHeader(String key, long value); + + /** + * 设置内容类型,会增加默认的字符集到消息头中 + * + * @param contentType 内容类型 + */ + public void setContentType(String contentType); + + /** + * 设置内容类型,不设置字符集到消息头中 + * + * @param contentType 内容类型 + */ + public void setContentTypeNoCharset(String contentType); + + /***********************************************************************/ + // sendError & sendRedirect + /***********************************************************************/ + + /** + * 发送错误信息 + * + * @param code 编码 + * @throws IOException 异常 + */ + public void sendError(int code) throws IOException; + + /** + * 发送错误信息 + * + * @param code 编码 + * @param reason 原因 + * @throws IOException 异常 + */ + public void sendError(int code, String reason) throws IOException; + + /** + * 发送错误信息,内容为HTML格式 + * + * @param code 响应码 + * @throws IOException 可能的异常 + */ + public void sendErrorHTML(int code) throws IOException; + + /** + * 发送错误信息,内容为HTML格式 + * + * @param code 响应码 + * @param reason 响应原因 + * @throws IOException 可能的异常 + */ + public void sendErrorHTML(int code, String reason) throws IOException; + + /** + * 发送重定向信息 + * + * @param location 重定向URL + * @throws IOException 异常 + */ + public void sendRedirect(String location) throws IOException; + + /** + * 发送消息头,如304等,会清空内容 + * + * @param code 响应码,可以是200表示成功 + * @throws IOException 可能的异常 + */ + public void sendHeader(int code) throws IOException; + + /** + * 一般用于返回200-207的成功码和提示的一个内容,和sendError不同的是sendError的reason=content,而sendSuccess的reason=默认值 + * + * @param code 成功码 + * @param content 内容 + * @throws IOException 可能的异常 + */ + public void sendContent(int code, String content) throws IOException; + + /***********************************************************************/ + // write & print & commit + /***********************************************************************/ + + /** 获取输出流 */ + public OutputStream getOutputStream(); + + /** 写内容字节方式 */ + public void write(byte[] b) throws IOException; + + /** 写内容加回车换行 */ + public void println(String str) throws IOException; + + /** 写回车换行 */ + public void println() throws IOException; + + /** 写内容,无回车换行 */ + public void print(String str) throws IOException; + + /** 提交流 */ + public void commit() throws IOException; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpSenderImpl.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSenderImpl.java new file mode 100644 index 0000000..9e0fe83 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSenderImpl.java @@ -0,0 +1,533 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.Map.Entry; + +import org.zhiqim.httpd.constants.HttpStatus; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; + +/** + * HTTP发送器 + * + * @version v1.0.0 @author zouzhigang 2018-9-11 新建与整理 + */ +public class HttpSenderImpl implements HttpSender +{ + private HttpHeaderAbs header; + private HttpOutputStream output; + + private String version = _HTTP_1_1_; + private int status = _200_OK_; + private String reason = _200_DESC_; + private String characterEncoding = _UTF_8_; + + //消息头 + private HashMap headers; + private StringBuilder headerBuffer; + + public HttpSenderImpl(HttpHeaderAbs header, boolean autoClose) + { + this.header = header; + this.output = header.getOutputStream(); + this.output.setSender(this); + + this.headers = new HashMap<>(5); + this.headers.put(_SERVER_, _ZHTTPD_); + if (autoClose) + {//是否执行完自动关闭 + this.headers.put(_CONNECTION_, _CLOSE_); + } + + this.headerBuffer = new StringBuilder(); + } + + /** 是否已提交 */ + public boolean isCommitted() + { + return header.isCommitted(); + } + + /** 是否可编辑 */ + public boolean isEditable() + { + return header.isEditable(); + } + + /** 是否支持响应GZIP */ + public boolean isResponseGZip() + { + return header.isResponseGZip(); + } + + /** 提交流 */ + public void commit() throws IOException + { + if (header.isCommitted()) + return; + + header.setStep(_11_COMMITTED_); + output.commit(); + + if (isClose()) + {//是否提交后关闭连接 + header.close(); + } + } + + /***********************************************************************/ + // 状态&版本&编码 + /***********************************************************************/ + + public void setStatus(int code) + { + this.status = code; + this.reason = HttpStatus.getStatusMsg(code); + } + + public int getStatus() + { + return status; + } + + public void setVersion(String version) + { + this.version = version; + } + + public String getReason() + { + return reason; + } + + public String getCharacterEncoding() + { + return characterEncoding; + } + + public long getFlushLength() + { + return output.getOutputLength(); + } + + /***********************************************************************/ + // 设置头部信息 + /***********************************************************************/ + + /** 设置头部域 */ + public void setHeader(String key, Object value) + { + if (value == null) + return; + + headers.put(key, Strings.valueOf(value)); + } + + /** 获取头部域 */ + public String getHeader(String key) + { + return headers.get(key); + } + + /** 判断是否有头部域 */ + public boolean hasHeader(String key) + { + return headers.containsKey(key); + } + + /** 是否关闭连接(没有连接属性和指明关闭的) */ + public boolean isClose() + { + String connection = getHeader(_CONNECTION_); + return Validates.isEmptyBlank(connection) || _CLOSE_.equalsIgnoreCase(connection); + } + + /** 设置头部日期格式域 */ + public void setDateHeader(String key, long value) + { + String date = DateTimes.getDateTimeHttp(value); + setHeader(key, date); + } + + /** 设置头部域,增加一个属性 */ + public void addHeader(String key, Object value) + { + if (value == null) + return; + + String v = getHeader(key); + if (v == null) + setHeader(key, value); + else + setHeader(key, v + "," + Strings.valueOf(value)); + } + + /** 设置头部日期格式域,增加一个日期类型的属性 */ + public void addDateHeader(String key, long value) + { + String date = DateTimes.getDateTimeHttp(value); + + String v = getHeader(key); + if (v == null) + setHeader(key, date); + else + setHeader(key, v + "," + value); + } + + /** 删除头部域 */ + public void removeHeader(String key) + { + headers.remove(key); + } + + /** 添加复杂的头信息,如cookie等 */ + public void addMultiHeader(String key, String value) + { + headerBuffer.append(key).append(_COLON_).append(value).append(_BR_); + } + + /** + * 设置编码格式 + * + * @param encoding 编码格式 + */ + public void setCharacterEncoding(String encoding) + { + Asserts.assertNotEmptyBlank(encoding, "编码格式不允许为空白"); + this.characterEncoding = encoding; + } + + /** + * 设置内容类型,会增加默认的字符集到消息头中 + * + * @param contentType 内容类型 + */ + public void setContentType(String contentType) + { + Asserts.assertNotEmptyBlank(contentType, "内容类型不允许为空白"); + + //在contentType中查找encoding,格式为:text/html; charset=UTF-8 + String mimeType = null; + int i0 = contentType.indexOf(';'); + if (i0 == -1) + mimeType = contentType; + else + { + mimeType = contentType.substring(0, i0).trim(); + int i1 = contentType.indexOf("charset=", i0); + if (i1>=0) + {//有设置编码则修改为该编码 + characterEncoding = contentType.substring(i1 + 8); + } + } + + if (Validates.isEmptyBlank(characterEncoding)) + setHeader(_CONTENT_TYPE_, mimeType); + else + setHeader(_CONTENT_TYPE_, mimeType + "; charset="+characterEncoding); + } + + /** 设置头部域中内容类型 */ + public void setContentTypeNoCharset(String contentType) + { + Asserts.assertNotEmptyBlank(contentType, "内容类型不允许为空白"); + Asserts.as(contentType.indexOf(";") == -1?null:"内容类型含字符集请调用setContentType方法"); + + setHeader(_CONTENT_TYPE_, contentType); + } + + /***********************************************************************/ + // 发送错误&内容 + /***********************************************************************/ + + /** + * 发送错误信息 + * + * @param code 编码 + * @throws IOException 异常 + */ + public void sendError(int code) throws IOException + { + sendError(code, null); + } + + /** + * 发送错误信息 + * + * @param code 编码 + * @param reason 原因 + * @throws IOException 异常 + */ + public void sendError(int code, String reason) throws IOException + { + Asserts.asState(isEditable()?null:"已提交不允许再提交"); + + this.status = code; + if (Validates.isEmptyBlank(reason)) + this.reason = HttpStatus.getStatusMsg(code); + else + this.reason = reason; + + this.clear(); + this.print(this.reason); + this.commit(); + } + + /** + * 发送错误信息,内容为HTML格式 + * + * @param code 响应码 + * @throws IOException 可能的异常 + */ + public void sendErrorHTML(int code) throws IOException + { + sendErrorHTML(code, null); + } + + /** + * 发送错误信息,内容为HTML格式 + * + * @param code 响应码 + * @param reason 响应原因 + * @throws IOException 可能的异常 + */ + public void sendErrorHTML(int code, String reason) throws IOException + { + Asserts.asState(isEditable()?null:"已提交不允许再提交"); + + this.status = code; + if (Validates.isEmptyBlank(reason)) + this.reason = HttpStatus.getStatusMsg(code); + else + this.reason = reason; + + //content + StringBuilder strb = new StringBuilder(); + strb.append(_HTML_5_TYPE_).append(_BR_); + strb.append(_HTML).append(_BR_); + strb.append(_HEAD).append("Error ").append(code).append("").append(_HEAD).append(_BR_); + strb.append(_BODY).append("

            Error ").append(reason).append("

            ").append(BODY_).append(_BR_); + strb.append(HTML_).append(_BR_); + + this.clear(); + this.print(this.reason); + this.commit(); + } + + /** + * 发送消息内容,如200,201等,含内容 + * + * @param code 响应码,可以是200表示成功 + * @param content 响应内容 + * @throws IOException 可能的异常 + */ + public void sendContent(int code, String content) throws IOException + { + Asserts.asState(isEditable()?null:"已提交不允许再提交"); + + this.status = code; + this.reason = HttpStatus.getStatusMsg(code); + + this.print(content); + this.commit(); + } + + /** + * 发送重定向信息 + * + * @param url 重定向URL + * @throws IOException 异常 + */ + public void sendRedirect(String url) throws IOException + { + Asserts.asState(!isCommitted()?null:"已提交不允许再提交"); + + this.status = _302_FOUND_; + this.reason = _302_DESC_; + this.setHeader(_LOCATION_, url); + this.setHeader(_PROXY_CONNECTION_, _CLOSE_); + this.commit(); + } + + /** + * 只返回消息头,如304等,会清空内容 + * + * @param code 响应码,可以是200表示成功 + * @throws IOException 可能的异常 + */ + public void sendHeader(int code) throws IOException + { + Asserts.asState(isEditable()?null:"有提交数据时不允许更新提交内容"); + + this.status = code; + this.reason = HttpStatus.getStatusMsg(code); + + this.clear(); + this.commit(); + } + + /***********************************************************************/ + // write & print & commit + /***********************************************************************/ + + /** 获取输出流 */ + public OutputStream getOutputStream() + { + return output; + } + + /** 写内容字节方式 */ + public void write(byte[] b) throws IOException + { + output.write(b); + } + + /** 写内容加回车换行 */ + public void println(String str) throws IOException + { + output.write(str.getBytes(characterEncoding)); + output.write(_CRLF_); + } + + /** 写回车换行 */ + public void println() throws IOException + { + output.write(_CRLF_); + } + + /** 写内容,无回车换行 */ + public void print(String str) throws IOException + { + output.write(str.getBytes(characterEncoding)); + } + + /** 清理内容 */ + public void clear() + { + output.reset(); + } + + /** 刷新流(分块) */ + public void flush() throws IOException + { + if (isCommitted()) + return; + + output.flush(); + } + + public byte[] buildChunkedHeader(boolean chunked) + { + //1.1 写入标志 + if (chunked) + {//分块 + setHeader(_TRANSFER_ENCODING_, _CHUNKED_); + } + else + {//整块 + if (isResponseGZip() && output.getContentLength() > 256) + {//如果支持gzip且内容长度大于256,则尝试压缩,压缩成功设置gzip头 + if (output.processGZipCompress()) + addHeader(_CONTENT_ENCODING_, _ENCODING_GZIP_); + } + + //整块的不管用户是否设置了内容长度,统一重设 + setHeader(_CONTENT_LENGTH_, output.getContentLength()); + } + + if (!hasHeader(_CONTENT_TYPE_)) + {//1.2 没有contentType设置成默认格式 + setContentType(_TEXT_HTML_UTF_8_); + } + + //2.1 准备消息头 + StringBuilder strb = new StringBuilder(); + strb.append(version).append(" ").append(status).append(" ").append(Urls.encodeUTF8(reason)).append(_BR_); + + for (Entry entry : headers.entrySet()) + {//2.2 响应消息头 + strb.append(entry.getKey()).append(_COLON_).append(entry.getValue()).append(_BR_); + } + + //2.3 响应复杂的消息头 + strb.append(headerBuffer); + + //2.4 增加时间和结束标志 + strb.append(_DATE_).append(_COLON_).append(DateTimes.getDateTimeHttp()).append(_BR_); + strb.append(_BR_);//头部结束标志 + + return strb.toString().getBytes(_UTF_8_C_); + } + + + + /***********************************************************************/ + // toString & destroy + /***********************************************************************/ + + public String toString() + { + StringBuilder strb = new StringBuilder(); + strb.append(version).append(" ").append(status).append(" ").append(Urls.encode(reason, characterEncoding)).append(_BR_); + if (headers != null) + { + for (Entry entry : headers.entrySet()) + { + strb.append(entry.getKey()).append(_COLON_).append(entry.getValue()).append(_BR_); + } + } + + if (headerBuffer != null) + { + strb.append(headerBuffer.toString()); + } + strb.append(_BR_); + return strb.toString(); + } + + /** 销毁 */ + public void destroy() + { + if (headers != null) + { + headers.clear(); + headers = null; + } + + if (headerBuffer != null) + { + headerBuffer.setLength(0); + headerBuffer = null; + } + + //引用置空 + output = null; + header = null; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpServer.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpServer.java new file mode 100644 index 0000000..7c29098 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpServer.java @@ -0,0 +1,292 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.bio.HttpBioListener; +import org.zhiqim.httpd.bio.HttpBioSslListener; +import org.zhiqim.httpd.nio.HttpNioListener; +import org.zhiqim.httpd.nio.HttpNioSslListener; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.Servicer; +import org.zhiqim.kernel.config.Group; +import org.zhiqim.kernel.extend.HashSetS; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Validates; + +/** + * HTTP多例服务,负责启动和关闭:

            + * 1、初始化AIO/BIO/NIO监听服务
            + * 2、加载和配置上下文环境
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpServer extends Servicer implements HttpdConstants +{ + private static final Log log = LogFactory.getLog(HttpServer.class); + + private boolean isRunning; //是否运行 + private HttpListener listener; //HTTP监听器 + private final List contextList; //HTTP上下文环境表 + + /*********************************************************************************/ + //配置创建HTTP服务 + /*********************************************************************************/ + + public HttpServer() + { + this.contextList = new ArrayList<>(); + } + + public boolean isRunning() + { + return isRunning; + } + + @Override + public boolean create() throws Exception + { + //1.诊断参数 + Group group = Global.getGroup(id); + Asserts.as(group != null?null:"HTTP服务[%s]未找到整个配置组", id); + log.info("初始化[HTTP服务:%s]开始...", id); + + //2、初始化上下文环境 + String contexts = group.getString(_SERVER_CONTEXT_); + Asserts.as(Validates.isNotEmptyBlank(contexts)?null:"HTTP服务["+id+"]未找到[context]配置项"); + + //3、初始化监听器 + String scheme = group.getString(_LISTEN_SCHEME_, _HTTP_); + String io = group.getString(_LISTEN_IO_, _BIO_); + if (_HTTPS_.equalsIgnoreCase(scheme)) + { + if (_NIO_.equalsIgnoreCase(io)) + listener = new HttpNioSslListener(this); + else + listener = new HttpBioSslListener(this); + } + else + { + if (_NIO_.equalsIgnoreCase(io)) + listener = new HttpNioListener(this); + else + listener = new HttpBioListener(this); + } + + listener.setGroup(group); + listener.open(); + + //4、初始化上下文环境 + String[] contextArr = Arrays.toStringArray(contexts); + for (String contextId : contextArr) + { + Group cGroup = Global.getGroup(contextId); + Asserts.as(cGroup != null?null:"HTTP服务["+id+"]未找到context["+contextId+"]配置项"); + + String contextClass = cGroup.getString(_CONTEXT_CLASS_, _HTTP_CONTEXT_CLASS_); + Object obj = Classes.newInstance(contextClass); + Asserts.as((obj instanceof HttpContext)?null:"HTTP服务["+id+"]context["+contextId+"]的[class]配置项未实现HttpContext接口"); + + HttpContext context = (HttpContext)obj; + context.setServer(this); + if (!context.create(cGroup)) + return false; + + contextList.add(context); + } + + isRunning = true; + + log.info("初始化[HTTP服务:%s]"+this.listener.toString()+"完成!!!%s", id, _BR_); + return true; + } + + @Override + public void destroy() throws Exception + { + isRunning = false; + if (listener != null) + { + listener.close(); + listener = null; + } + + for (HttpContext context : contextList) + { + if (context.isRunning()) + context.destroy(); + } + } + + /***************************************************************************************************/ + //手动创建服务 设置三个参数 domain & host & encoding 和 设置 listen & context 再setRunning() + /***************************************************************************************************/ + + public void setRunning() + { + this.isRunning = true; + } + + public void addContext(HttpContext context) + { + //检查是否有相同的配置 + context.setServer(this); + chkContextDomainPath(context.getContextDomains(), context.getContextPath()); + + //通过后放置到列表中 + contextList.add(context); + } + + public void removeContext(HttpContext context) + { + try + { + context.destroy(); + contextList.remove(context); + } + catch (Exception e) + { + log.error("移除上下文环境时异常", e); + } + } + + public void removeContext(String contextId) + { + HttpContext context = getContext(contextId); + if (context == null) + return; + + removeContext(context); + } + + /** 检查域名和路径是否存在相同的配置 */ + public void chkContextDomainPath(HashSetS domains, String path) + { + if (domains.isEmpty()) + {//未配置域名 + for (HttpContext ctx : contextList) + { + if (!ctx.getContextDomains().isEmpty()) + continue; + + if (!ctx.getContextPath().equals(path)) + continue; + + throw Asserts.exception("存在相同的上下文环境配置[%s]", ctx.getContextPath()); + } + } + else + {//有配置域名 + for (HttpContext ctx : contextList) + { + HashSetS ds = ctx.getContextDomains(); + if (ds.isEmpty()) + continue; + + if (!ctx.getContextPath().equals(path)) + continue; + + for (String d : domains.instance()) + { + if (!ds.contains(d)) + continue; + + //只要有一个成立则表示有相同 + throw Asserts.exception("存在相同的上下文环境配置[%s][%s]", d, ctx.getContextPath()); + } + } + } + } + + /*********************************************************************************/ + //获取 & 配对 listen, context, scheme, port, domain, host, encoding + /*********************************************************************************/ + + public HttpListener getListener() + { + return listener; + } + + public List getContextList() + { + return contextList; + } + + public HttpContext getContext(String contextId) + { + Asserts.as(contextId != null?null:"上下文环境路径不能为空"); + + for (HttpContext context : contextList) + { + if (contextId.equals(context.getId())) + return context; + } + + return null; + } + + public HttpContext getContext(String contextDomain, String contextPath) + { + Asserts.as(contextPath != null?null:"上下文环境路径不能为空"); + + if (!Validates.isEmptyBlank(contextDomain)) + {//1.域名不为空,优先找匹配上的 + for (HttpContext context : contextList) + { + HashSetS domains = context.getContextDomains(); + if (domains.isEmpty()) + continue; + + if (domains.contains(contextDomain) && contextPath.equals(context.getContextPath())) + return context; + } + } + + //2.再找缺省未配置域名的,只比较上下文环境路径 + for (HttpContext context : contextList) + { + if (!context.getContextDomains().isEmpty()) + continue; + + if (contextPath.equals(context.getContextPath())) + return context; + } + + return null; + } + + public int getPort() + { + return listener.getPort(); + } + + public String getScheme() + { + return listener.getScheme(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpSession.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSession.java new file mode 100644 index 0000000..c14becc --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSession.java @@ -0,0 +1,147 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import org.zhiqim.kernel.extend.HashMapSO; + +/** + * HTTP会话接口定义 + * + * @version v1.0.0 @author zouzhigang 2016-7-15 新建与整理 + */ +public interface HttpSession +{ + /************************************************************************************/ + //会话参数初始设置(IP地址 & 用户代理) + /************************************************************************************/ + + public void setSessionIp(String sessionIp); + + public void setUserAgent(String userAgent); + + /************************************************************************************/ + //会话更新 & 失效 + /************************************************************************************/ + + public void updateLastAccessed(); + + public void updateInfo(String sessionIp, String userAgent); + + public void invalidate(); + + /************************************************************************************/ + //用于业务浸入式更改sessionId(注:谨慎使用),HttpResponse会oldSessionId进行处理 + /************************************************************************************/ + + public void setNewSessionId(String newSessionId); + + public String getOldSessionId(); + + public void clearOldSessionId(); + + /************************************************************************************/ + //获取参数判断值 + /************************************************************************************/ + + public HttpContext getContext(); + + public String getId(); + + public boolean isNew(); + + public String getSessionIp(); + + public String getUserAgent(); + + public int getMaxInactiveInterval(); + + public long getCreated(); + + public String getCreateTime(); + + public long getLastAccessed(); + + public String getLastAccessTime(); + + public long getRemainSecond(); + + public long getRemainMinute(); + + public long[] getRemainTime(); + + public String getRemainTimeDesc(); + + /**********************************************/ + //读写关联到HttpSession中attribute列表 + /**********************************************/ + + public HashMapSO getAttributes(); + + public Object getAttribute(String name); + + public Object removeAttribute(String name); + + public void setAttribute(String name, Object value); + + public boolean hasAttribute(String name); + + public Object getAttribute(String name, Object defaultValue); + + public String getAttributeString(String name); + + public String getAttributeString(String name, String defaultValue); + + public int getAttributeInt(String name); + + public int getAttributeInt(String name, int defaultValue); + + public long getAttributeLong(String name); + + public long getAttributeLong(String name, long defaultValue); + + public boolean getAttributeBoolean(String name, boolean defaultValue); + + /**********************************************/ + //SessionUser相关 + /**********************************************/ + + /** 判断会话中是否有用户信息 */ + public boolean hasSessionUser(); + + /** 获取会话用户信息中用户类,多个时抛异常 */ + public HttpSessionUser getSessionUser(); + + /** 获取会话用户名称,多个时抛异常 */ + public String getSessionName(); + + /** 绑定会话用户信息 */ + public void bindSessionUser(HttpSessionUser sessionUser); + + /** 解绑会话用户信息 */ + public void unbindSessionUser(); + + /** 判断会话中是否有用户信息且指定的用户类 */ + public boolean hasSessionUser(Class clazz); + + /** 获取会话用户信息且指定的用户类 */ + public T getSessionUser(Class clazz); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpSessionManager.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSessionManager.java new file mode 100644 index 0000000..a0191fd --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSessionManager.java @@ -0,0 +1,128 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.util.List; + +import org.zhiqim.kernel.paging.PageResult; + +/** + * HTTP会话管理器接口

            + * 1.要求实现启动方法
            + * 2.设置会话值
            + * 3.获取会话值
            + * 4.删除会话值
            + * 5.遍历会话值 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface HttpSessionManager extends HttpdConstants +{ + /** 设置上下文环境对象 */ + public void setContext(HttpContext context); + + /** 获取上下文环境对象 */ + public HttpContext getContext(); + + /******************************************************************************************/ + //开启和关闭 + /******************************************************************************************/ + + /** 开启会话管理 */ + public void open(); + + /** 关闭会话管理 */ + public void close(); + + /******************************************************************************************/ + //设置参数部分 + /******************************************************************************************/ + + /** 设置会话超时时长 */ + public void setSessionTimeout(int sessionTimeout); + + /** 获取会话超时时长 */ + public int getSessionTimeout(); + + /** 设置会话编号名称 */ + public void setSessionIdName(String sessionCookieName); + + /** 获取会话编号名称 */ + public String getSessionIdName(); + + /** 设置会话参数 */ + public void setSessionParameter(String sessionParameter); + + /******************************************************************************************/ + //设置 & 获取 & 失效 会话 + /******************************************************************************************/ + + /** 新建会话 */ + public HttpSession newSession(String sessionId); + + /** 设置会话 */ + public void setSession(HttpSession session); + + /** 获取会话 */ + public HttpSession getSession(String sessionId); + + /** 判断会话是否存在 */ + public boolean hasSession(String sessionId); + + /** 通过会话编号使会话失效 */ + public void invalidateSession(String sessionId); + + /** 更新会话最后访问时间 */ + public void updateLastAccessed(String sessionId); + + /** 更新会话信息 */ + public void updateInfo(String sessionId, String sessionIp, String userAgent); + + /******************************************************************************************/ + //会话查询和统计 + /******************************************************************************************/ + + /** 会话数 */ + public int size(); + + /** 获取会话列表 */ + public List getSessionList(); + + /** 获取会话分页信息 */ + public PageResult getSessionPage(int pageNo, int pageSize); + + /******************************************************************************************/ + //会话用户查询和统计 + /******************************************************************************************/ + + /** 会话登录数 */ + public int sizeUser(); + + /** 是否有会话名称对应的会话 */ + public boolean hasSessionName(String sessionName); + + /** 获取会话登录用户列表,指定会话用户类名(如前后端共用session管理器的情况) */ + public List getSessionUserList(); + + /** 获取会话登录用户分页信息,指定会话用户类名(如前后端共用session管理器的情况) */ + public PageResult getSessionUserPage(int pageNo, int pageSize); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpSessionUser.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSessionUser.java new file mode 100644 index 0000000..31d30fc --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSessionUser.java @@ -0,0 +1,297 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.lang.reflect.Method; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Types; + +/** + * HTTP在线用户定义,子类继承时,需设置到HttpSessionManager中 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class HttpSessionUser +{ + protected transient HttpSession session; + + //两个冗余的字段,用于生成JSON时可以通过字符串找到对应的类名和字段 + protected String className; + protected String sessionName; + + //通用的值表,和session中的attributeMap不同的是: + //1.valueMap绑定sessionUser,解绑即失效 + //2.attributeMap可用在和sessionUser无关的地方 + protected HashMapSO valueMap = new HashMapSO(); + + public HttpSessionUser() + { + className = this.getClass().getName(); + } + + /**************************************************/ + //要求子类强制实现的方法 + /**************************************************/ + + public abstract String getSessionName(); + + /**************************************************/ + //由HttpSession回调 + /**************************************************/ + + public void setSession(HttpSession session) + { + this.session = session; + this.sessionName = getSessionName(); + } + + /**************************************************/ + //获取HttpSession对象和相关属性 + /**************************************************/ + + public HttpSession getSession() + { + return session; + } + + public HttpContext getContext() + { + return session.getContext(); + } + + public String getSessionId() + { + return session.getId(); + } + + public boolean isNew() + { + return session.isNew(); + } + + public String getSessionIp() + { + return session.getSessionIp(); + } + + public String getUserAgent() + { + return session.getUserAgent(); + } + + public long getCreated() + { + return session.getCreated(); + } + + public String getCreateTime() + { + return session.getCreateTime(); + } + + public long getLastAccessed() + { + return session.getLastAccessed(); + } + + public String getLastAccessTime() + { + return session.getLastAccessTime(); + } + + public long getRemainSecond() + { + return session.getRemainSecond(); + } + + public long getRemainMinute() + { + return session.getRemainMinute(); + } + + public long[] getRemainTime() + { + return session.getRemainTime(); + } + + public String getRemainTimeDesc() + { + return session.getRemainTimeDesc(); + } + + /**********************************************/ + //读写关联到HttpSession中attribute列表 + /**********************************************/ + + public HashMapSO getAttributes() + { + return session.getAttributes(); + } + + public Object getAttribute(String name) + { + return session.getAttribute(name); + } + + public Object removeAttribute(String name) + { + return session.removeAttribute(name); + } + + public void setAttribute(String name, Object value) + { + session.setAttribute(name, value); + } + + public boolean hasAttribute(String name) + { + return session.hasAttribute(name); + } + + /**********************************************/ + //读写关联到HttpSessionUser自己的参数列表 + /**********************************************/ + + public HashMapSO getValues() + { + return valueMap; + } + + public Object getValue(String key) + { + return valueMap.get(key); + } + + public boolean hasValue(String key) + { + return valueMap.containsKey(key); + } + + public Object removeValue(String key) + { + return valueMap.remove(key); + } + + public void setValue(String key, Object value) + { + valueMap.put(key, value); + } + + public void setValueTrue(String key) + { + valueMap.put(key, true); + } + + public void setValueFalse(String key) + { + valueMap.put(key, false); + } + + public String getValueString(String key) + { + return getValueString(key, null); + } + + public String getValueString(String key, String defaultValue) + { + Object value = getValue(key); + return (value == null)?defaultValue:Strings.trim(String.valueOf(value)); + } + + public int getValueInt(String key) + { + return getValueInt(key, -1); + } + + public int getValueInt(String key, int defaultValue) + { + return Ints.toInt(valueMap.get(key), defaultValue); + } + + public long getValueLong(String key) + { + return getValueLong(key, -1); + } + + public long getValueLong(String key, long defaultValue) + { + return Longs.toLong(valueMap.get(key), defaultValue); + } + + public boolean getValueBoolean(String key, boolean defaultValue) + { + Object value = valueMap.get(key); + if (value == null) + return defaultValue; + else if (value instanceof Boolean) + return (Boolean)value; + else if (value instanceof String) + return Boolean.parseBoolean((String)value); + else + return defaultValue; + } + + /** + * 有条件判断是否有值,如果valueMap有值则返回valueMap中的true/false,如果没有,则通过类和静态方法名,返回true/false + * 注意:1.如果valueMap中有值,值不是boolean类型,返回false + * 2.如果类和静态方法返回值不是boolean类型,返回false,如果不是静态方法或静态方法参数不是HttpSessionUser返回false + * + * @param key 键值 + * @param className 类名 + * @param methodName 方法名,方法必须是静态方法,且参数为HttpSessionUser实例,如public static boolean isOpen(HttpSessionUser sessionUser){}; + * @return =true/false + */ + public boolean isValue(String key, String className, String staticMethodName) + { + if (hasValue(key)) + {//有值则取值 + Object value = getValue(key); + return Types.isBoolean(value)?(Boolean)value:false; + } + + Class clazz = Global.forName(className); + Asserts.as(clazz != null?null:"判断会话属性值时,传入的类名或类别名不正确"); + + Method method = Classes.getMethodDeep(clazz, staticMethodName, this.getClass()); + Asserts.as(method != null?null:"判断会话属性值时,传入的静态方法名未找到"); + Asserts.as(Classes.isStaticMethod(method)?null:"判断会话属性值时,传入的方法名不是静态方法"); + + try + { + Object value = method.invoke(null, this); + Asserts.as(Types.isBoolean(value)?null:"判断会话属性值时,方法返回的值不是boolean型"); + + return (Boolean)value; + } + catch (Exception e) + {//异常返回false,表示业务处理失败 + return false; + } + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpSslConfig.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSslConfig.java new file mode 100644 index 0000000..c9ebdd4 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSslConfig.java @@ -0,0 +1,241 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.FileInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.KeyStore; +import java.security.SecureRandom; + +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLEngineResult; +import javax.net.ssl.SSLEngineResult.HandshakeStatus; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; + +import org.zhiqim.httpd.nio.HttpNioSslConnection; +import org.zhiqim.kernel.config.Group; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Validates; + +/** + * SSL参数配置和管理 + * + * @version v1.0.0 @author zouzhigang 2018-6-30 新建与整理 + */ +public class HttpSslConfig implements HttpdConstants +{ + //两项必须(服务端公私钥) + private String keystorePath; // = "./conf/keystore.jks"; + private String keystorePass; // = "123456"; + + //三项根据要求可选(CA信任公钥) + private String truststorePath; // = "./conf/truststore.jks"; + private String truststorePass; // = "123456"; + private boolean clientAuth; //是否需要客户端证验证(双向验证,客户端也要导入证书才行) + + public void initParam(Group group) + { + //1.SSL参数(五项,其中Keystore两项必须) + keystorePath = group.getString(_KEY_STORE_PATH_); + keystorePass = group.getString(_KEY_STORE_PASS_); + + Asserts.as(Validates.isNotEmpty(keystorePath)?null:"配置HTTPS时要求必须配置[keystorePath]不能为空"); + Asserts.as(Validates.isNotEmpty(keystorePass)?null:"配置HTTPS时要求必须配置[keystorePass]不能为空"); + + truststorePath = group.getString(_TRUST_STORE_PATH_); + truststorePass = group.getString(_TRUST_STORE_PASS_); + + Asserts.as((Validates.isNotEmpty(truststorePath)?Validates.isNotEmpty(truststorePass):true)?null:"配置HTTPS时如要配置了[truststorePath]则[truststorePass]不能为空"); + + clientAuth = group.isTrue(_CLIENT_AUTH_); + } + + /******************************************************************************/ + //获取SSL创建的SSLContext&SSLServerSocketFactory + /******************************************************************************/ + + /** 创建SSL工厂 */ + public SSLServerSocketFactory createFactory() throws Exception + { + return createSSLContext().getServerSocketFactory(); + } + + /** 创建SSL环境 */ + public SSLContext createSSLContext() throws Exception + { + SSLContext sslContext = SSLContext.getInstance(SSL_PROTOCOL); + + KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(SSL_ALGORITHM); + KeyStore keyStore = KeyStore.getInstance(SSL_KEYSTORE_TYPE); + + FileInputStream kfis = new FileInputStream(keystorePath); + keyStore.load(kfis, keystorePass.toCharArray()); + keyManagerFactory.init(keyStore, keystorePass.toCharArray()); + + TrustManager[] trustManager = null; + if (Validates.isNotEmptyBlank(truststorePath)) + {//有CA信任证书的创建管理器 + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(SSL_ALGORITHM); + KeyStore trustStore = KeyStore.getInstance(SSL_KEYSTORE_TYPE); + FileInputStream tfis = new FileInputStream(truststorePath); + trustStore.load(tfis, truststorePass.toCharArray()); + trustManagerFactory.init(trustStore); + + trustManager = trustManagerFactory.getTrustManagers(); + } + + sslContext.init(keyManagerFactory.getKeyManagers(), trustManager, new SecureRandom()); + return sslContext; + } + + /******************************************************************************/ + //SSL握手 + /******************************************************************************/ + + /** 握手操作 */ + public boolean doHandshake(HttpNioSslConnection conn) + { + //1.初始化参数 + SSLEngine sslEngine = conn.getSSLEngine(); + + SSLSession session = sslEngine.getSession(); + int appBufMax = session.getApplicationBufferSize(); + int netBufMax = session.getPacketBufferSize(); + + ByteBuffer appBuf = ByteBuffer.allocate(appBufMax + 10); + ByteBuffer netBuf = ByteBuffer.allocate(netBufMax); + + try + { + //2.开启握手 + sslEngine.beginHandshake(); + + //3.握手执行 + return doHandshake(conn, sslEngine, appBuf, netBuf); + } + catch(Exception e) + {//4.握手异常 + return false; + } + } + + /** 握手执行 */ + private boolean doHandshake(HttpNioSslConnection conn, SSLEngine sslEngine, ByteBuffer appBuf, ByteBuffer netBuf) throws IOException + { + HandshakeStatus hsStatus = sslEngine.getHandshakeStatus(); + + boolean handshakeDone = false; + while (!handshakeDone) + { + switch (hsStatus) + { + case NEED_UNWRAP: + {//1.客户端请求Hello + netBuf.clear(); + conn.read(netBuf); + netBuf.flip(); + + do + { + sslEngine.unwrap(netBuf, appBuf); + hsStatus = doTask(sslEngine); + } + while(netBuf.hasRemaining() && hsStatus == SSLEngineResult.HandshakeStatus.NEED_UNWRAP); + break; + } + case NEED_WRAP: + {//2.服务端响应Hello + netBuf.clear(); + sslEngine.wrap(_HELLO_N_, netBuf); + netBuf.flip(); + + conn.write(netBuf); + hsStatus = doTask(sslEngine); + break; + } + case NEED_TASK: + {//3.等待任务,当前使用同步处理 + hsStatus = doTask(sslEngine); + break; + } + case NOT_HANDSHAKING: + {//4.握手成功 + handshakeDone = true; + break; + } + case FINISHED: + {//5.握手完成 + break; + } + } + } + + return handshakeDone; + } + + /** 握手任务 */ + private HandshakeStatus doTask(SSLEngine sslEngine) + { + Runnable task; + while ((task = sslEngine.getDelegatedTask()) != null) + { + task.run(); + } + + return sslEngine.getHandshakeStatus(); + } + + /******************************************************************************/ + //获取配置参数值 + /******************************************************************************/ + + public String getKeystorePath() + { + return keystorePath; + } + + public String getKeystorePass() + { + return keystorePass; + } + + public String getTruststorePath() + { + return truststorePath; + } + + public String getTruststorePass() + { + return truststorePass; + } + + public boolean isClientAuth() + { + return clientAuth; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpSslConnection.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSslConnection.java new file mode 100644 index 0000000..83f8d73 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpSslConnection.java @@ -0,0 +1,34 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import javax.net.ssl.SSLEngine; + +/** + * SSL连接接口定义 + * + * @version v1.0.0 @author zouzhigang 2018-7-6 新建与整理 + */ +public interface HttpSslConnection extends HttpConnection +{ + public SSLEngine getSSLEngine(); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpUploader.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpUploader.java new file mode 100644 index 0000000..ff1c20f --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpUploader.java @@ -0,0 +1,277 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.HashMap; + +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; + +/** + * HTTP 上传类 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpUploader implements HttpdConstants, AutoCloseable +{ + private static final String CONTENT_DISPOSITION = "Content-Disposition:"; + private static final String CONTENT_TYPE = "Content-Type:"; + + private HashMap parameters; + + private String name; + private String fileContentType; + private String fileName; + private ByteArrayOutputStream fileContent; + + public HttpUploader() + { + parameters = new HashMap(); + fileContent = new ByteArrayOutputStream(); + } + + public String getParameter(String name) + { + return parameters.get(name); + } + + public HashMap getParameters() + { + return parameters; + } + + public String getName() + { + return name; + } + + public String getFileName() + { + return fileName; + } + + public String getFileExt() + { + return Files.getFileExt(fileName); + } + + public String getFileContentType() + { + return fileContentType; + } + + public byte[] getBytes() + { + return fileContent.toByteArray(); + } + + public int getFileSize() + { + return fileContent.size(); + } + + public void writeTo(OutputStream out) throws IOException + { + fileContent.writeTo(out); + } + + public void writeToFile(String filePath) throws IOException + { + Files.write(filePath, fileContent.toByteArray()); + } + + public InputStream getInputStream() + { + return new ByteArrayInputStream(fileContent.toByteArray()); + } + + public void close() + { + try{fileContent.close();}catch (IOException e){} + fileContent = null; + } + + public void parseHttpRequest(HttpRequest request, int maxSize) throws Exception + { + int contentLength = request.getContentLength(); + if (contentLength == 0) + throw new Exception("非法的文件上传信息[contentLength == 0]"); + + if (contentLength > maxSize) + throw new Exception("文件超过大小[contentLength == "+ contentLength +"]"); + + String contentType = request.getContentType(); + if (contentType == null) + throw new Exception("非法的文件上传信息[contentType == null]"); + + if (!contentType.startsWith(_MULTIPART_FORM_DATA_)) + throw new Exception("非法的文件上传信息[contentType == "+ contentType +"]"); + + int ind = contentType.indexOf("boundary="); + if (ind == -1) + throw new Exception("非法的文件上传信息[contentType == "+ contentType +"]"); + + String boundary = contentType.substring(ind+"boundary=".length()); + byte[] buffer = new byte[4096]; + InputStream input = request.getInputStream(); + + int len = 0; String name = null;String curContentType = null; + int type = 0; boolean isSkinEmptyLine = false;boolean isLastBR = false; + while ((len = Streams.readLine(input, buffer, buffer.length)) != -1) + { + String line = new String(buffer, 0, len, request.getCharacterEncoding()); + if (line.startsWith("--"+boundary+"--")) + {//全部内容结束 + break; + } + + if (line.startsWith("--"+boundary)) + {//新内容开始 + type = 0; //重置为未知 + isSkinEmptyLine = false;//重置下一行可以跳过空行 + continue; + } + + if (!isSkinEmptyLine && Validates.isEmptyBlank(line)) + {//跳过内容之前的空行 + isSkinEmptyLine = true; + continue; + } + + if (Strings.startsWithIgnoreCase(line, CONTENT_DISPOSITION)) + {//内容配置开始,前面空行不处理 + String formData = line.substring(CONTENT_DISPOSITION.length()).trim(); + name = parseFormDataName(formData); + if (name == null) + {//无效的配置 + isSkinEmptyLine = false;//重置下一行可以跳过空行 + continue; + } + + String filename = parseFormDataFileName(formData); + if (filename == null) + { + type = 1;//文本类型 + if (!parameters.containsKey(name)) + parameters.put(name, null); + } + else + { + type = 2;//文件类型 + this.name = name; + this.fileName = filename; + } + continue; + } + + if (Strings.startsWithIgnoreCase(line, CONTENT_TYPE)) + {//内容类型开始,文本类型不一般会指定 + curContentType = line.substring(CONTENT_TYPE.length()).trim(); + if (type == 2) + this.fileContentType = curContentType; + + isSkinEmptyLine = false;//重置下一行可以跳过空行 + continue; + } + + if (type == 1) + {//文本参数,仅支持一行,多行表示该参数多个值,空行不处理 + parseFormValue(request, name, line); + isSkinEmptyLine = false;//重置下一行可以跳过空行 + } + else if (type == 2) + {//文件内容 + if (isLastBR) + {//上一个回车换行加上,如果不能到这里,表示上一个回车换行是结尾 + fileContent.write(_CRLF_); + isLastBR = false; + } + + if (!line.endsWith(_BR_)) + fileContent.write(buffer, 0, len); + else + {//文件如果遇到\r\n,要下一个循环判断是否是结尾 + fileContent.write(buffer, 0, len-2); + isLastBR = true; + } + } + else + {//未定位到文件还是文本时不处理,一般是多余的\r\n + + } + } + } + + /** 解析form-data */ + private String parseFormDataName(String formData) + { + String key = "name=\""; + int ind = formData.indexOf(key); + if (ind == -1) + return null; + int ind2 = formData.indexOf("\"", ind+key.length()); + if (ind2 == -1) + return null; + + return formData.substring(ind+key.length(), ind2); + } + + /** 解析form-data */ + private String parseFormDataFileName(String formData) + { + String key = "filename=\""; + int ind = formData.indexOf(key); + if (ind == -1) + return null; + int ind2 = formData.indexOf("\"", ind+key.length()); + if (ind2 == -1) + return null; + + String name = formData.substring(ind+key.length(), ind2); + return name; + } + + private void parseFormValue(HttpRequest request, String name, String line) + { + line = line.replaceAll("\r", ""); + line = line.replaceAll("\n", ""); + + String value = parameters.get(name); + if (value == null) + { + parameters.put(name, line); + request.setParameterOnCNT(name, line); + } + else + { + parameters.put(name, value + "," + line);//参数名相同时,使用逗号隔开 + request.setParameterOnCNT(name, value + "," + line); + } + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocket.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocket.java new file mode 100644 index 0000000..b1fa6ab --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocket.java @@ -0,0 +1,69 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + + +/** + * HttpWebsocket接口定义 + * + * @version v1.0.0 @author zouzhigang 2017-6-9 新建与整理 + */ +public interface HttpWebsocket +{ + /** + * 接收到连接开启 + * + * @param conn 消息连接 + */ + public void onOpen(HttpWebsocketConnection conn); + + /** + * 接收连接主动关闭 + * + * @param conn 消息连接 + */ + public void onClose(HttpWebsocketConnection conn); + + /** + * 接收异常 + * + * @param conn 消息连接 + * @param e 消息异常 + */ + public void onException(HttpWebsocketConnection conn, Throwable e); + + /** + * 接收到文本消息 + * + * @param conn 消息连接 + * @param message 消息字符串 + */ + public void onMessage(HttpWebsocketConnection conn, String message); + + /** + * 接收到字节消息 + * + * @param conn 消息连接 + * @param message 消息字节数组 + */ + public void onMessage(HttpWebsocketConnection conn, byte[] message); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketConnection.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketConnection.java new file mode 100644 index 0000000..6f3ae87 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketConnection.java @@ -0,0 +1,84 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; + + +/** + * Websocket连接 + * + * @version v1.0.0 @author zouzhigang 2018-5-29 新建与整理 + */ +public interface HttpWebsocketConnection extends HttpdConstants +{ + public Log log = LogFactory.getLog(HttpWebsocketConnection.class); + + /***********************************************************************************/ + //打开&关闭 + /***********************************************************************************/ + + /** 启动 */ + public void open(); + + /** 关闭连接通知并删除 */ + public void close(); + + /** 异常连接通知并删除 */ + public void exception(Throwable e); + + /***********************************************************************************/ + //发送数据 + /***********************************************************************************/ + + /** 发送PING消息 */ + public boolean sendPing(); + + /** 发送文本消息 */ + public boolean send(String text); + + /** 发送字节数据 */ + public boolean send(byte[] data); + + /***********************************************************************************/ + //获取属性 + /***********************************************************************************/ + + /** 获取协议 */ + public String getProtocol(); + + /** 获取会话管理器 */ + public HttpSessionManager getSessionManager(); + + /** 获取会话,再通过管理器获取会话对象 */ + public String getSessionId(); + + /** 获取会话信息 */ + public HttpSession getSession(); + + /** 获取Websocket管理器 */ + public HttpWebsocketManager getWebsocketManager(); + + /** 获取WebSocket对象 */ + public HttpWebsocket getWebsocket(); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketConnectionAbs.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketConnectionAbs.java new file mode 100644 index 0000000..133e2a9 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketConnectionAbs.java @@ -0,0 +1,169 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; + +/** + * Websocket连接抽象类 + * + * @version v1.0.0 @author zouzhigang 2018-6-30 新建与整理 + */ +public abstract class HttpWebsocketConnectionAbs implements HttpWebsocketConnection +{ + protected HttpContext context; + protected HttpWebsocketManager manager; + protected String protocol; + protected String sessionId; + protected HttpWebsocket websocket; + protected volatile boolean isRunning; + + public HttpWebsocketConnectionAbs(HttpContext context, String protocol, String sessionId) + { + this.context = context; + this.manager = context.getWebsocketManager(); + this.protocol = protocol; + this.sessionId = sessionId; + + this.websocket = manager.getWebsocket(protocol); + if (this.websocket != null) + {//开启回调 + this.websocket.onOpen(this); + } + } + + /** 子类根据不同的结构提供不同的连接类 */ + public abstract HttpConnection getConnection(); + + /***********************************************************************************/ + //打开&关闭 + /***********************************************************************************/ + + @Override /** 开启,子类实现 */ + public abstract void open(); + + @Override /** 正常关闭 */ + public void close() + { + try + { + if (websocket != null) + websocket.onClose(this); + } + finally + { + websocket = null; + getWebsocketManager().remove(this); + } + } + + @Override /** 异常关闭 */ + public void exception(Throwable e) + { + try + { + if (websocket != null) + websocket.onException(this, e); + } + finally + { + websocket = null; + getWebsocketManager().remove(this); + } + } + + /***********************************************************************************/ + //发送数据 + /***********************************************************************************/ + + public boolean send(String text) + { + HttpConnection conn = getConnection(); + if (conn == null || conn.isClosed()) + return false; + + HttpWebsocketMessage message = new HttpWebsocketMessage().build(text); + return send(message.toBytes()); + } + + public boolean sendPing() + { + HttpConnection conn = getConnection(); + if (conn == null || conn.isClosed()) + return false; + + HttpWebsocketMessage message = new HttpWebsocketMessage().buildPing(); + return send(message.toBytes()); + } + + public boolean send(byte[] data) + { + HttpConnection conn = getConnection(); + if (conn == null || conn.isClosed()) + return false; + + try + { + conn.write(data, 0, data.length); + return true; + } + catch (IOException e) + { + exception(e); + return false; + } + } + + /***********************************************************************************/ + //获取属性 + /***********************************************************************************/ + + public String getProtocol() + { + return protocol; + } + + public HttpSessionManager getSessionManager() + { + return context.getSessionManager(); + } + + public String getSessionId() + { + return sessionId; + } + + public HttpSession getSession() + { + return getSessionManager().getSession(sessionId); + } + + public HttpWebsocket getWebsocket() + { + return websocket; + } + + public HttpWebsocketManager getWebsocketManager() + { + return context.getWebsocketManager(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketManager.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketManager.java new file mode 100644 index 0000000..538eb2b --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketManager.java @@ -0,0 +1,64 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.util.List; + +/** + * Websocket管理器定义 + * + * @version v1.0.0 @author zouzhigang 2018-9-29 新建与整理 + */ +public interface HttpWebsocketManager +{ + /** 获取管理器对应的上下文环境 */ + public HttpContext getContext(); + + /********************************************************************/ + //开启和关闭 + /********************************************************************/ + + /** 开启管理 */ + public void open(); + + /** 关闭管理 */ + public void close(); + + /*********************************************************************/ + //增加&删除&获取 + /*********************************************************************/ + + /** 获取HttpWebsocket实现类 */ + public HttpWebsocket getWebsocket(String protocol); + + /** 获取协议名下所有连接 */ + public List get(String protocol); + + /** 获取协议名下某个用户的所有连接 */ + public List get(String protocol, String sessionId); + + /** 由HttpWebsocketService增加连接关联到会话 */ + public void add(HttpWebsocketConnection conn); + + /** 从连接中收到结束取消关联会话 */ + public void remove(HttpWebsocketConnection conn); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketMessage.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketMessage.java new file mode 100644 index 0000000..3a5f92e --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketMessage.java @@ -0,0 +1,292 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; +import java.io.InputStream; + +import org.zhiqim.kernel.constants.CodeConstants; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Bytes; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.mutables.MInt; + +/** + * HttpWebsocket数据格式: + * 第一字节,第1位:FIN,标识是否为此消息的最后一个数据包 + * 第一字节,第5,6,7,8位,opcode,操作码(0-15): + * 0x00:标识一个中间数据包 + * 0x01:标识一个text类型数据包 + * 0x02:标识一个binary类型数据包 + * 0x08:标识一个断开连接类型数据包 + * 0x09:标识一个ping类型数据包 + * 0x0A:表示一个pong类型数据包 + * 0x03-07:保留 + * 0x0B-0F:保留 + * + * 0–999 保留段, 未使用. + * 1000 CLOSE_NORMAL 正常关闭; 无论为何目的而创建, 该链接都已成功完成任务. + * 1001 CLOSE_GOING_AWAY 终端离开, 可能因为服务端错误, 也可能因为浏览器正从打开连接的页面跳转离开. + * 1002 CLOSE_PROTOCOL_ERROR 由于协议错误而中断连接. + * 1003 CLOSE_UNSUPPORTED 由于接收到不允许的数据类型而断开连接 (如仅接收文本数据的终端接收到了二进制数据). + * 1004 保留. 其意义可能会在未来定义. + * 1005 CLOSE_NO_STATUS 保留. 表示没有收到预期的状态码. + * 1006 CLOSE_ABNORMAL 保留. 用于期望收到状态码时连接非正常关闭 (也就是说, 没有发送关闭帧). + * 1007 Unsupported Data 由于收到了格式不符的数据而断开连接 (如文本消息中包含了非 UTF-8 数据). + * 1008 Policy Violation 由于收到不符合约定的数据而断开连接. 这是一个通用状态码, 用于不适合使用 1003 和 1009 状态码的场景. + * 1009 CLOSE_TOO_LARGE 由于收到过大的数据帧而断开连接. + * 1010 Missing Extension 客户端期望服务器商定一个或多个拓展, 但服务器没有处理, 因此客户端断开连接. + * 1011 Internal Error 客户端由于遇到没有预料的情况阻止其完成请求, 因此服务端断开连接. + * 1012 Service Restart 服务器由于重启而断开连接. [Ref] + * 1013 Try Again Later 服务器由于临时原因断开连接, 如服务器过载因此断开一部分客户端连接. [Ref] + * 1014 由 WebSocket 标准保留以便未来使用. + * 1015 TLS Handshake 保留. 表示连接由于无法完成 TLS 握手而关闭 (例如无法验证服务器证书). + * 1016–1999 由 WebSocket 标准保留以便未来使用. + * 2000–2999 由 WebSocket 拓展保留使用. + * 3000–3999 可以由库或框架使用. 不应由应用使用. 可以在 IANA 注册, 先到先得. + * 4000–4999 可以由应用使用. + * + * @version v1.0.0 @author zouzhigang 2017-6-1 新建与整理 + */ +public class HttpWebsocketMessage implements CodeConstants +{ + protected boolean fin; + protected int opcode; + + protected boolean mask; + protected byte[] masks; + protected int length; + protected byte[] content; + + //内容解析属性:真实内容长度&内容文本 + protected int contentLen; + protected String text; + + public HttpWebsocketMessage parse(InputStream in) throws IOException + { + int first = in.read() & 0xFF; + int second = in.read() & 0xFF; + + //1.FIN + this.fin = (first & 0x80) != 0; + + //2.opcode + this.opcode = first & 0x0F; + + //3.MASK + this.mask = (second & 0x80) != 0; + + //4.length + this.contentLen = this.length = second & 0x7F; + if (this.length == 126) + {//2字节表示长度 + byte[] buf = Streams.getBytes(in, 2); + this.contentLen = Bytes.BU.getShortUnsigned(buf, 0); + } + else if (this.length == 127) + {//8字节表示长度 + byte[] buf = Streams.getBytes(in, 8); + long len = Bytes.BU.getLong(buf, 0); + if (len > Integer.MAX_VALUE) + throw Asserts.exception("超出支持的能力"); + + this.contentLen = (int)len; + } + + //5.masks + if (mask) + {//存在掩码的情况,取4字节 + this.masks = Streams.getBytes(in, 4); + } + + //6.内容 + if (contentLen > 0) + {//有内容 + this.content = Streams.getBytes(in, contentLen); + if (mask) + {//存在掩码的情况,作处理 + for (int i=0;i 0) + {//有内容 + Bytes.putBytes(buf, off, content); + } + + return buf; + } + + /***********************************************************************/ + // 业务方法 + /***********************************************************************/ + + public boolean isText() + { + return opcode == 0x01; + } + + public boolean isBinary() + { + return opcode == 0x02; + } + + public boolean isClose() + { + return opcode == 0x08; + } + + public boolean isPing() + { + return opcode == 0x09; + } + + public boolean isPong() + { + return opcode == 0x0A; + } + + /***********************************************************************/ + // 获取&设置 + /***********************************************************************/ + + public boolean isFin() + { + return fin; + } + + public int getOpcode() + { + return opcode; + } + + public boolean isMask() + { + return mask; + } + + public byte[] getMasks() + { + return masks; + } + + public int getLength() + { + return length; + } + + public String getText() + { + return text; + } + + public int getContentLen() + { + return contentLen; + } + + public byte[] getContent() + { + return (contentLen == 0)?new byte[0]:content; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketMessageAsync.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketMessageAsync.java new file mode 100644 index 0000000..2e999fc --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpWebsocketMessageAsync.java @@ -0,0 +1,233 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.io.IOException; + +import org.zhiqim.kernel.constants.CodeConstants; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Bytes; +import org.zhiqim.kernel.util.Strings; + +/** + * HttpWebsocket数据格式: + * 第一字节,第1位:FIN,标识是否为此消息的最后一个数据包 + * 第一字节,第5,6,7,8位,opcode,操作码(0-15): + * 0x00:标识一个中间数据包 + * 0x01:标识一个text类型数据包 + * 0x02:标识一个binary类型数据包 + * 0x08:标识一个断开连接类型数据包 + * 0x09:标识一个ping类型数据包 + * 0x0A:表示一个pong类型数据包 + * 0x03-07:保留 + * 0x0B-0F:保留 + * + * 一共分5步读取数据 + * 1、读first字节 + * 2、读second字节 + * 3、根据length读2字节或8字节 + * 4、读masks + * 5、读length + * + * @version v1.0.0 @author zouzhigang 2017-6-1 新建与整理 + */ +public class HttpWebsocketMessageAsync extends HttpWebsocketMessage implements CodeConstants +{ + private int step; + private int first; + private int second; + private byte[] buffer; + private int bufferOffset; + private int masksOffset; + private int contentOffset; + + public boolean parse(HttpInputStream in) throws IOException + { + if (step < 1) + {//第一步 + first = in.read(); + if (first == -1) + {//异步未读完,等待下次再读 + return false; + } + + step = 1; + } + + if (step < 2) + {//第二步 + second = in.read(); + if (second == -1) + {//异步未读完,等待下次再读 + return false; + } + + step = 2; + } + + //1.FIN + fin = (first & 0x80) != 0; + + //2.opcode + opcode = first & 0x0F; + + //3.MASK + mask = (second & 0x80) != 0; + + //4.length + contentLen = length = second & 0x7F; + if (length == 126) + { + if (step < 3) + { + if (buffer == null) + {//初始化 + buffer = new byte[2]; + bufferOffset = 0; + } + + byte[] buf = in.read(2 - bufferOffset); + if (buf != null && buf.length > 0) + { + bufferOffset = Bytes.putBytes(buffer, bufferOffset, buf); + } + + if (bufferOffset < 2) + {//异步未读完,等待下次再读 + return false; + } + + contentLen = Bytes.BU.getShortUnsigned(buffer, 0); + step = 3; + } + } + else if (length == 127) + { + if (step < 3) + { + if (buffer == null) + {//初始化 + buffer = new byte[8]; + bufferOffset = 0; + } + + byte[] buf = in.read(8 - bufferOffset); + if (buf != null && buf.length > 0) + { + bufferOffset = Bytes.putBytes(buffer, bufferOffset, buf); + } + + if (bufferOffset < 8) + {//异步未读完,等待下次再读 + return false; + } + + long len = Bytes.BU.getLong(buf, 0); + if (len > Integer.MAX_VALUE) + throw Asserts.exception("超出支持的能力"); + + contentLen = (int)len; + step = 3; + } + } + + //5.masks + if (step < 4) + { + if (mask) + { + if (masks == null) + {//初始化 + masks = new byte[4]; + masksOffset = 0; + } + + byte[] buf = in.read(4 - masksOffset); + if (buf != null && buf.length > 0) + { + masksOffset = Bytes.putBytes(masks, masksOffset, buf); + } + + if (masksOffset < 4) + {//异步未读完,等待下次再读 + return false; + } + } + + step = 4; + } + + //6.内容 + if (step < 5) + { + if (contentLen > 0) + {//有内容 + if (content == null) + {//初始化 + content = new byte[contentLen]; + contentOffset = 0; + } + + byte[] buf = in.read(contentLen - contentOffset); + if (buf != null && buf.length > 0) + { + contentOffset = Bytes.putBytes(content, contentOffset, buf); + } + + if (contentOffset < contentLen) + {//异步未读完,等待下次再读 + return false; + } + + if (mask) + { + for (int i=0;i. + */ +package org.zhiqim.httpd; + +import java.io.IOException; + +import org.zhiqim.kernel.util.codes.Base64; +import org.zhiqim.kernel.util.codes.SHA1; + +/** + * HttpWebsocket服务 + * + * @version v1.0.0 @author zouzhigang 2017-6-9 新建与整理 + */ +public class HttpWebsocketService implements HttpExecutor +{ + @Override + public boolean isMatch(String pathInContext) + { + return _PATH_SERVICE_WS_.equals(pathInContext); + } + + @Override + public void handle(HttpRequest request, HttpResponse response) throws IOException + { + if (!request.isWebSocket()) + {//非WS服务不支持 + response.sendError(_403_FORBIDDEN_); + return; + } + + HttpSession session = request.getSession(); + if (session == null) + {//必须会话支持 + response.sendError(_403_FORBIDDEN_); + return; + } + + //1.响应成功 + response.setStatus(_101_SWITCHING_PROTOCOLS_); + response.setHeader(_CONNECTION_, _UPGRADE_); + response.setHeader(_UPGRADE_, _WEBSOCKET_); + + //2.响应Sec-WebSocket-Accept&Sec-WebSocket-Protocol + String key = request.getHeader(_SEC_WEBSOCKET_KEY_); + String accept = Base64.encode(SHA1.encodeByte(key + _WEBSOCKET_SALT_, _UTF_8_C_)); + response.setHeader(_SEC_WEBSOCKET_ACCEPT_, accept); + + String protocol = request.getHeader(_SEC_WEBSOCKET_PROTOCOL_, null); + if (protocol != null) + {//响应协议 + response.setHeader(_SEC_WEBSOCKET_PROTOCOL_, protocol); + } + + //3.升级连接为WS连接 + HttpConnection conn = ((HttpRequestAbs)request).getConnection(); + conn.doWebsocket(request.getContext(), protocol, session.getId()); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/HttpdConstants.java b/zhiqim_httpd/src/org/zhiqim/httpd/HttpdConstants.java new file mode 100644 index 0000000..92726b3 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/HttpdConstants.java @@ -0,0 +1,175 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd; + +import java.nio.ByteBuffer; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.constants.HttpConstants; + +/** + * HTTPD常量定义 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("HttpdConstants") +public interface HttpdConstants extends HttpConstants +{ + //浏览器相关参数 + public static final String _ZHTTPD_ = "zhiqim_httpd_v1.5.0"; + public static final String _TOKEN_ = "_token_"; + public static final String _MSIE_ = "msie"; + public static final String _MSTRIDENT_ = "trident"; + public static final String _FIREFOX_ = "firefox"; + public static final String _WEBKIT_ = "webkit"; + public static final String _CHROME_ = "chrome"; + public static final String _SAFARI_ = "safari"; + public static final String _MOBILE_ = "mobile"; + public static final String _WWW_ = "www"; + public static final String _MICROMESSAGER_ = "micromessenger"; + + //默认的HTTP环境和会话管理器 + public static final String _HTTP_CONTEXT_CLASS_ = "org.zhiqim.httpd.context.ZmlContext"; + public static final String _HTTP_SESSION_MANAGER_DEFAULT_ = "org.zhiqim.httpd.sessioner.HashSessionManager"; + public static final String _HTTP_SESSION_USER_ = "org.zhiqim.httpd.HttpSessionUser"; + public static final String _HTTP_SESSION_IP_ = "org.zhiqim.httpd.HttpSession.sessionIp"; + public static final String _HTTP_SESSION_UA_ = "org.zhiqim.httpd.HttpSession.userAgent"; + public static final String _HTTP_REQUEST_PARAM_MATCH_ = "org.zhiqim.httpd.HttpRequest.paramMatch"; + + //常用的SSL协议|算法和类型 + public static final String SSL_PROTOCOL = "TLS"; //协议 + public static final String SSL_ALGORITHM = "SunX509";//算法 + public static final String SSL_KEYSTORE_TYPE = "JKS"; //类型 + + //常用的三个文件放到包里 + public static final String _PATH_FAVICON_ICO_ = "/org/zhiqim/httpd/resources/favicon.ico"; + public static final String _PATH_CROSSDOMAIN_XML_ = "/org/zhiqim/httpd/resources/crossdomain.xml"; + public static final String _PATH_MIME_PROPERTIES_ = "/org/zhiqim/httpd/resources/mime.properties"; + + //默认提供的处理器 + public static final String _PATH_FAVICON_ = "/favicon.ico"; + public static final String _PATH_CROSSDOMAIN_ = "/crossdomain.xml"; + public static final String _PATH_SERVICE_WS_ = "/service/ws"; + + //上下文环境的常量 + public static final String _CONTEXT_ = "context"; + public static final String _SESSION_ = "session"; + public static final String _SESSION_ID_ = "sessionId"; + public static final String _SESSION_USER_ = "sessionUser"; + public static final String _SESSION_NAME_ = "sessionName"; + public static final String _REQUEST_ = "request"; + public static final String _RESPONSE_ = "response"; + public static final String _LOG_ = "log"; + public static final String _AIO_ = "AIO"; + public static final String _BIO_ = "BIO"; + public static final String _NIO_ = "NIO"; + public static final ByteBuffer _HELLO_N_ = ByteBuffer.wrap(_ZHTTPD_.getBytes()); + + //上下文环境的常量(知启蒙特有的定义) + public static final String _ZHIQIM_CLIENT_TYPE_ = "zhiqimClientType"; + + //重定向支持的三个常量定义 + public static final String _REDIRECT_HISTORY_ = "-1"; //后退,调用window.history.back(); + public static final String _REDIRECT_CLOSE_WINDOW_ = "closeWindow";//关闭窗口,调用window.close(); + public static final String _REDIRECT_CLOSE_DIALOG_ = "closeDialog";//关闭对话框,调用parent.Z.Dialog.close(); + + //表单参数中两个重要标志 + public static final String _PARAM_CALL_FRAME_ = "zCallFrame"; + public static final String _PARAM_FORM_INDEX_ = "zFormIndex"; + public static final String _PARAM_DIALOG_FRAME_ = "zDialogFrame"; + + //HTTP协议长度定义 + public static final int _MAX_LINE_LEN_ = 8 * KiB; + public static final int _MAX_HEADER_LINE_ = 128; + public static final int _MAX_CONTENT_LEN_ = 8 * MiB; + public static final int _MAX_CHUNKED_SIZE_ = MiB; + public static final int _MAX_EXPIRES_ = 3600; + + //标记连接处理进度 + public static final int _01_CREATE_ = 1; //连接被listner创建 + public static final int _02_PARSE_HEADER_ = 2; //解析请求头 + public static final int _03_CHECK_HEADER_ = 3; //检查请求头 + public static final int _04_QUERY_CONTEXT_ = 4; //查找Context + public static final int _05_QUERY_HANDLER_ = 5; //查找Handler + public static final int _06_PARSE_CONTENT_ = 6; //解析请求内容 + public static final int _07_HANDLER_BEGIN_ = 7; //请求被Handler处理开始 + public static final int _08_INTERCEPTOR_ = 8; //请求被Interceptor处理 + public static final int _09_ACTION_ = 9; //请求被Action处理 + public static final int _10_HANDLER_END_ = 10;//请求被Handler处理结束 + public static final int _11_COMMITTED_ = 11;//提交响应完成 + public static final int _12_FINISHED_ = 12;//结束请求处理 + + public static final String _01_STEP_DESC_ = "[创建]"; + public static final String _02_STEP_DESC_ = "[解析请求头]"; + public static final String _03_STEP_DESC_ = "[检查请求头]"; + public static final String _04_STEP_DESC_ = "[查找上下文环境]"; + public static final String _05_STEP_DESC_ = "[查找处理器]"; + public static final String _06_STEP_DESC_ = "[解析请求内容]"; + public static final String _07_STEP_DESC_ = "[处理开始]"; + public static final String _08_STEP_DESC_ = "[拦截器处理中]"; + public static final String _09_STEP_DESC_ = "[业务处理中]"; + public static final String _10_STEP_DESC_ = "[处理完成]"; + public static final String _11_STEP_DESC_ = "[正在提交]"; + public static final String _12_STEP_DESC_ = "[提交完成]"; + + //HTTP服务配置 + public static final String _SERVER_CONTEXT_ = "context"; + + //HTTP监听配置 + public static final String _LISTEN_SCHEME_ = "scheme"; + public static final String _LISTEN_PORT_ = "port"; + public static final String _LISTEN_IO_ = "io"; + public static final String _LISTEN_IP_ADDRESS_ = "ipAddress"; + public static final String _LISTEN_SO_ITMEOUT_ = "soTimeout"; + public static final String _LISTEN_SO_LINGER_ = "soLinger"; + public static final String _LISTEN_SO_RECV_BUF_ = "soRecvBuf"; + public static final String _LISTEN_SO_SEND_BUF_ = "soSendBuf"; + public static final String _LISTEN_SO_IDLE_TIME_ = "soIdleTime"; + public static final String _LISTEN_PO_MIN_SIZE_ = "poMinSize"; + public static final String _LISTEN_PO_MAX_SIZE_ = "poMaxSize"; + public static final String _LISTEN_PO_IDLE_TIME_ = "poIdleTime"; + public static final String _LISTEN_PO_QUEUE_SIZE_ = "poQueueSize"; + public static final String _LISTEN_ACCESS_LOG_ = "accessLog"; + + //HTTPS证书相关 + public static final String _KEY_STORE_PATH_ = "keystorePath"; + public static final String _KEY_STORE_PASS_ = "keystorePass"; + public static final String _TRUST_STORE_PATH_ = "truststorePath"; + public static final String _TRUST_STORE_PASS_ = "truststorePass"; + public static final String _CLIENT_AUTH_ = "clientAuth"; + + //HTTP Context配置 + public static final String _CONTEXT_DOMAIN_ = "domain"; + public static final String _CONTEXT_PATH_ = "path"; + public static final String _CONTEXT_CLASS_ = "class"; + public static final String _CONTEXT_RESOURCE_TYPE_ = "resourceType"; + public static final String _CONTEXT_RESOURCE_PATH_ = "resourcePath"; + public static final String _CONTEXT_WELCOME_URL_ = "welcomeUrl"; + public static final String _CONTEXT_NOT_FOUND_URL_ = "notFoundUrl"; + public static final String _CONTEXT_MAX_CONTENT_LEN_ = "maxContentLength"; + public static final String _CONTEXT_CHUNK_SIZE_ = "chunkSize"; + public static final String _CONTEXT_EXPIRES_ = "expires"; + public static final String _CONTEXT_FILTER_ = "filter"; + public static final String _CONTEXT_ENCODING_ = "encoding"; + public static final String _CONTEXT_ORM_ = "orm"; + +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioConnection.java b/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioConnection.java new file mode 100644 index 0000000..8ffea7d --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioConnection.java @@ -0,0 +1,182 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.bio; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetAddress; +import java.net.Socket; +import java.security.cert.X509Certificate; + +import org.zhiqim.httpd.HttpConnection; +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpListener; +import org.zhiqim.httpd.HttpdConstants; +import org.zhiqim.kernel.util.Threads; + +/** + * HTTP连接信息类(连接即请求),包括输入输出流,实现Runnable,用于线程处理 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public final class HttpBioConnection implements HttpConnection, Runnable, HttpdConstants +{ + private String connId; + + private HttpListener listener; + private Socket socket; + private InetAddress remoteAddress; + private InputStream input; + private OutputStream output; + + //依次找到1.HttpHeader,2.HttpServer,3.HttpContext + private HttpBioHeader header; + + //websocket + private HttpBioWebsocketConnection websocket; + + public HttpBioConnection(HttpListener listener, Socket socket, InputStream input, OutputStream output) + {//HTTP + this.connId = sequence.nextString(); + + this.listener = listener; + this.socket = socket; + this.remoteAddress = socket.getInetAddress(); + this.input = input; + this.output = output; + + this.header = new HttpBioHeader(this); + } + + public HttpBioConnection(HttpListener listener, Socket socket, InputStream input, OutputStream output, X509Certificate[] certs) + {//HTTPS + this(listener, socket, input, output); + //用于业务再次认证 + this.header.setCertificates(certs); + } + + /***********************************************************************/ + //获取连接对应的websocket属性 + /***********************************************************************/ + + /** 是否是websocket连接 */ + public boolean isWebsocket() + { + return websocket != null; + } + + /** 关联Websocket */ + public void doWebsocket(HttpContext context, String protocol, String sessionId) + { + this.websocket = new HttpBioWebsocketConnection(this, context, protocol, sessionId); + this.websocket.open(); + } + + /** 是否活动 */ + public boolean isActive() + { + return true; + } + + /** 是否超时 */ + public boolean isOvertime() + { + return false; + } + + /** 是否已关闭 */ + public boolean isClosed() + { + return socket.isClosed(); + } + + /********************************************************************************/ + //处理请求 + /********************************************************************************/ + + public void run() + { + try + { + header.execute(); + } + catch (Exception e) + { + close(); + } + } + + /** 写入数据 */ + public void write(byte[] data) throws IOException + { + write(data, 0, data.length); + } + + /** 写入数据 */ + public void write(byte[] data, int off, int len) throws IOException + { + output.write(data, off, len); + } + + /** 关闭连接 */ + public void close() + {//由sender回调 + listener.remove(this); + + Threads.closeIgnoreException(input); + Threads.closeIgnoreException(output); + Threads.closeIgnoreException(socket); + } + + + /***********************************************************************/ + //获取连接属性上的参数 + /***********************************************************************/ + + @Override + public String getId() + { + return connId; + } + + @Override + public HttpListener getListener() + { + return listener; + } + + @Override + public String getRemoteAddr() + { + return remoteAddress.getHostAddress(); + } + + /***************************************************************************/ + //请求属性 + /***************************************************************************/ + + public InputStream getInputStream() + { + return input; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioHeader.java b/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioHeader.java new file mode 100644 index 0000000..76c43b5 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioHeader.java @@ -0,0 +1,57 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.bio; + +import org.zhiqim.httpd.HttpHeaderAbs; +import org.zhiqim.httpd.HttpInputStream; +import org.zhiqim.httpd.HttpRequestAbs; +import org.zhiqim.httpd.HttpSenderImpl; + +/** + * BIO请求头 + * + * @version v1.0.0 @author zouzhigang 2014-2-27 新建与整理 + * @version v1.5.0 @author zouzhigang 2018-9-12 和NIO请求头抽象到HttpHeaderAbs中 + */ +public class HttpBioHeader extends HttpHeaderAbs +{ + /** 构造函数 */ + public HttpBioHeader (HttpBioConnection conn) + { + super(conn, new HttpInputStream(conn.getInputStream()), null); + } + + public HttpSenderImpl newSender() + { + return new HttpSenderImpl(this, true); + } + + public HttpRequestAbs newRequest() + { + return new HttpBioRequest(this); + } + + public boolean isBio() + { + return true; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioListener.java b/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioListener.java new file mode 100644 index 0000000..151344c --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioListener.java @@ -0,0 +1,114 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.bio; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketException; + +import org.zhiqim.httpd.HttpListener; +import org.zhiqim.httpd.HttpServer; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Sockets; +import org.zhiqim.kernel.util.Threads; +import org.zhiqim.kernel.util.Validates; + +/** + * HTTP阻塞式监听器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpBioListener extends HttpListener +{ + private ServerSocket serverSocket; + + public HttpBioListener(HttpServer server) + { + super(server); + } + + @Override /** 线程开启前 */ + protected boolean openBefore() + { + //监听参数和线程池 + super.openBefore(); + + try + {//监听端口和守护线程 + if (Validates.isEmpty(listenerIp)) + serverSocket = new ServerSocket(listenerPort); + else + serverSocket = new ServerSocket(listenerPort, 50, InetAddress.getByName(listenerIp)); + serverSocket.setReuseAddress(true); + return true; + } + catch (Exception e) + { + throw Asserts.exception(e); + } + } + + @Override /** 线程关闭后 */ + protected void closeAfter() + { + if (serverSocket != null) + {//关闭监听 + Threads.closeIgnoreException(serverSocket); + serverSocket = null; + } + + //关闭父类的控制器/定时任务/连接列表 + super.closeAfter(); + } + + @Override /** 线程持续运行 */ + protected void loop() + { + try + { + Socket socket = serverSocket.accept(); + Sockets.setOption(socket, true, soTimeoutMs, soLingerS, false); + + //连接交给控制器多线程处理 + controller.execute(add(newConnection(socket))); + } + catch (SocketException e) + { + if (!_SOCKET_CLOSED_.equalsIgnoreCase(e.getMessage())) + {//非服务端自己关闭连接导致的异常打印 + log.error(toString() + "SocketException异常", e); + } + } + catch (IOException e) + { + log.error(toString() + "IO异常", e); + } + } + + /** 新建连接 */ + private HttpBioConnection newConnection(Socket socket) throws IOException + { + return new HttpBioConnection(this, socket, socket.getInputStream(), socket.getOutputStream()); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioRequest.java b/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioRequest.java new file mode 100644 index 0000000..8ca1117 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioRequest.java @@ -0,0 +1,79 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.bio; + +import java.io.ByteArrayInputStream; +import java.io.IOException; + +import org.zhiqim.httpd.HttpRequestAbs; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Zips; + +/** + * HTTP请求类 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpBioRequest extends HttpRequestAbs +{ + /** 构造函数 */ + public HttpBioRequest (HttpBioHeader header) + { + super(header); + } + + /***********************************************************************/ + //解析请求头、内容、会话和证书等 + /***********************************************************************/ + + /** + * 分析请求内容 + * + * @exception IOException IO异常 + */ + public boolean parseContent() throws IOException + { + //第十二步,解析内容流 + int cLen = getContentLength(); + if (cLen <= 0) + {//无内容 + bis = new ByteArrayInputStream(new byte[0]); + return true; + } + + //有内容 + byte[] contentBytes = Streams.getBytes(input, cLen); + bis = new ByteArrayInputStream(contentBytes, 0, cLen); + + if (isRequestGZip()) + bis = Zips.unGZip(bis); + + if (_POST_.equals(header.getMethod()) && _APPLICATION_X_WWW_FORM_.equals(header.getMimeType())) + {//form表单提交方式要解析到内容参数表中 + String line = new String(contentBytes, header.getCharacterEncoding()); + Urls.toMap(line, cntParamMap.instance(), header.getCharacterEncoding()); + } + + return true; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioSslListener.java b/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioSslListener.java new file mode 100644 index 0000000..3d46937 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioSslListener.java @@ -0,0 +1,178 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.bio; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.Socket; +import java.net.SocketException; +import java.security.cert.X509Certificate; + +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocket; + +import org.zhiqim.httpd.HttpCertificate; +import org.zhiqim.httpd.HttpListener; +import org.zhiqim.httpd.HttpServer; +import org.zhiqim.httpd.HttpSslConfig; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Hexs; +import org.zhiqim.kernel.util.Sockets; +import org.zhiqim.kernel.util.Threads; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.SSL; + +/** + * HTTPS阻塞式监听器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpBioSslListener extends HttpListener +{ + private static final String SSL_SESSION_CACHE = HttpCertificate.class.getName(); + private static final String SSL_NULL_WITH_NULL_NULL = "SSL_NULL_WITH_NULL_NULL"; + + private final HttpSslConfig ssl; + private SSLServerSocket serverSocket; + + /** 构造函数 */ + public HttpBioSslListener(HttpServer server) + { + super(server); + this.ssl = new HttpSslConfig(); + } + + @Override /** 协议 */ + public String getScheme() + { + return _HTTPS_; + } + + @Override /** 线程启动前 */ + protected boolean openBefore() + { + try + { + //优先SSL参数(五项,其中Keystore两项必须) + this.ssl.initParam(listenerGroup); + + //监听参数和线程池 + super.openBefore(); + + //监听端口和守护线程 + SSLServerSocketFactory factory = ssl.createFactory(); + if (Validates.isEmpty(listenerIp)) + serverSocket = (SSLServerSocket)factory.createServerSocket(listenerPort); + else + serverSocket = (SSLServerSocket)factory.createServerSocket(listenerPort, 50, InetAddress.getByName(listenerIp)); + serverSocket.setReuseAddress(true); + serverSocket.setNeedClientAuth(ssl.isClientAuth()); + serverSocket.setWantClientAuth(ssl.isClientAuth()); + return true; + } + catch(Exception e) + { + throw Asserts.exception(e); + } + } + + @Override /** 线程关闭之后 */ + protected void closeAfter() + { + //1.关闭监听 + if (serverSocket != null) + { + Threads.closeIgnoreException(serverSocket); + serverSocket = null; + } + + //2.关闭定时任务等父类定义 + super.closeAfter(); + + //3.打印退出日志 + log.info(toString() + "退出"); + } + + @Override /** 线程持续运行 */ + protected void loop() + { + try + { + Socket socket = serverSocket.accept(); + Sockets.setOption(socket, true, soTimeoutMs, soLingerS, false); + + SSLSocket sslSocket = (SSLSocket)socket; + SSLSession sslSession = sslSocket.getSession(); + String cipherSuite = sslSession.getCipherSuite(); + if (cipherSuite == null || SSL_NULL_WITH_NULL_NULL.equals(cipherSuite)) + {//HTTP访问,未使用SSL + socket.close(); + return; + } + + String sslSessionId = null; + X509Certificate[] x509Certs = null; + HttpCertificate sslSessionCache = (HttpCertificate)sslSession.getValue(SSL_SESSION_CACHE); + if (sslSessionCache != null) + { + x509Certs = sslSessionCache.getCerts(); + sslSessionId = sslSessionCache.getSessionId(); + } + else + { + x509Certs = SSL.getCertChain(sslSession); + byte[] bytes = sslSession.getId(); + sslSessionId = Hexs.toHexString(bytes); + sslSessionCache = new HttpCertificate(sslSessionId, x509Certs); + sslSession.putValue(SSL_SESSION_CACHE, sslSessionCache); + } + + if (x509Certs == null && ssl.isClientAuth()) + { + socket.close(); + return; + } + + //连接交给控制器多线程处理 + controller.execute(add(newConnection(socket, x509Certs))); + } + catch (SocketException e) + { + if (!_SOCKET_CLOSED_.equalsIgnoreCase(e.getMessage())) + {//非服务端自己关闭连接导致的异常打印 + log.error(toString() + "SocketException异常", e); + } + } + catch (IOException e) + { + log.error(toString() + "IO异常", e); + } + } + + /** 新建连接 */ + private HttpBioConnection newConnection(Socket socket, X509Certificate[] x509Certs) throws IOException + {//把输入输出流的引用先拿出来 + return new HttpBioConnection(this, socket, socket.getInputStream(), socket.getOutputStream(), x509Certs); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioWebsocketConnection.java b/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioWebsocketConnection.java new file mode 100644 index 0000000..ee39318 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/bio/HttpBioWebsocketConnection.java @@ -0,0 +1,172 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.bio; + +import java.net.SocketTimeoutException; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpWebsocketConnectionAbs; +import org.zhiqim.httpd.HttpWebsocketMessage; +import org.zhiqim.kernel.util.Threads; +import org.zhiqim.kernel.util.seqs.Sequence; + +/** + * HttpWebsocket连接线程 + * + * @version v1.0.0 @author zouzhigang 2017-6-9 新建与整理 + */ +public class HttpBioWebsocketConnection extends HttpWebsocketConnectionAbs implements Runnable +{ + private static final Sequence sequence = new Sequence(); + + private HttpBioConnection conn; + private Thread thread; + + public HttpBioWebsocketConnection(HttpBioConnection conn, HttpContext context, String protocol, String sessionId) + { + super(context, protocol, sessionId); + + this.conn = conn; + } + + public HttpBioConnection getConnection() + { + return conn; + } + + /***********************************************************************************/ + //打开&关闭 + /***********************************************************************************/ + + public synchronized void open() + { + thread = Threads.newThread(this, "Http.Websocket", sequence); + thread.start(); + + while (!isRunning) + {//阻塞等待线程运行成功 + Threads.sleepIgnoreException(3); + } + } + + public synchronized void close() + { + if (!isRunning) + return; + + //1.置关闭标志 + isRunning = false; + + //2.关闭监听线程 + if (thread != null) + { + if (!thread.isInterrupted()) + thread.interrupt(); + + thread = null; + } + + //3.关闭通讯 + super.close(); + } + + public synchronized void exception(Throwable e) + { + if (!isRunning) + return; + + //1.置关闭标志 + isRunning = false; + + //2.关闭监听线程 + if (thread != null) + { + if (!thread.isInterrupted()) + thread.interrupt(); + + thread = null; + } + + //3.关闭连接 + if (conn != null) + { + conn.close(); + conn = null; + } + + //4.关闭通讯 + super.exception(e); + } + + /***********************************************************************************/ + //线程监听接受数据 + /***********************************************************************************/ + + @Override + public void run() + { + isRunning = true; + while (isRunning) + { + try + { + HttpWebsocketMessage data = new HttpWebsocketMessage().parse(conn.getInputStream()); + if (data.isPong()) + {//心跳响应 + continue; + } + + if (data.isPing()) + {//心跳请求 + HttpWebsocketMessage message = new HttpWebsocketMessage().buildPong(); + send(message.toBytes()); + continue; + } + + if (data.isClose()) + {//接收到退出 + close(); + return; + } + + if (data.isText()) + {//接收到消息 + context.getSessionManager().updateLastAccessed(sessionId); + if (websocket != null){ + websocket.onMessage(this, data.getText()); + } + continue; + } + + //TODO 其他的后续再处理 + } + catch (SocketTimeoutException e) + {//超时继续监听 + continue; + } + catch (Throwable e) + { + exception(e); + } + } + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/constants/HttpMimeType.java b/zhiqim_httpd/src/org/zhiqim/httpd/constants/HttpMimeType.java new file mode 100644 index 0000000..88dba14 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/constants/HttpMimeType.java @@ -0,0 +1,63 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.constants; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +import org.zhiqim.httpd.HttpdConstants; + +import org.zhiqim.kernel.util.Resources; +import org.zhiqim.kernel.util.Validates; + +/** + * HTTP协议中MIME类型定义 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpMimeType implements HttpdConstants +{ + private static Properties p = null; + + static + { + if (p == null) + { + p = new Properties(); + InputStream in = Resources.getResourceStream(HttpMimeType.class, _PATH_MIME_PROPERTIES_); + try{p.load(in);}catch (IOException e){} + } + } + + public static String getResourceMimeType(String fileExt) + { + if (Validates.isEmptyBlank(fileExt)) + return _APPLICATION_OCTET_STREAM_; + + String mimeType = (String)p.get(fileExt); + if (mimeType == null) + return _APPLICATION_OCTET_STREAM_; + + return mimeType; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/constants/HttpStatus.java b/zhiqim_httpd/src/org/zhiqim/httpd/constants/HttpStatus.java new file mode 100644 index 0000000..6accf0b --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/constants/HttpStatus.java @@ -0,0 +1,118 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.constants; + +import java.util.HashMap; + +import org.zhiqim.httpd.HttpdConstants; + + +/** + * HTTP状态码常量定义 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpStatus implements HttpdConstants +{ + private static final HashMap _statusMsg = new HashMap(); + + static + { + _statusMsg.put(_0_SUCCESS_, _0_DESC_); + _statusMsg.put(_100_CONTINUE_, _100_DESC_); + _statusMsg.put(_101_SWITCHING_PROTOCOLS_, _101_DESC_); + _statusMsg.put(_102_PROCESSING_, _102_DESC_); + + _statusMsg.put(_200_OK_, _200_DESC_); + _statusMsg.put(_201_CREATED_, _201_DESC_); + _statusMsg.put(_202_ACCEPTED_, _202_DESC_); + _statusMsg.put(_203_NON_AUTHORITATIVE_INFORMATION_, _203_DESC_); + _statusMsg.put(_204_NO_CONTENT_, _204_DESC_); + _statusMsg.put(_205_RESET_CONTENT_, _205_DESC_); + _statusMsg.put(_206_PARTIAL_CONTENT_, _206_DESC_); + _statusMsg.put(_207_MULTI_STATUS_, _207_DESC_); + + _statusMsg.put(_300_MULTIPLE_CHOICES_, _300_DESC_); + _statusMsg.put(_301_MOVED_PERMANENTLY_, _301_DESC_); + _statusMsg.put(_302_FOUND_, _302_DESC_); + _statusMsg.put(_303_SEE_OTHER_, _303_DESC_); + _statusMsg.put(_304_NOT_MODIFIED_, _304_DESC_); + _statusMsg.put(_305_USE_PROXY_, _305_DESC_); + _statusMsg.put(_306_SWITCH_PROXY_, _306_DESC_); + _statusMsg.put(_307_TEMPORARY_REDIRECT_, _307_DESC_); + + _statusMsg.put(_400_BAD_REQUEST_, _400_DESC_); + _statusMsg.put(_401_UNAUTHORIZED_, _401_DESC_); + _statusMsg.put(_402_PAYMENT_REQUIRED_, _402_DESC_); + _statusMsg.put(_403_FORBIDDEN_, _403_DESC_); + _statusMsg.put(_404_NOT_FOUND_, _404_DESC_); + _statusMsg.put(_405_METHOD_NOT_ALLOWD_, _405_DESC_); + _statusMsg.put(_406_NOT_ACCEPTABLE_, _406_DESC_); + _statusMsg.put(_407_PROXY_AUTHENTICATION_REQUIRED_, _407_DESC_); + _statusMsg.put(_408_REQUEST_TIMEOUT_, _408_DESC_); + _statusMsg.put(_409_CONFLICT_, _409_DESC_); + _statusMsg.put(_410_GONE_, _410_DESC_); + _statusMsg.put(_411_LENGTH_REQUIRED_, _411_DESC_); + _statusMsg.put(_412_PRECONDITION_FAILED_, _412_DESC_); + _statusMsg.put(_413_REQUEST_ENTITY_TOO_LARGE_, _413_DESC_); + _statusMsg.put(_414_REQUEST_URL_TOO_LARGE_, _414_DESC_); + _statusMsg.put(_415_UNSUPPORTED_MEDIA_TYPE_, _415_DESC_); + _statusMsg.put(_416_REQUESTED_RANGE_NOT_SATISFIABLE_, _416_DESC_); + _statusMsg.put(_417_EXPECTATION_FAILED_, _417_DESC_); + _statusMsg.put(_421_TOO_MANY_CONNECTIONS_FROM_IP_, _421_DESC_); + _statusMsg.put(_422_UNPROCESSABLE_ENTITY_, _422_DESC_); + _statusMsg.put(_423_LOCKED_, _423_DESC_); + _statusMsg.put(_424_FAILED_DEPENDENCY_, _424_DESC_); + _statusMsg.put(_425_UNORDERED_COLLECTION_, _425_DESC_); + _statusMsg.put(_426_UPGRADE_REQUIRED_, _426_DESC_); + _statusMsg.put(_444_INTERRUPT_, _444_DESC_); + _statusMsg.put(_449_RETRY_WITH_, _449_DESC_); + + _statusMsg.put(_500_INTERNAL_SERVER_ERROR_, _500_DESC_); + _statusMsg.put(_501_NOT_IMPLEMENTED_, _501_DESC_); + _statusMsg.put(_502_BAD_GATEWAY_, _502_DESC_); + _statusMsg.put(_503_SERVER_UNAVAILABLE_, _503_DESC_); + _statusMsg.put(_504_GATEWAY_TIMEOUT_, _504_DESC_); + _statusMsg.put(_505_VERSION_NOT_SUPPORTED_, _505_DESC_); + _statusMsg.put(_506_VARIANT_ALSO_NEGOTIATES_, _506_DESC_); + _statusMsg.put(_507_INSUFFICIENT_STORAGE_, _507_DESC_); + _statusMsg.put(_508_LOOP_DETECTED_, _508_DESC_); + _statusMsg.put(_509_BANDWIDTH_LIMIT_EXCEEDED_, _509_DESC_); + _statusMsg.put(_510_NOT_EXTENDED_, _510_DESC_); + _statusMsg.put(_600_UNPARSEABLE_RESPONSE_HEADERS_, _600_DESC_); + + _statusMsg.put(_601_REDIRECT_PARENT_, _601_DESC_); + _statusMsg.put(_602_REDIRECT_, _602_DESC_); + _statusMsg.put(_603_REDIRECT_TOP_, _603_DESC_); + _statusMsg.put(_611_IP_NOT_ALLOW_, _611_DESC_); + _statusMsg.put(_612_SIGNATURE_FAILED_, _612_DESC_); + _statusMsg.put(_621_INTERCEPTOR_NOT_EXIST_, _621_DESC_); + _statusMsg.put(_622_INTERCEPTED_, _622_DESC_); + _statusMsg.put(_623_INTERCEPTOR_EXCEPTION_, _623_DESC_); + } + + public static final String getStatusMsg(int code) + { + String desc = _statusMsg.get(code); + return desc==null?""+code:desc; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/constants/HttpStep.java b/zhiqim_httpd/src/org/zhiqim/httpd/constants/HttpStep.java new file mode 100644 index 0000000..83176bd --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/constants/HttpStep.java @@ -0,0 +1,58 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.constants; + +import java.util.HashMap; + +import org.zhiqim.httpd.HttpdConstants; + +/** + * HTTP处理步骤 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpStep implements HttpdConstants +{ + private static final HashMap _statusMsg = new HashMap(); + + static + { + _statusMsg.put(_01_CREATE_, _01_STEP_DESC_); + _statusMsg.put(_02_PARSE_HEADER_, _02_STEP_DESC_); + _statusMsg.put(_03_CHECK_HEADER_, _03_STEP_DESC_); + _statusMsg.put(_04_QUERY_CONTEXT_, _04_STEP_DESC_); + _statusMsg.put(_05_QUERY_HANDLER_, _05_STEP_DESC_); + _statusMsg.put(_06_PARSE_CONTENT_, _06_STEP_DESC_); + _statusMsg.put(_07_HANDLER_BEGIN_, _07_STEP_DESC_); + _statusMsg.put(_08_INTERCEPTOR_, _08_STEP_DESC_); + _statusMsg.put(_09_ACTION_, _09_STEP_DESC_); + _statusMsg.put(_10_HANDLER_END_, _10_STEP_DESC_); + _statusMsg.put(_11_COMMITTED_, _11_STEP_DESC_); + _statusMsg.put(_12_FINISHED_, _12_STEP_DESC_); + } + + public static final String getStatusMsg(int code) + { + String desc = _statusMsg.get(code); + return desc==null?""+code:desc; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/ServiceExecutor.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/ServiceExecutor.java new file mode 100644 index 0000000..fc461e7 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/ServiceExecutor.java @@ -0,0 +1,116 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; + +import org.zhiqim.httpd.HttpExecutor; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.HttpWebsocketService; +import org.zhiqim.httpd.context.service.AjaxService; +import org.zhiqim.httpd.context.service.ResourceService; +import org.zhiqim.httpd.context.service.RmiService; +import org.zhiqim.httpd.context.service.UploadAccessService; +import org.zhiqim.httpd.context.service.UploadService; +import org.zhiqim.httpd.context.service.VcodeService; + +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Validates; + +/** + * 服务处理器,对应 /service/* 的地址 + * + * @version v1.0.0 @author zhichenggang 2017-1-6 新建与整理 + */ +public class ServiceExecutor implements HttpExecutor, ZmlContextConstants +{ + private HashMap executorMap = new HashMap<>(); + private ArrayList executors = new ArrayList<>(); + + public ServiceExecutor() + { + //5个精确定位 + executorMap.put(_PATH_SERVICE_AJAX_, new AjaxService()); + executorMap.put(_PATH_SERVICE_RMI_, new RmiService()); + executorMap.put(_PATH_SERVICE_VCODE_, new VcodeService()); + executorMap.put(_PATH_SERVICE_UPLOAD_, new UploadService()); + executorMap.put(_PATH_SERVICE_WS_, new HttpWebsocketService()); + + //2个模糊匹配 + executors.add(new ResourceService()); + executors.add(new UploadAccessService()); + executors.trimToSize(); + } + + @Override + public boolean isMatch(String pathInContext) + { + return Validates.isMatch(pathInContext, _PATH_SERVICE_); + } + + @Override + public void handle(HttpRequest request, HttpResponse response) throws IOException + { + HttpExecutor executor = getMatchExecutor(request.getPathInContext()); + if (executor != null) + executor.handle(request, response); + else + request.getContext().getNotFoundHandler().handle(request, response); + } + + public RmiService getRmiService() + { + return (RmiService)executorMap.get(_PATH_SERVICE_RMI_); + } + + public void addService(String path, HttpExecutor service) + { + Asserts.as(Validates.isLen(path, 10, 100) && path.startsWith("/service/")?null:"增加ZML上下文环境下服务时,path必须以/service/开头,最长100字符"); + Asserts.as(service != null?null:"增加ZML上下文环境下服务时,服务不能为null"); + + if (path.contains("*")) + executors.add(service); + else + executorMap.put(path, service); + } + + /** 匹配对应的Handler */ + private HttpExecutor getMatchExecutor(String pathInContext) + { + //1.先精确 + HttpExecutor executor = executorMap.get(pathInContext); + if (executor != null) + return executor; + + //2.后模糊 + for (HttpExecutor handler : executors) + { + if (handler.isMatch(pathInContext)) + return handler; + } + + return null; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/StaticContext.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/StaticContext.java new file mode 100644 index 0000000..5df5c20 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/StaticContext.java @@ -0,0 +1,757 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpContextLoader; +import org.zhiqim.httpd.HttpEntity; +import org.zhiqim.httpd.HttpException; +import org.zhiqim.httpd.HttpExecutor; +import org.zhiqim.httpd.HttpHandler; +import org.zhiqim.httpd.HttpHeader; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResource; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.HttpSender; +import org.zhiqim.httpd.HttpServer; +import org.zhiqim.httpd.HttpSessionManager; +import org.zhiqim.httpd.HttpWebsocketManager; +import org.zhiqim.httpd.HttpdConstants; +import org.zhiqim.httpd.entities.CrossdomainEntity; +import org.zhiqim.httpd.entities.FaviconEnitiy; +import org.zhiqim.httpd.entities.NotFoundEntity; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.config.Group; +import org.zhiqim.kernel.config.Item; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.HashSetS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; + +/** + * 静态上下文环境,实现基本的静态环境,允许子类实现不同的环境功能 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class StaticContext implements HttpContext, HttpdConstants +{ + protected static final NotFoundEntity _notFound = new NotFoundEntity(); + + protected String id; + protected boolean isRunning; + protected HttpServer server; + protected ClassLoader contextLoader; + protected HashSetS contextDomains = new HashSetS(); + protected String contextPath; + protected String encoding; + + protected HttpResource resource; + protected List cResourceList = new ArrayList(); + + protected boolean cookieUse = true; + protected String cookieDomain; + protected int cookiePort; + protected String cookiePath; + + protected String welcomeUrl; + protected String notFoundUrl; + protected int maxContentLength; + protected int chunkSize; + protected int expires; + + protected HashMapSO attributes = new HashMapSO(); + protected List handlers = new ArrayList(); + protected List filters = new ArrayList(2); + + protected HttpHandler defaultHandler; + + public StaticContext() + { + this.encoding = _UTF_8_; + ClassLoader parent = Thread.currentThread().getContextClassLoader(); + this.contextLoader = new HttpContextLoader(parent); + } + + @Override /** 创建 */ + public boolean create(Group group) throws Exception + { + //1.设置contextId + this.id = group.getId(); + + //2.设置context资源信息,[path必须,domain可选] + this.contextPath = group.getString(_CONTEXT_PATH_); + Asserts.as(Validates.isNotEmpty(contextPath)?null:"HttpContext["+id+"]的未找到[path]配置项"); + + String contextDomain = group.getString(_CONTEXT_DOMAIN_, null); + if (Validates.isNotEmptyBlank(contextDomain)) + {//把域名排重放到HashSet中 + String[] domains = Arrays.toStringArray(contextDomain); + for (String d : domains) + { + this.contextDomains.add(d); + } + } + + //验证是否有相同的 + server.chkContextDomainPath(this.contextDomains, this.contextPath); + + //3.设置资源目录和类型,为null表示不支持资源,如仅提供RMI的服务 + String resourceType = group.getString(_CONTEXT_RESOURCE_TYPE_, null); + String resourcePath = group.getString(_CONTEXT_RESOURCE_PATH_, null); + this.resource = new HttpResource(resourceType, resourcePath); + + //4.设置[/favion.ico和/crossdomain.xml]默认处理器 + this.addHandler(new FaviconEnitiy(this)); + this.addHandler(new CrossdomainEntity(this)); + + //5.设置最大文件大小、分块大小、未找到缺省页,欢迎页 + this.setWelcomeUrl(group.getString(_CONTEXT_WELCOME_URL_, null)); + this.setNotFoundUrl(group.getString(_CONTEXT_NOT_FOUND_URL_, null)); + this.maxContentLength = group.getInt(_CONTEXT_MAX_CONTENT_LEN_, _MAX_CONTENT_LEN_); + this.chunkSize = group.getInt(_CONTEXT_CHUNK_SIZE_, _MAX_CHUNKED_SIZE_); + this.expires = group.getInt(_CONTEXT_EXPIRES_, _MAX_EXPIRES_); + + //6.设置过滤模式 + String filterPattern = group.getString(_CONTEXT_FILTER_); + if (Validates.isNotEmpty(filterPattern)) + { + String[] filters = Arrays.toStringArray(filterPattern); + for (String filter : filters) + { + addFilter(filter); + } + } + + //7.把配置属性都添加属性表中 + for (Item item : group.list()) + { + setAttribute(item.getKey(), item.getString()); + } + + //创建成功 + this.isRunning = true; + return true; + } + + @Override /** 销毁 */ + public void destroy() + { + if (!isRunning) + return; + + this.isRunning = false; + + this.attributes.clear(); + this.handlers.clear(); + this.filters.clear(); + + //从服务中移除 + this.server.removeContext(this); + } + + @Override /** 读取可配置值 */ + public String getConfiguration() + { + return getAttributeString(_CONTEXT_ORM_); + } + + /*********************************************************************/ + //上下文环境基本属性相关方法 + /*********************************************************************/ + + public String getId() + { + return id; + } + + public boolean isRunning() + { + return isRunning; + } + + public void setServer(HttpServer server) + { + this.server = server; + } + + public void setEncoding(String encoding) + { + this.encoding = Strings.trimEmpty(encoding, _UTF_8_); + } + + public String getResourcePath() + { + return resource.getResourcePath(); + } + + public HttpServer getServer() + { + return server; + } + + public HashSetS getContextDomains() + { + return contextDomains; + } + + public String getContextPath() + { + return contextPath; + } + + /** 获取上下文环境下绝对路径转为根环境下的绝对路径,如contextPath=/doc,path=/index.htm,得到/doc/index.htm */ + public String getRootPath(String path) + { + path = Strings.trim(path); + if (!Strings.startsWith(path, "/")) + return path;//相对路径不处理 + + return Strings.trimRight(contextPath, "/") + path; + } + + public String getRealPath(String path) + { + Asserts.as(resource.getResourcePath() != null?null:"系统未配置资源根目录,不支持该方法查找地址"); + + path = Files.toLinuxPath(Strings.trim(path)); + if (Validates.isEmpty(path) || "/".equals(path)) + return resource.getResourcePath(); + + return resource.getResourcePath() + "/" + Strings.removeStartsWith(path, "/"); + } + + public boolean isClasspath() + { + return resource.isClasspath(); + } + + /** 通过上下文环境加载类 */ + public synchronized Class loadClass(String className) throws ClassNotFoundException + { + return contextLoader.loadClass(className); + } + + /*********************************************************************/ + //上下文环境组件资源相关 + /*********************************************************************/ + + /** + * 增加组件资源 + * + * @param resourceIndex 资源查找索引,从小到大查找 + * @param resourceType 资源类型classpath|directory + * @param resourcePath 资源地址,如/com/zhiqim/example或./example + * @return =true表示成功,=false表示已存在 + */ + public boolean addComponentResource(int resourceIndex, String resourceType, String resourcePath) + { + HttpResource cResource = new HttpResource(resourceIndex, resourceType, resourcePath); + if (cResourceList.contains(cResource)) + return false; + + cResourceList.add(cResource); + Collections.sort(cResourceList, HttpResource._resourceCompor); + return true; + } + + /** + * 获取该资源内的资源字符串 + * + * @param path 请求 + * @return =null表示不在该资源内,!=null表示在该资源内并读取到内容 + * @throws IOException 异常 + */ + public String getResourceString(String path) throws IOException + { + return getResourceString(path, _UTF_8_); + } + + /** + * 获取该资源内的资源字符串 + * + * @param path 请求 + * @param encoding 编码 + * @return =null表示不在该资源内,!=null表示在该资源内并读取到内容 + * @throws IOException 异常 + */ + public String getResourceString(String path, String encoding) throws IOException + { + String value = null; + if (resource != null) + { + value = resource.getResourceString(path, encoding); + if (value != null) + return value; + } + + //查找是否配置了组件资源目录列表 + for (HttpResource cResource : cResourceList) + { + value = cResource.getResourceString(path, encoding); + if (value != null) + return value; + } + + return value; + } + + /** + * 读取资源目录下的文件名和目录名,目录名以/结尾,用于显示目录下列表 + * + * @param folderPath 目录地址 + * @return 名称列表 + * @throws IOException 异常 + */ + public List getResourceNameList(String folderPath) throws IOException + { + List nameList = new ArrayList<>(); + if (resource != null) + { + nameList.addAll(resource.getResourceNameList(folderPath)); + } + + //查找是否配置了组件资源目录列表 + for (HttpResource cResource : cResourceList) + { + nameList.addAll(cResource.getResourceNameList(folderPath)); + } + + return nameList; + } + + /*********************************************************************/ + //上下文环境过滤和匹配相关 + /*********************************************************************/ + + /** + * 增加过滤路径,规则同Handler匹配规则,不允许增加缺省/的过滤 + * + * @param match 匹配字符串 + * @return =true表示增加成功,=false表示增加失败 + */ + public boolean addFilter(String match) + { + if ("/".equals(match) || !isValidMatch(match)) + return false; + + filters.add(match); + return true; + } + + /** + * 设置缺省Handler,除去匹配之后提供的/*处理器 + * + * @param handler 处理器 + */ + public void setDefaultHandler(HttpHandler handler) + { + this.defaultHandler = handler; + } + + /** + * 增加Handler处理器,规则如下: + * + * 1.精确匹配,/开头后加字符串,如/match, /match.do + * 2.最长路径匹配,使用/*标识,如/match/* + * 3.扩展匹配,不允许出现/字符,如*.do, *.action + * 4.缺省匹配,/字符串,当查询前三个不成功时,跳转到ResourceHandler处理,如果资源未找到,则转到缺省匹配 + * 5.如果前四种都失败,返回系统404页面 + * + * @param match 匹配字符串 + * @param handler 处理器 + * @return =true表示增加成功,=false表示增加失败 + */ + public boolean addHandler(HttpHandler handler) + { + handlers.add(handler); + return true; + } + + /** 匹配对应的Handler */ + public HttpHandler getMatchHandler(String pathInContext) + { + for (HttpHandler handler : handlers) + { + if (handler.isMatch(pathInContext)) + return handler; + } + + return defaultHandler; + } + + /** 是否过虑匹配 */ + public boolean isFilterPath(String pathInContext) + { + for (String filter : filters) + { + if (filter.equals(pathInContext)) + return true;//精确 + + if (filter.endsWith("/*")) + { + filter = filter.substring(0, filter.length()-1); + if (pathInContext.startsWith(filter)) + return true;//路径 + } + + if (filter.startsWith("*.")) + { + filter = filter.substring(1); + if (pathInContext.endsWith(filter)) + return true;//扩展 + } + + int ind = filter.indexOf("/*."); + if (ind != -1) + {//指定路径的扩展,如/service/*.js + String pathPrefix = filter.substring(0, ind+1);// /service/ + String pathSuffix = filter.substring(ind+2);// .js + if (pathInContext.startsWith(pathPrefix) && pathInContext.endsWith(pathSuffix)) + return true; + } + } + + return false; + } + + /** 是否是有效的匹配 */ + protected boolean isValidMatch(String match) + { + if (match == null) + return false; + + if ("/".equals(match)) + return true;//缺省匹配 + + int times = Strings.getTimes(match, '*'); + if (times == 0 && match.startsWith("/")) + return true;//精确匹配,如/index.htm + + if (times == 1 && match.startsWith("/") && match.endsWith("/*")) + return true;//路径匹配,如/service/* + + if (times == 1 && (match.indexOf("/*.") != -1 || match.startsWith("*.")) && !match.endsWith(".")) + return true;//扩展匹配,如*.htm,或指定路径的扩展匹配/service/*.htm + + return false; + } + + /*********************************************************************/ + //上下文环境处理器,根据过滤、匹配和组件资源一起配合检查处理 + /*********************************************************************/ + + /** + * 默认处理请求,子类可以重写,默认查询Handler,如果查到对应由Handler处理,否则认为由ResourceHandler处理 + * + * @param request 请求 + * @param response 响应 + * @exception HttpException HTTP异常 + * @exception IOException IO异常 + */ + public void handle(HttpRequest request, HttpResponse response)throws HttpException, IOException + { + //6.第六步,查找处理器 + String pathInContext = request.getPathInContext(); + + //查询是否过滤,如果在过滤里那么由缺省Handler处理 + if (isFilterPath(pathInContext)) + { + response.sendError(_403_FORBIDDEN_); + return; + } + + //查找匹配 + HttpHandler handler = getMatchHandler(pathInContext); + if (handler instanceof HttpExecutor) + { + ((HttpExecutor)handler).handle(request, response); + return; + } + else if (handler instanceof HttpEntity) + { + ((HttpEntity)handler).handle(request, response); + return; + } + + //查询不到则跳转到处理文件资源 + handleResource(request, response); + } + + /** + * 公共处理文件资源,该方法可以在匹配到的Handler中发现子匹配失败时回跳到文件资源处理中再检查一次 + * + * @param request 请求 + * @param response 响应 + * @exception HttpException HTTP异常 + * @exception IOException IO异常 + */ + public void handleResource(HttpHeader header, HttpSender sender)throws HttpException, IOException + { + //查找是否配置了资源目录 + if (resource != null) + { + if (resource.handleResource(header, sender)) + return; + } + + //查找是否配置了组件资源目录列表 + for (HttpResource cResource : cResourceList) + { + if (cResource.handleResource(header, sender)) + return; + } + + //最后未找到处理 + _notFound.handle(header, sender); + } + + /*********************************************************************/ + //上下文环境自定义属性相关方法 + /*********************************************************************/ + + public void setAttribute(String key, Object value) + { + attributes.put(key, value); + } + + public void setAttribute(Class key, T value) + { + attributes.put(key.getName(), value); + } + + public boolean hasAttribute(String key) + { + return attributes.containsKey(key); + } + + public HashMapSO getAttributes() + { + return attributes; + } + + public Object getAttribute(String key) + { + return attributes.get(key); + } + + @SuppressWarnings("unchecked") + public T getAttribute(Class key) + { + return (T)attributes.get(key.getName()); + } + + public Object getAttribute(String key, Object defaultValue) + {//这里不处理name和version,由缺省指定 + Object value = getAttribute(key); + return (value == null)?defaultValue:value; + } + + public String getContextName() + { + String name = getAttributeString(_NAME_); + return name == null?Global.getName():name; + } + + public String getContextVersion() + { + String version = getAttributeString(_VERSION_); + return version == null?Global.getVersion():version; + } + + public String getAttributeString(String key) + { + return getAttributeString(key, null); + } + + public String getAttributeString(String key, String defaultValue) + { + Object value = getAttribute(key); + return (value == null)?defaultValue:Strings.trim(String.valueOf(value)); + } + + public int getAttributeInt(String key) + { + return getAttributeInt(key, -1); + } + + public int getAttributeInt(String key, int defaultValue) + { + return Ints.toInt(getAttribute(key), defaultValue); + } + + public long getAttributeLong(String key) + { + return getAttributeLong(key, -1); + } + + public long getAttributeLong(String key, long defaultValue) + { + return Longs.toLong(getAttribute(key), defaultValue); + } + + public boolean getAttributeBoolean(String key, boolean defaultValue) + { + Object value = getAttribute(key); + if (value == null) + return defaultValue; + else if (value instanceof Boolean) + return (Boolean)value; + else if (value instanceof String) + return Boolean.parseBoolean((String)value); + else + return defaultValue; + } + + /**********************************************************************************/ + //静态上下文环境四项配置 + /**********************************************************************************/ + + /** 获取欢迎页 */ + public String getWelcomeUrl() + { + return welcomeUrl; + } + + /** 获取404页 */ + public String getNotFoundUrl() + { + return notFoundUrl; + } + + /** 获取NotFoundHandler */ + public HttpEntity getNotFoundHandler() + { + return _notFound; + } + + /** 获取上行最大内容长度 */ + public int getMaxContentLength() + { + return maxContentLength; + } + + /** 获取设置的分块大小 */ + public int getChunkSize() + { + return chunkSize; + } + + /** 获取静态文件有效期 */ + public int getExpires() + { + return expires; + } + + public void setWelcomeUrl(String welcomeUrl) + { + this.welcomeUrl = (Validates.isEmptyBlank(welcomeUrl))?null:Strings.addStartsWith(welcomeUrl, "/"); + } + + public void setNotFoundUrl(String notFoundUrl) + { + this.notFoundUrl = (Validates.isEmptyBlank(notFoundUrl))?null:Strings.addStartsWith(notFoundUrl, "/"); + } + + public String getDefaultEncoding() + { + return encoding; + } + + /**********************************************************************************/ + //静态上下文环境Cooke使用默认值 + /**********************************************************************************/ + + + /** 子类可以重写该方法 */ + public boolean isCookieUse() + { + return cookieUse; + } + + public String getCookieDomain() + { + return cookieDomain; + } + + public int getCookiePort() + { + return cookiePort; + } + + public String getCookiePath() + { + return contextPath; + } + + public void setCookieUse(boolean cookieUse) + { + this.cookieUse = cookieUse; + } + + public void setCookieDomain(String cookieDomain) + { + this.cookieDomain = cookieDomain; + } + + public void setCookiePort(int cookiePort) + { + this.cookiePort = cookiePort; + } + + public void setCookiePath(String cookiePath) + { + this.cookiePath = cookiePath; + } + + /**********************************************************************************/ + //静态上下文环境Session不支持 + /**********************************************************************************/ + + public HttpSessionManager getSessionManager() + { + return null; + } + + public void invalidateSession(String sessionId) + { + } + + /*********************************************************************/ + //静态上下文环境WebSocket不支持 + /*********************************************************************/ + + @Override + public HttpWebsocketManager getWebsocketManager() + {//不支持 + return null; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/ZResExecutor.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZResExecutor.java new file mode 100644 index 0000000..535b456 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZResExecutor.java @@ -0,0 +1,49 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context; + +import java.io.IOException; + +import org.zhiqim.httpd.HttpExecutor; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.kernel.util.Validates; + +/** + * 资源处理器,/zres/*和/ztmpl/*下除/ztmpl/*.htm,ztmpl/*.zml的资源访问 + * + * @version v1.0.0 @author zouzhigang 2017-12-22 新建与整理 + */ +public class ZResExecutor implements HttpExecutor, ZmlContextConstants +{ + @Override + public boolean isMatch(String pathInContext) + { + return Validates.isMatch(pathInContext, ZC_RES_ZRES_FILE) || Validates.isMatch(pathInContext, ZC_RES_ZTMPT_FILE); + } + + @Override + public void handle(HttpRequest request, HttpResponse response) throws IOException + { + request.getContext().handleResource(request, response); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlBootstrap.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlBootstrap.java new file mode 100644 index 0000000..cdc6e63 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlBootstrap.java @@ -0,0 +1,161 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Context; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Strings; + +/** + * HttpContext引导类,为初始化类,允许子类实现,每context根据自身要求初始化和释放对象 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZmlBootstrap +{ + protected static Log log = LogFactory.getLog(ZmlBootstrap.class); + protected Context context; + + private boolean isBefore; + private boolean isAfter; + private volatile boolean isClosed; + + /** 设置上下文环境 */ + public final void setContext(Context context) + { + if (this.context != null) + return; + + this.context = context; + } + + /** 获取上下文环境 */ + public final Context getContext() + { + return context; + } + + /***************************************************************************/ + //解决多依赖关系下一个组件的引导类只能引导一次 + /***************************************************************************/ + + /** 是否已前部引导 */ + public final boolean isBefore() + { + return isBefore; + } + + /** 设置是否前部引导 */ + public final void setBefored() + { + this.isBefore = true; + } + + /** 是否已后部引导 */ + public final boolean isAfter() + { + return isAfter; + } + + /** 设置是否已后部引导 */ + public final void setAftered() + { + this.isAfter = true; + } + + /** 是否已销毁 */ + public final boolean isClosed() + { + return isClosed; + } + + /** 关闭引导,子类实现释放资源接口 */ + public final void close() + { + if (!isClosed) + return; + + isClosed = true; + try{destroy();}catch(Throwable e){} + } + + /***************************************************************************/ + //子类可重写的三个受保护方法 + /***************************************************************************/ + + /** 在配置加载之后,在ZML配置之前 */ + protected void initBefore() throws Exception + { + } + + /** 在配置加载之后,在ZML配置之后 */ + protected void initAfter() throws Exception + { + } + + /** 释放资源接口,注:如果在init方法内初始化了线程等应用,务必在这里释放 */ + protected void destroy() + { + } + + /***************************************************************************/ + //子类可重写的两个日志公开方法 + /***************************************************************************/ + + /** + * 日志输出接口 + * + * @param request 请求 + * @param message 消息 + */ + public void log(HttpRequest request, String message) + { + log(request, message, null); + } + + /** + * 日志输出接口 + * + * @param request 请求 + * @param message 消息 + * @param e 访问时产生的异常 + */ + public void log(HttpRequest request, String message, Throwable e) + { + String sessionName = Strings.toString(request.getSessionName(), Strings.toString(request.getRequestName(), "guest")); + StringBuilder strb = new StringBuilder() + .append("USER:").append(sessionName).append(" ") + .append("IP:").append(request.getRemoteAddr()).append(" ") + .append("URI:").append(request.getRequestURI()); + + if (message != null) + strb.append(" ").append(message); + + if (e == null) + log.info(strb.toString()); + else + log.error(strb.toString(), e); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlConfig.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlConfig.java new file mode 100644 index 0000000..ab29fb1 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlConfig.java @@ -0,0 +1,834 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context; + +import java.util.Map.Entry; + +import org.zhiqim.httpd.HttpResource; +import org.zhiqim.httpd.HttpWebsocket; +import org.zhiqim.httpd.context.config.ZAction; +import org.zhiqim.httpd.context.config.ZActionPackage; +import org.zhiqim.httpd.context.config.ZAttribute; +import org.zhiqim.httpd.context.config.ZComponent; +import org.zhiqim.httpd.context.config.ZComponentWapper; +import org.zhiqim.httpd.context.config.ZConfig; +import org.zhiqim.httpd.context.config.ZInterceptor; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.httpd.context.core.Interceptor; +import org.zhiqim.httpd.context.extend.EmptyAction; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.HashMapSV; +import org.zhiqim.kernel.extend.LinkedMapSV; +import org.zhiqim.kernel.extend.MapS; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.Zml; +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.zml.ZmlVarNotice; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.statement._Var; + + +/** + * 上下文环境配置,针对FContext的多种情况进行处理 + * 1.先加载组件的context + * 2.再加载子context + * 3.最后加载本身context + * 后加载的可以调用和覆盖先加载的属性、变量、拦截器和动作 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZmlConfig implements ZmlContextConstants, ZmlVarNotice, MapS +{ + private static final Log log = LogFactory.getLog(ZmlConfig.class); + private static final EmptyAction empty = new EmptyAction(); + + private final Context context; + private final boolean pathExactPrior; + private final ZConfig rootConfig; + private final ZActionPackage actionPackage; + + private LinkedMapSV componentMap = new LinkedMapSV<>(); + private HashMapSV variableMap = new HashMapSV<>(); + private HashMapSO attributeMap = new HashMapSO(); + private HashMapSV interceptorMap = new HashMapSV<>(); + private HashMapSV actionMap = new HashMapSV<>(); + + private HttpWebsocket websocket; + private ZmlBootstrap bootstrap; + + /** + * 构造函数,提供配置根路径和是否是打包在类路径 + * + * @param context 上下文环境 + * @param resource 上下文件资源 + * @param pathExactPrior 路径寻找精确优先 + */ + public ZmlConfig(Context context, HttpResource resource, boolean pathExactPrior) + { + this.context = context; + this.pathExactPrior = pathExactPrior; + this.rootConfig = !resource.isValid()?null:new ZConfig(this, true, resource.getResourceType(), resource.getResourcePath(), ZC_CONFIG, ZC_CONF_CONFIG_XML); + this.actionPackage = rootConfig==null?null:rootConfig.getActionPackage(this); + } + + public Context getContext() + { + return context; + } + + public ZConfig getRootConfig() + { + return rootConfig; + } + + public String getActionPackage() + { + return actionPackage==null?null:actionPackage.getActionPackage(); + } + + public ZComponentWapper getComponent(String path) + { + return componentMap.get(path); + } + + /** 创建 */ + public boolean create() throws Exception + {//分三步,第一步:加载根配置,第二步:初始化根配置和组件配置,第三步:组装上下文ZML和执行引导 + + /***************************************************************************/ + //第一步,加载根配置和组件配置 + /***************************************************************************/ + + //1.1 加载根配置(配置文件和包) + if (rootConfig != null) + rootConfig.load(); + + if (actionPackage != null) + actionPackage.load(); + + if (rootConfig == null) + {//如果没有根配置则初始化完成 + return true; + } + + //1.2.先封装成组件包,再加载组件配置 + for (ZComponent c : rootConfig.getComponentList()) + { + ZComponentWapper component = new ZComponentWapper(this, c); + componentMap.put(c.getPath(), component); + + component.load(); + } + + /***************************************************************************/ + //第二步:初始化组件配置 + /***************************************************************************/ + + int resourceIndex = 0;ZmlEngine engine = context.getZmlEngine(); + for (ZComponentWapper component : componentMap.values()) + { + ZmlBootstrap bootstrap = component.getBootstrap(); + if (bootstrap != null && !bootstrap.isBefore()) + { + bootstrap.initBefore(); + bootstrap.setBefored(); + } + + //2.1 有资源目录 + //2.1.1 有上下文配置 + ZConfig rc = component.getConfig(); + if (rc != null) + {//有context.xml + for (ZConfig c : rc.getConfigList()) + { + if (!initConfig(c)) + return false; + } + + if (!initConfig(rc)) + return false; + } + + //2.1.2 组件资源目录,用于静态文件覆盖和读取 + context.addComponentResource(resourceIndex++, _CLASSPATH_, component.getPath()); + + //2.1.3 组件配置加载 + if (engine != null) + { + engine.addComponentZmlLoader(ZmlContext.class, component.getPath()); + engine.addConfigZml(ZC_CONF_CONFIG_ZML, component.getPath()); + } + + //2.2 有引导类 + if (bootstrap != null && !bootstrap.isAfter()) + { + bootstrap.initAfter(); + bootstrap.setAftered(); + } + } + + /***************************************************************************/ + //第三步:初始化根配置 + /***************************************************************************/ + + //3.1.最后初始化根配置的下配置的context + for (ZConfig c : rootConfig.getConfigList()) + { + if (!initConfig(c)) + return false; + } + + //3.2.最后初始化根配置config.xml + if (!initConfig(rootConfig)) + return false; + + //3.3.最后初始化前部引导 + ZmlBootstrap bootstrap = getBootstrap(); + if (!bootstrap.isBefore()) + { + bootstrap.initBefore(); + bootstrap.setBefored(); + } + + //3.4.最后组装根配置的上下文环境ZML(注,根引导类不在这里启动) + if (engine != null) + { + engine.addConfigZml(ZC_CONF_CONFIG_ZML); + } + + //3.5.最后初始化后部引导 + if (!bootstrap.isAfter()) + { + bootstrap.initAfter(); + bootstrap.setAftered(); + } + + return true; + } + + /** 销毁 */ + public void destroy() + { + if (bootstrap != null) + bootstrap.close(); + + for (ZComponentWapper component : componentMap.values()) + { + ZmlBootstrap bootstrap = component.getBootstrap(); + if (bootstrap != null){ + bootstrap.close(); + } + } + + componentMap.clear(); + } + + /************************************************************************************************/ + //获取 Variable & Attribute + /************************************************************************************************/ + + public boolean has(String key) + { + if (context.hasTopAttribute(key)) + {//1.查顶级 + return true; + } + + //2.顶级没有,优先变量表 + if (context.getZmlEngine() != null) + context.getZmlEngine().chkCurConfigModified(); + + for (HashMapSO vMap : variableMap.values()) + { + if (vMap.containsKey(key)) + return true; + } + + //3.最后取属性表 + return attributeMap.containsKey(key); + } + + /** 变量表优先,即context.zml优先于context.xml */ + public Object get(String key) + { + if (context.hasTopAttribute(key)) + {//1.如果顶级属性里有,则取属性,值为null也返回 + return context.getTopAttribute(key); + } + + //2.顶级没有,优先变量表 + if (context.getZmlEngine() != null) + context.getZmlEngine().chkCurConfigModified(); + + for (HashMapSO vMap : variableMap.values()) + { + Object value = vMap.get(key); + if (value != null)//动态检查 + return value; + } + + //3.最后取属性表 + return attributeMap.get(key); + } + + /** 根据协议获取WS */ + public HttpWebsocket getWebsocket(String protocol) + { + if (Validates.isEmptyBlank(protocol)) + return null; + + String cls = Global.getClassName(protocol); + String wss = rootConfig.getWebsocketClass(); + if (cls.equals(wss)) + { + if (websocket != null) + return websocket; + + Object instance = Classes.newInstance(cls); + Asserts.as((instance instanceof HttpWebsocket)?null:"组件["+context.getContextName()+"]配置的[websocket]不是HttpWebsocket实现类"); + websocket = (HttpWebsocket)instance; + return websocket; + } + + //从组件中找到最后一个 + for (int i=componentMap.size()-1;i>=0;i--) + { + ZComponentWapper component = componentMap.get(i); + HttpWebsocket websocket = component.getWebsocket(); + if (websocket != null && cls.equals(websocket.getClass().getName())) + return websocket; + } + + return null; + } + + public ZmlBootstrap getBootstrap() + { + if (bootstrap != null) + return bootstrap; + + String bootstrapClass = rootConfig.getBootstrapClass(); + if (Validates.isNotEmptyBlank(bootstrapClass)) + {//根配置有,以根配置为准 + Object instance = Classes.newInstance(bootstrapClass); + Asserts.as((instance instanceof ZmlBootstrap)?null:"组件["+context.getContextName()+"]配置的[bootstrap]或不是ZmlBootstrap或其子类"); + bootstrap = (ZmlBootstrap)instance; + bootstrap.setContext(context); + return bootstrap; + } + + //从组件中找到最后一个 + for (int i=componentMap.size()-1;i>=0;i--) + { + ZComponentWapper component = componentMap.get(i); + bootstrap = component.getBootstrap(); + if (bootstrap != null) + return bootstrap; + } + + //都没有,取默认 + bootstrap = new ZmlBootstrap(); + bootstrap.setContext(context); + return bootstrap; + } + + @Override/** 组件的配置ZML只在第一次加载时放置到属性表,当前配置ZML可能修改放置变量表 */ + public void doUpdateVariable(Zml zml, String configPath, String componentPath, LinkedMapSV<_Var> varMap) + { + HashMapSO vMap = null; + if (Validates.isNotEmpty(componentPath)) + {//组件取属性表 + vMap = attributeMap; + } + else + {//当前根配置ZML + vMap = variableMap.get(configPath); + if (vMap == null) + {//新建 + vMap = new HashMapSO(); + variableMap.put(configPath, vMap); + } + else + {//清理重建 + vMap.clear(); + } + } + + HashMapSO localMap = new HashMapSO(); + localMap.put("context", context); + + ZmlEngine engine = zml.getEngine(); + ZmlVariable variable = new ZmlVariable(); + variable.setZml(zml); + variable.setVariableMap(vMap); + variable.setContextMap(this); + variable.addLocalVariable(localMap); + + for (Entry entry : varMap.entrySet()) + { + String name = entry.getKey(); + Expression expression = entry.getValue().getExpression(); + + try + { + Object value = expression.build(variable); + vMap.put(name, value); + + if (engine != null) + { + //顶级属性没有配置ZmlContext参数时,如下两个参数可由变量设置 + if (_ZML_MAX_KEEP_TIME_.equals(name) && !context.hasTopAttribute(name)) + { + int val = Ints.toInt(value, 24*60*60);//24小时 + engine.setMaxKeepTime(val); + } + else if (_ZML_MAX_IDLE_TIME_.equals(name) && !context.hasTopAttribute(name)) + { + int val = Ints.toInt(value, 1*60*60);//1小时 + engine.setMaxIdleTime(val); + } + } + } + catch (ExpressionException e) + { + //异常表示解析失败,不加入到变量表 + } + } + } + + /************************************************************************************************/ + //获取 ZAction + /************************************************************************************************/ + + public ZAction getAction(String path) + { + if (path == null) + return null; + + //精确或循序优先 + return pathExactPrior?getExactPriorAction(path):getInTurnAction(path); + } + + private ZAction getInTurnAction(String path) + {//循序方式 + //1.先查根配置 + if (rootConfig != null) + { + ZAction action = rootConfig.getInTurnAction(path); + if (action != null) + return action; + } + + //2.再查actionPackage + if (actionPackage != null) + { + ZAction action = actionPackage.getInTurnAction(path); + if (action != null) + return action; + } + + //3.再倒序查组件 + for (int i=componentMap.size()-1;i>=0;i--) + { + ZComponentWapper component = componentMap.get(i); + ZAction action = component.getActionInTurn(path); + if (action != null) + return action; + } + + return null; + } + + private ZAction getExactPriorAction(String path) + { + //1.精确优先 + + //1.1.先查根配置 + if (rootConfig != null) + { + ZAction action = rootConfig.getExactAction(path); + if (action != null) + return action; + } + + //1.2.再查actionPackage + if (actionPackage != null) + { + ZAction action = actionPackage.getExactAction(path); + if (action != null) + return action; + } + + //1.3.再倒序查组件 + for (int i=componentMap.size()-1;i>=0;i--) + { + ZComponentWapper component = componentMap.get(i); + ZAction action = component.getExactAction(path); + if (action != null) + return action; + } + + //2.模糊再次 + + //2.1.先查根配置 + if (rootConfig != null) + { + ZAction action = rootConfig.getFuzzyAction(path); + if (action != null) + return action; + } + + //2.2.再查actionPackage + if (actionPackage != null) + { + ZAction action = actionPackage.getFuzzyAction(path); + if (action != null) + return action; + } + + //2.3.再倒序查组件 + for (int i=componentMap.size()-1;i>=0;i--) + { + ZComponentWapper component = componentMap.get(i); + ZAction action = component.getFuzzyAction(path); + if (action != null) + return action; + } + + return null; + } + + /************************************************************************************************/ + //设置和获取 Action + /************************************************************************************************/ + + public void setActionOnPath(String path, Action action) + { + actionMap.put(path, action); + } + + public Action getAction(ZAction zAction) + { + Action action = actionMap.get(zAction.getPath()); + if (action != null) + {//精确匹配path-->>> Action + return action; + } + + //模糊匹配的通过类名查找 + String className = zAction.getClassName(); + action = getActionByRuntimeClass(className); + if (action != null) + {//已被匹配过一次 + return action; + } + + Object obj = Classes.newInstance(className); + Asserts.as((obj != null && obj instanceof Action)?null:"Action[%s]替换通配符后的类[%s]不存在或不是Action类", zAction.getPath(), className); + + action = (Action)obj; + setActionOnRuntimeClass(className, action); + return action; + } + + public Action getActionInstance(String clazz) + { + if (clazz == null) + return null; + + clazz = Global.getClassName(clazz); + + //1.先判断通配的可能性_match_class方式 + Action action = getActionByRuntimeClass(clazz); + if (action != null) + return action; + + //2.再通过类找到路径,从路径中匹配 + return pathExactPrior?getExactPriorActionByClass(clazz):getInTurnActionByClass(clazz); + } + + private Action getInTurnActionByClass(String clazz) + { + //1.先查根配置 + if (rootConfig != null) + { + ZAction action = rootConfig.getInTurnActionByClass(clazz); + if (action != null) + return getAction(action); + } + + //2.再查actionPackage + if (actionPackage != null) + { + ZAction action = actionPackage.getInTurnActionByClass(clazz); + if (action != null) + return getAction(action); + } + + //3.再倒序查组件 + for (int i=componentMap.size()-1;i>=0;i--) + { + ZComponentWapper component = componentMap.get(i); + ZAction action = component.getInTurnActionByClass(clazz); + if (action != null) + return getAction(action); + } + + return null; + } + + private Action getExactPriorActionByClass(String clazz) + { + //1.精确优先 + + //1.1.先查根配置 + if (rootConfig != null) + { + ZAction action = rootConfig.getExactActionByClass(clazz); + if (action != null) + return getAction(action); + } + + //1.2.再查actionPackage + if (actionPackage != null) + { + ZAction action = actionPackage.getExactActionByClass(clazz); + if (action != null) + return getAction(action); + } + + //1.3.再倒序查组件 + for (int i=componentMap.size()-1;i>=0;i--) + { + ZComponentWapper component = componentMap.get(i); + ZAction action = component.getExactActionByClass(clazz); + if (action != null) + return getAction(action); + } + + //2.模糊再次 + + //2.1.先查根配置 + if (rootConfig != null) + { + ZAction action = rootConfig.getFuzzyActionByClass(clazz); + if (action != null) + return getAction(action); + } + + //2.2.再查actionPackage + if (actionPackage != null) + { + ZAction action = actionPackage.getFuzzyActionByClass(clazz); + if (action != null) + return getAction(action); + } + + //2.3.再倒序查组件 + for (int i=componentMap.size()-1;i>=0;i--) + { + ZComponentWapper component = componentMap.get(i); + ZAction action = component.getFuzzyActionByClass(clazz); + if (action != null) + return getAction(action); + } + + return null; + } + + /************************************************************************************************/ + // interceptor + /************************************************************************************************/ + + public boolean hasInterceptor(String interceptor) + { + if (interceptorMap.containsKey(interceptor)) + return true; + + Class clazz = Global.getClass(interceptor); + return (clazz != null && Classes.isImplement(clazz, Interceptor.class)); + } + + public void setInterceptor(String alias, Interceptor interceptor) + { + interceptorMap.put(alias, interceptor); + } + + public Interceptor getInterceptor(String interceptor) + { + Interceptor ic = interceptorMap.get(interceptor); + if (ic != null) + return ic; + + Class cls = Global.getClass(interceptor); + if (cls == null || !Classes.isImplement(cls, Interceptor.class)) + return null; + + return (Interceptor)Global.getWithoutNew(cls); + } + + /************************************************************************************************/ + // private load & check + /************************************************************************************************/ + + /** + * 加载上下文配置信息 + * + * @param config 上下文配置信息 + * @return =true表示加载成功,=false表示加载失败 + * @throws Exception 异常 + */ + private boolean initConfig(ZConfig config) throws Exception + { + //1.设置属性配置 + for (ZAttribute attribute : config.getAttributeList()) + { + attributeMap.put(attribute.getKey(), attribute.getValue()); + log.info(attribute); + } + + //2.设置拦截器 + for (ZInterceptor interceptor : config.getInterceptorList()) + { + String clazz = interceptor.getClazz(); + Object obj = Classes.newInstance(clazz); + if (obj == null) + { + log.error("interceptor配置[%s]未找到,请检查类名或类包名是否正确", clazz); + return false; + } + + if (!(obj instanceof Interceptor)) + { + log.error("interceptor配置未实现Interceptor接口[%s]", clazz); + return false; + } + + setInterceptor(interceptor.getKey(), (Interceptor)obj); + log.info(interceptor); + } + + //3.检查Action有效性 + + //3.1 检查Action变量名 + config.chkActionVariable(); + + //3.2 检查精确Action的拦截器、类名和会话名 + for (ZAction action : config.getExactActionList()) + { + if (!chkInterceptor(action)) + return false; + + if (!chkClass(action)) + return false; + + log.info(action); + } + + //3.3 检查可匹配Action拦截器、类名和会话名 + for (ZAction action : config.getFuzzyActionList()) + { + if (!chkInterceptor(action)) + return false; + + if (!chkClass(action)) + return false; + + log.info(action); + } + + return true; + } + + /** 检查拦截器 */ + private boolean chkInterceptor(ZAction action) + { + String interceptors = action.getInterceptor(); + if (Validates.isEmptyBlank(interceptors)) + return true; + + String path = action.getPath(); + String[] interceptorArr = interceptors.split(","); + for (String interceptor : interceptorArr) + { + if (!hasInterceptor(interceptor)) + { + log.error("action配置未找到拦截器[%s]][%s]", interceptor, path); + return false; + } + } + + return true; + } + + /** 检查拦截器 */ + private boolean chkClass(ZAction action) throws Exception + { + String path = action.getPath(); + String clazz = action.getClazz(); + if (Validates.isEmptyBlank(clazz)) + {//未配置class或class为空白的 + actionMap.put(path, empty); + } + else if (path.indexOf("*") != -1 && clazz.indexOf("{") != -1 && clazz.indexOf("}") != -1) + {//class有通配要求的不检查action,在运行时再检查 + } + else + {//其他的要求检查 + Object obj = Classes.newInstance(clazz);; + if (obj == null) + { + log.error("action配置[%s]未找到,请检查类名或类包名是否正确", clazz); + return false; + } + + if (!(obj instanceof Action)) + { + log.error("action配置[%s]未实现Action接口", clazz); + return false; + } + + actionMap.put(path, (Action)obj); + } + + return true; + } + + private Action getActionByRuntimeClass(String className) + { + return actionMap.get(ZC_MATCH_PREFIX + className); + } + + private void setActionOnRuntimeClass(String className, Action action) + { + actionMap.put(ZC_MATCH_PREFIX + className, action); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlContext.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlContext.java new file mode 100644 index 0000000..957afbf --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlContext.java @@ -0,0 +1,366 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpSessionManager; +import org.zhiqim.httpd.HttpWebsocketManager; +import org.zhiqim.httpd.context.config.ZAction; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.httpd.context.core.Interceptor; +import org.zhiqim.kernel.config.Group; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.zml.ZmlVariable; + +/** + * 实现ZML模式的上下文环境

            + * 1.继承自StaticContext类,实现ZML的上下文环境功能
            + * 2.支持配置目录过滤/conf/*和/zml/*和/ztmpl/*.zml,/ztmpl/*.htm目录下不允许访问
            + * 3.加载/conf/context.xml为上下文配置
            + * 3.1 Attribute为context属性配置
            + * 3.2 Interceptor为context的拦截器
            + * 3.3 Rule为在html中定义权限配置
            + * 3.4 Action为每path处理
            + * 4.加载/conf/context.zsml为配置ZML
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZmlContext extends StaticContext implements Context +{ + private static final Log log = LogFactory.getLog(ZmlContext.class); + + private ZmlConfig config; //配置管理 + private HttpSessionManager sessionManager; //会话管理器 + private ZmlEngine engine; //ZML引擎 + private ServiceExecutor serviceExecutor; //服务处理器 + private ZmlWebsocketManager websocketManager; //WS管理器 + + public ZmlContext() + { + super(); + addFilter(ZC_FILTER_CONF_FILE); + addFilter(ZC_FILTER_ZVIEW_FILE); + addFilter(ZC_FILTER_ZTMPL_HTM); + addFilter(ZC_FILTER_ZTMPL_ZML); + } + + /** 创建ZML上下文环境 */ + public boolean create(Group group) throws Exception + { + if (!super.create(group)) + {//初始化父类静态信息失败 + return false; + } + + if (!initConfig(group)) + {//初始化本类信息失败 + return false; + } + + if (!initZmlEngine()) + {// 初始化ZML引擎失败 + return false; + } + + if (!initContext()) + {//初始化上下文配置信息失败 + return false; + } + + return true; + } + + /** 初始化配置信息 */ + public boolean initConfig(Group group) + { + //1.资源配置 + this.config = new ZmlConfig(this, resource, group.isTrue(_ZML_PATH_EXACTPRIOR_, true)); + + //2.设置服务处理器和缺省处理器 + this.serviceExecutor = new ServiceExecutor(); + super.addHandler(serviceExecutor); + super.addHandler(new ZResExecutor()); + super.setDefaultHandler(new ZmlExecutor(group.getString(_ZML_PATTERN_, _ZML_PATTERN_DEFAULT_))); + + //3.Cookie参数配置 + super.setCookieUse(group.isTrue(_ZML_COOKIE_USE_, true)); + super.setCookieDomain(group.getString(_ZML_COOKIE_DOMAIN_)); + super.setCookiePort(group.getInt(_ZML_COOKIE_PORT_, 0)); + super.setCookiePath(group.getString(_ZML_COOKIE_PATH_)); + + //4.Session管理器配置 + String sessionManager = group.getString(_ZML_SESSION_MANAGER_, _HTTP_SESSION_MANAGER_DEFAULT_); + Object manager = Classes.newInstance(sessionManager); + Asserts.as((manager instanceof HttpSessionManager)?null:"未找到["+group.getId()+"]的["+_ZML_SESSION_MANAGER_+"]或不是HttpSessionManager实现类"); + + HttpSessionManager httpSessionManager = (HttpSessionManager)manager; + httpSessionManager.setContext(this); + httpSessionManager.setSessionTimeout(group.getInt(_ZML_SESSION_TIMEOUT_, 1800)); + httpSessionManager.setSessionIdName(group.getString(_ZML_SESSION_ID_NAME_, _JSESSIONID_)); + httpSessionManager.setSessionParameter(group.getString(_ZML_SESSION_PARAMETER_, _EMPTY_)); + httpSessionManager.open(); + this.sessionManager = httpSessionManager; + + //5.Websocket管理器配置 + this.websocketManager = new ZmlWebsocketManager(this); + this.websocketManager.open(); + return true; + } + + /** + * 初始化ZML引擎 + * + * @throws Exception + */ + private boolean initZmlEngine() + { + String resourcePath = getResourcePath(); + if (Validates.isEmptyBlank(resourcePath)) + {//仅RMI服务,未配置资源目录的不初始化ZML引擎 + return true; + } + + log.info("初始化[HTTP服务:%s][ZML引擎]开始...[%s]", getServerId(), DateTimes.getDateTimeSSSString()); + + try + { + engine = new ZmlEngine(); + engine.setZmlVarNotice(config); + engine.setAscQuery(false); + engine.setMaxKeepTime(getAttributeInt(_ZML_MAX_KEEP_TIME_, 24*60*60));//24小时 + engine.setMaxIdleTime(getAttributeInt(_ZML_MAX_IDLE_TIME_, 1*60*60));//1小时 + if (isClasspath()) + engine.setClassZmlLoader(ZmlContext.class, resourcePath); + else + engine.setFileZmlLoader(new File(resourcePath)); + + log.info("初始化[HTTP服务:%s][ZML引擎]结束!!![%s]", getServerId(), DateTimes.getDateTimeSSSString()); + return true; + } + catch (Exception e) + { + log.error("初始化[ZML引擎]错误", e); + return false; + } + } + + /** 初始化配置信息 */ + private boolean initContext() + { + log.info("初始化[HTTP服务:%s][Context:%s]开始...[%s]", getServerId(), getContextName(), DateTimes.getDateTimeSSSString()); + + try + { + if (!config.create()) + return false; + + log.info("初始化[HTTP服务:%s][Context:%s]完成!!![%s]", getServerId(), getContextName(), DateTimes.getDateTimeSSSString()); + return true; + } + catch(Exception e) + { + log.error("初始化[HTTP服务:%s][Context:%s]失败!!!" , e, getServerId(), getContextName()); + return false; + } + } + + /** 销毁ZML上下文环境 */ + public void destory() + { + if (!isRunning) + return; + + super.destroy(); + + if (config != null) + config.destroy(); + + if (sessionManager != null) + sessionManager.close(); + + if (websocketManager != null) + websocketManager.close(); + } + + /** 重写判断是否有属性 */ + public boolean hasAttribute(String key) + { + return config.has(key); + } + + /** 重写获取属性 */ + public Object getAttribute(String key) + { + return ZmlVariable.chkDynamicVar(config.get(key)); + } + + /** 判断是否有HTTP属性 */ + public boolean hasTopAttribute(String key) + { + return attributes.containsKey(key); + } + + /** 获取顶有属性对象 */ + public Object getTopAttribute(String key) + { + return attributes.get(key); + } + + /** 获取顶有属性字符串 */ + public String getTopAttributeString(String key) + { + return (String)attributes.get(key); + } + + /** 获取顶有属性字符串,有属性则返回字符串,否则返回缺省值 */ + public String getTopAttributeString(String key, String defaultValue) + { + return hasTopAttribute(key)?getTopAttributeString(key):defaultValue; + } + + /************************************************************************/ + //Bootstrap & RMIServer & Zml + /************************************************************************/ + + @Override + public String getServerId() + { + return getServer().getId(); + } + + @Override + public ZmlConfig getConfig() + { + return config; + } + + @Override + public ZmlBootstrap getBootstrap() + { + return config.getBootstrap(); + } + + @Override + public ServiceExecutor getServiceExecutor() + { + return serviceExecutor; + } + + @Override + public ZmlEngine getZmlEngine() + { + return engine; + } + + /************************************************************************/ + // session + /************************************************************************/ + + @Override + public HttpSessionManager getSessionManager() + { + return sessionManager; + } + + @Override + public void invalidateSession(String sessionId) + { + if (sessionManager != null) + sessionManager.invalidateSession(sessionId); + } + + /************************************************************************/ + //Action & Interceptor + /************************************************************************/ + + @Override + public ZAction getAction(String path) + { + return config.getAction(path); + } + + @Override + public Action getAction(ZAction fAction) + { + return config.getAction(fAction); + } + + @Override + public boolean hasActionInstance(String clazz) + { + return getActionInstance(clazz) != null; + } + + @Override + public Action getActionInstance(String clazz) + { + return config.getActionInstance(clazz); + } + + @Override + public boolean hasInterceptor(String interceptor) + { + return config.hasInterceptor(interceptor); + } + + @Override + public Interceptor getInterceptor(String interceptor) + { + return config.getInterceptor(interceptor); + } + + @Override + public List getInterceptorList(String interceptors) + { + if (Validates.isEmpty(interceptors)) + return new ArrayList(0); + + List interceptorList = new ArrayList(); + + String[] interceptorArr = Arrays.toStringArray(interceptors); + for (String interceptor : interceptorArr) + { + Interceptor ic = getInterceptor(interceptor); + if (ic != null) + interceptorList.add(ic); + } + + return interceptorList; + } + + @Override + public HttpWebsocketManager getWebsocketManager() + { + return websocketManager; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlContextConstants.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlContextConstants.java new file mode 100644 index 0000000..6d02ad3 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlContextConstants.java @@ -0,0 +1,178 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context; + +import org.zhiqim.httpd.HttpdConstants; +import org.zhiqim.httpd.context.extend.EmptyAction; + +/** + * 定义上下文常量 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface ZmlContextConstants extends HttpdConstants +{ + /********************************************************************************/ + //第一部分,ZML参数配置定义服务配置定义expires + /********************************************************************************/ + + public static final String _ZML_PATH_EXACTPRIOR_ = "pathExactPrior"; + + public static final String _ZML_COOKIE_USE_ = "cookie.use"; + public static final String _ZML_COOKIE_DOMAIN_ = "cookie.domain"; + public static final String _ZML_COOKIE_PORT_ = "cookie.port"; + public static final String _ZML_COOKIE_PATH_ = "cookie.path"; + + public static final String _ZML_SESSION_MANAGER_ = "session.manager"; + public static final String _ZML_SESSION_TIMEOUT_ = "session.timeout"; + public static final String _ZML_SESSION_ID_NAME_ = "session.idName"; + public static final String _ZML_SESSION_PARAMETER_ = "session.parameter"; + + public static final String _ZML_PATTERN_ = "zml.pattern"; + public static final String _ZML_MAX_KEEP_TIME_ = "zml.maxKeepTime"; + public static final String _ZML_MAX_IDLE_TIME_ = "zml.maxIdleTime"; + + public static final String _ZML_PATTERN_DEFAULT_ = "*.zml,*.htm"; + + /********************************************************************************/ + //第二部分,ZML服务配置定义 zml + /********************************************************************************/ + + //服务提供定义的路径服务 + public static final String _PATH_SERVICE_ = "/service/*"; + public static final String _PATH_SERVICE_AJAX_ = "/service/ajax"; + public static final String _PATH_SERVICE_RMI_ = "/service/rmi"; + public static final String _PATH_SERVICE_UPLOAD_ = "/service/upload"; + public static final String _PATH_SERVICE_UPLOAD_ACCESS_ = "/service/upl/*"; + public static final String _PATH_SERVICE_VCODE_ = "/service/vcode.jpg"; + public static final String _PATH_SERVICE_RESOURCE_ = "/service/res/*"; + public static final String _PATH_SERVICE_RES_AVATAR_ = "/service/res/image/pic_avatar.jpg"; + + //服务前置 + public static final String _PATH_SERVICE_PREFIX_ = "/service/"; + public static final String _PATH_RESOURCE_PREFIX_ = "/service/res/"; + public static final String _PATH_UPLOAD_PREFIX_ = "/service/upl/"; + + //服务常用属性 + public static final String _SERV_AJAX_INTERCEPTOR_ = "ajax.interceptor"; + + public static final String _SERV_UPLOAD_FORWARD_ = "upload.foward"; + public static final String _SERV_UPLOAD_ACCESS_ = "upload.access"; + public static final String _SERV_UPLOAD_ROOT_DIR_ = "upload.rootDir"; + + public static final String _SERV_IP_WHITE_LIST_SUFFIX_ = ".ipWhiteList"; + public static final String _SERV_IP_BLACK_LIST_SUFFIX_ = ".ipBlackList"; + public static final String _SERV_IP_DEFAULT_PERMISSION_ = ".ipDefaultPermission"; + + public static final String _SERV_RESOURCE_CLASSPATH_ = "/org/zhiqim/httpd/context/service/resource/"; + + /********************************************************************************/ + //第三部分,ZML上下文环境常量定义 + /********************************************************************************/ + + /** ZC 目录和服务 */ + public static final String ZC_CONF_FOLDER = "/conf/"; + public static final String ZC_CONF_CONFIG_XML = "/conf/config.xml"; + public static final String ZC_CONF_CONFIG_ZML = "/conf/config.zml"; + public static final String ZC_FILTER_CONF_FILE = "/conf/*"; + public static final String ZC_FILTER_ZVIEW_FILE = "/zview/*"; + public static final String ZC_FILTER_ZTMPL_HTM = "/ztmpl/*.htm"; + public static final String ZC_FILTER_ZTMPL_ZML = "/ztmpl/*.zml"; + public static final String ZC_RES_ZTMPT_FILE = "/ztmpl/*"; + public static final String ZC_RES_ZRES_FILE = "/zres/*"; + + public static final String ZC_MATCH_PREFIX = "_match_"; + public static final String ZC_VCODE_SESSION_NAME = "_vcode_"; + public static final String ZC_EMPTY_ACTION_NAME = EmptyAction.class.getName(); + + /** ZC 属性名多组件内多个 */ + public static final String ZC_WEBSOCKET = "websocket"; + public static final String ZC_BOOTSTRAP = "bootstrap"; + public static final String ZC_ACTION_PACKAGE = "actionPackage"; + + /** ZC 属性名组件依次重写 */ + public static final String ZC_ZHIQIM_CSS = "zhiqim.css"; + public static final String ZC_ZHIQIM_JS = "zhiqim.js"; + + public static final String ZC_ZHIQIM_MOBILE_CSS = "zhiqim.mobile.css"; + public static final String ZC_ZHIQIM_MOBILE_JS = "zhiqim.mobile.js"; + + /********************************************************************************/ + //第四部分,ZML上下文配置文件常量定义 + /********************************************************************************/ + + /** ZC DTD/XML格式 */ + public static final String ZC_VERSION = "V1.5.0"; + public static final String ZC_DTD_PUBLIC_ID = "-//ZHIQIM //DTD Zhiqim-Context Configuration 1.5.0//EN"; + public static final String ZC_DTD_PATH = "/org/zhiqim/httpd/context/config/zhiqim_context_1_5_0.dtd"; + public static final String ZC_DTD_URL = "http://zhiqim.org/xmldtds/zhiqim_context_1_5_0.dtd"; + + public static final String ZC_XML_DOCTYPE = ""; + + public static final String ZC_XML_HEAD = ""; + public static final String ZC_XML_TAIL = ""; + + /** ZC 核心定义,包括组件、子环境、宏定义、属性、拦截器和执行器 */ + public static final String ZC_COMPONENT = "component"; + public static final String ZC_CONFIG = "config"; + public static final String ZC_ATTRIBUTE = "attribute"; + public static final String ZC_INTERCEPTOR = "interceptor"; + public static final String ZC_SESSION_USER = "sessionUser"; + public static final String ZC_ACTION = "action"; + + /** ZC 字段名 */ + public static final String ZC_NAME = _NAME_; + public static final String ZC_TYPE = _TYPE_; + public static final String ZC_KEY = _KEY_; + public static final String ZC_VALUE = _VALUE_; + public static final String ZC_CLASS = _CLASS_; + public static final String ZC_PATH = "path"; + public static final String ZC_FORWARD = "forward"; + public static final String ZC_REDIRECT = "redirect"; + public static final String ZC_VIEW = "view"; + public static final String ZC_INCLUDE = "include"; + public static final String ZC_METHOD = "method"; + public static final String ZC_SUCCESS = "success"; + public static final String ZC_TIPS = "tips"; + + /********************************************************************************/ + //第五部分,响应常量定义 + /********************************************************************************/ + + public static final String _PATH_RETURN_RESULT_ = "/conf/return/returnResult.zml"; + public static final String _PATH_RETURN_FRAME_ = "/conf/return/returnFrame.zml"; + + /********************************************************************************/ + //第六部分,Service/Action等常量定义 + /********************************************************************************/ + + /** ZC Action常用的配置 */ + public static final String EXEC = "exec"; + public static final String LIST = "list"; + public static final int INT_LIST = 3322014; //"list".hashCode(); + public static final int INT_ITEM = 3242771; //"item".hashCode(); + public static final int INT_ADD = 96417; //"add".hashCode(); + public static final int INT_MODIFY = -1068795718; //"modify".hashCode(); + public static final int INT_INSERT = -1183792455; //"insert".hashCode(); + public static final int INT_UPDATE = -838846263; //"update".hashCode(); + public static final int INT_DELETE = -1335458389; //"delete".hashCode(); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlContexts.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlContexts.java new file mode 100644 index 0000000..8fe3146 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlContexts.java @@ -0,0 +1,375 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map.Entry; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Htmls; +import org.zhiqim.zml.Zml; +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.zml.Zmls; + +/** + * 对HttpRequest进行一级封装,实现相关的数据提取工具类,分隔HttpRequest代码 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("ZmlContexts") +public class ZmlContexts implements ZmlContextConstants +{ + private static final Log log = LogFactory.getLog(ZmlContexts.class); + + /******************************************************************/ + //以下为获取ZML引擎和ZML的方法 + /******************************************************************/ + + /** + * 获取当前请求对应的ZML引擎 + * + * @param context 上下文环境 + * @return ZmlEngine 返回ZML引擎 + */ + public static ZmlEngine getZmlEngine(HttpContext context) + { + return ((Context)context).getZmlEngine(); + } + + /** + * 获取当前请求对应的ZML引擎 + * + * @param request 请求 + * @return ZmlEngine 返回ZML引擎 + */ + public static ZmlEngine getZmlEngine(HttpRequest request) + { + return getZmlEngine(request.getContext()); + } + + /** + * 获取当前请求对应的ZML引擎中的ZML + * + * @param context 上下文环境 + * @param zmlPath ZML路径 + * @return Zml 返回ZML对象 + */ + public static Zml getZml(HttpContext context, String zmlPath) throws IOException + { + ZmlEngine engine = getZmlEngine(context); + if (engine == null) + return null; + + return engine.getZml(zmlPath); + } + + /** + * 获取当前请求对应的ZML引擎中的ZML + * + * @param request 请求 + * @param zmlPath ZML路径 + * @return Zml 返回ZML对象 + */ + public static Zml getZml(HttpRequest request, String zmlPath) throws IOException + { + ZmlEngine engine = getZmlEngine(request); + if (engine == null) + return null; + + return engine.getZml(zmlPath); + } + + /******************************************************************/ + //在Request下解释ZML内容 + /******************************************************************/ + + /** + * 解析ZML和[KEY/VALUE]得到内容 + * + * @param request 请求 + * @param zmlPath ZML路径 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZmlPath(HttpRequest request, String zmlPath) throws Exception + { + ZmlEngine engine = getZmlEngine(request); + if (engine == null) + return null; + + Zml zml = engine.getZml(zmlPath); + return parseZml(request, zml); + } + + /** + * 解析ZML和[KEY/VALUE]得到内容 + * + * @param request 请求 + * @param zmlPath ZML路径 + * @param key 属性键 + * @param value 属性值 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZmlPath(HttpRequest request, String zmlPath, String key, Object value) throws Exception + { + return parseZmlPath(request, zmlPath, new HashMapSO(key, value)); + } + + /** + * 解析ZML和属性表得到内容 + * + * @param request 请求 + * @param zmlPath ZML路径 + * @param variableMap 变量表 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZmlPath(HttpRequest request, String zmlPath, MapSO variableMap) throws Exception + { + ZmlEngine engine = getZmlEngine(request); + if (engine == null) + return null; + + Zml zml = engine.getZml(zmlPath); + return parseZml(request, zml, variableMap); + } + + /** + * 解析ZML内容和单一属性得到解析之后的内容 + * + * @param request 请求 + * @param content 指定ZML的内容 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZmlContent(HttpRequest request, String content) throws Exception + { + ZmlEngine engine = getZmlEngine(request); + Zml zml = new Zml(engine, content); + + return parseZml(request, zml); + } + + + /** + * 解析ZML内容和单一属性得到解析之后的内容 + * + * @param request 请求 + * @param content 指定ZML的内容 + * @param key 变量KEY + * @param value 变量VALUE + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZmlContent(HttpRequest request, String content, String key, Object value) throws Exception + { + ZmlEngine engine = getZmlEngine(request); + Zml zml = new Zml(engine, content); + + return parseZml(request, zml, new HashMapSO(key, value)); + } + + /** + * 解析ZML内容和属性表得到解析之后的内容 + * + * @param request 请求 + * @param content 指定ZML的内容 + * @param variableMap 变量表 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZmlContent(HttpRequest request, String content, MapSO variableMap) throws Exception + { + ZmlEngine engine = getZmlEngine(request); + Zml zml = new Zml(engine, content); + + return parseZml(request, zml, variableMap); + } + + + /** + * 解析ZML和属性表得到解析之后的内容,提供请求和响应作为变量条件 + * + * @param request 请求 + * @param zml ZML对象 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZml(HttpRequest request, Zml zml) throws Exception + { + return parseZml(request, zml, null); + } + + /** + * 解析ZML和属性表得到解析之后的内容,提供请求和响应作为变量条件 + * + * @param request 请求 + * @param zml ZML对象 + * @param key 变量KEY + * @param value 变量VALUE + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZml(HttpRequest request, Zml zml, String key, Object value) throws Exception + { + return parseZml(request, zml, new HashMapSO(key, value)); + } + + /** + * 解析ZML和属性表得到解析之后的内容,提供请求和响应作为变量条件 + * + * @param request 请求 + * @param zml ZML对象 + * @param variableMap 变量表 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZml(HttpRequest request, Zml zml, MapSO variableMap) throws Exception + { + //页面环境变量表,包括请求中参数和属性 + HashMapSO pageVariableMap = new HashMapSO(); + //1.先放参数,注意来自参数的数据由外部决定,这里要对其安全过滤 + HashMap paramMap = request.getParameterMap(); + if (!paramMap.isEmpty()) + { + for (Entry entry : paramMap.entrySet()) + { + String key = entry.getKey(); + String value = Htmls.filterAll(entry.getValue()); + pageVariableMap.put(key, value); + } + } + + //2.再放属性,这里的数据来自Action本身,明确,不作过滤,和参数名相同时覆盖 + pageVariableMap.putAll(request.getAttributeMap()); + + //3.自定义变量 + if (variableMap != null) + pageVariableMap.putAll(variableMap); + + //请求环境变量表,包括请求、响应、会话和上下文环境等固定值 + //1.放置Session对应的三个数据 + if (request.getSession() != null) + { + pageVariableMap.put("sessionId", request.getSessionId()); + pageVariableMap.put("sessionUser", request.getSessionUser()); + pageVariableMap.put("sessionName", request.getSessionName()); + } + + //2.放置范围域 + pageVariableMap.put("request", request); + pageVariableMap.put("response", request.getResponse()); + pageVariableMap.put("session", request.getSession()); + pageVariableMap.put("context", request.getContext()); + pageVariableMap.put("log", log); + + //2.上下文环境变量表两个,1)/conf/httpd.xml配置的,2)/resource/conf/context.zml,3)/resource/conf/context.xml配置的 + Context context = (Context)request.getContext(); + ZmlConfig config = context.getConfig(); + + return Zmls.parse(zml, pageVariableMap, config); + } + + /******************************************************************************************************************************/ + //在Context下解析ZML内容 + /******************************************************************************************************************************/ + + /** + * 解析ZML内容和单一属性得到解析之后的内容 + * + * @param context 上下文环境 + * @param content 指定ZML的内容 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZmlContent(HttpContext context, String content) throws Exception + { + ZmlEngine engine = getZmlEngine(context); + Zml zml = new Zml(engine, content); + + return parseZml(context, zml, null); + } + + /** + * 解析ZML内容和单一属性得到解析之后的内容 + * + * @param context 上下文环境 + * @param content 指定ZML的内容 + * @param key 变量KEY + * @param value 变量VALUE + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZmlContent(HttpContext context, String content, String key, Object value) throws Exception + { + ZmlEngine engine = getZmlEngine(context); + Zml zml = new Zml(engine, content); + + return parseZml(context, zml, new HashMapSO(key, value)); + } + + /** + * 解析ZML内容和属性表得到解析之后的内容 + * + * @param context 上下文环境 + * @param content 指定ZML的内容 + * @param variableMap 变量表 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZmlContent(HttpContext context, String content, MapSO variableMap) throws Exception + { + ZmlEngine engine = getZmlEngine(context); + Zml zml = new Zml(engine, content); + + return parseZml(context, zml, variableMap); + } + + /** + * 解析ZML和属性表得到解析之后的内容,提供请求和响应作为变量条件 + * + * @param context 上下文环境 + * @param zml ZML对象 + * @param variableMap 变量表 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseZml(HttpContext context, Zml zml, MapSO variableMap) throws Exception + { + //页面环境变量表,包括请求中参数和属性 + HashMapSO pageVariableMap = new HashMapSO(); + if (variableMap != null) + pageVariableMap.putAll(variableMap); + + ZmlConfig config = ((Context)context).getConfig(); + return Zmls.parse(zml, pageVariableMap, config); + } +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlException.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlException.java new file mode 100644 index 0000000..a8e25e0 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlException.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context; + +/** + * 定制的上下文级异常,处理Action/Interceptor内的异常 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZmlException extends Exception +{ + private static final long serialVersionUID = 1L; + + public ZmlException(String message) + { + super(message); + } + + public ZmlException(String message, Throwable e) + { + super(message, e); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlExecutor.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlExecutor.java new file mode 100644 index 0000000..ebfac07 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlExecutor.java @@ -0,0 +1,398 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context; + +import java.io.IOException; +import java.lang.reflect.Method; +import java.net.SocketException; +import java.rmi.RemoteException; +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.httpd.HttpException; +import org.zhiqim.httpd.HttpExecutor; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.config.ZAction; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.httpd.context.core.Interceptor; +import org.zhiqim.httpd.context.extend.DispatchAction; +import org.zhiqim.httpd.context.extend.GetPostAction; +import org.zhiqim.httpd.context.extend.StdDispatchAction; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.context.extend.ValidateAction; +import org.zhiqim.httpd.context.extend.ViewExecAction; +import org.zhiqim.httpd.context.returns.ReturnResult; +import org.zhiqim.httpd.context.returns.ReturnView; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.zml.ZmlLoader; + +/** + * Action处理器 + * 1.除*.zml和系统的/service/ajax等之外的path都在该处理器 + * 2.支持配置Action,实现MVC模式优先Action的操作 + * 3.支持配置通配符访问Action和对应的方法的配置,如 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZmlExecutor implements HttpExecutor, ZmlContextConstants +{ + private List patternList; + private ReturnView returnView; + private ReturnResult returnResult; + + public ZmlExecutor(String patterns) + { + this.patternList = Lists.toStringList(patterns); + + this.returnView = new ReturnView(); + this.returnResult = new ReturnResult(); + } + + /**********************************************************************************************/ + //implement HttpHandler & HttpExecutor + /**********************************************************************************************/ + + @Override + public boolean isMatch(String pathInContext) + {//默认全匹配,在handle中处理未匹配的 + return true; + } + + @Override + public void handle(HttpRequest request, HttpResponse response) throws HttpException, IOException + { + Context context = (Context)request.getContext(); + String path = request.getPathInContext(); + + ZAction zAction = context.getAction(path); + if (zAction != null) + {//匹配到Action,查出Action处理 + handleAction(request, response, zAction); + } + else if (isMatchPattern(path)) + {//匹配到ZML文件,则访问ZML文件 + handleZML(request, response); + } + else + {//未找到配置,回调资源处理器 + context.handleResource(request, response); + } + } + + private boolean isMatchPattern(String pathInContext) + {//判断是否配置模式 + for (String pattern : patternList) + { + if (Validates.isMatch(pathInContext, pattern)) + return true; + } + return false; + } + + /**********************************************************************************************/ + //handleZML & handleAction + /**********************************************************************************************/ + + /** 处理ZML文件 */ + private void handleZML(HttpRequest request, HttpResponse response) throws HttpException, IOException + { + Context context = (Context)request.getContext(); + String path = request.getPathInContext(); + ZmlEngine engine = context.getZmlEngine(); + if (engine == null) + {//不支持ZML引擎 + context.getNotFoundHandler().handle(request, response); + return; + } + + ZmlLoader loader = engine.getZmlLoader(path); + if (loader == null) + {//不存在ZML文件 + context.getNotFoundHandler().handle(request, response); + return; + } + + if (request.isMethodHead()) + {//HEAD + response.sendHeader(_200_OK_); + return; + } + + //业务处理开始,初始化响应,包括指定UTF-8编码,和不缓存数据 + request.setResponseEncodingUTF8(); + request.setResponseNoCache(); + + //指定请求为视图地址并处理 + returnView.process(request, path, null); + + if (request.isResponseRedirect()) + {//后置检查视图中的<#interceptor>,可能的跳转 + returnResult.process(request); + } + } + + /** 处理Action */ + private void handleAction(HttpRequest request, HttpResponse response, ZAction zAction) throws HttpException, IOException + { + //上下文环境和引导类 + Context context = (Context)request.getContext(); + ZmlBootstrap bootstrap = context.getBootstrap(); + + //第二步,对HEAD方法请求,直接返回成功,表示该Path存在 + if (request.isMethodHead()) + { + bootstrap.log(request, "HEAD请求"); + response.sendHeader(_200_OK_); + return; + } + + //业务处理开始,初始化响应,包括指定UTF-8编码,和不缓存数据 + request.setResponseEncodingUTF8(); + request.setResponseNoCache(); + request.setAttribute(_HTTP_REQUEST_PARAM_MATCH_, zAction.getMatchList()); + + //第三步,找到对应的Action + Action action = context.getAction(zAction); + + //组装ActionForward + Throwable exception = null;String info = null;Transaction tx = null; + request.setResponseConfig(zAction.getView(), zAction.getInclude(), zAction.getForward(), zAction.getRedirect(), zAction.getMethod(), zAction.getSuccess()); + + try + { + request.setStepInterceptor(); + + //第四步,先处理Interceptor的process操作 + List interceptorList = context.getInterceptorList(zAction.getInterceptor()); + for (Interceptor interceptor : interceptorList) + { + if (interceptor == null) + {//拦截器不存在 + response.sendError(_621_INTERCEPTOR_NOT_EXIST_); + return; + } + + interceptor.intercept(request); + if (response.isCommitted()) + {//允许被拦截器提交终止 + info = "拦截器已提交"; + return; + } + + if (!request.isResponseSuccess()) + {//拦截器已拦截 + info = "拦截器已拦截"; + return; + } + } + + //第五步,再处理Action的execute操作 + tx = getTransaction(request, zAction, action); + + request.setStepAction(); + action.execute(request); + + if (tx != null) + {//有事务则提交,异常在捕捉中处理 + tx.commit(); + } + } + catch (ZmlException | SQLException | RemoteException | RuntimeException e) + {//在 Interceptor/Action execute的过程中遇到的错误和异常 + exception = e; + + //业务异常显示 + String message = Validates.isEmpty(e.getMessage())?e.getClass().getName():e.getMessage(); + request.returnHistory(message); + //request.setAlertMsg(message); TODO 是否不返回上一页? + + if (tx != null) + {//如果有事务则回滚 + try{tx.rollback();}catch (Exception ex){request.getLog().error("事务回滚异常", ex);} + } + } + catch (SocketException e) + {//在处理时浏览器端取消、停止或关闭浏览器 + exception = e; + + if (tx != null) + {//如果有事务则回滚 + try{tx.rollback();}catch (Exception ex){request.getLog().error("事务回滚异常", ex);} + } + } + catch (Throwable e) + {//错误等其他异常 + exception = e; + + // 未知异常都返回上一页 + String message = Validates.isEmpty(e.getMessage())?e.getClass().getName():e.getMessage(); + request.returnHistory(message); + + if (tx != null) + {//如果有事务则回滚 + try{tx.rollback();}catch (Exception ex){request.getLog().error("事务回滚异常", ex);} + } + } + finally + { + if (tx != null) + {//有事务则关闭 + try{tx.close();}catch (Exception ex){request.getLog().error("事务关闭异常", ex);} + } + + if (exception instanceof SocketException) + {//SocketException不能回消息了 + bootstrap.log(request, "浏览器端取消、停止或已关闭"); + throw (SocketException)exception; + } + + if (response.isCommitted()) + {//已提交只打日志不再处理 + if (!request.hasForward())//重定向只打印一次日志 + bootstrap.log(request, info, exception); + return; + } + + if (request.isForceReturn()) + {//优先检查需要强制转向情况 + + String message = request.getAlertMsg(); + if (Validates.isNotEmpty(message)) + {//如果不为空,提示时增加成功和失败说明 + info = (request.isResponseSuccess()?"成功":"失败") + "信息:" + message; + } + + bootstrap.log(request, info, exception); + returnResult.process(request); + return; + } + + if (request.isReturn()) + {//再判断是否需要转向到页面 + + if (Validates.isNotEmpty(request.getForward(_UTF_8_))) + {//内部转向 + request.forwardTo(request.getForward(_UTF_8_)); + } + else if (Validates.isNotEmpty(request.getView())) + {//加载视图 + returnView.process(request); + + if (!request.isResponseSuccess()) + {//后置检查视图中的<#interceptor>,可能的跳转 + returnResult.process(request); + } + } + else + {//重定向,日志要先打 + if (request.isMethodPost()) + bootstrap.log(request, info, exception); + + String redirect = request.getRedirect(_UTF_8_); + response.sendRedirect(context.getRootPath(redirect)); + } + + return; + } + + bootstrap.log(request, info, exception); + } + } + + /**********************************************************************************************/ + //transaction + /**********************************************************************************************/ + + /** 通过配置和事务注释判断是否有事务 */ + private Transaction getTransaction(HttpRequest request, ZAction fAction, Action action) throws Exception + { + //1.优先判断是否配置transaction,=true表示所有 + if (Validates.isNotEmpty(fAction.getTransaction())) + { + String transaction = fAction.getTransaction(); + if (_TRUE_.equals(transaction)) + return TransactionManager.beginTransaction(); + else + return TransactionManager.beginTransaction(Arrays.toStringArray(transaction)); + } + + //2.其次判断方法里有没有配置事务注解 + String fMethod = fAction.getMethod(); + if (Validates.isEmpty(fMethod)) + {//取默认方法 + fMethod = getActionDefaultMethod(request, action); + } + + if (Validates.isNotEmpty(fAction.getMethod())) + { + Method method = Classes.getMethod(action.getClass(), fMethod, HttpRequest.class); + if (method != null) + { + AnTransaction anTx = method.getAnnotation(AnTransaction.class); + if (anTx != null) + return TransactionManager.beginTransaction(anTx.value()); + } + } + + //3.最后判断类有没有统一的配置事务注解 + AnTransaction anTx = action.getClass().getAnnotation(AnTransaction.class); + if (anTx != null) + {//1.类中有定义事务注解 + return TransactionManager.beginTransaction(anTx.value()); + } + + return null; + } + + /** 获取扩展Action */ + private String getActionDefaultMethod(HttpRequest request, Action action) + { + if (action instanceof ValidateAction) + return "perform"; + else if (action instanceof ViewExecAction) + return "view"; + else if (action instanceof StdSwitchAction) + return "list"; + else if (action instanceof StdDispatchAction || action instanceof DispatchAction) + return request.getParameter(ZC_METHOD); + else if (action instanceof GetPostAction) + { + if (request.isMethodGet()) + return "doGet"; + else if (request.isMethodPost()) + return "doPost"; + else + return null; + } + + return "execute"; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlWebsocketManager.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlWebsocketManager.java new file mode 100644 index 0000000..f904424 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/ZmlWebsocketManager.java @@ -0,0 +1,182 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpWebsocket; +import org.zhiqim.httpd.HttpWebsocketConnection; +import org.zhiqim.httpd.HttpWebsocketManager; +import org.zhiqim.kernel.extend.HashMapSV; +import org.zhiqim.kernel.schedule.Interval; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; + +/** + * ZML对Websocket的管理器 + * + * @version v1.0.0 @author Zouzhigang 2018-9-27 新建与整理 + */ +public class ZmlWebsocketManager implements HttpWebsocketManager, Task +{ + private final ZmlContext context; + private final List connList; + private final HashMapSV websocketMap; + private Interval interval; + + public ZmlWebsocketManager(ZmlContext context) + { + this.context = context; + this.connList = new ArrayList<>(); + this.websocketMap = new HashMapSV<>(); + } + + public void open() + {////定义29秒检查一次,保证最小1分钟清除即可,太频繁也不大合适 + this.interval = Interval.shedule(this, 29 * 1000); + } + + public void close() + { + if (this.interval != null) + { + this.interval.close(); + this.interval = null; + } + } + + public HttpContext getContext() + { + return context; + } + + @Override + public HttpWebsocket getWebsocket(String protocol) + { + if (Validates.isEmptyBlank(protocol)) + return null; + + if (websocketMap.containsKey(protocol)) + return websocketMap.get(protocol); + + HttpWebsocket websocket = context.getConfig().getWebsocket(protocol); + websocketMap.put(protocol, websocket); + return websocket; + } + + /** 未设置协议名的情况 */ + public List get(String protocol) + { + if (protocol == null) + return connList; + + List sList = new ArrayList<>(); + for (HttpWebsocketConnection conn : connList) + { + if (protocol.equals(conn.getProtocol())) + sList.add(conn); + } + + return sList; + } + + /** 指定协议名的情况 */ + public List get(String protocol, String sessionId) + { + if (sessionId == null) + return get(protocol); + + List sList = new ArrayList<>(); + if (protocol == null) + { + for (HttpWebsocketConnection conn : connList) + { + if (sessionId.equals(conn.getSessionId())) + sList.add(conn); + } + } + else + { + for (HttpWebsocketConnection conn : connList) + { + if (protocol.equals(conn.getProtocol()) && sessionId.equals(conn.getSessionId())) + sList.add(conn); + } + } + + return Lists.trim(sList); + } + + /*******************************************************************************/ + //增加 & 删除 + /*******************************************************************************/ + + /** 由HttpWebsocketService增加连接关联到会话 */ + public void add(HttpWebsocketConnection conn) + { + synchronized (connList) + { + connList.add(conn); + } + } + + /** 从连接中收到结束取消关联会话 */ + public void remove(HttpWebsocketConnection conn) + { + synchronized (connList) + { + connList.remove(conn); + } + } + + /*******************************************************************************/ + //定时检查 + /*******************************************************************************/ + + @Override + public void execute() + { + //1.查出需要关闭的连接 + List closes = new ArrayList<>(); + for (HttpWebsocketConnection conn : connList) + { + if (!context.getSessionManager().hasSession(conn.getSessionId())) + {//用户超时,则关闭连接 + closes.add(conn); + } + else if (!conn.sendPing()) + {//发送PING失败,异常连接关闭 + closes.add(conn); + } + } + + //2.逐个关闭连接 + for (HttpWebsocketConnection conn : closes) + { + conn.close(); + } + closes.clear(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/annotation/AnAction.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/annotation/AnAction.java new file mode 100644 index 0000000..35ed6de --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/annotation/AnAction.java @@ -0,0 +1,93 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Action注解定义,所有Action注解需在指定的package下,便于加载时缩小范围和组件之间不冲突 + * + * 1.可以在类上定义,表示该类是一个Action,那么该类必须是Action的子类,实现了execute方法 + * 2.可以在类的方法上定义,表示该类的方法是一个Action,那么该类方法必须实现和execute一样的参数 + * 3.拦截器另外使用 @see @AnInterceptor 注解 + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * @version v1.0.0 @author zouzhigang 2016-7-14 新建与整理 + */ +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface AnAction +{ + /*************************************************************************************/ + //name & path 必须 + /*************************************************************************************/ + + /** 名称 */ + String name(); + + /** 访问路径 */ + String path(); + + /*************************************************************************************/ + //view & forward & redirect 三都只选其一 + /*************************************************************************************/ + + /** 内部转向视图 */ + String view() default ""; + + /** 内部转向视图包括地址,多个用逗号隔开 */ + String include() default ""; + + /** 内部转向新的地址 */ + String forward() default ""; + + /** 外部重定向 */ + String redirect() default ""; + + /*************************************************************************************/ + //表示操作完成后的成功提示,为空表示不提示,一般用于执行页,如增加成功等 + /*************************************************************************************/ + + /** 操作确认提示 */ + String success() default ""; + + /** 操作冒泡提示 */ + String tips() default ""; + + /** 会话用户类 */ + String sessionUser() default ""; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/annotation/AnIntercept.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/annotation/AnIntercept.java new file mode 100644 index 0000000..03878b6 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/annotation/AnIntercept.java @@ -0,0 +1,43 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * 拦截器注解定义 + * + * 1.可以在类上定义,表示该类所有的方法执行时都检查拦截器 + * 2.可以在类的方法上定义,表示除类上的拦截器外,方法还有自己的拦截器也要检查 + * 3.@see @AnInterceptNot 表示在类上的拦截器上,要排除定义的拦截器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface AnIntercept +{ + /** 拦截器名称数组 */ + String[] value(); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/annotation/AnInterceptNot.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/annotation/AnInterceptNot.java new file mode 100644 index 0000000..b984442 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/annotation/AnInterceptNot.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 拦截器例外注解定义 + * + * 只在类的方法上定义,表示对类上的拦截器@see @AnIntercept 进行例外处理,即排除定义的例外拦截器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface AnInterceptNot +{ + /** 拦截器名称数组 */ + String[] value(); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZAction.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZAction.java new file mode 100644 index 0000000..1feb6d6 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZAction.java @@ -0,0 +1,263 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.config; + +import java.util.List; + +import org.zhiqim.httpd.context.ZmlContextConstants; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.httpd.context.core.Interceptor; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; + +/** + * Action配置类,支持四种格式

            + * + * 1、纯Action,表示访问path时,由Action返回内容,不加载view,也不重定向 + * 2、纯视图Action,表示访问path时使用默认Action[org.zhiqim.foxcontent.extend.EmptyAction]加载view返回响应
            + * 3、模型Action, + * 4、重定向Action, + * + * @see Action 对应的一个Action + * @see Interceptor Action支持设置拦截器,如 + * + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZAction implements ZmlContextConstants +{ + private ZConfig config; + + private String name; //模型名 + private String path; //PATH名称 + + private String interceptor; //请求的拦截器数组 + private String transaction; //请求的事务 + + private String forward; //内部转发新的地址 + private String redirect; //重定向新的地址 + private String view; //加载视图地址 + private String include; //加载视图内部包含的地址 + + private String clazz; //Action子类 + private String method; //使用StdAction的方法 + private String success; //转向页定制的对话框提示信息 + private String tips; //转向页定制的冒泡提示信息 + + private transient List matchList; //匹配的参数列表,临时属性,当/*/*.htm有效 + + public String toString() + { + StringBuilder strb = new StringBuilder("").toString(); + } + + /** 获取类名,如果为空则取EmptyAction */ + public String getClassName() + { + return clazz == null?ZC_EMPTY_ACTION_NAME:clazz; + } + + /***************************************************************/ + //设置属性,统一对字段进行trim + /***************************************************************/ + + public void setConfig(ZConfig config) + { + this.config = config; + } + + public void setName(String name) + { + this.name = name; + } + + public ZAction setPath(String path) + { + this.path = Strings.trim(path); + return this; + } + + public void setInterceptor(String interceptor) + { + this.interceptor = Strings.trim(interceptor); + } + + public void setTransaction(String transaction) + { + this.transaction = transaction; + } + + public void setView(String view) + { + this.view = Strings.trim(view); + } + + public void setInclude(String include) + { + this.include = Strings.trim(include); + } + + public void setForward(String forward) + { + this.forward = Strings.trim(forward); + } + + public void setRedirect(String redirect) + { + this.redirect = Strings.trim(redirect); + } + + public void setClazz(String clazz) + { + this.clazz = Strings.trim(clazz); + } + + public void setMethod(String method) + { + this.method = Strings.trim(method); + } + + public void setSuccess(String success) + { + this.success = Strings.trim(success); + } + + public void setTips(String tips) + { + this.tips = Strings.trim(tips); + } + + public ZAction setMatchList(List matchList) + { + this.matchList = matchList; + return this; + } + + /***************************************************************/ + //获取属性 + /***************************************************************/ + + public ZConfig getConfig() + { + return config; + } + + public String getName() + { + return name; + } + + public String getPath() + { + return path; + } + + public String getInterceptor() + { + return interceptor; + } + + public String getTransaction() + { + return transaction; + } + + public String getView() + { + return view; + } + + public String getInclude() + { + return include; + } + + public String getForward() + { + return forward; + } + + public String getRedirect() + { + return redirect; + } + + public String getClazz() + { + return clazz; + } + + public String getMethod() + { + return method; + } + + public String getSuccess() + { + return success; + } + + public String getTips() + { + return tips; + } + + public List getMatchList() + { + return matchList; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZActionMap.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZActionMap.java new file mode 100644 index 0000000..3068f62 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZActionMap.java @@ -0,0 +1,290 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.config; + +import java.util.Collection; +import java.util.List; + +import org.zhiqim.httpd.context.ZmlConfig; +import org.zhiqim.httpd.context.ZmlContextConstants; +import org.zhiqim.kernel.annotation.AnNullable; +import org.zhiqim.kernel.extend.LinkedMapSV; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.kernel.util.Replaces; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.Zmls; + +/** + * ZAction表,目标是把精确匹配和模糊匹配区分开来 + * 1. exactMap 精确匹配表 + * 2. fuzzyMap 模糊匹配表 + * + * @version v1.0.0 @author zhichenggang 2016-12-31 新建与整理 + */ +public class ZActionMap implements ZmlContextConstants +{ + private final ZmlConfig zmlConfig; + private final ZConfig config; + + private LinkedMapSV exactMap = new LinkedMapSV<>(); + private LinkedMapSV fuzzyMap = new LinkedMapSV<>(); + + public ZActionMap(ZmlConfig zmlConfig, ZConfig config) + { + this.zmlConfig = zmlConfig; + this.config = config; + } + + /**********************************************************************/ + //list & add & toString + /**********************************************************************/ + + /** 获取精确表 */ + public Collection getExactActionList() + { + return exactMap.values(); + } + + /** 获取模糊表 */ + public Collection getFuzzyActionList() + { + return fuzzyMap.values(); + } + + /** + * 添加一个ZAction + * + * @param path 路径,精确或模糊pattern + * @param action ZAction类 + */ + public void addAction(ZAction action) + { + action.setConfig(config); + String path = action.getPath(); + if (path.indexOf("*") == -1) + exactMap.put(path, action); + else + fuzzyMap.put(path, action); + } + + /** 删除一个ZAction */ + public void removeAction(String path) + { + exactMap.remove(path); + fuzzyMap.remove(path); + } + + /** 检查变量名 */ + public void chkVariable() + { + LinkedMapSV newExactMap = new LinkedMapSV<>(); + for (ZAction zAction : exactMap.values()) + { + ZAction newAction = chkVariable(zAction); + newExactMap.put(newAction.getPath(), newAction); + } + + exactMap.clear(); + exactMap = newExactMap; + + LinkedMapSV newFuzzyMap = new LinkedMapSV<>(); + for (ZAction zAction : fuzzyMap.values()) + { + ZAction newAction = chkVariable(zAction); + newFuzzyMap.put(newAction.getPath(), newAction); + } + + fuzzyMap.clear(); + fuzzyMap = newFuzzyMap; + } + + /** 检查变量名 */ + private ZAction chkVariable(ZAction zAction) + { + String path = zAction.getPath(); + if (path.contains("${") || path.contains("<#")) + { + try + { + zAction.setPath(Zmls.parseContext(path, zmlConfig)); + } + catch (Exception e) + { + throw Asserts.exception("action配置[%s],path变量解析失败", path); + } + } + + String redirect = zAction.getRedirect(); + if (Validates.isNotEmpty(redirect) && path.contains("${") || path.contains("<#")) + { + try + { + zAction.setRedirect(Zmls.parseContext(redirect, zmlConfig)); + } + catch (Exception e) + { + throw Asserts.exception("action配置[%s],redirect变量解析失败", path); + } + } + + String forward = zAction.getForward(); + if (Validates.isNotEmpty(forward) && path.contains("${") || path.contains("<#")) + { + try + { + zAction.setForward(Zmls.parseContext(forward, zmlConfig)); + } + catch (Exception e) + { + throw Asserts.exception("action配置[%s],forward变量解析失败", path); + } + } + + return zAction; + } + + /** toString */ + public String toString() + { + StringBuilder strb = new StringBuilder(); + for (ZAction action : fuzzyMap.values()) + { + strb.append(_FOUR_).append(action.toString()).append(_BR_); + } + for (ZAction action : exactMap.values()) + { + strb.append(_FOUR_).append(action.toString()).append(_BR_); + } + + return strb.toString(); + } + + /**********************************************************************/ + //通过类名方式 + /**********************************************************************/ + + /** + * 获取精确匹配的ZAction的path + * + * @param clazz 传入的类名 + * @return path + */ + @AnNullable + public ZAction getExactActionByClass(String clazz) + { + if (clazz == null) + return null; + + for (ZAction action : exactMap.values()) + { + if (clazz.equals(action.getClazz())) + return action; + } + + return null; + } + + /** + * 获取模糊匹配的ZAction的path + * + * @param clazz 传入的类名 + * @return path + */ + @AnNullable + public ZAction getFuzzyActionByClass(String clazz) + { + if (clazz == null) + return null; + + for (ZAction action : fuzzyMap.values()) + { + if (clazz.equals(action.getClazz())) + return action; + } + + return null; + } + + /**********************************************************************/ + //通过 path 获取 ZAction + /**********************************************************************/ + + /** + * 获取精确匹配的ZAction + * + * @param path 传入的上下文环境下的路径 + * @return ZAction + */ + @AnNullable + public ZAction getExactAction(String path) + { + return exactMap.get(path); + } + + /** + * 获取模糊匹配的ZAction + * + * @param path 传入的上下文环境下的路径 + * @return ZAction + */ + @AnNullable + public ZAction getFuzzyAction(String path) + { + for (String p : fuzzyMap.keySet()) + { + List matchList = Lists.getMatchList(path, p); + if (matchList == null) + continue; + + return getActionMatchParam(p, fuzzyMap.get(p), path, matchList); + } + + return null; + } + + /** 获取含通匹符的Action */ + private ZAction getActionMatchParam(String path, ZAction action, String pathInContext, List paramList) + { + //生成新的Action配置 + ZAction newAction = Objects.copy(action, new ZAction()); + newAction.setPath(pathInContext);//重置path为新的pathInContext + + for (int i=0;i. + */ +package org.zhiqim.httpd.context.config; + +import org.zhiqim.httpd.context.ZmlConfig; +import org.zhiqim.httpd.context.ZmlContextConstants; + +import org.zhiqim.kernel.control.Filter; +import org.zhiqim.kernel.control.FilterEndsWith; +import org.zhiqim.kernel.control.FilterHandler; +import org.zhiqim.kernel.util.Resources; + +/** + * ActionPackage配置 + * + * @version v1.0.0 @author zhichenggang 2016-12-31 新建与整理 + */ +public class ZActionPackage implements ZmlContextConstants +{ + private final ZmlConfig zmlConfig; + + private final String actionPackage; + private final ZActionMap actionMap; + + public ZActionPackage(ZmlConfig zmlConfig, ZConfig config, String actionPackage) + { + this.zmlConfig = zmlConfig; + this.actionPackage = actionPackage; + this.actionMap = new ZActionMap(zmlConfig, config); + } + + public void load() + { + Filter filter = new FilterEndsWith().param(".class"); + FilterHandler handler = new ZActionPackageLoader(this); + //扫描全路径 + Resources.scanClassPath(filter, handler); + } + + public String getActionPackage() + { + return actionPackage; + } + + public void addActionOnPackage(ZAction action) + { + actionMap.addAction(action); + } + + public ZmlConfig getConfig() + { + return zmlConfig; + } + + /*****************************************************************************/ + //通过path 获取 ZAction + /*****************************************************************************/ + + public ZAction getInTurnAction(String path) + { + //先查本文件精确再查模糊匹配 + ZAction action = actionMap.getExactAction(path); + if (action != null) + return action; + + return actionMap.getFuzzyAction(path); + } + + public ZAction getExactAction(String path) + { + return actionMap.getExactAction(path); + } + + public ZAction getFuzzyAction(String path) + { + return actionMap.getFuzzyAction(path); + } + + /*****************************************************************************/ + //通过class 获取 ZAction + /*****************************************************************************/ + + public ZAction getInTurnActionByClass(String clazz) + { + //先查本文件精确再查模糊匹配 + ZAction action = actionMap.getExactActionByClass(clazz); + if (action != null) + return action; + + return actionMap.getFuzzyActionByClass(clazz); + } + + public ZAction getExactActionByClass(String clazz) + { + return actionMap.getExactActionByClass(clazz); + } + + public ZAction getFuzzyActionByClass(String clazz) + { + return actionMap.getFuzzyActionByClass(clazz); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZActionPackageLoader.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZActionPackageLoader.java new file mode 100644 index 0000000..59d9f33 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZActionPackageLoader.java @@ -0,0 +1,207 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.config; + +import java.io.File; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.jar.JarEntry; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnAction; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.context.annotation.AnInterceptNot; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.httpd.context.extend.SwitchAction; + +import org.zhiqim.kernel.control.FilterHandler; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Jars; +import org.zhiqim.kernel.util.Lists; + +/** + * Action类加载器,加载配置了@AnAction配置的数据 + * 1.要求类是在包内 + * 2.要求类实现了Action接口 + * 3.如果是SwitchAction子类检查方法上的@AnAction和@AnInterceptor + * 4.否则只检查类上的@AnAction和@AnInterceptor + * + * @version v1.0.0 @author zouzhigang 2016-7-16 新建与整理 + */ +public class ZActionPackageLoader implements FilterHandler +{ + private static final Log log = LogFactory.getLog(ZActionPackageLoader.class); + + private ZActionPackage actionPackage; + + public ZActionPackageLoader(ZActionPackage wapper) + { + this.actionPackage = wapper; + } + + @Override + public boolean handle(Object obj) throws Exception + { + Object[] objs = (Object[])obj; + String className = null; + if (objs[0] instanceof File) + { + File classPath = (File)objs[0]; + File classFile = (File)objs[1]; + className = Files.getClassName(classPath, classFile); + } + else + { + JarEntry jarEntry = (JarEntry)objs[1]; + className = Jars.getClassName(jarEntry); + } + + if (className == null || !className.startsWith(actionPackage.getActionPackage())) + return true; + + Class clazz = Classes.forName(className); + if (!Classes.isImplement(clazz, Action.class)) + { + log.error("类[%s]未实现Action接口", className); + return false; + } + + Action actioner = (Action)Classes.newInstance(clazz); + if (actioner instanceof SwitchAction) + {//支持方法中注解@AnAction + AnIntercept classInterceptor = clazz.getAnnotation(AnIntercept.class); + + Method[] methods = clazz.getDeclaredMethods(); + for (Method method : methods) + { + AnAction anAction = method.getAnnotation(AnAction.class); + if (anAction == null) + continue; + + Class[] params = method.getParameterTypes(); + if (params.length != 1) + { + log.error("类[%s]方法[%s]参数个数不正确", className, method.getName()); + return false; + } + + if (params[0] != HttpRequest.class) + { + log.error("类[%s]方法[%s]参数不是[HttpRequest]", className, method.getName()); + return false; + } + + AnIntercept methodInterceptor = clazz.getAnnotation(AnIntercept.class); + AnInterceptNot methodInterceptorNot = clazz.getAnnotation(AnInterceptNot.class); + String interceptor = getInterceptor(classInterceptor, methodInterceptor, methodInterceptorNot); + + actionPackage.getConfig().setActionOnPath(anAction.path(), actioner); + + ZAction action = new ZAction(); + action.setName(anAction.name()); + action.setPath(anAction.path()); + action.setInterceptor(interceptor); + action.setForward(anAction.forward()); + action.setRedirect(anAction.redirect()); + action.setView(anAction.view()); + action.setClazz(className); + action.setMethod(method.getName()); + action.setSuccess(anAction.success()); + + actionPackage.addActionOnPackage(action); + } + } + else + {//仅找类中注解@AnAction + AnAction anAction = clazz.getAnnotation(AnAction.class); + if (anAction == null) + return true; + + AnIntercept anInterceptor = clazz.getAnnotation(AnIntercept.class); + String interceptor = anInterceptor==null?"":Arrays.toFilterSameStr(anInterceptor.value()); + + actionPackage.getConfig().setActionOnPath(anAction.path(), actioner); + + ZAction action = new ZAction(); + action.setName(anAction.name()); + action.setPath(anAction.path()); + action.setInterceptor(interceptor); + action.setForward(anAction.forward()); + action.setRedirect(anAction.redirect()); + action.setView(anAction.view()); + action.setInclude(anAction.include()); + action.setClazz(className); + action.setMethod(null); + action.setSuccess(anAction.success()); + + actionPackage.addActionOnPackage(action); + } + + return true; + } + + /** + * 通过类拦截,方法拦截和方法拦截例外,获取拦截最后的字符串 + * + * @param classInterceptor 类拦截 + * @param methodInterceptor 方法拦截 + * @param methodInterceptorNot 方法拦截例外 + * @return + */ + public static String getInterceptor(AnIntercept classInterceptor, AnIntercept methodInterceptor, AnInterceptNot methodInterceptorNot) + { + List interceptorList = new ArrayList<>(); + if (classInterceptor != null) + { + String[] interceptors = classInterceptor.value(); + for (String interceptor : interceptors) + { + interceptorList.add(interceptor); + } + } + + if (methodInterceptor != null) + { + String[] interceptors = methodInterceptor.value(); + for (String interceptor : interceptors) + { + interceptorList.add(interceptor); + } + } + + if (methodInterceptorNot != null) + { + String[] interceptors = methodInterceptorNot.value(); + for (String interceptor : interceptors) + { + interceptorList.remove(interceptor); + } + } + + return Lists.toString(interceptorList, ","); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZAttribute.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZAttribute.java new file mode 100644 index 0000000..ed18b5b --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZAttribute.java @@ -0,0 +1,71 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.config; + +import org.zhiqim.kernel.constants.SignConstants; + +/** + * 属性配置类,格式如: + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZAttribute implements SignConstants +{ + private String name; + private String key; + private String value; + + public String toString() + { + return new StringBuilder("") + .toString(); + } + + public String getName() + { + return name; + } + public void setName(String name) + { + this.name = name; + } + public String getKey() + { + return key; + } + public void setKey(String key) + { + this.key = key; + } + public String getValue() + { + return value; + } + public void setValue(String value) + { + this.value = value; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZCResolver.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZCResolver.java new file mode 100644 index 0000000..c66cede --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZCResolver.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.config; + +import java.io.IOException; +import java.io.InputStream; + +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.zhiqim.httpd.context.ZmlContextConstants; + +import org.zhiqim.kernel.util.Resources; + +/** + * 实现DTD本地验证,这样则不要到zhiqim.org下载验证
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZCResolver implements EntityResolver, ZmlContextConstants +{ + private String path; + + public ZCResolver(String path) + { + this.path = path; + } + + @Override + public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException + { + if (!ZC_DTD_PUBLIC_ID.equals(publicId)) + {//版本不支持 + throw new SAXException("配置文件["+path+"]格式不正确,["+ZC_VERSION+"]仅支持["+ZC_DTD_PUBLIC_ID+"]格式"); + } + + InputStream stream = Resources.getResourceStream(ZCResolver.class, ZC_DTD_PATH); + return new InputSource(stream); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZComponent.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZComponent.java new file mode 100644 index 0000000..80ef207 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZComponent.java @@ -0,0 +1,62 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.config; + +import org.zhiqim.httpd.context.ZmlContextConstants; + +/** + * 组件配置类 + * + * + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZComponent implements ZmlContextConstants +{ + private String name; + private String path; + + public String toString() + { + return new StringBuilder("").toString(); + } + + public String getName() + { + return name; + } + public void setName(String name) + { + this.name = name; + } + public String getPath() + { + return path; + } + public void setPath(String path) + { + this.path = path; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZComponentWapper.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZComponentWapper.java new file mode 100644 index 0000000..00dac63 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZComponentWapper.java @@ -0,0 +1,228 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.config; + +import org.zhiqim.httpd.HttpWebsocket; +import org.zhiqim.httpd.context.ZmlBootstrap; +import org.zhiqim.httpd.context.ZmlConfig; +import org.zhiqim.httpd.context.ZmlContextConstants; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Validates; + +/** + * 组件上下文环境和ZML引擎管理 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZComponentWapper implements ZmlContextConstants +{ + private final ZComponent component; + + private final ZConfig config; + private final ZActionPackage actionPackage; + private HttpWebsocket websocket; + private ZmlBootstrap bootstrap; + + public ZComponentWapper(ZmlConfig zmlConfig, ZComponent component) + { + this.component = component; + this.config = new ZConfig(zmlConfig, false, _CLASSPATH_, component.getPath(), component.getName(), ZC_CONF_CONFIG_XML); + this.actionPackage = config.getActionPackage(zmlConfig); + } + + public void load() throws Exception + { + //加载context.xml + config.load(); + + if (actionPackage != null) + {//加载actionPackage + actionPackage.load(); + } + } + + public String getPath() + { + return this.component.getPath(); + } + + public HttpWebsocket getWebsocket() + { + if (websocket != null) + return websocket; + + String cls = config.getWebsocketClass(); + if (Validates.isEmptyBlank(cls)) + return null; + + Object instance = Classes.newInstance(cls.trim()); + Asserts.as((instance instanceof HttpWebsocket)?null:"组件["+component.getName()+"]配置的[websocket]不是HttpWebsocket实现类"); + websocket = (HttpWebsocket)instance; + return websocket; + } + + public ZmlBootstrap getBootstrap() + { + if (bootstrap != null) + return bootstrap; + + String cls = config.getBootstrapClass(); + if (Validates.isEmptyBlank(cls)) + return null; + + Object instance = Classes.newInstance(cls.trim()); + Asserts.as((instance instanceof ZmlBootstrap)?null:"组件["+component.getName()+"]配置的[bootstrap]不是ZmlBootstrap或其子类"); + bootstrap = (ZmlBootstrap)instance; + bootstrap.setContext(config.getContext()); + return bootstrap; + } + + public ZConfig getConfig() + { + return config; + } + + /** 由Action包增加的@AnAction配置 */ + public void addActionOnPackage(ZAction action) + { + if (actionPackage != null) + actionPackage.addActionOnPackage(action); + } + + /*****************************************************************************/ + //通过pathInContext 获取ZAction + /*****************************************************************************/ + + public ZAction getActionInTurn(String path) + { + //1.先查根配置 + ZAction action = config.getInTurnAction(path); + if (action != null) + return action; + + //2.再查actionPackage + if (actionPackage != null) + { + action = actionPackage.getInTurnAction(path); + if (action != null) + return action; + } + + return null; + } + + + public ZAction getExactAction(String path) + { + //1.先查根配置 + ZAction action = config.getExactAction(path); + if (action != null) + return action; + + //2.再查actionPackage + if (actionPackage != null) + { + action = actionPackage.getExactAction(path); + if (action != null) + return action; + } + + return null; + } + + public ZAction getFuzzyAction(String path) + { + //1.先查根配置 + ZAction action = config.getFuzzyAction(path); + if (action != null) + return action; + + //2.再查actionPackage + if (actionPackage != null) + { + action = actionPackage.getFuzzyAction(path); + if (action != null) + return action; + } + + return null; + } + + /*****************************************************************************/ + //通过class 获取 path + /*****************************************************************************/ + + public ZAction getInTurnActionByClass(String clazz) + { + //1.先查根配置 + ZAction action = config.getInTurnActionByClass(clazz); + if (action != null) + return action; + + //2.再查actionPackage + if (actionPackage != null) + { + action = actionPackage.getInTurnActionByClass(clazz); + if (action != null) + return action; + } + + return null; + } + + public ZAction getExactActionByClass(String clazz) + { + //1.先查根配置 + ZAction action = config.getExactActionByClass(clazz); + if (action != null) + return action; + + //2.再查actionPackage + if (actionPackage != null) + { + action = actionPackage.getExactActionByClass(clazz); + if (action != null) + return action; + } + + return null; + } + + public ZAction getFuzzyActionByClass(String clazz) + { + //1.先查根配置 + ZAction action = config.getFuzzyActionByClass(clazz); + if (action != null) + return action; + + //2.再查actionPackage + if (actionPackage != null) + { + action = actionPackage.getFuzzyActionByClass(clazz); + if (action != null) + return action; + } + + return null; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZConfig.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZConfig.java new file mode 100644 index 0000000..3979b99 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZConfig.java @@ -0,0 +1,610 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.config; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.zhiqim.httpd.context.ZmlConfig; +import org.zhiqim.httpd.context.ZmlContextConstants; +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.kernel.constants.XmlConstants; +import org.zhiqim.kernel.extend.LinkedMapSV; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Resources; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.xml.Xmls; + +/** + * 上下文环境配置类 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZConfig implements ZmlContextConstants, XmlConstants +{ + private final ZmlConfig zmlConfig; + private final boolean isRootConfig; + + //配置对应的资源类型和路径 + private final String resourceType; + private final String resourcePath; + + //配置三项属性,名称、类型和路径 + private final String name; + private final String path; + + //组件、配置、属性、拦截器、会话用户、功能 + private final List componentList; + private final List configList; + private final LinkedMapSV attributeMap; + private final List interceptorList; + private final ZActionMap actionMap; + + /****************************************************************************************************/ + //构造函数&toString + /****************************************************************************************************/ + + /** + * 构造函数六个参数 + * + * @param zmlConfig ZML上下文件环境总配置类 + * @param isRootConfig 是否是上下文环境根配置 + * @param resourceType 上下文环境资源类型 + * @param resourcePath 上下文环境资源路径 + * @param name 当前配置的名称 + * @param path 当前配置的相对资源的路径 + */ + public ZConfig(ZmlConfig zmlConfig, boolean isRootConfig, String resourceType, String resourcePath, String name, String path) + { + this.zmlConfig = zmlConfig; + this.isRootConfig = isRootConfig; + + this.resourcePath = Strings.removeEndsWith(resourcePath, "/"); + this.resourceType = resourceType; + + this.name = name; + this.path = Strings.addStartsWith(path, "/"); + + this.componentList = new ArrayList<>(); + this.configList = new ArrayList<>(); + this.attributeMap = new LinkedMapSV<>(); + this.interceptorList = new ArrayList<>(); + this.actionMap = new ZActionMap(zmlConfig, this); + } + + public Context getContext() + { + return zmlConfig.getContext(); + } + + public String getName() + { + return name; + } + + public String getPath() + { + return path; + } + + public String toConfigString() + { + return new StringBuilder("") + .toString(); + } + + public String toString() + { + StringBuilder strb = new StringBuilder(); + strb.append(_XML_DEFIND_).append(_BR_); + strb.append(ZC_XML_DOCTYPE).append(_BR_); + strb.append(ZC_XML_HEAD).append(_BR_).append(_BR_); + + //组件 + for (ZComponent component : componentList) + { + strb.append(_FOUR_).append(component.toString()).append(_BR_); + } + strb.append(_BR_); + + //嵌套上下文 + for (ZConfig context : configList) + { + strb.append(_FOUR_).append(context.toConfigString()).append(_BR_); + } + strb.append(_BR_); + + //属性 + for (ZAttribute attribute : attributeMap.values()) + { + strb.append(_FOUR_).append(attribute.toString()).append(_BR_); + } + strb.append(_BR_); + + //拦截器 + for (ZInterceptor interceptor : interceptorList) + { + strb.append(_FOUR_).append(interceptor.toString()).append(_BR_); + } + strb.append(_BR_); + + //ACTION + strb.append(actionMap.toString()); + strb.append(_BR_); + + strb.append(ZC_XML_TAIL); + return strb.toString(); + } + + /****************************************************************************************************/ + //加载XML和组装配置表 + /****************************************************************************************************/ + + /** + * 加载XML + * + * @throws Exception + */ + public void load() throws Exception + { + InputStream in = getInputStream(); + Document document = null; + + try + { + document = Xmls.buildDocument(in, new ZCResolver(resourcePath + path)); + } + catch(Exception e) + { + throw Asserts.exception("加载[%s%s]时异常", e, resourcePath, path); + } + + //遍历标签 + NodeList componentList = document.getElementsByTagName(ZC_COMPONENT); + for (int i=0;i标签 + NodeList contextList = document.getElementsByTagName(ZC_CONFIG); + for (int i=0;i标签 + NodeList attributeList = document.getElementsByTagName(ZC_ATTRIBUTE); + for (int i=0;i标签 + NodeList interceptorList = document.getElementsByTagName(ZC_INTERCEPTOR); + for (int i=0;i标签 + NodeList actionList = document.getElementsByTagName(ZC_ACTION); + for (int i=0;i getComponentList() + { + return componentList; + } + + public List getConfigList() + { + return configList; + } + + public Collection getAttributeList() + { + return attributeMap.values(); + } + + public List getInterceptorList() + { + return interceptorList; + } + + public Collection getExactActionList() + { + return actionMap.getExactActionList(); + } + + public Collection getFuzzyActionList() + { + return actionMap.getFuzzyActionList(); + } + + /** 检查变量 */ + public void chkActionVariable() + { + actionMap.chkVariable(); + } + + /*****************************************************************************/ + //通过path 获取ZAction + /*****************************************************************************/ + + public ZAction getInTurnAction(String path) + { + //1.先查本文件精确和模糊匹配 + ZAction action = actionMap.getExactAction(path); + if (action != null) + return action; + + action = actionMap.getFuzzyAction(path); + if (action != null) + return action; + + //2.再倒序查contextList中精确和模糊匹配 + for (int i=configList.size()-1;i>=0;i--) + { + //递归查到为止 + ZConfig context = configList.get(i); + action = context.getInTurnAction(path); + if (action != null) + return action; + } + + return null; + } + + public ZAction getExactAction(String path) + { + //1.先查本文件精确匹配 + ZAction action = actionMap.getExactAction(path); + if (action != null) + return action; + + //2.再倒序查contextList中精确匹配 + for (int i=configList.size()-1;i>=0;i--) + { + //递归查到为止 + ZConfig context = configList.get(i); + action = context.getExactAction(path); + if (action != null) + return action; + } + + return null; + } + + public ZAction getFuzzyAction(String path) + { + //1.先查本文件模糊匹配 + ZAction action = actionMap.getFuzzyAction(path); + if (action != null) + return action; + + //2.再倒序查contextList中模糊匹配 + for (int i=configList.size()-1;i>=0;i--) + { + //递归查到为止 + ZConfig context = configList.get(i); + action = context.getFuzzyAction(path); + if (action != null) + return action; + } + + return null; + } + + /*****************************************************************************/ + //通过class 获取 ZAction + /*****************************************************************************/ + + public ZAction getInTurnActionByClass(String clazz) + { + //1.先查本文件精确和模糊匹配 + ZAction action = actionMap.getExactActionByClass(clazz); + if (action != null) + return action; + + action = actionMap.getFuzzyActionByClass(clazz); + if (action != null) + return action; + + //2.再倒序查contextList中精确和模糊匹配 + for (int i=configList.size()-1;i>=0;i--) + { + //递归查到为止 + ZConfig context = configList.get(i); + action = context.getInTurnActionByClass(clazz); + if (action != null) + return action; + } + + return null; + } + + public ZAction getExactActionByClass(String clazz) + { + //1.先查本文件精确匹配 + ZAction action = actionMap.getExactActionByClass(clazz); + if (action != null) + return action; + + //2.再倒序查contextList中精确匹配 + for (int i=configList.size()-1;i>=0;i--) + { + //递归查到为止 + ZConfig context = configList.get(i); + action = context.getExactActionByClass(clazz); + if (action != null) + return action; + } + + return null; + } + + public ZAction getFuzzyActionByClass(String clazz) + { + //1.先查本文件模糊匹配 + ZAction action = actionMap.getFuzzyActionByClass(clazz); + if (action != null) + return action; + + //2.再倒序查contextList中模糊匹配 + for (int i=configList.size()-1;i>=0;i--) + { + //递归查到为止 + ZConfig context = configList.get(i); + action = context.getFuzzyActionByClass(clazz); + if (action != null) + return action; + } + + return null; + } + + /*****************************************************************************/ + //获取自身定义的三项配置(不能被覆盖) + /*****************************************************************************/ + + /** 获取Websocket */ + public String getWebsocketClass() + { + ZAttribute attribute = attributeMap.get(ZC_WEBSOCKET); + if (attribute != null) + return attribute.getValue(); + + for (int i=configList.size()-1;i>=0;i--) + { + ZConfig context = configList.get(i); + attribute = context.attributeMap.get(ZC_WEBSOCKET); + if (attribute != null) + return attribute.getValue(); + } + + return null; + } + + /** 获取引导 */ + public String getBootstrapClass() + { + ZAttribute attribute = attributeMap.get(ZC_BOOTSTRAP); + if (attribute != null) + return attribute.getValue(); + + for (int i=configList.size()-1;i>=0;i--) + { + ZConfig context = configList.get(i); + attribute = context.attributeMap.get(ZC_BOOTSTRAP); + if (attribute != null) + return attribute.getValue(); + } + + return null; + } + + /** 获取包路径 */ + public ZActionPackage getActionPackage(ZmlConfig zmlConfig) + { + ZAttribute attribute = attributeMap.get(ZC_ACTION_PACKAGE); + if (attribute != null) + return new ZActionPackage(zmlConfig, this, attribute.getValue()); + + for (int i=configList.size()-1;i>=0;i--) + { + ZConfig context = configList.get(i); + attribute = context.attributeMap.get(ZC_ACTION_PACKAGE); + if (attribute != null) + return new ZActionPackage(zmlConfig, this, attribute.getValue()); + } + + return null; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZInterceptor.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZInterceptor.java new file mode 100644 index 0000000..65f102c --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/ZInterceptor.java @@ -0,0 +1,71 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.config; + +import org.zhiqim.kernel.constants.AsciiConstants; + +/** + * 挂截器配置 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZInterceptor implements AsciiConstants +{ + private String name; + private String key; + private String clazz; + + public String toString() + { + return new StringBuilder("") + .toString(); + } + + public String getName() + { + return name; + } + public void setName(String name) + { + this.name = name; + } + public String getKey() + { + return key; + } + public void setKey(String key) + { + this.key = key; + } + public String getClazz() + { + return clazz; + } + public void setClazz(String clazz) + { + this.clazz = clazz; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/config/zhiqim_context_1_5_0.dtd b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/zhiqim_context_1_5_0.dtd new file mode 100644 index 0000000..71ff3a9 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/config/zhiqim_context_1_5_0.dtd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/core/Action.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/core/Action.java new file mode 100644 index 0000000..4f81fb5 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/core/Action.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.core; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContextConstants; + + +/** + * 定义Action的接口 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface Action extends ZmlContextConstants +{ + /** + * Action的执行接口 + * + * @param request HTTP请求 + * @throws Exception 由于操作复杂,抛Exception比较合适 + */ + public void execute(HttpRequest request) throws Exception; +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/core/Context.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/core/Context.java new file mode 100644 index 0000000..e15568f --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/core/Context.java @@ -0,0 +1,150 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.core; + +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.context.ZmlBootstrap; +import org.zhiqim.httpd.context.ZmlConfig; +import org.zhiqim.httpd.context.ZmlContextConstants; +import org.zhiqim.httpd.context.ServiceExecutor; +import org.zhiqim.httpd.context.config.ZAction; + +import org.zhiqim.zml.ZmlEngine; + +/** + * ZML上下文环境必须实现的接口 + * + * @version v1.0.0 @author zouzhigang 2016-7-16 新建与整理 + */ +public interface Context extends HttpContext, ZmlContextConstants +{ + /***************************************************************************************/ + //Bootstrap & RmiService & ZmlEngine + /***************************************************************************************/ + + /** 获取服务Id */ + public String getServerId(); + + /** 获取配置类 */ + public ZmlConfig getConfig(); + + /** 获取引导类 */ + public ZmlBootstrap getBootstrap(); + + /** 获取ZML引擎类 */ + public ZmlEngine getZmlEngine(); + + /** 获取服务处理器 */ + public ServiceExecutor getServiceExecutor(); + + /***************************************************************************************/ + //TopAttribute + /***************************************************************************************/ + + /** 判断是否有顶级属性 */ + public boolean hasTopAttribute(String key); + + /** 获取顶有属性对象 */ + public Object getTopAttribute(String key); + + /** 获取顶有属性字符串 */ + public String getTopAttributeString(String key); + + /** 获取顶有属性字符串,有属性则返回字符串,否则返回缺省值 */ + public String getTopAttributeString(String key, String defaultValue); + + /***************************************************************************************/ + //Action & Interceptor + /***************************************************************************************/ + + /** + * 通过ZAction配置获取Action实例 + * + * @param fAction ZAction配置 + * @return Action实例 + */ + public Action getAction(ZAction fAction); + + /** + * 判断类是否在ActionMap中 + * + * @param clazz 类名 + * @return =true表示存在 + */ + public boolean hasActionInstance(String clazz); + + /** + * 获取类在ActionMap中的实例 + * + * @param clazz 类名 + * @return Action实例 + */ + public Action getActionInstance(String clazz); + + /** + * 获取Action配置 + * + * @param path 路径,如/index.htm + * @return Action配置 + */ + public ZAction getAction(String path); + + /** + * 判断是否有该别名的拦截器 + * + * @param interceptor 拦截器别名 + * @return =true表示有,=false表示没有 + */ + public boolean hasInterceptor(String interceptor); + + /** + * 获取该别名的拦截器 + * + * @param interceptor 拦截器别名 + * @return 拦截器 + */ + public Interceptor getInterceptor(String interceptor); + + /** + * 通过拦截器别名字符串获取拦截器列表 + * + * @param interceptors 拦截器别名字符串,多个用逗号隔开 + * @return 拦截器列表 + */ + public List getInterceptorList(String interceptors); + + /***************************************************************************************/ + //资源相关 + /***************************************************************************************/ + + /** + * 增加组件资源 + * + * @param resourceIndex 资源查找索引,从小到大查找 + * @param resourceType 资源类型classpath|directory + * @param resourcePath 资源地址,如/com/zhiqim/example或./example + * @return =true表示成功,=false表示已存在 + */ + public boolean addComponentResource(int resourceIndex, String resourceType, String resourcePath); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/core/Interceptor.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/core/Interceptor.java new file mode 100644 index 0000000..7163b90 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/core/Interceptor.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.core; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpdConstants; + +/** + * 定义拦截器接口,处理结果放置在request属性_RESPONSE_STATUS_和_RESPONSE_TEXT_中 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + * @version v1.1.0 @author zouzhigang 2015-11-19 修改原三个参数[forward,request,response]为只保留request参数 + */ +public interface Interceptor extends HttpdConstants +{ + /** + * 执行拦截操作,用于Action,Ajax,RMI等操作之前进行的拦截操作, 如用户身份验证,日志等操作. + * + * @param request HTTP请求 + * @throws Exception 允许抛出Exception + */ + public void intercept(HttpRequest request) throws Exception; +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/core/Return.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/core/Return.java new file mode 100644 index 0000000..0cecf70 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/core/Return.java @@ -0,0 +1,48 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.core; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContextConstants; +import org.zhiqim.httpd.context.returns.ReturnView; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; + +/** + * 定义响应页面接口 + * + * @version v1.0.0 @author zouzhigang 2017-8-19 新建与整理 + */ +public interface Return extends ZmlContextConstants +{ + public static final Log log = LogFactory.getLog(Return.class); + public static final ReturnView returnTemplate = new ReturnView(); + + /** + * 执行输出操作,用于Action处理完成之后,根据结果进行输出. + * + * @param request HTTP请求 + * @throws Exception 允许抛出Exception + */ + public void process(HttpRequest request) throws Exception; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/DispatchAction.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/DispatchAction.java new file mode 100644 index 0000000..8396c59 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/DispatchAction.java @@ -0,0 +1,56 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.extend; + +import java.lang.reflect.Method; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + + +/** + * 按子类方法(根据参数选择)的xxx.do?method=add分发器,不提供表单检查,由方法体自行检查
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class DispatchAction implements Action +{ + /** 按指定的method参数值方法 来分发 */ + public final void execute(HttpRequest request) throws Exception + { + String method = request.getParameter(ZC_METHOD); + if(method == null) + { + request.returnHistory("未找到分发的方法名"); + return; + } + + Method m = getClass().getMethod(method, HttpRequest.class); + if (m == null) + { + request.returnHistory("未找到分发["+method+"]的方法"); + return; + } + + m.invoke(this, request); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/EmptyAction.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/EmptyAction.java new file mode 100644 index 0000000..cae60a2 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/EmptyAction.java @@ -0,0 +1,40 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.extend; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + + +/** + * 空动作,什么都不处理,用于直接转到视图页 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public final class EmptyAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + // Nothing + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/GetPostAction.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/GetPostAction.java new file mode 100644 index 0000000..9a668b6 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/GetPostAction.java @@ -0,0 +1,86 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.extend; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + +import org.zhiqim.kernel.util.Validates; + +/** + * 提供通过GET和POST请求分开处理,常用于FORM提交 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class GetPostAction implements Action +{ + /** 设置为final,防止子类重写 */ + public final void execute(HttpRequest request) throws Exception + { + if (request.isMethodGet()) + { + //设置浏览器私有缓存表单信息,保证回退时填充表单 + request.setResponsePrivateCache(); + request.setAlertMsg(null); + + //写入验证信息 + validate(request); + + //调用子类实现的doGet方式 + doGet(request); + + //优先view + if (!Validates.isEmptyBlank(request.getView())) + request.setView(request.getView(), request.getInclude()); + } + else if (request.isMethodPost()) + { + //先执行validateForm,取得验证 + validate(request); + + //判断验证列表,如果有问题直接返回上一页 + if (!request.chkValidate()) + { + request.returnHistory(); + return ; + } + + //清除验证并处理 + request.clearValidate(); + doPost(request); + + //POST优先redirect + if (!Validates.isEmptyBlank(request.getRedirectInner())) + request.setRedirectInner(request.getRedirectInner()); + } + } + + /** 初始化验证列表 */ + protected abstract void validate(HttpRequest request) throws Exception; + + /** doGet方法,由子类实现 */ + protected abstract void doGet(HttpRequest request) throws Exception; + + /** doPost方法,由子类实现 */ + protected abstract void doPost(HttpRequest request) throws Exception; + +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/LogoutAction.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/LogoutAction.java new file mode 100644 index 0000000..e370788 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/LogoutAction.java @@ -0,0 +1,40 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.extend; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + +/** + * 退出操作,失效会话信息,如果仅解绑,请重写该类 + * + * @version v1.0.0 @author zouzhigang 2017-3-7 新建与整理 + * @version v1.4.1 @author zouzhigang 2018-5-8 修改为失效会话 + */ +public final class LogoutAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + request.invalidateSession(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/StdDispatchAction.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/StdDispatchAction.java new file mode 100644 index 0000000..c6f14fe --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/StdDispatchAction.java @@ -0,0 +1,153 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.extend; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + +import org.zhiqim.kernel.util.Validates; + +/** + * 标准Action分发器,标准分发器提供validateForm表单检查

            + * + * 包括方法如下:
            + * 0)validateId/validateForm (用于add,modify页面验证和insert,update的服务端验证)
            + * 1)item (用于显示单条详情)
            + * 2)list (用于显示列表,如分页,查询都在这里)
            + * 3)add (用于增加操作的页面初始化)
            + * 4)modify (用于修改操作的页面初始化)
            + * 5)insert (用于增加操作的执行)
            + * 6)update (用于修改操作的执行)
            + * 7)delete (用于删除操作的执行)
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class StdDispatchAction implements Action +{ + /** 设置为final,防止子类重写 */ + public final void execute(HttpRequest request) throws Exception + { + String method = request.getParameter(ZC_METHOD); + if (Validates.isEmptyBlank(method)) + method = LIST; + + switch (method.hashCode()) + { + case INT_ITEM: + validateId(request); + if (!request.chkValidate()) + { + request.returnHistory(); + break; + } + + request.clearValidate(); + item(request); + break; + case INT_ADD: + request.setResponsePrivateCache(); + request.setAlertMsg(null); + validateForm(request); + add(request); + break; + case INT_MODIFY: + validateId(request); + if (!request.chkValidate()) + { + request.returnHistory(); + break; + } + + request.clearValidate(); + request.setResponsePrivateCache(); + request.setAlertMsg(null); + validateForm(request); + modify(request); + break; + case INT_INSERT: + validateForm(request); + if (!request.chkValidate()) + { + request.returnHistory(); + break; + } + + request.clearValidate(); + insert(request); + break; + case INT_UPDATE: + validateForm(request); + if (!request.chkValidate()) + { + request.returnHistory(); + break; + } + + request.clearValidate(); + update(request); + break; + case INT_DELETE: + validateId(request); + if (!request.chkValidate()) + { + request.returnHistory(); + break; + } + + request.clearValidate(); + delete(request); + break; + default: + list(request); + break; + } + } + + /** 验证ID,用于item,modify,delete时检查ID是否传入 */ + protected abstract void validateId(HttpRequest request) throws Exception; + + /** 验证表单,用于add,modify作客户端javascript验证,用于insert,update作服务端验证 */ + protected abstract void validateForm(HttpRequest request) throws Exception; + + /** 1)item (用于显示单条详情) 可选 */ + protected void item(HttpRequest request) throws Exception + { + } + + /** 2)list (用于显示列表,如分页,查询都在这里) */ + protected abstract void list(HttpRequest request) throws Exception; + + /** 3)add (用于增加操作的页面初始化) */ + protected abstract void add(HttpRequest request) throws Exception; + + /** 4)modify(用于修改操作的页面初始化) */ + protected abstract void modify(HttpRequest request) throws Exception; + + /** 5)insert(用于增加操作的执行) */ + protected abstract void insert(HttpRequest request) throws Exception; + + /** 6)update(用于修改操作的执行) */ + protected abstract void update(HttpRequest request) throws Exception; + + /** 7)delete(用于删除操作的执行) */ + protected abstract void delete(HttpRequest request) throws Exception; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/StdSwitchAction.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/StdSwitchAction.java new file mode 100644 index 0000000..650807d --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/StdSwitchAction.java @@ -0,0 +1,154 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.extend; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + +import org.zhiqim.kernel.util.Validates; + +/** + * 标准Action分发器,标准分发器提供validateForm表单检查

            + * + * 包括方法如下:
            + * 0)validate (用于add,modify页面验证和insert,update的服务端验证)
            + * 1)item (用于显示单条详情)
            + * 2)list (用于显示列表,如分页,查询都在这里)
            + * 3)add (用于增加操作的页面初始化)
            + * 4)modify (用于修改操作的页面初始化)
            + * 5)insert (用于增加操作的执行)
            + * 6)update (用于修改操作的执行)
            + * 7)delete (用于删除操作的执行)
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class StdSwitchAction implements Action +{ + /** 设置为final,防止子类重写 */ + public final void execute(HttpRequest request) throws Exception + { + String method = request.getExecuteMethod(); + if (Validates.isEmptyBlank(method)) + method = LIST; + + switch (method.hashCode()) + { + case INT_ITEM: + validateId(request); + if (!request.chkValidate()) + { + request.returnHistory(); + break; + } + + request.clearValidate(); + item(request); + break; + case INT_ADD: + request.setResponsePrivateCache(); + request.setAlertMsg(null); + validateForm(request); + add(request); + break; + case INT_MODIFY: + validateId(request); + if (!request.chkValidate()) + { + request.returnHistory(); + break; + } + + request.clearValidate(); + request.setResponsePrivateCache(); + request.setAlertMsg(null); + validateForm(request); + modify(request); + break; + case INT_INSERT: + validateForm(request); + if (!request.chkValidate()) + { + request.returnHistory(); + break; + } + + request.clearValidate(); + insert(request); + break; + case INT_UPDATE: + validateForm(request); + if (!request.chkValidate()) + { + request.returnHistory(); + break; + } + + request.clearValidate(); + update(request); + break; + case INT_DELETE: + validateId(request); + if (!request.chkValidate()) + { + request.returnHistory(); + break; + } + + request.clearValidate(); + delete(request); + break; + default: + list(request); + break; + } + } + + + /** 验证ID,用于item,modify,delete时检查ID是否传入 */ + protected abstract void validateId(HttpRequest request) throws Exception; + + /** 验证表单,用于add,modify作客户端javascript验证,用于insert,update作服务端验证 */ + protected abstract void validateForm(HttpRequest request) throws Exception; + + /** 1)item (用于显示单条详情) 可选 */ + protected void item(HttpRequest request) throws Exception + { + } + + /** 2)list (用于显示列表,如分页,查询都在这里) */ + protected abstract void list(HttpRequest request) throws Exception; + + /** 3)add (用于增加操作的页面初始化) */ + protected abstract void add(HttpRequest request) throws Exception; + + /** 4)modify(用于修改操作的页面初始化) */ + protected abstract void modify(HttpRequest request) throws Exception; + + /** 5)insert(用于增加操作的执行) */ + protected abstract void insert(HttpRequest request) throws Exception; + + /** 6)update(用于修改操作的执行) */ + protected abstract void update(HttpRequest request) throws Exception; + + /** 7)delete(用于删除操作的执行) */ + protected abstract void delete(HttpRequest request) throws Exception; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/SwitchAction.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/SwitchAction.java new file mode 100644 index 0000000..e108276 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/SwitchAction.java @@ -0,0 +1,50 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.extend; + +import java.lang.reflect.Method; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + + +/** + * 根据context.xml配置的method转换处理方法,注意和DispatchAction之间的区别 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class SwitchAction implements Action +{ + /** 按子类方法 来转换 */ + public final void execute(HttpRequest request) throws Exception + { + String method = request.getExecuteMethod(); + Method m = getClass().getMethod(method, HttpRequest.class); + if (m == null) + { + request.returnHistory("未找到转换器["+method+"]的方法"); + return; + } + + m.invoke(this, request); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/ValidateAction.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/ValidateAction.java new file mode 100644 index 0000000..169ba94 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/ValidateAction.java @@ -0,0 +1,58 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.extend; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + + +/** + * 用于配置验证表单的Action + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class ValidateAction implements Action +{ + /** 置execute为final,防止子类重写 */ + public final void execute(HttpRequest request) throws Exception + { + //先执行validate,设置验证列表 + validate(request); + + //判断验证列表,如果有问题直接返回 + if (!request.chkValidate()) + { + request.returnHistory(); + return; + } + + //清除验证,由子类实现业务和一些与业务相关的验证 + request.clearValidate(); + perform(request); + } + + /** 由子类继承,初始化验证列表 */ + protected abstract void validate(HttpRequest request) throws Exception; + + /** 由子类继承,子类实现业务,类似于Action的execute */ + protected abstract void perform(HttpRequest request) throws Exception; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/ViewExecAction.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/ViewExecAction.java new file mode 100644 index 0000000..66d110e --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/extend/ViewExecAction.java @@ -0,0 +1,74 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.extend; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; + + +/** + * 包括一个View和一个Exec的Action,常用于页面和处理合并到一个Action + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class ViewExecAction implements Action +{ + /** 设置为final,防止子类重写 */ + public final void execute(HttpRequest request) throws Exception + { + String method = request.getExecuteMethod(); + if(EXEC.equalsIgnoreCase(method)) + {//处理,先把验证数据放入,再验证,失败退出,成功清除验证后执行 + validate(request); + if (!request.chkValidate()) + { + request.returnHistory(); + return; + } + + request.clearValidate(); + exec(request); + } + else + { + request.setResponsePrivateCache(); + request.setAlertMsg(null); + validate(request);//增加验证到forward + view(request); + } + } + + /** + * 增加验证,默认通过,子类可重写该方法 + * + * @param forward ActionForward + */ + protected void validate(HttpRequest request) throws Exception + { + } + + /** view方法,由子类实现 */ + protected abstract void view(HttpRequest request) throws Exception; + + /** exec方法,由子类实现 */ + protected abstract void exec(HttpRequest request) throws Exception; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/returns/ReturnFrame.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/returns/ReturnFrame.java new file mode 100644 index 0000000..07b69b7 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/returns/ReturnFrame.java @@ -0,0 +1,177 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.returns; + +import java.net.SocketException; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.httpd.context.core.Return; +import org.zhiqim.httpd.util.Responses; + +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.kernel.util.Htmls; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; + +/** + * 响应警告信息,用于通过iframe提交信息时响应错误 + * + * @version v1.0.0 @author zouzhigang 2017-8-21 新建与整理 + */ +public class ReturnFrame implements Return +{ + @Override + public void process(HttpRequest request) throws SocketException + { + Context context = (Context)request.getContext(); + ZmlEngine engine = context.getZmlEngine(); + if (engine.hasZml(_PATH_RETURN_FRAME_)) + { + returnTemplate.process(request, _PATH_RETURN_FRAME_, null); + return; + } + + HttpResponse response = request.getResponse(); + String encoding = response.getCharacterEncoding(); + + //1.Script头部 + StringBuilder strb = new StringBuilder(); + strb.append(_HTML_5_TYPE_).append(_BR_); + strb.append(_HTML).append(_BR_); + strb.append(_HEAD).append(_BR_); + strb.append(Htmls.toTitle(request.getContextName())); + strb.append(Htmls.toContentType(encoding)); + strb.append(_SCRIPT_BR); + + //2.组装告警函数 + buildAlertMsgFunction(request, strb); + + //3.组装回调函数 + buildCallbackFunction(request, strb); + + //4.Script尾部 + strb.append(SCRIPT_).append(_BR_); + strb.append(HEAD_).append(_BR_); + strb.append(HTML_).append(_BR_); + + //最后输出 + Responses.printAndCommit(response, strb, log); + } + + /** 组装告警函数 */ + private void buildAlertMsgFunction(HttpRequest request, StringBuilder strb) + { + String message = request.getAlertMsg(); + if (Validates.isEmpty(message)) + {//无消息的直接回调 + strb.append("callback();").append(_BR_).append(_BR_); + return; + } + + //有消息的,弹出消息告警,后执行回调函数 + message = Scripts.formatAlertMsg(message); + strb.append("if (parent.Z && parent.Z.onload && parent.Z.alert)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("parent.Z.alert(\"").append(message).append("\", callback, {type: \"").append(request.isResponseSuccess()?"success":"failure").append("\"});").append(_BR_) + .append("}").append(_BR_) + .append("else").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("alert(\"").append(message).append("\");").append(_BR_) + .append(_FOUR_).append("callback();").append(_BR_) + .append("}").append(_BR_) + .append(_BR_); + } + + /** 组装回调函数 */ + private void buildCallbackFunction(HttpRequest request, StringBuilder strb) + { + int returnType = request.getForceReturnType(); + + //1.函数头 + strb.append("function callback()").append(_BR_) + .append("{").append(_BR_); + + //2.回调恢复按钮 + if (returnType != 0) + {//跳转的,不作回调恢复按钮 + int formIndex = request.getParameterInt(_PARAM_FORM_INDEX_); + if (formIndex != -1) + {//恢复按钮 + strb.append(_FOUR_).append("if (parent.setFormButtonResume){").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("parent.setFormButtonResume(").append(formIndex).append(");").append(_BR_) + .append(_FOUR_).append("}").append(_BR_).append(_BR_); + } + } + + //3.跳转 + switch (request.getForceReturnType()) + { + case -1: + case 1: + case 2: + case 3: + {//-1.没有redirect,1.返回上一页,2.关闭本窗口,3.关闭对话框,这四项直接回空白页 + strb.append(_FOUR_).append("window.location.href = \"about:blank\";").append(_BR_); + break; + } + case 4: + {//调用javascript + String redirect = request.getRedirect(_UTF_8_); + strb.append(_FOUR_).append(redirect.substring("javascript:".length())).append(_BR_); + break; + } + default: + {//缺省表示正常连接 + //1.先清除可能的回车换行 + String redirect = request.getRedirect(_UTF_8_); + redirect = redirect.replaceAll("\r", ""); + redirect = redirect.replaceAll("\n", ""); + + //2.判断是否是有效的地址 + // 2.1 支持绝对地址//开头或http(s)://开头,如//www.zhiqim.com/index.htm,http://www.zhiqim.com/index.htm + // 2.2 支持基于虚拟目录如当前虚拟目录是/或/admin,则绝对路径如/zhiqim.htm在处理时自动转为/zhiqim.htm和/admin/zhiqim.htm + // 2.3 其他认为是相对路径,如zhiqim.htm,../zhiqim.htm之类的路径 + if (redirect.startsWith("/") && !redirect.startsWith("//")) + {//如果是绝对路径,自动加上虚拟目录 + redirect = request.getContext().getRootPath(redirect); + } + + strb.append(_FOUR_); + + int target = request.getResponseStatus(); + if (target == _601_REDIRECT_PARENT_) + strb.append("parent.parent.location.href=\""); + else if (target == _603_REDIRECT_TOP_) + strb.append("top.location.href=\""); + else + strb.append("parent.location.href=\""); + + strb.append(redirect).append("\";").append(_BR_); + } + } + + //4.函数结尾 + strb.append("}").append(_BR_); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/returns/ReturnResult.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/returns/ReturnResult.java new file mode 100644 index 0000000..87e24b8 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/returns/ReturnResult.java @@ -0,0 +1,196 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.returns; + +import java.net.SocketException; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.httpd.context.core.Return; +import org.zhiqim.httpd.util.Responses; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.util.Styles; +import org.zhiqim.kernel.util.Htmls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.ZmlEngine; + +/** + * 响应处理结果 + * + * @version v1.0.0 @author zouzhigang 2017-8-21 新建与整理 + */ +public class ReturnResult implements Return +{ + private ReturnFrame returnFrame = new ReturnFrame(); + + @Override + public void process(HttpRequest request) throws SocketException + { + //1.如果是frame目标的,使用returnFrame + if (request.getParameterBoolean(_PARAM_CALL_FRAME_)) + { + returnFrame.process(request); + return; + } + + //2.如果有配置/conf/return/returnResult.zml的 + Context context = (Context)request.getContext(); + ZmlEngine engine = context.getZmlEngine(); + if (engine.hasZml(_PATH_RETURN_RESULT_)) + { + returnTemplate.process(request, _PATH_RETURN_RESULT_, null); + return; + } + + //3.没有配置/conf/return/returnResult.zml的提交默认响应 + HttpResponse response = request.getResponse(); + String encoding = response.getCharacterEncoding(); + + String zhiqimCss = request.getContextAttributeString(request.isMobile()?ZC_ZHIQIM_MOBILE_CSS:ZC_ZHIQIM_CSS); + String zhiqimJs = request.getContextAttributeString(request.isMobile()?ZC_ZHIQIM_MOBILE_JS:ZC_ZHIQIM_JS); + boolean hasZhiqimCssJs = !Validates.isEmpty(zhiqimCss) && !Validates.isEmpty(zhiqimJs); + + //3.1 Script头部 + StringBuilder strb = new StringBuilder(); + strb.append(_HTML_5_TYPE_).append(_BR_); + strb.append(_HTML).append(_BR_); + strb.append(_HEAD).append(_BR_); + strb.append(Htmls.toTitle(request.getContextName())); + strb.append(Htmls.toContentType(encoding)); + if (hasZhiqimCssJs) + {//加载zhiqim.css/zhiqim.js + strb.append(Styles.src(zhiqimCss)).append(_BR_); + strb.append(Scripts.src(zhiqimJs)).append(_BR_); + } + strb.append(_SCRIPT_BR); + + //3.2 组装告警函数 + buildAlertMsgFunction(request, strb, hasZhiqimCssJs); + + //3.3 组装回调函数 + buildCallbackFunction(request, strb); + + //3.4 Script尾部 + strb.append(SCRIPT_).append(_BR_); + strb.append(HEAD_).append(_BR_); + strb.append(HTML_).append(_BR_); + + //4.最后输出 + Responses.printAndCommit(response, strb, log); + } + + /** 组装告警函数 */ + private void buildAlertMsgFunction(HttpRequest request, StringBuilder strb, boolean hasZhiqimCssJs) + { + if (hasZhiqimCssJs) + {//Z.onload BEGIN + strb.append("Z.onload(function()").append(_BR_) + .append("{").append(_BR_); + } + + //对信息进行HTML和Script标签处理 + String message = request.getAlertMsg(); + if (Validates.isEmpty(message)) + {//没有消息的,直接执行回调函数 + if (hasZhiqimCssJs) + strb.append(_FOUR_).append("callback();").append(_BR_); + else + strb.append("callback();").append(_BR_).append(_BR_); + + } + else + {//有消息的,弹出消息告警,后执行回调函数 + message = Scripts.formatAlertMsg(message); + + if (hasZhiqimCssJs) + { + String func = request.isResponseSuccess()?"success":"failure"; + strb.append(_FOUR_).append("Z.alert(\"").append(message).append("\", callback, {type: \"").append(func).append("\"});").append(_BR_); + } + else + { + strb.append("alert(\"").append(message).append("\");").append(_BR_); + strb.append("callback();").append(_BR_).append(_BR_); + } + } + + if (hasZhiqimCssJs) + {//Z.onload END + strb.append("});").append(_BR_).append(_BR_); + } + } + + /** 组装回调函数 */ + private void buildCallbackFunction(HttpRequest request, StringBuilder strb) + { + //1.函数头 + strb.append("function callback()").append(_BR_) + .append("{").append(_BR_); + + //2.跳转 + switch (request.getForceReturnType()) + { + case -1:break;//没有redirect + case 1:strb.append(_FOUR_).append("window.history.back();").append(_BR_);break; + case 2:strb.append(_FOUR_).append("window.close();").append(_BR_);break; + case 3:strb.append(_FOUR_).append("parent.Z.Dialog.close(location.hash, true);").append(_BR_);break; + case 4: + {//调用javascript + String redirect = request.getRedirect(_UTF_8_); + strb.append(_FOUR_).append(redirect.substring("javascript:".length())).append(_BR_); + break; + } + default: + {//缺省表示正常连接 + //1.先清除可能的回车换行 + String redirect = request.getRedirect(_UTF_8_); + redirect = redirect.replaceAll("\r", ""); + redirect = redirect.replaceAll("\n", ""); + + //2.判断是否是有效的地址 + // 2.1 支持绝对地址//开头或http(s)://开头,如//www.zhiqim.com/index.htm,http://www.zhiqim.com/index.htm + // 2.2 支持基于虚拟目录如当前虚拟目录是/或/admin,则绝对路径如/zhiqim.htm在处理时自动转为/zhiqim.htm和/admin/zhiqim.htm + // 2.3 其他认为是相对路径,如zhiqim.htm,../zhiqim.htm之类的路径 + if (redirect.startsWith("/") && !redirect.startsWith("//")) + {//如果是绝对路径,自动加上虚拟目录 + redirect = request.getContext().getRootPath(redirect); + } + + strb.append(_FOUR_); + + int target = request.getResponseStatus(); + if (target == _601_REDIRECT_PARENT_) + strb.append("parent.location.href=\""); + else if (target == _603_REDIRECT_TOP_) + strb.append("top.location.href=\""); + else + strb.append("window.location.href=\""); + + strb.append(redirect).append("\";").append(_BR_); + } + } + + //3.函数结尾 + strb.append("}").append(_BR_); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/returns/ReturnView.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/returns/ReturnView.java new file mode 100644 index 0000000..7542887 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/returns/ReturnView.java @@ -0,0 +1,131 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.returns; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map.Entry; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.HttpSession; +import org.zhiqim.httpd.context.ZmlConfig; +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.httpd.context.core.Return; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Htmls; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.Zml; +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.zml.Zmls; + +/** + * 响应处理视图 + * + * @version v1.0.0 @author zouzhigang 2017-8-21 新建与整理 + */ +public class ReturnView implements Return +{ + @Override + public void process(HttpRequest request) + { + process(request, request.getView(), request.getInclude()); + } + + public void process(HttpRequest request, String viewPath, String includePath) + { + HttpResponse response = request.getResponse(); + HttpSession session = request.getSession(); + + Context context = (Context)request.getContext(); + ZmlConfig config = context.getConfig(); + ZmlEngine engine = context.getZmlEngine(); + + //1.页面环境变量表,包括请求中参数和属性 + MapSO variableMap = new HashMapSO(); + + //1.1先放参数,注意来自参数的数据由外部决定,这里要对其安全过滤 + HashMap paramMap = request.getParameterMap(); + if (!paramMap.isEmpty()) + { + for (Entry entry : paramMap.entrySet()) + { + String key = entry.getKey(); + String value = Htmls.filterAll(entry.getValue()); + variableMap.put(key, value); + } + } + + //1.2再放属性,这里的数据来自Action本身,明确,不作过滤,和参数名相同时覆盖 + variableMap.putAll(request.getAttributeMap()); + + //1.3 放置Session对应的三个数据 + if (session != null) + { + variableMap.put("sessionId", request.getSessionId()); + variableMap.put("sessionUser", request.getSessionUser()); + variableMap.put("sessionName", request.getSessionName()); + } + + //1.4 放置范围域 + variableMap.put("request", request); + variableMap.put("response", response); + variableMap.put("session", session); + variableMap.put("context", context); + variableMap.put("log", log); + + try + { + //2.放置嵌套包含定义 + if (!Validates.isEmptyBlank(includePath)) + { + if (includePath.contains("${") || includePath.contains("<#")) + {//嵌套视图地址包含变量 + includePath = Zmls.parse(includePath, variableMap, config); + } + + if (!Validates.isEmptyBlank(includePath)) + { + variableMap.put("include", includePath); + variableMap.put("includeList", Lists.toStringList(includePath)); + } + } + + //视图地址检查 + if (viewPath.contains("${") || viewPath.contains("<#")) + {//视图地址包含变量 + viewPath = Zmls.parse(viewPath, variableMap, config); + } + + //处理视图 + Zml zml = engine.getZml(viewPath); + zml.process(response.getOutputStream(), response.getCharacterEncoding(), variableMap, config); + } + catch (Exception e) + { + log.error(e); + try{response.print(e.getMessage());response.commit();}catch (IOException e1){} + } + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/CheckObjectRule.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/CheckObjectRule.java new file mode 100644 index 0000000..98d11ee --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/CheckObjectRule.java @@ -0,0 +1,43 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.rule; + +import org.zhiqim.httpd.HttpRequest; + +/** + * 定义对象验证接口,通过请求和指定对象验证是否有权限如功能菜单等,举例: + * <#if ChkObjectRule.check(request, item)> + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface CheckObjectRule +{ + /** + * 检查权限接口,指定权限字符串,如菜单ID,菜单URL等 + * + * @param request 请求的上下文环境 + * @param obj 请求验证的对象 + * @return =true表示验证通过,=false表示验证不通过 + * @throws Exception 可能的异常 + */ + public boolean check(HttpRequest request, Object item) throws Exception; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/CheckPermissionRule.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/CheckPermissionRule.java new file mode 100644 index 0000000..82b8aca --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/CheckPermissionRule.java @@ -0,0 +1,43 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.rule; + +import org.zhiqim.httpd.HttpRequest; + +/** + * 定义权限验证接口,通过请求和指定参数验证是否有权限如功能菜单等,举例: + * <#if ChkPermissionRule.check(request, "delete")> + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface CheckPermissionRule +{ + /** + * 检查权限接口,指定权限字符串,如菜单ID,菜单URL等 + * + * @param request 请求的上下文环境 + * @param permission 请求权限参数信息 + * @return =true表示验证通过,=false表示验证不通过 + * @throws Exception 可能的异常 + */ + public boolean check(HttpRequest request, String permission) throws Exception; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/CheckRule.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/CheckRule.java new file mode 100644 index 0000000..60a2f74 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/CheckRule.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.rule; + +import org.zhiqim.httpd.HttpRequest; + +/** + * 仅通过request验证权限,如是否是管理员等会话判断 + * <#if ChkAdminRule.check(request)> + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface CheckRule +{ + /** + * 验证权限是否通过接口,用于判断条件 + * + * @param request 请求的上下文环境 + * @return =true表示验证通过,=false表示验证不通过 + * @throws Exception 可能的异常 + */ + public boolean check(HttpRequest request) throws Exception; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/ReplaceObjectRule.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/ReplaceObjectRule.java new file mode 100644 index 0000000..335241c --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/ReplaceObjectRule.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.rule; + +import org.zhiqim.httpd.HttpRequest; + +/** + * 定义替换对象验证接口,通过请求和指定对象验证是否有权限如功能菜单等,举例: + * <#if ChkObjectRule.replace(request, item)> + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface ReplaceObjectRule +{ + /** + * 检查权限接口,指定权限字符串,如菜单ID,菜单URL等 + * + * @param request 请求的上下文环境 + * @param obj 请求验证的对象 + * @param url 请求的URL信息 + * @return =true表示验证通过,=false表示验证不通过 + * @throws Exception 可能的异常 + */ + public boolean replace(HttpRequest request, Object obj, String url) throws Exception; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/ReplacePermissionRule.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/ReplacePermissionRule.java new file mode 100644 index 0000000..65321bd --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/ReplacePermissionRule.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.rule; + +import org.zhiqim.httpd.HttpRequest; + +/** + * 定义替换权限接口,通过请求和指定参数验证,成功返回要求的URL,否则返回验证权限URL,举例: + * + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface ReplacePermissionRule +{ + /** + * 替换权限接口定义,当参数验证未通过则返回指定的URL + * + * @param request 请求的上下文环境 + * @param permission 请求权限参数信息 + * @param url 请求的URL信息 + * @return 检验之后的有效信息 + * @throws Exception 可能的异常 + */ + public String replace(HttpRequest request, String permission, String url) throws Exception; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/ReplaceRule.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/ReplaceRule.java new file mode 100644 index 0000000..474c3c9 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/rule/ReplaceRule.java @@ -0,0 +1,43 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.rule; + +import org.zhiqim.httpd.HttpRequest; + +/** + * 定义替换权限接口,通过请求和指定参数验证,成功返回要求的URL,否则返回验证权限URL,举例: + * + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface ReplaceRule +{ + /** + * 替换权限接口定义,当参数验证未通过则返回指定的URL + * + * @param request 请求的上下文环境 + * @param url 请求的URL信息 + * @return 检验之后的有效URL信息 + * @throws Exception 可能的异常 + */ + public String replace(HttpRequest request, String url) throws Exception; +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/service/AjaxService.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/service/AjaxService.java new file mode 100644 index 0000000..7b6e494 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/service/AjaxService.java @@ -0,0 +1,83 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.service; + +import java.io.IOException; + +import org.zhiqim.httpd.HttpExecutor; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.ZmlContextConstants; +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; + +/** + * Ajax服务,提供给页面调用,验证方式如下: + * 1.连接提供当页面地址且在ZAction中能找到,格式如:/service/ajax?path=window.location.pathname + * 2.必须有会话,且会话不是首次创建。 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + * @version v1.3.0 @author zouzhigang 2017-3-15 增加对表单方式的提交 + */ +public class AjaxService implements HttpExecutor, ZmlContextConstants +{ + @Override + public boolean isMatch(String pathInContext) + { + return _PATH_SERVICE_AJAX_.equals(pathInContext); + } + + @Override + public void handle(HttpRequest request, HttpResponse response) throws IOException + { + if (!request.isXMLHttpRequest() || !_POST_.equals(request.getMethod()) || + !(_TEXT_PLAIN_.equals(request.getMimeType()) || _APPLICATION_X_WWW_FORM_.equals(request.getMimeType())) || + !_UTF_8_.equalsIgnoreCase(request.getCharacterEncodingHeader())) + {//要求XMLHttpRequest/POST/text/plain/UTF-8的访问 + response.sendError(_403_FORBIDDEN_); + return; + } + + String path = request.getParameterOnURL(ZC_PATH); + String serviceId = Strings.trim(request.getHeader(_X_RMI_SERVICE_), ""); + String clazz = Strings.trim(request.getHeader(_X_RMI_CLASS_), ""); + String method = request.getHeader(_X_RMI_METHOD_); + if (Validates.isEmptyBlank(path) || (Validates.isEmptyBlank(clazz) && Validates.isEmptyBlank(serviceId)) || Validates.isEmptyBlank(method)) + {//必须指定访问路径,类和方法名,否则认为是非法请求 + response.sendError(_412_PRECONDITION_FAILED_); + return; + } + + RmiService service = ((Context)request.getContext()).getServiceExecutor().getRmiService(); + + String classNameId = Validates.isEmpty(clazz)?serviceId:clazz; + String interceptors = request.getContextAttributeString(_SERV_AJAX_INTERCEPTOR_); + if (!service.chkInterceptor(request, response, interceptors, classNameId, method)) + {//如果有配置缺省拦截器时,有错误或认证失败不再继续 + return; + } + + //最后由RMI服务处理 + service.service(request, response); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/service/ResourceService.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/service/ResourceService.java new file mode 100644 index 0000000..b820f56 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/service/ResourceService.java @@ -0,0 +1,143 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.service; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpExecutor; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.constants.HttpMimeType; +import org.zhiqim.httpd.context.ZmlContextConstants; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Resources; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; + +/** + * 资源文件服务 + * /service/res/* + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ResourceService implements HttpExecutor, ZmlContextConstants +{ + private static final Log log = LogFactory.getLog(ResourceService.class); + + private final HashMap resourceMap = new HashMap(); + private final String lastModifiedTime = DateTimes.getDateTimeHttp(); + + public ResourceService() + { + try + { + //本目录下文件 + List fileNameList = Resources.getResourceFileNameList(ResourceService.class, _SERV_RESOURCE_CLASSPATH_); + + List imageList = Resources.getResourceFileNameList(ResourceService.class, _SERV_RESOURCE_CLASSPATH_ + "image/"); + for (String image : imageList) + {//image文件 + fileNameList.add("image/"+image); + } + + List fontList = Resources.getResourceFileNameList(ResourceService.class, _SERV_RESOURCE_CLASSPATH_ + "font/"); + for (String font : fontList) + {//font文件 + fileNameList.add("font/"+font); + } + + List swfList = Resources.getResourceFileNameList(ResourceService.class, _SERV_RESOURCE_CLASSPATH_ + "swf/"); + for (String swf : swfList) + {//swf文件 + fileNameList.add("swf/"+swf); + } + + for (String fileName : fileNameList) + {//对文件缓存 + resourceMap.put(fileName, Streams.getBytesClassPath(ResourceService.class, _SERV_RESOURCE_CLASSPATH_ + fileName)); + } + } + catch (IOException e) + { + log.error("初始化系统资源文件时失败", e); + } + } + + @Override + public boolean isMatch(String pathInContext) + { + return Validates.isMatch(pathInContext, _PATH_SERVICE_RESOURCE_); + } + + @Override + public void handle(HttpRequest request, HttpResponse response) throws IOException + { + HttpContext context = request.getContext(); + String path = request.getPathInContext(); + String name = Strings.removeStartsWith(path, "/service/res/"); + if (!resourceMap.containsKey(name)) + {//不存在 + response.sendError(_404_NOT_FOUND_); + return; + } + + String ifModifiedSince = request.getHeader(_IF_MODIFIED_SINCE_); + if (ifModifiedSince != null && ifModifiedSince.indexOf(lastModifiedTime) != -1) + {//如果有要求未修改返回304 + response.setHeader(_CACHE_CONTROL_, _MAX_AGE_+"="+context.getExpires()); + response.sendHeader(_304_NOT_MODIFIED_); + return; + } + + //找到则设置响应属性 + String fileExt = Files.getFileExt(path); + String mimeType = request.getMimeType(); + if (mimeType == null) + mimeType = HttpMimeType.getResourceMimeType(fileExt); + + if (mimeType != null)//强制UTF-8 + response.setContentType(mimeType+"; charset="+_UTF_8_); + + //设置响应内容属性 + response.setCharacterEncoding(_UTF_8_); + response.setHeader(_ACCEPT_RANGES_, _BYTES_); + response.setHeader(_LAST_MODIFIED_, lastModifiedTime); + + if (request.isMethodResponseContent()) + {//GET,POST + byte[] content = resourceMap.get(name); + response.setHeader(_CONTENT_LENGTH_, content.length); + response.setHeader(_CACHE_CONTROL_, _MAX_AGE_+"="+context.getExpires()); + response.write(content); + } + + response.commit(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/service/RmiService.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/service/RmiService.java new file mode 100644 index 0000000..083be27 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/service/RmiService.java @@ -0,0 +1,619 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.service; + +import java.io.IOException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpExecutor; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.ZmlBootstrap; +import org.zhiqim.httpd.context.ZmlContextConstants; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.context.annotation.AnInterceptNot; +import org.zhiqim.httpd.context.config.ZActionPackageLoader; +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.httpd.context.core.Interceptor; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnFilterNot; +import org.zhiqim.kernel.annotation.AnGlobal; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.Service; +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Htmls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.MD5; +import org.zhiqim.kernel.util.consts.Int; + +/** + * 远程方法调用,通过HTTP封装返回字符串类型值,返回值由类的方法决定 + * 1.应用,格式如201200 + * 2.时间戳,格式如2014-03-21 11:52:23 + * 3.类名,格式如org.zhiqim.Test + * 4.方法名,格式如doTest + * 5.签名,格式为MD5.encodeUTF8(key + timestamp + className + methodName + secret) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + * @version v1.3.0 @author zouzhigang 2017-3-15 增加对表单方式的提交 + */ +public class RmiService implements HttpExecutor, ZmlContextConstants +{ + private int timeDifference = 10 * 60 * 1000; + private HashSet innerObjs = new HashSet<>(); + private HashMap> classMap = new HashMap>(); + private HashMap instanceMap = new HashMap(); + + public RmiService() + { + innerObjs.add(_CONTEXT_); + innerObjs.add(_SESSION_); + innerObjs.add(_SESSION_USER_); + innerObjs.add(_LOG_); + } + + @Override + public boolean isMatch(String pathInContext) + { + return _PATH_SERVICE_RMI_.equals(pathInContext); + } + + @Override + public void handle(HttpRequest request, HttpResponse response) throws IOException + { + if (!_POST_.equals(request.getMethod()) || + !(_TEXT_PLAIN_.equals(request.getMimeType()) || _APPLICATION_X_WWW_FORM_.equals(request.getMimeType())) || + !_UTF_8_.equalsIgnoreCase(request.getCharacterEncodingHeader())) + {//不是POST/text/plain/UTF-8/的访问禁止 + response.sendError(_403_FORBIDDEN_); + return; + } + + String serviceId = Strings.trim(request.getHeader(_X_RMI_SERVICE_), ""); + String clazz = Strings.trim(request.getHeader(_X_RMI_CLASS_), ""); + String method = request.getHeader(_X_RMI_METHOD_); + String key = request.getHeader(_X_RMI_KEY_); + String timestamp = request.getHeader(_X_RMI_TIMESTAMP_); + String authorization = request.getHeader(_X_RMI_AUTHORIZATION_); + if ((Validates.isEmptyBlank(serviceId) && Validates.isEmptyBlank(clazz)) || Validates.isEmptyBlank(method) + || Validates.isEmptyBlank(key) || Validates.isEmptyBlank(authorization) || !Validates.isDateTime(timestamp)) + {//基础5个参数必须填入,否则认为是非法请求 + response.sendError(_400_BAD_REQUEST_); + return; + } + + long diffTime = System.currentTimeMillis() - DateTimes.toLong(timestamp); + if ((diffTime > 0 && diffTime > timeDifference) || (diffTime < 0 && diffTime < -timeDifference)) + {//误差只允许在10分钟以内 + response.sendError(_400_BAD_REQUEST_); + return ; + } + + HttpContext context = request.getContext(); + String secret = context.getAttributeString("rmi."+key); + if (Validates.isEmptyBlank(secret)) + { + response.sendError(_403_FORBIDDEN_); + return; + } + + String sign = MD5.encodeUTF8(key + timestamp + clazz + method + serviceId + secret); + if (!authorization.equalsIgnoreCase(sign)) + {//验证签名失败 + response.sendError(_401_UNAUTHORIZED_); + return; + } + + String remoteIp = request.getRemoteAddr(); + String ipWhiteList = context.getAttributeString("rmi."+key+_SERV_IP_WHITE_LIST_SUFFIX_); + String ipBlackList = context.getAttributeString("rmi."+key+_SERV_IP_BLACK_LIST_SUFFIX_); + boolean ipDefaultPermission = context.getAttributeBoolean("rmi."+key+_SERV_IP_DEFAULT_PERMISSION_, true); + if (!Validates.isIPAllowByWhiteBlackList(remoteIp, ipWhiteList, ipBlackList, ipDefaultPermission)) + {//对IP进行鉴权,支持黑白名单,开放时黑名单禁止访问,关闭时仅白名单可访问 + response.sendError(_403_FORBIDDEN_); + return; + } + + service(request, response); + } + + /*** + * 正常服务提供 + * + * @param request 请求 + * @param response 响应 + * @throws IOException 异常 + */ + void service(HttpRequest request, HttpResponse response) throws IOException + { + Context context = (Context)request.getContext(); + ZmlBootstrap bootstrap = context.getBootstrap(); + + request.setResponseNoCache(); + request.setResponseEncodingUTF8(); + response.setContentType(_TEXT_PLAIN_); + + //第一步,检查类名是否正确,先判断别名,再判断是否已处理,最后forName + String serviceId = Strings.trim(request.getHeader(_X_RMI_SERVICE_), ""); + String className = Strings.trim(request.getHeader(_X_RMI_CLASS_), ""); + String classNameId = Validates.isEmpty(className)?serviceId:className; + + Class curClass = getClass(request, serviceId, className); + if (curClass == null) + { + if (Validates.isEmpty(serviceId)) + { + bootstrap.log(request, "["+className+"类名和别名不存在]"); + response.sendError(_412_PRECONDITION_FAILED_, "["+className+"]类名和别名不存在"); + } + else + { + bootstrap.log(request, "[未找到"+serviceId+"对应的服务]"); + response.sendError(_412_PRECONDITION_FAILED_, "[未找到"+serviceId+"对应的服务]"); + } + return; + } + + //第二步,检查参数对应的方法,匹配成功得到参数列表 + String methodName = request.getHeader(_X_RMI_METHOD_); + + List paramList = new ArrayList(); + Method curMethod = getMethod(request, response, curClass, paramList); + if (curMethod == null) + { + bootstrap.log(request, "["+classNameId+"]中的["+methodName+"]未找到或参数不匹配"); + response.sendError(_412_PRECONDITION_FAILED_, "["+methodName+"]未找到或参数不匹配"); + return; + } + + //第三步,检查拦截器,如果有拦截器要先处理 + AnIntercept classInterceptor = curClass.getAnnotation(AnIntercept.class); + AnIntercept methodInterceptor = curMethod.getAnnotation(AnIntercept.class); + AnInterceptNot methodInterceptorNot = curMethod.getAnnotation(AnInterceptNot.class); + String interceptors = ZActionPackageLoader.getInterceptor(classInterceptor, methodInterceptor, methodInterceptorNot); + if (Validates.isNotEmpty(interceptors)) + { + if (!chkInterceptor(request, response, interceptors, classNameId, methodName)) + {//拦截时,有错误或认证失败不再继续 + return; + } + } + + //第四步,对参数进行安全过滤,如果未指定,则要求安全过滤 + Object[] curParams = paramList.toArray(); + if (!curMethod.isAnnotationPresent(AnFilterNot.class)) + { + for (int i=0;i txIdList = new ArrayList<>(); + AnTransaction classTx = curClass.getAnnotation(AnTransaction.class); + + if (classTx != null) + { + hasTx = true; + if (Validates.isEmpty(classTx.value())) + allTx = true; + else + { + for (String id : classTx.value()) + txIdList.add(id); + } + } + + if (!allTx) + {//如果不是所有的则再检查方法中的定义 + AnTransaction methodTx = curMethod.getAnnotation(AnTransaction.class); + if (methodTx != null) + { + hasTx = true; + if (Validates.isEmpty(methodTx.value())) + allTx = true; + else + { + for (String id : methodTx.value()) + txIdList.add(id); + } + } + } + + Object result = null; + Transaction tx = null; + + try + { + if (hasTx) + {//定义事务则开始 + String[] ids = allTx?new String[0]:Arrays.toFilterSameList(txIdList); + tx = TransactionManager.beginTransaction(ids); + } + + //第六步,调用类方法,得到结果 + curMethod.setAccessible(true); + if (Modifier.isStatic(curMethod.getModifiers())) + {//6.1优先静态方法 + result = curMethod.invoke(null, curParams); + } + else if (Validates.isNotEmpty(serviceId) && Global.hasService(serviceId)) + {//6.2其次判断是否是服务 + Object instance = Global.getService(serviceId); + result = curMethod.invoke(instance, curParams); + } + else if (innerObjs.contains(className)) + {//6.3再次内部对象,取其实例 + Object instance = getInnerObject(request, className); + result = curMethod.invoke(instance, curParams); + } + else if (context.hasActionInstance(className)) + {//6.4再次类是Action,取其实例 + Object instance = context.getActionInstance(className); + result = curMethod.invoke(instance, curParams); + } + else if (curClass.isAnnotationPresent(AnNew.class)) + {//6.5然后判断是否指定每次都新建该类,保持属性为原始数据 + Object instance = curClass.newInstance(); + result = curMethod.invoke(instance, curParams); + } + else if (curClass.isAnnotationPresent(AnGlobal.class)) + {//6.6再然后,如果定义在AnGlobal中,取全局变量 + Object instance = Global.getWithoutNew(curClass); + result = curMethod.invoke(instance, curParams); + } + else + {//6.7最后默认采用单例,如果属性被修改,后续调用为修改后数据 + + Object instance = instanceMap.get(className); + if (instance == null) + { + instance = curClass.newInstance(); + instanceMap.put(className, instance); + } + + result = curMethod.invoke(instance, curParams); + } + + if (tx != null) + {//事务提交 + try{tx.commit();}catch (Exception e){bootstrap.log(request, "["+classNameId+"]["+methodName+"][tx.commit()异常]", e);throw new Exception();} + } + + if (response.isCommitted()) + { + bootstrap.log(request, "["+classNameId+"]["+methodName+"][Commited]"); + return; + } + } + catch(Exception e) + {//6.8.调用类方法异常 + + if (tx != null) + {//事务回滚 + try{tx.rollback();}catch (Exception e1){bootstrap.log(request, "["+className+"]["+methodName+"][tx.rollback异常]", e1);} + } + + if (response.isCommitted()) + { + bootstrap.log(request, "["+classNameId+"]["+methodName+"][Commited]"); + return; + } + + String error = e.getMessage(); + if (e.getCause() != null) + {//反射调用时,多了一级InvokeTargetException + error = e.getCause().getMessage(); + if (error == null) + error = "未知错误["+e.getCause().getClass().getName()+"]"; + } + + if (error == null) + {//为空最后统一显示未知错误 + error = "未知错误"; + } + + bootstrap.log(request, "["+classNameId+"]["+methodName+"]调用异常", e); + response.sendError(_500_INTERNAL_SERVER_ERROR_, error); + return; + } + finally + { + if (tx != null) + {//事务关闭 + try{tx.close();}catch (Exception e){bootstrap.log(request, "["+classNameId+"]["+methodName+"][tx.close异常]", e);} + } + } + + //第七步,返回结果,两种方法的支持,1)方法返回结果ret,2)结果放置到属性中返回 + int status = request.getResponseStatus(); + String text = request.getResponseText(); + + if (void.class == curMethod.getReturnType()) + {//无返回值时结果取text + result = text; + } + else if (Int.class == curMethod.getReturnType()) + {//返回值为Int时要拆开 + Int ret = (Int)result; + status = ret.value(); + result = ret.desc(); + } + //else{其他类型取toString} + + if (result == null) + result = ""; + + if (status == 0) + { + bootstrap.log(request, "["+classNameId+"]["+methodName+"]"); + response.sendContent(200, result.toString()); + } + else + { + bootstrap.log(request, "["+classNameId+"]["+methodName+"]["+status+"]"); + if (status >= _601_REDIRECT_PARENT_ && status <= _603_REDIRECT_TOP_) + response.sendContent(status, result.toString());//重定向 + else + response.sendError(status, result.toString()); + } + } + + /** + * 检查拦截器 + * + * @param request 请求 + * @param response 响应 + * @param interceptors 拦截器值 + * @return 是否成功,=true表示成功,=false表示失败,退出 + * @throws IOException 异常 + */ + public boolean chkInterceptor(HttpRequest request, HttpResponse response, String interceptors, String classNameId, String methodName) throws IOException + { + if (Validates.isEmpty(interceptors)) + return true; + + Context context = (Context)request.getContext(); + ZmlBootstrap bootstrap = context.getBootstrap(); + + List interceptorList = context.getInterceptorList(interceptors); + for (Interceptor interceptor : interceptorList) + { + if (interceptor == null) + { + bootstrap.log(request, "["+classNameId+"]["+methodName+"][拦截器("+interceptors+")]某个不存在,请管理员检查配置"); + response.sendError(_621_INTERCEPTOR_NOT_EXIST_, "[拦截器("+interceptors+")]某个不存在,请管理员检查配置"); + return false; + } + + try + { + interceptor.intercept(request); + if (response.isCommitted()) + { + bootstrap.log(request, "["+classNameId+"]["+methodName+"][拦截器("+interceptor+")]直接处理结果"); + return false; + } + + if (!request.isResponseSuccess()) + { + int status = request.getResponseStatus(); + String text = request.getResponseText(); + response.sendError(status, text); + bootstrap.log(request, "["+classNameId+"]["+methodName+"][拦截器("+interceptor+")]拦截"+(request.isResponseRedirect()?"并重定向":"")); + return false; + } + } + catch(Exception e) + { + bootstrap.log(request, "["+classNameId+"]["+methodName+"][拦截器("+interceptor+")]调用异常,"+e.getMessage(), e); + response.sendError(_623_INTERCEPTOR_EXCEPTION_, e.getMessage()==null?"未知错误":e.getMessage()); + return false; + } + } + + return true; + } + + + /** 获取类结构 */ + private Class getClass(HttpRequest request, String serviceId, String className) + { + if (Validates.isNotEmpty(serviceId)) + {//1.如果有服务ID,以服务ID为准 + Service service = Global.getService(serviceId); + if (service == null) + return null; + + //如果类名也提供,则再比较类名也必须相等 + Class clazz = service.getClass(); + if (Validates.isEmpty(className) || className.equals(clazz.getName())) + return clazz; + else + return null; + } + + //2.优先类别名 + Class clazz = Global.getClass(className); + if (clazz != null) + return clazz; + + //3.再判断内置类 + + + clazz = classMap.get(className); + if (clazz != null) + return clazz; + + clazz = getInnerClass(request, className); + if (clazz != null) + return clazz; + + clazz = Classes.forName(className); + if (clazz == null) + return null; + + classMap.put(className, clazz); + return clazz; + } + + /** 获取方法 */ + private Method getMethod(HttpRequest request, HttpResponse response, Class curClass, List curParams) + { + String methodName = request.getHeader(_X_RMI_METHOD_); + List paramList = parseParameters(request); + + Method[] mtds = curClass.getMethods(); + for (Method method : mtds) + { + //2.1.判断方法名或别名是否相同,方向名不同结束本次查找 + AnAlias alias = method.getAnnotation(AnAlias.class); + if (!(methodName.equals(method.getName()) || (alias != null && methodName.equals(alias.value())))) + continue; + + //2.2.判断参数个数是否相同,把形参为HttpRequest和HttpResponse的填充实参request和response,并记录数目 + Class[] paramTypes = method.getParameterTypes(); + int reqRespNum = 0; + for (Class clazz : paramTypes) + { + if (clazz == HttpRequest.class || clazz == HttpResponse.class) + reqRespNum++; + } + + //2.3.判断参数个数是否相等,个数不相等结束本次查找 + if (paramTypes.length - reqRespNum != paramList.size()) + continue; + + //2.4.判断参数类型是否匹配成功 + boolean isMatch = true; + Object[] paramValues = new Object[paramTypes.length]; + for (int i=0, ind=0;i parseParameters(HttpRequest request) + { + if (request.isMimeForm()) + return new ArrayList(); + + String parameters = request.getInputStreamString(); + if (Validates.isEmptyBlank(parameters)) + return new ArrayList(); + + parameters = Urls.decodeUTF8(parameters); + List paramList = new ArrayList(); + for (int i=0,start=0,end=parameters.indexOf('#');end!=-1;i++,start=end,end=parameters.indexOf('#', start+1)) + { + if (i % 2 == 0) + continue; + String param = parameters.substring(start + 1, end); + if (param.indexOf("-%2-%-3%-") != -1) + param = param.replaceAll("-%2-%-3%-", "#"); + paramList.add(param); + } + + return paramList; + } + + /**********************************************************************************/ + //支持的四个内部对象 + /**********************************************************************************/ + + private Class getInnerClass(HttpRequest request, String className) + { + if (!innerObjs.contains(className)) + return null; + + if (_CONTEXT_.equals(className)) + return request.getContext().getClass(); + else if (_LOG_.equals(className)) + return request.getLog().getClass(); + else if (_SESSION_.equals(className)) + return request.getSession() == null?null:request.getSession().getClass(); + else + return request.getSessionUser() == null?null:request.getSessionUser().getClass(); + } + + private Object getInnerObject(HttpRequest request, String className) + { + if (!innerObjs.contains(className)) + return null; + + if (_CONTEXT_.equals(className)) + return request.getContext(); + else if (_LOG_.equals(className)) + return request.getLog(); + else if (_SESSION_.equals(className)) + return request.getSession(); + else + return request.getSessionUser(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/service/UploadAccessService.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/service/UploadAccessService.java new file mode 100644 index 0000000..81c1071 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/service/UploadAccessService.java @@ -0,0 +1,142 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.service; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpExecutor; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.constants.HttpMimeType; +import org.zhiqim.httpd.context.ZmlContextConstants; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.Base64; + +/** + * 上传文件访问服务,用于固定访问地址为/service/upl/*,中间*=${fileDir}/${fileId},实际处理在forward中 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class UploadAccessService implements HttpExecutor, ZmlContextConstants +{ + private static final Log log = LogFactory.getLog(UploadAccessService.class); + private String uploadRootDir; + + @Override + public boolean isMatch(String pathInContext) + { + return Validates.isMatch(pathInContext, _PATH_SERVICE_UPLOAD_ACCESS_); + } + + @Override + public void handle(HttpRequest request, HttpResponse response) throws IOException + { + HttpContext context = request.getContext(); + String forward = (String)context.getAttribute(_SERV_UPLOAD_FORWARD_); + if (Validates.isNotEmpty(forward)) + {//跳转优先,成功则跳转到对应的连接 + try{request.forwardTo(forward);} + catch(Exception e){response.sendHeader(_500_INTERNAL_SERVER_ERROR_);} + return; + } + + /**************************************************************/ + //当前处理方式 + /**************************************************************/ + if (uploadRootDir == null) + { + String rootDir = (String)context.getAttribute(_SERV_UPLOAD_ROOT_DIR_); + if (Validates.isEmptyBlank(rootDir) || !Files.mkDirectory(rootDir)) + { + log.error("[UploadAccessService][配置处理器处理时必须配置上传根目录][%s]", _SERV_UPLOAD_ROOT_DIR_); + response.sendError(_403_FORBIDDEN_); + return; + } + + uploadRootDir = Files.toLinuxPath(new File(rootDir).getCanonicalPath()); + uploadRootDir = Strings.addEndsWith(uploadRootDir, "/"); + } + + String filePath = Strings.removeStartsWith(request.getPathInContext(), _PATH_UPLOAD_PREFIX_); + String fileDir = Files.getFileDirPath(filePath, "/"); + String fileName = Files.getFileNameLinux(filePath); + + if (Validates.isNotEmpty(fileDir)) + { + fileDir = Base64.decodeFileUrlUTF8(fileDir); + } + + if (Validates.isEmpty(fileDir)) + filePath = uploadRootDir + fileName; + else + filePath = uploadRootDir + fileDir + "/" + fileName; + + File file = new File(filePath); + if (!file.exists() || !file.isFile()) + {//不存在或不是文件 + response.sendError(_404_NOT_FOUND_); + return; + } + + if (file.isHidden() || !file.canRead()) + {//隐藏、不可读和文件大小超限 + response.sendError(_403_FORBIDDEN_); + return; + } + + //设置文件类型 + String fileExt = Files.getFileExt(fileName); + response.setContentType(HttpMimeType.getResourceMimeType(fileExt)); + + long lastModified = file.lastModified(); + String lastModifiedTime = DateTimes.getDateTimeHttp(lastModified); + String ifModifiedSince = request.getHeader(_IF_MODIFIED_SINCE_); + if (ifModifiedSince != null && ifModifiedSince.indexOf(lastModifiedTime) != -1) + {//时间相等 + response.sendHeader(_304_NOT_MODIFIED_); + return; + } + + response.setHeader(_ACCEPT_RANGES_, _BYTES_); + response.setHeader(_LAST_MODIFIED_, lastModifiedTime); + + if (request.isMethodResponseContent()) + {//GET,POST + try(FileInputStream fis = new FileInputStream(file)) + { + Streams.putBytes(fis, response.getOutputStream()); + } + } + + response.commit(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/service/UploadService.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/service/UploadService.java new file mode 100644 index 0000000..528213c --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/service/UploadService.java @@ -0,0 +1,165 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.service; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpExecutor; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.ZmlContextConstants; +import org.zhiqim.httpd.util.Responses; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.Base64; + +/** + * 上传服务,用于固定访问地址为/service/upload,实际处理在forward中 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class UploadService implements HttpExecutor, ZmlContextConstants +{ + private static final Log log = LogFactory.getLog(UploadService.class); + private static final String[] FILE_DIR_NOT_FORMAT = {".", "\\", "?", ":", "*", "\'", "\"", "<", ">", "|"}; + + private String uploadRootDir; + + @Override + public boolean isMatch(String pathInContext) + { + return _PATH_SERVICE_UPLOAD_.equals(pathInContext); + } + + @Override + public void handle(HttpRequest request, HttpResponse response) throws IOException + { + String sessionName = Strings.toString(request.getSessionName(), "guest"); + + /**********************************************************/ + //第一步,判断上传参数 + /**********************************************************/ + int mode = request.getHeaderInt(_X_RESPONSED_MODE_, 0); + String fileDir = request.getHeader(_X_UPLOAD_FILE_DIR_); + String fileName = request.getHeader(_X_UPLOAD_FILE_NAME_); + int contentLength = request.getContentLength(); + + fileDir = Urls.decodeUTF8(fileDir); + fileDir = Strings.removeStartsWith(fileDir, "/"); + fileDir = Strings.removeEndsWith(fileDir, "/"); + fileName = Urls.decodeUTF8(fileName); + + if (mode < 0 || mode > 1 //响应模式,默认0 + || Validates.isStrContainStrArr(fileDir, FILE_DIR_NOT_FORMAT) //文件目录不支持.\:*?'"<>| + || Validates.isEmptyBlank(fileName) //文件名不能为空 + || contentLength <= 0) //内容不能为空 + { + log.error("[Upload][%s][参数不正确]", sessionName); + response.sendError(_412_PRECONDITION_FAILED_); + return; + } + + /**********************************************************/ + //第二步,跳转优先 + /**********************************************************/ + HttpContext context = request.getContext(); + String forward = (String)context.getAttribute(_SERV_UPLOAD_FORWARD_); + + if (Validates.isNotEmpty(forward)) + {//跳转优先,成功则跳转到对应的连接 + try{request.forwardTo(forward);} + catch(Exception e){try{response.sendHeader(_500_INTERNAL_SERVER_ERROR_);}catch(Exception e2){}} + return; + } + + /**********************************************************/ + //第三步,判断文件PATH和URL,生成并返回 + //1.文件根目录配置必须 + //2.对文件目录进行检查,并生成URL对应的BASE64编码的目录名 + //3.写入文件并返回URL + /**********************************************************/ + + if (uploadRootDir == null) + {//1.文件根目录配置必须 + String rootDir = (String)context.getAttribute(_SERV_UPLOAD_ROOT_DIR_); + if (Validates.isEmptyBlank(rootDir) || !Files.mkDirectory(rootDir)) + { + log.error("[Upload][%s][配置处理器处理时必须配置上传根目录][%s]", sessionName, _SERV_UPLOAD_ROOT_DIR_); + response.sendError(_403_FORBIDDEN_); + return; + } + + uploadRootDir = Files.toLinuxPath(new File(rootDir).getCanonicalPath()); + uploadRootDir = Strings.addEndsWith(uploadRootDir, "/"); + } + + //2.对文件目录进行分析并创建 + String fileDirPath = null; + if (Validates.isEmptyBlank(fileDir)) + fileDirPath = uploadRootDir; + else + { + fileDirPath = uploadRootDir + fileDir + "/"; + if (!Files.mkDirectory(fileDirPath)) + { + log.error("[Upload][%s][上传的文件目录无法创建][%s]", sessionName, request.getHeader(_X_UPLOAD_FILE_DIR_)); + response.sendError(_403_FORBIDDEN_); + return; + } + } + + String fileExt = Files.getFileExt(fileName); + fileName = Ids.uuid() + Files.fixFileExt(fileExt); + + String filePath = fileDirPath + fileName; + + String fileUrl = null; + if (Validates.isEmptyBlank(fileDir)) + fileUrl = _PATH_UPLOAD_PREFIX_ + fileName; + else + { + String fileDirUrl = Base64.encodeFileUrlUTF8(fileDir); + fileUrl = _PATH_UPLOAD_PREFIX_ + fileDirUrl + "/" + fileName; + } + + //写入文件 + byte[] data = Streams.getBytes(request.getInputStream(), contentLength); + Files.writeReturnSize(filePath, data); + + //返回URL + log.info("[Upload][%s][上传完成][%s]", sessionName, fileName); + HashMap headerMap = new HashMap(); + headerMap.put(_X_UPLOAD_FILE_URL_, fileUrl); + + Responses.doReturnMessage(response, mode, headerMap); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/context/service/VcodeService.java b/zhiqim_httpd/src/org/zhiqim/httpd/context/service/VcodeService.java new file mode 100644 index 0000000..faeb51c --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/context/service/VcodeService.java @@ -0,0 +1,190 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.service; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.Random; + +import javax.imageio.ImageIO; + +import org.zhiqim.httpd.HttpExecutor; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.ZmlContextConstants; + +import org.zhiqim.kernel.util.Validates; + +/** + * 验证码调用,业务系统可通过配置覆盖 + * /service/vcode.jpg + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public final class VcodeService implements HttpExecutor, ZmlContextConstants +{ + private static Random random = new Random(); + + @Override + public boolean isMatch(String pathInContext) + { + return _PATH_SERVICE_VCODE_.equals(pathInContext); + } + + @Override + public void handle(HttpRequest request,HttpResponse response) throws IOException + { + if (!Validates.isWindows()) + System.setProperty("java.awt.headless", "true"); + + int width = request.getParameterInt("width", request.getContextAttributeInt("vcode.width", 60)); + int height = request.getParameterInt("height", request.getContextAttributeInt("vcode.height", 28));//有z-input指定的高度相等 + String textColor = request.getParameter("textColor", request.getContextAttributeString("vcode.textColor", "#ffffff")); + String bgColor = request.getParameter("bgColor", request.getContextAttributeString("vcode.bgColor", "#0826A9"));//蓝色 + int fontSize = request.getParameterInt("fontSize", request.getContextAttributeInt("vcode.fontSize", 18)); + String fontFamily = request.getParameter("fontFamily", request.getContextAttributeString("vcode.fontFamily", "Arial")); + String fontWidthRatio = request.getParameter("fontWidthRatio", request.getContextAttributeString("vcode.fontWidthRatio", "0.6"));//Arial宽度比定为0.5 + boolean isYawp = request.getParameterBoolean("yawp", request.getContextAttributeBoolean("vcode.yawp", false)); + boolean isDisturb = request.getParameterBoolean("disturb", request.getContextAttributeBoolean("vcode.disturb", false)); + + //计算字间隔 + float wSplit = width/4 - fontSize*Float.parseFloat(fontWidthRatio); + if (wSplit < 0) + wSplit = 0; + float hSplit = (height - fontSize) / 2; + if (hSplit < 0) + hSplit = 0; + + //字体颜色 + int textRed = Integer.parseInt(textColor.substring(1, 3), 16); + int textGreen = Integer.parseInt(textColor.substring(3, 5), 16); + int textBlue = Integer.parseInt(textColor.substring(5), 16); + Color text = new Color(textRed, textGreen, textBlue); + + //背景颜色 + int bgRed = Integer.parseInt(bgColor.substring(1, 3), 16); + int bgGreen = Integer.parseInt(bgColor.substring(3, 5), 16); + int bgBlue = Integer.parseInt(bgColor.substring(5), 16); + Color bg = new Color(bgRed, bgGreen, bgBlue); + + //字体 + Font font = new Font(fontFamily, Font.PLAIN, fontSize); + + //设置为图片信息 + response.setContentType("image/jpeg"); + BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + + Graphics g = image.getGraphics(); + g.setColor(bg); + g.fillRect(0, 0, width, height); + g.setFont(font); + + if (isYawp) + { + doAddYawp(image, width, height); + } + + if (isDisturb) + { + doAddDisturb(g, width, height); + } + + Random random = new Random(); + String sRand = ""; + for (int i=0;i<4;i++) + { + String rand = String.valueOf(random.nextInt(10)); + sRand += rand; + + g.setColor(text); + int x = Math.round((width/4) * i + wSplit / 2); + int y = Math.round(fontSize + hSplit) - 2; + g.drawString(rand, x, y); + } + g.dispose(); + + request.getSession().setAttribute(ZC_VCODE_SESSION_NAME ,sRand); + ImageIO.write(image, "JPEG", response.getOutputStream()); + } + + /** 增加噪点 */ + private void doAddYawp(BufferedImage image, int width, int height) + { + float yawpRate = 0.08f;// 噪声率 + int area = (int) (yawpRate * width * height); + for (int i = 0; i < area; i++) + { + int x = random.nextInt(width); + int y = random.nextInt(height); + int rgb = getRandomColorInt(); + image.setRGB(x, y, rgb); + } + } + + /** 增加干扰线 */ + private void doAddDisturb(Graphics g, int width, int height) + { + g.setColor(getRandomColor(160, 200)); + + Random rd = new Random(); + for (int i = 0; i < 20; i++) + { + int x = rd.nextInt(width - 1); + int y = rd.nextInt(height - 1); + int xl = rd.nextInt(6) + 1; + int yl = rd.nextInt(12) + 1; + g.drawLine(x, y, x + xl + 40, y + yl + 20); + } + } + + private Color getRandomColor(int fc, int bc) + { + if (fc > 255) + fc = 255; + if (bc > 255) + bc = 255; + int r = fc + random.nextInt(bc - fc); + int g = fc + random.nextInt(bc - fc); + int b = fc + random.nextInt(bc - fc); + return new Color(r, g, b); + } + + private int getRandomColorInt() + { + int[] rgb = new int[3]; + for (int i = 0; i < 3; i++) + { + rgb[i] = random.nextInt(255); + } + + int color = 0; + for (int c : rgb) + { + color = color << 8; + color = color | c; + } + return color; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/entities/ClassResourceEntity.java b/zhiqim_httpd/src/org/zhiqim/httpd/entities/ClassResourceEntity.java new file mode 100644 index 0000000..52587c1 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/entities/ClassResourceEntity.java @@ -0,0 +1,117 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.entities; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpEntity; +import org.zhiqim.httpd.HttpHeader; +import org.zhiqim.httpd.HttpSender; +import org.zhiqim.httpd.constants.HttpMimeType; + +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Resources; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Urls; + +/** + * CLASS资源处理器
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ClassResourceEntity implements HttpEntity +{ + @Override + public boolean isMatch(String pathInContext) + {//全匹配,在handle中处理 + return true; + } + + @Override + public void handle(HttpHeader header, HttpSender sender) throws IOException + { + HttpContext context = header.getContext(); + String filePath = header.getPathOnResource(); + if (filePath == null) + { + filePath = context.getResourcePath() + header.getPathInContext(); + filePath = Urls.decode(filePath, header.getCharacterEncoding()); + } + + if (filePath.indexOf(".") == -1) + {//暂不支持无后缀的文件类型,同时也不支持目录列表 + context.getNotFoundHandler().handle(header, sender); + return; + } + + URL url = Resources.getResource(ClassResourceEntity.class, filePath); + if (url == null) + {//未找到直接返回404 + context.getNotFoundHandler().handle(header, sender); + return; + } + + URLConnection conn = url.openConnection(); + long lastModified = conn.getLastModified(); + String lastModifiedTime = DateTimes.getDateTimeHttp(lastModified); + + String ifModifiedSince = header.getHeader(_IF_MODIFIED_SINCE_); + if (ifModifiedSince != null && ifModifiedSince.indexOf(lastModifiedTime) != -1) + {//如果有要求未修改返回304 + sender.setHeader(_CACHE_CONTROL_, _MAX_AGE_+"="+context.getExpires()); + sender.sendError(_304_NOT_MODIFIED_); + return; + } + + //找到则设置响应属性 + String fileExt = Files.getFileExt(filePath); + String mimeType = header.getMimeType(); + if (mimeType == null) + mimeType = HttpMimeType.getResourceMimeType(fileExt); + + if (_TEXT_HTML_.equals(mimeType)) + sender.setContentType(_TEXT_HTML_+"; charset="+header.getCharacterEncoding()); + else + sender.setContentType(mimeType); + + //设置响应内容属性 + sender.setHeader(_ACCEPT_RANGES_, _BYTES_); + sender.setHeader(_LAST_MODIFIED_, lastModifiedTime); + + if (header.isMethodResponseContent()) + {//GET,POST + sender.setHeader(_CACHE_CONTROL_, _MAX_AGE_+"="+context.getExpires()); + sender.setHeader(_CONTENT_LENGTH_, conn.getContentLengthLong()); + try(InputStream in = conn.getInputStream()) + { + Streams.putBytes(in, sender.getOutputStream()); + } + } + + sender.commit(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/entities/CrossdomainEntity.java b/zhiqim_httpd/src/org/zhiqim/httpd/entities/CrossdomainEntity.java new file mode 100644 index 0000000..b5da198 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/entities/CrossdomainEntity.java @@ -0,0 +1,104 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.entities; + +import java.io.File; +import java.io.IOException; +import java.net.URL; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpEntity; +import org.zhiqim.httpd.HttpHeader; +import org.zhiqim.httpd.HttpSender; + +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Streams; + +/** + * 跨域处理器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class CrossdomainEntity implements HttpEntity +{ + private byte[] crossdomainBytes = null; + private String crossdomainModified = null; + + public CrossdomainEntity(HttpContext context) + { + try + { + if (crossdomainModified != null) + return; + + crossdomainModified = DateTimes.getDateTimeHttp(); + String crossdomainPath = context.getResourcePath() + "/crossdomain.xml"; + if (context.isClasspath()) + { + URL url = this.getClass().getResource(crossdomainPath); + if (url == null) + crossdomainBytes = Streams.getBytesClassPath(CrossdomainEntity.class, _PATH_CROSSDOMAIN_XML_); + else + crossdomainBytes = Streams.getBytesClassPath(CrossdomainEntity.class, crossdomainPath); + } + else + { + File file = new File(crossdomainPath); + if (file == null || !file.isFile() || !file.canRead()) + crossdomainBytes = Streams.getBytesClassPath(CrossdomainEntity.class, _PATH_CROSSDOMAIN_XML_); + else + crossdomainBytes = Streams.getBytesFilePath(file); + } + } + catch (IOException e) + { + crossdomainBytes = new byte[0]; + } + } + + @Override + public boolean isMatch(String pathInContext) + { + return _PATH_CROSSDOMAIN_.equals(pathInContext); + } + + @Override + public void handle(HttpHeader request, HttpSender response) throws IOException + { + String ifModifiedSince = request.getHeader(_IF_MODIFIED_SINCE_); + if (ifModifiedSince != null && ifModifiedSince.indexOf(crossdomainModified) != -1) + {//时间相等 + response.setHeader(_PRAGMA_, _NO_CACHE_); + response.setHeader(_CACHE_CONTROL_, _NO_CACHE_); + response.sendError(_304_NOT_MODIFIED_); + return; + } + + response.setHeader(_LAST_MODIFIED_, crossdomainModified); + response.setContentType(_TEXT_CDP_); + response.setHeader(_PRAGMA_, _NO_CACHE_); + response.setHeader(_CACHE_CONTROL_, _NO_CACHE_); + if (request.isMethodResponseContent()) + response.write(crossdomainBytes); + response.commit(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/entities/FaviconEnitiy.java b/zhiqim_httpd/src/org/zhiqim/httpd/entities/FaviconEnitiy.java new file mode 100644 index 0000000..e5b3718 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/entities/FaviconEnitiy.java @@ -0,0 +1,136 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.entities; + +import java.io.File; +import java.io.IOException; +import java.net.URL; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpEntity; +import org.zhiqim.httpd.HttpException; +import org.zhiqim.httpd.HttpHeader; +import org.zhiqim.httpd.HttpSender; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Resources; +import org.zhiqim.kernel.util.Streams; + +/** + * 图标处理器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class FaviconEnitiy implements HttpEntity +{ + private byte[] faviconBytes = null; + private long faviconModified = 0; + + public FaviconEnitiy(HttpContext context) + { + String faviconPath = context.getResourcePath() + "/favicon.ico"; + if (context.isClasspath()) + {//类路径的,可以缓存起来 + URL url = Resources.getResource(FaviconEnitiy.class, faviconPath); + if (url == null) + faviconBytes = new byte[0]; + else + { + try + { + faviconBytes = Streams.getBytesClassPath(FaviconEnitiy.class, faviconPath); + faviconModified = System.currentTimeMillis(); + } + catch (IOException e) + { + faviconBytes = new byte[0]; + } + } + } + else + {//文件目录,如果存在缓存 + File file = new File(faviconPath); + if (file == null || !file.isFile() || !file.canRead()) + return; + + try + { + faviconBytes = Streams.getBytesFilePath(file); + faviconModified = file.lastModified(); + } + catch (IOException e) + { + faviconBytes = null; + } + } + } + + public boolean isMatch(String pathInContext) + { + return _PATH_FAVICON_.equals(pathInContext); + } + + public void handle(HttpHeader request, HttpSender response) throws HttpException, IOException + { + HttpContext context = request.getContext(); + String faviconPath = context.getResourcePath() + "/favicon.ico"; + + if (context.isClasspath()) + {//类路径的,以缓存为准即可 + if (faviconBytes.length == 0) + { + response.sendError(_404_NOT_FOUND_); + return; + } + } + else + {//文件目录,需要检查是否被替换 + File file = new File(faviconPath); + if (file == null || !file.isFile() || !file.canRead()) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + if (faviconModified != file.lastModified()) + { + faviconModified = file.lastModified(); + faviconBytes = Streams.getBytesFilePath(file); + } + } + + String ifModifiedSince = request.getHeader(_IF_MODIFIED_SINCE_); + String faviconModifiedHttp = DateTimes.getDateTimeHttp(faviconModified); + if (ifModifiedSince != null && ifModifiedSince.indexOf(faviconModifiedHttp) != -1) + {//时间相等 + response.setHeader(_CACHE_CONTROL_, "max-age=3600, public"); + response.sendError(_304_NOT_MODIFIED_); + return; + } + + response.setContentType("image/x-icon"); + response.setHeader(_ACCEPT_RANGES_, _BYTES_); + response.setHeader(_LAST_MODIFIED_, faviconModifiedHttp); + response.setHeader(_CACHE_CONTROL_,"max-age=3600, public"); + response.write(faviconBytes); + response.commit(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/entities/FileResourceEntity.java b/zhiqim_httpd/src/org/zhiqim/httpd/entities/FileResourceEntity.java new file mode 100644 index 0000000..c9e897a --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/entities/FileResourceEntity.java @@ -0,0 +1,111 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.entities; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpEntity; +import org.zhiqim.httpd.HttpHeader; +import org.zhiqim.httpd.HttpSender; +import org.zhiqim.httpd.constants.HttpMimeType; + +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Urls; + +/** + * 文件资源处理器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class FileResourceEntity implements HttpEntity +{ + @Override + public boolean isMatch(String pathInContext) + {//全匹配,在handle中处理 + return true; + } + + @Override + public void handle(HttpHeader header, HttpSender sender) throws IOException + { + HttpContext context = header.getContext(); + String filePath = header.getPathOnResource(); + if (filePath == null) + { + filePath = context.getResourcePath() + header.getPathInContext(); + filePath = Urls.decode(filePath, header.getCharacterEncoding()); + } + + File file = new File(filePath); + if (!file.exists() || !file.isFile()) + { + context.getNotFoundHandler().handle(header, sender); + return; + } + + if (file.isHidden() || !file.canRead()) + { + sender.sendError(_403_FORBIDDEN_); + return; + } + + String fileExt = Files.getFileExt(filePath); + String mimeType = header.getMimeType(); + if (mimeType == null) + mimeType = HttpMimeType.getResourceMimeType(fileExt); + + if (_TEXT_HTML_.equals(mimeType)) + sender.setContentType(_TEXT_HTML_+"; charset="+header.getCharacterEncoding()); + else + sender.setContentType(mimeType); + + long lastModified = file.lastModified(); + String lastModifiedTime = DateTimes.getDateTimeHttp(lastModified); + String ifModifiedSince = header.getHeader(_IF_MODIFIED_SINCE_); + if (ifModifiedSince != null && ifModifiedSince.indexOf(lastModifiedTime) != -1) + {//时间相等 + sender.setHeader(_CACHE_CONTROL_, _MAX_AGE_+"="+context.getExpires()); + sender.sendError(_304_NOT_MODIFIED_); + return; + } + + sender.setHeader(_ACCEPT_RANGES_, _BYTES_); + sender.setHeader(_LAST_MODIFIED_, lastModifiedTime); + + if (header.isMethodResponseContent()) + { + sender.setHeader(_CACHE_CONTROL_, _MAX_AGE_+"="+context.getExpires()); + sender.setHeader(_CONTENT_LENGTH_, file.length()); + try(FileInputStream fis = new FileInputStream(file)) + { + Streams.putBytes(fis, sender.getOutputStream()); + } + } + + sender.commit(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/entities/NotFoundEntity.java b/zhiqim_httpd/src/org/zhiqim/httpd/entities/NotFoundEntity.java new file mode 100644 index 0000000..9f66288 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/entities/NotFoundEntity.java @@ -0,0 +1,66 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.entities; + +import java.io.IOException; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpEntity; +import org.zhiqim.httpd.HttpException; +import org.zhiqim.httpd.HttpHeader; +import org.zhiqim.httpd.HttpSender; + +import org.zhiqim.kernel.util.Strings; + +/** + * 未找到路径处理器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class NotFoundEntity implements HttpEntity +{ + @Override + public boolean isMatch(String pathInContext) + {//全匹配,在handle中处理 + return true; + } + + @Override + public void handle(HttpHeader header, HttpSender sender) throws HttpException, IOException + { + String pathInContext = header.getPathInContext(); + + HttpContext context = header.getContext(); + String notFoundUrl = context.getNotFoundUrl(); + if (notFoundUrl == null || notFoundUrl.equals(pathInContext)) + { + sender.sendErrorHTML(_404_NOT_FOUND_); + return; + } + + //有配置未找到页面,contextPath有可能是"/"格式,要清除最后一个"/" + String contextPath = context.getContextPath(); + contextPath = Strings.trimRight(contextPath, "/"); + + sender.sendRedirect(contextPath + notFoundUrl); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioConnection.java b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioConnection.java new file mode 100644 index 0000000..bfb7b45 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioConnection.java @@ -0,0 +1,408 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.nio; + +import java.io.EOFException; +import java.io.IOException; +import java.net.InetAddress; +import java.net.SocketTimeoutException; +import java.nio.ByteBuffer; +import java.nio.channels.SelectionKey; +import java.nio.channels.Selector; +import java.nio.channels.SocketChannel; +import java.util.LinkedList; + +import org.zhiqim.httpd.HttpChannel; +import org.zhiqim.httpd.HttpConnection; +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpListener; +import org.zhiqim.kernel.util.Threads; + +/** + * HTTP连接信息类,包括输入输出流,实现Runnable,用于线程处理 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpNioConnection implements HttpConnection, HttpChannel, Runnable +{ + private static final LinkedList selectorList = new LinkedList<>(); + + private final HttpListener listener; + private final SocketChannel socket; + private final InetAddress remoteAddress; + + //连接编号&缓冲&最近消息头 + protected String connId; + protected ByteBuffer netBuf; + protected HttpNioHeader header; + + //关闭和锁状态 + private volatile boolean closed; + private volatile boolean locked; + private volatile long lockTime; + + //WebSocket + protected HttpNioWebsocketConnection websocket; + + public HttpNioConnection(HttpListener listener, SocketChannel channel, InetAddress remoteAddress) + {//HTTP + this.listener = listener; + this.socket = channel; + this.remoteAddress = remoteAddress; + + this.connId = sequence.nextString(); + this.netBuf = ByteBuffer.allocate(listener.getSoRecvBuf()); + + //初始为解除锁定状态 + this.unlock(); + } + + /** 关闭后置,SSL连接可重写 */ + protected void closeAfter() + { + } + + /** 判断消息头,SSL连接可重写 */ + protected void chkHeader() + { + if (header == null || header.isParsed()) + header = new HttpNioHeader(this); + } + + /** 解决缓冲数据,SSL连接可重写 */ + protected int parseBuffer() + { + header.addBuffer(netBuf); + return 1; + } + + /********************************************************************************/ + //连接活动状态 + /********************************************************************************/ + + /** 尝试取锁 */ + public boolean tryLock() + { + synchronized (this) + { + if (locked) + {//活动中,表示被其他线程先执行 + return false; + } + + locked = true; + lockTime = System.currentTimeMillis(); + return true; + } + } + + /** 解除锁定 */ + private void unlock() + { + synchronized (this) + { + locked = false; + lockTime = System.currentTimeMillis(); + } + } + + /** 是否活动的 */ + public boolean isActive() + { + return locked; + } + + /** 是否空闲超时 */ + public boolean isOvertime() + { + if (websocket != null || !locked) + return false; + + return (System.currentTimeMillis() - lockTime) > listener.getSoIdleTimeMs(); + } + + /** 是否已关闭 */ + public boolean isClosed() + { + synchronized (this) + { + return closed || !socket.isOpen(); + } + } + + /********************************************************************************/ + //线程消息处理(1、连接中断,2、数据为空,3、有数据,4、连接异常) + /********************************************************************************/ + + public void run() + { + try + { + //3.从通道中读数据,并作相应的处理 + netBuf.clear(); + int count = socket.read(netBuf); + if (count == -1) + {//3.1 读数据时客户端已关闭或服务端异常,连接关闭 + closeSelfOrWebsocket(); + } + else if (count == 0) + {//3.2 连接数据为空,连接解锁,结束线程 + unlock(); + } + else + {//3.3 有连接数据,业务处理 + executeSelfOrWebsocket(); + } + } + catch (Throwable e) + {//3.4 连接异常 + closeSelfOrWebsocketException(e); + } + } + + /** 有数据处理 */ + private void executeSelfOrWebsocket() + { + if (websocket != null) + {//Websocket消息处理 + int result = websocket.execute(netBuf); + if (result == -1) + {//解析失败或异常,关闭 + closeSelfOrWebsocket(); + } + else + {//正常或下溢,连接解锁,等待后续数据 + unlock(); + } + } + else + {//HTTP/HTTPS消息处理 + + //1.检查消息头对象 + chkHeader(); + + //2.解析缓冲数据 + int result = parseBuffer(); + if (result == -1) + {//解析失败或异常 + close(); + return; + } + else if (result == 0) + {//下溢,连接解锁,等待后续数据 + unlock(); + return; + } + + try + {//3.消息处理,然后连接解锁 + header.execute(); + unlock(); + } + catch (Exception e) + {//4.失败关闭 + close(); + } + } + } + + /** 连接中断 */ + private void closeSelfOrWebsocket() + { + if (websocket == null){ + close(); + }else{ + websocket.close(); + websocket = null; + } + } + + /** 连接异常 */ + private void closeSelfOrWebsocketException(Throwable e) + { + if (websocket == null){ + close(); + }else{ + websocket.exception(e); + websocket = null; + } + } + + /********************************************************************************/ + //通道读写数据&关闭 + /********************************************************************************/ + + /** 读取缓冲 */ + public int read(ByteBuffer buf) throws IOException + { + return socket.read(buf); + } + + /** 写入缓冲 */ + public int write(ByteBuffer buf) throws IOException + { + int count = 0; + while (buf.hasRemaining()) + { + int len = socket.write(buf); + if (len < 0) + {//客户端主动断开 + throw new EOFException(); + } + else if (len > 0) + {//客户端网络正常,写入成功 + count += len; + } + else + {//客户端网络阻塞,启动阻塞检查 + writeSelection(); + } + } + + return count; + } + + /** 写入数据 */ + public void write(byte[] data) throws IOException + { + write(data, 0, data.length); + } + + /** 写入数据 */ + public void write(byte[] data, int off, int len) throws IOException + { + write(ByteBuffer.wrap(data, off, len)); + } + + /** 写入数据阻塞等待 */ + private void writeSelection() throws IOException + { + Selector selector = getSelector(); + SelectionKey key = null; + + try + { + key = socket.register(selector, SelectionKey.OP_WRITE); + if (selector.select(listener.getSoTimeoutMs()) == 0) + {//超时,抛出异常 + throw new SocketTimeoutException(); + } + } + finally + { + if (key != null) + { + key.cancel(); + key = null; + } + + selector.selectNow(); + setSelector(selector); + } + } + + /** 关闭连接 */ + public void close() + { + synchronized (this) + { + if (closed) + return; + + closed = true; + } + + unlock(); + closeAfter(); + listener.remove(this); + Threads.closeIgnoreException(socket); + } + + /***********************************************************************/ + //获取连接对应的websocket属性 + /***********************************************************************/ + + /** 是否是websocket连接 */ + public boolean isWebsocket() + { + return websocket != null; + } + + /** 关联Websocket */ + public void doWebsocket(HttpContext context, String protocol, String sessionId) + { + this.websocket = new HttpNioWebsocketConnection(this, context, protocol, sessionId); + this.websocket.open(); + } + + /***********************************************************************/ + //获取连接属性上的参数 + /***********************************************************************/ + + @Override + public String getId() + { + return connId; + } + + @Override + public HttpListener getListener() + { + return listener; + } + + @Override + public String getRemoteAddr() + { + return remoteAddress.getHostAddress(); + } + + @Override + public String toString() + { + return new StringBuilder("HttpNioConnection[").append(connId).append("]").toString(); + } + + /*************************************************************************/ + //对Selector进行缓存处理 + /*************************************************************************/ + + private static Selector getSelector() throws IOException + { + synchronized (selectorList) + { + if (!selectorList.isEmpty()) + return selectorList.removeFirst(); + } + + //队列中没有则创建一个 + return Selector.open(); + } + + private static void setSelector(Selector selector) + { + synchronized (selectorList) + { + selectorList.addLast(selector); + } + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioHeader.java b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioHeader.java new file mode 100644 index 0000000..5ce153b --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioHeader.java @@ -0,0 +1,91 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.nio; + +import java.io.IOException; +import java.nio.ByteBuffer; + +import javax.net.ssl.SSLEngine; + +import org.zhiqim.httpd.HttpConnection; +import org.zhiqim.httpd.HttpException; +import org.zhiqim.httpd.HttpHeaderAbs; +import org.zhiqim.httpd.HttpInputStream; +import org.zhiqim.httpd.HttpRequestAbs; +import org.zhiqim.httpd.HttpSenderImpl; + +/** + * NIO请求头 + * + * @version v1.4.0 @author zouzhigang 2018-3-27 新建与整理 + * @version v1.5.0 @author zouzhigang 2018-9-12 和BIO请求头抽象到HttpHeaderAbs中 + */ +public class HttpNioHeader extends HttpHeaderAbs +{ + /** 构造函数 */ + public HttpNioHeader (HttpConnection conn) + { + this(conn, null); + } + + /** 构造函数 */ + public HttpNioHeader (HttpConnection conn, SSLEngine sslEngine) + { + super(conn, new HttpInputStream(), sslEngine); + } + + /*****************************************************************************/ + //实现不同的IO对应的抽象方法 + /*****************************************************************************/ + + public HttpSenderImpl newSender() + { + return new HttpSenderImpl(this, false); + } + + public HttpRequestAbs newRequest() + { + return new HttpNioRequest(this); + } + + public boolean isBio() + { + return false; + } + + /*****************************************************************************/ + //NIO/AIO对应的缓冲处理 + /*****************************************************************************/ + + /** + * 加入缓冲列表 + * + * @param buf 有缓冲数据 + * @exception HttpException HTTP异常 + * @exception IOException IO异常 + */ + public void addBuffer(ByteBuffer buf) + { + //1.第一步,把缓冲加到流中 + getInputStream().addBuffer(buf); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioListener.java b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioListener.java new file mode 100644 index 0000000..396af55 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioListener.java @@ -0,0 +1,218 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.nio; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.StandardSocketOptions; +import java.nio.channels.CancelledKeyException; +import java.nio.channels.SelectionKey; +import java.nio.channels.Selector; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; +import java.util.Iterator; +import java.util.Set; + +import org.zhiqim.httpd.HttpListener; +import org.zhiqim.httpd.HttpServer; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Threads; +import org.zhiqim.kernel.util.Validates; + +/** + * HTTP非阻塞式监听器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpNioListener extends HttpListener +{ + protected ServerSocketChannel serverSocket; + protected Selector selector; + + public HttpNioListener(HttpServer server) + { + super(server); + } + + /** 开启前置,HTTPS可重写 */ + protected void openBeforeInner() + { + } + + /** 新建封装的连接对象,HTTPS可重写 */ + protected HttpNioConnection newConnection(SocketChannel socket) throws IOException + { + InetAddress remoteAddress = ((InetSocketAddress)socket.getRemoteAddress()).getAddress(); + return new HttpNioConnection(this, socket, remoteAddress); + } + + /************************************************************************************/ + //线程开启&关闭&运行 + /************************************************************************************/ + + @Override /** 线程开启前 */ + protected boolean openBefore() + { + //1.开启前置 + openBeforeInner(); + + //2.监听参数和线程池 + super.openBefore(); + + try + {//3.监听端口 + selector = Selector.open(); + + serverSocket = ServerSocketChannel.open(); + serverSocket.bind(Validates.isEmpty(listenerIp)?new InetSocketAddress(listenerPort):new InetSocketAddress(InetAddress.getByName(listenerIp), listenerPort)); + serverSocket.configureBlocking(false); + serverSocket.setOption(StandardSocketOptions.SO_REUSEADDR, true); + serverSocket.register(selector, SelectionKey.OP_ACCEPT); + return true; + } + catch(Exception e) + { + throw Asserts.exception(e); + } + } + + @Override /** 线程关闭后 */ + protected void closeAfter() + { + if (serverSocket != null) + {//关闭监听 + Threads.closeIgnoreException(serverSocket); + serverSocket = null; + } + + if (selector != null) + {//关闭选择器 + Threads.closeIgnoreException(selector); + selector = null; + } + + //关闭父类的控制器/定时任务/连接列表 + super.closeAfter(); + } + + @Override /** 线程持续运行 */ + protected void loop() + { + try + { + int keyNum = selector.select(soTimeoutMs); + if (keyNum == 0) + return; + + Set keys = selector.selectedKeys(); + for (Iterator it = keys.iterator();it.hasNext();) + { + SelectionKey key = it.next(); + it.remove(); + + try + { + if (!key.isValid() || key.interestOps() == 0) + continue; + + if (key.isAcceptable()) + {//客户请求连接 + onAccept(key); + } + else if (key.isReadable()) + {//读数据 + onRead(key); + } + } + catch(CancelledKeyException e) + {//虽然在前面有isValid排除,但在linux中readOps还有可能触发CancelledKeyException + } + catch(Throwable e) + { + key.cancel(); + } + } + } + catch (IOException e) + { + close(); + } + } + + /************************************************************************************/ + //NIO 接受连接&读客户端数据 + /************************************************************************************/ + + /** 接受客户端连接 */ + protected void onAccept(SelectionKey key) + { + ServerSocketChannel server = (ServerSocketChannel)key.channel(); + + HttpNioConnection conn = null; + SocketChannel socket = null; + + try + { + socket = server.accept(); + socket.configureBlocking(false); + socket.setOption(StandardSocketOptions.TCP_NODELAY, true); + socket.setOption(StandardSocketOptions.SO_LINGER, soLingerS); + socket.setOption(StandardSocketOptions.SO_KEEPALIVE, true); + socket.setOption(StandardSocketOptions.SO_RCVBUF, soRecvBuf); + socket.setOption(StandardSocketOptions.SO_SNDBUF, soSendBuf); + + conn = newConnection(socket); + socket.register(selector, SelectionKey.OP_READ, add(conn)); + } + catch (Throwable e) + { + if (conn != null) + {//连接创建成功异常,关连接 + conn.close(); + } + else if (socket != null) + {//Socket异常,关Socket + Threads.closeIgnoreException(socket); + } + } + } + + /** 读客户端数据 */ + private void onRead(SelectionKey key) + { + HttpNioConnection conn = (HttpNioConnection)key.attachment(); + if (conn.isClosed()) + {//连接已关闭或正在关闭 + key.cancel(); + return; + } + + if (!conn.tryLock()) + {//尝试获取活动锁,锁定状态的返回,未锁的置为锁定 + return; + } + + //连接空闲且有数据,转到线程池控制器处理 + controller.execute(conn); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioRequest.java b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioRequest.java new file mode 100644 index 0000000..d7339de --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioRequest.java @@ -0,0 +1,110 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.nio; + +import java.io.ByteArrayInputStream; +import java.io.IOException; + +import org.zhiqim.httpd.HttpInputStream; +import org.zhiqim.httpd.HttpRequestAbs; +import org.zhiqim.kernel.util.Bytes; +import org.zhiqim.kernel.util.Urls; +import org.zhiqim.kernel.util.Zips; + +/** + * HTTP NIO请求类,NIO特有的处理方式 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HttpNioRequest extends HttpRequestAbs +{ + private byte[] contentBytes; + private int offset; + + /** 构造函数 */ + public HttpNioRequest (HttpNioHeader header) + { + super(header); + } + + /***********************************************************************/ + //解析请求头、内容、会话和证书等 + /***********************************************************************/ + + /** + * 分析请求内容 + * + * @exception IOException IO异常 + */ + public boolean parseContent() throws IOException + { + //第十二步,解析内容流 + int cLen = getContentLength(); + if (cLen <= 0) + {//无内容 + bis = new ByteArrayInputStream(new byte[0]); + return true; + } + + //有内容 + if (contentBytes == null) + { + contentBytes = new byte[cLen]; + offset = 0; + } + + byte[] buf = ((HttpInputStream)input).read(cLen - offset); + if (buf != null && buf.length > 0) + { + offset = Bytes.putBytes(contentBytes, offset, buf); + } + + if (offset != cLen) + return false; + + bis = new ByteArrayInputStream(contentBytes, 0, cLen); + + if (isRequestGZip()) + bis = Zips.unGZip(bis); + + if (_POST_.equals(header.getMethod()) && _APPLICATION_X_WWW_FORM_.equals(header.getMimeType())) + {//form表单提交方式要解析到内容参数表中 + String line = new String(contentBytes, header.getCharacterEncoding()); + Urls.toMap(line, cntParamMap.instance(), header.getCharacterEncoding()); + } + + return true; + } + + /***********************************************************************/ + //destroy + /***********************************************************************/ + + /** 销毁 */ + public void destroy() + { + super.destroy(); + + if (contentBytes != null) + contentBytes = null; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioSslBuffer.java b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioSslBuffer.java new file mode 100644 index 0000000..0989234 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioSslBuffer.java @@ -0,0 +1,105 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.nio; + +import java.nio.ByteBuffer; + +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLEngineResult; + +import org.zhiqim.httpd.HttpInputStream; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; + +/** + * HTTPS对缓冲的封装处理 + * + * @version v1.0.0 @author zouzhigang 2018-11-27 新建与整理 + */ +public class HttpNioSslBuffer +{ + private static final Log log = LogFactory.getLog(HttpNioSslBuffer.class); + + private SSLEngine sslEngine; + private ByteBuffer appBuf; + private ByteBuffer tmpBuf; + + public HttpNioSslBuffer(SSLEngine sslEngine) + { + this.sslEngine = sslEngine; + + this.appBuf = ByteBuffer.allocate(sslEngine.getSession().getApplicationBufferSize() + 10); + this.tmpBuf = ByteBuffer.allocate(sslEngine.getSession().getPacketBufferSize()); + this.tmpBuf.flip(); + } + + public int parseBuffer(ByteBuffer netBuf, HttpInputStream input) + { + try + { + netBuf.flip(); + + //默认使用网络缓冲 + ByteBuffer curBuf = netBuf; + if (tmpBuf.hasRemaining()) + {//如果有临时缓冲,则新建缓冲把临时缓冲放置在当前缓冲的前面,并置空临时缓冲 + curBuf = ByteBuffer.allocate(tmpBuf.remaining() + netBuf.remaining()); + curBuf.put(tmpBuf).put(netBuf).flip(); + tmpBuf.clear().flip(); + } + + while (curBuf.hasRemaining()) + { + appBuf.clear(); + SSLEngineResult result = sslEngine.unwrap(curBuf, appBuf); + if (result.getStatus() == SSLEngineResult.Status.OK) + {//正常 + input.addBuffer(appBuf); + continue; + } + else if (result.getStatus() == SSLEngineResult.Status.BUFFER_UNDERFLOW) + {//下溢,把当前的放置到临时缓冲中,等待后面的数据 + tmpBuf.clear(); + tmpBuf.put(curBuf); + tmpBuf.flip(); + return 0; + } + else if (result.getStatus() == SSLEngineResult.Status.CLOSED) + {//关闭 + return -1; + } + else + {//其他的暂不支持,记录日志观察 + log.error("HTTPS解析网络包时,不支持状态[%s]", result.getStatus()); + return -1; + } + } + + return 1; + } + catch (Exception e) + { + log.error("HTTPS解析网络包时异常", e); + return -1; + } + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioSslConnection.java b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioSslConnection.java new file mode 100644 index 0000000..218c50b --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioSslConnection.java @@ -0,0 +1,108 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.nio; + +import java.io.IOException; +import java.net.InetAddress; +import java.nio.ByteBuffer; +import java.nio.channels.SocketChannel; + +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLException; + +/** + * HTTP连接信息类,包括输入输出流,实现Runnable,用于线程处理 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public final class HttpNioSslConnection extends HttpNioConnection +{ + private SSLEngine sslEngine; + private HttpNioSslBuffer buffer; + + public HttpNioSslConnection(HttpNioSslListener listener, SocketChannel channel, InetAddress remoteAddress, SSLEngine sslEngine) + {//HTTPS + super(listener, channel, remoteAddress); + + this.sslEngine = sslEngine; + this.buffer = new HttpNioSslBuffer(sslEngine); + } + + public SSLEngine getSSLEngine() + { + return sslEngine; + } + + /****************************************************************************/ + //SSL读数据握手&关闭 + /****************************************************************************/ + + @Override /** 关闭后置,SSL连接重写 */ + protected void closeAfter() + { + if (sslEngine != null) + {//关闭SSL引擎 + sslEngine.closeOutbound(); + try{sslEngine.closeInbound();}catch (SSLException e){} + sslEngine = null; + } + } + + /*******************************************************************************************/ + //重写方法,1)读包后解包处理,2)写入数据方法并封包处理,3)关联websocket + /*******************************************************************************************/ + + @Override /** 判断消息头,SSL连接可重写 */ + protected void chkHeader() + { + if (header == null || header.isParsed()) + header = new HttpNioHeader(this, sslEngine); + } + + @Override /** 解决缓冲数据,SSL连接可重写 */ + protected int parseBuffer() + { + return buffer.parseBuffer(netBuf, header.getInputStream()); + } + + @Override /** 写入数据并封包处理 */ + public void write(byte[] data, int off, int len) throws IOException + { + ByteBuffer appBuf = ByteBuffer.wrap(data); + ByteBuffer netBuf = ByteBuffer.allocate(sslEngine.getSession().getPacketBufferSize()); + while (appBuf.hasRemaining()) + { + netBuf.clear(); + sslEngine.wrap(appBuf, netBuf); + netBuf.flip(); + + //写入到通道 + super.write(netBuf); + } + } + + @Override + public String toString() + { + return new StringBuilder("HttpNioSslConnection[").append(connId).append("]").toString(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioSslListener.java b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioSslListener.java new file mode 100644 index 0000000..db7b1a8 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioSslListener.java @@ -0,0 +1,137 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.nio; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.StandardSocketOptions; +import java.nio.channels.SelectionKey; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; + +import org.zhiqim.httpd.HttpServer; +import org.zhiqim.httpd.HttpSslConfig; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Threads; + +/** + * HTTPS非阻塞式监听器
            + * 1、继承自HttpNioSslListener + * 2、重写getScheme方法,返回结果HTTPS + * 3、线程开启前创建SSLContext + * 4、重写newConnection增加SSLEngine参数 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + * @version v1.5.0 @author zouzhigang 2018-11-24 修改为完成从HttpNioListener继承,优化重写的方法 + */ +public class HttpNioSslListener extends HttpNioListener +{ + private final HttpSslConfig ssl; + private SSLContext sslContext; + + /** 构造函数,初始新建SSL配置类 */ + public HttpNioSslListener(HttpServer server) + { + super(server); + this.ssl = new HttpSslConfig(); + } + + @Override /** 协议 */ + public String getScheme() + { + return _HTTPS_; + } + + @Override /** 线程开启前 */ + protected void openBeforeInner() + { + try + { + //优先SSL参数(五项,其中Keystore两项必须) + ssl.initParam(listenerGroup); + sslContext = ssl.createSSLContext(); + } + catch(Exception e) + { + throw Asserts.exception(e); + } + } + + /** 接受客户端连接 */ + protected void onAccept(SelectionKey key) + { + ServerSocketChannel server = (ServerSocketChannel)key.channel(); + + HttpNioSslConnection conn = null; + SocketChannel socket = null; + + try + { + socket = server.accept(); + socket.setOption(StandardSocketOptions.TCP_NODELAY, true); + socket.setOption(StandardSocketOptions.SO_LINGER, soLingerS); + socket.setOption(StandardSocketOptions.SO_KEEPALIVE, true); + socket.setOption(StandardSocketOptions.SO_RCVBUF, soRecvBuf); + socket.setOption(StandardSocketOptions.SO_SNDBUF, soSendBuf); + + //先默认阻塞,并检查握手 + conn = newConnection(socket); + if (!ssl.doHandshake(conn)) + {//SSL的握手失败 + conn.close(); + return; + } + + //握手成功置为非阻塞,注册读事件 + socket.configureBlocking(false); + socket.register(selector, SelectionKey.OP_READ, add(conn)); + } + catch (Throwable e) + { + if (conn != null) + {//连接创建成功异常,关连接 + conn.close(); + } + else if (socket != null) + {//Socket异常,关Socket + Threads.closeIgnoreException(socket); + } + } + } + + @Override /** 新建封装的连接对象 */ + protected HttpNioSslConnection newConnection(SocketChannel socket) throws IOException + { + InetAddress remoteAddress = ((InetSocketAddress)socket.getRemoteAddress()).getAddress(); + + SSLEngine engine = sslContext.createSSLEngine(); + engine.setUseClientMode(ssl.isClientAuth()); + engine.setWantClientAuth(ssl.isClientAuth()); + engine.setEnableSessionCreation(true); + + return new HttpNioSslConnection(this, socket, remoteAddress, engine); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioWebsocketConnection.java b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioWebsocketConnection.java new file mode 100644 index 0000000..b69b63a --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/nio/HttpNioWebsocketConnection.java @@ -0,0 +1,187 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.nio; + +import java.nio.ByteBuffer; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpInputStream; +import org.zhiqim.httpd.HttpWebsocketConnectionAbs; +import org.zhiqim.httpd.HttpWebsocketMessage; +import org.zhiqim.httpd.HttpWebsocketMessageAsync; + +/** + * HttpWebsocket连接线程 + * + * @version v1.0.0 @author zouzhigang 2017-6-9 新建与整理 + */ +public class HttpNioWebsocketConnection extends HttpWebsocketConnectionAbs +{ + private HttpNioConnection conn; + private HttpInputStream input; + private HttpWebsocketMessageAsync data;//最后一个消息 + + //SSL属性 + private boolean hasSsl; + private HttpNioSslBuffer buffer; + + public HttpNioWebsocketConnection(HttpNioConnection conn, HttpContext context, String protocol, String sessionId) + { + super(context, protocol, sessionId); + + this.conn = conn; + this.input = new HttpInputStream(); + + if (conn instanceof HttpNioSslConnection) + {//对SSL属性初始化 + HttpNioSslConnection sslconn = (HttpNioSslConnection)conn; + this.hasSsl = true; + this.buffer = new HttpNioSslBuffer(sslconn.getSSLEngine()); + } + } + + public HttpNioConnection getConnection() + { + return conn; + } + + public synchronized void open() + { + if (isRunning) + return; + + isRunning = true; + } + + public synchronized void close() + { + if (!isRunning) + return; + + isRunning = false; + if (conn != null) + { + conn.close(); + conn = null; + } + + super.close(); + } + + public synchronized void exception(Throwable e) + { + if (!isRunning) + return; + + isRunning = false; + if (conn != null) + { + conn.close(); + conn = null; + } + + super.exception(e); + } + + /***********************************************************************************/ + //异步接受数据 + /***********************************************************************************/ + + public int execute(ByteBuffer buf) + { + int result = buffer(buf); + if (result <= 0) + {//NIO返回值为1,NIO-SSL可能返回-1/0/1,针对-1/0的返回连接处理 + return result; + } + + if (data == null || data.isParsed()) + data = new HttpWebsocketMessageAsync(); + + boolean readNext = parse(); + while (readNext && input.available() > 0) + { + data = new HttpWebsocketMessageAsync(); + readNext = parse(); + } + + return 1; + } + + /** 解析缓冲流 */ + private int buffer(ByteBuffer buf) + { + int result = 1; + if (hasSsl) + result = buffer.parseBuffer(buf, input); + else + input.addBuffer(buf); + return result; + } + + /** 解析数据流 */ + private boolean parse() + { + try + { + if (!data.parse(input)) + {//未完成解析 + return false; + } + + if (data.isPong()) + {//心跳响应 + return true; + } + + if (data.isPing()) + {//心跳请求 + HttpWebsocketMessage message = new HttpWebsocketMessage().buildPong(); + send(message.toBytes()); + return true; + } + + if (data.isClose()) + {//接收到退出 + close(); + return false; + } + + if (data.isText()) + {//接收到消息 + context.getSessionManager().updateLastAccessed(sessionId); + if (websocket != null){ + websocket.onMessage(this, data.getText()); + } + return true; + } + + //TODO 其他的后续再处理 + return true; + } + catch (Throwable e) + { + exception(e); + return false; + } + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/resources/crossdomain.xml b/zhiqim_httpd/src/org/zhiqim/httpd/resources/crossdomain.xml new file mode 100644 index 0000000..6b6b02d --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/resources/crossdomain.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/resources/favicon.ico b/zhiqim_httpd/src/org/zhiqim/httpd/resources/favicon.ico new file mode 100644 index 0000000..0aeca2d Binary files /dev/null and b/zhiqim_httpd/src/org/zhiqim/httpd/resources/favicon.ico differ diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/resources/mime.properties b/zhiqim_httpd/src/org/zhiqim/httpd/resources/mime.properties new file mode 100644 index 0000000..26a1dd0 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/resources/mime.properties @@ -0,0 +1,199 @@ +* = application/octet-stream +001 = application/x-001 +301 = application/x-301 +323 = text/h323 +906 = application/x-906 +907 = drawing/907 +a11 = application/x-a11 +acp = audio/x-mei-aac +ai = application/postscript +aif = audio/x-aiff +aifc = audio/x-aiff +aiff = audio/x-aiff +anv = application/x-anv +apk = application/vnd.android.package-archive +asa = text/asa +asc = text/plain +asf = video/x.ms.asf +asp = text/asp +asx = video/x.ms.asx +au = audio/basic +avi = video/x-msvideo +awf = application/vnd.adobe.workflow +bcpio = application/x-bcpio +bin = application/octet-stream +biz = text/xml +bmp = application/x-bmp +bot = application/x-bot +cab = application/x-cabinet +cdf = application/x-netcdf +cdp = text/x-cross-domain-policy +cdr = application/x-cdr +class = application/java-vm +cpio = application/x-cpio +cpt = application/mac-compactpro +crt = application/x-x509-ca-cert +csh = application/x-csh +css = text/css +csv = text/comma-separated-values +dcr = application/x-director +dir = application/x-director +dll = application/x-msdownload +dms = application/octet-stream +doc = application/msword +dtd = application/xml-dtd +dvi = application/x-dvi +dxr = application/x-director +eps = application/postscript +etx = text/x-setext +exe = application/octet-stream +ez = application/andrew-inset +gif = image/gif +gtar = application/x-gtar +gz = application/gzip +gzip = application/gzip +hdf = application/x-hdf +hqx = application/mac-binhex40 +html = text/html +htm = text/html +ice = x-conference/x-cooltalk +ico = image/x-icon +ief = image/ief +iges = model/iges +igs = model/iges +ipa = application/vnd.iphone +jar = application/java-archive +java = text/plain +jnlp = application/x-java-jnlp-file +jpeg = image/jpeg +jpe = image/jpeg +jpg = image/jpeg +js = application/x-javascript +json = application/json +jsp = text/plain +kar = audio/midi +latex = application/x-latex +lha = application/octet-stream +lzh = application/octet-stream +man = application/x-troff-man +mathml = application/mathml+xml +me = application/x-troff-me +mesh = model/mesh +mid = audio/midi +midi = audio/midi +mif = application/vnd.mif +mol = chemical/x-mdl-molfile +movie = video/x-sgi-movie +mov = video/quicktime +mp2 = audio/mpeg +mp3 = audio/mpeg +mpeg = video/mpeg +mpe = video/mpeg +mpga = audio/mpeg +mpg = video/mpeg +ms = application/x-troff-ms +msh = model/mesh +msi = application/octet-stream +nc = application/x-netcdf +oda = application/oda +odb = application/vnd.oasis.opendocument.database +odc = application/vnd.oasis.opendocument.chart +odf = application/vnd.oasis.opendocument.formula +odg = application/vnd.oasis.opendocument.graphics +odi = application/vnd.oasis.opendocument.image +odm = application/vnd.oasis.opendocument.text-master +odp = application/vnd.oasis.opendocument.presentation +ods = application/vnd.oasis.opendocument.spreadsheet +odt = application/vnd.oasis.opendocument.text +ogg = application/ogg +otc = application/vnd.oasis.opendocument.chart-template +otf = application/vnd.oasis.opendocument.formula-template +otg = application/vnd.oasis.opendocument.graphics-template +oth = application/vnd.oasis.opendocument.text-web +oti = application/vnd.oasis.opendocument.image-template +otp = application/vnd.oasis.opendocument.presentation-template +ots = application/vnd.oasis.opendocument.spreadsheet-template +ott = application/vnd.oasis.opendocument.text-template +pbm = image/x-portable-bitmap +pdb = chemical/x-pdb +pdf = application/pdf +pgm = image/x-portable-graymap +pgn = application/x-chess-pgn +png = image/png +pnm = image/x-portable-anymap +ppm = image/x-portable-pixmap +ppt = application/vnd.ms-powerpoint +ps = application/postscript +qt = video/quicktime +ra = audio/x-pn-realaudio +ra = audio/x-realaudio +ram = audio/x-pn-realaudio +ras = image/x-cmu-raster +rdf = application/rdf+xml +rgb = image/x-rgb +rm = audio/x-pn-realaudio +roff = application/x-troff +rpm = application/x-rpm +rpm = audio/x-pn-realaudio +rtf = application/rtf +rtx = text/richtext +ser = application/java-serialized-object +sgml = text/sgml +sgm = text/sgml +sh = application/x-sh +shar = application/x-shar +silo = model/mesh +sit = application/x-stuffit +skd = application/x-koan +skm = application/x-koan +skp = application/x-koan +skt = application/x-koan +smi = application/smil +smil = application/smil +snd = audio/basic +spl = application/x-futuresplash +src = application/x-wais-source +sv4cpio = application/x-sv4cpio +sv4crc = application/x-sv4crc +svg = image/svg+xml +swf = application/x-shockwave-flash +t = application/x-troff +tar = application/x-tar +tar.gz = application/x-gtar +tcl = application/x-tcl +tex = application/x-tex +texi = application/x-texinfo +texinfo = application/x-texinfo +tgz = application/x-gtar +tiff = image/tiff +tif = image/tiff +tr = application/x-troff +tsv = text/tab-separated-values +txt = text/plain +ustar = application/x-ustar +vcd = application/x-cdlink +vrml = model/vrml +vxml = application/voicexml+xml +wav = audio/x-wav +wbmp = image/vnd.wap.wbmp +wmlc = application/vnd.wap.wmlc +wmlsc = application/vnd.wap.wmlscriptc +wmls = text/vnd.wap.wmlscript +wml = text/vnd.wap.wml +wrl = model/vrml +wtls-ca-certificate = application/vnd.wap.wtls-ca-certificate +xbm = image/x-xbitmap +xht = application/xhtml+xml +xhtml = application/xhtml+xml +xls = application/vnd.ms-excel +xml = application/xml +xpm = image/x-xpixmap +xpm = image/x-xpixmap +xsl = application/xml +xslt = application/xslt+xml +xul = application/vnd.mozilla.xul+xml +xwd = image/x-xwindowdump +xyz = chemical/x-xyz +z = application/compress +zip = application/zip +zml = text/html \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/sessioner/HashSession.java b/zhiqim_httpd/src/org/zhiqim/httpd/sessioner/HashSession.java new file mode 100644 index 0000000..0ed6f62 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/sessioner/HashSession.java @@ -0,0 +1,404 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.sessioner; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpSession; +import org.zhiqim.httpd.HttpSessionManager; +import org.zhiqim.httpd.HttpSessionUser; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; + +/** + * HTTP会话对象: + * 1.sessionId 会话唯一标识,用于SessionManager管理 + * 2.created 会话创建时间 + * 3.accessed 会话访问时间 + * 4.sessionName 会话名称,用于业务上作为唯一标识 + * 5.sessionUser 会话对象,用于业务对象模型,作为存储 + * 6.attributes 属性列表 + * 持久化时,6个值都将保存到持久化层 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HashSession implements HttpSession +{ + //会话管理器 + private transient HttpContext context; + private transient HttpSessionManager sessionManager; + + //定义浸入式更换sessionId的保留老编号,由HttpResponse时清理 + private String oldSessionId; + + private String sessionId; + private long created; + private long accessed; + private int maxInactiveInterval; + private String sessionIp; + private String userAgent; + + private HttpSessionUser sessionUser; + private HashMapSO attributes; + + public HashSession() + { + this.created = System.currentTimeMillis(); + this.accessed = created; + this.attributes = new HashMapSO(); + } + + public HashSession setSessionManager(HttpSessionManager sessionManager) + { + this.sessionManager = sessionManager; + this.context = sessionManager.getContext(); + this.maxInactiveInterval = sessionManager.getSessionTimeout(); + return this; + } + + public HashSession setSessionId(String sessionId) + { + this.sessionId = sessionId; + return this; + } + + public void setSessionIp(String sessionIp) + { + this.sessionIp = sessionIp; + } + + public void setUserAgent(String userAgent) + { + this.userAgent = userAgent; + } + + /*********************************************************/ + //会话参数设置(最后访问时间、IP地址等) & 会话主动失效调用 + /*********************************************************/ + + public void updateLastAccessed() + { + this.accessed = System.currentTimeMillis(); + } + + public void updateInfo(String sessionIp, String userAgent) + { + this.accessed = System.currentTimeMillis(); + this.sessionIp = sessionIp; + this.userAgent = userAgent; + } + + public void invalidate() + { + if (sessionUser != null) + {//解除绑定 + sessionUser.setSession(null); + sessionUser = null; + } + + if (attributes != null) + {//清除属性 + attributes.clear(); + attributes = null; + } + + if (oldSessionId != null) + {//清除旧会话 + sessionManager.invalidateSession(oldSessionId); + oldSessionId = null; + } + + if (sessionId != null) + {//清除当前会话 + sessionManager.invalidateSession(sessionId); + sessionId = null; + } + } + + /******************************************************************************************/ + //用于业务浸入式更改sessionId(注:谨慎使用),HttpResponse会oldSessionId进行处理 + /******************************************************************************************/ + + /** 用于业务修改ID值,请谨慎使用 */ + public void setNewSessionId(String newSessionId) + { + if (newSessionId.equals(this.sessionId)) + return; + + this.oldSessionId = this.sessionId; + this.sessionId = newSessionId; + } + + public String getOldSessionId() + { + return oldSessionId; + } + + public void clearOldSessionId() + { + this.oldSessionId = null; + } + + /**********************************************/ + //获取参数判断值 + /**********************************************/ + + public HttpContext getContext() + { + return context; + } + + public String getId() + { + return sessionId; + } + + public boolean isNew() + { + return created == accessed; + } + + public String getSessionIp() + { + return sessionIp; + } + + public String getUserAgent() + { + return this.userAgent; + } + + public int getMaxInactiveInterval() + { + return maxInactiveInterval; + } + + public long getCreated() + { + return created; + } + + public String getCreateTime() + { + return DateTimes.toDateTimeString(created); + } + + public long getLastAccessed() + { + return accessed; + } + + public String getLastAccessTime() + { + return DateTimes.toDateTimeString(accessed); + } + + public long getRemainSecond() + { + long remain = System.currentTimeMillis() - getLastAccessed(); + return maxInactiveInterval - remain / 1000; + } + + public long getRemainMinute() + { + return getRemainSecond() / 60; + } + + public long[] getRemainTime() + { + long time = getRemainSecond(); + long day = time / 86400; + long hour = time % 86400 / 3600; + long minute = time % 3600 / 60; + long second = time % 60; + + return new long[]{day, hour, minute, second}; + } + + public String getRemainTimeDesc() + { + long[] times = getRemainTime(); + + StringBuilder strb = new StringBuilder(); + if (times[0] > 0) + strb.append(times[0]).append("天"); + if (times[1] > 0) + strb.append(times[1]).append("小时"); + if (times[2] > 0) + strb.append(times[2]).append("分"); + strb.append(times[3]).append("秒"); + + return strb.toString(); + } + + /**********************************************/ + //SessionUser相关 + /**********************************************/ + + /** 绑定会话用户信息 */ + public void bindSessionUser(HttpSessionUser sessionUser) + { + if (this.sessionUser != null && !this.sessionUser.equals(sessionUser)) + {//清理原关系 + this.sessionUser.setSession(null); + this.sessionUser = null; + } + + if (sessionUser != null) + {//增加新关系 + this.sessionUser = sessionUser; + this.sessionUser.setSession(this); + } + } + + /** 解绑会话用户信息 */ + public void unbindSessionUser() + { + if (this.sessionUser == null) + return; + + this.sessionUser.setSession(null); + this.sessionUser = null; + } + + /** 判断会话中是否有用户信息 */ + public boolean hasSessionUser() + { + return sessionUser != null; + } + + /** 获取会话用户信息中用户类,多个时抛异常,多会话用户时请谨慎调用 */ + public HttpSessionUser getSessionUser() + { + return sessionUser; + } + + /** 判断会话中是否有用户信息且指定的用户类 */ + public boolean hasSessionUser(Class clazz) + { + return sessionUser != null && sessionUser.getClass() == clazz; + } + + /** 获取会话用户信息且指定的用户类 */ + @SuppressWarnings("unchecked") + public T getSessionUser(Class clazz) + { + return sessionUser == null?null:sessionUser.getClass() == clazz?(T)sessionUser:null; + } + + /** 获取会话用户名称,多个时抛异常,多会话用户时请谨慎调用 */ + public String getSessionName() + { + return sessionUser == null?null:sessionUser.getSessionName(); + } + + /**********************************************/ + //读写关联到session中attribute列表 + /**********************************************/ + + public HashMapSO getAttributes() + { + return attributes; + } + + public Object removeAttribute(String name) + { + return attributes.remove(name); + } + + public void setAttribute(String name, Object value) + { + attributes.put(name, value); + } + + public boolean hasAttribute(String name) + { + return attributes.containsKey(name); + } + + public Object getAttribute(String name) + { + return attributes.get(name); + } + + public Object getAttribute(String name, Object defaultValue) + { + Object value = attributes.get(name); + return (value == null)?defaultValue:value; + } + + public String getAttributeString(String name) + { + return getAttributeString(name, null); + } + + public String getAttributeString(String name, String defaultValue) + { + Object value = getAttribute(name); + return (value == null)?defaultValue:Strings.trim(String.valueOf(value)); + } + + public int getAttributeInt(String name) + { + return getAttributeInt(name, -1); + } + + public int getAttributeInt(String name, int defaultValue) + { + return Ints.toInt(attributes.get(name), defaultValue); + } + + public long getAttributeLong(String name) + { + return getAttributeLong(name, -1); + } + + public long getAttributeLong(String name, long defaultValue) + { + return Longs.toLong(attributes.get(name), defaultValue); + } + + public boolean getAttributeBoolean(String name, boolean defaultValue) + { + Object value = attributes.get(name); + if (value == null) + return defaultValue; + else if (value instanceof Boolean) + return (Boolean)value; + else if (value instanceof String) + return Boolean.parseBoolean((String)value); + else + return defaultValue; + } + + /**********************************************/ + //清理和转换成字符串 + /**********************************************/ + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/sessioner/HashSessionManager.java b/zhiqim_httpd/src/org/zhiqim/httpd/sessioner/HashSessionManager.java new file mode 100644 index 0000000..f6632c2 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/sessioner/HashSessionManager.java @@ -0,0 +1,331 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.sessioner; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpSession; +import org.zhiqim.httpd.HttpSessionManager; +import org.zhiqim.httpd.HttpSessionUser; +import org.zhiqim.kernel.extend.HashMapSV; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.schedule.Interval; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Lists; + +/** + * Hash会话管理器,通过HashMap对会话进行管理 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class HashSessionManager implements HttpSessionManager, Task +{ + private HttpContext context; + private int sessionTimeout = 30 * 60; + private String sessionIdName = _JSESSIONID_; + private HashMapSV sessionMap; + private Interval every; + + /** 新建会话 */ + public HttpSession newSession(String sessionId) + { + return new HashSession().setSessionManager(this).setSessionId(sessionId); + } + + /** 获取上下文环境对象 */ + public HttpContext getContext() + { + return context; + } + + /** 设置上下文环境对象 */ + public void setContext(HttpContext context) + { + this.context = context; + } + + /**************************************************/ + //开启和关闭 + /**************************************************/ + + /** 开启会话管理器 */ + public void open() + { + this.sessionMap = new HashMapSV<>(999, true); + this.every = Interval.shedule(this, 29 * 1000);//定义29秒检查一次,保证最小1分钟清除即可,太频繁也不大合适 + } + + /** 关闭会话管理器 */ + public void close() + { + if (this.every != null){ + this.every.close(); + this.every = null; + } + + this.sessionMap.clear(); + this.sessionMap = null; + } + + /**************************************************/ + //设置参数部分 + /**************************************************/ + + /** 设置会话编号名称 */ + public void setSessionIdName(String sessionIdName) + { + this.sessionIdName = sessionIdName; + } + + /** 获取会话编号名称 */ + public String getSessionIdName() + { + return sessionIdName; + } + + /** 设置会话超时时长 */ + public void setSessionTimeout(int sessionTimeout) + { + this.sessionTimeout = sessionTimeout; + } + + /** 获取超时时长 */ + public int getSessionTimeout() + { + return sessionTimeout; + } + + /** 设置会话管理器参数,Hash模式无需参数 */ + public void setSessionParameter(String sessionParameter) + { + } + + /**************************************************/ + //设置 & 获取 & 失效 会话 + /**************************************************/ + + /** 设置一个会话 */ + public void setSession(HttpSession session) + { + sessionMap.put(session.getId(), session); + } + + /** 通过会话编号获取会话对象 */ + public HttpSession getSession(String sessionId) + { + return sessionMap.get(sessionId); + } + + /** 判断会话是否存在 */ + public boolean hasSession(String sessionId) + { + return sessionMap.containsKey(sessionId); + } + + /** 删除一个会话,指定会话编号 */ + public void invalidateSession(String sessionId) + { + HttpSession session = sessionMap.remove(sessionId); + if (session == null) + return; + + session.invalidate(); + session = null; + } + + /** 更新最后访问时间 */ + public void updateLastAccessed(String sessionId) + { + HttpSession session = sessionMap.get(sessionId); + if (session == null) + return; + + session.updateLastAccessed(); + } + + /** 更新信息 */ + public void updateInfo(String sessionId, String sessionIp, String userAgent) + { + HttpSession session = sessionMap.get(sessionId); + if (session == null) + return; + + session.updateInfo(sessionIp, userAgent); + } + + /******************************************************************************************/ + //会话查询和统计 + /******************************************************************************************/ + + /** 查会话数 */ + public int size() + { + return sessionMap.size(); + } + + /** 获取会话列表 */ + public List getSessionList() + { + ArrayList list = new ArrayList<>(); + for (HttpSession s : sessionMap.values()) + { + list.add(s); + } + + return Collections.unmodifiableList(Lists.trim(list)); + } + + /** 获取会话分页信息 */ + public PageResult getSessionPage(int pageNo, int pageSize) + { + int size = sessionMap.size(); + if (size == 0) + return PageBuilder.newResult(pageNo, pageSize); + + int pageNoMax = (size-1) / pageSize + 1; + if (pageNo < 1) pageNo = 1; + if (pageNo > pageNoMax) pageNo = pageNoMax; + + int start = (pageNo-1) * pageSize; + int end = pageNo * pageSize; + + ArrayList list = new ArrayList(); + Iterator it = sessionMap.values().iterator(); + for (int i=0;it.hasNext();i++) + { + HttpSession s = it.next(); + if (i < start) + continue; + else if (i >= end) + break; + else + list.add(s); + } + + list.trimToSize(); + return PageBuilder.newResult(size, pageNo, pageSize, list); + } + + /******************************************************************************************/ + //会话用户查询和统计 + /******************************************************************************************/ + + /** 查用户数,有登录状态 */ + public int sizeUser() + { + int size = 0; + for (HttpSession s : sessionMap.values()) + { + if (s.hasSessionUser()) + size++; + } + + return size; + } + + /** 是否有会话名称对应的会话 */ + public boolean hasSessionName(String sessionName) + { + Asserts.notNull(sessionName, "sessionName"); + + for (HttpSession s : sessionMap.values()) + { + HttpSessionUser sessionUser = s.getSessionUser(); + if (sessionUser == null) + continue; + + if (sessionName.equals(sessionUser.getSessionName())) + return true; + } + + return false; + } + + /** 获取会话登录用户列表,指定会话用户类名(如前后端共用session管理器的情况) */ + public List getSessionUserList() + { + List list = new ArrayList<>(); + for (HttpSession s : sessionMap.values()) + { + HttpSessionUser sessionUser = s.getSessionUser(); + if (sessionUser != null) + list.add(sessionUser); + } + + return Collections.unmodifiableList(Lists.trim(list)); + } + + /** 获取会话登录用户分页信息,指定会话用户类名(如前后端共用session管理器的情况) */ + public PageResult getSessionUserPage(int pageNo, int pageSize) + { + if (pageNo < 1) pageNo = 1; + int start = (pageNo-1) * pageSize; + int end = pageNo * pageSize; + + int total = 0; + List list = new ArrayList<>(); + for (HttpSession s : sessionMap.values()) + { + HttpSessionUser sessionUser = s.getSessionUser(); + if (sessionUser == null) + continue; + + total++; + if (total <= start || total > end) + continue;//非当前页 + else + list.add(sessionUser); + } + + list = Collections.unmodifiableList(Lists.trim(list)); + return PageBuilder.newResult(total, pageNo, pageSize, list); + } + + /********************************************************************/ + //定时任务 + /********************************************************************/ + + /** 定时检查超时用户 */ + public void execute() + { + for (Iterator it=sessionMap.values().iterator();it.hasNext();) + { + HttpSession session = it.next(); + if (session.getMaxInactiveInterval() <= 0) + continue;//设置为0或负数表示永驻内存 + + if(System.currentTimeMillis()-session.getLastAccessed() < session.getMaxInactiveInterval() * 1000) + continue;//未超时 + + //已超时清理 + it.remove(); + session.invalidate(); + session = null; + } + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/sessioner/RmiSession.java b/zhiqim_httpd/src/org/zhiqim/httpd/sessioner/RmiSession.java new file mode 100644 index 0000000..2d854a9 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/sessioner/RmiSession.java @@ -0,0 +1,438 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.sessioner; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpSession; +import org.zhiqim.httpd.HttpSessionUser; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Strings; + +/** + * HTTP会话对象: + * 1.sessionId 会话唯一标识,用于SessionManager管理 + * 2.created 会话创建时间 + * 3.accessed 会话访问时间 + * 4.sessionName 会话名称,用于业务上作为唯一标识 + * 5.sessionUser 会话对象,用于业务对象模型,作为存储 + * 6.attributes 属性列表 + * 持久化时,6个值都将保存到持久化层 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class RmiSession implements HttpSession +{ + //会话管理器 + private transient HttpContext context; + private transient RmiSessionManager sessionManager; + + //定义浸入式更换sessionId的保留老编号,由HttpResponse时清理 + private String oldSessionId; + + private String sessionId; + private long created; + private long accessed; + private int maxInactiveInterval; + private String sessionIp; + private String userAgent; + + private HttpSessionUser sessionUser; + private HashMapSO attributes; + + public RmiSession() + { + this.created = System.currentTimeMillis(); + this.accessed = created; + this.attributes = new HashMapSO(); + } + + public RmiSession setSessionManager(RmiSessionManager sessionManager) + { + this.sessionManager = sessionManager; + this.context = sessionManager.getContext(); + this.maxInactiveInterval = sessionManager.getSessionTimeout(); + return this; + } + + public RmiSession setSessionId(String sessionId) + { + this.sessionId = sessionId; + return this; + } + + public void setSessionIp(String sessionIp) + { + this.sessionIp = sessionIp; + } + + public void setUserAgent(String userAgent) + { + this.userAgent = userAgent; + } + + public void parse(String json) + { + this.oldSessionId = Jsons.getString(json, "oldSessionId"); + + this.sessionId = Jsons.getString(json, "sessionId"); + this.created = Jsons.getLong(json, "created"); + this.accessed = Jsons.getLong(json, "accessed"); + this.maxInactiveInterval = Jsons.getInt(json, "maxInactiveInterval"); + this.sessionIp = Jsons.getString(json, "sessionIp"); + this.userAgent = Jsons.getString(json, "userAgent"); + + this.attributes = Jsons.toMapSO(Jsons.getString(json, "attributes")); + + String sesionUserStr = Jsons.getString(json, "sessionUser"); + if (sesionUserStr != null) + { + String className = Jsons.getString(sesionUserStr, "className"); + Class clazz = Classes.forName(className); + if (clazz != null) + { + this.sessionUser = (HttpSessionUser)Jsons.toObject(sesionUserStr, clazz); + this.sessionUser.setSession(this); + } + } + } + + /*********************************************************/ + //会话参数设置(最后访问时间、IP地址等) & 会话主动失效调用 + /*********************************************************/ + + public void updateLastAccessed() + { + this.accessed = System.currentTimeMillis(); + this.sessionManager.updateLastAccessed(sessionId); + } + + public void updateInfo(String sessionIp, String userAgent) + { + this.accessed = System.currentTimeMillis(); + this.sessionIp = sessionIp; + this.userAgent = userAgent; + this.sessionManager.updateLastAccessed(sessionId); + } + + public void invalidate() + { + if (sessionUser != null) + {//解除绑定 + sessionUser.setSession(null); + sessionUser = null; + } + + if (attributes != null) + {//清除属性 + attributes.clear(); + attributes = null; + } + + if (oldSessionId != null) + {//清除旧会话 + sessionManager.invalidateSession(oldSessionId); + oldSessionId = null; + } + + if (sessionId != null) + {//清除当前会话 + sessionManager.invalidateSession(sessionId); + sessionId = null; + } + } + + /******************************************************************************************/ + //用于业务浸入式更改sessionId(注:谨慎使用),HttpResponse会oldSessionId进行处理 + /******************************************************************************************/ + + /** 用于业务修改ID值,请谨慎使用 */ + public void setNewSessionId(String newSessionId) + { + if (newSessionId.equals(this.sessionId)) + return; + + this.oldSessionId = this.sessionId; + this.sessionId = newSessionId; + } + + public String getOldSessionId() + { + return oldSessionId; + } + + public void clearOldSessionId() + { + this.oldSessionId = null; + } + + /**********************************************/ + //获取参数判断值 + /**********************************************/ + + public HttpContext getContext() + { + return context; + } + + public String getId() + { + return sessionId; + } + + public boolean isNew() + { + return created == accessed; + } + + public String getSessionIp() + { + return sessionIp; + } + + public String getUserAgent() + { + return this.userAgent; + } + + public int getMaxInactiveInterval() + { + return maxInactiveInterval; + } + + public long getCreated() + { + return created; + } + + public String getCreateTime() + { + return DateTimes.toDateTimeString(created); + } + + public long getLastAccessed() + { + return accessed; + } + + public String getLastAccessTime() + { + return DateTimes.toDateTimeString(accessed); + } + + public long getRemainSecond() + { + long remain = System.currentTimeMillis() - getLastAccessed(); + return maxInactiveInterval - remain / 1000; + } + + public long getRemainMinute() + { + return getRemainSecond() / 60; + } + + public long[] getRemainTime() + { + long time = getRemainSecond(); + long day = time / 86400; + long hour = time % 86400 / 3600; + long minute = time % 3600 / 60; + long second = time % 60; + + return new long[]{day, hour, minute, second}; + } + + public String getRemainTimeDesc() + { + long[] times = getRemainTime(); + + StringBuilder strb = new StringBuilder(); + if (times[0] > 0) + strb.append(times[0]).append("天"); + if (times[1] > 0) + strb.append(times[1]).append("小时"); + if (times[2] > 0) + strb.append(times[2]).append("分"); + strb.append(times[3]).append("秒"); + + return strb.toString(); + } + + /**********************************************/ + //SessionUser相关 + /**********************************************/ + + /** 绑定会话用户信息 */ + public void bindSessionUser(HttpSessionUser sessionUser) + { + if (this.sessionUser != null && !this.sessionUser.equals(sessionUser)) + {//清理原关系 + this.sessionUser.setSession(null); + this.sessionUser = null; + } + + if (sessionUser != null) + {//增加新关系 + this.sessionUser = sessionUser; + this.sessionUser.setSession(this); + } + + //同步到服务端 + this.sessionManager.setSession(this); + } + + /** 解绑会话用户信息 */ + public void unbindSessionUser() + { + if (this.sessionUser == null) + return; + + this.sessionUser.setSession(null); + this.sessionUser = null; + + //同步到服务端 + this.sessionManager.setSession(this); + } + + /** 判断会话中是否有用户信息 */ + public boolean hasSessionUser() + { + return sessionUser != null; + } + + /** 获取会话用户信息中用户类,多个时抛异常,多会话用户时请谨慎调用 */ + public HttpSessionUser getSessionUser() + { + return sessionUser; + } + + /** 判断会话中是否有用户信息且指定的用户类 */ + public boolean hasSessionUser(Class clazz) + { + return sessionUser != null && sessionUser.getClass() == clazz; + } + + /** 获取会话用户信息且指定的用户类 */ + @SuppressWarnings("unchecked") + public T getSessionUser(Class clazz) + { + return sessionUser == null?null:sessionUser.getClass() == clazz?(T)sessionUser:null; + } + + /** 获取会话用户名称,多个时抛异常,多会话用户时请谨慎调用 */ + public String getSessionName() + { + return sessionUser == null?null:sessionUser.getSessionName(); + } + + /**********************************************/ + //读写关联到session中attribute列表 + /**********************************************/ + + public HashMapSO getAttributes() + { + return attributes; + } + + public Object removeAttribute(String name) + { + return attributes.remove(name); + } + + public void setAttribute(String name, Object value) + { + attributes.put(name, value); + } + + public boolean hasAttribute(String name) + { + return attributes.containsKey(name); + } + + public Object getAttribute(String name) + { + return attributes.get(name); + } + + public Object getAttribute(String name, Object defaultValue) + { + Object value = attributes.get(name); + return (value == null)?defaultValue:value; + } + + public String getAttributeString(String name) + { + return getAttributeString(name, null); + } + + public String getAttributeString(String name, String defaultValue) + { + Object value = getAttribute(name); + return (value == null)?defaultValue:Strings.trim(String.valueOf(value)); + } + + public int getAttributeInt(String name) + { + return getAttributeInt(name, -1); + } + + public int getAttributeInt(String name, int defaultValue) + { + return Ints.toInt(attributes.get(name), defaultValue); + } + + public long getAttributeLong(String name) + { + return getAttributeLong(name, -1); + } + + public long getAttributeLong(String name, long defaultValue) + { + return Longs.toLong(attributes.get(name), defaultValue); + } + + public boolean getAttributeBoolean(String name, boolean defaultValue) + { + Object value = attributes.get(name); + if (value == null) + return defaultValue; + else if (value instanceof Boolean) + return (Boolean)value; + else if (value instanceof String) + return Boolean.parseBoolean((String)value); + else + return defaultValue; + } + + /**********************************************/ + //清理和转换成字符串 + /**********************************************/ + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/sessioner/RmiSessionManager.java b/zhiqim_httpd/src/org/zhiqim/httpd/sessioner/RmiSessionManager.java new file mode 100644 index 0000000..e0b99ea --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/sessioner/RmiSessionManager.java @@ -0,0 +1,457 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.sessioner; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpSession; +import org.zhiqim.httpd.HttpSessionManager; +import org.zhiqim.httpd.HttpSessionUser; +import org.zhiqim.kernel.httpclient.HttpRMI; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Lists; + +/** + * Hash会话管理器,通过HashMap对会话进行管理 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class RmiSessionManager implements HttpSessionManager +{ + private static final String SESSIONER = "sessioner"; + private HttpContext context; + + //四个接口定义参数 + private String url; + private String key; + private String secret; + + //两个会话参数 + private String sessionIdName; + private int sessionTimeout; + + /** 新建会话 */ + public HttpSession newSession(String sessionId) + { + return new RmiSession().setSessionManager(this).setSessionId(sessionId); + } + + /** 获取上下文环境对象 */ + public HttpContext getContext() + { + return context; + } + + /** 设置上下文环境对象 */ + public void setContext(HttpContext context) + { + this.context = context; + } + + /**************************************************************************************/ + //开启和关闭 + /**************************************************************************************/ + + /** 开启会话管理器 */ + public void open() + { + } + + /** 关闭会话管理器 */ + public void close() + { + } + + /**************************************************************************************/ + //设置参数部分 + /**************************************************************************************/ + + /** 设置会话编号名称 */ + public void setSessionIdName(String sessionIdName) + { + } + + /** 设置会话超时时长 */ + public void setSessionTimeout(int sessionTimeout) + { + } + + /** 设置会话管理器参数,Hash模式无需参数 */ + public void setSessionParameter(String sessionParameter) + { + String[] params = Arrays.toStringArray(sessionParameter); + this.url = params[0]; + this.key = params[1]; + this.secret = params[2]; + } + + public String getUrl() + { + return url; + } + + /**************************************************************************************/ + //获取参数部分 + /**************************************************************************************/ + + /** 获取会话编号名称 */ + public String getSessionIdName() + { + if (sessionIdName != null) + return sessionIdName; + + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("getSessionIdName"); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + + sessionIdName = conn.getResponseText(); + return sessionIdName; + } + + /** 获取超时时长 */ + public int getSessionTimeout() + { + if (sessionTimeout != 0) + return sessionTimeout; + + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("getSessionTimeout"); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + + sessionTimeout = Ints.toInt(conn.getResponseText()); + return sessionTimeout; + } + + /**************************************************************************************/ + //设置 & 获取 & 失效 会话 + /**************************************************************************************/ + + /** 设置一个会话 */ + public void setSession(HttpSession session) + { + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("setSession"); + conn.addParam(Jsons.toString(session)); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + } + + /** 通过会话编号获取会话对象 */ + public HttpSession getSession(String sessionId) + { + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("getSession"); + conn.addParam(sessionId); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + + String responseText = conn.getResponseText(); + RmiSession session = new RmiSession().setSessionManager(this); + session.parse(responseText); + return session; + } + + /** 判断会话是否存在 */ + public boolean hasSession(String sessionId) + { + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("hasSession"); + conn.addParam(sessionId); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + + return _TRUE_.equals(conn.getResponseText()); + } + + /** 删除一个会话,指定会话编号 */ + public void invalidateSession(String sessionId) + { + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("invalidateSession"); + conn.addParam(sessionId); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + } + + /** 更新会话最后访问时间 */ + public void updateLastAccessed(String sessionId) + { + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("updateLastAccessed"); + conn.addParam(sessionId); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + } + + /** 更新会话信息 */ + public void updateInfo(String sessionId, String sessionIp, String userAgent) + { + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("updateInfo"); + conn.addParam(sessionId); + conn.addParam(sessionIp); + conn.addParam(userAgent); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + } + + /**************************************************************************************/ + //会话查询和统计 + /**************************************************************************************/ + + /** 查会话数 */ + public int size() + { + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("size"); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + + return Ints.toInt(conn.getResponseText()); + } + + /** 获取会话列表 */ + public List getSessionList() + { + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("getSessionList"); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + + List list = Jsons.toList(conn.getResponseText(), RmiSession.class); + ArrayList nList = new ArrayList<>(list.size()); + for (HttpSession s : list) + { + nList.add(s); + } + + return Collections.unmodifiableList(Lists.trim(nList)); + } + + /** 获取会话分页信息 */ + public PageResult getSessionPage(int pageNo, int pageSize) + { + int size = size(); + if (size == 0) + return PageBuilder.newResult(pageNo, pageSize); + + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("getSessionList"); + conn.addParam(pageNo); + conn.addParam(pageSize); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + + List list = Jsons.toList(conn.getResponseText(), RmiSession.class); + ArrayList nList = new ArrayList<>(list.size()); + for (HttpSession s : list) + { + nList.add(s); + } + + return PageBuilder.newResult(size, pageNo, pageSize, nList); + } + + /**************************************************************************************/ + //会话用户查询和统计 + /**************************************************************************************/ + + /** 查用户数,有登录状态 */ + public int sizeUser() + { + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("sizeUser"); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + + return Ints.toInt(conn.getResponseText()); + } + + /** 是否有会话名称对应的会话 */ + public boolean hasSessionName(String sessionName) + { + Asserts.notNull(sessionName, "sessionName"); + + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("hasSessionName"); + conn.addParam(sessionName); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + + return _TRUE_.equals(conn.getResponseText()); + } + + /** 获取会话登录用户列表,指定会话用户类名(如前后端共用session管理器的情况) */ + public List getSessionUserList() + { + HttpRMI conn = new HttpRMI(url); + conn.setServiceId(SESSIONER); + conn.setKeySecret(key, secret); + conn.setMethodName("getSessionUserList"); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + + List list = new ArrayList<>(); + List strList = Jsons.toList(conn.getResponseText(), String.class); + for (String str : strList) + { + String className = Jsons.getString(str, "className"); + Class clazz = Classes.forName(className); + if (clazz == null) + continue; + + HttpSessionUser sessionUser = (HttpSessionUser)Jsons.toObject(str, clazz); + list.add(sessionUser); + } + + return Lists.trim(list); + } + + /** 获取会话登录用户分页信息,指定会话用户类名(如前后端共用session管理器的情况) */ + public PageResult getSessionUserPage(int pageNo, int pageSize) + { + int size = sizeUser(); + if (size == 0) + return PageBuilder.newResult(pageNo, pageSize); + + HttpRMI conn = new HttpRMI(url); + conn.setKeySecret(key, secret); + conn.setServiceId(SESSIONER); + conn.setMethodName("getSessionUserList"); + conn.addParam(pageNo); + conn.addParam(pageSize); + conn.execute(); + + if (!conn.isResponseSuccess()) + { + throw Asserts.exception(conn.getResponseText()); + } + + List list = new ArrayList<>(); + List strList = Jsons.toList(conn.getResponseText(), String.class); + for (String str : strList) + { + String className = Jsons.getString(str, "className"); + Class clazz = Classes.forName(className); + if (clazz == null) + continue; + + HttpSessionUser sessionUser = (HttpSessionUser)Jsons.toObject(str, clazz); + list.add(sessionUser); + } + + return PageBuilder.newResult(size, pageNo, pageSize, list); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/util/Requests.java b/zhiqim_httpd/src/org/zhiqim/httpd/util/Requests.java new file mode 100644 index 0000000..c2531ec --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/util/Requests.java @@ -0,0 +1,78 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.util; + +import java.util.Map; +import java.util.Map.Entry; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContextConstants; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Urls; + +/** + * 对HttpRequest进行一级封装,实现相关的数据提取工具类,分隔HttpRequest代码 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("Requests") +public class Requests implements ZmlContextConstants +{ + /** + * 提取所有参数及其值,并以隐藏控件的方式打出 + */ + public static String printAllParameterInHidden(HttpRequest request) + { + StringBuilder strb = new StringBuilder(); + + Map paramMap = request.getParameterMap(); + for (Entry entry : paramMap.entrySet()) + { + String name = entry.getKey(); + String[] values = Arrays.toStringArray(entry.getValue()); + for (String value : values) + {//字符串转化为数组 + strb.append("\n"); + } + } + + return strb.toString(); + } + + /** + * 提取所有参数,并以URL的方式出现 + */ + public static String getParameterForURL(HttpRequest request) + { + if (request.getParameterMap().isEmpty()) + return ""; + + StringBuilder strb = new StringBuilder("?"); + for (Entry entry : request.getParameterMap().entrySet()) + { + strb.append(entry.getKey()).append("=").append(Urls.encodeUTF8(entry.getValue())).append("&"); + } + strb.setLength(strb.length()-1); + return strb.toString(); + } +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/util/Responses.java b/zhiqim_httpd/src/org/zhiqim/httpd/util/Responses.java new file mode 100644 index 0000000..73a129d --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/util/Responses.java @@ -0,0 +1,101 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.util; + +import java.io.IOException; +import java.net.SocketException; +import java.util.HashMap; +import java.util.Map.Entry; + +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.ZmlContextConstants; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.logging.Log; + +/** + * 对HttpResponse进行一级封装,实现相关的数据提取工具类,分隔HttpResponse代码 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("Responses") +public class Responses implements ZmlContextConstants +{ + /** + * 根据模式类型发送响应 + * + * @param response 响应 + * @param mode 响应模式,=1表示按内容发送,!=1表示按消息头发送 + * @param headerMap 消息头列表 + * @throws Exception 可能的异常 + */ + public static void doReturnMessage(HttpResponse response, int mode, HashMap headerMap) throws IOException + { + if (mode != 1) + {//默认采用头响应 + for (Entry entry : headerMap.entrySet()) + { + response.addHeader(entry.getKey(), entry.getValue()); + } + response.sendHeader(_200_OK_); + } + else + {//指定采用JSON响应 + response.setContentType(_TEXT_PLAIN_UTF_8_); + StringBuilder strb = new StringBuilder("{"); + for (Entry entry : headerMap.entrySet()) + { + strb.append("\"").append(entry.getKey()).append("\":\"").append(entry.getValue()).append("\"").append(","); + } + + strb.setLength(strb.length()-1); + strb.append("}"); + response.print(strb.toString()); + response.commit(); + } + } + + /** + * 输出并提交 + * + * @param response 响应 + * @param strb 字符串 + * @param log 日志 + * @throws SocketException Socket异常抛出,其他异常打日志 + */ + public static void printAndCommit(HttpResponse response, StringBuilder strb, Log log) throws SocketException + { + try + { + response.print(strb.toString()); + response.commit(); + } + catch(SocketException e) + {//写入数据时,Socket异常,如对方中断,浏览器终止等,不打日志 + throw e; + } + catch(Exception e) + { + log.error(e); + } + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/util/Scripts.java b/zhiqim_httpd/src/org/zhiqim/httpd/util/Scripts.java new file mode 100644 index 0000000..489e97b --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/util/Scripts.java @@ -0,0 +1,1147 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.util; + +import java.util.Map; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.constants.HtmlConstants; +import org.zhiqim.kernel.constants.RegexpConstants; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Strings; + +/** + * Script工具类 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("Scripts") +public class Scripts extends Scriptx implements RegexpConstants, HtmlConstants +{ + /** 填充Script头部内容 */ + public static String head() + { + return _SCRIPT_BR; + } + + /** 填充Script尾部内容 */ + public static String tail() + { + return SCRIPT_; + } + + /** 填充Script指定源地址 */ + public static String src(String src) + { + return ""; + } + + public static String src(String src, String props) + { + StringBuilder strb = new StringBuilder(); + strb.append(_SCRIPT_PRE); + strb.append(" src=\"").append(src).append("\""); + + MapSS propMap = Jsons.toMapSS(props); + for (Map.Entry entry : propMap.entrySet()) + { + strb.append(" ").append(entry.getKey()).append("=\"").append(entry.getValue()).append("\""); + } + + strb.append(SCRIPT_); + strb.append(_BR_); + return strb.toString(); + } + + /** 填充jQuery下载百度的CDN地址 */ + public static String jQuery(String version) + { + if (Strings.getTimes(version, '.') == 1) version = version + ".0"; + return src("//apps.bdimg.com/libs/jquery/"+version+"/jquery.min.js"); + } + + /** 加载 */ + public static String onload(String load) + { + StringBuilder strb = new StringBuilder(); + strb.append(_SCRIPT); + strb.append("Z.onload(function(){").append(load).append("});"); + strb.append(SCRIPT_); + return strb.toString(); + } + + /** 格式化 */ + public static String formatAlertMsg(String message) + { + //1.回车换行转换\r成\\r,\n成\\n,以保证js按行解析正确 + message = message.replaceAll("\r","\\\\r"); + message = message.replaceAll("\n","\\\\n"); + //2.双引号和单引号统一前加\,由于js也可解析\",需多次转化 + message = message.replaceAll("\"", "\\\\\""); + message = message.replaceAll("\'", "\\\\\'"); + return message; + } + + /** 重新加载父窗口 */ + public static String doReloadParent() + { + return ""; + } + + /** 重新加载父窗口,先提示后加载 */ + public static String doReloadParent(String alert) + { + return ""; + } + + /** 重定向父窗口 */ + public static String doLocationParent(String url) + { + return ""; + } + + /** 重定向父窗口,先提示后重定向 */ + public static String doLocationParent(String url, String alert) + { + return ""; + } + + /*************************************/ + //正则表达式相关 + /*************************************/ + + /** + * 是否符号正则表达式 + * + * @param regexp 正则表达式 + * @return 得到指定函数名称的函数内容 + */ + public static String isRegexp(String regexp) + { + return Scriptx.isRegexp(regexp, false); + } + + /** 是否是数字 */ + public static String isNumeric() + { + return Scriptx.isNumeric(false); + } + + /** 是否是整数,包括正整数、负整数、和0,支持-号、不支持+号 */ + public static String isInteger() + { + return Scriptx.isInteger(false); + } + + /** 是否是字母和数字组合 */ + public static String isAlphaNumeric() + { + return Scriptx.isAlphaNumeric(false); + } + + /** 是否浮点型,支持多位小数,支持负数,如-12,-12.3,-12.35,-12.356,12,12.3,12.35,0,0.3,0.35,-0.3,-0.35,不支持+12,+12,35之类的前缀+号 */ + public static String isFloat() + { + return Scriptx.isFloat(false); + } + + /** 是否是最长两位小数的金额,支持负数,如-12,-12.3,-12.35,12,12.3,12.35,0,0.3,0.35,-0.3,-0.35,不支持+12,+12,35之类的前缀+号 */ + public static String isAmount2R() + { + return Scriptx.isAmount2R(false); + } + + /** 是否是邮箱地址,支持类似于xxx@xxx.xxx的邮箱格式,支持[-_.]等连接符,不支持中文等特殊符号 */ + public static String isEmail() + { + return Scriptx.isEmail(false); + } + + /** 是否是IP地址,支持类似于192.168.1.1/192.168.01.01/192.168.001.001的IP格式 */ + public static String isIP() + { + return Scriptx.isIP(false); + } + + /** 是否是MAC地址,格式为23:ad:87:be(十六进制) */ + public static String isMacAddress() + { + return Scriptx.isMacAddress(false); + } + + /** 是否是泛手机号码,支持前缀+86,86开头,后面接手机号 */ + public static String isMobile() + { + return Scriptx.isMobile(false); + } + + /** 是否是中国区11位的手机号码 */ + public static String isMobile11() + { + return Scriptx.isMobile11(false); + } + + /** 是否是日期格式,格式为yyyy-MM-dd */ + public static String isDate() + { + return Scriptx.isDate(false); + } + + /** 是否是时间格式,格式为HH:mm:ss */ + public static String isTime() + { + return Scriptx.isTime(false); + } + + /** 是否是日期时间格式,格式为yyyy-MM-dd HH:mm:ss */ + public static String isDateTime() + { + return Scriptx.isDateTime(false); + } + + /** 是否是身份证号,格式为[0-9]{6}yyyyMMdd[0-9]{3}[0-9xX*],前6位数字,中间8位1900-2099年的日期,末4位为3个数字和[0-9]或xX*。*/ + public static String isIdcard() + { + return Scriptx.isIdcard(false); + } + + /** 是否是邮政编码 */ + public static String isPostalCode() + { + return Scriptx.isPostalCode(false); + } + + /*************************************/ + //判断条件相关 + /*************************************/ + + /** 是否为空 */ + public static String isEmpty() + { + return new StringBuilder() + .append("function ").append(IS_EMPTY).append("(value)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (value == null || value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("for (var i=0;i String.fromCharCode(32))").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("}").append(_BR_) + .append(_FOUR_).append("return true;").append(_BR_) + .append("}").append(_BR_).append(_BR_).toString(); + } + + /** 是否不为空 */ + public static String isNotEmpty() + { + return new StringBuilder() + .append("function ").append(IS_NOT_EMPTY).append("(value)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (value == null || value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("for (var i=0;i String.fromCharCode(32))").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_FOUR_).append("}").append(_BR_) + .append(_FOUR_).append("return false;").append(_BR_) + .append("}").append(_BR_).append(_BR_).toString(); + } + + /** 是否相等 */ + public static String isEqual() + { + return new StringBuilder() + .append("function ").append(IS_EQUAL).append("(value1,value2)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (value1 == null || value1 == '' || value1.length < 1)").append(_BR_) + .append(_FOUR_).append("{").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("if (value1 == null || value1 == '' || value1.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_FOUR_).append("}").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("if (value1 == value2)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_FOUR_).append("return false;").append(_BR_) + .append("}").append(_BR_).append(_BR_).toString(); + } + + /** 判断长度是否在该范围 */ + public static String isLen() + { + return new StringBuilder() + .append("function ").append(IS_LEN).append("(value,min,max)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (value == null || value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append("{").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("if (min == 0)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("else").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("}").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("if (value.length < min || value.length > max)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("return true;").append(_BR_) + .append("}").append(_BR_).append(_BR_).toString(); + } + + /** 判断(如双字节*2)长度是否在该范围*/ + public static String isByteLen() + { + return new StringBuilder() + .append("function ").append(IS_BYTE_LEN).append("(value,min,max)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (value == null || value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append("{").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("if (min == 0)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("else").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("}").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("var byteLen = value.replace(/[^\\x00-\\xff]/g,\"xx\").length;").append(_BR_) + .append(_FOUR_).append("if ( byteLen < min || byteLen > max)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("return true;").append(_BR_) + .append("}").append(_BR_).append(_BR_).toString(); + } + + /** 是否数字组成,且在范围内 */ + public static String isNumericLen() + { + StringBuilder strb = new StringBuilder() + .append("function ").append(IS_NUMERIC_LEN).append("(value, min, max)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (min == 0 && (value == '' || value.length == 0))").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("if (value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("var reg = /").append(NUMERIC).append("/;").append(_BR_) + .append(_FOUR_).append("var flg = reg.test(value);").append(_BR_) + .append(_FOUR_).append("if (!flg)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("if (value.length < min || value.length > max)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("return true;").append(_BR_) + .append("}").append(_BR_).append(_BR_); + + return strb.toString(); + } + + /** 是否整数,且值在范围内 */ + public static String isIntegerValue() + { + return new StringBuilder() + .append("function ").append(IS_INTEGER_VALUE).append("(value, min, max)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (value === undefined || value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("var reg = /").append(INTEGER).append("/;").append(_BR_) + .append(_FOUR_).append("var flg = reg.test(value);").append(_BR_) + .append(_FOUR_).append("if (!flg)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("if (parseInt(value) < min || parseInt(value) > max)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("return true;").append(_BR_) + .append("}").append(_BR_).append(_BR_).toString(); + } + + /** 是否字母或数字组成,且在范围内 */ + public static String isAlphaNumericLen() + { + StringBuilder strb = new StringBuilder() + .append("function ").append(IS_ALPHA_NUMERIC_LEN).append("(value, min, max)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (min == 0 && (value == '' || value.length == 0))").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("if (value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("var reg = /").append(ALPHA_NUMERIC).append("/;").append(_BR_) + .append(_FOUR_).append("var flg = reg.test(value);").append(_BR_) + .append(_FOUR_).append("if (!flg)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("if (value.length < min || value.length > max)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("return true;").append(_BR_) + .append("}").append(_BR_).append(_BR_); + + return strb.toString(); + } + + /** 是否字母或数字组成,且在范围内 */ + public static String isAlphaNumericULLen() + { + StringBuilder strb = new StringBuilder() + .append("function ").append(IS_ALPHA_NUMERIC_UL_LEN).append("(value, min, max)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (min == 0 && (value == '' || value.length == 0))").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("if (value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("var reg = /").append(ALPHA_NUMERIC_UL).append("/;").append(_BR_) + .append(_FOUR_).append("var flg = reg.test(value);").append(_BR_) + .append(_FOUR_).append("if (!flg)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("if (value.length < min || value.length > max)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("return true;").append(_BR_) + .append("}").append(_BR_).append(_BR_); + + return strb.toString(); + } + + /** 是否字母或数字组成,字母开头且在指定范围内 */ + public static String isAlphaNumericPALen() + { + StringBuilder strb = new StringBuilder() + .append("function ").append(IS_ALPHA_NUMERIC_PA_LEN).append("(value, min, max)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (min == 0 && (value == '' || value.length == 0))").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("if (value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("var reg = /").append(ALPHA_NUMERIC_PA).append("/;").append(_BR_) + .append(_FOUR_).append("var flg = reg.test(value);").append(_BR_) + .append(_FOUR_).append("if (!flg)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("if (value.length < min || value.length > max)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("return true;").append(_BR_) + .append("}").append(_BR_).append(_BR_); + + return strb.toString(); + } + + /** 是否字母,数字或下划线组成且在指定范围内 */ + public static String isAlphaNumericUlLen() + { + StringBuilder strb = new StringBuilder() + .append("function ").append(IS_ALPHA_NUMERIC_UL_LEN).append("(value, min, max)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (min == 0 && (value == '' || value.length == 0))").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("if (value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("var reg = /").append(ALPHA_NUMERIC_UL).append("/;").append(_BR_) + .append(_FOUR_).append("var flg = reg.test(value);").append(_BR_) + .append(_FOUR_).append("if (!flg)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("if (value.length < min || value.length > max)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("return true;").append(_BR_) + .append("}").append(_BR_).append(_BR_); + + return strb.toString(); + } + + /** 是否字母,数字或点号组成且在指定范围内 */ + public static String isAlphaNumericDotLen() + { + StringBuilder strb = new StringBuilder() + .append("function ").append(IS_ALPHA_NUMERIC_DOT_LEN).append("(value, min, max)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (min == 0 && (value == '' || value.length == 0))").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("if (value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("var reg = /").append(ALPHA_NUMERIC_DOT).append("/;").append(_BR_) + .append(_FOUR_).append("var flg = reg.test(value);").append(_BR_) + .append(_FOUR_).append("if (!flg)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("if (value.length < min || value.length > max)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("return true;").append(_BR_) + .append("}").append(_BR_).append(_BR_); + + return strb.toString(); + } + + /** 是否字母,数字或(.-_~四个非特殊URL字符)组成且在指定范围内 */ + public static String isAlphaNumericUrlLen() + { + StringBuilder strb = new StringBuilder() + .append("function ").append(IS_ALPHA_NUMERIC_URL_LEN).append("(value, min, max)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (min == 0 && (value == '' || value.length == 0))").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("if (value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("var reg = /").append(ALPHA_NUMERIC_URL).append("/;").append(_BR_) + .append(_FOUR_).append("var flg = reg.test(value);").append(_BR_) + .append(_FOUR_).append("if (!flg)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("if (value.length < min || value.length > max)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("return true;").append(_BR_) + .append("}").append(_BR_).append(_BR_); + + return strb.toString(); + } + + /** 是否字母,数字或下划线组成,字母或下划线开头且在指定范围内 */ + public static String isAlphaNumericUlPALen() + { + StringBuilder strb = new StringBuilder() + .append("function ").append(IS_ALPHA_NUMERIC_UL_PA_LEN).append("(value, min, max)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (min == 0 && (value == '' || value.length == 0))").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("if (value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("var reg = /").append(ALPHA_NUMERIC_UL_PA).append("/;").append(_BR_) + .append(_FOUR_).append("var flg = reg.test(value);").append(_BR_) + .append(_FOUR_).append("if (!flg)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("if (value.length < min || value.length > max)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("return true;").append(_BR_) + .append("}").append(_BR_).append(_BR_); + + return strb.toString(); + } + + /** 是否在该范围内 */ + public static String isScope(String scope) + { + return new StringBuilder() + .append("function ").append(IS_SCOPE).append("(value)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (value === undefined || value == '' || value.length < 1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_).append(_BR_) + + .append(_FOUR_).append("for (var i=0;i value2 || value1 == value2)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_FOUR_).append("return false;").append(_BR_) + .append("}").append(_BR_).append(_BR_).toString(); + } + + /** 左值是否大于右值 */ + public static String isGreaterThen() + { + return new StringBuilder() + .append("function ").append(IS_GREATER_THEN).append("(value1, value2)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (value1 > value2)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_FOUR_).append("return false;").append(_BR_) + .append("}").append(_BR_).append(_BR_).toString(); + } + + /** 左值是否小于等于右值 */ + public static String isLessEqualThen() + { + return new StringBuilder() + .append("function ").append(IS_LESS_EQUAL_THEN).append("(value1, value2)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (value1 < value2 || value1 == value2)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_FOUR_).append("return false;").append(_BR_) + .append("}").append(_BR_).append(_BR_).toString(); + } + + /** 左值是否小于右值 */ + public static String isLessThen() + { + return new StringBuilder() + .append("function ").append(IS_LESS_THEN).append("(value1, value2)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (value1 < value2)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_FOUR_).append("return false;").append(_BR_) + .append("}").append(_BR_).append(_BR_).toString(); + } + + /*************************************/ + //字符串扩展方法相关 + /*************************************/ + + /** 是否字符串以str开头 */ + public static String startWith() + { + return new StringBuilder() + .append("String.prototype.startWith=function(str)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if(str==null||str==\"\"||this.length==0||str.length>this.length)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("if(this.substr(0,str.length)==str)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_FOUR_).append("else").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append("}").append(_BR_) + .toString(); + } + + /** 是否字符串以str结尾 */ + public static String endWith() + { + return new StringBuilder() + .append("String.prototype.endWith=function(str)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if(str==null||str==\"\"||this.length==0||str.length>this.length)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append(_FOUR_).append("if(this.substring(this.length-str.length)==str)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_) + .append(_FOUR_).append("else").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_) + .append("}").append(_BR_) + .toString(); + } + + /** 去除左空格 */ + public static String ltrim() + { + StringBuilder strb = new StringBuilder(); + strb.append("function ").append("ltrim(value)").append(_BR_); + strb.append("{").append(_BR_); + strb.append(_FOUR_).append("var w_space = String.fromCharCode(32);").append(_BR_); + strb.append(_FOUR_).append("var v_length = value.length;").append(_BR_); + strb.append(_FOUR_).append("if(v_length < 1)").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("return \"\"").append(_BR_); + strb.append(_BR_); + strb.append(_FOUR_).append("var strTemp = \"\";").append(_BR_); + strb.append(_FOUR_).append("var iTemp = 0;").append(_BR_); + strb.append(_FOUR_).append("while(iTemp < v_length)").append(_BR_); + strb.append(_FOUR_).append("{").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("if(value.charAt(iTemp) != w_space)").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("{").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append(_FOUR_).append("strTemp = value.substring(iTemp,v_length);").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append(_FOUR_).append("break;").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("}").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("iTemp = iTemp + 1;").append(_BR_); + strb.append(_FOUR_).append("}").append(_BR_); + strb.append(_FOUR_).append("return strTemp;").append(_BR_); + strb.append("}").append(_BR_); + return strb.toString(); + } + + /** 去除右空格 */ + public static String rtrim() + { + StringBuilder strb = new StringBuilder(); + strb.append("function ").append("rtrim(value)").append(_BR_); + strb.append("{//去除右空格").append(_BR_); + strb.append(_FOUR_).append("var w_space = String.fromCharCode(32);").append(_BR_); + strb.append(_FOUR_).append("var v_length = value.length;").append(_BR_); + strb.append(_FOUR_).append("if(v_length < 1)").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("return \"\"").append(_BR_); + strb.append(_BR_); + strb.append(_FOUR_).append("var strTemp = \"\";").append(_BR_); + strb.append(_FOUR_).append("var iTemp = 0;").append(_BR_); + strb.append(_FOUR_).append("while(iTemp < v_length)").append(_BR_); + strb.append(_FOUR_).append("{").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("if(value.charAt(iTemp) != w_space)").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("{").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append(_FOUR_).append("strTemp = value.substring(iTemp,v_length);").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append(_FOUR_).append("break;").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("}").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("iTemp = iTemp + 1;").append(_BR_); + strb.append(_FOUR_).append("}").append(_BR_); + strb.append(_FOUR_).append("return strTemp;").append(_BR_); + strb.append("}").append(_BR_); + return strb.toString(); + } + + /** 去除两边空格 */ + public static String trim() + { + StringBuilder strb = new StringBuilder(); + strb.append("function ").append("trim(value)").append(_BR_); + strb.append("{//去除两边空格").append(_BR_); + strb.append(_FOUR_).append("var w_space = String.fromCharCode(32);").append(_BR_); + strb.append(_FOUR_).append("var v_length = value.length;").append(_BR_); + strb.append(_FOUR_).append("if(v_length < 1)").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("return \"\"").append(_BR_); + strb.append(_BR_); + strb.append(_FOUR_).append("var strTemp = \"\";").append(_BR_); + strb.append(_FOUR_).append("var iTemp = 0;").append(_BR_); + strb.append(_FOUR_).append("while(iTemp < v_length)").append(_BR_); + strb.append(_FOUR_).append("{").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("if(value.charAt(iTemp) != w_space)").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("{").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append(_FOUR_).append("strTemp = value.substring(iTemp,v_length);").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append(_FOUR_).append("break;").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("}").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("iTemp = iTemp + 1;").append(_BR_); + strb.append(_FOUR_).append("}").append(_BR_); + strb.append(_BR_); + strb.append(_FOUR_).append("v_length = strTemp.length;").append(_BR_); + strb.append(_FOUR_).append("if(v_length < 1)").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("return \"\"").append(_BR_); + strb.append(_BR_); + strb.append(_FOUR_).append("var strTemp2 = \"\";").append(_BR_); + strb.append(_FOUR_).append("var iTemp2 = v_length;").append(_BR_); + strb.append(_FOUR_).append("while(iTemp2 > 0)").append(_BR_); + strb.append(_FOUR_).append("{").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("if(strTemp.charAt(iTemp2-1) != w_space)").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("{").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append(_FOUR_).append("strTemp2 = strTemp.substring(0,iTemp2);").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append(_FOUR_).append("break;").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("}").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("iTemp2 = iTemp2 + 1;").append(_BR_); + strb.append(_FOUR_).append("}").append(_BR_); + strb.append(_FOUR_).append("return strTemp2;").append(_BR_); + strb.append("}").append(_BR_); + return strb.toString(); + } + + /*************************************/ + //form表单相关 + /*************************************/ + + /** 选中一个选项 */ + public static String doSelectBox() + { + return new StringBuilder() + .append("function doSelectBox(boxName)").append(_BR_) + .append("{//从Radio中读取选中的一项").append(_BR_) + .append(_FOUR_).append("var obj = document.getElementsByName(boxName);").append(_BR_) + .append(_FOUR_).append("for(var i=0;i 0)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append(_FOUR_).append("element.options[0].selected = true;").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("}").append(_BR_) + .append(_FOUR_).append("}").append(_BR_) + .append("}").append(_BR_) + .toString(); + } + + /** 验证按钮变灰 */ + public static String setFormButtonGray() + { + return new StringBuilder() + .append("function setFormButtonGray(form)").append(_BR_) + .append("{//验证按钮变灰").append(_BR_) + .append(_FOUR_).append("for (var i=0;i 1 && value.charAt(0) == '0' && value.charAt(1) != '.')").append(_BR_) + .append(_FOUR_).append("{//去除多余的前缀0").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("value = value.substr(1, value.length);").append(_BR_) + .append(_FOUR_).append("}").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("if (value.charAt(0) == '.')").append(_BR_) + .append(_FOUR_).append("{//如果第一字符为点号,则前补0").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("value = \"0\"+value;").append(_BR_) + .append(_FOUR_).append("}").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("//小数后只保留最多两位,多余退格").append(_BR_) + .append(_FOUR_).append("var ind = value.indexOf(\".\");").append(_BR_) + .append(_FOUR_).append("if (ind != -1 && ind < value.length-2-1)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("element.value = value.substr(0, ind+2+1);").append(_BR_) + .append(_FOUR_).append("else").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("element.value = value").append(_BR_) + .append("}").append(_BR_) + .toString(); + } + + /** 输入框实时计算可输入数目 */ + public static String doCheckCounter(int len) + { + return new StringBuilder() + .append("function doCheckCounter(checkId, remainId)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("var content = document.getElementById(checkId).value;").append(_BR_) + .append(_FOUR_).append("if(content.length == 0)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("document.getElementById(remainId).innerHTML = \""+len+"\";").append(_BR_) + .append(_BR_) + .append(_FOUR_).append("var num = 0;//预期计数:中文2字节,英文1字节").append(_BR_) + .append(_FOUR_).append("var temp = '';//临时字符串").append(_BR_) + .append(_FOUR_).append("for(var i=0;i 127)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("num += 2;").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("else").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("num++;").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("if(num > "+len+")").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("{").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("document.getElementById(checkId).value = temp;").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("return;").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("}").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("temp += content.charAt(i);").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("document.getElementById(remainId).innerHTML = \"\"+("+len+" - num);").append(_BR_) + .append(_FOUR_).append("}").append(_BR_) + .append("}").append(_BR_) + .toString(); + } + + /** 获取当前为提交后submit,reset为灰色javascript */ + public static String getConfirm(String message) + { + StringBuilder strb = new StringBuilder(); + strb.append(_FOUR_).append("if(!confirm(\"").append(message).append("\"))").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_).append(_BR_); + + return strb.toString(); + } + + /** 获取当前为提交后submit,reset为灰色javascript */ + public static String getGraySubmit(boolean firefox) + { + StringBuilder strb = new StringBuilder(); + + if (!firefox) + {//非火狐直接变灰 + strb.append(_FOUR_).append("setFormButtonGray(form);").append(_BR_); + } + else + {//火狐检查是否有F && Z.onload,否则回退没办法恢复 + strb.append(_FOUR_).append("if (Z && Z.onload)").append(_BR_) + .append(_FOUR_).append("{//firefox要求F && Z.onload时才支持提交变灰和回退恢复").append(_BR_).append(_BR_) + //变灰 + .append(_FOUR_).append(_FOUR_).append("setFormButtonGray(form);").append(_BR_) + //回退 + .append(_FOUR_).append(_FOUR_).append("Z.onload(function(form){setFormButtonResume(form);}, form);").append(_BR_) + .append(_FOUR_).append("}").append(_BR_).append(_BR_); + } + + return strb.toString(); + } + + public static String getFormIndexTarget() + { + StringBuilder strb = new StringBuilder(); + + strb.append(_FOUR_).append("if (form.target === \"fCallFrame\")").append(_BR_) + .append(_FOUR_).append("{").append(_BR_); + + //1.组装frameTarget + strb.append(_FOUR_).append(_FOUR_).append("if (!form.frameTarget)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("{").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("var frameTarget = document.createElement(\"input\");").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("frameTarget.name = \"frameTarget\";").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("frameTarget.type = \"hidden\";").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("form.appendChild(frameTarget);").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("}").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("form.frameTarget.value = \"frameTarget\";").append(_BR_) + .append(_BR_); + + //2.组装formIndex + strb.append(_FOUR_).append(_FOUR_).append("if (!form.formIndex)").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("{").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("var formIndex = document.createElement(\"input\");").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("formIndex.name = \"formIndex\";").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("formIndex.type = \"hidden\";").append(_BR_) + .append(_FOUR_).append(_FOUR_).append(_FOUR_).append("form.appendChild(formIndex);").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("}").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("var ind = -1;").append(_BR_) + .append(_FOUR_).append(_FOUR_).append("for (var i=0;i. + */ +package org.zhiqim.httpd.util; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.constants.RegexpConstants; +import org.zhiqim.kernel.constants.SignConstants; + +/** + * 基础Script,从Scripts提取出来 + * + * @version v1.0.0 @author zouzhigang 2016-6-24 新建与整理 + */ +@AnAlias("Scriptx") +public class Scriptx implements RegexpConstants, SignConstants +{ + /** + * 构造正则表达式函数 + * + * @param function 指定函数名称 + * @param regexp 正则表达式 + * @param allowEmpty 是否允许为空 + * @return 得到指定函数名称的函数内容 + */ + public static String isRegexp(String function, String regexp, boolean allowEmpty) + { + if (!regexp.startsWith("/")) + regexp = "/" + regexp; + + if (!regexp.endsWith("/")) + regexp = regexp + "/"; + + StringBuilder strb = new StringBuilder() + .append("function ").append(function).append("(value)").append(_BR_) + .append("{").append(_BR_) + .append(_FOUR_).append("if (value === undefined || value == '' || value.length < 1)").append(_BR_); + if (allowEmpty) + strb.append(_FOUR_).append(_FOUR_).append("return true;").append(_BR_); + else + strb.append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_); + + strb.append(_BR_) + .append(_FOUR_).append("var reg = ").append(regexp).append(";").append(_BR_) + .append(_FOUR_).append("return reg.test(value);").append(_BR_) + .append("}").append(_BR_).append(_BR_); + + return strb.toString(); + } + + /** + * 是否符号正则表达式 + * + * @param regexp 正则表达式 + * @param allowEmpty 是否允许为空 + * @return 得到指定函数名称的函数内容 + */ + public static String isRegexp(String regexp, boolean allowEmpty) + { + return isRegexp(IS_REGEXP, regexp, allowEmpty); + } + + /** + * 是否是数字 + * + * @param allowEmpty 是否允许为空 + * @return isNumeric + */ + public static String isNumeric(boolean allowEmpty) + { + return isRegexp(IS_NUMERIC, NUMERIC, allowEmpty); + } + + /** + * 是否是整数,包括正整数、负整数、和0,支持-号、不支持+号 + * + * @param allowEmpty 是否允许为空 + * @return isInteger + */ + public static String isInteger(boolean allowEmpty) + { + return isRegexp(IS_INTEGER, INTEGER, allowEmpty); + } + + /** + * 是否是字母和数字组合 + * + * @param allowEmpty 是否允许为空 + * @return isAlphaNumeric + */ + public static String isAlphaNumeric(boolean allowEmpty) + { + return isRegexp(IS_ALPHA_NUMERIC, ALPHA_NUMERIC, allowEmpty); + } + + /** + * 是否是字母和数字组合,字母开头,且指定长度大小 + * + * @param allowEmpty 是否允许为空 + * @param min 最小长度 + * @param max 最大长度 + * @return isAlphaNumeric + */ + public static String isAlphaNumericLenPA(boolean allowEmpty, int min, int max) + { + if (min < 1) min = 1;if (max < min) max = min; + String regexp = ALPHA_NUMERIC_PA_N_M.replaceFirst("n", ""+(min-1)).replaceFirst("m", ""+(max-1)); + return isRegexp(IS_ALPHA_NUMERIC_PA_LEN, regexp, allowEmpty); + } + + /** + * 是否浮点型,支持多位小数,支持负数,如-12,-12.3,-12.35,-12.356,12,12.3,12.35,0,0.3,0.35,-0.3,-0.35,不支持+12,+12,35之类的前缀+号 + * + * @param allowEmpty 是否允许为空 + * @return isFloat + */ + public static String isFloat(boolean allowEmpty) + { + return isRegexp(IS_FLOAT, FLOAT, allowEmpty); + } + + /** + * 是否是最长两位小数的金额,支持负数,如-12,-12.3,-12.35,12,12.3,12.35,0,0.3,0.35,-0.3,-0.35,不支持+12,+12,35之类的前缀+号 + * + * @param allowEmpty 是否允许为空 + * @return isAmount2R + */ + public static String isAmount2R(boolean allowEmpty) + { + return isRegexp(IS_AMOUNT_2R, AMOUNT_2R, allowEmpty); + } + + /** + * 是否是邮箱地址,支持类似于xxx@xxx.xxx的邮箱格式,支持[-_.]等连接符,不支持中文等特殊符号 + * + * @param allowEmpty 是否允许为空 + * @return isEmail + */ + public static String isEmail(boolean allowEmpty) + { + return isRegexp(IS_EMAIL, EMAIL, allowEmpty); + } + + /** + * 是否是IP地址,支持类似于192.168.1.1/192.168.01.01/192.168.001.001的IP格式 + * + * @param allowEmpty 是否允许为空 + * @return isIP + */ + public static String isIP(boolean allowEmpty) + { + return isRegexp(IS_IP, IP, allowEmpty); + } + + /** + * 是否是MAC地址,格式为23:ad:87:be(十六进制) + * + * @param allowEmpty 是否允许为空 + * @return isIP + */ + public static String isMacAddress(boolean allowEmpty) + { + return isRegexp(IS_MAC, MAC, allowEmpty); + } + + /** + * 是否是泛手机号码,支持前缀+86,86开头,后面接手机号 + * + * @param allowEmpty 是否允许为空 + * @return isMsisdn + */ + public static String isMobile(boolean allowEmpty) + { + return isRegexp(IS_MOBILE, MOBILE, allowEmpty); + } + + /** + * 是否是中国区11位的手机号码 + * + * @param allowEmpty 是否允许为空 + * @return isMsisdn + */ + public static String isMobile11(boolean allowEmpty) + { + return isRegexp(IS_MOBILE11, MOBILE_11, allowEmpty); + } + + /** + * 是否是日期格式,格式为yyyy-MM-dd + * + * @param allowEmpty 是否允许为空 + * @return isDate + */ + public static String isDate(boolean allowEmpty) + { + return isRegexp(IS_DATE, DATE, allowEmpty); + } + + /** + * 是否是时间格式,格式为HH:mm:ss + * + * @param allowEmpty 是否允许为空 + * @return isTime + */ + public static String isTime(boolean allowEmpty) + { + return isRegexp(IS_TIME, TIME, allowEmpty); + } + + /** + * 是否是日期时间格式,格式为yyyy-MM-dd HH:mm:ss + * + * @param allowEmpty 是否允许为空 + * @return isDateTime + */ + public static String isDateTime(boolean allowEmpty) + { + return isRegexp(IS_DATE_TIME, DATE_TIME, allowEmpty); + } + + /** + * 是否是身份证号,格式为[0-9]{6}yyyyMMdd[0-9]{3}[0-9xX*],前6位数字,中间8位1900-2099年的日期,末4位为3个数字和[0-9]或xX*。 + * + * @param allowEmpty 是否允许为空 + * @return isIdcard + */ + public static String isIdcard(boolean allowEmpty) + { + return isRegexp(IS_DATE_TIME, DATE_TIME, allowEmpty); + } + + /** + * 是否是邮政编码 + * + * @param allowEmpty 是否允许为空 + * @return isPostalCode + */ + public static String isPostalCode(boolean allowEmpty) + { + return isRegexp(IS_POSTAL_CODE, POSTAL_CODE, allowEmpty); + } + + /** + * 是否是合适的用户名 + * + * @param allowEmpty 是否允许为空 + * @return isUserName + */ + public static String isUserCode(boolean allowEmpty) + { + return isRegexp(IS_USER_CODE, USER_CODE, allowEmpty); + } + + /** + * 是否是合适的用户密码 + * + * @param allowEmpty 是否允许为空 + * @return isUserPass + */ + public static String isUserPass(boolean allowEmpty) + { + return isRegexp(IS_USER_PASS, USER_PASS, allowEmpty); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/util/Sessions.java b/zhiqim_httpd/src/org/zhiqim/httpd/util/Sessions.java new file mode 100644 index 0000000..6f64356 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/util/Sessions.java @@ -0,0 +1,89 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.util; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpSession; +import org.zhiqim.httpd.HttpSessionUser; +import org.zhiqim.httpd.context.service.VcodeService; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.paging.PageResult; + +/** + * 对HttpSession进行一级封装,实现相关的数据提取工具类,分隔HttpSession代码 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("Sessions") +public class Sessions +{ + + /*************************************************************************/ + //获取会话中的特定值,和删除指定的会话 + /*************************************************************************/ + + /** + * 获取session中的验证码 + * + * @param request 请求 + * @return String 验证码值 + */ + public static String getSessionVerificationCode(HttpRequest request) + { + return request.getSessionAttributeString(VcodeService.ZC_VCODE_SESSION_NAME); + } + + /** + * 获取session中的用户对象列表 + * + * @param request 请求 + * @return User子类 + */ + public static PageResult getSessionUserPage(HttpRequest request, int pageNo, int pageSize) + { + return request.getContext().getSessionManager().getSessionUserPage(pageNo, pageSize); + } + + /** + * 获取session中的用户对象 + * + * @param request 请求 + * @return User子类 + */ + public static HttpSessionUser getSessionUser(HttpRequest request, String sessionId) + { + HttpSession session = request.getContext().getSessionManager().getSession(sessionId); + return session == null?null:session.getSessionUser(); + } + + /** + * 删除session中的指定的用户对象 + * + * @param request 请求 + * @param sessionId 会话编号 + */ + public static void removeSession(HttpRequest request, String sessionId) + { + request.getContext().getSessionManager().invalidateSession(sessionId); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/util/Styles.java b/zhiqim_httpd/src/org/zhiqim/httpd/util/Styles.java new file mode 100644 index 0000000..0d44b5a --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/util/Styles.java @@ -0,0 +1,75 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.util; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.constants.HtmlConstants; + +/** + * 样式工具类 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("Styles") +public class Styles implements HtmlConstants +{ + + public static String head() + { + return _STYLE_BR; + } + + public static String tail() + { + return STYLE_; + } + + public static String src(String src) + { + return ""; + } + + public static String less(String src) + { + return ""; + } + + public static String htmlOverflowHidden() + { + return ""; + } + + public static String htmlOverflowYScroll() + { + return ""; + } + + public static String htmlOverflowYAuto() + { + return ""; + } + + public static String bodyNoBackground() + { + return ""; + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/OneValidate.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/OneValidate.java new file mode 100644 index 0000000..300976a --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/OneValidate.java @@ -0,0 +1,99 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate; + +/** + * 单字段验证抽象类,提供基础的属性,实现由子类完成 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class OneValidate implements Validate +{ + protected String field; + protected String alert; + protected boolean allowEmpty; + protected String elementId; + protected boolean isFocus; + + public OneValidate(String field, String alert) + { + this(field, alert, false, true); + } + + public OneValidate(String field, String alert, String elementId) + { + this(field, alert, false, elementId); + } + + public OneValidate(String field, String alert, boolean allowEmpty) + { + this(field, alert, allowEmpty, true); + } + + public OneValidate(String field, String alert, boolean allowEmpty, boolean isFocus) + { + this.field = field; + this.alert = alert; + this.allowEmpty = allowEmpty; + this.isFocus = isFocus; + } + + public OneValidate(String field, String alert, boolean allowEmpty, String elementId) + { + this.field = field; + this.alert = alert; + this.allowEmpty = allowEmpty; + this.elementId = elementId; + } + + public OneValidate(String field, String alert, boolean allowEmpty, boolean isFocus, String elementId) + { + this.field = field; + this.alert = alert; + this.allowEmpty = allowEmpty; + this.isFocus = isFocus; + this.elementId = elementId; + } + + public String getField() + { + return field; + } + + /** + * 获取告警消息 + * + * @return String 告警消息 + */ + public String getAlertMsg() + { + return alert; + } + + /** + * 验证当前信息,如果验证失败,返回false + * + * @param 对值进行验证 + * @return 验证是失败还是成功 + */ + public abstract boolean validate(String value); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/OneValidateMinMax.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/OneValidateMinMax.java new file mode 100644 index 0000000..5fa7a37 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/OneValidateMinMax.java @@ -0,0 +1,67 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate; + +import org.zhiqim.httpd.util.Scripts; + +/** + * 单字段比较大小验证抽象类,提供基础的属性,实现由子类完成 + * 1、通过min判断是否支持为空 + * 2、提供通用的比较大小的JS方法 + * + * @version v1.0.0 @author zhichenggang 2017-10-14 新建与整理 + */ +public abstract class OneValidateMinMax extends OneValidate +{ + protected int min; + protected int max; + + /** 默认构造,是否允许为空取值min==0 */ + public OneValidateMinMax(String field, String alert, int min, int max) + { + super(field, alert, min == 0); + this.min = min; + this.max = max; + } + + /** 构造函数,是否允许为空取值min==0,支持把错误信息传到elementId中 */ + public OneValidateMinMax(String field, String alert, String elementId, int min, int max) + { + super(field, alert, min == 0, elementId); + this.min = min; + this.max = max; + } + + /** 构造函数,是否允许为空取值min==0,支持判断是否响应焦点 */ + public OneValidateMinMax(String field, String alert, boolean isFocus, int min, int max) + { + super(field, alert, min == 0, isFocus); + this.min = min; + this.max = max; + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScriptMinMax(getName(), field, alert, elementId, isFocus, min, max); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/TwoValidate.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/TwoValidate.java new file mode 100644 index 0000000..a8db4ef --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/TwoValidate.java @@ -0,0 +1,118 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate; + +/** + * 双字段的验证抽象类 + * + * @version v1.0.0 @author zouzhigang 2016-7-20 新建与整理 + */ +public abstract class TwoValidate implements Validate +{ + protected String field; + protected String field2; + protected String alert; + protected boolean allowEmpty; + protected String elementId; + protected boolean isFocus; + + public TwoValidate(String field, String field2, String alert) + { + this(field, field2, alert, false, true); + } + + public TwoValidate(String field, String field2, String alert, String elementId) + { + this(field, field2, alert, false, elementId); + } + + public TwoValidate(String field, String field2, String alert, boolean allowEmpty) + { + this(field, field2, alert, allowEmpty, true); + } + + public TwoValidate(String field, String field2, String alert, boolean allowEmpty, boolean isFocus) + { + this.field = field; + this.field2 = field2; + this.alert = alert; + this.allowEmpty = allowEmpty; + this.isFocus = isFocus; + } + + public TwoValidate(String field, String field2, String alert, boolean allowEmpty, String elementId) + { + this.field = field; + this.field2 = field2; + this.alert = alert; + this.allowEmpty = allowEmpty; + this.elementId = elementId; + } + + public TwoValidate(String field, String field2, String alert, boolean allowEmpty, boolean isFocus, String elementId) + { + this.field = field; + this.field2 = field2; + this.alert = alert; + this.allowEmpty = allowEmpty; + this.isFocus = isFocus; + this.elementId = elementId; + } + + /** + * 获取验证字段名1 + * + * @return 验证字段名称1 + */ + public String getField() + { + return field; + } + + /** + * 获取验证字段名2 + * + * @return 验证字段名称2 + */ + public String getField2() + { + return field2; + } + + /** + * 获取告警消息 + * + * @return String 告警消息 + */ + public String getAlertMsg() + { + return alert; + } + + /** + * 验证当前信息,如果验证失败,返回false + * + * @param 对值进行验证 + * @return 验证是失败还是成功 + */ + public abstract boolean validate(String value, String value2); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/Validate.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/Validate.java new file mode 100644 index 0000000..3c80276 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/Validate.java @@ -0,0 +1,61 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate; + +import org.zhiqim.kernel.constants.RegexpConstants; +import org.zhiqim.kernel.constants.SignConstants; + +/** + * 验证接口定义,提供基础的属性,实现由子类完成 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface Validate extends RegexpConstants, SignConstants +{ + /** + * 获取验证子类名称 + * + * @return String 验证子类名称,如IsEmpty,IsNumeric等 + */ + public String getName(); + + /** + * 获取告警消息 + * + * @return String 告警消息 + */ + public String getAlertMsg(); + + /** + * 获取组装后的验证Script + * + * @return String 组装后的验证Script + */ + public String getScript(); + + /** + * 获取验证需要的函数 + * + * @return String 验证需要的函数 + */ + public String getFunction(); +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericDotLen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericDotLen.java new file mode 100644 index 0000000..ec8136b --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericDotLen.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidateMinMax; + +/** + * 验证是否由字母,数字和点号组成 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsAlphaNumericDotLen") +public class IsAlphaNumericDotLen extends OneValidateMinMax +{ + /** 默认构造 */ + public IsAlphaNumericDotLen(String field, String alert, int min, int max) + { + super(field, alert, min, max); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsAlphaNumericDotLen(String field, String alert, String elementId, int min, int max) + { + super(field, alert, elementId, min, max); + } + + /** 构造函数,支持判断是否响应焦点 */ + public IsAlphaNumericDotLen(String field, String alert, boolean isFocus, int min, int max) + { + super(field, alert, isFocus, min, max); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_ALPHA_NUMERIC_DOT_LEN; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validates.isAlphaNumericDotLen(value, min, max); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isAlphaNumericDotLen(); + } +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericLen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericLen.java new file mode 100644 index 0000000..7dc5921 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericLen.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidateMinMax; + +/** + * 验证是否由数字和字母组成 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsAlphaNumericLen") +public class IsAlphaNumericLen extends OneValidateMinMax +{ + /** 默认构造 */ + public IsAlphaNumericLen(String field, String alert, int min, int max) + { + super(field, alert, min, max); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsAlphaNumericLen(String field, String alert, String elementId, int min,int max) + { + super(field, alert, elementId, min, max); + } + + /** 构造函数,支持判断是否响应焦点 */ + public IsAlphaNumericLen(String field, String alert, boolean isFocus, int min,int max) + { + super(field, alert, isFocus, min, max); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_ALPHA_NUMERIC_LEN; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validates.isAlphaNumericLen(value, min, max); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isAlphaNumericLen(); + } +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericPALen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericPALen.java new file mode 100644 index 0000000..7f6100d --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericPALen.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidateMinMax; + +/** + * 验证是否由数字和字母组成,字母开头 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsAlphaNumericPALen") +public class IsAlphaNumericPALen extends OneValidateMinMax +{ + /** 默认构造 */ + public IsAlphaNumericPALen(String field, String alert, int min, int max) + { + super(field, alert, min, max); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsAlphaNumericPALen(String field, String alert, String elementId, int min,int max) + { + super(field, alert, elementId, min, max); + } + + /** 构造函数,支持判断是否响应焦点 */ + public IsAlphaNumericPALen(String field, String alert, boolean isFocus, int min,int max) + { + super(field, alert, isFocus, min, max); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_ALPHA_NUMERIC_PA_LEN; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validates.isAlphaNumericPALen(value, min, max); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isAlphaNumericPALen(); + } +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericUlLen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericUlLen.java new file mode 100644 index 0000000..14e35ac --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericUlLen.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidateMinMax; + +/** + * 验证是否由字母,数字和下划线组成 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsAlphaNumericUlLen") +public class IsAlphaNumericUlLen extends OneValidateMinMax +{ + /** 默认构造 */ + public IsAlphaNumericUlLen(String field, String alert, int min, int max) + { + super(field, alert, min, max); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsAlphaNumericUlLen(String field, String alert, String elementId, int min, int max) + { + super(field, alert, elementId, min, max); + } + + /** 构造函数,支持判断是否响应焦点 */ + public IsAlphaNumericUlLen(String field, String alert, boolean isFocus, int min, int max) + { + super(field, alert, isFocus, min, max); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_ALPHA_NUMERIC_UL_LEN; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validates.isAlphaNumericUlLen(value, min, max); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isAlphaNumericULLen(); + } +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericUlPALen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericUlPALen.java new file mode 100644 index 0000000..1c95b1b --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericUlPALen.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidateMinMax; + +/** + * 验证是否由字母,数字和下划线组成,字母或下划线开头 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsAlphaNumericUlPALen") +public class IsAlphaNumericUlPALen extends OneValidateMinMax +{ + /** 默认构造 */ + public IsAlphaNumericUlPALen(String field, String alert, int min, int max) + { + super(field, alert, min, max); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsAlphaNumericUlPALen(String field, String alert, String elementId, int min,int max) + { + super(field, alert, elementId, min, max); + } + + /** 构造函数,支持判断是否响应焦点 */ + public IsAlphaNumericUlPALen(String field, String alert, boolean isFocus, int min,int max) + { + super(field, alert, isFocus, min, max); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_ALPHA_NUMERIC_UL_PA_LEN; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validates.isAlphaNumericUlPALen(value, min, max); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isAlphaNumericUlPALen(); + } +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericUrlLen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericUrlLen.java new file mode 100644 index 0000000..d826536 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsAlphaNumericUrlLen.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidateMinMax; + +/** + * 验证是否由字母,数字和(.-_~四个非特殊URL字符)组成 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsAlphaNumericUrlLen") +public class IsAlphaNumericUrlLen extends OneValidateMinMax +{ + /** 默认构造 */ + public IsAlphaNumericUrlLen(String field, String alert, int min, int max) + { + super(field, alert, min, max); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsAlphaNumericUrlLen(String field, String alert, String elementId, int min, int max) + { + super(field, alert, elementId, min, max); + } + + /** 构造函数,支持判断是否响应焦点 */ + public IsAlphaNumericUrlLen(String field, String alert, boolean isFocus, int min, int max) + { + super(field, alert, isFocus, min, max); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_ALPHA_NUMERIC_URL_LEN; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validates.isAlphaNumericUrlLen(value, min, max); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isAlphaNumericUrlLen(); + } +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsByteLen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsByteLen.java new file mode 100644 index 0000000..ee3f77d --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsByteLen.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidateMinMax; + +/** + * 验证指定长度限制,如果min为0,表示支持空,支持双字节,JAVA使用GBK计算,JS使用字符unicode + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsByteLen") +public class IsByteLen extends OneValidateMinMax +{ + /** 默认构造 */ + public IsByteLen(String field, String alert, int min, int max) + { + super(field, alert, min, max); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsByteLen(String field, String alert, String elementId, int min,int max) + { + super(field, alert, elementId, min, max); + } + + /** 构造函数,支持判断是否响应焦点 */ + public IsByteLen(String field, String alert, boolean isFocus, int min,int max) + { + super(field, alert, isFocus, min, max); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_BYTE_LEN; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validates.isByteLen(value, min, max); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isByteLen(); + } +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsChecked.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsChecked.java new file mode 100644 index 0000000..c524a36 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsChecked.java @@ -0,0 +1,76 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; + +/** + * 验证是否 选择了一项或多项,RADIO/CHECKBOX两种

            + * + * 注:不支持空格
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsChecked") +public class IsChecked extends OneValidate +{ + /** 默认构造 */ + public IsChecked(String field, String alert) + { + super(field, alert, false, false); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsChecked(String field, String alert, String elementId) + { + super(field, alert, false, false); + super.elementId = elementId; + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_CHECKED; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + String[] values = Arrays.toStringArray(value); + return values.length > 0; + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isChecked(); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScriptField(IS_CHECKED, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsGreaterEqualThenValue.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsGreaterEqualThenValue.java new file mode 100644 index 0000000..48bb3eb --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsGreaterEqualThenValue.java @@ -0,0 +1,89 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; + +/** + * 验证是否大于等于值 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsGreaterEqualThenValue") +public class IsGreaterEqualThenValue extends OneValidate +{ + private String value; + + public IsGreaterEqualThenValue(String field, String alert, String value) + { + super(field, alert); + this.value = value; + } + + public IsGreaterEqualThenValue(String field, String alert, String elementId, String value) + { + super(field, alert, elementId); + this.value = value; + } + + public IsGreaterEqualThenValue(String field, String alert, boolean isFocus, String value) + { + super(field, alert, false, isFocus); + this.value = value; + } + + public IsGreaterEqualThenValue(String field, String alert, boolean isFocus, String elementId, String value) + { + super(field, alert, false, isFocus, elementId); + this.value = value; + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_GREATER_EQUAL_THEN_VALUE; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + if (value == null) + return false; + + return value.compareTo(this.value) >= 0; + } + + /** 获取该验证的判断代码 */ + public String getFunction() + { + return Scripts.isGreaterEqualThen(); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScriptValue(IS_GREATER_EQUAL_THEN_VALUE, field, alert, elementId, isFocus, value); + } + +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsGreaterThenValue.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsGreaterThenValue.java new file mode 100644 index 0000000..ba10320 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsGreaterThenValue.java @@ -0,0 +1,89 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; + +/** + * 验证是否大于等于值 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsGreaterThenValue") +public class IsGreaterThenValue extends OneValidate +{ + private String value; + + public IsGreaterThenValue(String field, String alert, String value) + { + super(field, alert); + this.value = value; + } + + public IsGreaterThenValue(String field, String alert, String elementId, String value) + { + super(field, alert, elementId); + this.value = value; + } + + public IsGreaterThenValue(String field, String alert, boolean isFocus, String value) + { + super(field, alert, false, isFocus); + this.value = value; + } + + public IsGreaterThenValue(String field, String alert, boolean isFocus, String elementId, String value) + { + super(field, alert, false, isFocus, elementId); + this.value = value; + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_GREATER_THEN_VALUE; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + if (value == null) + return false; + + return value.compareTo(this.value) > 0; + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isGreaterThen(); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScriptValue(IS_GREATER_THEN_VALUE, field, alert, elementId, isFocus, value); + } + +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsIntegerValue.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsIntegerValue.java new file mode 100644 index 0000000..d4687ff --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsIntegerValue.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidateMinMax; + +/** + * 验证是否是整数,且值在给定的范围内 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsIntegerValue") +public class IsIntegerValue extends OneValidateMinMax +{ + /** 默认构造 */ + public IsIntegerValue(String field, String alert, int min, int max) + { + super(field, alert, min, max); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsIntegerValue(String field, String alert, String elementId, int min, int max) + { + super(field, alert, elementId, min, max); + } + + /** 构造函数,支持判断是否响应焦点 */ + public IsIntegerValue(String field, String alert, boolean isFocus, int min, int max) + { + super(field, alert, isFocus, min, max); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_INTEGER_VALUE; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validates.isIntegerValue(value, min, max); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isIntegerValue(); + } +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsLen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsLen.java new file mode 100644 index 0000000..cb2b868 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsLen.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidateMinMax; + +/** + * 验证是是指定长度,如果min为0,表示支持空 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsLen") +public class IsLen extends OneValidateMinMax +{ + /** 默认构造 */ + public IsLen(String field, String alert, int min, int max) + { + super(field, alert, min, max); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsLen(String field, String alert, String elementId, int min, int max) + { + super(field, alert, elementId, min, max); + } + + /** 构造函数,支持判断是否响应焦点 */ + public IsLen(String field, String alert, boolean isFocus, int min, int max) + { + super(field, alert, isFocus, min, max); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_LEN; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validates.isLen(value, min, max); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isLen(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsLessEqualThenValue.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsLessEqualThenValue.java new file mode 100644 index 0000000..152f665 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsLessEqualThenValue.java @@ -0,0 +1,88 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; + +/** + * 验证是否小于 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsLessEqualThenValue") +public class IsLessEqualThenValue extends OneValidate +{ + private String value; + + public IsLessEqualThenValue(String field, String alert, String value) + { + super(field, alert); + this.value = value; + } + + public IsLessEqualThenValue(String field, String alert, String elementId, String value) + { + super(field, alert, elementId); + this.value = value; + } + + public IsLessEqualThenValue(String field, String value, String alert, boolean isFocus) + { + super(field, alert, false, isFocus); + this.value = value; + } + + public IsLessEqualThenValue(String field, String value, String alert, String elementId, boolean isFocus) + { + super(field, alert, false, isFocus, elementId); + this.value = value; + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_LESS_EQUAL_THEN_VALUE; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + if (value == null) + return false; + + return value.compareTo(this.value) <= 0; + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isLessEqualThen(); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScriptValue(IS_LESS_EQUAL_THEN_VALUE, field, alert, elementId, isFocus, value); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsLessThenValue.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsLessThenValue.java new file mode 100644 index 0000000..8bbc617 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsLessThenValue.java @@ -0,0 +1,88 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; + +/** + * 验证是否小于值 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsLessThenValue") +public class IsLessThenValue extends OneValidate +{ + private String value; + + public IsLessThenValue(String field, String alert, String value) + { + super(field, alert); + this.value = value; + } + + public IsLessThenValue(String field, String alert, String elementId, String value) + { + super(field, alert, elementId); + this.value = value; + } + + public IsLessThenValue(String field, String value, String alert, boolean isFocus) + { + super(field, alert, false, isFocus); + this.value = value; + } + + public IsLessThenValue(String field, String value, String alert, String elementId, boolean isFocus) + { + super(field, alert, false, isFocus, elementId); + this.value = value; + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_LESS_THEN_VALUE; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + if (value == null) + return false; + + return value.compareTo(this.value) < 0; + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isLessThen(); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScriptValue(IS_LESS_THEN_VALUE, field, alert, elementId, isFocus, value); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsNotEmpty.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsNotEmpty.java new file mode 100644 index 0000000..822a8ba --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsNotEmpty.java @@ -0,0 +1,75 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidate; + +/** + * 验证不能为空
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsNotEmpty") +public class IsNotEmpty extends OneValidate +{ + public IsNotEmpty(String field, String alert) + { + super(field, alert); + } + + public IsNotEmpty(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + public IsNotEmpty(String field, String alert, boolean isFocus) + { + super(field, alert, false, isFocus); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_NOT_EMPTY; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validates.isNotEmptyBlank(value); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isNotEmpty(); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_NOT_EMPTY, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsNumericLen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsNumericLen.java new file mode 100644 index 0000000..cd36761 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsNumericLen.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidateMinMax; + +/** + * 验证是否是数字组成,且长度在给定的范围内 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsNumericLen") +public class IsNumericLen extends OneValidateMinMax +{ + /** 默认构造 */ + public IsNumericLen(String field, String alert, int min, int max) + { + super(field, alert, min, max); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsNumericLen(String field, String alert, String elementId, int min, int max) + { + super(field, alert, elementId, min, max); + } + + /** 构造函数,支持判断是否响应焦点 */ + public IsNumericLen(String field, String alert, boolean isFocus, int min, int max) + { + super(field, alert, isFocus, min, max); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_NUMERIC_LEN; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validates.isNumericLen(value, min, max); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isNumericLen(); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsScope.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsScope.java new file mode 100644 index 0000000..c458a48 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsScope.java @@ -0,0 +1,85 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.OneValidate; + +/** + * 在指定的范围内
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsScope") +public class IsScope extends OneValidate +{ + private String scope; + + public IsScope(String field, String alert, String scope) + { + super(field, alert); + this.scope = scope; + } + + public IsScope(String field, String alert, String elementId, String scope) + { + super(field, alert, elementId); + this.scope = scope; + } + + public IsScope(String field, String alert, boolean allowEmpty, String scope) + { + super(field, alert, allowEmpty); + this.scope = scope; + } + + public IsScope(String field, String alert, boolean allowEmpty, String elementId, String scope) + { + super(field, alert, allowEmpty, elementId); + this.scope = scope; + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_SCOPE; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validates.isScope(value, scope); + } + + public String getFunction() + { + return Scripts.isScope(scope); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_SCOPE, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsSelect.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsSelect.java new file mode 100644 index 0000000..2723725 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/ones/IsSelect.java @@ -0,0 +1,73 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.ones; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; + +/** + * 验证是否 选择了一项或多项

            + * + * 注:不支持空格
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsSelect") +public class IsSelect extends OneValidate +{ + public IsSelect(String field, String alert) + { + super(field, alert, false, false); + } + + public IsSelect(String field, String alert, String elementId) + { + super(field, alert, false, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_SELECT; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + String[] values = Arrays.toStringArray(value); + return values.length > 0; + } + + /** 获取该验证函数 */ + public String getFunction() + { + return Scripts.isSelect(); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScriptField(IS_SELECT, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsAlphaNumeric.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsAlphaNumeric.java new file mode 100644 index 0000000..2ea72fc --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsAlphaNumeric.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validatex; +import org.zhiqim.httpd.validate.OneValidate; + +/** + * 验证是否由数字和字母组成 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsAlphaNumeric") +public class IsAlphaNumeric extends OneValidate +{ + /** 默认构造 */ + public IsAlphaNumeric(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsAlphaNumeric(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsAlphaNumeric(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsAlphaNumeric(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsAlphaNumeric(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_ALPHA_NUMERIC; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isAlphaNumeric(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isAlphaNumeric(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_ALPHA_NUMERIC, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsAmount2R.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsAmount2R.java new file mode 100644 index 0000000..1861857 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsAmount2R.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validatex; +import org.zhiqim.httpd.validate.OneValidate; + +/** + * 验证是否最大两位小数的金额 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsAmount2R") +public class IsAmount2R extends OneValidate +{ + /** 默认构造 */ + public IsAmount2R(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsAmount2R(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsAmount2R(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsAmount2R(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsAmount2R(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_AMOUNT_2R; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isAmount2R(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isAmount2R(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_AMOUNT_2R, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsDate.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsDate.java new file mode 100644 index 0000000..f782aaa --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsDate.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否日期,如(2007-10-29)

            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsDate") +public class IsDate extends OneValidate +{ + /** 默认构造 */ + public IsDate(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsDate(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsDate(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsDate(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsDate(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_DATE; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isDate(value, allowEmpty); + } + + /** 获取该验证的函数*/ + public String getFunction() + { + return Scripts.isDate(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_DATE, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsDateTime.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsDateTime.java new file mode 100644 index 0000000..7c728b8 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsDateTime.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validatex; +import org.zhiqim.httpd.validate.OneValidate; + +/** + * 验证是否日期时间,如(2007-10-29 23:13:56) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsDateTime") +public class IsDateTime extends OneValidate +{ + /** 默认构造 */ + public IsDateTime(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsDateTime(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsDateTime(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsDateTime(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsDateTime(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_DATE_TIME; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isDateTime(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isDateTime(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_DATE_TIME, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsEmail.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsEmail.java new file mode 100644 index 0000000..81bb24c --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsEmail.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否 Email + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsEmail") +public class IsEmail extends OneValidate +{ + /** 默认构造 */ + public IsEmail(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsEmail(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsEmail(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsEmail(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsEmail(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_EMAIL; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isEmail(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isEmail(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_EMAIL, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsFloat.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsFloat.java new file mode 100644 index 0000000..502d24c --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsFloat.java @@ -0,0 +1,88 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否 货币

            + */ +@AnAlias("IsFloat") +public class IsFloat extends OneValidate +{ + /** 默认构造 */ + public IsFloat(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsFloat(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsFloat(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsFloat(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsFloat(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_FLOAT; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isFloat(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isFloat(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_FLOAT, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsIP.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsIP.java new file mode 100644 index 0000000..b082b0f --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsIP.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否 IP + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsIP") +public class IsIP extends OneValidate +{ + /** 默认构造 */ + public IsIP(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsIP(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsIP(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsIP(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsIP(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_IP; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isIP(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isIP(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_IP, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsIdcard.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsIdcard.java new file mode 100644 index 0000000..086a2ad --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsIdcard.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否身份证号 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsIdcard") +public class IsIdcard extends OneValidate +{ + /** 默认构造 */ + public IsIdcard(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsIdcard(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsIdcard(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsIdcard(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsIdcard(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IDCARD; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isIdcard(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isIdcard(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IDCARD, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsInteger.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsInteger.java new file mode 100644 index 0000000..78c7557 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsInteger.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否 数字组成 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsInteger") +public class IsInteger extends OneValidate +{ + /** 默认构造 */ + public IsInteger(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsInteger(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsInteger(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsInteger(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsInteger(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_INTEGER; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isInteger(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isInteger(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_INTEGER, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsMacAddress.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsMacAddress.java new file mode 100644 index 0000000..576c909 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsMacAddress.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否 MAC地址 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsMacAddress") +public class IsMacAddress extends OneValidate +{ + /** 默认构造 */ + public IsMacAddress(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsMacAddress(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsMacAddress(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsMacAddress(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsMacAddress(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_MAC; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isMacAddress(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isMacAddress(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_MAC, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsMobile.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsMobile.java new file mode 100644 index 0000000..39a8c8c --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsMobile.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否是泛手机号 ,支持+86,86开头后面接11号手机号 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsMobile") +public class IsMobile extends OneValidate +{ + /** 默认构造 */ + public IsMobile(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsMobile(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsMobile(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsMobile(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsMobile(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_MOBILE; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isMobile(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isMobile(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_MOBILE, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsMobile11.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsMobile11.java new file mode 100644 index 0000000..b2ce6fd --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsMobile11.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否是11位中国区的手机号
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsMobile11") +public class IsMobile11 extends OneValidate +{ + /** 默认构造 */ + public IsMobile11(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsMobile11(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsMobile11(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsMobile11(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsMobile11(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_MOBILE11; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isMobile11(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isMobile11(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_MOBILE11, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsNumeric.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsNumeric.java new file mode 100644 index 0000000..22fb09a --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsNumeric.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否 数字组成 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsNumeric") +public class IsNumeric extends OneValidate +{ + /** 默认构造 */ + public IsNumeric(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsNumeric(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsNumeric(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsNumeric(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsNumeric(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_NUMERIC; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isNumeric(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isNumeric(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_NUMERIC, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsPostalCode.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsPostalCode.java new file mode 100644 index 0000000..947f548 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsPostalCode.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否 邮编 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsPostalCode") +public class IsPostalCode extends OneValidate +{ + /** 默认构造 */ + public IsPostalCode(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsPostalCode(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsPostalCode(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsPostalCode(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsPostalCode(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_POSTAL_CODE; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isPostalCode(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isPostalCode(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_POSTAL_CODE, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsRegexp.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsRegexp.java new file mode 100644 index 0000000..788ef42 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsRegexp.java @@ -0,0 +1,92 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证value是否符合模式regExp
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsRegexp") +public class IsRegexp extends OneValidate +{ + private String regexp; + + public IsRegexp(String field, String alert, String regexp) + { + super(field, alert); + this.regexp = regexp; + } + + public IsRegexp(String field, String alert, boolean allowEmpty, String regexp) + { + super(field, alert, allowEmpty); + this.regexp = regexp; + } + + public IsRegexp(String field, String alert, boolean allowEmpty, boolean isFocus, String regexp) + { + super(field, alert, allowEmpty, isFocus); + this.regexp = regexp; + } + + public IsRegexp(String field, String alert, String elementId, String regexp) + { + super(field, alert, elementId); + this.regexp = regexp; + } + + public IsRegexp(String field, String alert, boolean allowEmpty, String elementId, String regexp) + { + super(field, alert, allowEmpty, elementId); + this.regexp = regexp; + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_REGEXP; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isRegexp(regexp, value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isRegexp(regexp, allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_REGEXP, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsTime.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsTime.java new file mode 100644 index 0000000..1110169 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsTime.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否 时间如(23:11:34),注:不支持空格
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsTime") +public class IsTime extends OneValidate +{ + /** 默认构造 */ + public IsTime(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsTime(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsTime(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsTime(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsTime(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_TIME; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isTime(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isTime(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_TIME, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsUserCode.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsUserCode.java new file mode 100644 index 0000000..3a1a01f --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsUserCode.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否 符号用户编码规则 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsUserCode") +public class IsUserCode extends OneValidate +{ + /** 默认构造 */ + public IsUserCode(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsUserCode(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsUserCode(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsUserCode(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsUserCode(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_USER_CODE; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isUserCode(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isUserCode(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_USER_CODE, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsUserPass.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsUserPass.java new file mode 100644 index 0000000..460b4e1 --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/onex/IsUserPass.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.onex; + +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.OneValidate; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Validatex; + +/** + * 验证是否 合适的密码 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsUserPass") +public class IsUserPass extends OneValidate +{ + /** 默认构造 */ + public IsUserPass(String field, String alert) + { + super(field, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsUserPass(String field, String alert, String elementId) + { + super(field, alert, elementId); + } + + /** 默认构造,支持判断是否允许为空 */ + public IsUserPass(String field, String alert, boolean allowEmpty) + { + super(field, alert, allowEmpty); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsUserPass(String field, String alert, boolean allowEmpty, boolean isFocus) + { + super(field, alert, allowEmpty, isFocus); + } + + /** 构造函数,支持判断是否允许为空,支持把错误信息传到elementId中 */ + public IsUserPass(String field, String alert, boolean allowEmpty, String elementId) + { + super(field, alert, allowEmpty, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_USER_PASS; + } + + /** 服务端验证 */ + public boolean validate(String value) + { + return Validatex.isUserPass(value, allowEmpty); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isUserPass(allowEmpty); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScript(IS_USER_PASS, field, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsEqual.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsEqual.java new file mode 100644 index 0000000..1f8f84e --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsEqual.java @@ -0,0 +1,91 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.two; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.httpd.validate.TwoValidate; + +/** + * 验证两个值是否相等
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsEqual") +public class IsEqual extends TwoValidate +{ + /** 默认构造 */ + public IsEqual(String field1, String field2, String alert) + { + super(field1, field2, alert); + } + + /** 构造函数,支持把错误信息传到elementId中 */ + public IsEqual(String field1, String field2, String alert, String elementId) + { + super(field1, field2, alert, elementId); + } + + /** 构造函数,支持判断是否允许为空,支持判断是否响应焦点 */ + public IsEqual(String field1, String field2, String alert, boolean isFocus) + { + super(field1, field2, alert, false, isFocus); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_EQUAL; + } + + /** 服务端验证 */ + public boolean validate(String value, String value2) + { + return Validates.isEqual(value, value2); + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isEqual(); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + StringBuilder strb = new StringBuilder(); + strb.append(_FOUR_).append("if(!").append(IS_EQUAL).append("(form.").append(field).append(".value, form.").append(field2).append(".value))").append(_BR_); + strb.append(_FOUR_).append("{").append(_BR_); + if (elementId == null) + strb.append(_FOUR_).append(_FOUR_).append("alert('").append(alert).append("');").append(_BR_); + else + strb.append(_FOUR_).append(_FOUR_).append("document.getElementById(\"").append(elementId).append("\").innerHTML='").append(alert).append("';").append(_BR_); + if (isFocus) + strb.append(_FOUR_).append(_FOUR_).append("form.").append(field2).append(".focus();").append(_BR_); + strb.append(_FOUR_).append(_FOUR_).append("return false;").append(_BR_); + strb.append(_FOUR_).append("}").append(_BR_).append(_BR_); + + return strb.toString(); + } + +} \ No newline at end of file diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsGreaterEqualThen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsGreaterEqualThen.java new file mode 100644 index 0000000..0a0abda --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsGreaterEqualThen.java @@ -0,0 +1,86 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.two; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.TwoValidate; + +/** + * 验证是否大于等于 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsGreaterEqualThen") +public class IsGreaterEqualThen extends TwoValidate +{ + private String field2; + + public IsGreaterEqualThen(String field1, String field2, String alert) + { + super(field1, field2, alert); + } + + public IsGreaterEqualThen(String field1, String field2, String alert, String elementId) + { + super(field1, field2, alert, elementId); + this.field2 = field2; + } + + public IsGreaterEqualThen(String field1, String field2, String alert, boolean isFocus) + { + super(field1, field2, alert, false, isFocus); + } + + public IsGreaterEqualThen(String field1, String field2, String alert, boolean isFocus, String elementId) + { + super(field1, field2, alert, false, isFocus, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_GREATER_EQUAL_THEN; + } + + /** 服务端验证 */ + public boolean validate(String value1, String value2) + { + if (value1 == null || value2 == null) + return false; + + return value1.compareTo(value2) >= 0; + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isGreaterEqualThen(); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScriptTwo(IS_GREATER_EQUAL_THEN, field, field2, alert, elementId, isFocus); + } + +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsGreaterThen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsGreaterThen.java new file mode 100644 index 0000000..64f9dbf --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsGreaterThen.java @@ -0,0 +1,83 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.two; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.TwoValidate; + +/** + * 验证是否大于 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsGreaterThen") +public class IsGreaterThen extends TwoValidate +{ + public IsGreaterThen(String field1, String field2, String alert) + { + super(field1, field2, alert); + } + + public IsGreaterThen(String field1, String field2, String alert, String elementId) + { + super(field1, field2, alert, elementId); + } + + public IsGreaterThen(String field1, String field2, String alert, boolean isFocus) + { + super(field1, field2, alert, false, isFocus); + } + + public IsGreaterThen(String field1, String field2, String alert, boolean isFocus, String elementId) + { + super(field1, field2, alert, false, isFocus, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_GREATER_THEN; + } + + /** 服务端验证 */ + public boolean validate(String value1, String value2) + { + if (value1 == null || value2 == null) + return false; + + return value1.compareTo(value2) > 0; + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isGreaterThen(); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScriptTwo(IS_GREATER_EQUAL_THEN, field, field2, alert, elementId, isFocus); + } + +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsLessEqualThen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsLessEqualThen.java new file mode 100644 index 0000000..c5ca0ef --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsLessEqualThen.java @@ -0,0 +1,82 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.two; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.TwoValidate; + +/** + * 验证是否小于等于 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsLessEqualThen") +public class IsLessEqualThen extends TwoValidate +{ + public IsLessEqualThen(String field1, String field2, String alert) + { + super(field1, field2, alert); + } + + public IsLessEqualThen(String field1, String field2, String alert, String elementId) + { + super(field1, field2, alert, elementId); + } + + public IsLessEqualThen(String field1, String field2, String alert, boolean isFocus) + { + super(field1, field2, alert, false, isFocus); + } + + public IsLessEqualThen(String field1, String field2, String alert, boolean isFocus, String elementId) + { + super(field1, field2, alert, false, isFocus, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_LESS_EQUAL_THEN; + } + + /** 服务端验证 */ + public boolean validate(String value1, String value2) + { + if (value1 == null || value2 == null) + return false; + + return value1.compareTo(value2) <= 0; + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isLessEqualThen(); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScriptTwo(IS_GREATER_EQUAL_THEN, field, field2, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsLessThen.java b/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsLessThen.java new file mode 100644 index 0000000..de1bc8d --- /dev/null +++ b/zhiqim_httpd/src/org/zhiqim/httpd/validate/two/IsLessThen.java @@ -0,0 +1,82 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.validate.two; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.httpd.util.Scripts; +import org.zhiqim.httpd.validate.TwoValidate; + +/** + * 验证是否小于 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("IsLessThen") +public class IsLessThen extends TwoValidate +{ + public IsLessThen(String field1, String field2, String alert) + { + super(field1, field2, alert); + } + + public IsLessThen(String field1, String field2, String alert, String elementId) + { + super(field1, field2, alert, elementId); + } + + public IsLessThen(String field1, String field2, String alert, boolean isFocus) + { + super(field1, field2, alert, false, isFocus); + } + + public IsLessThen(String field1, String field2, String alert, boolean isFocus, String elementId) + { + super(field1, field2, alert, false, isFocus, elementId); + } + + /** 获取该验证的名称 */ + public String getName() + { + return IS_LESS_THEN; + } + + /** 服务端验证 */ + public boolean validate(String value1, String value2) + { + if (value1 == null || value2 == null) + return false; + + return value1.compareTo(value2) < 0; + } + + /** 获取该验证的函数 */ + public String getFunction() + { + return Scripts.isLessThen(); + } + + /** 获取该验证的判断代码 */ + public String getScript() + { + return Scripts.buildValidateScriptTwo(IS_GREATER_EQUAL_THEN, field, field2, alert, elementId, isFocus); + } +} diff --git a/zhiqim_httpd/test/org/zhiqim/announcement/ZoaAnnouncementDao.java b/zhiqim_httpd/test/org/zhiqim/announcement/ZoaAnnouncementDao.java new file mode 100644 index 0000000..ee87f71 --- /dev/null +++ b/zhiqim_httpd/test/org/zhiqim/announcement/ZoaAnnouncementDao.java @@ -0,0 +1,55 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.announcement; + +import org.zhiqim.announcement.dbo.ZoaAnnouncementEx; +import org.zhiqim.announcement.dbo.ZoaAnnouncementReader; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.dbo.Selector; + +/** + * 公告数据访问对象 + * + * @version v1.0.0 @author zouzhigang 2017-11-17 新建与整理 + */ +@AnAlias("ZoaAnnouncementDao") +public class ZoaAnnouncementDao +{ + /** + * 获取是否有未读公告 + * + * @param request 请求 + * @return =true表示有,=false表示没有 + * @throws Exception 异常 + */ + public static boolean hasUnReadAnnouncement(HttpRequest request) throws Exception + { + Selector selector = new Selector(); + selector.addJoin(ZoaAnnouncementReader.class, new Selector("operatorCode", request.getSessionName())); + selector.addMust("announcementStatus", 0); + selector.addMustIsNull("operatorCode"); + + return ORM.view().count(ZoaAnnouncementEx.class, selector) > 0; + } +} diff --git a/zhiqim_httpd/test/org/zhiqim/announcement/ZoaAnnouncementWS.java b/zhiqim_httpd/test/org/zhiqim/announcement/ZoaAnnouncementWS.java new file mode 100644 index 0000000..4607fbc --- /dev/null +++ b/zhiqim_httpd/test/org/zhiqim/announcement/ZoaAnnouncementWS.java @@ -0,0 +1,93 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.announcement; + +import org.zhiqim.httpd.HttpSession; +import org.zhiqim.httpd.HttpSessionUser; +import org.zhiqim.httpd.HttpWebsocket; +import org.zhiqim.httpd.HttpWebsocketConnection; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Ids; + +@AnAlias("zoa_announcement") +public class ZoaAnnouncementWS implements HttpWebsocket +{ + @Override + public void onOpen(HttpWebsocketConnection conn) + { + HttpSessionUser sessionUser = conn.getSession().getSessionUser(); + if (sessionUser == null) + { + return; + } + + } + + @Override + public void onClose(HttpWebsocketConnection conn) + { + HttpSessionUser sessionUser = conn.getSession().getSessionUser(); + if (sessionUser == null) + { + return; + } + + } + + @Override + public void onException(HttpWebsocketConnection conn, Throwable e) + { + HttpSessionUser sessionUser = conn.getSession().getSessionUser(); + if (sessionUser == null) + { + return; + } + + } + + @Override + public void onMessage(HttpWebsocketConnection conn, String message) + { + HttpSession session = conn.getSession(); + + HttpSessionUser sessionUser = session.getSessionUser(); + if (sessionUser == null) + { + return; + } + + conn.send("" + Ids.longId()); + } + + @Override + public void onMessage(HttpWebsocketConnection conn, byte[] message) + { + HttpSessionUser sessionUser = conn.getSession().getSessionUser(); + if (sessionUser == null) + { + return; + } + + conn.send("" + Ids.longId()); + } + +} diff --git a/zhiqim_httpd/test/org/zhiqim/announcement/action/AnnouncementAction.java b/zhiqim_httpd/test/org/zhiqim/announcement/action/AnnouncementAction.java new file mode 100644 index 0000000..92ae1f7 --- /dev/null +++ b/zhiqim_httpd/test/org/zhiqim/announcement/action/AnnouncementAction.java @@ -0,0 +1,165 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.announcement.action; + +import java.util.List; + +import org.zhiqim.announcement.dbo.ZoaAnnouncement; +import org.zhiqim.announcement.dbo.ZoaAnnouncementEx; +import org.zhiqim.announcement.dbo.ZoaAnnouncementReader; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpSessionManager; +import org.zhiqim.httpd.HttpSessionUser; +import org.zhiqim.httpd.HttpWebsocketConnection; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsIntegerValue; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * 公告管理,支持公告的增加、修改和删除权限 + * + * @version v1.0.0 @author duanxiaohui 2017-11-13 新建与整理 + */ +public class AnnouncementAction extends StdSwitchAction +{ + + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("announcementId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsLen("announcementTitle", "公告标题不能为空,[1, 60]范围", 1, 60)); + request.addValidate(new IsIntegerValue("announcementType", "公告类型请选择一项", 1, 3)); + request.addValidate(new IsLen("announcementContent", "公告内容不能为空,[1, 1000]范围", 1, 1000)); + } + + protected void item(HttpRequest request) throws Exception + { + long announcementId = request.getParameterLong("announcementId"); + ZoaAnnouncement item = ORM.table().item(ZoaAnnouncement.class, announcementId); + if (item == null) + { + request.returnHistory("该公告不存在或数据不完整!"); + return; + } + + if (ORM.table().count(ZoaAnnouncementReader.class, announcementId, request.getSessionName()) == 0) + {//未读的,更新为已读 + ZoaAnnouncementReader reader = new ZoaAnnouncementReader(); + reader.setAnnouncementId(announcementId); + reader.setOperatorCode(request.getSessionName()); + ORM.table().insert(reader); + } + + request.setAttribute("item", item); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("fmr_page_size", 20); + + Selector selector = new Selector(); + selector.addJoin(ZoaAnnouncementReader.class, new Selector("operatorCode", request.getSessionName())); + selector.addMaybeLike("announcementTitle", request.getParameter("announcementTitle")); + selector.addMust("announcementStatus", 0); + selector.addOrderbyDesc("announcementTime"); + + PageResult result = ORM.view().page(ZoaAnnouncementEx.class, pageNo, pageSize, selector); + result.addConditionMap(request.getParameterMap()); + + request.setAttribute("result", result); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String announcementTitle = request.getParameter("announcementTitle"); + int announcementType = request.getParameterInt("announcementType"); + String announcementContent = request.getParameter("announcementContent"); + + ZoaAnnouncement item = new ZoaAnnouncement(); + item.setAnnouncementId(Ids.longId()); + item.setAnnouncementTitle(announcementTitle); + item.setAnnouncementType(announcementType); + item.setAnnouncementStatus(0); + item.setAnnouncementContent(announcementContent); + item.setAnnouncementTime(Sqls.nowTimestamp()); + item.setAnnouncementPublisher(request.getSessionName()); + + ORM.table().insert(item); + + //对所有连上来的WS进行消息推送 + HttpSessionManager manager = request.getContext().getSessionManager(); + List list = manager.getSessionUserList(); + for (HttpSessionUser sessionUser : list) + { + List connList = request.getContext().getWebsocketManager().get("zoa_announcement", sessionUser.getSessionId()); + for (HttpWebsocketConnection conn : connList) + { + conn.send("zoa_announcement_new"); + } + } + } + + @Override + protected void delete(HttpRequest request) throws Exception + {//实际为修改为已删除状态 + + Updater updater = new Updater(); + updater.addMust("announcementId", request.getParameterLong("announcementId")); + updater.addField("announcementStatus", 1); + + ORM.table().update(ZoaAnnouncement.class, updater); + } + + /****************************************************************************************/ + //不支持修改 + /****************************************************************************************/ + + @Override + protected void modify(HttpRequest request) throws Exception + { + } + + @Override + protected void update(HttpRequest request) throws Exception + { + } +} diff --git a/zhiqim_httpd/test/org/zhiqim/announcement/action/AnnouncementReaderListAction.java b/zhiqim_httpd/test/org/zhiqim/announcement/action/AnnouncementReaderListAction.java new file mode 100644 index 0000000..0ef286f --- /dev/null +++ b/zhiqim_httpd/test/org/zhiqim/announcement/action/AnnouncementReaderListAction.java @@ -0,0 +1,61 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.announcement.action; + +import org.zhiqim.announcement.dbo.ZoaAnnouncementReaderEx; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.dbo.Selector; + +/** + * 公告阅读列表 + * + * @version v1.0.0 @author duanxiaohui 2017-11-13 新建与整理 + */ +public class AnnouncementReaderListAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("fmr_page_size", 20); + + long announcementId = request.getParameterLong("announcementId"); + + Selector selector = new Selector(); + selector.addMust("announcementId", announcementId); + String operatorKey = request.getParameter("operatorKey"); + + if (Validates.isNotEmpty(operatorKey)) + {//条件 + selector.addOr(new Selector().addMaybeLike("operatorCode", operatorKey).addMaybeLike("operatorName", operatorKey)); + } + + PageResult result = ORM.view().page(ZoaAnnouncementReaderEx.class, pageNo, pageSize, selector); + result.addConditionMap(request.getParameterMap()); + + request.setAttribute("result", result); + } +} diff --git a/zhiqim_httpd/test/org/zhiqim/announcement/action/AnnouncementRecycleAction.java b/zhiqim_httpd/test/org/zhiqim/announcement/action/AnnouncementRecycleAction.java new file mode 100644 index 0000000..0250227 --- /dev/null +++ b/zhiqim_httpd/test/org/zhiqim/announcement/action/AnnouncementRecycleAction.java @@ -0,0 +1,53 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.announcement.action; + +import org.zhiqim.announcement.dbo.ZoaAnnouncementEx; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.dbo.Selector; + +/** + * 公告回收站(已删除列表) + * + * @version v1.0.0 @author duanxiaohui 2017-11-16 新建与整理 + */ +public class AnnouncementRecycleAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int pageNo = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("fmr_page_size", 20); + + Selector selector = new Selector(); + selector.addMust("announcementStatus", 1); + selector.addOrderbyDesc("announcementTime"); + + PageResult result = ORM.view().page(ZoaAnnouncementEx.class, pageNo, pageSize, selector); + result.addConditionMap(request.getParameterMap()); + + request.setAttribute("result", result); + } +} \ No newline at end of file diff --git a/zhiqim_httpd/test/org/zhiqim/announcement/action/AnnouncementRecycleDeleteAction.java b/zhiqim_httpd/test/org/zhiqim/announcement/action/AnnouncementRecycleDeleteAction.java new file mode 100644 index 0000000..bebe0a4 --- /dev/null +++ b/zhiqim_httpd/test/org/zhiqim/announcement/action/AnnouncementRecycleDeleteAction.java @@ -0,0 +1,48 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.announcement.action; + +import org.zhiqim.announcement.dbo.ZoaAnnouncement; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; + +/** + * 公告彻底删除 + * + * @version v1.0.0 @author zouzhigang 2017-11-17 新建与整理 + */ +public class AnnouncementRecycleDeleteAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long announcementId = request.getParameterLong("announcementId"); + if(announcementId == -1) + { + request.returnHistory("该公告不存在"); + return; + } + + ORM.table().delete(ZoaAnnouncement.class, announcementId); + } +} diff --git a/zhiqim_httpd/test/org/zhiqim/announcement/dbo/ZoaAnnouncement.java b/zhiqim_httpd/test/org/zhiqim/announcement/dbo/ZoaAnnouncement.java new file mode 100644 index 0000000..a9431a1 --- /dev/null +++ b/zhiqim_httpd/test/org/zhiqim/announcement/dbo/ZoaAnnouncement.java @@ -0,0 +1,123 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.announcement.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 公告表 对应表《ZOA_ANNOUNCEMENT》 + */ +@AnAlias("ZoaAnnouncement") +@AnTable(table="ZOA_ANNOUNCEMENT", key="ANNOUNCEMENT_ID", type="InnoDB") +public class ZoaAnnouncement implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ANNOUNCEMENT_ID", type="long", notNull=true) private long announcementId; //1.公告编号 + @AnTableField(column="ANNOUNCEMENT_TITLE", type="string,60", notNull=true) private String announcementTitle; //2.公告标题 + @AnTableField(column="ANNOUNCEMENT_TYPE", type="byte", notNull=true) private int announcementType; //3.公告类型:1,行政公告 2,假日公告 3,会议公告 + @AnTableField(column="ANNOUNCEMENT_STATUS", type="int", notNull=true) private int announcementStatus; //4.公告状态:0,正常 1,已删除 + @AnTableField(column="ANNOUNCEMENT_CONTENT", type="string,1000", notNull=true) private String announcementContent; //5.公告内容 + @AnTableField(column="ANNOUNCEMENT_PUBLISHER", type="string,32", notNull=true) private String announcementPublisher; //6.公告发布人 + @AnTableField(column="ANNOUNCEMENT_TIME", type="datetime", notNull=true) private Timestamp announcementTime; //7.公告发布时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getAnnouncementId() + { + return announcementId; + } + + public void setAnnouncementId(long announcementId) + { + this.announcementId = announcementId; + } + + public String getAnnouncementTitle() + { + return announcementTitle; + } + + public void setAnnouncementTitle(String announcementTitle) + { + this.announcementTitle = announcementTitle; + } + + public int getAnnouncementType() + { + return announcementType; + } + + public void setAnnouncementType(int announcementType) + { + this.announcementType = announcementType; + } + + public int getAnnouncementStatus() + { + return announcementStatus; + } + + public void setAnnouncementStatus(int announcementStatus) + { + this.announcementStatus = announcementStatus; + } + + public String getAnnouncementContent() + { + return announcementContent; + } + + public void setAnnouncementContent(String announcementContent) + { + this.announcementContent = announcementContent; + } + + public String getAnnouncementPublisher() + { + return announcementPublisher; + } + + public void setAnnouncementPublisher(String announcementPublisher) + { + this.announcementPublisher = announcementPublisher; + } + + public Timestamp getAnnouncementTime() + { + return announcementTime; + } + + public void setAnnouncementTime(Timestamp announcementTime) + { + this.announcementTime = announcementTime; + } + +} diff --git a/zhiqim_httpd/test/org/zhiqim/announcement/dbo/ZoaAnnouncementEx.java b/zhiqim_httpd/test/org/zhiqim/announcement/dbo/ZoaAnnouncementEx.java new file mode 100644 index 0000000..bc320b5 --- /dev/null +++ b/zhiqim_httpd/test/org/zhiqim/announcement/dbo/ZoaAnnouncementEx.java @@ -0,0 +1,57 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.announcement.dbo; + +import org.zhiqim.announcement.dbo.ZoaAnnouncement; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 公告扩展视图 对应视图《ZOA_ANNOUNCEMENT_EX》 + */ +@AnAlias("ZoaAnnouncementEx") +@AnView("ZOA_ANNOUNCEMENT,ZOA_ANNOUNCEMENT_READER") +@AnViewJoin({@AnViewJoinValue(type="LEFT", lTable="ZOA_ANNOUNCEMENT", lColumn="ANNOUNCEMENT_ID", rTable="ZOA_ANNOUNCEMENT_READER", rColumn="ANNOUNCEMENT_ID")}) +public class ZoaAnnouncementEx extends ZoaAnnouncement +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="ZOA_ANNOUNCEMENT_READER", column="OPERATOR_CODE") private String operatorCode; //2.公告阅读操作员 + + public String toString() + { + return Jsons.toString(this); + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + +} diff --git a/zhiqim_httpd/test/org/zhiqim/announcement/dbo/ZoaAnnouncementReader.java b/zhiqim_httpd/test/org/zhiqim/announcement/dbo/ZoaAnnouncementReader.java new file mode 100644 index 0000000..5833e13 --- /dev/null +++ b/zhiqim_httpd/test/org/zhiqim/announcement/dbo/ZoaAnnouncementReader.java @@ -0,0 +1,67 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.announcement.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 公告阅读表 对应表《ZOA_ANNOUNCEMENT_READER》 + */ +@AnAlias("ZoaAnnouncementReader") +@AnTable(table="ZOA_ANNOUNCEMENT_READER", key="ANNOUNCEMENT_ID,OPERATOR_CODE", type="InnoDB") +public class ZoaAnnouncementReader implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="OPERATOR_CODE", type="string,32", notNull=true) private String operatorCode; //1.公告阅读操作员 + @AnTableField(column="ANNOUNCEMENT_ID", type="long", notNull=true) private long announcementId; //2.公告编号 + + public String toString() + { + return Jsons.toString(this); + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getAnnouncementId() + { + return announcementId; + } + + public void setAnnouncementId(long announcementId) + { + this.announcementId = announcementId; + } + +} diff --git a/zhiqim_httpd/test/org/zhiqim/announcement/dbo/ZoaAnnouncementReaderEx.java b/zhiqim_httpd/test/org/zhiqim/announcement/dbo/ZoaAnnouncementReaderEx.java new file mode 100644 index 0000000..9f57fdd --- /dev/null +++ b/zhiqim_httpd/test/org/zhiqim/announcement/dbo/ZoaAnnouncementReaderEx.java @@ -0,0 +1,79 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.announcement.dbo; + +import org.zhiqim.announcement.dbo.ZoaAnnouncementReader; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 公告阅读扩展视图 对应视图《ZOA_ANNOUNCEMENT_READER_EX》 + */ +@AnAlias("ZoaAnnouncementReaderEx") +@AnView("ZOA_ANNOUNCEMENT_READER,ZMR_OPERATOR") +@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="ZOA_ANNOUNCEMENT_READER", lColumn="OPERATOR_CODE", rTable="ZMR_OPERATOR", rColumn="OPERATOR_CODE")}) +public class ZoaAnnouncementReaderEx extends ZoaAnnouncementReader +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="ZMR_OPERATOR", column="OPERATOR_CODE") private String operatorCode; //2.操作员编码 + @AnViewField(table="ZMR_OPERATOR", column="OPERATOR_NAME") private String operatorName; //3.操作员名称 + @AnViewField(table="ZMR_OPERATOR", column="OPERATOR_AVATAR") private long operatorAvatar; //4.操作员头像编号 + + public String toString() + { + return Jsons.toString(this); + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public String getOperatorName() + { + return operatorName; + } + + public void setOperatorName(String operatorName) + { + this.operatorName = operatorName; + } + + public long getOperatorAvatar() + { + return operatorAvatar; + } + + public void setOperatorAvatar(long operatorAvatar) + { + this.operatorAvatar = operatorAvatar; + } + +} diff --git a/zhiqim_httpd/test/org/zhiqim/httpd/context/config/ZAttributeTest.java b/zhiqim_httpd/test/org/zhiqim/httpd/context/config/ZAttributeTest.java new file mode 100644 index 0000000..9693cc9 --- /dev/null +++ b/zhiqim_httpd/test/org/zhiqim/httpd/context/config/ZAttributeTest.java @@ -0,0 +1,40 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.context.config; + +import org.zhiqim.httpd.context.config.ZAttribute; + +public class ZAttributeTest +{ + public static void main(String[] args) + { + ZAttribute attribute = new ZAttribute(); + attribute.setName("验证码长度"); + attribute.setKey("validateCode.width"); + attribute.setValue("30"); + + String ret = ""; + + System.out.println(attribute.toString()); + System.out.println(ret.equals(attribute.toString())); + } +} diff --git a/zhiqim_httpd/test/org/zhiqim/httpd/test/SessionUser.java b/zhiqim_httpd/test/org/zhiqim/httpd/test/SessionUser.java new file mode 100644 index 0000000..fa4c39f --- /dev/null +++ b/zhiqim_httpd/test/org/zhiqim/httpd/test/SessionUser.java @@ -0,0 +1,34 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.test; + +import org.zhiqim.httpd.HttpSessionUser; + +public class SessionUser extends HttpSessionUser +{ + @Override + public String getSessionName() + { + return "abc"; + } + +} diff --git a/zhiqim_manager/.classpath b/zhiqim_manager/.classpath new file mode 100644 index 0000000..3b611c2 --- /dev/null +++ b/zhiqim_manager/.classpath @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/zhiqim_manager/.project b/zhiqim_manager/.project new file mode 100644 index 0000000..7f4ed3d --- /dev/null +++ b/zhiqim_manager/.project @@ -0,0 +1,17 @@ + + + zhiqim_manager + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/zhiqim_manager/.settings/org.eclipse.core.resources.prefs b/zhiqim_manager/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..e9d5b62 --- /dev/null +++ b/zhiqim_manager/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding//src/org/zhiqim/manager/action/IndexAction.java=UTF-8 diff --git a/zhiqim_manager/.settings/org.eclipse.jdt.core.prefs b/zhiqim_manager/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..87b7a7a --- /dev/null +++ b/zhiqim_manager/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/zhiqim_manager/bin/.gitignore b/zhiqim_manager/bin/.gitignore new file mode 100644 index 0000000..cf1db2e --- /dev/null +++ b/zhiqim_manager/bin/.gitignore @@ -0,0 +1 @@ +/org/ diff --git a/zhiqim_manager/conf/httpd.xml b/zhiqim_manager/conf/httpd.xml new file mode 100644 index 0000000..8fde3a6 --- /dev/null +++ b/zhiqim_manager/conf/httpd.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_manager/conf/logging.xml b/zhiqim_manager/conf/logging.xml new file mode 100644 index 0000000..da3a326 --- /dev/null +++ b/zhiqim_manager/conf/logging.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_manager/conf/zhiqim.xml b/zhiqim_manager/conf/zhiqim.xml new file mode 100644 index 0000000..1b4532a --- /dev/null +++ b/zhiqim_manager/conf/zhiqim.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_manager/document/export/V1.5.0.exp.xml b/zhiqim_manager/document/export/V1.5.0.exp.xml new file mode 100644 index 0000000..92c8573 --- /dev/null +++ b/zhiqim_manager/document/export/V1.5.0.exp.xml @@ -0,0 +1,33 @@ + +
            +
            + + + + + + + + + + + + + + + +
            +
            + + + + + + + + + + + +
            +
            diff --git a/zhiqim_manager/document/export/jar.exp.xml b/zhiqim_manager/document/export/jar.exp.xml new file mode 100644 index 0000000..b3d1639 --- /dev/null +++ b/zhiqim_manager/document/export/jar.exp.xml @@ -0,0 +1,15 @@ + +
            +
            + + + + + + + + + + +
            +
            diff --git a/zhiqim_manager/document/export/project.exp.xml b/zhiqim_manager/document/export/project.exp.xml new file mode 100644 index 0000000..3ff590d --- /dev/null +++ b/zhiqim_manager/document/export/project.exp.xml @@ -0,0 +1,20 @@ + +
            +
            + + + + + + + + + + + + + + + +
            +
            diff --git a/zhiqim_manager/lib/aliyun-java-sdk-core-4.1.0.jar b/zhiqim_manager/lib/aliyun-java-sdk-core-4.1.0.jar new file mode 100644 index 0000000..cc7da01 Binary files /dev/null and b/zhiqim_manager/lib/aliyun-java-sdk-core-4.1.0.jar differ diff --git a/zhiqim_manager/lib/aliyun-java-sdk-dysmsapi-1.1.0.jar b/zhiqim_manager/lib/aliyun-java-sdk-dysmsapi-1.1.0.jar new file mode 100644 index 0000000..d07e04f Binary files /dev/null and b/zhiqim_manager/lib/aliyun-java-sdk-dysmsapi-1.1.0.jar differ diff --git a/zhiqim_manager/lib/commons-codec-1.9.jar b/zhiqim_manager/lib/commons-codec-1.9.jar new file mode 100644 index 0000000..ef35f1c Binary files /dev/null and b/zhiqim_manager/lib/commons-codec-1.9.jar differ diff --git a/zhiqim_manager/lib/commons-lang-2.6.jar b/zhiqim_manager/lib/commons-lang-2.6.jar new file mode 100644 index 0000000..98467d3 Binary files /dev/null and b/zhiqim_manager/lib/commons-lang-2.6.jar differ diff --git a/zhiqim_manager/lib/commons-lang3-3.7.jar b/zhiqim_manager/lib/commons-lang3-3.7.jar new file mode 100644 index 0000000..f37ded6 Binary files /dev/null and b/zhiqim_manager/lib/commons-lang3-3.7.jar differ diff --git a/zhiqim_manager/lib/commons-logging-1.2.jar b/zhiqim_manager/lib/commons-logging-1.2.jar new file mode 100644 index 0000000..93a3b9f Binary files /dev/null and b/zhiqim_manager/lib/commons-logging-1.2.jar differ diff --git a/zhiqim_manager/lib/fastjson-1.2.47.jar b/zhiqim_manager/lib/fastjson-1.2.47.jar new file mode 100644 index 0000000..f342bca Binary files /dev/null and b/zhiqim_manager/lib/fastjson-1.2.47.jar differ diff --git a/zhiqim_manager/lib/gson-2.8.5.jar b/zhiqim_manager/lib/gson-2.8.5.jar new file mode 100644 index 0000000..0d5baf3 Binary files /dev/null and b/zhiqim_manager/lib/gson-2.8.5.jar differ diff --git a/zhiqim_manager/lib/httpclient-4.5.2.jar b/zhiqim_manager/lib/httpclient-4.5.2.jar new file mode 100644 index 0000000..701609f Binary files /dev/null and b/zhiqim_manager/lib/httpclient-4.5.2.jar differ diff --git a/zhiqim_manager/lib/httpcore-4.4.9.jar b/zhiqim_manager/lib/httpcore-4.4.9.jar new file mode 100644 index 0000000..cddba28 Binary files /dev/null and b/zhiqim_manager/lib/httpcore-4.4.9.jar differ diff --git a/zhiqim_manager/lib/jackson-annotations-2.9.0.jar b/zhiqim_manager/lib/jackson-annotations-2.9.0.jar new file mode 100644 index 0000000..c602d75 Binary files /dev/null and b/zhiqim_manager/lib/jackson-annotations-2.9.0.jar differ diff --git a/zhiqim_manager/lib/workwechat-service-provider-SNAPSHOT-1.0.0.jar b/zhiqim_manager/lib/workwechat-service-provider-SNAPSHOT-1.0.0.jar new file mode 100644 index 0000000..9f88093 Binary files /dev/null and b/zhiqim_manager/lib/workwechat-service-provider-SNAPSHOT-1.0.0.jar differ diff --git a/zhiqim_manager/lib/zhiqim.jar b/zhiqim_manager/lib/zhiqim.jar new file mode 100644 index 0000000..5c710ad Binary files /dev/null and b/zhiqim_manager/lib/zhiqim.jar differ diff --git a/zhiqim_manager/lib/zhiqim_httpd.jar b/zhiqim_manager/lib/zhiqim_httpd.jar new file mode 100644 index 0000000..31f9b33 Binary files /dev/null and b/zhiqim_manager/lib/zhiqim_httpd.jar differ diff --git a/zhiqim_manager/lib/zhiqim_mysql5.0.8.jar b/zhiqim_manager/lib/zhiqim_mysql5.0.8.jar new file mode 100644 index 0000000..6e34167 Binary files /dev/null and b/zhiqim_manager/lib/zhiqim_mysql5.0.8.jar differ diff --git a/zhiqim_manager/lib/zhiqim_orm.jar b/zhiqim_manager/lib/zhiqim_orm.jar new file mode 100644 index 0000000..2e4dcef Binary files /dev/null and b/zhiqim_manager/lib/zhiqim_orm.jar differ diff --git a/zhiqim_manager/lib/zhiqim_ui.jar b/zhiqim_manager/lib/zhiqim_ui.jar new file mode 100644 index 0000000..20dcff2 Binary files /dev/null and b/zhiqim_manager/lib/zhiqim_ui.jar differ diff --git a/zhiqim_manager/lib/zhiqim_zml.jar b/zhiqim_manager/lib/zhiqim_zml.jar new file mode 100644 index 0000000..0e2aa82 Binary files /dev/null and b/zhiqim_manager/lib/zhiqim_zml.jar differ diff --git a/zhiqim_manager/logs/2024-06-09.error.log b/zhiqim_manager/logs/2024-06-09.error.log new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/zhiqim_manager/logs/2024-06-09.error.log @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/zhiqim_manager/logs/2024-06-09.info.log b/zhiqim_manager/logs/2024-06-09.info.log new file mode 100644 index 0000000..3c2ca4f --- /dev/null +++ b/zhiqim_manager/logs/2024-06-09.info.log @@ -0,0 +1,106 @@ +2024-06-09 12:00:41,023 [main] INFO - 初始化[数据库映射:orm]开始... +2024-06-09 12:00:41,124 [main] INFO - 增加计划任务[Scheduler-PewK-org.zhiqim.orm.ZTableCacheTask] +2024-06-09 12:00:41,128 [main] INFO - 增加计划任务[Scheduler-PewK-org.zhiqim.orm.ZTableCacheTask] +2024-06-09 12:00:41,130 [main] INFO - 初始化[数据库映射:orm]完成!!! + +2024-06-09 12:00:41,130 [main] INFO - 初始化[HTTP服务:httpd]开始... +2024-06-09 12:00:41,131 [Interval-org.zhiqim.httpd.nio.HttpNioListener] INFO - 允许最大连接[200],当前总连接[0]=WS[0]+活动[0]+空闲[0],允许空闲[53]秒 +2024-06-09 12:00:41,285 [main] INFO - 初始化[HTTP服务:httpd][ZML引擎]开始...[2024-06-09 12:00:41,285] +2024-06-09 12:00:41,292 [main] INFO - 初始化[HTTP服务:httpd][ZML引擎]结束!!![2024-06-09 12:00:41,292] +2024-06-09 12:00:41,292 [main] INFO - 初始化[HTTP服务:httpd][Context:zhiqim_manager]开始...[2024-06-09 12:00:41,292] +2024-06-09 12:00:41,300 [main] INFO - +2024-06-09 12:00:41,300 [main] INFO - +2024-06-09 12:00:41,300 [main] INFO - +2024-06-09 12:00:41,300 [main] INFO - +2024-06-09 12:00:41,301 [main] INFO - +2024-06-09 12:00:41,301 [main] INFO - +2024-06-09 12:00:41,305 [main] INFO - +2024-06-09 12:00:41,305 [main] INFO - +2024-06-09 12:00:41,305 [main] INFO - +2024-06-09 12:00:41,306 [main] INFO - +2024-06-09 12:00:41,306 [main] INFO - +2024-06-09 12:00:41,306 [main] INFO - +2024-06-09 12:00:41,306 [main] INFO - +2024-06-09 12:00:41,306 [main] INFO - +2024-06-09 12:00:41,306 [main] INFO - +2024-06-09 12:00:41,306 [main] INFO - +2024-06-09 12:00:41,306 [main] INFO - +2024-06-09 12:00:41,307 [main] INFO - +2024-06-09 12:00:41,307 [main] INFO - +2024-06-09 12:00:41,307 [main] INFO - +2024-06-09 12:00:41,307 [main] INFO - +2024-06-09 12:00:41,307 [main] INFO - +2024-06-09 12:00:41,308 [main] INFO - +2024-06-09 12:00:41,308 [main] INFO - +2024-06-09 12:00:41,308 [main] INFO - +2024-06-09 12:00:41,308 [main] INFO - +2024-06-09 12:00:41,308 [main] INFO - +2024-06-09 12:00:41,308 [main] INFO - +2024-06-09 12:00:41,308 [main] INFO - +2024-06-09 12:00:41,308 [main] INFO - +2024-06-09 12:00:41,309 [main] INFO - +2024-06-09 12:00:41,309 [main] INFO - +2024-06-09 12:00:41,309 [main] INFO - +2024-06-09 12:00:41,309 [main] INFO - +2024-06-09 12:00:41,309 [main] INFO - +2024-06-09 12:00:41,309 [main] INFO - +2024-06-09 12:00:41,309 [main] INFO - +2024-06-09 12:00:41,309 [main] INFO - +2024-06-09 12:00:41,310 [main] INFO - +2024-06-09 12:00:41,310 [main] INFO - +2024-06-09 12:00:41,310 [main] INFO - +2024-06-09 12:00:41,310 [main] INFO - +2024-06-09 12:00:41,310 [main] INFO - +2024-06-09 12:00:41,310 [main] INFO - +2024-06-09 12:00:41,310 [main] INFO - +2024-06-09 12:00:41,310 [main] INFO - +2024-06-09 12:00:41,310 [main] INFO - +2024-06-09 12:00:41,311 [main] INFO - +2024-06-09 12:00:41,311 [main] INFO - +2024-06-09 12:00:41,311 [main] INFO - +2024-06-09 12:00:41,311 [main] INFO - +2024-06-09 12:00:41,311 [main] INFO - +2024-06-09 12:00:41,311 [main] INFO - +2024-06-09 12:00:41,312 [main] INFO - +2024-06-09 12:00:41,312 [main] INFO - +2024-06-09 12:00:41,312 [main] INFO - +2024-06-09 12:00:41,312 [main] INFO - +2024-06-09 12:00:41,312 [main] INFO - +2024-06-09 12:00:41,312 [main] INFO - +2024-06-09 12:00:41,313 [main] INFO - +2024-06-09 12:00:41,313 [main] INFO - +2024-06-09 12:00:41,313 [main] INFO - +2024-06-09 12:00:41,313 [main] INFO - +2024-06-09 12:00:41,313 [main] INFO - +2024-06-09 12:00:41,313 [main] INFO - +2024-06-09 12:00:41,313 [main] INFO - +2024-06-09 12:00:41,313 [main] INFO - +2024-06-09 12:00:41,313 [main] INFO - +2024-06-09 12:00:41,313 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,314 [main] INFO - +2024-06-09 12:00:41,315 [main] INFO - +2024-06-09 12:00:41,315 [main] INFO - +2024-06-09 12:00:41,315 [main] INFO - +2024-06-09 12:00:41,315 [main] INFO - +2024-06-09 12:00:41,315 [main] INFO - +2024-06-09 12:00:41,315 [main] INFO - +2024-06-09 12:00:41,315 [main] INFO - +2024-06-09 12:00:41,329 [main] INFO - 刷新缓存[org.zhiqim.manager.dbo.ZmrParam] +2024-06-09 12:00:41,441 [main] INFO - 增加计划任务[Scheduler-aqGB-org.zhiqim.manager.ZmrTask] +2024-06-09 12:00:41,441 [main] INFO - 初始化[HTTP服务:httpd][Context:管理平台]完成!!![2024-06-09 12:00:41,441] +2024-06-09 12:00:41,441 [main] INFO - 初始化[HTTP服务:httpd]http监听:[name:httpd;port:8999]完成!!! + +2024-06-09 12:00:41,441 [main] INFO - 系统[zhiqim_manager]-版本[V3.0]初始化完成!!! + diff --git a/zhiqim_manager/logs/database/2024-06-09.database.log b/zhiqim_manager/logs/database/2024-06-09.database.log new file mode 100644 index 0000000..578f60a --- /dev/null +++ b/zhiqim_manager/logs/database/2024-06-09.database.log @@ -0,0 +1,21 @@ +2024-06-09 12:00:41,035 [main] INFO - 创建数据库连接[000001][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[测试] +2024-06-09 12:00:41,040 [main] INFO - 创建数据库连接[000002][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,045 [main] INFO - 创建数据库连接[000003][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,048 [main] INFO - 创建数据库连接[000004][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,053 [main] INFO - 创建数据库连接[000005][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,057 [main] INFO - 创建数据库连接[000006][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,060 [main] INFO - 创建数据库连接[000007][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,065 [main] INFO - 创建数据库连接[000008][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,071 [main] INFO - 创建数据库连接[000009][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,075 [main] INFO - 创建数据库连接[000010][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,079 [main] INFO - 创建数据库连接[000011][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,082 [main] INFO - 创建数据库连接[000012][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,085 [main] INFO - 创建数据库连接[000013][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,089 [main] INFO - 创建数据库连接[000014][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,093 [main] INFO - 创建数据库连接[000015][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,096 [main] INFO - 创建数据库连接[000016][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,099 [main] INFO - 创建数据库连接[000017][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,102 [main] INFO - 创建数据库连接[000018][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,105 [main] INFO - 创建数据库连接[000019][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,109 [main] INFO - 创建数据库连接[000020][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] +2024-06-09 12:00:41,113 [main] INFO - 创建数据库连接[000021][jdbc:mysql://127.0.0.1:3306/yangcai_design?useUnicode=true&characterEncoding=UTF-8|root]成功,[初始化] diff --git a/zhiqim_manager/resource/conf/config.xml b/zhiqim_manager/resource/conf/config.xml new file mode 100644 index 0000000..fe9d97c --- /dev/null +++ b/zhiqim_manager/resource/conf/config.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/conf/config.zml b/zhiqim_manager/resource/conf/config.zml new file mode 100644 index 0000000..3b64c72 --- /dev/null +++ b/zhiqim_manager/resource/conf/config.zml @@ -0,0 +1,149 @@ +<#--------------------------------------------------------------------------> +<#-----知启蒙全局变量定义(统一使用zhiqim前缀)---------------------------------> +<#--------------------------------------------------------------------------> + +<#var zhiqim.css = context.getRootPath("/service/res/zhiqim_v1.5.0.r2019010101.css")/> +<#var zhiqim.js = new ZmrCdnRuntime(context, "/service/res/zhiqim_v1.5.0.r2019010101.min.js")/> +<#var zhiqim.mobile.css= context.getRootPath("/service/res/zhiqim.mobile_v1.5.0.r2019010101.css")/> +<#var zhiqim.mobile.js= new ZmrCdnRuntime(context, "/service/res/zhiqim.mobile_v1.5.0.r2019010101.min.js")/> +<#var zhiqim_iframenav.js = new ZmrCdnRuntime(context, "/ztmpl/zhiqim_manager/zhiqim_iframenav_v1.5.0.r2019010101.js")/> +<#var jsencrypt.js = new ZmrCdnRuntime(context, "/ztmpl/zhiqim_manager/jsencrypt.js")/> + +<#--------------------------------------------------------------------------> +<#-----知启蒙管理台变量定义(统一使用zmr前缀)----------------------------------> +<#--------------------------------------------------------------------------> + +<#--分页显示默认条数--> +<#var zmr_page_size = 20/> + +<#--脚注标注--> +<#var zmr_copyname = "2021 秒绘科技"/> +<#var zmr_copyright = "Copyright  © "+zmr_copyname+" All Rights Reserved"/> + +<#--------------------------------------------------------------------------> +<#-------知启蒙管理台函数定义(统一使用zhiqim_manager前缀)---------------------> +<#--------------------------------------------------------------------------> + +<#--头部定义返回历史连接--> +<#function zhiqim_manager_history(url)> + + + +<#--主体内容--> +<#function zhiqim_manager_content()> +
            + + +<#--主体内容结束--> +<#function zhiqim_manager_content_end()> +
            + + +<#--显示标题--> +<#function zhiqim_manager_title(name)> + + + + +
            ${name}
            + + +<#--显示无记录信息--> +<#function zhiqim_manager_no_record(colspan, desc)> + + ${desc} + + + +<#--显示无记录信息--> +<#function zhiqim_manager_tr_no_record(result, colspan, desc)> +<#if result.isEmpty()> + + ${desc} + + + + +<#--显示tr标题--> +<#function zhiqim_manager_tr_title(colspan, name)> + + ${name} + + + +<#--判断列表背景分隔颜色--> +<#function zhiqim_manager_tr_bg(index)> +<#if index % 2 == 0>${zmr_tr_odd_bgcolor}<#else>${zmr_tr_even_bgcolor} + + +<#--列表行移入移出颜色变化--> +<#function zhiqim_manager_tr_onmouse()> +onmouseover="Z(this).css('background-color', '${zmr_tr_over_bgcolor}')" onmouseout="Z(this).css('background-color', '${zmr_tr_even_bgcolor}')" + + +<#--列表行点击选中单选按钮--> +<#function zhiqim_manager_tr_click_radio()> +onclick="Z(this).find('td:first-child > zcover > i.z-radio').click();" + + +<#--列表行点击选中多选按钮--> +<#function zhiqim_manager_tr_click_checkbox()> +onclick="Z(this).find('td:first-child > zcover > i.z-checkbox').click();" + + +<#--显示记录脚注--> +<#function zhiqim_manager_list(size)> + + + + +
            共 ${size} 条数据
            + + +<#--显示返回上一页--> +<#function zhiqim_manager_return()> + + + + +
            返回上一页
            + + +<#--显示返回上一页和提交--> +<#function zhiqim_manager_submit()> + + + + + +
            返回上一页
            + + +<#--显示返回上一页和提交带参数--> +<#function zhiqim_manager_submit_onclick(onclick)> + + + + + +
            返回上一页
            + + +<#--------------------------------------------------------------------------> +<#-------知启蒙管理台预定义函数定义-------------------------------------------> +<#--------------------------------------------------------------------------> + +<#--topnav左边区域自定义块--> +<#function zhiqim_manager_topnav_left_defined()> + + + +<#--topnav右边区域自定义块--> +<#function zhiqim_manager_topnav_right_defined()> + + diff --git a/zhiqim_manager/resource/conf/zmr.menu.sql b/zhiqim_manager/resource/conf/zmr.menu.sql new file mode 100644 index 0000000..1a6118d --- /dev/null +++ b/zhiqim_manager/resource/conf/zmr.menu.sql @@ -0,0 +1,58 @@ +-- --------------------------------------------------- +-- 知启蒙管理台功能菜单 +-- --------------------------------------------------- + + +truncate table ZMR_MENU; +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('ROOT', 'MENU', '系统功能根菜单', '', 0, 0, 0, '', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU', 'MENU_010', '系统配置', '系统', 1, 0, 1, 'z-config', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_010', '系统基础设置', '', 2, 0, 1, 'z-setting', '/${zhiqim_manager}/menu.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_010', '增加系统菜单', '', 3, 0, 2, '', '/${zhiqim_manager}/menuAdd.htm,/${zhiqim_manager}/menuInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_020', '修改系统菜单', '', 3, 0, 2, '', '/${zhiqim_manager}/menuModify.htm,/${zhiqim_manager}/menuUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_030', '删除系统菜单', '', 3, 0, 2, '', '/${zhiqim_manager}/menuDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_100', '系统头像管理', '', 3, 0, 2, '', '/${zhiqim_manager}/avatar.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_110', '增加系统头像', '', 3, 0, 2, '', '/${zhiqim_manager}/avatarAdd.htm,/${zhiqim_manager}/avatarInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_120', '修改系统头像', '', 3, 0, 2, '', '/${zhiqim_manager}/avatarModify.htm,/${zhiqim_manager}/avatarUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_130', '删除系统头像', '', 3, 0, 2, '', '/${zhiqim_manager}/avatarDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_200', '系统配置管理', '', 3, 0, 2, '', '/${zhiqim_manager}/config.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_210', '系统缓存管理', '', 3, 0, 2, '', '/${zhiqim_manager}/cache.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_300', '系统参数设置', '', 3, 0, 2, '', '/${zhiqim_manager}/param.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_305', '操作员参数管理', '', 3, 0, 2, '', '/${zhiqim_manager}/paramOperator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_310', '首页主题设置', '', 3, 0, 2, '', '/${zhiqim_manager}/themeIndex.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_320', '主页主题设置', '', 3, 0, 2, '', '/${zhiqim_manager}/themeMain.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_330', '公钥私钥设置', '', 3, 0, 2, '', '/${zhiqim_manager}/keys.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_340', '系统进程管理', '', 3, 0, 2, '', '/${zhiqim_manager}/process.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_050', '组织部门管理', '', 2, 0, 1, 'z-apps', '/${zhiqim_manager}/dept.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_010', '组织管理', '', 3, 0, 2, '', '/${zhiqim_manager}/org.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_020', '增加组织', '', 3, 0, 2, '', '/${zhiqim_manager}/orgAdd.htm,/zhiqim_manager/orgInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_030', '修改组织', '', 3, 0, 2, '', '/${zhiqim_manager}/orgModify.htm,/zhiqim_manager/orgUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_040', '删除组织', '', 3, 0, 2, '', '/${zhiqim_manager}/orgDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_050', '组织权限', '', 3, 0, 2, '', '/${zhiqim_manager}/orgRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_100', '部门管理', '', 3, 0, 2, '', '/${zhiqim_manager}/dept.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_110', '增加部门', '', 3, 0, 2, '', '/${zhiqim_manager}/deptAdd.htm,/${zhiqim_manager}/deptInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_120', '修改部门', '', 3, 0, 2, '', '/${zhiqim_manager}/deptModify.htm,/${zhiqim_manager}/deptUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_130', '删除部门', '', 3, 0, 2, '', '/${zhiqim_manager}/deptDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_140', '部门成员', '', 3, 0, 2, '', '/${zhiqim_manager}/deptOperator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_150', '部门权限', '', 3, 0, 2, '', '/${zhiqim_manager}/deptRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_110', '操作员管理', '', 2, 0, 1, 'z-customer', '/${zhiqim_manager}/operator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_010', '增加操作员', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorAdd.htm,/${zhiqim_manager}/operatorInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_020', '修改操作员', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorModify.htm,/${zhiqim_manager}/operatorUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_030', '删除操作员', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_040', '查看操作员权限', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorRuleView.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_050', '设置操作员独立权限 ', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_060', '设置操作员部门', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorDept.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_070', '设置操作员角色', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorRole.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_080', '操作员参数管理', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorParam.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_090', '角色管理', '', 3, 0, 2, '', '/${zhiqim_manager}/role.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_100', '增加角色', '', 3, 0, 2, '', '/${zhiqim_manager}/roleAdd.htm,/${zhiqim_manager}/roleInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_110', '修改角色', '', 3, 0, 2, '', '/${zhiqim_manager}/roleModify.htm,/${zhiqim_manager}/roleUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_120', '删除角色', '', 3, 0, 2, '', '/${zhiqim_manager}/roleDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_130', '角色成员', '', 3, 0, 2, '', '/${zhiqim_manager}/roleOperator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_140', '角色权限', '', 3, 0, 2, '', '/${zhiqim_manager}/roleRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_150', '操作日志查询', '', 2, 0, 1, 'z-text', '/${zhiqim_manager}/operateLog.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_150', 'MENU_010_150_100', '操作员在线列表', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorOnline.htm', ''); +commit; + +-- --------------------------------------------------- +-- 知启蒙管理台功能菜单创建完成 +-- --------------------------------------------------- diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/alone.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/alone.htm new file mode 100644 index 0000000..fb74675 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/alone.htm @@ -0,0 +1,138 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} + + + +${Htmls.toCallFrame()} + +
            + +
            +
            + ${zhiqim_manager_topnav_left_defined()} +
            +
            + ${zhiqim_manager_topnav_right_defined()} + <#if ZmrOrgDao.getOrgList(request, sessionUser.getOperatorCode()).size() gt 1> + + + + +
            +
            + + +
            + + + + + +
            + <#include include/> +
            + + +
            + + + +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/contactus.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/contactus.png new file mode 100644 index 0000000..6f40b77 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/contactus.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/default_2019010101.css b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/default_2019010101.css new file mode 100644 index 0000000..341bee6 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/default_2019010101.css @@ -0,0 +1,95 @@ +@charset "utf-8"; + +/* ZhiqimUI */ +.z-input{color:#333;} + +/* global */ +body{color:#333;background-color:#fff;} +body,table,td,div{font-size:14px;line-height:120%;} +a,a:visited{color:#333;text-decoration:none;cursor:pointer;} +a:active,a:hover{color:#4bb0af;text-decoration:none;} +a.blue,a.blue:visited{color:#0066cc;text-decoration:none;cursor:pointer;} +a.blue:active,a.blue:hover{color:#0066cc;text-decoration:underline;} + +/* topnav */ +.topnav {position:relative;width:100%;min-width:680px;color:#fff;background-color:#00a2eb;height:55px;z-index:99;} +.topnav .logo {float:left;width:200px;height:55px;padding:0 10px;overflow:hidden;font-size:24px;line-height:55px;background-color:#008bd2;word-break:break-all;word-wrap:break-word;} +.topnav a{color: #fff;} + +.topnav .topnavleft {float:left;height:55px;} +.topnav .topnavleft .bar {float:left;height:55px;line-height:55px;} +.topnav .topnavleft .first {border-left:1px solid #008bd2;} +.topnav .topnavleft .nav, .topnav .topnavleft .nav-only {float:left;height:55px;line-height:55px;border-right:1px solid #008bd2;} +.topnav .topnavleft .nav:hover{background-color:#008bd2; color:#fff;} + +.topnav .topnavright {float:right;height:55px;} +.topnav .topnavright .nav, .topnav .topnavright .nav-only {float:left;height:55px;line-height:55px;border-left:1px solid #008bd2;} +.topnav .topnavright .nav:hover {background-color:#008bd2; color:#fff;} + +/* container */ +.container {position:relative;width:100%;height:100%;min-height:1000px;overflow:hidden;background-color:#eaedf1;} + +/*[替换z-tabnav的背景色为容器背景色]*/ +.container .z-tabnav>nav li.z-active{border-bottom:1px solid #eaedf1;} +.container .z-tabnav>nav li.z-active:hover{background-color:#eaedf1;} + +.sidebar {position:relative;float:left;width:200px;min-height:1000px;overflow:hidden;background-color:#2c3a40;margin-bottom:-9999px;padding-bottom:9999px;} +.sidebar p{position:relative;float:left;width:200px; height:40px;line-height:40px;color:#fff; padding-left:15px; background-color:#273237;cursor:pointer;border-bottom:1px solid #22282e;} +.sidebar p a{color:#fff;} +.sidebar p .z-arrow{position:absolute;top:16px;right:10px;} +.sidebar p:hover{background-color:#22282e;} +.sidebar p.active{background-color:#37424f;} + +.sidebar ul{position:relative;width:200px;height:auto;overflow:hidden;} +.sidebar ul li{float:left;background-color:#37424f;width:200px;height:40px;color:#fff; line-height:40px;padding-left:15px;cursor:pointer;} +.sidebar ul li a{color:#fff;} +.sidebar ul li:hover{background-color:#414750;color:#fff;} +.sidebar ul li.active{background-color:#5c5c5c;color:#fff;} + +/* iframenav */ +.iframenav{position:relative;margin-left:200px;height:40px;line-height:40px;} + +/* [iframenav翻页] */ +.iframenav-prev,.iframenav-next{position:absolute;top:0;width:50px;height:39px;z-index:1;background:#fff;cursor:pointer;padding:0 22px;text-align:center;line-height:39px;} +.iframenav-prev:hover,.iframenav-next:hover{background-color:#f5f5f5;} +.iframenav-prev{left:0;border-right:1px solid #d3d3d3;} +.iframenav-next{right:100px;border-left:1px solid #d3d3d3;} +.iframenav-prev .z-font,.iframenav-next .z-font{color:#999;margin-left:-8px;} + +/* [iframenav控制] */ +.iframenav-ctrl{position:absolute;top:0;right:0;} +.iframenav-ctrl-title{position:absolute;top:0;right:0;width:100px;height:39px;z-index:1;border-left:1px solid #d3d3d3;text-align:center;line-height:39px;color:#666;background:#fff;cursor:pointer;} +.iframenav-ctrl-title:hover{background-color:#f5f5f5;} +.iframenav-ctrl-title .z-font{color:#999;margin-left:6px;font-size:10px;} +.iframenav-ctrl-wrap{position:absolute;top:39px;right:0;display:none;width:150px;height:130px;z-index:2;background-color:#fff;border:1px solid #d3d3d3;} +.iframenav-ctrl-wrap ul{padding:10px 0;} +.iframenav-ctrl-wrap ul+ul{border-top:1px solid #ccc;} +.iframenav-ctrl-wrap li{padding:0 25px;line-height:30px;cursor:pointer;} +.iframenav-ctrl-wrap li:hover{background:#f1f1f1;} + +/* [iframenav选项卡] */ +.iframenav-tab-wrap{height:39px;margin:0 150px 0 50px;overflow:hidden;position:relative;} +.iframenav-tab-list{position:absolute;left:0;top:0;height:39px;background-color:#fff;overflow:hidden;} +.iframenav-tab-item{position:relative;float:left;line-height:39px;border-right:1px solid #d3d3d3;padding:0 35px 0 20px;background:#fff;color:#666;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;} +.iframenav-tab-item.active{background-color:#d4d8db;} +.iframenav-tab-item:hover{color:#222;} +.iframenav-tab-item:first-child{padding-right:23px;} + +.iframenav-tab-item .z-font{position:absolute;top:2px;width:25px;line-height:39px;color:#666;font-size:12px;cursor:pointer;text-align:center;} +.iframenav-tab-item .z-error{right:0;padding-right:5px;} +.iframenav-tab-item .z-error:hover{color:#f00;} + +/* [iframenav内容页] */ +.iframenav-cont{} +.iframenav-cont-item{width:100%;height:100%;display:none;} +.iframenav-cont-item.active{display:block;} +.iframenav-cont-item > iframe{width:100%;height:100%;border:0;margin:0;padding:0;} + +/* mainbody */ +.mainbody{margin-left:200px;} +.mainbody .breadcrumb{position:relative;float:left;width:100%;} +.mainbody .content{position:relative;float:left;width:100%;padding:20px;} + +/* footer */ +.footer {position:relative;width:100%;height:60px;display:block;overflow:hidden;background-color:#f4f4f4;border-top:1px solid #d3d3d3;z-index:99;} +.footer-wrap {position:relative;margin:0 auto;height:100%;line-height:60px;text-align: center;color:#333;} diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/default_2019010101.js b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/default_2019010101.js new file mode 100644 index 0000000..fb6aee2 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/default_2019010101.js @@ -0,0 +1,115 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站进行实名登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/LICENSE.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ ++(function(Z) +{//BEGIN + +/**************************************************/ +//定义全局的对象,便于所有的页面调用 +/**************************************************/ +var Zmr = window.Zmr = {}; + +Zmr.selectOrgDialog = function() +{//弹出组织选择框 + var dialog = new Z.Dialog(); + dialog.title = "选择组织"; + dialog.url = "orgSelector.htm"; + dialog.width = 392; + dialog.height = 423; + dialog.fixed = true; + dialog.scroll = true; + dialog.execute(); +}; + +Zmr.sidebar = function() +{//打开&关闭边导航 + var $sidebar = Z("#sidebar"); + if ($sidebar.isHide()) + { + $sidebar.show(); + Z("#logo").show(); + Z("#iframenav").css("margin-left", 200); + Z("#mainbody").css("margin-left", 200); + } + else + { + $sidebar.hide(); + Z("#logo").hide(); + Z("#iframenav").css("margin-left", 0); + Z("#mainbody").css("margin-left", 0); + } + + Z.ajax().setContextPath(Zmr.contextPath) + .setClassName("sessionUser").setMethodName("setSidebar").addParam(!$sidebar.isHide()) + .execute(); +}; + +Zmr.calcMainbodyHeight = function() +{//计算主体高度 + var height = Z(document).clientHeight()-55;//55为topnav的高度 + Z("#container").css("height", height); + Z("#mainbody").css("height", height-40);//40为iframenav高度 +}; + +Zmr.treeExpand = function(code) +{//树菜单展开和关闭 + var $menu = Z("#menu-"+code); + var $ico = Z("#ico-"+code); + + if (!$menu.isHide()) + { + $menu.hide(); + if ($ico.hasClass("z-mlastnode")) + $ico.removeClass("z-mlastnode").addClass("z-plastnode"); + else + $ico.removeClass("z-mnode").addClass("z-pnode"); + } + else + { + $menu.show(); + if ($ico.hasClass("z-plastnode")) + $ico.removeClass("z-plastnode").addClass("z-mlastnode"); + else + $ico.removeClass("z-pnode").addClass("z-mnode"); + } +}; + +Zmr.addTopMenuClick = function() +{//增加顶级栏目点击事件,先定义两个开关,防止并发时导致数据混乱 + Zmr.doClickTopMenuUp = false; + Zmr.doClickTopMenuDw = false; + + Z(".sidebar p").click(function() + { + if (Zmr.doClickTopMenuUp || Zmr.doClickTopMenuDw) + return; + + Zmr.doClickTopMenuUp = true;Zmr.doClickTopMenuDw = true; + Z(this).next("ul").slideToggle(200, function(){Zmr.doClickTopMenuDw = false;}) + .siblings("ul").slideUp(200, function(){Zmr.doClickTopMenuUp = false;}); + }); +}; + +/**************************************************/ +//定义初始化滑动菜单 +/**************************************************/ +Z.onload(function() +{//菜单隐藏展开 + Zmr.addTopMenuClick(); +}); + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/define.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/define.htm new file mode 100644 index 0000000..12120c7 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/define.htm @@ -0,0 +1,61 @@ +<#--变量定义--> +<#var zmr_theme.css = context.getRootPath("/ztmpl/zhiqim_manager/"+themeMain+"/default_2019010101.css")/> +<#var zmr_theme.js = context.getRootPath("/ztmpl/zhiqim_manager/"+themeMain+"/default_2019010101.js")/> +<#var zmr_color_class = "z-blue"/> +<#var zmr_sidebar_width = 200/> +<#var zmr_topnav_height = 55/> +<#var zmr_breadcrumb_height = 40/> +<#var zmr_title_bgcolor = "#efefef"/> +<#var zmr_thead_bgcolor = "#efefef"/> +<#var zmr_tr_odd_bgcolor = "#f3fdfc"/> +<#var zmr_tr_even_bgcolor = "#ffffff"/> +<#var zmr_tr_over_bgcolor = "#f3fdfc"/> +<#var zmr_tfoot_bgcolor = "#ffffff"/> +<#--面包屑 --> +<#function zhiqim_manager_breadcrumb_name(name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑一级栏目 --> +<#function zhiqim_manager_breadcrumb(name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑二级栏目 --> +<#function zhiqim_manager_breadcrumb_parent(parentUrl, parentName, name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑三级栏目 --> +<#function zhiqim_manager_breadcrumb_parent_last(parentUrl, parentName, lastUrl, lastName, name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--显示记录分页--> +<#function zhiqim_manager_paging(result, link)> + + + + +
            ${PagingStd.toHtmlLink(result, link)}
            + +<#--显示记录分页JS--> +<#function zhiqim_manager_paging_jsMethod(result, jsMethod)> + + + + +
            ${PagingStd.toHtmlClick(result, jsMethod)}
            + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/iframeInner.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/iframeInner.htm new file mode 100644 index 0000000..39dacf0 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/iframeInner.htm @@ -0,0 +1,35 @@ +<#var zmr_sidebar_width = 0/> +<#var zmr_topnav_height = 0/> + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +<#if request.getPathInContext() == "/"+zhiqim_manager+"/param.htm" || request.getPathInContext() == "/"+zhiqim_manager+"/themeMain.htm"> + + + + + +${Htmls.toCallFrame()} +
            +
            + + +<#include include/> + + +
            +
            + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/iframeMain.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/iframeMain.htm new file mode 100644 index 0000000..4753014 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/iframeMain.htm @@ -0,0 +1,175 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +${Scripts.src(zhiqim_iframenav.js)} +${Styles.htmlOverflowHidden()} + + + + + +
            + +
            +
            + ${zhiqim_manager_topnav_left_defined()} +
            +
            + ${zhiqim_manager_topnav_right_defined()} + <#if ZmrOrgDao.getOrgList(request, sessionUser.getOperatorCode()).size() gt 1> + + + + +
            +
            + + +
            + + + + + +
            +
            +
            +
              +
            • 首页
            • +
            +
            +
            +
            +
            关闭操作
            +
            +
              +
            • 定位当前选项卡
            • +
            +
              +
            • 关闭全部选项卡
            • +
            • 关闭其他选项卡
            • +
            +
            +
            +
            + + +
            +
            + +
            +
            + + +
            +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/index.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/index.htm new file mode 100644 index 0000000..018c9cf --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/index.htm @@ -0,0 +1,176 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Scripts.src(jsencrypt.js)} +${Styles.htmlOverflowHidden()} + + + + + +${Htmls.toCallFrame()} +
            +
            欢迎登录  [ ${context.getContextName()} ]!
            +
            +
            + + + + diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/index_bg_center.jpg b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/index_bg_center.jpg new file mode 100644 index 0000000..d108557 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/index_bg_center.jpg differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/preview_index.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/preview_index.png new file mode 100644 index 0000000..63fc118 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/preview_index.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/preview_main.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/preview_main.png new file mode 100644 index 0000000..0b1c758 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/00_default/preview_main.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/alone.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/alone.htm new file mode 100644 index 0000000..87ed59c --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/alone.htm @@ -0,0 +1,130 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} + + + +${Htmls.toCallFrame()} + +
            + +
            +
            + ${zhiqim_manager_topnav_left_defined()} +
            +
            + ${zhiqim_manager_topnav_right_defined()} + <#if ZmrOrgDao.getOrgList(request, sessionUser.getOperatorCode()).size() gt 1> + + + + + +
            +
            + + +
            + + + + + +
            + <#include include/> +
            + + +
            + + + +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/classic_2019010101.css b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/classic_2019010101.css new file mode 100644 index 0000000..7b17e27 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/classic_2019010101.css @@ -0,0 +1,97 @@ +@charset "utf-8"; + +/* ZhiqimUI */ +.z-input{color:#333;} + +/* global */ +body{color:#333;background-color:#fff;} +body,table,td,div{font-size:14px;line-height:120%;} +a,a:visited{color:#333;text-decoration:none;cursor:pointer;} +a:active,a:hover{color:#216a9d;text-decoration:none;} +a.blue,a.blue:visited{color:#0066cc;text-decoration:none;cursor:pointer;} +a.blue:active,a.blue:hover{color:#0066cc;text-decoration:underline;} + +/* topnav */ +.topnav {position:relative;width:100%;min-width:680px;color: #fff;background-color:#008fbf;height:55px;z-index:99;} +.topnav .logo {float:left;width:200px;height:55px;padding:0 10px;overflow:hidden;font-size:24px;line-height:55px;background-color:#2a80b9;word-break:break-all;word-wrap:break-word;} + +.topnav .topnavleft {float:left;height:55px;} +.topnav .topnavleft .bar {float:left;height:55px;line-height:55px;} +.topnav .topnavleft .first {border-left:1px solid #2a80b9;} +.topnav .topnavleft .nav, .topnav .topnavleft .nav-only {float:left;height:55px;line-height:55px;border-right:1px solid #2a80b9;} +.topnav .topnavleft .nav:hover{background-color:#2a80b9; color:#fff;} + +.topnav .topnavright {float:right;height:55px;} +.topnav .topnavright .nav, .topnav .topnavright .nav-only {float:left;height:55px;line-height:55px; border-left:1px solid #2a80b9;} +.topnav .topnavright .nav:hover {background-color:#2a80b9; color:#fff;} + +/* container */ +.container {position:relative;width:100%;height:100%; min-height:1000px;overflow:hidden;background-color:#edf3f7;} + +/*[替换z-tabnav的背景色为容器背景色]*/ +.container .z-tabnav>nav li.z-active{border-bottom:1px solid #edf3f7;} +.container .z-tabnav>nav li.z-active:hover{background-color:#edf3f7;} + +.sidebar {position:relative; float: left; width:200px;min-height:1000px;height:100%;margin-bottom:-9999px;padding-bottom:9999px;overflow:hidden; background-color: #f2f2f2; border-right:1px solid #d8dce5;} + +.sidebar p{position:relative;float:left;width:200px; height:40px;line-height:40px; border-bottom:1px solid #e5e5e5;border-left:3px solid transparent;display:block;padding-left:10px;cursor:pointer;} +.sidebar p a{color:#333;} +.sidebar p .z-arrow{position:absolute;top:16px;right:10px;} +.sidebar p .z-arrow>span{border-color:#f2f2f2 transparent transparent;} +.sidebar p:hover{width:200px;background-color:#fafafa; border-left:3px solid #2a80b9;color:#216a9d;} +.sidebar p.active{width:200px;background-color:#fafafa; border-left:3px solid #2a80b9;color:#216a9d;} +.sidebar p:hover>.z-arrow>span{border-color:#fafafa transparent transparent;} +.sidebar p.active>.z-arrow>span{border-color:#fafafa transparent transparent;} + +.sidebar ul{position:relative;width:200px;height:auto;overflow:hidden;} +.sidebar ul li{float:left;width:200px;border-left:0px;line-height:35px;text-indent:35px;border-bottom:1px dashed #e5e5e5;background-color:#fff;background-color:#fff;background-image:url(ico_n.gif); background-position:15px; background-repeat:no-repeat;display:block;cursor:pointer;} +.sidebar ul li:hover{background-image: url(ico_h.gif) ; background-repeat:no-repeat;color:#216a9d;} +.sidebar ul li.active{background-image:url(ico_h.gif); background-repeat:no-repeat;color:#216a9d;} + +/* iframenav */ +.iframenav{position:relative;margin-left:200px;height:40px;line-height:40px;} + +/* [iframenav翻页] */ +.iframenav-prev,.iframenav-next{position:absolute;top:0;width:50px;height:39px;z-index:1;background:#fff;cursor:pointer;padding:0 22px;text-align:center;line-height:39px;} +.iframenav-prev:hover,.iframenav-next:hover{background-color:#f5f5f5;} +.iframenav-prev{left:0;border-right:1px solid #d3d3d3;} +.iframenav-next{right:100px;border-left:1px solid #d3d3d3;} +.iframenav-prev .z-font,.iframenav-next .z-font{color:#999;margin-left:-8px;} + +/* [iframenav控制] */ +.iframenav-ctrl{position:absolute;top:0;right:0;} +.iframenav-ctrl-title{position:absolute;top:0;right:0;width:100px;height:39px;z-index:1;border-left:1px solid #d3d3d3;text-align:center;line-height:39px;color:#666;background:#fff;cursor:pointer;} +.iframenav-ctrl-title:hover{background-color:#f5f5f5;} +.iframenav-ctrl-title .z-font{color:#999;margin-left:6px;font-size:10px;} +.iframenav-ctrl-wrap{position:absolute;top:39px;right:0;display:none;width:150px;height:130px;z-index:2;background-color:#fff;border:1px solid #d3d3d3;} +.iframenav-ctrl-wrap ul{padding:10px 0;} +.iframenav-ctrl-wrap ul+ul{border-top:1px solid #ccc;} +.iframenav-ctrl-wrap li{padding:0 25px;line-height:30px;cursor:pointer;} +.iframenav-ctrl-wrap li:hover{background:#f1f1f1;} + +/* [iframenav选项卡] */ +.iframenav-tab-wrap{height:39px;margin:0 150px 0 50px;overflow:hidden;position:relative;} +.iframenav-tab-list{position:absolute;left:0;top:0;height:39px;background-color:#fff;overflow:hidden;} +.iframenav-tab-item{position:relative;float:left;line-height:39px;border-right:1px solid #d3d3d3;padding:0 35px 0 20px;background:#fff;color:#666;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;} +.iframenav-tab-item.active{background-color:#d4d8db;} +.iframenav-tab-item:hover{color:#222;} +.iframenav-tab-item:first-child{padding-right:23px;} + +.iframenav-tab-item .z-font{position:absolute;top:2px;width:25px;line-height:39px;color:#666;font-size:12px;cursor:pointer;text-align:center;} +.iframenav-tab-item .z-error{right:0;padding-right:5px;} +.iframenav-tab-item .z-error:hover{color:#f00;} + +/* [iframenav内容页] */ +.iframenav-cont{} +.iframenav-cont-item{width:100%;height:100%;display:none;} +.iframenav-cont-item.active{display:block;} +.iframenav-cont-item > iframe{width:100%;height:100%;border:0;margin:0;padding:0;} + +/* mainbody */ +.mainbody{margin-left:200px;} +.mainbody .breadcrumb{position:relative;float:left;width: 100%;background-color:#f5f5f5;} +.mainbody .content{position:relative;float:left;width:100%;padding:20px;} + +/* footer */ +.footer {position:relative;width:100%;height:40px;display:block;overflow:hidden;background-color:#2a80b9;z-index:99;} +.footer-wrap {position:relative;margin:0 auto;height:100%;line-height:40px;text-align: center;color:#fff;} diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/classic_2019010101.js b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/classic_2019010101.js new file mode 100644 index 0000000..2c3157c --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/classic_2019010101.js @@ -0,0 +1,113 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站进行实名登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/LICENSE.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ ++(function(Z) +{//BEGIN + +/**************************************************/ +//定义全局的对象,便于所有的页面调用 +/**************************************************/ +var Zmr = window.Zmr = {}; + +Zmr.selectOrgDialog = function() +{//弹出组织选择框 + var dialog = new Z.Dialog(); + dialog.title = "选择组织"; + dialog.url = "orgSelector.htm"; + dialog.width = 392; + dialog.height = 423; + dialog.fixed = true; + dialog.scroll = true; + dialog.execute(); +}; + +Zmr.sidebar = function() +{//打开&关闭边导航 + var $sidebar = Z("#sidebar"); + if ($sidebar.isHide()) + { + $sidebar.show(); + Z("#logo").show(); + Z("#mainbody").css("margin-left", 200); + } + else + { + $sidebar.hide(); + Z("#logo").hide(); + Z("#mainbody").css("margin-left", 0); + } + + Z.ajax().setContextPath(Zmr.contextPath) + .setClassName("sessionUser").setMethodName("setSidebar").addParam(!$sidebar.isHide()) + .execute(); +}; + +Zmr.calcMainbodyHeight = function() +{//计算主体高度 + var height = Z(document).clientHeight()-55;//-55为topnav的高度 + Z("#container").css("height", height); + Z("#mainbody").css("height", height-40);//40为iframenav高度 +} + +Zmr.treeExpand = function(code) +{//树菜单展开和关闭 + var $menu = Z("#menu-"+code); + var $ico = Z("#ico-"+code); + + if (!$menu.isHide()) + { + $menu.hide(); + if ($ico.hasClass("z-mlastnode")) + $ico.removeClass("z-mlastnode").addClass("z-plastnode"); + else + $ico.removeClass("z-mnode").addClass("z-pnode"); + } + else + { + $menu.show(); + if ($ico.hasClass("z-plastnode")) + $ico.removeClass("z-plastnode").addClass("z-mlastnode"); + else + $ico.removeClass("z-pnode").addClass("z-mnode"); + } +}; + +Zmr.addTopMenuClick = function() +{//增加顶级栏目点击事件 + Zmr.doClickTopMenuUp = false; + Zmr.doClickTopMenuDw = false; + + Z(".sidebar p").click(function() + { + if (Zmr.doClickTopMenuUp || Zmr.doClickTopMenuDw) + return; + + Zmr.doClickTopMenuUp = true;Zmr.doClickTopMenuDw = true; + Z(this).next("ul").slideToggle(200, function(){Zmr.doClickTopMenuDw = false;}) + .siblings("ul").slideUp(200, function(){Zmr.doClickTopMenuUp = false;}); + }); +}; + +/**************************************************/ +//定义初始化滑动菜单 +/**************************************************/ +Z.onload(function() +{//菜单隐藏展开 + Zmr.addTopMenuClick(); +}); + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/define.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/define.htm new file mode 100644 index 0000000..f6451ce --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/define.htm @@ -0,0 +1,61 @@ +<#--变量定义--> +<#var zmr_theme.css = context.getRootPath("/ztmpl/zhiqim_manager/"+themeMain+"/classic_2019010101.css")/> +<#var zmr_theme.js = context.getRootPath("/ztmpl/zhiqim_manager/"+themeMain+"/classic_2019010101.js")/> +<#var zmr_color_class = "z-blue"/> +<#var zmr_sidebar_width = 200/> +<#var zmr_topnav_height = 55/> +<#var zmr_breadcrumb_height = 40/> +<#var zmr_title_bgcolor = "#f5f5f5"/> +<#var zmr_thead_bgcolor = "#f5f5f5"/> +<#var zmr_tr_odd_bgcolor = "#f6fafd"/> +<#var zmr_tr_even_bgcolor = "#ffffff"/> +<#var zmr_tr_over_bgcolor = "#f6fafd"/> +<#var zmr_tfoot_bgcolor = "#ffffff"/> +<#--面包屑 --> +<#function zhiqim_manager_breadcrumb_name(name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑一级栏目 --> +<#function zhiqim_manager_breadcrumb(name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑二级栏目 --> +<#function zhiqim_manager_breadcrumb_parent(parentUrl, parentName, name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑三级栏目 --> +<#function zhiqim_manager_breadcrumb_parent_last(parentUrl, parentName, lastUrl, lastName, name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--显示记录分页--> +<#function zhiqim_manager_paging(result, link)> + + + + +
            ${PagingStd.toHtmlLink(result, link)}
            + +<#--显示记录分页JS--> +<#function zhiqim_manager_paging_jsMethod(result, jsMethod)> + + + + +
            ${PagingStd.toHtmlClick(result, jsMethod)}
            + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/ico_h.gif b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/ico_h.gif new file mode 100644 index 0000000..ca34682 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/ico_h.gif differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/ico_n.gif b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/ico_n.gif new file mode 100644 index 0000000..b30c209 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/ico_n.gif differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/iframeInner.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/iframeInner.htm new file mode 100644 index 0000000..39dacf0 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/iframeInner.htm @@ -0,0 +1,35 @@ +<#var zmr_sidebar_width = 0/> +<#var zmr_topnav_height = 0/> + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +<#if request.getPathInContext() == "/"+zhiqim_manager+"/param.htm" || request.getPathInContext() == "/"+zhiqim_manager+"/themeMain.htm"> + + + + + +${Htmls.toCallFrame()} +
            +
            + + +<#include include/> + + +
            +
            + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/iframeMain.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/iframeMain.htm new file mode 100644 index 0000000..c9242b2 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/iframeMain.htm @@ -0,0 +1,167 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +${Scripts.src(zhiqim_iframenav.js)} +${Styles.htmlOverflowHidden()} + + + + + +
            + +
            +
            + ${zhiqim_manager_topnav_left_defined()} +
            +
            + ${zhiqim_manager_topnav_right_defined()} + <#if ZmrOrgDao.getOrgList(request, sessionUser.getOperatorCode()).size() gt 1> + + + + + +
            +
            + + +
            + + + + + +
            +
            +
            +
              +
            • 首页
            • +
            +
            +
            +
            +
            关闭操作
            +
            +
              +
            • 定位当前选项卡
            • +
            +
              +
            • 关闭全部选项卡
            • +
            • 关闭其他选项卡
            • +
            +
            +
            +
            + + +
            +
            + +
            +
            + + +
            +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/index.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/index.htm new file mode 100644 index 0000000..df6d888 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/index.htm @@ -0,0 +1,166 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Scripts.src(jsencrypt.js)} +${Styles.htmlOverflowHidden()} + + + + + +
            +
            欢迎登录  [ ${context.getContextName()} ]!
            +
            +
            + + + + diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/preview_index.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/preview_index.png new file mode 100644 index 0000000..7eb6636 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/preview_index.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/preview_main.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/preview_main.png new file mode 100644 index 0000000..d0a1628 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/01_classic/preview_main.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/alone.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/alone.htm new file mode 100644 index 0000000..def83ec --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/alone.htm @@ -0,0 +1,149 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} + + + +${Htmls.toCallFrame()} + +
            + +
            +
            + ${zhiqim_manager_topnav_left_defined()} +
            +
            + ${zhiqim_manager_topnav_right_defined()} + <#if ZmrOrgDao.getOrgList(request, sessionUser.getOperatorCode()).size() gt 1> + + + + +
            +
            + + +
            + + + + + +<#var mainbodyLeft = 260/> +<#if topMenuCode == null || !sessionUser.hasChildMenu(topMenuCode)> + <#var mainbodyLeft = 60/> + +<#if !sessionUser.hasSidebar()> +
            +<#elseif topMenuCode == null || !sessionUser.hasChildMenu(topMenuCode)> +
            +<#else> +
            + + <#include include/> +
            + + +
            +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/concise_2019010101.css b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/concise_2019010101.css new file mode 100644 index 0000000..665df50 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/concise_2019010101.css @@ -0,0 +1,98 @@ +@charset "utf-8"; + +/* ZhiqimUI */ +.z-input{color:#333;} + +/* global */ +body{color:#333;background-color:#fff;} +body,table,td,div{font-size:14px;line-height:120%;} +a,a:visited{color:#333;text-decoration:none;cursor:pointer;} +a:active,a:hover{color:#1e7eec;text-decoration:none;} +a.blue,a.blue:visited{color:#0066cc;text-decoration:none;cursor:pointer;} +a.blue:active,a.blue:hover{color:#0066cc;text-decoration:underline;} + +/* topnav */ +.topnav {position:relative;width:100%;min-width:680px; color: #fff;background-color:#00a2eb;height:55px;z-index:99;} +.topnav .logo {float:left;width:260px;height:55px;padding:0 10px;overflow:hidden;font-size:28px;line-height:55px;background-color:#008bd2;word-break:break-all;word-wrap:break-word;} + +.topnav .topnavleft {float:left;height:55px;} +.topnav .topnavleft .bar {float:left;height:55px;line-height:55px;} +.topnav .topnavleft .first {border-left:1px solid #008bd2;} +.topnav .topnavleft .nav, .topnav .topnavleft .nav-only {float:left;height:55px;line-height:55px;border-right:1px solid #008bd2;} +.topnav .topnavleft .nav:hover{background-color:#008bd2; color:#fff;} + +.topnav .topnavright {float:right;height:55px;} +.topnav .topnavright .nav, .topnav .topnavright .nav-only {float:left;height:55px;line-height:55px;border-left:1px solid #008bd2;} +.topnav .topnavright .nav:hover {background-color:#008bd2; color:#fff;} + +/* container */ +.container {position:relative;width:100%;height:100%; min-height:1000px;overflow:hidden;background-color:#fff;} + +.sidebar-top{position:absolute;top:0;left:0;float:left;width:60px;height:100%;overflow:hidden; background-color:#333;z-index:20;} +.sidebar-top li{position:relative;float:left;width:60px;height:70px;display:inline-block;text-align:center;color:#fff;padding:13px 0;line-height:22px;} +.sidebar-top li:hover{background-color:#414750;cursor:pointer;} +.sidebar-top li.active{background-color:#5c5c5c;} +.sidebar-top li i{font-size:22px;} +.sidebar-top .avatar{width: 100%;text-align:center;padding:16px 0;cursor:pointer;} + +.sidebar-child{position:absolute;top:0;left:60px;float:left;width:200px;min-height:800px;height:100%;overflow:hidden; background-color:#f2f2f2;border-right:1px solid #d8dce5;z-index:20;} +.sidebar-child li{position:relative;float:left;width:200px; height:40px;line-height:40px;color:#333; padding-left:25px; background-color:#f2f2f2;cursor:pointer;} +.sidebar-child li a{color:#333;} +.sidebar-child li .z-arrow>span{border-color:#eff6fc transparent transparent;} +.sidebar-child li:hover{background-color:#f2f1ed;color:#008bd2;} +.sidebar-child li.active{background-color:#e4e3df;color:#008bd2;} +.sidebar-child li:hover>.z-arrow>span{border-color:#333 transparent transparent;} +.sidebar-child li.active>.z-arrow>span{border-color:#333 transparent transparent;} + +.sidebar-child .info{position:relative;width:100%;padding:25px;} + +.ueseroperate{position:relative;width:100%;overflow:hidden;padding-top:15px;min-height:200px; padding-left:25px;border-top:1px solid #e5e5e5;} +.ueseroperate .operatemenu{position:relative;cursor: pointer;color: #999;height:40px;line-height:40px;} +.ueseroperate .operatemenu:hover{color:#333;} + +/* iframenav */ +.iframenav{position:relative;height:40px;line-height:40px;} + +/* [iframenav翻页] */ +.iframenav-prev,.iframenav-next{position:absolute;top:0;width:50px;height:39px;z-index:1;background:#fff;cursor:pointer;padding:0 22px;text-align:center;line-height:39px;} +.iframenav-prev:hover,.iframenav-next:hover{background-color:#f5f5f5;} +.iframenav-prev{left:0;border-right:1px solid #d3d3d3;} +.iframenav-next{right:100px;border-left:1px solid #d3d3d3;} +.iframenav-prev .z-font,.iframenav-next .z-font{color:#999;margin-left:-8px;} + +/* [iframenav控制] */ +.iframenav-ctrl{position:absolute;top:0;right:0;} +.iframenav-ctrl-title{position:absolute;top:0;right:0;width:100px;height:39px;z-index:1;border-left:1px solid #d3d3d3;text-align:center;line-height:39px;color:#666;background:#fff;cursor:pointer;} +.iframenav-ctrl-title:hover{background-color:#f5f5f5;} +.iframenav-ctrl-title .z-font{color:#999;margin-left:6px;font-size:10px;} +.iframenav-ctrl-wrap{position:absolute;top:39px;right:0;display:none;width:150px;height:130px;z-index:2;background-color:#fff;border:1px solid #d3d3d3;} +.iframenav-ctrl-wrap ul{padding:10px 0;} +.iframenav-ctrl-wrap ul+ul{border-top:1px solid #ccc;} +.iframenav-ctrl-wrap li{padding:0 25px;line-height:30px;cursor:pointer;} +.iframenav-ctrl-wrap li:hover{background:#f1f1f1;} + +/* [iframenav选项卡] */ +.iframenav-tab-wrap{height:39px;margin:0 150px 0 50px;overflow:hidden;position:relative;} +.iframenav-tab-list{position:absolute;left:0;top:0;height:39px;background-color:#fff;overflow:hidden;} +.iframenav-tab-item{position:relative;float:left;line-height:39px;border-right:1px solid #d3d3d3;padding:0 35px 0 20px;background:#fff;color:#666;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;} +.iframenav-tab-item.active{background-color:#d4d8db;} +.iframenav-tab-item:hover{color:#222;} +.iframenav-tab-item:first-child{padding-right:23px;} + +.iframenav-tab-item .z-font{position:absolute;top:2px;width:25px;line-height:39px;color:#666;font-size:12px;cursor:pointer;text-align:center;} +.iframenav-tab-item .z-error{right:0;padding-right:5px;} +.iframenav-tab-item .z-error:hover{color:#f00;} + +/* [iframenav内容页] */ +.iframenav-cont{} +.iframenav-cont-item{width:100%;height:100%;display:none;} +.iframenav-cont-item.active{display:block;} +.iframenav-cont-item > iframe{width:100%;height:100%;border:0;margin:0;padding:0;} + +/* mainbody */ +.mainbody{margin-left:260px;} +.mainbody .content{position:relative;float:left;width:100%;padding:30px;} + +/* footer */ +.footer {position: absolute !important;bottom:50px;width:100%;z-index:99;} +.footer-wrap {position:relative;line-height:20px;text-align:left;color:#999;padding:25px;font-size:12px;} diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/concise_2019010101.js b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/concise_2019010101.js new file mode 100644 index 0000000..4e7a6fd --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/concise_2019010101.js @@ -0,0 +1,108 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站进行实名登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/LICENSE.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ ++(function(Z) +{//BEGIN + +/**************************************************/ +//定义全局的对象,便于所有的页面调用 +/**************************************************/ +var Zmr = window.Zmr = {}; + +Zmr.selectOrgDialog = function() +{//弹出组织选择框 + var dialog = new Z.Dialog(); + dialog.title = "选择组织"; + dialog.url = "orgSelector.htm"; + dialog.width = 392; + dialog.height = 423; + dialog.fixed = true; + dialog.scroll = true; + dialog.execute(); +}; + +Zmr.sidebar = function() +{//打开&关闭边导航 + var $sidebar = Z("#sidebar"); + if ($sidebar.isHide()) + { + $sidebar.show(); + Z("#logo").show(); + Z("#mainbody").css("margin-left", Z("#mainbody").val()); + } + else + { + $sidebar.hide(); + Z("#logo").hide(); + Z("#mainbody").css("margin-left", 0); + } + + Z.ajax().setContextPath(Zmr.contextPath) + .setClassName("sessionUser").setMethodName("setSidebar").addParam(!$sidebar.isHide()) + .execute(); +}; + +Zmr.calcMainbodyHeight = function() +{//计算主体高度 + var height = Z(document).clientHeight()-55;//55为topnav的高度 + Z("#container").css("height", height); + Z("#mainbody").css("height", height-40);//40为iframenav高度 +}; + +Zmr.treeExpand = function(code) +{//树菜单展开和关闭 + var $menu = Z("#menu-"+code); + var $ico = Z("#ico-"+code); + + if (!$menu.isHide()) + { + $menu.hide(); + if ($ico.hasClass("z-mlastnode")) + $ico.removeClass("z-mlastnode").addClass("z-plastnode"); + else + $ico.removeClass("z-mnode").addClass("z-pnode"); + } + else + { + $menu.show(); + if ($ico.hasClass("z-plastnode")) + $ico.removeClass("z-plastnode").addClass("z-mlastnode"); + else + $ico.removeClass("z-pnode").addClass("z-mnode"); + } +}; + +Zmr.doClickTopMenu = function(elem, menuCode, hasChild) +{//点击顶级栏目 + Z(elem).addClass("active").siblings("li").removeClass("active"); + Z("#sidebar-child").find("p").removeClass("active"); + + if (elem == Z.D.id("menu-avatar") || !hasChild) + { + Z("#sidebar-child").hide(); + Z("#mainbody").css("margin-left", 60).val(60); + } + else + { + Z("#sidebar-child").children("div").hide(); + Z("#sidebar-child-"+menuCode).show(); + Z("#sidebar-child").show(); + Z("#mainbody").css("margin-left", 260).val(260); + } +}; + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/define.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/define.htm new file mode 100644 index 0000000..8938d4b --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/define.htm @@ -0,0 +1,61 @@ +<#--变量定义--> +<#var zmr_theme.css = context.getRootPath("/ztmpl/zhiqim_manager/"+themeMain+"/concise_2019010101.css")/> +<#var zmr_theme.js = context.getRootPath("/ztmpl/zhiqim_manager/"+themeMain+"/concise_2019010101.js")/> +<#var zmr_color_class = "z-blue"/> +<#var zmr_sidebar_width = 260/> +<#var zmr_topnav_height = 55/> +<#var zmr_breadcrumb_height = 40/> +<#var zmr_title_bgcolor = "#efefef"/> +<#var zmr_thead_bgcolor = "#efefef"/> +<#var zmr_tr_odd_bgcolor = "#f2faff"/> +<#var zmr_tr_even_bgcolor = "#ffffff"/> +<#var zmr_tr_over_bgcolor = "#f2faff"/> +<#var zmr_tfoot_bgcolor = "#ffffff"/> +<#--面包屑 --> +<#function zhiqim_manager_breadcrumb_name(name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑一级栏目 --> +<#function zhiqim_manager_breadcrumb(name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑二级栏目 --> +<#function zhiqim_manager_breadcrumb_parent(parentUrl, parentName, name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑三级栏目 --> +<#function zhiqim_manager_breadcrumb_parent_last(parentUrl, parentName, lastUrl, lastName, name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--显示记录分页--> +<#function zhiqim_manager_paging(result, link)> + + + + +
            ${PagingStd.toHtmlLink(result, link)}
            + +<#--显示记录分页JS--> +<#function zhiqim_manager_paging_jsMethod(result, jsMethod)> + + + + +
            ${PagingStd.toHtmlClick(result, jsMethod)}
            + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/iframeInner.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/iframeInner.htm new file mode 100644 index 0000000..eb7d90b --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/iframeInner.htm @@ -0,0 +1,35 @@ +<#var zmr_sidebar_width = 0/> +<#var zmr_topnav_height = 0/> + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +<#if request.getPathInContext() == "/"+zhiqim_manager+"/param.htm" || request.getPathInContext() == "/"+zhiqim_manager+"/themeMain.htm"> + + + + + +${Htmls.toCallFrame()} +
            +
            + + +<#include include/> + + +
            +
            + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/iframeMain.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/iframeMain.htm new file mode 100644 index 0000000..8fe2e84 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/iframeMain.htm @@ -0,0 +1,181 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +${Scripts.src(zhiqim_iframenav.js)} +${Styles.htmlOverflowHidden()} + + + + + +
            + +
            +
            + ${zhiqim_manager_topnav_left_defined()} +
            +
            + ${zhiqim_manager_topnav_right_defined()} + <#if ZmrOrgDao.getOrgList(request, sessionUser.getOperatorCode()).size() gt 1> + + + + +
            +
            + + +
            + + + + + +
            +
            +
            +
              +
            • 首页
            • +
            +
            +
            +
            +
            关闭操作
            +
            +
              +
            • 定位当前选项卡
            • +
            +
              +
            • 关闭全部选项卡
            • +
            • 关闭其他选项卡
            • +
            +
            +
            +
            + + +
            +
            + +
            +
            + + +
            +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/index.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/index.htm new file mode 100644 index 0000000..d621963 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/index.htm @@ -0,0 +1,179 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Scripts.src(jsencrypt.js)} +${Styles.htmlOverflowHidden()} + + + + + +
            +
            欢迎登录  [ ${context.getContextName()} ]!
            +
            +
            + + + + diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/index_bg_center.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/index_bg_center.png new file mode 100644 index 0000000..d6df769 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/index_bg_center.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/preview_index.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/preview_index.png new file mode 100644 index 0000000..59706dd Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/preview_index.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/preview_main.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/preview_main.png new file mode 100644 index 0000000..4914b31 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/02_concise/preview_main.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/alone.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/alone.htm new file mode 100644 index 0000000..4f9b748 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/alone.htm @@ -0,0 +1,136 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} + + + +${Htmls.toCallFrame()} + +
            + +
            +
            + ${zhiqim_manager_topnav_left_defined()} +
            +
            + ${zhiqim_manager_topnav_right_defined()} + <#if ZmrOrgDao.getOrgList(request, sessionUser.getOperatorCode()).size() gt 1> + + + + +
            +
            + + +
            + + + + + +
            + <#include include/> +
            + + +
            + + + +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/define.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/define.htm new file mode 100644 index 0000000..789da5b --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/define.htm @@ -0,0 +1,61 @@ +<#--变量定义--> +<#var zmr_theme.css = context.getRootPath("/ztmpl/zhiqim_manager/"+themeMain+"/elegant_2019010101.css")/> +<#var zmr_theme.js = context.getRootPath("/ztmpl/zhiqim_manager/"+themeMain+"/elegant_2019010101.js")/> +<#var zmr_color_class = "z-blue"/> +<#var zmr_sidebar_width = 200/> +<#var zmr_topnav_height = 55/> +<#var zmr_breadcrumb_height = 40/> +<#var zmr_title_bgcolor = "#f5f5f5"/> +<#var zmr_thead_bgcolor = "#f5f5f5"/> +<#var zmr_tr_odd_bgcolor = "#f6fafd"/> +<#var zmr_tr_even_bgcolor = "#ffffff"/> +<#var zmr_tr_over_bgcolor = "#f6fafd"/> +<#var zmr_tfoot_bgcolor = "#ffffff"/> +<#--面包屑 --> +<#function zhiqim_manager_breadcrumb_name(name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑一级栏目 --> +<#function zhiqim_manager_breadcrumb(name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑二级栏目 --> +<#function zhiqim_manager_breadcrumb_parent(parentUrl, parentName, name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑三级栏目 --> +<#function zhiqim_manager_breadcrumb_parent_last(parentUrl, parentName, lastUrl, lastName, name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--显示记录分页--> +<#function zhiqim_manager_paging(result, link)> + + + + +
            ${PagingStd.toHtmlLink(result, link)}
            + +<#--显示记录分页JS--> +<#function zhiqim_manager_paging_jsMethod(result, jsMethod)> + + + + +
            ${PagingStd.toHtmlClick(result, jsMethod)}
            + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/elegant_2019010101.css b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/elegant_2019010101.css new file mode 100644 index 0000000..5a20293 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/elegant_2019010101.css @@ -0,0 +1,102 @@ +@charset "utf-8"; + +/* ZhiqimUI */ +.z-input{color:#333;} + +/* global */ +body{color:#333;background-color:#fff;} +body,table,td,div{font-size:14px;line-height:120%;} +a,a:visited{color:#333;text-decoration:none;cursor:pointer;} +a:active,a:hover{color:#1e7eec;text-decoration:none;} +a.blue,a.blue:visited{color:#0066cc;text-decoration:none;cursor:pointer;} +a.blue:active,a.blue:hover{color:#0066cc;text-decoration:underline;} + +/* topnav */ +.topnav {position:relative;width:100%;min-width:680px;color:#fff;background-color:#00a2eb;height:55px;z-index:99;} +.topnav .logo {float:left;width:200px;height:55px;padding:0 10px;overflow:hidden;font-size:24px;line-height:55px;background-color:#008bd2;word-break:break-all;word-wrap:break-word;} +.topnav a{color: #fff;} + +.topnav .topnavleft {float:left;height:55px;} +.topnav .topnavleft .bar {float:left;height:55px;line-height:55px;} +.topnav .topnavleft .first {border-left:1px solid #008bd2;} +.topnav .topnavleft .nav, .topnav .topnavleft .nav-only {float:left;height:55px;line-height:55px;border-right:1px solid #008bd2;} +.topnav .topnavleft .nav:hover{background-color:#008bd2; color:#fff;} + +.topnav .topnavright {float:right;height:55px;} +.topnav .topnavright .nav, .topnav .topnavright .nav-only {float:left;height:55px;line-height:55px;border-left:1px solid #008bd2;} +.topnav .topnavright .nav:hover {background-color:#008bd2; color:#fff;} + +/* container */ +.container {position:relative;width:100%;height:100%; min-height:1000px;overflow:hidden;background-color:#fff;} + +.sidebar {position:relative; float: left; width:201px;min-height:1000px;height:100%;margin-bottom:-9999px;padding-bottom:9999px;overflow:hidden; background-color: #48525e;border-right:1px solid #d4e1ee;} +.sidebar p{position:relative;float:left;width:200px; height:40px;line-height:40px;color:#fff; padding-left:15px; background-color:#48525e;border-bottom:1px solid #e5e5e5;cursor:pointer;} +.sidebar p a{color:#fff;} +.sidebar p .z-arrow{position:absolute;top:16px;right:10px;} +.sidebar p .z-arrow>span{border-color:#fff transparent transparent;} +.sidebar p:hover{background-color:#e3f0fc;border-top:1px #d1e6fa;border-bottom:1px #d1e6fa;} +.sidebar p.active{background-color:#e3f0fc;border-top:1px #d1e6fa;border-bottom:1px #d1e6fa;} +.sidebar p:hover>.z-arrow>span{border-color:#e3f0fc transparent transparent;} +.sidebar p.active>.z-arrow>span{border-color:#e3f0fc transparent transparent;} + +.sidebar ul{position:relative;width:200px;height:auto;border-bottom:1px solid #686f78;padding-top:15px;padding-bottom:20px; overflow:hidden;} +.sidebar ul li{float:left;width:200px;height:40px;color:#fff;border-left:5px solid #48525e;background-color:#48525e;font-size:15px;line-height:40px;padding-left:25px;cursor:pointer;} +.sidebar ul li a{color:#fff;} +.sidebar ul li:hover{color:#bfc1c4;} +.sidebar ul li.active{background-color:#363c41;color:#fff;border-left:5px solid #008bd2;color:#008bd2;} +.sidebar ul li.active i{color:#008bd2;} + +.sidebar .user-box {border-bottom:1px solid #686f78;padding-bottom:10px;} +.sidebar .user-box .avatar-box {position: relative;height:80px;background: #3a434c;z-index:2;} +.sidebar .user-box .avatar-box a{position: absolute;width:80px;height:80px;left:60px;bottom:-20px;} +.sidebar .user-box .avatar-box a img {border-radius: 50%;box-shadow: 0 0 0 8px #3a434c;} + +.sidebar i{color:#9ba0a7;font-size:18px;} + +/* iframenav */ +.iframenav{position:relative;margin-left:200px;height:40px;line-height:40px;} + +/* [iframenav翻页] */ +.iframenav-prev,.iframenav-next{position:absolute;top:0;width:50px;height:39px;z-index:1;background:#fff;cursor:pointer;padding:0 22px;text-align:center;line-height:39px;} +.iframenav-prev:hover,.iframenav-next:hover{background-color:#f5f5f5;} +.iframenav-prev{left:0;border-right:1px solid #d3d3d3;} +.iframenav-next{right:100px;border-left:1px solid #d3d3d3;} +.iframenav-prev .z-font,.iframenav-next .z-font{color:#999;margin-left:-8px;} + +/* [iframenav控制] */ +.iframenav-ctrl{position:absolute;top:0;right:0;} +.iframenav-ctrl-title{position:absolute;top:0;right:0;width:100px;height:39px;z-index:1;border-left:1px solid #d3d3d3;text-align:center;line-height:39px;color:#666;background:#fff;cursor:pointer;} +.iframenav-ctrl-title:hover{background-color:#f5f5f5;} +.iframenav-ctrl-title .z-font{color:#999;margin-left:6px;font-size:10px;} +.iframenav-ctrl-wrap{position:absolute;top:39px;right:0;display:none;width:150px;height:130px;z-index:2;background-color:#fff;border:1px solid #d3d3d3;} +.iframenav-ctrl-wrap ul{padding:10px 0;} +.iframenav-ctrl-wrap ul+ul{border-top:1px solid #ccc;} +.iframenav-ctrl-wrap li{padding:0 25px;line-height:30px;cursor:pointer;} +.iframenav-ctrl-wrap li:hover{background:#f1f1f1;} + +/* [iframenav选项卡] */ +.iframenav-tab-wrap{height:39px;margin:0 150px 0 50px;overflow:hidden;position:relative;} +.iframenav-tab-list{position:absolute;left:0;top:0;height:39px;background-color:#fff;overflow:hidden;} +.iframenav-tab-item{position:relative;float:left;line-height:39px;border-right:1px solid #d3d3d3;padding:0 35px 0 20px;background:#fff;color:#666;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;} +.iframenav-tab-item.active{background-color:#d4d8db;} +.iframenav-tab-item:hover{color:#222;} +.iframenav-tab-item:first-child{padding-right:23px;} + +.iframenav-tab-item .z-font{position:absolute;top:2px;width:25px;line-height:39px;color:#666;font-size:12px;cursor:pointer;text-align:center;} +.iframenav-tab-item .z-error{right:0;padding-right:5px;} +.iframenav-tab-item .z-error:hover{color:#f00;} + +/* [iframenav内容页] */ +.iframenav-cont{} +.iframenav-cont-item{width:100%;height:100%;display:none;} +.iframenav-cont-item.active{display:block;} +.iframenav-cont-item > iframe{width:100%;height:100%;border:0;margin:0;padding:0;} + +/* mainbody */ +.mainbody{margin-left:200px;} +.mainbody .breadcrumb{position:relative;float:left;width: 100%;} +.mainbody .content{position:relative;float:left;width:100%;padding:20px;} + +/* footer */ +.footer {position:relative;width:100%;height:60px;display:block;overflow:hidden;background-color:#f4f4f4;border-top:1px solid #d3d3d3;z-index:99;} +.footer-wrap {position:relative;margin:0 auto;height:100%;line-height:60px;text-align: center;color:#333;} diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/elegant_2019010101.js b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/elegant_2019010101.js new file mode 100644 index 0000000..d1feec8 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/elegant_2019010101.js @@ -0,0 +1,114 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站进行实名登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/LICENSE.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ ++(function(Z) +{//BEGIN + +/**************************************************/ +//定义全局的对象,便于所有的页面调用 +/**************************************************/ +var Zmr = window.Zmr = {}; + +Zmr.selectOrgDialog = function() +{//弹出组织选择框 + var dialog = new Z.Dialog(); + dialog.title = "选择组织"; + dialog.url = "orgSelector.htm"; + dialog.width = 392; + dialog.height = 423; + dialog.fixed = true; + dialog.scroll = true; + dialog.execute(); +}; + +Zmr.sidebar = function() +{//打开&关闭边导航 + var $sidebar = Z("#sidebar"); + if ($sidebar.isHide()) + { + $sidebar.show(); + Z("#logo").show(); + Z("#mainbody").css("margin-left", 201); + } + else + { + $sidebar.hide(); + Z("#logo").hide(); + Z("#mainbody").css("margin-left", 0); + } + + Z.ajax().setContextPath(Zmr.contextPath) + .setClassName("sessionUser").setMethodName("setSidebar").addParam(!$sidebar.isHide()) + .execute(); +}; + + +Zmr.calcMainbodyHeight = function() +{//计算主体高度 + var height = Z(document).clientHeight()-55;//-55为topnav的高度 + Z("#container").css("height", height); + Z("#mainbody").css("height", height-40);//40为iframenav高度 +} + +Zmr.treeExpand = function(code) +{//树菜单展开和关闭 + var $menu = Z("#menu-"+code); + var $ico = Z("#ico-"+code); + + if (!$menu.isHide()) + { + $menu.hide(); + if ($ico.hasClass("z-mlastnode")) + $ico.removeClass("z-mlastnode").addClass("z-plastnode"); + else + $ico.removeClass("z-mnode").addClass("z-pnode"); + } + else + { + $menu.show(); + if ($ico.hasClass("z-plastnode")) + $ico.removeClass("z-plastnode").addClass("z-mlastnode"); + else + $ico.removeClass("z-pnode").addClass("z-mnode"); + } +}; + +Zmr.addTopMenuClick = function() +{//增加顶级栏目点击事件 + Zmr.doClickTopMenuUp = false; + Zmr.doClickTopMenuDw = false; + + Z(".sidebar p").click(function() + { + if (Zmr.doClickTopMenuUp || Zmr.doClickTopMenuDw) + return; + + Zmr.doClickTopMenuUp = true;Zmr.doClickTopMenuDw = true; + Z(this).next("ul").slideToggle(200, function(){Zmr.doClickTopMenuDw = false;}) + .siblings("ul").slideUp(200, function(){Zmr.doClickTopMenuUp = false;}); + }); +}; + +/**************************************************/ +//定义初始化滑动菜单 +/**************************************************/ +Z.onload(function() +{//菜单隐藏展开 + Zmr.addTopMenuClick(); +}); + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/iframeInner.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/iframeInner.htm new file mode 100644 index 0000000..39dacf0 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/iframeInner.htm @@ -0,0 +1,35 @@ +<#var zmr_sidebar_width = 0/> +<#var zmr_topnav_height = 0/> + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +<#if request.getPathInContext() == "/"+zhiqim_manager+"/param.htm" || request.getPathInContext() == "/"+zhiqim_manager+"/themeMain.htm"> + + + + + +${Htmls.toCallFrame()} +
            +
            + + +<#include include/> + + +
            +
            + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/iframeMain.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/iframeMain.htm new file mode 100644 index 0000000..2bea0f1 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/iframeMain.htm @@ -0,0 +1,174 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +${Scripts.src(zhiqim_iframenav.js)} +${Styles.htmlOverflowHidden()} + + + + + +
            + +
            +
            + ${zhiqim_manager_topnav_left_defined()} +
            +
            + ${zhiqim_manager_topnav_right_defined()} + <#if ZmrOrgDao.getOrgList(request, sessionUser.getOperatorCode()).size() gt 1> + + + + +
            +
            + + +
            + + + + + +
            +
            +
            +
              +
            • 首页
            • +
            +
            +
            +
            +
            关闭操作
            +
            +
              +
            • 定位当前选项卡
            • +
            +
              +
            • 关闭全部选项卡
            • +
            • 关闭其他选项卡
            • +
            +
            +
            +
            + + +
            +
            + +
            +
            + + +
            +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/index.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/index.htm new file mode 100644 index 0000000..dad97a2 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/index.htm @@ -0,0 +1,174 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Scripts.src(jsencrypt.js)} +${Styles.htmlOverflowHidden()} +${Scripts.src("/ztmpl/zhiqim_manager/zhiqim_webgl_three.js")} + + + + + +
            +
            欢迎登录  [ ${context.getContextName()} ]!
            +
            +
            + + +
            + + diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/preview_index.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/preview_index.png new file mode 100644 index 0000000..096aec7 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/preview_index.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/preview_main.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/preview_main.png new file mode 100644 index 0000000..2b2956e Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/03_elegant/preview_main.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/alone.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/alone.htm new file mode 100644 index 0000000..a36ef6f --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/alone.htm @@ -0,0 +1,138 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} + + + +${Htmls.toCallFrame()} + +
            + +
            +
            + ${zhiqim_manager_topnav_left_defined()} +
            +
            + ${zhiqim_manager_topnav_right_defined()} + <#if ZmrOrgDao.getOrgList(request, sessionUser.getOperatorCode()).size() gt 1> + + + + +
            +
            + + +
            + + + + + +
            + <#include include/> +
            + + +
            + + + +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/define.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/define.htm new file mode 100644 index 0000000..761d0f5 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/define.htm @@ -0,0 +1,53 @@ +<#--变量定义--> +<#var zmr_theme.css = context.getRootPath("/ztmpl/zhiqim_manager/"+themeMain+"/fresh_2019010101.css")/> +<#var zmr_theme.js = context.getRootPath("/ztmpl/zhiqim_manager/"+themeMain+"/fresh_2019010101.js")/> +<#var zmr_color_class = "z-cyan"/> +<#var zmr_sidebar_width = 200/> +<#var zmr_topnav_height = 55/> +<#var zmr_breadcrumb_height = 40/> +<#var zmr_title_bgcolor = "#f5f5f5"/> +<#var zmr_thead_bgcolor = "#f5f5f5"/> +<#var zmr_tr_odd_bgcolor = "#f6ffff"/> +<#var zmr_tr_even_bgcolor = "#ffffff"/> +<#var zmr_tr_over_bgcolor = "#f6ffff"/> +<#var zmr_tfoot_bgcolor = "#ffffff"/> +<#--面包屑 --> +<#function zhiqim_manager_breadcrumb_name(name)> + + +<#--面包屑一级栏目 --> +<#function zhiqim_manager_breadcrumb(name)> + + +<#--面包屑二级栏目 --> +<#function zhiqim_manager_breadcrumb_parent(parentUrl, parentName, name)> + + +<#--面包屑三级栏目 --> +<#function zhiqim_manager_breadcrumb_parent_last(parentUrl, parentName, lastUrl, lastName, name)> + + +<#--显示记录分页--> +<#function zhiqim_manager_paging(result, link)> + + + + +
            ${PagingStd.toHtmlLink(result, link)}
            + +<#--显示记录分页JS--> +<#function zhiqim_manager_paging_jsMethod(result, jsMethod)> + + + + +
            ${PagingStd.toHtmlClick(result, jsMethod)}
            + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/fresh_2019010101.css b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/fresh_2019010101.css new file mode 100644 index 0000000..60cd042 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/fresh_2019010101.css @@ -0,0 +1,55 @@ +@charset "utf-8"; + +/* ZhiqimUI */ +.z-input{color:#333;} + +/* global */ +body{color:#333;background-color:#fff;} +body,table,td,div{font-size:14px;line-height:120%;} +a,a:visited{color:#333;text-decoration:none;cursor:pointer;} +a:active,a:hover{color:#00ba8b;text-decoration:none;} +a.blue,a.blue:visited{color:#0066cc;text-decoration:none;cursor:pointer;} +a.blue:active,a.blue:hover{color:#0066cc;text-decoration:underline;} + +/* topnav */ +.topnav {position:relative;width:100%;min-width:680px;color:#fff;background-color:#01adae;height:55px;z-index:99;} +.topnav .logo {float:left;width:200px;height:55px;padding:0 10px;overflow:hidden;font-size:24px;line-height:55px;background-color:#01a2a3;word-break:break-all;word-wrap:break-word;} +.topnav a{color: #fff;} + +.topnav .topnavleft {float:left;line-height:55px;} +.topnav .topnavleft .bar {float:left;height:55px;line-height:55px;} +.topnav .topnavleft .first {border-left:1px solid #01a2a3;} +.topnav .topnavleft .nav, .topnav .topnavleft .nav-only {float:left;height:55px;line-height:55px;border-right:1px solid #01a2a3;} +.topnav .topnavleft .nav:hover{background-color:#01a2a3; color:#fff;} + +.topnav .topnavright {float:right;height:55px;} +.topnav .topnavright .nav, .topnav .topnavright .nav-only {float:left;height:55px;line-height:55px;border-left:1px solid #01a2a3;} +.topnav .topnavright .nav:hover {background-color:#01a2a3; color:#fff;} + +/* container */ +.container {position:relative;width:100%;height:100%; min-height:1000px;overflow:hidden;} + +.sidebar {position:relative; float: left; width:200px;min-height:1000px;height:100%;margin-bottom:-9999px;padding-bottom:9999px;overflow:hidden; background-color: #f2f2f2; border-right:1px solid #d8dce5;} +.sidebar p{position:relative;float:left;width:200px; height:40px;line-height:40px;color:#333; padding-left:15px; border-bottom:1px solid #e5e5e5;cursor:pointer;} +.sidebar p a{color:#333;} +.sidebar p .z-arrow{position:absolute;top:16px;right:10px;} +.sidebar p .z-arrow>span{border-color:#f2f2f2 transparent transparent;} +.sidebar p:hover{background-color:#fafafa;border-bottom:1px solid #e5e5e5;} +.sidebar p.active{background-color:#fafafa;border-bottom:1px solid #e5e5e5;} +.sidebar p:hover>.z-arrow>span{border-color:#fafafa transparent transparent;} +.sidebar p.active>.z-arrow>span{border-color:#fafafa transparent transparent;} + +.sidebar ul{position:relative;width:200px;height:auto;overflow:hidden;} +.sidebar ul li{float:left;width:200px;height:40px;background-color:#fff;color:#333; line-height:40px;padding-left:35px;border-bottom:1px solid #e5e5e5;border-left:3px solid transparent;cursor:pointer;} +.sidebar ul li a{color:#333;} +.sidebar ul li:hover{background-color:#01adae;border-left:3px solid #ffa000;color:#fff;} +.sidebar ul li.active{background-color:#fff;border-left:3px solid #01adae;color:#01adae;} + +/* mainbody */ +.mainbody{margin-left:200px;} +.mainbody .breadcrumb{position:relative;float:left;width: 100%;} +.mainbody .content{position:relative;float:left;width:100%;padding:20px;} + +/* footer */ +.footer {position:relative;width:100%;height:60px;display:block;overflow:hidden;background-color:#f4f4f4;border-top:1px solid #d3d3d3;z-index:99;} +.footer-wrap {position:relative;margin:0 auto;height:100%;line-height:60px;text-align:center;color:#333;} diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/fresh_2019010101.js b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/fresh_2019010101.js new file mode 100644 index 0000000..f5f2b2f --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/fresh_2019010101.js @@ -0,0 +1,120 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站进行实名登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/LICENSE.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ ++(function(Z) +{//BEGIN + +/**************************************************/ +//定义全局的对象,便于所有的页面调用 +/**************************************************/ +var Zmr = window.Zmr = {}; + +Zmr.selectOrgDialog = function() +{//弹出组织选择框 + var dialog = new Z.Dialog(); + dialog.title = "选择组织"; + dialog.url = "orgSelector.htm"; + dialog.width = 392; + dialog.height = 423; + dialog.fixed = true; + dialog.scroll = true; + dialog.execute(); +}; + +Zmr.sidebar = function() +{//打开&关闭边导航 + var $sidebar = Z("#sidebar"); + if ($sidebar.isHide()) + { + $sidebar.show(); + Z("#logo").show(); + Z("#mainbody").css("margin-left", 200); + } + else + { + $sidebar.hide(); + Z("#logo").hide(); + Z("#mainbody").css("margin-left", 0); + } + + Z.ajax().setContextPath(Zmr.contextPath) + .setClassName("sessionUser").setMethodName("setSidebar").addParam(!$sidebar.isHide()) + .execute(); +}; + +Zmr.addTopMenuClick = function() +{//增加顶级栏目点击事件 + Zmr.doClickTopMenuUp = false; + Zmr.doClickTopMenuDw = false; + + Z(".sidebar p").click(function() + { + if (Zmr.doClickTopMenuUp || Zmr.doClickTopMenuDw) + return; + + Zmr.doClickTopMenuUp = true;Zmr.doClickTopMenuDw = true; + Z(this).next("ul").slideToggle(200, function(){Zmr.doClickTopMenuDw = false;}) + .siblings("ul").slideUp(200, function(){Zmr.doClickTopMenuUp = false;}); + }); +}; + +Zmr.doClickChildMenu = function(elem, menuUrl) +{//点击二级栏目 + Z(elem).parent().parent().find("li").removeClass("active"); + Z(elem).addClass("active"); + Z.L.href(menuUrl, window.mainFrame); +}; + +Zmr.calcMainbodyHeight = function() +{//计算主体高度 + var height = Z(document).clientHeight()-55;//-55为topnav的高度 + Z("#container").css("height", height); + Z("#mainbody").css("height", height); +} + +Zmr.treeExpand = function(code) +{//树菜单展开和关闭 + var $menu = Z("#menu-"+code); + var $ico = Z("#ico-"+code); + + if (!$menu.isHide()) + { + $menu.hide(); + if ($ico.hasClass("z-mlastnode")) + $ico.removeClass("z-mlastnode").addClass("z-plastnode"); + else + $ico.removeClass("z-mnode").addClass("z-pnode"); + } + else + { + $menu.show(); + if ($ico.hasClass("z-plastnode")) + $ico.removeClass("z-plastnode").addClass("z-mlastnode"); + else + $ico.removeClass("z-pnode").addClass("z-mnode"); + } +}; + +/**************************************************/ +//定义初始化滑动菜单 +/**************************************************/ +Z.onload(function() +{//菜单隐藏展开 + Zmr.addTopMenuClick(); +}); + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/iframeInner.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/iframeInner.htm new file mode 100644 index 0000000..39dacf0 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/iframeInner.htm @@ -0,0 +1,35 @@ +<#var zmr_sidebar_width = 0/> +<#var zmr_topnav_height = 0/> + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +<#if request.getPathInContext() == "/"+zhiqim_manager+"/param.htm" || request.getPathInContext() == "/"+zhiqim_manager+"/themeMain.htm"> + + + + + +${Htmls.toCallFrame()} +
            +
            + + +<#include include/> + + +
            +
            + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/iframeMain.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/iframeMain.htm new file mode 100644 index 0000000..6cf4e93 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/iframeMain.htm @@ -0,0 +1,138 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +${Styles.htmlOverflowHidden()} + + + + + +
            + +
            +
            + ${zhiqim_manager_topnav_left_defined()} +
            +
            + ${zhiqim_manager_topnav_right_defined()} + <#if ZmrOrgDao.getOrgList(request, sessionUser.getOperatorCode()).size() gt 1> + + + + +
            +
            + + +
            + + + + + +
            + +
            + + +
            +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/index.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/index.htm new file mode 100644 index 0000000..a119b2e --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/index.htm @@ -0,0 +1,183 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Scripts.src(jsencrypt.js)} +${Styles.htmlOverflowHidden()} + + + + + +
            +
            +
            +
            ${context.getContextName()}
            +
            +
            +
            + + + + diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/index_topbgleft.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/index_topbgleft.png new file mode 100644 index 0000000..f890fde Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/index_topbgleft.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/index_topbgright.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/index_topbgright.png new file mode 100644 index 0000000..a49b7dc Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/index_topbgright.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/index_toplogobg.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/index_toplogobg.png new file mode 100644 index 0000000..0ff29f8 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/index_toplogobg.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/preview_index.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/preview_index.png new file mode 100644 index 0000000..61fc3de Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/preview_index.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/preview_main.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/preview_main.png new file mode 100644 index 0000000..6483b1c Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/04_fresh/preview_main.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/alone.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/alone.htm new file mode 100644 index 0000000..b524ff7 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/alone.htm @@ -0,0 +1,125 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} + + + +${Htmls.toCallFrame()} + +
            + +
            +<#var topMenuCode = sessionUser.getSelectedTopMenuCodeOrFirstMenuCode(request, designatedPath)/> +<#var childMenuCode = sessionUser.getSelectedSecondMenuCode(request, designatedPath)/> +<#for topMenu : sessionUser.getTopMenuList()> +<#if sessionUser.hasChildMenu(topMenu.getMenuCode())> + +<#elseif Validates.isNotEmptyBlank(topMenu.getMenuUrl())> + + + + ${zhiqim_manager_topnav_left_defined()} +
            +
            + ${zhiqim_manager_topnav_right_defined()} + <#if ZmrOrgDao.getOrgList(request, sessionUser.getOperatorCode()).size() gt 1> + + + + + +
            +
            + + +
            + +
            + <#include include/> + +
            + +
            + + + +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/define.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/define.htm new file mode 100644 index 0000000..f066a9c --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/define.htm @@ -0,0 +1,61 @@ +<#--变量定义--> +<#var zmr_theme.css = context.getRootPath("/ztmpl/zhiqim_manager/"+themeMain+"/flatwise_2019010101.css")/> +<#var zmr_theme.js = context.getRootPath("/ztmpl/zhiqim_manager/"+themeMain+"/flatwise_2019010101.js")/> +<#var zmr_color_class = "z-blue"/> +<#var zmr_sidebar_width = 0/> +<#var zmr_topnav_height = 55/> +<#var zmr_breadcrumb_height = 40/> +<#var zmr_title_bgcolor = "#f5f5f5"/> +<#var zmr_thead_bgcolor = "#f5f5f5"/> +<#var zmr_tr_odd_bgcolor = "#f6fafd"/> +<#var zmr_tr_even_bgcolor = "#ffffff"/> +<#var zmr_tr_over_bgcolor = "#f6fafd"/> +<#var zmr_tfoot_bgcolor = "#ffffff"/> +<#--面包屑 --> +<#function zhiqim_manager_breadcrumb_name(name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑一级栏目 --> +<#function zhiqim_manager_breadcrumb(name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑二级栏目 --> +<#function zhiqim_manager_breadcrumb_parent(parentUrl, parentName, name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--面包屑三级栏目 --> +<#function zhiqim_manager_breadcrumb_parent_last(parentUrl, parentName, lastUrl, lastName, name)> +<#if !ZmrParamDao.isThemeFrame(context)> + + + +<#--显示记录分页--> +<#function zhiqim_manager_paging(result, link)> + + + + +
            ${PagingStd.toHtmlLink(result, link)}
            + +<#--显示记录分页JS--> +<#function zhiqim_manager_paging_jsMethod(result, jsMethod)> + + + + +
            ${PagingStd.toHtmlClick(result, jsMethod)}
            + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/flatwise_2019010101.css b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/flatwise_2019010101.css new file mode 100644 index 0000000..a6b3d4b --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/flatwise_2019010101.css @@ -0,0 +1,91 @@ +@charset "utf-8"; + +/* ZhiqimUI */ +.z-input{color:#333;} + +/* global */ +body{color:#333;background-color:#fff;} +body,table,td,div{font-size:14px;line-height:120%;} +a,a:visited{color:#333;text-decoration:none;cursor:pointer;} +a:active,a:hover{color:#4bb0af;text-decoration:none;} +a.blue,a.blue:visited{color:#0066cc;text-decoration:none;cursor:pointer;} +a.blue:active,a.blue:hover{color:#0066cc;text-decoration:underline;} + +/* topnav */ +.topnav {position:relative;width:100%;min-width:680px;color:#fff;background-color:#00a2eb;height:55px;z-index:99;} +.topnav .logo {float:left;width:200px;height:55px;padding:0 10px;overflow:hidden;font-size:24px;line-height:55px;background-color:#2a80b9;word-break:break-all;word-wrap:break-word;} +.topnav a{color: #fff;} + +.topnav .topnavleft {float:left;height:55px;line-height:55px;} +.topnav .topnavleft .nav, .topnav .topnavleft .nav-only{float:left;min-width:120px;height:55px;border-right:1px solid #008bd2;padding:0 10px;cursor:pointer;font-size:14px;line-height:55px;text-align:center;} +.topnav .topnavleft .nav.active{background-color:#008bd2;color:#fff;} +.topnav .topnavleft .nav:hover{background-color:#fff;color:#000;} + +.topnav .topnavright {float:right;height:55px;} +.topnav .topnavright .nav, .topnav .topnavright .nav-only {float:left;height:55px;line-height:55px;border-left:1px solid #008bd2;} +.topnav .topnavright .nav:hover {background-color:#008bd2; color:#fff;} + +/* [下拉] */ +.topnav .topnavleft .dropdown{display:inline-block;width:130px;} +.topnav .topnavleft .dropdown:hover .subnav{display: block;} +.topnav .topnavleft .dropdown:hover i:before{content:"\f08b";} +.topnav .topnavleft .subnav{position:absolute;top:55px;margin-left:-10px;width:260px;display:none;background-color:#fff;box-shadow: 0px 5px 10px 0px rgba(0,0,0,0.2);} +.topnav .topnavleft .subnav li{float:left;color:#333;width:130px;padding: 12px 16px;text-decoration:none;display: block;} +.topnav .topnavleft .subnav li:hover,.topnav .topnavleft .subnav li.active{background-color: #f1f1f1;color:#078ce9;} +.topnav .topnavleft .single{display:inline-block;width:130px;} +.topnav .topnavleft .single:hover {background-color:#008bd2; color:#fff;} + +/* container */ +.container {position:relative;width:100%;height:100%; min-height:1000px;overflow:hidden;} + +/*[替换z-tabnav的背景色为容器背景色]*/ +.container .z-tabnav>nav li.z-active{border-bottom:1px solid #eaedf1;} +.container .z-tabnav>nav li.z-active:hover{background-color:#eaedf1;} + +/* iframenav */ +.iframenav{position:relative;height:40px;line-height:40px;} + +/* [iframenav翻页] */ +.iframenav-prev,.iframenav-next{position:absolute;top:0;width:50px;height:39px;z-index:1;background:#fff;cursor:pointer;padding:0 22px;text-align:center;line-height:39px;} +.iframenav-prev:hover,.iframenav-next:hover{background-color:#f5f5f5;} +.iframenav-prev{left:0;border-right:1px solid #d3d3d3;} +.iframenav-next{right:100px;border-left:1px solid #d3d3d3;} +.iframenav-prev .z-font,.iframenav-next .z-font{color:#999;margin-left:-8px;} + +/* [iframenav控制] */ +.iframenav-ctrl{position:absolute;top:0;right:0;} +.iframenav-ctrl-title{position:absolute;top:0;right:0;width:100px;height:39px;z-index:1;border-left:1px solid #d3d3d3;text-align:center;line-height:39px;color:#666;background:#fff;cursor:pointer;} +.iframenav-ctrl-title:hover{background-color:#f5f5f5;} +.iframenav-ctrl-title .z-font{color:#999;margin-left:6px;font-size:10px;} +.iframenav-ctrl-wrap{position:absolute;top:39px;right:0;display:none;width:150px;height:130px;z-index:2;background-color:#fff;border:1px solid #d3d3d3;} +.iframenav-ctrl-wrap ul{padding:10px 0;} +.iframenav-ctrl-wrap ul+ul{border-top:1px solid #ccc;} +.iframenav-ctrl-wrap li{padding:0 25px;line-height:30px;cursor:pointer;} +.iframenav-ctrl-wrap li:hover{background:#f1f1f1;} + +/* [iframenav选项卡] */ +.iframenav-tab-wrap{height:39px;margin:0 150px 0 50px;overflow:hidden;position:relative;} +.iframenav-tab-list{position:absolute;left:0;top:0;height:39px;background-color:#fff;overflow:hidden;} +.iframenav-tab-item{position:relative;float:left;line-height:39px;border-right:1px solid #d3d3d3;padding:0 35px 0 20px;background:#fff;color:#666;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;} +.iframenav-tab-item.active{background-color:#d4d8db;} +.iframenav-tab-item:hover{color:#222;} +.iframenav-tab-item:first-child{padding-right:23px;} + +.iframenav-tab-item .z-font{position:absolute;top:2px;width:25px;line-height:39px;color:#666;font-size:12px;cursor:pointer;text-align:center;} +.iframenav-tab-item .z-error{right:0;padding-right:5px;} +.iframenav-tab-item .z-error:hover{color:#f00;} + +/* [iframenav内容页] */ +.iframenav-cont{} +.iframenav-cont-item{width:100%;height:100%;display:none;} +.iframenav-cont-item.active{display:block;} +.iframenav-cont-item > iframe{width:100%;height:100%;border:0;margin:0;padding:0;} + +/* mainbody */ +.mainbody{position:relative;} +.mainbody .breadcrumb{position:relative;float:left;width:100%;} +.mainbody .content{position:relative;float:left;width:100%;padding:20px;} + +/* footer */ +.footer {position:relative;width:100%;height:60px;display:block;overflow:hidden;background-color:#f4f4f4;border-top:1px solid #d3d3d3;z-index:99;} +.footer-wrap {position:relative;margin:0 auto;height:100%;line-height:60px;text-align: center;color:#333;} diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/flatwise_2019010101.js b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/flatwise_2019010101.js new file mode 100644 index 0000000..f23df3d --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/flatwise_2019010101.js @@ -0,0 +1,68 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站进行实名登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/LICENSE.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ ++(function(Z) +{//BEGIN + +/**************************************************/ +//定义全局的对象,便于所有的页面调用 +/**************************************************/ +var Zmr = window.Zmr = {}; + +Zmr.selectOrgDialog = function() +{//弹出组织选择框 + var dialog = new Z.Dialog(); + dialog.title = "选择组织"; + dialog.url = "orgSelector.htm"; + dialog.width = 392; + dialog.height = 423; + dialog.fixed = true; + dialog.scroll = true; + dialog.execute(); +}; + +Zmr.calcMainbodyHeight = function() +{//计算主体高度 + var height = Z(document).clientHeight()-55;//-55为topnav的高度 + Z("#container").css("height", height); + Z("#mainbody").css("height", height-40);//-40为iframenav高度 +} + +Zmr.treeExpand = function(code) +{//树菜单展开和关闭 + var $menu = Z("#menu-"+code); + var $ico = Z("#ico-"+code); + + if (!$menu.isHide()) + { + $menu.hide(); + if ($ico.hasClass("z-mlastnode")) + $ico.removeClass("z-mlastnode").addClass("z-plastnode"); + else + $ico.removeClass("z-mnode").addClass("z-pnode"); + } + else + { + $menu.show(); + if ($ico.hasClass("z-plastnode")) + $ico.removeClass("z-plastnode").addClass("z-mlastnode"); + else + $ico.removeClass("z-pnode").addClass("z-mnode"); + } +}; + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/iframeInner.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/iframeInner.htm new file mode 100644 index 0000000..39dacf0 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/iframeInner.htm @@ -0,0 +1,35 @@ +<#var zmr_sidebar_width = 0/> +<#var zmr_topnav_height = 0/> + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +<#if request.getPathInContext() == "/"+zhiqim_manager+"/param.htm" || request.getPathInContext() == "/"+zhiqim_manager+"/themeMain.htm"> + + + + + +${Htmls.toCallFrame()} +
            +
            + + +<#include include/> + + +
            +
            + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/iframeMain.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/iframeMain.htm new file mode 100644 index 0000000..fabea3e --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/iframeMain.htm @@ -0,0 +1,164 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} +${Scripts.src(zmr_theme.js)} +${Scripts.src(zhiqim_iframenav.js)} +${Styles.htmlOverflowHidden()} + + + + + +
            + + +
            + ${zhiqim_manager_topnav_right_defined()} + <#if ZmrOrgDao.getOrgList(request, sessionUser.getOperatorCode()).size() gt 1> + + + + + +
            +
            + + +
            + + +
            +
            +
            +
              +
            • 首页
            • +
            +
            +
            +
            +
            关闭操作
            +
            +
              +
            • 定位当前选项卡
            • +
            +
              +
            • 关闭全部选项卡
            • +
            • 关闭其他选项卡
            • +
            +
            +
            +
            + + +
            +
            + +
            +
            + + +
            +<#if Validates.isNotEmptyBlank(sessionUser.getOperator().getInitialPassword()) && sessionUser.getOperator().getInitialPassword().equals(sessionUser.getOperator().getOperatorPass())> + + + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/index.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/index.htm new file mode 100644 index 0000000..1d947e3 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/index.htm @@ -0,0 +1,166 @@ + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Scripts.src(jsencrypt.js)} +${Styles.htmlOverflowHidden()} + + + + + +
            +
            欢迎登录  [ ${context.getContextName()} ]!
            +
            +
            + + + + diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/preview_index.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/preview_index.png new file mode 100644 index 0000000..7eb6636 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/preview_index.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/preview_main.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/preview_main.png new file mode 100644 index 0000000..3402717 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/05_flatwise/preview_main.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/empty.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/empty.htm new file mode 100644 index 0000000..47f77b8 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/empty.htm @@ -0,0 +1 @@ +<#include include/> \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/index.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index.htm new file mode 100644 index 0000000..1b66b64 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index.htm @@ -0,0 +1,4 @@ +<#-- 主题变量和函数定义 --> +<#include "/ztmpl/zhiqim_manager/"+themeIndex+"/define.htm"/> +<#-- 主题首页定义 --> +<#include "/ztmpl/zhiqim_manager/"+themeIndex+"/index.htm"/> \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_bg_00.jpg b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_bg_00.jpg new file mode 100644 index 0000000..f93d7c0 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_bg_00.jpg differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_bg_01.jpg b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_bg_01.jpg new file mode 100644 index 0000000..d4d1f84 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_bg_01.jpg differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_logo_00.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_logo_00.png new file mode 100644 index 0000000..63148c8 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_logo_00.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_logo_01.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_logo_01.png new file mode 100644 index 0000000..db4d23f Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_logo_01.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_slogan_00.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_slogan_00.png new file mode 100644 index 0000000..e3e56c9 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_slogan_00.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_slogan_01.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_slogan_01.png new file mode 100644 index 0000000..ef24743 Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_slogan_01.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_slogan_02.png b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_slogan_02.png new file mode 100644 index 0000000..3f5254a Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/index_slogan_02.png differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/inner.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/inner.htm new file mode 100644 index 0000000..e027409 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/inner.htm @@ -0,0 +1,17 @@ +<#-- 主题变量和函数定义 --> +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + +${context.getContextName()} + + +${Styles.src(zhiqim.css)} +${Scripts.src(zhiqim.js)} +${Styles.src(zmr_theme.css)} + + + +<#include include/> + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/jsencrypt.js b/zhiqim_manager/resource/ztmpl/zhiqim_manager/jsencrypt.js new file mode 100644 index 0000000..cc4ed72 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/jsencrypt.js @@ -0,0 +1,3 @@ +/*! JSEncrypt v2.3.1 | https://npmcdn.com/jsencrypt@2.3.1/LICENSE.txt */ +(function(a,b){if(typeof define==="function"&&define.amd){define(["exports"],b)}else{if(typeof exports==="object"&&typeof exports.nodeName!=="string"){b(module.exports)}else{b(a)}}})(this,function(ap){var bE;var n=244837814094590;var aV=((n&16777215)==15715070);function bf(z,t,L){if(z!=null){if("number"==typeof z){this.fromNumber(z,t,L)}else{if(t==null&&"string"!=typeof z){this.fromString(z,256)}else{this.fromString(z,t)}}}}function bm(){return new bf(null)}function a7(bX,t,z,bW,bZ,bY){while(--bY>=0){var L=t*this[bX++]+z[bW]+bZ;bZ=Math.floor(L/67108864);z[bW++]=L&67108863}return bZ}function a6(bX,b2,b3,bW,b0,t){var bZ=b2&32767,b1=b2>>15;while(--t>=0){var L=this[bX]&32767;var bY=this[bX++]>>15;var z=b1*L+bY*bZ;L=bZ*L+((z&32767)<<15)+b3[bW]+(b0&1073741823);b0=(L>>>30)+(z>>>15)+b1*bY+(b0>>>30);b3[bW++]=L&1073741823}return b0}function a5(bX,b2,b3,bW,b0,t){var bZ=b2&16383,b1=b2>>14;while(--t>=0){var L=this[bX]&16383;var bY=this[bX++]>>14;var z=b1*L+bY*bZ;L=bZ*L+((z&16383)<<14)+b3[bW]+b0;b0=(L>>28)+(z>>14)+b1*bY;b3[bW++]=L&268435455}return b0}if(aV&&(navigator.appName=="Microsoft Internet Explorer")){bf.prototype.am=a6;bE=30}else{if(aV&&(navigator.appName!="Netscape")){bf.prototype.am=a7;bE=26}else{bf.prototype.am=a5;bE=28}}bf.prototype.DB=bE;bf.prototype.DM=((1<=0;--t){z[t]=this[t]}z.t=this.t;z.s=this.s}function h(t){this.t=1;this.s=(t<0)?-1:0;if(t>0){this[0]=t}else{if(t<-1){this[0]=t+this.DV}else{this.t=0}}}function bi(t){var z=bm();z.fromInt(t);return z}function bI(bZ,z){var bW;if(z==16){bW=4}else{if(z==8){bW=3}else{if(z==256){bW=8}else{if(z==2){bW=1}else{if(z==32){bW=5}else{if(z==4){bW=2}else{this.fromRadix(bZ,z);return}}}}}}this.t=0;this.s=0;var bY=bZ.length,L=false,bX=0;while(--bY>=0){var t=(bW==8)?bZ[bY]&255:aX(bZ,bY);if(t<0){if(bZ.charAt(bY)=="-"){L=true}continue}L=false;if(bX==0){this[this.t++]=t}else{if(bX+bW>this.DB){this[this.t-1]|=(t&((1<<(this.DB-bX))-1))<>(this.DB-bX))}else{this[this.t-1]|=t<=this.DB){bX-=this.DB}}if(bW==8&&(bZ[0]&128)!=0){this.s=-1;if(bX>0){this[this.t-1]|=((1<<(this.DB-bX))-1)<0&&this[this.t-1]==t){--this.t}}function u(z){if(this.s<0){return"-"+this.negate().toString(z)}var L;if(z==16){L=4}else{if(z==8){L=3}else{if(z==2){L=1}else{if(z==32){L=5}else{if(z==4){L=2}else{return this.toRadix(z)}}}}}var bX=(1<0){if(bZ>bZ)>0){t=true;bY=Y(b0)}while(bW>=0){if(bZ>(bZ+=this.DB-L)}else{b0=(this[bW]>>(bZ-=L))&bX;if(bZ<=0){bZ+=this.DB;--bW}}if(b0>0){t=true}if(t){bY+=Y(b0)}}}return t?bY:"0"}function bC(){var t=bm();bf.ZERO.subTo(this,t);return t}function bB(){return(this.s<0)?this.negate():this}function bN(t){var L=this.s-t.s;if(L!=0){return L}var z=this.t;L=z-t.t;if(L!=0){return(this.s<0)?-L:L}while(--z>=0){if((L=this[z]-t[z])!=0){return L}}return 0}function q(z){var bW=1,L;if((L=z>>>16)!=0){z=L;bW+=16}if((L=z>>8)!=0){z=L;bW+=8}if((L=z>>4)!=0){z=L;bW+=4}if((L=z>>2)!=0){z=L;bW+=2}if((L=z>>1)!=0){z=L;bW+=1}return bW}function bt(){if(this.t<=0){return 0}return this.DB*(this.t-1)+q(this[this.t-1]^(this.s&this.DM))}function bv(L,z){var t;for(t=this.t-1;t>=0;--t){z[t+L]=this[t]}for(t=L-1;t>=0;--t){z[t]=0}z.t=this.t+L;z.s=this.s}function a2(L,z){for(var t=L;t=0;--L){bW[L+bX+1]=(this[L]>>t)|bZ;bZ=(this[L]&bY)<=0;--L){bW[L]=0}bW[bX]=bZ;bW.t=this.t+bX+1;bW.s=this.s;bW.clamp()}function bT(bZ,bW){bW.s=this.s;var bX=Math.floor(bZ/this.DB);if(bX>=this.t){bW.t=0;return}var z=bZ%this.DB;var t=this.DB-z;var bY=(1<>z;for(var L=bX+1;L>z}if(z>0){bW[this.t-bX-1]|=(this.s&bY)<>=this.DB}if(z.t>=this.DB}bX+=this.s}else{bX+=this.s;while(L>=this.DB}bX-=z.s}bW.s=(bX<0)?-1:0;if(bX<-1){bW[L++]=this.DV+bX}else{if(bX>0){bW[L++]=bX}}bW.t=L;bW.clamp()}function bJ(z,bW){var t=this.abs(),bX=z.abs();var L=t.t;bW.t=L+bX.t;while(--L>=0){bW[L]=0}for(L=0;L=0){L[z]=0}for(z=0;z=t.DV){L[z+t.t]-=t.DV;L[z+t.t+1]=1}}if(L.t>0){L[L.t-1]+=t.am(z,t[z],L,2*z,0,1)}L.s=0;L.clamp()}function a9(b3,b0,bZ){var b9=b3.abs();if(b9.t<=0){return}var b1=this.abs();if(b1.t0){b9.lShiftTo(b8,bX);b1.lShiftTo(b8,bZ)}else{b9.copyTo(bX);b1.copyTo(bZ)}var b5=bX.t;var L=bX[b5-1];if(L==0){return}var b4=L*(1<1)?bX[b5-2]>>this.F2:0);var cc=this.FV/b4,cb=(1<=0){bZ[bZ.t++]=1;bZ.subTo(bY,bZ)}bf.ONE.dlShiftTo(b5,bY);bY.subTo(bX,bX);while(bX.t=0){var bW=(bZ[--b7]==L)?this.DM:Math.floor(bZ[b7]*cc+(bZ[b7-1]+ca)*cb);if((bZ[b7]+=bX.am(0,bW,bZ,b6,0,b5))0){bZ.rShiftTo(b8,bZ)}if(z<0){bf.ZERO.subTo(bZ,bZ)}}function bh(t){var z=bm();this.abs().divRemTo(t,null,z);if(this.s<0&&z.compareTo(bf.ZERO)>0){t.subTo(z,z)}return z}function aT(t){this.m=t}function aI(t){if(t.s<0||t.compareTo(this.m)>=0){return t.mod(this.m)}else{return t}}function c(t){return t}function V(t){t.divRemTo(this.m,null,t)}function p(t,L,z){t.multiplyTo(L,z);this.reduce(z)}function aF(t,z){t.squareTo(z);this.reduce(z)}aT.prototype.convert=aI;aT.prototype.revert=c;aT.prototype.reduce=V;aT.prototype.mulTo=p;aT.prototype.sqrTo=aF;function ab(){if(this.t<1){return 0}var t=this[0];if((t&1)==0){return 0}var z=t&3;z=(z*(2-(t&15)*z))&15;z=(z*(2-(t&255)*z))&255;z=(z*(2-(((t&65535)*z)&65535)))&65535;z=(z*(2-t*z%this.DV))%this.DV;return(z>0)?this.DV-z:-z}function K(t){this.m=t;this.mp=t.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<(t.DB-15))-1;this.mt2=2*t.t}function by(t){var z=bm();t.abs().dlShiftTo(this.m.t,z);z.divRemTo(this.m,null,z);if(t.s<0&&z.compareTo(bf.ZERO)>0){this.m.subTo(z,z)}return z}function bl(t){var z=bm();t.copyTo(z);this.reduce(z);return z}function bV(t){while(t.t<=this.mt2){t[t.t++]=0}for(var L=0;L>15)*this.mpl)&this.um)<<15))&t.DM;z=L+this.m.t;t[z]+=this.m.am(0,bW,t,L,0,this.m.t);while(t[z]>=t.DV){t[z]-=t.DV;t[++z]++}}t.clamp();t.drShiftTo(this.m.t,t);if(t.compareTo(this.m)>=0){t.subTo(this.m,t)}}function ac(t,z){t.squareTo(z);this.reduce(z)}function bz(t,L,z){t.multiplyTo(L,z);this.reduce(z)}K.prototype.convert=by;K.prototype.revert=bl;K.prototype.reduce=bV;K.prototype.mulTo=bz;K.prototype.sqrTo=ac;function ad(){return((this.t>0)?(this[0]&1):this.s)==0}function am(b0,b1){if(b0>4294967295||b0<1){return bf.ONE}var bZ=bm(),L=bm(),bY=b1.convert(this),bX=q(b0)-1;bY.copyTo(bZ);while(--bX>=0){b1.sqrTo(bZ,L);if((b0&(1<0){b1.mulTo(L,bY,bZ)}else{var bW=bZ;bZ=L;L=bW}}return b1.revert(bZ)}function aG(L,t){var bW;if(L<256||t.isEven()){bW=new aT(t)}else{bW=new K(t)}return this.exp(L,bW)}bf.prototype.copyTo=d;bf.prototype.fromInt=h;bf.prototype.fromString=bI;bf.prototype.clamp=bA;bf.prototype.dlShiftTo=bv;bf.prototype.drShiftTo=a2;bf.prototype.lShiftTo=s;bf.prototype.rShiftTo=bT;bf.prototype.subTo=bs;bf.prototype.multiplyTo=bJ;bf.prototype.squareTo=au;bf.prototype.divRemTo=a9;bf.prototype.invDigit=ab;bf.prototype.isEven=ad;bf.prototype.exp=am;bf.prototype.toString=u;bf.prototype.negate=bC;bf.prototype.abs=bB;bf.prototype.compareTo=bN;bf.prototype.bitLength=bt;bf.prototype.mod=bh;bf.prototype.modPowInt=aG;bf.ZERO=bi(0);bf.ONE=bi(1);function f(){var t=bm();this.copyTo(t);return t}function b(){if(this.s<0){if(this.t==1){return this[0]-this.DV}else{if(this.t==0){return -1}}}else{if(this.t==1){return this[0]}else{if(this.t==0){return 0}}}return((this[1]&((1<<(32-this.DB))-1))<>24}function ag(){return(this.t==0)?this.s:(this[0]<<16)>>16}function aU(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function aZ(){if(this.s<0){return -1}else{if(this.t<=0||(this.t==1&&this[0]<=0)){return 0}else{return 1}}}function I(t){if(t==null){t=10}if(this.signum()==0||t<2||t>36){return"0"}var bW=this.chunkSize(t);var L=Math.pow(t,bW);var bZ=bi(L),b0=bm(),bY=bm(),bX="";this.divRemTo(bZ,b0,bY);while(b0.signum()>0){bX=(L+bY.intValue()).toString(t).substr(1)+bX;b0.divRemTo(bZ,b0,bY)}return bY.intValue().toString(t)+bX}function av(b1,bY){this.fromInt(0);if(bY==null){bY=10}var bW=this.chunkSize(bY);var bX=Math.pow(bY,bW),L=false,t=0,b0=0;for(var z=0;z=bW){this.dMultiply(bX);this.dAddOffset(b0,0);t=0;b0=0}}if(t>0){this.dMultiply(Math.pow(bY,t));this.dAddOffset(b0,0)}if(L){bf.ZERO.subTo(this,this)}}function aP(bW,L,bY){if("number"==typeof L){if(bW<2){this.fromInt(1)}else{this.fromNumber(bW,bY);if(!this.testBit(bW-1)){this.bitwiseTo(bf.ONE.shiftLeft(bW-1),ak,this)}if(this.isEven()){this.dAddOffset(1,0)}while(!this.isProbablePrime(L)){this.dAddOffset(2,0);if(this.bitLength()>bW){this.subTo(bf.ONE.shiftLeft(bW-1),this)}}}}else{var z=new Array(),bX=bW&7;z.length=(bW>>3)+1;L.nextBytes(z);if(bX>0){z[0]&=((1<0){if(bW>bW)!=(this.s&this.DM)>>bW){L[t++]=bX|(this.s<<(this.DB-bW))}while(z>=0){if(bW<8){bX=(this[z]&((1<>(bW+=this.DB-8)}else{bX=(this[z]>>(bW-=8))&255;if(bW<=0){bW+=this.DB;--z}}if((bX&128)!=0){bX|=-256}if(t==0&&(this.s&128)!=(bX&128)){++t}if(t>0||bX!=this.s){L[t++]=bX}}}return L}function bG(t){return(this.compareTo(t)==0)}function W(t){return(this.compareTo(t)<0)?this:t}function bu(t){return(this.compareTo(t)>0)?this:t}function aJ(z,bY,bW){var L,bX,t=Math.min(z.t,this.t);for(L=0;L>=16;z+=16}if((t&255)==0){t>>=8;z+=8}if((t&15)==0){t>>=4;z+=4}if((t&3)==0){t>>=2;z+=2}if((t&1)==0){++z}return z}function aq(){for(var t=0;t=this.t){return(this.s!=0)}return((this[t]&(1<<(z%this.DB)))!=0)}function U(L,z){var t=bf.ONE.shiftLeft(L);this.bitwiseTo(t,z,t);return t}function a1(t){return this.changeBit(t,ak)}function ah(t){return this.changeBit(t,i)}function aO(t){return this.changeBit(t,aa)}function S(z,bW){var L=0,bX=0,t=Math.min(z.t,this.t);while(L>=this.DB}if(z.t>=this.DB}bX+=this.s}else{bX+=this.s;while(L>=this.DB}bX+=z.s}bW.s=(bX<0)?-1:0;if(bX>0){bW[L++]=bX}else{if(bX<-1){bW[L++]=this.DV+bX}}bW.t=L;bW.clamp()}function bg(t){var z=bm();this.addTo(t,z);return z}function aA(t){var z=bm();this.subTo(t,z);return z}function bH(t){var z=bm();this.multiplyTo(t,z);return z}function bU(){var t=bm();this.squareTo(t);return t}function bd(t){var z=bm();this.divRemTo(t,z,null);return z}function bP(t){var z=bm();this.divRemTo(t,null,z);return z}function bk(t){var L=bm(),z=bm();this.divRemTo(t,L,z);return new Array(L,z)}function e(t){this[this.t]=this.am(0,t-1,this,0,0,this.t);++this.t;this.clamp()}function aR(z,t){if(z==0){return}while(this.t<=t){this[this.t++]=0}this[t]+=z;while(this[t]>=this.DV){this[t]-=this.DV;if(++t>=this.t){this[this.t++]=0}++this[t]}}function Z(){}function bw(t){return t}function bK(t,L,z){t.multiplyTo(L,z)}function ai(t,z){t.squareTo(z)}Z.prototype.convert=bw;Z.prototype.revert=bw;Z.prototype.mulTo=bK;Z.prototype.sqrTo=ai;function Q(t){return this.exp(t,new Z())}function aQ(t,bX,bW){var L=Math.min(this.t+t.t,bX);bW.s=0;bW.t=L;while(L>0){bW[--L]=0}var z;for(z=bW.t-this.t;L=0){L[z]=0}for(z=Math.max(bW-this.t,0);z2*this.m.t){return t.mod(this.m)}else{if(t.compareTo(this.m)<0){return t}else{var z=bm();t.copyTo(z);this.reduce(z);return z}}}function bM(t){return t}function D(t){t.drShiftTo(this.m.t-1,this.r2);if(t.t>this.m.t+1){t.t=this.m.t+1;t.clamp()}this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(t.compareTo(this.r2)<0){t.dAddOffset(1,this.m.t+1)}t.subTo(this.r2,t);while(t.compareTo(this.m)>=0){t.subTo(this.m,t)}}function aM(t,z){t.squareTo(z);this.reduce(z)}function x(t,L,z){t.multiplyTo(L,z);this.reduce(z)}bR.prototype.convert=H;bR.prototype.revert=bM;bR.prototype.reduce=D;bR.prototype.mulTo=x;bR.prototype.sqrTo=aM;function N(b4,bZ){var b2=b4.bitLength(),b0,bW=bi(1),b7;if(b2<=0){return bW}else{if(b2<18){b0=1}else{if(b2<48){b0=3}else{if(b2<144){b0=4}else{if(b2<768){b0=5}else{b0=6}}}}}if(b2<8){b7=new aT(bZ)}else{if(bZ.isEven()){b7=new bR(bZ)}else{b7=new K(bZ)}}var b3=new Array(),bY=3,b5=b0-1,L=(1<1){var ca=bm();b7.sqrTo(b3[1],ca);while(bY<=L){b3[bY]=bm();b7.mulTo(ca,b3[bY-2],b3[bY]);bY+=2}}var b1=b4.t-1,b8,b6=true,bX=bm(),b9;b2=q(b4[b1])-1;while(b1>=0){if(b2>=b5){b8=(b4[b1]>>(b2-b5))&L}else{b8=(b4[b1]&((1<<(b2+1))-1))<<(b5-b2);if(b1>0){b8|=b4[b1-1]>>(this.DB+b2-b5)}}bY=b0;while((b8&1)==0){b8>>=1;--bY}if((b2-=bY)<0){b2+=this.DB;--b1}if(b6){b3[b8].copyTo(bW);b6=false}else{while(bY>1){b7.sqrTo(bW,bX);b7.sqrTo(bX,bW);bY-=2}if(bY>0){b7.sqrTo(bW,bX)}else{b9=bW;bW=bX;bX=b9}b7.mulTo(bX,b3[b8],bW)}while(b1>=0&&(b4[b1]&(1<0){z.rShiftTo(bY,z);bZ.rShiftTo(bY,bZ)}while(z.signum()>0){if((bW=z.getLowestSetBit())>0){z.rShiftTo(bW,z)}if((bW=bZ.getLowestSetBit())>0){bZ.rShiftTo(bW,bZ)}if(z.compareTo(bZ)>=0){z.subTo(bZ,z);z.rShiftTo(1,z)}else{bZ.subTo(z,bZ);bZ.rShiftTo(1,bZ)}}if(bY>0){bZ.lShiftTo(bY,bZ)}return bZ}function aj(bW){if(bW<=0){return 0}var L=this.DV%bW,z=(this.s<0)?bW-1:0;if(this.t>0){if(L==0){z=this[0]%bW}else{for(var t=this.t-1;t>=0;--t){z=(L*z+this[t])%bW}}}return z}function bS(z){var bY=z.isEven();if((this.isEven()&&bY)||z.signum()==0){return bf.ZERO}var bX=z.clone(),bW=this.clone();var L=bi(1),t=bi(0),b0=bi(0),bZ=bi(1);while(bX.signum()!=0){while(bX.isEven()){bX.rShiftTo(1,bX);if(bY){if(!L.isEven()||!t.isEven()){L.addTo(this,L);t.subTo(z,t)}L.rShiftTo(1,L)}else{if(!t.isEven()){t.subTo(z,t)}}t.rShiftTo(1,t)}while(bW.isEven()){bW.rShiftTo(1,bW);if(bY){if(!b0.isEven()||!bZ.isEven()){b0.addTo(this,b0);bZ.subTo(z,bZ)}b0.rShiftTo(1,b0)}else{if(!bZ.isEven()){bZ.subTo(z,bZ)}}bZ.rShiftTo(1,bZ)}if(bX.compareTo(bW)>=0){bX.subTo(bW,bX);if(bY){L.subTo(b0,L)}t.subTo(bZ,t)}else{bW.subTo(bX,bW);if(bY){b0.subTo(L,b0)}bZ.subTo(t,bZ)}}if(bW.compareTo(bf.ONE)!=0){return bf.ZERO}if(bZ.compareTo(z)>=0){return bZ.subtract(z)}if(bZ.signum()<0){bZ.addTo(z,bZ)}else{return bZ}if(bZ.signum()<0){return bZ.add(z)}else{return bZ}}var az=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];var k=(1<<26)/az[az.length-1];function bL(bY){var bX,L=this.abs();if(L.t==1&&L[0]<=az[az.length-1]){for(bX=0;bX>1;if(bY>az.length){bY=az.length}var z=bm();for(var bX=0;bX=256||C>=y){if(window.removeEventListener){window.removeEventListener("mousemove",F,false)}else{if(window.detachEvent){window.detachEvent("onmousemove",F)}}return}try{var t=z.x+z.y;l[C++]=t&255;this.count+=1}catch(L){}};if(window.addEventListener){window.addEventListener("mousemove",F,false)}else{if(window.attachEvent){window.attachEvent("onmousemove",F)}}}function bb(){if(j==null){j=P();while(C=0&&bZ>0){var bX=bW.charCodeAt(L--);if(bX<128){bY[--bZ]=bX}else{if((bX>127)&&(bX<2048)){bY[--bZ]=(bX&63)|128;bY[--bZ]=(bX>>6)|192}else{bY[--bZ]=(bX&63)|128;bY[--bZ]=((bX>>6)&63)|128;bY[--bZ]=(bX>>12)|224}}}bY[--bZ]=0;var z=new G();var t=new Array();while(bZ>2){t[0]=0;while(t[0]==0){z.nextBytes(t)}bY[--bZ]=t[0]}bY[--bZ]=2;bY[--bZ]=0;return new bf(bY)}function A(){this.n=null;this.e=0;this.d=null;this.p=null;this.q=null;this.dmp1=null;this.dmq1=null;this.coeff=null}function an(z,t){if(z!=null&&t!=null&&z.length>0&&t.length>0){this.n=w(z,16);this.e=parseInt(t,16)}else{console.error("Invalid RSA public key")}}function bq(t){return t.modPowInt(this.e,this.n)}function al(L){var t=bD(L,(this.n.bitLength()+7)>>3);if(t==null){return null}var bW=this.doPublic(t);if(bW==null){return null}var z=bW.toString(16);if((z.length&1)==0){return z}else{return"0"+z}}A.prototype.doPublic=bq;A.prototype.setPublic=an;A.prototype.encrypt=al;function bo(bW,bY){var t=bW.toByteArray();var L=0;while(L=t.length){return null}}var z="";while(++L191)&&(bX<224)){z+=String.fromCharCode(((bX&31)<<6)|(t[L+1]&63));++L}else{z+=String.fromCharCode(((bX&15)<<12)|((t[L+1]&63)<<6)|(t[L+2]&63));L+=2}}}return z}function aC(L,t,z){if(L!=null&&t!=null&&L.length>0&&t.length>0){this.n=w(L,16);this.e=parseInt(t,16);this.d=w(z,16)}else{console.error("Invalid RSA private key")}}function O(bZ,bW,bX,L,z,t,b0,bY){if(bZ!=null&&bW!=null&&bZ.length>0&&bW.length>0){this.n=w(bZ,16);this.e=parseInt(bW,16);this.d=w(bX,16);this.p=w(L,16);this.q=w(z,16);this.dmp1=w(t,16);this.dmq1=w(b0,16);this.coeff=w(bY,16)}else{console.error("Invalid RSA private key")}}function ax(L,b2){var z=new G();var bZ=L>>1;this.e=parseInt(b2,16);var bW=new bf(b2,16);for(;;){for(;;){this.p=new bf(L-bZ,1,z);if(this.p.subtract(bf.ONE).gcd(bW).compareTo(bf.ONE)==0&&this.p.isProbablePrime(10)){break}}for(;;){this.q=new bf(bZ,1,z);if(this.q.subtract(bf.ONE).gcd(bW).compareTo(bf.ONE)==0&&this.q.isProbablePrime(10)){break}}if(this.p.compareTo(this.q)<=0){var b1=this.p;this.p=this.q;this.q=b1}var b0=this.p.subtract(bf.ONE);var bX=this.q.subtract(bf.ONE);var bY=b0.multiply(bX);if(bY.gcd(bW).compareTo(bf.ONE)==0){this.n=this.p.multiply(this.q);this.d=bW.modInverse(bY);this.dmp1=this.d.mod(b0);this.dmq1=this.d.mod(bX);this.coeff=this.q.modInverse(this.p);break}}}function ay(t){if(this.p==null||this.q==null){return t.modPow(this.d,this.n)}var L=t.mod(this.p).modPow(this.dmp1,this.p);var z=t.mod(this.q).modPow(this.dmq1,this.q);while(L.compareTo(z)<0){L=L.add(this.p)}return L.subtract(z).multiply(this.coeff).mod(this.p).multiply(this.q).add(z)}function r(z){var L=w(z,16);var t=this.doPrivate(L);if(t==null){return null}return bo(t,(this.n.bitLength()+7)>>3)}A.prototype.doPrivate=ay;A.prototype.setPrivate=aC;A.prototype.setPrivateEx=O;A.prototype.generate=ax;A.prototype.decrypt=r;(function(){var z=function(b3,b1,b2){var bZ=new G();var bW=b3>>1;this.e=parseInt(b1,16);var bY=new bf(b1,16);var b0=this;var bX=function(){var b5=function(){if(b0.p.compareTo(b0.q)<=0){var b8=b0.p;b0.p=b0.q;b0.q=b8}var ca=b0.p.subtract(bf.ONE);var b7=b0.q.subtract(bf.ONE);var b9=ca.multiply(b7);if(b9.gcd(bY).compareTo(bf.ONE)==0){b0.n=b0.p.multiply(b0.q);b0.d=bY.modInverse(b9);b0.dmp1=b0.d.mod(ca);b0.dmq1=b0.d.mod(b7);b0.coeff=b0.q.modInverse(b0.p);setTimeout(function(){b2()},0)}else{setTimeout(bX,0)}};var b6=function(){b0.q=bm();b0.q.fromNumberAsync(bW,1,bZ,function(){b0.q.subtract(bf.ONE).gcda(bY,function(b7){if(b7.compareTo(bf.ONE)==0&&b0.q.isProbablePrime(10)){setTimeout(b5,0)}else{setTimeout(b6,0)}})})};var b4=function(){b0.p=bm();b0.p.fromNumberAsync(b3-bW,1,bZ,function(){b0.p.subtract(bf.ONE).gcda(bY,function(b7){if(b7.compareTo(bf.ONE)==0&&b0.p.isProbablePrime(10)){setTimeout(b6,0)}else{setTimeout(b4,0)}})})};setTimeout(b4,0)};setTimeout(bX,0)};A.prototype.generateAsync=z;var t=function(bX,b3){var bW=(this.s<0)?this.negate():this.clone();var b2=(bX.s<0)?bX.negate():bX.clone();if(bW.compareTo(b2)<0){var bZ=bW;bW=b2;b2=bZ}var bY=bW.getLowestSetBit(),b0=b2.getLowestSetBit();if(b0<0){b3(bW);return}if(bY0){bW.rShiftTo(b0,bW);b2.rShiftTo(b0,b2)}var b1=function(){if((bY=bW.getLowestSetBit())>0){bW.rShiftTo(bY,bW)}if((bY=b2.getLowestSetBit())>0){b2.rShiftTo(bY,b2)}if(bW.compareTo(b2)>=0){bW.subTo(b2,bW);bW.rShiftTo(1,bW)}else{b2.subTo(bW,b2);b2.rShiftTo(1,b2)}if(!(bW.signum()>0)){if(b0>0){b2.lShiftTo(b0,b2)}setTimeout(function(){b3(b2)},0)}else{setTimeout(b1,0)}};setTimeout(b1,10)};bf.prototype.gcda=t;var L=function(b0,bX,b3,b2){if("number"==typeof bX){if(b0<2){this.fromInt(1)}else{this.fromNumber(b0,b3);if(!this.testBit(b0-1)){this.bitwiseTo(bf.ONE.shiftLeft(b0-1),ak,this)}if(this.isEven()){this.dAddOffset(1,0)}var bZ=this;var bY=function(){bZ.dAddOffset(2,0);if(bZ.bitLength()>b0){bZ.subTo(bf.ONE.shiftLeft(b0-1),bZ)}if(bZ.isProbablePrime(bX)){setTimeout(function(){b2()},0)}else{setTimeout(bY,0)}};setTimeout(bY,0)}}else{var bW=new Array(),b1=b0&7;bW.length=(b0>>3)+1;bX.nextBytes(bW);if(b1>0){bW[0]&=((1<>6)+a4.charAt(bW&63)}if(z+1==L.length){bW=parseInt(L.substring(z,z+1),16);t+=a4.charAt(bW<<2)}else{if(z+2==L.length){bW=parseInt(L.substring(z,z+2),16);t+=a4.charAt(bW>>2)+a4.charAt((bW&3)<<4)}}while((t.length&3)>0){t+=J}return t}function aW(bX){var L="";var bW;var t=0;var z;for(bW=0;bW>2);z=v&3;t=1}else{if(t==1){L+=Y((z<<2)|(v>>4));z=v&15;t=2}else{if(t==2){L+=Y(z);L+=Y(v>>2);z=v&3;t=3}else{L+=Y((z<<2)|(v>>4));L+=Y(v&15);t=0}}}}if(t==1){L+=Y(z<<2)}return L}function M(bW){var L=aW(bW);var z;var t=new Array();for(z=0;2*z15){throw"ASN.1 length too long to represent by 8x: n = "+b1.toString(16)}var bY=128+bZ;return bY.toString(16)+b0}};this.getEncodedHex=function(){if(this.hTLV==null||this.isModified){this.hV=this.getFreshValueHex();this.hL=this.getLengthHexFromValue();this.hTLV=this.hT+this.hL+this.hV;this.isModified=false}return this.hTLV};this.getValueHex=function(){this.getEncodedHex();return this.hV};this.getFreshValueHex=function(){return""}};KJUR.asn1.DERAbstractString=function(L){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);var z=null;var t=null;this.getString=function(){return this.s};this.setString=function(bW){this.hTLV=null;this.isModified=true;this.s=bW;this.hV=stohex(this.s)};this.setStringHex=function(bW){this.hTLV=null;this.isModified=true;this.s=null;this.hV=bW};this.getFreshValueHex=function(){return this.hV};if(typeof L!="undefined"){if(typeof L.str!="undefined"){this.setString(L.str)}else{if(typeof L.hex!="undefined"){this.setStringHex(L.hex)}}}};at.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object);KJUR.asn1.DERAbstractTime=function(L){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);var z=null;var t=null;this.localDateToUTC=function(bX){utc=bX.getTime()+(bX.getTimezoneOffset()*60000);var bW=new Date(utc);return bW};this.formatDate=function(b1,b3){var bW=this.zeroPadding;var b2=this.localDateToUTC(b1);var b4=String(b2.getFullYear());if(b3=="utc"){b4=b4.substr(2,2)}var b0=bW(String(b2.getMonth()+1),2);var b5=bW(String(b2.getDate()),2);var bX=bW(String(b2.getHours()),2);var bY=bW(String(b2.getMinutes()),2);var bZ=bW(String(b2.getSeconds()),2);return b4+b0+b5+bX+bY+bZ+"Z"};this.zeroPadding=function(bX,bW){if(bX.length>=bW){return bX}return new Array(bW-bX.length+1).join("0")+bX};this.getString=function(){return this.s};this.setString=function(bW){this.hTLV=null;this.isModified=true;this.s=bW;this.hV=stohex(this.s)};this.setByDateValue=function(b0,b2,bX,bW,bY,bZ){var b1=new Date(Date.UTC(b0,b2-1,bX,bW,bY,bZ,0));this.setByDate(b1)};this.getFreshValueHex=function(){return this.hV}};at.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object);KJUR.asn1.DERAbstractStructured=function(z){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);var t=null;this.setByASN1ObjectArray=function(L){this.hTLV=null;this.isModified=true;this.asn1Array=L};this.appendASN1Object=function(L){this.hTLV=null;this.isModified=true;this.asn1Array.push(L)};this.asn1Array=new Array();if(typeof z!="undefined"){if(typeof z.array!="undefined"){this.asn1Array=z.array}}};at.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object);KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff"};at.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(t){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(z){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(z)};this.setByInteger=function(L){var z=new bf(String(L),10);this.setByBigInteger(z)};this.setValueHex=function(z){this.hV=z};this.getFreshValueHex=function(){return this.hV};if(typeof t!="undefined"){if(typeof t.bigint!="undefined"){this.setByBigInteger(t.bigint)}else{if(typeof t["int"]!="undefined"){this.setByInteger(t["int"])}else{if(typeof t.hex!="undefined"){this.setValueHex(t.hex)}}}}};at.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object);KJUR.asn1.DERBitString=function(t){KJUR.asn1.DERBitString.superclass.constructor.call(this);this.hT="03";this.setHexValueIncludingUnusedBits=function(z){this.hTLV=null;this.isModified=true;this.hV=z};this.setUnusedBitsAndHexValue=function(z,bW){if(z<0||7=2){bX[bX.length]=b0;b0=0;b2=0}else{b0<<=4}}if(b2){throw"Hex encoding incomplete: 4 bits missing"}return bX};window.Hex=t})();(function(z){var t={},L;t.decode=function(bW){var bZ;if(L===z){var bY="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b3="= \f\n\r\t\u00A0\u2028\u2029";L=[];for(bZ=0;bZ<64;++bZ){L[bY.charAt(bZ)]=bZ}for(bZ=0;bZ=4){bX[bX.length]=(b0>>16);bX[bX.length]=(b0>>8)&255;bX[bX.length]=b0&255;b0=0;b2=0}else{b0<<=6}}switch(b2){case 1:throw"Base64 encoding incomplete: at least 2 bits missing";case 2:bX[bX.length]=(b0>>10);break;case 3:bX[bX.length]=(b0>>16);bX[bX.length]=(b0>>8)&255;break}return bX};t.re=/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/;t.unarmor=function(bX){var bW=t.re.exec(bX);if(bW){if(bW[1]){bX=bW[1]}else{if(bW[2]){bX=bW[2]}else{throw"RegExp out of sync"}}}return t.decode(bX)};window.Base64=t})();(function(bY){var z=100,t="\u2026",L={tag:function(b0,b1){var bZ=document.createElement(b0);bZ.className=b1;return bZ},text:function(bZ){return document.createTextNode(bZ)}};function bX(bZ,b0){if(bZ instanceof bX){this.enc=bZ.enc;this.pos=bZ.pos}else{this.enc=bZ;this.pos=b0}}bX.prototype.get=function(bZ){if(bZ===bY){bZ=this.pos++}if(bZ>=this.enc.length){throw"Requesting byte offset "+bZ+" on a stream of length "+this.enc.length}return this.enc[bZ]};bX.prototype.hexDigits="0123456789ABCDEF";bX.prototype.hexByte=function(bZ){return this.hexDigits.charAt((bZ>>4)&15)+this.hexDigits.charAt(bZ&15)};bX.prototype.hexDump=function(b3,bZ,b0){var b2="";for(var b1=b3;b1191)&&(b2<224)){b1+=String.fromCharCode(((b2&31)<<6)|(this.get(b0++)&63))}else{b1+=String.fromCharCode(((b2&15)<<12)|((this.get(b0++)&63)<<6)|(this.get(b0++)&63))}}}return b1};bX.prototype.parseStringBMP=function(b4,b0){var b3="";for(var b2=b4;b24){bZ<<=3;var b2=this.get(b4);if(b2===0){bZ-=8}else{while(b2<128){b2<<=1;--bZ}}return"("+bZ+" bit)"}var b3=0;for(var b1=b4;b1bZ;--b3){var b5=this.get(b3);for(var b1=b6;b1<8;++b1){b7+=(b5>>b1)&1?"1":"0"}b6=0}}return b7};bX.prototype.parseOctetString=function(b3,b0){var bZ=b0-b3,b2="("+bZ+" byte) ";if(bZ>z){b0=b3+z}for(var b1=b3;b1z){b2+=t}return b2};bX.prototype.parseOID=function(b6,b0){var b3="",b5=0,b4=0;for(var b2=b6;b2=31)?"bigint":b5)}b5=b4=0}}return b3};function bW(b2,b3,b1,bZ,b0){this.stream=b2;this.header=b3;this.length=b1;this.tag=bZ;this.sub=b0}bW.prototype.typeName=function(){if(this.tag===bY){return"unknown"}var b1=this.tag>>6,bZ=(this.tag>>5)&1,b0=this.tag&31;switch(b1){case 0:switch(b0){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString";default:return"Universal_"+b0.toString(16)}case 1:return"Application_"+b0.toString(16);case 2:return"["+b0+"]";case 3:return"Private_"+b0.toString(16)}};bW.prototype.reSeemsASCII=/^[ -~]+$/;bW.prototype.content=function(){if(this.tag===bY){return null}var b3=this.tag>>6,b0=this.tag&31,b2=this.posContent(),bZ=Math.abs(this.length);if(b3!==0){if(this.sub!==null){return"("+this.sub.length+" elem)"}var b1=this.stream.parseStringISO(b2,b2+Math.min(bZ,z));if(this.reSeemsASCII.test(b1)){return b1.substring(0,2*z)+((b1.length>2*z)?t:"")}else{return this.stream.parseOctetString(b2,b2+bZ)}}switch(b0){case 1:return(this.stream.get(b2)===0)?"false":"true";case 2:return this.stream.parseInteger(b2,b2+bZ);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(b2,b2+bZ);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(b2,b2+bZ);case 6:return this.stream.parseOID(b2,b2+bZ);case 16:case 17:return"("+this.sub.length+" elem)";case 12:return this.stream.parseStringUTF(b2,b2+bZ);case 18:case 19:case 20:case 21:case 22:case 26:return this.stream.parseStringISO(b2,b2+bZ);case 30:return this.stream.parseStringBMP(b2,b2+bZ);case 23:case 24:return this.stream.parseTime(b2,b2+bZ)}return null};bW.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+((this.sub===null)?"null":this.sub.length)+"]"};bW.prototype.print=function(b0){if(b0===bY){b0=""}document.writeln(b0+this);if(this.sub!==null){b0+=" ";for(var b1=0,bZ=this.sub.length;b1=0){b2+="+"}b2+=this.length;if(this.tag&32){b2+=" (constructed)"}else{if(((this.tag==3)||(this.tag==4))&&(this.sub!==null)){b2+=" (encapsulates)"}}b2+="\n";if(this.sub!==null){b0+=" ";for(var b1=0,bZ=this.sub.length;b1";b8+="Length: "+this.header+"+";if(this.length>=0){b8+=this.length}else{b8+=(-this.length)+" (undefined)"}if(this.tag&32){b8+="
            (constructed)"}else{if(((this.tag==3)||(this.tag==4))&&(this.sub!==null)){b8+="
            (encapsulates)"}}if(b4!==null){b8+="
            Value:
            "+b4+"";if((typeof oids==="object")&&(this.tag==6)){var b1=oids[b4];if(b1){if(b1.d){b8+="
            "+b1.d}if(b1.c){b8+="
            "+b1.c}if(b1.w){b8+="
            (warning!)"}}}}b7.innerHTML=b8;b0.appendChild(b7);var bZ=L.tag("div","sub");if(this.sub!==null){for(var b2=0,b5=this.sub.length;b2=bZ){return}var b0=L.tag("span",b1);b0.appendChild(L.text(b3.hexDump(b4,bZ)));b2.appendChild(b0)};bW.prototype.toHexDOM=function(b0){var b3=L.tag("span","hex");if(b0===bY){b0=b3}this.head.hexNode=b3;this.head.onmouseover=function(){this.hexNode.className="hexCurrent"};this.head.onmouseout=function(){this.hexNode.className="hex"};b3.asn1=this;b3.onmouseover=function(){var b5=!b0.selected;if(b5){b0.selected=this.asn1;this.className="hexCurrent"}this.asn1.fakeHover(b5)};b3.onmouseout=function(){var b5=(b0.selected==this.asn1);this.asn1.fakeOut(b5);if(b5){b0.selected=null;this.className="hex"}};this.toHexDOM_sub(b3,"tag",this.stream,this.posStart(),this.posStart()+1);this.toHexDOM_sub(b3,(this.length>=0)?"dlen":"ulen",this.stream,this.posStart()+1,this.posContent());if(this.sub===null){b3.appendChild(L.text(this.stream.hexDump(this.posContent(),this.posEnd())))}else{if(this.sub.length>0){var b4=this.sub[0];var b2=this.sub[this.sub.length-1];this.toHexDOM_sub(b3,"intro",this.stream,this.posContent(),b4.posStart());for(var b1=0,bZ=this.sub.length;b13){throw"Length over 24 bits not supported at position "+(b2.pos-1)}if(bZ===0){return -1}b0=0;for(var b1=0;b14)){return false}var b4=new bX(b5);if(b0==3){b4.get()}var b3=b4.get();if((b3>>6)&1){return false}try{var b2=bW.decodeLength(b4);return((b4.pos-b5.pos)+b2==bZ)}catch(b1){return false}};bW.decode=function(b6){if(!(b6 instanceof bX)){b6=new bX(b6,0)}var b5=new bX(b6),b8=b6.get(),b3=bW.decodeLength(b6),b2=b6.pos-b5.pos,bZ=null;if(bW.hasContent(b8,b3,b6)){var b0=b6.pos;if(b8==3){b6.get()}bZ=[];if(b3>=0){var b1=b0+b3;while(b6.pos +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + 秒绘设计 + + + + ${Scripts.src(zhiqim.js)} + + + <#include include/> + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/norm.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/norm.htm new file mode 100644 index 0000000..79d7e6c --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/norm.htm @@ -0,0 +1,15 @@ +<#-- 主题变量和函数定义 --> +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + +秒绘设计 + + +${Scripts.src(zhiqim.js)} + + + +<#include include/> + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/template.htm b/zhiqim_manager/resource/ztmpl/zhiqim_manager/template.htm new file mode 100644 index 0000000..78b04ff --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/template.htm @@ -0,0 +1,12 @@ +<#-- 主题变量和函数定义 --> +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> +<#-- 判断是否启用了iframe --> +<#if !ZmrParamDao.isThemeFrame(context)> + <#include "/ztmpl/zhiqim_manager/"+themeMain+"/alone.htm"/> +<#else> + <#if request.getPathInContext() == "/"+zhiqim_manager+"/main.htm"> + <#include "/ztmpl/zhiqim_manager/"+themeMain+"/iframeMain.htm"/> + <#else> + <#include "/ztmpl/zhiqim_manager/"+themeMain+"/iframeInner.htm"/> + + \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/three.js b/zhiqim_manager/resource/ztmpl/zhiqim_manager/three.js new file mode 100644 index 0000000..4b20d21 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/three.js @@ -0,0 +1,827 @@ +// threejs.org/license +'use strict';var THREE={REVISION:"68"};"object"===typeof module&&(module.exports=THREE);THREE.CullFaceNone=0;THREE.CullFaceBack=1;THREE.CullFaceFront=2;THREE.CullFaceFrontBack=3;THREE.FrontFaceDirectionCW=0;THREE.FrontFaceDirectionCCW=1;THREE.BasicShadowMap=0;THREE.PCFShadowMap=1;THREE.PCFSoftShadowMap=2;THREE.FrontSide=0;THREE.BackSide=1;THREE.DoubleSide=2;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NoBlending=0; +THREE.NormalBlending=1;THREE.AdditiveBlending=2;THREE.SubtractiveBlending=3;THREE.MultiplyBlending=4;THREE.CustomBlending=5;THREE.AddEquation=100;THREE.SubtractEquation=101;THREE.ReverseSubtractEquation=102;THREE.ZeroFactor=200;THREE.OneFactor=201;THREE.SrcColorFactor=202;THREE.OneMinusSrcColorFactor=203;THREE.SrcAlphaFactor=204;THREE.OneMinusSrcAlphaFactor=205;THREE.DstAlphaFactor=206;THREE.OneMinusDstAlphaFactor=207;THREE.DstColorFactor=208;THREE.OneMinusDstColorFactor=209; +THREE.SrcAlphaSaturateFactor=210;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.AddOperation=2;THREE.UVMapping=function(){};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.RepeatWrapping=1E3;THREE.ClampToEdgeWrapping=1001;THREE.MirroredRepeatWrapping=1002;THREE.NearestFilter=1003;THREE.NearestMipMapNearestFilter=1004;THREE.NearestMipMapLinearFilter=1005; +THREE.LinearFilter=1006;THREE.LinearMipMapNearestFilter=1007;THREE.LinearMipMapLinearFilter=1008;THREE.UnsignedByteType=1009;THREE.ByteType=1010;THREE.ShortType=1011;THREE.UnsignedShortType=1012;THREE.IntType=1013;THREE.UnsignedIntType=1014;THREE.FloatType=1015;THREE.UnsignedShort4444Type=1016;THREE.UnsignedShort5551Type=1017;THREE.UnsignedShort565Type=1018;THREE.AlphaFormat=1019;THREE.RGBFormat=1020;THREE.RGBAFormat=1021;THREE.LuminanceFormat=1022;THREE.LuminanceAlphaFormat=1023; +THREE.RGB_S3TC_DXT1_Format=2001;THREE.RGBA_S3TC_DXT1_Format=2002;THREE.RGBA_S3TC_DXT3_Format=2003;THREE.RGBA_S3TC_DXT5_Format=2004;THREE.Color=function(a){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(a)}; +THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(a){a instanceof THREE.Color?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(a,b,c){if(0===b)this.r=this.g=this.b=c;else{var d=function(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a};b=0.5>=c?c*(1+b):c+b-c*b;c=2*c-b;this.r=d(c,b,a+1/3);this.g=d(c,b,a);this.b=d(c,b,a-1/3)}return this},setStyle:function(a){if(/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(a))return a=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(a),this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,this;if(/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(a))return a=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(a),this.r= +Math.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,this;if(/^\#([0-9a-f]{6})$/i.test(a))return a=/^\#([0-9a-f]{6})$/i.exec(a),this.setHex(parseInt(a[1],16)),this;if(/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(a))return a=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a),this.setHex(parseInt(a[1]+a[1]+a[2]+a[2]+a[3]+a[3],16)),this;if(/^(\w+)$/i.test(a))return this.setHex(THREE.ColorKeywords[a]),this},copy:function(a){this.r=a.r;this.g= +a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);this.b=Math.sqrt(this.b);return this},getHex:function(){return 255*this.r<<16^255*this.g<< +8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){a=a||{h:0,s:0,l:0};var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h=(f+e)/2;if(f===e)f=g=0;else{var k=e-f,f=0.5>=h?k/(e+f):k/(2-e-f);switch(e){case b:g=(c-d)/k+(cf&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=0.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y= +0.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=0.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*= +-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this}, +multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,l=b._w;this._x=c*l+f*g+d*k-e*h;this._y=d*l+f*h+e*g-c*k;this._z=e*l+f*k+c*h-d*g;this._w=f*l-c*g-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."); +return a.applyQuaternion(this)},slerp:function(a,b){var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),k=Math.sqrt(1-g*g);if(0.001>Math.abs(k))return this._w=0.5*(f+this._w),this._x=0.5*(c+this._x),this._y=0.5*(d+this._y),this._z=0.5*(e+this._z),this;g=Math.sin((1-b)*h)/k;h=Math.sin(b*h)/k;this._w=f*g+this._w*h;this._x= +c*g+this._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];this._w=a[3];this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._w]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y, +this._z,this._w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; +THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a, +b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this}, +subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2);a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this}, +roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b= +this.x-a.x;a=this.y-a.y;return b*b+a*a},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a){this.x=a[0];this.y=a[1];return this},toArray:function(){return[this.x,this.y]},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; +THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+ +a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), +this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y= +a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a;return function(b){!1===b instanceof THREE.Euler&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.");void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromEuler(b));return this}}(),applyAxisAngle:function(){var a;return function(b,c){void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromAxisAngle(b,c));return this}}(),applyMatrix3:function(a){var b=this.x, +c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12];this.y=a[1]*b+a[5]*c+a[9]*d+a[13];this.z=a[2]*b+a[6]*c+a[10]*d+a[14];return this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z= +(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,l=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-l*-f;this.y=k*a+b*-f+l*-e-h*-g;this.z=l*a+b*-g+h*-f-k*-e;return this},transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x; +this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z= +b.z);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3);a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x= +0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+ +Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},cross:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y= +e*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;this.x=d*h-e*g;this.y=e*f-c*h;this.z=c*g-d*f;return this},projectOnVector:function(){var a,b;return function(c){void 0===a&&(a=new THREE.Vector3);a.copy(c).normalize();b=this.dot(a);return this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a;return function(b){void 0=== +a&&(a=new THREE.Vector3);return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/(this.length()*a.length());return Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},setEulerFromRotationMatrix:function(a,b){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")}, +setEulerFromQuaternion:function(a,b){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(a){console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a, +b){console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(a,b)},setFromMatrixPosition:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z= +a;return this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;this.x=d[c];this.y=d[c+1];this.z=d[c+2];return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];return this},toArray:function(){return[this.x,this.y,this.z]},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}; +THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x; +case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this}, +addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b= +this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a):(this.z=this.y=this.x=0,this.w=1);return this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this}, +setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var l=a[10];if(0.01>Math.abs(d-g)&&0.01>Math.abs(f-c)&&0.01>Math.abs(k-b)){if(0.1>Math.abs(d+g)&&0.1>Math.abs(f+c)&&0.1>Math.abs(k+b)&&0.1>Math.abs(e+h+l-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;l=(l+1)/2;d=(d+g)/4;f=(f+c)/4;k=(k+b)/4;e>h&&e>l?0.01>e?(b=0,d=c=0.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>l?0.01>h?(b=0.707106781,c=0,d=0.707106781):(c= +Math.sqrt(h),b=d/c,d=k/c):0.01>l?(c=b=0.707106781,d=0):(d=Math.sqrt(l),b=f/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(f-c)*(f-c)+(g-d)*(g-d));0.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(f-c)/a;this.z=(g-d)/a;this.w=Math.acos((e+h+l-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z=b.z);this.wb.w&&(this.w=b.w);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z); +this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w): +Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())}, +setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3];return this},toArray:function(){return[this.x,this.y,this.z,this.w]},clone:function(){return new THREE.Vector4(this.x,this.y,this.z, +this.w)}};THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ"; +THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x= +a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[1],k=d[5],l=d[9],n=d[2],q=d[6],d=d[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(c(g,-1,1)),0.99999>Math.abs(g)?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-f,e)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-c(l,-1,1)),0.99999>Math.abs(l)?(this._y=Math.atan2(g,d),this._z=Math.atan2(h,k)): +(this._y=Math.atan2(-n,e),this._z=0)):"ZXY"===b?(this._x=Math.asin(c(q,-1,1)),0.99999>Math.abs(q)?(this._y=Math.atan2(-n,d),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,e))):"ZYX"===b?(this._y=Math.asin(-c(n,-1,1)),0.99999>Math.abs(n)?(this._x=Math.atan2(q,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(c(h,-1,1)),0.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-n,e)):(this._x=0,this._y=Math.atan2(g,d))):"XZY"===b?(this._z= +Math.asin(-c(f,-1,1)),0.99999>Math.abs(f)?(this._x=Math.atan2(q,k),this._y=Math.atan2(g,e)):(this._x=Math.atan2(-l,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;this.onChangeCallback();return this},setFromQuaternion:function(a,b,c){var d=THREE.Math.clamp,e=a.x*a.x,f=a.y*a.y,g=a.z*a.z,h=a.w*a.w;b=b||this._order;"XYZ"===b?(this._x=Math.atan2(2*(a.x*a.w-a.y*a.z),h-e-f+g),this._y=Math.asin(d(2*(a.x*a.z+a.y*a.w),-1,1)),this._z=Math.atan2(2* +(a.z*a.w-a.x*a.y),h+e-f-g)):"YXZ"===b?(this._x=Math.asin(d(2*(a.x*a.w-a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h-e-f+g),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h-e+f-g)):"ZXY"===b?(this._x=Math.asin(d(2*(a.x*a.w+a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.y*a.w-a.z*a.x),h-e-f+g),this._z=Math.atan2(2*(a.z*a.w-a.x*a.y),h-e+f-g)):"ZYX"===b?(this._x=Math.atan2(2*(a.x*a.w+a.z*a.y),h-e-f+g),this._y=Math.asin(d(2*(a.y*a.w-a.x*a.z),-1,1)),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h+e-f-g)):"YZX"=== +b?(this._x=Math.atan2(2*(a.x*a.w-a.z*a.y),h-e+f-g),this._y=Math.atan2(2*(a.y*a.w-a.x*a.z),h+e-f-g),this._z=Math.asin(d(2*(a.x*a.y+a.z*a.w),-1,1))):"XZY"===b?(this._x=Math.atan2(2*(a.x*a.w+a.y*a.z),h-e+f-g),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h+e-f-g),this._z=Math.asin(d(2*(a.z*a.w-a.x*a.y),-1,1))):console.warn("THREE.Euler: .setFromQuaternion() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this); +this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._order]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}}; +THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3}; +THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(0.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a, +b){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);var e=b.dot(b),e=b.dot(a)/e;d&&(e=THREE.Math.clamp(e,0,1));return e}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);c=c||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a); +this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}};THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector2(-Infinity,-Infinity)}; +THREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.y +this.max.y?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&& +a.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}};THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector3(-Infinity,-Infinity,-Infinity)}; +THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y|| +a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y|| +a.max.zthis.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new THREE.Vector3;return function(b){b=b||new THREE.Sphere;b.center=this.center();b.radius=0.5*this.size(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this}, +union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b); +a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.makeEmpty();this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}}; +THREE.Matrix3=function(a,b,c,d,e,f,g,h,k){var l=this.elements=new Float32Array(9);l[0]=void 0!==a?a:1;l[3]=b||0;l[6]=c||0;l[1]=d||0;l[4]=void 0!==e?e:1;l[7]=f||0;l[2]=g||0;l[5]=h||0;l[8]=void 0!==k?k:1}; +THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,f,g,h,k){var l=this.elements;l[0]=a;l[3]=b;l[6]=c;l[1]=d;l[4]=e;l[7]=f;l[2]=g;l[5]=h;l[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)}, +multiplyVector3Array:function(a){console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;ethis.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.elements.set(this.elements);c=1/g;var f=1/h,l=1/k;b.elements[0]*=c;b.elements[1]*= +c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=l;b.elements[9]*=l;b.elements[10]*=l;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(0.5*a)); +var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,k=c-d,l=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/k;g[9]=0;g[13]=-((c+d)/k);g[2]=0;g[6]=0;g[10]=-2/l;g[14]=-((f+e)/l);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){var a= +this.elements;return new THREE.Matrix4(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15])}};THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3}; +THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin); +var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(a,b,c,d){var e=a.clone().add(b).multiplyScalar(0.5),f=b.clone().sub(a).normalize(),g=0.5*a.distanceTo(b), +h=this.origin.clone().sub(e);a=-this.direction.dot(f);b=h.dot(this.direction);var k=-h.dot(f),l=h.lengthSq(),n=Math.abs(1-a*a),q,r;0<=n?(h=a*k-b,q=a*b-k,r=g*n,0<=h?q>=-r?q<=r?(g=1/n,h*=g,q*=g,a=h*(h+a*q+2*b)+q*(a*h+q+2*k)+l):(q=g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l):(q=-g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l):q<=-r?(h=Math.max(0,-(-a*g+b)),q=0f)return null;f=Math.sqrt(f-e);e=d-f; +d+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3; +return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(fg||e>d)return null;if(e>c||c!== +c)c=e;if(gd?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));if(0>g||e+g>f)return null; +e=-h*a.dot(d);return 0>e?null:this.at(e/f,k)}}(),applyMatrix4:function(a){this.direction.add(this.origin).applyMatrix4(a);this.origin.applyMatrix4(a);this.direction.sub(this.origin);this.direction.normalize();return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}};THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3;this.radius=void 0!==b?b:0}; +THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,f=0,g=b.length;f=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<= +this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius); +return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}}; +THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]}; +THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],n=c[8],q=c[9],r=c[10],t=c[11],s=c[12],p=c[13],v=c[14],c=c[15];b[0].setComponents(f-a,l-g,t-n,c-s).normalize();b[1].setComponents(f+ +a,l+g,t+n,c+s).normalize();b[2].setComponents(f+d,l+h,t+q,c+p).normalize();b[3].setComponents(f-d,l-h,t-q,c-p).normalize();b[4].setComponents(f-e,l-k,t-r,c-v).normalize();b[5].setComponents(f+e,l+k,t+r,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes, +c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)e;e++){var f=d[e];a.x=0g&&0>f)return!1}return!0}}(), +containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0}; +THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d, +c);return this}}(),copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a, +b){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0a&&0f||1e;e++)8==e||13==e||18==e||23==e?b[e]="-":14==e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return ac?c:a},clampBottom:function(a,b){return a=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(0.5-Math.random())},sign:function(a){return 0>a?-1:0this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1: +f+2;l=this.points[c[0]];n=this.points[c[1]];q=this.points[c[2]];r=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,n.x,q.x,r.x,g,h,k);d.y=b(l.y,n.y,q.y,r.y,g,h,k);d.z=b(l.z,n.z,q.z,r.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a=b.x+b.y}}(); +THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return 0.5*a.cross(b).length()}}(),midpoint:function(a){return(a|| +new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}, +clone:function(){return(new THREE.Triangle).copy(this)}};THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}; +THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(), +a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){}; +THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&& +c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;ee&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},l=function(a, +b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;L[0]=a.positionScreen;L[1]=b.positionScreen;L[2]=c.positionScreen;return E.isIntersectionBox(Q.setFromPoints(L))},q=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){f=a;g=f.material;h.getNormalMatrix(f.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:l, +checkBackfaceCulling:q,pushVertex:function(b,c,d){n=a();n.position.set(b,c,d);k(n)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=r[a],e=r[b];u=c();u.id=f.id;u.v1.copy(d);u.v2.copy(e);u.z=(d.positionScreen.z+e.positionScreen.z)/2;u.material=f.material;K.elements.push(u)},pushTriangle:function(a,c,k){var n=r[a],p=r[c],t=r[k];if(!1!==l(n,p,t)&&(g.side===THREE.DoubleSide||!0===q(n,p,t))){s=b();s.id=f.id;s.v1.copy(n);s.v2.copy(p);s.v3.copy(t); +s.z=(n.positionScreen.z+p.positionScreen.z+t.positionScreen.z)/3;for(n=0;3>n;n++)p=3*arguments[n],t=s.vertexNormalsModel[n],t.set(d[p],d[p+1],d[p+2]),t.applyMatrix3(h).normalize(),p=2*arguments[n],s.uvs[n].set(e[p],e[p+1]);s.vertexNormalsLength=3;s.material=f.material;K.elements.push(s)}}}};this.projectScene=function(n,t,w,v){I=D=p=0;K.elements.length=0;!0===n.autoUpdate&&n.updateMatrixWorld();void 0===t.parent&&t.updateMatrixWorld();R.copy(t.matrixWorldInverse.getInverse(t.matrixWorld));B.multiplyMatrices(t.projectionMatrix, +R);H.setFromMatrix(B);h=0;K.objects.length=0;K.lights.length=0;n.traverseVisible(function(a){if(a instanceof THREE.Light)K.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===H.intersectsObject(a)){if(h===l){var b=new THREE.RenderableObject;k.push(b);l++;h++;g=b}else g=k[h++];g.id=a.id;g.object=a;null!==a.renderDepth?g.z=a.renderDepth:(O.setFromMatrixPosition(a.matrixWorld),O.applyProjection(B),g.z=O.z);K.objects.push(g)}}); +!0===w&&K.objects.sort(e);n=0;for(w=K.objects.length;nva;va++)s.uvs[va].copy(ua[va]); +s.color=ca.color;s.material=qa;s.z=(la.positionScreen.z+ja.positionScreen.z+Fa.positionScreen.z)/3;K.elements.push(s)}}}}}else if(A instanceof THREE.Line)if(x instanceof THREE.BufferGeometry){if(z=x.attributes,void 0!==z.position){G=z.position.array;x=0;for(y=G.length;x=J.z&&(C=d(),C.id=A.id,C.x=J.x*x,C.y=J.y*x,C.z=J.z,C.object=A,C.rotation=A.rotation,C.scale.x=A.scale.x*Math.abs(C.x-(J.x+t.projectionMatrix.elements[0])/(J.w+t.projectionMatrix.elements[12])),C.scale.y=A.scale.y*Math.abs(C.y-(J.y+t.projectionMatrix.elements[5])/ +(J.w+t.projectionMatrix.elements[13])),C.material=A.material,K.elements.push(C)))}!0===v&&K.elements.sort(e);return K}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0}; +THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.materialIndex=this.materialIndex;for(var b=0,c=this.vertexNormals.length;bb.max.x&&(b.max.x=e);fb.max.y&& +(b.max.y=f);gb.max.z&&(b.max.z=g)}}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')},computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&& +(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;eBa?-1:1;h[4*a]=Ea.x;h[4*a+1]=Ea.y;h[4*a+2]=Ea.z;h[4*a+3]=Pa}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent= +{itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;np;p++)s=a[3*c+p],-1==r[s]?(q[2*p]=s,q[2*p+1]=-1,n++):r[s]k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)p=q[n+1],-1n;n+=2)s=q[n],p=q[n+1],-1===p&&(p=g++),r[s]=p,t[p]=s,e[f++]=p-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},normalizeNormals:function(){for(var a=this.attributes.normal.array, +b,c,d,e=0,f=a.length;ed?-1:1,e.vertexTangents[c]=new THREE.Vector4(A.x,A.y,A.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;cd;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;cc&&(h[f].counter+=1,g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:f,vertices:0,numMorphTargets:l,numMorphNormals:n},this.geometryGroups[g]=k,this.geometryGroupsList.push(k))),this.geometryGroups[g].faces3.push(d),this.geometryGroups[g].vertices+=3}}(),clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;ca.opacity)h.transparent=a.transparent;void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);void 0!==a.vertexColors&&("face"=== +a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorAmbient&&(h.ambient=e(a.colorAmbient));a.colorEmissive&&(h.emissive=e(a.colorEmissive));a.transparency&&(h.opacity=a.transparency);a.specularCoef&&(h.shininess=a.specularCoef);a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap, +a.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&d(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy);a.mapAlpha&& +b&&d(h,"alphaMap",a.mapAlpha,a.mapAlphaRepeat,a.mapAlphaOffset,a.mapAlphaWrap,a.mapAlphaAnisotropy);a.mapBumpScale&&(h.bumpScale=a.mapBumpScale);a.mapNormal?(g=THREE.ShaderLib.normalmap,k=THREE.UniformsUtils.clone(g.uniforms),k.tNormal.value=h.normalMap,a.mapNormalFactor&&k.uNormalScale.value.set(a.mapNormalFactor,a.mapNormalFactor),h.map&&(k.tDiffuse.value=h.map,k.enableDiffuse.value=!0),h.specularMap&&(k.tSpecular.value=h.specularMap,k.enableSpecular.value=!0),h.lightMap&&(k.tAO.value=h.lightMap, +k.enableAO.value=!0),k.diffuse.value.setHex(h.color),k.specular.value.setHex(h.specular),k.ambient.value.setHex(h.ambient),k.shininess.value=h.shininess,void 0!==h.opacity&&(k.opacity.value=h.opacity),g=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:k,lights:!0,fog:!0}),h.transparent&&(g.transparent=!0)):g=new THREE[g](h);void 0!==a.DbgName&&(g.name=a.DbgName);return g}}; +THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;bg;g++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],t.normal.set(D[q++],D[q++],D[q]),p.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*u[k++],s=new THREE.Vector3(D[q++], +D[q++],D[q]),2!==d&&t.vertexNormals.push(s),0!==d&&p.vertexNormals.push(s);n&&(n=u[k++],n=A[n],t.color.setHex(n),p.color.setHex(n));if(b)for(d=0;4>d;d++)n=u[k++],n=A[n],2!==d&&t.vertexColors.push(new THREE.Color(n)),0!==d&&p.vertexColors.push(new THREE.Color(n));c.faces.push(t);c.faces.push(p)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;dg;g++)r=u[k++],w=v[2*r],r=v[2*r+1], +w=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],t.normal.set(D[q++],D[q++],D[q]));if(s)for(d=0;3>d;d++)q=3*u[k++],s=new THREE.Vector3(D[q++],D[q++],D[q]),t.vertexNormals.push(s);n&&(n=u[k++],t.color.setHex(A[n]));if(b)for(d=0;3>d;d++)n=u[k++],t.vertexColors.push(new THREE.Color(A[n]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;df)){var r=b.origin.distanceTo(l);rd.far||e.push({distance:r,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.type));THREE.Object3D.prototype.clone.call(this,a);return a}; +THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype); +THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0g.far||h.push({distance:C,point:x,indices:[n,q,r],face:null,faceIndex:null,object:this})}}}else for(p=n.position.array,s=k=0,A=p.length;kg.far||h.push({distance:C,point:x,indices:[n,q,r],face:null,faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,p=!0===s?this.material.materials:null,t=g.precision,v=k.vertices,w=0,u=k.faces.length;wg.far||h.push({distance:C,point:x,face:D,faceIndex:w,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype); +THREE.Bone.prototype.updateMatrixWorld=function(a){THREE.Object3D.prototype.updateMatrixWorld.call(this,a);this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0}; +THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256h.end&&(h.end=e);b||(b=g)}}a.firstAnimation=b}; +THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={});this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1E3,this.time=0):console.warn("animation["+a+"] undefined")}; +THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||0>this.time)this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)}else this.time%=this.duration,0>this.time&&(this.time+=this.duration);a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1);a!==this.currentKeyframe&& +(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a);b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b}; +THREE.MorphAnimMesh.prototype.interpolateTargets=function(a,b,c){for(var d=this.morphTargetInfluences,e=0,f=d.length;e=this.objects[d].distance)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;else break;for(;dthis.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.updateMatrix=function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0}; +THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Particle=THREE.Sprite;THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1;this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype); +THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)){this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}this.dispatchEvent({type:"objectAdded",object:a});a.dispatchEvent({type:"addedToScene",scene:this});for(b=0;bE&&O.clearRect(aa.min.x|0,aa.min.y|0,aa.max.x-aa.min.x|0,aa.max.y-aa.min.y|0),0$.positionScreen.z||1<$.positionScreen.z)continue;if(-1>X.positionScreen.z||1T.positionScreen.z||1=S||(S*=V.intensity,R.add(Za.multiplyScalar(S)))):V instanceof THREE.PointLight&&(da=Ga.setFromMatrixPosition(V.matrixWorld),S=ea.dot(Ga.subVectors(da,H).normalize()),0>=S||(S*=0==V.distance?1:1-Math.min(H.distanceTo(da)/V.distance,1),0!=S&&(S*=V.intensity,R.add(Za.multiplyScalar(S)))));G.multiply(Ba).add(Ya);!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(G)}else E instanceof THREE.MeshBasicMaterial||E instanceof THREE.MeshLambertMaterial||E instanceof +THREE.MeshPhongMaterial?null!==E.map?E.map.mapping instanceof THREE.UVMapping&&(ca=J.uvs,f(ya,Ea,Aa,za,Oa,Pa,ca[0].x,ca[0].y,ca[1].x,ca[1].y,ca[2].x,ca[2].y,E.map)):null!==E.envMap?E.envMap.mapping instanceof THREE.SphericalReflectionMapping?(ma.copy(J.vertexNormalsModel[0]).applyMatrix3(Ja),la=0.5*ma.x+0.5,qa=0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[1]).applyMatrix3(Ja),ua=0.5*ma.x+0.5,ja=0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[2]).applyMatrix3(Ja),Fa=0.5*ma.x+0.5,va=0.5*ma.y+0.5,f(ya,Ea,Aa,za, +Oa,Pa,la,qa,ua,ja,Fa,va,E.envMap)):E.envMap.mapping instanceof THREE.SphericalRefractionMapping&&(ma.copy(J.vertexNormalsModel[0]).applyMatrix3(Ja),la=-0.5*ma.x+0.5,qa=-0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[1]).applyMatrix3(Ja),ua=-0.5*ma.x+0.5,ja=-0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[2]).applyMatrix3(Ja),Fa=-0.5*ma.x+0.5,va=-0.5*ma.y+0.5,f(ya,Ea,Aa,za,Oa,Pa,la,qa,ua,ja,Fa,va,E.envMap)):(G.copy(E.color),E.vertexColors===THREE.FaceColors&&G.multiply(J.color),!0===E.wireframe?b(G,E.wireframeLinewidth, +E.wireframeLinecap,E.wireframeLinejoin):c(G)):(E instanceof THREE.MeshDepthMaterial?G.r=G.g=G.b=1-p(H.positionScreen.z*H.positionScreen.w,oa.near,oa.far):E instanceof THREE.MeshNormalMaterial?(ma.copy(J.normalModel).applyMatrix3(Ja),G.setRGB(ma.x,ma.y,ma.z).multiplyScalar(0.5).addScalar(0.5)):G.setRGB(1,1,1),!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(G))}}aa.union(ra)}}O.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={}; +THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n\tif ( gl_FragColor.a < ALPHATEST ) discard;\n\n#endif\n";THREE.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n\tvec3 dirVector = normalize( lDirection.xyz );\n\n\tfloat dotProduct = dot( transformedNormal, dirVector );\n\tvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t#endif\n\n\t#endif\n\n\t#ifdef WRAP_AROUND\n\n\t\tvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\tdirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tdirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n\t\t#endif\n\n\t#endif\n\n\tvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n\t#endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat lDistance = 1.0;\n\t\tif ( pointLightDistance[ i ] > 0.0 )\n\t\t\tlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\n\n\t\tlVector = normalize( lVector );\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\tpointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tpointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\tvLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\tfloat lDistance = 1.0;\n\t\t\tif ( spotLightDistance[ i ] > 0.0 )\n\t\t\t\tlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\n\n\t\t\tlVector = normalize( lVector );\n\n\t\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\t\t\tvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\t\tvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\t\tspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n\t\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\t\tspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvLightFront += spotLightColor[ i ] * spotLightWeighting * lDistance * spotEffect;\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvLightBack += spotLightColor[ i ] * spotLightWeightingBack * lDistance * spotEffect;\n\n\t\t\t#endif\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n\t\tvec3 lVector = normalize( lDirection.xyz );\n\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\tfloat hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n\t\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n\t\t#endif\n\n\t}\n\n#endif\n\nvLightFront = vLightFront * diffuse + ambient * ambientLightColor + emissive;\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vLightBack * diffuse + ambient * ambientLightColor + emissive;\n\n#endif"; +THREE.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif";THREE.ShaderChunk.default_vertex="vec4 mvPosition;\n\n#ifdef USE_SKINNING\n\n\tmvPosition = modelViewMatrix * skinned;\n\n#endif\n\n#if !defined( USE_SKINNING ) && defined( USE_MORPHTARGETS )\n\n\tmvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#endif\n\n#if !defined( USE_SKINNING ) && ! defined( USE_MORPHTARGETS )\n\n\tmvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;"; +THREE.ShaderChunk.map_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif";THREE.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\t#ifdef USE_MORPHNORMALS\n\n\tvec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n\t#else\n\n\tvec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n\t#endif\n\n#endif\n"; +THREE.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n\tuniform float logDepthBufFC;\n\n#endif";THREE.ShaderChunk.lightmap_pars_vertex="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\n#endif";THREE.ShaderChunk.lights_phong_fragment="vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef DOUBLE_SIDED\n\n\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n#endif\n\n#ifdef USE_NORMALMAP\n\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tvec3 pointDiffuse = vec3( 0.0 );\n\tvec3 pointSpecular = vec3( 0.0 );\n\n\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat lDistance = 1.0;\n\t\tif ( pointLightDistance[ i ] > 0.0 )\n\t\t\tlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\n\n\t\tlVector = normalize( lVector );\n\n\t\t\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat pointDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\tpointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * lDistance;\n\n\t\t\t\t// specular\n\n\t\tvec3 pointHalfVector = normalize( lVector + viewPosition );\n\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\tfloat pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\tpointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance * specularNormalization;\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tvec3 spotDiffuse = vec3( 0.0 );\n\tvec3 spotSpecular = vec3( 0.0 );\n\n\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat lDistance = 1.0;\n\t\tif ( spotLightDistance[ i ] > 0.0 )\n\t\t\tlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\n\n\t\tlVector = normalize( lVector );\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\t\t\t// diffuse\n\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n\t\t\t#else\n\n\t\t\t\tfloat spotDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t\t#endif\n\n\t\t\tspotDiffuse += diffuse * spotLightColor[ i ] * spotDiffuseWeight * lDistance * spotEffect;\n\n\t\t\t\t\t// specular\n\n\t\t\tvec3 spotHalfVector = normalize( lVector + viewPosition );\n\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\tfloat spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\tspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * specularNormalization * spotEffect;\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n\tvec3 dirDiffuse = vec3( 0.0 );\n\tvec3 dirSpecular = vec3( 0.0 );\n\n\tfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\t\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n\t\tvec3 dirVector = normalize( lDirection.xyz );\n\n\t\t\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, dirVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat dirDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\tdirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\n\n\t\t// specular\n\n\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\tfloat dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n\t\t/*\n\t\t// fresnel term from skin shader\n\t\tconst float F0 = 0.128;\n\n\t\tfloat base = 1.0 - dot( viewPosition, dirHalfVector );\n\t\tfloat exponential = pow( base, 5.0 );\n\n\t\tfloat fresnel = exponential + F0 * ( 1.0 - exponential );\n\t\t*/\n\n\t\t/*\n\t\t// fresnel term from fresnel shader\n\t\tconst float mFresnelBias = 0.08;\n\t\tconst float mFresnelScale = 0.3;\n\t\tconst float mFresnelPower = 5.0;\n\n\t\tfloat fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n\t\t*/\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t// \t\tdirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\tdirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tvec3 hemiDiffuse = vec3( 0.0 );\n\tvec3 hemiSpecular = vec3( 0.0 );\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n\t\tvec3 lVector = normalize( lDirection.xyz );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\themiDiffuse += diffuse * hemiColor;\n\n\t\t// specular (sky light)\n\n\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\tfloat hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n\t\t// specular (ground light)\n\n\t\tvec3 lVectorGround = -lVector;\n\n\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\tfloat hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\themiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n\t}\n\n#endif\n\nvec3 totalDiffuse = vec3( 0.0 );\nvec3 totalSpecular = vec3( 0.0 );\n\n#if MAX_DIR_LIGHTS > 0\n\n\ttotalDiffuse += dirDiffuse;\n\ttotalSpecular += dirSpecular;\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\ttotalDiffuse += hemiDiffuse;\n\ttotalSpecular += hemiSpecular;\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\ttotalDiffuse += pointDiffuse;\n\ttotalSpecular += pointSpecular;\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\ttotalDiffuse += spotDiffuse;\n\ttotalSpecular += spotSpecular;\n\n#endif\n\n#ifdef METAL\n\n\tgl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient + totalSpecular );\n\n#else\n\n\tgl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\n\n#endif"; +THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n\n#endif";THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n\tvec3 morphedNormal = vec3( 0.0 );\n\n\tmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n\tmorphedNormal += normal;\n\n#endif"; +THREE.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\tuniform samplerCube envMap;\n\tuniform float flipEnvMap;\n\tuniform int combine;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\n\t\tuniform bool useRefract;\n\t\tuniform float refractionRatio;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif"; +THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n\t\t\t// Per-Pixel Tangent Space Normal Mapping\n\t\t\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n"; +THREE.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n";THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\tuniform sampler2D lightMap;\n\n#endif";THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n\t}\n\n#endif"; +THREE.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif";THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\t#ifdef GAMMA_INPUT\n\n\t\ttexelColor.xyz *= texelColor.xyz;\n\n\t#endif\n\n\tgl_FragColor = gl_FragColor * texelColor;\n\n#endif";THREE.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n\tvUv2 = uv2;\n\n#endif"; +THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n\tgl_FragColor = gl_FragColor * texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) );\n\n#endif";THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n";THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n\t#ifdef GAMMA_INPUT\n\n\t\tvColor = color * color;\n\n\t#else\n\n\t\tvColor = color;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n\t#ifdef USE_MORPHTARGETS\n\n\tvec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n\n#endif\n"; +THREE.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\n\tvarying vec3 vReflect;\n\n\tuniform float refractionRatio;\n\tuniform bool useRefract;\n\n#endif\n";THREE.ShaderChunk.linear_to_gamma_fragment="#ifdef GAMMA_OUTPUT\n\n\tgl_FragColor.xyz = sqrt( gl_FragColor.xyz );\n\n#endif";THREE.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif";THREE.ShaderChunk.lights_lambert_pars_vertex="uniform vec3 ambient;\nuniform vec3 diffuse;\nuniform vec3 emissive;\n\nuniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n"; +THREE.ShaderChunk.map_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n\n#endif\n";THREE.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n\tvec3 reflectVec;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n\t\t// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\n\t\tvec3 worldNormal = normalize( vec3( vec4( normal, 0.0 ) * viewMatrix ) );\n\n\t\tif ( useRefract ) {\n\n\t\t\treflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t} else { \n\n\t\t\treflectVec = reflect( cameraToVertex, worldNormal );\n\n\t\t}\n\n\t#else\n\n\t\treflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t\tvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#else\n\n\t\tvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#endif\n\n\t#ifdef GAMMA_INPUT\n\n\t\tcubeColor.xyz *= cubeColor.xyz;\n\n\t#endif\n\n\tif ( combine == 1 ) {\n\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n\n\t} else if ( combine == 2 ) {\n\n\t\tgl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n\n\t} else {\n\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n\n\t}\n\n#endif"; +THREE.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif";THREE.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n\tgl_Position.z = log2(max(1e-6, gl_Position.w + 1.0)) * logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif"; +THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif";THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n\t#else\n\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\n\t#endif\n\n\t#ifdef FOG_EXP2\n\n\t\tconst float LOG2 = 1.442695;\n\t\tfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\n\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\n\t#endif\n\t\n\tgl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n\n#endif"; +THREE.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t\t\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n\t\t\t//\thttp://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n\t\t\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif"; +THREE.ShaderChunk.defaultnormal_vertex="vec3 objectNormal;\n\n#ifdef USE_SKINNING\n\n\tobjectNormal = skinnedNormal.xyz;\n\n#endif\n\n#if !defined( USE_SKINNING ) && defined( USE_MORPHNORMALS )\n\n\tobjectNormal = morphedNormal;\n\n#endif\n\n#if !defined( USE_SKINNING ) && ! defined( USE_MORPHNORMALS )\n\n\tobjectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n\tobjectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;"; +THREE.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;"; +THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif";THREE.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif"; +THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n\tgl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );\n\n#endif";THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif";THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n\tgl_FragColor = gl_FragColor * vec4( vColor, 1.0 );\n\n#endif";THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n\tvec3 morphed = vec3( 0.0 );\n\tmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\tmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\tmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\tmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\tmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\tmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\tmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\tmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n\tmorphed += position;\n\n#endif"; +THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\n\tvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\n\tworldNormal = normalize( worldNormal );\n\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\tif ( useRefract ) {\n\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t} else {\n\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t}\n\n#endif"; +THREE.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n\t#ifdef SHADOWMAP_DEBUG\n\n\t\tvec3 frustumColors[3];\n\t\tfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n\t\tfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n\t\tfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n\t#endif\n\n\t#ifdef SHADOWMAP_CASCADE\n\n\t\tint inFrustumCount = 0;\n\n\t#endif\n\n\tfloat fDepth;\n\tvec3 shadowColor = vec3( 1.0 );\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\t\t\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t\t\t// if ( all( something, something ) ) using this instead\n\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\n\t\t\t\t// don't shadow pixels outside of light frustum\n\t\t\t\t// use just first frustum (for cascades)\n\t\t\t\t// don't shadow pixels behind far plane of light frustum\n\n\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\tinFrustumCount += int( inFrustum );\n\t\t\tbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n\t\t#else\n\n\t\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\t#endif\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t/*\n\t\t\t\t\t\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n\t\t\t\t\t\t// must enroll loop manually\n\n\t\t\t\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\n\t\t\t\t\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n\t\t\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n\t\t\t\t\t\t\t\t// doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n\t\t\t\t\t\t\t\t//vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n\t\t\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\t\t\tif ( fDepth < shadowCoord.z )\n\t\t\t\t\t\t\tshadow += 1.0;\n\n\t\t\t\t}\n\n\t\t\t\tshadow /= 9.0;\n\n\t\t*/\n\n\t\t\t\tconst float shadowDelta = 1.0 / 9.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.25 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.25 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.25 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.25 * yPixelOffset;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.0 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.0 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.0 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.0 * yPixelOffset;\n\n\t\t\t\tmat3 shadowKernel;\n\t\t\t\tmat3 depthKernel;\n\n\t\t\t\tdepthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tdepthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tdepthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tdepthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tdepthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tdepthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tdepthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tdepthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tdepthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n\t\t\t\tvec3 shadowZ = vec3( shadowCoord.z );\n\t\t\t\tshadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n\t\t\t\tshadowKernel[0] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n\t\t\t\tshadowKernel[1] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n\t\t\t\tshadowKernel[2] *= vec3(0.25);\n\n\t\t\t\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n\t\t\t\tshadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n\t\t\t\tshadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n\t\t\t\tvec4 shadowValues;\n\t\t\t\tshadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n\t\t\t\tshadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n\t\t\t\tshadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n\t\t\t\tshadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n\t\t\t\tshadow = dot( shadowValues, vec4( 1.0 ) );\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#else\n\n\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\tif ( fDepth < shadowCoord.z )\n\n\t\t// spot with multiple shadows is darker\n\n\t\t\t\t\tshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n\t\t// spot with multiple shadows has the same color as single shadow spot\n\n\t\t// \t\t\t\t\tshadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n\t\t\t#endif\n\n\t\t}\n\n\n\t\t#ifdef SHADOWMAP_DEBUG\n\n\t\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\t\tif ( inFrustum && inFrustumCount == 1 ) gl_FragColor.xyz *= frustumColors[ i ];\n\n\t\t\t#else\n\n\t\t\t\tif ( inFrustum ) gl_FragColor.xyz *= frustumColors[ i ];\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t}\n\n\t#ifdef GAMMA_OUTPUT\n\n\t\tshadowColor *= shadowColor;\n\n\t#endif\n\n\tgl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\n\n#endif\n"; +THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n\t#ifdef USE_SKINNING\n\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\n\t#endif\n\n\t#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n\t#endif\n\n\t#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n#endif"; +THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n#endif"; +THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n"; +THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\t#extension GL_EXT_frag_depth : enable\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n\tgl_FragColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n";THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n"; +THREE.UniformsUtils={merge:function(a){var b,c,d,e={};for(b=0;b dashSize ) {\n\t\tdiscard;\n\t}\n\tgl_FragColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.fog_fragment, +"}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2E3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment, +"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvNormal = normalize( normalMatrix * normal );", +THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},normalmap:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{enableAO:{type:"i", +value:0},enableDiffuse:{type:"i",value:0},enableSpecular:{type:"i",value:0},enableReflection:{type:"i",value:0},enableDisplacement:{type:"i",value:0},tDisplacement:{type:"t",value:null},tDiffuse:{type:"t",value:null},tCube:{type:"t",value:null},tNormal:{type:"t",value:null},tSpecular:{type:"t",value:null},tAO:{type:"t",value:null},uNormalScale:{type:"v2",value:new THREE.Vector2(1,1)},uDisplacementBias:{type:"f",value:0},uDisplacementScale:{type:"f",value:1},diffuse:{type:"c",value:new THREE.Color(16777215)}, +specular:{type:"c",value:new THREE.Color(1118481)},ambient:{type:"c",value:new THREE.Color(16777215)},shininess:{type:"f",value:30},opacity:{type:"f",value:1},useRefract:{type:"i",value:0},refractionRatio:{type:"f",value:0.98},reflectivity:{type:"f",value:0.5},uOffset:{type:"v2",value:new THREE.Vector2(0,0)},uRepeat:{type:"v2",value:new THREE.Vector2(1,1)},wrapRGB:{type:"v3",value:new THREE.Vector3(1,1,1)}}]),fragmentShader:["uniform vec3 ambient;\nuniform vec3 diffuse;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\nuniform bool enableDiffuse;\nuniform bool enableSpecular;\nuniform bool enableAO;\nuniform bool enableReflection;\nuniform sampler2D tDiffuse;\nuniform sampler2D tNormal;\nuniform sampler2D tSpecular;\nuniform sampler2D tAO;\nuniform samplerCube tCube;\nuniform vec2 uNormalScale;\nuniform bool useRefract;\nuniform float refractionRatio;\nuniform float reflectivity;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nuniform vec3 ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_HEMI_LIGHTS > 0\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#endif\n#if MAX_SPOT_LIGHTS > 0\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n#endif\n#ifdef WRAP_AROUND\n\tuniform vec3 wrapRGB;\n#endif\nvarying vec3 vWorldPosition;\nvarying vec3 vViewPosition;", +THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\tgl_FragColor = vec4( vec3( 1.0 ), opacity );\n\tvec3 specularTex = vec3( 1.0 );\n\tvec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\n\tnormalTex.xy *= uNormalScale;\n\tnormalTex = normalize( normalTex );\n\tif( enableDiffuse ) {\n\t\t#ifdef GAMMA_INPUT\n\t\t\tvec4 texelColor = texture2D( tDiffuse, vUv );\n\t\t\ttexelColor.xyz *= texelColor.xyz;\n\t\t\tgl_FragColor = gl_FragColor * texelColor;\n\t\t#else\n\t\t\tgl_FragColor = gl_FragColor * texture2D( tDiffuse, vUv );\n\t\t#endif\n\t}\n\tif( enableAO ) {\n\t\t#ifdef GAMMA_INPUT\n\t\t\tvec4 aoColor = texture2D( tAO, vUv );\n\t\t\taoColor.xyz *= aoColor.xyz;\n\t\t\tgl_FragColor.xyz = gl_FragColor.xyz * aoColor.xyz;\n\t\t#else\n\t\t\tgl_FragColor.xyz = gl_FragColor.xyz * texture2D( tAO, vUv ).xyz;\n\t\t#endif\n\t}", +THREE.ShaderChunk.alphatest_fragment,"\tif( enableSpecular )\n\t\tspecularTex = texture2D( tSpecular, vUv ).xyz;\n\tmat3 tsb = mat3( normalize( vTangent ), normalize( vBinormal ), normalize( vNormal ) );\n\tvec3 finalNormal = tsb * normalTex;\n\t#ifdef FLIP_SIDED\n\t\tfinalNormal = -finalNormal;\n\t#endif\n\tvec3 normal = normalize( finalNormal );\n\tvec3 viewPosition = normalize( vViewPosition );\n\t#if MAX_POINT_LIGHTS > 0\n\t\tvec3 pointDiffuse = vec3( 0.0 );\n\t\tvec3 pointSpecular = vec3( 0.0 );\n\t\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\t\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\t\tvec3 pointVector = lPosition.xyz + vViewPosition.xyz;\n\t\t\tfloat pointDistance = 1.0;\n\t\t\tif ( pointLightDistance[ i ] > 0.0 )\n\t\t\t\tpointDistance = 1.0 - min( ( length( pointVector ) / pointLightDistance[ i ] ), 1.0 );\n\t\t\tpointVector = normalize( pointVector );\n\t\t\t#ifdef WRAP_AROUND\n\t\t\t\tfloat pointDiffuseWeightFull = max( dot( normal, pointVector ), 0.0 );\n\t\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dot( normal, pointVector ) + 0.5, 0.0 );\n\t\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\t\t\t#else\n\t\t\t\tfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\n\t\t\t#endif\n\t\t\tpointDiffuse += pointDistance * pointLightColor[ i ] * diffuse * pointDiffuseWeight;\n\t\t\tvec3 pointHalfVector = normalize( pointVector + viewPosition );\n\t\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\t\tfloat pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( pointVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\t\tpointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance * specularNormalization;\n\t\t}\n\t#endif\n\t#if MAX_SPOT_LIGHTS > 0\n\t\tvec3 spotDiffuse = vec3( 0.0 );\n\t\tvec3 spotSpecular = vec3( 0.0 );\n\t\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\t\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\t\tvec3 spotVector = lPosition.xyz + vViewPosition.xyz;\n\t\t\tfloat spotDistance = 1.0;\n\t\t\tif ( spotLightDistance[ i ] > 0.0 )\n\t\t\t\tspotDistance = 1.0 - min( ( length( spotVector ) / spotLightDistance[ i ] ), 1.0 );\n\t\t\tspotVector = normalize( spotVector );\n\t\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\t\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\t\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\t\t\t\t#ifdef WRAP_AROUND\n\t\t\t\t\tfloat spotDiffuseWeightFull = max( dot( normal, spotVector ), 0.0 );\n\t\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dot( normal, spotVector ) + 0.5, 0.0 );\n\t\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\t\t\t\t#else\n\t\t\t\t\tfloat spotDiffuseWeight = max( dot( normal, spotVector ), 0.0 );\n\t\t\t\t#endif\n\t\t\t\tspotDiffuse += spotDistance * spotLightColor[ i ] * diffuse * spotDiffuseWeight * spotEffect;\n\t\t\t\tvec3 spotHalfVector = normalize( spotVector + viewPosition );\n\t\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\t\tfloat spotSpecularWeight = specularTex.r * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\t\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( spotVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\t\tspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * spotDistance * specularNormalization * spotEffect;\n\t\t\t}\n\t\t}\n\t#endif\n\t#if MAX_DIR_LIGHTS > 0\n\t\tvec3 dirDiffuse = vec3( 0.0 );\n\t\tvec3 dirSpecular = vec3( 0.0 );\n\t\tfor( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\n\t\t\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n\t\t\tvec3 dirVector = normalize( lDirection.xyz );\n\t\t\t#ifdef WRAP_AROUND\n\t\t\t\tfloat directionalLightWeightingFull = max( dot( normal, dirVector ), 0.0 );\n\t\t\t\tfloat directionalLightWeightingHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );\n\t\t\t\tvec3 dirDiffuseWeight = mix( vec3( directionalLightWeightingFull ), vec3( directionalLightWeightingHalf ), wrapRGB );\n\t\t\t#else\n\t\t\t\tfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\n\t\t\t#endif\n\t\t\tdirDiffuse += directionalLightColor[ i ] * diffuse * dirDiffuseWeight;\n\t\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\t\tfloat dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\t\tdirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\t\t}\n\t#endif\n\t#if MAX_HEMI_LIGHTS > 0\n\t\tvec3 hemiDiffuse = vec3( 0.0 );\n\t\tvec3 hemiSpecular = vec3( 0.0 );\n\t\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\t\t\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n\t\t\tvec3 lVector = normalize( lDirection.xyz );\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\t\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\t\t\themiDiffuse += diffuse * hemiColor;\n\t\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\t\tfloat hemiSpecularWeightSky = specularTex.r * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\t\t\tvec3 lVectorGround = -lVector;\n\t\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\t\tfloat hemiSpecularWeightGround = specularTex.r * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\t\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\t\themiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\t\t}\n\t#endif\n\tvec3 totalDiffuse = vec3( 0.0 );\n\tvec3 totalSpecular = vec3( 0.0 );\n\t#if MAX_DIR_LIGHTS > 0\n\t\ttotalDiffuse += dirDiffuse;\n\t\ttotalSpecular += dirSpecular;\n\t#endif\n\t#if MAX_HEMI_LIGHTS > 0\n\t\ttotalDiffuse += hemiDiffuse;\n\t\ttotalSpecular += hemiSpecular;\n\t#endif\n\t#if MAX_POINT_LIGHTS > 0\n\t\ttotalDiffuse += pointDiffuse;\n\t\ttotalSpecular += pointSpecular;\n\t#endif\n\t#if MAX_SPOT_LIGHTS > 0\n\t\ttotalDiffuse += spotDiffuse;\n\t\ttotalSpecular += spotSpecular;\n\t#endif\n\t#ifdef METAL\n\t\tgl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient + totalSpecular );\n\t#else\n\t\tgl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\n\t#endif\n\tif ( enableReflection ) {\n\t\tvec3 vReflect;\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tif ( useRefract ) {\n\t\t\tvReflect = refract( cameraToVertex, normal, refractionRatio );\n\t\t} else {\n\t\t\tvReflect = reflect( cameraToVertex, normal );\n\t\t}\n\t\tvec4 cubeColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\n\t\t#ifdef GAMMA_INPUT\n\t\t\tcubeColor.xyz *= cubeColor.xyz;\n\t\t#endif\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularTex.r * reflectivity );\n\t}", +THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["attribute vec4 tangent;\nuniform vec2 uOffset;\nuniform vec2 uRepeat;\nuniform bool enableDisplacement;\n#ifdef VERTEX_TEXTURES\n\tuniform sampler2D tDisplacement;\n\tuniform float uDisplacementScale;\n\tuniform float uDisplacementBias;\n#endif\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 vViewPosition;", +THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,"\t#ifdef USE_SKINNING\n\t\tvNormal = normalize( normalMatrix * skinnedNormal.xyz );\n\t\tvec4 skinnedTangent = skinMatrix * vec4( tangent.xyz, 0.0 );\n\t\tvTangent = normalize( normalMatrix * skinnedTangent.xyz );\n\t#else\n\t\tvNormal = normalize( normalMatrix * normal );\n\t\tvTangent = normalize( normalMatrix * tangent.xyz );\n\t#endif\n\tvBinormal = normalize( cross( vNormal, vTangent ) * tangent.w );\n\tvUv = uv * uRepeat + uOffset;\n\tvec3 displacedPosition;\n\t#ifdef VERTEX_TEXTURES\n\t\tif ( enableDisplacement ) {\n\t\t\tvec3 dv = texture2D( tDisplacement, uv ).xyz;\n\t\t\tfloat df = uDisplacementScale * dv.x + uDisplacementBias;\n\t\t\tdisplacedPosition = position + normalize( normal ) * df;\n\t\t} else {\n\t\t\t#ifdef USE_SKINNING\n\t\t\t\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\t\t\t\tvec4 skinned = vec4( 0.0 );\n\t\t\t\tskinned += boneMatX * skinVertex * skinWeight.x;\n\t\t\t\tskinned += boneMatY * skinVertex * skinWeight.y;\n\t\t\t\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\t\t\t\tskinned += boneMatW * skinVertex * skinWeight.w;\n\t\t\t\tskinned = bindMatrixInverse * skinned;\n\t\t\t\tdisplacedPosition = skinned.xyz;\n\t\t\t#else\n\t\t\t\tdisplacedPosition = position;\n\t\t\t#endif\n\t\t}\n\t#else\n\t\t#ifdef USE_SKINNING\n\t\t\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\t\t\tvec4 skinned = vec4( 0.0 );\n\t\t\tskinned += boneMatX * skinVertex * skinWeight.x;\n\t\t\tskinned += boneMatY * skinVertex * skinWeight.y;\n\t\t\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\t\t\tskinned += boneMatW * skinVertex * skinWeight.w;\n\t\t\tskinned = bindMatrixInverse * skinned;\n\t\t\tdisplacedPosition = skinned.xyz;\n\t\t#else\n\t\t\tdisplacedPosition = position;\n\t\t#endif\n\t#endif\n\tvec4 mvPosition = modelViewMatrix * vec4( displacedPosition, 1.0 );\n\tvec4 worldPosition = modelMatrix * vec4( displacedPosition, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;", +THREE.ShaderChunk.logdepthbuf_vertex,"\tvWorldPosition = worldPosition.xyz;\n\tvViewPosition = -mvPosition.xyz;\n\t#ifdef USE_SHADOWMAP\n\t\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\t\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\t\t}\n\t#endif\n}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\tvWorldPosition = worldPosition.xyz;\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", +THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex, +"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {", +THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}}; +THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var e in d.attributes){var f=d.attributes[e];if(!f.__webglInitialized||f.createUniqueBuffers){f.__webglInitialized=!0;var g=1;"v2"===f.type?g=2:"v3"===f.type?g=3:"v4"===f.type?g=4:"c"===f.type&&(g=3);f.size=g;f.array=new Float32Array(c*g);f.buffer=m.createBuffer();f.buffer.belongsToAttribute=e;f.needsUpdate=!0}a.__webglCustomAttributesList.push(f)}}} +function c(a,b){var c=b.geometry,g=a.faces3,h=3*g.length,k=1*g.length,l=3*g.length,g=d(b,a),n=f(g),r=e(g),p=g.vertexColors?g.vertexColors:!1;a.__vertexArray=new Float32Array(3*h);r&&(a.__normalArray=new Float32Array(3*h));c.hasTangents&&(a.__tangentArray=new Float32Array(4*h));p&&(a.__colorArray=new Float32Array(3*h));n&&(0ja;ja++)Da=R[ja], +yb[gb]=Da.x,yb[gb+1]=Da.y,yb[gb+2]=Da.z,gb+=3;else for(ja=0;3>ja;ja++)yb[gb]=ba.x,yb[gb+1]=ba.y,yb[gb+2]=ba.z,gb+=3;m.bindBuffer(m.ARRAY_BUFFER,y.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,yb,I)}if(xb&&Hb&&Q){B=0;for(N=ka.length;Bja;ja++)Ga=V[ja],cb[Sa]=Ga.x,cb[Sa+1]=Ga.y,Sa+=2;0ja;ja++)Ya=za[ja],fb[Za]=Ya.x,fb[Za+1]=Ya.y,Za+=2;0c;c++)G.autoScaleCubemaps&&!U?(g=h,f=c,r=a.image[c],u=sc,r.width<=u&&r.height<=u||(v=Math.max(r.width,r.height),q=Math.floor(r.width*u/v),u=Math.floor(r.height*u/v),v=document.createElement("canvas"),v.width=q,v.height=u,v.getContext("2d").drawImage(r,0,0,r.width,r.height,0,0,q,u),r=v),g[f]=r):h[c]=a.image[c];c=h[0];g=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height); +f=B(a.format);r=B(a.type);E(m.TEXTURE_CUBE_MAP,a,g);for(c=0;6>c;c++)if(U)for(u=h[c].mipmaps,v=0,x=u.length;v=Qb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Qb);qa+=1;return a}function N(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)} +function ba(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function P(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function O(a){a!==xa&&(m.lineWidth(a),xa=a)}function J(a,b,c){Qa!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),Qa=a);!a||cb===b&&Ga===c||(m.polygonOffset(b,c),cb=b,Ga=c)}function E(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,B(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,B(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,B(b.magFilter)),m.texParameteri(a, +m.TEXTURE_MIN_FILTER,B(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,R(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,R(b.minFilter)));Ta&&b.type!==THREE.FloatType&&(1b;b++)m.deleteFramebuffer(a.__webglFramebuffer[b]),m.deleteRenderbuffer(a.__webglRenderbuffer[b]);else m.deleteFramebuffer(a.__webglFramebuffer),m.deleteRenderbuffer(a.__webglRenderbuffer); +G.info.memory.textures--},ic=function(a){a=a.target;a.removeEventListener("dispose",ic);Nb(a)},Tb=function(a){void 0!==a.__webglVertexBuffer&&m.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&m.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&m.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&m.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&m.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&m.deleteBuffer(a.__webglUV2Buffer); +void 0!==a.__webglSkinIndicesBuffer&&m.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&m.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&m.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&m.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&m.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)m.deleteBuffer(a.__webglCustomAttributesList[b].buffer); +G.info.memory.geometries--},Nb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Ba.length;ad.numSupportedMorphTargets?(h.sort(t),h.length=d.numSupportedMorphTargets):h.length>d.numSupportedMorphNormals?h.sort(t):0===h.length&&h.push([0,0]);for(p=0;pf;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer(); +m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);Q(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture), +E(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer): +Q(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=wb,a=sb,d=ma,e=Ja);b!==Za&&(m.bindFramebuffer(m.FRAMEBUFFER,b),m.viewport(d,e,c,a),Za=b);Hb=c;Ib=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin); +this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)}; +THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format: +THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null}; +THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps; +a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype); +THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,l=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var r="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?r="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(r="SHADOWMAP_TYPE_PCF_SOFT");var t,s;t=[];for(var p in g)s=g[p],!1!==s&&(s="#define "+p+" "+s,t.push(s)); +t=t.join("\n");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",t,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+ +e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND": +"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"), +b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",t,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG": +"",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP": +"",e.shadowMapEnabled?"#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));l=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+l);n=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+n);f.attachShader(g,l);f.attachShader(g,n);void 0!==q&&f.bindAttribLocation(g,0,q);f.linkProgram(g);!1===f.getProgramParameter(g,f.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."), +console.error("gl.VALIDATE_STATUS",f.getProgramParameter(g,f.VALIDATE_STATUS)),console.error("gl.getError()",f.getError()));""!==f.getProgramInfoLog(g)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f.getProgramInfoLog(g));f.deleteShader(l);f.deleteShader(n);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")): +q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var v in h)q.push(v);h=q;v={};q=0;for(b=h.length;qq-1?0:q-1,t=q+1>e-1?e-1:q+1,s=0>n-1?0:n-1,p=n+1>d-1?d-1:n+1,v=[],w=[0,0,h[4*(q*d+n)]/255*b];v.push([-1,0,h[4*(q*d+s)]/255*b]);v.push([-1,-1,h[4*(r*d+s)]/255*b]);v.push([0,-1,h[4*(r*d+n)]/255*b]);v.push([1,-1,h[4*(r*d+p)]/255*b]);v.push([1,0,h[4*(q*d+p)]/255*b]);v.push([1,1,h[4*(t*d+p)]/255*b]);v.push([0,1,h[4*(t*d+n)]/255* +b]);v.push([-1,1,h[4*(t*d+s)]/255*b]);r=[];s=v.length;for(t=0;te)return null;var f=[],g=[],h=[],k,l,n;if(0=q--){console.log("Warning, unable to triangulate polygon!");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var r;a:{var t=r=void 0,s=void 0,p=void 0,v=void 0,w=void 0,u=void 0,D=void 0,A= +void 0,t=a[g[k]].x,s=a[g[k]].y,p=a[g[l]].x,v=a[g[l]].y,w=a[g[n]].x,u=a[g[n]].y;if(1E-10>(p-t)*(u-s)-(v-s)*(w-t))r=!1;else{var x=void 0,C=void 0,I=void 0,z=void 0,y=void 0,K=void 0,N=void 0,ba=void 0,P=void 0,O=void 0,P=ba=N=A=D=void 0,x=w-p,C=u-v,I=t-w,z=s-u,y=p-t,K=v-s;for(r=0;rk)g=d+1;else if(0b&&(b=0);1=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]}; +THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;cb?b=h.x:h.xc?c=h.y:h.yd?d=h.z:h.zMath.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c}; +THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;cl&&(g=b[f],k=-k,h=b[e],l=-l),!(a.yh.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<= +h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;bz||z>I)return[];k=l*n-k*q;if(0>k||k>I)return[]}else{if(0d?[]:k==d?f?[]:[g]:a<=d?[g,h]: +[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1; +d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;cO){console.log("Infinite Loop! Holes left:"+ +l.length+", Probably Hole outside Shape!");break}for(q=K;qh;h++)l=k[h].x+":"+k[h].y, +l=n[l],void 0!==l&&(k[h]=l);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a, +b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()}; +THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)}; +THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype); +THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b}; +THREE.SplineCurve=function(a){this.points=void 0==a?[]:a};THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],d=this.points,e;e=(d.length-1)*a;a=Math.floor(e);e-=a;c[0]=0==a?a:a-1;c[1]=a;c[2]=a>d.length-2?d.length-1:a+1;c[3]=a>d.length-3?d.length-1:a+2;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);return b}; +THREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a;this.aY=b;this.xRadius=c;this.yRadius=d;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=g};THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype); +THREE.EllipseCurve.prototype.getPoint=function(a){var b;b=this.aEndAngle-this.aStartAngle;0>b&&(b+=2*Math.PI);b>2*Math.PI&&(b-=2*Math.PI);b=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b;a=this.aX+this.xRadius*Math.cos(b);b=this.aY+this.yRadius*Math.sin(b);return new THREE.Vector2(a,b)};THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)};THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype); +THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.subVectors(this.v2,this.v1);b.multiplyScalar(a);b.add(this.v1);return b});THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b,c;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);c=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);a=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(b,c,a)}); +THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b,c;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);c=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);a=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(b,c,a)}); +THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;a*=d.length-1;e=Math.floor(a);a-=e;c[0]=0==e?e:e-1;c[1]=e;c[2]=e>d.length-2?d.length-1:e+1;c[3]=e>d.length-3?d.length-1:e+2;e=d[c[0]];var f=d[c[1]],g=d[c[2]],c=d[c[3]];b.x=THREE.Curve.Utils.interpolate(e.x,f.x,g.x,c.x,a);b.y=THREE.Curve.Utils.interpolate(e.y,f.y,g.y,c.y,a);b.z=THREE.Curve.Utils.interpolate(e.z,f.z,g.z,c.z,a);return b}); +THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;e=(d.length-0)*a;a=Math.floor(e);e-=a;a+=0a.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time= +0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){d={};for(c=0;cd;d++){for(var e= +this.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.timef.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}}; +THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,r,t,s,p;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];s=a[c[2]];p=a[c[3]];c=e*e;r=e*c;d[0]=f(q[0],t[0],s[0],p[0],e,c,r);d[1]=f(q[1],t[1],s[1],p[1],e,c,r);d[2]=f(q[2],t[2],s[2],p[2],e,c,r);return d},f=function(a,b,c,d,e,f,r){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)* +r+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(!0===this.loop&&this.currentTime>f)this.currentTime%=f,this.reset();else if(!1===this.loop&&this.currentTime>f){this.stop();return}f=0;for(var h=this.hierarchy.length;fn;n++){var q=this.keyTypes[n],r=l.prevKey[q],t=l.nextKey[q];if(t.time<=this.currentTime){r=this.data.hierarchy[f].keys[0]; +for(t=this.getNextKeyWith(q,f,1);t.timer.index;)r=t,t=this.getNextKeyWith(q,f,t.index+1);l.prevKey[q]=r;l.nextKey[q]=t}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var s=(this.currentTime-r.time)/(t.time-r.time),p=r[q],v=t[q];0>s&&(s=0);1a&&(this.currentTime%=a);this.currentTime=Math.min(this.currentTime,a);a=0;for(var b=this.hierarchy.length;af.index;)f=g,g=e[f.index+1];d.prevKey= +f;d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.interpolate(g,g.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorldNeedsUpdate=!0}}}};THREE.KeyFrameAnimation.prototype.getNextKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c%=b.length;cthis.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);c=this.duration/this.frames;var d=Math.floor(this.currentTime/c);d!=b&&(this.mesh.morphTargetInfluences[a]=0,this.mesh.morphTargetInfluences[b]=1,this.mesh.morphTargetInfluences[d]= +0,a=b,b=d);this.mesh.morphTargetInfluences[d]=this.currentTime%c/c;this.mesh.morphTargetInfluences[a]=1-this.mesh.morphTargetInfluences[d]}}}()}; +THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,p){var v,w=h.widthSegments,u=h.heightSegments,D=e/2,A=f/2,x=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",u=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var C=w+1,I=u+1,z=e/w,y=f/u,K=new THREE.Vector3;K[v]=0=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else a=!1,1E-10e?-1E-10>g&& +(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(H=c.length;0<=--H;){e=H;f=H-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;gMath.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(l,1-g),new THREE.Vector2(q,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-f),new THREE.Vector2(n,1-g),new THREE.Vector2(r,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2; +THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;cc&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+0.5, +a.y));return a.clone()}THREE.Geometry.call(this);c=c||1;d=d||0;for(var k=this,l=0,n=a.length;lt&&(0.2>d&&(b[0].x+=1),0.2>a&&(b[1].x+=1),0.2>q&&(b[2].x+=1));l=0;for(n=this.vertices.length;lc.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}(); +THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=0.2*a);void 0===c&&(c=0.2*b);this.line.scale.set(1,a,1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)}; +THREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3));THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);void 0!==a&&this.update(a)};THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype); +THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.geometry.attributes.position.array;d[0]=b.x;d[1]=b.y;d[2]=b.z;d[3]=c.x;d[4]=b.y;d[5]=b.z;d[6]=c.x;d[7]=b.y;d[8]=b.z;d[9]=c.x;d[10]=c.y;d[11]=b.z;d[12]=c.x;d[13]=c.y;d[14]=b.z;d[15]=b.x;d[16]=c.y;d[17]=b.z;d[18]=b.x;d[19]=c.y;d[20]=b.z;d[21]=b.x;d[22]=b.y;d[23]=b.z;d[24]=b.x;d[25]=b.y;d[26]=c.z;d[27]=c.x;d[28]=b.y;d[29]=c.z;d[30]=c.x;d[31]=b.y; +d[32]=c.z;d[33]=c.x;d[34]=c.y;d[35]=c.z;d[36]=c.x;d[37]=c.y;d[38]=c.z;d[39]=b.x;d[40]=c.y;d[41]=c.z;d[42]=b.x;d[43]=c.y;d[44]=c.z;d[45]=b.x;d[46]=b.y;d[47]=c.z;d[48]=b.x;d[49]=b.y;d[50]=b.z;d[51]=b.x;d[52]=b.y;d[53]=c.z;d[54]=c.x;d[55]=b.y;d[56]=b.z;d[57]=c.x;d[58]=b.y;d[59]=c.z;d[60]=c.x;d[61]=c.y;d[62]=b.z;d[63]=c.x;d[64]=c.y;d[65]=c.z;d[66]=b.x;d[67]=c.y;d[68]=b.z;d[69]=b.x;d[70]=c.y;d[71]=c.z;this.geometry.attributes.position.needsUpdate=!0;this.geometry.computeBoundingSphere();this.matrixAutoUpdate= +!1;this.matrixWorld=a.matrixWorld};THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a;this.box=new THREE.Box3;THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)}; +THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3);d.colors.push(new THREE.Color(b));void 0===f[a]&&(f[a]=[]);f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b("n1","n2",16755200);b("n2","n4",16755200);b("n4","n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);b("n1","f1",16755200); +b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()}; +THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype); +THREE.CameraHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Camera,c=new THREE.Projector;return function(){function d(d,g,h,k){a.set(g,h,k);c.unprojectVector(a,b);d=e.pointMap[d];if(void 0!==d)for(g=0,h=d.length;gs;s++){d[0]=t[g[s]];d[1]=t[g[(s+1)%3]];d.sort(f);var p=d.toString();void 0===e[p]?(e[p]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},n++):e[p].face2=q}h.addAttribute("position",new THREE.Float32Attribute(6*n,3));d=h.attributes.position.array; +f=0;for(p in e)if(g=e[p],void 0===g.face2||0.9999>k[g.face1].normal.dot(k[g.face2].normal))n=l[g.vert1],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z,n=l[g.vert2],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z;THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype); +THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;cb;b++)a.faces[b].color=this.colors[4>b?0:1];b=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(a,b);this.add(this.lightSphere); +this.update()};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose();this.lightSphere.material.dispose()}; +THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=!0}}(); +THREE.PointLightHelper=function(a,b){this.light=a;this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrixWorld=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()}; +THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}; +THREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;cp;p++){d[0]=s[g[p]];d[1]=s[g[(p+1)%3]];d.sort(f);var v=d.toString();void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++)}d=new Float32Array(6*n);r=0;for(t=n;rp;p++)n= +k[q[2*r+p]],g=6*r+3*p,d[g+0]=n.x,d[g+1]=n.y,d[g+2]=n.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){for(var k=a.geometry.attributes.position.array,t=a.geometry.attributes.index.array,l=a.geometry.offsets,n=0,q=new Uint32Array(2*t.length),s=0,w=l.length;sp;p++)d[0]=g+t[r+p],d[1]=g+t[r+(p+1)%3],d.sort(f),v=d.toString(), +void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++);d=new Float32Array(6*n);r=0;for(t=n;rp;p++)g=6*r+3*p,n=3*q[2*r+p],d[g+0]=k[n],d[g+1]=k[n+1],d[g+2]=k[n+2]}else for(k=a.geometry.attributes.position.array,n=k.length/3,q=n/3,d=new Float32Array(6*n),r=0,t=q;rp;p++)g=18*r+6*p,q=9*r+3*p,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],n=9*r+(p+1)%3*3,d[g+3]=k[n],d[g+4]=k[n+1],d[g+5]=k[n+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}), +THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)}; +THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})}; +THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;ah.end&&(h.end=f);c||(c=k)}}for(k in d)h=d[k],this.createAnimation(k,h.start,h.end,a);this.firstAnimation=c}; +THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a])a.direction=1,a.directionBackwards=!1};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){if(a=this.animationsMap[a])a.direction=-1,a.directionBackwards=!0};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)}; +THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b}; +THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1}; +THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;bd.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight; +f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}}; +THREE.LensFlarePlugin=function(){function a(a,b){var d=c.createProgram(),e=c.createShader(c.FRAGMENT_SHADER),f=c.createShader(c.VERTEX_SHADER),g="precision "+b+" float;\n";c.shaderSource(e,g+a.fragmentShader);c.shaderSource(f,g+a.vertexShader);c.compileShader(e);c.compileShader(f);c.attachShader(d,e);c.attachShader(d,f);c.linkProgram(d);return d}var b=[],c,d,e,f,g,h,k,l,n,q,r,t,s;this.init=function(b){c=b.context;d=b;e=b.getPrecision();f=new Float32Array(16);g=new Uint16Array(6);b=0;f[b++]=-1;f[b++]= +-1;f[b++]=0;f[b++]=0;f[b++]=1;f[b++]=-1;f[b++]=1;f[b++]=0;f[b++]=1;f[b++]=1;f[b++]=1;f[b++]=1;f[b++]=-1;f[b++]=1;f[b++]=0;f[b++]=1;b=0;g[b++]=0;g[b++]=1;g[b++]=2;g[b++]=0;g[b++]=2;g[b++]=3;h=c.createBuffer();k=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,h);c.bufferData(c.ARRAY_BUFFER,f,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.bufferData(c.ELEMENT_ARRAY_BUFFER,g,c.STATIC_DRAW);l=c.createTexture();n=c.createTexture();c.bindTexture(c.TEXTURE_2D,l);c.texImage2D(c.TEXTURE_2D,0,c.RGB,16, +16,0,c.RGB,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);c.bindTexture(c.TEXTURE_2D,n);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,16,16,0,c.RGBA,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE); +c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);0>=c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(q=!1,r=a(THREE.ShaderFlares.lensFlare,e)):(q=!0,r=a(THREE.ShaderFlares.lensFlareVertexTexture,e));t={};s={};t.vertex=c.getAttribLocation(r,"position");t.uv=c.getAttribLocation(r,"uv");s.renderType=c.getUniformLocation(r,"renderType");s.map=c.getUniformLocation(r,"map");s.occlusionMap=c.getUniformLocation(r,"occlusionMap");s.opacity= +c.getUniformLocation(r,"opacity");s.color=c.getUniformLocation(r,"color");s.scale=c.getUniformLocation(r,"scale");s.rotation=c.getUniformLocation(r,"rotation");s.screenPosition=c.getUniformLocation(r,"screenPosition")};this.render=function(a,e,f,g){b.length=0;a.traverseVisible(function(a){a instanceof THREE.LensFlare&&b.push(a)});if(0!==b.length){a=new THREE.Vector3;var D=g/f,A=0.5*f,x=0.5*g,C=16/g,I=new THREE.Vector2(C*D,C),z=new THREE.Vector3(1,1,0),y=new THREE.Vector2(1,1),K=s,C=t;c.useProgram(r); +c.enableVertexAttribArray(t.vertex);c.enableVertexAttribArray(t.uv);c.uniform1i(K.occlusionMap,0);c.uniform1i(K.map,1);c.bindBuffer(c.ARRAY_BUFFER,h);c.vertexAttribPointer(C.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(C.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.disable(c.CULL_FACE);c.depthMask(!1);for(var N=0,ba=b.length;NK;K++)C[K]=new THREE.Vector3,A[K]=new THREE.Vector3;C=x.shadowCascadeNearZ[y];x=x.shadowCascadeFarZ[y];A[0].set(-1,-1,C);A[1].set(1,-1,C);A[2].set(-1,1,C);A[3].set(1,1,C);A[4].set(-1,-1,x);A[5].set(1,-1,x);A[6].set(-1,1,x);A[7].set(1,1,x);z.originalCamera=s;A=new THREE.Gyroscope; +A.position.copy(w.shadowCascadeOffset);A.add(z);A.add(z.target);s.add(A);w.shadowCascadeArray[D]=z;console.log("Created virtualLight",z)}y=w;C=D;x=y.shadowCascadeArray[C];x.position.copy(y.position);x.target.position.copy(y.target.position);x.lookAt(x.target);x.shadowCameraVisible=y.shadowCameraVisible;x.shadowDarkness=y.shadowDarkness;x.shadowBias=y.shadowCascadeBias[C];A=y.shadowCascadeNearZ[C];y=y.shadowCascadeFarZ[C];x=x.pointsFrustum;x[0].z=A;x[1].z=A;x[2].z=A;x[3].z=A;x[4].z=y;x[5].z=y;x[6].z= +y;x[7].z=y;I[u]=z;u++}else I[u]=w,u++;p=0;for(v=I.length;py;y++)C=x[y],C.copy(A[y]),THREE.ShadowMapPlugin.__projector.unprojectVector(C,D),C.applyMatrix4(u.matrixWorldInverse),C.xn.x&&(n.x=C.x),C.yn.y&&(n.y=C.y),C.zn.z&&(n.z=C.z);u.left=l.x;u.right=n.x;u.top=n.y;u.bottom=l.y;u.updateProjectionMatrix()}u=w.shadowMap;A=w.shadowMatrix; +D=w.shadowCamera;D.position.setFromMatrixPosition(w.matrixWorld);q.setFromMatrixPosition(w.target.matrixWorld);D.lookAt(q);D.updateMatrixWorld();D.matrixWorldInverse.getInverse(D.matrixWorld);w.cameraHelper&&(w.cameraHelper.visible=w.shadowCameraVisible);w.shadowCameraVisible&&w.cameraHelper.update();A.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);A.multiply(D.projectionMatrix);A.multiply(D.matrixWorldInverse);k.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse);h.setFromMatrix(k);c.setRenderTarget(u); +c.clear();r.length=0;a(t,t,D);w=0;for(u=r.length;w 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); +u.compileShader(x);u.compileShader(P);u.attachShader(w,x);u.attachShader(w,P);u.linkProgram(w);K=w;p=u.getAttribLocation(K,"position");v=u.getAttribLocation(K,"uv");a=u.getUniformLocation(K,"uvOffset");b=u.getUniformLocation(K,"uvScale");c=u.getUniformLocation(K,"rotation");d=u.getUniformLocation(K,"scale");e=u.getUniformLocation(K,"color");f=u.getUniformLocation(K,"map");g=u.getUniformLocation(K,"opacity");h=u.getUniformLocation(K,"modelViewMatrix");k=u.getUniformLocation(K,"projectionMatrix");l= +u.getUniformLocation(K,"fogType");n=u.getUniformLocation(K,"fogDensity");q=u.getUniformLocation(K,"fogNear");r=u.getUniformLocation(K,"fogFar");t=u.getUniformLocation(K,"fogColor");s=u.getUniformLocation(K,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;x=w.getContext("2d");x.fillStyle="white";x.fillRect(0,0,8,8);A=new THREE.Texture(w);A.needsUpdate=!0};this.render=function(C,I,P,O){x.length=0;C.traverseVisible(function(a){a instanceof THREE.Sprite&&x.push(a)});if(0!==x.length){u.useProgram(K); +u.enableVertexAttribArray(p);u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,z);u.vertexAttribPointer(p,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,y);u.uniformMatrix4fv(k,!1,I.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(f,0);O=P=0;var J=C.fog;J?(u.uniform3f(t,J.color.r,J.color.g,J.color.b),J instanceof THREE.Fog?(u.uniform1f(q,J.near),u.uniform1f(r,J.far),u.uniform1i(l,1), +O=P=1):J instanceof THREE.FogExp2&&(u.uniform1f(n,J.density),u.uniform1i(l,2),O=P=2)):(u.uniform1i(l,0),O=P=0);for(var J=0,E=x.length;J'+ clickText +'') + .appendTo($tabList); + $tab.on("click", Zin.selectIframeTabEvent); + $tab.find(".z-refresh").on("click", Zin.refreshIframeTabClick); + $tab.find(".z-error").on("click", Zin.closeIframeTabClick); + + $iframe = Z('
            ') + .appendTo(".iframenav-cont"); + + //3.选中自己,调整位置偏移,显示完整选项卡 + Zin.selectIframeTab(elemId); +}; + +/**************************************************/ +//3个iframenav的点击事件(其中刷新暂时没有添加) +/**************************************************/ + +Zin.selectIframeTabEvent = function(event) +{//点击选项卡标签页 + var $tab = Z.E.current(event); + var tabId = $tab.id; + Zin.selectIframeTab(tabId.replace("tab_", "")); +}; + +Zin.refreshIframeTabClick = function(event) +{//点击选项卡上的刷新按钮 + var $refresh = Z(Z.E.current(event)); + var tabId = $refresh.parent()[0].id; + Zin.refreshIframeTab(tabId.replace("tab_", "")); +}; + +Zin.closeIframeTabClick = function(event) +{//点击选项卡上的关闭按钮 + var $close = Z(Z.E.current(event)); + var tabId = $close.parent()[0].id; + Zin.closeIframeTab(tabId.replace("tab_", "")); +}; + +/**************************************************/ +//指定操作功能 +/**************************************************/ + +Zin.selectIframeTab = function(id) +{//选择指定的选项卡 + Z("#tab_"+id).addClass("active").siblings(".iframenav-tab-item").removeClass("active"); + Z("#iframe_"+id).addClass("active").siblings(".iframenav-cont-item").removeClass("active"); + Zin.setTranslateForShowActive(); + + var mainUrl = Z("#iframe_"+id+" iframe").attr("src"); + if (mainUrl) + {//切换选项卡同步到后端,关闭选项卡时为null不处理,整页刷新时依然使用关闭的URL + var $elem = Z("#" + id); + $elem.parent().parent().find("li").removeClass("active"); + $elem.addClass("active"); + + mainUrl = mainUrl.substring(location.origin.length); + Z.ajax().setContextPath(Zin.contextPath) + .setClassName("sessionUser").setMethodName("setMainUrl").addParam(mainUrl) + .execute(); + } +}; + +Zin.refreshIframeTab = function(id) +{//刷新指定框架 + Z("#iframe_" + id).find("iframe")[0].contentWindow.location.reload(true); +}; + +Zin.closeIframeTab = function(id) +{//关闭指定框架,并切换到前一个框架 + var $currTab = Z("#tab_" + id); + var $prevTab = Z($currTab[0].previousElementSibling || Z(".iframenav-tab-item:first-child")[0]); + + //删除当前框架,同时选中前一个为活动 + Zin.closeIframeTabOnly(id); + Zin.selectIframeTab($prevTab[0].id.replace("tab_", "")); +}; + +Zin.closeIframeTabOnly = function(id) +{//仅关闭指定框架 + Z("#tab_" + id).remove(); + Z("#iframe_" + id).remove(); +}; + +Zin.setTranslateForShowActive = function() +{//调整位置偏移,显示完整选项卡 + var $tabList = Z(".iframenav-tab-list"); + var $tabs = Z(".iframenav-tab-item"); + + //1.校准宽度 + var fillWidth = 0; + $tabs.each(function(item){ + fillWidth += item.getBoundingClientRect().width; + }); + fillWidth = Math.ceil(fillWidth); + + var wrapRect = Z(".iframenav-tab-wrap")[0].getBoundingClientRect(); + $tabList.css("width", fillWidth > wrapRect.width ? fillWidth : wrapRect.width); + if (fillWidth < wrapRect.width) + $tabList.css("transform", "translate(0,0)"); + + //2.当前标签、前后两个标签,宽度信息 + var $active = Z(".iframenav-tab-item.active"); + var activeRect = $active[0].getBoundingClientRect(); + var $prev = $active[0].previousElementSibling; + var prevWidth = !!$prev ? $prev.getBoundingClientRect().width : 0; + var $next = $active[0].nextElementSibling; + var nextWidth = !!$next ? $next.getBoundingClientRect().width : 0; + + //3.计算理论偏移量 + var mLeft = activeRect.left - prevWidth - wrapRect.left; + var mRight = activeRect.right + nextWidth - wrapRect.right; + var tabTransX = parseFloat($tabList.css("transform").replace(/^[^\d]+/,"") || 0); + tabTransX = tabTransX >= 0 ? tabTransX : 0; + if (mLeft < 0 && mRight > 0) + return; + + if (mLeft < 0) + tabTransX += mLeft; + + if (mRight > 0) + tabTransX += mRight; + + $tabList.css("transform", "translate(-" + tabTransX + "px,0)"); +}; + +/**************************************************/ +//外部调用 +/**************************************************/ + +Zin.toggleIframeCtrlWrap = function() +{//切换关闭操作界面 + Z(".iframenav-ctrl-wrap").toggle(); +}; + +Zin.selectIframeTabActive = function() +{//定位到当前选项卡 + var $active = Z(".iframenav-tab-item.active"); + var tabId = $active[0].id; + Zin.selectIframeTab(tabId.replace("tab_", "")); + + Zin.toggleIframeCtrlWrap(); +} + +Zin.closeIframeTabAll = function() +{//关闭所有选项卡 + var $tab = Z(".iframenav-tab-item:not(:first-child)"); + + var idList = []; + $tab.each(function(elem){idList.push(elem.id.replace("tab_", ""));}); + idList.forEach(Zin.closeIframeTabOnly); + + //选中首页 + var $index = Z(".iframenav-tab-item:first-child"); + Zin.selectIframeTab($index[0].id.replace("tab_", "")); + Zin.toggleIframeCtrlWrap(); +}; + +Zin.closeIframeTabOther = function() +{//关闭其他选项卡 + var $tab = Z(".iframenav-tab-item:not(:first-child)"); + var $active = Z(".iframenav-tab-item.active"); + + var idList = []; + $tab.each(function(elem){if ($active[0] !== elem){idList.push(elem.id.replace("tab_",""));}}); + idList.forEach(Zin.closeIframeTabOnly); + + Zin.setTranslateForShowActive(); + Zin.toggleIframeCtrlWrap(); +}; + +Zin.refreshIframeTabActive = function() +{//刷新当前选项卡 + var $active = Z(".iframenav-tab-item.active"); + Zin.refreshIframeTab($active[0].id.replace("tab_","")); +}; + +Zin.turnIframeTab = function(isNext) +{//向前向后翻页选项卡 + var wrapWidth = Z(".iframenav-tab-wrap")[0].getBoundingClientRect().width; + var $tabList = Z(".iframenav-tab-list"); + var tabTransX = parseFloat($tabList.css("transform").replace(/^[^\d]+/,"") || 0); + tabTransX = tabTransX >= 0 ? tabTransX : 0; + + var $tabs = Z(".iframenav-tab-item"); + var listWidth = 0, fillWidth = 0; + var fillArray=[]; + + for (var i=0;i<$tabs.length;i++) + { + var tab = $tabs[i]; + var tabWidth = tab.getBoundingClientRect().width; + listWidth += tabWidth; + if (isNext) + { + if (listWidth - tabTransX > wrapWidth) + { + tabTransX = listWidth - tabWidth; + break; + } + } + else + { + fillArray.unshift(tabWidth); + if (listWidth >= tabTransX) + { + while(fillWidth < wrapWidth) + { + fillWidth += fillArray[i++]; + } + tabTransX = listWidth - fillWidth; + break; + } + } + } + + $tabList.css("transform", "translate(-" + (tabTransX >= 0 ? tabTransX : 0) + "px,0)"); +} + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/zhiqim_image_clipper.js b/zhiqim_manager/resource/ztmpl/zhiqim_manager/zhiqim_image_clipper.js new file mode 100644 index 0000000..37b418d --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/zhiqim_image_clipper.js @@ -0,0 +1,208 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站进行实名登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/LICENSE.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ ++(function(Z) +{ +//BEGIN + +/** + * 图片裁切 +*/ +Z.ImageClipper = Z.Class.newInstance(); +Z.ImageClipper.prototype = +{ + defaults: + { + elem : null, + ratio: 1, + state : {}, + img: null, + clipWidth: [50, 100, 150], + save: null + }, + + execute: function() + { + this.$elem = Z.$elem(this.elem, "Z.ImageClipper"); + if (this.clipWidth == null || this.clipWidth.length == 0) + { + Z.alert("[Z.ImageClipper]没有设置clipWidth,或不是数组"); + return; + } + + this.id = Z.random(10); + var html = '
            ' + + '
            ' + + '
            ' + + '
            加载中...
            ' + + '
            ' + + '
            ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '
            ' + + '
            ' + + '
            '; + + this.$elem.html(html); + this.$imageBox = this.$elem.find("#ZImageClipper_image_"+this.id); + this.$square = this.$elem.find("#ZImageClipper_square_"+this.id); + this.$loading = this.$elem.find("#ZImageClipper_loading_"+this.id).show(); + + this.image = new Image(); + Z(this.image).load(function() + { + this.$loading.hide(); + this.setBackground(); + + this.$imageBox.mousedown(this.onMouseDown, this).mousemove(this.onMouseMove, this); + Z(window).mouseup(this.onMouseUp, this); + }, this); + this.image.src = this.img; + + Z("#ZImageClipper_zoomIn_"+this.id).click(this.onZoomIn, this); + Z("#ZImageClipper_zoomOut_"+this.id).click(this.onZoomOut, this); + + this.$file = Z(""); + this.$file.appendTo("body").change(function() + { + var file = this.$file[0].files[0]; + var reader = new FileReader(); + reader.onload = Z.bind(function(e) + { + this.img = e.target.result; + this.image.src = this.img; + }, this); + + reader.readAsDataURL(file); + }, this); + + Z("#ZImageClipper_upload_"+this.id).click(function(){this.$file[0].click();}, this); + Z("#ZImageClipper_clip_"+this.id).click(function() + { + var imgData = this.getDataURL(); + var imgDiv = ''; + Z.each(this.clipWidth, function(elem){ + imgDiv += '

            '+elem+' * '+elem+'
            ' + }); + Z("#ZImageClipper_clipped_"+this.id).html(imgDiv); + }, this); + + if (Z.T.isFunction(this.save)){ + Z("#ZImageClipper_save_"+this.id).click(this.save, this); + } + }, + + setBackground: function() + { + var w = parseInt(this.image.width) * this.ratio; + var h = parseInt(this.image.height) * this.ratio; + + var pw = (400 - w) / 2; + var ph = (400 - h) / 2; + + this.$imageBox.css({ + "background-image": "url(" + this.image.src + ")", + "background-size": w +"px " + h + "px", + "background-position": pw + "px " + ph + "px", + "background-repeat": "no-repeat"}); + }, + + onMouseDown: function(e) + { + Z.E.stop(e); + this.state.dragging = true; + this.state.mouseX = e.clientX; + this.state.mouseY = e.clientY; + }, + + onMouseMove: function(e) + { + Z.E.stop(e); + if (!this.state.dragging) + return; + + var x = e.clientX - this.state.mouseX; + var y = e.clientY - this.state.mouseY; + + var bg = this.$imageBox.css('background-position').split(' '); + + var bgX = x + parseInt(bg[0]); + var bgY = y + parseInt(bg[1]); + + this.$imageBox.css('background-position', bgX +'px ' + bgY + 'px'); + + this.state.mouseX = e.clientX; + this.state.mouseY = e.clientY; + }, + + onMouseUp: function(e) + { + Z.E.stop(e); + this.state.dragging = false; + }, + + onZoomIn: function() + { + this.ratio *= 1.1; + this.setBackground(); + }, + + onZoomOut: function() + { + this.ratio *= 0.9; + this.setBackground(); + }, + + getDataURL: function() + { + var width = this.$square.offsetWidth(), + height = this.$square.offsetHeight(), + canvas = document.createElement("canvas"), + dim = this.$imageBox.css('background-position').split(' '), + size = this.$imageBox.css('background-size').split(' '), + dx = parseInt(dim[0]) - this.$imageBox.offsetWidth()/2 + width/2, + dy = parseInt(dim[1]) - this.$imageBox.offsetHeight()/2 + height/2, + dw = parseInt(size[0]), + dh = parseInt(size[1]), + sh = parseInt(this.image.height), + sw = parseInt(this.image.width); + + canvas.width = width; + canvas.height = height; + var context = canvas.getContext("2d"); + context.drawImage(this.image, 0, 0, sw, sh, dx, dy, dw, dh); + var imageData = canvas.toDataURL('image/png'); + return imageData; + }, + + getBlob: function() + { + var imageData = this.getDataURL(); + var b64 = imageData.replace('data:image/png;base64,',''); + var binary = atob(b64); + var array = []; + for (var i = 0; i < binary.length; i++) { + array.push(binary.charCodeAt(i)); + } + return new Blob([new Uint8Array(array)], {type: 'image/png'}); + } +} + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/zhiqim_image_clipper_default.jpg b/zhiqim_manager/resource/ztmpl/zhiqim_manager/zhiqim_image_clipper_default.jpg new file mode 100644 index 0000000..7c69caa Binary files /dev/null and b/zhiqim_manager/resource/ztmpl/zhiqim_manager/zhiqim_image_clipper_default.jpg differ diff --git a/zhiqim_manager/resource/ztmpl/zhiqim_manager/zhiqim_webgl_three.js b/zhiqim_manager/resource/ztmpl/zhiqim_manager/zhiqim_webgl_three.js new file mode 100644 index 0000000..d8408e1 --- /dev/null +++ b/zhiqim_manager/resource/ztmpl/zhiqim_manager/zhiqim_webgl_three.js @@ -0,0 +1,265 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站进行实名登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/LICENSE.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ ++(function(Z) +{ +//BEGIN + +/** + * WebGL+three.js 3D动画,当前有波浪和光线球两种 +*/ +Z.WebGLThree = Z.Class.newInstance(); +Z.WebGLThree.prototype = +{ + defaults: + { + //常量 + SEPARATION: 125, + AMOUNTX: 35, + AMOUNTY: 35, + + //传入参数 + threePath: null, + elem: null, + + //内部对象 + camera: null, + scene: null, + renderer: null, + particles_ware: [], + particles_globe: [], + + //运行时 + count: 0, + mouseX: 0, + mouseY: 0, + windowHalfX: window.innerWidth / 2, + windowHalfY: window.innerHeight / 2, + rotation_speed: .002, + timeout: null + }, + + execute: function() + { + if (Z.B.mobile || Z.B.msieVer <= 9) + {//移动端和IE9以下不支持 + return; + } + + if (this.threePath == null || this.elem == null) + {//两个参数必须,未传不处理 + return; + } + + //先加载three.js,再初始化init + this.$elem = Z.$elem(this.elem, "Z.WebGLThree"); + Z.loads(this.threePath, Z.bind(this.initWebGL, this)); + }, + + initWebGL: function() + { + var animationType = Math.floor(2 * Math.random()); + if (animationType == 0) + {//波浪 + this.initWave(); + this.animateWave(); + } + else + {//光球 + this.initGlobe(); + this.animateGlobe(); + } + + //增加事件处理 + Z(document).mousemove(this.onDocumentMouseMove, this) + .on("touchstart", this.onDocumentTouchStart, this) + .on("touchmove", this.onDocumentTouchMove, this); + Z(window).resize(this.onWindowResize, this); + }, + + /******************************************************************************************/ + //光球 + /******************************************************************************************/ + initGlobe: function initGlobe() + { + this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 1e4), + this.camera.position.z = 500, + this.scene = new THREE.Scene; + + for (var t = 2 * Math.PI, i = function (e) {e.beginPath(), e.arc(0, 0, 25, 0, t, true), e.fill()}, t = 2 * Math.PI, n = 0; 500 > n; n++) + { + var o = new THREE.SpriteCanvasMaterial({color: 16777215, + transparent: true, + program: function (e) {e.beginPath(), e.arc(0, 0, .5, 0, t, true), e.fill()}}); + var particle = new THREE.Sprite(o); + particle.position.x = 2 * Math.random() - 1; + particle.position.y = 2 * Math.random() - 1; + particle.position.z = 2 * Math.random() - 1; + particle.position.normalize(); + particle.position.multiplyScalar(10 * Math.random() + 450); + particle.scale.multiplyScalar(4 + 2 * Math.random()); + particle.material.opacity = .1; + this.scene.add(particle); + this.particles_globe.push(particle); + } + for (var n = 0; 500 > n; n++) + { + var s = new THREE.Geometry; + var r = new THREE.Vector3(2 * Math.random() - 1, 2 * Math.random() - 1, 2 * Math.random() - 1); + r.normalize(); + r.multiplyScalar(450); + s.vertices.push(r); + + var a = r.clone(); + a.multiplyScalar(.3 * Math.random() + 1), s.vertices.push(a); + var l = new THREE.Line(s, new THREE.LineBasicMaterial({color: 16777215, opacity: .3})); + this.scene.add(l) + } + this.renderer = new THREE.CanvasRenderer({alpha: true}); + this.renderer.setClearColor(0, 0); + this.renderer.setSize(window.innerWidth, window.innerHeight); + this.$elem.append(this.renderer.domElement) + }, + + animateGlobe: function() + { + requestAnimationFrame(Z.bind(this.animateGlobe, this)); + this.renderGlobe(); + }, + + renderGlobe: function() + { + var e = Z("body:hover"), t = this.camera.position.x, i = this.camera.position.y, n = this.camera.position.z; + if (e.length != 0 && this.timeout != null) + { + this.camera.position.x += .05 * (this.mouseX - this.camera.position.x); + } + else + { + this.camera.position.x = t * Math.cos(this.rotation_speed) - n * Math.sin(this.rotation_speed); + this.camera.position.z = n * Math.cos(this.rotation_speed) + t * Math.sin(this.rotation_speed); + } + + this.camera.position.y += .05 * (-this.mouseY + 200 - this.camera.position.y); + this.camera.lookAt(this.scene.position); + + Z(document).mousemove(function () { + this.timeout !== null && clearTimeout(this.timeout), this.timeout = setTimeout(function () {this.timeout = null}, 600) + }); + + for (var o = 0; o < this.particles_globe.length; o++) + { + var particle = this.particles_globe[o++]; + temp = 50 * Math.sin(.3 * (o + this.count)) + .5 * Math.sin(.5 * (o + this.count)); + opacity = Math.abs(temp) / 50 + .1; + opacity > 1 && (opacity = 1); + particle.material.opacity = opacity; + } + + this.renderer.render(this.scene, this.camera); + this.count += .1; + }, + + /******************************************************************************************/ + //波浪 + /******************************************************************************************/ + initWave: function() + { + this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 1e4); + this.camera.position.z = 1e3; + this.camera.position.y = 100; + this.camera.position.y = 1e3; + + this.scene = new THREE.Scene; + for (var t = 2 * Math.PI, i = 0, n = 0; this.AMOUNTX > n; n++)for (var o = 0; this.AMOUNTY > o; o++) + { + var s = new THREE.SpriteCanvasMaterial({color: 16777215, + transparent: true, + program: function (e) {e.beginPath(), e.arc(0, 0, .5, 0, t, true), e.fill()}}); + + var particle = this.particles_ware[i++] = new THREE.Sprite(s); + particle.position.x = n * this.SEPARATION - this.AMOUNTX * this.SEPARATION / 2; + particle.position.z = o * this.SEPARATION - this.AMOUNTY * this.SEPARATION / 2; + this.scene.add(particle), particle.material.opacity = .4; + } + + this.renderer = new THREE.CanvasRenderer({alpha: true}); + this.renderer.setClearColor(0, 0); + this.renderer.setSize(window.innerWidth, window.innerHeight); + this.$elem.append(this.renderer.domElement); + }, + + animateWave: function() + { + requestAnimationFrame(Z.bind(this.animateWave, this)); + this.renderWave(); + }, + + renderWave: function() + { + this.camera.position.x += .01 * (this.mouseX - this.camera.position.x), + this.camera.position.y += .005 * (this.mouseY - this.camera.position.y), + this.camera.lookAt(this.scene.position); + + for (var e = 0, t = 0; this.AMOUNTX > t; t++) + { + for (var i = 0; this.AMOUNTY > i; i++) + { + var particle = this.particles_ware[e++]; + particle.position.y = 50 * Math.sin(.3 * (t + this.count)) + 50 * Math.sin(.5 * (i + this.count)); + particle.scale.x = particle.scale.y = 4 * (Math.sin(.3 * (t + this.count)) + 1) + 4 * (Math.sin(.5 * (i + this.count)) + 1); + opacity = Math.abs(particle.position.y) / 100; + opacity < .5 && (opacity = .5); + opacity > 1 && (opacity = 1); + particle.material.opacity = opacity; + } + } + + this.renderer.render(this.scene, this.camera); + this.count += .03 + }, + + /******************************************************************************************/ + //事件处理 + /******************************************************************************************/ + + onWindowResize: function() + {//缩放 + this.windowHalfX = window.innerWidth / 2, + this.windowHalfY = window.innerHeight / 2, + this.camera.aspect = window.innerWidth / window.innerHeight, + this.camera.updateProjectionMatrix(), + this.renderer.setSize(window.innerWidth, window.innerHeight); + }, + + onDocumentMouseMove: function(e) + {//鼠标移动 + this.mouseX = e.clientX - this.windowHalfX, this.mouseY = e.clientY + 150; + }, + + onDocumentTouchStart: function(e) + {//iOS触摸开始 + 1 === e.touches.length && (e.preventDefault(), this.mouseX = e.touches[0].pageX - this.windowHalfX, this.mouseY = -e.touches[0].pageY); + }, + + onDocumentTouchMove: function(e) + {//iOS触摸移动 + 1 === e.touches.length && (e.preventDefault(), this.mouseX = e.touches[0].pageX - this.windowHalfX, this.mouseY = -e.touches[0].pageY); + } +}; + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/avatar.zml b/zhiqim_manager/resource/zview/zhiqim_manager/avatar.zml new file mode 100644 index 0000000..4ba216f --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/avatar.zml @@ -0,0 +1,71 @@ + +${zhiqim_manager_breadcrumb("系统头像")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 操作 --> +<#if ZmrAdminRule.check(request)> +
            + <#if ZmrPathRule.check(request, "/"+zhiqim_manager+"/avatarAdd.htm")> + <#if ZmrPathRule.check(request, "/"+zhiqim_manager+"/avatarModify.htm")> + <#if ZmrPathRule.check(request, "/"+zhiqim_manager+"/avatarDelete.htm")> +
            + + +<#-- 列表 --> + + + + + + + +<#for item : result.list()> + + + + + + + +${zhiqim_manager_tr_no_record(result, 4, "暂时没有系统头像信息")} +
            选择头像(50*50)头像(100*100)头像(150*150)
            + <#if ZmrAdminRule.check(request)> + + +
            +${zhiqim_manager_paging(result)} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/avatarAdd.zml b/zhiqim_manager/resource/zview/zhiqim_manager/avatarAdd.zml new file mode 100644 index 0000000..c92f32b --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/avatarAdd.zml @@ -0,0 +1,33 @@ +<#var zhiqim_image_clipper.js = new ZmrCdnRuntime(context, "/ztmpl/zhiqim_manager/zhiqim_image_clipper.js")/> +${zhiqim_manager_history("avatar.htm")} +${request.getValidateScript()} +${Scripts.src(zhiqim_image_clipper.js)} + +${zhiqim_manager_breadcrumb_parent("avatar.htm", "系统头像", "增加系统头像")} +${zhiqim_manager_content()} +${zhiqim_manager_title("增加系统头像")} +
            +
            +
            +${zhiqim_manager_return()} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/avatarModify.zml b/zhiqim_manager/resource/zview/zhiqim_manager/avatarModify.zml new file mode 100644 index 0000000..649bd07 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/avatarModify.zml @@ -0,0 +1,35 @@ +<#var zhiqim_image_clipper.js = new ZmrCdnRuntime(context, "/ztmpl/zhiqim_manager/zhiqim_image_clipper.js")/> +${zhiqim_manager_history("avatar.htm")} +${request.getValidateScript()} +${Scripts.src(zhiqim_image_clipper.js)} + +${zhiqim_manager_breadcrumb_parent("avatar.htm" "系统头像" "修改系统头像")} +${zhiqim_manager_content()} +${zhiqim_manager_title("修改系统头像")} +
            +
            +
            +${zhiqim_manager_return()} + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/cache.zml b/zhiqim_manager/resource/zview/zhiqim_manager/cache.zml new file mode 100644 index 0000000..3b1c2ae --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/cache.zml @@ -0,0 +1,54 @@ +${request.getValidateSubmitScript()} + +${zhiqim_manager_breadcrumb("系统缓存")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> +<#for server : list> +<#if server.getCacheMap().isEmpty()> +<#continue/> + + +${zhiqim_manager_tr_title(4, "系统缓存["+server.getId()+"]列表")} + + + + + + +${zhiqim_manager_tr_no_record(group, 4, "暂时没有配置信息")} +
            表名对象定时器操作
            +<#for item : server.getCacheMap().keySet()> +
            + + + + + + + + + +
            #{server.table().getTable(item).getTable()}#{item.getName()}#{server.getCacheMap().get(item).toString()}
            +
            + + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/config.zml b/zhiqim_manager/resource/zview/zhiqim_manager/config.zml new file mode 100644 index 0000000..3310dee --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/config.zml @@ -0,0 +1,66 @@ +${request.getValidateSubmitScript()} + +${zhiqim_manager_breadcrumb("系统配置")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> +<#for group : groupList> +<#if group.isPrivate()> +<#continue/> + + +${zhiqim_manager_tr_title(4, "系统配置["+group.getId()+"]["+group.getDesc()+"]列表")} + + + + + + +${zhiqim_manager_tr_no_record(group, 4, "暂时没有配置信息")} +
            配置键配置值操作配置描述
            +<#for item : group.list()> +<#if item.isPrivate()> +<#continue/> + +<#if ZmrAdminRule.check(request) && item.isPublic()> +
            + + + + + + + <#if ZmrAdminRule.check(request) && item.isPublic()> + + + <#else> + + + + + +
            #{item.getKey()}class="zi-samp">#{item.getString()}#{item.getDesc()}
            +<#if ZmrAdminRule.check(request) && item.isPublic()> +
            + + + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/dept.zml b/zhiqim_manager/resource/zview/zhiqim_manager/dept.zml new file mode 100644 index 0000000..e606880 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/dept.zml @@ -0,0 +1,93 @@ +<#-- 显示子部门,并递归显示下级子部门 --> +<#function showChildDept(self, parent)> + + + <#if ZmrAdminRule.check(request)> + + + + ${self.self().getDeptId()} + + <#var level = self.self().getDeptLevel()/> + <#if level == 0> + + <#else> + <#for i : 1..(level-1)> + <#if self.isLastNode(level-i)> + + <#else> + + + + <#if self.isLastNode()> + + <#else> + + + + + #{self.self().getDeptName()} + + <#if self.self().getDeptStatus() == 0>正常<#else>停用 + ${self.self().getDeptLevel()} + ${self.self().getDeptManager()} + ${self.self().getDeptSubManager()} + +<#for child : self.children()> +${showChildDept(child, self)} + + + +${zhiqim_manager_breadcrumb("部门管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + +<#if size == 0> +${zhiqim_manager_no_record(6, "暂时没有部门信息")} +<#else> + + + + + + + + + +<#for child : tree.children()> +${showChildDept(child, tree)} + + +
            选择部门编号部门名称部门状态部门级别部门负责人部门副负责人
            <#if ZmrAdminRule.check(request)>${tree.self().getDeptId()} #{tree.self().getDeptName()}<#if tree.self().getDeptStatus() == 0>正常<#else>停用${tree.self().getDeptLevel()}${tree.self().getDeptManager()}${tree.self().getDeptSubManager()}
            +${zhiqim_manager_list(size)} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/deptAdd.zml b/zhiqim_manager/resource/zview/zhiqim_manager/deptAdd.zml new file mode 100644 index 0000000..4632ae1 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/deptAdd.zml @@ -0,0 +1,77 @@ +${Scripts.onload("document.theForm.deptName.focus();")} +${zhiqim_manager_history("dept.htm")} +${request.getValidateScript()} + + +${zhiqim_manager_breadcrumb_parent("dept.htm" "部门管理" "增加部门")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            增加部门
            上级部门:(请选择)${parent.getDeptName()}
            部门名称:(2-16位) *
            部门状态:(正常|停用) *
            部门排序数:(必须是[0, 999999]范围的非负整数) *
            部门负责人:
            部门副负责人:
            部门描述:(不能超过100个汉字)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/deptModify.zml b/zhiqim_manager/resource/zview/zhiqim_manager/deptModify.zml new file mode 100644 index 0000000..72b6c67 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/deptModify.zml @@ -0,0 +1,79 @@ +${zhiqim_manager_history("dept.htm")} +${request.getValidateScript()} + + +${zhiqim_manager_breadcrumb_parent("dept.htm" "部门管理" "修改部门")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            修改部门
            部门编号:(由不定长6位字母或数字组合)#{item.getDeptId()}
            部门名称:(不能超过32个汉字) *
            部门状态:(正常|停用) *
            部门排序数:(必须是[0, 999999]范围的非负整数) *
            部门负责人:
            部门副负责人:
            部门描述:(不能超过100个汉字)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/deptOperator.zml b/zhiqim_manager/resource/zview/zhiqim_manager/deptOperator.zml new file mode 100644 index 0000000..988c6d2 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/deptOperator.zml @@ -0,0 +1,120 @@ +<#-- 显示子部门,并递归显示下级子部门 --> +<#function showChildDept(self, parent)> + + + <#var level = self.self().getDeptLevel()/> + <#for i : 1..(level-1)> + <#if self.isLastNode(level-i)> + + <#else> + + + + <#if self.isLastNode()> + + <#else> + + + + #{self.self().getDeptName()} + + +<#for child : self.children()> +${showChildDept(child, self)} + + + + +${zhiqim_manager_breadcrumb("部门成员")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + +
            + + + + + <#for child : tree.children()> + ${showChildDept(child, tree)} + +
            #{tree.self().getDeptName()}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/deptOperatorSelector.zml b/zhiqim_manager/resource/zview/zhiqim_manager/deptOperatorSelector.zml new file mode 100644 index 0000000..cdb169e --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/deptOperatorSelector.zml @@ -0,0 +1,49 @@ +${Styles.htmlOverflowHidden()} + + +<#-- 查询 --> +
            +
            + + + +
            +
            + +<#-- 列表 --> +
            + + + + + + + +${zhiqim_manager_tr_no_record(operatorList, 4, "没有可选择的操作员")} +<#for item : operatorList> + + + + + + + + + + +<#-- 操作 --> +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/deptRule.zml b/zhiqim_manager/resource/zview/zhiqim_manager/deptRule.zml new file mode 100644 index 0000000..3e33646 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/deptRule.zml @@ -0,0 +1,81 @@ +<#-- 显示子部门,并递归显示下级子部门 --> +<#function showChildDept(self, parent)> + + + +<#for child : self.children()> +${showChildDept(child, self)} + + + + + +${zhiqim_manager_breadcrumb("部门权限")} +${zhiqim_manager_content()} +
            + +
            + +
            操作员头像操作员编码操作员姓名
            ${item.getOperatorCode()}${item.getOperatorName()}
            + <#var level = self.self().getDeptLevel()/> + <#for i : 1..(level-1)> + <#if self.isLastNode(level-i)> + + <#else> + + + + <#if self.isLastNode()> + + <#else> + + + + #{self.self().getDeptName()} +
            + + + + + +
            + + + + + <#for child : tree.children()> + ${showChildDept(child, tree)} + +
            #{tree.self().getDeptName()}
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/keys.zml b/zhiqim_manager/resource/zview/zhiqim_manager/keys.zml new file mode 100644 index 0000000..5e9792e --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/keys.zml @@ -0,0 +1,40 @@ +${zhiqim_manager_breadcrumb("系统菜单")} +${zhiqim_manager_content()} + +
            + +
            + + + + + + + + + + + + + + +
            密钥类型密钥值
            公钥${publicKey}
            私钥${privateKey}
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/main.zml b/zhiqim_manager/resource/zview/zhiqim_manager/main.zml new file mode 100644 index 0000000..01b9613 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/main.zml @@ -0,0 +1,5 @@ +${zhiqim_manager_breadcrumb_name("欢迎光临["+context.getContextName()+"]!")} +${zhiqim_manager_content()} + + +${zhiqim_manager_content_end()} diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/menu.zml b/zhiqim_manager/resource/zview/zhiqim_manager/menu.zml new file mode 100644 index 0000000..ea615b5 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/menu.zml @@ -0,0 +1,108 @@ +<#-- 显示子菜单,并递归显示下级子菜单 --> +<#function showChildMenu(self, parent)> + + + + + + + + + + + + +
            + <#if ZmrAdminRule.check(request)> + + + + <#var level = self.self().getMenuLevel()/> + <#for i : 1..(level-1)> + <#if self.isLastNode(level-i)> + + <#else> + + + + <#if self.hasChildren()> + + <#else> + + + + #{self.self().getMenuName()} + #{self.self().getMenuNameAbbr()}#{self.self().getMenuCode()}<#if self.self().getMenuStatus()==0>正常<#else>停用#{self.self().getMenuLevel()}<#if self.self().getMenuType()==1>枝节点<#else>属性#{self.self().getMenuUrl()}
            +<#if self.hasChildren()> + + + + +${zhiqim_manager_breadcrumb("系统菜单")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 操作 --> +<#if ZmrAdminRule.check(request)> +
            +<#if ZmrSuperAdminRule.check(request)> + + +<#if ZmrPathRule.check(request, "/"+zhiqim_manager+"/menuModify.htm")> +<#if ZmrSuperAdminRule.check(request)> + + +
            + + +<#-- 列表 --> + + + + + + + + + + + + + + + + + + + + + + + +
            选择菜单目录菜单简称菜单编码状态级别菜单类型图标URL
            系统功能根菜单#{tree.self().getMenuNameAbbr()}#{tree.self().getMenuCode()}<#if tree.self().getMenuStatus()==0>正常<#else>停用#{tree.self().getMenuLevel()}根节点#{tree.self().getMenuUrl()}
            +<#for child : tree.children()> +${showChildMenu(child, tree)} + +${zhiqim_manager_list(menuSize)} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/menuAdd.zml b/zhiqim_manager/resource/zview/zhiqim_manager/menuAdd.zml new file mode 100644 index 0000000..9ba7f79 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/menuAdd.zml @@ -0,0 +1,57 @@ +${Scripts.onload("Z(document.theForm.menuCode).focusEnd();")} +${zhiqim_manager_history("menu.htm")} +${request.getValidateScript()} + +${zhiqim_manager_breadcrumb_parent("menu.htm" "系统菜单" "增加菜单信息")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + +<#if parent.getMenuLevel() == 0> + + + + + + + + + + + + + +<#if parent.getMenuLevel() lte 1> + + + + + + + + + + + + + +
            增加菜单信息
            父级菜单:(请选择)${parent.getMenuCode()}(${parent.getMenuName()})
            菜单编码:(在父级菜单基础上增加编码值,编码值每段三位,如010) *
            菜单名称:(16位不定长字符) *
            菜单简称:(3位不定长字符,仅一级菜单使用) *
            菜单状态:(停用或正常) *
            菜单类型:(枝节点或属性) *
            菜单图标:(在z-font中选择字体图标,仅一二级菜单使用)
            菜单URL:(菜单权限对应的URL,多个用逗号隔开,100字符以内)
            菜单描述:(用一句简短的句子描述菜单,100字以内)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/menuModify.zml b/zhiqim_manager/resource/zview/zhiqim_manager/menuModify.zml new file mode 100644 index 0000000..52981f2 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/menuModify.zml @@ -0,0 +1,60 @@ +${zhiqim_manager_history("menu.htm")} +${request.getValidateScript()} + +${zhiqim_manager_breadcrumb_parent("menu.htm" "系统菜单" "修改本菜单信息")} +${zhiqim_manager_content()} +${zhiqim_manager_title("修改 ["+item.getMenuName()+"] 菜单")} +
            + + + + + + + + + + + + +<#if item.getMenuLevel() == 1> + + + + +<#else> + + + + + + + + + + +<#if item.getMenuLevel() lte 2> + + + + +<#else> + + + + + + + + + + +
            菜单编码:${item.getMenuCode()}
            菜单名称:(16位不定长字符) *
            菜单简称:(3位不定长字符,仅一级菜单使用) *
            菜单状态:(正常|停用) +  * +
            菜单类型:(枝节点 | 属性) *
            菜单图标:(在z-font中选择字体图标,仅一二级菜单使用)
            菜单URL:(菜单权限对应的URL,多个用逗号隔开,100字符以内)
            菜单描述:(用一句简短的句子描述菜单,100字以内)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/message.zml b/zhiqim_manager/resource/zview/zhiqim_manager/message.zml new file mode 100644 index 0000000..787de5b --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/message.zml @@ -0,0 +1,81 @@ +${zhiqim_manager_breadcrumb("消息列表")} +${zhiqim_manager_content()} +${sweet_alert_reuse_method()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + + + +<#for item : result.list()> + + + + + + + + + + + + +${zhiqim_manager_tr_no_record(result, 10, "暂时没有消息")} +
            订单号发送者发送时间消息内容设计师订单状态处理状态处理时间操作
            #{item.getOrderId()}#{item.getProducerOperateName()}<#if item.getSendTimeTimestamp() !=null>#{Sqls.toDateTimeString(item.getSendTimeTimestamp())}<#else>#{item.getMessageBody()}#{item.getDesignerName()}#{item.getOrderStatusName()}<#if item.getState() == "1">已创建(未处理)<#elseif item.getState() == 2>平台已收到(未处理)<#elseif item.getState() == 3>已处理<#else>失效<#if item.getState() == "3" && item.getReadTimeTimestamp() !=null>#{Sqls.toDateTimeString(item.getReadTimeTimestamp())}<#else><#if item.getState() == "3"><#elseif item.getState() == 1 ||item.getState() == 2><#else>
            + + + + +
            ${PagingGo.toHtmlLink(result)}
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/messageFromMe.zml b/zhiqim_manager/resource/zview/zhiqim_manager/messageFromMe.zml new file mode 100644 index 0000000..767e80a --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/messageFromMe.zml @@ -0,0 +1,85 @@ +${zhiqim_manager_breadcrumb("消息列表")} +${zhiqim_manager_content()} +${sweet_alert_reuse_method()} + + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + + + + +<#for item : result.list()> + + + + + + + + + + + + +${zhiqim_manager_tr_no_record(result, 10, "暂时没有消息")} +
            订单号接收者接收时间消息内容设计师订单状态处理状态处理时间操作
            #{item.getOrderId()}#{item.getConsumerOperateName()}<#if item.getConsumeTimeTimestamp() !=null>#{Sqls.toDateTimeString(item.getConsumeTimeTimestamp())}<#else>#{item.getMessageBody()}#{item.getDesignerName()}#{item.getOrderStatusName()}<#if item.getState() == "1">已创建(未处理)<#elseif item.getState() == 2>平台已收到(未处理)<#elseif item.getState() == 3>已处理<#else>失效<#if item.getState() == "3" && item.getReadTimeTimestamp() !=null>#{Sqls.toDateTimeString(item.getReadTimeTimestamp())}<#else>
            + + + + +
            ${PagingGo.toHtmlLink(result)}
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/modifyAvatar.zml b/zhiqim_manager/resource/zview/zhiqim_manager/modifyAvatar.zml new file mode 100644 index 0000000..ee93591 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/modifyAvatar.zml @@ -0,0 +1,86 @@ +<#var zhiqim_image_clipper.js = new ZmrCdnRuntime(context, "/ztmpl/zhiqim_manager/zhiqim_image_clipper.js")/> +${Scripts.src(zhiqim_image_clipper.js)} + +${zhiqim_manager_content()} +
            + +
            +
            + +
            +
            + + +
            +
            +
            +
            +
            +
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/modifyEmail.zml b/zhiqim_manager/resource/zview/zhiqim_manager/modifyEmail.zml new file mode 100644 index 0000000..174fd50 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/modifyEmail.zml @@ -0,0 +1,32 @@ + +
            + 原邮箱:<#if Validates.isNotEmpty(sessionUser.getOperatorEmail())>${sessionUser.getOperatorEmail()}(已绑定) <#else>(未绑定) +
            +
            + 新邮箱: + * + 请输入新的邮箱 +
            +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/modifyMobile.zml b/zhiqim_manager/resource/zview/zhiqim_manager/modifyMobile.zml new file mode 100644 index 0000000..2244d40 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/modifyMobile.zml @@ -0,0 +1,88 @@ + +
            + 原手机号:<#if Validates.isNotEmpty(sessionUser.getOperatorMobile())>${sessionUser.getOperatorMobile()}(已绑定) <#else>(未绑定) +
            +
            + 新手机号: + * +
            +
            +    验证码: + * + +
            +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/modifyOperatorParam.zml b/zhiqim_manager/resource/zview/zhiqim_manager/modifyOperatorParam.zml new file mode 100644 index 0000000..64ba2a5 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/modifyOperatorParam.zml @@ -0,0 +1,31 @@ + +
            + 原${desc}:${value} +
            +
            + 新${desc}:*请输入新${desc} +
            +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/modifyPassword.zml b/zhiqim_manager/resource/zview/zhiqim_manager/modifyPassword.zml new file mode 100644 index 0000000..1eb9291 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/modifyPassword.zml @@ -0,0 +1,42 @@ +${request.getValidateScript()} + +
            + + + + + + + + + + + + + + + + + + + + + +
            旧 密 码:*请输入原始密码
            新 密 码:*6-16位密码,大写字母、小写字母、数字和特殊字符必须四选三,特殊字符支持.`_~!@#$%
            确认密码:*再次输入新密码
            +
            + + +
            +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/modifyWangwang.zml b/zhiqim_manager/resource/zview/zhiqim_manager/modifyWangwang.zml new file mode 100644 index 0000000..aea846f --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/modifyWangwang.zml @@ -0,0 +1,32 @@ + +
            + 原旺旺:<#if Validates.isNotEmpty(sessionUser.getOperatorWangwang())>${sessionUser.getOperatorWangwang()}(已绑定) <#else>(未绑定) +
            +
            + 新旺旺: + * + 请输入新的旺旺 +
            +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/modifyWkwechatAccount.zml b/zhiqim_manager/resource/zview/zhiqim_manager/modifyWkwechatAccount.zml new file mode 100644 index 0000000..8229570 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/modifyWkwechatAccount.zml @@ -0,0 +1,32 @@ + +
            + 原企业微信账号:<#if Validates.isNotEmpty(sessionUser.getWkwechatAccount())>${sessionUser.getWkwechatAccount()}(已绑定) <#else>(未绑定) +
            +
            + 新企业微信账号: + * + 请输入新的企业微信账号 +
            +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/modifyWxcode.zml b/zhiqim_manager/resource/zview/zhiqim_manager/modifyWxcode.zml new file mode 100644 index 0000000..aa0be96 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/modifyWxcode.zml @@ -0,0 +1,32 @@ + +
            + 原微信:<#if Validates.isNotEmpty(sessionUser.getOperatorWxcode())>${sessionUser.getOperatorWxcode()}(已绑定) <#else>(未绑定) +
            +
            + 新微信: + * + 请输入新的微信 +
            +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/operateLog.zml b/zhiqim_manager/resource/zview/zhiqim_manager/operateLog.zml new file mode 100644 index 0000000..c63a51d --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/operateLog.zml @@ -0,0 +1,47 @@ +${zhiqim_manager_breadcrumb("操作日志查询")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + +<#for item : result.list()> + + + + + + + +${zhiqim_manager_tr_no_record(result, 4, "暂时没有操作日志")} +
            操作时间操作员操作URL操作描述
            #{Sqls.toDateTimeString(item.getOperateTime())}#{item.getOperatorCode()}#{item.getOperateUrl()}#{item.getOperateDesc()}
            + + + + +
            ${PagingGo.toHtmlLink(result)}
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/operator.zml b/zhiqim_manager/resource/zview/zhiqim_manager/operator.zml new file mode 100644 index 0000000..58c9a99 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/operator.zml @@ -0,0 +1,213 @@ + +${zhiqim_manager_breadcrumb("操作员管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + <#if ZmrPathRule.check(request, "/"+zhiqim_manager+"/dept.htm")> + + + + + + + +${zhiqim_manager_tr_no_record(result, 11, "暂时没有操作员信息")} +<#for item : result.list()> + + + + + + + <#if ZmrPathRule.check(request, "/"+zhiqim_manager+"/dept.htm")> + + + + + + + + + +
            选择头像操作员编码操作员名称状态 + + + + + +
            所属部门<#if ZmrPathRule.check(request, "/"+zhiqim_manager+"/operatorDept.htm")>设置
            +
            + <#else> + + + + + + + +
            所属角色<#if ZmrPathRule.check(request, "/"+zhiqim_manager+"/operatorRole.htm")>设置
            +
            手机号个人微信企业微信账号更新时间
            + <#if ZmrAdminMutexRule.check(request, item)> + + + ${item.getOperatorCode()}#{item.getOperatorName()}${item.getOperatorStatus()==0?"正常":"停用"} + + <#var deptIds = Arrays.toLongArray(item.getOperatorDept())/> + <#for deptName : Arrays.toStringArray(item.getOperatorCreated())> + + + + + +
            #{deptName} + <#if ZmrAdminMutexRule.check(request, item)> + 取消 + +
            +
            + + <#var roleIds = Arrays.toLongArray(item.getOperatorRole())/> + <#for roleName : Arrays.toStringArray(item.getOperatorPass())> + + + + + +
            #{roleName} + <#if ZmrAdminMutexRule.check(request, item)> + 取消 + +
            +
            + #{item.getOperatorMobile()} + + #{item.getOperatorWxcode()} + + #{item.getWkwechatAccount()} + #{item.getOperatorModified()}
            +${zhiqim_manager_paging(result)} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/operatorAdd.zml b/zhiqim_manager/resource/zview/zhiqim_manager/operatorAdd.zml new file mode 100644 index 0000000..5f55e0c --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/operatorAdd.zml @@ -0,0 +1,105 @@ +${Scripts.onload("document.theForm.operatorCode.focus();")} +${zhiqim_manager_history("operator.htm")} +${request.getValidateScript()} + + + +${zhiqim_manager_breadcrumb_parent("operator.htm", "操作员管理", "增加操作员")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<#if ZmrSuperAdminRule.check(request)> + + + + + +
            增加操作员
            操作员编码:(2-16位字母数字或汉字开头,字母数字汉字特殊字符组成,特殊字符支持._-`~!@#$% *
            操作员名称:(64位不定长字符) *
            操作员密码:(6-16位密码,大写字母、小写字母、数字和特殊字符必须四选三,特殊字符支持._-`~!@#$% *  
            操作员状态:(停用或正常) *
            操作员手机号: *
            操作员个人微信号: *
            操作员类型:(管理员或操作员) *
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/operatorAddSuccess.zml b/zhiqim_manager/resource/zview/zhiqim_manager/operatorAddSuccess.zml new file mode 100644 index 0000000..8b67379 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/operatorAddSuccess.zml @@ -0,0 +1,34 @@ +${Styles.htmlOverflowHidden()} + + + + + + + + + + + + + + + +
            设计平台地址:${host}
            登录账号:${operatorCode}
            初始密码:${operatorPass}
            +  温馨提示:首次登陆请务必修改密码 +<#-- 操作 --> +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/operatorDeptSelector.zml b/zhiqim_manager/resource/zview/zhiqim_manager/operatorDeptSelector.zml new file mode 100644 index 0000000..4054d54 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/operatorDeptSelector.zml @@ -0,0 +1,47 @@ +${Styles.htmlOverflowHidden()} + + +<#-- 查询 --> +
            +
            + + + +
            +
            + +<#-- 列表 --> +
            + + + + + + +${zhiqim_manager_tr_no_record(list, 3, "没有可设置的部门")} +<#for item : list> + + + + + + + + + +<#-- 操作 --> +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/operatorModify.zml b/zhiqim_manager/resource/zview/zhiqim_manager/operatorModify.zml new file mode 100644 index 0000000..e34a625 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/operatorModify.zml @@ -0,0 +1,79 @@ +${zhiqim_manager_history("operator.htm")} +${request.getValidateScript()} + + + +${zhiqim_manager_breadcrumb_parent("operator.htm" "操作员管理" "修改操作员")} +${zhiqim_manager_content()} + + + + +
            选择部门名称状态
            ${item.getDeptName()}<#if item.getDeptStatus()==0>正常<#else>停用
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<#if ZmrSuperAdminRule.check(request)> + + + + +<#else> + + + + + +
            修改操作员
            操作员编码:${operator.getOperatorCode()}
            操作员名称:(64位不定长字符) *
            操作员密码:(为空表示不修改,如果修改请输入6-16位密码,大小写字母数字特殊字符必须四选三,特殊字符支持._-`~!@#$%  
            操作员状态:(停用或正常) + +  * +
            操作员手机号: *
            操作员个人微信号: *
            操作员类型:(管理员或操作员) + +  * +
            操作员类型: + + <#if operator.getOperatorType()=2>操作员 + <#if operator.getOperatorType()=1>管理员 + <#if operator.getOperatorType()=0>超级管理员 +
            +${zhiqim_manager_submit()} + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/operatorOnline.zml b/zhiqim_manager/resource/zview/zhiqim_manager/operatorOnline.zml new file mode 100644 index 0000000..c21a509 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/operatorOnline.zml @@ -0,0 +1,58 @@ + + +${zhiqim_manager_breadcrumb("操作员在线列表")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + +<#for item : result.list()> + + + + + + + + + +${zhiqim_manager_tr_no_record(result, 6, "暂时没有操作员在线")} +
            操作员编码操作员名称登录时间最后访问管理员操作
            ${item.getOperatorCode()}${item.getOperatorName()}${item.getCreateTime()}${item.getLastAccessTime()}(还剩${item.getRemainMinute()}分钟)<#if item.getOperatorType() lt 2>是<#else>否 + <#if sessionUser.getSessionId() == item.getSessionId()> + 自己 + <#elseif ZmrAdminRule.check(request)> + + <#else> + -- + +
            +${zhiqim_manager_paging(result)} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/operatorRoleSelector.zml b/zhiqim_manager/resource/zview/zhiqim_manager/operatorRoleSelector.zml new file mode 100644 index 0000000..1052466 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/operatorRoleSelector.zml @@ -0,0 +1,47 @@ +${Styles.htmlOverflowHidden()} + + +<#-- 查询 --> +
            +
            + + + +
            +
            + +<#-- 列表 --> +
            + + + + + + +${zhiqim_manager_tr_no_record(list, 3, "没有可设置的角色")} +<#for item : list> + + + + + + + + + +<#-- 操作 --> +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/operatorRule.zml b/zhiqim_manager/resource/zview/zhiqim_manager/operatorRule.zml new file mode 100644 index 0000000..d81b1b6 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/operatorRule.zml @@ -0,0 +1,77 @@ +<#-- 显示子菜单,并递归显示下级子菜单 --> +<#function showChildMenu(self, parent)> +
            选择角色名称状态
            ${item.getRoleName()}<#if item.getRoleStatus()==0>正常<#else>停用
            + + + + + + + +
            + <#var level = self.self().getMenuLevel()/> + <#for i : 1..(level-1)> + <#if self.isLastNode(level-i)> + + <#else> + + + + <#if self.hasChildren()> + + <#else> + + + + checked onclick='Z.Forms.doSelectCheckBoxTree("rule", this.checked, this.value, this.form);' value="${self.self().getMenuCode()}"> + #{self.self().getMenuName()} + #{self.self().getMenuNameAbbr()}#{self.self().getMenuCode()}#{self.self().getMenuLevel()}<#if self.self().getMenuType()==1>节点<#else>属性
            +<#if self.hasChildren()> + + + +${zhiqim_manager_history("operator.htm")} + +${zhiqim_manager_breadcrumb_parent("operator.htm" "操作员管理" "操作员权限信息")} +${zhiqim_manager_content()} + + + + +
            & 说明:根据系统菜单显示操作员权限信息
            +<#if operator.getOperatorType() gt 0> +
            + + + + + + + + + + + + + + + + + + + + +
            操作员[${operator.getOperatorCode()}]权限表
            菜单目录菜单简称菜单编码菜单级别菜单类型
            checked onclick='Z.Forms.doSelectCheckBoxTree("rule", this.checked, this.value, this.form);' value="#{tree.self().getMenuCode()}">系统功能根菜单#{tree.self().getMenuNameAbbr()}#{tree.self().getMenuCode()}#{tree.self().getMenuLevel()}根节点
            +<#for child : tree.children()> +${showChildMenu(child, tree)} + +<#if operator.getOperatorType() gt 0> +${zhiqim_manager_submit()} +
            + +${zhiqim_manager_list(menuSize)} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/operatorRuleView.zml b/zhiqim_manager/resource/zview/zhiqim_manager/operatorRuleView.zml new file mode 100644 index 0000000..9c8b46a --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/operatorRuleView.zml @@ -0,0 +1,70 @@ +<#-- 显示子菜单,并递归显示下级子菜单 --> +<#function showChildMenu(self, parent)> + + + + + + + + +
            + <#var level = self.self().getMenuLevel()/> + <#for i : 1..(level-1)> + <#if self.isLastNode(level-i)> + + <#else> + + + + <#if self.hasChildren()> + + <#else> + + + + #{self.self().getMenuName()} + #{self.self().getMenuNameAbbr()}#{self.self().getMenuCode()}#{self.self().getMenuLevel()}<#if self.self().getMenuType()==1>节点<#else>属性
            +<#if self.hasChildren()> + + + +${zhiqim_manager_history("operator.htm")} + +${zhiqim_manager_breadcrumb_parent("operator.htm" "操作员管理" "操作员权限信息")} +${zhiqim_manager_content()} + + + + +
            & 说明:根据系统菜单显示操作员权限信息
            + + + + + + + + + + + + + + + + + + +
            操作员[${operator.getOperatorCode()}]权限表
            菜单目录菜单简称菜单编码菜单级别菜单类型
            系统功能根菜单#{tree.self().getMenuNameAbbr()}#{tree.self().getMenuCode()}#{tree.self().getMenuLevel()}根节点
            +<#for child : tree.children()> +${showChildMenu(child, tree)} + + +${zhiqim_manager_return()} +${zhiqim_manager_list(menuSize)} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/operatorSelector.zml b/zhiqim_manager/resource/zview/zhiqim_manager/operatorSelector.zml new file mode 100644 index 0000000..a1f922a --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/operatorSelector.zml @@ -0,0 +1,49 @@ +${Styles.htmlOverflowHidden()} + + +<#-- 查询 --> +
            +
            + + +
            +
            + +<#-- 列表 --> +
            + + + + + + + +${zhiqim_manager_tr_no_record(list, 4, "没有可选择的操作员")} +<#for item : list> + + + + + + + + + + +<#-- 操作 --> +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/operatorsSelector.zml b/zhiqim_manager/resource/zview/zhiqim_manager/operatorsSelector.zml new file mode 100644 index 0000000..f8833d4 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/operatorsSelector.zml @@ -0,0 +1,49 @@ +${Styles.htmlOverflowHidden()} + + +<#-- 查询 --> +
            +
            + + + +
            + +<#-- 列表 --> +
            +
            选择操作员头像操作员编码操作员姓名
            ${item.getOperatorCode()}${item.getOperatorName()}
            + + + + + + +${zhiqim_manager_tr_no_record(list, 4, "没有可选择的操作员")} +<#for item : list> + + + + + + + + + + +<#-- 操作 --> +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/org.zml b/zhiqim_manager/resource/zview/zhiqim_manager/org.zml new file mode 100644 index 0000000..b38a541 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/org.zml @@ -0,0 +1,69 @@ +${zhiqim_manager_breadcrumb("组织管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> +
            选择操作员头像操作员编码操作员姓名
            ${item.getOperatorCode()}${item.getOperatorName()}
            + + + + + + + + + +<#if size == 0> +${zhiqim_manager_no_record(6, "暂时没有组织信息")} +<#else> +<#for item : list> + + + + + <#if item.getOrgLevel() == 0 > + + + <#if item.getOrgLevel() == 1 > + + + + + + + + + +
            选择组织编号组织名称组织状态组织级别组织负责人
            + <#if ZmrAdminRule.check(request)> + + + ${item.getOrgId()}#{item.getOrgName()} + <#if item_index == list.size()-1> + + <#else> + + + #{item.getOrgName()} + <#if item.getOrgStatus() == 0>正常<#else>停用${item.getOrgLevel()}${item.getOrgManager()}
            +${zhiqim_manager_list(list.size())} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/orgAdd.zml b/zhiqim_manager/resource/zview/zhiqim_manager/orgAdd.zml new file mode 100644 index 0000000..ba06392 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/orgAdd.zml @@ -0,0 +1,36 @@ +${Scripts.onload("document.theForm.orgName.focus();")} +${zhiqim_manager_history("org.htm")} +${request.getValidateScript()} + +${zhiqim_manager_breadcrumb_parent("org.htm" "组织管理" "增加组织")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + +
            增加组织
            上级组织:${parent.getOrgName()}
            组织名称:(2-12位) *
            组织状态:(正常|停用) *
            组织排序数:(必须是[0, 999999]范围的非负整数) *
            组织描述:(不能超过100个汉字)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/orgModify.zml b/zhiqim_manager/resource/zview/zhiqim_manager/orgModify.zml new file mode 100644 index 0000000..b0999bd --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/orgModify.zml @@ -0,0 +1,57 @@ +${zhiqim_manager_history("org.htm")} +${request.getValidateScript()} + + +${zhiqim_manager_breadcrumb_parent("org.htm" "组织管理" "修改组织")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            修改组织
            组织编号:#{org.getOrgId()}
            组织名称:(2-12位) *
            组织状态:(正常|停用) *
            组织排序数:(必须是[0, 999999]范围的非负整数) *
            组织负责人:
            组织描述:(不能超过100个汉字)
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/orgRule.zml b/zhiqim_manager/resource/zview/zhiqim_manager/orgRule.zml new file mode 100644 index 0000000..d6d9da8 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/orgRule.zml @@ -0,0 +1,69 @@ + + +${zhiqim_manager_breadcrumb("组织权限")} +${zhiqim_manager_content()} +
            + +
            + + + + + + + + + +
            + + <#for item : list> + class="z-bg-gray" > + <#if item.getOrgLevel() == 0 > + + + <#if item.getOrgLevel() == 1 > + + + + +
            ${item.getOrgName()} + <#if item_index == list.size()-1> + + <#else> + + + + ${item.getOrgName()} +
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/orgSelector.zml b/zhiqim_manager/resource/zview/zhiqim_manager/orgSelector.zml new file mode 100644 index 0000000..5c8f5cd --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/orgSelector.zml @@ -0,0 +1,62 @@ +${Styles.htmlOverflowHidden()} + + +<#-- 查询 --> +
            +
            + + +
            +
            + +<#-- 列表 --> +
            + + + + + + +${zhiqim_manager_tr_no_record(list, 3, "没有可选择的组织")} +<#for item : list> + + + + <#if item.getOrgLevel() == 0 > + + + <#if item.getOrgLevel() == 1 > + + + + + +
            选择组织名称组织状态
            #{item.getOrgName()} + <#if item_index == list.size()-1> + + <#else> + + + #{item.getOrgName()} + <#if item.getOrgStatus() == 0>正常<#else>停用
            +
            + +<#-- 操作 --> +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/param.zml b/zhiqim_manager/resource/zview/zhiqim_manager/param.zml new file mode 100644 index 0000000..55264e6 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/param.zml @@ -0,0 +1,59 @@ +${request.getValidateSubmitScript()} + +${zhiqim_manager_breadcrumb("系统参数")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#for group : groupMap.entrySet()> + +${zhiqim_manager_tr_title(4, "系统参数["+group.getKey()+"]列表")} + + + + + + +${zhiqim_manager_tr_no_record(group.getValue(), 4, "暂时没有参数信息")} +
            参数键参数值操作参数描述
            +<#for item : group.getValue().values()> +<#if ZmrAdminRule.check(request) && item.getParamType() == "public"> +
            + + + + + + + <#if ZmrAdminRule.check(request) && item.getParamType() == "public"> + + + <#else> + + + + + +
            #{item.getParamKey()}class="zi-samp">#{item.getParamValue()}#{item.getParamDesc()}
            +<#if ZmrAdminRule.check(request) && item.getParamType() == "public"> +
            + + + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/paramOperator.zml b/zhiqim_manager/resource/zview/zhiqim_manager/paramOperator.zml new file mode 100644 index 0000000..67a273e --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/paramOperator.zml @@ -0,0 +1,47 @@ +${zhiqim_manager_breadcrumb("操作员参数管理")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 操作 --> +<#if ZmrAdminRule.check(request)> +
            + + +
            + + +<#-- 列表 --> + + + + + + +${zhiqim_manager_tr_no_record(result, 3, "暂时没有操作员参数信息")} +<#for item : result.list()> + + + + + + +
            选择操作员参数键操作员参数描述
            ${item.getParamKey()}#{item.getParamDesc()}
            +${zhiqim_manager_paging(result)} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/paramOperatorAdd.zml b/zhiqim_manager/resource/zview/zhiqim_manager/paramOperatorAdd.zml new file mode 100644 index 0000000..1d78174 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/paramOperatorAdd.zml @@ -0,0 +1,23 @@ +${Scripts.onload("document.theForm.paramKey.focus();")} +${zhiqim_manager_history("paramOperator.htm")} +${request.getValidateScript()} + +${zhiqim_manager_breadcrumb_parent("paramOperator.htm", "操作员参数", "增加操作员参数")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + +
            增加操作员参数
            操作员参数键:(32位不定长字符) *
            操作员参数描述:(200位不定长字符) *
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/presenter/deptOperatorInfo.zml b/zhiqim_manager/resource/zview/zhiqim_manager/presenter/deptOperatorInfo.zml new file mode 100644 index 0000000..962ad7b --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/presenter/deptOperatorInfo.zml @@ -0,0 +1,33 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> + + + + + + + + + + + +${zhiqim_manager_tr_no_record(operatorList, 4, "暂时没有操作员信息")} +<#for item : operatorList> + + + + + + + +
            部门[${dept.getDeptName()}]成员 + <#if ZmrAdminRule.check(request)> + + +
            成员编号成员头像成员姓名操作
            ${item.getOperatorCode()}${item.getOperatorName()} + <#if ZmrAdminMutexRule.check(request, item)> + + <#else> + -- + +
            +${zhiqim_manager_list(operatorList.size())} diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/presenter/deptRuleInfo.zml b/zhiqim_manager/resource/zview/zhiqim_manager/presenter/deptRuleInfo.zml new file mode 100644 index 0000000..e60fee1 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/presenter/deptRuleInfo.zml @@ -0,0 +1,70 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> +<#-- 显示子菜单,并递归显示下级子菜单 --> +<#function showChildMenu(self, parent)> + + + + + + + +
            + <#var level = self.self().getMenuLevel()/> + <#for i : 1..(level-1)> + <#if self.isLastNode(level-i)> + + <#else> + + + + <#if self.hasChildren()> + + <#else> + + + + <#if ZmrAdminRule.check(request)> + checked onclick='Z.Forms.doSelectCheckBoxTree("rule", this.checked, this.value, this.form);' value="${self.self().getMenuCode()}"> + + #{self.self().getMenuName()} + #{self.self().getMenuCode()}#{self.self().getMenuLevel()}<#if self.self().getMenuType()==1>节点<#else>属性
            +<#if self.hasChildren()> + + + + +
            + + + + + + + + + + + + + + + + + +
            部门[${dept.getDeptName()}]权限表
            菜单目录菜单编码菜单级别菜单类型
            <#if ZmrAdminRule.check(request)>checked onclick='Z.Forms.doSelectCheckBoxTree("rule", this.checked, this.value, this.form);' value="#{tree.self().getMenuCode()}">系统功能根菜单#{tree.self().getMenuCode()}#{tree.self().getMenuLevel()}根节点
            +<#for child : tree.children()> +${showChildMenu(child, tree)} + +<#if ZmrAdminRule.check(request)> + + + + +
            + +
            +${zhiqim_manager_list(menuSize)} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/presenter/orgRuleInfo.zml b/zhiqim_manager/resource/zview/zhiqim_manager/presenter/orgRuleInfo.zml new file mode 100644 index 0000000..27627d3 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/presenter/orgRuleInfo.zml @@ -0,0 +1,70 @@ +<#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/> +<#-- 显示子菜单,并递归显示下级子菜单 --> +<#function showChildMenu(self, parent)> + + + + + + + +
            + <#var level = self.self().getMenuLevel()/> + <#for i : 1..(level-1)> + <#if self.isLastNode(level-i)> + + <#else> + + + + <#if self.hasChildren()> + + <#else> + + + + <#if ZmrAdminRule.check(request)> + checked onclick='Z.Forms.doSelectCheckBoxTree("rule", this.checked, this.value, this.form);' value="${self.self().getMenuCode()}"> + + #{self.self().getMenuName()} + #{self.self().getMenuCode()}#{self.self().getMenuLevel()}<#if self.self().getMenuType()==1>节点<#else>属性
            +<#if self.hasChildren()> + + + + +
            + + + + + + + + + + + + + + + + + +
            组织[${org.getOrgName()}]权限表
            菜单目录菜单编码菜单级别菜单类型
            <#if ZmrAdminRule.check(request)>checked onclick='Z.Forms.doSelectCheckBoxTree("rule", this.checked, this.value, this.form);' value="#{tree.self().getMenuCode()}">系统功能根菜单#{tree.self().getMenuCode()}#{tree.self().getMenuLevel()}根节点
            +<#for child : tree.children()> +${showChildMenu(child, tree)} + +<#if ZmrAdminRule.check(request)> + + + + +
            <#if org.getOrgLevel() == 1>
            + +
            +${zhiqim_manager_list(menuSize)} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/presenter/processInfo.zml b/zhiqim_manager/resource/zview/zhiqim_manager/presenter/processInfo.zml new file mode 100644 index 0000000..145df0d --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/presenter/processInfo.zml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + +
            进程基本信息
            进程pid:${pid}系统运行时间和平均负载:${list.get(0)}
            进程内线程状态:${list.get(1)}CPU状态:${list.get(2)}
            物理内存:${list.get(3)}交换空间:${list.get(4)}
            + + + + + + + + + + + + + + + + + + + + +<#for item : pageResult.list()> + + + + + + + + + + + + + + + + +
            线程状态列表
            PIDUSERPRNIVIRTRESSHRS%CPU%MEMTIME+COMMAND操作
            ${item.get(0)}${item.get(1)}${item.get(2)}${item.get(3)}${item.get(4)}${item.get(5)}${item.get(6)}${item.get(7)}${item.get(8)}${item.get(9)}${item.get(10)}${item.get(11)}
            + + + + + +
            ${PagingStd.toHtmlClick(pageResult,"doShowInfo")}
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/presenter/selSysAvatarInfo.zml b/zhiqim_manager/resource/zview/zhiqim_manager/presenter/selSysAvatarInfo.zml new file mode 100644 index 0000000..9f15f75 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/presenter/selSysAvatarInfo.zml @@ -0,0 +1,24 @@ + +<#if result.size() == 0> + + + +<#else> + + + + + + + +
            + 很抱歉,没有找到系统头像! +
            +
              + <#for item : result.list()> +
            • + +
            • + +
            +
            ${PagingStd.toHtmlClick(result,"doQuerySysAvatar")}
            diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/process.zml b/zhiqim_manager/resource/zview/zhiqim_manager/process.zml new file mode 100644 index 0000000..531addc --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/process.zml @@ -0,0 +1,55 @@ + + +${zhiqim_manager_breadcrumb("进程信息")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 显示进程信息 --> +
            + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/processThreadStack.zml b/zhiqim_manager/resource/zview/zhiqim_manager/processThreadStack.zml new file mode 100644 index 0000000..ba2c35a --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/processThreadStack.zml @@ -0,0 +1,12 @@ +${Styles.htmlOverflowHidden()} +
            + <#if Validates.isNotEmptyBlank(stackInfo)> +
            ${stackInfo}
            + <#else> + 无堆栈信息 + + +
            + +
            +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/profile.zml b/zhiqim_manager/resource/zview/zhiqim_manager/profile.zml new file mode 100644 index 0000000..d7e7606 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/profile.zml @@ -0,0 +1,127 @@ + + +${zhiqim_manager_breadcrumb_name("个人中心")} +${zhiqim_manager_content()} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            基本信息:
            用户昵称:#{sessionUser.getOperatorCode()}(#{sessionUser.getOperatorName()})
            用户头像:更换头像
            手机号码:<#if Validates.isNotEmpty(operator.getOperatorMobile())>${sessionUser.getOperatorMobile()}(已绑定)<#else>(未绑定)修改
            电子邮箱:<#if Validates.isNotEmpty(operator.getOperatorEmail())>${sessionUser.getOperatorEmail()}(已绑定)<#else>(未绑定)修改
            登录密码:******修改
            个人微信: + + <#if Validates.isNotEmpty(operator.getOperatorWxcode())> + ${sessionUser.getOperatorWxcode()} + (已绑定) + <#else> + (未绑定) + + + 修改
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/role.zml b/zhiqim_manager/resource/zview/zhiqim_manager/role.zml new file mode 100644 index 0000000..1e3281b --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/role.zml @@ -0,0 +1,53 @@ +${zhiqim_manager_breadcrumb("操作员角色")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + + + +<#if list.isEmpty()> +${zhiqim_manager_no_record(6, "暂时没有角色信息")} + +<#for item : list> + + + + + + + + + +
            选择角色编号角色名称角色状态角色排序数操作
            + <#if ZmrAdminRule.check(request)> + + + ${item.getRoleId()}#{item.getRoleName()}<#if item.getRoleStatus() == 0>正常<#else>停用${item.getRoleSeq()} + <#if ZmrPathRule.check(request, "/"+zhiqim_manager+"/roleOperator.htm")> + <#if ZmrPathRule.check(request, "/"+zhiqim_manager+"/roleRule.htm")> +
            +${zhiqim_manager_list(list.size())} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/roleAdd.zml b/zhiqim_manager/resource/zview/zhiqim_manager/roleAdd.zml new file mode 100644 index 0000000..694034b --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/roleAdd.zml @@ -0,0 +1,28 @@ +${Scripts.onload("document.theForm.roleName.focus();")} +${zhiqim_manager_history("role.htm")} +${request.getValidateScript()} + +${zhiqim_manager_breadcrumb_parent("role.htm" "操作员角色" "增加角色")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + +
            增加角色
            角色名称:(2-16位) *
            角色状态:(正常|停用) *
            角色排序数:(必须是[0, 999999]范围的非负整数) *
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/roleModify.zml b/zhiqim_manager/resource/zview/zhiqim_manager/roleModify.zml new file mode 100644 index 0000000..2832b38 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/roleModify.zml @@ -0,0 +1,32 @@ +${zhiqim_manager_history("role.htm")} +${request.getValidateScript()} + +${zhiqim_manager_breadcrumb_parent("role.htm" "操作员角色" "修改角色")} +${zhiqim_manager_content()} +
            + + + + + + + + + + + + + + + + + + + + + + +
            修改角色
            角色编号:(由不定长6位字母或数字组合)#{item.getRoleId()}
            角色名称:(不能超过32个汉字) *
            角色状态:(正常|停用) *
            角色排序数:(必须是[0, 999999]范围的非负整数) *
            +${zhiqim_manager_submit()} +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/roleOperator.zml b/zhiqim_manager/resource/zview/zhiqim_manager/roleOperator.zml new file mode 100644 index 0000000..d6dcd67 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/roleOperator.zml @@ -0,0 +1,83 @@ + +${zhiqim_manager_breadcrumb("部门成员")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + +${zhiqim_manager_tr_no_record(operatorList, 4, "暂时没有操作员信息")} +<#for item : operatorList> + + + + + + + +
            成员编号成员头像成员姓名操作
            ${item.getOperatorCode()}${item.getOperatorName()} + <#if ZmrAdminMutexRule.check(request, item)> + + <#else> + -- + +
            +${zhiqim_manager_list(operatorList.size())} + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/roleOperatorSelector.zml b/zhiqim_manager/resource/zview/zhiqim_manager/roleOperatorSelector.zml new file mode 100644 index 0000000..604e3a4 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/roleOperatorSelector.zml @@ -0,0 +1,49 @@ +${Styles.htmlOverflowHidden()} + + +<#-- 查询 --> +
            +
            + + + +
            +
            + +<#-- 列表 --> +
            + + + + + + + +${zhiqim_manager_tr_no_record(operatorList, 4, "没有可选择的操作员")} +<#for item : operatorList> + + + + + + + + + + +<#-- 操作 --> +
            + + +
            \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/roleRule.zml b/zhiqim_manager/resource/zview/zhiqim_manager/roleRule.zml new file mode 100644 index 0000000..f8b1a36 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/roleRule.zml @@ -0,0 +1,80 @@ +<#-- 显示子菜单,并递归显示下级子菜单 --> +<#function showChildMenu(self, parent)> +
            操作员头像操作员编码操作员姓名
            ${item.getOperatorCode()}${item.getOperatorName()}
            + + + + + + +
            + <#var level = self.self().getMenuLevel()/> + <#for i : 1..(level-1)> + <#if self.isLastNode(level-i)> + + <#else> + + + + <#if self.hasChildren()> + + <#else> + + + + <#if ZmrAdminRule.check(request)> + checked onclick='Z.Forms.doSelectCheckBoxTree("rule", this.checked, this.value, this.form);' value="${self.self().getMenuCode()}"> + + #{self.self().getMenuName()} + #{self.self().getMenuCode()}#{self.self().getMenuLevel()}<#if self.self().getMenuType()==1>节点<#else>属性
            +<#if self.hasChildren()> + + + + +${zhiqim_manager_breadcrumb("角色权限")} +${zhiqim_manager_content()} +
            + +
            + +
            + + + + + + + + + + + + + + +
            菜单目录菜单编码菜单级别菜单类型
            <#if ZmrAdminRule.check(request)>checked onclick='Z.Forms.doSelectCheckBoxTree("rule", this.checked, this.value, this.form);' value="#{tree.self().getMenuCode()}">系统功能根菜单#{tree.self().getMenuCode()}#{tree.self().getMenuLevel()}根节点
            +<#for child : tree.children()> +${showChildMenu(child, tree)} + +<#if ZmrAdminRule.check(request)> + + + + +
            + +
            +${zhiqim_manager_list(menuSize)} + +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/themeIndex.zml b/zhiqim_manager/resource/zview/zhiqim_manager/themeIndex.zml new file mode 100644 index 0000000..b56a7b3 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/themeIndex.zml @@ -0,0 +1,54 @@ + + +${zhiqim_manager_breadcrumb("更换主题风格")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +
            + + +<#for template : templateList> +<#if template_index % 2 == 0> + + + +<#if template_index % 2 == 1> + + + +<#if templateList.size() % 2 ==1> + + + +
            +

            + <#if ZmrAdminRule.check(request)> + + +
             
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/themeMain.zml b/zhiqim_manager/resource/zview/zhiqim_manager/themeMain.zml new file mode 100644 index 0000000..35c3b1d --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/themeMain.zml @@ -0,0 +1,54 @@ + + +${zhiqim_manager_breadcrumb("更换主题风格")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +
            + + +<#for template : templateList> +<#if template_index % 2 == 0> + + + +<#if template_index % 2 == 1> + + + +<#if templateList.size() % 2 ==1> + + + +
            +

            + <#if ZmrAdminRule.check(request)> + + +
             
            +
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_manager/resource/zview/zhiqim_manager/validatePassword.zml b/zhiqim_manager/resource/zview/zhiqim_manager/validatePassword.zml new file mode 100644 index 0000000..1156ee5 --- /dev/null +++ b/zhiqim_manager/resource/zview/zhiqim_manager/validatePassword.zml @@ -0,0 +1,36 @@ +${Styles.htmlOverflowHidden()} + + +<#-- 查询 --> + + + + + +
            验证密码: + + +
            + +<#-- 操作 --> +
            + +
            \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/SmsUtils.java b/zhiqim_manager/src/org/zhiqim/manager/SmsUtils.java new file mode 100644 index 0000000..99932d2 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/SmsUtils.java @@ -0,0 +1,161 @@ +package org.zhiqim.manager; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.regex.Pattern; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Validates; + +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; + +/** + * ƶŷͷ + * + * @version V1.2.0 @author caohong 2020-12-26 Ӱƶŷ + */ +public class SmsUtils +{ + private static final Log log = LogFactory.getLog(SmsUtils.class); + + // Ʒ:ͨŶAPIƷ,滻 + public static final String product = "Dysmsapi"; + // Ʒ,滻 + public static final String domain = "dysmsapi.aliyuncs.com"; + public static final String accessKeyId = Global.getString("aliyun.sms", "accessKeyId"); + public static final String accessKeySecret = Global.getString("aliyun.sms", "accessKeySecret"); + + /** + * [Ҫ]:֤
            + * + * @author caohong + * @param request Ự + * @param mobile ֻ + * @param templateCode ģcode
            + * SMS_174195343 ֤֤:֤${code}ڽ֤Ҫ߱Ŷ
            + * SMS_174195340 ûע֤:֤${code}עΪûл֧֣
            + * SMS_174195339 ޸֤:֤${code}ڳ޸ĵ¼룬Ʊ˻Ϣ
            + * @throws Exception + */ + public static void sendSmsCode(HttpRequest request, String mobile, String templateCode) throws Exception + { + if (Validates.isEmpty(mobile)) + { + return; + } + + if (Validates.isNotEmpty(mobile)) + { + boolean isMatch = Pattern.matches(ZmrConstants.ZMR_MOBILE, mobile); + if (!isMatch) + { + return; + } + } + + if (Validates.isEmpty(templateCode)) + { + templateCode = "SMS_174195343"; + } + + int smsCode = 123456; + if (isProdSystem(request)) + { + smsCode = (int) ((Math.random() * 9 + 1) * 100000); + } + + // Ͷ + doSendSms(mobile, smsCode, templateCode); + + // Ựбֻ֤ + request.setSessionAttribute("_smscode_", smsCode); + } + + /** + * [Ҫ]:ƶŽӿ
            + * + * @author caohong + * @param mobile ֻ + * @param smsCode ֤ + * @param templateCode ģcode
            + * SMS_174195343 ֤֤:֤${code}ڽ֤Ҫ߱Ŷ
            + * SMS_174195340 ûע֤:֤${code}עΪûл֧֣
            + * SMS_174195339 ޸֤:֤${code}ڳ޸ĵ¼룬Ʊ˻Ϣ
            + * @throws Exception + */ + @SuppressWarnings("deprecation") + private static void doSendSms(String mobile, int smsCode, String templateCode) throws Exception + { + if (Validates.isEmpty(templateCode)) + { + templateCode = "SMS_174195343"; + } + + // óʱʱ-е + System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); + System.setProperty("sun.net.client.defaultReadTimeout", "10000"); + + // ʼascClient,ʱֶ֧region޸ģ + IClientProfile profile = DefaultProfile.getProfile("cn-fujian", "LTAI5tPxirUFsFnUsaVpk5Ya", "8QmWrHrkATccUXCFtYqVTk5nSx99hO"); + //IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKeyId, accessKeySecret); + DefaultProfile.addEndpoint("cn-fujian", "cn-fujian", product, domain); + IAcsClient acsClient = new DefaultAcsClient(profile); + // װ + SendSmsRequest request = new SendSmsRequest(); + // ʹpostύ + // :ֻš֧ԶŷָʽãΪ1000ֻ,ڵüʱӳ,֤͵ĶƼʹõõķʽ + request.setPhoneNumbers(mobile); + // :ǩ-ڶſ̨ҵ + request.setSignName("촴"); + // :ģ + request.setTemplateCode(templateCode); + // ѡ:ģеı滻JSON,ģΪ"װ${name},֤Ϊ${code}"ʱ + request.setTemplateParam("{\"code\":\"" + smsCode + "\"}"); + // ʧClientException쳣 + SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request); + if (sendSmsResponse.getCode() != null && sendSmsResponse.getCode().equals("OK")) + { + // log.info("ֻš" + mobile + "Ͷ֤롾" + smsCode + "ɹ"); + } + else + { + log.error("ֻš" + mobile + "Ͷ֤롾" + smsCode + "ʧܣ" + sendSmsResponse.getMessage()); + } + } + + public static void main(String[] args) throws Exception { + doSendSms("17362985940", 545454, "SMS_463645918"); + } + + /** + * Ƿ + * + * @author caohong + * @param request + * @return + */ + private static boolean isProdSystem(HttpRequest request) + { + try + { + URI uri = new URI(request.getRequestURL().toString()); + if (!uri.getHost().startsWith("localhost") && !uri.getHost().startsWith("127") && !uri.getHost().startsWith("192")) + { + return true; + } + } + catch (URISyntaxException e) + { + log.error(e.getMessage(), e); + } + return false; + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/ZmrBootstrap.java b/zhiqim_manager/src/org/zhiqim/manager/ZmrBootstrap.java new file mode 100644 index 0000000..0994777 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/ZmrBootstrap.java @@ -0,0 +1,350 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager; + +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.config.ItemType; +import org.zhiqim.kernel.extend.SS; +import org.zhiqim.kernel.schedule.Day; +import org.zhiqim.kernel.schedule.Scheduler; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Images; +import org.zhiqim.kernel.util.Randoms; +import org.zhiqim.kernel.util.Resources; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.RSA; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.manager.dbo.ZmrAvatar; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrMenu; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.manager.dbo.ZmrOrgRule; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; + +/** + * 初始化引导类 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +public class ZmrBootstrap extends ZmrBootstrapApi +{ + private ZmrPassworder passworder; // 管理台密码器 + private ORMServer zmrServer; // 管理台独立数据库 + private ORMServer oprServer; // 操作员独立数据库 + + /*******************************************************************************/ + // 静态传入request获取属性 + /*******************************************************************************/ + + /** 获取管理台独立数据库表指令类 */ + public static ZTable table(HttpRequest request) + { + return request.getContextAttribute(ZmrBootstrap.class).table(); + } + + /** 获取操作员独立数据库表指令类 */ + public static ZTable tableOpr(HttpRequest request) + { + return request.getContextAttribute(ZmrBootstrap.class).tableOpr(); + } + + /** 获取管理台独立数据库表指令类 */ + public static ZTable table(HttpContext context) + { + return context.getAttribute(ZmrBootstrap.class).table(); + } + + /** 获取操作员独立数据库表指令类 */ + public static ZTable tableOpr(HttpContext context) + { + return context.getAttribute(ZmrBootstrap.class).tableOpr(); + } + + /*******************************************************************************/ + // 三个属性的获取 + /*******************************************************************************/ + + /** 获取管理台密码器 */ + public ZmrPassworder getPassworder() + { + return passworder; + } + + /** 获取管理台独立数据库表指令类 */ + public ZTable table() + { + return zmrServer.table(); + } + + /** 获取操作员独立数据库表指令类 */ + public ZTable tableOpr() + { + return oprServer.table(); + } + + /*******************************************************************************/ + // 初始化 + /*******************************************************************************/ + + @Override + protected void initBefore() throws Exception + { + context.setAttribute(ZmrBootstrap.class, this); + + initORMServer(); + initPassworder(); + } + + @Override + protected void initAfter() throws Exception + { + initOperator(); + initMenu(); + initParam(); + initAvatar(); + initOrg(); + initOrgRule(); + initDept(); + + // 设置主题默认值 + context.setAttribute(ZMR_THEME_INDEX, ZmrParamDao.getThemeIndex(context)); + context.setAttribute(ZMR_THEME_MAIN, ZmrParamDao.getThemeMain(context)); + + // 增加删除日志任务 + Scheduler scheduler = Global.getWithoutNew(Scheduler.class); + scheduler.addTask(new Day(new ZmrTask(this), 5, 5, 5)); + } + + /** 初始化管理台独立数据库 */ + private void initORMServer() + { + // 1.判断是否有管理台独立数据库 + String zmrOrm = context.getTopAttributeString(ZMR_ORM); + if (Validates.isEmptyBlank(zmrOrm)) + {// 未配置取默认值 + zmrServer = ORM.server(context); + } + else + {// 有配置必须检查正确性 + zmrServer = ORM.server(zmrOrm); + Asserts.asserts(zmrServer != null, "上下文环境[%s]配置的管理台数据库ID[zmr.orm]未找到对应的数据库服务", context.getContextName()); + } + + // 2.判断是否有操作员独立数据库 + String zmrOrmOpr = context.getTopAttributeString(ZMR_ORM_OPR); + if (Validates.isEmptyBlank(zmrOrmOpr)) + {// 未配置取管理台独立数据库 + oprServer = zmrServer; + } + else + {// 有配置必须检查正确性 + oprServer = ORM.server(zmrOrmOpr); + Asserts.asserts(oprServer != null, "上下文环境[%s]配置的管理台操作员数据库ID[zmr.orm.opr]未找到对应的数据库服务", context.getContextName()); + } + + } + + /** 初始化密码器 */ + private void initPassworder() + { + String zmrPassworder = context.getTopAttributeString(ZMR_PASSWORDER, ZMR_PASSWORDER_DEFAULT); + Object instance = Global.newInstance(zmrPassworder); + Asserts.asserts(instance instanceof ZmrPassworder, "上下文环境[%s]的密码器配置[zmr.passworder]不是ZmrPassworder或子类", context.getContextName()); + + passworder = (ZmrPassworder) instance; + } + + /** 初始化组织,使用操作员独立数据库 */ + private void initOrg() throws Exception + { + if (tableOpr().count(ZmrOrg.class) > 0) + { + return; + } + + ZmrOrg org = new ZmrOrg(); + org.setOrgId(ID13); + org.setOrgName("湖南秒绘科技有限公司"); + org.setOrgStatus(0); + org.setOrgLevel(0); + + tableOpr().insert(org); + } + + /** 初始操作员,使用操作员独立数据库 */ + private void initOperator() throws Exception + { + int count = tableOpr().count(ZmrOperator.class); + if (count > 0) + { + return; + } + + String datetime = DateTimes.getDateTimeString(); + String passSalt = Randoms.lettersDigitsSecure(64); + + ZmrOperator operator = new ZmrOperator(); + operator.setOrgId(ID13); + operator.setOperatorCode("miaohui"); + operator.setOperatorPass(passworder.encode("miaohui", ZMR_PASSWORD, passSalt)); + operator.setOperatorPassSalt(passSalt); + operator.setOperatorStatus(0); + operator.setOperatorType(0); + operator.setOperatorName("超级管理员"); + operator.setOperatorCreated(datetime); + operator.setOperatorModified(datetime); + + table().replace(operator); + } + + /** 初始化菜单 */ + private void initMenu() throws Exception + { + if (table().count(ZmrMenu.class) > 0) + { + return; + } + + String path = context.getAttributeString(ZMR_MENU_SQL); + if (Validates.isEmpty(path)) + { + return; + } + + String sqls = context.getResourceString(path); + if (sqls == null) + { + return; + } + + List sqlList = Sqls.toSqlList(sqls); + if (sqlList.isEmpty()) + { + return; + } + + zmrServer.sql().execute(sqlList); + } + + /** 初始化参数 */ + private void initParam() throws Exception + { + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_THEME_INDEX, "00_default", 1, ItemType.PROTECTED, "首页主题(在首页主题中修改)"); + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_THEME_MAIN, "00_default", 2, ItemType.PROTECTED, "主页主题(在主页主题中修改)"); + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_THEME_FRAME, "false", 3, ItemType.PUBLIC, "主题是否使用iframe风格"); + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_HAS_MANAGE_LOGIN, "false", 4, ItemType.PUBLIC, "是否使用管理页登录退出功能"); + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_HAS_VERIFICATION_CODE, "false", 5, ItemType.PUBLIC, "是否需要验证码"); + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_HAS_REMEMBER_CODE, "true", 6, ItemType.PUBLIC, "是否显示记住用户名"); + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_HAS_REMEMBER_PASS, "false", 7, ItemType.PUBLIC, "是否显示记住密码"); + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_MAIN_URL, "/${zhiqim_manager}/main.htm", 8, ItemType.PUBLIC, "登录之后的主页地址"); + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_REMAIN_LOG_DAY, "7", 9, ItemType.PUBLIC, "保留操作员日志天数"); + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_OPERATOR_DEPT_ALL_RULE, "true", 10, ItemType.PUBLIC, "操作员权限是否继承上级部门权限"); + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_CDN_PATH, "", 11, ItemType.PUBLIC, "如果CDN路径不为空,JS文件优先取CDN路径"); + + SS keys = RSA.buildKeyPair();// 密钥对 + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_PUBLIC_KEY, keys.key(), 12, ItemType.PRIVATE, "随机生成的公钥"); + ZmrParamDao.addParam(context, ZMR_NAME, ZMR_PRIVATE_KEY, keys.value(), 13, ItemType.PRIVATE, "随机生成的私钥"); + } + + /** 初始化头像 */ + private void initAvatar() throws Exception + { + if (table().count(ZmrAvatar.class) > 0) + { + return; + } + + long avatarId = 1000000000001L; + List avatarNameList = Resources.getResourceNameList(ZmrBootstrap.class, AVATAR_PREFIX); + for (String avatarName : avatarNameList) + { + byte[] data = Streams.getBytesClassPath(ZmrBootstrap.class, AVATAR_PREFIX + avatarName); + + byte[] bytes50 = Images.resizePNG(data, 50, 50); + byte[] bytes100 = Images.resizePNG(data, 100, 100); + byte[] bytes150 = Images.resizePNG(data, 150, 150); + + ZmrAvatar avatar = new ZmrAvatar(); + avatar.setAvatarId(avatarId++); + avatar.setAvatarType(0); + avatar.setAvatarTime(System.currentTimeMillis()); + avatar.setAvatar50(bytes50); + avatar.setAvatar100(bytes100); + avatar.setAvatar150(bytes150); + + table().insert(avatar); + } + } + + /** 初始化组织权限 */ + private void initOrgRule() throws Exception + { + List list = table().list(ZmrOrgRule.class, new Selector("orgId", ID13)); + if (list.size() > 0) + { + return; + } + + List menuList = table().list(ZmrMenu.class); + if (Validates.isEmpty(menuList)) + { + return; + } + + for (int i = 0; i < menuList.size(); i++) + { + ZmrOrgRule rule = new ZmrOrgRule(); + rule.setOrgId(ID13); + rule.setMenuCode(menuList.get(i).getMenuCode()); + list.add(rule); + } + + table().insertBatch(list); + } + + /** 初始化部门 */ + private void initDept() throws Exception + { + if (table().count(ZmrDept.class) > 0) + { + return; + } + + ZmrDept dept = new ZmrDept(); + dept.setOrgId(ID13); + dept.setParentId(0); + dept.setDeptId(ID13); + dept.setDeptName("湖南秒绘科技有限公司"); + dept.setDeptStatus(0); + dept.setDeptLevel(0); + dept.setDeptParentAll("0"); + + table().insert(dept); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/ZmrBootstrapApi.java b/zhiqim_manager/src/org/zhiqim/manager/ZmrBootstrapApi.java new file mode 100644 index 0000000..a7e664a --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/ZmrBootstrapApi.java @@ -0,0 +1,106 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpdConstants; +import org.zhiqim.httpd.context.ZmlBootstrap; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.manager.dbo.ZmrOperatorLog; + +/** + * 管理台引导类缺省类,各系统可继承该类进行引导,以保证有以下功能: + * 1、登录之后处理 + * 2、退出之前处理 + * 3、POST日志打印到操作日志表中 + * + * @version v1.0.0 @author zouzhigang 2017-9-22 新建与整理 + */ +public class ZmrBootstrapApi extends ZmlBootstrap implements ZmrConstants, HttpdConstants +{ + /** + * 登录之后处理接口 + * + * @param request 请求 + */ + public void logined(HttpRequest request) + { + } + + /** + * 退出之前处理接口 + * + * @param request 请求 + */ + public void logouting(HttpRequest request) + { + } + + /** + * 日志输出接口 + * + * @param request 请求 + * @param message 消息 + */ + public void log(HttpRequest request, String message) + { + log(request, message, null); + } + + /** + * 日志输出接口 + * + * @param request 请求 + * @param message 消息 + * @param e 访问时产生的异常 + */ + public void log(HttpRequest request, String message, Throwable e) + { + super.log(request, message, e); + + if (!request.isMethodPost()) + {//HEAD、GET不写日志 + return; + } + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (sessionUser == null) + {//未登录不写日志 + return; + } + + String operateDesc = Strings.formatMessage(message, e); + + try + { + ZmrOperatorLog log = new ZmrOperatorLog(); + log.setOrgId(sessionUser.getOperator().getOrgId()); + log.setOperatorCode(sessionUser.getOperatorCode()); + log.setOperateTime(Sqls.nowTimestamp()); + log.setOperateUrl(request.getRequestURL()); + log.setOperateDesc(operateDesc); + + request.getContextAttribute(ZmrBootstrap.class).table().insert(log); + } + catch (Exception ex) + { + log.error("写入操作日志到数据库时异常", ex); + } + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/ZmrCdnRuntime.java b/zhiqim_manager/src/org/zhiqim/manager/ZmrCdnRuntime.java new file mode 100644 index 0000000..56fe4bb --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/ZmrCdnRuntime.java @@ -0,0 +1,64 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager; + +import java.sql.SQLException; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.orm.ORMException; +import org.zhiqim.zml.ZmlVarRuntime; + +/** + * 变量zhiqim.js运行时取值,对应格式如: + * <#var zhiqim.js = new ZmrCdnRuntime(context, "/service/res/zhiqim_v1.4.0.r2018010101.min.js")/> + * + * @version v1.0.0 @author zouzhigang 2018-2-26 新建与整理 + */ +@AnAlias("ZmrCdnRuntime") +public class ZmrCdnRuntime implements ZmlVarRuntime, ZmrConstants +{ + private HttpContext context; + private String pathInContext; + + public ZmrCdnRuntime(HttpContext context, String pathInContext) + { + this.context = context; + this.pathInContext = pathInContext; + } + + @Override + public Object build() + { + try + { + String cdnPath = ZmrParamDao.getString(context, ZMR_NAME, ZMR_CDN_PATH); + if (Validates.isEmptyBlank(cdnPath)) + return context.getRootPath(pathInContext); + else + return Strings.trimRight(cdnPath, "/") + pathInContext; + } + catch (ORMException | SQLException e) + { + return context.getRootPath(pathInContext); + } + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/ZmrConstants.java b/zhiqim_manager/src/org/zhiqim/manager/ZmrConstants.java new file mode 100644 index 0000000..4d9b0c0 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/ZmrConstants.java @@ -0,0 +1,65 @@ +package org.zhiqim.manager; + +import org.zhiqim.httpd.context.ZmlContextConstants; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.constants.ZhiqimConstants; + +/** + * 知启蒙管理台常量定义 + * + * @version v1.0.0 @author zhichenggang 2017-1-2 新建与整理 + */ +@AnAlias("ZmrConstants") +public interface ZmrConstants extends ZmlContextConstants, ZhiqimConstants +{ + public static final String ZMR_NAME = "zhiqim.manager"; + public static final String ZMR_PATH = "zhiqim_manager"; + public static final String ZMR_PASSWORDER_DEFAULT = "org.zhiqim.manager.ZmrPassworder"; + public static final String ZMR_PASSWORD = "miaohui@2020"; + public static final String ZMR_PAGE_SIZE = "zmr_page_size"; + public static final String ZMR_MENU_SQL = "zmr_menu_sql"; + public static final String ZMR_PASSWORDER = "zmr.passworder"; + public static final String ZMR_ORM = "zmr.orm"; + public static final String ZMR_ORM_OPR = "zmr.orm.opr"; + public static final String ZMR_BOOTSTRAP = ZmrBootstrap.class.getName(); + /** 11位手机号 */ + public static final String ZMR_MOBILE = "^0?(13|14|15|16|17|18|19)[0-9]{9}$"; + + /**********************************************************************************/ + // 参数表 + /**********************************************************************************/ + + public static final String ZMR_THEME_INDEX = "themeIndex"; + public static final String ZMR_THEME_MAIN = "themeMain"; + public static final String ZMR_THEME_FRAME = "themeFrame"; + public static final String ZMR_HAS_MANAGE_LOGIN = "hasManageLogin"; + public static final String ZMR_MH_IP = "mhIp"; + public static final String ZMR_HAS_VERIFICATION_CODE = "hasVerificationCode"; + public static final String ZMR_HAS_REMEMBER_CODE = "hasRememberCode"; + public static final String ZMR_HAS_REMEMBER_PASS = "hasRememberPass"; + public static final String ZMR_MAIN_URL = "mainUrl"; + public static final String ZMR_REMAIN_LOG_DAY = "remainLogDay"; + public static final String ZMR_OPERATOR_DEPT_ALL_RULE = "operatorDeptAllRule"; + public static final String ZMR_CDN_PATH = "cdnPath"; + public static final String ZMR_PUBLIC_KEY = "publicKey"; + public static final String ZMR_PRIVATE_KEY = "privateKey"; + + public static final String ZMR_MAIN_URL_DEFAULT = "/${zhiqim_manager}/main.htm"; + public static final String ZMR_MAIN_URL_WELCOME = "/${zhiqim_manager}/welcome.htm"; + public static final String ZMR_TEMPLATE_INNER = "/ztmpl/zhiqim_manager/inner.htm"; + public static final String ZMR_THEME_DEFAULT = "00_default"; + + /**********************************************************************************/ + // 会话键 + /**********************************************************************************/ + + public static final String ZMR_SESSION_USER_DEPT_ID = "zmr_session_user_dept_id"; + public static final String ZMR_SESSION_USER_ROLE_ID = "zmr_session_user_role_id"; + + /**********************************************************************************/ + // 头像字段 + /**********************************************************************************/ + + public static final String AVATAR_PREFIX = "/org/zhiqim/manager/avatar/"; + public static final String IMAGE_DATA_PNG_BASE64 = "data:image/png;base64,"; +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/ZmrInterceptor.java b/zhiqim_manager/src/org/zhiqim/manager/ZmrInterceptor.java new file mode 100644 index 0000000..b24fc8f --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/ZmrInterceptor.java @@ -0,0 +1,49 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Interceptor; +import org.zhiqim.kernel.annotation.AnAlias; + +/** + * 检查是否登录拦截器 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +@AnAlias("chkZmrLogin") +public class ZmrInterceptor implements Interceptor, ZmrConstants +{ + @Override + public void intercept(HttpRequest request) throws Exception + { + if (request.hasSessionUser(ZmrSessionUser.class)) + {// 已登录不拦截 + return; + } + + if (request.isXMLHttpRequest()) + {// AJAX访问 + request.setResponseError("您闲置太久或未登录,请重新登录后再操作..."); + } + else + {// URL访问 + request.setRedirectTop("/" + request.getContextAttributeString(ZMR_PATH) + "/logout.htm", "您闲置太久或未登录,正在返回初始界面,请确定....."); + } + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/ZmrPassworder.java b/zhiqim_manager/src/org/zhiqim/manager/ZmrPassworder.java new file mode 100644 index 0000000..5028034 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/ZmrPassworder.java @@ -0,0 +1,97 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager; + +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.MD5; +import org.zhiqim.kernel.util.codes.SHA256; + +/** + * 密码器,系统提供一个默认的SHA256的编码算法和HEX的简单加解密算法 + * 1、建议各系统编写一个子类重写该类的三个方法,并配置到zmr.passwroder中 + * 2、如果未打开保存密码功能,encrypt/decrypt可忽略 + * + * @version v1.0.0 @author zhichenggang 2017-1-1 新建与整理 + */ +public class ZmrPassworder implements ZmrConstants +{ + /** + * 操作员密码不可逆编码,默认SHA256(name + code + pass + salt) + * + * @param operatorCode 操作员编码 + * @param operatorPass 操作员密码 + * @param operatorPassSalt 操作员密码盐值 + * @return 编码之后的密码 + */ + public String encode(String operatorCode, String operatorPass, String operatorPassSalt) + { + return SHA256.encodeUTF8(Z_NAME + operatorCode + operatorPass + operatorPassSalt); + } + + /** + * 密钥编码,默认MD5(name + code + salt),取MD5前10 + len + 后20 + * + * @param operatorCode 操作员编码 + * @param operatorPass 操作员密码 + * @param operatorPassSalt 操作员密码盐值 + * @return 编码之后的密码 + */ + public String secret(String operatorCode, String operatorPass, String operatorPassSalt) + { + String value = Strings.prefixZero(operatorPass.length(), 2); + String md5 = MD5.encodeUTF8(Z_NAME + operatorCode + operatorPassSalt); + return md5.substring(0, 10) + value + md5.substring(12); + } + + /** + * 验证密钥是否正确 + * + * @param operatorCode 操作员编码 + * @param operatorPass 操作员密码 + * @param operatorPassSalt 操作员密码盐值 + * @param operatorPassSecr 操作员存储的密钥 + * @return =true表示正确 + */ + public boolean secretChk(String operatorCode, String operatorPass, String operatorPassSalt, String operatorPassSecr) + { + if (secretLen(operatorPassSecr) != operatorPass.length()) + return false; + + return operatorPassSecr.equals(secret(operatorCode, operatorPass, operatorPassSalt)); + } + + /** + * 取出密钥中的真实密码长度值 + * + * @param secret 操作员密码 + * @return 加密后密码 + */ + public int secretLen(String secret) + { + if (!Validates.isMD5String(secret)) + return 0; + + String value = secret.substring(10, 12); + if (!Validates.isNumeric(value)) + return 0; + + return Ints.toInt(value); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/ZmrSessionUser.java b/zhiqim_manager/src/org/zhiqim/manager/ZmrSessionUser.java new file mode 100644 index 0000000..90c256c --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/ZmrSessionUser.java @@ -0,0 +1,651 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpSessionUser; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnGenerics; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrMenu; +import org.zhiqim.manager.dbo.ZmrOperator; + +/** + * 操作员会话用户信息 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +@AnAlias("ZmrSessionUser") +public class ZmrSessionUser extends HttpSessionUser implements ZmrConstants +{ + private ZmrOperator operator; + + @AnGenerics(ZmrMenu.class) + private List menuList; + private String topFirstMenuCode; + private String menuUrlRules; + private String mainUrl; + private String welcomeUrl; + private long selectedOrgId; + private boolean sidebar = true; + + public ZmrSessionUser() + { + this.menuList = new ArrayList(); + } + + @Override + public String getSessionName() + { + return operator.getOperatorCode(); + } + + public ZmrOperator getOperator() + { + return operator; + } + + public String getRootPath(String path) + { + return getContext().getRootPath(path); + } + + public int getOperatorTypeThenG() + { + return isSuperAdmin() ? 0 : 1; + } + + /***************************************************************************************/ + // 操作员相关信息 + /***************************************************************************************/ + + public ZmrSessionUser setOperator(ZmrOperator operator) + { + this.operator = operator; + return this; + } + + public long getOperatorOrgId() + { + return operator.getOrgId(); + } + + public String getOperatorCode() + { + return operator.getOperatorCode(); + } + + public String getOperatorName() + { + return operator.getOperatorName(); + } + + public String getOperatorPassSalt() + { + return operator.getOperatorPassSalt(); + } + + public int getOperatorType() + { + return operator.getOperatorType(); + } + + public boolean isSuperAdmin() + { + return getOperatorType() == 0; + } + + public boolean isAdmin() + { + return operator.getOperatorType() == 0 || operator.getOperatorType() == 1; + } + + public String getOperatorMobile() + { + return operator.getOperatorMobile(); + } + + public String getOperatorEmail() + { + return operator.getOperatorEmail(); + } + + public String getOperatorWangwang() + { + return operator.getOperatorWangwang(); + } + + public String getOpenId() + { + return operator.getOpenId(); + } + + public String getWkwechatAccount() + { + return operator.getWkwechatAccount(); + } + + public String getOperatorWxcode() + { + return operator.getOperatorWxcode(); + } + + /***************************************************************************************/ + // 操作员参数相关信息 + /***************************************************************************************/ + + public boolean hasOperatorParam(String key) + { + if (Validates.isEmptyBlank(operator.getOperatorParam())) + { + return false; + } + + return Jsons.getString(operator.getOperatorParam(), key) != null; + } + + public String getOperatorParam(String key) + { + if (Validates.isEmptyBlank(operator.getOperatorParam())) + { + return null; + } + + return Jsons.getString(operator.getOperatorParam(), key); + } + + public int getOperatorParamInt(String key) + { + if (Validates.isEmptyBlank(operator.getOperatorParam())) + { + return -1; + } + + return Jsons.getInt(operator.getOperatorParam(), key); + } + + public long getOperatorParamLong(String key) + { + if (Validates.isEmptyBlank(operator.getOperatorParam())) + { + return -1; + } + + return Jsons.getLong(operator.getOperatorParam(), key); + } + + /***************************************************************************************/ + // 操作员权限相关信息 + /***************************************************************************************/ + + public ZmrSessionUser setMenuList(HttpContext context, List menuList) throws Exception + { + if (menuList == null || menuList.isEmpty()) + { + return this; + } + + this.menuList = menuList; + StringBuffer strb = new StringBuffer(); + for (ZmrMenu menu : menuList) + { + menu.setMenuUrl(ZmlContexts.parseZmlContent(context, menu.getMenuUrl())); + if (menu.getMenuStatus() != 0) + { + continue; + } + + if (menu.getMenuUrl() != null) + { + strb.append(menu.getMenuUrl()).append(","); + } + } + + menuUrlRules = strb.toString(); + + // 取顶级第一个栏目 + for (ZmrMenu menu : menuList) + { + if (menu.getMenuStatus() != 0) + { + continue; + } + + if (menu.getMenuType() == 1 && menu.getMenuLevel() == 1) + { + topFirstMenuCode = menu.getMenuCode(); + break; + } + } + + return this; + } + + public List getMenuList() + { + return menuList; + } + + public boolean hasMenuRule(String path) + { + if (path == null) + { + return false; + } + + return menuUrlRules.indexOf(path) != -1; + } + + /** 获取顶级栏目 */ + public List getTopMenuList() + { + List list = new ArrayList<>(); + for (ZmrMenu menu : menuList) + { + if (menu.getMenuStatus() != 0) + { + continue; + } + + if (menu.getMenuLevel() == 1 && menu.getMenuType() == 1) + { + list.add(menu); + } + } + + return list; + } + + /** 获取顶级栏目 */ + public ZmrMenu getTopMenuFirst() + { + for (ZmrMenu menu : menuList) + { + if (menu.getMenuStatus() != 0) + { + continue; + } + + if (menu.getMenuLevel() == 1 && menu.getMenuType() == 1) + { + return menu; + } + } + + return null; + } + + /** 判断存在子菜单 */ + public boolean hasChildMenu(String menuCode) + { + for (ZmrMenu menu : menuList) + { + if (menu.getMenuStatus() != 0) + { + continue; + } + + if (menu.getParentCode().equals(menuCode) && menu.getMenuType() == 1) + { + return true; + } + } + + return false; + } + + /** 获取第一个子菜单 */ + public ZmrMenu getChildMenuFirst(String menuCode) + { + for (ZmrMenu menu : menuList) + { + if (menu.getMenuStatus() != 0) + { + continue; + } + + if (menu.getParentCode().equals(menuCode) && menu.getMenuType() == 1) + { + return menu; + } + } + + return null; + } + + /** 获取子菜单列表 */ + public List getChildMenuList(String menuCode) + { + List list = new ArrayList<>(); + for (ZmrMenu menu : menuList) + { + if (menu.getMenuStatus() != 0) + { + continue; + } + + if (menu.getParentCode().equals(menuCode) && menu.getMenuType() == 1) + { + list.add(menu); + } + } + + return list; + } + + /** 通过子菜单获取顶级菜单 */ + public ZmrMenu getTopMenuByChild(String childMenuCode) + { + if (childMenuCode == null) + { + return null; + } + + ZmrMenu child = null; + for (ZmrMenu menu : menuList) + { + if (menu.getMenuStatus() != 0) + { + continue; + } + + if (menu.getMenuCode().equals(childMenuCode)) + { + if (menu.getMenuType() != 1 && menu.getMenuLevel() != 1) + { + return null;// 不是二级菜单,暂时不支持 + } + + child = menu; + break; + } + } + + return (child == null) ? null : getMenu(child.getParentCode()); + } + + /** + * 获取选中的顶级菜单,允许页面指定,未指定取当前mainUrl进行比较,如果未找到返回null + * + * @param designatedPath 指定的路径 + * @return 选中的菜单 + */ + public String getSelectedTopMenuCodeByMainUrl(String designatedPath) + { + return getSelectedTopMenuCode(mainUrl, designatedPath, null); + } + + /** + * 获取选中的顶级菜单,允许页面指定,未指定取当前path进行比较,如果未找到则取第一个顶级菜单 + * + * @param request 请求 + * @param designatedPath 指定的路径 + * @return 选中的菜单 + */ + public String getSelectedTopMenuCodeOrFirstMenuCode(HttpRequest request, String designatedPath) + { + return getSelectedTopMenuCode(request.getPathInContext(), designatedPath, topFirstMenuCode); + } + + /** + * 获取选中的顶级菜单,允许页面指定,未指定取当前path进行比较,如果未找到取缺省值 + * + * @param request 请求 + * @param designatedPath 指定的路径 + * @param defaultMenuCode 缺省菜单 + * @return 选中的菜单 + */ + public String getSelectedTopMenuCode(HttpRequest request, String designatedPath) + { + return getSelectedTopMenuCode(request.getPathInContext(), designatedPath, null); + } + + /** + * 获取选中的顶级菜单,允许页面指定,未指定取当前path进行比较,如果未找到取缺省值 + * + * @param requestPath 请求路径 + * @param designatedPath 指定的路径 + * @param defaultMenuCode 缺省菜单 + * @return 选中的菜单 + */ + public String getSelectedTopMenuCode(String requestPath, String designatedPath, String defaultMenuCode) + { + String path = (designatedPath == null) ? requestPath : designatedPath; + ZmrMenu menu = getMenuByPath(path); + if (menu == null || menu.getMenuLevel() == 0) + { + return defaultMenuCode; + } + + if (menu.getMenuLevel() == 1) + {// 顶级 + return menu.getMenuType() == 1 ? menu.getMenuCode() : defaultMenuCode; + } + + while (true) + {// 大于顶级循环找到顶级为止 + menu = getMenu(menu.getParentCode()); + if (menu == null) + { + return null; + } + + if (menu.getMenuLevel() > 1) + { + continue; + } + + return menu.getMenuType() == 1 ? menu.getMenuCode() : defaultMenuCode; + } + } + + /** + * 获取选中的顶级菜单,允许页面指定,未指定取当前path进行比较,如果未找到则取第一个顶级菜单 + * + * @param request 请求 + * @param designatedPath 指定的path + * @return + */ + public String getSelectedSecondMenuCode(HttpRequest request, String designatedPath) + { + String path = (designatedPath == null) ? request.getPathInContext() : designatedPath; + ZmrMenu menu = getMenuByPath(path); + if (menu == null || menu.getMenuLevel() <= 1) + { + return null; + } + + if (menu.getMenuLevel() == 2) + {// 二级 + return menu.getMenuType() == 1 ? menu.getMenuCode() : null; + } + + while (true) + {// 大于二级循环找到二级为止 + menu = getMenu(menu.getParentCode()); + if (menu == null) + { + return null; + } + + if (menu.getMenuLevel() > 2) + { + continue; + } + + return menu.getMenuType() == 1 ? menu.getMenuCode() : null; + } + } + + public ZmrMenu getMenu(String menuCode) + { + for (ZmrMenu menu : menuList) + { + if (menu.getMenuStatus() != 0) + { + continue; + } + + if (menuCode.equals(menu.getMenuCode())) + { + return menu; + } + } + + return null; + } + + /** 通过路径找到菜单,级别大的优先 */ + public ZmrMenu getMenuByPath(String path) + { + int ind = path.indexOf("?"); + if (ind != -1) + { + path = path.substring(0, ind); + } + + ZmrMenu selected = null; + for (ZmrMenu menu : menuList) + { + if (menu.getMenuStatus() != 0) + { + continue; + } + + if (Validates.isNotEmpty(menu.getMenuUrl()) && menu.getMenuUrl().contains(path)) + { + if (selected == null || selected.getMenuLevel() < menu.getMenuLevel()) + { + selected = menu; + } + } + } + + return selected; + } + + /**************************************************************************************/ + // 框架时左右相关信息 + /**************************************************************************************/ + + public String getMainUrl() + { + return mainUrl; + } + + public void setMainUrl(String mainUrl) + { + this.mainUrl = mainUrl; + } + + public void setWelcomeUrl(String welcomeUrl) + { + this.welcomeUrl = welcomeUrl; + } + + public boolean isWelcomeUrl() + { + return Validates.isEqual(welcomeUrl, mainUrl); + } + + public void setSidebar(boolean sidebar) + { + this.sidebar = sidebar; + } + + public boolean hasSidebar() + { + return sidebar; + } + + public String getSidebarClass() + { + return sidebar ? "" : "z-hide"; + } + + /**************************************************************************************/ + // 头像相关信息 + /**************************************************************************************/ + + public String getAvatar50() + { + return operator.getOperatorAvatar() == 0 ? getRootPath(_PATH_SERVICE_RES_AVATAR_) : getAvatarUrl(getOperatorAvatar(), 50); + } + + public String getAvatar100() + { + return operator.getOperatorAvatar() == 0 ? getRootPath(_PATH_SERVICE_RES_AVATAR_) : getAvatarUrl(getOperatorAvatar(), 100); + } + + public String getAvatar150() + { + return operator.getOperatorAvatar() == 0 ? getRootPath(_PATH_SERVICE_RES_AVATAR_) : getAvatarUrl(getOperatorAvatar(), 150); + } + + public long getOperatorAvatar() + { + return operator.getOperatorAvatar(); + } + + public String getAvatarUrl(long avatarId, int avatarSize) + { + return getRootPath(new StringBuffer("/").append(getContext().getAttribute("zhiqim_manager")).append("/avatar/").append(avatarId).append("/") + .append(avatarSize).append(".png").toString()); + } + + /**************************************************************************************/ + // 会话默认选中 + /**************************************************************************************/ + + public long getSelectedDeptId(long defaultValue) + { + return getValueLong(ZMR_SESSION_USER_DEPT_ID, defaultValue); + } + + public long getSelectedRoleId(long defaultValue) + { + return getValueLong(ZMR_SESSION_USER_ROLE_ID, defaultValue); + } + + public long getSelectedOrgId() + { + return selectedOrgId; + } + + public void setSelectedOrgId(long orgId) + { + this.selectedOrgId = orgId; + } + + public boolean isPresaleRole() + {// 操作员是否客服角色 + String presaleRole = operator.getOperatorRole(); + if (Validates.isEmpty(presaleRole)) + { + return false; + } + + return presaleRole.contains("1806211542344560"); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/ZmrTask.java b/zhiqim_manager/src/org/zhiqim/manager/ZmrTask.java new file mode 100644 index 0000000..d6436fc --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/ZmrTask.java @@ -0,0 +1,103 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOperatorLog; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * 管理台任务 + * 1)检查超级管理员是否需要关闭 + * 2)删除保留时长之外的操作日志 + * + * @version v1.0.0 @author zouzhigang 2017-7-19 新建与整理 + */ +public class ZmrTask implements Task +{ + private static final Log log = LogFactory.getLog(ZmrTask.class); + private ZmrBootstrap bootstrap; + + public ZmrTask(ZmrBootstrap bootstrap) + { + this.bootstrap = bootstrap; + } + + @Override + public void execute() + { + //检查超级管理员是否需要关闭 + chkCloseSuperAdmin(); + + //删除保留时长之外的操作日志 + delExpireOperateLog(); + } + + /** 检查超级管理员是否需要关闭 */ + private void chkCloseSuperAdmin() + { + try + { + if (bootstrap.tableOpr().count(ZmrOperator.class, new Selector("operatorType", 0).addMust("operatorStatus", 0)) == 0) + {//超级管理员已停用的不处理 + return; + } + + if (bootstrap.tableOpr().count(ZmrOperator.class, new Selector("operatorType", 1).addMust("operatorStatus", 0)) == 0) + {//如果没有正常的管理员,则不停用超级管理员 + return; + } + + //有正常的管理员,则停用超级管理员 + bootstrap.tableOpr().update(ZmrOperator.class, new Updater().addField("operatorStatus", 1).addMust("operatorType", 0)); + log.info("停用超级管理员成功..."); + } + catch (Exception e) + { + log.error("停用超级管理员时异常", e); + } + } + + /** 删除保留时长之外的操作日志 */ + private void delExpireOperateLog() + { + try + { + int remainDay = ZmrParamDao.getRemainLogDay(bootstrap.getContext()); + String datetime = DateTimes.getDateString() + " 00:00:00"; + String operateTime = DateTimes.getPreviousDateTimeString(datetime, remainDay); + + Selector selector = new Selector() + .addMustThenL("operateTime", Sqls.toTimestamp(operateTime)); + + bootstrap.table().delete(ZmrOperatorLog.class, selector); + log.info("删除[%s]之前的操作日志成功...", operateTime); + } + catch (Exception e) + { + log.error("删除之前的操作日志时异常", e); + } + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/AvatarAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/AvatarAction.java new file mode 100644 index 0000000..4bbc230 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/AvatarAction.java @@ -0,0 +1,134 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.extend.SwitchAction; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Longs; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.dbo.ZmrAvatar; +import org.zhiqim.orm.dbo.Selector; + +/** + * 操作员/系统头像管理 + */ +public class AvatarAction extends SwitchAction implements ZmrConstants +{ + public void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt(ZMR_PAGE_SIZE, 20); + + PageResult result = ZmrBootstrap.table(request).page(ZmrAvatar.class, page, pageSize, new Selector("avatarType", 0)); + request.setAttribute("result", result); + } + + public void modify(HttpRequest request) throws Exception + { + long avatarId = request.getParameterLong("avatarId"); + + ZmrAvatar avatar = ZmrBootstrap.table(request).item(ZmrAvatar.class, avatarId); + if(avatar == null) + { + request.returnHistory("头像不存在,请重新选择"); + return; + } + request.setAttribute("avatar", avatar); + } + + public void access(HttpRequest request) throws Exception + { + HttpResponse response = request.getResponse(); + + //1.判断参数 + List paramList = request.getParameterMatch(); + if (paramList == null || paramList.size() != 2 || + !Validates.isIntegerNonnegative(paramList.get(0)) || !Validates.isIntegerPositive(paramList.get(1))) + {//匹配参数失败 + response.sendError(_400_BAD_REQUEST_); + return; + } + + int avatarSize = Ints.toInt(paramList.get(1)); + if (avatarSize != 50 && avatarSize != 100 && avatarSize != 150) + {//不是50/100/150 + response.sendError(_400_BAD_REQUEST_); + return; + } + + long avatarId = Longs.toLong(paramList.get(0)); + if (avatarId == 0) + {//没有头像 + response.sendRedirect(request.getRootPath(_PATH_SERVICE_RES_AVATAR_)); + return; + } + + //2.查出记录 + Selector selector = new Selector(); + selector.addFields("avatarTime, avatar"+avatarSize); + selector.addMust("avatarId", avatarId); + + ZmrAvatar avatar = ZmrBootstrap.table(request).item(ZmrAvatar.class, selector); + if (avatar == null) + { + response.sendError(_404_NOT_FOUND_); + return; + } + + //3.清除缓存设置 + response.removeHeader(_PRAGMA_); + response.removeHeader(_P3P_); + response.removeHeader(_CACHE_CONTROL_); + + //4.判断是否未修改 + long lastModified = avatar.getAvatarTime(); + String lastModifiedTime = DateTimes.getDateTimeHttp(lastModified); + String ifModifiedSince = request.getHeader(_IF_MODIFIED_SINCE_); + if (ifModifiedSince != null && ifModifiedSince.indexOf(lastModifiedTime) != -1) + {//时间相等 + response.setHeader(_EXPIRES_, DateTimes.getDateTimeHttpNextHour()); + response.sendError(_304_NOT_MODIFIED_); + return; + } + + //5.提交修改 + response.setContentType("image/png"); + response.setHeader(_ACCEPT_RANGES_, _BYTES_); + response.setHeader(_LAST_MODIFIED_, lastModifiedTime); + response.setHeader(_EXPIRES_, DateTimes.getDateTimeHttpNextHour()); + + byte[] data = null; + switch (avatarSize) + { + case 50:data = avatar.getAvatar50();break; + case 100:data = avatar.getAvatar100();break; + case 150:data = avatar.getAvatar150();break; + } + + response.write(data); + response.commit(); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/CacheAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/CacheAction.java new file mode 100644 index 0000000..c2f26f7 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/CacheAction.java @@ -0,0 +1,75 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.GetPostAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.Service; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.orm.ORMServer; + +/** + * 系统缓存管理 + * + * @version v1.4.1 @author zouzhigang 2018-5-4 新建与整理 + */ +public class CacheAction extends GetPostAction +{ + protected void validate(HttpRequest request) + { + request.addValidate(new IsNotEmpty("id", "请选择需要刷新的数据库对象")); + request.addValidate(new IsNotEmpty("className", "请选择需要刷新的缓存对象")); + } + + protected void doGet(HttpRequest request) throws Exception + { + request.setAttribute("list", Global.getServiceList(ORMServer.class)); + } + + protected void doPost(HttpRequest request) throws Exception + { + String id = request.getParameter("id"); + String className = request.getParameter("className"); + + Service service = Global.getService(id); + if (service == null || !(service instanceof ORMServer)) + { + request.returnHistory("请选择有效的数据库对象"); + return; + } + + ORMServer server = (ORMServer)service; + Class clazz = Classes.forName(Global.getClassName(className)); + if (clazz == null) + { + request.returnHistory("请选择需要刷新的缓存对象"); + return; + } + + if (!server.isCache(clazz)) + { + request.returnHistory("该对象未设置为缓存对象"); + return; + } + + server.table().cache(clazz); + request.setAlertMsg("刷新成功"); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/ConfigAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/ConfigAction.java new file mode 100644 index 0000000..83488f4 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/ConfigAction.java @@ -0,0 +1,82 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.Collection; +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpServer; +import org.zhiqim.httpd.context.extend.GetPostAction; +import org.zhiqim.httpd.validate.ones.IsByteLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.Global; + +/** + * 配置管理类 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +public class ConfigAction extends GetPostAction +{ + protected void validate(HttpRequest request) + { + request.addValidate(new IsNotEmpty("groupId", "参数类别未获取到,请重试")); + request.addValidate(new IsNotEmpty("key", "参数编码未获取到,请重试")); + request.addValidate(new IsByteLen("value", "参数值不能为空且不能超过800个字符", 0, 800)); + } + + protected void doGet(HttpRequest request) throws Exception + { + request.setValidateConfirm("修改配置参数后会对系统产生影响,确定要修改参数吗?"); + request.setAttribute("groupList", Global.getGroupList()); + } + + protected void doPost(HttpRequest request) throws Exception + { + String groupId = request.getParameter("groupId"); + String key = request.getParameter("key"); + String value = request.getParameterNoFilter("value"); + + //相等 + String oldValue = Global.getString(groupId, key); + if (!oldValue.equals(value)) + {//更新配置文件 + Global.setValue(groupId, key, value); + Global.saveConfigByGroup(groupId); + + //查看是不是HttpServer,还需要去更新到HttpContext中 + List list = Global.getServiceList(HttpServer.class); + list: for (HttpServer server : list) + { + Collection contextList = server.getContextList(); + for (HttpContext context : contextList) + { + if (!context.getId().equals(groupId)) + continue; + + context.setAttribute(key, value); + break list; + } + } + } + + request.setAlertMsg("修改成功"); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/DeptAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/DeptAction.java new file mode 100644 index 0000000..6e78e56 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/DeptAction.java @@ -0,0 +1,183 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsIntegerValue; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.onex.IsInteger; +import org.zhiqim.kernel.tree.Tree; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrDeptDao; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.dbo.Selector; + +/** + * 部门管理 + * + * @version v1.0.0 @author zouzhigang 2015-5-29 新建与整理 + */ +public class DeptAction extends StdSwitchAction implements ZmrConstants +{ + + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsInteger("deptId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsInteger("deptId", "请选择一个选项")); + request.addValidate(new IsLen("deptName", "部门名称不能为空且不能超过32个汉字", 1, 32)); + request.addValidate(new IsIntegerValue("deptSeq", "部门排序必须是[0, 999999]范围的非负整数", 0, 999999)); + request.addValidate(new IsLen("deptDesc", "部门描述可为空或不能超过100个汉字", 0, 100)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + + Tree tree = ZmrDeptDao.getOrgDeptTree(request, orgId); + request.setAttribute("tree", tree); + request.setAttribute("size", tree.size()); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + long deptId = request.getParameterLong("deptId"); + if (deptId == -1) + { + request.returnHistory("上级部门不存在,请选择正确的部门"); + return; + } + + ZmrDept parent = ZmrBootstrap.table(request).item(ZmrDept.class, deptId); + if (parent == null) + { + request.returnHistory("上级部门不存在,请选择正确的部门"); + return; + } + + request.setAttribute("parent", parent); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long deptId = request.getParameterLong("deptId"); + ZmrDept item = ZmrBootstrap.table(request).item(ZmrDept.class, deptId); + if (item == null) + { + request.returnHistory("部门不存在,请选择正确的部门"); + return; + } + + request.setAttribute("item", item); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + ZmrDept item = request.getParameter(ZmrDept.class); + ZmrDept parent = ZmrBootstrap.table(request).item(ZmrDept.class, item.getParentId()); + if (parent == null || parent.getDeptStatus() != 0) + { + request.returnHistory("上级部门不存在或停用,请选择正确的部门"); + return; + } + + item.setDeptLevel(parent.getDeptLevel()+1); + if (parent.getDeptLevel() == 0) + item.setDeptParentAll(""+parent.getDeptId()); + else + item.setDeptParentAll(parent.getDeptParentAll() + "," + parent.getDeptId()); + + ZmrBootstrap.table(request).insert(item); + + //修改负责人所属部门 + List operatorCodeList = new ArrayList(); + if (Validates.isNotEmptyBlank(item.getDeptManager())) + operatorCodeList.add(item.getDeptManager()); + if (Validates.isNotEmptyBlank(item.getDeptSubManager())) + operatorCodeList.addAll(Lists.toStringList(item.getDeptSubManager())); + + ZmrDeptDao.doUpdateDeptManeger(request, operatorCodeList, item.getDeptId()+"", item.getDeptParentAll()); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + ZmrDept item = request.getParameter(ZmrDept.class); + ZmrBootstrap.table(request).update(item); + + //修改负责人所属部门 + List operatorCodeList = new ArrayList(); + if(Validates.isNotEmptyBlank(item.getDeptManager())) + operatorCodeList.add(item.getDeptManager()); + if(Validates.isNotEmptyBlank(item.getDeptSubManager())) + operatorCodeList.addAll(Lists.toStringList(item.getDeptSubManager())); + + ZmrDeptDao.doUpdateDeptManeger(request, operatorCodeList, item.getDeptId()+"", item.getDeptParentAll()); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long deptId = request.getParameterLong("deptId"); + ZmrDept item = ZmrBootstrap.table(request).item(ZmrDept.class, deptId); + if (item == null) + { + request.returnHistory("部门不存在,请选择正确的部门"); + return; + } + + if (item.getDeptLevel() == 0) + { + request.returnHistory("顶级部门不能删除,只允许修改"); + return; + } + + if (ZmrBootstrap.table(request).count(ZmrDept.class, new Selector("parentId", deptId)) > 0) + { + request.returnHistory("该部门有下级部门,要先删除下级部门才能删除本部门"); + return; + } + + if (ZmrBootstrap.tableOpr(request).count(ZmrOperator.class, new Selector().addMustLike("operatorDept", deptId)) > 0) + { + request.returnHistory("该部门已有操作员,请删除部门成员后再删除本部门"); + return; + } + + ZmrBootstrap.table(request).delete(ZmrDept.class, deptId); + } +} \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/DeptOperatorAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/DeptOperatorAction.java new file mode 100644 index 0000000..c991f1e --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/DeptOperatorAction.java @@ -0,0 +1,43 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.tree.Tree; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrDeptDao; +import org.zhiqim.manager.dbo.ZmrDept; + +/** + * 部门与操作员关联
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class DeptOperatorAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + + Tree tree = ZmrDeptDao.getOrgDeptTree(request, orgId); + request.setAttribute("tree", tree); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/DeptOperatorSelectorAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/DeptOperatorSelectorAction.java new file mode 100644 index 0000000..00f5c37 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/DeptOperatorSelectorAction.java @@ -0,0 +1,76 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.dbo.Selector; + +/** + * 部门操作员选择器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class DeptOperatorSelectorAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + request.setResponsePrivateCache(); + + long deptId = request.getParameterLong("deptId"); + if (deptId == -1) + { + request.returnCloseDialog("您选择的部门不存在,请选择一个有效的部门"); + return; + } + + // 获取部门 + ZmrDept dept = ZmrBootstrap.table(request).item(ZmrDept.class, deptId); + if (dept == null) + { + request.returnCloseDialog("您选择的部门不存在,请选择一个有效的部门"); + return; + } + + // 获取部门下未关联的所有操作员,管理员除外 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + Selector selector = new Selector(); + selector.addMust("orgId", dept.getOrgId()); + selector.addMustThenG("operatorType", sessionUser.getOperatorTypeThenG()); + selector.addMust("operatorStatus", 0); + String operatorKey = request.getParameter("operatorKey"); + if (Validates.isNotEmpty(operatorKey)) + {// 条件 + selector.addOr(new Selector().addMaybeLike("operatorCode", operatorKey).addMaybeLike("operatorName", operatorKey)); + } + + selector.addOr(new Selector().addMaybeIsNull("operatorDept").addMustNotLike("operatorDept", deptId)); + List operatorList = ZmrBootstrap.tableOpr(request).list(ZmrOperator.class, selector); + + request.setAttribute("dept", dept); + request.setAttribute("operatorList", operatorList); + } +} \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/DeptRuleAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/DeptRuleAction.java new file mode 100644 index 0000000..fa42748 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/DeptRuleAction.java @@ -0,0 +1,104 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.GetPostAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.tree.Tree; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrDeptDao; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrDeptRule; +import org.zhiqim.manager.dbo.ZmrMenu; +import org.zhiqim.orm.dbo.Selector; + +/** + * 部门权限列表
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class DeptRuleAction extends GetPostAction implements ZmrConstants +{ + protected void validate(HttpRequest request) + { + request.addValidate(new IsNotEmpty("deptId", "请选择部门")); + } + + @Override + protected void doGet(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + + List menuList = ZmrOrgDao.getMenuList(request, orgId); + if (menuList.isEmpty()) + { + request.setRedirect("/manager/dept.htm", "请先设置组织权限"); + return; + } + + Tree tree = ZmrDeptDao.getOrgDeptTree(request, orgId); + request.setAttribute("tree", tree); + } + + @Override + protected void doPost(HttpRequest request) throws Exception + { + long deptId = request.getParameterLong("deptId"); + String[] menuCodes = request.getParameterValuesOnCNT("rule"); + if (menuCodes == null) + menuCodes = new String[0]; + + // 判断部门是否存在 + if (ZmrBootstrap.table(request).count(ZmrDept.class, deptId) == 0) + { + request.returnHistory("您选择的部门不存在"); + return; + } + + // 重置操作员权限 + ZmrBootstrap.table(request).delete(ZmrDeptRule.class, new Selector("deptId", deptId)); + if (menuCodes.length > 0) + { + List bathList = new ArrayList(); + for (int i = 0; i < menuCodes.length; i++) + { + ZmrDeptRule rule = new ZmrDeptRule(); + rule.setDeptId(deptId); + rule.setMenuCode(menuCodes[i]); + + bathList.add(rule); + } + + ZmrBootstrap.table(request).insertBatch(bathList); + } + + //设置为当前选中 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + sessionUser.setValue(ZMR_SESSION_USER_DEPT_ID, deptId); + + request.setAlertMsg("保存成功"); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/IndexAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/IndexAction.java new file mode 100644 index 0000000..a2cec2f --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/IndexAction.java @@ -0,0 +1,142 @@ +/* + * 鐗堟潈鎵�鏈� (C) 2015 鐭ュ惎钂�(ZHIQIM) 淇濈暀鎵�鏈夋潈鍒┿�俒娆㈣繋鍔犵洘鐭ュ惎钂欙紝涓�璧烽倐閫呮鏋舵ⅵ] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.Arrays; +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNumericLen; +import org.zhiqim.kernel.constants.ZhiqimConstants; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrPassworder; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrParamDao; + +/** + * 棣栭〉 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 鏂板缓涓庢暣鐞� + */ +public class IndexAction implements Action, ZhiqimConstants, ZmrConstants +{ + @Override + public void execute(HttpRequest request) throws Exception + { + HttpContext context = request.getContext(); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (sessionUser != null) + {// 鐢ㄦ埛宸茬櫥褰曠殑锛岀洿鎺ヨ繘鍏ョ郴缁� + String mainUrl = ZmlContexts.parseZmlContent(request, ZmrParamDao.getMainUrl(context)); + if (!ZmrParamDao.isThemeFrame(context)) + { + request.setRedirect(mainUrl); + } + else + { + String defaultUrl = ZmlContexts.parseZmlContent(request, ZMR_MAIN_URL_DEFAULT); + String welcomeUrl = ZmlContexts.parseZmlContent(request, ZMR_MAIN_URL_WELCOME); + sessionUser.setMainUrl(defaultUrl.equals(mainUrl) ? welcomeUrl : mainUrl); + request.setRedirect(defaultUrl); + } + + return; + } + + request.setResponsePrivateCache(); + + request.addValidate(new IsLen("operatorCode", "璇疯緭鍏ユ纭殑甯愬彿", 2, 32)); + request.addValidate(new IsLen("operatorPass", "璇疯緭鍏ユ纭殑瀵嗙爜", 6, 90)); + + boolean hasVerificationSms = false; + String userIp = request.getRemoteAddr(); + // 鍙拡瀵笶RP璁剧疆澶栫綉鐭俊楠岃瘉鐮� + + if (userIp.contains("192.168.3.136") && request.getPort() == 8089) + { + // 姹熷竼鐢佃剳闇�瑕佸崟鐙牎楠屾祴璇� + hasVerificationSms = true; + } + else if ("0:0:0:0:0:0:0:1".equals(userIp) || userIp.contains("192.168.3") || ("127.0.0.1").equals(userIp)) + { + // localhost銆佹祴璇曠幆澧� 涓嶅仛鏍¢獙 + hasVerificationSms = false; + } + else + { + List mhIpArray = null; + String mhIpString = ZmrParamDao.getMhIp(context); + if (mhIpString == null || Validates.isEmptyBlank(mhIpString)) + { + // 鍙傛暟鏈缃椂涓嶆姤閿欙紝绛変簬ERP涓嶅啀璁剧疆澶栫綉鐭俊楠岃瘉鐮� + // request.setResponseError("鍏徃澶栫綉IP[zhiqim.manager][mhIp]鍙傛暟鏈缃�"); + // return; + } + else + { + mhIpArray = Arrays.asList(mhIpString.split(",")); + if (!mhIpArray.contains(userIp)) + { + hasVerificationSms = true; + } + } + } + + boolean hasVerificationCode = ZmrParamDao.hasVerificationCode(context); + boolean hasRememberCode = ZmrParamDao.hasRememberCode(context); + boolean hasRememberPass = ZmrParamDao.hasRememberPass(context); + if (hasVerificationSms) + { + request.addValidate(new IsNumericLen("smsCode", "鐭俊楠岃瘉鐮佷负6浣嶆暟瀛�", 6, 6)); + } + if (hasVerificationCode) + { + request.addValidate(new IsNumericLen("verificationCode", "楠岃瘉鐮佸繀椤绘槸4浣嶆暟瀛�", 4, 4)); + } + + request.setAttribute("hasRememberCode", hasRememberCode); + request.setAttribute("hasRememberPass", hasRememberPass); + request.setAttribute("hasVerificationSms", hasVerificationSms); + request.setSessionAttribute("hasVerificationSms", hasVerificationSms); + request.setAttribute("hasVerificationCode", hasVerificationCode); + + if (hasRememberCode) + {// 璁颁綇鐢ㄦ埛鍚� + String operatorCode = request.getCookie("operatorCode"); + request.setAttribute("operatorCode", operatorCode); + + if (hasRememberPass) + {// 璁颁綇瀵嗙爜 + String operatorPass = request.getCookie("operatorPass"); + if (!Validates.isEmptyBlank(operatorPass)) + { + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + int len = passworder.secretLen(operatorPass); + request.setAttribute("operatorPass", Strings.prefixLen("", len, '说')); + } + } + } + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/KeysAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/KeysAction.java new file mode 100644 index 0000000..ee86dfe --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/KeysAction.java @@ -0,0 +1,54 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.GetPostAction; +import org.zhiqim.kernel.extend.SS; +import org.zhiqim.kernel.util.codes.RSA; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.dao.ZmrParamDao; + +/** + * 修改密钥对 + * + * @version v1.0.0 @author liuhu 2018-8-29 新建与整理 + */ +public class KeysAction extends GetPostAction implements ZmrConstants +{ + protected void validate(HttpRequest request) throws Exception + { + } + + protected void doGet(HttpRequest request) throws Exception + { + String publicKey = ZmrParamDao.getPublicKey(request.getContext()); + String privateKey = ZmrParamDao.getPrivateKey(request.getContext()); + + request.setAttribute("publicKey", publicKey); + request.setAttribute("privateKey", privateKey); + } + + protected void doPost(HttpRequest request) throws Exception + { + SS keys = RSA.buildKeyPair(); + + ZmrParamDao.doUpdate(request.getContext(), ZMR_NAME, ZMR_PUBLIC_KEY, keys.key()); + ZmrParamDao.doUpdate(request.getContext(), ZMR_NAME, ZMR_PRIVATE_KEY, keys.value()); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/LogoutAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/LogoutAction.java new file mode 100644 index 0000000..664e56c --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/LogoutAction.java @@ -0,0 +1,54 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlBootstrap; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.manager.ZmrBootstrapApi; +import org.zhiqim.manager.dao.ZmrParamDao; + + +/** + * 操作员退出 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +public class LogoutAction implements Action +{ + public void execute(HttpRequest request) throws Exception + { + //1.退出之前回调退出API + Context context = (Context)request.getContext(); + ZmlBootstrap bootstrap = context.getBootstrap(); + if (bootstrap instanceof ZmrBootstrapApi) + { + ((ZmrBootstrapApi)bootstrap).logouting(request); + } + + //2.解绑会话用户 + request.unbindSessionUser(); + + //3.设置有管理登录页时,到管理登录页,否则到/index.htm + if (ZmrParamDao.hasManageLogin(request.getContext())) + { + request.setRedirectInner("/"+request.getContextAttributeString("zhiqim_manager")+".htm"); + } + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/MainAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/MainAction.java new file mode 100644 index 0000000..e451778 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/MainAction.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.lang.management.ManagementFactory; +import java.lang.management.OperatingSystemMXBean; +import java.lang.management.RuntimeMXBean; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; + +/** + * 登录后主页 + * + * @version v1.0.0 @author zouzhigang 2015-5-29 新建与整理 + */ +public class MainAction implements Action +{ + public void execute(HttpRequest request) throws Exception + { + Runtime rt = Runtime.getRuntime(); + long use = (rt.totalMemory() - rt.freeMemory()) / 1024 / 1024; + long max = rt.maxMemory() / 1024 / 1024; + + OperatingSystemMXBean system = ManagementFactory.getOperatingSystemMXBean(); + String systemVersion = system.getName() + " " + system.getVersion(); + + RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); + String pidName = runtime.getName(); + String jdkVersion = runtime.getVmName() + " " + runtime.getVmVersion(); + String startTime = DateTimes.toDateTimeString(runtime.getStartTime()); + long uptime = runtime.getUptime(); + long day = uptime / (24 * 3600 * 1000); + long hour = (uptime % (24 * 3600 * 1000)) / (3600 * 1000); + long min = (uptime % (3600 * 1000)) / (60 * 1000); + long sec = (uptime % (60 * 1000)) / 1000; + + request.setAttribute("use", use); + request.setAttribute("max", max); + request.setAttribute("pidName", pidName); + request.setAttribute("systemVersion", systemVersion); + request.setAttribute("jdkVersion", jdkVersion); + request.setAttribute("startTime", startTime); + request.setAttribute("day", day); + request.setAttribute("hour", hour); + request.setAttribute("min", min); + request.setAttribute("sec", sec); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/MenuAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/MenuAction.java new file mode 100644 index 0000000..882169a --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/MenuAction.java @@ -0,0 +1,203 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsIntegerValue; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.onex.IsInteger; +import org.zhiqim.kernel.tree.Tree; +import org.zhiqim.kernel.tree.TreeBuilder; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrMenu; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * 功能菜单管理 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +public class MenuAction extends StdSwitchAction +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("menuCode", "请选中一个菜单编码")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsNotEmpty("menuCode", "菜单编码不能为空,格式为MENU_开头的每3个数字和下划线组成的字符串")); + request.addValidate(new IsNotEmpty("parentCode", "父菜单编码不能为空")); + request.addValidate(new IsLen("menuName", "菜单名称不能为空且不能超过32个汉字", 1, 32)); + request.addValidate(new IsIntegerValue("menuStatus", "菜单状态范围为[0, 1]之间", 0, 1)); + request.addValidate(new IsIntegerValue("menuType", "菜单类型范围为[1, 2]之间", 1, 2)); + request.addValidate(new IsInteger("menuLevel", "菜单级别必须是整数")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + + List list = sessionUser.getMenuList(); + Tree tree = TreeBuilder.newTree(list, "parentCode", "menuCode"); + + request.setAttribute("menuSize", list.size()); + request.setAttribute("tree", tree); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + String menuCode = request.getParameter("menuCode"); + ZmrMenu item = ZmrBootstrap.table(request).item(ZmrMenu.class, menuCode); + if (item == null) + {// 获取菜单信息 + request.returnHistory("您选择的菜单不存在,请选择一个有效的菜单"); + return; + } + + request.setAttribute("parent", item); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String menuCode = request.getParameter("menuCode"); + String parentCode = request.getParameter("parentCode"); + + if (!menuCode.startsWith(parentCode+"_")) + { + request.returnHistory("该菜单编号格式不对,没有从父菜单编码中继承"); + return; + } + + String code = menuCode.substring(parentCode.length()+1); + if (!Validates.isNumericLen(code, 3, 3)) + { + request.returnHistory("该菜单编号格式不对,小编码为3位数字组成"); + return; + } + + if (ZmrBootstrap.table(request).count(ZmrMenu.class, menuCode) > 0) + { + request.returnHistory("该菜单编号已存在,请重选一个"); + return; + } + + //插入数据库 + ZmrMenu menu = request.getParameter(ZmrMenu.class); + ZmrBootstrap.table(request).insert(menu); + + //更新自己的会话 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + List menuList = ZmrOperatorDao.getOperatorMenuList(request, sessionUser.getOperator()); + sessionUser.setMenuList(request.getContext(), menuList); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + String menuCode = request.getParameter("menuCode"); + ZmrMenu item = ZmrBootstrap.table(request).item(ZmrMenu.class, menuCode); + if (item == null) + {// 获取菜单信息 + request.returnHistory("您选择的菜单不存在,请选择一个有效的菜单"); + return; + } + + if (item.getMenuLevel() == 0) + { + request.returnHistory("系统功能根菜单不支持修改"); + return; + } + + request.setAttribute("item", item); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + String menuCode = request.getParameter("menuCode"); + if (ZmrBootstrap.table(request).count(ZmrMenu.class, menuCode) == 0) + { + request.returnHistory("你修改的菜单不存在,请选择有效的菜单进行修改"); + return; + } + + String menuName = request.getParameter("menuName"); + int menuStatus = request.getParameterInt("menuStatus"); + String menuNameAbbr = request.getParameter("menuNameAbbr"); + int menuType = request.getParameterInt("menuType"); + String menuIcon = request.getParameter("menuIcon"); + String menuUrl = request.getParameter("menuUrl"); + String menuDesc = request.getParameter("menuDesc"); + + //更新到数据库 + Updater updater = new Updater(); + updater.addMust("menuCode", menuCode); + updater.addField("menuName", menuName); + updater.addField("menuNameAbbr", menuNameAbbr); + updater.addField("menuStatus", menuStatus); + updater.addField("menuType", menuType); + updater.addField("menuIcon", menuIcon); + updater.addField("menuUrl", menuUrl); + updater.addField("menuDesc", menuDesc); + ZmrBootstrap.table(request).update(ZmrMenu.class, updater); + + //刷新所有在线用户会话 + ZmrOperatorDao.refresh(request); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + String menuCode = request.getParameter("menuCode"); + if (ZmrBootstrap.table(request).count(ZmrMenu.class, menuCode) == 0) + { + request.returnHistory("你修改的菜单不存在,请选择有效的菜单进行修改"); + return; + } + + if (ZmrBootstrap.table(request).count(ZmrMenu.class, new Selector("parentCode", menuCode)) > 0) + { + request.returnHistory("你修改的菜单有子菜单,请先删除子菜单"); + return; + } + + ZmrBootstrap.table(request).delete(ZmrMenu.class, menuCode); + + //刷新所有在线用户会话 + ZmrOperatorDao.refresh(request); + } + + /*******************************************************************************/ + //暂不支持增加&删除 + /*******************************************************************************/ + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/OperateLogAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/OperateLogAction.java new file mode 100644 index 0000000..41ca6e9 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/OperateLogAction.java @@ -0,0 +1,69 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperatorLog; +import org.zhiqim.orm.dbo.Selector; + +/** + * 操作日志查询 + * @version v1.0.0 @author zhouwenbin 2017-6-2 新建与整理 + */ +public class OperateLogAction implements Action, ZmrConstants +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt(ZMR_PAGE_SIZE, 20); + String beginTime = request.getParameter("beginTime", DateTimes.getPreviousDateTimeString()); + String endTime = request.getParameter("endTime", DateTimes.getDateTimeString()); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + + Selector selector = new Selector(); + if (!sessionUser.isAdmin()) + {//操作员只能查看自己的 + selector.addMust("operatorCode", sessionUser.getOperatorCode()); + } + else + {//查操作员 + selector.addMaybe("operatorCode", request.getParameter("operatorCode")); + } + selector.addMaybeThenGE("operateTime", Sqls.toTimestamp(beginTime)); + selector.addMaybeThenLE("operateTime", Sqls.toTimestamp(endTime)); + selector.addOrderbyDesc("operateTime"); + selector.addMust("orgId", orgId); + + PageResult result = ZmrBootstrap.table(request).page(ZmrOperatorLog.class, page, pageSize, selector); + result.addConditionMap(request.getParameterMap()); + + request.setAttribute("result", result); + request.setAttribute("startTime", beginTime); + request.setAttribute("endTime", endTime); + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/OperatorAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorAction.java new file mode 100644 index 0000000..26c6945 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorAction.java @@ -0,0 +1,375 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; +import java.util.Random; +import java.util.regex.Pattern; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.onex.IsUserCode; +import org.zhiqim.httpd.validate.onex.IsUserPass; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Randoms; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrPassworder; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrDeptDao; +import org.zhiqim.manager.dbo.ZmrAvatar; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOperatorLog; +import org.zhiqim.manager.dbo.ZmrOperatorRule; +import org.zhiqim.manager.dbo.ZmrRole; +import org.zhiqim.manager.presenter.WorkWechatPresenter; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * 操作员/管理员管理 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +public class OperatorAction extends StdSwitchAction implements ZmrConstants +{ + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsUserCode("operatorCode", "操作员编码由2-16位字母数字汉字开头,字母汉字数字特殊符号组成")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsUserCode("operatorCode", "操作员编码由2-16位字母数字汉字开头,字母汉字数字特殊符号组成")); + request.addValidate(new IsNotEmpty("operatorName", "操作员名称不能为空")); + request.addValidate(new IsNotEmpty("operatorStatus", "操作员状态不能为空")); + request.addValidate(new IsNotEmpty("operatorMobile", "操作员手机号不能为空")); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt(ZMR_PAGE_SIZE, 20); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + + List deptList = ZmrDeptDao.getOrgDeptList(request, orgId); + List roleList = ZmrBootstrap.table(request).list(ZmrRole.class); + + Selector selector = new Selector(); + if (sessionUser.isAdmin()) + {// 管理员可以看到管理员和操作员 + selector.addMustThenG("operatorType", 0); + } + else + {// 操作员只能查操作员 + selector.addMustThenG("operatorType", 1); + } + + String operatorKey = request.getParameter("operatorKey"); + if (Validates.isNotEmpty(operatorKey)) + {// 条件 + selector.addOr(new Selector().addMaybeLike("operatorCode", operatorKey).addMaybeLike("operatorName", operatorKey)); + } + selector.addMaybe("operatorStatus", request.getParameterInt("operatorStatus")); + selector.addOrderbyAsc("operatorType"); + selector.addOrderbyAsc("operatorStatus"); + selector.addOrderbyAsc("operatorCreated"); + selector.addMust("orgId", orgId); + + PageResult result = ZmrBootstrap.tableOpr(request).page(ZmrOperator.class, page, pageSize, selector); + result.addConditionMap(request.getParameterMap()); + + for (ZmrOperator operator : result.list()) + { + toDeptName(deptList, operator); + toRoleName(roleList, operator); + } + + request.setAttribute("result", result); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + request.addValidate(new IsUserPass("operatorPass", "操作员密码不合法,要求6-16位(大小写字母数字和特殊字符必须四选三)")); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + String dateTime = DateTimes.getDateTimeString(); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + String operatorCode = request.getParameter("operatorCode"); + String operatorPass = request.getParameter("operatorPass"); + int operatorStatus = request.getParameterInt("operatorStatus"); + int operatorType = request.getParameterInt("operatorType", 2);// 默认为操作员 + String operatorName = request.getParameter("operatorName"); + String operatorMobile = request.getParameter("operatorMobile"); + String operatorWangwang = request.getParameter("operatorWangwang"); + String operatorWxcode = request.getParameter("operatorWxcode"); + + if (Validates.isNotEmpty(operatorMobile)) + { + boolean isMatch = Pattern.matches(ZmrConstants.ZMR_MOBILE, operatorMobile); + if (!isMatch) + { + request.setResponseError("请输入正确的手机号"); + return; + } + } + + if (ZmrBootstrap.tableOpr(request).count(ZmrOperator.class, operatorCode) > 0) + { + request.returnHistory("该操作员编码已经存在,请重新输入"); + return; + } + + if (!Validates.isUserPass(operatorPass)) + { + request.returnHistory("请输入6-16位操作员密码(大小写字母数字和特殊字符必须四选三)"); + return; + } + + if (operatorPass.toLowerCase().contains("yangcai")) + { + request.returnHistory("密码中不允许包含yangcai"); + return; + } + + if (Validates.isEmpty(operatorWxcode)) + { + request.returnHistory("请输入个人微信账号"); + return; + } + + /* 根据企业成员手机号获取企业微信账号 */ + String accessToken = WorkWechatPresenter.doGetWorkWechatAccessToken(); + String wkwechatAccount = WorkWechatPresenter.getUserIdByPhoneNumber(accessToken, operatorMobile); + + long operatorAvatar = 0; + PageResult result = ZmrBootstrap.table(request).page(ZmrAvatar.class, 1, 10, new Selector("avatarId", "avatarType", 0)); + if (result.size() > 0) + {// 随机取一个系统头像 + int ind = new Random().nextInt(result.size()); + operatorAvatar = result.list().get(ind).getAvatarId(); + } + + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + String operatorPassSalt = Randoms.lettersDigitsSecure(64); + operatorPass = passworder.encode(operatorCode, operatorPass, operatorPassSalt); + + ZmrOperator operator = new ZmrOperator(); + operator.setOrgId(orgId); + operator.setOperatorCode(operatorCode); + operator.setOperatorPass(operatorPass); + operator.setOperatorPassSalt(operatorPassSalt); + operator.setOperatorStatus(operatorStatus); + operator.setOperatorType(operatorType); + operator.setOperatorName(operatorName); + operator.setOperatorAvatar(operatorAvatar); + operator.setOperatorMobile(operatorMobile); + operator.setOperatorCreated(dateTime); + operator.setOperatorModified(dateTime); + operator.setOperatorWangwang(operatorWangwang); + operator.setWkwechatAccount(wkwechatAccount); + operator.setOperatorWxcode(operatorWxcode); + operator.setInitialPassword(operatorPass); + ZmrBootstrap.table(request).insert(operator); + request.setAttribute("operator", operator); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + request.addValidate(new IsUserPass("operatorPass", "操作员密码不合法,要求6-16位(大小写字母数字和特殊字符必须四选三)", true)); + String operatorCode = request.getParameter("operatorCode"); + + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + request.returnHistory("该操作员不存在,请重新选择"); + return; + } + + request.setAttribute("operator", operator); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + String dateTime = DateTimes.getDateTimeString(); + String operatorCode = request.getParameter("operatorCode"); + String operatorName = request.getParameter("operatorName"); + String operatorPass = request.getParameter("operatorPass"); + String operatorMobile = request.getParameter("operatorMobile"); + int operatorStatus = request.getParameterInt("operatorStatus"); + int operatorType = request.getParameterInt("operatorType"); + String operatorWangwang = request.getParameter("operatorWangwang"); + String operatorWxcode = request.getParameter("operatorWxcode"); + + Updater updater = new Updater(); + updater.addMaybe("operatorCode", operatorCode); + updater.addField("operatorName", operatorName); + if (Validates.isNotEmpty(operatorPass)) + { + if (!Validates.isUserPass(operatorPass)) + { + request.returnHistory("请输入6-16位操作员密码(大小写字母数字和特殊字符必须四选三)"); + return; + } + if (operatorPass.toLowerCase().contains("yangcai")) + { + request.returnHistory("密码中不允许包含yangcai"); + return; + } + + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + String operatorPassSalt = Randoms.lettersDigitsSecure(64); + + operatorPass = passworder.encode(operatorCode, operatorPass, operatorPassSalt); + updater.addField("operatorPass", operatorPass); + updater.addField("operatorPassSalt", operatorPassSalt); + } + + if (Validates.isNotEmpty(operatorMobile)) + { + boolean isMatch = Pattern.matches(ZmrConstants.ZMR_MOBILE, operatorMobile); + if (!isMatch) + { + request.returnHistory("请输入正确的手机号"); + return; + } + } + + if (Validates.isEmpty(operatorWxcode)) + { + request.returnHistory("请输入个人微信账号"); + return; + } + + /* 根据企业成员手机号获取企业微信账号 */ + String accessToken = WorkWechatPresenter.doGetWorkWechatAccessToken(); + String wkwechatAccount = WorkWechatPresenter.getUserIdByPhoneNumber(accessToken, operatorMobile); + + // 停用时添加判断 + if (operatorStatus == 1) + { + // 去掉角色 + updater.addField("operatorRole", ""); + } + + updater.addField("operatorStatus", operatorStatus); + updater.addField("operatorMobile", operatorMobile); + updater.addField("operatorModified", dateTime); + updater.addField("operatorType", operatorType); + updater.addField("operatorWangwang", operatorWangwang); + updater.addField("wkwechatAccount", wkwechatAccount); + updater.addField("operatorWxcode", operatorWxcode); + + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + } + + @Override + @AnTransaction + protected void delete(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode"); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + request.returnHistory("该操作员不存在"); + return; + } + + Selector selector = new Selector("operatorCode", operatorCode); + if (ZmrBootstrap.table(request).count(ZmrOperatorLog.class, selector) > 0) + { + request.returnHistory("该操作员已有操作日志,不允许删除,只能停用"); + return; + } + + ZmrAvatar avatar = ZmrBootstrap.table(request).item(ZmrAvatar.class, operator.getOperatorAvatar()); + if (avatar != null && avatar.getAvatarType() == 1) + {// 删除操作员头像 + ZmrBootstrap.table(request).delete(ZmrAvatar.class, operator.getOperatorAvatar()); + } + + // 删除操作员&权限 + ZmrBootstrap.tableOpr(request).delete(ZmrOperator.class, operatorCode); + ZmrBootstrap.table(request).delete(ZmrOperatorRule.class, selector); + } + + /********************************************************************************************/ + // 私有方法 + /********************************************************************************************/ + private void toDeptName(List deptList, ZmrOperator operator) + { + operator.setOperatorCreated(""); + + long[] deptIds = Arrays.toLongArray(operator.getOperatorDept()); + for (long deptId : deptIds) + { + for (ZmrDept dept : deptList) + { + if (dept.getDeptId() == deptId) + { + if (Validates.isEmpty(operator.getOperatorCreated())) + { + operator.setOperatorCreated(dept.getDeptName()); + } + else + { + operator.setOperatorCreated(operator.getOperatorCreated() + "," + dept.getDeptName()); + } + break; + } + } + } + } + + private void toRoleName(List roleList, ZmrOperator operator) + { + operator.setOperatorPass(""); + + long[] roleIds = Arrays.toLongArray(operator.getOperatorRole()); + for (long roleId : roleIds) + { + for (ZmrRole role : roleList) + { + if (role.getRoleId() == roleId) + { + if (Validates.isEmpty(operator.getOperatorPass())) + { + operator.setOperatorPass(role.getRoleName()); + } + else + { + operator.setOperatorPass(operator.getOperatorPass() + "," + role.getRoleName()); + } + break; + } + } + } + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/OperatorDeptSelectorAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorDeptSelectorAction.java new file mode 100644 index 0000000..1f4d89c --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorDeptSelectorAction.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.Iterator; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.dbo.Selector; + +/** + * 操作员部门选择器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class OperatorDeptSelectorAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + request.setResponsePrivateCache(); + + String operatorCode = request.getParameter("operatorCode"); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + request.returnHistory("您选择的操作员不存在,请选择一个有效的操作员"); + return; + } + + //查询所有部门 + Selector selector = new Selector(); + selector.addMust("orgId", operator.getOrgId()); + selector.addMaybeLike("deptName", request.getParameter("deptName")); + List list = ZmrBootstrap.table(request).list(ZmrDept.class, selector); + + //去除已选的部门 + long[] operatorDept = Arrays.toLongArray(operator.getOperatorDept()); + for (Iterator it=list.iterator();it.hasNext();) + { + long deptId = it.next().getDeptId(); + if (Validates.isContain(operatorDept, deptId)) + it.remove(); + } + + request.setAttribute("operator", operator); + request.setAttribute("list", list); + } +} \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/OperatorOnlineAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorOnlineAction.java new file mode 100644 index 0000000..8e49935 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorOnlineAction.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpSessionManager; +import org.zhiqim.httpd.HttpSessionUser; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.manager.ZmrConstants; + +/** + * 操作员在线列表 + * + * @version v1.0.0 @author huangsufang 2018-1-22 新建与整理 + */ +public class OperatorOnlineAction implements Action, ZmrConstants +{ + @Override + public void execute(HttpRequest request) throws Exception + { + HttpSessionManager sessionManager = request.getContext().getSessionManager(); + + int page = request.getParameterInt(_PAGE_, 1); + int pageSize = request.getContextAttributeInt(ZMR_PAGE_SIZE, 20); + PageResult result = sessionManager.getSessionUserPage(page, pageSize); + request.setAttribute("result", result); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/OperatorRoleSelectorAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorRoleSelectorAction.java new file mode 100644 index 0000000..95242ea --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorRoleSelectorAction.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.Iterator; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrRole; +import org.zhiqim.orm.dbo.Selector; + +/** + * 操作员角色选择器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class OperatorRoleSelectorAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + request.setResponsePrivateCache(); + + String operatorCode = request.getParameter("operatorCode"); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + request.returnHistory("您选择的操作员不存在,请选择一个有效的操作员"); + return; + } + + //查询所有角色 + Selector selector = new Selector(); + selector.addMust("orgId", operator.getOrgId()); + selector.addMaybeLike("roleName", request.getParameter("roleName")); + List list = ZmrBootstrap.table(request).list(ZmrRole.class, selector); + + //去除已选的角色 + long[] operatorRole = Arrays.toLongArray(operator.getOperatorRole()); + for (Iterator it=list.iterator();it.hasNext();) + { + long roleId = it.next().getRoleId(); + if (Validates.isContain(operatorRole, roleId)) + it.remove(); + } + + request.setAttribute("operator", operator); + request.setAttribute("list", list); + } +} \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/OperatorRuleAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorRuleAction.java new file mode 100644 index 0000000..c0da435 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorRuleAction.java @@ -0,0 +1,115 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.GetPostAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.tree.Tree; +import org.zhiqim.kernel.tree.TreeBuilder; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrMenu; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOperatorRule; +import org.zhiqim.orm.dbo.Selector; + +/** + * 修改操作员/管理员权限页面 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +public class OperatorRuleAction extends GetPostAction +{ + protected void validate(HttpRequest request) + { + request.addValidate(new IsNotEmpty("operatorCode", "请选择操作员")); + } + + @Override + protected void doGet(HttpRequest request) throws Exception + { + request.setResponsePrivateCache(); + + String operatorCode = request.getParameter("operatorCode"); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + request.returnHistory("您选择的操作员不存在"); + return; + } + + // 获取操作员权限 + List ruleList = ZmrBootstrap.table(request).list(ZmrOperatorRule.class, new Selector("operatorCode", operatorCode)); + + //获取能管理的权限 + long orgId = operator.getOrgId(); + List list = ZmrOrgDao.getMenuList(request, orgId); + if (list.isEmpty()) + { + request.setRedirect("/manager/operator.htm", "请先设置组织权限"); + return; + } + + Tree tree = TreeBuilder.newTree(list, "parentCode", "menuCode"); + + request.setAttribute("operator", operator); + request.setAttribute("menuSize", list.size()); + request.setAttribute("tree", tree); + request.setAttribute("ruleList", ruleList); + } + + @Override + protected void doPost(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode"); + String[] itemCodes = request.getParameterValues("rule"); + if (itemCodes == null) + itemCodes = new String[0]; + + // 判断操作员是否存在 + if (ZmrBootstrap.tableOpr(request).count(ZmrOperator.class, operatorCode) == 0) + { + request.returnHistory("您选择的操作员不存在"); + return; + } + + // 重置操作员权限 + ZmrBootstrap.table(request).delete(ZmrOperatorRule.class, new Selector("operatorCode", operatorCode)); + if (itemCodes.length > 0) + { + List bathList = new ArrayList(); + for (int i = 0; i < itemCodes.length; i++) + { + ZmrOperatorRule rule = new ZmrOperatorRule(); + rule.setOperatorCode(operatorCode); + rule.setMenuCode(itemCodes[i]); + + bathList.add(rule); + } + + ZmrBootstrap.table(request).insertBatch(bathList); + } + + request.setAlertMsg("保存成功"); + request.addParam("operatorCode", operatorCode); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/OperatorRuleViewAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorRuleViewAction.java new file mode 100644 index 0000000..f223be6 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorRuleViewAction.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.ValidateAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.tree.Tree; +import org.zhiqim.kernel.tree.TreeBuilder; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrMenu; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.dbo.Selector; + +/** + * 操作员权限显示 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +public class OperatorRuleViewAction extends ValidateAction +{ + protected void validate(HttpRequest request) + { + request.addValidate(new IsNotEmpty("operatorCode", "请选择操作员")); + } + + protected void perform(HttpRequest request) throws Exception + { + request.setResponsePrivateCache(); + + String operatorCode = request.getParameter("operatorCode"); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + request.returnHistory("您选择的操作员不存在"); + return; + } + + // 获取操作员权限 + List list = ZmrOperatorDao.getOperatorMenuList(request, operator); + if (list.isEmpty()) + {//没有一个权限的,取根节点 + list = ZmrBootstrap.table(request).list(ZmrMenu.class, new Selector("menuLevel", 0)); + } + + Tree tree = TreeBuilder.newTree(list, "parentCode", "menuCode"); + + request.setAttribute("operator", operator); + request.setAttribute("menuSize", list.size()); + request.setAttribute("tree", tree); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/OperatorSelectorAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorSelectorAction.java new file mode 100644 index 0000000..5648d7d --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/OperatorSelectorAction.java @@ -0,0 +1,64 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.dbo.Selector; + +/** + * 操作员选择器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class OperatorSelectorAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + request.setResponsePrivateCache(); + + // 查询本组织操作员(超级管理员可以查管理员,管理员和操作员只能查操作员) + long orgId = request.getParameterLong("orgId"); + if (orgId == -1) + { + return; + } + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + Selector selector = new Selector(); + selector.addMustThenG("operatorType", sessionUser.getOperatorTypeThenG()); + selector.addMust("orgId", orgId); + selector.addMust("operatorStatus", 0); + String operatorKey = request.getParameter("operatorKey"); + if (Validates.isNotEmpty(operatorKey)) + {// 条件 + selector.addOr(new Selector().addMaybeLike("operatorCode", operatorKey).addMaybeLike("operatorName", operatorKey)); + } + + List list = ZmrBootstrap.tableOpr(request).list(ZmrOperator.class, selector); + + request.setAttribute("list", list); + } +} \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/OrgAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/OrgAction.java new file mode 100644 index 0000000..be0eb77 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/OrgAction.java @@ -0,0 +1,216 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsIntegerValue; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.onex.IsInteger; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrDeptRule; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.manager.dbo.ZmrRole; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * 组织管理 + * + * @version v1.0.0 @author zzy 2018-5-30 新建与整理 + */ +public class OrgAction extends StdSwitchAction implements ZmrConstants +{ + + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsInteger("orgId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsLen("orgName", "组织名称不能为空且不能超过32个汉字", 1, 32)); + request.addValidate(new IsIntegerValue("orgSeq", "组织排序必须是[0, 999999]范围的非负整数", 0, 999999)); + request.addValidate(new IsLen("orgDesc", "组织描述可为空或不能超过100个汉字", 0, 100)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + List list = ZmrBootstrap.tableOpr(request).list(ZmrOrg.class, new Selector().addOrderbyAsc("orgLevel,orgStatus")); + request.setAttribute("list", list); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + ZmrOrg parent = ZmrBootstrap.tableOpr(request).item(ZmrOrg.class, new Selector("orgLevel", 0)); + if (parent == null) + { + request.returnHistory("上级组织不存在,请选择正确的组织"); + return; + } + + request.setAttribute("parent", parent); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + ZmrOrg org = ZmrBootstrap.tableOpr(request).item(ZmrOrg.class, orgId); + if (org == null) + { + request.returnHistory("组织不存在,请选择正确的组织"); + return; + } + + request.setAttribute("org", org); + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + ZmrOrg org = request.getParameter(ZmrOrg.class); + + org.setOrgId(Ids.longId13()); + org.setOrgLevel(1); + ZmrBootstrap.table(request).insert(org); + + // 插入部门 + ZmrDept dept = new ZmrDept(); + dept.setOrgId(org.getOrgId()); + dept.setParentId(0); + dept.setDeptId(org.getOrgId()); + dept.setDeptName(org.getOrgName()); + dept.setDeptStatus(0); + dept.setDeptLevel(0); + dept.setDeptParentAll("0"); + + ZmrBootstrap.table(request).insert(dept); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + ZmrOrg org = ZmrBootstrap.tableOpr(request).item(ZmrOrg.class, new Selector("orgId", orgId)); + String orgName = request.getParameter("orgName"); + int orgStatus = request.getParameterInt("orgStatus"); + int orgSeq = request.getParameterInt("orgSeq"); + String orgManager = request.getParameter("orgManager"); + String orgDesc = request.getParameter("orgDesc"); + + Updater updater = new Updater(); + updater.addMust("orgId", orgId); + updater.addField("orgName", orgName); + updater.addField("orgStatus", orgStatus); + updater.addField("orgSeq", orgSeq); + updater.addField("orgManager", orgManager); + updater.addField("orgDesc", orgDesc); + + ZmrBootstrap.tableOpr(request).update(ZmrOrg.class, updater); + + // 将组织负责人的级别提升为管理员 + if (Validates.isNotEmpty(orgManager)) + { + Updater operatorUpdater = new Updater(); + operatorUpdater.addMust("operatorCode", orgManager); + operatorUpdater.addField("operatorType", 1); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, operatorUpdater); + } + + // 更换负责人,将原来负责人的权限降为操作员 + String oldOrgManager = org.getOrgManager(); + if (Validates.isNotEmpty(oldOrgManager)) + { + if (!oldOrgManager.equals(orgManager)) + { + Updater operatorUpdater = new Updater(); + operatorUpdater.addMust("operatorCode", oldOrgManager); + operatorUpdater.addField("operatorType", 2); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, operatorUpdater); + } + } + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = request.getParameterLong("orgId"); + + if (sessionUser.getSelectedOrgId() == orgId) + { + request.returnHistory("当前选中组织不能删除,请先切换组织"); + return; + } + + ZmrOrg org = ZmrBootstrap.tableOpr(request).item(ZmrOrg.class, orgId); + if (org == null) + { + request.returnHistory("组织不存在,请选择正确的组织"); + return; + } + + if (org.getOrgLevel() == 0) + { + request.returnHistory("顶级组织不能删除,只允许修改"); + return; + } + + if (ZmrBootstrap.table(request).count(ZmrDept.class, new Selector("orgId", orgId)) > 1) + { + request.returnHistory("该组织已有部门,要先删除部门(根部门除外)才能删除本组织"); + return; + } + + if (ZmrBootstrap.table(request).count(ZmrRole.class, new Selector("orgId", orgId)) > 0) + { + request.returnHistory("该组织已有角色,要先删除角色才能删除本组织"); + return; + } + + if (ZmrBootstrap.tableOpr(request).count(ZmrOperator.class, new Selector().addMust("orgId", orgId)) > 0) + { + request.returnHistory("该组织已有操作员,请删除组织成员后再删除本组织"); + return; + } + + // 清除根部门、根部门权限 + ZmrDept dept = ZmrBootstrap.table(request).item(ZmrDept.class, new Selector("orgId", orgId).addMust("deptLevel", 0)); + if (dept != null) + { + long deptId = dept.getDeptId(); + ZmrBootstrap.table(request).delete(ZmrDeptRule.class, new Selector("deptId", deptId)); + ZmrBootstrap.table(request).delete(ZmrDept.class, deptId); + } + + ZmrBootstrap.tableOpr(request).delete(ZmrOrg.class, orgId); + } +} \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/OrgRuleAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/OrgRuleAction.java new file mode 100644 index 0000000..04eb30a --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/OrgRuleAction.java @@ -0,0 +1,82 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.GetPostAction; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.manager.dbo.ZmrOrgRule; +import org.zhiqim.orm.dbo.Selector; + +public class OrgRuleAction extends GetPostAction +{ + @Override + protected void validate(HttpRequest request) throws Exception + { + + } + + @Override + protected void doGet(HttpRequest request) throws Exception + { + List list = ZmrOrgDao.listForStatus(request); + request.setAttribute("list", list); + } + + @Override + protected void doPost(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + + // 判断组织是否存在 + if (ZmrBootstrap.tableOpr(request).count(ZmrOrg.class, orgId) == 0) + { + request.returnHistory("您选择的组织不存在"); + return; + } + + String[] menuCodes = request.getParameterValuesOnCNT("rule"); + if (menuCodes == null) + { + menuCodes = new String[0]; + } + + // 重置组织权限 + ZmrBootstrap.table(request).delete(ZmrOrgRule.class, new Selector("orgId", orgId)); + if (menuCodes.length > 0) + { + List bathList = new ArrayList(); + for (int i = 0; i < menuCodes.length; i++) + { + ZmrOrgRule rule = new ZmrOrgRule(); + rule.setOrgId(orgId); + rule.setMenuCode(menuCodes[i]); + + bathList.add(rule); + } + ZmrBootstrap.table(request).insertBatch(bathList); + } + + request.setAlertMsg("保存成功"); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/OrgSelectorAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/OrgSelectorAction.java new file mode 100644 index 0000000..b6e56eb --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/OrgSelectorAction.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.orm.dbo.Selector; + +/** + * 组织选择器 + * + * @version v1.0.0 @author zzy 2018-8-21 新建与整理 + */ +public class OrgSelectorAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + String orgName = request.getParameter("orgName"); + List list = ZmrBootstrap.tableOpr(request).list(ZmrOrg.class, new Selector().addMaybeLike("orgName", orgName)); + request.setAttribute("list", list); + } +} \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/ParamAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/ParamAction.java new file mode 100644 index 0000000..f3d67c3 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/ParamAction.java @@ -0,0 +1,71 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.GetPostAction; +import org.zhiqim.httpd.validate.ones.IsByteLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.manager.dbo.ZmrParam; + +/** + * 修改参数页面和处理 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + * @version v1.4.1 @author zouzhigang 2015-5-4 删除刷新缓存标志,移到缓存管理功能 + */ +public class ParamAction extends GetPostAction +{ + protected void validate(HttpRequest request) + { + request.addValidate(new IsNotEmpty("paramGroup", "参数组编码未获取到,请重试")); + request.addValidate(new IsNotEmpty("paramKey", "参数编码未获取到,请重试")); + request.addValidate(new IsByteLen("paramValue", "参数值可以为空且不能超过2000个字符", 0, 2000)); + } + + protected void doGet(HttpRequest request) throws Exception + { + request.setValidateConfirm("修改系统参数后会对系统产生影响,确定要修改参数吗?"); + request.setAttribute("groupMap", ZmrParamDao.getGroupMap(request.getContext())); + } + + protected void doPost(HttpRequest request) throws Exception + { + String paramGroup = request.getParameter("paramGroup"); + String paramKey = request.getParameter("paramKey"); + String paramValue = request.getParameterNoFilter("paramValue"); + + ZmrParam param = ZmrParamDao.getParam(request.getContext(), paramGroup, paramKey); + if (param == null) + { + request.returnHistory("您选择的参数不存在,请选择有效的参数进行修改"); + return; + } + + if (Validates.isEqual(param.getParamValue(), paramValue)) + { + request.setRedirect("param.htm"); + return; + } + + ZmrParamDao.doUpdate(request.getContext(), paramGroup, paramKey, paramValue); + request.setRedirectTop("param.htm"); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/ParamOperatorAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/ParamOperatorAction.java new file mode 100644 index 0000000..c3dddb2 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/ParamOperatorAction.java @@ -0,0 +1,113 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrParamOperator; + +/** + * 操作员参数管理 + * + * @version v1.0.0 @author zhuzhiyuan 2018-12-5 新建与整理 + */ +public class ParamOperatorAction extends StdSwitchAction implements ZmrConstants +{ + protected void validateId(HttpRequest request) + { + request.addValidate(new IsNotEmpty("paramKey","参数键不能为空")); + } + + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsLen("paramKey", "参数键不能为空,且不超过32个字符", 1, 32)); + request.addValidate(new IsLen("paramDesc", "参数描述不能为空,且不超过200个字符", 1, 200)); + } + + protected void list(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page"); + int pageSize = request.getContextAttributeInt(ZMR_PAGE_SIZE, 20); + + PageResult result = ZmrBootstrap.tableOpr(request).page(ZmrParamOperator.class, page, pageSize); + + request.setAttribute("result", result); + } + + protected void add(HttpRequest request) throws Exception + { + } + + protected void insert(HttpRequest request) throws Exception + { + String paramKey = request.getParameter("paramKey"); + String paramDesc = request.getParameter("paramDesc"); + + if(ZmrBootstrap.tableOpr(request).count(ZmrParamOperator.class, paramKey) > 0) + { + request.returnHistory("该操作员参数键已经存在,请重新输入"); + return; + } + + ZmrParamOperator operatorParam = new ZmrParamOperator(); + operatorParam.setParamKey(paramKey); + operatorParam.setParamDesc(paramDesc); + + ZmrBootstrap.table(request).insert(operatorParam); + } + + protected void modify(HttpRequest request) throws Exception + { + } + + protected void update(HttpRequest request) throws Exception + { + } + + @AnTransaction + protected void delete(HttpRequest request) throws Exception + { + String paramKey = request.getParameter("paramKey"); + ZmrParamOperator operatorParam = ZmrBootstrap.tableOpr(request).item(ZmrParamOperator.class, paramKey); + if (operatorParam == null) + { + request.returnHistory("该操作员参数不存在"); + return; + } + + //删除操作员参数 + List operatorList = ZmrBootstrap.tableOpr(request).list(ZmrOperator.class); + for (ZmrOperator zmrOperator : operatorList) + { + ZmrOperatorDao.deleteOperatorParam(request, zmrOperator.getOperatorCode(), paramKey); + } + + ZmrBootstrap.table(request).delete(ZmrParamOperator.class, paramKey); + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/ProcessThreadStackAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/ProcessThreadStackAction.java new file mode 100644 index 0000000..cefcf4b --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/ProcessThreadStackAction.java @@ -0,0 +1,64 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Linux; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Systems; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.presenter.ZmrProcessPresenter; + +/** + * 堆栈信息查看类 + * + * @version v1.0.0 @author liuhu 2018-9-7 新建与整理 + */ +public class ProcessThreadStackAction implements Action +{ + public void execute(HttpRequest request) throws Exception + { + String javaHome = Global.getString("boot", "home"); + if (Validates.isEmptyBlank(javaHome)) + javaHome = Systems.getPropOrEnv("JAVA_HOME"); + javaHome = Strings.trimRight(javaHome, "/"); + + String shell = new StringBuilder(javaHome).append("/bin/jstack -l ").append(Systems.getPid()).toString(); + String result = Linux.shell(shell, _UTF_8_); + + List list = ZmrProcessPresenter.findThreadStack(result); + StringBuilder stackInfo = new StringBuilder(); + int threadPid = Integer.valueOf(request.getParameter("threadPid")); + + for(String temp:list) + { + String tempPid = ZmrProcessPresenter.findPid(temp); + if(tempPid.equals(Integer.toHexString(threadPid))) + { + stackInfo.append(temp); + break; + } + } + + request.setAttribute("stackInfo", stackInfo.toString()); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/ProfileAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/ProfileAction.java new file mode 100644 index 0000000..416f69b --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/ProfileAction.java @@ -0,0 +1,43 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; + +/** + * 操作员信息 + * + * @version v1.0.0 @author zhouwenbin 2017-5-31 新建与整理 + */ +public class ProfileAction implements Action +{ + + @Override + public void execute(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, sessionUser.getOperatorCode()); + + request.setAttribute("operator", operator); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/RoleAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/RoleAction.java new file mode 100644 index 0000000..fe917f9 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/RoleAction.java @@ -0,0 +1,119 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.StdSwitchAction; +import org.zhiqim.httpd.validate.ones.IsIntegerValue; +import org.zhiqim.httpd.validate.ones.IsLen; +import org.zhiqim.httpd.validate.onex.IsInteger; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrRole; +import org.zhiqim.orm.dbo.Selector; + +/** + * 角色管理 + * + * @version v1.0.0 @author zouzhigang 2015-5-29 新建与整理 + */ +public class RoleAction extends StdSwitchAction implements ZmrConstants +{ + + @Override + protected void validateId(HttpRequest request) + { + request.addValidate(new IsInteger("roleId", "请选择一个选项")); + } + + @Override + protected void validateForm(HttpRequest request) + { + request.addValidate(new IsInteger("roleId", "请选择一个选项")); + request.addValidate(new IsLen("roleName", "角色名称不能为空且不能超过32个汉字", 1, 32)); + request.addValidate(new IsIntegerValue("roleStatus", "角色状态范围为[0, 1]之间", 0, 1)); + request.addValidate(new IsIntegerValue("roleSeq", "角色排序必须是[0, 999999]范围的非负整数", 0, 999999)); + } + + @Override + protected void list(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getSelectedOrgId(); + + List list = ZmrBootstrap.table(request).list(ZmrRole.class, new Selector("orgId", orgId).addOrderbyAsc("roleSeq")); + request.setAttribute("list", list); + } + + @Override + protected void add(HttpRequest request) throws Exception + { + } + + @Override + protected void insert(HttpRequest request) throws Exception + { + ZmrRole item = request.getParameter(ZmrRole.class); + item.setOrgId(request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId()); + ZmrBootstrap.table(request).insert(item); + } + + @Override + protected void modify(HttpRequest request) throws Exception + { + long roleId = request.getParameterLong("roleId"); + ZmrRole item = ZmrBootstrap.table(request).item(ZmrRole.class, roleId); + if (item == null) + { + request.returnHistory("角色不存在,请选择正确的角色"); + return; + } + + request.setAttribute("item", item); + } + + @Override + protected void update(HttpRequest request) throws Exception + { + ZmrRole item = request.getParameter(ZmrRole.class); + ZmrBootstrap.table(request).update(item); + } + + @Override + protected void delete(HttpRequest request) throws Exception + { + long roleId = request.getParameterLong("roleId"); + if (ZmrBootstrap.table(request).count(ZmrRole.class, roleId) == 0) + { + request.returnHistory("角色不存在,请选择成确的角色"); + return; + } + + if (ZmrBootstrap.tableOpr(request).count(ZmrOperator.class, new Selector().addMustLike("operatorRole", roleId)) > 0) + { + request.returnHistory("该角色已有操作员,请删除角色成员后再删除本角色"); + return; + } + + ZmrBootstrap.table(request).delete(ZmrRole.class, roleId); + } +} \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/RoleOperatorAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/RoleOperatorAction.java new file mode 100644 index 0000000..97a27fd --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/RoleOperatorAction.java @@ -0,0 +1,55 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrRole; +import org.zhiqim.orm.dbo.Selector; + +/** + * 角色与操作员关联
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class RoleOperatorAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long roleId = request.getParameterLong("roleId"); + + ZmrRole role = ZmrBootstrap.table(request).item(ZmrRole.class, roleId); + if (role == null) + { + request.setResponseError("您选择的角色不存在,请选择一个有效的角色"); + return; + } + + Selector selector = new Selector(); + selector.addMustLike("operatorRole", roleId); + List operatorList = ZmrBootstrap.tableOpr(request).list(ZmrOperator.class, selector); + + request.setAttribute("role", role); + request.setAttribute("operatorList", operatorList); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/RoleOperatorSelectorAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/RoleOperatorSelectorAction.java new file mode 100644 index 0000000..22c7212 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/RoleOperatorSelectorAction.java @@ -0,0 +1,76 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrRole; +import org.zhiqim.orm.dbo.Selector; + +/** + * 角色操作员选择器 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class RoleOperatorSelectorAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + request.setResponsePrivateCache(); + + long roleId = request.getParameterLong("roleId"); + if (roleId == -1) + { + request.returnCloseDialog("您选择的角色不存在,请选择一个有效的角色"); + return; + } + + // 获取角色 + ZmrRole role = ZmrBootstrap.table(request).item(ZmrRole.class, roleId); + if (role == null) + { + request.returnCloseDialog("您选择的角色不存在,请选择一个有效的角色"); + return; + } + + // 获取角色下未关联的所有操作员,管理员除外 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + Selector selector = new Selector(); + selector.addMust("orgId", role.getOrgId()); + selector.addMustThenG("operatorType", sessionUser.getOperatorTypeThenG()); + selector.addMust("operatorStatus", 0); + String operatorKey = request.getParameter("operatorKey"); + if (Validates.isNotEmpty(operatorKey)) + {// 条件 + selector.addOr(new Selector().addMaybeLike("operatorCode", operatorKey).addMaybeLike("operatorName", operatorKey)); + } + + selector.addOr(new Selector().addMaybeIsNull("operatorRole").addMustNotLike("operatorRole", roleId)); + List operatorList = ZmrBootstrap.tableOpr(request).list(ZmrOperator.class, selector); + + request.setAttribute("role", role); + request.setAttribute("operatorList", operatorList); + } +} \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/RoleRuleAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/RoleRuleAction.java new file mode 100644 index 0000000..891722f --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/RoleRuleAction.java @@ -0,0 +1,105 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.GetPostAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.tree.Tree; +import org.zhiqim.kernel.tree.TreeBuilder; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrMenu; +import org.zhiqim.manager.dbo.ZmrRole; +import org.zhiqim.manager.dbo.ZmrRoleRule; +import org.zhiqim.orm.dbo.Selector; + +/** + * 角色权限列表
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class RoleRuleAction extends GetPostAction implements ZmrConstants +{ + protected void validate(HttpRequest request) + { + request.addValidate(new IsNotEmpty("roleId", "请选择角色")); + } + + @Override + protected void doGet(HttpRequest request) throws Exception + { + long roleId = request.getParameterLong("roleId"); + + ZmrRole role = ZmrBootstrap.table(request).item(ZmrRole.class, roleId); + if (role == null) + { + request.setResponseError("您选择的角色不存在,请选择一个有效的角色"); + return; + } + + // 获取角色权限 + List ruleList = ZmrBootstrap.table(request).list(ZmrRoleRule.class, new Selector("roleId", roleId)); + + //获取角色所属组织的权限 + List menuList = ZmrOrgDao.getMenuList(request, role.getOrgId()); + Tree tree = TreeBuilder.newTree(menuList, "parentCode", "menuCode"); + + request.setAttribute("role", role); + request.setAttribute("ruleList", ruleList); + request.setAttribute("tree", tree); + request.setAttribute("menuSize", menuList.size()); + } + + @Override + protected void doPost(HttpRequest request) throws Exception + { + long roleId = request.getParameterLong("roleId"); + String[] menuCodes = request.getParameterValuesOnCNT("rule"); + if (menuCodes == null) + menuCodes = new String[0]; + + // 判断角色是否存在 + if (ZmrBootstrap.table(request).count(ZmrRole.class, roleId) == 0) + { + request.returnHistory("您选择的角色不存在"); + return; + } + + // 重置操作员权限 + ZmrBootstrap.table(request).delete(ZmrRoleRule.class, new Selector("roleId", roleId)); + if (menuCodes.length > 0) + { + List bathList = new ArrayList(); + for (int i = 0; i < menuCodes.length; i++) + { + ZmrRoleRule rule = new ZmrRoleRule(); + rule.setRoleId(roleId); + rule.setMenuCode(menuCodes[i]); + + bathList.add(rule); + } + + ZmrBootstrap.table(request).insertBatch(bathList); + } + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/ThemeIndexAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/ThemeIndexAction.java new file mode 100644 index 0000000..a46f903 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/ThemeIndexAction.java @@ -0,0 +1,86 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.GetPostAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dao.ZmrParamDao; + +/** + * 更换首页主题风格 + * + * @version v1.0.0 @author zouzhigang 2016-5-28 新建与整理 + */ +public class ThemeIndexAction extends GetPostAction +{ + private String templates = ""; + + @Override + protected void validate(HttpRequest request) + { + request.addValidate(new IsNotEmpty("theme", "请选择一个选项")); + } + + @Override + protected void doGet(HttpRequest request) throws Exception + { + HttpContext context = request.getContext(); + + //1.定义模板名称和图片列表 + List templateList = new ArrayList<>(); + + //2.获取模板列表 + templates = "";//把模板名称记下来,方便doPost时检查 + List nameList = request.getContext().getResourceNameList("/ztmpl/zhiqim_manager"); + for (String name : nameList) + { + if (!name.endsWith("/")) + continue;//文件过滤掉 + + name = Strings.trimRight(name, "/"); + templates += name + ","; + String[] template = new String[]{name, context.getRootPath("/ztmpl/zhiqim_manager/"+name+"/preview_index.png")}; + templateList.add(template); + } + templates = Strings.trimRight(templates, ","); + + //3.模板列表信息放置到属性表中 + request.setAttribute("templateList", templateList); + } + + @Override + protected void doPost(HttpRequest request) throws Exception + { + String theme = request.getParameter("theme"); + if (!Validates.isStrContainStrArr(theme, templates, ",")) + { + request.returnHistory("当前仅支持"+templates); + return; + } + + ZmrParamDao.doUpdateThemeIndex(request.getContext(), theme); + request.setContextAttribute("themeIndex", theme); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/ThemeMainAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/ThemeMainAction.java new file mode 100644 index 0000000..ff6ebc9 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/ThemeMainAction.java @@ -0,0 +1,86 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.extend.GetPostAction; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dao.ZmrParamDao; + +/** + * 更换主页主题风格 + * + * @version v1.0.0 @author zouzhigang 2016-5-28 新建与整理 + */ +public class ThemeMainAction extends GetPostAction +{ + private String templates = ""; + + @Override + protected void validate(HttpRequest request) + { + request.addValidate(new IsNotEmpty("theme", "请选择一个选项")); + } + + @Override + protected void doGet(HttpRequest request) throws Exception + { + HttpContext context = request.getContext(); + + //1.定义模板名称和图片列表 + List templateList = new ArrayList<>(); + + //2.获取模板列表 + templates = "";//把模板名称记下来,方便doPost时检查 + List nameList = request.getContext().getResourceNameList("/ztmpl/zhiqim_manager"); + for (String name : nameList) + { + if (!name.endsWith("/")) + continue;//文件过滤掉 + + name = Strings.trimRight(name, "/"); + templates += name + ","; + String[] template = new String[]{name, context.getRootPath("/ztmpl/zhiqim_manager/"+name+"/preview_main.png")}; + templateList.add(template); + } + templates = Strings.trimRight(templates, ","); + + //3.模板列表信息放置到属性表中 + request.setAttribute("templateList", templateList); + } + + @Override + protected void doPost(HttpRequest request) throws Exception + { + String theme = request.getParameter("theme"); + if (!Validates.isStrContainStrArr(theme, templates, ",")) + { + request.returnHistory("当前仅支持"+templates); + return; + } + + ZmrParamDao.doUpdateThemeMain(request.getContext(), theme); + request.setContextAttribute("themeMain", theme); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/ZmiAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/ZmiAction.java new file mode 100644 index 0000000..c816402 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/ZmiAction.java @@ -0,0 +1,48 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Validates; + +/** + * "/zmi/*.htm"文件处理 + * + * @version v1.0.0 @author zouzhigang 2018-1-18 新建与整理 + */ +public class ZmiAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + String zml = request.getContext().getResourceString("/ztmpl/zhiqim_manager/inner.htm"); + String content = ZmlContexts.parseZmlContent(request, zml, "include", request.getPathInContext()); + + HttpResponse response = request.getResponse(); + if (response.isCommitted()) + return; + + if (!Validates.isEmpty(content)) + response.print(content); + + response.commit(); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/action/ZmrAction.java b/zhiqim_manager/src/org/zhiqim/manager/action/ZmrAction.java new file mode 100644 index 0000000..65b17d4 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/action/ZmrAction.java @@ -0,0 +1,48 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Validates; + +/** + * "/zmr/*.htm"文件处理 + * + * @version v1.0.0 @author zouzhigang 2018-1-18 新建与整理 + */ +public class ZmrAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + String zml = request.getContext().getResourceString("/ztmpl/zhiqim_manager/template.htm"); + String content = ZmlContexts.parseZmlContent(request, zml, "include", request.getPathInContext()); + + HttpResponse response = request.getResponse(); + if (response.isCommitted()) + return; + + if (!Validates.isEmpty(content)) + response.print(content); + + response.commit(); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/avatar/01.jpg b/zhiqim_manager/src/org/zhiqim/manager/avatar/01.jpg new file mode 100644 index 0000000..331fe54 Binary files /dev/null and b/zhiqim_manager/src/org/zhiqim/manager/avatar/01.jpg differ diff --git a/zhiqim_manager/src/org/zhiqim/manager/avatar/02.jpg b/zhiqim_manager/src/org/zhiqim/manager/avatar/02.jpg new file mode 100644 index 0000000..a17619e Binary files /dev/null and b/zhiqim_manager/src/org/zhiqim/manager/avatar/02.jpg differ diff --git a/zhiqim_manager/src/org/zhiqim/manager/avatar/03.jpg b/zhiqim_manager/src/org/zhiqim/manager/avatar/03.jpg new file mode 100644 index 0000000..0b38de8 Binary files /dev/null and b/zhiqim_manager/src/org/zhiqim/manager/avatar/03.jpg differ diff --git a/zhiqim_manager/src/org/zhiqim/manager/avatar/04.jpg b/zhiqim_manager/src/org/zhiqim/manager/avatar/04.jpg new file mode 100644 index 0000000..6efa706 Binary files /dev/null and b/zhiqim_manager/src/org/zhiqim/manager/avatar/04.jpg differ diff --git a/zhiqim_manager/src/org/zhiqim/manager/avatar/05.jpg b/zhiqim_manager/src/org/zhiqim/manager/avatar/05.jpg new file mode 100644 index 0000000..7acfa13 Binary files /dev/null and b/zhiqim_manager/src/org/zhiqim/manager/avatar/05.jpg differ diff --git a/zhiqim_manager/src/org/zhiqim/manager/avatar/06.jpg b/zhiqim_manager/src/org/zhiqim/manager/avatar/06.jpg new file mode 100644 index 0000000..e2e513c Binary files /dev/null and b/zhiqim_manager/src/org/zhiqim/manager/avatar/06.jpg differ diff --git a/zhiqim_manager/src/org/zhiqim/manager/avatar/07.jpg b/zhiqim_manager/src/org/zhiqim/manager/avatar/07.jpg new file mode 100644 index 0000000..e7a972f Binary files /dev/null and b/zhiqim_manager/src/org/zhiqim/manager/avatar/07.jpg differ diff --git a/zhiqim_manager/src/org/zhiqim/manager/avatar/08.jpg b/zhiqim_manager/src/org/zhiqim/manager/avatar/08.jpg new file mode 100644 index 0000000..bd5771d Binary files /dev/null and b/zhiqim_manager/src/org/zhiqim/manager/avatar/08.jpg differ diff --git a/zhiqim_manager/src/org/zhiqim/manager/avatar/09.jpg b/zhiqim_manager/src/org/zhiqim/manager/avatar/09.jpg new file mode 100644 index 0000000..d270d01 Binary files /dev/null and b/zhiqim_manager/src/org/zhiqim/manager/avatar/09.jpg differ diff --git a/zhiqim_manager/src/org/zhiqim/manager/avatar/10.jpg b/zhiqim_manager/src/org/zhiqim/manager/avatar/10.jpg new file mode 100644 index 0000000..033b894 Binary files /dev/null and b/zhiqim_manager/src/org/zhiqim/manager/avatar/10.jpg differ diff --git a/zhiqim_manager/src/org/zhiqim/manager/dao/ZmrDeptDao.java b/zhiqim_manager/src/org/zhiqim/manager/dao/ZmrDeptDao.java new file mode 100644 index 0000000..30bd7f5 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dao/ZmrDeptDao.java @@ -0,0 +1,203 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dao; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.tree.Tree; +import org.zhiqim.kernel.tree.TreeBuilder; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * 部门数据访问对象 + * + * @version v1.0.0 @author zouzhigang 2017-8-23 新建与整理 + */ +@AnAlias("ZmrDeptDao") +public class ZmrDeptDao +{ + + /** + * 获取组织下部门列表,根据部门级别、部门排序数、部门ID排序 + * + * @param request 请求对象 + * @param orgId 组织编号 + * @return 部门列表 + * @throws ORMException ORM异常 + * @throws SQLException SQL异常 + */ + public static List getOrgDeptList(HttpRequest request, long orgId) throws ORMException, SQLException + { + return ZmrBootstrap.table(request).list(ZmrDept.class, new Selector("orgId", orgId).addOrderbyAsc("deptLevel,deptSeq,deptId")); + } + + /** + * 获取组织下部门树,根据部门级别、部门排序数、部门ID排序 + * + * @param request 请求对象 + * @param orgId 组织编号 + * @return 部门列表 + * @throws ORMException ORM异常 + * @throws SQLException SQL异常 + */ + public static Tree getOrgDeptTree(HttpRequest request, long orgId) throws ORMException, SQLException + { + return TreeBuilder.newTree(getOrgDeptList(request, orgId), "parentId", "deptId"); + } + + /** + * 是否是部门经理 + * + * @param request 请求对象 + * @param operatorCode 部门经理编码 + * @return =true表示是 + * @throws ORMException ORM异常 + * @throws SQLException SQL异常 + */ + public static boolean isDeptManager(HttpRequest request, String operatorCode) throws ORMException, SQLException + { + return !ZmrBootstrap.table(request).list(ZmrDept.class, new Selector("deptId", "deptManager", operatorCode)).isEmpty(); + } + + /** + * 获取部门经理下属操作员编码列表 + * + * @param request 请求对象 + * @param operatorCode 部门经理编码 + * @param recursion 是否向在递归 + * @return 下属操作员列表 + * @throws Exception 异常 + */ + public static List getDeptOperatorCodeList(HttpRequest request, String operatorCode, boolean recursion) throws Exception + { + Asserts.assertNotEmpty(operatorCode, "操作员编码不允许为空"); + + List deptList = ZmrBootstrap.table(request).list(ZmrDept.class, new Selector("deptManager", operatorCode)); + if (deptList.isEmpty()) + return new ArrayList<>(); + + List list = new ArrayList<>(); + List operatorList = ZmrBootstrap.tableOpr(request).list(ZmrOperator.class); + opr:for (ZmrOperator operator : operatorList) + { + String deptAll = recursion?operator.getOperatorDeptAll():operator.getOperatorDept(); + for (ZmrDept dept : deptList) + { + if (Validates.isContain(deptAll, ",", dept.getDeptId())) + { + list.add(operator.getOperatorCode()); + continue opr; + } + } + } + + return list; + } + + /** + * 获取部门经理下属操作员列表 + * + * @param request 请求对象 + * @param operatorCode 部门经理编码 + * @param recursion 是否向在递归 + * @return 下属操作员列表 + * @throws Exception 异常 + */ + public static List getDeptOperatorList(HttpRequest request, String operatorCode, boolean recursion) throws Exception + { + Asserts.assertNotEmpty(operatorCode, "操作员编码不允许为空"); + + List deptList = ZmrBootstrap.table(request).list(ZmrDept.class, new Selector("deptManager", operatorCode)); + if (deptList.isEmpty()) + return new ArrayList<>(); + + List list = new ArrayList<>(); + List operatorList = ZmrBootstrap.tableOpr(request).list(ZmrOperator.class); + opr:for (ZmrOperator operator : operatorList) + { + String deptAll = recursion?operator.getOperatorDeptAll():operator.getOperatorDept(); + for (ZmrDept dept : deptList) + { + if (Validates.isContain(deptAll, ",", dept.getDeptId())) + { + list.add(operator); + continue opr; + } + } + } + + return list; + } + + /** + * 更新部门负责人所属部门 + * @param request 请求对象 + * @param operatorCodeList 操作员编码列表 + * @param deptId 部门编码 + * @param deptParentAll 部门所有父节点 + * @throws Exception + */ + public static void doUpdateDeptManeger(HttpRequest request, List operatorCodeList, String deptId, String deptParentAll) throws Exception + { + for (String operatorCode : operatorCodeList) + { + ZmrOperator operator = ORM.get(ZTable.class).item(ZmrOperator.class, operatorCode); + if(operator == null) + { + request.returnHistory("操作员不存在"); + return; + } + + String operatorDept = operator.getOperatorDept(); + if (Validates.isEmptyBlank(operatorDept)) + operatorDept = deptId; + else + operatorDept += "," + deptId; + + String operatorDeptAll = operator.getOperatorDeptAll(); + if (Validates.isEmptyBlank(operatorDeptAll)) + operatorDeptAll = deptParentAll + "," + deptId; + else + operatorDeptAll += "," + deptParentAll + "," + deptId; + + //去重 + operatorDept = Arrays.toFilterSameStr(Arrays.toStringArray(operatorDept)); + operatorDeptAll = Arrays.toFilterSameStr(Arrays.toStringArray(operatorDeptAll)); + + Updater updater = new Updater(); + updater.addMust("operatorCode", operatorCode); + updater.addField("operatorDept", operatorDept); + updater.addField("operatorDeptAll",operatorDeptAll); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + } + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dao/ZmrOperatorDao.java b/zhiqim_manager/src/org/zhiqim/manager/dao/ZmrOperatorDao.java new file mode 100644 index 0000000..94c110c --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dao/ZmrOperatorDao.java @@ -0,0 +1,474 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dao; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpSessionUser; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrPassworder; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrDeptRule; +import org.zhiqim.manager.dbo.ZmrMenu; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrOperatorRule; +import org.zhiqim.manager.dbo.ZmrOrgRule; +import org.zhiqim.manager.dbo.ZmrRoleRule; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * 操作员数据访问对象 + * + * @version v1.0.0 @author zouzhigang 2017-8-12 新建与整理 + */ +@AnAlias("ZmrOperatorDao") +public class ZmrOperatorDao +{ + /*********************************************************************************************/ + //操作员基础信息 + /*********************************************************************************************/ + + /** + * 验证操作员密码 + * + * @param request 请求对象 + * @param operator 操作员对象 + * @param operatorPass 操作员密码 + * @return =true表示成功 + * @throws Exception 可能的异常 + */ + public static boolean validateSecret(HttpRequest request, ZmrOperator operator, String operatorPass) + { + Asserts.as(operator!=null?null:"操作员对象不能为null"); + Asserts.as(!Validates.isEmptyBlank(operatorPass)?null:"操作员密码不能为空白"); + + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + String encodePass = passworder.encode(operator.getOperatorCode(), operatorPass, operator.getOperatorPassSalt()); + return encodePass.equals(operator.getOperatorPass()); + } + + /** + * 验证操作员密码 + * + * @param request 请求对象 + * @param operator 操作员对象 + * @param operatorPass 操作员密码 + * @return =true表示成功 + * @throws Exception 可能的异常 + */ + public static boolean validatePassword(HttpRequest request, ZmrOperator operator, String operatorPass) + { + Asserts.as(operator!=null?null:"操作员对象不能为null"); + Asserts.as(!Validates.isEmptyBlank(operatorPass)?null:"操作员密码不能为空白"); + + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + String encodePass = passworder.encode(operator.getOperatorCode(), operatorPass, operator.getOperatorPassSalt()); + return encodePass.equalsIgnoreCase(operator.getOperatorPass()); + } + + /** + * 验证操作员密码 + * + * @param request 请求对象 + * @param operatorCode 操作员编码 + * @param operatorPass 操作员密码 + * @return =true表示成功 + * @throws Exception 可能的异常 + */ + public static boolean validatePassword(HttpRequest request, String operatorCode, String operatorPass) throws Exception + { + Asserts.as(!Validates.isEmptyBlank(operatorCode)?null:"操作员编码不能为空白"); + Asserts.as(!Validates.isEmptyBlank( operatorPass)?null:"操作员密码不能为空白"); + + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + return false; + + return validatePassword(request, operator, operatorPass); + } + + /** + * 验证操作员是否有指定的菜单权限 + * + * @param request 请求对象 + * @param operatorCode 操作员编码 + * @param menuUrl 菜单URL + * @return =true表示有权限 + * @throws Exception 可能的异常 + */ + public static boolean hasMenuRule(HttpRequest request, String operatorCode, String menuUrl) throws Exception + { + Asserts.as(!Validates.isEmptyBlank(operatorCode)?null:"操作员编码不能为空白"); + Asserts.as(!Validates.isEmptyBlank(menuUrl)?null:"菜单URL不能为空白"); + + List menuList = getOperatorMenuList(request, operatorCode); + for (ZmrMenu menu : menuList) + { + if (menuUrl.equals(menu.getMenuUrl())) + return true; + } + + return false; + } + + /** + * 验证操作员是否有指定的菜单权限 + * + * @param request 请求对象 + * @param operator 操作员对象 + * @param menuUrl 菜单URL + * @return =true表示有权限 + * @throws Exception 可能的异常 + */ + public static boolean hasMenuRule(HttpRequest request, ZmrOperator operator, String menuUrl) throws Exception + { + Asserts.as(operator != null?null:"操作员编码不能为空白"); + Asserts.as(!Validates.isEmptyBlank(menuUrl)?null:"菜单URL不能为空白"); + + List menuList = getOperatorMenuList(request, operator); + for (ZmrMenu menu : menuList) + { + if (menuUrl.equals(menu.getMenuUrl())) + return true; + } + + return false; + } + + /*********************************************************************************************/ + //操作员参数相关 + /*********************************************************************************************/ + + /** + * 获取操作员参数 + * + * @param request 请求对象 + * @param operatorCode 操作员编码 + * @param key 参数字段 + * @throws Exception 可能的异常 + */ + public static String getOperatorParam(HttpRequest request, String operatorCode, String key) throws Exception + { + Asserts.as(!Validates.isEmptyBlank(operatorCode)?null:"操作员编码不能为空白"); + + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + return null; + + return Jsons.getString(operator.getOperatorParam(), key); + } + + /** + * 获取操作员参数 + * + * @param request 请求对象 + * @param operator 操作员对象 + * @param key 参数字段 + * @throws Exception 可能的异常 + */ + public static String getOperatorParam(ZmrOperator operator, String key) throws Exception + { + Asserts.as(operator != null?null:"操作员编码不能为空白"); + + return Jsons.getString(operator.getOperatorParam(), key); + } + + /** + * 更新操作员参数 + * + * @param request 请求对象 + * @param operatorCode 操作员编码 + * @param key 参数字段 + * @param value 参数值 + * @throws Exception 可能的异常 + */ + public static void addOrUpdateOperatorParam(HttpRequest request, String operatorCode, String key, Object value) throws Exception + { + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + return; + + String operatorParam = operator.getOperatorParam(); + if (Validates.isEmptyBlank(operatorParam)) + operatorParam = "{}"; + operatorParam = Jsons.toStringAddOrUpdate(operatorParam, key, value); + + Updater updater = new Updater(); + updater.addField("operatorParam", operatorParam); + updater.addMust("operatorCode", operatorCode); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + } + + /** + * 删除操作员参数 + * + * @param request 请求对象 + * @param operatorCode 操作员编码 + * @param key 参数字段 + * @throws Exception 可能的异常 + */ + public static void deleteOperatorParam(HttpRequest request, String operatorCode, String key) throws Exception + { + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + return; + + String operatorParam = operator.getOperatorParam(); + if (Validates.isEmptyBlank(operatorParam)) + operatorParam = "{}"; + operatorParam = Jsons.toStringRemove(operatorParam, key); + + Updater updater = new Updater(); + updater.addField("operatorParam", operatorParam); + updater.addMust("operatorCode", operatorCode); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + } + + /*********************************************************************************************/ + //操作员权限相关 + /*********************************************************************************************/ + + /** + * 获取所有正常菜单列表 + * + * @param request 请求对象 + * @return 全部菜单列表 + * @throws Exception 可能的异常 + */ + public static List getAllMenuList(HttpRequest request) throws Exception + { + Selector selector = new Selector(); + selector.addOrderbyAsc("menuLevel"); + selector.addOrderbyAsc("menuCode"); + + return ZmrBootstrap.table(request).list(ZmrMenu.class, selector); + } + + /** + * 获取操作员菜单列表 + * + * @param request 请求对象 + * @param operatorCode 操作员编码 + * @return 菜单列表 + * @throws Exception 可能的异常 + */ + public static List getOperatorMenuList(HttpRequest request, String operatorCode) throws Exception + { + Asserts.assertNotEmpty(operatorCode, "操作员编码不允许为空"); + + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + return new ArrayList(); + + return getOperatorMenuList(request, operator); + } + + /** + * 获取操作员菜单列表 + * + * @param request 请求对象 + * @param operator 操作员 + * @return 菜单列表 + * @throws Exception 可能的异常 + */ + public static List getOperatorMenuList(HttpRequest request, ZmrOperator operator) throws Exception + { + List menuList = getAllMenuList(request); + if (operator.getOperatorType() == 0) + return menuList; + + //1.删除未开启的功能菜单 + for (Iterator it=menuList.iterator();it.hasNext();) + { + ZmrMenu menu = it.next(); + if (menu.getMenuStatus() != 0) + it.remove(); + } + + //2.查出操作员独立权限、组织权限、部门权限和角色权限 + List operatorRuleList = ZmrBootstrap.table(request).list(ZmrOperatorRule.class, new Selector("operatorCode", operator.getOperatorCode())); + + //查看该操作员是否是所属组织负责人,如果是,给操作员赋予组织全部权限。 + List orgRuleList = new ArrayList(); + if(ZmrOrgDao.isOrgManager(request, operator.getOperatorCode())) + { + List list = ZmrBootstrap.table(request).list(ZmrOrgRule.class, new Selector("orgId", operator.getOrgId())); + orgRuleList.addAll(list); + } + + List deptRuleList = new ArrayList<>(); + String deptIds = ZmrParamDao.isOperatorDeptAllRule(request.getContext())?operator.getOperatorDeptAll():operator.getOperatorDept(); + List deptIdList = Lists.toLongList(deptIds); + for (long deptId : deptIdList) + { + List ruleList = ZmrBootstrap.table(request).list(ZmrDeptRule.class, new Selector("deptId", deptId)); + deptRuleList.addAll(ruleList); + } + + List roleRuleList = new ArrayList<>(); + List roleIdList = Lists.toLongList(operator.getOperatorRole()); + for (long roleId : roleIdList) + { + List ruleList = ZmrBootstrap.table(request).list(ZmrRoleRule.class, new Selector("roleId", roleId)); + roleRuleList.addAll(ruleList); + } + + //3.属于三者之一则认为有效 + for (Iterator it=menuList.iterator();it.hasNext();) + { + String menuCode = it.next().getMenuCode(); + if (isOrgRule(orgRuleList, menuCode)) + continue; + + if (isOperatorRule(operatorRuleList, menuCode)) + continue; + + if (isDeptRule(deptRuleList, menuCode)) + continue; + + if (isRoleRule(roleRuleList, menuCode)) + continue; + + it.remove(); + } + + return menuList; + } + + /** + * 根据组织编号查询操作员 + * + * @param request 请求对象 + * @param orgId 组织编号 + * @return 组织下操作员列表 + * @throws Exception 可能的异常 + */ + public static List getOperator(HttpRequest request, long orgId) throws Exception + { + return ZmrBootstrap.tableOpr(request).list(ZmrOperator.class, new Selector("orgId",orgId)); + } + + /** + * 查询所有操作员 + * + * @param request 请求对象 + * @return 操作员列表 + * @throws Exception 可能的异常 + */ + public static List getOperatorAll(HttpRequest request) throws Exception + { + return ZmrBootstrap.tableOpr(request).list(ZmrOperator.class); + } + + /** + * 指定操作员编码查询操作员 + * + * @param request 请求对象 + * @param operatorCode 操作员编号 + * @return 操作员对象 + * @throws Exception 可能的异常 + */ + public static ZmrOperator getOperator(HttpRequest request, String operatorCode) throws Exception + { + return ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + } + + /** 是否在操作员列表中 */ + public static boolean isOperator(List list, String operatorCode) + { + for (ZmrOperator opr : list) + { + if (operatorCode.equals(opr.getOperatorCode())) + return true; + } + + return false; + } + + /** 是否操作员独立权限 */ + public static boolean isOperatorRule(List ruleList, String menuCode) + { + for (ZmrOperatorRule rule : ruleList) + { + if (menuCode.equals(rule.getMenuCode())) + return true; + } + + return false; + } + + /** 是否部门权限 */ + public static boolean isDeptRule(List ruleList, String menuCode) + { + for (ZmrDeptRule rule : ruleList) + { + if (menuCode.equals(rule.getMenuCode())) + return true; + } + + return false; + } + + /** 是否组织权限 */ + public static boolean isOrgRule(List ruleList, String menuCode) + { + for (ZmrOrgRule rule : ruleList) + { + if (menuCode.equals(rule.getMenuCode())) + return true; + } + + return false; + } + + /** 是否角色权限 */ + public static boolean isRoleRule(List ruleList, String menuCode) + { + for (ZmrRoleRule rule : ruleList) + { + if (menuCode.equals(rule.getMenuCode())) + return true; + } + + return false; + } + + /** 刷新所有在线用户会话 */ + public static void refresh(HttpRequest request) throws Exception + { + List sessionUserList = request.getContext().getSessionManager().getSessionUserList(); + for (HttpSessionUser sessionUser : sessionUserList) + { + if (!(sessionUser instanceof ZmrSessionUser)) + continue; + + ZmrSessionUser sUser = (ZmrSessionUser)sessionUser; + List menuList = ZmrOperatorDao.getOperatorMenuList(request, sUser.getOperator()); + sUser.setMenuList(request.getContext(), menuList); + } + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dao/ZmrOrgDao.java b/zhiqim_manager/src/org/zhiqim/manager/dao/ZmrOrgDao.java new file mode 100644 index 0000000..c9a521d --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dao/ZmrOrgDao.java @@ -0,0 +1,229 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dao; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrMenu; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.manager.dbo.ZmrOrgRule; +import org.zhiqim.orm.dbo.Selector; + +@AnAlias("ZmrOrgDao") +public class ZmrOrgDao +{ + /** + * 获取组织列表 + * + * @param request 请求对象 + * @return 组织列表 + * @throws Exception 可能的异常 + */ + public static List list(HttpRequest request) throws Exception + { + return ZmrBootstrap.tableOpr(request).list(ZmrOrg.class, new Selector().addOrderbyAsc("orgLevel,orgSeq,orgId")); + } + + /** + * 获取正常状态组织列表 + * + * @param request 请求对象 + * @return 组织列表 + * @throws Exception 可能的异常 + */ + public static List listForStatus(HttpRequest request) throws Exception + { + return ZmrBootstrap.tableOpr(request).list(ZmrOrg.class, new Selector().addMust("orgStatus", 0).addOrderbyAsc("orgLevel,orgSeq,orgId")); + } + + /** + * 获取可切换的组织列表 + * + * @param request 请求对象 + * @return 组织列表 + * @throws Exception 可能的异常 + */ + public static List getOrgList(HttpRequest request, String operatorCode) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + long orgId = sessionUser.getOperatorOrgId(); + ZmrOrg org = ZmrBootstrap.tableOpr(request).item(ZmrOrg.class, new Selector("orgId", orgId)); + List list = new ArrayList(); + if (org.getOrgLevel() == 0) + { + list = list(request); + } + + if (org.getOrgLevel() == 1) + { + list.add(org); + } + + return list; + } + + /** + * 获取组织列表,根据级别 + * + * @param request 请求对象 + * @param orgLevel 组织级别 + * @return 组织列表 + * @throws Exception 可能的异常 + */ + public static List levelList(HttpRequest request, int orgLevel) throws Exception + { + return ZmrBootstrap.tableOpr(request).list(ZmrOrg.class, new Selector().addMust("orgLevel", orgLevel).addOrderbyAsc("orgSeq,orgId")); + } + + /** + * 获取根组织编号 + * + * @param request 请求对象 + * @return 根组织编号 + * @throws Exception 可能的异常 + */ + public static long getOrgRootId(HttpRequest request) throws Exception + { + return ZmrBootstrap.tableOpr(request).item(ZmrOrg.class, new Selector("orgLevel", 0)).getOrgId(); + } + + /** + * 获取组织名称 + * + * @param request 请求对象 + * @param orgId 组织编号 + * @return 组织名称 + * @throws Exception 可能的异常 + */ + public static String getOrgName(HttpRequest request, long orgId) throws Exception + { + ZmrOrg org = ZmrBootstrap.tableOpr(request).item(ZmrOrg.class, orgId); + return Validates.isEmpty(org) ? "" : org.getOrgName(); + } + + /** + * 是否是组织负责人 + * + * @param request 请求对象 + * @param operatorCode 操作员编号 + * @return 是否组织负责人 + * @throws Exception 可能的异常 + */ + public static boolean isOrgManager(HttpRequest request, String operatorCode) throws Exception + { + return !ZmrBootstrap.tableOpr(request).list(ZmrOrg.class, new Selector("orgId", "orgManager", operatorCode)).isEmpty(); + } + + /** + * 设置顶级组织权限和菜单权限保持一致 + * + * @param request 请求对象 + * @param orgId 组织编号 + * @throws Exception 可能的异常 + */ + public static void setTopOrgRule(HttpRequest request, long orgId) throws Exception + { + List menuList = ZmrBootstrap.table(request).list(ZmrMenu.class, new Selector()); + List orgRuleList = ZmrBootstrap.table(request).list(ZmrOrgRule.class, new Selector("orgId", orgId)); + + String allMenu = ""; + for (ZmrMenu menu : menuList) + { + allMenu += menu.getMenuCode() + ","; + } + String orgMenu = ""; + for (ZmrOrgRule rule : orgRuleList) + { + orgMenu += rule.getMenuCode() + ","; + } + + if (!allMenu.equals(orgMenu)) + { + ZmrBootstrap.table(request).delete(ZmrOrgRule.class, new Selector("orgId", orgId)); + List newRuleList = new ArrayList(); + for (ZmrMenu menu : menuList) + { + ZmrOrgRule rule = new ZmrOrgRule(); + rule.setOrgId(orgId); + rule.setMenuCode(menu.getMenuCode()); + newRuleList.add(rule); + } + ZmrBootstrap.table(request).insertBatch(newRuleList); + + // 刷新所有在线用户会话 + ZmrOperatorDao.refresh(request); + } + } + + /** + * 获取部门、角色、操作员所属组织的权限 + * + * @param request 请求对象 + * @param orgId 组织编号 + * @return 组织权限 + * @throws Exception 可能的异常 + */ + public static List getMenuList(HttpRequest request, long orgId) throws Exception + { + ZmrOrg org = ZmrBootstrap.tableOpr(request).item(ZmrOrg.class, orgId); + if (org != null && org.getOrgLevel() == 0) + { + setTopOrgRule(request, orgId); + } + + List orgRuleList = ZmrBootstrap.table(request).list(ZmrOrgRule.class, new Selector("orgId", orgId)); + String codeS = ""; + for (ZmrOrgRule rule : orgRuleList) + { + if (Validates.isEmptyBlank(codeS)) + { + codeS = rule.getMenuCode(); + } + else + { + codeS = codeS + "," + rule.getMenuCode(); + } + } + + List menuList = ZmrBootstrap.table(request).list(ZmrMenu.class, + new Selector().addMustIn("menuCode", Arrays.toStringArray(codeS)).addMust("menuStatus", 0)); + + return menuList; + } + + /** + * 指定组织编号获取组织 + * + * @param request 请求对象 + * @param orgId 组织编号 + * @return 组织对象 + * @throws Exception 可能的异常 + */ + public static ZmrOrg getOrg(HttpRequest request, long orgId) throws Exception + { + return ZmrBootstrap.tableOpr(request).item(ZmrOrg.class, orgId); + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dao/ZmrParamDao.java b/zhiqim_manager/src/org/zhiqim/manager/dao/ZmrParamDao.java new file mode 100644 index 0000000..ae38206 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dao/ZmrParamDao.java @@ -0,0 +1,306 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dao; + +import java.sql.SQLException; +import java.util.LinkedHashMap; +import java.util.List; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.config.ItemType; +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.dbo.ZmrParam; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * 参数访问对象 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + * @version v1.4.1 @author zouzhigang 2018-5-3 由ZmrParamCache改为ZmrParamDao + */ +@AnAlias("ZmrParamDao") +public class ZmrParamDao implements ZmrConstants, SignConstants +{ + /**************************************************/ + //新建参数对象 + /**************************************************/ + + /** 新建参数对象,默认值和验证为空,允许修改 */ + public static void addParam(HttpContext context, String paramGroup, String paramKey, int paramSeq, String paramDesc) throws Exception + { + addParam(context, paramGroup, paramKey, null, paramSeq, ItemType.PUBLIC, null, paramDesc); + } + + /** 新建参数对象,默认验证为空 */ + public static void addParam(HttpContext context, String paramGroup, String paramKey, String paramValue, int paramSeq, ItemType paramType, String paramDesc) throws Exception + { + addParam(context, paramGroup, paramKey, paramValue, paramSeq, paramType, null, paramDesc); + } + + /** 新建参数对象,全7个字段 */ + public static void addParam(HttpContext context, String paramGroup, String paramKey, String paramValue, int paramSeq, ItemType paramType, String paramValidate, String paramDesc) throws Exception + { + if (ZmrBootstrap.table(context).count(ZmrParam.class, paramGroup, paramKey) == 0) + { + ZmrParam param = new ZmrParam(); + param.setParamGroup(paramGroup); + param.setParamKey(paramKey); + param.setParamValue(paramValue); + param.setParamSeq(paramSeq); + param.setParamType(ItemType.toString(paramType)); + param.setParamValidate(paramValidate); + param.setParamDesc(paramDesc); + + ZmrBootstrap.table(context).insert(param); + } + } + + /**************************************************/ + //判断和获取参数 + /**************************************************/ + + /** 判断是否存在参数组 */ + public static boolean hasGroup(HttpContext context, String paramGroup) throws ORMException, SQLException + { + return ZmrBootstrap.table(context).count(ZmrParam.class, new Selector("paramGroup", paramGroup)) > 0; + } + + + /** 判断是否存在参数 */ + public static boolean hasParam(HttpContext context, String paramGroup, String paramKey) throws ORMException, SQLException + { + return ZmrBootstrap.table(context).count(ZmrParam.class, paramGroup, paramKey) > 0; + } + + /** 获取参数组表 */ + public static LinkedHashMap> getGroupMap(HttpContext context) throws ORMException, SQLException + { + LinkedHashMap> groupMap = new LinkedHashMap<>(); + + List paramList = ZmrBootstrap.table(context).list(ZmrParam.class, new Selector().addMustNotEqual("paramType", "private").addOrderbyAsc("paramGroup,paramSeq")); + for (ZmrParam param : paramList) + { + LinkedHashMap paramMap = groupMap.get(param.getParamGroup()); + if (paramMap == null) + { + paramMap = new LinkedHashMap(); + groupMap.put(param.getParamGroup(), paramMap); + } + + paramMap.put(param.getParamKey(), param); + } + return groupMap; + } + + /** 获取参数 */ + public static ZmrParam getParam(HttpContext context, String paramGroup, String paramKey) throws ORMException, SQLException + { + ZTable table = ZmrBootstrap.table(context); + return table.item(ZmrParam.class, paramGroup, paramKey); + } + + /** 获取字符串数据 */ + public static String getString(HttpContext context, String paramGroup, String paramKey) throws ORMException, SQLException + { + ZmrParam param = getParam(context, paramGroup, paramKey); + return (param == null)?null:param.getParamValue(); + } + + /** 获取字符串数据,为null取缺省值 */ + public static String getString(HttpContext context, String paramGroup, String paramKey, String defaultValue) throws ORMException, SQLException + { + String value = getString(context, paramGroup, paramKey); + return (Validates.isEmptyBlank(value))?defaultValue:value; + } + + /** 获取整型数据 */ + public static int getInt(HttpContext context, String paramGroup, String paramKey) throws ORMException, SQLException + { + return getInt(context, paramGroup, paramKey, -1); + } + + /** 获取整型数据,为null取缺省值 */ + public static int getInt(HttpContext context, String paramGroup, String paramKey, int defaultValue) throws ORMException, SQLException + { + return Ints.toInt(getString(context, paramGroup, paramKey), defaultValue); + } + + /** 判断是否为真 */ + public static boolean isTrue(HttpContext context, String paramGroup, String paramKey) throws ORMException, SQLException + { + return _TRUE_.equals(getString(context, paramGroup, paramKey)); + } + + /** 判断是否为真,为null取缺省值 */ + public static boolean isTrue(HttpContext context, String paramGroup, String paramKey, String defaultValue) throws ORMException, SQLException + { + return _TRUE_.equals(getString(context, paramGroup, paramKey, defaultValue)); + } + + /**************************************************/ + //更新和刷新参数 + /**************************************************/ + + /** 更新缓存值 */ + public static boolean doUpdate(HttpContext context, String paramGroup, String paramKey, int paramValue) throws ORMException, SQLException + { + return doUpdate(context, paramGroup, paramKey, String.valueOf(paramValue)); + } + + /** 更新缓存值 */ + public static boolean doUpdate(HttpContext context, String paramGroup, String paramKey, long paramValue) throws ORMException, SQLException + { + return doUpdate(context, paramGroup, paramKey, String.valueOf(paramValue)); + } + + /** 更新缓存值 */ + public static boolean doUpdate(HttpContext context, String paramGroup, String paramKey, boolean paramValue) throws ORMException, SQLException + { + return doUpdate(context, paramGroup, paramKey, String.valueOf(paramValue)); + } + + /** 更新缓存值 */ + public static boolean doUpdate(HttpContext context, String paramGroup, String paramKey, String paramValue) throws ORMException, SQLException + { + //更新到数据库 + Updater updater = new Updater(); + updater.addMust("paramGroup", paramGroup); + updater.addMust("paramKey", paramKey); + updater.addField("paramValue", paramValue); + return ZmrBootstrap.table(context).update(ZmrParam.class, updater) > 0; + } + + /**************************************************/ + //以下为ZMR本身自带的六项参数 + /**************************************************/ + + /** 获取首页主题风格 */ + public static String getThemeIndex(HttpContext context) throws ORMException, SQLException + { + return getString(context, ZMR_NAME, ZMR_THEME_INDEX, ZMR_THEME_DEFAULT); + } + + /** 更新首页主题风格 */ + public static void doUpdateThemeIndex(HttpContext context, String theme) throws ORMException, SQLException + { + doUpdate(context, ZMR_NAME, ZMR_THEME_INDEX, theme); + } + + /** 获取主页主题风格 */ + public static String getThemeMain(HttpContext context) throws ORMException, SQLException + { + return getString(context, ZMR_NAME, ZMR_THEME_MAIN, ZMR_THEME_DEFAULT); + } + + /** 更新主页主题风格 */ + public static void doUpdateThemeMain(HttpContext context, String theme) throws ORMException, SQLException + { + doUpdate(context, ZMR_NAME, ZMR_THEME_MAIN, theme); + } + + public static boolean isThemeFrame(HttpContext context) throws ORMException, SQLException + { + return isTrue(context, ZMR_NAME, ZMR_THEME_FRAME, _FALSE_); + } + + /** 获取公司外网IP */ + public static String getMhIp(HttpContext context) throws ORMException, SQLException + { + return getString(context, ZMR_NAME, ZMR_MH_IP); + } + + /** 是否有管理登录页 */ + public static boolean hasManageLogin(HttpContext context) throws ORMException, SQLException + { + return isTrue(context, ZMR_NAME, ZMR_HAS_MANAGE_LOGIN); + } + + /** 是否有验证码 */ + public static boolean hasVerificationCode(HttpContext context) throws ORMException, SQLException + { + return isTrue(context, ZMR_NAME, ZMR_HAS_VERIFICATION_CODE); + } + + /** 是否记住用户名 */ + public static boolean hasRememberCode(HttpContext context) throws ORMException, SQLException + { + return isTrue(context, ZMR_NAME, ZMR_HAS_REMEMBER_CODE); + } + + /** 是否记住密码 */ + public static boolean hasRememberPass(HttpContext context) throws ORMException, SQLException + { + return isTrue(context, ZMR_NAME, ZMR_HAS_REMEMBER_PASS); + } + + /** 获取主页地址 */ + public static String getMainUrl(HttpContext context) throws ORMException, SQLException + { + return getString(context, ZMR_NAME, ZMR_MAIN_URL, ZMR_MAIN_URL_DEFAULT); + } + + /** 获取主页首页地址 */ + public static String getMainIndexUrl(HttpContext context) throws ORMException, SQLException + { + return isThemeFrame(context)?ZMR_MAIN_URL_WELCOME:ZMR_MAIN_URL_DEFAULT; + } + + /** 获取保留操作日志天数 */ + public static int getRemainLogDay(HttpContext context) throws ORMException, SQLException + { + return getInt(context, ZMR_NAME, ZMR_REMAIN_LOG_DAY, 7); + } + + /** 是否取操作员继承的所有部门权限 */ + public static boolean isOperatorDeptAllRule(HttpContext context) throws ORMException, SQLException + { + return isTrue(context, ZMR_NAME, ZMR_OPERATOR_DEPT_ALL_RULE); + } + + /** 是否使用CDN路径 */ + public static boolean hasCdnPath(HttpContext context) throws ORMException, SQLException + { + return !Validates.isEmptyBlank(getString(context, ZMR_NAME, ZMR_CDN_PATH)); + } + + /** 获取CDN路径 */ + public static String getCdnPath(HttpContext context) throws ORMException, SQLException + { + return getString(context, ZMR_NAME, ZMR_CDN_PATH); + } + + /** 获取公钥 */ + public static String getPublicKey(HttpContext context) throws ORMException, SQLException + { + return getString(context, ZMR_NAME, ZMR_PUBLIC_KEY); + } + + /** 获取私钥 */ + public static String getPrivateKey(HttpContext context) throws ORMException, SQLException + { + return getString(context, ZMR_NAME, ZMR_PRIVATE_KEY); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrAvatar.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrAvatar.java new file mode 100644 index 0000000..4d6cf57 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrAvatar.java @@ -0,0 +1,109 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 系统头像表 对应表《ZMR_AVATAR》 + */ +@AnAlias("ZmrAvatar") +@AnNew +@AnTable(table="ZMR_AVATAR", key="AVATAR_ID", type="InnoDB") +public class ZmrAvatar implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="AVATAR_ID", type="long", notNull=true) private long avatarId; //1.头像编号 + @AnTableField(column="AVATAR_TYPE", type="byte", notNull=true) private int avatarType; //2.头像类型:0系统,1用户 + @AnTableField(column="AVATAR_TIME", type="long", notNull=true) private long avatarTime; //3.头像上传时间,long型,方便转HTTP时间 + @AnTableField(column="AVATAR_50", type="binary", notNull=true) private byte[] avatar50; //4.50*50头像 + @AnTableField(column="AVATAR_100", type="binary", notNull=true) private byte[] avatar100; //5.100*100头像 + @AnTableField(column="AVATAR_150", type="binary", notNull=true) private byte[] avatar150; //6.150*150头像 + + public String toString() + { + return Jsons.toString(this); + } + + public long getAvatarId() + { + return avatarId; + } + + public void setAvatarId(long avatarId) + { + this.avatarId = avatarId; + } + + public int getAvatarType() + { + return avatarType; + } + + public void setAvatarType(int avatarType) + { + this.avatarType = avatarType; + } + + public long getAvatarTime() + { + return avatarTime; + } + + public void setAvatarTime(long avatarTime) + { + this.avatarTime = avatarTime; + } + + public byte[] getAvatar50() + { + return avatar50; + } + + public void setAvatar50(byte[] avatar50) + { + this.avatar50 = avatar50; + } + + public byte[] getAvatar100() + { + return avatar100; + } + + public void setAvatar100(byte[] avatar100) + { + this.avatar100 = avatar100; + } + + public byte[] getAvatar150() + { + return avatar150; + } + + public void setAvatar150(byte[] avatar150) + { + this.avatar150 = avatar150; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrDept.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrDept.java new file mode 100644 index 0000000..b195de3 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrDept.java @@ -0,0 +1,164 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 组织部门表 对应表《ZMR_DEPT》 + */ +@AnAlias("ZmrDept") +@AnNew +@AnTable(table="ZMR_DEPT", key="DEPT_ID", type="InnoDB") +public class ZmrDept implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ORG_ID", type="long", notNull=true) private long orgId; //1.组织编号 + @AnTableField(column="PARENT_ID", type="long", notNull=true) private long parentId; //2.部门父编号 + @AnTableField(column="DEPT_ID", type="long", notNull=true) private long deptId; //3.部门编号 + @AnTableField(column="DEPT_NAME", type="string,32", notNull=true) private String deptName; //4.部门名称 + @AnTableField(column="DEPT_LEVEL", type="int", notNull=true) private int deptLevel; //5.部门级别 + @AnTableField(column="DEPT_STATUS", type="byte", notNull=true) private int deptStatus; //6.部门状态,0表示正常,1表示停用 + @AnTableField(column="DEPT_SEQ", type="int", notNull=true) private int deptSeq; //7.部门排序数 + @AnTableField(column="DEPT_PARENT_ALL", type="string,850", notNull=true) private String deptParentAll; //8.部门所有父节点,多个逗号隔开 + @AnTableField(column="DEPT_MANAGER", type="string,32", notNull=false) private String deptManager; //9.部门负责人 + @AnTableField(column="DEPT_SUB_MANAGER", type="string,200", notNull=false) private String deptSubManager; //10.部门副负责人,多个逗号隔开 + @AnTableField(column="DEPT_DESC", type="string,100", notNull=false) private String deptDesc; //11.部门描述 + + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public long getParentId() + { + return parentId; + } + + public void setParentId(long parentId) + { + this.parentId = parentId; + } + + public long getDeptId() + { + return deptId; + } + + public void setDeptId(long deptId) + { + this.deptId = deptId; + } + + public String getDeptName() + { + return deptName; + } + + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public int getDeptLevel() + { + return deptLevel; + } + + public void setDeptLevel(int deptLevel) + { + this.deptLevel = deptLevel; + } + + public int getDeptStatus() + { + return deptStatus; + } + + public void setDeptStatus(int deptStatus) + { + this.deptStatus = deptStatus; + } + + public int getDeptSeq() + { + return deptSeq; + } + + public void setDeptSeq(int deptSeq) + { + this.deptSeq = deptSeq; + } + + public String getDeptParentAll() + { + return deptParentAll; + } + + public void setDeptParentAll(String deptParentAll) + { + this.deptParentAll = deptParentAll; + } + + public String getDeptManager() + { + return deptManager; + } + + public void setDeptManager(String deptManager) + { + this.deptManager = deptManager; + } + + public String getDeptSubManager() + { + return deptSubManager; + } + + public void setDeptSubManager(String deptSubManager) + { + this.deptSubManager = deptSubManager; + } + + public String getDeptDesc() + { + return deptDesc; + } + + public void setDeptDesc(String deptDesc) + { + this.deptDesc = deptDesc; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrDeptRule.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrDeptRule.java new file mode 100644 index 0000000..281d4ad --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrDeptRule.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 组织部门权限表 对应表《ZMR_DEPT_RULE》 + */ +@AnAlias("ZmrDeptRule") +@AnNew +@AnTable(table="ZMR_DEPT_RULE", key="DEPT_ID,MENU_CODE", type="InnoDB") +public class ZmrDeptRule implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="DEPT_ID", type="long", notNull=true) private long deptId; //1.部门编号 + @AnTableField(column="MENU_CODE", type="string,32", notNull=true) private String menuCode; //2.菜单编码 + + public String toString() + { + return Jsons.toString(this); + } + + public long getDeptId() + { + return deptId; + } + + public void setDeptId(long deptId) + { + this.deptId = deptId; + } + + public String getMenuCode() + { + return menuCode; + } + + public void setMenuCode(String menuCode) + { + this.menuCode = menuCode; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrMenu.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrMenu.java new file mode 100644 index 0000000..80b7393 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrMenu.java @@ -0,0 +1,153 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 系统菜单表 对应表《ZMR_MENU》 + */ +@AnAlias("ZmrMenu") +@AnNew +@AnTable(table="ZMR_MENU", key="MENU_CODE", type="InnoDB") +public class ZmrMenu implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="PARENT_CODE", type="string,32", notNull=true) private String parentCode; //1.父类菜单编码 + @AnTableField(column="MENU_CODE", type="string,32", notNull=true) private String menuCode; //2.菜单编码 + @AnTableField(column="MENU_NAME", type="string,64", notNull=true) private String menuName; //3.菜单名称 + @AnTableField(column="MENU_NAME_ABBR", type="string,10", notNull=false) private String menuNameAbbr; //4.菜单名称简称 + @AnTableField(column="MENU_LEVEL", type="byte", notNull=true) private int menuLevel; //5.菜单级别:相对于根节点的级别 + @AnTableField(column="MENU_TYPE", type="byte", notNull=true) private int menuType; //6.菜单类型:0表示根节点;1表示枝节点;2表示属性 + @AnTableField(column="MENU_STATUS", type="byte", notNull=true) private int menuStatus; //7.菜单状态,0表示正常,1表示停用 + @AnTableField(column="MENU_ICON", type="string,32", notNull=false) private String menuIcon; //8.菜单图标 + @AnTableField(column="MENU_URL", type="string,100", notNull=false) private String menuUrl; //9.菜单对应的URL:1.当URL为空时不显示链接;2.URL允许多个path,之间用“,”分隔,链接采用第一个path;3.path作为权限的验证原子 + @AnTableField(column="MENU_DESC", type="string,100", notNull=false) private String menuDesc; //10.菜单描述 + + public String toString() + { + return Jsons.toString(this); + } + + public String getParentCode() + { + return parentCode; + } + + public void setParentCode(String parentCode) + { + this.parentCode = parentCode; + } + + public String getMenuCode() + { + return menuCode; + } + + public void setMenuCode(String menuCode) + { + this.menuCode = menuCode; + } + + public String getMenuName() + { + return menuName; + } + + public void setMenuName(String menuName) + { + this.menuName = menuName; + } + + public String getMenuNameAbbr() + { + return menuNameAbbr; + } + + public void setMenuNameAbbr(String menuNameAbbr) + { + this.menuNameAbbr = menuNameAbbr; + } + + public int getMenuLevel() + { + return menuLevel; + } + + public void setMenuLevel(int menuLevel) + { + this.menuLevel = menuLevel; + } + + public int getMenuType() + { + return menuType; + } + + public void setMenuType(int menuType) + { + this.menuType = menuType; + } + + public int getMenuStatus() + { + return menuStatus; + } + + public void setMenuStatus(int menuStatus) + { + this.menuStatus = menuStatus; + } + + public String getMenuIcon() + { + return menuIcon; + } + + public void setMenuIcon(String menuIcon) + { + this.menuIcon = menuIcon; + } + + public String getMenuUrl() + { + return menuUrl; + } + + public void setMenuUrl(String menuUrl) + { + this.menuUrl = menuUrl; + } + + public String getMenuDesc() + { + return menuDesc; + } + + public void setMenuDesc(String menuDesc) + { + this.menuDesc = menuDesc; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOperator.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOperator.java new file mode 100644 index 0000000..c73b62e --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOperator.java @@ -0,0 +1,341 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 操作员表 对应表《ZMR_OPERATOR》 + */ +@AnAlias("ZmrOperator") +@AnNew +@AnTable(table = "ZMR_OPERATOR", key = "OPERATOR_CODE", type = "InnoDB") +public class ZmrOperator implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "ORG_ID", type = "long", notNull = true) + private long orgId; // 1.组织编号 + @AnTableField(column = "OPERATOR_CODE", type = "string,32", notNull = true) + private String operatorCode; // 2.操作员编码 + @AnTableField(column = "OPERATOR_PASS", type = "string,64,char", notNull = true) + private String operatorPass; // 3.操作员密码 + @AnTableField(column = "OPERATOR_PASS_SALT", type = "string,64,char", notNull = true) + private String operatorPassSalt; // 4.操作员密码盐值 + @AnTableField(column = "OPERATOR_STATUS", type = "byte", notNull = true) + private int operatorStatus; // 5.操作员状态:0正常,1停用 + @AnTableField(column = "OPERATOR_TYPE", type = "byte", notNull = true) + private int operatorType; // 6.操作员类型:0:超级管理员,1:管理员,2:操作员 + @AnTableField(column = "OPERATOR_NAME", type = "string,64", notNull = true) + private String operatorName; // 7.操作员名称 + @AnTableField(column = "OPERATOR_BALANCE", type = "long", notNull = true) + private long operatorBalance; // 8.操作员余额,单位:分 + @AnTableField(column = "OPERATOR_AVATAR", type = "long", notNull = false) + private long operatorAvatar; // 9.操作员头像编号 + @AnTableField(column = "OPERATOR_DEPT", type = "string,850", notNull = false) + private String operatorDept; // 10.操作员所属部门,多个用逗号隔开,当前支持关联50个部门 + @AnTableField(column = "OPERATOR_DEPT_ALL", type = "string,1700", notNull = false) + private String operatorDeptAll; // 11.操作员对应的所有部门,多个用逗号隔开,当前支持关联100个部门 + @AnTableField(column = "OPERATOR_ROLE", type = "string,850", notNull = false) + private String operatorRole; // 12.操作员角色,多个用逗号隔开,当前支持关联50个角色 + @AnTableField(column = "OPERATOR_MOBILE", type = "string,21", notNull = false) + private String operatorMobile; // 13.操作员手机号 + @AnTableField(column = "OPERATOR_EMAIL", type = "string,64", notNull = false) + private String operatorEmail; // 14.操作员邮箱 + @AnTableField(column = "OPERATOR_SKIN", type = "string,20", notNull = false) + private String operatorSkin; // 15.操作员主题肤色 + @AnTableField(column = "OPERATOR_IP", type = "string,18", notNull = false) + private String operatorIp; // 16.操作员工作IP + @AnTableField(column = "OPERATOR_URL", type = "string,50", notNull = false) + private String operatorUrl; // 17.操作员登录后首页 + @AnTableField(column = "OPERATOR_PARAM", type = "string,1024", notNull = false) + private String operatorParam; // 18.操作员参数,用于项目自定义设置 + @AnTableField(column = "OPERATOR_CREATED", type = "string,19,char", notNull = true) + private String operatorCreated; // 19.操作员创建时间,格式:yyyy-MM-dd hh:mm:ss + @AnTableField(column = "OPERATOR_MODIFIED", type = "string,19,char", notNull = true) + private String operatorModified; // 20.操作员修改时间,格式:yyyy-MM-dd hh:mm:ss + @AnTableField(column = "OPERATOR_WANGWANG", type = "string,100", notNull = false) + private String operatorWangwang; // 21.操作员旺旺 + @AnTableField(column = "OPEN_ID", type = "string,50", notNull = false) + private String openId; // 22.微信openid + @AnTableField(column = "INITIAL_PASSWORD", type = "string,64,char", notNull = false) + private String initialPassword; // 23.初始密码 + @AnTableField(column = "WKWECHAT_ACCOUNT", type = "string,200", notNull = false) + private String wkwechatAccount; // 24.企业微信账号 + @AnTableField(column = "OPERATOR_WXCODE", type = "string,200", notNull = false) + private String operatorWxcode; // 25.个人微信 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public String getOperatorPass() + { + return operatorPass; + } + + public void setOperatorPass(String operatorPass) + { + this.operatorPass = operatorPass; + } + + public String getOperatorPassSalt() + { + return operatorPassSalt; + } + + public void setOperatorPassSalt(String operatorPassSalt) + { + this.operatorPassSalt = operatorPassSalt; + } + + public int getOperatorStatus() + { + return operatorStatus; + } + + public void setOperatorStatus(int operatorStatus) + { + this.operatorStatus = operatorStatus; + } + + public int getOperatorType() + { + return operatorType; + } + + public void setOperatorType(int operatorType) + { + this.operatorType = operatorType; + } + + public String getOperatorName() + { + return operatorName; + } + + public void setOperatorName(String operatorName) + { + this.operatorName = operatorName; + } + + public long getOperatorBalance() + { + return operatorBalance; + } + + public void setOperatorBalance(long operatorBalance) + { + this.operatorBalance = operatorBalance; + } + + public long getOperatorAvatar() + { + return operatorAvatar; + } + + public void setOperatorAvatar(long operatorAvatar) + { + this.operatorAvatar = operatorAvatar; + } + + public String getOperatorDept() + { + return operatorDept; + } + + public void setOperatorDept(String operatorDept) + { + this.operatorDept = operatorDept; + } + + public String getOperatorDeptAll() + { + return operatorDeptAll; + } + + public void setOperatorDeptAll(String operatorDeptAll) + { + this.operatorDeptAll = operatorDeptAll; + } + + public String getOperatorRole() + { + return operatorRole; + } + + public void setOperatorRole(String operatorRole) + { + this.operatorRole = operatorRole; + } + + public String getOperatorMobile() + { + return operatorMobile; + } + + public void setOperatorMobile(String operatorMobile) + { + this.operatorMobile = operatorMobile; + } + + public String getOperatorEmail() + { + return operatorEmail; + } + + public void setOperatorEmail(String operatorEmail) + { + this.operatorEmail = operatorEmail; + } + + public String getOperatorSkin() + { + return operatorSkin; + } + + public void setOperatorSkin(String operatorSkin) + { + this.operatorSkin = operatorSkin; + } + + public String getOperatorIp() + { + return operatorIp; + } + + public void setOperatorIp(String operatorIp) + { + this.operatorIp = operatorIp; + } + + public String getOperatorUrl() + { + return operatorUrl; + } + + public void setOperatorUrl(String operatorUrl) + { + this.operatorUrl = operatorUrl; + } + + public String getOperatorParam() + { + return operatorParam; + } + + public void setOperatorParam(String operatorParam) + { + this.operatorParam = operatorParam; + } + + public String getOperatorCreated() + { + return operatorCreated; + } + + public void setOperatorCreated(String operatorCreated) + { + this.operatorCreated = operatorCreated; + } + + public String getOperatorModified() + { + return operatorModified; + } + + public void setOperatorModified(String operatorModified) + { + this.operatorModified = operatorModified; + } + + public String getOperatorWangwang() + { + return operatorWangwang; + } + + public void setOperatorWangwang(String operatorWangwang) + { + this.operatorWangwang = operatorWangwang; + } + + public String getOpenId() + { + return openId; + } + + public void setOpenId(String openId) + { + this.openId = openId; + } + + public String getInitialPassword() + { + return initialPassword; + } + + public void setInitialPassword(String initialPassword) + { + this.initialPassword = initialPassword; + } + + public String getWkwechatAccount() + { + return wkwechatAccount; + } + + public void setWkwechatAccount(String wkwechatAccount) + { + this.wkwechatAccount = wkwechatAccount; + } + + public String getOperatorWxcode() + { + return operatorWxcode; + } + + public void setOperatorWxcode(String operatorWxcode) + { + this.operatorWxcode = operatorWxcode; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOperatorLog.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOperatorLog.java new file mode 100644 index 0000000..d94bfb7 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOperatorLog.java @@ -0,0 +1,100 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 操作员日志表 对应表《ZMR_OPERATOR_LOG》 + */ +@AnAlias("ZmrOperatorLog") +@AnNew +@AnTable(table="ZMR_OPERATOR_LOG", key="", type="InnoDB") +@AnIndex({@AnIndexValue(name="IX_ZMR_OPERATOR_LOG_ORG_TIME", column="ORG_ID,OPERATE_TIME", unique=false)}) +public class ZmrOperatorLog implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ORG_ID", type="long", notNull=true) private long orgId; //1.组织编号 + @AnTableField(column="OPERATOR_CODE", type="string,32", notNull=true) private String operatorCode; //2.操作员编码 + @AnTableField(column="OPERATE_TIME", type="datetime", notNull=true) private Timestamp operateTime; //3.操作时间,格式:yyyy-MM-dd hh:mm:ss + @AnTableField(column="OPERATE_URL", type="string,512", notNull=true) private String operateUrl; //4.操作链接 + @AnTableField(column="OPERATE_DESC", type="string,512", notNull=false) private String operateDesc; //5.操作描述 + + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public Timestamp getOperateTime() + { + return operateTime; + } + + public void setOperateTime(Timestamp operateTime) + { + this.operateTime = operateTime; + } + + public String getOperateUrl() + { + return operateUrl; + } + + public void setOperateUrl(String operateUrl) + { + this.operateUrl = operateUrl; + } + + public String getOperateDesc() + { + return operateDesc; + } + + public void setOperateDesc(String operateDesc) + { + this.operateDesc = operateDesc; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOperatorRule.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOperatorRule.java new file mode 100644 index 0000000..4cda2e5 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOperatorRule.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 操作员独立权限表 对应表《ZMR_OPERATOR_RULE》 + */ +@AnAlias("ZmrOperatorRule") +@AnNew +@AnTable(table="ZMR_OPERATOR_RULE", key="OPERATOR_CODE,MENU_CODE", type="InnoDB") +public class ZmrOperatorRule implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="OPERATOR_CODE", type="string,32", notNull=true) private String operatorCode; //1.操作员编码 + @AnTableField(column="MENU_CODE", type="string,32", notNull=true) private String menuCode; //2.菜单编码 + + public String toString() + { + return Jsons.toString(this); + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public String getMenuCode() + { + return menuCode; + } + + public void setMenuCode(String menuCode) + { + this.menuCode = menuCode; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOrg.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOrg.java new file mode 100644 index 0000000..63ecb80 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOrg.java @@ -0,0 +1,129 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 系统组织表 对应表《ZMR_ORG》 + */ +@AnAlias("ZmrOrg") +@AnNew +@AnTable(table = "ZMR_ORG", key = "ORG_ID", type = "InnoDB") +public class ZmrOrg implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column = "ORG_ID", type = "long", notNull = true) + private long orgId; // 1.组织编号 + @AnTableField(column = "ORG_NAME", type = "string,32", notNull = true) + private String orgName; // 2.组织名称 + @AnTableField(column = "ORG_LEVEL", type = "int", notNull = true) + private int orgLevel; // 3.组织级别 + @AnTableField(column = "ORG_STATUS", type = "byte", notNull = true) + private int orgStatus; // 4.组织状态,0表示正常,1表示停用 + @AnTableField(column = "ORG_SEQ", type = "int", notNull = true) + private int orgSeq; // 5.组织排序数 + @AnTableField(column = "ORG_DESC", type = "string,100", notNull = false) + private String orgDesc; // 6.组织描述 + @AnTableField(column = "ORG_MANAGER", type = "string,32", notNull = false) + private String orgManager; // 7.组织负责人 + + @Override + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public int getOrgLevel() + { + return orgLevel; + } + + public void setOrgLevel(int orgLevel) + { + this.orgLevel = orgLevel; + } + + public int getOrgStatus() + { + return orgStatus; + } + + public void setOrgStatus(int orgStatus) + { + this.orgStatus = orgStatus; + } + + public int getOrgSeq() + { + return orgSeq; + } + + public void setOrgSeq(int orgSeq) + { + this.orgSeq = orgSeq; + } + + public String getOrgDesc() + { + return orgDesc; + } + + public void setOrgDesc(String orgDesc) + { + this.orgDesc = orgDesc; + } + + public String getOrgManager() + { + return orgManager; + } + + public void setOrgManager(String orgManager) + { + this.orgManager = orgManager; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOrgRule.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOrgRule.java new file mode 100644 index 0000000..ad481f4 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrOrgRule.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 系统组织权限表 对应表《ZMR_ORG_RULE》 + */ +@AnAlias("ZmrOrgRule") +@AnNew +@AnTable(table="ZMR_ORG_RULE", key="ORG_ID,MENU_CODE", type="InnoDB") +public class ZmrOrgRule implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ORG_ID", type="long", notNull=true) private long orgId; //1.组织编号 + @AnTableField(column="MENU_CODE", type="string,32", notNull=true) private String menuCode; //2.菜单编码 + + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getMenuCode() + { + return menuCode; + } + + public void setMenuCode(String menuCode) + { + this.menuCode = menuCode; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrParam.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrParam.java new file mode 100644 index 0000000..29fafd2 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrParam.java @@ -0,0 +1,120 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 系统参数表 对应表《ZMR_PARAM》 + */ +@AnAlias("ZmrParam") +@AnNew +@AnTable(table="ZMR_PARAM", key="PARAM_GROUP,PARAM_KEY", type="InnoDB") +public class ZmrParam implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="PARAM_GROUP", type="string,32", notNull=true) private String paramGroup; //1.参数组号 + @AnTableField(column="PARAM_KEY", type="string,32", notNull=true) private String paramKey; //2.参数键 + @AnTableField(column="PARAM_SEQ", type="int", notNull=true) private int paramSeq; //3.参数排序数 + @AnTableField(column="PARAM_VALUE", type="string,2000", notNull=false) private String paramValue; //4.参数值,允许为空 + @AnTableField(column="PARAM_TYPE", type="string,10", notNull=true) private String paramType; //5.参数类型,private表示私有不显示,protected表示显示,public表示公开可修改 + @AnTableField(column="PARAM_VALIDATE", type="string,200", notNull=false) private String paramValidate; //6.参数验证 + @AnTableField(column="PARAM_DESC", type="string,200", notNull=true) private String paramDesc; //7.参数描述 + + public String toString() + { + return Jsons.toString(this); + } + + public String getParamGroup() + { + return paramGroup; + } + + public void setParamGroup(String paramGroup) + { + this.paramGroup = paramGroup; + } + + public String getParamKey() + { + return paramKey; + } + + public void setParamKey(String paramKey) + { + this.paramKey = paramKey; + } + + public int getParamSeq() + { + return paramSeq; + } + + public void setParamSeq(int paramSeq) + { + this.paramSeq = paramSeq; + } + + public String getParamValue() + { + return paramValue; + } + + public void setParamValue(String paramValue) + { + this.paramValue = paramValue; + } + + public String getParamType() + { + return paramType; + } + + public void setParamType(String paramType) + { + this.paramType = paramType; + } + + public String getParamValidate() + { + return paramValidate; + } + + public void setParamValidate(String paramValidate) + { + this.paramValidate = paramValidate; + } + + public String getParamDesc() + { + return paramDesc; + } + + public void setParamDesc(String paramDesc) + { + this.paramDesc = paramDesc; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrParamOperator.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrParamOperator.java new file mode 100644 index 0000000..90d7367 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrParamOperator.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 系统操作员参数表 对应表《ZMR_PARAM_OPERATOR》 + */ +@AnAlias("ZmrParamOperator") +@AnNew +@AnTable(table="ZMR_PARAM_OPERATOR", key="PARAM_KEY", type="InnoDB") +public class ZmrParamOperator implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="PARAM_KEY", type="string,32", notNull=true) private String paramKey; //1.参数键 + @AnTableField(column="PARAM_DESC", type="string,200", notNull=true) private String paramDesc; //2.参数描述 + + public String toString() + { + return Jsons.toString(this); + } + + public String getParamKey() + { + return paramKey; + } + + public void setParamKey(String paramKey) + { + this.paramKey = paramKey; + } + + public String getParamDesc() + { + return paramDesc; + } + + public void setParamDesc(String paramDesc) + { + this.paramDesc = paramDesc; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrRole.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrRole.java new file mode 100644 index 0000000..7dbaea8 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrRole.java @@ -0,0 +1,98 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 角色表 对应表《ZMR_ROLE》 + */ +@AnAlias("ZmrRole") +@AnNew +@AnTable(table="ZMR_ROLE", key="ROLE_ID", type="InnoDB") +public class ZmrRole implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ORG_ID", type="long", notNull=true) private long orgId; //1.组织编号 + @AnTableField(column="ROLE_ID", type="long", notNull=true) private long roleId; //2.角色编号 + @AnTableField(column="ROLE_NAME", type="string,32", notNull=true) private String roleName; //3.角色名称 + @AnTableField(column="ROLE_STATUS", type="byte", notNull=true) private int roleStatus; //4.角色状态,0表示正常,1表示停用 + @AnTableField(column="ROLE_SEQ", type="int", notNull=true) private int roleSeq; //5.角色排序数 + + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public long getRoleId() + { + return roleId; + } + + public void setRoleId(long roleId) + { + this.roleId = roleId; + } + + public String getRoleName() + { + return roleName; + } + + public void setRoleName(String roleName) + { + this.roleName = roleName; + } + + public int getRoleStatus() + { + return roleStatus; + } + + public void setRoleStatus(int roleStatus) + { + this.roleStatus = roleStatus; + } + + public int getRoleSeq() + { + return roleSeq; + } + + public void setRoleSeq(int roleSeq) + { + this.roleSeq = roleSeq; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrRoleRule.java b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrRoleRule.java new file mode 100644 index 0000000..fb30761 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/dbo/ZmrRoleRule.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 角色权限表 对应表《ZMR_ROLE_RULE》 + */ +@AnAlias("ZmrRoleRule") +@AnNew +@AnTable(table="ZMR_ROLE_RULE", key="ROLE_ID,MENU_CODE", type="InnoDB") +public class ZmrRoleRule implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ROLE_ID", type="long", notNull=true) private long roleId; //1.角色编号 + @AnTableField(column="MENU_CODE", type="string,32", notNull=true) private String menuCode; //2.菜单编码 + + public String toString() + { + return Jsons.toString(this); + } + + public long getRoleId() + { + return roleId; + } + + public void setRoleId(long roleId) + { + this.roleId = roleId; + } + + public String getMenuCode() + { + return menuCode; + } + + public void setMenuCode(String menuCode) + { + this.menuCode = menuCode; + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/presenter/WorkWechatPresenter.java b/zhiqim_manager/src/org/zhiqim/manager/presenter/WorkWechatPresenter.java new file mode 100644 index 0000000..a3d00ad --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/presenter/WorkWechatPresenter.java @@ -0,0 +1,417 @@ +package org.zhiqim.manager.presenter; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.TreeMap; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Collectionx; +import org.zhiqim.kernel.util.Validates; + +import com.miaohui.service.constant.ParamOfTypeAndSceneEnum; +import com.miaohui.service.constant.WorkWechatResultCodeEnum; +import com.miaohui.service.request.WorkWechatConfigContactWayRequest; +import com.miaohui.service.request.WorkWechatGetAccessTokenRequest; +import com.miaohui.service.request.WorkWechatGetContactWayRequest; +import com.miaohui.service.request.WorkWechatGetUserIdByPhoneNumberRequest; + +/** + * 企业微信相关API调用
            + * + * @author HuangZhiGao + * @date 2020年9月14日 下午3:30:47 + */ +@AnAlias("WorkWechatPresenter") +public class WorkWechatPresenter +{ + + private static final Log log = LogFactory.getLog(WorkWechatPresenter.class); + + /** + * 请求企业微信API获取access_token
            + * + * @return String 返回access_token + * @author HuangZhiGao + * @date 2020年9月14日 下午9:27:11 + */ + public static String doGetWorkWechatAccessToken() + { + String accessToken = null; + WorkWechatGetAccessTokenRequest accessTokenRequest = new WorkWechatGetAccessTokenRequest(); + try + { + String result = accessTokenRequest.execute(); + MapSO resultMap = Jsons.toMapSO(result); + + Object errcodeObj = resultMap.get("errcode"); + if (Validates.isNotEmpty(errcodeObj)) + { + String errcode = errcodeObj.toString(); + if (WorkWechatResultCodeEnum.REQUEST_SUCCESSFUL.getCode().equals(errcode)) + { + Object accessTokenObj = resultMap.get("access_token"); + if (Validates.isNotEmpty(accessTokenObj)) + { + accessToken = accessTokenObj.toString(); + } + else + { + log.error("请求企业微信API获取access_token失败:[access_token为空],返回结果[" + resultMap + "]"); + } + } + else + { + log.error("请求企业微信API获取access_token失败:[" + WorkWechatResultCodeEnum.getNameByCode(errcode) + "],返回结果[" + resultMap + "]"); + } + } + else + { + log.error("请求企业微信API获取access_token错误:[结果码为空],返回结果[" + resultMap + "]"); + } + } + catch (Exception e) + { + log.error("请求企业微信API获取access_token异常:[" + e.getMessage() + "]\n" + e); + } + + return accessToken; + } + + /** + * 请求企业微信API 配置客户联系「联系我」方式
            + * + * @param accessToken 必填 调用接口凭证 + * @param type 必填 联系方式类型,1-单人, 2-多人 + * @param scene 必填 场景,1-在小程序中联系,2-通过二维码联系 + * @param user 使用该联系方式的用户userID列表,在type为1时为必填,且只能有一个 + * @param isTemp 非必填 是否临时会话模式,true表示使用临时会话模式,默认为false + * @return String 返回config_id 联系方式的配置id + * @author HuangZhiGao + * @date 2020年9月14日 下午9:39:42 + */ + public static String doConfigContactWay(String accessToken, String type, String scene, List user, Boolean isTemp) + { + String configId = null; + + /*校验参数*/ + Boolean validate = validateConfigContactWayParams(accessToken, type, scene, user); + if (!validate) + { + return configId; + } + + /*默认为临时会话*/ + if (Validates.isEmpty(isTemp)) + { + isTemp = Boolean.FALSE; + } + + WorkWechatConfigContactWayRequest configContactWayRequest = new WorkWechatConfigContactWayRequest(); + // 参数准备 + TreeMap urlParamsMap = new TreeMap(); + urlParamsMap.put("access_token", accessToken); + /*jsonParamsMap参数设置顺序请严格按照企业微信API示例的规范来,并且参数格式必须是官方要求格式(注意换行符和制表符以及空格的问题),此处是一个巨坑*/ + LinkedHashMap jsonParamsMap = new LinkedHashMap(); + jsonParamsMap.put("type", type); + jsonParamsMap.put("scene", scene); + jsonParamsMap.put("user", user); + jsonParamsMap.put("is_temp", isTemp.toString()); + + try + { + String result = configContactWayRequest.execute(urlParamsMap, jsonParamsMap); + MapSO resultMap = Jsons.toMapSO(result); + + Object errcodeObj = resultMap.get("errcode"); + if (Validates.isNotEmpty(errcodeObj)) + { + String errcode = errcodeObj.toString(); + if (WorkWechatResultCodeEnum.REQUEST_SUCCESSFUL.getCode().equals(errcode)) + { + Object configIdObj = resultMap.get("config_id"); + if (Validates.isNotEmpty(configIdObj)) + { + configId = configIdObj.toString(); + } + else + { + log.error("请求企业微信API 配置客户联系「联系我」方式失败:[config_id为空],返回结果[" + resultMap + "]"); + log.error("地址栏请求参数[" + urlParamsMap + "],请求体请求参数[" + jsonParamsMap + "]"); + } + } + else + { + log.error("请求企业微信API 配置客户联系「联系我」方式失败:[" + WorkWechatResultCodeEnum.getNameByCode(errcode) + "],返回结果[" + resultMap + "]"); + log.error("地址栏请求参数[" + urlParamsMap + "],请求体请求参数[" + jsonParamsMap + "]"); + } + } + else + { + log.error("请求企业微信API 配置客户联系「联系我」方式错误:[结果码为空],返回结果[" + resultMap + "]"); + log.error("地址栏请求参数[" + urlParamsMap + "],请求体请求参数[" + jsonParamsMap + "]"); + } + } + catch (Exception e) + { + log.error("请求企业微信API 配置客户联系「联系我」方式异常:[" + e.getMessage() + "]\n" + e); + log.error("地址栏请求参数[" + urlParamsMap + "],请求体请求参数[" + jsonParamsMap + "]"); + } + + return configId; + } + + /** + * 校验doConfigContactWay方法的入参
            + * + * @param accessToken 必填 调用接口凭证 + * @param type 必填 联系方式类型,1-单人, 2-多人 + * @param scene 必填 场景,1-在小程序中联系,2-通过二维码联系 + * @param user 使用该联系方式的用户userID列表,在type为1时为必填,且只能有一个 + * @return Boolean 返回布尔标记 + * @author HuangZhiGao + * @date 2020年9月14日 下午10:08:09 + */ + private static Boolean validateConfigContactWayParams(String accessToken, String type, String scene, List user) + { + Boolean flag = Boolean.TRUE; + + if (Validates.isEmpty(accessToken)) + { + log.error("调用接口凭证 accessToken 不能为空"); + flag = Boolean.FALSE; + return flag; + } + + if (Validates.isEmpty(type)) + { + log.error("联系方式类型 type 不能为空"); + flag = Boolean.FALSE; + return flag; + } + else + { + if (!ParamOfTypeAndSceneEnum.TYPE_SINGLE_PERSON.getCode().equals(type) && !ParamOfTypeAndSceneEnum.TYPE_MANY_PEOPLE.getCode().equals(type)) + { + log.error("联系方式类型 type 值只能是1或2"); + flag = Boolean.FALSE; + return flag; + } + } + + if (Validates.isEmpty(scene)) + { + log.error("场景 scene 不能为空"); + flag = Boolean.FALSE; + return flag; + } + else + { + if (!ParamOfTypeAndSceneEnum.SCENE_CONTACT_WITH_MINIPROGRAM.getCode().equals(scene) && !ParamOfTypeAndSceneEnum.SCENE_CONTACT_WITH_QRCODE.getCode().equals(scene)) + { + log.error("场景 scene 值只能是1或2"); + flag = Boolean.FALSE; + return flag; + } + } + + if (Collectionx.isEmpty(user)) + { + log.error("使用该联系方式的用户userID列表 user 不能为空"); + flag = Boolean.FALSE; + return flag; + } + else + { + if (user.size() > 1 && ParamOfTypeAndSceneEnum.TYPE_SINGLE_PERSON.getCode().equals(type)) + { + log.error("在type为1时 user 列表元素有且只能有一个"); + flag = Boolean.FALSE; + return flag; + } + } + + return flag; + } + + /** + * 请求企业微信API 获取企业已配置的「联系我」方式
            + * + * @param accessToken 必填 调用接口凭证 + * @param configId 必填 联系方式的配置id + * @return String 返回qr_code 二维码链接 + * @author HuangZhiGao + * @date 2020年9月14日 下午10:49:01 + */ + public static String getContactWay(String accessToken, String configId) + { + String qrcode = null; + + if (Validates.isEmpty(accessToken)) + { + log.error("调用接口凭证 accessToken 不能为空"); + return qrcode; + } + + if (Validates.isEmpty(configId)) + { + log.error("联系方式的配置id configId 不能为空"); + return qrcode; + } + + WorkWechatGetContactWayRequest getContactWayRequest = new WorkWechatGetContactWayRequest(); + TreeMap urlParamsMap = new TreeMap(); + urlParamsMap.put("access_token", accessToken); + LinkedHashMap jsonParamsMap = new LinkedHashMap(); + jsonParamsMap.put("config_id", configId); + + try + { + String result = getContactWayRequest.execute(urlParamsMap, jsonParamsMap); + MapSO resultMap = Jsons.toMapSO(result); + + Object errcodeObj = resultMap.get("errcode"); + if (Validates.isNotEmpty(errcodeObj)) + { + String errcode = errcodeObj.toString(); + if (WorkWechatResultCodeEnum.REQUEST_SUCCESSFUL.getCode().equals(errcode)) + { + Object contactWayObj = resultMap.get("contact_way"); + if (Validates.isEmpty(contactWayObj)) { + log.error("请求企业微信API 获取企业已配置的「联系我」方式失败:[contact_way为空],返回结果[" + resultMap + "]"); + } + else + { + HashMapSO contactWay = Jsons.toMapSO(contactWayObj.toString()); + Object qrcodeObj = contactWay.get("qr_code"); + + if (Validates.isNotEmpty(qrcodeObj)) + { + qrcode = qrcodeObj.toString(); + } + else + { + log.error("请求企业微信API 获取企业已配置的「联系我」方式失败:[qr_code为空],返回结果[" + resultMap + "]"); + log.error("地址栏请求参数[" + urlParamsMap + "],请求体请求参数[" + jsonParamsMap + "]"); + } + } + } + else + { + log.error("请求企业微信API 获取企业已配置的「联系我」方式失败:[" + WorkWechatResultCodeEnum.getNameByCode(errcode) + "],返回结果[" + resultMap + "]"); + log.error("地址栏请求参数[" + urlParamsMap + "],请求体请求参数[" + jsonParamsMap + "]"); + } + } + else + { + log.error("请求企业微信API 获取企业已配置的「联系我」方式错误:[结果码为空],返回结果[" + resultMap + "]"); + log.error("地址栏请求参数[" + urlParamsMap + "],请求体请求参数[" + jsonParamsMap + "]"); + } + } + catch (Exception e) + { + log.error("请求企业微信API 获取企业已配置的「联系我」方式异常:[" + e.getMessage() + "]\n" + e); + log.error("地址栏请求参数[" + urlParamsMap + "],请求体请求参数[" + jsonParamsMap + "]"); + } + + return qrcode; + } + + /** + * 请求企业微信API 根据企业微信成员手机号获取userid
            + * + * @param accessToken 必填 调用接口凭证 + * @param mobile 必填 企业成员手机号码 + * @return String 返回userId 企业成员userid + * @author HuangZhiGao + * @date 2021-01-08 10:11:52 + */ + public static String getUserIdByPhoneNumber(String accessToken, String mobile) + { + String userId = null; + + if (Validates.isEmpty(accessToken)) + { + log.error("调用接口凭证 accessToken 不能为空"); + return userId; + } + + if (Validates.isEmpty(mobile)) + { + log.error("企业成员手机号码 mobile 不能为空"); + return userId; + } + + WorkWechatGetUserIdByPhoneNumberRequest getUserIdByPhoneNumberRequest = new WorkWechatGetUserIdByPhoneNumberRequest(); + TreeMap urlParamsMap = new TreeMap<>(); + urlParamsMap.put("access_token", accessToken); + LinkedHashMap jsonParamsMap = new LinkedHashMap(); + jsonParamsMap.put("mobile", mobile); + + try + { + String result = getUserIdByPhoneNumberRequest.execute(urlParamsMap, jsonParamsMap); + MapSO resultMap = Jsons.toMapSO(result); + + Object errcodeObj = resultMap.get("errcode"); + if (Validates.isNotEmpty(errcodeObj)) + { + String errcode = errcodeObj.toString(); + if (WorkWechatResultCodeEnum.REQUEST_SUCCESSFUL.getCode().equals(errcode)) + { + Object userIdObj = resultMap.get("userid"); + if (Validates.isNotEmpty(userIdObj)) + { + userId = userIdObj.toString(); + } + else + { + log.error("请求企业微信API 根据企业微信成员手机号获取userid方式失败:[userid为空],返回结果[" + resultMap + "]"); + log.error("地址栏请求参数[" + urlParamsMap + "],请求体请求参数[" + jsonParamsMap + "]"); + } + } + else + { + log.error("请求企业微信API 根据企业微信成员手机号获取userid方式失败:[" + WorkWechatResultCodeEnum.getNameByCode(errcode) + "],返回结果[" + resultMap + "]"); + log.error("地址栏请求参数[" + urlParamsMap + "],请求体请求参数[" + jsonParamsMap + "]"); + } + } + else + { + log.error("请求企业微信API 根据企业微信成员手机号获取userid方式错误:[结果码为空],返回结果[" + resultMap + "]"); + log.error("地址栏请求参数[" + urlParamsMap + "],请求体请求参数[" + jsonParamsMap + "]"); + } + } + catch (Exception e) + { + log.error("请求企业微信API 根据企业微信成员手机号获取userid方式异常:[" + e.getMessage() + "]\n" + e); + log.error("地址栏请求参数[" + urlParamsMap + "],请求体请求参数[" + jsonParamsMap + "]"); + } + + return userId; + } + + + public static void main(String[] args) + { + // 测试代码 + String accessToken = doGetWorkWechatAccessToken(); + System.out.println(accessToken); + + List users = new ArrayList(); + users.add("caohong"); + String contactWay = doConfigContactWay(accessToken, ParamOfTypeAndSceneEnum.TYPE_SINGLE_PERSON.getCode(), ParamOfTypeAndSceneEnum.SCENE_CONTACT_WITH_QRCODE.getCode(), users, Boolean.TRUE); + System.out.println(contactWay); + + String qrcode = getContactWay(accessToken, contactWay); + System.out.println(qrcode); + + String userId = getUserIdByPhoneNumber(accessToken, "17346884115"); + System.out.println(userId); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrAvatarPresenter.java b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrAvatarPresenter.java new file mode 100644 index 0000000..d9195af --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrAvatarPresenter.java @@ -0,0 +1,150 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.presenter; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.constants.CodeConstants; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Images; +import org.zhiqim.kernel.util.codes.Base64; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.dbo.ZmrAvatar; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * 管理台头像控制器 + * + * @version v1.0.0 @author zouzhigang 2017-6-6 新建与整理 + */ +@AnAlias("ZmrAvatarPresenter") +@AnIntercept("chkZmrLogin") +public class ZmrAvatarPresenter implements ZmrConstants, CodeConstants +{ + /** + * 插入头像,从页面拿到base64的字符串,转为byte[]存入数据库 + * + * @param request 请求 + * @param data 图片BASE64字符串 + * @throws Exception 异常 + */ + public static void doInsert(HttpRequest request, String data) throws Exception + { + int idx = data.indexOf(","); + byte[] imageData = Base64.decode(data.substring(idx+1)); + + ZmrAvatar avatar = new ZmrAvatar(); + avatar.setAvatarId(Ids.longId19()); + avatar.setAvatarType(0); + + byte[] bytes50 = Images.resizePNG(imageData, 50, 50); + if(bytes50 == null) + { + request.setResponseError("图片错误"); + return; + } + + byte[] bytes100 = Images.resizePNG(imageData, 100, 100); + if(bytes100 == null) + { + request.setResponseError("图片错误"); + return; + } + + byte[] bytes150 = Images.resizePNG(imageData, 150, 150); + if(bytes150 == null) + { + request.setResponseError("图片错误"); + return; + } + + avatar.setAvatarTime(System.currentTimeMillis()); + avatar.setAvatar50(bytes50); + avatar.setAvatar100(bytes100); + avatar.setAvatar150(bytes150); + + ZmrBootstrap.table(request).insert(avatar); + } + + /** + * 更新头像,从页面拿到base64的字符串,转为byte[]更新到数据库 + * + * @param request 请求 + * @param avatarId 头像编号 + * @param data 图片BASE64字符串 + * @throws Exception 异常 + */ + public static void doUpdate(HttpRequest request, long avatarId, String data) throws Exception + { + int idx = data.indexOf(","); + byte[] imageData = Base64.decode(data.substring(idx+1)); + + byte[] bytes50 = Images.resizePNG(imageData, 50, 50); + if(bytes50 == null) + { + request.setResponseError("图片错误"); + return; + } + + byte[] bytes100 = Images.resizePNG(imageData, 100, 100); + if(bytes100 == null) + { + request.setResponseError("图片错误"); + return; + } + + byte[] bytes150 = Images.resizePNG(imageData, 150, 150); + if(bytes150 == null) + { + request.setResponseError("图片错误"); + return; + } + + Updater updater = new Updater(); + updater.addMust("avatarId", avatarId); + updater.addField("avatarTime", System.currentTimeMillis()); + updater.addField("avatar50", bytes50); + updater.addField("avatar100", bytes100); + updater.addField("avatar150", bytes150); + + ZmrBootstrap.table(request).update(ZmrAvatar.class, updater); + } + + /** + * 删除头像 + * + * @param request 请求 + * @param avatarId 头像编号 + * @throws Exception 异常 + */ + public static void doDelete(HttpRequest request, long avatarId) throws Exception + { + if(ZmrBootstrap.tableOpr(request).count(ZmrOperator.class, new Selector("operatorAvatar", avatarId)) > 0) + { + request.setResponseError("该头像正在被操作员使用,不允许删除"); + return; + } + + //删除系统头像 + ZmrBootstrap.table(request).delete(ZmrAvatar.class, avatarId); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrDeptPresenter.java b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrDeptPresenter.java new file mode 100644 index 0000000..5809b32 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrDeptPresenter.java @@ -0,0 +1,182 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.presenter; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.tree.Tree; +import org.zhiqim.kernel.tree.TreeBuilder; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrDeptRule; +import org.zhiqim.manager.dbo.ZmrMenu; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * 操作员部门控制器 + * + * @version v1.0.0 @author zouzhigang 2017-6-6 新建与整理 + */ +@AnAlias("ZmrDeptPresenter") +@AnIntercept("chkZmrLogin") +public class ZmrDeptPresenter implements ZmrConstants +{ + /** 显示部门成员列表 */ + public static void doShowDeptOperatorList(HttpRequest request) throws Exception + { + long deptId = request.getParameterLong("deptId"); + if (deptId == -1) + { + request.setResponseError("您选择的部门不存在,请选择一个有效的部门"); + return; + } + + ZmrDept dept = ZmrBootstrap.table(request).item(ZmrDept.class, deptId); + if (dept == null) + { + request.setResponseError("您选择的部门不存在,请选择一个有效的部门"); + return; + } + + Selector selector = new Selector(); + selector.addMustLike("operatorDept", deptId); + List operatorList = ZmrBootstrap.tableOpr(request).list(ZmrOperator.class, selector); + + MapSO variable = new HashMapSO(); + variable.put("dept", dept); + variable.put("operatorList", operatorList); + + String responseText = ZmlContexts.parseZmlPath(request, "/zview/zhiqim_manager/presenter/deptOperatorInfo.zml", variable); + request.setResponseResult(responseText); + + //设置为当前选中 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + sessionUser.setValue(ZMR_SESSION_USER_DEPT_ID, deptId); + } + + /** 显示部门权限列表 */ + public static void doShowDeptRuleList(HttpRequest request) throws Exception + { + long deptId = request.getParameterLong("deptId"); + if (deptId == -1) + { + request.setResponseError("您选择的部门不存在,请选择一个有效的部门"); + return; + } + + ZmrDept dept = ZmrBootstrap.table(request).item(ZmrDept.class, deptId); + if (dept == null) + { + request.setResponseError("您选择的部门不存在,请选择一个有效的部门"); + return; + } + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + + // 获取部门权限 + List ruleList = ZmrBootstrap.table(request).list(ZmrDeptRule.class, new Selector("deptId", deptId)); + + //获取能管理的权限(组织权限) + List list = ZmrOrgDao.getMenuList(request, dept.getOrgId()); + Tree tree = TreeBuilder.newTree(list, "parentCode", "menuCode"); + + MapSO variable = new HashMapSO(); + variable.put("dept", dept); + variable.put("tree", tree); + variable.put("menuSize", list.size()); + variable.put("ruleList", ruleList); + + String responseText = ZmlContexts.parseZmlPath(request, "/zview/zhiqim_manager/presenter/deptRuleInfo.zml", variable); + request.setResponseResult(responseText); + + //设置为当前选中 + sessionUser.setValue(ZMR_SESSION_USER_DEPT_ID, deptId); + } + + /** 增加多个部门成员 */ + public static void doAddDeptOperator(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("deptId", "请选择一个部门")); + request.addValidate(new IsNotEmpty("operatorCodes", "请选择操作员")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + //判断部门是否存在 + long deptId = request.getParameterLong("deptId"); + ZmrDept dept = ZmrBootstrap.table(request).item(ZmrDept.class, deptId); + if (dept == null) + { + request.returnHistory("您选择的部门不存在,请选择一个有效的部门"); + return; + } + + String[] operatorCodeArr = Arrays.toStringArray(request.getParameter("operatorCodes")); + for (String operatorCode : operatorCodeArr) + { + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + continue; + + //操作员部门 + String operatorDept = operator.getOperatorDept(); + if (Validates.isEmpty(operatorDept)) + operatorDept = "" + deptId; + else + operatorDept += "," + deptId; + + //操作员所有部门 + String operatorDeptAll = operator.getOperatorDeptAll(); + if (Validates.isEmpty(operatorDeptAll)) + operatorDeptAll = dept.getDeptParentAll(); + else + operatorDeptAll += "," + dept.getDeptParentAll(); + operatorDeptAll += "," + operatorDept; + + //去重 + operatorDeptAll = Arrays.toFilterSameStr(Arrays.toStringArray(operatorDeptAll)); + + Updater updater = new Updater(); + updater.addField("operatorDept", operatorDept); + updater.addField("operatorDeptAll", operatorDeptAll); + updater.addMust("operatorCode", operatorCode); + + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + + //设置为当前选中 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + sessionUser.setValue(ZMR_SESSION_USER_DEPT_ID, deptId); + } + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrLoginPresenter.java b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrLoginPresenter.java new file mode 100644 index 0000000..b6e6d96 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrLoginPresenter.java @@ -0,0 +1,561 @@ +package org.zhiqim.manager.presenter; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.regex.Pattern; + +import org.zhiqim.httpd.HttpContext; +import org.zhiqim.httpd.HttpCookie; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.HttpResponse; +import org.zhiqim.httpd.context.ZmlBootstrap; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.core.Context; +import org.zhiqim.httpd.util.Sessions; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.ones.IsNumericLen; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Randoms; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.Base64; +import org.zhiqim.kernel.util.codes.RSA; +import org.zhiqim.manager.SmsUtils; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrBootstrapApi; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrPassworder; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dao.ZmrParamDao; +import org.zhiqim.manager.dbo.ZmrAvatar; +import org.zhiqim.manager.dbo.ZmrMenu; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * ½ + * + * @version v1.0.0 @author liuhu 2018-8-2 ½ + * @version v2.0.0 @author caohong 2021-5-22 עᣬ빦 + */ +@AnAlias("ZmrLoginPresenter") +public class ZmrLoginPresenter implements ZmrConstants +{ + private static final Log log = LogFactory.getLog(ZmrLoginPresenter.class); + + public static void doLogin(HttpRequest request) throws Exception + { + HttpContext context = request.getContext(); + + // 1.жϴ + request.addValidate(new IsNotEmpty("operatorCode", "ûΪ")); + request.addValidate(new IsNotEmpty("operatorPass", "벻Ϊ")); + + String hasVerificationSms = request.getSessionAttribute("hasVerificationSms") == null ? null + : String.valueOf(request.getSessionAttribute("hasVerificationSms")); + if ("true".equals(hasVerificationSms)) + { + request.addValidate(new IsNumericLen("smsCode", "֤6λ", 6, 6)); + } + if (ZmrParamDao.hasVerificationCode(context)) + { + request.addValidate(new IsNumericLen("verificationCode", "֤4λ", 4, 4)); + } + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + // 2.֤ + if ("true".equals(hasVerificationSms)) + { + String smsCode = request.getParameter("smsCode"); + if (smsCode.length() != 6) + { + request.setResponseError("֤6λ"); + return; + } + String sessionSmsCodeSession = request.getSessionAttributeString("_smscode_"); + if (!smsCode.equals(sessionSmsCodeSession)) + { + request.setResponseError("֤벻ȷʧЧ룡"); + return; + } + } + + // 2.֤ + if (ZmrParamDao.hasVerificationCode(context)) + { + String verificationCode = request.getParameter("verificationCode"); + if (verificationCode.length() != 4) + { + request.setResponseError("֤4λ"); + return; + } + String vcode = Sessions.getSessionVerificationCode(request); + if (!verificationCode.equals(vcode)) + { + request.setResponseError("֤벻ȷʧЧ룡"); + return; + } + } + + // 3.֤ԱǷڡǷͣ + String operatorCode = request.getParameter("operatorCode"); + Selector selector = new Selector(); + if (Validates.isNumericLen(operatorCode, 11, 11)) + { + selector.addMust("operatorMobile", operatorCode); + } + else + { + selector.addMust("operatorCode", operatorCode); + } + + String role = request.getParameter("role");// ¼ɫƽ̨ + if (Validates.isNotEmptyBlank(role)) + { + if ("oms".equals(role)) + { + // Ӫ̨ɫ + selector.addMust("orgId", 1805031820320001L); + } + else + { + // ʦɫܲ֯ + selector.addMustNotEqual("orgId", 1805031820320001L); + } + } + + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, selector); + if (operator == null) + { + request.setResponseError("ûȷ"); + return; + } + + if (operator.getOperatorStatus() == 1) + { + request.setResponseError("ûͣãϵԱ"); + return; + } + + // 4.֤ + String operatorPass = request.getParameter("operatorPass"); + + byte[] operatorPassByte = Base64.decode(operatorPass); + String privateKey = ZmrParamDao.getPrivateKey(context); + byte[] operatorPassDecrypt = RSA.decrypt(operatorPassByte, privateKey); + operatorPass = new String(operatorPassDecrypt, _UTF_8_C_); + + if (isValidateRememberPass(operatorPass)) + {// ȫǡʾסҪ֤Կ + if (!ZmrParamDao.hasRememberCode(context) || !ZmrParamDao.hasRememberPass(context) || !operatorCode.equals(request.getCookie("operatorCode"))) + { + request.setResponseError("û벻ȷ"); + return; + } + + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + String operatorPassSecr = request.getCookie("operatorPass"); + if (!passworder.secretChk(operatorCode, operatorPass, operator.getOperatorPassSalt(), operatorPassSecr)) + { + request.setResponseError("û벻ȷ"); + return; + } + } + else + {// ֤ + if (!ZmrOperatorDao.validatePassword(request, operator, operatorPass)) + { + request.setResponseError("û벻ȷ"); + return; + } + } + + List menuList = ZmrOperatorDao.getOperatorMenuList(request, operator); + if (menuList.isEmpty()) + { + request.setResponseError("ûκβȨޣԱϵ"); + return; + } + + // 5.֤װỰû + ZmrSessionUser sessionUser = new ZmrSessionUser().setOperator(operator).setMenuList(context, menuList); + sessionUser.setSelectedOrgId(operator.getOrgId()); + + request.bindSessionUser(sessionUser); + + // 6.жҪϢCOOKIE + if (ZmrParamDao.hasRememberCode(context)) + { + boolean rememberCode = request.getParameterBoolean("rememberCode"); + boolean rememberPass = request.getParameterBoolean("rememberPass"); + int day30 = 60 * 60 * 24 * 30; + + HttpResponse response = request.getResponse(); + if (rememberPass) + {// ѡ˼ס룬һס¼ + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + String operatorSecr = passworder.secret(operatorCode, operatorPass, operator.getOperatorPassSalt()); + response.addCookie(new HttpCookie("operatorCode", operatorCode, day30)); + response.addCookie(new HttpCookie("operatorPass", operatorSecr, day30)); + } + else if (rememberCode) + {// ֻסû + response.addCookie(new HttpCookie("operatorCode", operatorCode, day30)); + response.addCookie(new HttpCookie("operatorPass", "", day30)); + } + else + {// ֵΪ + response.addCookie(new HttpCookie("operatorCode", "", day30)); + response.addCookie(new HttpCookie("operatorPass", "", day30)); + } + } + + // 7.жǷдҳתַ + String mainUrl = request.getRootPath(ZmlContexts.parseZmlContent(request, ZmrParamDao.getMainUrl(context))); + if (!ZmrParamDao.isThemeFrame(context)) + { + request.setResponseResult(mainUrl); + } + else + { + String defaultUrl = request.getRootPath(ZmlContexts.parseZmlContent(request, ZMR_MAIN_URL_DEFAULT)); + String welcomeUrl = request.getRootPath(ZmlContexts.parseZmlContent(request, ZMR_MAIN_URL_WELCOME)); + sessionUser.setWelcomeUrl(welcomeUrl); + sessionUser.setMainUrl(defaultUrl.equals(mainUrl) ? welcomeUrl : mainUrl); + request.setResponseResult(defaultUrl); + } + + if ("true".equals(hasVerificationSms)) + { + request.getSessionAttributeString("_smscode_", null); + Map map = new HashMap(); + map.put("˺", operatorCode); + map.put("ֻ", operator.getOperatorMobile()); + } + // 8.ص¼ + ZmlBootstrap bootstrap = ((Context) context).getBootstrap(); + if (bootstrap instanceof ZmrBootstrapApi) + { + ((ZmrBootstrapApi) bootstrap).logined(request); + } + } + + /** + * [Ҫ]:¼֤
            + * + * @author caohong + * @param request + * @throws Exception + */ + public static void sendSms(HttpRequest request) throws Exception + { + // 1.жϴ + request.addValidate(new IsNotEmpty("operatorCode", "ûΪ")); + // 3.֤ԱǷڡǷͣãǷͣ + String operatorCode = request.getParameter("operatorCode"); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + request.setResponseError("ûȷ"); + return; + } + + if (operator.getOperatorStatus() == 1) + { + request.setResponseError("ûͣãϵԱ"); + return; + } + + String mobile = operator.getOperatorMobile(); + if (Validates.isEmpty(mobile)) + { + request.setResponseError("ûδֻ룬ϵԱ"); + return; + } + + // Ͷ + SmsUtils.sendSmsCode(request, mobile, "SMS_463645918"); + } + + /** + * [Ҫ]:
            + * + * @author caohong + * @param request + * @throws Exception + */ + public static void sendSmsRestPass(HttpRequest request) throws Exception + { + // 1.жϴ + request.addValidate(new IsNotEmpty("operatorMobile", "ֻŲΪ")); + + // 2.֤ԱǷڡǷͣãǷͣ + String operatorMobile = request.getParameter("operatorMobile"); + Selector selector = new Selector(); + selector.addMust("operatorMobile", operatorMobile); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, selector); + if (operator == null) + { + request.setResponseError("ֻδע"); + return; + } + + if (operator.getOperatorStatus() == 1) + { + request.setResponseError("ûͣãϵԱ"); + return; + } + + // Ͷ֤ + SmsUtils.sendSmsCode(request, operatorMobile, "SMS_463645918"); + } + + /** + * [Ҫ]:ע֤ᷢ
            + * + * @author caohong + * @param request + * @throws Exception + */ + public static void sendSmsReg(HttpRequest request) throws Exception + { + // 1.жϴ + request.addValidate(new IsNotEmpty("operatorMobile", "ֻŲΪ")); + request.addValidate(new IsNotEmpty("operatorCode", "ûdzƲΪ")); + + // 2.֤ԱǷ + String operatorMobile = request.getParameter("operatorMobile"); + String operatorCode = request.getParameter("operatorCode"); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator != null) + { + request.setResponseError("ûdzѴ"); + return; + } + + Selector selector = new Selector(); + selector.addMust("operatorMobile", operatorMobile); + ZmrOperator operatorNew = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, selector); + if (operatorNew != null) + { + request.setResponseError("ֻע"); + return; + } + + // Ͷ + SmsUtils.sendSmsCode(request, operatorMobile, "SMS_463645918"); + } + + private static boolean isValidateRememberPass(String operatorPass) + { + for (int i = 0; i < operatorPass.length(); i++) + { + if (operatorPass.charAt(i) != '') + { + return false; + } + } + return true; + } + + /** + * [Ҫ]:
            + * + * @author caohong + * @param request + * @throws Exception + */ + public static void resetPassword(HttpRequest request) throws Exception + { + // 1.жϴ + request.addValidate(new IsNotEmpty("operatorMobile", "ûΪ")); + request.addValidate(new IsNotEmpty("operatorPass", "벻Ϊ")); + request.addValidate(new IsNotEmpty("smsCode", "֤벻Ϊ")); + request.addValidate(new IsNumericLen("smsCode", "֤6λ", 6, 6)); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + try + { + String operatorMobile = request.getParameter("operatorMobile"); + String operatorPass = request.getParameter("operatorPass"); + String operatorNewPass = request.getParameter("operatorNewPass"); + String smsCode = request.getParameter("smsCode"); + + boolean isMatch = Pattern.matches(ZmrConstants.ZMR_MOBILE, operatorMobile); + if (!isMatch) + { + request.setResponseError("ֻŲϷ"); + return; + } + + if (!operatorPass.equals(operatorNewPass)) + { + request.setResponseError("ȷ벻һ"); + return; + } + + String sessionSmsCodeSession = request.getSessionAttributeString("_smscode_"); + if (!smsCode.equals(sessionSmsCodeSession)) + { + request.setResponseError("֤벻ȷʧЧ룡"); + return; + } + + if (!Validates.isUserPass(operatorPass)) + { + request.setResponseError("벻Ҫ󣺱Сдĸַֺѡ"); + return; + } + + Selector selector = new Selector(); + selector.addMust("operatorMobile", operatorMobile); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, selector); + if (operator == null) + { + request.setResponseError("ֻδע"); + return; + } + + // + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + String operatorPassSalt = Randoms.lettersDigitsSecure(64); + operatorPass = passworder.encode(operator.getOperatorCode(), operatorPass, operatorPassSalt); + + Updater updater = new Updater(); + updater.addMust("operatorMobile", operatorMobile); + updater.addField("operatorPass", operatorPass); + updater.addField("operatorPassSalt", operatorPassSalt); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + request.setResponseResult("óɹ"); + } + catch (Exception e) + { + log.error("Ա쳣" + e.getMessage(), e); + request.setResponseError("쳣" + e.getMessage()); + return; + } + } + + /** + * ʦע,Զʱ֯ͿԽɫ + * + * @author caohong + * @param request + * @throws Exception + */ + @AnTransaction + public static void insertReg(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("operatorMobile", "ֻŲΪ")); + request.addValidate(new IsNotEmpty("operatorCode", "ûdzƲΪ")); + request.addValidate(new IsNotEmpty("operatorPass", "벻Ϊ")); + request.addValidate(new IsNotEmpty("smsCode", "֤벻Ϊ")); + request.addValidate(new IsNumericLen("smsCode", "֤6λ", 6, 6)); + + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + try + { + String operatorCode = request.getParameter("operatorCode"); + String operatorPass = request.getParameter("operatorPass"); + String operatorNewPass = request.getParameter("operatorNewPass"); + String operatorMobile = request.getParameter("operatorMobile"); + String smsCode = request.getParameter("smsCode"); + + if (operatorCode.length() < 2 || operatorCode.length() > 8) + { + request.setResponseError("ûdzƳȲϷϵͳ֧2-8λĸֻ"); + return; + } + + boolean isMatch = Pattern.matches(ZmrConstants.ZMR_MOBILE, operatorMobile); + if (!isMatch) + { + request.setResponseError("ȷֻ"); + return; + } + + if (!operatorPass.equals(operatorNewPass)) + { + request.setResponseError("ȷ벻һ"); + return; + } + + if (ZmrBootstrap.tableOpr(request).count(ZmrOperator.class, operatorCode) > 0) + { + request.setResponseError("ûdzѾڣ"); + return; + } + + String sessionSmsCodeSession = request.getSessionAttributeString("_smscode_"); + if (!smsCode.equals(sessionSmsCodeSession)) + { + request.setResponseError("֤벻ȷʧЧ룡"); + return; + } + + if (!Validates.isUserPass(operatorPass)) + { + request.setResponseError("벻Ҫ󣺱Сдĸַֺѡ"); + return; + } + + long operatorAvatar = 0; + PageResult result = ZmrBootstrap.table(request).page(ZmrAvatar.class, 1, 10, new Selector("avatarId", "avatarType", 0)); + if (result.size() > 0) + {// ȡһϵͳͷ + int ind = new Random().nextInt(result.size()); + operatorAvatar = result.list().get(ind).getAvatarId(); + } + + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + String operatorPassSalt = Randoms.lettersDigitsSecure(64); + operatorPass = passworder.encode(operatorCode, operatorPass, operatorPassSalt); + + // עû + ZmrOperator operator = new ZmrOperator(); + operator.setOrgId(1808071102554512L);// Ĭһʱ֯ + operator.setOperatorRole("2112411071001");// ʼȨ + operator.setOperatorCode(operatorCode); + operator.setOperatorPass(operatorPass); + operator.setOperatorPassSalt(operatorPassSalt); + operator.setOperatorStatus(0); + operator.setOperatorType(2);// ĬϲԱ + operator.setOperatorName(operatorCode); + operator.setOperatorAvatar(operatorAvatar); + operator.setOperatorMobile(operatorMobile); + operator.setOperatorCreated(DateTimes.getDateTimeString()); + operator.setOperatorModified(DateTimes.getDateTimeString()); + operator.setOperatorParam("reg");// ⲿע,ҵ߼ж + ZmrBootstrap.table(request).insert(operator); + + request.setResponseResult("עɹ"); + } + catch (Exception e) + { + log.error("ûע쳣" + e.getMessage(), e); + request.setResponseError("ûע쳣" + e.getMessage()); + return; + } + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrOperatorPresenter.java b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrOperatorPresenter.java new file mode 100644 index 0000000..db96cd9 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrOperatorPresenter.java @@ -0,0 +1,463 @@ +package org.zhiqim.manager.presenter; + +import java.util.List; +import java.util.Random; +import java.util.regex.Pattern; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.onex.IsUserCode; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnTransaction; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Randoms; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrPassworder; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrAvatar; +import org.zhiqim.manager.dbo.ZmrDept; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrRole; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * 操作员控制器 + * + * @version v1.0.0 @author zouzhigang 2017-6-6 新建与整理 + * @version v2.0.0 @author caohong 2021-5-22 增加企业微信绑定 + */ +@AnAlias("ZmrOperatorPresenter") +@AnIntercept("chkZmrLogin") +public class ZmrOperatorPresenter +{ + private static final Log log = LogFactory.getLog(ZmrOperatorPresenter.class); + + protected static void validateForm(HttpRequest request) + { + request.addValidate(new IsUserCode("operatorCode", "操作员编码由2-16位字母数字汉字开头,字母汉字数字特殊符号组成")); + request.addValidate(new IsNotEmpty("operatorName", "操作员名称不能为空")); + request.addValidate(new IsNotEmpty("operatorStatus", "操作员状态不能为空")); + request.addValidate(new IsNotEmpty("operatorMobile", "操作员手机号不能为空")); + } + + /** + * 验证操作员密码 + * + * @param request 请求 + * @param operatorPass 密码 + */ + public static void doValidatePassword(HttpRequest request, String operatorPass) + { + if (Validates.isEmptyBlank(operatorPass)) + { + request.setResponseError("密码不允许为空白"); + return; + } + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (!ZmrOperatorDao.validatePassword(request, sessionUser.getOperator(), operatorPass)) + { + request.setResponseError("密码不正确"); + } + } + + /** + * 增加操作员多个部门,参数统一在request中 + * + * @param request 请求 + * @throws Exception 异常 + */ + public static void doAddOperatorDepts(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("operatorCode", "请选择操作员")); + request.addValidate(new IsNotEmpty("deptIds", "请选择一个部门")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + // 判断操作员是否存在 + String operatorCode = request.getParameter("operatorCode"); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + request.returnHistory("您选择的操作员不存在,请选择一个有效的操作员"); + return; + } + + // 判断部门是否存在 + long[] deptIdArr = Arrays.toLongArray(request.getParameter("deptIds")); + for (long deptId : deptIdArr) + { + ZmrDept dept = ZmrBootstrap.table(request).item(ZmrDept.class, deptId); + if (operator == null) + { + continue; + } + + // 操作员部门 + if (Validates.isEmpty(operator.getOperatorDept())) + { + operator.setOperatorDept("" + deptId); + } + else + { + operator.setOperatorDept(operator.getOperatorDept() + "," + deptId); + } + + // 操作员所有部门 + String operatorDeptAll = operator.getOperatorDeptAll(); + if (Validates.isEmpty(operatorDeptAll)) + { + operatorDeptAll = dept.getDeptParentAll(); + } + else + { + operatorDeptAll += "," + dept.getDeptParentAll(); + } + operatorDeptAll += "," + operator.getOperatorDept(); + operator.setOperatorDeptAll(operatorDeptAll); + } + + Updater updater = new Updater(); + updater.addField("operatorDept", operator.getOperatorDept()); + updater.addField("operatorDeptAll", Arrays.toFilterSameStr(operator.getOperatorDeptAll())); + updater.addMust("operatorCode", operatorCode); + + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + } + + /** + * 删除操作员部门,参数统一在request中 + * + * @param request 请求 + * @throws Exception 异常 + */ + public static void doDeleteOperatorDept(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("operatorCode", "请选择一个操作员")); + request.addValidate(new IsNotEmpty("deptId", "请选择一个部门")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + String operatorCode = request.getParameter("operatorCode"); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + request.setResponseError("请选择一个有效的操作员"); + return; + } + + // 删除对应的部门 + long deptId = request.getParameterLong("deptId"); + String operatorDept = operator.getOperatorDept(); + List operatorDeptList = Lists.toLongList(operatorDept); + operatorDeptList.remove(deptId); + + operatorDept = Lists.toString(operatorDeptList); + + // 重置所有部门 + String operatorDeptAll = null; + for (long oprDeptId : operatorDeptList) + { + ZmrDept dept = ZmrBootstrap.table(request).item(ZmrDept.class, oprDeptId); + if (dept == null) + { + continue; + } + + if (operatorDeptAll == null) + { + operatorDeptAll = dept.getDeptParentAll(); + } + else + { + operatorDeptAll += "," + dept.getDeptParentAll(); + } + + operatorDeptAll += "," + oprDeptId; + } + operatorDeptAll = Arrays.toFilterSameStr(operatorDeptAll); + + Updater updater = new Updater(); + updater.addField("operatorDept", operatorDept); + updater.addField("operatorDeptAll", operatorDeptAll); + updater.addMust("operatorCode", operatorCode); + + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + } + + /** + * 增加操作员多个角色,参数统一在request中 + * + * @param request 请求 + * @throws Exception 异常 + */ + public static void doAddOperatorRoles(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("operatorCode", "请选择操作员")); + request.addValidate(new IsNotEmpty("roleIds", "请选择一个角色")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + // 判断操作员是否存在 + String operatorCode = request.getParameter("operatorCode"); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + request.returnHistory("您选择的操作员不存在,请选择一个有效的操作员"); + return; + } + + // 判断角色是否存在 + String[] roleIdArr = Arrays.toStringArray(request.getParameter("roleIds")); + for (String roleId : roleIdArr) + { + if (Validates.isEmpty(operator.getOperatorRole())) + { + operator.setOperatorRole(roleId); + } + else if (!operator.getOperatorRole().contains(roleId)) + { + operator.setOperatorRole(operator.getOperatorRole() + "," + roleId); + } + } + + Updater updater = new Updater(); + updater.addField("operatorRole", operator.getOperatorRole()); + updater.addMust("operatorCode", operatorCode); + + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + } + + /** + * 删除操作员角色,参数统一在request中 + * + * @param request 请求 + * @throws Exception 异常 + */ + public static void doDeleteOperatorRole(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("operatorCode", "请选择一个操作员")); + request.addValidate(new IsNotEmpty("roleId", "请选择一个角色")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + String operatorCode = request.getParameter("operatorCode"); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + request.setResponseError("请选择一个有效的操作员"); + return; + } + + // 删除对应的角色 + long roleId = request.getParameterLong("roleId"); + String operatorRole = operator.getOperatorRole(); + List operatorRoleList = Lists.toLongList(operatorRole); + operatorRoleList.remove(roleId); + + operatorRole = Lists.toString(operatorRoleList); + + Updater updater = new Updater(); + updater.addField("operatorRole", operatorRole); + updater.addMust("operatorCode", operatorCode); + + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + } + + /** 增加角色多个操作员 */ + public static void doAddRoleOperator(HttpRequest request) throws Exception + { + request.addValidate(new IsNotEmpty("roleId", "请选择一个角色")); + request.addValidate(new IsNotEmpty("operatorCodes", "请选择操作员")); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + // 判断角色是否存在 + long roleId = request.getParameterLong("roleId"); + ZmrRole role = ZmrBootstrap.table(request).item(ZmrRole.class, roleId); + if (role == null) + { + request.returnHistory("您选择的角色不存在,请选择一个有效的角色"); + return; + } + + String[] operatorCodeArr = Arrays.toStringArray(request.getParameter("operatorCodes")); + for (String operatorCode : operatorCodeArr) + { + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + continue; + } + + // 操作员角色 + String operatorRole = operator.getOperatorRole(); + if (Validates.isEmpty(operatorRole)) + { + operatorRole = "" + roleId; + } + else + { + operatorRole += "," + roleId; + } + + Updater updater = new Updater(); + updater.addField("operatorRole", operatorRole); + updater.addMust("operatorCode", operatorCode); + + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + } + } + + /** 剔除在线用户 */ + public static void RemoveOnlineOperator(HttpRequest request, String sessionId) throws Exception + { + request.getContext().getSessionManager().invalidateSession(sessionId); + } + + /** + * 设置操作员组织编号 + * + * @param request 请求对象 + * @param orgId 组织编号 + * @throws Exception 异常 + */ + public static void setOrgId(HttpRequest request, long orgId) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + sessionUser.setValue("orgId", orgId); + } + + /** + * 保存操作员,自动管理企业微信 + * + * @param request + * @throws Exception + */ + @AnTransaction + public static void insert(HttpRequest request) throws Exception + { + try + { + validateForm(request); + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + String dateTime = DateTimes.getDateTimeString(); + long orgId = request.getSessionUser(ZmrSessionUser.class).getSelectedOrgId(); + String operatorCode = request.getParameter("operatorCode"); + String operatorPass = request.getParameter("operatorPass"); + int operatorStatus = request.getParameterInt("operatorStatus"); + int operatorType = request.getParameterInt("operatorType", 2);// 默认为操作员 + String operatorName = request.getParameter("operatorName"); + String operatorIp = request.getParameter("operatorIp"); + String operatorMobile = request.getParameter("operatorMobile"); + String operatorWangwang = request.getParameter("operatorWangwang", ""); + String operatorWxcode = request.getParameter("operatorWxcode"); + + if (Validates.isNotEmpty(operatorMobile)) + { + boolean isMatch = Pattern.matches(ZmrConstants.ZMR_MOBILE, operatorMobile); + if (!isMatch) + { + request.setResponseError("请输入正确的手机号"); + return; + } + } + + if (ZmrBootstrap.tableOpr(request).count(ZmrOperator.class, operatorCode) > 0) + { + request.setResponseError("该操作员编码已经存在,请重新输入"); + return; + } + + if (!Validates.isUserPass(operatorPass)) + { + request.setResponseError("请输入6-16位操作员密码(大小写字母数字和特殊字符必须四选三)"); + return; + } + + if (operatorPass.toLowerCase().contains("yangcai")) + { + request.setResponseError("密码中不允许包含yangcai"); + return; + } + + if (Validates.isEmpty(operatorWxcode)) + { + request.setResponseError("请输入个人微信账号"); + return; + } + + /* 根据企业成员手机号获取企业微信账号 */ + String accessToken = WorkWechatPresenter.doGetWorkWechatAccessToken(); + String wkwechatAccount = WorkWechatPresenter.getUserIdByPhoneNumber(accessToken, operatorMobile); + + long operatorAvatar = 0; + PageResult result = ZmrBootstrap.table(request).page(ZmrAvatar.class, 1, 10, new Selector("avatarId", "avatarType", 0)); + if (result.size() > 0) + {// 随机取一个系统头像 + int ind = new Random().nextInt(result.size()); + operatorAvatar = result.list().get(ind).getAvatarId(); + } + + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + String operatorPassSalt = Randoms.lettersDigitsSecure(64); + operatorPass = passworder.encode(operatorCode, operatorPass, operatorPassSalt); + + ZmrOperator operator = new ZmrOperator(); + operator.setOrgId(orgId); + operator.setOperatorCode(operatorCode); + operator.setOperatorPass(operatorPass); + operator.setOperatorPassSalt(operatorPassSalt); + operator.setOperatorStatus(operatorStatus); + operator.setOperatorType(operatorType); + operator.setOperatorName(operatorName); + operator.setOperatorIp(operatorIp); + operator.setOperatorAvatar(operatorAvatar); + operator.setOperatorMobile(operatorMobile); + operator.setOperatorCreated(dateTime); + operator.setOperatorModified(dateTime); + operator.setOperatorWangwang(operatorWangwang); + operator.setWkwechatAccount(wkwechatAccount); + operator.setOperatorWxcode(operatorWxcode); + operator.setInitialPassword(operatorPass); + ZmrBootstrap.table(request).insert(operator); + request.setAttribute("operator", operator); + } + catch (Exception e) + { + log.error("添加操作员异常:" + e.getMessage(), e); + request.setResponseError("添加操作员异常:" + e.getMessage()); + return; + } + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrOrgPresenter.java b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrOrgPresenter.java new file mode 100644 index 0000000..3fe71aa --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrOrgPresenter.java @@ -0,0 +1,102 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.presenter; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.tree.Tree; +import org.zhiqim.kernel.tree.TreeBuilder; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOrgDao; +import org.zhiqim.manager.dbo.ZmrMenu; +import org.zhiqim.manager.dbo.ZmrOrg; +import org.zhiqim.manager.dbo.ZmrOrgRule; +import org.zhiqim.orm.dbo.Selector; +/** + * 组织控制器 + * + * @version v1.0.0 @author liuhu 2018-8-10 新建与整理 + */ +@AnAlias("ZmrOrgPresenter") +@AnIntercept("chkZmrLogin") +public class ZmrOrgPresenter implements ZmrConstants +{ + /** + * 组织权限列表 + * @param request + * @throws Exception + */ + public static void doShowOrgRuleList(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + if (orgId == -1) + { + request.setResponseError("您选择的组织不存在,请选择一个有效的组织"); + return; + } + + ZmrOrg org = ZmrBootstrap.tableOpr(request).item(ZmrOrg.class, orgId); + if (org == null) + { + request.setResponseError("您选择的组织不存在,请选择一个有效的组织"); + return; + } + + if(org.getOrgLevel() == 0) + ZmrOrgDao.setTopOrgRule(request, orgId); + + //获取已拥有的权限 + List ruleList = ZmrBootstrap.table(request).list(ZmrOrgRule.class, new Selector("orgId", orgId)); + + // 获取能管理的权限 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + List list = sessionUser.getMenuList(); + Tree tree = TreeBuilder.newTree(list, "parentCode", "menuCode"); + + MapSO variable = new HashMapSO(); + variable.put("org", org); + variable.put("tree", tree); + variable.put("menuSize", list.size()); + variable.put("ruleList", ruleList); + + String responseText = ZmlContexts.parseZmlPath(request, "/zview/zhiqim_manager/presenter/orgRuleInfo.zml", variable); + request.setResponseResult(responseText); + } + + /** + * 切换组织 + * @param request + * @throws Exception + */ + public static void doSelOrg(HttpRequest request) throws Exception + { + long orgId = request.getParameterLong("orgId"); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + sessionUser.setSelectedOrgId(orgId); + sessionUser.setValue(ZMR_SESSION_USER_DEPT_ID, "zmr_session_user_dept_id"); + sessionUser.setValue(ZMR_SESSION_USER_ROLE_ID, "zmr_session_user_role_id"); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrProcessPresenter.java b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrProcessPresenter.java new file mode 100644 index 0000000..f70970c --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrProcessPresenter.java @@ -0,0 +1,166 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.presenter; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.constants.CodeConstants; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Linux; +import org.zhiqim.kernel.util.Systems; + +/** + * 进程状态查询控制器 + * + * @version v1.0.0 @author liuhu 2018-9-6 新建与整理 + */ +@AnAlias("ZmrProcessPresenter") +@AnIntercept("chkZmrLogin") +public class ZmrProcessPresenter implements CodeConstants +{ + /** + * 获取进程信息 + * + * @param request 请求 + * @throws Exception 异常 + */ + public static void doShowProcessInfo(HttpRequest request) throws Exception + { + if (Systems.isWindows()) + { + request.setResponseError("暂不支持Windows查询进程信息"); + return; + } + + int pid= Systems.getPid(); + String shell = new StringBuilder("top -H -p ").append(pid).append(" -n 1 -b").toString(); + String result = Linux.shell(shell, _UTF_8_); + + List list = findProcessInfo(result); + List> threadList = findThreadList(result); + + int pageNo = request.getParameterInt("pageNo", 1); + PageResult> pageResult = PageBuilder.pageResult(pageNo, 15, threadList); + MapSO variable = new HashMapSO(); + variable.put("pid", pid); + variable.put("list", list); + variable.put("pageResult", pageResult); + + String responseText = ZmlContexts.parseZmlPath(request, "/zview/zhiqim_manager/presenter/processInfo.zml", variable); + request.setResponseResult(responseText); + } + + /** + * 正则表达式获取线程列表 + * + * @param result 进程字符串 + * @return 线程列表 + */ + public static List> findThreadList(String result) + { + List> list = new ArrayList>(); + Pattern pattern = Pattern.compile("(\\d+)\\s+(\\w+)\\s+(\\d)+\\s+(\\d+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)"); + Matcher matcher = pattern.matcher(result); + while(matcher.find()) + { + List stringList = new ArrayList(); + stringList.add(matcher.group(1)); + stringList.add(matcher.group(2)); + stringList.add(matcher.group(3)); + stringList.add(matcher.group(4)); + stringList.add(matcher.group(5)); + stringList.add(matcher.group(6)); + stringList.add(matcher.group(7)); + stringList.add(matcher.group(8)); + stringList.add(matcher.group(9)); + stringList.add(matcher.group(10)); + stringList.add(matcher.group(11)); + stringList.add(matcher.group(12)); + list.add(stringList); + } + return list; + } + + /** + * 正则表达式获取进程信息前五行 + * + * @param result 进程字符串 + * @return 进程信息表 + */ + public static List findProcessInfo(String result) + { + List list = new ArrayList(); + Pattern pattern = Pattern.compile("\\S.+\\n"); + Matcher matcher = pattern.matcher(result); + int i = 0; + while(matcher.find()) + { + if(i++ == 5) + break; + + list.add(matcher.group()); + } + return list; + } + + /** + * 正则表达式获取线程堆栈信息 + * + * @param result 进程字符串 + * @return 进程堆栈表 + */ + public static List findThreadStack(String result) + { + List list = new ArrayList(); + Pattern pattern = Pattern.compile("\\\"([\\s\\S]+?\"[\\s\\S]+?)(?=\\\"|JNI)"); + Matcher matcher = pattern.matcher(result); + while(matcher.find()) + { + list.add(matcher.group()); + } + return list; + } + + /** + * 正则表达式获得线程PID + * + * @param result 进程字符串 + * @return 线程PID + */ + public static String findPid(String result) + { + StringBuilder str = new StringBuilder(); + Pattern pattern = Pattern.compile("nid=0x(\\w+)"); + Matcher matcher = pattern.matcher(result); + while(matcher.find()) + { + str.append(matcher.group(1)); + } + return str.toString(); + } +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrProfilePresenter.java b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrProfilePresenter.java new file mode 100644 index 0000000..2e6232a --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/presenter/ZmrProfilePresenter.java @@ -0,0 +1,389 @@ +package org.zhiqim.manager.presenter; + +import java.util.regex.Pattern; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.ZmlContexts; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.httpd.validate.ones.IsByteLen; +import org.zhiqim.httpd.validate.ones.IsNotEmpty; +import org.zhiqim.httpd.validate.onex.IsUserPass; +import org.zhiqim.httpd.validate.two.IsEqual; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.constants.CodeConstants; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Images; +import org.zhiqim.kernel.util.Randoms; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.codes.Base64; +import org.zhiqim.manager.SmsUtils; +import org.zhiqim.manager.ZmrBootstrap; +import org.zhiqim.manager.ZmrConstants; +import org.zhiqim.manager.ZmrPassworder; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dao.ZmrOperatorDao; +import org.zhiqim.manager.dbo.ZmrAvatar; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.manager.dbo.ZmrParamOperator; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; + +/** + * 管理台个人中心控制器 + * + * @version v1.0.0 @author zouzhigang 2017-6-5 新建与整理 + * @version v2.0.0 @author 曹红 2021-5-31 增加短信认证 + */ +@AnAlias("ZmrProfilePresenter") +@AnIntercept("chkZmrLogin") +public class ZmrProfilePresenter implements CodeConstants +{ + + /** 修改密码 */ + public static void doModifyPass(HttpRequest request) throws Exception + { + request.addValidate(new IsByteLen("oldPassword", "密码为6-16位,请输入正确的旧密码", 6, 16)); + request.addValidate(new IsUserPass("newPassword", "新密码不合法,要求6-16位(大小写字母数字和特殊字符必须四选三)")); + request.addValidate(new IsUserPass("newPassword2", "新密码确认不合法,要求6-16位(大小写字母数字和特殊字符必须四选三)")); + request.addValidate(new IsEqual("newPassword", "newPassword2", "新密码和新密码确认不一致")); + + if (!request.chkValidate()) + { + request.setResponseError(request.getAlertMsg()); + return; + } + + String oldPassword = request.getParameter("oldPassword"); + String newPassword = request.getParameter("newPassword"); + + if (oldPassword.equals(newPassword)) + { + request.setResponseError("修改密码时不能使用旧密码"); + return; + } + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + String operatorCode = sessionUser.getOperatorCode(); + + ZmrPassworder passworder = request.getContextAttribute(ZmrBootstrap.class).getPassworder(); + String oldPassEncode = passworder.encode(operatorCode, oldPassword, sessionUser.getOperatorPassSalt()); + + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, operatorCode); + if (operator == null || !oldPassEncode.equalsIgnoreCase(operator.getOperatorPass())) + { + request.setResponseError("旧密码不正确"); + return; + } + + String newPassSalt = Randoms.lettersDigitsSecure(64); + newPassword = passworder.encode(operatorCode, newPassword, newPassSalt); + + Updater updater = new Updater(); + updater.addMaybe("operatorCode", operatorCode); + updater.addField("operatorPass", newPassword); + updater.addField("operatorPassSalt", newPassSalt); + updater.addField("operatorModified", DateTimes.getDateTimeString()); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + + sessionUser.setOperator(ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, sessionUser.getOperatorCode())); + } + + /** + * [简要描述]:修改手机号发送验证码
            + * + * @author caohong + * @param request + * @throws Exception + */ + public static void sendSmsByModifyMobile(HttpRequest request) throws Exception + { + // 1.判断传入参数 + request.addValidate(new IsNotEmpty("operatorMobile", "手机号不能为空")); + + // 2.验证操作员编码是否存在 + String operatorMobile = request.getParameter("operatorMobile"); + Selector selector = new Selector(); + selector.addMust("operatorMobile", operatorMobile); + ZmrOperator operatorNew = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, selector); + if (operatorNew != null) + { + request.setResponseError("手机号已注册"); + return; + } + + if (Validates.isNotEmpty(operatorMobile)) + { + boolean isMatch = Pattern.matches(ZmrConstants.ZMR_MOBILE, operatorMobile); + if (!isMatch) + { + request.setResponseError("请输入正确的手机号"); + return; + } + } + + // 发送短信验证码 + SmsUtils.sendSmsCode(request, operatorMobile, "SMS_174195343"); + } + + /** 更换成手机号 */ + public static void doModifyMobile(HttpRequest request, String mobile, String smsCode) throws Exception + { + boolean isMatch = Pattern.matches(ZmrConstants.ZMR_MOBILE, mobile); + if (!isMatch) + { + request.setResponseError("请输入正确的手机号"); + return; + } + + String sessionSmsCodeSession = request.getSessionAttributeString("_smscode_"); + if (!smsCode.equals(sessionSmsCodeSession)) + { + request.setResponseError("短信验证码不正确或已失效,请新输入!"); + return; + } + + // 根据企业成员手机号获取企业微信账号 + String accessToken = WorkWechatPresenter.doGetWorkWechatAccessToken(); + String wkwechatAccount = WorkWechatPresenter.getUserIdByPhoneNumber(accessToken, mobile); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + + Updater updater = new Updater(); + updater.addMust("operatorCode", sessionUser.getOperatorCode()); + updater.addField("operatorMobile", mobile); + updater.addField("wkwechatAccount", wkwechatAccount); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + + sessionUser.setOperator(ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, sessionUser.getOperatorCode())); + } + + /** 更换电子邮箱 */ + public static void doModifyEmail(HttpRequest request, String email) throws Exception + { + if (!Validates.isEmail(email, false)) + { + request.setResponseError("请输入正确的邮箱"); + return; + } + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + Updater updater = new Updater(); + updater.addMust("operatorCode", sessionUser.getOperatorCode()); + updater.addField("operatorEmail", email); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + + sessionUser.setOperator(ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, sessionUser.getOperatorCode())); + } + + /** 更换旺旺 */ + public static void doModifyWangwang(HttpRequest request, String wagnwang) throws Exception + { + if (Validates.isEmptyBlank(wagnwang)) + { + request.setResponseError("请输入正确的旺旺"); + return; + } + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + Updater updater = new Updater(); + updater.addMust("operatorCode", sessionUser.getOperatorCode()); + updater.addField("operatorWangwang", wagnwang); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + + sessionUser.setOperator(ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, sessionUser.getOperatorCode())); + } + + /** + * 更换企业微信账号 + */ + public static void doModifyWkwechatAccount(HttpRequest request, String wkwechatAccount) throws Exception + { + if (Validates.isEmptyBlank(wkwechatAccount)) + { + request.setResponseError("请输入操作员企业微信账号"); + return; + } + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + Updater updater = new Updater(); + updater.addMust("operatorCode", sessionUser.getOperatorCode()); + updater.addField("wkwechatAccount", wkwechatAccount); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + + sessionUser.setOperator(ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, sessionUser.getOperatorCode())); + } + + /** + * 更换个人微信账号 + */ + public static void doModifyWxcode(HttpRequest request, String operatorWxcode) throws Exception + { + if (Validates.isEmptyBlank(operatorWxcode)) + { + request.setResponseError("请输入操作员个人微信账号"); + return; + } + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + Updater updater = new Updater(); + updater.addMust("operatorCode", sessionUser.getOperatorCode()); + updater.addField("operatorWxcode", operatorWxcode); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + + sessionUser.setOperator(ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, sessionUser.getOperatorCode())); + } + + /** 查询系统头像 */ + public static String doQuerySysAvatar(HttpRequest request, int pageNo) throws Exception + { + int pageSize = 18; + if (pageNo < 1) + { + pageNo = 1; + } + + PageResult result = ZmrBootstrap.table(request).page(ZmrAvatar.class, pageNo, pageSize, + new Selector("avatarType", 0).addOrderbyAsc("avatarId")); + + MapSO attrMap = new HashMapSO(); + attrMap.put("result", result); + attrMap.put("pageNo", pageNo); + + return ZmlContexts.parseZmlPath(request, "/zview/zhiqim_manager/presenter/selSysAvatarInfo.zml", attrMap); + } + + /** 更换成系统头像 */ + public static void doModifySysAvatar(HttpRequest request, long avatarId) throws Exception + { + if (ZmrBootstrap.table(request).item(ZmrAvatar.class, avatarId) == null) + { + request.setResponseError("选择的头像不存在,请重新选择"); + return; + } + + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, sessionUser.getOperatorCode()); + if (operator.getOperatorAvatar() != 0) + {// 不为0,检查是否用户自定义的 + ZmrAvatar avatar = ZmrBootstrap.table(request).item(ZmrAvatar.class, operator.getOperatorAvatar()); + if (avatar != null && avatar.getAvatarType() == 1) + {// 如果是,要删除自定义的数据 + ZmrBootstrap.table(request).delete(ZmrAvatar.class, operator.getOperatorAvatar()); + } + } + + Updater updater = new Updater(); + updater.addMust("operatorCode", sessionUser.getOperatorCode()); + updater.addField("operatorAvatar", avatarId); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + + sessionUser.setOperator(ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, sessionUser.getOperatorCode())); + } + + /** 更换成自定义头像 */ + public static void doModifySelfAvatar(HttpRequest request, String data) throws Exception + { + // 1.读取头像图片 + int idx = data.indexOf(","); + byte[] imageData = Base64.decode(data.substring(idx + 1)); + + byte[] bytes50 = Images.resizePNG(imageData, 50, 50); + if (bytes50 == null) + { + request.setResponseError("图片错误"); + return; + } + + byte[] bytes100 = Images.resizePNG(imageData, 100, 100); + if (bytes100 == null) + { + request.setResponseError("图片错误"); + return; + } + + byte[] bytes150 = Images.resizePNG(imageData, 150, 150); + if (bytes150 == null) + { + request.setResponseError("图片错误"); + return; + } + + // 2.以数据库数据为准,查操作员信息,防止账号多浏览器登录 + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + ZmrOperator operator = ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, sessionUser.getOperatorCode()); + + if (operator.getOperatorAvatar() != 0) + { + ZmrAvatar avatar = ZmrBootstrap.table(request).item(ZmrAvatar.class, operator.getOperatorAvatar()); + if (avatar.getAvatarType() == 1) + {// 操作员自定义的,要删除头像图片 + ZmrBootstrap.table(request).delete(ZmrAvatar.class, operator.getOperatorAvatar()); + } + } + + // 3.新的头像插入到头像表 + long avatarId = Ids.longId13(); + ZmrAvatar avatar = new ZmrAvatar(); + avatar.setAvatarId(avatarId); + avatar.setAvatarType(1);// 自定义头像 + avatar.setAvatarTime(System.currentTimeMillis()); + avatar.setAvatar50(bytes50); + avatar.setAvatar100(bytes100); + avatar.setAvatar150(bytes150); + ZmrBootstrap.table(request).insert(avatar); + + // 4.更新操作员头像Id号 + Updater updater = new Updater(); + updater.addMust("operatorCode", sessionUser.getOperatorCode()); + updater.addField("operatorAvatar", avatarId); + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + + // 5.更新会话为新的头像Id号 + operator.setOperatorAvatar(avatarId); + sessionUser.setOperator(operator); + } + + /** 关闭超级管理员权限 */ + public static void doCloseSuperAdmin(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (!sessionUser.isSuperAdmin()) + { + request.setResponseError("你没有关闭超级管理员权限"); + return; + } + + if (ZmrBootstrap.tableOpr(request).count(ZmrOperator.class, new Selector("operatorType", 1)) == 0) + { + request.setResponseError("还没有设置管理员,不能关闭超级管理员"); + return; + } + + Updater updater = new Updater(); + updater.addField("operatorStatus", 1); + updater.addMust("operatorType", 0); + + ZmrBootstrap.tableOpr(request).update(ZmrOperator.class, updater); + } + + /** 修改操作员参数 */ + public static void doModifyOperatorParam(HttpRequest request) throws Exception + { + String paramKey = request.getParameter("paramKey"); + String paramValue = request.getParameter("paramValue"); + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + + if (ZmrBootstrap.tableOpr(request).count(ZmrParamOperator.class, paramKey) <= 0) + { + request.setResponseError("该操作员参数键未定义,请重新输入"); + return; + } + + ZmrOperatorDao.addOrUpdateOperatorParam(request, sessionUser.getOperatorCode(), paramKey, paramValue); + sessionUser.setOperator(ZmrBootstrap.tableOpr(request).item(ZmrOperator.class, sessionUser.getOperatorCode())); + } + +} diff --git a/zhiqim_manager/src/org/zhiqim/manager/rule/ZmrAdminMutexRule.java b/zhiqim_manager/src/org/zhiqim/manager/rule/ZmrAdminMutexRule.java new file mode 100644 index 0000000..8689cc0 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/rule/ZmrAdminMutexRule.java @@ -0,0 +1,52 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.rule; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.rule.CheckObjectRule; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnGlobal; +import org.zhiqim.manager.ZmrSessionUser; +import org.zhiqim.manager.dbo.ZmrOperator; + +/** + * 页面验证是否有管理员,管理员之间互斥权限,返回boolean =true表示有,=false表示没有 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +@AnAlias("ZmrAdminMutexRule") +@AnGlobal +public class ZmrAdminMutexRule implements CheckObjectRule +{ + public boolean check(HttpRequest request, Object obj) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (sessionUser == null) + {// 用户未登录或超时 + return false; + } + + if (sessionUser.isSuperAdmin()) + {//超级管理员有所有权限 + return true; + } + + //管理员,且检查的对象是操作员 + return sessionUser.isAdmin() && (obj instanceof ZmrOperator) && ((ZmrOperator)obj).getOperatorType() > 1; + } +} \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/rule/ZmrAdminRule.java b/zhiqim_manager/src/org/zhiqim/manager/rule/ZmrAdminRule.java new file mode 100644 index 0000000..858a813 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/rule/ZmrAdminRule.java @@ -0,0 +1,45 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.rule; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.rule.CheckRule; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnGlobal; +import org.zhiqim.manager.ZmrSessionUser; + +/** + * 页面验证是否有管理员权限,返回boolean =true表示有,=false表示没有 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +@AnAlias("ZmrAdminRule") +@AnGlobal +public class ZmrAdminRule implements CheckRule +{ + public boolean check(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (sessionUser == null) + {// 用户未登录或超时 + return false; + } + + return sessionUser.isAdmin(); + } +} \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/rule/ZmrPathRule.java b/zhiqim_manager/src/org/zhiqim/manager/rule/ZmrPathRule.java new file mode 100644 index 0000000..6c75b1a --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/rule/ZmrPathRule.java @@ -0,0 +1,45 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.rule; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.rule.CheckPermissionRule; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnGlobal; +import org.zhiqim.manager.ZmrSessionUser; + +/** + * 验证页面是否显示该路径 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +@AnAlias("ZmrPathRule") +@AnGlobal +public class ZmrPathRule implements CheckPermissionRule +{ + public boolean check(HttpRequest request, String permission) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (sessionUser == null) + {// 用户未登录或超时 + return false; + } + + return sessionUser.hasMenuRule(permission); + } +} \ No newline at end of file diff --git a/zhiqim_manager/src/org/zhiqim/manager/rule/ZmrSuperAdminRule.java b/zhiqim_manager/src/org/zhiqim/manager/rule/ZmrSuperAdminRule.java new file mode 100644 index 0000000..a188b32 --- /dev/null +++ b/zhiqim_manager/src/org/zhiqim/manager/rule/ZmrSuperAdminRule.java @@ -0,0 +1,45 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_manager.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.manager.rule; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.rule.CheckRule; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnGlobal; +import org.zhiqim.manager.ZmrSessionUser; + +/** + * 页面验证是否有超级管理员权限,返回boolean =true表示有,=false表示没有 + * + * @version v1.0.0 @author zouzhigang 2015-5-28 新建与整理 + */ +@AnAlias("ZmrSuperAdminRule") +@AnGlobal +public class ZmrSuperAdminRule implements CheckRule +{ + public boolean check(HttpRequest request) throws Exception + { + ZmrSessionUser sessionUser = request.getSessionUser(ZmrSessionUser.class); + if (sessionUser == null) + {// 用户未登录或超时 + return false; + } + + return sessionUser.isSuperAdmin(); + } +} \ No newline at end of file diff --git a/zhiqim_orm/.classpath b/zhiqim_orm/.classpath new file mode 100644 index 0000000..e243548 --- /dev/null +++ b/zhiqim_orm/.classpath @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/zhiqim_orm/.gitignore b/zhiqim_orm/.gitignore new file mode 100644 index 0000000..7da5aac --- /dev/null +++ b/zhiqim_orm/.gitignore @@ -0,0 +1,2 @@ +/bin +/logs diff --git a/zhiqim_orm/.project b/zhiqim_orm/.project new file mode 100644 index 0000000..79f6321 --- /dev/null +++ b/zhiqim_orm/.project @@ -0,0 +1,17 @@ + + + zhiqim_orm + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/zhiqim_orm/.settings/org.eclipse.jdt.core.prefs b/zhiqim_orm/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..87b7a7a --- /dev/null +++ b/zhiqim_orm/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/zhiqim_orm/.settings/org.eclipse.jdt.ui.prefs b/zhiqim_orm/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..aeaf25e --- /dev/null +++ b/zhiqim_orm/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/zhiqim_orm/LICENSE b/zhiqim_orm/LICENSE new file mode 100644 index 0000000..5cc63c2 --- /dev/null +++ b/zhiqim_orm/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. [http://fsf.org/] + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/zhiqim_orm/README.md b/zhiqim_orm/README.md new file mode 100644 index 0000000..cd0fbc7 --- /dev/null +++ b/zhiqim_orm/README.md @@ -0,0 +1,835 @@ +### 什么是“知启蒙数据库映射”? +--------------------------------------- +      “知启蒙数据库映射(ZhiqimORM)”是Zhiqim Development Kit面向数据库开发的多例服务,包括ZSQL规范和三大映射关系(表映射、字段映射和指令映射),有比MyBatis更简单的动态SQL,和比Hibernate更彻底的对象关系映射:
            +1、数据库二维表和Java对象之间的注解定义映射,表和视图分别对应Java的_Table、_View;
            +2、数据库表列和Java字段的数据格式映射,支持6种数据库的9种数据格式;
            +3、数据库SQL语句和Java指令映射,基于ZTable、ZView的创建、清空、存在、分页、列表、单条、数目、求和、插入、更新、替换、删除等指令。
            + +
            + +### 知启蒙数据库映射有哪些优点? +--------------------------------------- +1、ZhiqimORM仅依赖JDK1.7+和ZhiqimKernel。15年的坚持,值得信赖。
            +2、ZhiqimORM是基于ZhiqimKernel设计的多例服务,支持配置多个数据库,且自带JDBC连接池。
            +3、ZhiqimORM的ZSQL语句可以通过XML配置,和Java代码分离,更易查看和检查,支持不同后缀适配不同的数据库;
            +4、ZhiqimORM的ZSQL/ZDBO规范通过(?、##、$$)三个通配符建立SQL语句和Java对象的映射关联,简洁清晰。
            +5、ZhiqimORM提供了标准的ZTable规则,对应数据库表设计,大量的基于表的增、删、改、查、列表、分页、统计无需编写SQL语句;
            +6、ZhiqimORM提供了标签的ZTView规则,对应多表关联设计,大量基于视图的查询、列表、分页和统计无需编写SQL语句。
            + +
            + +### 知启蒙数据库映射目前支持的6种数据库 +--------------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            编号数据库名称常用的驱动连接URL
            1mysqlcom.mysql.jdbc.Driverjdbc:mysql://127.0.0.1:3306/zhiqim?useUnicode=true&amp;characterEncoding=UTF-8
            2oracleoracle.jdbc.driver.OracleDriverjdbc:oracle:thin:@127.0.0.1:1521:zhiqim
            3mssqlcom.microsoft.jdbc.sqlserver.SQLServerDriverjdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=zhiqim
            4postpresqlorg.postgresql.Driverjdbc:postgresql://127.0.0.1:5432/zhiqim
            5sqliteorg.sqlite.JDBCjdbc:sqlite:./db/zhiqim.db
            6hsqlorg.hsqldb.jdbc.JDBCDriverjdbc:hsqldb:./db/zhiqim
            + +
            + +### 知启蒙数据库映射支持的9种数据格式映射 +--------------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            编号名称JAVA类型MySQLOracleMSSQLPostpreSQLSQLiteHSQL
            基本类型5种
            1booleanbooleantinyint(1)NUMBER(1)bitboolintegerboolean
            2byteinttinyint(4)NUMBER(4)tinyintint2integertinyint
            3shortintsmallint(6)NUMBER(6)smallintint2integersmalli
            nt
            4intintintNUMBER(11)intint4integerinteger
            5longlongbigintNUMBER(20)bigintint8integerbigint
            对象类型2种
            6stringjava.lang.
            String
            varchar
            char
            text
            mediumtext
            longtext
            VARCHAR2
            CHAR
            CLOB
            varchar
            char
            text
            varchar
            char
            text
            varchar
            char
            text
            varchar
            char
            clob
            7datetimejava.sql.
            Timestamp
            datetimeDATEdatetimetimestampdatetimetimestamp
            特殊类型2种
            8decimaldoubledecimal(m,n)NUMBER(m,n)decimal(m,n)decimal(m,n)numeric(m,n)decimal
            (m,n)
            9binarybyte[]mediumblobBLOBimagebyteablobblob
            + +
            + +### 知启蒙数据库映射使用举例                                                                                       下载留言本示例 + +``` +/** + * 首页 + * + * @version v1.0.0 @author zouzhigang 2016-9-1 新建与整理 + */ +public class IndexAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + int page = request.getParameterInt("page", 1); + int pageSize = request.getContextAttributeInt("page.size", 10); + + Selector selector = new Selector(); + selector.addOrderbyDesc("messageTime"); + PageResult result = Global.get(ZTable.class).page(Message.class, page, pageSize, selector); + + request.setAttribute("result", result); + } +} +``` + +
            + + +### 知启蒙数据库映射指令集 + +``` + /********************************************************************************************/ + //exist 表是否存在 + /********************************************************************************************/ + + /** + * 是否存在[表类]对应的[实际表] + * + * @param clazz 表类 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(Class clazz) throws ORMException, SQLException; + + /** + * 是否存在[表类]对应的[实际表]月表,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$ + * + * @param clazz 表类 + * @param month 月份 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean existMonth(Class clazz, String month) throws ORMException, SQLException; + + /** + * 是否存在[表类]对应的[实际表],支持表名中有一个替换字段,如LOG_TRACE$ID$ + * + * @param clazz 表类 + * @param replaceKey 替换键 + * @param replaceValue 替换值 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(Class clazz, String replaceKey, String replaceValue) throws ORMException, SQLException; + + /** + * 是否存在[表类]对应的[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param clazz 表类 + * @param replaceMap 可替换字段表 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(Class clazz, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //create 创建表 + /********************************************************************************************/ + + /** + * 创建[表类]对应的[实际表] + * + * @param clazz 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void create(Class clazz) throws ORMException, SQLException; + + /** + * 创建[表类]对应的[实际表]月表 + * + * @param clazz 表类 + * @param month 月份 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void createMonth(Class clazz, String month) throws ORMException, SQLException; + + /** + * 创建[表类]对应的[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param clazz 表类 + * @param replaceMap 可替换字段表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void create(Class clazz, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //truncate 清空表 + /********************************************************************************************/ + + /** + * 清空[表类]对应的[实际表] + * + * @param clazz 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(Class clazz) throws ORMException, SQLException; + + /** + * 清空[表类]对应的[实际表],支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$ + * + * @param clazz 表类 + * @param month 分月表时使用 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncateMonth(Class clazz, String month) throws ORMException, SQLException; + + /** + * 清空[表类]对应的[实际表],支持表名中有一个替换字段,如LOG_TRACE$ID$ + * + * @param clazz 表类 + * @param replaceKey 替换键 + * @param replaceValue 替换值 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(Class clazz, String replaceKey, String replaceValue) throws ORMException, SQLException; + + /** + * 清空[表类]对应的[实际表],支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param clazz 表类 + * @param replaceMap 替换表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(Class clazz, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //insert 插入数据 + /********************************************************************************************/ + + /** + * 增加数据,传入标准[表类]对象 + * + * @param data 表对象 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insert(Object data) throws ORMException, SQLException; + + /** + * 增加数据,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$ + * + * @param data 表类 + * @param month 月份 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insertMonth(Object data, String month) throws ORMException, SQLException; + + /** + * 增加数据,支持表或字段中有一个替换字段,如LOG_TRACE$ID$ + * + * @param data 表对象 + * @param replaceKey 替换键 + * @param replaceValue 替换值 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insert(Object data, String replaceKey, String replaceValue) throws ORMException, SQLException; + + /** + * 增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insert(Object data, MapSS replaceMap) throws ORMException, SQLException; + + /** + * 替换数据,传入标准[表类]对象和更新器(取fieldMap和replaceMap)当存在时指定修改的值 + * + * @param data 表对象 + * @param updater 更新器 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insertOrUpdate(Object data, Updater updater) throws ORMException, SQLException; + + /** + * 批量增加数据 + * + * @param dataList 表对象列表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] insertBatch(List dataList) throws ORMException, SQLException; + + /** + * 批量增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param dataList 表对象列表 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] insertBatch(List dataList, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //replace 替换数据,MYSQL支持,如果有数据先删除后增加 + /********************************************************************************************/ + + /** + * 替换数据,传入标准[表类]对象 + * + * @param data 表对象 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(Object data) throws ORMException, SQLException; + + /** + * 替换数据,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$ + * + * @param data 表对象 + * @param month 月份 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replaceMonth(Object data, String month) throws ORMException, SQLException; + + /** + * 替换数据,支持表或字段中有一个替换字段,如LOG_TRACE$ID$ + * + * @param data 表对象 + * @param replaceKey 替换键 + * @param replaceValue 替换值 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(Object data, String replaceKey, String replaceValue) throws ORMException, SQLException; + + /** + * 替换数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(Object data, MapSS replaceMap) throws ORMException, SQLException; + + /** + * 批量替换数据 + * + * @param dataList 表对象列表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] replaceBatch(List dataList) throws ORMException, SQLException; + + /** + * 批量替换数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param dataList 表对象列表 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] replaceBatch(List dataList, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //update 更新数据 + /********************************************************************************************/ + + /** + * 更新数据,指定更新器需要更新的字段、条件和可替换表 + * + * @param clazz 表类 + * @param updater 更新器 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(Class clazz, Updater updater) throws ORMException, SQLException; + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新 + * + * @param data 表对象 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(Object data) throws ORMException, SQLException; + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$ + * + * @param data 表对象 + * @param month 月份 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int updateMonth(Object data, String month) throws ORMException, SQLException; + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持表或字段中有一个替换字段,如LOG_TRACE$ID$ + * + * @param data 表对象 + * @param replaceKey 替换键 + * @param replaceValue 替换值 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(Object data, String replaceKey, String replaceValue) throws ORMException, SQLException; + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持可替换表 + * + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(Object data, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //delete 删除数据 + /********************************************************************************************/ + + /** + * 删除数据,多个主键时使用 + * + * @param clazz 表类 + * @param ids 关键属性为数组,多个主键 + * @return 返回删除数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int delete(Class clazz, Object... ids) throws ORMException, SQLException; + + /** + * 删除数据, 根据条件 + * + * @param clazz 表类 + * @param selector 对象选择器 + * @return 返回删除数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int delete(Class clazz, Selector selector) throws ORMException, SQLException; + + /********************************************************************************************/ + //count 查询数目 + /********************************************************************************************/ + + /** + * 查询数目,多个主键时使用 + * + * @param clazz 表类 + * @param ids 关键属性值,支持多个 + * @return 存在的数目 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class clazz, Object... ids) throws ORMException, SQLException; + + /** + * 查询数目,整表查询 + * + * @param clazz 表类 + * @return int 数目值 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class clazz) throws ORMException, SQLException; + + /** + * 查询数目,根据条件、可替换表查询 + * + * @param clazz 表类 + * @param selector 对象查询器 + * @return int 数目值 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class clazz, Selector selector)throws ORMException, SQLException; + + /********************************************************************************************/ + //sum 计算总和 + /********************************************************************************************/ + + /** + * 计算总和 + * + * @param clazz 表类 + * @param field 表字段 + * @return 计算总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(Class clazz, String field) throws ORMException, SQLException; + + /** + * 计算总和 + * + * @param clazz 表类 + * @param selector 对象查询器 + * @param field 表字段 + * @return 计算总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(Class clazz, Selector selector, String field) throws ORMException, SQLException; + + /** + * 计算多个总和 + * + * @param clazz 表类 + * @param selector 对象查询器 + * @param fields 多个表字段 + * @return 计算多个总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long[] sum(Class clazz, Selector selector, String... fields) throws ORMException, SQLException; + + /********************************************************************************************/ + //item 查询一条数据 + /********************************************************************************************/ + + /** + * 查询一个表对象,支持多个主键 + * + * @param clazz 表类 + * @param ids 关键属性值 + * @return 返回表对象 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public T item(Class clazz, Object... ids) throws ORMException, SQLException; + + /** + * 查询一个表对象,并指定返回属性,查询第一行 + * + * @param clazz 表类 + * @return 返回表对象 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public T item(Class clazz) throws ORMException, SQLException; + + /** + * 查询一个表对象,并指定返回属性,查询条件和排序条件 + * + * @param clazz 表类 + * @param selector 对象查询器 + * @return 返回表对象 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public T item(Class clazz, Selector selector) throws ORMException, SQLException; + + /********************************************************************************************/ + //list 查询列表 + /********************************************************************************************/ + + /** + * 查询表对象列表,全表查询 + * + * @param clazz 表类 + * @return 返回表对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(Class clazz) throws ORMException, SQLException; + + /** + * 查询表对象列表,并指定返回属性,查询条件和排序条件 + * + * @param clazz 表类 + * @param selector 对象查询器 + * @return 返回表对象列表 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public List list(Class clazz, Selector selector) throws ORMException, SQLException; + + /** + * 查询表对象列表,查询指定的位置的数据 + * + * @param clazz 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 返回表对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(Class clazz, int pageNo, int pageSize) throws ORMException, SQLException; + + /** + * 查询表对象列表,并指定位置的,条件和排序条件 + * + * @param clazz 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 对象查询器 + * @return 返回表对象列表 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public List list(Class clazz, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException; + + /********************************************************************************************/ + //page 分页显示 + /********************************************************************************************/ + + /** + * 查询表对象分页信息 + * + * @param clazz 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(Class clazz, int pageNo, int pageSize) throws ORMException, SQLException; + + /** + * 查询表对象分页信息 + * + * @param clazz 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 对象查询器 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(Class clazz, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException; + +``` + +
            + +### 知启蒙数据库映射ZhiqimSQL示例 +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +
            + + +### 知启蒙技术框架与交流 +--------------------------------------- + +![知启蒙技术框架架构图](https://images.gitee.com/uploads/images/2018/0907/171951_230c3a33_2134900.png "知启蒙技术框架架构图.png") +

            +QQ群:加入QQ交流群,请点击[【458171582】](https://jq.qq.com/?_wv=1027&k=5DWlB3b)

            +教程:欲知更多知启蒙数据库映射,[【请戳这里】](https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm/tutorial/index.htm) diff --git a/zhiqim_orm/conf/logging.xml b/zhiqim_orm/conf/logging.xml new file mode 100644 index 0000000..78d076f --- /dev/null +++ b/zhiqim_orm/conf/logging.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_orm/conf/orm2.sql.xml b/zhiqim_orm/conf/orm2.sql.xml new file mode 100644 index 0000000..a59a2c1 --- /dev/null +++ b/zhiqim_orm/conf/orm2.sql.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_orm/conf/zhiqim.xml b/zhiqim_orm/conf/zhiqim.xml new file mode 100644 index 0000000..675bee1 --- /dev/null +++ b/zhiqim_orm/conf/zhiqim.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_orm/database/fadfox_orm_test.db b/zhiqim_orm/database/fadfox_orm_test.db new file mode 100644 index 0000000..e69de29 diff --git a/zhiqim_orm/database/sqlite.db b/zhiqim_orm/database/sqlite.db new file mode 100644 index 0000000..1a38f3e Binary files /dev/null and b/zhiqim_orm/database/sqlite.db differ diff --git a/zhiqim_orm/database/sqlitestudio-2.1.5.exe b/zhiqim_orm/database/sqlitestudio-2.1.5.exe new file mode 100644 index 0000000..07e9a59 Binary files /dev/null and b/zhiqim_orm/database/sqlitestudio-2.1.5.exe differ diff --git a/zhiqim_orm/db/fadfox_orm_test.db b/zhiqim_orm/db/fadfox_orm_test.db new file mode 100644 index 0000000..03ed5ce Binary files /dev/null and b/zhiqim_orm/db/fadfox_orm_test.db differ diff --git a/zhiqim_orm/db/hsql.lck b/zhiqim_orm/db/hsql.lck new file mode 100644 index 0000000..280e4fb Binary files /dev/null and b/zhiqim_orm/db/hsql.lck differ diff --git a/zhiqim_orm/db/hsql.log b/zhiqim_orm/db/hsql.log new file mode 100644 index 0000000..dc6f92e --- /dev/null +++ b/zhiqim_orm/db/hsql.log @@ -0,0 +1,19 @@ +/*C1*/SET SCHEMA SYSTEM_LOBS +INSERT INTO BLOCKS VALUES(0,2147483647,0) +COMMIT +/*C3*/SET SCHEMA PUBLIC +create table if not exists T_INTEGER ( T_ID bigint NOT NULL, T_BOOLEAN boolean NOT NULL, T_BYTE tinyint NOT NULL, T_SHORT smallint NOT NULL, T_INT integer NOT NULL, T_LONG bigint NOT NULL, primary key (T_ID) ) +create table if not exists T_STRING ( T_ID bigint NOT NULL, T_CHAR char(19) NULL, T_VARCHAR varchar(32) NULL, T_STRING2000 varchar(2000) NULL, T_STRING4000 varchar(4000) NULL, T_STRING8000 varchar(8000) NULL, T_STRING16000 clob NULL, primary key (T_ID) ) +create table if not exists T_DATETIME ( T_ID bigint NOT NULL, T_DATETIME timestamp NOT NULL, T_DATETIME2 timestamp NOT NULL, primary key (T_ID) ) +create table if not exists T_DECIMAL ( T_ID bigint NOT NULL, T_DM5_2 decimal(5,2) NOT NULL, T_DM10_3 decimal(10,3) NOT NULL, T_DM15_4 decimal(15,4) NOT NULL, primary key (T_ID) ) +/*C2*/SET SCHEMA PUBLIC +DISCONNECT +/*C3*/DISCONNECT +/*C4*/SET SCHEMA PUBLIC +DISCONNECT +/*C5*/SET SCHEMA PUBLIC +DISCONNECT +/*C6*/SET SCHEMA PUBLIC +DISCONNECT +/*C7*/SET SCHEMA PUBLIC +DISCONNECT diff --git a/zhiqim_orm/db/hsql.properties b/zhiqim_orm/db/hsql.properties new file mode 100644 index 0000000..831e130 --- /dev/null +++ b/zhiqim_orm/db/hsql.properties @@ -0,0 +1,5 @@ +#HSQL Database Engine 2.3.4 +#Sat Dec 24 17:58:13 CST 2016 +version=2.3.4 +modified=yes +tx_timestamp=0 diff --git a/zhiqim_orm/db/hsql.script b/zhiqim_orm/db/hsql.script new file mode 100644 index 0000000..83a40dc --- /dev/null +++ b/zhiqim_orm/db/hsql.script @@ -0,0 +1,43 @@ +SET DATABASE UNIQUE NAME HSQLDB59304433B3 +SET DATABASE GC 0 +SET DATABASE DEFAULT RESULT MEMORY ROWS 0 +SET DATABASE EVENT LOG LEVEL 0 +SET DATABASE TRANSACTION CONTROL LOCKS +SET DATABASE DEFAULT ISOLATION LEVEL READ COMMITTED +SET DATABASE TRANSACTION ROLLBACK ON CONFLICT TRUE +SET DATABASE TEXT TABLE DEFAULTS '' +SET DATABASE SQL NAMES FALSE +SET DATABASE SQL REFERENCES FALSE +SET DATABASE SQL SIZE TRUE +SET DATABASE SQL TYPES FALSE +SET DATABASE SQL TDC DELETE TRUE +SET DATABASE SQL TDC UPDATE TRUE +SET DATABASE SQL TRANSLATE TTI TYPES TRUE +SET DATABASE SQL TRANSLATE TTI TYPES TRUE +SET DATABASE SQL CONCAT NULLS TRUE +SET DATABASE SQL UNIQUE NULLS TRUE +SET DATABASE SQL CONVERT TRUNCATE TRUE +SET DATABASE SQL AVG SCALE 0 +SET DATABASE SQL DOUBLE NAN TRUE +SET FILES WRITE DELAY 500 MILLIS +SET FILES BACKUP INCREMENT TRUE +SET FILES CACHE SIZE 10000 +SET FILES CACHE ROWS 50000 +SET FILES SCALE 32 +SET FILES LOB SCALE 32 +SET FILES DEFRAG 0 +SET FILES NIO TRUE +SET FILES NIO SIZE 256 +SET FILES LOG TRUE +SET FILES LOG SIZE 50 +CREATE USER SA PASSWORD DIGEST 'd41d8cd98f00b204e9800998ecf8427e' +ALTER USER SA SET LOCAL TRUE +CREATE SCHEMA PUBLIC AUTHORIZATION DBA +ALTER SEQUENCE SYSTEM_LOBS.LOB_ID RESTART WITH 1 +SET DATABASE DEFAULT INITIAL SCHEMA PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.SQL_IDENTIFIER TO PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.YES_OR_NO TO PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.TIME_STAMP TO PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CARDINAL_NUMBER TO PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CHARACTER_DATA TO PUBLIC +GRANT DBA TO SA diff --git a/zhiqim_orm/document/export/V1.5.0.exp.xml b/zhiqim_orm/document/export/V1.5.0.exp.xml new file mode 100644 index 0000000..35adfde --- /dev/null +++ b/zhiqim_orm/document/export/V1.5.0.exp.xml @@ -0,0 +1,15 @@ + +
            +
            + + + + + + + + + + +
            +
            diff --git a/zhiqim_orm/document/export/V1.5.1.exp.xml b/zhiqim_orm/document/export/V1.5.1.exp.xml new file mode 100644 index 0000000..5f7b227 --- /dev/null +++ b/zhiqim_orm/document/export/V1.5.1.exp.xml @@ -0,0 +1,14 @@ + +
            +
            + + + + + + + + + +
            +
            diff --git a/zhiqim_orm/document/metainfo/MANIFEST.MF b/zhiqim_orm/document/metainfo/MANIFEST.MF new file mode 100644 index 0000000..f9ea420 --- /dev/null +++ b/zhiqim_orm/document/metainfo/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: ZhiqimORM +Bundle-SymbolicName: zhiqim_orm +Bundle-Version: 1.5.0 +Export-Package: org.zhiqim.orm, + org.zhiqim.orm.annotation, + org.zhiqim.orm.config, + org.zhiqim.orm.datasource, + org.zhiqim.orm.dbo, + org.zhiqim.orm.dbo.condition, + org.zhiqim.orm.dbo.defined, + org.zhiqim.orm.executor, + org.zhiqim.orm.policy +Require-Bundle: zhiqim +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/zhiqim_orm/document/metainfo/version.txt b/zhiqim_orm/document/metainfo/version.txt new file mode 100644 index 0000000..bbc76ae --- /dev/null +++ b/zhiqim_orm/document/metainfo/version.txt @@ -0,0 +1,90 @@ +V1.0.1.R2014022701 + 1)版本创建、整理 + 2)版本内部发布测试 + 3)版本内部测试完成,发布 +V1.0.3.R2014060101 + 1)20140521修改"初始化DBO和STMT失败",改成"初始化DBO和SQL失败" + 2)20140521增加FREL对表是否存在进行检查,如果不存在则创建加入缓存,下次认为存在 + 3)20140527增加Updater时对表达式的支持如updater.addFieldExpression("buyNum", "buyNum+1");表示在原值上加1 + 4)20140601修改FDBOExecutor.create中对replace表的BUG。原没有作replaceMap处理 +V1.0.5.R2014081201 + 1)fadfox.jar增加JSON功能和HTTPC功能,涉及到ORM要求调整 + 2)对返回的ArrayList数据,作timeToSize()处理,优化内存 + 3)修改ORMServer中对多例配置的错误 +V1.0.6.R2015011201 + 1)调整StringBuffer成StringBuilder + 2)修改TransactionManager.beginTransaction()方法为获取第一个ORMServer,以前有BUG,并增加通过index和name获取ORMServer + 3)修改FDBOExecutor中FDBO["+dbo.getName()+"]配置中未找到["+field.getField()+"]字段,的描述,原来的表达不正确 + 4)fadfox.jar调整DateTimes类方法,有影响,要求版本在V1.0.6R2015011201以上 +V1.0.7.R2015052501 + 1)拆分FDataSource中getConnection时同步锁connList为两步,防止锁太大带来死锁 + 2)支持连接耗尽时,配置等待时长和重试次数,系统默认是5秒和1次 + 3)修改等待时长打印日志的错误 + 4)fadfox.jar修改了queryEndsWithFile方法 +V1.1.0.R2015072901 + 1)根据fadfox整理成统一该版本 +V1.1.1.R2015091401版本: + 1)使用JDK1.7编译,增加ORMServer加载.xml时文件时否存在检查 +V1.1.2.R2015102601 + 1)要求使用V1.1.2版本的fadfox.jar + 2)修改FDbo为FTable,后期进行调整 + 3)修改for调用方式,合并Documents到Xmlx中 +V1.1.3.R2016020301 + 1)春节前整理版本号 + 2)根据FTimer改动修改的版本 +V1.2.0.R2016072101 + 1)调整FSQL配置,删除原来的,改成content,更简单且更好理解 + 2)调整FSQL实现,对配置中删除的param和result两个配置,改成通过实时传入验证 + 3)调整FDBO成FTable,类似于表,更好记和理解 + 4)调整FREHL成FView,类似于视图,更好记和理解 + 5)调整Selector和Updater中的addWhere成addMaybe,表示如果且为null就不作为条件,与addMust必须不能为空,更好理解。 + 6)修改原throw new IlleglParameterException为throw Asserts.exception()和Asserts.asserts() +V1.2.1.R2016100801 + 1)增加对SQLite的支持,删除对Access的支持 + 2)修改SQL文件加载方式,以前是在classpath逐个查找,可能会碰到类或jar不允许加载,修改为通过orm.sql进行配置,配置支持file,folder,classpath,package四种 + 3)增加policy接口,以便支持6种数据库的适配 +V1.2.2.R2017010101 + 1)配合fadfox.jar调整HashMap为FHashMapSO + 2)增加FTabler对非持久化表(运行时增加的表)处理 + 3)增加FSQLer对DDL语句的处理,如修改表名,修改列名,修改列类型,增删列 +V1.3.0.R2017022701 + 1)增加insertOrUpdate方法,是mysql特有的根据条件指定更新一些字段,而replace是更新所有字段 + 2)增加list读取指定位置的数据,支持pageNo和pageSize两个参数 + 3)增加对selector和updater的字段值和数据库要求进行强制检查,不一致不允许操作 + 4)增加对自连表、多表关联的视图时的别名的支持 + 5)修改判断字段的值是否合法,增加允许为null时传入null值 +V1.3.1.R2017052801 + 1)修改Asserts.asserts为Asserts.as()方法,使用三目运算断言,防止断言为真时需要初始化无意义的断言失败字符串 + 2)增加ORMI18n类,实现国际化字符串静态字符串展示,当前用于断言失败字符串 + 3)增加select @@IDENTITY的处理方法Global.get(FSQL.class).identityInt()和identityLong()获取事务线程中的自增ID + 4)修改isValidSelector和isValidUpdater方法,显示错误的字段信息 + 5)修复SQL中转义字符组装SQL时的BUG + 6)修改连接池中,获取连接时,先检查是否活动中,活动中的连接优先跳过,以前是先判断是否有效,可能导致最后一次有效时被删除。 +V1.3.2.R2017080501 + 1)修改boolean型的判断方法,如isTest字段,设置方法为void setTest(boolean isTest),判断方法为boolean isTest() + 2)增加not like的支持,并修改方法中value值为Object,方便传入整型和长整型 + 3)增加orm.cache缓存表类的配置和实现,注意count/sum方法还是直接查数据库,item/list/page查缓存,insert/insertBatch/replace/update/delete更新缓存 + 4)增加FSQL.execute方法对SQLite数据时修改truncate为delete from +V1.3.3.R2017110601 + 1)增加selector表达式条件 + 2)增加selector左右联left join,right jon支持增加条件selector.addJoin(FDbo.class, new Selector("field", value)); + 3)修改原HashMap为FHashMapSO +V1.4.0.R2018010101 + 1)正式启用ZhiqimORM名称,原所有Fadfox改为Zhiqim,原所有fadfox改为zhiqim,原所有FADFOX改为ZHIQIM,原com.zhiqim.fadfox改为org.zhiqim.kernel + 2)修改包结构,整理F前缀,更改ZSQLer为ZDDL + 3)增加MySQL启动时对wait_timeout的检查,要求大于配置的3分钟 + 4)增加ZDDL.toColumnType(String fieldType, String fieldLength) + 5)增加对SQLite的主键修改的独立处理功能 + 6)修改当服务关闭时没有从Global移除ZTable等实例的BUG + 7)Class.forName修改成Classes.forName,防止ClassLoader不准确 +V1.4.1.R2018072501 + 1)优化配置中当maxIdleTime未配置时取maxKeepTime + 2)修改表缓存,支持@AnAlias别名作为key,增加表缓存定时刷新缓存,格式采用scheduler的格式 3)优化表缓存,修改排序不准确的BUG +V1.5.0.R2019010101 + 1)修改工程名为zhiqim_orm,使用zhiqim_kernel_v1.5.0_r2019010101库 + 2)增加IsEmpty和IsNotEmpty条件,由于MySQL中null和空字符串''不相等 + 3)增加存储过程的ZSQL支持,通过CallParam和CallResult传参和读取多结果,结果支持MAP和DBO + 4)修复ORMServer关闭时没有把testConnnectioner关闭的的BUG + 5)修复ZTabler未实现多例模式的BUG(导致多数据库配置失败) + 6)根据zhiqim_kernel修改继承自Tasker到实现Task,Every/Timer修改为Interval,修改为Threadx的处理方式 + 7)执行程序和源码分开打包 \ No newline at end of file diff --git a/zhiqim_orm/document/数据库字典V1.3.dbo b/zhiqim_orm/document/数据库字典V1.3.dbo new file mode 100644 index 0000000..bcb6135 --- /dev/null +++ b/zhiqim_orm/document/数据库字典V1.3.dbo @@ -0,0 +1,129 @@ + + + + +. + */ +]]> + + + + + + + + + + + + + +
            + + + + + + + + + +
            + + + + + +
            + + + + + + +
            + + + + +
            + + + + + + + + + +
            + + + + + + +
            + + + +
            + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            \ No newline at end of file diff --git a/zhiqim_orm/document/问答数据库字典.dbo b/zhiqim_orm/document/问答数据库字典.dbo new file mode 100644 index 0000000..f88a48f --- /dev/null +++ b/zhiqim_orm/document/问答数据库字典.dbo @@ -0,0 +1,106 @@ + + + + +. + */ +]]> + + + + + + + + + + + + + + +
            + + + + + + + + +
            + + + + + + + + + +
            + + + + +
            + + + + + +
            + +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            \ No newline at end of file diff --git a/zhiqim_orm/lib/zhiqim.jar b/zhiqim_orm/lib/zhiqim.jar new file mode 100644 index 0000000..3ddac43 Binary files /dev/null and b/zhiqim_orm/lib/zhiqim.jar differ diff --git a/zhiqim_orm/libext/hsqldb.jar b/zhiqim_orm/libext/hsqldb.jar new file mode 100644 index 0000000..71d39c3 Binary files /dev/null and b/zhiqim_orm/libext/hsqldb.jar differ diff --git a/zhiqim_orm/libext/ojdbc14.jar b/zhiqim_orm/libext/ojdbc14.jar new file mode 100644 index 0000000..3979ee7 Binary files /dev/null and b/zhiqim_orm/libext/ojdbc14.jar differ diff --git a/zhiqim_orm/libext/postgresql-9.4.1211.jre7.jar b/zhiqim_orm/libext/postgresql-9.4.1211.jre7.jar new file mode 100644 index 0000000..22361e7 Binary files /dev/null and b/zhiqim_orm/libext/postgresql-9.4.1211.jre7.jar differ diff --git a/zhiqim_orm/libext/sqljdbc4.jar b/zhiqim_orm/libext/sqljdbc4.jar new file mode 100644 index 0000000..b26b1ec Binary files /dev/null and b/zhiqim_orm/libext/sqljdbc4.jar differ diff --git a/zhiqim_orm/libext/zhiqim_mysql5.0.8.jar b/zhiqim_orm/libext/zhiqim_mysql5.0.8.jar new file mode 100644 index 0000000..d63b38f Binary files /dev/null and b/zhiqim_orm/libext/zhiqim_mysql5.0.8.jar differ diff --git a/zhiqim_orm/libext/zhiqim_sqlite3.8.6_native.jar b/zhiqim_orm/libext/zhiqim_sqlite3.8.6_native.jar new file mode 100644 index 0000000..fe91f24 Binary files /dev/null and b/zhiqim_orm/libext/zhiqim_sqlite3.8.6_native.jar differ diff --git a/zhiqim_orm/libsrc/zhiqim-src.jar b/zhiqim_orm/libsrc/zhiqim-src.jar new file mode 100644 index 0000000..2f6de02 Binary files /dev/null and b/zhiqim_orm/libsrc/zhiqim-src.jar differ diff --git a/zhiqim_orm/sql/orm3.sql.xml b/zhiqim_orm/sql/orm3.sql.xml new file mode 100644 index 0000000..45844fd --- /dev/null +++ b/zhiqim_orm/sql/orm3.sql.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_orm/src/org/zhiqim/orm/ORM.java b/zhiqim_orm/src/org/zhiqim/orm/ORM.java new file mode 100644 index 0000000..a302c09 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ORM.java @@ -0,0 +1,270 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.control.Configurable; +import org.zhiqim.kernel.util.Asserts; + +/** + * ORM工具类,简化获取ORMServer的方法 + * + * @version v1.0.0 @author zouzhigang 2018-11-26 新建与整理 + */ +@AnAlias("ORM") +public class ORM implements ORMConstants +{ + /***********************************************************************************/ + //ORM通用对象 + /***********************************************************************************/ + + /** 获取ORM中的第一个对象 */ + public static T get(Class cls) + { + return get(cls, 0); + } + + /** 获取ORM中指定可配置对象 */ + public static T get(Class cls, Configurable config) + { + return get(cls, config.getConfiguration()); + } + + /** 获取ORM中指定ID的对象 */ + @SuppressWarnings("unchecked") + public static T get(Class cls, String id) + { + if (cls == ZTable.class) + return (T)table(id); + else if (cls == ZView.class) + return (T)view(id); + else if (cls == ZSQL.class) + return (T)sql(id); + else if (cls == ZDDL.class) + return (T)ddl(id); + else if (cls == ZTabler.class) + return (T)tabler(id); + else if (cls == ORMServer.class) + return (T)server(id); + else + throw Asserts.exception("不支持的ORM对象"); + } + + /** 获取ORM中指定索引的对象 */ + @SuppressWarnings("unchecked") + public static T get(Class cls, int idx) + { + if (cls == ZTable.class) + return (T)table(idx); + else if (cls == ZView.class) + return (T)view(idx); + else if (cls == ZSQL.class) + return (T)sql(idx); + else if (cls == ZDDL.class) + return (T)ddl(idx); + else if (cls == ZTabler.class) + return (T)tabler(idx); + else if (cls == ORMServer.class) + return (T)server(idx); + else + throw Asserts.exception("不支持的ORM对象"); + } + + /***********************************************************************************/ + //ORM服务对象 + /***********************************************************************************/ + + /** 获取第一个ORM服务 */ + public static ORMServer server() + { + return Global.getService(ORMServer.class); + } + + /** 获取指定ID的ORM服务 */ + public static ORMServer server(String id) + { + return Global.getService(ORMServer.class, id); + } + + /** 获取指定索引的ORM服务 */ + public static ORMServer server(int idx) + { + return Global.getService(ORMServer.class, idx); + } + + /** 获取指定可配置对象的ORM服务 */ + public static ORMServer server(Configurable config) + { + return server(config.getConfiguration()); + } + + /***********************************************************************************/ + //表指令对象 + /***********************************************************************************/ + + /** 获取第一个表指令对象 */ + public static ZTable table() + { + return Global.getService(ORMServer.class).table(); + } + + /** 获取指定ID的表指令对象 */ + public static ZTable table(String id) + { + return Global.getService(ORMServer.class, id).table(); + } + + /** 获取指定索引的表指令对象 */ + public static ZTable table(int idx) + { + return Global.getService(ORMServer.class, idx).table(); + } + + /** 获取指定可配置对象的表指令对象 */ + public static ZTable table(Configurable config) + { + return table(config.getConfiguration()); + } + + /***********************************************************************************/ + //视图指令对象 + /***********************************************************************************/ + + /** 获取第一个视图指令对象 */ + public static ZView view() + { + return Global.getService(ORMServer.class).view(); + } + + /** 获取指定ID的视图指令对象 */ + public static ZView view(String id) + { + return Global.getService(ORMServer.class, id).view(); + } + + /** 获取指定索引的视图指令对象 */ + public static ZView view(int idx) + { + return Global.getService(ORMServer.class, idx).view(); + } + + /** 获取指定可配置对象的视图指令对象 */ + public static ZView view(Configurable config) + { + return view(config.getConfiguration()); + } + + /***********************************************************************************/ + //SQL指令对象 + /***********************************************************************************/ + + /** 获取第一个SQL指令对象 */ + public static ZSQL sql() + { + return Global.getService(ORMServer.class).sql(); + } + + /** 获取指定ID的SQL指令对象 */ + public static ZSQL sql(String id) + { + return Global.getService(ORMServer.class, id).sql(); + } + + /** 获取指定索引的SQL指令对象 */ + public static ZSQL sql(int idx) + { + return Global.getService(ORMServer.class, idx).sql(); + } + + /** 获取指定可配置对象的SQL指令对象 */ + public static ZSQL sql(Configurable config) + { + return sql(config.getConfiguration()); + } + + /***********************************************************************************/ + //DDL指令对象 + /***********************************************************************************/ + + /** 获取第一个DDL指令对象 */ + public static ZDDL ddl() + { + return Global.getService(ORMServer.class).ddl(); + } + + /** 获取指定ID的DDL指令对象 */ + public static ZDDL ddl(String id) + { + return Global.getService(ORMServer.class, id).ddl(); + } + + /** 获取指定索引的DDL指令对象 */ + public static ZDDL ddl(int idx) + { + return Global.getService(ORMServer.class, idx).ddl(); + } + + /** 获取指定可配置对象的DDL指令对象 */ + public static ZDDL ddl(Configurable config) + { + return ddl(config.getConfiguration()); + } + + /***********************************************************************************/ + //表管理指令对象 + /***********************************************************************************/ + + /** 获取第一个表管理指令对象 */ + public static ZTabler tabler() + { + return Global.getService(ORMServer.class).tabler(); + } + + /** 获取指定ID的表管理指令对象 */ + public static ZTabler tabler(String id) + { + return Global.getService(ORMServer.class, id).tabler(); + } + + /** 获取指定索引的表管理指令对象 */ + public static ZTabler tabler(int idx) + { + return Global.getService(ORMServer.class, idx).tabler(); + } + + /** 获取指定可配置对象的表管理指令对象 */ + public static ZTabler tabler(Configurable config) + { + return tabler(config.getConfiguration()); + } + + /***********************************************************************************/ + //表批量处理 + /***********************************************************************************/ + + public static int[] batch() + { + + return null; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ORMConstants.java b/zhiqim_orm/src/org/zhiqim/orm/ORMConstants.java new file mode 100644 index 0000000..4cc1844 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ORMConstants.java @@ -0,0 +1,149 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import org.zhiqim.kernel.constants.CodeConstants; +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.constants.TypeConstants; +import org.zhiqim.kernel.util.consts.Int; + +/** + * ORM常量定义 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface ORMConstants extends SignConstants, TypeConstants, CodeConstants +{ + public enum CALL_TYPE {IN, INOUT, OUT}; + + /*****************************************************************************/ + //目前支持的6种数据库类型 + /*****************************************************************************/ + + public String Z_ORM_ID = "orm.id"; + + public Int Z_ORM_MYSQL = new Int(1, "mysql"); + public Int Z_ORM_ORACLE = new Int(2, "oracle"); + public Int Z_ORM_MSSQL = new Int(3, "mssql"); + public Int Z_ORM_PSQL = new Int(4, "postgresql"); + public Int Z_ORM_SQLITE = new Int(5, "sqlite"); + public Int Z_ORM_HSQL = new Int(6, "hsql"); + + public int Z_ORM_MYSQL_INT = 1; + public int Z_ORM_ORACLE_INT = 2; + public int Z_ORM_MSSQL_INT = 3; + public int Z_ORM_PSQL_INT = 4; + public int Z_ORM_SQLITE_INT = 5; + public int Z_ORM_HSQL_INT = 6; + + /*****************************************************************************/ + //目前支持的9种列类型 + /*****************************************************************************/ + + public Int Z_ORM_STRING = new Int(1, "string"); + public Int Z_ORM_INT = new Int(2, "int"); + public Int Z_ORM_LONG = new Int(3, "long"); + + public Int Z_ORM_BOOLEAN = new Int(4, "boolean"); + public Int Z_ORM_BYTE = new Int(5, "byte"); + public Int Z_ORM_SHORT = new Int(6, "short"); + + public Int Z_ORM_DATETIME = new Int(7, "datetime"); + public Int Z_ORM_DECIMAL = new Int(8, "decimal"); + public Int Z_ORM_BINARY = new Int(9, "binary"); + + public int Z_ORM_STRING_INT = 1; + public int Z_ORM_INT_INT = 2; + public int Z_ORM_LONG_INT = 3; + public int Z_ORM_BOOLEAN_INT = 4; + public int Z_ORM_BYTE_INT = 5; + public int Z_ORM_SHORT_INT = 6; + public int Z_ORM_DATETIME_INT = 7; + public int Z_ORM_DECIMAL_INT = 8; + public int Z_ORM_BINARY_INT = 9; + + /*****************************************************************************/ + //zhiqim-sql配置信息 + /*****************************************************************************/ + + public String Z_SQL_CONFIG_DTD_PUBLIC_ID = "-//ZHIQIM //DTD Zhiqim-Sql Configuration 1.5.0//EN"; + public String Z_SQL_CONFIG_DTD_PATH = "/org/zhiqim/orm/config/zhiqim_sql_1_5_0.dtd"; + public String Z_SQL_CONFIG_DTD_URL = "http://zhiqim.org/xmldtds/zhiqim_sql_1_5_0.dtd"; + + public String Z_SQL_CONFIG_XML_DOCTYPE = ""; + + public String Z_SQL_CONFIG_XML_HEAD = ""; + public String Z_SQL_CONFIG_XML_TAIL = ""; + + public String Z_SQL_ENDSWITH = ".sql.xml"; + + //zhiqim-sql所在的位置 + public int Z_SQL_FILE_INT = 0; + public int Z_SQL_FOLDER_INT = 1; + public int Z_SQL_CLASS_INT = 2; + public int Z_SQL_PACKAGE_INT = 3; + + public String Z_SQL_FILE = "file"; + public String Z_SQL_FOLDER = "folder"; + public String Z_SQL_CLASS = "classpath"; + public String Z_SQL_PACKAGE = "package"; + + /*****************************************************************************/ + //SQL条件 + /*****************************************************************************/ + + public int EQUAL = 0;//= 等于 + public int NOT_EQUAL = 1;//<> 不等 + public int OR = 2;//or 否则 + public int LIKE = 10;//'%value%' 两边都LIKE + public int LIKE_LEFT = 11;//'%value' 左LIKE + public int LIKE_RIGHT = 12;//'value%' 右LIKE + public int THEN_G = 21;//> 大于 + public int THEN_GE = 22;//>= 大于等于 + public int THEN_L = 23;//< 小于 + public int THEN_LE = 24;//<= 小于等于 + public int IS_NULL = 31;//is null 为空 + public int IS_NOT_NULL = 32;//is not null 不为空 + public int IN = 33;//in 包含 + public int NOT_IN = 34;//not in 不包含 + + public String ASC = "asc";//顺序 + public String DESC = "desc";//倒序 + + public String JOIN_EQUAL = "EQUAL";//内连接inner join + public String JOIN_LEFT = "LEFT";//左连接left join + public String JOIN_RIGHT = "RIGHT";//右连接right join + + /*****************************************************************************/ + //表是否存在的SQL语句 + /*****************************************************************************/ + + public String T_EXISTS_MYSQL = "select count(*) from information_schema.tables where table_schema='%s' and table_name='%s'"; + public String T_EXISTS_ORACLE = "select count(*) from tab where tabtype='TABLE' and tname='%s'"; + public String T_EXISTS_MSSQL = "select count(*) from sysobjects where type='U' and name='%s'"; + public String T_EXISTS_PSQL = "select count(*) from pg_tables where tablename='%s'"; + public String T_EXISTS_SQLITE = "select count(*) from sqlite_master where type='table' and name='%s'"; + public String T_EXISTS_HSQL = "select count(*) from information_schema.tables where table_name='%s';"; + + public String T_COLUMN_MYSQL = "select COLUMN_TYPE,IS_NULLABLE from information_schema.columns where table_schema=? and table_name=? and column_name=?"; + public String T_SELECT_IDENTITY = "select @@IDENTITY"; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ORMException.java b/zhiqim_orm/src/org/zhiqim/orm/ORMException.java new file mode 100644 index 0000000..b1919e5 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ORMException.java @@ -0,0 +1,64 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import org.zhiqim.kernel.util.Strings; + +/** + * ORM异常定义 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ORMException extends Exception +{ + private static final long serialVersionUID = 1L; + + public ORMException() + { + super(); + } + + public ORMException(String message) + { + super(message); + } + + public ORMException(String message, Object...arguments) + { + super(Strings.format(message, arguments)); + } + + public ORMException(String message, Throwable e) + { + super(message, e); + } + + public ORMException(Throwable e) + { + super(e); + } + + public ORMException(String message, Throwable e, Object...arguments) + { + super(Strings.format(message, arguments), e); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ORMI18n.java b/zhiqim_orm/src/org/zhiqim/orm/ORMI18n.java new file mode 100644 index 0000000..94ff35d --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ORMI18n.java @@ -0,0 +1,50 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import org.zhiqim.kernel.util.Resources; + +/** + * 国际化定义 + * + * @version v1.0.0 @author zouzhigang 2017-6-1 新建与整理 + */ +public class ORMI18n +{ + static + {//初始化静态属性 + Resources.buildStaticProperties(ORMI18n.class); + } + + /** ORM字段类型[%s]不正确 */ + public static String ormFieldTypeIncorrect1; + + /** ORM表[%s]中未找到字段[%s] */ + public static String ormTableNotFoundField2; + + /** ORM视图[%s]中未找到表[%s] */ + public static String ormViewNotFountTable2; + + /** ORM视图[%s]中未找到字段[%s] */ + public static String ormViewNotFoundField2; + +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ORMI18n.properties b/zhiqim_orm/src/org/zhiqim/orm/ORMI18n.properties new file mode 100644 index 0000000..de80308 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ORMI18n.properties @@ -0,0 +1,5 @@ +# +ormFieldTypeIncorrect1=ORM\u5B57\u6BB5\u7C7B\u578B[%s]\u4E0D\u6B63\u786E +ormTableNotFoundField2=ORM\u8868[%s]\u4E2D\u672A\u627E\u5230\u5B57\u6BB5[%s] +ormViewNotFountTable2=ORM\u89C6\u56FE[%s]\u4E2D\u672A\u627E\u5230\u8868[%s] +ormViewNotFoundField2=ORM\u89C6\u56FE[%s]\u4E2D\u672A\u627E\u5230\u5B57\u6BB5[%s] \ No newline at end of file diff --git a/zhiqim_orm/src/org/zhiqim/orm/ORMParameter.java b/zhiqim_orm/src/org/zhiqim/orm/ORMParameter.java new file mode 100644 index 0000000..d9f779b --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ORMParameter.java @@ -0,0 +1,472 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import java.io.File; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.config.Group; +import org.zhiqim.kernel.config.Item; +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.extend.HashMapSV; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Resources; +import org.zhiqim.kernel.util.Systems; +import org.zhiqim.kernel.util.codes.Base64; +import org.zhiqim.kernel.util.codes.HEX; +import org.zhiqim.orm.datasource.ZDataSource; + +/** + * ORM服务需要配置的参数 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ORMParameter implements ORMConstants +{ + private String id; + + //必填五项 + private String dbType; + private String driver; + private String url; + private String user; + private String pass; + private int level; + + //常用配置三项 + private int minPoolSize = 2; + private int maxPoolSize = 10; + private int maxKeepTime = 7001; + + //连接时效两项 + private int maxIdleTime = 7001; + + //密码类型 + private String passType = null; + + //检查连接三项 + private boolean isChkConnOnTimer = false; + private boolean isChkConnOnGet = false; + private boolean isChkConnOnRelease = false; + + //耗尽重试两项 + private int outOfConnWaitTime = 5; + private int outOfConnRetryCount = 1; + + //SQL输出日志两项 + private boolean isUpdateSqlLog = false; + private boolean isQuerySqlLog = false; + + //sql文件表 + private HashMapSV sqlMap = new HashMapSV<>(); + private HashMapSS cacheMap = new HashMapSS(); + + /***********************************************************************************/ + //构造函数 + /***********************************************************************************/ + + /** 空构造,然后手动设置参数 */ + public ORMParameter() + { + } + + /** 通过配置生成参数对象 */ + public ORMParameter(Group group) + { + this.id = group.getId(); + + //5项必须 + this.dbType = group.getString("dbType"); + this.driver = group.getString("driver"); + this.url = group.getString("url"); + this.user = group.getString("user"); + this.pass = group.getString("pass"); + this.level = group.getInt("level", -1); + + //其他有默认值 + this.passType = group.getString("passType"); + this.minPoolSize = group.getInt("minPoolSize", 2); + this.maxPoolSize = group.getInt("maxPoolSize", 10); + + this.maxKeepTime = group.getInt("maxKeepTime", 7001); + this.maxIdleTime = group.getInt("maxIdleTime", this.maxKeepTime); + this.isChkConnOnTimer = group.isTrue("isChkConnOnTimer", false); + this.isChkConnOnGet = group.isTrue("isChkConnOnGet", false); + this.isChkConnOnRelease = group.isTrue("isChkConnOnRelease", false); + + this.outOfConnWaitTime = group.getInt("outOfConnWaitTime", 5); + this.outOfConnRetryCount = group.getInt("outOfConnRetryCount", 1); + + this.isUpdateSqlLog = group.isTrue("isUpdateSqlLog", false); + this.isQuerySqlLog = group.isTrue("isQuerySqlLog", false); + + //SQL文件 + Group grp = Global.getGroup(group.getId()+".sql"); + if (grp != null) + { + for (Item item : grp.list()) + { + addSqlConfig(item.getKey(), item.getString()); + } + } + + //表缓存 + grp = Global.getGroup(group.getId()+".cache"); + if (grp != null) + { + for (Item item : grp.list()) + { + addCacheConfig(item.getKey(), item.getString()); + } + } + } + + /** 初始化连接池 */ + public ZDataSource newDatabase() + { + //对密码支持简单加密,HEX/Base64两种 + if (_HEX_.equalsIgnoreCase(passType)) + pass = HEX.decrypt(pass); + else if (_BASE64_.equalsIgnoreCase(passType)) + pass = Base64.decodeUTF8(pass); + + return new ZDataSource(id, driver, url, user, pass, level, + minPoolSize, maxPoolSize, maxKeepTime, maxIdleTime, + isChkConnOnTimer, isChkConnOnGet, isChkConnOnRelease, + outOfConnWaitTime, outOfConnRetryCount); + } + + /***********************************************************************************/ + //判断数据库类型 + /***********************************************************************************/ + + /** 获取数据库类型 */ + public int getDatabaseType() + { + return ORMType.getDatabaseType(dbType).value(); + } + + /** 判断是否是Oracle数据库 */ + public boolean isOracle() + { + return getDatabaseType() == Z_ORM_ORACLE.value(); + } + + /** 判断是否是Microsoft SQLServer数据库 */ + public boolean isMssql() + { + return getDatabaseType() == Z_ORM_MSSQL.value(); + } + + /** 判断是否是SQLite数据库 */ + public boolean isSqlite() + { + return getDatabaseType() == Z_ORM_SQLITE.value(); + } + + /** 判断是否是Hsql数据库 */ + public boolean isHsql() + { + return getDatabaseType() == Z_ORM_HSQL.value(); + } + + /** 判断是否是MySql数据库 */ + public boolean isMysql() + { + return getDatabaseType() == Z_ORM_MYSQL.value(); + } + + /** 获取数据库名 */ + public String getDbName() + { + if (isMysql()) + { + if ("jndi".equalsIgnoreCase(driver)) + return user;//JNDI 时配置成用户 + + String dbUrl = url; + int ind = dbUrl.indexOf("?"); + if (ind != -1) + dbUrl = dbUrl.substring(0, ind); + + int ind2 = dbUrl.lastIndexOf("/"); + return dbUrl.substring(ind2+1); + } + + return null; + } + + /***********************************************************************************/ + //SQL文件表 + /***********************************************************************************/ + + public HashMapSV getSqlConfig() + { + return sqlMap; + } + + public void addSqlConfig(String key, String value) + { + int type = Z_SQL_FILE.equals(value)?Z_SQL_FILE_INT: + Z_SQL_FOLDER.equals(value)?Z_SQL_FOLDER_INT: + Z_SQL_CLASS.equals(value)?Z_SQL_CLASS_INT: + Z_SQL_PACKAGE.equals(value)?Z_SQL_PACKAGE_INT:-1; + + addSqlConfig(key, type); + } + + public void addSqlConfig(String key, int type) + { + Asserts.notNull(key, _KEY_); + Asserts.as((type >= 0 && type <= 3)?null:"增加ORM的SQL配置["+key+"]的类型不正确"); + + switch (type) + { + case Z_SQL_FILE_INT: + { + Asserts.as(key.endsWith(Z_SQL_ENDSWITH)?null:"增加ORM的SQL配置["+key+"]必须以[.sql.xml]结尾的SQL配置文件名"); + + File file = new File(key); + Asserts.as((file.isFile() && file.canRead())?null:"增加ORM的SQL配置["+key+"]必须是文件并可读"); + break; + } + case Z_SQL_FOLDER_INT: + { + File folder = new File(key); + Asserts.as((folder.isDirectory() && folder.canRead())?null:"增加ORM的SQL配置["+key+"]必须是文件夹并可读"); + break; + } + case Z_SQL_CLASS_INT: + { + Asserts.as(key.endsWith(Z_SQL_ENDSWITH)?null:"增加ORM的SQL配置["+key+"]必须以[.sql.xml]结尾的SQL配置文件名"); + Asserts.as(Resources.exists(ORMServer.class, key)?null:"增加ORM的SQL配置["+key+"]必须是文件并可读"); + break; + } + case Z_SQL_PACKAGE_INT: + { + Asserts.as(Resources.exists(ORMServer.class, key)?null:"增加ORM的SQL配置["+key+"]必须是存在"); + break; + } + } + + key = Systems.replacePropertyPath(key); + sqlMap.put(key, type); + } + + /***********************************************************************************/ + //Cache配置表 + /***********************************************************************************/ + + public void addCacheConfig(String key, String value) + { + cacheMap.put(key, value); + } + + public HashMapSS getCacheConfig() + { + return cacheMap; + } + + /***********************************************************************************/ + //参数的设置和获取 + /***********************************************************************************/ + + public String getDbType() + { + return dbType; + } + + public void setDbType(String dbType) + { + this.dbType = dbType; + } + + public boolean isUpdateSqlLog() + { + return isUpdateSqlLog; + } + + public void setUpdateSqlLog(boolean isUpdateSqlLog) + { + this.isUpdateSqlLog = isUpdateSqlLog; + } + + public boolean isQuerySqlLog() + { + return isQuerySqlLog; + } + + public void setQuerySqlLog(boolean isQuerySqlLog) + { + this.isQuerySqlLog = isQuerySqlLog; + } + + public String getDriver() + { + return driver; + } + + public void setDriver(String driver) + { + this.driver = driver; + } + + public String getUrl() + { + return url; + } + + public void setUrl(String url) + { + this.url = url; + } + + public String getUser() + { + return user; + } + + public void setUser(String user) + { + this.user = user; + } + + public String getPass() + { + return pass; + } + + public void setPass(String pass) + { + this.pass = pass; + } + + public String getPassType() + { + return passType; + } + + public void setPassType(String passType) + { + this.passType = passType; + } + + public int getLevel() + { + return level; + } + + public void setLevel(int level) + { + this.level = level; + } + + public int getMinPoolSize() + { + return minPoolSize; + } + + public void setMinPoolSize(int minPoolSize) + { + this.minPoolSize = minPoolSize; + } + + public int getMaxPoolSize() + { + return maxPoolSize; + } + + public void setMaxPoolSize(int maxPoolSize) + { + this.maxPoolSize = maxPoolSize; + } + + public int getMaxKeepTime() + { + return maxKeepTime; + } + + public void setMaxKeepTime(int maxKeepTime) + { + this.maxKeepTime = maxKeepTime; + } + + public int getMaxIdleTime() + { + return maxIdleTime; + } + + public void setMaxIdleTime(int maxIdleTime) + { + this.maxIdleTime = maxIdleTime; + } + + public boolean isChkConnOnTimer() + { + return isChkConnOnTimer; + } + + public void setChkConnOnTimer(boolean isChkConnOnTimer) + { + this.isChkConnOnTimer = isChkConnOnTimer; + } + + public boolean isChkConnOnGet() + { + return isChkConnOnGet; + } + + public void setChkConnOnGet(boolean isChkConnOnGet) + { + this.isChkConnOnGet = isChkConnOnGet; + } + + public boolean isChkConnOnRelease() + { + return isChkConnOnRelease; + } + + public void setChkConnOnRelease(boolean isChkConnOnRelease) + { + this.isChkConnOnRelease = isChkConnOnRelease; + } + + public int getOutOfConnWaitTime() + { + return outOfConnWaitTime; + } + + public void setOutOfConnWaitTime(int outOfConnWaitTime) + { + this.outOfConnWaitTime = outOfConnWaitTime; + } + + public int getOutOfConnRetryCount() + { + return outOfConnRetryCount; + } + + public void setOutOfConnRetryCount(int outOfConnRetryCount) + { + this.outOfConnRetryCount = outOfConnRetryCount; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ORMPolicy.java b/zhiqim_orm/src/org/zhiqim/orm/ORMPolicy.java new file mode 100644 index 0000000..85b9ab7 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ORMPolicy.java @@ -0,0 +1,191 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.dbo.defined._TableField; + +/** + * ORM数据库策略 + * + * @version v1.0.0 @author zouzhigang 2016-9-18 新建与整理 + */ +public interface ORMPolicy extends ORMConstants +{ + /** + * 检查保持时长是否正确 + * + * @param maxKeepTime 保持时长 + * @return =true正确,数据库定义的比该值大 + */ + public boolean chkKeepTime(int maxKeepTime); + + /** + * 生成表是否存在的SQL + * + * @param databaseName 数据库名 + * @param tableName 表名 + * @return SQL语句 + */ + public String toExistsSQL(String databaseName, String tableName); + + /** + * 增加表的一列,支持类型和是否为null + * + * @param table 表名 + * @param column 列名 + * @param columnType 列类型 + * @param notNull 是否不允许为null + * @return SQL语句 + */ + public String toAlertColumnAdd(String table, String column, String columnType, boolean notNull); + + /** + * ORM定义的类型,转化为SQL类型,如string,15转化为varchar(15) + * + * @param type ORM定义的类型如string,15 + * @return SQL类型,如varchar(15) + */ + public String toColumnType(String type); + + /** + * 生成字段字符串 + * + * @param field 表字段对象 + * @return 生成字符串 + */ + public String toColumnString(_TableField field); + + /** + * 生成创建表字符串 + * + * @param _table 表对象 + * @param replaceMap 可替换表 + * @return 得到创建表的SQL列表 + */ + public List toTableString(_Table _table, MapSS replaceMap); + + /** + * 生成查询一条数据的SQL语句 + * + * @param fieldSQL 字段SQL + * @param tableName 表名 + * @param whereSQL 条件SQL + * @param orderbySQL 排序SQL + * @param groupbySQL 分组SQL + * @return 完整ZSQL + */ + public String toItemSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL); + + /** + * 生成分页显示的SQL语句 + * + * @param fieldSQL 字段SQL + * @param tableName 表名 + * @param whereSQL 条件SQL + * @param orderbySQL 排序SQL + * @param groupbySQL 分组SQL + * @param maxNum 最大数目 + * @param pageNo 页码 + * @return 完整SQL + */ + public String toPageSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL, int maxNum, int pageNo); + + /** + * 生成视图关联分页显示的SQL语句 + * + * @param innerTableSQL 内部表SQL + * @param maxNum 最大数目 + * @param pageNo 页码 + * @return 完整ZSQL + */ + public String toPageViewSQL(StringBuilder innerTableSQL, int maxNum, int pageNo); + + /**************************************************************************************************/ + //不同的数据库处理 + /**************************************************************************************************/ + + /** + * 删除表的一列 + * + * @param table 表名 + * @param column 列名 + * @throws SQLException 数据库异常 + */ + public void executeAlertColumnDrop(String table, String column) throws ORMException, SQLException; + + /** + * 修改表的一列值 + * + * @param table 表名 + * @param newColumnType 新类型 + * @param newNotNull 新列是否不为null + * @param ORMException ORM异常 + * @throws SQLException 数据库异常 + */ + public void executeAlertColumnType(String table, String column, String newColumnType, boolean newNotNull) throws ORMException, SQLException; + + /** + * 修改表的一列名 + * + * @param table 表名 + * @param column 列名 + * @param newColumn 新列名 + * @throws ORMException ORM异常 + * @throws SQLException 数据库异常 + */ + public void executeAlertColumnName(String table, String column, String newColumn) throws ORMException, SQLException; + + /** + * 修改表的一列 + * + * @param table 表名 + * @param column 列名 + * @param newColumn 新列名 + * @param newColumnType 新类型 + * @param newNotNull 新列是否不为null + * @throws ORMException ORM异常 + * @throws SQLException 数据库异常 + */ + public void executeAlertColumnInfo(String table, String column, String newColumn, String newColumnType, boolean newNotNull) throws ORMException, SQLException; + + /** + * 增加表的主键 + * + * @param table 表名 + * @param columns 列名,多个用逗号隔开如AAA_AAA,BBB_BBB + * @throws SQLException 数据库异常 + */ + public void executeAlertPrimaryKeyAdd(String table, String columns) throws ORMException, SQLException; + + /** + * 删除表的主键 + * + * @param table 表名 + * @throws SQLException 数据库异常 + */ + public void executeAlertPrimaryKeyDrop(String table) throws ORMException, SQLException; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ORMPredefinded.java b/zhiqim_orm/src/org/zhiqim/orm/ORMPredefinded.java new file mode 100644 index 0000000..43dbf4b --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ORMPredefinded.java @@ -0,0 +1,321 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import java.util.Map; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.Servicer; +import org.zhiqim.kernel.extend.HashMapCV; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.TreeMapSO; +import org.zhiqim.kernel.schedule.TaskThreader; +import org.zhiqim.kernel.util.Types; +import org.zhiqim.orm.annotation.AnDbo; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.dbo.Dbo; +import org.zhiqim.orm.executor.BatchExecutor; +import org.zhiqim.orm.executor.BatchExecutorBase; +import org.zhiqim.orm.executor.BatchExecutorClass; +import org.zhiqim.orm.executor.BatchExecutorMap; +import org.zhiqim.orm.executor.CallExecutor; +import org.zhiqim.orm.executor.QueryExecutor; +import org.zhiqim.orm.executor.QueryExecutorBaseBase; +import org.zhiqim.orm.executor.QueryExecutorBaseClass; +import org.zhiqim.orm.executor.QueryExecutorBaseMap; +import org.zhiqim.orm.executor.QueryExecutorClassBase; +import org.zhiqim.orm.executor.QueryExecutorClassClass; +import org.zhiqim.orm.executor.QueryExecutorClassMap; +import org.zhiqim.orm.executor.QueryExecutorMapBase; +import org.zhiqim.orm.executor.QueryExecutorMapClass; +import org.zhiqim.orm.executor.QueryExecutorMapMap; +import org.zhiqim.orm.executor.UpdateExecutor; +import org.zhiqim.orm.executor.UpdateExecutorBase; +import org.zhiqim.orm.executor.UpdateExecutorClass; +import org.zhiqim.orm.executor.UpdateExecutorMap; +import org.zhiqim.orm.impl.ZDDLImplement; +import org.zhiqim.orm.impl.ZSQLImplement; +import org.zhiqim.orm.impl.ZTableImplement; +import org.zhiqim.orm.impl.ZTablerImplement; +import org.zhiqim.orm.impl.ZViewImplement; + +/** + * ORM预处理,从ORMServer中独立出来一个抽象类,这样ORMServer就不会太大,易管理 + * + * @version v1.0.0 @author zouzhigang 2018-11-26 新建与整理 + */ +public abstract class ORMPredefinded extends Servicer +{ + //SQL处理器 + protected final HashMapCV callMap = new HashMapCV<>(); + protected final HashMapCV updateMap = new HashMapCV<>(); + protected final HashMapCV batchMap = new HashMapCV<>(); + protected final HashMapCV queryMap = new HashMapCV<>(); + + //SQL表和缓存表 + protected final HashMapSS sqlMap = new HashMapSS(); + protected final HashMapCV cacheMap = new HashMapCV<>(); + + //ORM指令对象 + protected ZSQLImplement zSQL; + protected ZDDLImplement zDDL; + protected ZTableImplement zTable; + protected ZTablerImplement zTabler; + protected ZViewImplement zView; + + /***********************************************************************************/ + //ORM预开启&关闭 + /***********************************************************************************/ + + /** 开启 */ + protected void open() + { + //call + callMap.put(CallExecutor.class, new CallExecutor()); + //update + updateMap.put(UpdateExecutorBase.class, new UpdateExecutorBase()); + updateMap.put(UpdateExecutorClass.class, new UpdateExecutorClass()); + updateMap.put(UpdateExecutorMap.class, new UpdateExecutorMap()); + //batch + batchMap.put(BatchExecutorBase.class, new BatchExecutorBase()); + batchMap.put(BatchExecutorClass.class, new BatchExecutorClass()); + batchMap.put(BatchExecutorMap.class, new BatchExecutorMap()); + //query + queryMap.put(QueryExecutorBaseBase.class, new QueryExecutorBaseBase()); + queryMap.put(QueryExecutorBaseClass.class, new QueryExecutorBaseClass()); + queryMap.put(QueryExecutorBaseMap.class, new QueryExecutorBaseMap()); + queryMap.put(QueryExecutorClassBase.class, new QueryExecutorClassBase()); + queryMap.put(QueryExecutorClassClass.class, new QueryExecutorClassClass()); + queryMap.put(QueryExecutorClassMap.class, new QueryExecutorClassMap()); + queryMap.put(QueryExecutorMapBase.class, new QueryExecutorMapBase()); + queryMap.put(QueryExecutorMapClass.class, new QueryExecutorMapClass()); + queryMap.put(QueryExecutorMapMap.class, new QueryExecutorMapMap()); + } + + /** 关闭 */ + protected void close() + { + sqlMap.clear(); + updateMap.clear(); + batchMap.clear(); + queryMap.clear(); + } + + /***********************************************************************************/ + //获取ORM指令对象,目前共5个(sql,ddl,table,tabler,view) + /***********************************************************************************/ + + public ZSQL sql() + { + return zSQL; + } + + public ZDDL ddl() + { + return zDDL; + } + + public ZTable table() + { + return zTable; + } + + public ZView view() + { + return zView; + } + + public ZTabler tabler() + { + return zTabler; + } + + /***********************************************************************************/ + //获取ORM指令对象,目前共5个(sql,ddl,table,tabler,view) + /***********************************************************************************/ + + public String getSQL(String id) + { + return sqlMap.get(id); + } + + public CallExecutor getCallExecutor() + { + return callMap.get(CallExecutor.class); + } + + public UpdateExecutor getUpdateExecutor(Class clazz) + { + return updateMap.get(clazz); + } + + public UpdateExecutor getUpdateExecutor(Object param) + { + if (isParamBase(param)) + {//基本类型和数组 + return updateMap.get(UpdateExecutorBase.class); + } + else if (param instanceof Map || param instanceof MapSO) + {//MAP + return updateMap.get(UpdateExecutorMap.class); + } + else if (this.isDbo(param.getClass())) + {//DBO + return updateMap.get(UpdateExecutorClass.class); + } + else + {//其他的不支持 + return null; + } + } + + public BatchExecutor getBatchExecutor(Object param) + { + if (isParamBase(param)) + {//基本类型和数组 + return batchMap.get(BatchExecutorBase.class); + } + else if (param instanceof Map || param instanceof MapSO) + {//MAP + return batchMap.get(BatchExecutorMap.class); + } + else if (this.isDbo(param.getClass())) + {//DBO + return batchMap.get(BatchExecutorClass.class); + } + else + {//其他的不支持 + return null; + } + } + + public QueryExecutor getQueryExecutor(Object param, Class resultClass) + { + if (isParamBase(param)) + {//基础类型 + if (isResultBase(resultClass)) + return queryMap.get(QueryExecutorBaseBase.class); + + if (resultClass == Map.class || resultClass == MapSO.class || resultClass == HashMapSO.class || resultClass == LinkedMapSO.class || resultClass == TreeMapSO.class) + return queryMap.get(QueryExecutorBaseMap.class); + + if (isDbo(resultClass)) + return queryMap.get(QueryExecutorBaseClass.class); + + return null; + } + + if (param instanceof Map || param instanceof MapSO) + {//MAP + if (isResultBase(resultClass)) + return queryMap.get(QueryExecutorMapBase.class); + + if (resultClass == Map.class || resultClass == MapSO.class || resultClass == HashMapSO.class || resultClass == LinkedMapSO.class || resultClass == TreeMapSO.class) + return queryMap.get(QueryExecutorMapMap.class); + + if (isDbo(resultClass)) + return queryMap.get(QueryExecutorMapClass.class); + + return null; + } + + if (isDbo(param.getClass())) + {//DBO + if (isResultBase(resultClass)) + return queryMap.get(QueryExecutorClassBase.class); + + if (resultClass == Map.class || resultClass == MapSO.class || resultClass == HashMapSO.class || resultClass == LinkedMapSO.class || resultClass == TreeMapSO.class) + return queryMap.get(QueryExecutorClassMap.class); + + if (isDbo(resultClass)) + return queryMap.get(QueryExecutorClassClass.class); + + return null; + } + + return null; + } + + public BatchExecutor getBatchExecutor(Class clazz) + { + return batchMap.get(clazz); + } + + public QueryExecutor getQueryExecutor(Class clazz) + { + return queryMap.get(clazz); + } + + public boolean isParamBase(Object param) + { + return (param == null || param instanceof Integer || param instanceof Long || param instanceof String || Types.isArray(param)); + } + + public boolean isResultBase(Class resultClass) + { + return resultClass == int.class || resultClass == Integer.class || resultClass == long.class || resultClass == Long.class || resultClass == String.class; + } + + public boolean isDbo(String name) + { + return isDbo(Global.forName(name)); + } + + public boolean isDbo(Class clazz) + { + if (clazz == null) + return false; + else if (clazz.isAnnotationPresent(AnTable.class)) + return true; + else if (clazz.isAnnotationPresent(AnView.class)) + return true; + else if (clazz.isAnnotationPresent(AnDbo.class)) + return true; + else + return false; + } + + public Dbo getDbo(String name) + { + Class clazz = Global.forName(name); + if (clazz == null) + return null; + else + return getDbo(clazz); + } + + public Dbo getDbo(Class clazz) + { + if (clazz.isAnnotationPresent(AnTable.class)) + return zTable.getTable(clazz); + else if (clazz.isAnnotationPresent(AnView.class)) + return zView.getView(clazz); + else if (clazz.isAnnotationPresent(AnDbo.class)) + return zSQL.getDbo(clazz); + else + return null; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ORMServer.java b/zhiqim_orm/src/org/zhiqim/orm/ORMServer.java new file mode 100644 index 0000000..be09db9 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ORMServer.java @@ -0,0 +1,376 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.SQLException; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.config.Group; +import org.zhiqim.kernel.extend.HashMapCV; +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.extend.HashMapSV; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.ScheduleFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.schedule.TaskThreader; +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.kernel.transaction.TransactionService; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Resources; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.orm.cache.ZTableCacheTask; +import org.zhiqim.orm.config.ZSQLConfig; +import org.zhiqim.orm.datasource.ZDataSource; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.impl.ZDDLImplement; +import org.zhiqim.orm.impl.ZSQLImplement; +import org.zhiqim.orm.impl.ZTableImplement; +import org.zhiqim.orm.impl.ZTablerImplement; +import org.zhiqim.orm.impl.ZViewImplement; + +/** + * ORM服务器,实现系统定义的服务、多例接口,支持配置创建和手动创建

            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ORMServer extends ORMPredefinded implements TransactionService, ORMConstants +{ + private static final Log log = LogFactory.getLog(ORMServer.class); + + private ORMParameter parameter; + private ORMPolicy policy; + private ZDataSource dataSource; + + /***********************************************************************************/ + //服务创建&销毁 + /***********************************************************************************/ + + @Override /** 服务配置方式创建 */ + public boolean create() throws Exception + { + if (id == null) + return false; + + Group group = Global.getGroup(id); + if (group == null) + return false; + + return create(new ORMParameter(group)); + } + + /** + * 数据库映射服务构造函数,由业务创建,如果配置创建直接调用无参数构造函数 + * + * @param parameter 数据库参数 + * @throws Exception 创建异常 + */ + public boolean create(ORMParameter parameter) throws Exception + { + this.parameter = parameter; + + log.info("初始化[数据库映射:%s]开始...", id); + + //1.判断是否支持的数据库 + String dbType = parameter.getDbType(); + policy = ORMType.getDatabasePolicy(this, dbType); + if (policy == null) + { + log.fatal("不支持的数据库类型[%s]", dbType); + return false; + } + + //2.初始化数据库连接池 + dataSource = parameter.newDatabase(); + if (!dataSource.open()) + { + log.fatal("初始化连接池失败[%s]", dbType); + return false; + } + + //3.开启SQL处理器 + super.open(); + + //4.初始化SQL数据 + if (!isInitSQLMapping()) + { + log.fatal("初始化DBO和SQL失败[%s]", dbType); + return false; + } + + //5.创建指令对象,要注意创建顺序SQL-DDL-Table-View + zSQL = new ZSQLImplement(this); + zDDL = new ZDDLImplement(this); + zTabler = new ZTablerImplement(this); + zTable = new ZTableImplement(this); + zView = new ZViewImplement(this); + + //6.初始化缓存 + initCacheConfig(); + + //7.注册服务到事务管理中 + TransactionManager.addTransactionService(this); + + //8.检查设置的保持时长要求少于数据库设置的时长 + if (!policy.chkKeepTime(parameter.getMaxKeepTime())) + { + log.info("初始化[数据库映射:%s]检查到保持时长小于配置的maxKeepTime+3分钟", id); + return false; + } + + log.info("初始化[数据库映射:%s]完成!!!\r\n", id); + return true; + } + + @Override + public void destroy() throws Exception + { + //从全局对象表和事务管理中移除 + TransactionManager.removeTransactionService(this); + + //关闭SQL处理器 + super.close(); + + //销毁数据源 + if (dataSource != null) + { + dataSource.close(); + dataSource = null; + } + } + + /** 初始化所有.sql.xml文件数据 */ + private boolean isInitSQLMapping() throws Exception + { + HashMapSV sqlConfigMap = parameter.getSqlConfig(); + for (Map.Entry entry : sqlConfigMap.entrySet()) + { + String key = entry.getKey(); + int type = entry.getValue(); + switch (type) + { + case Z_SQL_FILE_INT: + { + addSQLConfig(key, new FileInputStream(key)); + break; + } + case Z_SQL_FOLDER_INT: + { + File folder = new File(key); + File[] fileList = folder.listFiles(); + for (File file : fileList) + { + if (!file.isFile() || !file.canRead()) + continue; + + String name = Files.toLinuxPath(file.getPath()); + if (!name.endsWith(".sql.xml")) + continue; + + addSQLConfig(name, new FileInputStream(file)); + } + + break; + } + case Z_SQL_CLASS_INT: + { + addSQLConfig(key, Resources.getResourceStream(ORMServer.class, key)); + break; + } + case Z_SQL_PACKAGE_INT: + { + List fileList = Resources.getResourceFileNameList(ORMServer.class, key); + for (String name : fileList) + { + if (!name.endsWith(".sql.xml")) + continue; + + String className = Strings.addEndsWith(key, "/") + name; + addSQLConfig(className, Resources.getResourceStream(ORMServer.class, className)); + } + + break; + } + } + } + + return true; + } + + /** 加载SQL到内存表中 */ + private void addSQLConfig(String name, InputStream is) throws Exception + { + ZSQLConfig sqlConfig = new ZSQLConfig(name); + sqlConfig.load(is); + + for (Map.Entry sqlEntry : sqlConfig.getSQLMap().entrySet()) + { + if (sqlMap.containsKey(sqlEntry.getKey())) + throw new ORMException("映射文件:[%s]配置异常,有相同的ID[%s]存在", name, sqlEntry.getKey()); + sqlMap.put(sqlEntry.getKey(), sqlEntry.getValue()); + } + + log.info("映射文件[%s]加载成功", name); + } + + /** 初始化需要缓存的表加载数据到内存 */ + private void initCacheConfig() throws Exception + { + HashMapSS cacheConfigMap = parameter.getCacheConfig(); + for (String className : cacheConfigMap.keySet()) + { + Class clazz = Classes.forName(Global.getClassName(className)); + if (clazz == null) + throw new ORMException("缓存类[%s]配置异常,未找到该类", className); + + _Table table = zTable.getTable(clazz); + if (table == null) + throw new ORMException("缓存类[%s]配置异常,该类不是标准表DBO对象", className); + + Task task = new ZTableCacheTask(zTable, clazz); + MapSS paramMap = Jsons.toMapSS(cacheConfigMap.get(className)); + TaskThreader taskThreader = ScheduleFactory.getTaskThreader(task, paramMap); + if (taskThreader == null) + throw new ORMException("缓存类[%s]配置异常,时钟格式不正常", className); + + cacheMap.put(clazz, taskThreader); + } + + zTable.schedule(); + } + + /***********************************************************************************/ + //获取服务的属性,参数&连接&缓存&事务等 + /***********************************************************************************/ + + /** 获取数据库参数 */ + public ORMParameter getParameter() + { + return parameter; + } + + /** 获取数据库类型 */ + public int getDatabaseType() + { + return parameter.getDatabaseType(); + } + + /** 获取数据库名称 */ + public String getDatabaseName() + { + return parameter.getDbName(); + } + + /** 是否打印更新日志 */ + public boolean isUpdateSqlLog() + { + return parameter.isUpdateSqlLog(); + } + + /** 是否打印查询日志 */ + public boolean isQuerySqlLog() + { + return parameter.isQuerySqlLog(); + } + + /** 判断是否是Oracle数据库 */ + public boolean isOracle() + { + return parameter.isOracle(); + } + + /** 判断是否是Microsoft SQLServer数据库 */ + public boolean isMssql() + { + return parameter.isMssql(); + } + + /** 判断是否是SQLite数据库 */ + public boolean isSqlite() + { + return parameter.isSqlite(); + } + + /** 判断是否是Hsql数据库 */ + public boolean isHsql() + { + return parameter.isHsql(); + } + + /** 判断是否是MySql数据库 */ + public boolean isMysql() + { + return parameter.isMysql(); + } + + /** 获取一个数据库资源 */ + public ZDataSource getDateSource() + { + return dataSource; + } + + /** 获取一个连接 */ + public Connection getConnection() throws SQLException + { + return dataSource.getConnection(); + } + + /** 获取ORM不同数据库的策略封装对象 */ + public ORMPolicy getPolicy() + { + return policy; + } + + /** 判断表是否是缓存表 */ + public boolean isCache(Class clazz) + { + return cacheMap.containsKey(clazz); + } + + /** 获取缓存表 */ + public HashMapCV getCacheMap() + { + return cacheMap; + } + + @Override /** 获取事务实例 */ + public Connection getTransactionInstance() throws SQLException + { + return getConnection(); + } + + @Override /** 开始事务实例 */ + public Transaction beginTransaction(Object instance) throws SQLException + { + return new ORMTransaction(id, (Connection)instance).begin(); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ORMTransaction.java b/zhiqim_orm/src/org/zhiqim/orm/ORMTransaction.java new file mode 100644 index 0000000..eeed679 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ORMTransaction.java @@ -0,0 +1,77 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import java.sql.Connection; +import java.sql.SQLException; + +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionAbstracter; + +/** + * 实现事务接口,包括提交、回滚、关闭以及判断是否已提交和已回滚,该类只由事务管理器创建 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ORMTransaction extends TransactionAbstracter +{ + private Connection conn = null; + private boolean autoCommit = true; + + public ORMTransaction(String id, Connection conn) + { + super(id); + this.conn = conn; + } + + /** 开始一个事务 */ + public Transaction begin() throws SQLException + { + autoCommit = conn.getAutoCommit(); + if (autoCommit) + conn.setAutoCommit(false); + return this; + } + + /** 提交一个事务 */ + public void commit() throws SQLException + { + conn.commit(); + super.setCommitted(); + } + + /** 回滚一个事务 */ + public void rollback() throws SQLException + { + conn.rollback(); + super.setRollbacked(); + } + + /** 关闭一个事务 */ + public void close() throws SQLException + { + conn.setAutoCommit(autoCommit); + conn.close(); + + super.setClosed(); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ORMType.java b/zhiqim_orm/src/org/zhiqim/orm/ORMType.java new file mode 100644 index 0000000..976e052 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ORMType.java @@ -0,0 +1,256 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.LinkedMapSV; +import org.zhiqim.kernel.extend.MapSV; +import org.zhiqim.kernel.util.consts.Int; +import org.zhiqim.orm.policy._HSQL; +import org.zhiqim.orm.policy._MSSQL; +import org.zhiqim.orm.policy._MySQL; +import org.zhiqim.orm.policy._Oracle; +import org.zhiqim.orm.policy._PostgetSQL; +import org.zhiqim.orm.policy._SQLite; + +/** + * ORM支持的数据库类型,当前支持6种,分别为ORACLE|MYSQL|MSSQL|HSQL|SQLite|PostgreSQL + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ORMType implements ORMConstants +{ + private static final MapSV DB_TYPE_MAP = new LinkedMapSV<>(); + private static final MapSV DC_TYPE_MAP = new LinkedMapSV<>(); + + static + { + //支持的6六种数据库类型 + DB_TYPE_MAP.put(Z_ORM_MYSQL.desc(), Z_ORM_MYSQL); + DB_TYPE_MAP.put(Z_ORM_ORACLE.desc(), Z_ORM_ORACLE); + DB_TYPE_MAP.put(Z_ORM_MSSQL.desc(), Z_ORM_MSSQL); + DB_TYPE_MAP.put(Z_ORM_PSQL.desc(), Z_ORM_PSQL); + DB_TYPE_MAP.put(Z_ORM_SQLITE.desc(), Z_ORM_SQLITE); + DB_TYPE_MAP.put(Z_ORM_HSQL.desc(), Z_ORM_HSQL); + + //支持的9种数据字段类型 + DC_TYPE_MAP.put(Z_ORM_STRING.desc(), Z_ORM_STRING); + DC_TYPE_MAP.put(Z_ORM_INT.desc(), Z_ORM_INT); + DC_TYPE_MAP.put(Z_ORM_LONG.desc(), Z_ORM_LONG); + DC_TYPE_MAP.put(Z_ORM_BOOLEAN.desc(), Z_ORM_BOOLEAN); + DC_TYPE_MAP.put(Z_ORM_BYTE.desc(), Z_ORM_BYTE); + DC_TYPE_MAP.put(Z_ORM_SHORT.desc(), Z_ORM_SHORT); + DC_TYPE_MAP.put(Z_ORM_DATETIME.desc(), Z_ORM_DATETIME); + DC_TYPE_MAP.put(Z_ORM_DECIMAL.desc(), Z_ORM_DECIMAL); + DC_TYPE_MAP.put(Z_ORM_BINARY.desc(), Z_ORM_BINARY); + } + + /**********************************************************************/ + //数据库类型 + /**********************************************************************/ + + public static ORMPolicy getDatabasePolicy(ORMServer server, String dbType) + { + Int value = DB_TYPE_MAP.get(dbType); + if (value == null) + return null; + + switch (value.value()) + { + case Z_ORM_MYSQL_INT:return new _MySQL(server); + case Z_ORM_ORACLE_INT:return new _Oracle(server); + case Z_ORM_MSSQL_INT:return new _MSSQL(server); + case Z_ORM_PSQL_INT:return new _PostgetSQL(server); + case Z_ORM_SQLITE_INT:return new _SQLite(server); + case Z_ORM_HSQL_INT:return new _HSQL(server); + + default:return null; + } + } + + public static Int getDatabaseType(String dbType) + { + return DB_TYPE_MAP.get(dbType); + } + + public static boolean isDatabaseTypeSql(String name, String dbType) + { + boolean isSpecified = false; + for (String s : DB_TYPE_MAP.keySet()) + { + if (name.endsWith("." + s + Z_SQL_ENDSWITH)) + { + isSpecified = true; + break; + } + } + + //未特别指定的通用支持 + if (!isSpecified) + return true; + + //指定的则和当前进行匹配 + return name.endsWith("." + dbType + Z_SQL_ENDSWITH); + } + + public static List getDatabaseTypeList() + { + List list = new ArrayList<>(DB_TYPE_MAP.size()); + for (String key : DB_TYPE_MAP.keySet()) + { + list.add(key); + } + return list; + } + + public static String[] getDatabaseTypes() + { + String[] types = new String[DB_TYPE_MAP.size()];int i=0; + for (String key : DB_TYPE_MAP.keySet()) + { + types[i++] = key; + } + return types; + } + + /**********************************************************************/ + //字段类型 + /**********************************************************************/ + + public static boolean isSupportColumn(String columnType) + { + return DC_TYPE_MAP.containsKey(columnType); + } + + public static boolean hasColumnLength(String columnType) + { + Int value = DC_TYPE_MAP.get(columnType); + return value==null?false:hasColumnLength(value.value()); + } + + public static boolean hasColumnLength(int columnType) + { + return (columnType == Z_ORM_STRING_INT || columnType == Z_ORM_DECIMAL_INT); + } + + public static int getColumnTypeMaybeLength(String columnTypeMaybeLength) + { + int ind = columnTypeMaybeLength.indexOf(","); + if (ind == -1) + return getColumnType(columnTypeMaybeLength).value(); + + String ctype = columnTypeMaybeLength.substring(0, ind); + return getColumnType(ctype).value(); + } + + public static Int getColumnType(String columnType) + { + return DC_TYPE_MAP.get(columnType); + } + + public static List getColumnTypeList() + { + List list = new ArrayList<>(DC_TYPE_MAP.size()); + for (String key : DC_TYPE_MAP.keySet()) + { + list.add(key); + } + return list; + } + + public static String[] getColumnTypes() + { + String[] types = new String[DC_TYPE_MAP.size()];int i=0; + for (String key : DC_TYPE_MAP.keySet()) + { + types[i++] = key; + } + return types; + } + + /** + * 把带下划线的名称转为表名,如FMR_PARAM转换为FmrParam + * + * @param name 名称 + * @return 表名 + */ + public static String toUpperName(String name) + { + return name.substring(0, 1).toUpperCase() + toTableFieldName(name.substring(1)); + } + + /** + * 把带下划线的列名转为字段名,如PARAM_NAME转换为paramName + * + * @param name 名称 + * @return 字段名 + */ + public static String toLowerName(String name) + { + return name.substring(0, 1).toLowerCase() + toTableFieldName(name.substring(1)); + } + + /** 去除表名字段名第一个字母的数据处理 */ + private static String toTableFieldName(String name) + { + StringBuilder strb = new StringBuilder(); + + //3.遇到下划线则下一字母大写,遇到$$中间的字母大写,并把$替换成_ + boolean nextWord = false; + boolean nextReplace = false; + + for (int i=0;i. + */ +package org.zhiqim.orm; + +import java.sql.SQLException; + +import org.zhiqim.kernel.MultiInstance; +import org.zhiqim.kernel.annotation.AnAlias; + +/** + * DDL调用,支持(alter)

            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("ZDDL") +public interface ZDDL extends MultiInstance +{ + /*****************************************************/ + //字段和列类型之间的转换 + /*****************************************************/ + + /** + * ORM定义的类型,转化为SQL类型,如string,15转化为varchar(15) + * + * @param type ORM定义的类型如string,15 + * @return SQL类型,如varchar(15) + */ + public String toColumnType(String type); + + /** + * ORM定义的类型,转化为SQL类型,如string,15转化为varchar(15) + * + * @param fieldType ORM定义的类型如string,int + * @param fieldLength ORM定义的类型长度,string和decimal时有效,如19,char | 10,2 + * @return SQL类型,如varchar(15) + */ + public String toColumnType(String fieldType, String fieldLength); + + /*****************************************************/ + //alter DDL语句 + /*****************************************************/ + + /** + * 修改一个表的名称 + * + * @param table 表名 + * @param newTable 新表名 + * @throws SQLException 数据库异常 + */ + public void alterTableName(String table, String newTable) throws SQLException; + + /** + * 增加一个表的一列 + * + * @param table 表名 + * @param column 列名 + * @param columnType 列类型 + * @param notNull 是否允许为null + * @throws SQLException 数据库异常 + */ + public void alterColumnAdd(String table, String column, String columnType, boolean notNull) throws SQLException; + + /** + * 删除一个表的一列 + * + * @param table 表名 + * @param column 列名 + * @throws SQLException 数据库异常 + */ + public void alterColumnDrop(String table, String column) throws ORMException, SQLException; + + /** + * 修改一个表的一列信息 + * + * @param table 表名 + * @param column 列名 + * @param newColumn 新列名 + * @param newColumnType 新列类型 + * @param newNotNull 新列是否不为null + * @throws SQLException 数据库异常 + */ + public void alterColumnInfo(String table, String column, String newColumn, String newColumnType, boolean newNotNull) throws ORMException, SQLException; + + /** + * 修改一个表的列名 + * + * @param table 表名 + * @param column 列名 + * @param newColumn 新列名 + * @throws SQLException 数据库异常 + */ + public void alterColumnName(String table, String column, String newColumn) throws ORMException, SQLException; + + /** + * 修改一个表的一列类型 + * + * @param table 表名 + * @param column 列名 + * @param newType 新类型 + * @throws SQLException 数据库异常 + */ + public void alterColumnType(String table, String column, String newColumnType, boolean newNotNull) throws ORMException, SQLException; + + /** + * 增加表的主键 + * + * @param table 表名 + * @param columns 列名,多个用逗号隔开如AAA_AAA,BBB_BBB + * @throws SQLException 数据库异常 + */ + public void alertPrimaryKeyAdd(String table, String columns) throws ORMException, SQLException; + + /** + * 删除表的主键 + * + * @param table 表名 + * @throws SQLException 数据库异常 + */ + public void alertPrimaryKeyDrop(String table) throws ORMException, SQLException; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ZSQL.java b/zhiqim_orm/src/org/zhiqim/orm/ZSQL.java new file mode 100644 index 0000000..79a486b --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ZSQL.java @@ -0,0 +1,364 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.MultiInstance; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.orm.dbo.CallParam; +import org.zhiqim.orm.dbo.CallResult; + +/** + * 标准SQL调用,支持(executeUpdate, executeBatch, executeQuery)

            + * executeUpdate, 执行更新SQL语句,支持insert,replace,update,delete等
            + * executeBatch, 批量执行更新SQL语句,支持insert,replace,update,delete等
            + * executeQuery, 执行查询SQL语句,
            + * 返回结果可以是boolean,byte,short,int,long,String,Timestamp,double,byte[]等9种类型
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("ZSQL") +public interface ZSQL extends MultiInstance +{ + /************************************************************************************************/ + //select @@IDENTITY 查自增ID + /************************************************************************************************/ + + /** + * 查询当前自增ID值 + * + * @return 整型 + * @throws SQLException 数据库异常 + */ + public int identityInt() throws SQLException; + + /** + * 查询当前自增ID值 + * + * @return 长整型 + * @throws SQLException 数据库异常 + */ + public long identityLong() throws SQLException; + + /************************************************************************************************/ + //exist 查询是否存在表或字段 + /************************************************************************************************/ + + /** + * 查询表是否存在 + * + * @param table 表名 + * @return boolean存在是否 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean existTable(String table) throws ORMException, SQLException; + + /************************************************************************************************/ + //execute + /************************************************************************************************/ + + /** + * 执行标准SQL语句,不带参数,如DDL,DML语句 + * + * @param sql SQL语句 + * @throws SQLException 数据库异常 + */ + public void execute(String sql) throws SQLException; + + /** + * 批执行标准SQL语句,不带参数,如DDL,DML语句 + * + * @param sqlList SQL语句列表 + * @throws SQLException 数据库异常 + */ + public void execute(List sqlList) throws SQLException; + + /************************************************************************************************/ + //executeUpdate + /************************************************************************************************/ + + /** + * 无参数executeUpdate执行 + * + * @param id SQL配置编号 + * @return int 执行条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int executeUpdateId(String id) throws ORMException, SQLException; + + /** + * executeUpdate执行 + * + * @param id SQL配置编号 + * @param param 参数,需和executeUpdate配置对应,否则将报错 + * @return int 执行条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int executeUpdateId(String id, Object param) throws ORMException, SQLException; + + /** + * executeUpdate执行 + * + * @param id SQL配置编号 + * @param param 参数,需和executeUpdate配置对应,否则将报错 + * @param replaceMap 字符替换表 + * @return int 执行条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int executeUpdateId(String id, Object param, MapSS replaceMap) throws ORMException, SQLException; + + /** + * executeUpdate执行 + * + * @param sql SQL语句 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int executeUpdate(String sql) throws ORMException, SQLException; + + /** + * executeUpdate执行 + * + * @param sql SQL语句 + * @param param 参数,需和update配置对应,否则将报错 + * @return int 执行条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int executeUpdate(String sql, Object param) throws ORMException, SQLException; + + /** + * executeUpdate执行 + * + * @param sql SQL语句 + * @param param 参数,需和update配置对应,否则将报错 + * @param replaceMap 字符替换表 + * @return int 执行条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int executeUpdate(String sql, Object param, MapSS replaceMap) throws ORMException, SQLException; + + /************************************************************************************************/ + //executeBatch + /************************************************************************************************/ + + /** + * executeBatch执行 + * + * @param id SQL配置编号 + * @param paramList 参数列表 + * @return int[] 执行结果数组 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] executeBatchId(String id, List paramList) throws ORMException, SQLException; + + /** + * executeBatch执行 + * + * @param id SQL配置编号 + * @param paramList 参数列表 + * @param replaceMap 字符替换表 + * @return int[] 执行结果数组 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] executeBatchId(String id, List paramList, MapSS replaceMap) throws ORMException, SQLException; + + /** + * executeBatch执行 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @return int[] 执行结果数组 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] executeBatch(String sql, List paramList) throws ORMException, SQLException; + + /** + * executeBatch执行 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @param replaceMap 字符替换表 + * @return int[] 执行结果数组 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] executeBatch(String sql, List paramList, MapSS replaceMap) throws ORMException, SQLException; + + /************************************************************************************************/ + //executeQuery + /************************************************************************************************/ + + /** + * executeQuery执行 + * + * @param id SQL配置编号 + * @param resultClass 结果类结构 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQueryId(String id, Class resultClass) throws ORMException, SQLException; + + /** + * executeQuery执行 + * + * @param id SQL配置编号 + * @param resultClass 结果类结构 + * @param param 参数 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQueryId(String id, Class resultClass, Object param) throws ORMException, SQLException; + + /** + * executeQuery执行 + * + * @param id SQL配置编号 + * @param resultClass 结果类结构 + * @param param 参数 + * @param replaceMap 字符替换表 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQueryId(String id, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException; + + /** + * executeQuery执行 + * + * @param sql SQL语句 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQuery(String sql) throws ORMException, SQLException; + + /** + * executeQuery执行 + * + * @param sql SQL语句 + * @param resultClass 结果类结构 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQuery(String sql, Class resultClass) throws ORMException, SQLException; + + /** + * executeQuery执行 + * + * @param sql SQL语句 + * @param resultClass 结果类结构 + * @param param 参数 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQuery(String sql, Class resultClass, Object param) throws ORMException, SQLException; + + /** + * executeQuery执行 + * + * @param sql SQL语句 + * @param resultClass 结果类结构 + * @param param 参数 + * @param replaceMap 字符替换表 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQuery(String sql, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException; + + /************************************************************************************************/ + //call(函数&存储过程调用) + /************************************************************************************************/ + + /** + * call 函数&存储过程执行,无结果集,一般用于函数或count/sum等简单的存储过程 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void call(String sql, List paramList) throws ORMException, SQLException; + + + /** + * call 函数&存储过程执行,支持替换表,无结果集,一般用于函数或count/sum等简单的存储过程 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @param replaceMap 字符替换表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void call(String sql, List paramList, MapSS replaceMap) throws ORMException, SQLException; + + /** + * call 存储过程执行,返回一个结果集 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @param replaceMap 字符替换表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List call(String sql, List paramList, Class resultClass) throws ORMException, SQLException; + + /** + * call 函数&存储过程执行,支持多结果集 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @param resultList 结果集列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void call(String sql, List paramList, List resultList) throws ORMException, SQLException; + + /** + * call 函数&存储过程执行,支持多结果集 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @param resultList 结果集列表 + * @param replaceMap 字符替换表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void call(String sql, List paramList, List resultList, MapSS replaceMap) throws ORMException, SQLException; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ZTable.java b/zhiqim_orm/src/org/zhiqim/orm/ZTable.java new file mode 100644 index 0000000..9552ea0 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ZTable.java @@ -0,0 +1,610 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.MultiInstance; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.dbo.Batcher; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.orm.dbo.defined._Table; + +/** + * 标准类与数据库表映射调用,支持(truncate,exist,insert,replace,update,delete,count,sum,item,list,page)

            + * truncate, 清除表类对应的表
            + * exist, 检查表类对应的表是否存在
            + * create 创建表类对应的表 + * insert, 插入表类对应的表一条数据
            + * replace, 替换表类对应的表一条数据,根据主键
            + * update, 更新表类对应的表一条数据或根据条件更新数据
            + * delete, 删除表类对应的表一条数据或根据条件删除数据
            + * count, 统计表类对应的表数目
            + * sum, 总计表类对应的表数目
            + * item, 查询表类对应的表一条数据,根据主键,或根据条件排序取第一条
            + * list, 查询表类对应的表列表,或根据条件排序
            + * pag, 分页查询表类对应的表列表,指定分页页码和页数目
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + * @version v1.2.0 @author zouzhigang 2016-6-27 修改原类名FDBO为ZTable,正式使用表类名称 + */ +@AnAlias("ZTable") +public interface ZTable extends MultiInstance +{ + /** + * 通过表名获取表对象 + * + * @param tableName 表名 + * @return 表对象 + */ + public _Table getTableByTableName(String tableName); + + /** + * 更新数据到缓存 + * + * @param cls 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void cache(Class cls) throws ORMException, SQLException; + + /** + * 批量处理插入/更新/删除数据 + * + * @param batcherList 批量表 + * @return 响应表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] batch(List batcherList) throws ORMException, SQLException; + + /********************************************************************************************/ + //exist 表是否存在 + /********************************************************************************************/ + + /** + * 是否存在[表类]对应的[实际表] + * + * @param cls 表类 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(Class cls) throws ORMException, SQLException; + + /** + * 是否存在[表类]对应的[实际表]分表编号,支持表名中替换字段指定为$ID$,如LOG_TRACE$ID$ + * + * @param cls 表类 + * @param id 分表编号 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(Class cls, String id) throws ORMException, SQLException; + + /** + * 是否存在[表类]对应的[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param cls 表类 + * @param replaceMap 可替换字段表 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(Class cls, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //create 创建表 + /********************************************************************************************/ + + /** + * 创建[表类]对应的[实际表] + * + * @param cls 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void create(Class cls) throws ORMException, SQLException; + + /** + * 创建[表类]对应的[实际表]ID分表 + * + * @param cls 表类 + * @param id 分表编号 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void create(Class cls, String id) throws ORMException, SQLException; + + /** + * 创建[表类]对应的[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param cls 表类 + * @param replaceMap 可替换字段表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void create(Class cls, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //drop 删除表 + /********************************************************************************************/ + + /** + * 创建[表类]对应的[实际表] + * + * @param cls 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void drop(Class cls) throws ORMException, SQLException; + + /** + * 创建[表类]对应的[实际表]分表 + * + * @param cls 表类 + * @param id 分表编号 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void drop(Class cls, String id) throws ORMException, SQLException; + + /** + * 创建[表类]对应的[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param cls 表类 + * @param replaceMap 可替换字段表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void drop(Class cls, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //truncate 清空表 + /********************************************************************************************/ + + /** + * 清空[表类]对应的[实际表] + * + * @param cls 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(Class cls) throws ORMException, SQLException; + + /** + * 清空[表类]对应的[实际表]分表,支持表名中替换字段指定为$ID$,如LOG_TRACE$ID$ + * + * @param cls 表类 + * @param id 分表编号 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(Class cls, String id) throws ORMException, SQLException; + + /** + * 清空[表类]对应的[实际表],支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param cls 表类 + * @param replaceMap 替换表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(Class cls, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //insert 插入数据 + /********************************************************************************************/ + + /** + * 增加数据,传入标准[表类]对象 + * + * @param data 表对象 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insert(Object data) throws ORMException, SQLException; + + /** + * 增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insert(Object data, MapSS replaceMap) throws ORMException, SQLException; + + /** + * 替换数据,传入标准[表类]对象和更新器(取fieldMap和replaceMap)当存在时指定修改的值 + * + * @param data 表对象 + * @param updater 更新器 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insertOrUpdate(Object data, Updater updater) throws ORMException, SQLException; + + /** + * 批量增加数据 + * + * @param dataList 表对象列表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] insertBatch(List dataList) throws ORMException, SQLException; + + /** + * 批量增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param dataList 表对象列表 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] insertBatch(List dataList, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //replace 替换数据,MYSQL支持,如果有数据先删除后增加 + /********************************************************************************************/ + + /** + * 替换数据,传入标准[表类]对象 + * + * @param data 表对象 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(Object data) throws ORMException, SQLException; + + /** + * 替换数据,支持表或字段中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(Object data, MapSS replaceMap) throws ORMException, SQLException; + + /** + * 批量替换数据 + * + * @param dataList 表对象列表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] replaceBatch(List dataList) throws ORMException, SQLException; + + /** + * 批量替换数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param dataList 表对象列表 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] replaceBatch(List dataList, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //update 更新数据 + /********************************************************************************************/ + + /** + * 更新数据,指定更新器需要更新的字段、条件和可替换表 + * + * @param cls 表类 + * @param updater 更新器 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(Class cls, Updater updater) throws ORMException, SQLException; + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新 + * + * @param data 表对象 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(Object data) throws ORMException, SQLException; + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持可替换表 + * + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(Object data, MapSS replaceMap) throws ORMException, SQLException; + + /********************************************************************************************/ + //delete 删除数据 + /********************************************************************************************/ + + /** + * 删除数据,多个主键时使用 + * + * @param cls 表类 + * @param ids 关键属性为数组,多个主键 + * @return 返回删除数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int delete(Class cls, Object... ids) throws ORMException, SQLException; + + /** + * 删除数据,多个主键时使用 + * + * @param cls 表类 + * @param replaceMap 替换表 + * @param ids 关键属性为数组,多个主键 + * @return 返回删除数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int delete(Class cls, MapSS replaceMap, Object... ids) throws ORMException, SQLException; + + /** + * 删除数据, 根据条件 + * + * @param cls 表类 + * @param selector 对象选择器 + * @return 返回删除数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int delete(Class cls, Selector selector) throws ORMException, SQLException; + + /** + * 批量删除数据,根据主键删除 + * + * @param cls 表名 + * @param idsList 关键属性为数组的列表,多个主键列表 + * @param replaceMap 替换表 + * @return 返回删除结果列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] deleteBatch(Class cls, List idsList) throws ORMException, SQLException; + + /** + * 批量删除数据,根据主键删除 + * + * @param cls 表名 + * @param replaceMap 替换表 + * @param idsList 关键属性为数组的列表,多个主键列表 + * @return 返回删除结果列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] deleteBatch(Class cls, MapSS replaceMap, List idsList) throws ORMException, SQLException; + + /********************************************************************************************/ + //count 查询数目 + /********************************************************************************************/ + + /** + * 查询数目,多个主键时使用 + * + * @param cls 表类 + * @param ids 关键属性值,支持多个 + * @return 存在的数目 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class cls, Object... ids) throws ORMException, SQLException; + + /** + * 查询数目,整表查询 + * + * @param cls 表类 + * @return int 数目值 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class cls) throws ORMException, SQLException; + + /** + * 查询数目,根据条件、可替换表查询 + * + * @param cls 表类 + * @param selector 对象查询器 + * @return int 数目值 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class cls, Selector selector)throws ORMException, SQLException; + + /********************************************************************************************/ + //sum 计算总和 + /********************************************************************************************/ + + /** + * 计算总和 + * + * @param cls 表类 + * @param field 表字段 + * @return 计算总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(Class cls, String field) throws ORMException, SQLException; + + /** + * 计算总和 + * + * @param cls 表类 + * @param selector 对象查询器 + * @param field 表字段 + * @return 计算总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(Class cls, Selector selector, String field) throws ORMException, SQLException; + + /** + * 计算多个总和 + * + * @param cls 表类 + * @param selector 对象查询器 + * @param fields 多个表字段 + * @return 计算多个总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long[] sum(Class cls, Selector selector, String... fields) throws ORMException, SQLException; + + /********************************************************************************************/ + //item 查询一条数据 + /********************************************************************************************/ + + /** + * 查询一个表对象,支持多个主键 + * + * @param cls 表类 + * @param ids 关键属性值 + * @return 返回表对象 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public T item(Class cls, Object... ids) throws ORMException, SQLException; + + /** + * 查询一个表对象,并指定返回属性,查询第一行 + * + * @param cls 表类 + * @return 返回表对象 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public T item(Class cls) throws ORMException, SQLException; + + /** + * 查询一个表对象,并指定返回属性,查询条件和排序条件 + * + * @param cls 表类 + * @param selector 对象查询器 + * @return 返回表对象 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public T item(Class cls, Selector selector) throws ORMException, SQLException; + + /********************************************************************************************/ + //list 查询列表 + /********************************************************************************************/ + + /** + * 查询表对象列表,全表查询 + * + * @param cls 表类 + * @return 返回表对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(Class cls) throws ORMException, SQLException; + + /** + * 查询表对象列表,并指定返回属性,查询条件和排序条件 + * + * @param cls 表类 + * @param selector 对象查询器 + * @return 返回表对象列表 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public List list(Class cls, Selector selector) throws ORMException, SQLException; + + /** + * 查询表对象列表,查询指定的位置的数据 + * + * @param cls 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 返回表对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(Class cls, int pageNo, int pageSize) throws ORMException, SQLException; + + /** + * 查询表对象列表,并指定位置的,条件和排序条件 + * + * @param cls 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 对象查询器 + * @return 返回表对象列表 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public List list(Class cls, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException; + + /********************************************************************************************/ + //page 分页显示 + /********************************************************************************************/ + + /** + * 查询表对象分页信息 + * + * @param cls 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(Class cls, int pageNo, int pageSize) throws ORMException, SQLException; + + /** + * 查询表对象分页信息 + * + * @param cls 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 对象查询器 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(Class cls, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException; + +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ZTabler.java b/zhiqim_orm/src/org/zhiqim/orm/ZTabler.java new file mode 100644 index 0000000..e4d7ca6 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ZTabler.java @@ -0,0 +1,631 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.MultiInstance; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.orm.dbo.defined._Table; + +/** + * 自建表与数据库表映射调用 + * + * @version v1.0.0 @author zouzhigang 2016-10-26 新建与整理 + */ +@AnAlias("ZTabler") +public interface ZTabler extends MultiInstance +{ + /**************************************************************************/ + //exist 表是否存在 + /**************************************************************************/ + + /** + * 是否存在[实际表]可替换表 + * + * @param table 表类 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(_Table _table) throws ORMException, SQLException; + + /** + * 是否存在[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param table 表类 + * @param replaceMap 可替换字段表 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(_Table table, MapSS replaceMap) throws ORMException, SQLException; + + /**************************************************************************/ + //create 创建表 + /**************************************************************************/ + + /** + * 创建[实际表]可替换表 + * + * @param _table 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void create(_Table _table) throws ORMException, SQLException; + + /** + * 创建[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表类 + * @param replaceMap 可替换字段表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void create(_Table _table, MapSS replaceMap) throws ORMException, SQLException; + + /**************************************************************************/ + //drop 删除表 + /**************************************************************************/ + + /** + * 删除[实际表]可替换表 + * + * @param _table 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void drop(_Table _table) throws ORMException, SQLException; + + /** + * 删除[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表类 + * @param replaceMap 可替换字段表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void drop(_Table _table, MapSS replaceMap) throws ORMException, SQLException; + + /**************************************************************************/ + //truncate 清空表 + /**************************************************************************/ + + /** + * 清空[实际表] + * + * @param _table 表对象 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(_Table _table) throws ORMException, SQLException; + + /** + * 清空[实际表],支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表对象 + * @param replaceMap 替换表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(_Table _table, MapSS replaceMap) throws ORMException, SQLException; + + /**************************************************************************/ + //insert 插入数据 + /**************************************************************************/ + + /** + * 增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表定义对象 + * @param data 表数据对象 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insert(_Table _table, LinkedMapSO data) throws ORMException, SQLException; + + /** + * 增加数据,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$ + * + * @param _table 表定义对象 + * @param data 表类 + * @param month 月份 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insertMonth(_Table _table, LinkedMapSO data, String month) throws ORMException, SQLException; + + /** + * 增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表定义对象 + * @param data 表数据对象 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insert(_Table _table, LinkedMapSO data, MapSS replaceMap) throws ORMException, SQLException; + + /** + * 替换数据,传入标准[表类]对象和更新器(取fieldMap和replaceMap)当存在时指定修改的值 + * + * @param _table 表定义对象 + * @param data 表对象 + * @param updater 更新器 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insertOrUpdate(_Table _table, LinkedMapSO data, Updater updater) throws ORMException, SQLException; + + /** + * 批量增加数据 + * + * @param _table 表定义对象 + * @param dataList 表对象列表 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] insertBatch(_Table _table, List dataList) throws ORMException, SQLException; + + /** + * 批量增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表定义对象 + * @param dataList 表对象列表 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] insertBatch(_Table _table, List dataList, MapSS replaceMap) throws ORMException, SQLException; + + + /**************************************************************************/ + //replace 替换数据,MYSQL支持,如果有数据先删除后增加 + /**************************************************************************/ + + /** + * 替换数据,传入标准[表类]对象 + * + * @param _table 表定义对象 + * @param data 表对象 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(_Table _table, LinkedMapSO data) throws ORMException, SQLException; + + /** + * 替换数据,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$ + * + * @param _table 表定义对象 + * @param data 表对象 + * @param month 月份 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replaceMonth(_Table _table, LinkedMapSO data, String month) throws ORMException, SQLException; + + /** + * 替换数据,支持表或字段中有一个替换字段,如LOG_TRACE$ID$ + * + * @param _table 表定义对象 + * @param data 表对象 + * @param replaceKey 替换键 + * @param replaceValue 替换值 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(_Table _table, LinkedMapSO data, String replaceKey, String replaceValue) throws ORMException, SQLException; + + /** + * 替换数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表定义对象 + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(_Table _table, LinkedMapSO data, MapSS replaceMap) throws ORMException, SQLException; + + /** + * 批量替换数据 + * + * @param _table 表定义对象 + * @param dataList 表对象列表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] replaceBatch(_Table _table, List dataList) throws ORMException, SQLException; + + /** + * 批量替换数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表定义对象 + * @param dataList 表对象列表 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] replaceBatch(_Table _table, List dataList, MapSS replaceMap) throws ORMException, SQLException; + + /**************************************************************************/ + //update 更新数据 + /**************************************************************************/ + + /** + * 更新数据,指定更新器需要更新的字段、条件和可替换表 + * + * @param _table 表定义对象 + * @param updater 更新器 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(_Table _table, Updater updater) throws ORMException, SQLException; + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新 + * + * @param _table 表定义对象 + * @param data 表对象 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(_Table _table, LinkedMapSO data) throws ORMException, SQLException; + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$ + * + * @param _table 表定义对象 + * @param data 表对象 + * @param month 月份 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int updateMonth(_Table _table, LinkedMapSO data, String month) throws ORMException, SQLException; + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持表或字段中有一个替换字段,如LOG_TRACE$ID$ + * + * @param _table 表定义对象 + * @param data 表对象 + * @param replaceKey 替换键 + * @param replaceValue 替换值 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(_Table _table, LinkedMapSO data, String replaceKey, String replaceValue) throws ORMException, SQLException; + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持可替换表 + * + * @param _table 表定义对象 + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(_Table _table, LinkedMapSO data, MapSS replaceMap) throws ORMException, SQLException; + + /**************************************************************************/ + //delete 删除数据 + /**************************************************************************/ + + /** + * 删除数据,多个主键时使用 + * + * @param _table 表定义对象 + * @param ids 关键属性为数组,多个主键 + * @return 返回删除数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int delete(_Table _table, Object... ids) throws ORMException, SQLException; + + /** + * 删除数据,多个主键时使用 + * + * @param _table 表定义对象 + * @param replaceMap 替换表 + * @param ids 关键属性为数组,多个主键 + * @return 返回删除数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int delete(_Table _table, MapSS replaceMap, Object... ids) throws ORMException, SQLException; + + /** + * 删除数据, 根据条件 + * + * @param _table 表定义对象 + * @param selector 对象选择器 + * @return 返回删除数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int delete(_Table _table, Selector selector) throws ORMException, SQLException; + + /** + * 批量删除数据,多个主键时使用 + * + * @param _table 表定义对象 + * @param idsList 关键属性为数组,多个主键的列表 + * @return 返回删除数列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] deleteBatch(_Table _table, List idsList) throws ORMException, SQLException; + + /** + * 批量删除数据,多个主键时使用 + * + * @param _table 表定义对象 + * @param replaceMap 替换表 + * @param idsList 关键属性为数组,多个主键的列表 + * @return 返回删除数列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] deleteBatch(_Table _table, MapSS replaceMap, List idsList) throws ORMException, SQLException; + + /**************************************************************************/ + //count 查询数目 + /**************************************************************************/ + + /** + * 查询数目,多个主键时使用 + * + * @param _table 表定义对象 + * @param ids 关键属性值,支持多个 + * @return 存在的数目 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(_Table _table, Object... ids) throws ORMException, SQLException; + + /** + * 查询数目,整表查询 + * + * @param _table 表定义对象 + * @return int 数目值 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(_Table _table) throws ORMException, SQLException; + + /** + * 查询数目,根据条件、可替换表查询 + * + * @param _table 表定义对象 + * @param selector 对象查询器 + * @return int 数目值 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(_Table _table, Selector selector)throws ORMException, SQLException; + + /**************************************************************************/ + //sum 计算总和 + /**************************************************************************/ + + /** + * 计算总和 + * + * @param _table 表定义对象 + * @param field 表字段 + * @return 计算总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(_Table _table, String field) throws ORMException, SQLException; + + /** + * 计算总和 + * + * @param _table 表定义对象 + * @param selector 对象查询器 + * @param field 表字段 + * @return 计算总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(_Table _table, Selector selector, String field) throws ORMException, SQLException; + + /** + * 计算多个总和 + * + * @param _table 表定义对象 + * @param selector 对象查询器 + * @param fields 多个表字段 + * @return 计算多个总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long[] sum(_Table _table, Selector selector, String... fields) throws ORMException, SQLException; + + /**************************************************************************/ + //item 查询一条数据 + /**************************************************************************/ + + /** + * 查询一个表对象,支持多个主键 + * + * @param _table 表定义实例 + * @param ids 关键属性值 + * @return 返回表对象 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public LinkedMapSO item(_Table _table, Object... ids) throws ORMException, SQLException; + + /** + * 查询一个表对象,并指定返回属性,查询第一行 + * + * @param _table 表定义实例 + * @return 返回表对象 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public LinkedMapSO item(_Table _table) throws ORMException, SQLException; + + /** + * 查询一个表对象,并指定返回属性,查询条件和排序条件 + * + * @param _table 表定义实例 + * @param selector 对象查询器 + * @return 返回表对象 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public LinkedMapSO item(_Table _table, Selector selector) throws ORMException, SQLException; + + /**************************************************************************/ + //list 查询列表 + /**************************************************************************/ + + /** + * 查询表对象列表,全表查询 + * + * @param _table 表定义对象 + * @return 返回表对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(_Table _table) throws ORMException, SQLException; + + /** + * 查询表对象列表,并指定返回属性,查询条件和排序条件 + * + * @param _table 表定义对象 + * @param selector 对象查询器 + * @return 返回表对象列表 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public List list(_Table _table, Selector selector) throws ORMException, SQLException; + + /** + * 查询表对象列表,查询指定的位置的数据 + * + * @param _table 表定义对象 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 返回表对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(_Table _table, int pageNo, int pageSize) throws ORMException, SQLException; + + /** + * 查询表对象列表,并指定位置的,条件和排序条件 + * + * @param _table 表定义对象 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 对象查询器 + * @return 返回表对象列表 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public List list(_Table _table, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException; + + /**************************************************************************/ + //page 分页显示 + /**************************************************************************/ + + /** + * 查询表对象分页信息 + * + * @param _table 表定义对象 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(_Table _table, int pageNo, int pageSize) throws ORMException, SQLException; + + /** + * 查询表对象分页信息 + * + * @param _table 表定义对象 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 对象查询器 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(_Table _table, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException; + + /**************************************************************************/ + //内部ZTabler & ZTable 共享的方法 + /**************************************************************************/ + + /** + * 通过表定义对象,组装插入或替换的SQL + * 1.insert & insertOrUpdate & insertBatch + * 2.replace & replaceBatch + * 调用 + * + * @param _table 表定义对象 + * @param statement insert & replace + * @return SQL语句 + */ + public String toInsertOrReplaceSQL(_Table _table, String statement); + + /** + * 通过表定义对象,组装更新字段SQL + * update & insertOrUpdate调用 + * + * @param _table 表定义对象 + * @param updater 更新器 + * @param paramMap 参数表 + * @return SQL语句 + * @throws ORMException 映射异常 + */ + public String toUpdateFieldSQL(_Table _table, Updater updater, MapSO paramMap) throws ORMException; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/ZView.java b/zhiqim_orm/src/org/zhiqim/orm/ZView.java new file mode 100644 index 0000000..58b55ab --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/ZView.java @@ -0,0 +1,199 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm; + +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.MultiInstance; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.orm.dbo.Selector; + +/** + * 视图类与数据库表多表映射调用,支持(count,sum,item,list,page)

            + * count, 统计视图类对应的关联表数目
            + * sum, 总计视图类对应的关联表数目
            + * item, 查询视图类对应的关联表一条数据,根据主键,或根据条件排序取第一条
            + * list, 查询视图类对应的关联表列表,或根据条件排序
            + * pag, 分页查询视图类对应的关联表列表,指定分页页码和页数目
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + * @version v1.2.0 @author zouzhigang 2016-6-27 修改原类名FRHEL为ZView,正式使用视图名称 + */ +@AnAlias("ZView") +public interface ZView extends MultiInstance +{ + /*****************************************************/ + //count 查询数目 + /*****************************************************/ + + /** + * 查询数目,查全视图 + * + * @param clazz 视图类 + * @return 返回数目 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class clazz)throws ORMException, SQLException; + + /** + * 查询数目,根据条件、可替换表查询 + * + * @param clazz 视图类 + * @param selector 对象查询器 + * @return 返回数目 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class clazz, Selector selector)throws ORMException, SQLException; + + /*****************************************************/ + //sum 计算总和 + /*****************************************************/ + + /** + * 计算总和,全视图求和 + * + * @param clazz 视图类 + * @param field 视图字段 + * @return 返回总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(Class clazz, String field) throws ORMException, SQLException; + + /** + * 计算总和,根据条件视图中求和 + * + * @param clazz 视图类 + * @param field 视图字段 + * @param selector 查询器 + * @return 返回总和(sum) + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(Class clazz, String field, Selector selector) throws ORMException, SQLException; + + /** + * 计算多个总和,全视图中多个求和 + * + * @param clazz 视图类 + * @param fieldArr 多个视图字段 + * @return 返回计算多个总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long[] sum(Class clazz, String[] fieldArr) throws ORMException, SQLException; + + /** + * 计算多个总和,根据条件视图中多个求和 + * + * @param clazz 视图类 + * @param fieldArr 多个视图字段 + * @param selector 查询器 + * @return 返回计算多个总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long[] sum(Class clazz, String[] fieldArr, Selector selector) throws ORMException, SQLException; + + /*****************************************************/ + //item 查询一条数据 + /*****************************************************/ + + /** + * 查询一个视图对象,全视图中取第一个 + * + * @param clazz 视图类 + * @return 返回视图对象 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public T item(Class clazz) throws ORMException, SQLException; + + /** + * 查询一个视图对象,可排序取第一个 + * + * @param clazz 视图类 + * @param selector 查询器 + * @return 返回视图对象 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public T item(Class clazz, Selector selector) throws ORMException, SQLException; + + /*****************************************************/ + //list 查询列表 + /*****************************************************/ + + /** + * 查询列表,查全视图 + * + * @param clazz 视图类 + * @return 视图对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(Class clazz) throws ORMException, SQLException; + + /** + * 查询列表,根据查询器 + * + * @param clazz 视图类 + * @param selector 查询器 + * @return 视图对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(Class clazz, Selector selector) throws ORMException, SQLException; + + /*****************************************************/ + //page 分页显示 + /*****************************************************/ + + /** + * 查询视图分页信息,查全视图 + * + * @param clazz 视图类 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(Class clazz, int pageNo, int pageSize) throws ORMException, SQLException; + + /** + * 查询视图分页信息 + * + * @param clazz 视图类 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 查询器 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(Class clazz, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/annotation/AnDbo.java b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnDbo.java new file mode 100644 index 0000000..5f5defa --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnDbo.java @@ -0,0 +1,41 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 数据库参数或结果注解 + * + * @version v1.0.0 @author zouzhigang 2016-6-24 新建与整理 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(value = {ElementType.TYPE}) +public @interface AnDbo +{ + +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/annotation/AnDboField.java b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnDboField.java new file mode 100644 index 0000000..2202114 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnDboField.java @@ -0,0 +1,45 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 数据库参数或结果字段注解 + * + * @version v1.0.0 @author zouzhigang 2016-6-24 新建与整理 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface AnDboField +{ + /** 列名 */ + String column(); + + /** 列类型 */ + String type(); +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/annotation/AnIndex.java b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnIndex.java new file mode 100644 index 0000000..fefcb77 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnIndex.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 索引注解,用于定义表支持的多个索引注解值 + * @see AnIndexValue 索引注解值 + * + * @version v1.0.0 @author zouzhigang 2015-10-22 新建与整理 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface AnIndex +{ + AnIndexValue[] value(); +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/annotation/AnIndexValue.java b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnIndexValue.java new file mode 100644 index 0000000..e232403 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnIndexValue.java @@ -0,0 +1,49 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 索引注解值,用于定义该类对应到一张表 + * @see AnIndex 索引注解 + * + * @version v1.0.0 @author zouzhigang 2015-10-22 新建与整理 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface AnIndexValue +{ + /** 索引名 */ + String name(); + + /** 索引列,多个逗号隔开 */ + String column(); + + /** 索引类型,如unique */ + boolean unique() default false; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/annotation/AnTable.java b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnTable.java new file mode 100644 index 0000000..b1d7983 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnTable.java @@ -0,0 +1,51 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 表注解类,用于定义该类对应到一张表 + * @see AnTableField 定义表属性 + * @see AnIndexValue 定义表索引属性 + * @see AnViewJoin 定义视图中表连接关系 + * + * @version v1.0.0 @author zouzhigang 2015-10-22 新建与整理 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface AnTable +{ + /** 表名 */ + String table(); + + /** 表主键 */ + String key(); + + /** 表存储类型如innodb */ + String type() default ""; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/annotation/AnTableField.java b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnTableField.java new file mode 100644 index 0000000..0333b62 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnTableField.java @@ -0,0 +1,49 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 表字段注解类,用于定义该字段对应的个表的字段 + * @see AnTable 定义表属性 + * + * @version v1.0.0 @author zouzhigang 2015-11-13 新建与整理 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface AnTableField +{ + /** 列名 */ + String column(); + + /** 列类型,共9种,如int|string,32|binary,2000 */ + String type(); + + /** 列是否允许为null,为空时表示不适用于创建表 */ + boolean notNull() default false; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/annotation/AnTableReplace.java b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnTableReplace.java new file mode 100644 index 0000000..d8e1ff0 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnTableReplace.java @@ -0,0 +1,42 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 表可替换字段注解类,用于定义该字段对应的分表时的字段 + * @see AnTable 定义表属性 + * + * @version v1.0.0 @author zouzhigang 2015-11-13 新建与整理 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface AnTableReplace +{ + String value(); +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/annotation/AnView.java b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnView.java new file mode 100644 index 0000000..a0f03fd --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnView.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 视图注解类,用于定义该类对应到多表的关联 + * @see AnViewField 定义视图属性 + * @see AnViewJoin 定义视图中表连接关系 + * + * @version v1.0.0 @author zouzhigang 2015-10-22 新建与整理 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface AnView +{ + /** 多表名之间用逗号隔开 */ + String value(); +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/annotation/AnViewField.java b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnViewField.java new file mode 100644 index 0000000..fa0036b --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnViewField.java @@ -0,0 +1,47 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 视图字段注解类,用于定义该字段对应的个表的字段 + * @see AnView 定义视图属性 + * @see AnViewJoin 定义视图中表连接关系 + * + * @version v1.0.0 @author zouzhigang 2015-11-13 新建与整理 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface AnViewField +{ + /** 表名 */ + String table(); + + /** 列名 */ + String column(); +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/annotation/AnViewJoin.java b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnViewJoin.java new file mode 100644 index 0000000..2521e03 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnViewJoin.java @@ -0,0 +1,43 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * + * 表连接注解类,用于定义视图需要的多个连接属性 + * @see AnViewJoinValue 定义一个连接属性 + * + * @version v1.0.0 @author zouzhigang 2015-10-22 新建与整理 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface AnViewJoin +{ + AnViewJoinValue[] value(); +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/annotation/AnViewJoinValue.java b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnViewJoinValue.java new file mode 100644 index 0000000..854effe --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/annotation/AnViewJoinValue.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * + * 表连接注解属性类,用于定义视图的一个连接属性 + * @see AnViewJoin 定义一个连接属性放置到连接表中 + * + * @version v1.0.0 @author zouzhigang 2015-10-22 新建与整理 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface AnViewJoinValue +{ + /** 连接类型(EQUAL|LEFT|RIGHT) */ + String type(); + + /** 左表名 */ + String lTable(); + + /** 左表列名 */ + String lColumn(); + + /** 右表名 */ + String rTable() default ""; + + /** 右表列名 */ + String rColumn() default ""; + + /** 右值,右值和右表名右表列名互斥只取一个 */ + String rValue() default ""; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/cache/ZTableCache.java b/zhiqim_orm/src/org/zhiqim/orm/cache/ZTableCache.java new file mode 100644 index 0000000..993ea6d --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/cache/ZTableCache.java @@ -0,0 +1,471 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.cache; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +import org.zhiqim.kernel.extend.HashMapCO; +import org.zhiqim.kernel.extend.HashMapCV; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.schedule.Scheduler; +import org.zhiqim.kernel.schedule.TaskThreader; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Objects; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.dbo.Comparator; +import org.zhiqim.orm.dbo.Condition; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.condition._Equal; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.impl.ZTableImplement; + +/** + * 表缓存 + * + * @version v1.0.0 @author zhichenggang 2017-7-1 新建与整理 + */ +public final class ZTableCache +{ + private static final Log log = LogFactory.getLog(ZTableCache.class); + + private final ORMServer server; + private final HashMapCO lockMap; + private final HashMapCV> cache; + private final HashMapCV> index; + private final Scheduler scheduler; + + public ZTableCache(ORMServer server) + { + this.server = server; + this.lockMap = new HashMapCO(); + this.cache = new HashMapCV<>(); + this.index = new HashMapCV<>(); + + //增加计划任务 + this.scheduler = new Scheduler(); + this.scheduler.create(); + } + + /** 安排任务 */ + public void schedule() + { + for (TaskThreader task : server.getCacheMap().values()) + { + this.scheduler.addTask(task); + } + } + + /** 缓存回调刷新 */ + public void cache(Class clazz, List list) throws ORMException, SQLException + { + Object lock = lock(clazz); + synchronized (lock) + {//表内锁 + + //1.创建表缓存 + List oList = cache.remove(clazz); + if (oList != null) + { + oList.clear(); + oList = null; + } + + cache.put(clazz, list); + + //2.创建表主键索引 + _Table _table = ((ZTableImplement)server.table()).getTable(clazz); + String[] keyFields = _table.getKeyFieldArr(); + if (keyFields.length == 0) + {//没有主键 + index.put(clazz, null); + } + else + { + //把主键数组换成字段数组 + HashMap map = new HashMap<>(); + for (T item : list) + { + ZTableCacheKey key = new ZTableCacheKey(keyFields.length); + for (int i=0;i T item(Class clazz) throws ORMException, SQLException + { + List list = check(clazz); + if (list.isEmpty()) + return null; + + return Objects.copy(list.get(0), Classes.newInstance(clazz)); + } + + /** + * 查询一个表对象,支持多个主键 + * + * @param clazz 表类 + * @param ids 关键属性值 + * @return 返回表对象 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + @SuppressWarnings("unchecked") + public T item(Class clazz, Object... ids) throws ORMException, SQLException + { + List list = check(clazz); + if (list.isEmpty()) + return null; + + //读取索引表 + HashMap map = (HashMap)index.get(clazz); + if (map == null) + return null; + + return map.get(new ZTableCacheKey(ids)); + } + + /** + * 查询一个表对象,并指定返回属性,查询条件和排序条件 + * + * @param clazz 表类 + * @param selector 对象查询器 + * @return 返回表对象 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + @SuppressWarnings("unchecked") + public T item(Class clazz, Selector selector) throws ORMException, SQLException + { + if (selector == null) + return item(clazz); + + List list = check(clazz); + if (list.isEmpty()) + return null; + + if (selector.hasCondition()) + {//有条件的 + HashMap map = (HashMap)index.get(clazz); + if (map != null) + {//如果有索引表的支持,则判断一下是否包含索引的条件 + _Table _table = ((ZTableImplement)server.table()).getTable(clazz); + String[] keyFields = _table.getKeyFieldArr(); + + ZTableCacheKey key = new ZTableCacheKey(keyFields.length); + for (Condition condition : selector.getConditionList()) + { + if (!(condition instanceof _Equal)) + continue; + + _Equal equal = (_Equal)condition; + int idx = Arrays.indexOf(keyFields, equal.getField()); + if (idx != -1) + {//把结果配对到主键中 + key.set(idx, equal.getValue()); + } + } + + if (key.isAllKey()) + { + T result = map.get(key); + if (result == null) + return null; + + return match(result, selector)?result:null; + } + } + } + + //逐个检查 + list = fatch(clazz, list, selector); + if (list.isEmpty()) + return null; + + //取第一个 + return Objects.copy(list.get(0), Classes.newInstance(clazz)); + } + + /********************************************************************************************/ + //list 查询列表 + /********************************************************************************************/ + + /** + * 查询表对象列表,全表查询 + * + * @param clazz 表类 + * @return 返回表对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(Class clazz) throws ORMException, SQLException + { + return list(clazz, null); + } + + /** + * 查询表对象列表,并指定返回属性,查询条件和排序条件 + * + * @param clazz 表类 + * @param selector 对象查询器 + * @return 返回表对象列表 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public List list(Class clazz, Selector selector) throws ORMException, SQLException + { + List list = check(clazz); + if (list.isEmpty()) + return new ArrayList(); + + list = fatch(clazz, list, selector); + + //最后取拷贝数据 + return copyList(clazz, list); + } + + /** + * 查询表对象列表,查询指定的位置的数据 + * + * @param clazz 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 返回表对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(Class clazz, int pageNo, int pageSize) throws ORMException, SQLException + { + return list(clazz, pageNo, pageSize, null); + } + + /** + * 查询表对象列表,并指定位置的,条件和排序条件 + * + * @param clazz 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 对象查询器 + * @return 返回表对象列表 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public List list(Class clazz, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException + { + List list = check(clazz); + if (list.isEmpty()) + return new ArrayList(); + + list = fatch(clazz, list, selector); + + //取得分页的列表 + list = PageBuilder.pageList(pageNo, pageSize, list); + + //最后取拷贝数据 + return copyList(clazz, list); + } + + /********************************************************************************************/ + //page 分页显示 + /********************************************************************************************/ + + /** + * 查询表对象分页信息 + * + * @param clazz 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(Class clazz, int pageNo, int pageSize) throws ORMException, SQLException + { + return page(clazz, pageNo, pageSize, null); + } + + /** + * 查询表对象分页信息 + * + * @param clazz 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 对象查询器 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(Class clazz, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException + { + if (selector == null) + return page(clazz, pageNo, pageSize); + + List list = check(clazz); + if (list.isEmpty()) + return PageBuilder.newResult(pageNo, pageSize); + + list = fatch(clazz, list, selector); + + //取得分页的列表 + int total = list.size(); + list = PageBuilder.pageList(pageNo, pageSize, list); + + //取得分页列表的拷贝数据 + list = copyList(clazz, list); + + //最后封装成分页对象 + return PageBuilder.newResult(total, pageNo, pageSize, list); + } + + /********************************************************************************************/ + //私用共享方 + /********************************************************************************************/ + + @SuppressWarnings("unchecked") /** 检查缓存,未缓存的加载缓存 */ + private List check(Class clazz) throws ORMException, SQLException + { + List list = (List) cache.get(clazz); + if (list != null) + return list; + + //第一次没有数据,执行更新缓存操作 + synchronized (cache) + { + list = (List) cache.get(clazz); + if (list == null) + {//第二次作双重检查 + server.table().cache(clazz); + } + } + + if (list == null) + {//最后再检查一次 + list = (List) cache.get(clazz); + } + + return list; + } + + /** 抓取列表,没条件的全列表,有条件的逐个匹配 */ + private List fatch(Class clazz, List list, Selector selector) + { + if (selector == null || (!selector.hasCondition() && !selector.hasOrderby())) + {//没条件且不要排序的,无需拷贝列表,直接返回缓存原始列表即可 + return list; + } + + List nList = null; + if (!selector.hasCondition()) + {//没条件的,但要排序的,拷贝列表 + nList = Lists.copy(list, false); + } + else + {//有条件的 + nList = new ArrayList<>(); + for (T item : list) + {//逐个匹配 + if (match(item, selector)) + nList.add(item); + } + } + + if (nList.size() > 1 && selector.hasOrderby()) + {//数据大于1条的,且要求排序的作排序 + Collections.sort(nList, new Comparator<>(selector)); + } + + return nList; + } + + /** 匹配对象 */ + private boolean match(T item, Selector selector) + { + for (Condition c : selector.getConditionList()) + { + if (!c.match(item)) + return false; + } + + return true; + } + + /** 读取表锁 */ + private Object lock(Class clazz) + { + synchronized (this) + { + Object lock = lockMap.get(clazz); + if (lock == null) + { + lock = new Object(); + lockMap.put(clazz, lock); + } + return lock; + } + } + + /** 拷贝列表,数据全部重新创建 */ + private List copyList(Class clazz, List list) + { + if (list.isEmpty()) + return new ArrayList<>(); + + ArrayList cList = new ArrayList<>(list.size()); + for (T item : list) + { + cList.add(Objects.copy(item, Classes.newInstance(clazz))); + } + + return Lists.trim(cList); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/cache/ZTableCacheKey.java b/zhiqim_orm/src/org/zhiqim/orm/cache/ZTableCacheKey.java new file mode 100644 index 0000000..edf5778 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/cache/ZTableCacheKey.java @@ -0,0 +1,89 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.cache; + +import java.util.Arrays; + +/** + * 表缓存主键 + * + * @version v1.0.0 @author zouzhigang 2019-3-21 新建与整理 + */ +public class ZTableCacheKey +{ + private Object[] objs; + + public ZTableCacheKey(int count) + { + this.objs = new Object[count]; + } + + public ZTableCacheKey(Object[] ids) + { + this.objs = ids; + } + + public void set(int idx, Object obj) + { + this.objs[idx] = obj; + } + + public Object[] get() + { + return objs; + } + + public boolean isAllKey() + {//有一个为空则非全KEY匹配 + for (Object id : objs) + { + if (id == null) + return false; + } + + return true; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + Arrays.hashCode(objs); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ZTableCacheKey other = (ZTableCacheKey) obj; + if (!Arrays.equals(objs, other.objs)) + return false; + return true; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/cache/ZTableCacheTask.java b/zhiqim_orm/src/org/zhiqim/orm/cache/ZTableCacheTask.java new file mode 100644 index 0000000..8e72cf9 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/cache/ZTableCacheTask.java @@ -0,0 +1,62 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.cache; + +import java.sql.SQLException; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; + +/** + * 表缓存刷新任务 + * + * @version v1.4.1 @author zouzhigang 2018-5-3 新建与整理 + */ +public class ZTableCacheTask implements Task +{ + private static final Log log = LogFactory.getLog(ZTableCache.class); + + private final ZTable zTable; + private final Class clazz; + + public ZTableCacheTask(ZTable zTable, Class clazz) + { + this.zTable = zTable; + this.clazz = clazz; + } + + @Override + public void execute() + { + try + { + zTable.cache(clazz); + } + catch (ORMException | SQLException e) + { + log.error("刷新缓存[%s]时异常", e, clazz.getName()); + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/config/ZSQLConfig.java b/zhiqim_orm/src/org/zhiqim/orm/config/ZSQLConfig.java new file mode 100644 index 0000000..ebca6a4 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/config/ZSQLConfig.java @@ -0,0 +1,116 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.config; + +import java.io.InputStream; +import java.util.Map; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.zhiqim.kernel.constants.XmlConstants; +import org.zhiqim.kernel.extend.LinkedMapSS; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.xml.Xmls; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMException; + +/** + * ZhiqimSQL配置信息,id和SQL语句

            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZSQLConfig implements ORMConstants, XmlConstants +{ + private String name; + private LinkedMapSS sqlMap = new LinkedMapSS(); + + public ZSQLConfig(String name) + { + this.name = name; + } + + public String toString() + { + StringBuilder strb = new StringBuilder(); + strb.append(_XML_DEFIND_).append(_BR_); + strb.append(Z_SQL_CONFIG_XML_DOCTYPE).append(_BR_); + strb.append(Z_SQL_CONFIG_XML_HEAD).append(_BR_).append(_BR_); + + for (Map.Entry entry : sqlMap.entrySet()) + { + strb.append("").append(entry.getKey()).append("\">").append(_BR_); + strb.append("").append(_BR_); + strb.append("").append(_BR_); + } + strb.append(_BR_); + + strb.append(Z_SQL_CONFIG_XML_TAIL); + return strb.toString(); + } + + /** + * 加载XML + * + * @param in 输入流 + * @throws Exception 可能的异常 + */ + public void load(InputStream in) throws Exception + { + Document document = Xmls.buildDocument(in, new ZSQLResolver()); + + //遍历标签 + NodeList updateList = document.getElementsByTagName("sql"); + for (int i=0;i. + */ +package org.zhiqim.orm.config; + +import java.io.IOException; +import java.io.InputStream; + +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import org.zhiqim.kernel.util.Resources; +import org.zhiqim.orm.ORMConstants; + +/** + * 实现DTD本地验证,这样则不要到zhiqim.org下载验证
            + */ +public class ZSQLResolver implements EntityResolver, ORMConstants +{ + @Override + public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException + { + if (Z_SQL_CONFIG_DTD_PUBLIC_ID.equals(publicId)) + { + InputStream stream = Resources.getResourceStream(ZSQLResolver.class, Z_SQL_CONFIG_DTD_PATH); + return new InputSource(stream); + } + + return null; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/config/zhiqim_sql_1_5_0.dtd b/zhiqim_orm/src/org/zhiqim/orm/config/zhiqim_sql_1_5_0.dtd new file mode 100644 index 0000000..220d519 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/config/zhiqim_sql_1_5_0.dtd @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/zhiqim_orm/src/org/zhiqim/orm/datasource/ZCall.java b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZCall.java new file mode 100644 index 0000000..0ac4101 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZCall.java @@ -0,0 +1,103 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.datasource; + +import java.sql.CallableStatement; +import java.sql.Date; +import java.sql.SQLException; +import java.sql.Time; +import java.sql.Timestamp; +import java.sql.Types; + +public class ZCall +{ + /** + * 从存储过程中读取对象 + * + * @param resultClass 结果类 + * @param cstmt 过程 + * @param index 索引值 + * @return 索引位置的对象 + * @throws SQLException SQL异常 + */ + public static Object getValue(Class resultClass, CallableStatement cstmt, int index) throws SQLException + { + if (resultClass == boolean.class || resultClass == Boolean.class) + return cstmt.getBoolean(index); + else if (resultClass == byte.class || resultClass == Byte.class || resultClass == short.class || resultClass == Short.class || resultClass == int.class || resultClass == Integer.class) + return cstmt.getInt(index); + else if (resultClass == long.class || resultClass == Long.class) + return cstmt.getLong(index); + //日期类型 + else if (resultClass == Timestamp.class) + return cstmt.getTimestamp(index); + else if (resultClass == Date.class) + return cstmt.getDate(index); + else if (resultClass == Time.class) + return cstmt.getTime(index); + //字符串 + else if (resultClass == String.class) + return cstmt.getString(index); + //二进制 + else if (resultClass == byte[].class) + return cstmt.getBytes(index); + else + {//其他类型 + return cstmt.getObject(index); + } + } + + /** + * 通过类,对应到存储过程的类型 + * + * @param clazz 类结构 + * @return 数据库字段类型 + */ + public static int getType(Class clazz) + { + if (clazz == null) + return Types.NULL; + else if (clazz == boolean.class || clazz == Boolean.class) + return Types.BOOLEAN; + else if (clazz == byte.class || clazz == Byte.class || clazz == short.class || clazz == Short.class || clazz == int.class || clazz == Integer.class) + return Types.INTEGER; + else if (clazz == long.class || clazz == Long.class) + return Types.BIGINT; + //日期类型 + else if (clazz == Timestamp.class) + return Types.TIMESTAMP; + else if (clazz == Date.class) + return Types.DATE; + else if (clazz == Time.class) + return Types.TIME; + //字符串 + else if (clazz == String.class) + return Types.VARCHAR; + //二进制 + else if (clazz == byte[].class) + return Types.BLOB; + else + {//其他类型 + return Types.OTHER; + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/datasource/ZConnection.java b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZConnection.java new file mode 100644 index 0000000..370edbe --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZConnection.java @@ -0,0 +1,456 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.datasource; + +import java.sql.Array; +import java.sql.Blob; +import java.sql.CallableStatement; +import java.sql.Clob; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.NClob; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLClientInfoException; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Savepoint; +import java.sql.Statement; +import java.sql.Struct; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.Executor; + +/** + * 数据库连接类,对Connection进行封装,增加对是否空闲,空闲时长和处理数等字段,以及close释放到连接池中

            + * 1.connection属性为通过DataSource创建的连接信息
            + * 2.isIdle,idleTime,completedCount表示空闲时数据以及处理数
            + * 3.close()为提供业务关闭时释放连接
            + * 4.shutdown()为连接池关闭连接
            + * 5.isConnectionAvailable()检查数据库连接有效性
            + * 6.isExcessTimeOrNum()检查是否超出空闲时长和处理数
            + * 采用LRU(Least Recently Used)算法对连接进行管理,即每次提供的缓存连接都是最近的,那么最远的就会超出最大空闲了。 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZConnection implements Connection +{ + private ZDataSource source; + private Connection conn; + private String connId; + private long keepTimeMs; + + private volatile boolean autoCommit; + private volatile boolean closed; + + private volatile boolean idle; + private volatile long idleTimeMs; + + public ZConnection(ZDataSource source, Connection conn) + { + this.source = source; + this.conn = conn; + this.connId = source.nextSequence(); + this.keepTimeMs = System.currentTimeMillis(); + + try{this.autoCommit = conn.getAutoCommit();}catch (SQLException e){this.autoCommit = true;} + + this.idle = true; + this.idleTimeMs = keepTimeMs; + } + + /** 当前连接编号 */ + public String getId() + { + return connId; + } + + /** 当前连接是否空闲 */ + public boolean isIdle() + { + return !closed && idle; + } + + /** 当前线程是否运行 */ + public boolean isActive() + { + return !idle; + } + + /** 设置连接为运行中 */ + public ZConnection active() + { + idle = false; + source.active(); + return this; + } + + /** 设置连接为空闲中 */ + public void idle() + { + idle = true; + idleTimeMs = System.currentTimeMillis(); + source.idle(); + } + + /** + * 检查数据库连接是否超过指定的最大保持时长、最大空闲时长和最大调用量 + * + * @return =true表示超过,=false可用 + */ + public boolean isKeepOrIdleTimeout() + { + if ((System.currentTimeMillis() - keepTimeMs) > source.getMaxKeepTimeMs()) + return true; + + if ((System.currentTimeMillis() - idleTimeMs) > source.getMaxIdleTimeMs()) + return true; + + return false; + } + + /** + * 检查数据库连接 + * + * @return =true,正常,=false不可用 + */ + public boolean isConnectionAvailable() + { + if (conn == null) + return false; + + ResultSet rst = null; + + try + { + DatabaseMetaData metaData = conn.getMetaData(); + rst = metaData.getTables(null, null, "PROBABLYNOT", new String[]{"TABLE"}); + return true; + } + catch (SQLException e) + { + return false; + } + finally + { + ZDBClose.close(rst); + } + } + + public void setAutoCommit() + { + try{conn.setAutoCommit(autoCommit);}catch (SQLException e){} + } + + void shutdown() + { + closed = true; + try{if (!conn.isClosed())conn.close();}catch(SQLException e){} + } + + public void close() throws SQLException + { + try{conn.clearWarnings();}catch(Exception e){} + source.releaseConnection(this); + } + + /** 获取连接已保持时长 */ + public long getKeepTimeMs() + { + return keepTimeMs; + } + + /** 获取连接已空闲时长 */ + public long getIdleTimeMs() + { + return idleTimeMs; + } + + public int getHoldability() throws SQLException + { + return conn.getHoldability(); + } + + public int getTransactionIsolation() throws SQLException + { + return conn.getTransactionIsolation(); + } + + public void clearWarnings() throws SQLException + { + conn.clearWarnings(); + } + + public void commit() throws SQLException + { + conn.commit(); + } + + public void rollback() throws SQLException + { + conn.rollback(); + } + + public boolean getAutoCommit() throws SQLException + { + return conn.getAutoCommit(); + } + + public boolean isClosed() + { + if (closed){return true;} + try{return conn.isClosed();}catch (SQLException e) {return true;} + } + + public boolean isReadOnly() throws SQLException + { + return conn.isReadOnly(); + } + + public void setHoldability(int holdability) throws SQLException + { + conn.setHoldability(holdability); + } + + public void setTransactionIsolation(int level) throws SQLException + { + conn.setTransactionIsolation(level); + } + + public void setAutoCommit(boolean autoCommit) throws SQLException + { + this.autoCommit = autoCommit; + conn.setAutoCommit(autoCommit); + } + + public void setReadOnly(boolean readOnly) throws SQLException + { + conn.setReadOnly(readOnly); + } + + public String getCatalog() throws SQLException + { + return conn.getCatalog(); + } + + public void setCatalog(String catalog) throws SQLException + { + conn.setCatalog(catalog); + } + + public DatabaseMetaData getMetaData() throws SQLException + { + return conn.getMetaData(); + } + + public SQLWarning getWarnings() throws SQLException + { + return conn.getWarnings(); + } + + public Savepoint setSavepoint() throws SQLException + { + return conn.setSavepoint(); + } + + public void releaseSavepoint(Savepoint savepoint) throws SQLException + { + conn.releaseSavepoint(savepoint); + } + + public void rollback(Savepoint savepoint) throws SQLException + { + conn.rollback(savepoint); + } + + public Statement createStatement() throws SQLException + { + return conn.createStatement(); + } + + public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException + { + return conn.createStatement(resultSetType, resultSetConcurrency); + } + + public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException + { + return conn.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability); + } + + public Map> getTypeMap() throws SQLException + { + return conn.getTypeMap(); + } + + public void setTypeMap(Map> map) throws SQLException + { + conn.setTypeMap(map); + } + + public String nativeSQL(String sql) throws SQLException + { + return conn.nativeSQL(sql); + } + + public CallableStatement prepareCall(String sql) throws SQLException + { + return conn.prepareCall(sql); + } + + public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException + { + return conn.prepareCall(sql, resultSetType, resultSetConcurrency); + } + + public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException + { + return conn.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability); + } + + public PreparedStatement prepareStatement(String sql) throws SQLException + { + return conn.prepareStatement(sql); + } + + public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException + { + return conn.prepareStatement(sql, autoGeneratedKeys); + } + + public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException + { + return conn.prepareStatement(sql, resultSetType, resultSetConcurrency); + } + + public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException + { + return conn.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability); + } + + public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException + { + return conn.prepareStatement(sql, columnIndexes); + } + + public Savepoint setSavepoint(String name) throws SQLException + { + return conn.setSavepoint(name); + } + + public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException + { + return conn.prepareStatement(sql, columnNames); + } + + public T unwrap(Class iface) throws SQLException + { + return conn.unwrap(iface); + } + + public boolean isWrapperFor(Class iface) throws SQLException + { + return conn.isWrapperFor(iface); + } + + public Clob createClob() throws SQLException + { + return conn.createClob(); + } + + public Blob createBlob() throws SQLException + { + return conn.createBlob(); + } + + public NClob createNClob() throws SQLException + { + return conn.createNClob(); + } + + public SQLXML createSQLXML() throws SQLException + { + return conn.createSQLXML(); + } + + public boolean isValid(int timeout) throws SQLException + { + return conn.isValid(timeout); + } + + public void setClientInfo(String name, String value) throws SQLClientInfoException + { + conn.setClientInfo(name, value); + } + + public void setClientInfo(Properties properties) throws SQLClientInfoException + { + conn.setClientInfo(properties); + } + + public String getClientInfo(String name) throws SQLException + { + return conn.getClientInfo(name); + } + + public Properties getClientInfo() throws SQLException + { + return conn.getClientInfo(); + } + + public Array createArrayOf(String typeName, Object[] elements) throws SQLException + { + return conn.createArrayOf(typeName, elements); + } + + public Struct createStruct(String typeName, Object[] attributes) throws SQLException + { + return conn.createStruct(typeName, attributes); + } + + /**********************************************************/ + //JDK1.7增加 + /**********************************************************/ + + public void setSchema(String schema) throws SQLException + { + } + + public String getSchema() throws SQLException + { + return null; + } + + public void abort(Executor executor) throws SQLException + { + } + + public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException + { + } + + public int getNetworkTimeout() throws SQLException + { + return 0; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/datasource/ZConnectionTester.java b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZConnectionTester.java new file mode 100644 index 0000000..181819d --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZConnectionTester.java @@ -0,0 +1,153 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.datasource; + +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; + +/** + * 数据库连接测试类
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZConnectionTester +{ + private static final Log log = LogFactory.getLog("database.log"); + + public final static int CONNECTION_IS_OKAY = 0; + public final static int CONNECTION_IS_INVALID = -1; + public final static int DATABASE_IS_INVALID = -8; + + private final static Set INVALID_DB_STATES; + static + { + Set temp = new HashSet(); + temp.add("08001"); //SQL State "Unable to connect to data source" + temp.add("08007"); //SQL State "Connection failure during transaction" + temp.add(null); //SQL State "Io 异常: Connection reset by peer: socket write error" + + // MySql appently uses this state to indicate a stale, expired + // connection when the database is fine, so we'll not presume + // this SQL state signals an invalid database. + temp.add("08S01"); //SQL State "Communication link failure" + + INVALID_DB_STATES = Collections.unmodifiableSet(temp); + } + + private ZDataSource dataSource = null; + private ZConnection testconnection = null; + + public ZConnectionTester(ZDataSource dataSource) + { + this.dataSource = dataSource; + } + + /** + * 判断数据库是否断开 + * + * @return boolean =true表示断开,=false表示正常 + */ + public boolean isDbBreak() + { + if (testconnection == null) + { + testconnection = dataSource.newProxyConnection("测试"); + if (testconnection == null) + return true; + } + + if (testconnection.isClosed() || testconnection.isKeepOrIdleTimeout()) + { + testconnection.shutdown(); + testconnection = null; + testconnection = dataSource.newProxyConnection("测试"); + if (testconnection == null) + return true; + } + + int status = isConnectionAvailable(testconnection); + if (status == CONNECTION_IS_OKAY) + return false; + + testconnection.shutdown(); + testconnection = null; + return true; + } + + /** + * 检查数据库连接 + * + * @param connection 数据库连接 + * @return =0,正常,=-1,该连接异常,=-8,数据库异常 + */ + public int isConnectionAvailable(Connection connection) + { + if (connection == null) + return CONNECTION_IS_INVALID; + + ResultSet rst = null; + + try + { + DatabaseMetaData metaData = connection.getMetaData(); + + rst = metaData.getTables(null, null, "PROBABLYNOT", new String[]{"TABLE"}); + return CONNECTION_IS_OKAY; + } + catch (SQLException e) + { + String state = e.getSQLState(); + if (INVALID_DB_STATES.contains(state)) + { + log.error("检查数据库连接是否可用时:数据库不可用"); + return DATABASE_IS_INVALID; + } + else + { + log.error("检查数据库连接是否可用时:连接不可用"); + return CONNECTION_IS_INVALID; + } + } + finally + { + ZDBClose.close(rst); + } + } + + /** 关闭测试连接 */ + public void shutdown() + { + if (testconnection != null) + { + testconnection.shutdown(); + testconnection = null; + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/datasource/ZDBClose.java b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZDBClose.java new file mode 100644 index 0000000..1ee1822 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZDBClose.java @@ -0,0 +1,104 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.datasource; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; + +/** + * 数据库关闭工具类 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public final class ZDBClose +{ + private static final Log log = LogFactory.getLog(ZDBClose.class); + + /** 关闭连接结果集 */ + public static void close(ResultSet rst) + { + try + { + if (rst != null) + rst.close(); + } + catch (Exception e) + { + log.error(e.getMessage()); + } + } + + /** 关闭连接属性 */ + public static void close(Statement stmt) + { + try + { + if (stmt != null) + stmt.close(); + } + catch (Exception e) + { + log.error(e.getMessage()); + } + } + + /** 关闭连接属性 */ + public static void close(ResultSet rst, Statement stmt) + { + close(rst); + close(stmt); + } + + /** 关闭/归还连接 */ + public static void close(Connection conn) + { + try + { + if (conn != null) + conn.close(); + } + catch (SQLException e) + { + log.error(e.getMessage()); + } + } + + /** 关闭和归还连接属性 */ + public static void close(Statement stmt, Connection conn) + { + close(stmt); + close(conn); + } + + /** 关闭和归还连接属性 */ + public static void close(ResultSet rst, Statement stmt, Connection conn) + { + close(rst); + close(stmt); + close(conn); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/datasource/ZDataSource.java b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZDataSource.java new file mode 100644 index 0000000..b3421a1 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZDataSource.java @@ -0,0 +1,681 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.datasource; + +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.logging.Logger; + +import javax.naming.InitialContext; +import javax.sql.DataSource; + +import org.zhiqim.kernel.control.ThreadLock; +import org.zhiqim.kernel.control.Threadx; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Randoms; +import org.zhiqim.kernel.util.Threads; +import org.zhiqim.kernel.util.seqs.Sequence; + +/** + * 数据库配置与管理类
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZDataSource extends Threadx implements DataSource, Runnable +{ + private static final Log log = LogFactory.getLog("database.log"); + + private static final String JNDI = "jndi"; //JNDI + private static final int CHK_TIME = 60 * 1000; //每60秒检查一次线程池 + + //数据库基础属性 + private final String id; //数据库服务编号 + private final Sequence sequence = new Sequence(6); //数据库连接序号 + private final ThreadLock lock = new ThreadLock(); //数据库连接有效时通知锁 + private final List connList; //数据库连接池 + private final ConcurrentHashMap closedMap; //数据库连接池等待关闭列表 + private final AtomicInteger activeSize; //数据库连接活跃数 + + //数据库驱动配置 + private String driver; //数据库驱动 + private String url; //数据库URL + private String user; //数据库用户名 + private String pass; //数据库密码 + private int level; //事务隔离级别0/1/2/4/8分别表示不支持事务/脏读/不支持读未提交/再次读取相同的数据而不会失败,但虚读仍然会出现/防止脏读、不可重复的读和虚读 + + //数据库连接池配置 + private int minPoolSize; //连接池最小数目 + private int maxPoolSize; //连接池最大数目 + private long maxKeepTimeMs; //数据库连接最大保持毫秒时间,超出则重建连接 + private long maxIdleTimeMs; //数据库连接最大空闲毫秒时间,超出则重建连接 + + //数据库连接检查配置 + private boolean isChkConnOnTimer; //是否定时检查连接有效性 + private boolean isChkConnOnGet; //是否在获取连接时检查连接有效性 + private boolean isChkConnOnRelease; //是否在释放连接时检查连接有效性 + + //数据库连接耗尽策略配置 + private int outOfConnWaitTimeMs; //数据库连接耗尽时,最大等待时长,单位毫秒,建议5000毫秒 + private int outOfConnRetryCount; //数据库连接耗尽时,重试次数,建议重试1次 + + //数据库状态属性 + private boolean isDbBreak; //数据库是否已断开 + private ZConnectionTester tester; //数据库连接测试类 + + /** + * 默认参数构造函数,默认空闲时间=保持时间,最大100001次调用,定时检查连接有效性,获取和释放时检查有效性 + * + * @param id 数据库服务编号 + * @param driver 数据库驱动 + * @param url 数据库URL + * @param user 数据库用户名 + * @param pass 数据库密码 + * @param minPoolSize 连接池最小数目 + * @param maxPoolSize 连接池最大数目 + * @param maxKeepTime 数据库连接最大保持时长,超出则重建连接,单位:秒 + */ + public ZDataSource(String id, String driver, String url, String user, String pass, int minPoolSize, int maxPoolSize, int maxKeepTime) + { + this(id, driver, url, user, pass, -1, minPoolSize, maxPoolSize, maxKeepTime, maxKeepTime, true, false, false, 5, 1); + } + + /** + * 全参数构造函数 + * + * @param id 数据库服务编号 + * @param driver 数据库驱动 + * @param url 数据库URL + * @param user 数据库用户名 + * @param pass 数据库密码 + * @param level 数据库连接事务隔离级别 + * @param minPoolSize 连接池最小数目 + * @param maxPoolSize 连接池最大数目 + * @param maxKeepTime 数据库连接最大保持时长,超出则重建连接,单位:秒 + * @param maxIdleTime 数据库连接最大空闲时长,超出则重建连接,单位:秒 + * @param isChkConnOnTimer 是否定时检查连接有效性 + * @param isChkConnOnGet 是否在获取连接时检查连接有效性 + * @param isChkConnOnRelease 是否在释放连接时检查连接有效性 + * @param outOfConnWaitTime 数据库连接耗尽时,最大等待时长,单位秒 + * @param outOfConnRetryCount 数据库连接耗尽时,重试次数,建议重试1次 + */ + public ZDataSource(String id, String driver, String url, String user, String pass, int level, int minPoolSize, int maxPoolSize, int maxKeepTime, int maxIdleTime, + boolean isChkConnOnTimer, boolean isChkConnOnGet, boolean isChkConnOnRelease, int outOfConnWaitTime, int outOfConnRetryCount) + { + //配置 + this.id = id != null?id:Randoms.lettersDigits(2); + this.connList = new LinkedList<>(); + this.closedMap = new ConcurrentHashMap<>(); + this.activeSize = new AtomicInteger(0); + + //基础参数 + this.driver = driver; + this.url = url; + this.user = user; + this.pass = pass; + this.level = level; + + //连接池/处理参数 + this.minPoolSize = minPoolSize; + this.maxPoolSize = maxPoolSize; + this.maxKeepTimeMs = maxKeepTime * 1000; + this.maxIdleTimeMs = maxIdleTime * 1000; + this.isChkConnOnTimer = isChkConnOnTimer; + this.isChkConnOnGet = isChkConnOnGet; + this.isChkConnOnRelease = isChkConnOnRelease; + this.outOfConnWaitTimeMs = outOfConnWaitTime * 1000; + this.outOfConnRetryCount = outOfConnRetryCount; + } + + /** 数据库信息 */ + public String toString() + { + return new StringBuilder("数据库[") + .append("id:").append(id).append(",") + .append("min:").append(minPoolSize).append(",") + .append("max:").append(maxPoolSize).append(",") + .append("cur:").append(getConnSize()).append(",") + .append("active:").append(activeSize.get()).append(",") + .append("mKeep:").append(maxKeepTimeMs/1000).append(",") + .append("mIdle:").append(maxIdleTimeMs/1000).append(",") + .append("isTimer:").append(isChkConnOnTimer).append(",") + .append("isGet:").append(isChkConnOnGet).append(",") + .append("isRelease:").append(isChkConnOnRelease).append(",") + .append("outWait:").append(outOfConnWaitTimeMs/1000).append(",") + .append("outRetry:").append(outOfConnRetryCount).append("]") + .toString(); + } + + /**********************************************************************************/ + //数据库服务线程开启&关闭&运行 + /**********************************************************************************/ + + @Override /** 线程名 */ + protected String getThreadName() + { + return "ZDataSource-"+id; + } + + @Override /** 线程开启前 */ + protected boolean openBefore() + { + if (!createConnectionTester()) + {//创建连接测试者 + return false; + } + + //2.先删除已有的连接 + deleteConnections(); + + //3.创建新的连接 + return createConnections("初始化"); + } + + @Override /** 线程关闭后 */ + protected void closeAfter() + { + deleteConnections(); + tester.shutdown(); + + log.info("数据库[%s]监视线程退出", id); + } + + + @Override /** 线程首次运行 */ + protected void first() + { + Threads.sleepIgnoreException(CHK_TIME); + } + + @Override /** 线程持续运行 */ + protected void loop() + { + //1.打印数据库日记信息 + log.info(toString()); + + //2.关闭等待关闭的连接 + for (Iterator it=closedMap.keySet().iterator();it.hasNext();) + { + ZConnection conn = it.next(); + conn.shutdown(); + it.remove(); + log.info("监视关闭数据库等待关闭的连接[%s][%s]成功", id, conn.getId()); + } + + //3.检查数据库是否断开 + isDbBreak = tester.isDbBreak(); + if (isDbBreak) + {//如果数据库断开,则关闭所有连接 + deleteConnections(); + return; + } + + //4.检查所有连接,关闭需要关闭的连接(已关闭、超出时长和连接不可用) + List list = Lists.copy(connList, true); + for (ZConnection conn : list) + { + if (conn.isActive()) + {//活动中的连接不检查 + continue; + } + + if (conn.isClosed() || conn.isKeepOrIdleTimeout() || (isChkConnOnTimer && !conn.isConnectionAvailable())) + {//已关闭、已超出时长或数目、和要求定时检查连接连接不可用时,三种情况下销毁连接并从队列移除 + synchronized (connList) + { + connList.remove(conn); + } + + String connId = conn.getId(); + conn.shutdown(); + conn = null; + + log.info("监视关闭数据库连接[%s][%s]成功", id, connId); + } + } + + //5.补足最小连接数 + createConnections("补足"); + + //6.等待60秒进入下次循环 + Threads.sleepIgnoreException(CHK_TIME); + } + + /**创建测试连接*/ + private boolean createConnectionTester() + { + if (tester != null) + {//如果已有测试器,先关闭 + tester.shutdown(); + tester = null; + } + + try + { + if (!JNDI.equalsIgnoreCase(driver)) + {//判断驱动类是否能加载到 + Class cls = Classes.forName(driver); + if (cls == null) + { + log.error("数据库[%s]初始化失败,未找到驱动类[%s]", id, driver); + return false; + } + } + + tester = new ZConnectionTester(this); + if (tester.isDbBreak()) + { + log.error("数据库[%s]初始化失败,连接断开", id); + return false; + } + } + catch (Exception e) + { + log.error("数据库[%s]初始化失败,%s", id, e.getMessage()); + return false; + } + + return true; + } + + /** 从池里获取一个连接,当连接耗尽时重复等待多少次 */ + public Connection getConnection() throws SQLException + { + return getConnection(0); + } + + /** 从池里获取一个连接 */ + private Connection getConnection(int times) throws SQLException + { + //第一步,先看是否能从连接池找到或新建 + synchronized (connList) + { + //1.1循环寻找一个有效的空闲连接,并对无效连接进行处理 + for (Iterator it=connList.iterator();it.hasNext();) + { + ZConnection conn = it.next(); + if (conn.isActive()) + {//1.1.1 先判断是否活动中,活动中继续找下一个 + continue; + } + + if (conn.isClosed() || conn.isKeepOrIdleTimeout() || (isChkConnOnGet && !conn.isConnectionAvailable())) + {//1.1.2 已关闭、已超出时长或数目、和要求获取时检查连接连接不可用时,三种情况下销毁连接并从队列移除 + closedMap.put(conn, null); + it.remove(); + continue; + } + + //1.1.3 找到一个空闲并可用的连接即返回 + return conn.active(); + } + + //1.2如果没有空闲连接则检查是否达到最达连接数,没到最大值新建一个并返回 + if (connList.size() < maxPoolSize) + { + ZConnection conn = newProxyConnection("获取"); + if (conn != null) + { + connList.add(conn); + return conn.active(); + } + } + } + + //第二步,如果没有空闲且连接达到最大数,则线程进入等待状态5秒,等待别的线程处理完释放连接 + lock.lock(outOfConnWaitTimeMs); + + //第三步,别的线程有释放或时间到达,检查是否有效线程,有则返回 + synchronized (connList) + { + for (ZConnection conn : connList) + { + if (conn.isActive()) + continue; + + return conn.active(); + } + } + + //第四步,最后还是没有获取到连接则抛出异常,防止线程锁死在等待数据库连接上,导致发现不了问题 + String fatal = "数据库连接["+id+"]连接耗尽,[max:"+getMaxPoolSize()+",cur:"+getConnSize()+",active:"+activeSize.get()+"]"; + if (times < outOfConnRetryCount) + { + log.fatal("%s[第%s]", fatal, times+1); + return getConnection(times + 1); + } + else + { + log.fatal("%s[第%s][全部失败抛出异常到业务层]", fatal, times+1); + throw new SQLException("数据库连接耗尽,请与管理员联系检查数据库是否正常工作和连接池配置是否足够!"); + } + } + + /** 释放一个连接到池内 */ + public void releaseConnection(ZConnection conn) + { + if (conn == null) + return; + + if (conn.isClosed() || conn.isKeepOrIdleTimeout() || (isChkConnOnRelease && !conn.isConnectionAvailable())) + {//已关闭、已超出时长或数目、和要求释放时检查连接连接不可用时,三种情况下销毁连接并从队列移除 + String connId = conn.getId(); + conn.shutdown(); + synchronized (connList) + { + connList.remove(conn); + } + conn = null; + + log.info("释放关闭数据库连接[%s][%s]成功", id, connId); + return; + } + + //连接没问题即设置为空闲并通知 + conn.idle(); + lock.unlock(); + } + + /** 创建所有连接 */ + private boolean createConnections(String type) + { + int num = minPoolSize - connList.size(); + for(int i=0;i 0) + {//有创建连接的解锁通知 + lock.unlock(); + } + + return true; + } + + /** 删除所有连接 */ + private void deleteConnections() + { + synchronized (connList) + { + for (Iterator it=connList.iterator();it.hasNext();) + { + ZConnection conn = it.next(); + String connId = conn.getId(); + conn.shutdown(); + it.remove(); + conn = null; + + log.info("销毁关闭数据库连接[%s][%s]成功", id, connId); + } + } + } + + /** 获取一个代理的连接 */ + ZConnection newProxyConnection(String type) + { + try + { + Connection conn = null; + if (JNDI.equalsIgnoreCase(driver)) + {//JNDI + DataSource dataSource = (DataSource)new InitialContext().lookup(url); + if (dataSource == null) + return null; + + dataSource.setLoginTimeout(10); + conn = dataSource.getConnection(); + } + else + {//JDBC + DriverManager.setLoginTimeout(10); + conn = DriverManager.getConnection(url, user, pass); + } + + if (conn == null) + { + log.error("创建数据库连接[%s]失败,[%s]", id, type); + return null; + } + + ZConnection connection = new ZConnection(this, conn); + if (level == 0 || level == 1 || level == 2 || level == 4 || level == 8) + {//事务隔离等级,分5级,分别是0/1/2/4/8,越大越严格,其中0表示不支持事务,默认取决于数据库 + connection.setTransactionIsolation(level); + } + + log.info("创建数据库连接[%s][%s]成功,[%s]", id, connection.getId(), type); + return connection; + } + catch (SQLException e) + { + log.error("创建数据库连接[%s]时,发生异常:[%s]", id, e.getMessage()); + return null; + } + catch(Exception e) + { + log.error("创建数据库连接[%s]时,发生异常:[%s]", id, e.getMessage()); + return null; + } + } + + void active() + { + activeSize.getAndIncrement(); + } + + void idle() + { + activeSize.getAndDecrement(); + } + + /***********************************/ + //DataSource 参数信息,密码不支持获取 + /***********************************/ + + /** 获取当前连接数 */ + public int getConnSize() + { + return connList.size(); + } + + /** 获取当前连接活跃数 */ + public int getConnActiveSize() + { + return activeSize.get(); + } + + /** 判断数据库是否断开 */ + public boolean isDbBreak() + { + return tester.isDbBreak(); + } + + /** 下一个连接序号 */ + public String nextSequence() + { + return sequence.nextString(); + } + + public String getId() + { + return id; + } + + public String getDriver() + { + return driver; + } + + public String getUrl() + { + return url; + } + + public String getUser() + { + return user; + } + + public int getMinPoolSize() + { + return minPoolSize; + } + + public int getMaxPoolSize() + { + return maxPoolSize; + } + + public long getMaxKeepTimeMs() + { + return maxKeepTimeMs; + } + + public long getMaxIdleTimeMs() + { + return maxIdleTimeMs; + } + + public boolean isChkConnOnTimer() + { + return isChkConnOnTimer; + } + + public boolean isChkConnOnGet() + { + return isChkConnOnGet; + } + + public boolean isChkConnOnRelease() + { + return isChkConnOnRelease; + } + + /***********************************/ + //DataSource 支持动态修改的参数 + /***********************************/ + + public void setMinPoolSize(int minPoolSize) + { + this.minPoolSize = minPoolSize; + } + + public void setMaxPoolSize(int maxPoolSize) + { + this.maxPoolSize = maxPoolSize; + } + + public void setMaxKeepTime(long maxKeepTime) + { + this.maxKeepTimeMs = maxKeepTime * 1000; + } + + public void setMaxIdleTime(long maxIdleTime) + { + this.maxIdleTimeMs = maxIdleTime * 1000; + } + + public void setChkConnOnTimer(boolean isChkConnOnTimer) + { + this.isChkConnOnTimer = isChkConnOnTimer; + } + + public void setChkConnOnGet(boolean isChkConnOnGet) + { + this.isChkConnOnGet = isChkConnOnGet; + } + + public void setChkConnOnRelease(boolean isChkConnOnRelease) + { + this.isChkConnOnRelease = isChkConnOnRelease; + } + + /***********************************/ + //DataSource要求实现的方法,但没用上 + /***********************************/ + + public Connection getConnection(String username, String password) throws SQLException + { + throw new SQLException("不支持传入用户名和密码获取连接"); + } + + public PrintWriter getLogWriter() throws SQLException + { + return DriverManager.getLogWriter(); + } + + public int getLoginTimeout() throws SQLException + { + return DriverManager.getLoginTimeout(); + } + + public void setLogWriter(PrintWriter out) throws SQLException + { + DriverManager.setLogWriter(out); + } + + public void setLoginTimeout(int seconds) throws SQLException + { + DriverManager.setLoginTimeout(seconds); + } + + /***********************************/ + //JDK1.6增加 + /***********************************/ + + public boolean isWrapperFor(Class iface) throws SQLException + { + return false; + } + + public T unwrap(Class iface) throws SQLException + { + return null; + } + + /***********************************/ + //JDK1.7增加 + /***********************************/ + + public Logger getParentLogger() throws SQLFeatureNotSupportedException + { + return null; + } +} \ No newline at end of file diff --git a/zhiqim_orm/src/org/zhiqim/orm/datasource/ZResultSet.java b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZResultSet.java new file mode 100644 index 0000000..b16718f --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZResultSet.java @@ -0,0 +1,315 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.datasource; + +import java.lang.reflect.Method; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Date; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Time; +import java.sql.Timestamp; +import java.sql.Types; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.extend.TreeMapSO; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.dbo.Dbo; +import org.zhiqim.orm.dbo.DboField; + + +/** + * 数据库结果集工具类 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZResultSet implements ORMConstants +{ + /*******************************************************************************************/ + //解释结果集 + /*******************************************************************************************/ + + /** + * 解释结果集到哈唏表中 + * + * @param rst 结果集 + * @param resultClass 结果类 + * @return 结果表 + * @throws SQLException SQL异常 + */ + public static List parseToBase(ResultSet rst, Class resultClass) throws SQLException + { + if (!rst.next()) + {//先判断是否有数据 + return new ArrayList<>(); + } + + ArrayList resultList = new ArrayList<>(); + ResultSetMetaData rstMeta = rst.getMetaData(); + int columnCount = rstMeta.getColumnCount(); + + do + { + if (columnCount == 1) + {//只有一列时,取该值 + resultList.add(getValue(resultClass, rst, 1)); + } + else + {//多列时,取数据 + Object[] result = new Object[columnCount]; + for (int i=1;i<=columnCount;i++) + {// 从1开始 + result[i-1] = getValue(resultClass, rst, i); + } + + resultList.add(result); + } + } + while (rst.next()); + + resultList.trimToSize(); + return resultList; + } + + /** + * 解释结果集到哈唏表中 + * + * @param rst 结果集 + * @param resultClass 结果类 + * @return 结果表 + * @throws SQLException SQL异常 + */ + public static List parseToMap(ResultSet rst, Class resultClass) throws SQLException + { + if (!rst.next()) + {//先判断是否有数据 + return new ArrayList<>(); + } + + ArrayList resultList = new ArrayList<>(); + ResultSetMetaData rstMeta = rst.getMetaData(); + int columnCount = rstMeta.getColumnCount(); + + do + { + LinkedMapSO result = new LinkedMapSO(columnCount); + + for (int i = 1; i <= columnCount; i++) + {// 从1开始 + int type = rstMeta.getColumnType(i); + String columnName = rstMeta.getColumnName(i); + switch (type) + { + case Types.CLOB: + Clob clob = rst.getClob(i); + if (clob != null) + result.put(columnName, clob.getSubString((long) 1, (int) clob.length())); + else + result.put(columnName, null); + break; + + default: + Object obj = rst.getObject(i); + result.put(columnName, obj); + break; + } + } + + if (resultClass == Map.class || resultClass == HashMap.class || resultClass == LinkedHashMap.class) + resultList.add(result.instance()); + else if (resultClass == TreeMap.class) + resultList.add(new TreeMap(result.instance())); + else if (resultClass == TreeMapSO.class) + resultList.add(new TreeMapSO(result)); + else + resultList.add(result); + } + while (rst.next()); + + resultList.trimToSize(); + return resultList; + } + + /** + * 解释结果集到DBO中 + * + * @param rst 结果集 + * @param resultDbo 结果DBO + * @return 结果表 + * @throws SQLException SQL异常 + */ + public static List parseToDbo(ResultSet rst, Dbo resultDbo) throws Exception + { + if (!rst.next()) + {//先判断是否有数据 + return new ArrayList<>(); + } + + ArrayList resultList = new ArrayList<>(); + ResultSetMetaData rstMeta = rst.getMetaData(); + int columnCount = rstMeta.getColumnCount(); + + do + { + // 生成DBO + Object result = Classes.newInstance(resultDbo.getName()); + for (int i = 1; i <= columnCount; i++) + {// 从1开始 + String columnName = rstMeta.getColumnName(i); + int columnType = rstMeta.getColumnType(i); + parseToDboField(rst, result, resultDbo, columnName, columnType, i); + } + + resultList.add(result); + } + while (rst.next()); + + resultList.trimToSize(); + return resultList; + } + + /** + * 解释结果集到DBO中,使用反射调用结果集方法设置数据 + * + * @param rst 结果集 + * @param result 结果对象 + * @param dbo 数据库对象 + * @param columnName 列名 + * @param i 索引 + * @throws Exception 可能的异常 + */ + private static void parseToDboField(ResultSet rst, Object result, Dbo dbo, String columnName, int columnType, int i) throws Exception + { + //查找属性,先找列对应,后找属性对应 + DboField field = dbo.getField(columnName); + if (field == null) + return; + + Class clazz = result.getClass(); + String method = field.getSetMethod(); + int type = field.getType(); + Object obj = null; + Method m = null; + + switch (type) + { + //基本类型 + case Z_ORM_BOOLEAN_INT: obj = rst.getBoolean(i);m = clazz.getMethod(method, boolean.class);break; + case Z_ORM_BYTE_INT: obj = rst.getInt(i);m = clazz.getMethod(method, int.class);break; + case Z_ORM_SHORT_INT: obj = rst.getInt(i);m = clazz.getMethod(method, int.class);break; + case Z_ORM_INT_INT: obj = rst.getInt(i);m = clazz.getMethod(method, int.class);break; + case Z_ORM_LONG_INT: obj = rst.getLong(i);m = clazz.getMethod(method, long.class);break; + //小数和时间 + case Z_ORM_DECIMAL_INT: obj = rst.getDouble(i);m = clazz.getMethod(method, double.class);break; + case Z_ORM_DATETIME_INT: obj = rst.getTimestamp(i);break; + //字符串 + case Z_ORM_STRING_INT: + { + if (Types.CLOB == columnType) + {//CLOB + Clob clob = rst.getClob(i); + if (clob != null) + obj = clob.getSubString(0, (int)clob.length()); + } + else + {//其他类型直接读取字符串 + obj = rst.getString(i); + } + break; + } + //二进制字节数组 + case Z_ORM_BINARY_INT: + { + if (Types.BLOB == columnType) + { + Blob blob = rst.getBlob(i); + if (blob != null) + obj = blob.getBytes(1, (int)blob.length()); + } + else + {//其他类型直接读byte[] + obj = rst.getBytes(i); + } + break; + } + default: + obj = rst.getObject(i); + break; + } + + if (obj != null) + { + if (m == null) + m = clazz.getMethod(method, obj.getClass()); + m.invoke(result, obj); + } + } + + /*******************************************************************************************/ + //从结果集或结果中读取对象 + /*******************************************************************************************/ + + /** + * 从结果集中读取对象 + * + * @param resultClass 结果类 + * @param rst 结果集 + * @param index 索引值 + * @return 索引位置的对象 + * @throws SQLException SQL异常 + */ + public static Object getValue(Class resultClass, ResultSet rst, int index) throws SQLException + { + if (resultClass == boolean.class || resultClass == Boolean.class) + return rst.getBoolean(index); + else if (resultClass == byte.class || resultClass == Byte.class || resultClass == short.class || resultClass == Short.class || resultClass == int.class || resultClass == Integer.class) + return rst.getInt(index); + else if (resultClass == long.class || resultClass == Long.class) + return rst.getLong(index); + //日期类型 + else if (resultClass == Timestamp.class) + return rst.getTimestamp(index); + else if (resultClass == Date.class) + return rst.getDate(index); + else if (resultClass == Time.class) + return rst.getTime(index); + //字符串 + else if (resultClass == String.class) + return rst.getString(index); + //二进制 + else if (resultClass == byte[].class) + return rst.getBytes(index); + else + {//其他类型 + return rst.getObject(index); + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/datasource/ZStatement.java b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZStatement.java new file mode 100644 index 0000000..ee2568c --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/datasource/ZStatement.java @@ -0,0 +1,316 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.datasource; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.StringReader; +import java.io.Writer; +import java.sql.Date; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Time; +import java.sql.Timestamp; +import java.sql.Types; +import java.util.ArrayList; +import java.util.List; + +import oracle.sql.BLOB; +import oracle.sql.CLOB; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Hexs; +import org.zhiqim.kernel.util.Replaces; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMServer; + +/** + * 数据库处理工具类 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZStatement +{ + /** + * 预处理语句设置参数,对SQL语句填充后返回SQL语句,用于打印日志 + * + * @param server ORM服务 + * @param pstmt 预处理语句 + * @param index 索引 + * @param value 设置的值 + * @param str SQL语句 + * @return 填充后的SQL语句 + * @throws SQLException SQL异常 + * @throws IOException IO异常 + */ + public static String setParameter(ORMServer server, PreparedStatement pstmt, int index, Object value, String str) throws SQLException, IOException + { + if (value == null) + { + pstmt.setNull(index, Types.CHAR);//注意这里用Types.CHAR,可以保证string,int,long等值正确,其他的未测试 + str = str.replaceFirst("\\?", "null"); + } + //基本类型 + else if (value instanceof Boolean) + { + pstmt.setBoolean(index, ((Boolean)value).booleanValue()); + str = str.replaceFirst("\\?", String.valueOf(value)); + } + else if (value instanceof Byte) + { + pstmt.setByte(index, ((Byte)value).byteValue()); + str = str.replaceFirst("\\?", String.valueOf(value)); + } + else if (value instanceof Short) + { + pstmt.setShort(index, ((Short)value).shortValue()); + str = str.replaceFirst("\\?", String.valueOf(value)); + } + else if (value instanceof Integer) + { + pstmt.setInt(index, ((Integer)value).intValue()); + str = str.replaceFirst("\\?", String.valueOf(value)); + } + else if (value instanceof Long) + { + pstmt.setLong(index, ((Long)value).longValue()); + str = str.replaceFirst("\\?", String.valueOf(value)); + } + //日期格式 + else if (value instanceof Timestamp) + { + Timestamp time = (Timestamp)value; + pstmt.setTimestamp(index, time); + + str = str.replaceFirst("\\?", "'" + Sqls.toDateTimeString(time) + "'"); + } + else if (value instanceof Date) + { + Date date = (Date)value; + pstmt.setDate(index, date); + + str = str.replaceFirst("\\?", "'" + Sqls.toDateString(date) + "'"); + } + else if (value instanceof Time) + { + Time time = (Time)value; + pstmt.setTime(index, time); + + str = str.replaceFirst("\\?", "'" + Sqls.toTimeString(time) + "'"); + } + //字符串 + else if (value instanceof String) + { + String v = (String)value; + if (v.length() <= 2000) + pstmt.setString(index, v); + else if (server.isOracle()) + {//oracle + CLOB clob = CLOB.createTemporary(pstmt.getConnection(), false, CLOB.DURATION_SESSION); + clob.open(CLOB.MODE_READWRITE); + Writer writer = clob.getCharacterOutputStream(); + writer.write(v); + writer.close(); + clob.close(); + + pstmt.setClob(index, clob); + } + else + {//其他 + StringReader reader = new StringReader(v); + pstmt.setCharacterStream(index, reader, v.length()); + } + + //SQL转义 + v = v.replaceAll("'", "''"); + if (v.indexOf("?") != -1) + {//转义 + v = v.replaceAll("\\?", "-%6-%-3%-"); + } + + v = Replaces.toReplaceEscape(v); + str = str.replaceFirst("\\?", "'"+ v +"'"); + } + //二进制 + else if (value instanceof byte[]) + { + byte[] v = (byte[])value; + if (!server.isOracle()) + pstmt.setBytes(index, v); + else + { + BLOB blob = BLOB.createTemporary(pstmt.getConnection(), false, BLOB.DURATION_SESSION); + blob.open(BLOB.MODE_READWRITE); + OutputStream os = blob.getBinaryOutputStream(); + os.write(v); + os.close(); + blob.close(); + + pstmt.setBlob(index, blob); + } + + str = str.replaceFirst("\\?", "'"+ Hexs.toHexString(v) +"'"); + } + else + {//其他类型 + pstmt.setObject(index, value); + str = str.replaceFirst("\\?", String.valueOf(value)); + } + + return str; + } + + /** + * 预处理语句设置参数 + * + * @param server ORM服务 + * @param pstmt 预处理语句 + * @param index 索引 + * @param value 设置的值 + * @throws SQLException SQL异常 + * @throws IOException IO异常 + */ + public static void setParameter(ORMServer server, PreparedStatement pstmt, int index, Object value) throws SQLException, IOException + { + if (value == null) + pstmt.setNull(index, Types.CHAR);//注意这里用Types.CHAR,可以保证string,int,long等值正确,其他的未测试 + + //基本类型 + else if (value instanceof Boolean) + pstmt.setBoolean(index, ((Boolean)value).booleanValue()); + else if (value instanceof Byte) + pstmt.setByte(index, ((Byte)value).byteValue()); + else if (value instanceof Short) + pstmt.setShort(index, ((Short)value).shortValue()); + else if (value instanceof Integer) + pstmt.setInt(index, ((Integer)value).intValue()); + else if (value instanceof Long) + pstmt.setLong(index, ((Long)value).longValue()); + //日期类型 + else if (value instanceof Timestamp) + pstmt.setTimestamp(index, (Timestamp)value); + else if (value instanceof Date) + pstmt.setDate(index, (Date)value); + else if (value instanceof Time) + pstmt.setTime(index, (Time)value); + //字符串 + else if (value instanceof String) + { + String v = (String)value; + if (v.length() <= 2000) + pstmt.setString(index, (String)value); + else if (server.isOracle()) + {//oracle clob + CLOB clob = CLOB.createTemporary(pstmt.getConnection(), false, CLOB.DURATION_SESSION); + clob.open(CLOB.MODE_READWRITE); + Writer writer = clob.getCharacterOutputStream(); + writer.write(v); + writer.close(); + clob.close(); + + pstmt.setClob(index, clob); + } + else + {//其他 + StringReader reader = new StringReader(v); + pstmt.setCharacterStream(index, reader, v.length()); + } + } + //二进制 + else if (value instanceof byte[]) + { + byte[] v = (byte[])value; + if (!server.isOracle()) + pstmt.setBytes(index, v); + else + {//oracle blob + BLOB blob = BLOB.createTemporary(pstmt.getConnection(), false, BLOB.DURATION_SESSION); + blob.open(BLOB.MODE_READWRITE); + OutputStream os = blob.getBinaryOutputStream(); + os.write(v); + os.close(); + blob.close(); + + pstmt.setBlob(index, blob); + } + } + else + {//其他类型 + pstmt.setObject(index, value); + } + } + + + /** + * 替换SQL中##参数值为? + * + * @param sql SQL语句 + * @param paramKeyList 参数KEY列表 + * @return 新的SQL语句 + */ + public static String paramMapString(String sql, List paramKeyList) + { + for (int i=0,start=0,end=sql.indexOf('#');end!=-1;i++,start=end,end=sql.indexOf('#', start+1)) + { + if (i % 2 == 0) + continue; + String paramKey = sql.substring(start + 1, end); + paramKeyList.add(paramKey); + } + + for (int i=0;i paramKeyList = new ArrayList(); + for (int i=0,start=0,end=sql.indexOf('#');end!=-1;i++,start=end,end=sql.indexOf('#', start+1)) + { + if (i % 2 == 0) + continue; + String paramKey = sql.substring(start + 1, end); + paramKeyList.add(paramKey); + } + + for (int i=0;i. + */ +package org.zhiqim.orm.dbo; + +/** + * 批处理类型 + * + * @version v1.0.0 @author zouzhigang 2019-3-29 新建与整理 + */ +public enum BatchType +{ + /*****************************************************************************/ + //枚举类型定义 + /*****************************************************************************/ + + /** 插入 */ + INSERT, + + /** 替换 */ + REPLACE, + + /** 插入或更新 */ + INSERT_OR_UPDATE, + + /** 更新 */ + UPDATE, + + /** 更新器 */ + UPDATER, + + /** 使用主键删除 */ + DELETE_ID, + + /** 使用查询器删除 */ + DELETE_SELECTOR; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/Batcher.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/Batcher.java new file mode 100644 index 0000000..e065876 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/Batcher.java @@ -0,0 +1,314 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo; + +import org.zhiqim.kernel.extend.MapSS; + + +/** + * 批量处理封装 + * + * @version v1.0.0 @author zouzhigang 2019-3-29 新建与整理 + */ +public class Batcher +{ + private BatchType type; + + //插入 + private Object insertData; + private MapSS insertReplaceMap; + + //替换 + private Object replaceData; + private MapSS replaceReplaceMap; + + //插入或更新 + private Object insertOrUpdateData; + private Updater insertOrUpdateUpdater; + + //更新 + private Object updateData; + private MapSS updateReplaceMap; + + //更新器 + private Class updaterClass; + private Updater updaterUpdater; + + //删除 + private Class deleteClass; + private MapSS deleteReplaceMap; + private Object[] deleteIds; + private Selector deleteSelector; + + /*************************************************************************************/ + //设置 + /*************************************************************************************/ + + /** + * 增加数据,传入标准[表类]对象 + * + * @param data 表对象 + * @return 当前对象 + */ + public Batcher insert(Object data) + { + this.insertData = data; + + this.type = BatchType.INSERT; + return this; + } + + /** + * 增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param data 表对象 + * @param replaceMap 适配表 + * @return 当前对象 + */ + public Batcher insert(Object data, MapSS replaceMap) + { + this.insertData = data; + this.insertReplaceMap = replaceMap; + + this.type = BatchType.INSERT; + return this; + } + + /** + * 替换数据,传入标准[表类]对象和更新器(取fieldMap和replaceMap)当存在时指定修改的值 + * + * @param data 表对象 + * @param updater 更新器 + * @return 当前对象 + */ + public Batcher insertOrUpdate(Object data, Updater updater) + { + this.insertOrUpdateData = data; + this.insertOrUpdateUpdater = updater; + + this.type = BatchType.INSERT_OR_UPDATE; + return this; + } + + /** + * 替换数据,传入标准[表类]对象 + * + * @param data 表对象 + * @return 当前对象 + */ + public Batcher replace(Object data) + { + this.replaceData = data; + + this.type = BatchType.REPLACE; + return this; + } + + /** + * 替换数据,支持表或字段中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param data 表对象 + * @param replaceMap 适配表 + * @return 当前对象 + */ + public Batcher replace(Object data, MapSS replaceMap) + { + this.replaceData = data; + this.replaceReplaceMap = replaceMap; + + this.type = BatchType.REPLACE; + return this; + } + + /** + * 更新数据,指定更新器需要更新的字段、条件和可替换表 + * + * @param cls 表类 + * @param updater 更新器 + * @return 当前对象 + */ + public Batcher update(Class cls, Updater updater) + { + this.updaterClass = cls; + this.updaterUpdater = updater; + + this.type = BatchType.UPDATE; + return this; + } + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新 + * + * @param data 表对象 + * @return 当前对象 + */ + public Batcher update(Object data) + { + this.updateData = data; + + this.type = BatchType.UPDATE; + return this; + } + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持可替换表 + * + * @param data 表对象 + * @param replaceMap 适配表 + * @return 当前对象 + */ + public Batcher update(Object data, MapSS replaceMap) + { + this.updateData = data; + this.updateReplaceMap = replaceMap; + return this; + } + + /** + * 删除数据,多个主键时使用 + * + * @param cls 表类 + * @param ids 关键属性为数组,多个主键 + * @return 当前对象 + */ + public Batcher delete(Class cls, Object... ids) + { + this.deleteClass = cls; + this.deleteIds = ids; + + this.type = BatchType.DELETE_ID; + return this; + } + + /** + * 删除数据,多个主键时使用 + * + * @param cls 表类 + * @param replaceMap 替换表 + * @param ids 关键属性为数组,多个主键 + * @return 当前对象 + */ + public Batcher delete(Class cls, MapSS replaceMap, Object... ids) + { + this.deleteClass = cls; + this.deleteReplaceMap = replaceMap; + this.deleteIds = ids; + + this.type = BatchType.DELETE_ID; + return this; + } + + /** + * 删除数据, 根据条件 + * + * @param cls 表类 + * @param selector 对象选择器 + * @return 当前对象 + */ + public Batcher delete(Class cls, Selector selector) + { + this.deleteClass = cls; + this.deleteSelector = selector == null?new Selector():selector; + + this.type = BatchType.DELETE_SELECTOR; + return this; + } + + /********************************************************************************************/ + //获取 + /********************************************************************************************/ + + public BatchType getType() + { + return type; + } + + public Object getInsertData() + { + return insertData; + } + + public MapSS getInsertReplaceMap() + { + return insertReplaceMap; + } + + public Object getReplaceData() + { + return replaceData; + } + + public MapSS getReplaceReplaceMap() + { + return replaceReplaceMap; + } + + public Object getInsertOrUpdateData() + { + return insertOrUpdateData; + } + + public Updater getInsertOrUpdateUpdater() + { + return insertOrUpdateUpdater; + } + + public Object getUpdateData() + { + return updateData; + } + + public MapSS getUpdateReplaceMap() + { + return updateReplaceMap; + } + + public Class getUpdaterClass() + { + return updaterClass; + } + + public Updater getUpdaterUpdater() + { + return updaterUpdater; + } + + public Class getDeleteClass() + { + return deleteClass; + } + + public MapSS getDeleteReplaceMap() + { + return deleteReplaceMap; + } + + public Object[] getDeleteIds() + { + return deleteIds; + } + + public Selector getDeleteSelector() + { + return deleteSelector; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/CallParam.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/CallParam.java new file mode 100644 index 0000000..18d6ddf --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/CallParam.java @@ -0,0 +1,106 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo; + +import java.sql.CallableStatement; +import java.sql.SQLException; + +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.datasource.ZCall; + +/** + * 调用参数 + * + * @version v1.4.1 @author zouzhigang 2018-7-23 新建与整理 + */ +public final class CallParam implements ORMConstants +{ + private CALL_TYPE type; + private Class clazz; + private Object value; + + private CallParam(CALL_TYPE type, Class clazz) + { + this.type = type; + this.clazz = clazz; + } + + private CallParam(CALL_TYPE type, Object value) + { + this.type = type; + this.value = value; + this.clazz = value.getClass(); + } + + public CALL_TYPE type() + { + return type; + } + + public Object value() + { + return value; + } + + /**********************************************************************************/ + //三种生成参数对象 + /**********************************************************************************/ + + public boolean isInWrite() + { + return this.type == CALL_TYPE.IN || this.type == CALL_TYPE.INOUT; + } + + public boolean isOutRead() + { + return this.type == CALL_TYPE.OUT || this.type == CALL_TYPE.INOUT; + } + + public int typeSQL() + { + return ZCall.getType(clazz); + } + + public void value(CallableStatement cstmt, int index) throws SQLException + { + value = ZCall.getValue(clazz, cstmt, index); + } + + /**********************************************************************************/ + //三种生成参数对象 + /**********************************************************************************/ + + public static CallParam in(Object value) + { + return new CallParam(CALL_TYPE.IN, value); + } + + public static CallParam inout(Object value) + { + return new CallParam(CALL_TYPE.INOUT, value); + } + + public static CallParam out(Class clazz) + { + return new CallParam(CALL_TYPE.OUT, clazz); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/CallResult.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/CallResult.java new file mode 100644 index 0000000..4c9ac2a --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/CallResult.java @@ -0,0 +1,62 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo; + +import java.util.ArrayList; +import java.util.List; + +/** + * 调用结果集 + * + * @version v1.4.1 @author zouzhigang 2018-7-23 新建与整理 + */ +public class CallResult +{ + private Class resultClass; + private List resultList; + + private CallResult(Class resultClass) + { + this.resultClass = resultClass; + this.resultList = new ArrayList<>(); + } + + public Class getResultClass() + { + return resultClass; + } + + public List getResultList() + { + return resultList; + } + + public void setResultList(List resultList) + { + this.resultList = resultList; + } + + public static CallResult set(Class resultClass) + { + return new CallResult(resultClass); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/Comparator.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/Comparator.java new file mode 100644 index 0000000..4db7482 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/Comparator.java @@ -0,0 +1,131 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo; + +import java.sql.Timestamp; +import java.util.Map.Entry; + +import org.zhiqim.kernel.extend.LinkedMapSS; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.orm.ORMConstants; + +/** + * 对象比较器,用于排序,其中静态方法用于条件比较 + * + * @version v1.0.0 @author zouzhigang 2017-8-23 新建与整理 + */ +public class Comparator implements java.util.Comparator, ORMConstants +{ + private Selector selector; + + public Comparator(Selector selector) + { + this.selector = selector; + } + + @Override + public int compare(T o1, T o2) + { + if (selector == null) + return 0; + + LinkedMapSS orderbyMap = selector.getOrderby(); + if (orderbyMap == null || orderbyMap.isEmpty()) + return 0; + + for (Entry entry : orderbyMap.entrySet()) + { + String field = entry.getKey(); + String orderby = entry.getValue(); + boolean isAsc = ASC.equals(orderby); + + Object value1 = Classes.getFieldValue(o1, field); + Object value2 = Classes.getFieldValue(o2, field); + int val = compareValue(value1, value2); + if (val == 0) + continue; + + return ((val < 0 && isAsc) || (val > 0 && !isAsc))?-1:1; + } + + return 0; + } + + /** + * 比较两个对象值,9种数据库类型转为Java的6种类型 + * + * @param value1 值1 + * @param value2 值2 + * @return =0表示相等,>0表示前者大,<0表示后者大 + */ + public static int compareValue(Object value1, Object value2) + { + Asserts.as(value1.getClass() == value2.getClass()?null:"比较的两个对象类型不一致"); + + switch (value1.getClass().getName().hashCode()) + { + case BOOLEAN_OBJ_CODE: + { + boolean v1 = (Boolean)value1; + boolean v2 = (Boolean)value2; + int v11 = v1?1:0; + int v22 = v2?1:0; + return v11 - v22; + } + case INT_OBJ_CODE: + { + int v1 = (Integer)value1; + int v2 = (Integer)value2; + return v1 - v2; + } + case LONG_OBJ_CODE: + { + long v1 = (Long)value1; + long v2 = (Long)value2; + return v1 == v2?0:(v1 > v2)?1:-1; + } + case STRING_CODE: + { + String v1 = (String)value1; + String v2 = (String)value2; + return v1.compareTo(v2); + } + case DOUBLE_OBJ_CODE: + { + double v1 = (Double)value1; + double v2 = (Double)value2; + return v1 == v2?0:(v1 > v2)?1:-1; + } + case TIMESTAMP_CODE: + { + Timestamp v1 = (Timestamp)value1; + Timestamp v2 = (Timestamp)value2; + long v11 = v1.getTime(); + long v22 = v2.getTime(); + return v11 == v22?0:(v11 > v22)?1:-1; + } + default: + throw Asserts.exception("比较的对象类型不是ORM支持的类型"); + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/Condition.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/Condition.java new file mode 100644 index 0000000..8a0f800 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/Condition.java @@ -0,0 +1,132 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.orm.ORMException; + +public abstract class Condition implements SignConstants +{ + //比较条件 + public static final String EQUAL = "="; //= 等于 + public static final String EQUAL_NOT = "<>"; //<> 不等 + public static final String LIKE = "like"; //like 两边都LIKE %value%,左边%value,右边value% + public static final String LIKE_NOT = "not like"; //not like 两边都LIKE %value%,左边%value,右边value% + public static final String THEN_G = ">"; //> 大于 + public static final String THEN_GE = ">="; //>= 大于等于 + public static final String THEN_L = "<"; //< 小于 + public static final String THEN_LE = "<="; //<= 小于等于 + //判断条件 + public static final String IS_NULL = "is null"; //is null 为空 + public static final String IS_NOT_NULL = "is not null"; //is not null 不为空 + public static final String IN = "in"; //in 包含 + public static final String IN_NOT = "not in"; //not in 不包含 + //多重条件 + public static final String OR = "or"; //or 或者 + + /*******************************************************************/ + //子类必须实现的方法 + /*******************************************************************/ + + /** + * 判断对象是否匹配 + * + * @param obj 比较的对象 + * @return =true表示匹配成功 + */ + public abstract boolean match(Object obj); + + /** + * 生成FDbo对应的条件SQL + * + * @param dbo _Dbo/_Table/_View三种的一种 + * @param paramMap 由Selector/Updater指定的参数表 + * @return SQL + * @throws ORMException 异常 + */ + public abstract String toSql(Dbo dbo, MapSO paramMap) throws ORMException; + + + /*******************************************************************/ + //内部断言方法和值转换方法 + /*******************************************************************/ + + /** + * 验证字段在DBO中的有效性 + * + * @param dbo 数据库对象 + * @param field 字段 + * @throws ORMException 异常 + */ + protected void assertField(Dbo dbo, String field) throws ORMException + { + if (!dbo.hasField(field)) + throw new ORMException("ZTable/ZView["+dbo.getName()+"]配置中未找到["+field+"]属性"); + } + + /** + * 断言是否是int[],long[],String[]三种 + * + * @param value 值 + * @throws ORMException 异常 + */ + protected void assertArray(Object value) throws ORMException + { + if (!(value instanceof int[]) && !(value instanceof long[]) && !(value instanceof String[])) + throw new ORMException("ZTable/ZView[in/not in]仅支持int[],long[],String[]三种数组类型"); + } + + /** + * 值转换,针对对象转换成数据库支持的类型 + * + * @param value 原值 + * @return 转换后的值 + */ + protected Object convertValue(Object value) + { + if (value instanceof Boolean) + {//boolean型转换成int型 + boolean b = (Boolean)value; + return b?1:0; + } + + return value; + } + + /** + * 值转换,针对in/not in把对象转换成数组格式 + * + * @param value 原值 + * @return 转换后的值 + */ + protected String convertArray(Object value) + { + if (value instanceof int[]) + return "("+Arrays.toString((int[])value, ",") + ")"; + else if (value instanceof long[]) + return "("+Arrays.toString((long[])value, ",") + ")"; + else + return "("+Arrays.toStringSql((String[])value, ",") + ")"; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/Conditioner.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/Conditioner.java new file mode 100644 index 0000000..23cd164 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/Conditioner.java @@ -0,0 +1,700 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo; + +import java.io.Serializable; +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.LinkedMapSS; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Types; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.dbo.condition._Equal; +import org.zhiqim.orm.dbo.condition._EqualNot; +import org.zhiqim.orm.dbo.condition._Expression; +import org.zhiqim.orm.dbo.condition._In; +import org.zhiqim.orm.dbo.condition._InNot; +import org.zhiqim.orm.dbo.condition._IsEmpty; +import org.zhiqim.orm.dbo.condition._IsNotEmpty; +import org.zhiqim.orm.dbo.condition._IsNotNull; +import org.zhiqim.orm.dbo.condition._IsNull; +import org.zhiqim.orm.dbo.condition._Like; +import org.zhiqim.orm.dbo.condition._LikeL; +import org.zhiqim.orm.dbo.condition._LikeNot; +import org.zhiqim.orm.dbo.condition._LikeNotL; +import org.zhiqim.orm.dbo.condition._LikeNotR; +import org.zhiqim.orm.dbo.condition._LikeR; +import org.zhiqim.orm.dbo.condition._Or; +import org.zhiqim.orm.dbo.condition._ThenG; +import org.zhiqim.orm.dbo.condition._ThenGE; +import org.zhiqim.orm.dbo.condition._ThenL; +import org.zhiqim.orm.dbo.condition._ThenLE; + +/** + * 条件管理器,管理条件和可替换表 + * 1. @see Selector 查询器 + * 2. @see Updater 更新器 + * + * @version v1.0.0 @author zouzhigang 2016-6-27 新建与整理 + */ +abstract class Conditioner> implements Serializable, ORMConstants +{ + private static final long serialVersionUID = 1L; + + protected List conditionList = null; + protected LinkedMapSS replaceMap = new LinkedMapSS(); + + /** 返回对应的适配信息 */ + public LinkedMapSS getReplaceMap() + { + return replaceMap; + } + + public List getConditionList() + { + return conditionList; + } + + public boolean hasCondition() + { + return conditionList != null && !conditionList.isEmpty(); + } + + /******************************************************/ + //条件列表管理 + /******************************************************/ + + /** 增加[可能][相等]条件 */ + public C addMaybe(String field, Object value) + { + if (!chkMaybeFieldValue(field, value)) + return self(); + + addCondition(new _Equal(field, value)); + return self(); + } + + /** 增加[强制][相等]条件 */ + public C addMust(String field, Object value) + { + chkMustFieldValue(field, value); + addCondition(new _Equal(field, value)); + return self(); + } + + /** 增加[可能][不等]条件 */ + public C addMaybeNotEqual(String field, Object value) + { + if (!chkMaybeFieldValue(field, value)) + return self(); + + addCondition(new _EqualNot(field, value)); + return self(); + } + + /** 增加[强制][不等]条件 */ + public C addMustNotEqual(String field, Object value) + { + chkMustFieldValue(field, value); + addCondition(new _EqualNot(field, value)); + return self(); + } + + /** 增加[可能][LIKE]条件 */ + public C addMaybeLike(String field, Object value) + { + if (!chkMaybeFieldValue(field, value)) + return self(); + + addCondition(new _Like(field, String.valueOf(value))); + return self(); + } + + /** 增加[强制][LIKE]条件 */ + public C addMustLike(String field, Object value) + { + chkMustFieldValue(field, value); + addCondition(new _Like(field, String.valueOf(value))); + return self(); + } + + /** 增加[可能][LIKE_LEFT]查询条件 */ + public C addMaybeLikeLeft(String field, Object value) + { + if (!chkMaybeFieldValue(field, value)) + return self(); + + addCondition(new _LikeL(field, String.valueOf(value))); + return self(); + } + + /** 增加[强制][LIKE_LEFT]条件 */ + public C addMustLikeLeft(String field, Object value) + { + chkMustFieldValue(field, value); + addCondition(new _LikeL(field, String.valueOf(value))); + return self(); + } + + /** 增加[可能][LIKE_RIGHT]查询条件 */ + public C addMaybeLikeRight(String field, Object value) + { + if (!chkMaybeFieldValue(field, value)) + return self(); + + addCondition(new _LikeR(field, String.valueOf(value))); + return self(); + } + + /** 增加[强制][LIKE_RIGHT]查询条件 */ + public C addMustLikeRight(String field, Object value) + { + chkMustFieldValue(field, value); + addCondition(new _LikeR(field, String.valueOf(value))); + return self(); + } + + /** 增加[可能][NOT LIKE]条件 */ + public C addMaybeNotLike(String field, Object value) + { + if (!chkMaybeFieldValue(field, value)) + return self(); + + addCondition(new _LikeNot(field, String.valueOf(value))); + return self(); + } + + /** 增加[强制][NOT LIKE]条件 */ + public C addMustNotLike(String field, Object value) + { + chkMustFieldValue(field, value); + addCondition(new _LikeNot(field, String.valueOf(value))); + return self(); + } + + /** 增加[可能][NOT LIKE_LEFT]查询条件 */ + public C addMaybeNotLikeLeft(String field, Object value) + { + if (!chkMaybeFieldValue(field, value)) + return self(); + + addCondition(new _LikeNotL(field, String.valueOf(value))); + return self(); + } + + /** 增加[强制][NOT LIKE_LEFT]条件 */ + public C addMustNotLikeLeft(String field, Object value) + { + chkMustFieldValue(field, value); + addCondition(new _LikeNotL(field, String.valueOf(value))); + return self(); + } + + /** 增加[可能][NOT LIKE_RIGHT]查询条件 */ + public C addMaybeNotLikeRight(String field, Object value) + { + if (!chkMaybeFieldValue(field, value)) + return self(); + + addCondition(new _LikeNotR(field, String.valueOf(value))); + return self(); + } + + /** 增加[强制][NOT LIKE_RIGHT]查询条件 */ + public C addMustNotLikeRight(String field, Object value) + { + chkMustFieldValue(field, value); + addCondition(new _LikeNotR(field, String.valueOf(value))); + return self(); + } + + /** 增加[可能][大于]查询条件 */ + public C addMaybeThenG(String field, Object value) + { + if (!chkMaybeFieldValue(field, value)) + return self(); + + addCondition(new _ThenG(field, value)); + return self(); + } + + /** 增加[强制][大于]查询条件 */ + public C addMustThenG(String field, Object value) + { + chkMustFieldValue(field, value); + addCondition(new _ThenG(field, value)); + return self(); + } + + /** 增加[可能][大于等于]查询条件 */ + public C addMaybeThenGE(String field, Object value) + { + if (!chkMaybeFieldValue(field, value)) + return self(); + + addCondition(new _ThenGE(field, value)); + return self(); + } + + /** 增加[强制][大于等于]查询条件 */ + public C addMustThenGE(String field, Object value) + { + chkMustFieldValue(field, value); + addCondition(new _ThenGE(field, value)); + return self(); + } + + /** 增加[可能][小于]查询条件 */ + public C addMaybeThenL(String field, Object value) + { + if (!chkMaybeFieldValue(field, value)) + return self(); + + addCondition(new _ThenL(field, value)); + return self(); + } + + /** 增加[强制][小于]查询条件 */ + public C addMustThenL(String field, Object value) + { + chkMustFieldValue(field, value); + addCondition(new _ThenL(field, value)); + return self(); + } + + /** 增加[可能][小于等于]查询条件 */ + public C addMaybeThenLE(String field, Object value) + { + if (!chkMaybeFieldValue(field, value)) + return self(); + + addCondition(new _ThenLE(field, value)); + return self(); + } + + /** 增加[强制][小于等于]查询条件 */ + public C addMustThenLE(String field, Object value) + { + chkMustFieldValue(field, value); + addCondition(new _ThenLE(field, value)); + return self(); + } + + /** 增加[可能][is null]查询条件 */ + public C addMaybeIsNull(String field) + { + if (!chkMaybeFieldValue(field)) + return self(); + + addCondition(new _IsNull(field)); + return self(); + } + + /** 增加[强制][is null]查询条件 */ + public C addMustIsNull(String field) + { + chkMustFieldValue(field); + addCondition(new _IsNull(field)); + return self(); + } + + /** 增加[可能][is not null]查询条件 */ + public C addMaybeIsNotNull(String field) + { + if (!chkMaybeFieldValue(field)) + return self(); + + addCondition(new _IsNotNull(field)); + return self(); + } + + /** 增加[强制][is not null]查询条件 */ + public C addMustIsNotNull(String field) + { + chkMustFieldValue(field); + addCondition(new _IsNotNull(field)); + return self(); + } + + /** 增加[可能][is null or = '']查询条件 */ + public C addMaybeIsEmpty(String field) + { + if (!chkMaybeFieldValue(field)) + return self(); + + addCondition(new _IsEmpty(field)); + return self(); + } + + /** 增加[强制][is null or = '']查询条件 */ + public C addMustIsEmpty(String field) + { + chkMustFieldValue(field); + addCondition(new _IsEmpty(field)); + return self(); + } + + /** 增加[可能][is not null and <> '']查询条件 */ + public C addMaybeIsNotEmpty(String field) + { + if (!chkMaybeFieldValue(field)) + return self(); + + addCondition(new _IsNotEmpty(field)); + return self(); + } + + /** 增加[强制][is not null and <> '']查询条件 */ + public C addMustIsNotEmpty(String field) + { + chkMustFieldValue(field); + addCondition(new _IsNotEmpty(field)); + return self(); + } + + /** 增加[可能][in][String]查询条件 */ + public C addMaybeIn(String field, String ... values) + { + if (!chkMaybeFieldValue(field, values)) + return self(); + + addCondition(new _In(field, values)); + return self(); + } + + /** 增加[强制][in][String]查询条件 */ + public C addMustIn(String field, String ... values) + { + chkMustFieldValue(field, values); + addCondition(new _In(field, values)); + return self(); + } + + /** 增加[可能][in][int]查询条件 */ + public C addMaybeIn(String field, int ... values) + { + if (!chkMaybeFieldValue(field, values)) + return self(); + + addCondition(new _In(field, values)); + return self(); + } + + /** 增加[强制][in][int]查询条件 */ + public C addMustIn(String field, int ... values) + { + chkMustFieldValue(field, values); + addCondition(new _In(field, values)); + return self(); + } + + /** 增加[可能][in][long]查询条件 */ + public C addMaybeInLong(String field, long ... values) + { + if (!chkMaybeFieldValue(field, values)) + return self(); + + addCondition(new _In(field, values)); + return self(); + } + + /** 增加[强制][in][long]查询条件 */ + public C addMustInLong(String field, long ... values) + { + chkMustFieldValue(field, values); + addCondition(new _In(field, values)); + return self(); + } + + /** 增加[可能][not in][String]查询条件 */ + public C addMaybeNotIn(String field, String ... values) + { + if (!chkMaybeFieldValue(field, values)) + return self(); + + addCondition(new _InNot(field, values)); + return self(); + } + + /** 增加[强制][not in][String]查询条件 */ + public C addMustNotIn(String field, String ... values) + { + chkMustFieldValue(field, values); + addCondition(new _InNot(field, values)); + return self(); + } + + /** 增加[可能][not in][int]查询条件 */ + public C addMaybeNotIn(String field, int ... values) + { + if (!chkMaybeFieldValue(field, values)) + return self(); + + addCondition(new _InNot(field, values)); + return self(); + } + + /** 增加[强制][not in][int]查询条件 */ + public C addMustNotIn(String field, int ... values) + { + chkMustFieldValue(field, values); + addCondition(new _InNot(field, values)); + return self(); + } + + /** 增加[可能][not in][long]查询条件 */ + public C addMaybeNotInLong(String field, long ... values) + { + if (!chkMaybeFieldValue(field, values)) + return self(); + + addCondition(new _InNot(field, values)); + return self(); + } + + /** 增加[强制][not in][long]查询条件 */ + public C addMustNotInLong(String field, long ... values) + { + chkMustFieldValue(field, values); + addCondition(new _InNot(field, values)); + return self(); + } + + /*****************************************************************/ + //表达式管理结束 + /*****************************************************************/ + + /** 增加相等表达式 */ + public C addExpression(String field, String expression) + { + return addExpression(field, expression, Condition.EQUAL); + } + + /** 增加不等表达式 */ + public C addExpressionNotEqual(String field, String expression) + { + return addExpression(field, expression, Condition.EQUAL_NOT); + } + + /** 增加大于表达式 */ + public C addExpressionThenG(String field, String expression) + { + return addExpression(field, expression, Condition.THEN_G); + } + + /** 增加大于等于表达式 */ + public C addExpressionThenGE(String field, String expression) + { + return addExpression(field, expression, Condition.THEN_GE); + } + + /** 增加小于表达式 */ + public C addExpressionThenL(String field, String expression) + { + return addExpression(field, expression, Condition.THEN_L); + } + + /** 增加小于等于表达式 */ + public C addExpressionThenLE(String field, String expression) + { + return addExpression(field, expression, Condition.THEN_LE); + } + + /** 增加表达式 */ + private C addExpression(String field, String expression, String condition) + { + Asserts.notEmptyBlank(field, _FIELD_); + Asserts.notEmptyBlank(expression, _VALUE_); + + addCondition(new _Expression(field, expression, condition)); + return self(); + } + + /*****************************************************************/ + //表达式管理结束 + /*****************************************************************/ + + /** + * 增加或者列表 + * + * @param selector 否则列表由多个条件组成 + * @return 本对象 + */ + public C addOr(Selector selector) + { + List conditionList = selector.getConditionList(); + + Asserts.as(conditionList != null?null:"增加[or]查询条件不能为空"); + Asserts.as(conditionList.size() >= 2?null:"增加[or]查询条件必须>=2个"); + + _Or or = new _Or(); + for (Condition condition : conditionList) + { + or.addCondition(condition); + } + + addCondition(or); + return self(); + } + + /*****************************************************************/ + //条件列表管理结束 + /*****************************************************************/ + + /** + * 组装Where条件的SQL语句 + * + * @param dbo _Dbo/_Table/_View三种的一种 + * @param paramMap 参数表 + * @return SQL字符串 + * @throws ORMException 异常 + */ + public String getWhereSQL(Dbo dbo, MapSO paramMap) throws ORMException + { + if (conditionList == null || conditionList.isEmpty()) + return ""; + + //如果相等的连接条件,后面加and即可,否则先加where,再接and + boolean hasEqualJoin = dbo.hasEqualJoin(); + StringBuilder whereSQL = new StringBuilder(); + //第一个 + whereSQL.append(hasEqualJoin?" and ":" where "); + whereSQL.append(conditionList.get(0).toSql(dbo, paramMap)); + //后面的 + for (int i=1;i(3); + conditionList.add(condition); + } + + /** + * 可能性检查字段是否为空,为空返回false,否则返回true + * + * @param field 字段 + * @return 为空返回false,否则返回true + */ + protected boolean chkMaybeFieldValue(String field) + { + return !Validates.isEmptyBlank(field); + } + + /** + * 强制性检查字段是否为空,为空返回false,否则返回true + * + * @param field 字段 + */ + protected void chkMustFieldValue(String field) + { + Asserts.notEmptyBlank(field); + } + + /** + * 可能性检查字段和值是否为空,为空返回false,否则返回true + * + * @param field 字段 + * @param value 值 + * @return 为空返回false,否则返回true + */ + protected boolean chkMaybeFieldValue(String field, Object value) + { + if (Validates.isEmptyBlank(field) || value == null) + return false; + + if (value instanceof String && Validates.isEmpty((String)value)) + return false; + + if (value instanceof Integer && ((Integer)value) == -1) + return false; + + if (value instanceof Long && ((Long)value) == -1) + return false; + + if (Types.isArray(value)) + { + if (Array.getLength(value) == 0) + return false; + } + + return true; + } + + /** + * 强制性检查字段和值是否为空,为空抛非法参数异常 + * + * @param field 字段 + * @param value 值 + */ + protected void chkMustFieldValue(String field, Object value) + { + Asserts.notEmptyBlank(field, _FIELD_); + Asserts.notNull(value, _VALUE_); + + Asserts.as(!(value instanceof String && Validates.isEmpty((String)value)) ? null : "字段["+field+"]的["+value+"]为String型时值不能为空字符串"); + Asserts.as(!(value instanceof Integer && ((Integer)value) == -1) ? null : "字段["+field+"]的["+value+"]为int型时值不能为-1"); + Asserts.as(!(value instanceof Long && ((Long)value) == -1) ? null : "字段["+field+"]的["+value+"]为long型时值不能为-1"); + + if (Types.isArray(value)) + { + Asserts.as(Array.getLength(value) > 0 ? null : "字段["+field+"]或["+value+"]为Array型时数目必须>0"); + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/Dbo.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/Dbo.java new file mode 100644 index 0000000..0fb2549 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/Dbo.java @@ -0,0 +1,58 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo; + +import org.zhiqim.orm.dbo.defined._Dbo; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.dbo.defined._View; + +/** + * 数据库对象模型,(_Dbo,_Table, _View)三个子类

            + * @see _Dbo 是查询结果对象,用于executeQuery时组装返回一个对象
            + * @see _Table 是数据库表对象,用于ZTable对象映射到数据库进行增删改查
            + * @see _View 是数据库视图对象,由多个表数据组装而成,用于ZView关联查询
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface Dbo +{ + /** 获取类名 */ + public String getName(); + + /** 判断是否是有相等的连接条件 */ + public boolean hasEqualJoin(); + + /** 判断是否存在该字段 */ + public boolean hasField(String fieldName); + + /** 通过字段获取数据库列名 */ + public String getColumn(String fieldName); + + /** 通过字段名获取组装GET方法 */ + public String getGetMethod(String fieldName); + + /** 通过字段名获取字段 */ + public DboField getField(String fieldName); + + /** 获取字段列表,按长度排序 */ + public DboField[] getFieldColumnListOrderByLen(); +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/DboField.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/DboField.java new file mode 100644 index 0000000..5d5595f --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/DboField.java @@ -0,0 +1,48 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo; + +/** + * 数据库对象字段模型,(_DboField, _TableField, _ViewField)三个子类

            + * 1. @see _DboField 数据库查询结构对象的字段 + * 2. @see _TableField 数据库表列,描述类字段和数据库表列名的映射关系,如字段userName对应表列名USER_NAME,类型为String
            + * 3. @see _ViewField 数据库视图关联列,比_TableField多一个table字段,用于指定某个表的列名和类型
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface DboField +{ + /** 字段数据类型,当前支持共9种 */ + public int getType(); + + /** 字段SET方法,用于运行时反射机制赋值 */ + public String getSetMethod(); + + /** 字段SET方法,用于运行时反射机制赋值 */ + public String getGetMethod(); + + /** 获取字段名 */ + public String getField(); + + /** 获取列名 */ + public String getColumn(); +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/Selector.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/Selector.java new file mode 100644 index 0000000..5219060 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/Selector.java @@ -0,0 +1,378 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map.Entry; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.extend.HashMapSV; +import org.zhiqim.kernel.extend.LinkedMapSS; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.defined._Table; + +/** + * 对象查询器,支持查询字段、条件和排序条件 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("Selector") +@AnNew +public class Selector extends Conditioner +{ + private static final long serialVersionUID = 1L; + private static final String FIELD_FORMAT = " ,_ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"; + + private String fields = null; + private String groupby = null; + private LinkedMapSS orderbyMap = null; + private HashMapSV joinMap = null; + + /** 构造空查询器,构造后增加参数 */ + public Selector() + { + } + + /** 构造指定字段串的查询器 */ + public Selector(String fields) + { + addFields(fields); + } + + /** 构造指定一个相等条件的查询器 */ + public Selector(String field, Object value) + { + addMust(field, value); + } + + /** 构造指定字段串和一个相等条件的查询器 */ + public Selector(String fields, String field, Object value) + { + addFields(fields); + addMust(field, value); + } + + /** 增加一个条件 */ + public Selector(Condition condition) + { + addCondition(condition); + } + + /** 增加字段字符串 */ + public Selector addFields(String fields) + { + if (!Validates.isScope(fields, FIELD_FORMAT)) + return this; + + //去除前后空格和逗号 + fields = fields.trim(); + fields = Strings.trimLeft(fields, ","); + fields = Strings.trimRight(fields, ","); + + if (Validates.isEmptyBlank(fields)) + return this; + + if (this.fields != null) + fields = this.fields + "," + fields; + + //去除相同的字段 + String[] fieldArr = Arrays.toStringArray(fields); + this.fields = Arrays.toFilterSameStr(fieldArr); + return this; + } + + /** 清除字段字符串 */ + public Selector clearFields() + { + this.fields = null; + return this; + } + + /** + * 增加适配信息 + * + * @param key 适配建 + * @param value 适配值 + * @return 返回本对象 + */ + public Selector addReplace(String key, String value) + { + addReplaceInner(key, value); + return this; + } + + /** 增加分组字段字符串 */ + public Selector addGroupbyFields(String fields) + { + if (!Validates.isScope(fields, FIELD_FORMAT)) + return this; + + //去除前后空格和逗号 + fields = fields.trim(); + fields = Strings.trimLeft(fields, ","); + fields = Strings.trimRight(fields, ","); + + if (Validates.isEmptyBlank(fields)) + return this; + + if (this.groupby != null) + fields = this.groupby + "," + fields; + + //去除相同的字段 + String[] fieldArr = Arrays.toStringArray(fields); + this.groupby = Arrays.toFilterSameStr(fieldArr); + return this; + } + + /** 清除分组字段字符串 */ + public Selector clearGroupbyFields() + { + this.groupby = null; + return this; + } + + /** 增加左右连别名查询器 */ + public Selector addJoin(String alias, Selector selector) + { + if (joinMap == null) + joinMap = new HashMapSV<>(); + + joinMap.put(alias, selector); + return this; + } + + /** 增加左右连类查询器 */ + public Selector addJoin(Class clazz, Selector selector) + { + if (joinMap == null) + joinMap = new HashMapSV<>(); + + joinMap.put(clazz.getName(), selector); + return this; + } + + /** + * 组装Where条件的SQL语句 + * + * @param dbo _Dbo/_Table/_View三种的一种 + * @param alias 表别名 + * @param table 表真实名称 + * @param tableAlias 表真实名后连表别名 + * @param paramMap 参数表 + * @return SQL字符串 + * @throws ORMException 异常 + */ + public String getJoinWhereSQL(ZTable fTable, String alias, String table, String tableAlias, MapSO paramMap) throws ORMException + { + if (joinMap == null) + return tableAlias; + + //先判断是否从别名中获取到,没有再找类名 + _Table dbo = fTable.getTableByTableName(table); + Selector selector = joinMap.get(alias); + if (selector == null) + selector = joinMap.get(dbo.getName()); + + if (selector == null) + return tableAlias; + + List conditionList = selector.getConditionList(); + if (conditionList == null || conditionList.isEmpty()) + return tableAlias; + + //如果相等的连接条件,后面加and即可,否则先加where,再接and + StringBuilder whereSQL = new StringBuilder(); + //第一个 + whereSQL.append("(select ").append(selector.getFieldSQL(dbo)) + .append(" from ").append(table) + .append(" where "); + whereSQL.append(conditionList.get(0).toSql(dbo, paramMap)); + //后面的 + for (int i=1;i 0){ + strb.setLength(strb.length()-1); + } + return strb.toString(); + } + + /** 检查排序 */ + public String getOrderbySQL(Dbo dbo) throws ORMException + { + if (orderbyMap == null || orderbyMap.isEmpty()) + return ""; + + StringBuilder strb = new StringBuilder(" order by"); + for (Entry entry : orderbyMap.entrySet()) + { + String field = entry.getKey(); + if (!dbo.hasField(field)) + throw new ORMException("映射配置异常,在配置["+dbo.getName()+"]中未找到["+field+"]字段"); + + String column = dbo.getColumn(field); + strb.append(" ").append(column).append(" ").append(entry.getValue()).append(","); + } + strb.setLength(strb.length()-1); + return strb.toString(); + } + + /** 检查排序并反转,用于分页时倒序的倒序 */ + public String getOrderbyReverseSQL(Dbo dbo) throws ORMException + { + if (orderbyMap == null || orderbyMap.isEmpty()) + return ""; + + //先转换成列表 + ArrayList orderbyList = new ArrayList(); + for (Entry entry : orderbyMap.entrySet()) + { + String field = entry.getKey(); + if (!dbo.hasField(field)) + throw new ORMException("映射配置异常,在配置["+dbo.getName()+"]中未找到["+field+"]字段"); + + orderbyList.add(new String[]{field, (ASC.equals(entry.getValue()))?DESC:ASC}); + } + //再作反转 + orderbyList = Lists.reverse(orderbyList); + + //生成字符串 + StringBuilder strb = new StringBuilder(" order by"); + for (String[] orderbyArr : orderbyList) + { + String field = orderbyArr[0]; + String value = orderbyArr[1]; + String column = dbo.getColumn(field); + + strb.append(" ").append(column).append(" ").append(value).append(","); + } + + strb.setLength(strb.length()-1); + return strb.toString(); + } + + /** 获取分组SQL */ + public String getGroupbySQL(Dbo dbo) throws ORMException + { + if (Validates.isEmptyBlank(groupby)) + return ""; + + StringBuilder strb = new StringBuilder(" group by"); + String[] fieldArr = Arrays.toStringArray(groupby); + for (String field : fieldArr) + { + String column = dbo.getColumn(field); + if (column == null) + throw new ORMException("映射配置异常,在配置["+dbo.getName()+"]中未找到["+field+"]属性"); + + strb.append(" ").append(column).append(","); + } + strb.setLength(strb.length()-1); + return strb.toString(); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/Updater.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/Updater.java new file mode 100644 index 0000000..3ac0d75 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/Updater.java @@ -0,0 +1,89 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.extend.LinkedMapSV; +import org.zhiqim.orm.ORMException; + +/** + * 对象更新器,支持更新字段列表,和查询条件列表 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("Updater") +@AnNew +public class Updater extends Conditioner +{ + private static final long serialVersionUID = 1L; + private LinkedMapSV fieldMap = new LinkedMapSV<>(); + + /** 检查有效性 */ + public boolean isValid() throws ORMException + { + //完成field + if (fieldMap.isEmpty() || conditionList.isEmpty()) + return false; + else + return true; + } + + /** + * 增加适配信息 + * + * @param key 适配建 + * @param value 适配值 + * @return 返回本对象 + */ + public Updater addReplace(String key, String value) + { + addReplaceInner(key, value); + return this; + } + + /******************************************************/ + //字段管理 + /******************************************************/ + + /** + * 增加更新字段 + * + * @param field 更新字段 + */ + public Updater addField(String field, Object value) + { + fieldMap.put(field, new UpdaterField(field, value)); + return this; + } + + public Updater addFieldExpression(String field, String expression) + { + fieldMap.put(field, new UpdaterField(field, expression, 1)); + return this; + } + + public LinkedMapSV getFieldList() + { + return fieldMap; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/UpdaterField.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/UpdaterField.java new file mode 100644 index 0000000..823ad65 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/UpdaterField.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo; + +import java.io.Serializable; + +/** + * 更新器字段说明 + * + * 1.更新字段=某值 + * 2.更新字段为表达式 + * + * @version v1.0.0 @author zhichenggang 2014-3-21 新建与整理 + */ +public class UpdaterField implements Serializable +{ + private static final long serialVersionUID = 1L; + + private String field; + private Object value; + private int type;//=0表示值,=1表示表达式,其中表达式支持字段替换 + + UpdaterField(String field, Object value) + { + this.field = field; + this.value = value; + this.type = 0; + } + + UpdaterField(String field, Object value, int type) + { + this.field = field; + this.value = value; + this.type = type; + } + + public String getField() + { + return field; + } + + public Object getValue() + { + return value; + } + + public int getType() + { + return type; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Compare.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Compare.java new file mode 100644 index 0000000..4d57524 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Compare.java @@ -0,0 +1,81 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.dbo.Condition; +import org.zhiqim.orm.dbo.Dbo; + + +/** + * 比较类型的条件,一共支持9种 + * + * @see _Equal 相等 + * @see _EqualNot 不等 + * @see _ThenG 大于 + * @see _ThenGE 大于等于 + * @see _ThenL 小于 + * @see _ThenLE 小于等于 + * @see _Like 两边like + * @see _LikeL 左边like + * @see _LikeR 右边like + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class _Compare extends Condition +{ + protected String field; + protected Object value; + protected String compare; + + public _Compare(String field, Object value, String compare) + { + this.field = field; + this.value = value; + this.compare = compare; + } + + public String toSql(Dbo dbo, MapSO paramMap) throws ORMException + { + assertField(dbo, field); + + String column = dbo.getColumn(field); + + int ind = paramMap.size(); + paramMap.put(field+ind, convertValue(value));//把值放到表中,后续方便把##转成?号,然后再设置值 + + return new StringBuilder() + .append(column).append(_SPACE_).append(compare).append(_SPACE_) + .append("#").append(field+ind).append("#") + .toString(); + } + + public String getField() + { + return field; + } + + public Object getValue() + { + return value; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Equal.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Equal.java new file mode 100644 index 0000000..1186cc4 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Equal.java @@ -0,0 +1,45 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Validates; + +/** + * 相等条件 + * + * @see _Compare 具体实现在父类比较条件中 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Equal extends _Compare +{ + public _Equal(String field, Object value) + { + super(field, value, EQUAL); + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + return Validates.isEqual(fValue, value); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_EqualNot.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_EqualNot.java new file mode 100644 index 0000000..19a9b49 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_EqualNot.java @@ -0,0 +1,46 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Validates; + + +/** + * 不等条件 + * + * @see _Compare 具体实现在父类比较条件中 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _EqualNot extends _Compare +{ + public _EqualNot(String field, Object value) + { + super(field, value, EQUAL_NOT); + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + return !Validates.isEqual(fValue, value); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Expression.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Expression.java new file mode 100644 index 0000000..19692ae --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Expression.java @@ -0,0 +1,74 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ + +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.dbo.Condition; +import org.zhiqim.orm.dbo.Dbo; +import org.zhiqim.orm.dbo.DboField; + +/** + * 表达式条件,如where field = field2+1 + * + * @version v1.0.0 @author zouzhigang 2017-9-8 新建与整理 + */ +public class _Expression extends Condition +{ + private String field; + private String expression; + private String condition; + + public _Expression(String field, String expression, String condition) + { + this.field = field; + this.expression = expression; + this.condition = condition; + } + + @Override + public boolean match(Object obj) + { + throw Asserts.exception("暂不支持表达式匹配"); + } + + @Override + public String toSql(Dbo dbo, MapSO paramMap) throws ORMException + { + assertField(dbo, field); + + String column = dbo.getColumn(field); + + //对表达式中可能出现的字段进行匹配,替换成表列,注意有可能第二个列名会包含第一个列名,因此处理时字段名从长到短进行匹配 + DboField[] dboFieldArr = dbo.getFieldColumnListOrderByLen(); + for (DboField dboField : dboFieldArr) + {//依次从长到短对表达式中的字段替换成表列 TODO 暂不对$等可能替换成错进行处理 + expression = expression.replaceAll(dboField.getField(), dboField.getColumn()); + } + + return new StringBuilder() + .append(column).append(_SPACE_).append(condition).append(_SPACE_).append(expression) + .toString(); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_In.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_In.java new file mode 100644 index 0000000..dfa808b --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_In.java @@ -0,0 +1,73 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.dbo.Condition; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 判断是否在数组中的条件 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _In extends Condition +{ + private String field; + private Object value; + + public _In(String field, Object value) + { + this.field = field; + this.value = value; + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + return Validates.isContain(Lists.toList(Arrays.toArray(value)), fValue); + } + + public String toSql(Dbo dbo, MapSO paramMap) throws ORMException + { + assertField(dbo, field); + assertArray(value); + + String column = dbo.getColumn(field); + return new StringBuilder().append(column).append(_SPACE_).append(IN).append(_SPACE_).append(convertArray(value)).toString(); + } + + public String getField() + { + return field; + } + + public Object getValue() + { + return value; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_InNot.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_InNot.java new file mode 100644 index 0000000..4f3e61a --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_InNot.java @@ -0,0 +1,73 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.dbo.Condition; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 判断是否不在数组中的条件 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _InNot extends Condition +{ + private String field; + private Object value; + + public _InNot(String field, Object value) + { + this.field = field; + this.value = value; + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + return !Validates.isContain(Lists.toList(Arrays.toArray(value)), fValue); + } + + public String toSql(Dbo dbo, MapSO paramMap) throws ORMException + { + assertField(dbo, field); + assertArray(value); + + String column = dbo.getColumn(field); + return new StringBuilder().append(column).append(_SPACE_).append(IN_NOT).append(_SPACE_).append(convertArray(value)).toString(); + } + + public String getField() + { + return field; + } + + public Object getValue() + { + return value; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_IsEmpty.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_IsEmpty.java new file mode 100644 index 0000000..d4819e8 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_IsEmpty.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.dbo.Condition; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 判断是否为空的条件 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _IsEmpty extends Condition +{ + private String field; + + public _IsEmpty(String field) + { + this.field = field; + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + return fValue == null; + } + + public String toSql(Dbo dbo, MapSO paramMap) throws ORMException + { + assertField(dbo, field); + + String column = dbo.getColumn(field); + return new StringBuilder("(").append(column).append(_SPACE_).append(IS_NULL) + .append(" or ").append(column).append(" = '')") + .toString(); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_IsNotEmpty.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_IsNotEmpty.java new file mode 100644 index 0000000..5006534 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_IsNotEmpty.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.dbo.Condition; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 判断是否不为空的条件 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _IsNotEmpty extends Condition +{ + private String field; + + public _IsNotEmpty(String field) + { + this.field = field; + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + return fValue != null; + } + + public String toSql(Dbo dbo, MapSO paramMap) throws ORMException + { + assertField(dbo, field); + + String column = dbo.getColumn(field); + return new StringBuilder().append(column).append(_SPACE_).append(IS_NOT_NULL) + .append(" and ").append(column).append(" <> ''") + .toString(); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_IsNotNull.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_IsNotNull.java new file mode 100644 index 0000000..bcb6ec6 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_IsNotNull.java @@ -0,0 +1,57 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.dbo.Condition; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 判断是否不为空的条件 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _IsNotNull extends Condition +{ + private String field; + + public _IsNotNull(String field) + { + this.field = field; + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + return fValue != null; + } + + public String toSql(Dbo dbo, MapSO paramMap) throws ORMException + { + assertField(dbo, field); + + String column = dbo.getColumn(field); + return new StringBuilder().append(column).append(_SPACE_).append(IS_NOT_NULL).toString(); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_IsNull.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_IsNull.java new file mode 100644 index 0000000..81a27c9 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_IsNull.java @@ -0,0 +1,57 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.dbo.Condition; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 判断是否为空的条件 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _IsNull extends Condition +{ + private String field; + + public _IsNull(String field) + { + this.field = field; + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + return fValue == null; + } + + public String toSql(Dbo dbo, MapSO paramMap) throws ORMException + { + assertField(dbo, field); + + String column = dbo.getColumn(field); + return new StringBuilder().append(column).append(_SPACE_).append(IS_NULL).toString(); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Like.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Like.java new file mode 100644 index 0000000..4101506 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Like.java @@ -0,0 +1,50 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.util.Classes; + +/** + * 两边LIKE + * + * @see _Compare 具体实现在父类比较条件中 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Like extends _Compare +{ + private String orgiValue; + + public _Like(String field, String value) + { + super(field, "%"+value+"%", LIKE); + this.orgiValue = value; + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + if (fValue == null) + return false; + + return String.valueOf(fValue).contains(orgiValue); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeL.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeL.java new file mode 100644 index 0000000..b1215f4 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeL.java @@ -0,0 +1,51 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Strings; + +/** + * 左边LIKE + * + * @see _Compare 具体实现在父类比较条件中 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _LikeL extends _Compare +{ + private String orgiValue; + + public _LikeL(String field, String value) + { + super(field, "%"+value, LIKE); + this.orgiValue = value; + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + if (fValue == null) + return false; + + return Strings.endsWith(String.valueOf(fValue), orgiValue); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeNot.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeNot.java new file mode 100644 index 0000000..765bdb4 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeNot.java @@ -0,0 +1,50 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.util.Classes; + +/** + * 两边NOT LIKE + * + * @see _Compare 具体实现在父类比较条件中 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _LikeNot extends _Compare +{ + private String orgiValue; + + public _LikeNot(String field, String value) + { + super(field, "%"+value+"%", LIKE_NOT); + this.orgiValue = value; + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + if (fValue == null) + return false; + + return !String.valueOf(fValue).contains(orgiValue); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeNotL.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeNotL.java new file mode 100644 index 0000000..6585eb2 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeNotL.java @@ -0,0 +1,51 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Strings; + +/** + * 左边NOT LIKE + * + * @see _Compare 具体实现在父类比较条件中 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _LikeNotL extends _Compare +{ + private String orgiValue; + + public _LikeNotL(String field, String value) + { + super(field, "%"+value, LIKE_NOT); + this.orgiValue = value; + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + if (fValue == null) + return false; + + return !Strings.endsWith(String.valueOf(fValue), orgiValue); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeNotR.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeNotR.java new file mode 100644 index 0000000..2ddff46 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeNotR.java @@ -0,0 +1,51 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Strings; + +/** + * 右边NOT LIKE + * + * @see _Compare 具体实现在父类比较条件中 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _LikeNotR extends _Compare +{ + private String orgiValue; + + public _LikeNotR(String field, String value) + { + super(field, value+"%", LIKE_NOT); + this.orgiValue = value; + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + if (fValue == null) + return false; + + return !Strings.startsWith(String.valueOf(fValue), orgiValue); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeR.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeR.java new file mode 100644 index 0000000..3611c36 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_LikeR.java @@ -0,0 +1,51 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Strings; + +/** + * 右边LIKE + * + * @see _Compare 具体实现在父类比较条件中 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _LikeR extends _Compare +{ + private String orgiValue; + + public _LikeR(String field, String value) + { + super(field, value+"%", LIKE); + this.orgiValue = value; + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + if (fValue == null) + return false; + + return Strings.startsWith(String.valueOf(fValue), orgiValue); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Or.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Or.java new file mode 100644 index 0000000..dbdf0d7 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_Or.java @@ -0,0 +1,80 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.dbo.Condition; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 或者条件,里面是一个条件列表,格式如:(field = 'abc' or field2 <> 'def') + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Or extends Condition +{ + List list = new ArrayList(2); + + public void addCondition(Condition condition) + { + list.add(condition); + } + + public boolean match(Object obj) + { + for (Condition c : list) + { + if (c.match(obj)) + return true; + } + + return false; + } + + public String toSql(Dbo dbo, MapSO paramMap) throws ORMException + { + if (list.size() < 2) + throw new ORMException("ZTable/ZView[or]要求的条件数目必须>=2个"); + + StringBuilder strb = new StringBuilder("("); + //第一个 + strb.append(list.get(0).toSql(dbo, paramMap)); + //后面的 + for (int i=1;i getCondition() + { + return list; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_ThenG.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_ThenG.java new file mode 100644 index 0000000..48f7367 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_ThenG.java @@ -0,0 +1,46 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.orm.dbo.Comparator; + + +/** + * 大于条件 + * + * @see _Compare 具体实现在父类比较条件中 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _ThenG extends _Compare +{ + public _ThenG(String field, Object value) + { + super(field, value, THEN_G); + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + return Comparator.compareValue(fValue, value) > 0; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_ThenGE.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_ThenGE.java new file mode 100644 index 0000000..a2eb036 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_ThenGE.java @@ -0,0 +1,46 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.orm.dbo.Comparator; + + +/** + * 大于等于条件 + * + * @see _Compare 具体实现在父类比较条件中 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _ThenGE extends _Compare +{ + public _ThenGE(String field, Object value) + { + super(field, value, THEN_GE); + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + return Comparator.compareValue(fValue, value) >= 0; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_ThenL.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_ThenL.java new file mode 100644 index 0000000..5313395 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_ThenL.java @@ -0,0 +1,46 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.orm.dbo.Comparator; + + +/** + * 小于条件 + * + * @see _Compare 具体实现在父类比较条件中 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _ThenL extends _Compare +{ + public _ThenL(String field, Object value) + { + super(field, value, THEN_L); + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + return Comparator.compareValue(fValue, value) < 0; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_ThenLE.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_ThenLE.java new file mode 100644 index 0000000..d8b43bb --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/condition/_ThenLE.java @@ -0,0 +1,46 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.condition; + +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.orm.dbo.Comparator; + + +/** + * 小于等于条件 + * + * @see _Compare 具体实现在父类比较条件中 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _ThenLE extends _Compare +{ + public _ThenLE(String field, Object value) + { + super(field, value, THEN_LE); + } + + public boolean match(Object obj) + { + Object fValue = Classes.getFieldValue(obj, field); + return Comparator.compareValue(fValue, value) <= 0; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_Dbo.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_Dbo.java new file mode 100644 index 0000000..ff8cc60 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_Dbo.java @@ -0,0 +1,154 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.defined; + +import org.zhiqim.kernel.extend.LinkedMapSV; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.dbo.Dbo; +import org.zhiqim.orm.dbo.DboField; + + +/** + * 数据库参数或结果格式,配置格式如:

            + *
            + *
            + *
            + *


            + * 用于ZSQL时根据column和type反射机制组装数据对象 + * + * 注:_Dbo支持通过column找到_DboField + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Dbo implements ORMConstants, Dbo +{ + private String name; //类名 + + private LinkedMapSV<_DboField> fieldMap = new LinkedMapSV<>(); + + public _Dbo(String name) + { + this.name = name; + } + + public void addField(String name, String column, String type) + { + _DboField field = new _DboField(name, column, type); + fieldMap.put(name, field); + } + + public String toString() + { + StringBuilder strb = new StringBuilder(_FOUR_).append("").append(_BR_); + + for (_DboField field : fieldMap.values()) + { + strb.append(_FOUR_).append(_FOUR_).append(field).append(_BR_); + } + + strb.append(_FOUR_).append(""); + return strb.toString(); + } + + public String getName() + { + return name; + } + + /** 判断是否是有相等的连接条件 */ + public boolean hasEqualJoin() + {//不是视图直接返回false + return false; + } + + /** 判断是否存在该字段 */ + public boolean hasField(String fieldName) + { + return fieldMap.containsKey(fieldName)?true:getFieldByColumn(fieldName)!=null; + } + + /** 通过字段获取数据库列名 */ + public String getColumn(String fieldName) + { + _DboField field = getField(fieldName); + return (field == null)?null:field.getColumn(); + } + + /** 根据名称查字段get方法 */ + public String getGetMethod(String name) + { + //先判断是否是字段名,再判断是否是表列名 + _DboField field = getField(name); + return (field == null)?null:field.getGetMethod(); + } + + /** 根据名称查字段 */ + public _DboField getField(String name) + { + //先查字段名,再查表列名 + _DboField field = fieldMap.get(name); + if (field == null) + field = getFieldByColumn(name); + + return field; + } + + /** 通过列名找到字段 */ + public _DboField getFieldByColumn(String column) + { + for (_DboField field : fieldMap.values()) + { + if (field.getColumn().equals(column)) + return field; + } + + return null; + } + + /** 获取字段列表按长度排序 */ + public DboField[] getFieldColumnListOrderByLen() + { + _DboField[] array = new _DboField[fieldMap.size()]; + int index = 0; + for (_DboField field : fieldMap.values()) + { + array[index++] = field; + } + + for (int i=0;i. + */ +package org.zhiqim.orm.dbo.defined; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMType; +import org.zhiqim.orm.dbo.DboField; + +/** + * 数据库参数或结果字段格式,配置格式如:

            + *
            + * 和_Dbo一起组装 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _DboField implements ORMConstants, DboField +{ + private String field; + private String column; + private String type; + + public _DboField(String field, String column, String type) + { + this.field = field; + this.column = column; + this.type = type; + } + + public String toString() + { + return new StringBuilder("") + .toString(); + } + + public String getField() + { + return field; + } + + public String getColumn() + { + return column; + } + + public int getType() + { + return ORMType.getColumnTypeMaybeLength(type); + } + + public String getSetMethod() + { + if (getType() != Z_ORM_BOOLEAN_INT || !Strings.startsWith(field, "is")) + return "set" + field.substring(0, 1).toUpperCase() + field.substring(1); + else + return "set" + field.substring(2); + } + + public String getGetMethod() + { + if (getType() != Z_ORM_BOOLEAN_INT) + return "get" + field.substring(0, 1).toUpperCase() + field.substring(1); + + if (Strings.startsWith(field, "is")) + return field; + else + return "is" + field.substring(0, 1).toUpperCase() + field.substring(1); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_Table.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_Table.java new file mode 100644 index 0000000..7916e35 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_Table.java @@ -0,0 +1,618 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.defined; + +import java.lang.reflect.Field; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.LinkedMapSV; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMType; +import org.zhiqim.orm.dbo.Condition; +import org.zhiqim.orm.dbo.Dbo; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.orm.dbo.UpdaterField; +import org.zhiqim.orm.dbo.condition._Compare; +import org.zhiqim.orm.dbo.condition._In; +import org.zhiqim.orm.dbo.condition._InNot; +import org.zhiqim.orm.dbo.condition._IsNotNull; +import org.zhiqim.orm.dbo.condition._IsNull; +import org.zhiqim.orm.dbo.condition._Or; + +/** + * 标准数据库对象,配置格式如:

            + *
            + *
            + *
            + *


            + * 用于ZTable时,传入_Table类,映射成数据库表,和根据数据库表列组装成_Table对象 + * + * 注:_Table支持通过column找到_TableField + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Table implements Dbo, ORMConstants +{ + private String name; //类名 + private String table; //表名 + private String key; //主键 + private String type; //表类型 + + private List<_TableIndex> indexList = new ArrayList<>(); + private List<_TableReplace> replaceList = new ArrayList<>(); + private LinkedMapSV<_TableField> fieldMap = new LinkedMapSV<>(); + private LinkedMapSV<_TableField> columnMap = new LinkedMapSV<>(); + + /** + * 给非实体类创建_Table调用,默认name=table,默认type="" + * + * @param table 表名 + * @param key 主键,多个逗号隔开 + */ + public _Table(String table, String key) + { + this(table, table, key, ""); + } + + /** + * 给非实体类创建_Table调用,默认name=table + * + * @param table 表名 + * @param key 主键,多个逗号隔开 + * @param type 表类型,如MySQL的InnoDB + */ + public _Table(String table, String key, String type) + { + this(table, table, key, type); + } + + /** + * 给实体类创建_Table调用,默认name=类名 + * + * @param table 表名 + * @param key 主键,多个逗号隔开 + * @param type 表类型,如MySQL的InnoDB + */ + public _Table(String name, String table, String key, String type) + { + this.name = name; + this.table = table; + this.type = type; + + if (Validates.isNotEmptyBlank(key)) + this.key = key.toUpperCase(); + } + + /** + * 增加索引 + * + * @param name 索引名称 + * @param column 索引列,多个逗号隔开 + * @param unique 是否唯一索引 + */ + public void addIndex(String name, String column, boolean unique) + { + _TableIndex index = new _TableIndex(name, column.toUpperCase(), unique); + indexList.add(index); + } + + /** + * 增加索引,默认索引名=IX_表名 + * + * @param name 索引名称 + * @param column 索引列,多个逗号隔开 + * @param unique 是否唯一索引 + */ + public void addIndex(String column, boolean unique) + { + _TableIndex index = new _TableIndex("IX_"+table, column.toUpperCase(), unique); + indexList.add(index); + } + + /** + * 增加可替换字段 + * + * @param replace 可替换字段 + */ + public void addReplace(String name, String column) + { + replaceList.add(new _TableReplace(name, column)); + } + + /** + * 增加字段 + * + * @param field 字段名 + * @param column 数据表列名 + * @param type 数据类型,格式如int|string,32|string,19,char表示固定长度 + * @param notNull 是否不允许为null + */ + public void addField(String field, String column, String type, boolean notNull) + { + _TableField tField = new _TableField(field, column.toUpperCase(), type, notNull); + fieldMap.put(field, tField); + columnMap.put(column.toUpperCase(), tField); + } + + /** + * 增加字段,默认字段名为首字母小写,遇下划线字母大写 + * + * @param column 数据表列名 + * @param type 数据类型,格式如int|string,32|string,19,char表示固定长度 + * @param notNull 是否不允许为null + */ + public void addField(String column, String type, boolean notNull) + { + String field = ORMType.toLowerName(column); + _TableField tField = new _TableField(field, column.toUpperCase(), type, notNull); + fieldMap.put(field, tField); + columnMap.put(column.toUpperCase(), tField); + } + + public String toString() + { + StringBuilder strb = new StringBuilder(_FOUR_).append("").append(_BR_); + + for (_TableIndex index : indexList) + { + strb.append(_FOUR_).append(_FOUR_).append(index).append(_BR_); + } + strb.append(_BR_); + + for (_TableField field : fieldMap.values()) + { + strb.append(_FOUR_).append(_FOUR_).append(field).append(_BR_); + } + + strb.append(_FOUR_).append(""); + return strb.toString(); + } + + /** 判断是否是有相等的连接条件 */ + public boolean hasEqualJoin() + {//不是视图直接返回false + return false; + } + + /** 根据名称查字段get方法 */ + public String getGetMethod(String field) + { + //先判断是否是字段名,再判断是否是表列名 + _TableField tField = getField(field); + return (tField == null)?null:tField.getGetMethod(); + } + + /** 根据名称查字段set方法 */ + public String getSetMethod(String field) + { + //先判断是否是字段名,再判断是否是表列名 + _TableField tField = getField(field); + return (tField == null)?null:tField.getSetMethod(); + } + + /** 根据字段查表列名 */ + public String getColumn(String field) + { + _TableField tField = getField(field); + return (tField == null)?null:tField.getColumn(); + } + + /** 根据名称查字段 */ + public _TableField getField(String field) + { + //先查字段名,再查表列名 + _TableField tField = fieldMap.get(field); + if (tField == null) + tField = columnMap.get(field.toUpperCase()); + + return tField; + } + + /** 是否有对应的字段名 */ + public boolean hasField(String field) + { + return fieldMap.containsKey(field)?true:columnMap.containsKey(field.toUpperCase()); + } + + /** 获取字段列表 */ + public List<_TableField> getFieldList() + { + return new ArrayList<_TableField>(fieldMap.values()); + } + + public List<_TableField> getFieldListNoKey() + { + List keyList = getKeyList(); + List<_TableField> fieldList = new ArrayList<_TableField>(); + for (_TableField field : fieldMap.values()) + { + if (keyList.contains(field.getColumn())) + continue; + fieldList.add(field); + } + + return fieldList; + } + + /** 获取字段列表按长度排序 */ + public _TableField[] getFieldColumnListOrderByLen() + { + _TableField[] array = new _TableField[fieldMap.size()]; + int index = 0; + for (_TableField field : fieldMap.values()) + { + array[index++] = field; + } + + for (int i=0;i cList) + { + for (Condition c : cList) + { + if (c instanceof _IsNull || c instanceof _IsNotNull) + continue; + + if (c instanceof _Compare) + { + _Compare _c = (_Compare)c; + if (!isValidCondition(_c.getField(), _c.getValue())) + return _c.getField(); + } + else if (c instanceof _In) + { + _In in = (_In)c; + if (!isValidFieldIn(in.getField(), in.getValue())) + return in.getField(); + } + else if (c instanceof _InNot) + { + _InNot in = (_InNot)c; + if (!isValidFieldIn(in.getField(), in.getValue())) + return in.getField(); + } + else if (c instanceof _Or) + { + _Or or = (_Or)c; + String result = isValidCondition(or.getCondition()); + if (result != null) + return result; + } + } + + return null; + } + + /** 验证条件是否合法 */ + private boolean isValidCondition(String field, Object value) + { + _TableField f = fieldMap.get(field); + return (f == null)?false:isValidField(f.getType(), value); + } + + /** 是否是对象 */ + private boolean isValidField(int type, Object value) + { + switch (type) + { + //基本类型 + case Z_ORM_BOOLEAN_INT:return (value instanceof Boolean); + case Z_ORM_BYTE_INT: + case Z_ORM_SHORT_INT: + case Z_ORM_INT_INT: + case Z_ORM_LONG_INT:return value instanceof Integer || value instanceof Long; + //小数和时间 + case Z_ORM_DATETIME_INT:return (value instanceof Timestamp); + case Z_ORM_DECIMAL_INT:return (value instanceof Double); + //字符串和二进制 + case Z_ORM_STRING_INT:return (value instanceof String); + case Z_ORM_BINARY_INT:return (value instanceof byte[]); + default:return false; + } + } + + /** 是否是数组 */ + private boolean isValidFieldIn(String field, Object value) + { + _TableField f = fieldMap.get(field); + if (f == null) + return false; + + switch (f.getType()) + { + //基本类型 + case Z_ORM_BYTE_INT: + case Z_ORM_SHORT_INT: + case Z_ORM_INT_INT: + case Z_ORM_LONG_INT:return value instanceof int[] || value instanceof Integer[] || value instanceof long[] || value instanceof Long[]; + //小数和时间 + case Z_ORM_DECIMAL_INT:return (value instanceof double[] || value instanceof Double[]); + //字符串和二进制 + case Z_ORM_STRING_INT:return (value instanceof String[]); + default:return true; + } + } + + public String getName() + { + return name; + } + + public String getTable() + { + return table; + } + + public String getType() + { + return type; + } + + public String getKey() + { + return key; + } + + public String[] getKeyArr() + { + return Arrays.toStringArray(key, ","); + } + + public String[] getKeyFieldArr() + { + String[] keys = getKeyArr(); + if (keys.length == 0) + return keys; + + String[] fields = new String[keys.length]; + for (int i=0;i getKeyList() + { + return Lists.toStringList(key, ","); + } + + public boolean isAllKey() + { + return Arrays.toStringArray(key, ",").length == fieldMap.size(); + } + + public List<_TableIndex> getIndexList() + { + return indexList; + } + + public void chkReplace(MapSS replaceMap) + { + if (replaceList.isEmpty()) + return; + + if (!replaceMap.isEmpty()) + { + //1.找出需要替换field为column的可替换字段 + List<_TableReplace> list = new ArrayList<>(); + for (String field : replaceMap.keySet()) + { + _TableReplace replace = getReplaceColumn(field); + if (replace != null) + { + list.add(replace); + } + } + + //2.替换可替换字段到替换表中 + for (_TableReplace replace : list) + {//把id换成ID + String value = replaceMap.remove(replace.getField()); + replaceMap.put(replace.getColumn(), value==null?_EMPTY_:value); + } + } + + //3.最后检查把未指定的替换字段为空字符串 + for (_TableReplace replace : replaceList) + { + if (replaceMap.containsKey(replace.getColumn())) + continue; + + replaceMap.put(replace.getColumn(), _EMPTY_); + } + } + + public void addReplaceToMap(Object data, MapSS replaceMap) + { + if (replaceList.isEmpty()) + return; + + for (_TableReplace replace : replaceList) + { + Object val = Classes.getFieldValue(data, replace.getField()); + replaceMap.put(replace.getColumn(), val==null?_EMPTY_:String.valueOf(val)); + } + } + + public void addReplaceToData(Object data, MapSS replaceMap) + { + if (replaceList.isEmpty()) + return; + + for (_TableReplace replace : replaceList) + { + String value = replaceMap.get(replace.getColumn()); + if (value != null) + { + Field field = Classes.getFieldDeep(data.getClass(), replace.getField()); + if (field != null) + { + Classes.setFieldValue(data, field, value); + } + } + } + } + + private _TableReplace getReplaceColumn(String field) + { + for (_TableReplace replace : replaceList) + { + if (replace.getField().equals(field)) + return replace; + } + + return null; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_TableField.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_TableField.java new file mode 100644 index 0000000..4329395 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_TableField.java @@ -0,0 +1,105 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.defined; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMType; +import org.zhiqim.orm.dbo.DboField; + +/** + * 标准字段格式,配置格式如:

            + *
            + * 和_Table一起组装 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _TableField implements ORMConstants, DboField +{ + private String field; + private String column; + private String type; + private boolean notNull; + + public _TableField(String name, String column, String type, boolean notNull) + { + this.field = name; + this.column = column; + this.type = type; + this.notNull = notNull; + } + + public String toString() + { + return new StringBuilder("") + .toString(); + } + + public String getField() + { + return field; + } + + public String getColumn() + { + return column; + } + + public int getType() + { + return ORMType.getColumnTypeMaybeLength(type); + } + + public String getTypeAndLength() + { + return type; + } + + public boolean isNotNull() + { + return notNull; + } + + public String getSetMethod() + { + if (getType() != Z_ORM_BOOLEAN_INT || !Strings.startsWith(field, "is")) + return "set" + field.substring(0, 1).toUpperCase() + field.substring(1); + else + return "set" + field.substring(2); + } + + public String getGetMethod() + { + if (getType() != Z_ORM_BOOLEAN_INT) + return "get" + field.substring(0, 1).toUpperCase() + field.substring(1); + + if (Strings.startsWith(field, "is")) + return field; + else + return "is" + field.substring(0, 1).toUpperCase() + field.substring(1); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_TableIndex.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_TableIndex.java new file mode 100644 index 0000000..05db552 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_TableIndex.java @@ -0,0 +1,74 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.defined; + +import org.zhiqim.kernel.constants.SignConstants; + +/** + * 索引属性,格式如下:

            + *
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _TableIndex implements SignConstants +{ + private String name; + private String column; + private boolean unique; + + public _TableIndex(String name, String column, boolean unique) + { + this.name = name; + this.column = column; + this.unique = unique; + } + + public String toString() + { + return new StringBuilder("") + .toString(); + } + + public String getName() + { + return name; + } + + public String getColumn() + { + return column; + } + + public boolean isUnique() + { + return unique; + } + + public String getType() + { + return unique?"unique":""; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_TableReplace.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_TableReplace.java new file mode 100644 index 0000000..f8812c6 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_TableReplace.java @@ -0,0 +1,49 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.defined; + +/** + * 表可替换字段 + * + * @version v1.0.0 @author zouzhigang 2018-12-6 新建与整理 + */ +public class _TableReplace +{ + private String field; + private String column; + + public _TableReplace(String field, String column) + { + this.field = field; + this.column = column; + } + + public String getField() + { + return field; + } + + public String getColumn() + { + return column; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_View.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_View.java new file mode 100644 index 0000000..562bec0 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_View.java @@ -0,0 +1,421 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.defined; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map.Entry; + +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.extend.LinkedMapSV; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Replaces; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Dbo; +import org.zhiqim.orm.dbo.Selector; + +/** + * 视图对象,配置格式如:

            + *
            + *
            + *
            + *
            + *
            + *


            + * 自联表注意使用别名配置,如下配置格式: + *
            + *
            + *
            + *
            + *
            + *


            + * 用于ZView时,传入_View类,映射成数据库多表,和根据数据库表列组装成_View对象 + * + * 注:_View不支持通过column找到_ViewField + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _View implements ORMConstants, Dbo +{ + private String name; + private String table; + + private LinkedMapSV<_ViewField> fieldMap = new LinkedMapSV<>(); + private List<_ViewJoin> joinList = new ArrayList<>(); + + public _View(String name, String table) + { + this.name = name; + this.table = table; + } + + public void addField(String name, String table, String column, int type) + { + _ViewField field = new _ViewField(name, table, column.toUpperCase(), type); + fieldMap.put(name, field); + } + + public void addJoin(String type, String lTable, String lColumn, String rTable, String rColumn, String rValue) + { + if (Validates.isNotEmpty(rColumn)) + rColumn = rColumn.toUpperCase(); + + _ViewJoin join = new _ViewJoin(type, lTable, lColumn.toUpperCase(), rTable, rColumn, rValue); + joinList.add(join); + } + + public String toString() + { + StringBuilder strb = new StringBuilder(_FOUR_).append("").append(_BR_); + + for (_ViewField field : fieldMap.values()) + { + strb.append(_FOUR_).append(_FOUR_).append(field).append(_BR_); + } + + strb.append(_BR_); + for (_ViewJoin where : joinList) + { + strb.append(_FOUR_).append(_FOUR_).append(where).append(_BR_); + } + + strb.append(_FOUR_).append(""); + return strb.toString(); + } + + public String getName() + { + return name; + } + + public List<_ViewJoin> getWhereList() + { + return joinList; + } + + public String[] getTableArr() + { + return Arrays.toStringArray(table, ","); + } + + public List getTableNoAliasList() + { + ArrayList list = new ArrayList<>(); + + String[] tableArr = getTableArr(); + for (String table : tableArr) + { + String[] alias = Arrays.toStringArray(table, " "); + if (alias.length == 2) + list.add(alias[0]); + else + list.add(table); + } + + return Lists.trim(list); + } + + /** 可能表名有别名,再找一次 */ + public String getTableName(String tableName) + { + String[] tableArr = getTableArr(); + for (String table : tableArr) + { + String[] alias = Arrays.toStringArray(table, " "); + if (alias.length != 2) + continue; + + if (tableName.equals(alias[1])) + return alias[0]; + } + + return tableName; + } + + public List<_ViewField> getFieldList(String fields) + { + if (Validates.isEmptyBlank(fields))//为空表示全部 + return new ArrayList<_ViewField>(fieldMap.values()); + + List fieldNameList = Lists.toStringList(fields); + List<_ViewField> fieldList = new ArrayList<_ViewField>(); + for (_ViewField field : fieldMap.values()) + { + if (fieldNameList.contains(field.getField())) + fieldList.add(field); + } + + Asserts.as(!fieldList.isEmpty()?null:"["+fields+"]未找到一个匹配的字段"); + return fieldList; + } + + /** 根据名称查字段get方法 */ + public String getGetMethod(String name) + { + _ViewField field = fieldMap.get(name); + if (field == null) + return null; + + return field.getGetMethod(); + } + + /** 根据名称查字段set方法 */ + public String getSetMethod(String name) + { + _ViewField field = fieldMap.get(name); + if (field == null) + return null; + + return field.getSetMethod(); + } + + public _ViewField getField(String field) + { + return fieldMap.get(field); + } + + public String getColumn(String field) + { + _ViewField _viewField = fieldMap.get(field); + if (_viewField == null) + return null; + + return _viewField.getTable() + "." + _viewField.getColumn(); + } + + public boolean hasField(String field) + { + return fieldMap.containsKey(field); + } + + /** 是否有对应的所有字段名 */ + public boolean hasAllField(String[] fieldArr) + { + for (String field : fieldArr) + { + if (!fieldMap.containsKey(field)) + return false; + } + return true; + } + + /** 缺省字段 */ + public String getDefaultFieldSQL(String fields) + { + StringBuilder strb = new StringBuilder(); + + List<_ViewField> fieldList = getFieldList(fields); + //第一个 + _ViewField field = fieldList.get(0); + strb.append(field.getTable()).append(".").append(field.getColumn()).append(" as ").append(field.getField()); + //剩下的前加逗号 + for (int i=1;i entry : joinMap.entrySet()) + { + String tableKey = entry.getKey(); + String joinSql = entry.getValue(); + + String[] tableArr = tableKey.split(","); + String lTable = tableArr[0]; + String rTable = tableArr[1]; + + tables.remove(rTable);//去除右表 + + String laTable = tableos.get(lTable); + String lTableValue = tables.get(lTable); + if (lTableValue == null) + throw new ORMException("暂不支持嵌套左右连接,请调整为以一张表为主表进行左右连接"); + + lTableValue = lTableValue.replaceAll(lTable+"\\.", "T1A2B3L4E5."); + lTableValue = Replaces.replaceAllEscape(lTableValue, laTable, joinSql);//改进左表,如果左表有别名,则连别名一起改进 + lTableValue = lTableValue.replaceAll("T1A2B3L4E5.", lTable+"\\."); + tables.put(lTable, lTableValue); + } + + StringBuilder strb = new StringBuilder(); + for (String tab : tables.values()){ + strb.append(tab).append(","); + } + if (strb.length() > 0){ + strb.setLength(strb.length()-1); + } + return strb.toString(); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_ViewField.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_ViewField.java new file mode 100644 index 0000000..110432a --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_ViewField.java @@ -0,0 +1,94 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.defined; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.dbo.DboField; + +/** + * 视图字段格式,和_TableField相比,必须加上table配置,配置格式如:

            + *
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _ViewField implements ORMConstants, DboField +{ + private String field; + private String table; + private String column; + private int type; + + public _ViewField(String field, String table, String column, int type) + { + this.field = field; + this.table = table; + this.column = column; + this.type = type; + } + + public String toString() + { + StringBuilder strb = new StringBuilder("").toString(); + } + + public String getField() + { + return field; + } + public String getTable() + { + return table; + } + public String getColumn() + { + return column; + } + public int getType() + { + return type; + } + + public String getSetMethod() + { + if (getType() != Z_ORM_BOOLEAN_INT || !Strings.startsWith(field, "is")) + return "set" + field.substring(0, 1).toUpperCase() + field.substring(1); + else + return "set" + field.substring(2); + } + + public String getGetMethod() + { + if (getType() != Z_ORM_BOOLEAN_INT) + return "get" + field.substring(0, 1).toUpperCase() + field.substring(1); + + if (Strings.startsWith(field, "is")) + return field; + else + return "is" + field.substring(0, 1).toUpperCase() + field.substring(1); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_ViewJoin.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_ViewJoin.java new file mode 100644 index 0000000..54ea20d --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_ViewJoin.java @@ -0,0 +1,96 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.defined; + +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMConstants; + +/** + * 视图连接条件格式,支持以下四种格式,配置格式如:

            + * 1.左表列=右表列
            + * 2.左表列 left join in 右表列
            + * 3.左表列 right join in 右表列
            + * 4.左表列=固定值 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _ViewJoin implements ORMConstants +{ + private String type; + + private String lTable; + private String lColumn; + private String rTable; + private String rColumn; + private String rValue; + + public _ViewJoin(String type, String lTable, String lColumn, String rTable, String rColumn, String rValue) + { + this.type = type; + this.lTable = lTable; + this.lColumn = lColumn; + this.rTable = rTable; + this.rColumn = rColumn; + this.rValue = rValue; + } + + public String toString() + { + StringBuilder strb = new StringBuilder("").toString(); + } + + public String getType() + { + return type; + } + public String getLTable() + { + return lTable; + } + public String getLColumn() + { + return lColumn; + } + public String getRTable() + { + return rTable; + } + public String getRColumn() + { + return rColumn; + } + public String getRValue() + { + return rValue; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_ViewReplace.java b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_ViewReplace.java new file mode 100644 index 0000000..004bc80 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/dbo/defined/_ViewReplace.java @@ -0,0 +1,56 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.dbo.defined; + +/** + * 视图替换字段 + * + * @version v1.0.0 @author zouzhigang 2018-12-6 新建与整理 + */ +public class _ViewReplace +{ + private String name; + private String table; + + public _ViewReplace(String name, String table) + { + this.name = name; + this.table = table; + } + + public String getName() + { + return name; + } + public void setName(String name) + { + this.name = name; + } + public String getTable() + { + return table; + } + public void setTable(String table) + { + this.table = table; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/executor/BatchExecutor.java b/zhiqim_orm/src/org/zhiqim/orm/executor/BatchExecutor.java new file mode 100644 index 0000000..269aa0b --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/executor/BatchExecutor.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; + +/** + * 批量处理器接口,传递OMR服务,连接,update,参数列表和可替换表等 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface BatchExecutor extends ORMConstants +{ + public final Log log = LogFactory.getLog(QueryExecutor.class); + public final Log uSqlLog = LogFactory.getLog("update.sql.log"); + public final Log qSqlLog = LogFactory.getLog("query.sql.log"); + + /** + * 执行executeBatch处理 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param paramList 参数列表 + * @param replaceMap 可替换表 + * @return 返回int,处理条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public int[] execute(ORMServer server, Connection conn, String sql, List paramList, MapSS replaceMap) throws ORMException, SQLException; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/executor/BatchExecutorBase.java b/zhiqim_orm/src/org/zhiqim/orm/executor/BatchExecutorBase.java new file mode 100644 index 0000000..ba2e387 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/executor/BatchExecutorBase.java @@ -0,0 +1,149 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Types; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZStatement; + +/** + * 批量处理模式,参数为基本类型的列表,当前支持[int,long,string,array] + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class BatchExecutorBase implements BatchExecutor +{ + /** + * 执行executeBatch处理,基本类型不需要判断是否有通配符##,sql语句用?代替 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param paramList 参数列表 + * @param replaceMap 可替换表 + * @return 返回int,处理条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public int[] execute(ORMServer server, Connection conn, String sql, List paramList, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + List strList = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + + // 2.SQL语句处理完毕 + if (server.isUpdateSqlLog()) + { + strList = new ArrayList<>(paramList.size()); + for (int i=0;i. + */ +package org.zhiqim.orm.executor; + +import java.lang.reflect.Method; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.extend.SS; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZStatement; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 批量处理模式,参数为_Dbo的列表,支持_Dbo,_Table,_View + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class BatchExecutorClass implements BatchExecutor +{ + /** + * 执行executeBatch处理,全部为通配符匹配 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param paramList 参数列表 + * @param replaceMap 可替换表 + * @return 返回int,处理条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public int[] execute(ORMServer server, Connection conn, String sql, List paramList, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + List strList = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + + Class dboClass = paramList.get(0).getClass(); + Dbo paramDbo = server.getDbo(dboClass); + + // 2.获取通配符## + List paramKeyList = new ArrayList<>(); + for (int i = 0, start = 0, end = sql.indexOf('#'); end != -1; i++, start = end, end = sql.indexOf('#', start + 1)) + { + if (i % 2 == 0) + continue; + String paramKey = sql.substring(start + 1, end);// 取出KEY,支持类field和表column + String method = paramDbo.getGetMethod(paramKey); + if (method == null) + throw new ORMException("ZTable/ZView[" + paramDbo.getClass().getName() + "]没有找到" + paramKey + "对应的方法]"); + + paramKeyList.add(new SS(paramKey, method)); + } + + for (int i=0;i(paramList.size()); + for (int i=0;i. + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZStatement; + +/** + * 批量处理模式,参数为MapSO的列表 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class BatchExecutorMap implements BatchExecutor +{ + /** + * 执行executeBatch处理,全部为通配符匹配 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param paramList 参数列表 + * @param replaceMap 可替换表 + * @return 返回int,处理条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public int[] execute(ORMServer server, Connection conn, String sql, List paramList, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + List strList = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + + // //2.获取通配符## + List paramKeyList = new ArrayList<>(); + for (int i = 0, start = 0, end = sql.indexOf('#'); end != -1; i++, start = end, end = sql.indexOf('#', start + 1)) + { + if (i % 2 == 0) + continue; + + String paramKey = sql.substring(start + 1, end); + paramKeyList.add(paramKey); + } + + for (int i=0;i(paramList.size()); + for (int i = 0; i < paramList.size(); i++) + { + String str = sql; + strList.add(str); + } + } + + // 4.设置传递参数 + boolean isMapSO = (paramList.get(0) instanceof MapSO); + + pstmt = conn.prepareStatement(sql); + for (int b = 0; b < paramList.size(); b++) + {// 批插 + String str = null; + if (server.isUpdateSqlLog()) + str = strList.get(b); + + Object v = paramList.get(b); + Map paramMap = isMapSO ? ((MapSO) v).instance() : (Map) v; + + for (int i = 0; i < paramKeyList.size(); i++) + { + String paramKey = paramKeyList.get(i); + Object value = paramMap.get(paramKey); + + if (server.isUpdateSqlLog()) + str = ZStatement.setParameter(server, pstmt, i + 1, value, str); + else + ZStatement.setParameter(server, pstmt, i + 1, value); + } + + // 逐个添加到批量表中 + pstmt.addBatch(); + + // 更新完整SQL语句到列表中 + if (server.isUpdateSqlLog()) + { + strList.remove(b); + strList.add(b, str); + } + } + + // 4.批量处理 + int[] rets = pstmt.executeBatch(); + + // 5.打印日志 + if (server.isUpdateSqlLog()) + { + for (String str : strList) + { + str = str.replaceAll("-%6-%-3%-", "?"); + uSqlLog.info(str); + } + } + + return rets; + } + catch (SQLException e) + { + log.error("BatchExecutorMap[SQLException][%s][sql=%s]", e, e.getMessage(), sql); + throw e; + } + catch (Exception e) + { + log.error("BatchExecutorMap[Exception][%s]", e, e.getMessage()); + throw new ORMException(e.getMessage(), e); + } + finally + { + ZDBClose.close(pstmt); + } + } + +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/executor/CallExecutor.java b/zhiqim_orm/src/org/zhiqim/orm/executor/CallExecutor.java new file mode 100644 index 0000000..722a1d0 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/executor/CallExecutor.java @@ -0,0 +1,153 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.executor; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.extend.TreeMapSO; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZResultSet; +import org.zhiqim.orm.datasource.ZStatement; +import org.zhiqim.orm.dbo.CallParam; +import org.zhiqim.orm.dbo.CallResult; +import org.zhiqim.orm.dbo.Dbo; + +public class CallExecutor +{ + public final Log log = LogFactory.getLog(QueryExecutor.class); + public final Log cSqlLog = LogFactory.getLog("call.sql.log"); + + /** + * 执行executeQuery处理,基本类型不需要判断是否有通配符##,sql语句用?代替 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param paramList 参数表 + * @param resultList 结果集表 + * @param replaceMap 可替换表 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public void execute(ORMServer server, Connection conn, String sql, List paramList, List resultList, MapSS replaceMap) throws ORMException, SQLException + { + CallableStatement cstmt = null; + ResultSet rst = null; + + try + { + //1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + cstmt = conn.prepareCall(sql); + + //设置IN/INOUT参数 + for (int i=0;i resultClass = callResult.getResultClass(); + + if (server.isResultBase(resultClass)) + callResult.setResultList(ZResultSet.parseToBase(rst, resultClass)); + else if (resultClass == Map.class || resultClass == MapSO.class || resultClass == HashMapSO.class || resultClass == LinkedMapSO.class || resultClass == TreeMapSO.class) + callResult.setResultList(ZResultSet.parseToMap(rst, resultClass)); + else if (server.isDbo(resultClass)) + { + Dbo resultDbo = server.getDbo(resultClass); + callResult.setResultList(ZResultSet.parseToDbo(rst, resultDbo)); + } + else + {//解析不了 + throw new ORMException("调用[函数/存储过程]时不支持的结果集类["+resultClass+"]"); + } + + ZDBClose.close(rst); + rst = null; + index++; + } + while (cstmt.getMoreResults() && resultList.size() > index); + } + } + catch (SQLException e) + { + log.error("CallExecutor[SQLException][%s][sql=%s]", e, e.getMessage(), sql); + throw e; + } + catch (Exception e) + { + log.error("CallExecutor[Exception][%s]", e, e.getMessage()); + throw new ORMException(e.getMessage(), e); + } + finally + { + ZDBClose.close(rst, cstmt); + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutor.java b/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutor.java new file mode 100644 index 0000000..a4a33d3 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutor.java @@ -0,0 +1,60 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; + +/** + * 查询处理器接口,传递OMR服务,连接,query,参数和可替换表等 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface QueryExecutor extends ORMConstants +{ + public final Log log = LogFactory.getLog(QueryExecutor.class); + public final Log uSqlLog = LogFactory.getLog("update.sql.log"); + public final Log qSqlLog = LogFactory.getLog("query.sql.log"); + + /** + * 执行executeQuery处理 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回结果集列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public List execute(ORMServer server, Connection conn, String sql, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException; + +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorBaseBase.java b/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorBaseBase.java new file mode 100644 index 0000000..2f1fec5 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorBaseBase.java @@ -0,0 +1,121 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Types; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZResultSet; +import org.zhiqim.orm.datasource.ZStatement; + +/** + * 查询处理器接口,参数为基本类型[int,long,String,Array],结果集为基本类型[int,long,String,Object] + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class QueryExecutorBaseBase implements QueryExecutor +{ + /** + * 执行executeQuery处理,基本类型不需要判断是否有通配符##,sql语句用?代替 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回结果集列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public List execute(ORMServer server, Connection conn, String sql, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + ResultSet rst = null; + String str = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + + // SQL语句处理完毕 + if (server.isQuerySqlLog()) + str = sql; + + pstmt = conn.prepareStatement(sql); + if (Types.isArray(param)) + {// 数组 + Object[] objs = Arrays.toArray(param); + for (int i = 0; i < objs.length; i++) + { + if (server.isQuerySqlLog()) + str = ZStatement.setParameter(server, pstmt, i + 1, objs[i], str); + else + ZStatement.setParameter(server, pstmt, i + 1, objs[i]); + } + } + else if (param != null) + {// 单个 + if (server.isQuerySqlLog()) + str = ZStatement.setParameter(server, pstmt, 1, param, str); + else + ZStatement.setParameter(server, pstmt, 1, param); + } + + // 查询可以打印SQL + if (server.isQuerySqlLog()) + { + str = str.replaceAll("-%6-%-3%-", "?"); + qSqlLog.info(str); + } + + rst = pstmt.executeQuery(); + + //解决结果集到基础对象中 + return ZResultSet.parseToBase(rst, resultClass); + } + catch (SQLException e) + { + log.error("QueryExecutorBaseBase[SQLException][%s][sql=%s]", e, e.getMessage(), sql); + throw e; + } + catch (Exception e) + { + log.error("QueryExecutorBaseBase[Exception][%s]", e, e.getMessage()); + throw new ORMException(e.getMessage(), e); + } + finally + { + ZDBClose.close(rst, pstmt); + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorBaseClass.java b/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorBaseClass.java new file mode 100644 index 0000000..d811450 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorBaseClass.java @@ -0,0 +1,122 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Types; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZResultSet; +import org.zhiqim.orm.datasource.ZStatement; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 查询处理器接口,参数为基本类型[int,long,String,Array],结果集为Class类型[com.zhiqim.dbo.User] + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class QueryExecutorBaseClass implements QueryExecutor +{ + /** + * 执行executeQuery处理,基本类型不需要判断是否有通配符##,sql语句用?代替 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回结果集列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public List execute(ORMServer server, Connection conn, String sql, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + ResultSet rst = null; + String str = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + Dbo resultDbo = server.getDbo(resultClass); + + if (server.isQuerySqlLog()) + str = sql; + + pstmt = conn.prepareStatement(sql); + if (Types.isArray(param)) + {// 数组 + Object[] objs = Arrays.toArray(param); + for (int i = 0; i < objs.length; i++) + { + if (server.isQuerySqlLog()) + str = ZStatement.setParameter(server, pstmt, i + 1, objs[i], str); + else + ZStatement.setParameter(server, pstmt, i + 1, objs[i]); + } + } + else if (param != null) + {// 单个 + if (server.isQuerySqlLog()) + str = ZStatement.setParameter(server, pstmt, 1, param, str); + else + ZStatement.setParameter(server, pstmt, 1, param); + } + + // 查询可以打印SQL + if (server.isQuerySqlLog()) + { + str = str.replaceAll("-%6-%-3%-", "?"); + qSqlLog.info(str); + } + + rst = pstmt.executeQuery(); + + //解决结果集到DBO中 + return ZResultSet.parseToDbo(rst, resultDbo); + } + catch (SQLException e) + { + log.error("QueryExecutorBaseClass[SQLException][%s][sql=%s]", e, e.getMessage(), sql); + throw e; + } + catch (Exception e) + { + log.error("QueryExecutorBaseClass[Exception][%s]", e, e.getMessage()); + throw new ORMException(e.getMessage(), e); + } + finally + { + ZDBClose.close(rst, pstmt); + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorBaseMap.java b/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorBaseMap.java new file mode 100644 index 0000000..d6e4e90 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorBaseMap.java @@ -0,0 +1,121 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Types; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZResultSet; +import org.zhiqim.orm.datasource.ZStatement; + +/** + * 查询处理器接口,参数为基本类型[int,long,String,Array],结果集为Map类型 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class QueryExecutorBaseMap implements QueryExecutor +{ + /** + * 执行executeQuery处理,基本类型不需要判断是否有通配符##,sql语句用?代替 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回结果集列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public List execute(ORMServer server, Connection conn, String sql, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + ResultSet rst = null; + String str = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + + // SQL语句处理完毕 + if (server.isQuerySqlLog()) + str = sql; + + pstmt = conn.prepareStatement(sql); + if (Types.isArray(param)) + {// 数组 + Object[] objs = Arrays.toArray(param); + for (int i = 0; i < objs.length; i++) + { + if (server.isQuerySqlLog()) + str = ZStatement.setParameter(server, pstmt, i + 1, objs[i], str); + else + ZStatement.setParameter(server, pstmt, i + 1, objs[i]); + } + } + else if (param != null) + {// 单个 + if (server.isQuerySqlLog()) + str = ZStatement.setParameter(server, pstmt, 1, param, str); + else + ZStatement.setParameter(server, pstmt, 1, param); + } + + // 查询可以打印SQL + if (server.isQuerySqlLog()) + { + str = str.replaceAll("-%6-%-3%-", "?"); + qSqlLog.info(str); + } + + rst = pstmt.executeQuery(); + + //解决结果集到哈唏表中 + return ZResultSet.parseToMap(rst, resultClass); + } + catch (SQLException e) + { + log.error("QueryExecutorBaseMap[SQLException][%s][sql=%s]", e, e.getMessage(), sql); + throw e; + } + catch (Exception e) + { + log.error("QueryExecutorBaseMap[Exception][%s]", e, e.getMessage()); + throw new ORMException(e.getMessage(), e); + } + finally + { + ZDBClose.close(rst, pstmt); + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorClassBase.java b/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorClassBase.java new file mode 100644 index 0000000..7e71ef0 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorClassBase.java @@ -0,0 +1,140 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.executor; + +import java.lang.reflect.Method; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.extend.SO; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZResultSet; +import org.zhiqim.orm.datasource.ZStatement; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 查询处理器接口,参数为Class类型[com.zhiqim.dbo.User],结果集为基本类型[int,long,String,Object] + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class QueryExecutorClassBase implements QueryExecutor +{ + /** + * 执行executeQuery处理 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回结果集列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public List execute(ORMServer server, Connection conn, String sql, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + ResultSet rst = null; + String str = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + + Dbo paramDbo = server.getDbo(param.getClass().getName()); + + // 获取通配符## + List paramKeyList = new ArrayList<>(); + for (int i = 0, start = 0, end = sql.indexOf('#'); end != -1; i++, start = end, end = sql.indexOf('#', start + 1)) + { + if (i % 2 == 0) + continue; + + String paramKey = sql.substring(start + 1, end);// 取出KEY,支持类field和表column + String method = paramDbo.getGetMethod(paramKey); + if (method == null) + throw new ORMException("_Table/_View/_Dbo[" + paramDbo.getClass().getName() + "]没有找到" + paramKey + "对应的方法]"); + + // 反射机制取值 + Method m = param.getClass().getMethod(method, new Class[0]); + Object value = m.invoke(param, new Object[0]); + paramKeyList.add(new SO(paramKey, value)); + } + + // 把SQL中通配符改成? + for (int i=0;i. + */ +package org.zhiqim.orm.executor; + +import java.lang.reflect.Method; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.LinkedList; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.extend.SO; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZResultSet; +import org.zhiqim.orm.datasource.ZStatement; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 查询处理器接口,参数为Class类型[com.zhiqim.dbo.User],结果集为Class类型[com.zhiqim.dbo.User] + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class QueryExecutorClassClass implements QueryExecutor +{ + /** + * 执行executeQuery处理 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回结果集列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public List execute(ORMServer server, Connection conn, String sql, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + ResultSet rst = null; + String str = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + + Dbo paramDbo = server.getDbo(param.getClass()); + Dbo resultDbo = server.getDbo(resultClass); + + // 获取通配符## + LinkedList paramKeyList = new LinkedList<>(); + for (int i = 0, start = 0, end = sql.indexOf('#'); end != -1; i++, start = end, end = sql.indexOf('#', start + 1)) + { + if (i % 2 == 0) + continue; + String paramKey = sql.substring(start + 1, end);// 取出KEY,支持类field和表column + String method = paramDbo.getGetMethod(paramKey); + if (method == null) + throw new ORMException("_Table/_View/_Dbo[" + paramDbo.getClass().getName() + "]没有找到" + paramKey + "对应的方法]"); + + // 反射机制取值 + Method m = param.getClass().getMethod(method, new Class[0]); + Object value = m.invoke(param, new Object[0]); + paramKeyList.add(new SO(paramKey, value)); + } + + // 把SQL中通配符改成? + for (int i = 0; i < paramKeyList.size(); i++) + { + String paramKey = paramKeyList.get(i).key(); + sql = sql.replaceAll("#" + paramKey + "#", "?");// 把#paramKey#换成? + } + + // SQL语句处理完毕 + if (server.isQuerySqlLog()) + str = sql; + + pstmt = conn.prepareStatement(sql); + for (int i = 0; i < paramKeyList.size(); i++) + { + Object value = paramKeyList.get(i).value(); + if (server.isQuerySqlLog()) + str = ZStatement.setParameter(server, pstmt, i + 1, value, str); + else + ZStatement.setParameter(server, pstmt, i + 1, value); + } + + // 查询可以打印SQL + if (server.isQuerySqlLog()) + { + str = str.replaceAll("-%6-%-3%-", "?"); + qSqlLog.info(str); + } + + rst = pstmt.executeQuery(); + + //解决结果集到DBO中 + return ZResultSet.parseToDbo(rst, resultDbo); + } + catch (SQLException e) + { + log.error("QueryExecutorClassClass[SQLException][%s][sql=%s]", e, e.getMessage(), sql); + throw e; + } + catch (Exception e) + { + log.error("QueryExecutorClassClass[Exception][%s]", e, e.getMessage()); + throw new ORMException(e.getMessage(), e); + } + finally + { + ZDBClose.close(rst, pstmt); + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorClassMap.java b/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorClassMap.java new file mode 100644 index 0000000..3b895c7 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/executor/QueryExecutorClassMap.java @@ -0,0 +1,140 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.executor; + +import java.lang.reflect.Method; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.extend.SO; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZResultSet; +import org.zhiqim.orm.datasource.ZStatement; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 查询处理器接口,参数为Class类型[org.zhiqim.dbo.User],结果集为MapSO类型 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class QueryExecutorClassMap implements QueryExecutor +{ + /** + * 执行executeQuery处理 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回结果集列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public List execute(ORMServer server, Connection conn, String sql, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + ResultSet rst = null; + String str = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + + Dbo paramDbo = server.getDbo(param.getClass()); + + // 获取通配符## + List paramKeyList = new ArrayList<>(); + for (int i = 0, start = 0, end = sql.indexOf('#'); end != -1; i++, start = end, end = sql.indexOf('#', start + 1)) + { + if (i % 2 == 0) + continue; + + String paramKey = sql.substring(start + 1, end);// 取出KEY,支持类field和表column + String method = paramDbo.getGetMethod(paramKey); + if (method == null) + throw new ORMException("_Table/_View/_Dbo[" + paramDbo.getClass().getName() + "]没有找到" + paramKey + "对应的方法]"); + + // 反射机制取值 + Method m = param.getClass().getMethod(method, new Class[0]); + Object value = m.invoke(param, new Object[0]); + paramKeyList.add(new SO(paramKey, value)); + } + + // 把SQL中通配符改成? + for (int i=0;i. + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZResultSet; +import org.zhiqim.orm.datasource.ZStatement; + +/** + * 查询处理器接口,参数为MapSO类型,结果集为基本类型[int,long,String,Object] + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class QueryExecutorMapBase implements QueryExecutor +{ + /** + * 执行executeQuery处理 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回结果集列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public List execute(ORMServer server, Connection conn, String sql, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + ResultSet rst = null; + String str = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + Map paramMap = (param instanceof MapSO) ? ((MapSO) param).instance() : (Map) param; + + // 替换通配符##为? + List paramKeyList = new ArrayList<>(); + sql = ZStatement.paramMapString(sql, paramKeyList); + + // SQL语句处理完毕 + if (server.isQuerySqlLog()) + str = sql; + + pstmt = conn.prepareStatement(sql); + for (int i=0;i. + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZResultSet; +import org.zhiqim.orm.datasource.ZStatement; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 查询处理器接口,参数为MapSO类型,结果集为Class类型[org.zhiqim.dbo.User] + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class QueryExecutorMapClass implements QueryExecutor +{ + /** + * 执行executeQuery处理 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回结果集列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public List execute(ORMServer server, Connection conn, String sql, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + ResultSet rst = null; + String str = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + + Map paramMap = (param instanceof MapSO) ? ((MapSO) param).instance() : (Map) param; + Dbo resultDbo = server.getDbo(resultClass); + + // 替换通配符##为? + List paramKeyList = new ArrayList<>(); + sql = ZStatement.paramMapString(sql, paramKeyList); + + // SQL语句处理完毕 + if (server.isQuerySqlLog()) + str = sql; + + pstmt = conn.prepareStatement(sql); + for (int i=0;i. + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZResultSet; +import org.zhiqim.orm.datasource.ZStatement; + +/** + * 查询处理器接口,参数为MapSO类型,结果集为MapSO类型 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class QueryExecutorMapMap implements QueryExecutor +{ + /** + * 执行executeQuery处理 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回结果集列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public List execute(ORMServer server, Connection conn, String sql, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + ResultSet rst = null; + String str = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + Map paramMap = (param instanceof MapSO) ? ((MapSO) param).instance() : (Map) param; + + // 替换通配符##为? + List paramKeyList = new ArrayList<>(); + sql = ZStatement.paramMapString(sql, paramKeyList); + + // SQL语句处理完毕 + if (server.isQuerySqlLog()) + str = sql; + + pstmt = conn.prepareStatement(sql); + for (int i=0;i. + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.SQLException; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; + +/** + * 更新处理器接口,传递OMR服务,连接,update,参数和可替换表等 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface UpdateExecutor extends ORMConstants +{ + public final Log log = LogFactory.getLog(UpdateExecutor.class); + public final Log uSqlLog = LogFactory.getLog("update.sql.log"); + public final Log qSqlLog = LogFactory.getLog("query.sql.log"); + + /** + * 执行executeUpdate处理 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回int,处理条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public int execute(ORMServer server, Connection conn, String sql, Object param, MapSS replaceMap) throws ORMException, SQLException; +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/executor/UpdateExecutorBase.java b/zhiqim_orm/src/org/zhiqim/orm/executor/UpdateExecutorBase.java new file mode 100644 index 0000000..f965d32 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/executor/UpdateExecutorBase.java @@ -0,0 +1,119 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Types; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZStatement; + +/** + * 查询处理器接口,参数为基本类型[int,long,String,Array] + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class UpdateExecutorBase implements UpdateExecutor +{ + /** + * 执行executeUpdate处理,基本类型不需要判断是否有通配符##,sql语句用?代替 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回int,处理条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public int execute(ORMServer server, Connection conn, String sql, Object param, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + String str = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + + // 2.SQL语句处理完毕,保留一个打印SQL + if (server.isUpdateSqlLog()) + str = sql; + + // 3.设置传递参数 + pstmt = conn.prepareStatement(sql); + if (Types.isArray(param)) + {// 数组 + Object[] objs = Arrays.toArray(param); + for (int i = 0; i < objs.length; i++) + { + Object value = objs[i]; + if (server.isUpdateSqlLog()) + str = ZStatement.setParameter(server, pstmt, i + 1, value, str); + else + ZStatement.setParameter(server, pstmt, i + 1, value); + } + } + else if (param != null) + {// 单个 + if (server.isUpdateSqlLog()) + str = ZStatement.setParameter(server, pstmt, 1, param, str); + else + ZStatement.setParameter(server, pstmt, 1, param); + } + + // 4.执行处理 + int result = pstmt.executeUpdate(); + + // 5.打印日志 + if (server.isUpdateSqlLog()) + { + str = str.replaceAll("-%6-%-3%-", "?"); + uSqlLog.info(str); + } + + return result; + } + catch (SQLException e) + { + log.error("UpdateExecutorBase[SQLException][%s][sql=%s]", e, e.getMessage(), sql); + throw e; + } + catch (Exception e) + { + log.error("UpdateExecutorBase[Exception][%s]", e, e.getMessage()); + throw new ORMException(e.getMessage(), e); + } + finally + { + ZDBClose.close(pstmt); + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/executor/UpdateExecutorClass.java b/zhiqim_orm/src/org/zhiqim/orm/executor/UpdateExecutorClass.java new file mode 100644 index 0000000..204633d --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/executor/UpdateExecutorClass.java @@ -0,0 +1,136 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.executor; + +import java.lang.reflect.Method; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.extend.SO; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZStatement; +import org.zhiqim.orm.dbo.Dbo; + +/** + * 查询处理器接口,参数为Class类型[com.zhiqim.dbo.User] + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class UpdateExecutorClass implements UpdateExecutor +{ + /** + * 执行executeUpdate处理,全部为通配符匹配 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回int,处理条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public int execute(ORMServer server, Connection conn, String sql, Object param, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + String str = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + + // 2.获取通配符## + Dbo dbo = server.getDbo(param.getClass().getName()); + List paramList = new ArrayList<>(); + for (int i = 0, start = 0, end = sql.indexOf('#'); end != -1; i++, start = end, end = sql.indexOf('#', start + 1)) + { + if (i % 2 == 0) + continue; + + String paramKey = sql.substring(start + 1, end);// 取出KEY,支持类field和表column + String method = dbo.getGetMethod(paramKey); + if (method == null) + throw new ORMException("_Table/_View/_Dbo[" + dbo.getClass().getName() + "]没有找到" + paramKey + "对应的方法]"); + + // 反射机制取值 + Method m = param.getClass().getMethod(method, new Class[0]); + Object paramValue = m.invoke(param, new Object[0]); + paramList.add(new SO(paramKey, paramValue)); + } + + for (int i=0;i. + */ +package org.zhiqim.orm.executor; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.datasource.ZStatement; + +/** + * 查询处理器接口,参数为MapSO类型 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class UpdateExecutorMap implements UpdateExecutor +{ + /** + * 执行executeUpdate处理,MAP类型全为通配符 + * + * @param server ORM服务 + * @param conn 数据库连接 + * @param sql ZSQL语句 + * @param param 参数 + * @param replaceMap 可替换表 + * @return 返回int,处理条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据映射异常 + */ + public int execute(ORMServer server, Connection conn, String sql, Object param, MapSS replaceMap) throws ORMException, SQLException + { + PreparedStatement pstmt = null; + String str = null; + + try + { + // 1.替换可替换符$$ + sql = Sqls.formatReplaceMap(sql, replaceMap); + Map paramMap = (param instanceof MapSO) ? ((MapSO) param).instance() : (Map) param; + + // 2.获取通配符## + List paramKeyList = new ArrayList<>(); + for (int i = 0, start = 0, end = sql.indexOf('#'); end != -1; i++, start = end, end = sql.indexOf('#', start + 1)) + { + if (i % 2 == 0) + continue; + String paramKey = sql.substring(start + 1, end); + paramKeyList.add(paramKey); + } + + // 3.转换通配符为? + for (int i=0;i. + */ +package org.zhiqim.orm.impl; + +import java.sql.SQLException; + +import org.zhiqim.kernel.MultiInstancer; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ZDDL; +import org.zhiqim.orm.ZSQL; + +/** + * SQL(DML)调用实现

            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public final class ZDDLImplement extends MultiInstancer implements ZDDL, ORMConstants +{ + private ORMServer server; + private ZSQL zSQL; + + public ZDDLImplement(ORMServer server) + { + this.server = server; + this.zSQL = server.sql(); + } + + /** + * 获取ORM服务器 + * + * @return 数据库服务器 + */ + public ORMServer getServer() + { + return server; + } + + /** + * ORM定义的类型,转化为SQL类型,如string,15转化为varchar(15) + * + * @param type ORM定义的类型如string,15 + * @return SQL类型,如varchar(15) + */ + public String toColumnType(String type) + { + return server.getPolicy().toColumnType(type); + } + + /** + * ORM定义的类型,转化为SQL类型,如string,15转化为varchar(15) + * + * @param fieldType ORM定义的类型如string,int + * @param fieldLength ORM定义的类型长度,string和decimal时有效,如19,char | 10,2 + * @return SQL类型,如varchar(15) + */ + public String toColumnType(String fieldType, String fieldLength) + { + return toColumnType(Validates.isEmptyBlank(fieldLength)?fieldType:(fieldType+","+fieldLength)); + } + + /*****************************************************/ + //alter DML语句 + /*****************************************************/ + + /** + * 修改一个表的名称 + * + * @param table 表名 + * @param newTable 新表名 + * @throws SQLException 数据库异常 + */ + public void alterTableName(String table, String newTable) throws SQLException + { + zSQL.execute(new StringBuilder("alter table ").append(table).append(" rename to ").append(newTable.toUpperCase()).toString()); + } + + /** + * 增加一个表的一列 + * + * @param table 表名 + * @param column 列名 + * @param columnType 列类型 + * @param notNull 是否允许为null + * @throws SQLException 数据库异常 + */ + public void alterColumnAdd(String table, String column, String columnType, boolean notNull) throws SQLException + { + zSQL.execute(server.getPolicy().toAlertColumnAdd(table, column, columnType, notNull)); + } + + + /** + * 删除一个表的一列 + * + * @param table 表名 + * @param column 列名 + * @throws SQLException 数据库异常 + */ + public void alterColumnDrop(String table, String column) throws ORMException, SQLException + { + server.getPolicy().executeAlertColumnDrop(table, column); + } + + /** + * 修改一个表的一列信息 + * + * @param table 表名 + * @param column 列名 + * @param newColumn 新列名 + * @param newColumnType 新列类型 + * @param newNotNull 新列是否不为null + * @throws SQLException 数据库异常 + */ + public void alterColumnInfo(String table, String column, String newColumn, String newColumnType, boolean newNotNull) throws ORMException, SQLException + { + if (column.equalsIgnoreCase(newColumn)) + { + alterColumnType(table, column, newColumnType, newNotNull); + return; + } + + server.getPolicy().executeAlertColumnInfo(table, column, newColumn, newColumnType, newNotNull); + } + + /** + * 修改一个表的列名 + * + * @param table 表名 + * @param column 列名 + * @param newColumn 新列名 + * @throws SQLException 数据库异常 + */ + public void alterColumnName(String table, String column, String newColumn) throws ORMException, SQLException + { + server.getPolicy().executeAlertColumnName(table, column, newColumn); + } + + /** + * 修改一个表的一列类型 + * + * @param table 表名 + * @param column 列名 + * @param newType 新类型 + * @throws SQLException 数据库异常 + */ + public void alterColumnType(String table, String column, String newColumnType, boolean newNotNull) throws ORMException, SQLException + { + server.getPolicy().executeAlertColumnType(table, column, newColumnType, newNotNull); + } + + /** + * 增加表的主键 + * + * @param table 表名 + * @param columns 列名,多个用逗号隔开如AAA_AAA,BBB_BBB + * @throws SQLException 数据库异常 + */ + public void alertPrimaryKeyAdd(String table, String columns) throws ORMException, SQLException + { + server.getPolicy().executeAlertPrimaryKeyAdd(table, columns); + } + + /** + * 删除表的主键 + * + * @param table 表名 + * @throws SQLException 数据库异常 + */ + public void alertPrimaryKeyDrop(String table) throws ORMException, SQLException + { + server.getPolicy().executeAlertPrimaryKeyDrop(table); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/impl/ZSQLImplement.java b/zhiqim_orm/src/org/zhiqim/orm/impl/ZSQLImplement.java new file mode 100644 index 0000000..772a5ab --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/impl/ZSQLImplement.java @@ -0,0 +1,749 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.impl; + +import java.lang.reflect.Field; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.MultiInstancer; +import org.zhiqim.kernel.extend.HashMapCV; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.annotation.AnDbo; +import org.zhiqim.orm.annotation.AnDboField; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.dbo.CallParam; +import org.zhiqim.orm.dbo.CallResult; +import org.zhiqim.orm.dbo.defined._Dbo; +import org.zhiqim.orm.executor.BatchExecutor; +import org.zhiqim.orm.executor.CallExecutor; +import org.zhiqim.orm.executor.QueryExecutor; +import org.zhiqim.orm.executor.UpdateExecutor; + +/** + * 实现标准SQL调用,支持(executeUpdate, executeBatch, executeQuery)

            + * executeUpdate, 执行更新SQL语句,支持insert,replace,update,delete等
            + * executeBatch, 批量执行更新SQL语句,支持insert,replace,update,delete等
            + * executeQuery, 执行查询SQL语句,
            + * 返回结果可以是boolean,byte,int,long,String,Timestamp,Date,Time,FClob,FBlob等10种类型
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public final class ZSQLImplement extends MultiInstancer implements ZSQL, ORMConstants +{ + private ORMServer server; + private HashMapCV<_Dbo> dboMap; + + public ZSQLImplement(ORMServer server) + { + this.server = server; + this.dboMap = new HashMapCV<>(); + } + + /** + * 获取ORM服务器 + * + * @return 数据库服务器 + */ + public ORMServer getServer() + { + return server; + } + + /** + * 通过数据库对象类获取数据库对象对象 + * + * @param clazz 数据库对象类 + * @return 数据库对象 + */ + public _Dbo getDbo(Class clazz) + { + _Dbo _dbo = dboMap.get(clazz); + if (_dbo != null) + return _dbo; + + AnDbo result = clazz.getAnnotation(AnDbo.class); + if (result == null) + return null; + + _dbo = new _Dbo(clazz.getName()); + //增加字段 + Field[] fields = clazz.getDeclaredFields(); + for (Field field : fields) + { + String fieldName = field.getName(); + AnDboField f = field.getAnnotation(AnDboField.class); + if (f != null) + { + _dbo.addField(fieldName, f.column(), f.type()); + } + } + + dboMap.put(clazz, _dbo); + return _dbo; + } + + /*****************************************************/ + //select @@IDENTITY as id 查自增ID + /*****************************************************/ + + /** + * 查询当前自增ID值 + * + * @return 整型 + * @throws SQLException 数据库异常 + */ + public int identityInt() throws SQLException + { + return (int)identityLong(); + } + + /** + * 查询当前自增ID值 + * + * @return 长整型 + * @throws SQLException 数据库异常 + */ + public long identityLong() throws SQLException + { + //检查是否有事务连接 + boolean isTx = true; + Connection conn = (Connection)TransactionManager.getInstance(server.getId()); + if (conn == null) + {//判断当前线程中有没有事务连接,如果没有则定义为非事务,有则为事务 + isTx = false; + conn = server.getConnection(); + } + + PreparedStatement pstmt = null; + ResultSet rst = null; + + try + { + pstmt = conn.prepareStatement(T_SELECT_IDENTITY); + rst = pstmt.executeQuery(); + if (!rst.next()) + return -1; + + return rst.getLong(1); + } + finally + { + ZDBClose.close(rst, pstmt); + + //非事务时,要求归还连接 + if (!isTx) + conn.close(); + } + } + + /*****************************************************/ + //execute + /*****************************************************/ + + /** + * 执行标准SQL语句,不带参数,如DDL,DML语句 + * + * @param sql SQL语句 + * @throws SQLException 数据库异常 + */ + public void execute(String sql) throws SQLException + { + if (Validates.isEmptyBlank(sql)) + return; + + if (server.isSqlite()) + {//SQLite作truncate处理 + sql = Sqls.formatSpace(sql); + sql = sql.replaceAll("truncate table", "delete from"); + } + + //检查是否有事务连接 + boolean isTx = true; + Connection conn = (Connection)TransactionManager.getInstance(server.getId()); + if (conn == null) + {//判断当前线程中有没有事务连接,如果没有则定义为非事务,有则为事务 + isTx = false; + conn = server.getConnection(); + } + + Statement stmt = null; + + try + { + stmt = conn.createStatement(); + stmt.execute(sql); + } + finally + { + ZDBClose.close(stmt); + + if (!isTx) + {//非事务时,要求归还连接 + conn.close(); + } + } + } + + /** + * 批执行标准SQL语句,不带参数,如DDL,DML语句 + * + * @param sqlList SQL语句列表 + * @throws SQLException 数据库异常 + */ + public void execute(List sqlList) throws SQLException + { + if (Validates.isEmpty(sqlList)) + return; + + boolean isTx = true; + Connection conn = (Connection)TransactionManager.getInstance(server.getId()); + if (conn == null) + {//如果没有连接则取默认非事务连接 + isTx = false; + conn = server.getConnection(); + } + + Statement stmt = null; + boolean autoCommit = true; + try + { + autoCommit = conn.getAutoCommit(); + if (!isTx) + conn.setAutoCommit(false); + + stmt = conn.createStatement(); + for (String sql : sqlList) + { + if (server.isSqlite()) + {//SQLite作truncate处理 + sql = Sqls.formatSpace(sql); + sql = sql.replaceAll("truncate table", "delete from"); + } + + stmt.execute(sql); + } + + if (!isTx) + conn.commit(); + } + catch (SQLException e) + { + if (!isTx) + conn.rollback(); + + throw e; + } + finally + { + ZDBClose.close(stmt); + + if (!isTx) + { + conn.setAutoCommit(autoCommit); + conn.close(); + } + } + } + + /*****************************************************/ + //executeUpdate + /*****************************************************/ + + /** + * 无参数executeUpdate执行 + * + * @param id SQL配置编号 + * @return int 执行条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int executeUpdateId(String id) throws ORMException, SQLException + { + return executeUpdate(id, null, null); + } + + /** + * executeUpdate执行 + * + * @param id SQL配置编号 + * @param param 参数,需和executeUpdate配置对应,否则将报错 + * @return int 执行条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int executeUpdateId(String id, Object param) throws ORMException, SQLException + { + return executeUpdateId(id, param, null); + } + + /** + * executeUpdate执行 + * + * @param id SQL配置编号 + * @param param 参数,需和executeUpdate配置对应,否则将报错 + * @param replaceMap 字符替换表 + * @return int 执行条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int executeUpdateId(String id, Object param, MapSS replaceMap) throws ORMException, SQLException + { + String sql = server.getSQL(id); + if (sql == null) + throw new ORMException("ZSQL[executeUpdateId]["+id+"]未找到配置"); + + return executeUpdate(sql, param, replaceMap); + } + + /** + * executeUpdate执行 + * + * @param sql SQL语句 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int executeUpdate(String sql) throws ORMException, SQLException + { + return executeUpdate(sql, null, null); + } + + /** + * executeUpdate执行 + * + * @param sql SQL语句 + * @param param 参数,需和update配置对应,否则将报错 + * @return int 执行条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int executeUpdate(String sql, Object param) throws ORMException, SQLException + { + return executeUpdate(sql, param, null); + } + + /** + * executeUpdate执行 + * + * @param sql SQL语句 + * @param param 参数,需和update配置对应,否则将报错 + * @param replaceMap 字符替换表 + * @return int 执行条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int executeUpdate(String sql, Object param, MapSS replaceMap) throws ORMException, SQLException + { + //判断update和传参是事匹配 + UpdateExecutor updateExecutor = server.getUpdateExecutor(param); + if (updateExecutor == null) + throw new ORMException("ZSQL[executeUpdate]不支持的参数类型"); + + //检查是否有事务连接 + boolean isTx = true; + Connection conn = (Connection)TransactionManager.getInstance(server.getId()); + if (conn == null) + {//判断当前线程中有没有事务连接,如果没有则定义为非事务,有则为事务 + isTx = false; + conn = server.getConnection(); + } + + try + { + return updateExecutor.execute(server, conn, sql, param, replaceMap); + } + finally + { + //非事务时,要求归还连接 + if (!isTx) + conn.close(); + } + } + + /*****************************************************/ + //executeBatch + /*****************************************************/ + + /** + * executeBatch执行 + * + * @param id SQL配置编号 + * @param paramList 参数列表 + * @return int[] 执行结果数组 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] executeBatchId(String id, List paramList) throws ORMException, SQLException + { + return executeBatchId(id, paramList, null); + } + + /** + * executeBatch执行 + * + * @param id SQL配置编号 + * @param paramList 参数列表 + * @param replaceMap 字符替换表 + * @return int[] 执行结果数组 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] executeBatchId(String id, List paramList, MapSS replaceMap) throws ORMException, SQLException + { + String sql = server.getSQL(id); + if (sql == null) + throw new ORMException("ZSQL[executeBatchId]["+id+"]未找到配置"); + + return executeBatch(sql, paramList, replaceMap); + } + + /** + * executeBatch执行 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @return int[] 执行结果数组 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] executeBatch(String sql, List paramList) throws ORMException, SQLException + { + return executeBatch(sql, paramList, null); + } + + /** + * executeBatch执行 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @param replaceMap 字符替换表 + * @return int[] 执行结果数组 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] executeBatch(String sql, List paramList, MapSS replaceMap) throws ORMException, SQLException + { + //批处理为空 + if (paramList == null || paramList.isEmpty()) + return new int[0]; + + //判断update和传参是事匹配 + BatchExecutor batchExecutor = server.getBatchExecutor(paramList.get(0)); + if (batchExecutor == null) + throw new ORMException("ZSQL[executeBatch]不支持的参数类型"); + + boolean isTx = true; + Connection conn = (Connection)TransactionManager.getInstance(server.getId()); + if (conn == null) + {//如果没有连接则取默认非事务连接 + isTx = false; + conn = server.getConnection(); + } + + boolean autoCommit = true; + try + { + autoCommit = conn.getAutoCommit(); + if (!isTx) + conn.setAutoCommit(false); + + int[] result = batchExecutor.execute(server, conn, sql, paramList, replaceMap); + if (!isTx) + conn.commit(); + + return result; + } + catch (SQLException | ORMException e) + { + if (!isTx) + conn.rollback(); + + throw e; + } + finally + { + if (!isTx) + { + conn.setAutoCommit(autoCommit); + conn.close(); + } + } + } + + /*****************************************************/ + //executeQuery + /*****************************************************/ + + /** + * executeQuery执行 + * + * @param id SQL配置编号 + * @param resultClass 结果类结构 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQueryId(String id, Class resultClass) throws ORMException, SQLException + { + return executeQueryId(id, resultClass, null, null); + } + + /** + * executeQuery执行 + * + * @param id SQL配置编号 + * @param resultClass 结果类结构 + * @param param 参数 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQueryId(String id, Class resultClass, Object param) throws ORMException, SQLException + { + return executeQueryId(id, resultClass, param, null); + } + + /** + * executeQuery执行 + * + * @param id SQL配置编号 + * @param resultClass 结果类结构 + * @param param 参数 + * @param replaceMap 字符替换表 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQueryId(String id, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException + { + String sql = server.getSQL(id); + if (sql == null) + throw new ORMException("ZSQL[executeQueryId]["+id+"]未找到配置"); + + return executeQuery(sql, resultClass, param, replaceMap); + } + + /** + * executeQuery执行 + * + * @param sql SQL语句 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQuery(String sql) throws ORMException, SQLException + { + return executeQuery(sql, LinkedMapSO.class); + } + + /** + * executeQuery执行 + * + * @param sql SQL语句 + * @param resultClass 结果类结构 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQuery(String sql, Class resultClass) throws ORMException, SQLException + { + return executeQuery(sql, resultClass, null, null); + } + + /** + * executeQuery执行 + * + * @param sql SQL语句 + * @param resultClass 结果类结构 + * @param param 参数 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List executeQuery(String sql, Class resultClass, Object param) throws ORMException, SQLException + { + return executeQuery(sql, resultClass, param, null); + } + + /** + * executeQuery执行 + * + * @param sql SQL语句 + * @param resultClass 结果类结构 + * @param param 参数 + * @param replaceMap 字符替换表 + * @return 结果集 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + @SuppressWarnings("unchecked") + public List executeQuery(String sql, Class resultClass, Object param, MapSS replaceMap) throws ORMException, SQLException + { + //判断query和传参是事匹配 + QueryExecutor queryExecutor = server.getQueryExecutor(param, resultClass); + if (queryExecutor == null) + throw new ORMException("ZSQL[executeQuery]不支持的参数或结果类型"); + + //检查是否有事务连接 + boolean isTx = true; + Connection conn = (Connection)TransactionManager.getInstance(server.getId()); + if (conn == null) + {//判断当前线程中有没有事务连接,如果没有则定义为非事务,有则为事务 + isTx = false; + conn = server.getConnection(); + } + + try + { + return (List) queryExecutor.execute(server, conn, sql, resultClass, param, replaceMap); + } + finally + { + //非事务时,要求归还连接 + if (!isTx) + conn.close(); + } + } + + /************************************************************************************************/ + //call (函数&存储过程调用) + /************************************************************************************************/ + + /** + * call 函数&存储过程执行,无结果集,一般用于函数或count/sum等简单的存储过程 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void call(String sql, List paramList) throws ORMException, SQLException + { + call(sql, paramList, null, null); + } + + + /** + * call 函数&存储过程执行,支持替换表,无结果集,一般用于函数或count/sum等简单的存储过程 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @param replaceMap 字符替换表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void call(String sql, List paramList, MapSS replaceMap) throws ORMException, SQLException + { + call(sql, paramList, null, replaceMap); + } + + /** + * call 存储过程执行,返回一个结果集 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @param replaceMap 字符替换表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + @SuppressWarnings("unchecked") + public List call(String sql, List paramList, Class resultClass) throws ORMException, SQLException + { + List resultList = new ArrayList<>(1); + resultList.add(CallResult.set(resultClass)); + + call(sql, paramList, resultList, null); + return (List)resultList.get(0).getResultList(); + } + + /** + * call 函数&存储过程执行,支持多结果集 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @param resultList 结果集列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void call(String sql, List paramList, List resultList) throws ORMException, SQLException + { + call(sql, paramList, resultList, null); + } + + /** + * call 函数&存储过程执行,支持多结果集 + * + * @param sql SQL语句 + * @param paramList 参数列表 + * @param resultList 结果集列表 + * @param replaceMap 字符替换表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void call(String sql, List paramList, List resultList, MapSS replaceMap) throws ORMException, SQLException + { + //检查是否有事务连接 + boolean isTx = true; + Connection conn = (Connection)TransactionManager.getInstance(server.getId()); + if (conn == null) + {//判断当前线程中有没有事务连接,如果没有则定义为非事务,有则为事务 + isTx = false; + conn = server.getConnection(); + } + + try + { + CallExecutor executor = server.getCallExecutor(); + executor.execute(server, conn, sql, paramList, resultList, replaceMap); + } + finally + { + //非事务时,要求归还连接 + if (!isTx) + conn.close(); + } + } + + /*****************************************************/ + //exist 查询是否存在表或字段 + /*****************************************************/ + + public boolean existTable(String table) throws ORMException, SQLException + { + String sql = server.getPolicy().toExistsSQL(server.getDatabaseName(), table); + List result = executeQuery(sql, Integer.class); + return result.get(0) > 0; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/impl/ZTableImplement.java b/zhiqim_orm/src/org/zhiqim/orm/impl/ZTableImplement.java new file mode 100644 index 0000000..c0112d8 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/impl/ZTableImplement.java @@ -0,0 +1,1505 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.impl; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.sql.SQLException; +import java.util.Collection; +import java.util.List; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.MultiInstancer; +import org.zhiqim.kernel.extend.HashMapCV; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZTabler; +import org.zhiqim.orm.annotation.AnIndex; +import org.zhiqim.orm.annotation.AnIndexValue; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; +import org.zhiqim.orm.annotation.AnTableReplace; +import org.zhiqim.orm.cache.ZTableCache; +import org.zhiqim.orm.dbo.Batcher; +import org.zhiqim.orm.dbo.Dbo; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.dbo.defined._TableField; + +/** + * 标准类与数据库表映射调用,支持(truncate,exist,insert,replace,update,delete,count,sum,item,list,page)

            + * truncate, 清除表类对应的表
            + * exist, 检查表类对应的表是否存在
            + * create 创建表类对应的表 + * drop 删除表类对应的表 + * insert, 插入表类对应的表一条数据
            + * replace, 替换表类对应的表一条数据,根据主键
            + * update, 更新表类对应的表一条数据或根据条件更新数据
            + * delete, 删除表类对应的表一条数据或根据条件删除数据
            + * count, 统计表类对应的表数目
            + * sum, 总计表类对应的表数目
            + * item, 查询表类对应的表一条数据,根据主键,或根据条件排序取第一条
            + * list, 查询表类对应的表列表,或根据条件排序
            + * pag, 分页查询表类对应的表列表,指定分页页码和页数目
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + * @version v1.2.0 @author zouzhigang 2016-6-27 修改原类名ZTableExcutor为ZTableExecutor,正式使用表类名称 + */ +public final class ZTableImplement extends MultiInstancer implements ZTable, ORMConstants +{ + private ORMServer server; + private ZSQL zSQL; + private ZTabler zTabler; + private ZTableCache zCache; + private HashMapCV<_Table> tableMap; + + public ZTableImplement(ORMServer server) + { + this.server = server; + this.zSQL = server.sql(); + this.zTabler = server.tabler(); + this.zCache = new ZTableCache(server); + this.tableMap = new HashMapCV<>(true); + } + + /** + * 通过表类获取表对象 + * + * @param cls 表类 + * @return 表对象 + */ + public _Table getTable(Class cls) + { + _Table _table = tableMap.get(cls); + if (_table != null) + return _table; + + AnTable anTable = cls.getAnnotation(AnTable.class); + if (anTable == null) + return null; + + _table = new _Table(cls.getName(), anTable.table(), anTable.key(), anTable.type()); + //1.增加索引 + AnIndex anIndex = cls.getAnnotation(AnIndex.class); + if (anIndex != null) + { + AnIndexValue[] values = anIndex.value(); + for (AnIndexValue value : values) + { + _table.addIndex(value.name(), value.column(), value.unique()); + } + } + //2.增加字段和可替换字段 + Field[] fields = cls.getDeclaredFields(); + for (Field field : fields) + { + String fieldName = field.getName(); + AnTableField f = field.getAnnotation(AnTableField.class); + if (f != null) + { + _table.addField(fieldName, f.column(), f.type(), f.notNull()); + } + + AnTableReplace r = field.getAnnotation(AnTableReplace.class); + if (r != null) + { + _table.addReplace(fieldName, r.value()); + } + } + + //3.放置到缓存 + tableMap.put(cls, _table); + return _table; + } + + /** + * 通过表名获取表对象 + * + * @param tableName 表名 + * @return 表对象 + */ + public _Table getTableByTableName(String tableName) + { + for(_Table _table : tableMap.values()) + { + if (tableName.equals(_table.getTable())) + return _table; + } + + //未找到则从全局找 + Collection> list = Global.getClassList(); + for (Class clazz : list) + { + if (!clazz.isAnnotationPresent(AnTable.class)) + continue; + + _Table _table = getTable(clazz); + if (tableName.equals(_table.getTable())) + return _table; + } + + return null; + } + + /********************************************************************************************/ + //cache 表缓存 + /********************************************************************************************/ + + /** 更新数据缓存任务安排 */ + public void schedule() + { + zCache.schedule(); + } + + /** + * 更新数据到缓存 + * + * @param cls 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void cache(Class cls) throws ORMException, SQLException + { + if (!server.isCache(cls)) + {//未配置缓存的不处理 + return; + } + + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[cache]["+cls.getName()+"][未找到相应的配置]"); + + //创建表当不存在时 + create(cls); + + //组装SQL + StringBuilder sql = new StringBuilder("select * from ").append(_table.getTable()); + + //执行SQL + List list = zSQL.executeQuery(sql.toString(), cls); + zCache.cache(cls, list); + } + + /********************************************************************************************/ + //batch 表批处理 + /********************************************************************************************/ + + /** + * 批量处理插入/更新/删除数据 + * + * @param batcherList 批量表 + * @return 响应表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] batch(List batcherList) throws ORMException, SQLException + { + if (batcherList == null || batcherList.isEmpty()) + return new int[0]; + + Transaction tx = null; + int[] rets = new int[batcherList.size()]; + + try + { + tx = TransactionManager.beginTransaction(server.getId()); + + int i=0; + for (Batcher batcher : batcherList) + {//使用foreach而不使用fori是但心LinkedList + switch (batcher.getType()) + { + case INSERT: + rets[i++] = insert(batcher.getInsertData(), batcher.getInsertReplaceMap()); + break; + case REPLACE: + rets[i++] = replace(batcher.getReplaceData(), batcher.getReplaceReplaceMap()); + break; + case INSERT_OR_UPDATE: + rets[i++] = insertOrUpdate(batcher.getInsertOrUpdateData(), batcher.getInsertOrUpdateUpdater()); + break; + case UPDATE: + rets[i++] = update(batcher.getUpdateData(), batcher.getUpdateReplaceMap()); + break; + case UPDATER: + rets[i++] = update(batcher.getUpdaterClass(), batcher.getUpdaterUpdater()); + break; + case DELETE_ID: + rets[i++] = delete(batcher.getDeleteClass(), batcher.getDeleteReplaceMap(), batcher.getDeleteIds()); + break; + case DELETE_SELECTOR: + rets[i++] = delete(batcher.getDeleteClass(), batcher.getDeleteSelector()); + break; + } + } + + tx.commit(); + } + catch(ORMException | SQLException e) + { + if (tx != null) + { + try{tx.rollback();}catch(Exception e2){} + } + + throw e; + } + catch(Exception e) + { + if (tx != null) + { + try{tx.rollback();}catch(Exception e2){} + } + + throw new ORMException(e); + } + finally + { + if (tx != null) + { + try{tx.close();}catch(Exception e){} + } + } + + return rets; + } + + /********************************************************************************************/ + //truncate 清空表 + /********************************************************************************************/ + + /** + * 清空[表类]对应的[实际表] + * + * @param cls 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(Class cls) throws ORMException, SQLException + { + truncate(cls, new HashMapSS()); + } + + /** + * 清空[表类]对应的[实际表]分表,支持表名中替换字段指定为$ID$,如LOG_TRACE$ID$ + * + * @param clazz 表类 + * @param id 分表编号 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(Class cls, String id) throws ORMException, SQLException + { + truncate(cls, new HashMapSS(_ID_, id)); + } + + /** + * 清空[表类]对应的[实际表],支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param cls 表类 + * @param replaceMap 替换表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(Class cls, MapSS replaceMap) throws ORMException, SQLException + { + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[truncate]["+cls.getName()+"][未找到相应的配置]"); + + if (replaceMap == null) + throw new ORMException("ZTable[truncate][可替换表对象不能为null]"); + + zTabler.truncate(_table, replaceMap); + + if (server.isCache(cls)) + {//更新缓存 + cache(cls); + } + } + + /********************************************************************************************/ + //exist 表是否存在 + /********************************************************************************************/ + + /** + * 是否存在[表类]对应的[实际表] + * + * @param cls 表类 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(Class cls) throws ORMException, SQLException + { + return exist(cls, new HashMapSS()); + } + + /** + * 是否存在[表类]对应的[实际表]分表,支持表名中替换字段指定为$ID$,如LOG_TRACE$ID$ + * + * @param cls 表类 + * @param id 分表编号 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(Class cls, String id) throws ORMException, SQLException + { + return exist(cls, new HashMapSS(_ID_, id)); + } + + /** + * 是否存在[表类]对应的[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param cls 表类 + * @param replaceMap 可替换字段表 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(Class cls, MapSS replaceMap) throws ORMException, SQLException + { + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[exist]["+cls.getName()+"][未找到相应的配置]"); + + if (replaceMap == null) + throw new ORMException("ZTable[exist][可替换表对象不能为null]"); + + return zTabler.exist(_table, replaceMap); + } + + /********************************************************************************************/ + //create 创建表 + /********************************************************************************************/ + + /** + * 创建[表类]对应的[实际表] + * + * @param cls 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void create(Class cls) throws ORMException, SQLException + { + create(cls, new HashMapSS()); + } + + /** + * 创建[表类]对应的[实际表]分表 + * + * @param cls 表类 + * @param id 分表编号 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void create(Class cls, String id) throws ORMException, SQLException + { + create(cls, new HashMapSS(_ID_, id)); + } + + /** + * 创建[表类]对应的[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param cls 表类 + * @param replaceMap 可替换字段表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void create(Class cls, MapSS replaceMap) throws ORMException, SQLException + { + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[create]["+cls.getName()+"][未找到相应的配置]"); + + if (replaceMap == null) + throw new ORMException("ZTable[create][可替换表对象不能为null]"); + + zTabler.create(_table, replaceMap); + } + + /********************************************************************************************/ + //drop 删除表 + /********************************************************************************************/ + + /** + * 创建[表类]对应的[实际表] + * + * @param clazz 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void drop(Class cls) throws ORMException, SQLException + { + drop(cls, new HashMapSS()); + } + + /** + * 创建[表类]对应的[实际表]分表 + * + * @param cls 表类 + * @param id 分表编号 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void drop(Class cls, String id) throws ORMException, SQLException + { + drop(cls, new HashMapSS(_ID_, id)); + } + + /** + * 创建[表类]对应的[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param cls 表类 + * @param replaceMap 可替换字段表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void drop(Class cls, MapSS replaceMap) throws ORMException, SQLException + { + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[drop]["+cls.getName()+"][未找到相应的配置]"); + + if (replaceMap == null) + throw new ORMException("ZTable[drop][可替换表对象不能为null]"); + + zTabler.drop(_table, replaceMap); + } + + /********************************************************************************************/ + //insert 插入数据 + /********************************************************************************************/ + + /** + * 增加数据,传入标准[表类]对象 + * + * @param data 表对象 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insert(Object data) throws ORMException, SQLException + { + return insert(data, new HashMapSS()); + } + + /** + * 增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insert(Object data, MapSS replaceMap) throws ORMException, SQLException + { + Class cls = data.getClass(); + _Table _table = getTable(data.getClass()); + if (_table == null) + throw new ORMException("ZTable[insert]["+cls.getName()+"][未找到相应的配置]"); + + if (replaceMap == null) + throw new ORMException("ZTable[insert][可替换表对象不能为null]"); + + //检查和尝试创建表 + _table.addReplaceToMap(data, replaceMap); + create(cls, replaceMap); + + //组装SQL + String sql = zTabler.toInsertOrReplaceSQL(_table, "insert"); + + //执行SQL + int ret = zSQL.executeUpdate(sql, data, replaceMap); + + if (ret > 0 && server.isCache(cls)) + {//更新缓存 + cache(cls); + } + + return ret; + } + + /** + * 替换数据,传入标准[表类]对象和更新器(取fieldMap和replaceMap)当存在时指定修改的值 + * + * @param data 表对象 + * @param updater 更新器 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insertOrUpdate(Object data, Updater updater) throws ORMException, SQLException + { + Class clazz = data.getClass(); + _Table _table = getTable(data.getClass()); + if (_table == null) + throw new ORMException("ZTable[insertOrUpdate]["+clazz.getName()+"][未找到相应的配置]"); + + if (!server.isMysql()) + throw new ORMException("ZTable[insertOrUpdate]不支持当前数据库类型]"); + + //检查和尝试创建表 + _table.addReplaceToMap(data, updater.getReplaceMap()); + create(clazz, updater.getReplaceMap()); + + //组装字段和条件SQL和参数列 + MapSO paramMap = new HashMapSO(); + String insertSQL = toInsertOrUpdateSQL(_table, data, paramMap); + String updateSQL = zTabler.toUpdateFieldSQL(_table, updater, paramMap); + + //组装SQL + StringBuilder sql = new StringBuilder(insertSQL).append(" on duplicate key update ").append(updateSQL); + + //执行SQL + int ret = zSQL.executeUpdate(sql.toString(), paramMap, updater.getReplaceMap()); + + if (ret > 0 && server.isCache(clazz)) + {//更新缓存 + cache(clazz); + } + + return ret; + } + + /** + * 批量增加数据 + * + * @param dataList 表对象列表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] insertBatch(List dataList) throws ORMException, SQLException + { + return insertBatch(dataList, new HashMapSS()); + } + + /** + * 批量增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param dataList 表对象列表 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] insertBatch(List dataList, MapSS replaceMap) throws ORMException, SQLException + { + if (dataList == null || dataList.isEmpty()) + return new int[0]; + + Class cls = dataList.get(0).getClass(); + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[insertBatch]["+cls.getName()+"][未找到相应的配置]"); + + if (replaceMap == null) + throw new ORMException("ZTable[insertBatch][可替换表对象不能为null]"); + + //检查和尝试创建表 + _table.addReplaceToMap(dataList.get(0), replaceMap); + zTabler.create(_table, replaceMap); + + //组装SQL + String sql = zTabler.toInsertOrReplaceSQL(_table, "insert"); + + //执行SQL + int[] rets = zSQL.executeBatch(sql, dataList, replaceMap); + + if (server.isCache(cls) && hasDataUpdate(rets)) + {//更新缓存 + cache(cls); + } + + return rets; + } + + /********************************************************************************************/ + //replace 替换数据,MYSQL支持,如果有数据先删除后增加 + /********************************************************************************************/ + + /** + * 替换数据,传入标准[表类]对象 + * + * @param data 表对象 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(Object data) throws ORMException, SQLException + { + return replace(data, new HashMapSS()); + } + + /** + * 替换数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(Object data, MapSS replaceMap) throws ORMException, SQLException + { + Class clazz = data.getClass(); + _Table _table = getTable(clazz); + if (_table == null) + throw new ORMException("ZTable[replace]["+clazz.getName()+"][未找到相应的配置]"); + + if (!server.isMysql() && !server.isSqlite()) + throw new ORMException("ZTable[replace]不支持当前数据库类型]"); + + if (replaceMap == null) + throw new ORMException("ZTable[replace][可替换表对象不能为null]"); + + //检查和尝试创建表 + _table.addReplaceToMap(data, replaceMap); + create(data.getClass(), replaceMap); + + //组装SQL + String sql = zTabler.toInsertOrReplaceSQL(_table, "replace"); + + //执行SQL + int ret = zSQL.executeUpdate(sql, data, replaceMap); + + if (ret > 0 && server.isCache(clazz)) + {//更新缓存 + cache(clazz); + } + + return ret; + } + + /** + * 批量替换数据 + * + * @param dataList 表对象列表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] replaceBatch(List dataList) throws ORMException, SQLException + { + return replaceBatch(dataList, new HashMapSS()); + } + + /** + * 批量替换数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param dataList 表对象列表 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] replaceBatch(List dataList, MapSS replaceMap) throws ORMException, SQLException + { + if (dataList == null || dataList.isEmpty()) + return new int[0]; + + Class clazz = dataList.get(0).getClass(); + String name = clazz.getName(); + _Table _table = getTable(clazz); + if (_table == null) + throw new ORMException("ZTable[replaceBatch]["+name+"][未找到相应的配置]"); + + if (!server.isMysql() && !server.isSqlite()) + throw new ORMException("ZTable[replaceBatch]不支持当前数据库类型]"); + + if (replaceMap == null) + throw new ORMException("ZTable[replaceBatch][可替换表对象不能为null]"); + + //检查和尝试创建表 + _table.addReplaceToMap(dataList.get(0), replaceMap); + create(dataList.get(0).getClass(), replaceMap); + + //组装SQL + String sql = zTabler.toInsertOrReplaceSQL(_table, "replace"); + + //执行SQL + int[] rets = zSQL.executeBatch(sql, dataList, replaceMap); + + if (server.isCache(clazz)) + {//更新缓存 + cache(clazz); + } + + return rets; + } + + /********************************************************************************************/ + //update 更新数据 + /********************************************************************************************/ + + /** + * 更新数据,指定更新器需要更新的字段、条件和可替换表 + * + * @param clazz 表类 + * @param updater 更新器 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(Class clazz, Updater updater) throws ORMException, SQLException + { + _Table _table = getTable(clazz); + if (_table == null) + throw new ORMException("ZTable[update]["+clazz.getName()+"][未找到相应的配置]"); + + String result = _table.isValidUpdater(updater); + if (result != null) + throw new ORMException("ZTable[update]["+clazz.getName()+"][更新器字段["+result+"]类型和值要求不一致]"); + + int ret = zTabler.update(_table, updater); + + if (ret > 0 && server.isCache(clazz)) + {//更新缓存 + cache(clazz); + } + + return ret; + } + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新 + * + * @param data 表对象 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(Object data) throws ORMException, SQLException + { + return update(data, new HashMapSS()); + } + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持可替换表 + * + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(Object data, MapSS replaceMap) throws ORMException, SQLException + { + Class clazz = data.getClass(); + _Table _table = getTable(clazz); + if (_table == null) + throw new ORMException("ZTable[update]["+clazz.getName()+"][未找到相应的配置]"); + + if (_table.isAllKey()) + throw new ORMException("ZTable[update]["+clazz.getName()+"][所有字段都是关键属性,不支持此更新方法"); + + if (replaceMap == null) + throw new ORMException("ZTable[update][可替换表对象不能为null]"); + + //检查和尝试创建表 + _table.addReplaceToMap(data, replaceMap); + create(clazz, replaceMap); + + //组装SQL + StringBuilder sql = new StringBuilder("update ").append(_table.getTable()).append(" set "); + //field + List<_TableField> fieldList = _table.getFieldListNoKey(); + //第一个不加逗号 + _TableField field = fieldList.get(0); + sql.append(field.getColumn()).append("=#").append(field.getColumn()).append("#"); + //后面的加逗号 + for (int i=1;i keyList = _table.getKeyList(); + //第一个不加 where + StringBuilder where = new StringBuilder(); + where.append(" where ").append(keyList.get(0)).append("=#").append(keyList.get(0)).append("#"); + //后面的加 and + for (int i=1;i 0 && server.isCache(clazz)) + {//更新缓存 + cache(clazz); + } + + return ret; + } + + /********************************************************************************************/ + //delete 删除数据 + /********************************************************************************************/ + + /** + * 删除数据,多个主键时使用 + * + * @param cls 表类 + * @param ids 关键属性为数组,多个主键 + * @return 返回删除数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int delete(Class cls, Object... ids) throws ORMException, SQLException + { + return delete(cls, null, ids); + } + + /** + * 删除数据,多个主键时使用 + * + * @param cls 表类 + * @param replaceMap 替换表 + * @param ids 关键属性为数组,多个主键 + * @return 返回删除数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int delete(Class cls, MapSS replaceMap, Object... ids) throws ORMException, SQLException + { + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[delete]["+cls.getName()+"][未找到相应的配置]"); + + int ret = zTabler.delete(_table, replaceMap, ids); + + if (ret > 0 && server.isCache(cls)) + {//更新缓存 + cache(cls); + } + + return ret; + } + + /** + * 删除数据, 根据条件 + * + * @param cls 表类 + * @param selector 对象选择器 + * @return 返回删除数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int delete(Class cls, Selector selector) throws ORMException, SQLException + { + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[delete]["+cls.getName()+"][未找到相应的配置]"); + + String result = _table.isValidSelector(selector); + if (result != null) + throw new ORMException("ZTable[delete]["+cls.getName()+"][查询器字段["+result+"]类型和值要求不一致]"); + + int ret = zTabler.delete(_table, selector); + + if (ret > 0 && server.isCache(cls)) + {//更新缓存 + cache(cls); + } + + return ret; + } + + /** + * 批量删除数据,根据主键删除 + * + * @param cls 表名 + * @param idsList 关键属性为数组的列表,多个主键列表 + * @return 返回删除结果列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] deleteBatch(Class cls, List idsList) throws ORMException, SQLException + { + return deleteBatch(cls, null, idsList); + } + + /** + * 批量删除数据,根据主键删除 + * + * @param cls 表名 + * @param replaceMap 替换表 + * @param idsList 关键属性为数组的列表,多个主键列表 + * @return 返回删除结果列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] deleteBatch(Class cls, MapSS replaceMap, List idsList) throws ORMException, SQLException + { + if (idsList == null || idsList.isEmpty()) + return new int[0]; + + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[delete]["+cls.getName()+"][未找到相应的配置]"); + + int[] ret = zTabler.deleteBatch(_table, replaceMap, idsList); + + if (server.isCache(cls) && hasDataUpdate(ret)) + {//更新缓存 + cache(cls); + } + + return ret; + } + + /********************************************************************************************/ + //count 查询数目 + /********************************************************************************************/ + + /** + * 查询数目,多个主键时使用 + * + * @param cls 表类 + * @param ids 关键属性值 + * @return 存在的数目 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class cls, Object... ids) throws ORMException, SQLException + { + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[count]["+cls.getName()+"][未找到相应的配置]"); + + if (!_table.isValidKeyObj(ids)) + throw new ORMException("ZTable[count]["+cls.getName()+"][传入主键值和要求不一致]"); + + return zTabler.count(_table, ids); + } + + /** + * 查询数目,整表查询 + * + * @param cls 表类 + * @return int 数目值 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class cls) throws ORMException, SQLException + { + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[count]["+cls.getName()+"][未找到相应的配置]"); + + return zTabler.count(_table); + } + + /** + * 查询数目,根据条件、可替换表查询 + * + * @param cls 表类 + * @param selector 对象查询器 + * @return int 数目值 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class cls, Selector selector)throws ORMException, SQLException + { + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[count]["+cls.getName()+"][未找到相应的配置]"); + + String result = _table.isValidSelector(selector); + if (result != null) + throw new ORMException("ZTable[count]["+cls.getName()+"][查询器字段["+result+"]类型和值要求不一致]"); + + return zTabler.count(_table, selector); + } + + /********************************************************************************************/ + //sum 计算总和 + /********************************************************************************************/ + + /** + * 计算总和 + * + * @param cls 表类 + * @param field 表字段 + * @return 计算总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(Class cls, String field) throws ORMException, SQLException + { + return sum(cls, new Selector(), field); + } + + /** + * 计算总和 + * + * @param cls 表类 + * @param field 表字段 + * @param selector 对象查询器 + * @return 计算总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(Class cls, Selector selector, String field) throws ORMException, SQLException + { + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[sum]["+cls.getName()+"][未找到相应的配置]"); + + String result = _table.isValidSelector(selector); + if (result != null) + throw new ORMException("ZTable[sum]["+cls.getName()+"][查询器字段["+result+"]类型和值要求不一致]"); + + return zTabler.sum(_table, selector, field); + } + + /** + * 计算多个总和 + * + * @param cls 表类 + * @param fields 多个表字段 + * @param selector 对象查询器 + * @return 计算多个总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long[] sum(Class cls, Selector selector, String... fields) throws ORMException, SQLException + { + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[sum]["+cls.getName()+"][未找到相应的配置]"); + + String result = _table.isValidSelector(selector); + if (result != null) + throw new ORMException("ZTable[sum]["+cls.getName()+"][查询器字段["+result+"]类型和值要求不一致]"); + + return zTabler.sum(_table, selector, fields); + } + + /********************************************************************************************/ + //item 查询一条数据 + /********************************************************************************************/ + + /** + * 查询一个表对象,支持多个主键 + * + * @param cls 表类 + * @param ids 关键属性值 + * @return 返回表对象 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public T item(Class cls, Object... ids) throws ORMException, SQLException + { + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[item]["+cls.getName()+"][未找到相应的配置]"); + + if (!_table.isValidKeyObj(ids)) + throw new ORMException("ZTable[item]["+cls.getName()+"]传参与主键要求不匹配]"); + + //检查和尝试创建表 + create(cls); + + if (server.isCache(cls)) + {//从缓存中查找 + return zCache.item(cls, ids); + } + + StringBuilder sql = new StringBuilder("select * from ").append(_table.getTable()); + + String[] keyArr = _table.getKeyArr(); + //第一个where + sql.append(" where ").append(keyArr[0]).append("=?"); + //后面的and + for (int i=1;i list = zSQL.executeQuery(sql.toString(), cls, ids); + return list.isEmpty()?null:list.get(0); + } + + /** + * 查询一个表对象,并指定返回属性,查询第一行 + * + * @param cls 表类 + * @return 返回表对象 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public T item(Class cls) throws ORMException, SQLException + { + return item(cls, new Selector()); + } + + /** + * 查询一个表对象,并指定返回属性,查询条件和排序条件 + * + * @param cls 表类 + * @param selector 对象查询器 + * @return 返回表对象 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public T item(Class cls, Selector selector) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZTable[item][selector]不允许为NULL]"); + + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[item]["+cls.getName()+"][未找到相应的配置]"); + + String field = _table.isValidSelector(selector); + if (field != null) + throw new ORMException("ZTable[item]["+cls.getName()+"][查询器字段["+field+"]类型和值要求不一致]"); + + //检查和尝试创建表 + create(cls, selector.getReplaceMap()); + + if (server.isCache(cls)) + {//从缓存中查找 + return zCache.item(cls, selector); + } + + //组装SQL + MapSO paramMap = new HashMapSO(); + String fieldSQL = selector.getFieldSQL(_table); + String whereSQL = selector.getWhereSQL(_table, paramMap); + String orderbySQL = selector.getOrderbySQL(_table); + String groupbySQL = selector.getGroupbySQL(_table); + String sql = server.getPolicy().toItemSQL(fieldSQL, _table.getTable(), whereSQL, orderbySQL, groupbySQL); + + //执行SQL + List list = zSQL.executeQuery(sql, cls, paramMap, selector.getReplaceMap()); + if (list.isEmpty()) + return null; + + //检查可替换参数 + T item = list.get(0); + _table.addReplaceToData(item, selector.getReplaceMap()); + return item; + } + + /**************************************************************************/ + //list 查询列表 + /**************************************************************************/ + + /** + * 查询表对象列表,全表查询 + * + * @param cls 表类 + * @return 返回表对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(Class cls) throws ORMException, SQLException + { + return list(cls, new Selector()); + } + + /** + * 查询表对象列表,并指定返回属性,查询条件和排序条件 + * + * @param cls 表类 + * @param selector 对象查询器 + * @return 返回表对象列表 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public List list(Class cls, Selector selector) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZTable[list][Selector]不允许为NULL]"); + + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[list]["+cls.getName()+"][未找到相应的配置]"); + + String result = _table.isValidSelector(selector); + if (result != null) + throw new ORMException("ZTable[list]["+cls.getName()+"][查询器字段["+result+"]类型和值要求不一致]"); + + //创建表当不存在时 + create(cls, selector.getReplaceMap()); + + if (server.isCache(cls)) + {//从缓存中查找 + return zCache.list(cls, selector); + } + + //组装SQL + MapSO paramMap = new HashMapSO(); + String fieldSQL = selector.getFieldSQL(_table); + String whereSQL = selector.getWhereSQL(_table, paramMap); + String orderbySQL = selector.getOrderbySQL(_table); + String groupbySQL = selector.getGroupbySQL(_table); + StringBuilder sql = new StringBuilder("select ").append(fieldSQL).append(" from ").append(_table.getTable()).append(whereSQL).append(orderbySQL).append(groupbySQL); + + //执行SQL + List list = zSQL.executeQuery(sql.toString(), cls, paramMap, selector.getReplaceMap()); + + //检查有没有可替换参数 + for (T item : list) + { + _table.addReplaceToData(item, selector.getReplaceMap()); + } + return list; + } + + /** + * 查询表对象列表,全表查询指定位置的数据 + * + * @param cls 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 返回表对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(Class cls, int pageNo, int pageSize) throws ORMException, SQLException + { + return list(cls, pageNo, pageSize, new Selector()); + } + + /** + * 查询表对象列表,并指定位置,查询条件和排序条件 + * + * @param cls 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 对象查询器 + * @return 返回表对象列表 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public List list(Class cls, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZTable[list][Selector]不允许为NULL]"); + + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[list]["+cls.getName()+"][未找到相应的配置]"); + + String result = _table.isValidSelector(selector); + if (result != null) + throw new ORMException("ZTable[list]["+cls.getName()+"][查询器字段["+result+"]类型和值要求不一致]"); + + //创建表当不存在时 + create(cls, selector.getReplaceMap()); + + if (server.isCache(cls)) + {//从缓存中查找 + return zCache.list(cls, pageNo, pageSize, selector); + } + + if (pageNo < 1) pageNo = 1; + if (pageSize < 1) pageSize = 10; + + //执行SQL + return list(cls, _table, pageNo, pageSize, selector); + } + + + /**************************************************************************/ + //page 分页显示 + /**************************************************************************/ + + /** + * 查询表对象分页信息 + * + * @param cls 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(Class cls, int pageNo, int pageSize) throws ORMException, SQLException + { + return page(cls, pageNo, pageSize, new Selector()); + } + + /** + * 查询表对象分页信息 + * + * @param cls 表类 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 对象查询器 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(Class cls, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZTable[page][selector]不允许为NULL]"); + + _Table _table = getTable(cls); + if (_table == null) + throw new ORMException("ZTable[page]["+cls.getName()+"][未找到相应的配置]"); + + String result = _table.isValidSelector(selector); + if (result != null) + throw new ORMException("ZTable[page]["+cls.getName()+"][查询器字段["+result+"]类型和值要求不一致]"); + + //创建表当不存在时 + create(cls, selector.getReplaceMap()); + + if (server.isCache(cls)) + {//从缓存中查找 + return zCache.page(cls, pageNo, pageSize, selector); + } + + if (pageNo < 1) pageNo = 1; + if (pageSize < 1) pageSize = 10; + + int totalRecord = count(cls, selector); + if (totalRecord == 0) + return PageBuilder.newResult(pageNo, pageSize); + + //检查where + int maxPage = (totalRecord-1) / pageSize + 1; + if (pageNo > maxPage) pageNo = maxPage; + + //执行SQL + List resultSet = list(cls, _table, pageNo, pageSize, selector); + return PageBuilder.newResult(totalRecord, pageNo, pageSize, resultSet); + } + + /**************************************************************************/ + //内部方法 + /**************************************************************************/ + + /** + * 内部方法,组装插入替换SQL + * 1.insert & insertOrUpdate & insertBatch + * 2.replace & replaceBatch + * 调用 + */ + private String toInsertOrUpdateSQL(_Table _table, Object data, MapSO paramMap) throws ORMException + { + Class clazz = data.getClass(); + Dbo dbo = server.getDbo(clazz); + + //组装SQL + StringBuilder sql = new StringBuilder("insert into ").append(_table.getTable()).append("("); + StringBuilder values = new StringBuilder("values ("); + List<_TableField> fieldList = _table.getFieldList(); + for (_TableField field : fieldList) + { + String fieldName = field.getField(); + String method = dbo.getGetMethod(fieldName); + if (method == null) + throw new ORMException("_Table/_View/_Dbo["+clazz.getName()+"]没有找到"+fieldName+"对应的方法]"); + + try + {//取值放置到MAP中,以fieldName方式 + Method m = clazz.getMethod(method, new Class[0]); + Object value = m.invoke(data, new Object[0]); + paramMap.put(fieldName, value); + sql.append(field.getColumn()).append(","); + values.append("#").append(fieldName).append("#").append(","); + } + catch (Exception e) + { + throw new ORMException(e); + } + } + + //去除最后一个逗号 + sql.setLength(sql.length()-1); + values.setLength(values.length()-1); + + //最后加结尾 + sql.append(") ").append(values).append(")"); + + return sql.toString(); + } + + /** 内部方法,list & page 调用 */ + private List list(Class clazz, _Table _table, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException + { + int minNum = (pageNo-1) * pageSize + 1; + int maxNum = pageNo * pageSize; + + MapSO paramMap = new HashMapSO(); + paramMap.put("minNum", minNum); + paramMap.put("maxNum", maxNum); + paramMap.put("minSize", minNum - 1); + paramMap.put("pageSize", pageSize); + + //组装SQL + String fieldSQL = selector.getFieldSQL(_table); + String whereSQL = selector.getWhereSQL(_table, paramMap); + String orderbySQL = selector.getOrderbySQL(_table); + String groupbySQL = selector.getGroupbySQL(_table); + String sql = server.getPolicy().toPageSQL(fieldSQL, _table.getTable(), whereSQL, orderbySQL, groupbySQL, maxNum, pageNo); + + //执行SQL + List list = zSQL.executeQuery(sql, clazz, paramMap, selector.getReplaceMap()); + + //检查有没有可替换参数 + for (T item : list) + { + _table.addReplaceToData(item, selector.getReplaceMap()); + } + return list; + } + + /** 是否有数据更新 */ + private boolean hasDataUpdate(int[] rets) + { + for (int ret : rets) + { + if (ret > 0) + return true; + } + + return false; + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/impl/ZTablerImplement.java b/zhiqim_orm/src/org/zhiqim/orm/impl/ZTablerImplement.java new file mode 100644 index 0000000..79a8602 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/impl/ZTablerImplement.java @@ -0,0 +1,1460 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.impl; + +import java.math.BigDecimal; +import java.sql.SQLException; +import java.util.HashSet; +import java.util.List; + +import org.zhiqim.kernel.MultiInstancer; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMI18n; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTabler; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.orm.dbo.UpdaterField; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.dbo.defined._TableField; + +/** + * 标准类与数据库表映射调用,支持(truncate,exist,insert,replace,update,delete,count,sum,item,list,page)

            + * truncate, 清除表类对应的表
            + * exist, 检查表类对应的表是否存在
            + * create 创建表类对应的表 + * insert, 插入表类对应的表一条数据
            + * replace, 替换表类对应的表一条数据,根据主键
            + * update, 更新表类对应的表一条数据或根据条件更新数据
            + * delete, 删除表类对应的表一条数据或根据条件删除数据
            + * count, 统计表类对应的表数目
            + * sum, 总计表类对应的表数目
            + * item, 查询表类对应的表一条数据,根据主键,或根据条件排序取第一条
            + * list, 查询表类对应的表列表,或根据条件排序
            + * pag, 分页查询表类对应的表列表,指定分页页码和页数目
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + * @version v1.2.0 @author zouzhigang 2016-6-27 修改原类名ZTableExcutor为ZTableExecutor,正式使用表类名称 + */ +public final class ZTablerImplement extends MultiInstancer implements ZTabler, ORMConstants +{ + private static final Log log = LogFactory.getLog(ZTablerImplement.class); + + private ORMServer server; + private ZSQL zSQL; + private HashSet existTableList; + private Object createTableLock; + + public ZTablerImplement(ORMServer server) + { + this.server = server; + this.zSQL = server.sql(); + this.existTableList = new HashSet(); + this.createTableLock = new Object(); + } + + /** + * 获取ORM服务器 + * + * @return 数据库服务器 + */ + public ORMServer getServer() + { + return server; + } + + /*****************************************************/ + //exist 表是否存在 + /*****************************************************/ + + /** + * 是否存在[实际表]可替换表 + * + * @param table 表类 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(_Table _table) throws ORMException, SQLException + { + return exist(_table, new HashMapSS()); + } + + /** + * 是否存在[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param table 表类 + * @param replaceMap 可替换字段表 + * @return =true表示存在,=false表示不存在 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public boolean exist(_Table _table, MapSS replaceMap) throws ORMException, SQLException + { + if (_table == null) + throw new ORMException("ZTabler[exist][表定义对象不能为null]"); + + if (replaceMap == null) + throw new ORMException("ZTabler[exist][可替换表对象不能为null]"); + + _table.chkReplace(replaceMap); + String table = Sqls.formatReplaceMap(_table.getTable(), replaceMap); + if (existTableList.contains(table)) + return true; + + boolean exist = zSQL.existTable(table); + if (exist) + existTableList.add(table); + + return exist; + } + + /*****************************************************/ + //create 创建表 + /*****************************************************/ + + /** + * 创建[实际表]可替换表 + * + * @param table 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void create(_Table table) throws ORMException, SQLException + { + create(table, new HashMapSS()); + } + + /** + * 创建[表类]对应的[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param table 表类 + * @param replaceMap 可替换字段表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void create(_Table _table, MapSS replaceMap) throws ORMException, SQLException + { + if (_table == null) + throw new ORMException("ZTabler[create][表定义对象不能为null]"); + + if (replaceMap == null) + throw new ORMException("ZTabler[create][可替换表对象不能为null]"); + + _table.chkReplace(replaceMap); + if (exist(_table, replaceMap)) + return; + + synchronized (createTableLock) + { + if (exist(_table, replaceMap)) + return; + + List sqlList = server.getPolicy().toTableString(_table, replaceMap); + zSQL.execute(sqlList); + } + + String tableName = Sqls.formatReplaceMap(_table.getTable(), replaceMap); + log.info("创建表[%s]成功", tableName); + } + + /** + * 删除[实际表]可替换表 + * + * @param table 表类 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void drop(_Table _table) throws ORMException, SQLException + { + drop(_table, null); + } + + /** + * 删除[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param table 表类 + * @param replaceMap 可替换字段表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void drop(_Table _table, MapSS replaceMap) throws ORMException, SQLException + { + if (_table == null) + throw new ORMException("ZTabler[drop][表定义对象不能为null]"); + + if (replaceMap == null) + throw new ORMException("ZTabler[drop][可替换表对象不能为null]"); + + _table.chkReplace(replaceMap); + String tableName = Sqls.formatReplaceMap(_table.getTable(), replaceMap); + if (!zSQL.existTable(tableName)) + {//直接到数据库查 + existTableList.remove(tableName); + return; + } + + //删除表和清除缓存 + zSQL.execute("drop table "+tableName+";"); + existTableList.remove(tableName); + log.info("删除表[%s]成功", tableName); + } + + /*****************************************************/ + //truncate 清空表 + /*****************************************************/ + + /** + * 清空[实际表] + * + * @param _table 表对象 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(_Table _table) throws ORMException, SQLException + { + truncate(_table, new HashMapSS()); + } + + /** + * 清空[表类]对应的[实际表],支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表定义对象 + * @param replaceMap 替换表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public void truncate(_Table _table, MapSS replaceMap) throws ORMException, SQLException + { + if (_table == null) + throw new ORMException("ZTabler[truncate][表定义对象不能为null]"); + + if (replaceMap == null) + throw new ORMException("ZTabler[truncate][可替换表对象不能为null]"); + + //组装SQL并执行 + String tableName = Sqls.formatReplaceMap(_table.getTable(), replaceMap); + + if (!server.isSqlite()) + { + //创建表当不存在时 + create(_table, replaceMap); + + zSQL.execute("truncate table "+tableName); + } + else + {//SQLite + if (zSQL.existTable(tableName)) + {//先删表 + zSQL.execute("drop table "+tableName); + existTableList.remove(tableName); + } + + //再重建表 + create(_table, replaceMap); + } + } + + /*****************************************************/ + //insert 插入数据 + /*****************************************************/ + + /** + * 增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表定义对象 + * @param data 表数据对象 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insert(_Table _table, LinkedMapSO data) throws ORMException, SQLException + { + return insert(_table, data, new HashMapSS()); + } + + /** + * 增加数据,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$ + * + * @param _table 表定义对象 + * @param data 表类 + * @param month 月份 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insertMonth(_Table _table, LinkedMapSO data, String month) throws ORMException, SQLException + { + return insert(_table, data, new HashMapSS("MONTH", month)); + } + + /** + * 增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表定义对象 + * @param data 表数据对象 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insert(_Table _table, LinkedMapSO data, MapSS replaceMap) throws ORMException, SQLException + { + if (_table == null) + throw new ORMException("ZTabler[insert][表定义对象不能为null]"); + + if (replaceMap == null) + throw new ORMException("ZTabler[insert][可替换表对象不能为null]"); + + //创建表当不存在时 + create(_table, replaceMap); + + //组装SQL并把可能的field替换成column + String sql = toInsertOrReplaceSQL(_table, "insert"); + replaceFieldToColumn(data, _table); + + //执行SQL + return zSQL.executeUpdate(sql, data, replaceMap); + } + + /** + * 替换数据,传入标准[表类]对象和更新器(取fieldMap和replaceMap)当存在时指定修改的值 + * + * @param _table 表定义对象 + * @param data 表对象 + * @param updater 更新器 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int insertOrUpdate(_Table _table, LinkedMapSO data, Updater updater) throws ORMException, SQLException + { + if (_table == null) + throw new ORMException("ZTabler[insertOrUpdate][表定义对象不能为null]"); + + if (!server.isMysql()) + throw new ORMException("ZTabler[insertOrUpdate]不支持当前数据库类型]"); + + //创建表当不存在时 + create(_table, updater.getReplaceMap()); + + //组装字段和条件SQL和参数列 + MapSO paramMap = new HashMapSO(); + String insertSQL = toInsertOrUpdateSQL(_table, data, paramMap); + String updateSQL = toUpdateFieldSQL(_table, updater, paramMap); + + //组装SQL + StringBuilder sql = new StringBuilder(insertSQL).append(" on duplicate key update ").append(updateSQL); + + //执行SQL + return zSQL.executeUpdate(sql.toString(), paramMap, updater.getReplaceMap()); + } + + /** + * 批量增加数据 + * + * @param _table 表定义对象 + * @param dataList 表对象列表 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] insertBatch(_Table _table, List dataList) throws ORMException, SQLException + { + return insertBatch(_table, dataList, new HashMapSS()); + } + + /** + * 批量增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表定义对象 + * @param dataList 表对象列表 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] insertBatch(_Table _table, List dataList, MapSS replaceMap) throws ORMException, SQLException + { + if (dataList == null || dataList.isEmpty()) + return new int[0]; + + if (_table == null) + throw new ORMException("ZTabler[insertBatch][表定义对象不能为null]"); + + if (replaceMap == null) + throw new ORMException("ZTabler[insertBatch][可替换表对象不能为null]"); + + //创建表当不存在时 + create(_table, replaceMap); + + //组装SQL + String sql = toInsertOrReplaceSQL(_table, "insert"); + for (LinkedMapSO data : dataList) + { + replaceFieldToColumn(data, _table); + } + + //执行SQL + return zSQL.executeBatch(sql, dataList, replaceMap); + } + + /*****************************************************/ + //replace 替换数据,MYSQL支持,如果有数据先删除后增加 + /*****************************************************/ + + /** + * 替换数据,传入标准[表类]对象 + * + * @param _table 表定义对象 + * @param data 表对象 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(_Table _table, LinkedMapSO data) throws ORMException, SQLException + { + return replace(_table, data, new HashMapSS()); + } + + /** + * 替换数据,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$ + * + * @param _table 表定义对象 + * @param data 表对象 + * @param month 月份 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replaceMonth(_Table _table, LinkedMapSO data, String month) throws ORMException, SQLException + { + HashMapSS replaceMap = new HashMapSS(); + replaceMap.put("MONTH", month); + + return replace(_table, data, replaceMap); + } + + /** + * 替换数据,支持表或字段中有一个替换字段,如LOG_TRACE$ID$ + * + * @param _table 表定义对象 + * @param data 表对象 + * @param replaceKey 替换键 + * @param replaceValue 替换值 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(_Table _table, LinkedMapSO data, String replaceKey, String replaceValue) throws ORMException, SQLException + { + HashMapSS replaceMap = new HashMapSS(); + replaceMap.put(replaceKey, replaceValue); + + return replace(_table, data, replaceMap); + } + + /** + * 替换数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表定义对象 + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int replace(_Table _table, LinkedMapSO data, MapSS replaceMap) throws ORMException, SQLException + { + if (_table == null) + throw new ORMException("ZTabler[replace][表定义对象不能为null]"); + + if (!server.isMysql() && !server.isSqlite()) + throw new ORMException("ZTabler[replace]不支持当前数据库类型]"); + + if (replaceMap == null) + throw new ORMException("ZTabler[replace][可替换表对象不能为null]"); + + //创建表当不存在时 + create(_table, replaceMap); + + //组装SQL + String sql = toInsertOrReplaceSQL(_table, "replace"); + replaceFieldToColumn(data, _table); + + //执行SQL + return zSQL.executeUpdate(sql, data, replaceMap); + } + + /** + * 批量替换数据 + * + * @param _table 表定义对象 + * @param dataList 表对象列表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] replaceBatch(_Table _table, List dataList) throws ORMException, SQLException + { + return replaceBatch(_table, dataList, new HashMapSS()); + } + + /** + * 批量替换数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$ + * + * @param _table 表定义对象 + * @param dataList 表对象列表 + * @param replaceMap 适配表 + * @return int 表示插入的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] replaceBatch(_Table _table, List dataList, MapSS replaceMap) throws ORMException, SQLException + { + if (dataList == null || dataList.isEmpty()) + return new int[0]; + + if (_table == null) + throw new ORMException("ZTabler[replaceBatch][表定义对象不能为null]"); + + if (!server.isMysql() && !server.isSqlite()) + throw new ORMException("ZTabler[replaceBatch]不支持当前数据库类型]"); + + if (replaceMap == null) + throw new ORMException("ZTabler[replaceBatch][可替换表对象不能为null]"); + + //创建表当不存在时 + create(_table, replaceMap); + + //组装SQL + String sql = toInsertOrReplaceSQL(_table, "replace"); + for (LinkedMapSO data : dataList) + { + replaceFieldToColumn(data, _table); + } + + //执行SQL + return zSQL.executeBatch(sql, dataList, replaceMap); + } + + /*****************************************************/ + //update 更新数据 + /*****************************************************/ + + /** + * 更新数据,指定更新器需要更新的字段、条件和可替换表 + * + * @param _table 表定义对象 + * @param updater 更新器 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(_Table _table, Updater updater) throws ORMException, SQLException + { + if (updater == null) + throw new ORMException("ZTabler[update][updater不允许为null]"); + + if (_table == null) + throw new ORMException("ZTabler[update][表定义对象不能为null]"); + + //创建表当不存在时 + create(_table, updater.getReplaceMap()); + + //组装字段和条件SQL和参数列 + MapSO paramMap = new HashMapSO(); + String fieldSQL = toUpdateFieldSQL(_table, updater, paramMap); + String whereSQL = updater.getWhereSQL(_table, paramMap); + + //组装SQL + StringBuilder sql = new StringBuilder("update ").append(_table.getTable()).append(" set "); + sql.append(fieldSQL); + sql.append(whereSQL); + + //执行SQL + return zSQL.executeUpdate(sql.toString(), paramMap, updater.getReplaceMap()); + } + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新 + * + * @param _table 表定义对象 + * @param data 表对象 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(_Table _table, LinkedMapSO data) throws ORMException, SQLException + { + return update(_table, data, new HashMapSS()); + } + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$ + * + * @param _table 表定义对象 + * @param data 表对象 + * @param month 月份 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int updateMonth(_Table _table, LinkedMapSO data, String month) throws ORMException, SQLException + { + HashMapSS replaceMap = new HashMapSS(); + replaceMap.put("MONTH", month); + + return update(_table, data, replaceMap); + } + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持表或字段中有一个替换字段,如LOG_TRACE$ID$ + * + * @param _table 表定义对象 + * @param data 表对象 + * @param replaceKey 替换键 + * @param replaceValue 替换值 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(_Table _table, LinkedMapSO data, String replaceKey, String replaceValue) throws ORMException, SQLException + { + HashMapSS replaceMap = new HashMapSS(); + replaceMap.put(replaceKey, replaceValue); + + return update(_table, data, replaceMap); + } + + /** + * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持可替换表 + * + * @param _table 表定义对象 + * @param data 表对象 + * @param replaceMap 适配表 + * @return int 表示更新的条数 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int update(_Table _table, LinkedMapSO data, MapSS replaceMap) throws ORMException, SQLException + { + if (_table == null) + throw new ORMException("ZTabler[update][表定义对象不能为null]"); + + if (_table.isAllKey()) + throw new ORMException("ZTabler[update]["+_table.getName()+"]所有字段都是关键属性,不支持此更新方法"); + + if (replaceMap == null) + throw new ORMException("ZTabler[update][可替换表对象不能为null]"); + + //创建表当表不存在时 + create(_table, replaceMap); + + //组装SQL + StringBuilder sql = new StringBuilder("update ").append(_table.getTable()).append(" set "); + //field + List<_TableField> fieldList = _table.getFieldListNoKey(); + //第一个不加逗号 + _TableField field = fieldList.get(0); + sql.append(field.getColumn()).append("=#").append(field.getColumn()).append("#"); + //后面的加逗号 + for (int i=1;i keyList = _table.getKeyList(); + //第一个不加 where + StringBuilder where = new StringBuilder(); + where.append(" where ").append(keyList.get(0)).append("=#").append(keyList.get(0)).append("#"); + //后面的加 and + for (int i=1;i idsList) throws ORMException, SQLException + { + return deleteBatch(_table, null, idsList); + } + + /** + * 批量删除数据,多个主键时使用 + * + * @param _table 表定义对象 + * @param replaceMap 替换表 + * @param idsList 关键属性为数组,多个主键的列表 + * @return 返回删除数列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int[] deleteBatch(_Table _table, MapSS replaceMap, List idsList) throws ORMException, SQLException + { + if (idsList == null || idsList.isEmpty()) + return new int[0]; + + if (_table == null) + throw new ORMException("ZTabler[delete][表定义对象不能为null]"); + + Object[] ids = idsList.get(0); + if (!_table.isValidKeyObj(ids)) + throw new ORMException("ZTabler[delete]["+_table.getName()+"]传参与主键要求不匹配]"); + + //创建表当表不存在时 + create(_table); + + //组装SQL + StringBuilder sql = new StringBuilder("delete from "); + + String[] keyArr = _table.getKeyArr(); + sql.append(_table.getTable()).append(" where ").append(keyArr[0]).append("=?"); + for (int i=1;i list = zSQL.executeQuery(sql.toString(), Integer.class, ids); + return list.get(0); + } + + /** + * 查询数目,整表查询 + * + * @param _table 表定义对象 + * @return int 数目值 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(_Table _table) throws ORMException, SQLException + { + if (_table == null) + throw new ORMException("ZTabler[count][表定义对象不能为null]"); + + //创建表当不存在时 + create(_table); + + //组装SQL + String sql = "select count(*) from "+_table.getTable(); + + //执行SQL + List list = zSQL.executeQuery(sql, Integer.class); + return list.get(0); + } + + /** + * 查询数目,根据条件、可替换表查询 + * + * @param _table 表定义对象 + * @param selector 对象查询器 + * @return int 数目值 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(_Table _table, Selector selector)throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZTabler[count][selector不允许为null]"); + + if (_table == null) + throw new ORMException("ZTabler[count][表定义对象不能为null]"); + + //创建表当不存在时 + create(_table, selector.getReplaceMap()); + + //组装SQL + MapSO paramMap = new HashMapSO(); + String whereSQL = selector.getWhereSQL(_table, paramMap); + StringBuilder sql = new StringBuilder("select count(*) from ").append(_table.getTable()).append(whereSQL); + + //执行SQL + List list = zSQL.executeQuery(sql.toString(), Integer.class, paramMap, selector.getReplaceMap()); + return list.get(0); + } + + /*****************************************************/ + //sum 计算总和 + /*****************************************************/ + + /** + * 计算总和 + * + * @param _table 表定义对象 + * @param field 表字段 + * @return 计算总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(_Table _table, String field) throws ORMException, SQLException + { + return sum(_table, new Selector(), field); + } + + /** + * 计算总和 + * + * @param _table 表定义对象 + * @param selector 对象查询器 + * @param field 表字段 + * @return 计算总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(_Table _table, Selector selector, String field) throws ORMException, SQLException + { + if (_table == null) + throw new ORMException("ZTabler[sum][表定义对象不能为null]"); + + String column = _table.getColumn(field); + if (column == null) + throw new ORMException("ZTabler[sum]["+_table.getName()+"]配置中未找到["+field+"]字段"); + + //创建表当不存在时 + create(_table, selector.getReplaceMap()); + + //组装SQL + MapSO paramMap = new HashMapSO(); + String whereSQL = selector.getWhereSQL(_table, paramMap); + StringBuilder sql = new StringBuilder("select sum(").append(column).append(") from ").append(_table.getTable()).append(whereSQL); + + //执行SQL + List list = zSQL.executeQuery(sql.toString(), Long.class, paramMap, selector.getReplaceMap()); + return list.isEmpty()?0:list.get(0); + } + + /** + * 计算多个总和 + * + * @param _table 表定义对象 + * @param selector 对象查询器 + * @param fields 多个表字段 + * @return 计算多个总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long[] sum(_Table _table, Selector selector, String... fields) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZTabler[sum][selector不允许为null]"); + + if (fields == null || fields.length < 1) + throw new ORMException("ZTabler[sum][fieldArr]不能为空]"); + + if (_table == null) + throw new ORMException("ZTabler[sum][表定义对象不能为null]"); + + if (!_table.hasAllField(fields)) + throw new ORMException("ZTabler[sum]["+Arrays.toString(fields)+"]有未找到的字段"); + + create(_table, selector.getReplaceMap()); + + //组装SQL + StringBuilder sql = new StringBuilder("select "); + //第一个 + String column = _table.getColumn(fields[0]); + sql.append(" sum(").append(column).append(") as ").append(fields[0]); + //后面的 + for (int i=1;i list = zSQL.executeQuery(sql.toString(), LinkedMapSO.class, paramMap, selector.getReplaceMap()); + if (list.isEmpty()) + return new long[fields.length]; + + //对结果集处理 + LinkedMapSO item = list.get(0); + long[] valueArr = new long[fields.length]; + for (int i=0;i list = zSQL.executeQuery(sql.toString(), LinkedMapSO.class, ids); + return list.isEmpty()?null:list.get(0); + } + + /** + * 查询一个表对象,并指定返回属性,查询第一行 + * + * @param _table 表定义实例 + * @return 返回表对象 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public LinkedMapSO item(_Table _table) throws ORMException, SQLException + { + return item(_table, new Selector()); + } + + /** + * 查询一个表对象,并指定返回属性,查询条件和排序条件 + * + * @param _table 表定义实例 + * @param selector 对象查询器 + * @return 返回表对象 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public LinkedMapSO item(_Table _table, Selector selector) throws ORMException, SQLException + { + if (_table == null) + throw new ORMException("ZTabler[item][表定义对象不能为null]"); + + //创建表当不存在时 + create(_table, selector.getReplaceMap()); + + //组装SQL + MapSO paramMap = new HashMapSO(); + String fieldSQL = selector.getFieldSQL(_table); + String whereSQL = selector.getWhereSQL(_table, paramMap); + String orderbySQL = selector.getOrderbySQL(_table); + String groupbySQL = selector.getGroupbySQL(_table); + String sql = server.getPolicy().toItemSQL(fieldSQL, _table.getTable(), whereSQL, orderbySQL, groupbySQL); + + //执行SQL + List list = zSQL.executeQuery(sql, LinkedMapSO.class, paramMap, selector.getReplaceMap()); + return list.isEmpty()?null:list.get(0); + } + + /*****************************************************/ + //list 查询列表 + /*****************************************************/ + + /** + * 查询表对象列表,全表查询 + * + * @param _table 表定义对象 + * @return 返回表对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(_Table _table) throws ORMException, SQLException + { + return list(_table, new Selector()); + } + + /** + * 查询表对象列表,并指定返回属性,查询条件和排序条件 + * + * @param _table 表定义对象 + * @param selector 对象查询器 + * @return 返回表对象列表 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public List list(_Table _table, Selector selector) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZTabler[list][Selector不允许为null]"); + + if (_table == null) + throw new ORMException("ZTabler[list][表定义对象不能为null]"); + + //创建表当不存在时 + create(_table, selector.getReplaceMap()); + + //组装SQL + MapSO paramMap = new HashMapSO(); + String fieldSQL = selector.getFieldSQL(_table); + String whereSQL = selector.getWhereSQL(_table, paramMap); + String orderbySQL = selector.getOrderbySQL(_table); + String groupbySQL = selector.getGroupbySQL(_table); + StringBuilder sql = new StringBuilder("select ").append(fieldSQL).append(" from ").append(_table.getTable()).append(whereSQL).append(orderbySQL).append(groupbySQL); + + //执行SQL + return zSQL.executeQuery(sql.toString(), LinkedMapSO.class, paramMap, selector.getReplaceMap()); + } + + /** + * 查询表对象列表,查询指定的位置的数据 + * + * @param _table 表定义对象 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 返回表对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(_Table _table, int pageNo, int pageSize) throws ORMException, SQLException + { + return list(_table, pageNo, pageSize, new Selector()); + } + + /** + * 查询表对象列表,并指定位置的,条件和排序条件 + * + * @param _table 表定义对象 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 对象查询器 + * @return 返回表对象列表 + * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常 + * @throws SQLException 数据库异常 + */ + public List list(_Table _table, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZTabler[list][Selector不允许为null]"); + + if (_table == null) + throw new ORMException("ZTabler[list][表定义对象不能为null]"); + + //创建表当不存在时 + create(_table, selector.getReplaceMap()); + + if (pageNo < 1) pageNo = 1; + if (pageSize < 1) pageSize = 10; + + //执行SQL + return lister(_table, pageNo, pageSize, selector); + } + + /*****************************************************/ + //page 分页显示 + /*****************************************************/ + + /** + * 查询表对象分页信息 + * + * @param _table 表定义对象 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(_Table _table, int pageNo, int pageSize) throws ORMException, SQLException + { + return page(_table, pageNo, pageSize, new Selector()); + } + + /** + * 查询表对象分页信息 + * + * @param _table 表定义对象 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 对象查询器 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(_Table _table, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZTabler[page][selector]不允许为NULL]"); + + if (_table == null) + throw new ORMException("ZTabler[page][表定义对象不能为null]"); + + //检查和尝试创建表 + create(_table, selector.getReplaceMap()); + + if (pageNo < 1) pageNo = 1; + if (pageSize < 1) pageSize = 10; + + int totalRecord = count(_table, selector); + if (totalRecord == 0) + return PageBuilder.newResult(pageNo, pageSize); + + //检查where + int maxPage = (totalRecord-1) / pageSize + 1; + if (pageNo > maxPage) pageNo = maxPage; + + //执行SQL + List list = lister(_table, pageNo, pageSize, selector); + return PageBuilder.newResult(totalRecord, pageNo, pageSize, list); + } + + + /**************************************************************************/ + //内部ZTable & ZTabler调用的方法 + /**************************************************************************/ + + /** + * 通过表定义对象,组装插入或替换的SQL + * 1.insert & insertOrUpdate & insertBatch + * 2.replace & replaceBatch + * 调用 + * + * @param _table 表定义对象 + * @param statement insert & replace + * @return SQL语句 + */ + public String toInsertOrReplaceSQL(_Table _table, String statement) + { + //组装SQL + StringBuilder sql = new StringBuilder(statement).append(" into ").append(_table.getTable()).append("("); + StringBuilder values = new StringBuilder("values ("); + List<_TableField> fieldList = _table.getFieldList(); + for (_TableField field : fieldList) + { + sql.append(field.getColumn()).append(","); + values.append("#").append(field.getColumn()).append("#").append(","); + } + + //去除最后一个逗号 + sql.setLength(sql.length()-1); + values.setLength(values.length()-1); + + //最后加结尾 + sql.append(") ").append(values).append(")"); + + return sql.toString(); + } + + /** + * 通过表定义对象,组装插入或更新的SQL + * 1.insert & insertOrUpdate & insertBatch + * 2.replace & replaceBatch + * 调用 + * + * @param _table 表定义对象 + * @param data 对象 + * @param paramMap 得到参数表 + * @return SQL语句 + * @throws ORMException 异常 + */ + private String toInsertOrUpdateSQL(_Table _table, LinkedMapSO data, MapSO paramMap) throws ORMException + { + //组装SQL + StringBuilder sql = new StringBuilder("insert into ").append(_table.getTable()).append("("); + StringBuilder values = new StringBuilder("values ("); + List<_TableField> fieldList = _table.getFieldList(); + for (_TableField field : fieldList) + { + String column = field.getColumn(); + + paramMap.put(column, data.get(column)); + sql.append(column).append(","); + values.append("#").append(column).append("#").append(","); + } + + //去除最后一个逗号 + sql.setLength(sql.length()-1); + values.setLength(values.length()-1); + + //最后加结尾 + sql.append(") ").append(values).append(")"); + + return sql.toString(); + } + + /** + * 通过表定义对象,组装更新字段SQL + * update & insertOrUpdate调用 + * + * @param _table 表对象 + * @param updater 更新器 + * @param paramMap 参数表 + * @return SQL语句 + * @throws ORMException 映射异常 + */ + public String toUpdateFieldSQL(_Table _table, Updater updater, MapSO paramMap) throws ORMException + { + StringBuilder sql = new StringBuilder(); + for (UpdaterField field : updater.getFieldList().values()) + { + if (!_table.hasField(field.getField())) + throw new ORMException("ZTabler[toUpdateFieldSQL]["+_table.getName()+"]配置中未找到["+field.getField()+"]字段"); + + String column = _table.getColumn(field.getField()); + if (field.getType() == 0) + {//值类型 + paramMap.put(column, field.getValue()); + sql.append(column).append("=#").append(column).append("#,"); + } + else + {//表达式类型 + String value = (String)field.getValue(); + + //对value中可能出现的字段进行匹配,替换成表列,注意有可能第二个列名会包含第一个列名,因此处理时字段名从长到短进行匹配 + _TableField[] dboFieldArr = _table.getFieldColumnListOrderByLen(); + for (_TableField dboField : dboFieldArr) + {//依次从长到短对表达式中的字段替换成表列 TODO 暂不对$等可能替换成错进行处理 + value = value.replaceAll(dboField.getField(), dboField.getColumn()); + } + + sql.append(column).append("=").append(value).append(","); + } + } + + //如果有值去掉最后的逗号 + if (sql.length() > 0) + sql.setLength(sql.length()-1); + + return sql.toString(); + } + + /** 内部方法,list & page 调用 */ + private List lister(_Table _table, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException + { + int minNum = (pageNo-1) * pageSize + 1; + int maxNum = pageNo * pageSize; + + MapSO paramMap = new HashMapSO(); + paramMap.put("minNum", minNum); + paramMap.put("maxNum", maxNum); + paramMap.put("minSize", minNum - 1); + paramMap.put("pageSize", pageSize); + + //组装SQL + String fieldSQL = selector.getFieldSQL(_table); + String whereSQL = selector.getWhereSQL(_table, paramMap); + String orderbySQL = selector.getOrderbySQL(_table); + String groupbySQL = selector.getGroupbySQL(_table); + String sql = server.getPolicy().toPageSQL(fieldSQL, _table.getTable(), whereSQL, orderbySQL, groupbySQL, maxNum, pageNo); + + //执行SQL + return zSQL.executeQuery(sql, LinkedMapSO.class, paramMap, selector.getReplaceMap()); + } + + /** + * 替换字段名为列名 + * + * @param _table 表定义对象 + * @return 本身 + */ + private void replaceFieldToColumn(LinkedMapSO data, _Table _table) + { + String[] keys = Lists.toArray(data.keySet(), new String[0]); + for (String key : keys) + { + String column = _table.getColumn(key); + Asserts.assertNotNull(column, ORMI18n.ormTableNotFoundField2, _table.getName(), key); + + if (column.equals(key)) + continue; + + //把field替换成column + data.put(column, data.get(key)); + data.remove(key); + } + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/impl/ZViewImplement.java b/zhiqim_orm/src/org/zhiqim/orm/impl/ZViewImplement.java new file mode 100644 index 0000000..2caa377 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/impl/ZViewImplement.java @@ -0,0 +1,582 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.impl; + +import java.lang.reflect.Field; +import java.math.BigDecimal; +import java.sql.SQLException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; + +import org.zhiqim.kernel.MultiInstancer; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.paging.PageBuilder; +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMI18n; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ORMType; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.ZTabler; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; +import org.zhiqim.orm.annotation.AnView; +import org.zhiqim.orm.annotation.AnViewField; +import org.zhiqim.orm.annotation.AnViewJoin; +import org.zhiqim.orm.annotation.AnViewJoinValue; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.dbo.defined._TableField; +import org.zhiqim.orm.dbo.defined._View; + +/** + * 视图类与数据库表多表映射调用,支持(count,sum,item,list,page)

            + * count, 统计视图类对应的关联表数目
            + * sum, 总计视图类对应的关联表数目
            + * item, 查询视图类对应的关联表一条数据,根据主键,或根据条件排序取第一条
            + * list, 查询视图类对应的关联表列表,或根据条件排序
            + * pag, 分页查询视图类对应的关联表列表,指定分页页码和页数目
            + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + * @version v1.2.0 @author zouzhigang 2016-6-27 修改原类名FRHELExcutor为ZViewExecutor,正式使用视图名称 + */ +public final class ZViewImplement extends MultiInstancer implements ZView, ORMConstants +{ + private ORMServer server; + private ZSQL zSQL; + private ZTabler zTabler; + private ZTable zTable; + private HashSet existViewList; + private HashMap, _View> viewMap; + + public ZViewImplement(ORMServer server) + { + this.server = server; + this.zSQL = server.sql(); + this.zTabler = server.tabler(); + this.zTable = server.table(); + this.existViewList = new HashSet(); + this.viewMap = new HashMap<>(); + } + + /** + * 通过视图类获取视图对象 + * + * @param clazz 视图类 + * @return 视图对象 + */ + public _View getView(Class clazz) + { + _View _view = viewMap.get(clazz); + if (_view != null) + return _view; + + AnView anView = clazz.getAnnotation(AnView.class); + if (anView == null) + return null; + + String table = anView.value(); + _view = new _View(clazz.getName(), table); + + //1.增加连接 + AnViewJoin join = clazz.getAnnotation(AnViewJoin.class); + if (join != null) + { + AnViewJoinValue[] values = join.value(); + for (AnViewJoinValue value : values) + { + _view.addJoin(value.type(), value.lTable(), value.lColumn(), value.rTable(), value.rColumn(), value.rValue()); + } + } + //2.增加字段 + Field[] fields = clazz.getDeclaredFields(); + for (Field field : fields) + { + if (Classes.isStaticTransientField(field)) + continue; + + String fieldName = field.getName(); + + AnViewField vfield = field.getAnnotation(AnViewField.class); + if (vfield != null) + {//从表中找字段 + _Table _table = zTable.getTableByTableName(_view.getTableName(vfield.table())); + Asserts.assertNotNull(_table, ORMI18n.ormViewNotFountTable2, clazz.getName(), vfield.table()); + + _TableField _field = _table.getField(vfield.column()); + Asserts.assertNotNull(_field, ORMI18n.ormViewNotFoundField2, clazz.getName(), fieldName); + + _view.addField(fieldName, vfield.table(), vfield.column(), _field.getType()); + } + } + + //3.增加表字段 + Class superClass = clazz.getSuperclass(); + if (superClass != Object.class) + { + fields = superClass.getDeclaredFields(); + for (Field field : fields) + { + if (Classes.isStaticTransientField(field)) + continue; + + String fieldName = field.getName(); + + AnTableField tfield = field.getAnnotation(AnTableField.class); + if (tfield != null) + { + Class fpclass = field.getDeclaringClass(); + AnTable t = fpclass.getAnnotation(AnTable.class); + if (t != null) + { + int type = ORMType.getColumnTypeMaybeLength(tfield.type()); + _view.addField(fieldName, t.table(), tfield.column(), type); + } + } + } + } + + viewMap.put(clazz, _view); + return _view; + } + + /*****************************************************/ + //count 查询数目 + /*****************************************************/ + + /** + * 查询数目,查全视图 + * + * @param clazz 视图类 + * @return 返回数目 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class clazz)throws ORMException, SQLException + { + return count(clazz, new Selector()); + } + + /** + * 查询数目,根据条件、可替换表查询 + * + * @param clazz 视图类 + * @param selector 对象查询器 + * @return 返回数目 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public int count(Class clazz, Selector selector)throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZView[count][selector]不允许为NULL]"); + + _View _view = getView(clazz); + if (_view == null) + throw new ORMException("ZView[count]["+clazz.getName()+"]未找到相应的配置]"); + + //检查表是否存在,当前仅支持MYSQL + createJoinTable(_view, selector.getReplaceMap()); + + MapSO paramMap = new HashMapSO(); + StringBuilder sql = new StringBuilder("select count(*) from "); + sql.append(_view.getJoinTable(zTable, selector, paramMap)); //连接表 + sql.append(_view.getEqualJoinSQL()); //连接条件 + sql.append(selector.getWhereSQL(_view, paramMap)); //自定义条件 + + List list = zSQL.executeQuery(sql.toString(), Integer.class, paramMap, selector.getReplaceMap()); + return list.get(0); + } + + /*****************************************************/ + //sum 计算总和 + /*****************************************************/ + + /** + * 计算总和,全视图求和 + * + * @param clazz 视图类 + * @param field 视图字段 + * @return 返回总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(Class clazz, String field) throws ORMException, SQLException + { + return sum(clazz, field, new Selector()); + } + + /** + * 计算总和,根据条件视图中求和 + * + * @param clazz 视图类 + * @param field 视图字段 + * @param selector 查询器 + * @return 返回总和(sum) + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long sum(Class clazz, String field, Selector selector) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZView[sum][Selector]不允许为NULL]"); + + _View view = getView(clazz); + if (view == null) + throw new ORMException("ZView[sum]["+clazz.getName()+"]未找到相应的配置]"); + + String column = view.getColumn(field); + if (column == null) + throw new ORMException("ZView[sum]["+clazz.getName()+"]配置中未找到["+field+"]字段"); + + //检查表是否存在,当前仅支持MYSQL + createJoinTable(view, selector.getReplaceMap()); + + MapSO paramMap = new HashMapSO(); + StringBuilder sql = new StringBuilder("select sum(").append(column).append(")"); + sql.append(" from ").append(view.getJoinTable(zTable, selector, paramMap)); //连接表 + sql.append(view.getEqualJoinSQL()); //连接条件 + sql.append(selector==null?"":selector.getWhereSQL(view, paramMap)); //自定义条件 + + List list = zSQL.executeQuery(sql.toString(), Long.class, paramMap, selector.getReplaceMap()); + return list.isEmpty()?0:list.get(0); + } + + /** + * 计算多个总和,全视图中多个求和 + * + * @param clazz 视图类 + * @param fieldArr 多个视图字段 + * @return 返回计算多个总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long[] sum(Class clazz, String[] fieldArr) throws ORMException, SQLException + { + return sum(clazz, fieldArr, new Selector()); + } + + /** + * 计算多个总和,根据条件视图中多个求和 + * + * @param clazz 视图类 + * @param fieldArr 多个视图字段 + * @param selector 查询器 + * @return 返回计算多个总和 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public long[] sum(Class clazz, String[] fieldArr, Selector selector) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZView[sum][selector]不允许为NULL]"); + + if (fieldArr == null || fieldArr.length < 1) + throw new ORMException("ZView[sum][fieldArr]不能为空]"); + + _View view = getView(clazz); + if (view == null) + throw new ORMException("ZView[sum]["+clazz.getName()+"]未找到相应的配置]"); + + if (!view.hasAllField(fieldArr)) + throw new ORMException("ZView[sum]["+Arrays.toString(fieldArr)+"]有未找到的字段"); + + //检查表是否存在,当前仅支持MYSQL + createJoinTable(view, selector.getReplaceMap()); + + StringBuilder sql = new StringBuilder("select "); + //第一个 + String column = view.getColumn(fieldArr[0]); + sql.append(" sum(").append(column).append(") as ").append(fieldArr[0]); + //后面的 + for (int i=1;i list = zSQL.executeQuery(sql.toString(), LinkedMapSO.class, paramMap, selector==null?null:selector.getReplaceMap()); + if (list.isEmpty()) + return new long[fieldArr.length]; + + LinkedMapSO item = list.get(0); + long[] valueArr = new long[fieldArr.length]; + for (int i=0;i T item(Class clazz) throws ORMException, SQLException + { + return item(clazz, new Selector()); + } + + /** + * 查询一个视图对象,可排序取第一个 + * + * @param clazz 视图类 + * @param selector 查询器 + * @return 返回视图对象 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public T item(Class clazz, Selector selector) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZView[item][Selector]不允许为NULL]"); + + _View _view = getView(clazz); + if (_view == null) + throw new ORMException("ZView[item]["+clazz.getName()+"]未找到相应的配置]"); + + //检查表是否存在,当前仅支持MYSQL + createJoinTable(_view, selector.getReplaceMap()); + + //组装SQL + MapSO paramMap = new HashMapSO(); + String whereSQL = selector.getWhereSQL(_view, paramMap); + String orderbySQL = selector.getOrderbySQL(_view); + String groupbySQL = selector.getGroupbySQL(_view); + + //加上一行标识,组装SQL + StringBuilder sql = new StringBuilder(); + switch (server.getDatabaseType()) + { + case Z_ORM_MYSQL_INT: + case Z_ORM_SQLITE_INT: + sql.append("select ").append(_view.getDefaultFieldSQL(selector.getFields())).append(" from ").append(_view.getJoinTable(zTable, selector, paramMap)) + .append(_view.getEqualJoinSQL()).append(whereSQL).append(orderbySQL).append(groupbySQL).append(" limit 1"); + break; + case Z_ORM_MSSQL_INT: + case Z_ORM_HSQL_INT: + sql.append("select top 1 ").append(_view.getDefaultFieldSQL(selector.getFields())).append(" from ").append(_view.getJoinTable(zTable, selector, paramMap)) + .append(_view.getEqualJoinSQL()).append(whereSQL).append(orderbySQL).append(groupbySQL); + break; + case Z_ORM_ORACLE_INT: + sql.append("select * from (select ").append(_view.getDefaultFieldSQL(selector.getFields())).append(" from ").append(_view.getJoinTable(zTable, selector, paramMap)) + .append(_view.getEqualJoinSQL()).append(whereSQL).append(orderbySQL).append(groupbySQL) + .append(") where rownum = 1 "); + break; + default: + throw new ORMException("不支持的数据库类型["+server.getDatabaseType()+"]"); + } + + List list = zSQL.executeQuery(sql.toString(), clazz, paramMap); + return list.isEmpty()?null:list.get(0); + } + + /*****************************************************/ + //list 查询列表 + /*****************************************************/ + + /** + * 查询列表,查全视图 + * + * @param clazz 视图类 + * @return 视图对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(Class clazz) throws ORMException, SQLException + { + return list(clazz, new Selector()); + } + + /** + * 查询列表,根据查询器 + * + * @param clazz 视图类 + * @param selector 查询器 + * @return 视图对象列表 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public List list(Class clazz, Selector selector) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZView[list][selector]不允许为NULL]"); + + _View _view = getView(clazz); + if (_view == null) + throw new ORMException("ZView[list]["+clazz.getName()+"]未找到相应的配置]"); + + //检查表是否存在,当前仅支持MYSQL + createJoinTable(_view, selector.getReplaceMap()); + + //组装SQL + MapSO paramMap = new HashMapSO(); + StringBuilder sql = new StringBuilder("select ").append(_view.getDefaultFieldSQL(selector.getFields())); //字段 + sql.append(" from ").append(_view.getJoinTable(zTable, selector, paramMap)); //连接表 + sql.append(_view.getEqualJoinSQL()); //连接条件 + sql.append(selector.getWhereSQL(_view, paramMap)); //自定义条件 + sql.append(selector.getOrderbySQL(_view)); //自定义排序 + sql.append(selector.getGroupbySQL(_view)); //自定义分组 + + return zSQL.executeQuery(sql.toString(), clazz, paramMap, selector.getReplaceMap()); + } + + /*****************************************************/ + //page 分页显示 + /*****************************************************/ + + /** + * 查询视图分页信息,查全视图 + * + * @param clazz 视图类 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(Class clazz, int pageNo, int pageSize) throws ORMException, SQLException + { + return page(clazz, pageNo, pageSize, new Selector()); + } + + /** + * 查询视图分页信息 + * + * @param clazz 视图类 + * @param pageNo 页码 + * @param pageSize 页数 + * @param selector 查询器 + * @return 分页信息,包括总页数,页码,页数和查询的记录 + * @throws ORMException 映射异常 + * @throws SQLException 数据库异常 + */ + public PageResult page(Class clazz, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException + { + if (selector == null) + throw new ORMException("ZView[page][selector]不允许为NULL]"); + + _View _view = getView(clazz); + if (_view == null) + throw new ORMException("ZView[page]["+clazz.getName()+"]未找到相应的配置]"); + + //检查表是否存在,当前仅支持MYSQL + createJoinTable(_view, selector.getReplaceMap()); + + if (pageNo < 1) pageNo = 1; + if (pageSize < 1) pageSize = 10; + + //先查数目 + int totalRecord = count(clazz, selector); + if (totalRecord == 0) + return PageBuilder.newResult(pageNo, pageSize); + + //检查where + int minNum = (pageNo-1) * pageSize + 1; + int maxNum = pageNo * pageSize; + MapSO paramMap = new HashMapSO(); + paramMap.put("minNum", new Integer(minNum)); + paramMap.put("maxNum", new Integer(maxNum)); + paramMap.put("minSize", new Integer(minNum - 1)); + paramMap.put("pageSize", new Integer(pageSize)); + + //组装SQL + String whereSQL = selector.getWhereSQL(_view, paramMap); + String orderbySQL = selector.getOrderbySQL(_view); + //String orderbyReSQL = selector.getOrderbyReverseSQL(_view);MSSQL使用临时表方案暂未用反转 + String groupbySQL = selector.getGroupbySQL(_view); + + StringBuilder innerTableSQL = new StringBuilder(" ( select "); + innerTableSQL.append(_view.getDefaultFieldSQL(selector.getFields())); //字段 + innerTableSQL.append(" from ").append(_view.getJoinTable(zTable, selector, paramMap)); //连接表 + innerTableSQL.append(_view.getEqualJoinSQL()); //连接条件 + innerTableSQL.append(whereSQL); //自定义条件 + innerTableSQL.append(orderbySQL); //自定义排序 + innerTableSQL.append(groupbySQL); //自定义分组 + innerTableSQL.append(" ) "); + + String sql = server.getPolicy().toPageViewSQL(innerTableSQL, maxNum, pageNo); + + //执行SQL + List list = zSQL.executeQuery(sql, clazz, paramMap, selector.getReplaceMap()); + return PageBuilder.newResult(totalRecord, pageNo, pageSize, list); + } + + /** 检查创建表 */ + private void createJoinTable(_View _view, MapSS replaceMap) throws SQLException, ORMException + { + String viewName = _view.getName(); + if (replaceMap != null) + {//如果替换表不为null则加进去 + StringBuilder strb = new StringBuilder(viewName); + for (Entry entry : replaceMap.entrySet()) + { + strb.append("_").append(entry.getKey()).append("_").append(entry.getValue()); + } + viewName = strb.toString(); + } + + //检查表是否存在,当前仅支持MYSQL + if (existViewList.contains(viewName)) + return; + + List tableList = _view.getTableNoAliasList(); + for (String table : tableList) + { + _Table _table = zTable.getTableByTableName(table); + if (_table == null) + throw new ORMException("ZView[createJoinTable]["+_view.getName()+"]未找到相应["+table+"]的配置"); + + zTabler.create(_table, replaceMap); + } + + existViewList.add(viewName); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/policy/_HSQL.java b/zhiqim_orm/src/org/zhiqim/orm/policy/_HSQL.java new file mode 100644 index 0000000..df6b568 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/policy/_HSQL.java @@ -0,0 +1,298 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.policy; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMI18n; +import org.zhiqim.orm.ORMPolicy; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ORMType; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.dbo.defined._TableField; +import org.zhiqim.orm.dbo.defined._TableIndex; + +/** + * HSQL数据库策略 + * + * 编号 数据库类型 JDBC类型 JDBC索引 说明 + * 布尔型 + * 1 BOOLEAN java.lang.Boolean 16 boolean它的值有true,false,unknown三种,在2.0标准中,bit类型是boolean类型的一个别名。 + * 整型 + * 2 TINYINT java.lang.Integer -6 + * 3 SMALLINT java.lang.Integer 5 + * 4 INTEGER java.lang.Integer 4 + * 5 BIGINT java.lang.Long -5 + * 小数型 + * 6 DECIMAL java.math.BigDecimal 3 + * 7 NUMERIC java.math.BigDecimal 2 + * 8 DOUBLE java.lang.Double 8 + * 9 FLOAT java.lang.Double 6 + * 10 REAL java.lang.Double 7 + * 字符串 + * 11 CHAR java.lang.String 1 + * 12 VARCHAR java.lang.String 12 + * 13 VARCHAR_IGNORECASE java.lang.String 12 + * 14 LONGVARCHAR java.lang.String -1 默认1M + * 23 CLOB 默认1M + * 日期 + * 15 DATE java.sql.Date 91 + * 16 TIME java.sql.Time 92 + * 17 TIMESTAMP java.sql.Timestamp 93 + * 二进制 + * 13 BINARY [B -2 默认1M + * 14 LONGVARBINARY [B -4 + * 18 VARBINARY [B -3 + * 22 BLOB 默认1M + * 其他类型 + * 24 ARRAY + * 25 DATALINK + * 26 DISTINCT + * 27 JAVA_OBJECT + * 28 REF + * 29 XML + * + * @version v1.0.0 @author zouzhigang 2016-9-18 新建与整理 + */ +public class _HSQL implements ORMPolicy +{ + private ORMServer server; + + public _HSQL(ORMServer server) + { + this.server = server; + } + + @Override + public boolean chkKeepTime(int maxKeepTime) + { + return true; + } + + @Override + public String toExistsSQL(String databaseName, String tableName) + { + return Strings.format(T_EXISTS_HSQL, tableName); + } + + @Override + public String toAlertColumnAdd(String table, String column, String columnType, boolean notNull) + { + return new StringBuilder() + .append("alter table ").append(table) + .append(" add column ").append(column.toUpperCase()).append(" ").append(columnType) + .append(notNull?" not null":" default null") + .toString(); + } + + @Override + public String toColumnType(String type) + { + int ctype = ORMType.getColumnTypeMaybeLength(type); + switch (ctype) + { + //基本类型 + case Z_ORM_BOOLEAN_INT: return "boolean"; + case Z_ORM_BYTE_INT: return "tinyint"; + case Z_ORM_SHORT_INT: return "smallint"; + case Z_ORM_INT_INT: return "integer"; + case Z_ORM_LONG_INT: return "bigint"; + //小数和时间 + case Z_ORM_DATETIME_INT: return "timestamp"; + case Z_ORM_DECIMAL_INT: + { + String[] values = Arrays.toStringArray(type); + Asserts.asserts(values.length == 3, ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[1]), ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[2]), ORMI18n.ormFieldTypeIncorrect1, type); + //decimal(15,3)前面11位整数相当于int,中间点号,后面3位小数的表示方式 + return "decimal("+values[1]+","+values[2]+")"; + } + //字符串 + case Z_ORM_STRING_INT: + { + String[] values = Arrays.toStringArray(type); + Asserts.asserts(values.length > 1, ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[1]), ORMI18n.ormFieldTypeIncorrect1, type); + + if (values.length == 3 && "char".equals(values[2])) + {//char(50) + Asserts.asserts(Validates.isIntegerValue(values[1], 1, 255), ORMI18n.ormFieldTypeIncorrect1, type); + return "char("+values[1]+")"; + } + else + {//varchar,text + int length = Ints.toInt(values[1]); + if (length <= 8000) + return "varchar("+values[1]+")"; + else + return "clob"; + } + } + //二进制字节数组 + case Z_ORM_BINARY_INT: return "blob"; + default:throw Asserts.exception("传入的类型[%s]不支持", type); + } + } + + @Override + public String toColumnString(_TableField field) + { + String column = field.getColumn(); + String columnType = toColumnType(field.getTypeAndLength()); + boolean notNull = field.isNotNull(); + + //PARENT_CODE varchar(32) NOT NULL,(逗号在ZTable中处理) + return new StringBuilder(column.toUpperCase()).append(" ").append(columnType).append(" ").append(notNull?"NOT NULL":"NULL").toString(); + } + + @Override + public List toTableString(_Table _table, MapSS replaceMap) + { + String key = _table.getKey(); + + String tableReplace = Sqls.formatReplaceMap(_table.getTable(), replaceMap); + List sqlList = new ArrayList<>(); + + //1.表头 + StringBuilder strb = new StringBuilder(); + strb.append("create table if not exists ").append(tableReplace.toUpperCase()).append(_BR_) + .append("("); + + //2.字段 PARENT_CODE varchar2(32) NOT NULL + for (_TableField field : _table.getFieldList()) + { + strb.append(_BR_).append(_FOUR_).append(toColumnString(field)).append(","); + } + + //3.主键primary key (ITEM_CODE) + if (_table.getKeyArr().length == 0) + strb.setLength(strb.length()-1); + else + strb.append(_BR_).append(_FOUR_).append("primary key (").append(key).append(")"); + + //4.表尾 + strb.append(_BR_).append(");").append(_BR_); + sqlList.add(Sqls.formatSpace(strb.toString())); + + //5.索引 create unique index IX_USER_INFO_NAME_NICK on USER_INFO(USER_NAME,USER_NICK); + for (_TableIndex index : _table.getIndexList()) + { + String indexNameReplace = Sqls.formatReplaceMap(index.getName(), replaceMap); + StringBuilder strbIndex = new StringBuilder("create ").append(index.getType()).append(" index ").append(indexNameReplace) + .append(" on ").append(tableReplace).append("(").append(index.getColumn()).append(");") + .append(_BR_); + + sqlList.add(Sqls.formatSpace(strbIndex.toString())); + } + + return Lists.trim(sqlList); + } + + @Override + public String toItemSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL) + { + return new StringBuilder() + .append("select top 1 ").append(fieldSQL) + .append(" from ").append(tableName).append(whereSQL).append(orderbySQL).append(groupbySQL) + .toString(); + } + + @Override + public String toPageSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL, int maxNum, int pageNo) + { + return new StringBuilder() + .append("select limit #minSize# #pageSize# ").append(fieldSQL) + .append(" from ").append(tableName).append(whereSQL).append(orderbySQL).append(groupbySQL) + .toString(); + } + + @Override + public String toPageViewSQL(StringBuilder innerTableSQL, int maxNum, int pageNo) + { + return new StringBuilder() + .append("select limit #minSize# #pageSize# * from ").append(innerTableSQL) + .toString(); + } + + /**************************************************************************************************/ + //不同的数据库处理 + /**************************************************************************************************/ + + @Override + public void executeAlertColumnDrop(String table, String column) throws ORMException, SQLException + {//标准SQL92 drop column + server.sql().execute(new StringBuilder("alter table ").append(table.toUpperCase()).append(" drop column ").append(column.toUpperCase()).toString()); + } + + @Override + public void executeAlertColumnName(String table, String column, String newColumn) throws ORMException, SQLException + {//和标准SQL92不同,格式为alter table [tableName] alter column [columnName] rename to [newColumnName] + server.sql().execute(new StringBuilder("alter table ").append(table.toUpperCase()).append(" alter column ").append(column.toUpperCase()).append(" rename to ").append(newColumn.toUpperCase()).toString()); + } + + @Override + public void executeAlertColumnType(String table, String column, String newColumnType, boolean newNotNull) throws ORMException, SQLException + {//分成两句处理,和PostgreSQL不同,这里是set not null和set null + String sql = new StringBuilder() + .append("alter table ").append(table.toUpperCase()).append(" alter column ").append(column.toUpperCase()).append(" ").append(newColumnType).append(";") + .append("alter table ").append(table.toUpperCase()).append(" alter column ").append(column.toUpperCase()).append(newNotNull?" set not null":" set null").append(";") + .toString(); + + server.sql().execute(sql); + } + + @Override + public void executeAlertColumnInfo(String table, String column, String newColumn, String newColumnType, boolean newNotNull) throws ORMException, SQLException + {//分成三句处理 + String sql = new StringBuilder() + .append("alter table ").append(table.toUpperCase()).append(" alter column ").append(column.toUpperCase()).append(" rename to ").append(newColumn.toUpperCase()).append(";") + .append("alter table ").append(table.toUpperCase()).append(" alter column ").append(column.toUpperCase()).append(" ").append(newColumnType).append(";") + .append("alter table ").append(table.toUpperCase()).append(" alter column ").append(column.toUpperCase()).append(newNotNull?" set not null":" set null").append(";") + .toString(); + + server.sql().execute(sql); + } + + @Override + public void executeAlertPrimaryKeyAdd(String table, String columns) throws SQLException + { + server.sql().execute("alter table "+table+" add primary key("+columns+")"); + } + + @Override + public void executeAlertPrimaryKeyDrop(String table) throws SQLException + { + server.sql().execute("alter table "+table+" drop primary key"); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/policy/_MSSQL.java b/zhiqim_orm/src/org/zhiqim/orm/policy/_MSSQL.java new file mode 100644 index 0000000..23df60f --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/policy/_MSSQL.java @@ -0,0 +1,275 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.policy; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMI18n; +import org.zhiqim.orm.ORMPolicy; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ORMType; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.dbo.defined._TableField; +import org.zhiqim.orm.dbo.defined._TableIndex; + +/** + * MSSQL数据库策略 + * + * @version v1.0.0 @author zouzhigang 2016-9-18 新建与整理 + */ +public class _MSSQL implements ORMPolicy +{ + private ORMServer server; + + public _MSSQL(ORMServer server) + { + this.server = server; + } + + @Override + public boolean chkKeepTime(int maxKeepTime) + { + return true; + } + + @Override + public String toExistsSQL(String databaseName, String tableName) + { + return Strings.format(T_EXISTS_MSSQL, tableName); + } + + @Override + public String toAlertColumnAdd(String table, String column, String columnType, boolean notNull) + { + return new StringBuilder() + .append("alter table ").append(table) + .append(" add ").append(column.toUpperCase()).append(" ").append(columnType) + .append(notNull?" not null":" default null") + .toString(); + } + + @Override + public String toColumnType(String type) + { + int ctype = ORMType.getColumnTypeMaybeLength(type); + switch (ctype) + { + //基本类型 + case Z_ORM_BOOLEAN_INT: return "bit"; + case Z_ORM_BYTE_INT: return "tinyint"; + case Z_ORM_SHORT_INT: return "smallint"; + case Z_ORM_INT_INT: return "int"; + case Z_ORM_LONG_INT: return "bigint"; + //小数和时间 + case Z_ORM_DATETIME_INT: return "datetime"; + case Z_ORM_DECIMAL_INT: + { + String[] values = Arrays.toStringArray(type); + Asserts.asserts(values.length == 3, ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[1]), ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[2]), ORMI18n.ormFieldTypeIncorrect1, type); + //decimal(15,3)前面11位整数相当于int,中间点号,后面3位小数的表示方式 + return "decimal("+values[1]+","+values[2]+")"; + } + //字符串 + case Z_ORM_STRING_INT: + { + String[] values = Arrays.toStringArray(type); + Asserts.asserts(values.length > 1, ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[1]), ORMI18n.ormFieldTypeIncorrect1, type); + + if (values.length == 3 && "char".equals(values[2])) + {//char(50) + Asserts.asserts(Validates.isIntegerValue(values[1], 1, 255), ORMI18n.ormFieldTypeIncorrect1, type); + return "char("+values[1]+")"; + } + else + {//varchar,text + int length = Ints.toInt(values[1]); + if (length <= 8000) + return "varchar("+values[1]+")"; + else + return "text"; + } + } + //二进制字节数组 + case Z_ORM_BINARY_INT: return "image"; + default:throw Asserts.exception("传入的类型[%s]不支持", type); + } + } + + @Override + public String toColumnString(_TableField field) + { + String column = field.getColumn(); + String columnType = toColumnType(field.getTypeAndLength()); + boolean notNull = field.isNotNull(); + + //PARENT_CODE varchar(32) NOT NULL,(逗号在ZTable中处理) + return new StringBuilder(column.toUpperCase()).append(" ").append(columnType).append(" ").append(notNull?"NOT NULL":"NULL").toString(); + } + + @Override + public List toTableString(_Table _table, MapSS replaceMap) + { + String key = _table.getKey(); + + String tableReplace = Sqls.formatReplaceMap(_table.getTable(), replaceMap); + List sqlList = new ArrayList<>(); + + //1.表头 + StringBuilder strb = new StringBuilder(); + strb.append("create table ").append(tableReplace.toUpperCase()).append(_BR_) + .append("(");//不支持if not exists + + //2.字段 PARENT_CODE varchar2(32) NOT NULL + for (_TableField field : _table.getFieldList()) + { + strb.append(_BR_).append(_FOUR_).append(toColumnString(field)).append(","); + } + + //3.主键primary key (ITEM_CODE) + if (_table.getKeyArr().length == 0) + strb.setLength(strb.length()-1); + else + strb.append(_BR_).append(_FOUR_).append("primary key (").append(key).append(")"); + + //4.表尾 + strb.append(_BR_).append(");").append(_BR_); + sqlList.add(Sqls.formatSpace(strb.toString())); + + //5.索引 create unique index IX_USER_INFO_NAME_NICK on USER_INFO(USER_NAME,USER_NICK); + for (_TableIndex index : _table.getIndexList()) + { + String indexNameReplace = Sqls.formatReplaceMap(index.getName(), replaceMap); + StringBuilder strbIndex = new StringBuilder("create ").append(index.getType()).append(" index ").append(indexNameReplace) + .append(" on ").append(tableReplace).append("(").append(index.getColumn()).append(");") + .append(_BR_); + + sqlList.add(Sqls.formatSpace(strbIndex.toString())); + } + + return Lists.trim(sqlList); + } + + @Override + public String toItemSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL) + { + return new StringBuilder() + .append("select top 1 ").append(fieldSQL) + .append(" from ").append(tableName).append(whereSQL).append(orderbySQL).append(groupbySQL) + .toString(); + } + + @Override + public String toPageSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL, int maxNum, int pageNo) + { + if (pageNo == 1) + { + return new StringBuilder() + .append("select top ").append(maxNum).append(" ").append(fieldSQL) + .append(" from ").append(tableName).append(whereSQL).append(orderbySQL) + .toString(); + } + else + { + return new StringBuilder() + .append("select top ").append(maxNum).append(" identity(int,1,1) as idkey_, ").append(fieldSQL).append(" into _temp_zhiqim_page from ").append(tableName).append(whereSQL).append(orderbySQL).append(groupbySQL) + .append(" select * from _temp_zhiqim_page where idkey_ >= #minNum#") + .append(" drop table _temp_zhiqim_page") + .toString(); + } + } + + @Override + public String toPageViewSQL(StringBuilder innerTableSQL, int maxNum, int pageNo) + { + if (pageNo == 1) + return new StringBuilder("select top ").append(maxNum).append(" * from ").append(innerTableSQL).toString(); + else + return new StringBuilder("select top ").append(maxNum).append(" identity(int,1,1) as idkey_, * into _temp_zhiqim_page from ").append(innerTableSQL) + .append(" select * from _temp_zhiqim_page where idkey_ >= #minNum#") + .append(" drop table _temp_zhiqim_page") + .toString(); + } + + /**************************************************************************************************/ + //不同的数据库处理 + /**************************************************************************************************/ + + @Override + public void executeAlertColumnDrop(String table, String column) throws ORMException, SQLException + {//标准SQL92 drop column + server.sql().execute(new StringBuilder("alter table ").append(table.toUpperCase()).append(" drop column ").append(column.toUpperCase()).toString()); + } + + @Override + public void executeAlertColumnName(String table, String column, String newColumn) throws ORMException, SQLException + {//利用存储过程 + + server.sql().execute(new StringBuilder("sp_rename '").append(table.toUpperCase()).append(".").append(column.toUpperCase()).append("', '").append(newColumn.toUpperCase()).append("'").toString()); + } + + @Override + public void executeAlertColumnType(String table, String column, String newColumnType, boolean newNotNull) throws ORMException, SQLException + {//标准SQL92 + String sql = new StringBuilder() + .append("alter table ").append(table).append(" alter column ").append(column.toUpperCase()).append(" ").append(newColumnType).append(newNotNull?" not null":" default null") + .toString(); + + server.sql().execute(sql); + } + + @Override + public void executeAlertColumnInfo(String table, String column, String newColumn, String newColumnType, boolean newNotNull) throws ORMException, SQLException + {//分成两句处理 + String sql = new StringBuilder() + .append("sp_rename '").append(table.toUpperCase()).append(".").append(column.toUpperCase()).append("', '").append(newColumn.toUpperCase()).append("'").append(";") + .append("alter table ").append(table.toUpperCase()).append(" alter column ").append(column.toUpperCase()).append(" ").append(newColumnType).append(newNotNull?" not null":" default null").append(";") + .toString(); + + server.sql().execute(sql); + } + + @Override + public void executeAlertPrimaryKeyAdd(String table, String columns) throws SQLException + { + server.sql().execute("alter table "+table+" add primary key("+columns+")"); + } + + @Override + public void executeAlertPrimaryKeyDrop(String table) throws SQLException + { + server.sql().execute("alter table "+table+" drop primary key"); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/policy/_MySQL.java b/zhiqim_orm/src/org/zhiqim/orm/policy/_MySQL.java new file mode 100644 index 0000000..64a7ae3 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/policy/_MySQL.java @@ -0,0 +1,316 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.policy; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMI18n; +import org.zhiqim.orm.ORMPolicy; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ORMType; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.dbo.defined._TableField; +import org.zhiqim.orm.dbo.defined._TableIndex; + +/** + * + * create table if not exists TEST_STRING ( + * T_ID bigint(20) NOT NULL, + * T_STRING varchar(50) NULL, + * T_DATE date NULL, + * T_TIME time NULL, + * T_DATETIME datetime NULL, + * primary key (T_ID) + * )engine=InnoDB default charset=utf8 collate=utf8_general_ci; + * + * MySQL数据库策略 + * + * 1.datetime类型对应java.sql.Timestamp,但没有毫微秒,格式如:'1000-01-01 00:00:00' 到 '9999-12-31 23:59:59' + * + * @version v1.0.0 @author zouzhigang 2016-9-18 新建与整理 + */ +public class _MySQL implements ORMPolicy +{ + private ORMServer server; + + public _MySQL(ORMServer server) + { + this.server = server; + } + + @Override + public boolean chkKeepTime(int maxKeepTime) + { + try + { + List list = server.sql().executeQuery("show session variables like 'wait_timeout';", HashMapSO.class); + for (HashMapSO item : list) + { + if (item.containsKey("Value")) + { + int timeout = Ints.toInt((String)item.get("Value")); + return timeout > maxKeepTime + 180;//大于3分钟 + } + } + } + catch (ORMException | SQLException e) + { + return false; + } + + return true; + } + + @Override + public String toExistsSQL(String databaseName, String tableName) + { + return Strings.format(T_EXISTS_MYSQL, databaseName, tableName); + } + + @Override + public String toAlertColumnAdd(String table, String column, String columnType, boolean notNull) + { + return new StringBuilder() + .append("alter table ").append(table.toUpperCase()) + .append(" add column ").append(column.toUpperCase()).append(" ").append(columnType) + .append(notNull?" not null":" default null") + .toString(); + } + + @Override + public String toColumnType(String type) + { + int ctype = ORMType.getColumnTypeMaybeLength(type); + switch (ctype) + { + //基本类型 + case Z_ORM_BOOLEAN_INT: return "tinyint(1)"; + case Z_ORM_BYTE_INT: return "tinyint(4)"; + case Z_ORM_SHORT_INT: return "smallint(6)"; + case Z_ORM_INT_INT: return "int"; + case Z_ORM_LONG_INT: return "bigint"; + //小数和时间 + case Z_ORM_DATETIME_INT: return "datetime"; + case Z_ORM_DECIMAL_INT: + { + String[] values = Arrays.toStringArray(type); + Asserts.asserts(values.length == 3, ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[1]), ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[2]), ORMI18n.ormFieldTypeIncorrect1, type); + //decimal(15,3)前面11位整数相当于int,中间点号,后面3位小数的表示方式 + return "decimal("+values[1]+","+values[2]+")"; + + } + //字符串 + case Z_ORM_STRING_INT: + { + String[] values = Arrays.toStringArray(type); + Asserts.asserts(values.length > 1, ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[1]), ORMI18n.ormFieldTypeIncorrect1, type); + + if (values.length == 3 && "char".equals(values[2])) + {//char(50) + Asserts.asserts(Validates.isIntegerValue(values[1], 1, 255), ORMI18n.ormFieldTypeIncorrect1, type); + return "char("+values[1]+")"; + } + else + {//varchar,text + int length = Ints.toInt(values[1]); + if (length <= 2000) + return "varchar("+values[1]+")"; + else if (length <= 20000) + return "text"; + else if (length <= 5000000) + return "mediumtext"; + else + return "longtext"; + } + + + } + //二进制字节数组 + case Z_ORM_BINARY_INT: return "mediumblob"; + default:throw Asserts.exception("传入的类型[%s]不支持", type); + } + } + + @Override + public String toColumnString(_TableField field) + { + String column = field.getColumn(); + String columnType = toColumnType(field.getTypeAndLength()); + boolean notNull = field.isNotNull(); + + //PARENT_CODE varchar(32) NOT NULL,(逗号在ZTable中处理) + return new StringBuilder(column.toUpperCase()).append(" ").append(columnType).append(" ").append(notNull?"NOT NULL":"NULL").toString(); + } + + @Override + public List toTableString(_Table _table, MapSS replaceMap) + { + String type = _table.getType(); + String key = _table.getKey(); + + String tableReplace = Sqls.formatReplaceMap(_table.getTable(), replaceMap); + List sqlList = new ArrayList<>(); + + //1.表头 + StringBuilder strb = new StringBuilder(); + strb.append("create table if not exists ").append(tableReplace.toUpperCase()).append(_BR_) + .append("("); + + //2.字段 PARENT_CODE varchar(32) NOT NULL + for (_TableField field : _table.getFieldList()) + { + strb.append(_BR_).append(_FOUR_).append(toColumnString(field)).append(","); + } + + //3.主键primary key (ITEM_CODE) + if (_table.getKeyArr().length == 0) + strb.setLength(strb.length()-1); + else + strb.append(_BR_).append(_FOUR_).append("primary key (").append(key).append(")"); + + //4.表尾 + strb.append(_BR_).append(")engine=").append(Validates.isEmptyBlank(type)?"InnoDB":type).append(" default charset=utf8 collate=utf8_general_ci;").append(_BR_); + sqlList.add(Sqls.formatSpace(strb.toString())); + + //5.索引 create unique index IX_USER_INFO_NAME_NICK on USER_INFO(USER_NAME,USER_NICK); + for (_TableIndex index : _table.getIndexList()) + { + String indexNameReplace = Sqls.formatReplaceMap(index.getName(), replaceMap); + StringBuilder strbIndex = new StringBuilder("create ").append(index.getType()).append(" index ").append(indexNameReplace) + .append(" on ").append(tableReplace).append("(").append(index.getColumn()).append(");") + .append(_BR_); + + sqlList.add(Sqls.formatSpace(strbIndex.toString())); + } + + return Lists.trim(sqlList); + } + + @Override + public String toItemSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL) + { + return new StringBuilder() + .append("select ").append(fieldSQL) + .append(" from ").append(tableName).append(whereSQL).append(orderbySQL).append(groupbySQL) + .append(" limit 1") + .toString(); + } + + @Override + public String toPageSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL, int maxNum, int pageNo) + { + return new StringBuilder() + .append("select ").append(fieldSQL) + .append(" from ").append(tableName).append(whereSQL).append(orderbySQL).append(groupbySQL) + .append(" limit #minSize#, #pageSize#") + .toString(); + } + + @Override + public String toPageViewSQL(StringBuilder innerTableSQL, int maxNum, int pageNo) + { + return new StringBuilder() + .append("select * from ").append(innerTableSQL).append(" p_ limit #minSize#, #pageSize#") + .toString(); + } + + /**************************************************************************************************/ + //不同的数据库处理 + /**************************************************************************************************/ + + @Override + public void executeAlertColumnDrop(String table, String column) throws ORMException, SQLException + {//标准SQL92 drop column + server.sql().execute(new StringBuilder("alter table ").append(table.toUpperCase()).append(" drop column ").append(column.toUpperCase()).toString()); + } + + @Override + public void executeAlertColumnName(String table, String column, String newColumn) throws ORMException, SQLException + {//采用系统存储过程sp_rename + List result = server.sql().executeQuery(T_COLUMN_MYSQL, LinkedMapSO.class, new String[]{server.getDatabaseName(), table, column}); + if (result.isEmpty()) + throw new ORMException("ZSQL[alterColumnRename][未找到表%s列%s]", table, column); + + LinkedMapSO item = result.get(0); + String columnType = (String)item.get("COLUMN_TYPE"); + boolean notNull = "NO".equals(item.get("IS_NULLABLE")); + + //执行change + server.sql().execute(new StringBuilder() + .append("alter table ").append(table.toUpperCase()) + .append(" change ").append(column.toUpperCase()).append(" ").append(newColumn.toUpperCase()).append(" ").append(columnType) + .append(notNull?" not null":" default null") + .toString()); + } + + @Override + public void executeAlertColumnType(String table, String column, String newColumnType, boolean newNotNull) throws ORMException, SQLException + { + String sql = new StringBuilder() + .append("alter table ").append(table.toUpperCase()) + .append(" modify column ").append(column.toUpperCase()).append(" ").append(newColumnType) + .append(newNotNull?" not null":" default null") + .toString(); + + server.sql().execute(sql); + } + + @Override + public void executeAlertColumnInfo(String table, String column, String newColumn, String newColumnType, boolean newNotNull) throws ORMException, SQLException + {//MySQL有change支持同时修改列名和类型 + String sql = new StringBuilder() + .append("alter table ").append(table.toUpperCase()) + .append(" change ").append(column.toUpperCase()).append(" ").append(newColumn.toUpperCase()).append(" ").append(newColumnType) + .append(newNotNull?" not null":" default null") + .toString(); + + server.sql().execute(sql); + } + + @Override + public void executeAlertPrimaryKeyAdd(String table, String columns) throws SQLException + { + server.sql().execute("alter table "+table+" add primary key("+columns+")"); + } + + @Override + public void executeAlertPrimaryKeyDrop(String table) throws SQLException + { + server.sql().execute("alter table "+table+" drop primary key"); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/policy/_Oracle.java b/zhiqim_orm/src/org/zhiqim/orm/policy/_Oracle.java new file mode 100644 index 0000000..1c76934 --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/policy/_Oracle.java @@ -0,0 +1,286 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.policy; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMI18n; +import org.zhiqim.orm.ORMPolicy; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ORMType; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.dbo.defined._TableField; +import org.zhiqim.orm.dbo.defined._TableIndex; + +/** + * ORACLE数据库策略 + * + * 注意: + * 1.不支持create table if not exists TABLE风格 + * 2.一条语句最后不要加分号";",会认为是无效字符ORA-00911,在PL/SQL里需要加分号表示一句结束 + * 3.date类型包括月,年,日,世纪,时,分和秒,不是java.sql.Date只有日期。 + * 4.timestamp类型颗粒到秒后6位,如2012-12-12 12:12:12.000000 + * + * 常用类型 + * 1.number(1) --- boolean 1/0 1位 + * 2.number(4) --- byte -255 4位 + * 3.number(6) --- short -32767 6位 + * 4.number(11) --- int -2147483648 11位 + * 5.number(20) --- long -9223372036854775808 20位 + * 6.varchar2(4000) + * + * @version v1.0.0 @author zouzhigang 2016-9-18 新建与整理 + */ +public class _Oracle implements ORMPolicy +{ + private ORMServer server; + + public _Oracle(ORMServer server) + { + this.server = server; + } + + @Override + public boolean chkKeepTime(int maxKeepTime) + { + return true; + } + + @Override + public String toExistsSQL(String databaseName, String tableName) + { + return Strings.format(T_EXISTS_ORACLE, tableName); + } + + /** + * 增加表的一列,支持类型和是否为null + * + * @param table 表名 + * @param column 列名 + * @param columnType 列类型 + * @param notNull 是否不允许为null + * @return SQL语句 + */ + public String toAlertColumnAdd(String table, String column, String columnType, boolean notNull) + { + return new StringBuilder() + .append("alter table ").append(table.toUpperCase()) + .append(" add column ").append(column.toUpperCase()).append(" ").append(columnType) + .append(notNull?" not null":" default null") + .toString(); + } + + @Override + public String toColumnType(String type) + { + int ctype = ORMType.getColumnTypeMaybeLength(type); + switch (ctype) + { + //基本类型 + case Z_ORM_BOOLEAN_INT: return "NUMBER(1)"; + case Z_ORM_BYTE_INT: return "NUMBER(4)"; + case Z_ORM_SHORT_INT: return "NUMBER(6)"; + case Z_ORM_INT_INT: return "NUMBER(11)"; + case Z_ORM_LONG_INT: return "NUMBER(20)"; + //小数和时间 + case Z_ORM_DATETIME_INT: return "DATE"; + case Z_ORM_DECIMAL_INT: + { + String[] values = Arrays.toStringArray(type); + Asserts.asserts(values.length == 3, ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[1]), ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[2]), ORMI18n.ormFieldTypeIncorrect1, type); + //decimal(15,3)前面11位整数相当于int,中间点号,后面3位小数的表示方式 + return "NUMBER("+values[1]+","+values[2]+")"; + + } + //字符串 + case Z_ORM_STRING_INT: + { + String[] values = Arrays.toStringArray(type); + Asserts.asserts(values.length > 1, ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[1]), ORMI18n.ormFieldTypeIncorrect1, type); + + if (values.length == 3 && "char".equals(values[2])) + {//char(50) + Asserts.asserts(Validates.isIntegerValue(values[1], 1, 255), ORMI18n.ormFieldTypeIncorrect1, type); + return "CHAR("+values[1]+")"; + } + else + {//varchar,text + int length = Ints.toInt(values[1]); + if (length <= 4000) + return "VARCHAR2("+values[1]+")"; + else + return "CLOB"; + } + } + //二进制字节数组 + case Z_ORM_BINARY_INT: return "BLOB"; + default:throw Asserts.exception("传入的类型[%s]不支持", type); + } + } + + @Override + public String toColumnString(_TableField field) + { + String column = field.getColumn(); + String columnType = toColumnType(field.getTypeAndLength()); + boolean notNull = field.isNotNull(); + + //PARENT_CODE varchar(32) NOT NULL,(逗号在ZTable中处理) + return new StringBuilder(column.toUpperCase()).append(" ").append(columnType).append(" ").append(notNull?"NOT NULL":"NULL").toString(); + } + + @Override + public List toTableString(_Table _table, MapSS replaceMap) + { + String key = _table.getKey(); + + String tableReplace = Sqls.formatReplaceMap(_table.getTable(), replaceMap); + List sqlList = new ArrayList<>(); + + //1.表头 + StringBuilder strb = new StringBuilder(); + strb.append("create table ").append(tableReplace.toUpperCase()).append(_BR_) + .append("(");//不支持if not exists + + //2.字段 PARENT_CODE varchar2(32) NOT NULL + for (_TableField field : _table.getFieldList()) + { + strb.append(_BR_).append(_FOUR_).append(toColumnString(field)).append(","); + } + + //3.主键primary key (ITEM_CODE) + if (_table.getKeyArr().length == 0) + strb.setLength(strb.length()-1); + else + strb.append(_BR_).append(_FOUR_).append("primary key (").append(key).append(")"); + + //4.表尾 + strb.append(_BR_).append(")").append(_BR_); + sqlList.add(Sqls.formatSpace(strb.toString())); + + + //5.索引 create unique index IX_USER_INFO_NAME_NICK on USER_INFO(USER_NAME,USER_NICK); + for (_TableIndex index : _table.getIndexList()) + { + String indexNameReplace = Sqls.formatReplaceMap(index.getName(), replaceMap); + StringBuilder strbIndex = new StringBuilder("create ").append(index.getType()).append(" index ").append(indexNameReplace) + .append(" on ").append(tableReplace).append("(").append(index.getColumn()).append(")") + .append(_BR_); + + sqlList.add(Sqls.formatSpace(strbIndex.toString())); + } + + return Lists.trim(sqlList); + } + + @Override + public String toItemSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL) + { + return new StringBuilder() + .append("select * from (select ").append(fieldSQL) + .append(" from ").append(tableName).append(whereSQL).append(orderbySQL).append(groupbySQL) + .append(") where rownum = 1") + .toString(); + } + + @Override + public String toPageSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL, int maxNum, int pageNo) + { + return new StringBuilder() + .append("select * from (select rownum idkey_, p_.* from (select ").append(fieldSQL) + .append(" from ").append(tableName).append(whereSQL).append(orderbySQL).append(groupbySQL) + .append(") p_) where idkey_ between #minNum# and #maxNum#") + .toString(); + } + + @Override + public String toPageViewSQL(StringBuilder innerTableSQL, int maxNum, int pageNo) + { + return new StringBuilder() + .append("select * from (select rownum idkey_, p_.* from ").append(innerTableSQL) + .append(" p_ ) where idkey_ between #minNum# and #maxNum#") + .toString(); + } + + /**************************************************************************************************/ + //不同的数据库处理 + /**************************************************************************************************/ + + @Override + public void executeAlertColumnDrop(String table, String column) throws ORMException, SQLException + {//标准SQL92 drop column + server.sql().execute(new StringBuilder("alter table ").append(table.toUpperCase()).append(" drop column ").append(column.toUpperCase()).toString()); + } + + @Override + public void executeAlertColumnName(String table, String column, String newColumn) throws ORMException, SQLException + {//标准SQL92 rename column + server.sql().execute(new StringBuilder("alter table ").append(table.toUpperCase()).append(" rename column ").append(column).append(" to ").append(newColumn).toString()); + } + + @Override + public void executeAlertColumnType(String table, String column, String newColumnType, boolean newNotNull)throws ORMException, SQLException + { + String sql = new StringBuilder() + .append("alter table ").append(table.toUpperCase()).append(" modify column ").append(column.toUpperCase()).append(" ").append(newColumnType).append(newNotNull?" not null":" default null") + .toString(); + + server.sql().execute(sql); + } + + @Override + public void executeAlertColumnInfo(String table, String column, String newColumn, String newColumnType, boolean newNotNull) throws ORMException, SQLException + {//分成两句处理 + String sql = new StringBuilder() + .append("alter table ").append(table.toUpperCase()).append(" rename column ").append(column.toUpperCase()).append(" to ").append(newColumn.toUpperCase()).append(";") + .append("alter table ").append(table.toUpperCase()).append(" modify column ").append(column.toUpperCase()).append(" ").append(newColumnType).append(newNotNull?" not null":" default null").append(";") + .toString(); + + server.sql().execute(sql); + } + + @Override + public void executeAlertPrimaryKeyAdd(String table, String columns) throws SQLException + { + server.sql().execute("alter table "+table+" add primary key("+columns+")"); + } + + @Override + public void executeAlertPrimaryKeyDrop(String table) throws SQLException + { + server.sql().execute("alter table "+table+" drop primary key"); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/policy/_PostgetSQL.java b/zhiqim_orm/src/org/zhiqim/orm/policy/_PostgetSQL.java new file mode 100644 index 0000000..5ed7d5e --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/policy/_PostgetSQL.java @@ -0,0 +1,275 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.policy; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMI18n; +import org.zhiqim.orm.ORMPolicy; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ORMType; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.dbo.defined._TableField; +import org.zhiqim.orm.dbo.defined._TableIndex; + +/** + * PostgetSQL数据库策略 + * + * @version v1.0.0 @author zouzhigang 2016-9-18 新建与整理 + */ +public class _PostgetSQL implements ORMPolicy +{ + private ORMServer server; + + public _PostgetSQL(ORMServer server) + { + this.server = server; + } + + @Override + public boolean chkKeepTime(int maxKeepTime) + { + return true; + } + + @Override + public String toExistsSQL(String databaseName, String tableName) + { + return Strings.format(T_EXISTS_PSQL, tableName); + } + + /** + * 增加表的一列,支持类型和是否为null + * + * @param table 表名 + * @param column 列名 + * @param columnType 列类型 + * @param notNull 是否不允许为null + * @return SQL语句 + */ + public String toAlertColumnAdd(String table, String column, String columnType, boolean notNull) + { + return new StringBuilder() + .append("alter table ").append(table.toUpperCase()) + .append(" add column ").append(column.toUpperCase()).append(" ").append(columnType) + .append(notNull?" not null":" default null") + .toString(); + } + + @Override + public String toColumnType(String type) + { + int ctype = ORMType.getColumnTypeMaybeLength(type); + switch (ctype) + { + //基本类型 + case Z_ORM_BOOLEAN_INT: return "bool"; + case Z_ORM_BYTE_INT: return "int2"; + case Z_ORM_SHORT_INT: return "int2"; + case Z_ORM_INT_INT: return "int4"; + case Z_ORM_LONG_INT: return "int8"; + //小数和时间 + case Z_ORM_DATETIME_INT: return "timestamp"; + case Z_ORM_DECIMAL_INT: + { + String[] values = Arrays.toStringArray(type); + Asserts.asserts(values.length == 3, ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[1]), ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[2]), ORMI18n.ormFieldTypeIncorrect1, type); + //decimal(15,3)前面11位整数相当于int,中间点号,后面3位小数的表示方式 + return "decimal("+values[1]+","+values[2]+")"; + + } + //字符串 + case Z_ORM_STRING_INT: + { + String[] values = Arrays.toStringArray(type); + Asserts.asserts(values.length > 1, ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[1]), ORMI18n.ormFieldTypeIncorrect1, type); + + if (values.length == 3 && "char".equals(values[2])) + {//char(50) + Asserts.asserts(Validates.isIntegerValue(values[1], 1, 255), ORMI18n.ormFieldTypeIncorrect1, type); + return "char("+values[1]+")"; + } + else + {//varchar,text + int length = Ints.toInt(values[1]); + if (length <= 4000) + return "varchar("+values[1]+")"; + else + return "text"; + } + + + } + //二进制字节数组 + case Z_ORM_BINARY_INT: return "bytea"; + default:throw Asserts.exception("传入的类型[%s]不支持", type); + } + } + + @Override + public String toColumnString(_TableField field) + { + String column = field.getColumn(); + String columnType = toColumnType(field.getTypeAndLength()); + boolean notNull = field.isNotNull(); + + //PARENT_CODE varchar(32) NOT NULL,(逗号在ZTable中处理) + return new StringBuilder(column.toUpperCase()).append(" ").append(columnType).append(" ").append(notNull?"NOT NULL":"NULL").toString(); + } + + @Override + public List toTableString(_Table _table, MapSS replaceMap) + { + String key = _table.getKey(); + + String tableReplace = Sqls.formatReplaceMap(_table.getTable(), replaceMap); + List sqlList = new ArrayList<>(); + + //1.表头 + StringBuilder strb = new StringBuilder(); + strb.append("create table if not exists ").append(tableReplace.toUpperCase()).append(_BR_) + .append("("); + + //2.字段 PARENT_CODE varchar2(32) NOT NULL + for (_TableField field : _table.getFieldList()) + { + strb.append(_BR_).append(_FOUR_).append(toColumnString(field)).append(","); + } + + //3.主键primary key (ITEM_CODE) + if (_table.getKeyArr().length == 0) + strb.setLength(strb.length()-1); + else + strb.append(_BR_).append(_FOUR_).append("primary key (").append(key).append(")"); + + //4.表尾 + strb.append(_BR_).append(");").append(_BR_); + sqlList.add(Sqls.formatSpace(strb.toString())); + + + //5.索引 create unique index IX_USER_INFO_NAME_NICK on USER_INFO(USER_NAME,USER_NICK); + for (_TableIndex index : _table.getIndexList()) + { + String indexNameReplace = Sqls.formatReplaceMap(index.getName(), replaceMap); + StringBuilder strbIndex = new StringBuilder("create ").append(index.getType()).append(" index ").append(indexNameReplace) + .append(" on ").append(tableReplace).append("(").append(index.getColumn()).append(");") + .append(_BR_); + + sqlList.add(Sqls.formatSpace(strbIndex.toString())); + } + + return Lists.trim(sqlList); + } + + @Override + public String toItemSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL) + { + return new StringBuilder() + .append("select ").append(fieldSQL) + .append(" from ").append(tableName).append(whereSQL).append(orderbySQL).append(groupbySQL) + .append(" limit 1") + .toString(); + } + + @Override + public String toPageSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL, int maxNum, int pageNo) + { + return new StringBuilder() + .append("select ").append(fieldSQL) + .append(" from ").append(tableName).append(whereSQL).append(orderbySQL).append(groupbySQL) + .append(" limit #pageSize# offset #minSize#") + .toString(); + } + + @Override + public String toPageViewSQL(StringBuilder innerTableSQL, int maxNum, int pageNo) + { + return new StringBuilder() + .append("select * from ").append(innerTableSQL).append(" p_ limit #pageSize# offset #minSize#") + .toString(); + } + + /**************************************************************************************************/ + //不同的数据库处理 + /**************************************************************************************************/ + + @Override + public void executeAlertColumnDrop(String table, String column) throws ORMException, SQLException + {//标准SQL92 drop column + server.sql().execute(new StringBuilder("alter table ").append(table.toUpperCase()).append(" drop column ").append(column.toUpperCase()).toString()); + } + + @Override + public void executeAlertColumnName(String table, String column, String newColumn) throws ORMException, SQLException + {//标准SQL92 rename column + server.sql().execute(new StringBuilder("alter table ").append(table.toUpperCase()).append(" rename column ").append(column.toUpperCase()).append(" to ").append(newColumn.toUpperCase()).toString()); + } + + @Override + public void executeAlertColumnType(String table, String column, String newColumnType, boolean newNotNull) throws ORMException, SQLException + {//分成两句处理,和HSQL不同,这里是set not null和drop not null + String sql = new StringBuilder() + .append("alter table ").append(table).append(" alter column ").append(column).append(" type ").append(newColumnType).append(";") + .append("alter table ").append(table).append(" alter column ").append(column).append(newNotNull?" set not null":" drop not null;") + .toString(); + + server.sql().execute(sql); + } + + @Override + public void executeAlertColumnInfo(String table, String column, String newColumn, String newColumnType, boolean newNotNull) throws ORMException, SQLException + {//分成三句处理 + String sql = new StringBuilder() + .append("alter table ").append(table.toUpperCase()).append(" rename column ").append(column.toUpperCase()).append(" to ").append(newColumn.toUpperCase()).append(";") + .append("alter table ").append(table.toUpperCase()).append(" alter column ").append(column.toUpperCase()).append(" type ").append(newColumnType).append(";") + .append("alter table ").append(table.toUpperCase()).append(" alter column ").append(column.toUpperCase()).append(newNotNull?" set not null":" drop not null").append(";") + .toString(); + + server.sql().execute(sql); + } + + @Override + public void executeAlertPrimaryKeyAdd(String table, String columns) throws SQLException + { + server.sql().execute("alter table "+table+" add primary key("+columns+")"); + } + + @Override + public void executeAlertPrimaryKeyDrop(String table) throws SQLException + { + server.sql().execute("alter table "+table+" drop primary key"); + } +} diff --git a/zhiqim_orm/src/org/zhiqim/orm/policy/_SQLite.java b/zhiqim_orm/src/org/zhiqim/orm/policy/_SQLite.java new file mode 100644 index 0000000..7a51eca --- /dev/null +++ b/zhiqim_orm/src/org/zhiqim/orm/policy/_SQLite.java @@ -0,0 +1,501 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.policy; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.kernel.extend.MapSS; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Randoms; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ORMI18n; +import org.zhiqim.orm.ORMPolicy; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ORMType; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.dbo.defined._TableField; +import org.zhiqim.orm.dbo.defined._TableIndex; + +/** + * SQLite数据库策略 + * + * @version v1.0.0 @author zouzhigang 2016-9-18 新建与整理 + */ +public class _SQLite implements ORMPolicy +{ + private ORMServer server; + + public _SQLite(ORMServer server) + { + this.server = server; + } + + @Override + public boolean chkKeepTime(int maxKeepTime) + { + return true; + } + + @Override + public String toExistsSQL(String databaseName, String tableName) + { + return Strings.format(T_EXISTS_SQLITE, tableName); + } + + /** + * 增加表的一列,支持类型和是否为null + * + * @param table 表名 + * @param column 列名 + * @param columnType 列类型 + * @param notNull 是否不允许为null + * @return SQL语句 + */ + public String toAlertColumnAdd(String table, String column, String columnType, boolean notNull) + { + return new StringBuilder() + .append("alter table ").append(table.toUpperCase()) + .append(" add column ").append(column.toUpperCase()).append(" ").append(columnType) + .append(notNull?" not null default 0":" default null") + .toString(); + } + + @Override + public String toColumnType(String type) + { + int ctype = ORMType.getColumnTypeMaybeLength(type); + switch (ctype) + { + //基本类型 + case Z_ORM_BOOLEAN_INT: + case Z_ORM_BYTE_INT: + case Z_ORM_SHORT_INT: + case Z_ORM_INT_INT: + case Z_ORM_LONG_INT: return "integer"; + //小数和时间 + case Z_ORM_DATETIME_INT: return "datetime"; + case Z_ORM_DECIMAL_INT: + { + String[] values = Arrays.toStringArray(type); + Asserts.asserts(values.length == 3, ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[1]), ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[2]), ORMI18n.ormFieldTypeIncorrect1, type); + //decimal(15,3)前面11位整数相当于int,中间点号,后面3位小数的表示方式 + return "numeric("+values[1]+","+values[2]+")"; + } + //字符串 + case Z_ORM_STRING_INT: + { + String[] values = Arrays.toStringArray(type); + Asserts.asserts(values.length > 1, ORMI18n.ormFieldTypeIncorrect1, type); + Asserts.asserts(Validates.isIntegerPositive(values[1]), ORMI18n.ormFieldTypeIncorrect1, type); + + if (values.length == 3 && "char".equals(values[2])) + {//char(50) + Asserts.asserts(Validates.isIntegerValue(values[1], 1, 255), ORMI18n.ormFieldTypeIncorrect1, type); + return "char("+values[1]+")"; + } + else + {//varchar,text + int length = Ints.toInt(values[1]); + if (length <= 4000) + return "varchar("+values[1]+")"; + else + return "text"; + } + } + //二进制字节数组 + case Z_ORM_BINARY_INT: return "blob"; + default:throw Asserts.exception("传入的类型[%s]不支持", type); + } + } + + @Override + public String toColumnString(_TableField field) + { + String column = field.getColumn(); + String columnType = toColumnType(field.getTypeAndLength()); + boolean notNull = field.isNotNull(); + + //PARENT_CODE varchar(32) NOT NULL,(逗号在ZTable中处理) + return new StringBuilder(column.toUpperCase()).append(" ").append(columnType).append(" ").append(notNull?"NOT NULL":"NULL").toString(); + } + + @Override + public List toTableString(_Table _table, MapSS replaceMap) + { + String key = _table.getKey(); + + String tableReplace = Sqls.formatReplaceMap(_table.getTable(), replaceMap); + List sqlList = new ArrayList<>(); + + //1.表头 + StringBuilder strb = new StringBuilder(); + strb.append("create table if not exists ").append(tableReplace).append(_BR_) + .append("("); + + //2.字段 PARENT_CODE varchar2(32) NOT NULL + for (_TableField field : _table.getFieldList()) + { + strb.append(_BR_).append(_FOUR_).append(toColumnString(field)).append(","); + } + + //3.主键primary key (ITEM_CODE) + if (_table.getKeyArr().length == 0) + strb.setLength(strb.length()-1); + else + strb.append(_BR_).append(_FOUR_).append("primary key (").append(key).append(")"); + + //4.表尾 + strb.append(_BR_).append(");").append(_BR_); + sqlList.add(Sqls.formatSpace(strb.toString())); + + //5.索引 create unique index IX_USER_INFO_NAME_NICK on USER_INFO(USER_NAME,USER_NICK); + for (_TableIndex index : _table.getIndexList()) + { + String indexNameReplace = Sqls.formatReplaceMap(index.getName(), replaceMap); + StringBuilder strbIndex = new StringBuilder("create ").append(index.getType()).append(" index ").append(indexNameReplace) + .append(" on ").append(tableReplace).append("(").append(index.getColumn()).append(");") + .append(_BR_); + + sqlList.add(Sqls.formatSpace(strbIndex.toString())); + } + + return Lists.trim(sqlList); + } + + @Override + public String toItemSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL) + { + return new StringBuilder() + .append("select ").append(fieldSQL) + .append(" from ").append(tableName).append(whereSQL).append(orderbySQL).append(groupbySQL) + .append(" limit 1") + .toString(); + } + + @Override + public String toPageSQL(String fieldSQL, String tableName, String whereSQL, String orderbySQL, String groupbySQL, int maxNum, int pageNo) + { + return new StringBuilder() + .append("select ").append(fieldSQL) + .append(" from ").append(tableName).append(whereSQL).append(orderbySQL).append(groupbySQL) + .append(" limit #minSize#, #pageSize#") + .toString(); + } + + @Override + public String toPageViewSQL(StringBuilder innerTableSQL, int maxNum, int pageNo) + { + return new StringBuilder() + .append("select * from ").append(innerTableSQL).append(" p_ limit #minSize#, #pageSize#") + .toString(); + } + + /**************************************************************************************************/ + //不同的数据库处理 + /**************************************************************************************************/ + + @Override + public void executeAlertColumnDrop(String table, String column) throws ORMException, SQLException + {//1.先新建临时表,2.拷贝数据到临时表,3.删除原表并修改临时表名为原表名 + table = table.toUpperCase(); + List list = getTableColumnList(table); + + column = column.toUpperCase(); + boolean exists = false; + StringBuilder oldColumns = new StringBuilder(); + StringBuilder tempTableKeys = new StringBuilder(); + + for (Iterator it=list.iterator();it.hasNext();) + { + LinkedMapSO map = it.next(); + String columnName = (String)map.get("name"); + if (columnName.equalsIgnoreCase(column)) + {//找到要删除的列名 + it.remove(); + exists = true; + } + else + { + oldColumns.append(columnName).append(","); + + if ((Integer)map.get("pk") == 1) + tempTableKeys.append(columnName).append(","); + } + } + + if (!exists) + throw new ORMException("表[%s]没有列[%s]", table, column); + + if (list.isEmpty()) + throw new ORMException("表[%s]只有该[%s],不允许删除,如果要删除请删除表", table, column); + + //去掉最后一个逗号 + oldColumns.setLength(oldColumns.length()-1); + if (tempTableKeys.length() > 0) + tempTableKeys.setLength(tempTableKeys.length()-1); + + //重建表 + recreateTable("删除列", table, list, oldColumns, tempTableKeys); + } + + @Override + public void executeAlertColumnType(String table, String column, String newColumnType, boolean newNotNull)throws ORMException, SQLException + {//1.先新建临时表,2.拷贝数据到临时表,3.删除原表并修改临时表名为原表名 + table = table.toUpperCase(); + List list = getTableColumnList(table); + + column = column.toUpperCase(); + boolean exists = false; + StringBuilder oldColumns = new StringBuilder(); + StringBuilder tempTableKeys = new StringBuilder(); + + for (LinkedMapSO map : list) + { + String columnName = (String)map.get("name"); + oldColumns.append(columnName).append(","); + + if (columnName.equalsIgnoreCase(column)) + {//找到要修改的列 + map.put("type", newColumnType); + map.put("notnull", newNotNull?1:0); + exists = true; + } + + if ((Integer)map.get("pk") == 1) + tempTableKeys.append(columnName).append(","); + } + + if (!exists) + throw Asserts.exception("表[%s]没有列[%s]", table, column); + + //去掉最后一个逗号 + oldColumns.setLength(oldColumns.length()-1); + if (tempTableKeys.length() > 0) + tempTableKeys.setLength(tempTableKeys.length()-1); + + //重建表 + recreateTable("修改列类型", table, list, oldColumns, tempTableKeys); + } + + @Override + public void executeAlertColumnName(String table, String column, String newColumn) throws ORMException, SQLException + {//1.先新建临时表,2.拷贝数据到临时表,3.删除原表并修改临时表名为原表名 + table = table.toUpperCase(); + List list = getTableColumnList(table); + + column = column.toUpperCase(); + boolean exists = false; + StringBuilder oldColumns = new StringBuilder(); + StringBuilder tempTableKeys = new StringBuilder(); + + for (LinkedMapSO map : list) + { + String columnName = (String)map.get("name"); + oldColumns.append(columnName).append(","); + + if (columnName.equalsIgnoreCase(column)) + {//找到要修改的列名 + columnName = newColumn; + map.put("name", newColumn); + exists = true; + } + + if ((Integer)map.get("pk") == 1) + tempTableKeys.append(columnName).append(","); + } + + if (!exists) + throw new ORMException("表[%s]没有列[%s]", table, column); + + //去掉最后一个逗号 + oldColumns.setLength(oldColumns.length()-1); + if (tempTableKeys.length() > 0) + tempTableKeys.setLength(tempTableKeys.length()-1); + + //重建表 + recreateTable("修改列名", table, list, oldColumns, tempTableKeys); + } + + @Override + public void executeAlertColumnInfo(String table, String column, String newColumn, String newColumnType, boolean newNotNull) throws ORMException, SQLException + {//1.先新建临时表,2.拷贝数据到临时表,3.删除原表并修改临时表名为原表名 + table = table.toUpperCase(); + List list = getTableColumnList(table); + + column = column.toUpperCase(); + boolean exists = false; + StringBuilder oldColumns = new StringBuilder(); + StringBuilder tempTableKeys = new StringBuilder(); + + for (LinkedMapSO map : list) + { + String columnName = (String)map.get("name"); + oldColumns.append(columnName).append(","); + + if (columnName.equalsIgnoreCase(column)) + {//找到要修改的列名 + columnName = newColumn; + map.put("name", newColumn); + map.put("type", newColumnType); + map.put("notnull", newNotNull?1:0); + exists = true; + } + + if ((Integer)map.get("pk") == 1) + tempTableKeys.append(columnName).append(","); + } + + if (!exists) + throw new ORMException("表[%s]没有列[%s]", table, column); + + //去掉最后一个逗号 + oldColumns.setLength(oldColumns.length()-1); + tempTableKeys.setLength(tempTableKeys.length()-1); + if (tempTableKeys.length() > 0) + tempTableKeys.setLength(tempTableKeys.length()-1); + + //重建表 + recreateTable("修改列信息", table, list, oldColumns, tempTableKeys); + } + + @Override + public void executeAlertPrimaryKeyAdd(String table, String columns) throws ORMException, SQLException + { + table = table.toUpperCase(); + List list = getTableColumnList(table); + + StringBuilder oldColumns = new StringBuilder(); + for (LinkedMapSO map : list) + { + String columnName = (String)map.get("name"); + oldColumns.append(columnName).append(","); + } + oldColumns.setLength(oldColumns.length()-1); + + StringBuilder tempTableKeys = new StringBuilder(columns); + + //重建表 + recreateTable("修改主键", table, list, oldColumns, tempTableKeys); + } + + @Override + public void executeAlertPrimaryKeyDrop(String table) throws ORMException, SQLException + { + table = table.toUpperCase(); + List list = getTableColumnList(table); + + StringBuilder oldColumns = new StringBuilder(); + for (LinkedMapSO map : list) + { + String columnName = (String)map.get("name"); + oldColumns.append(columnName).append(","); + } + oldColumns.setLength(oldColumns.length()-1); + + StringBuilder tempTableKeys = new StringBuilder(); + + //重建表 + recreateTable("修改主键", table, list, oldColumns, tempTableKeys); + } + + /**************************************************************************************************/ + //私有方法 + /**************************************************************************************************/ + + /** 获取列表 */ + private List getTableColumnList(String table) throws ORMException, SQLException + { + List list = server.sql().executeQuery("pragma table_info ('"+table+"')"); + if (list.isEmpty()) + throw new ORMException("表[%s]不存在或没有任何列", table); + + return list; + } + + /** 重建表 */ + private void recreateTable(String intro, String table, List list, StringBuilder oldColumns, StringBuilder tempTableKeys) throws ORMException, SQLException + { + String tempTable = table + "_TEMP_" + Randoms.upperLetters(4); + String createSQL = toTableSQL(tempTable, tempTableKeys.toString(), list); + String insertSQL = "insert into " + tempTable + " select " + oldColumns.toString() + " from " + table + ";"; + String dropSQL = "drop table " + table + ";"; + String renameSQL = "alter table " + tempTable + " rename to " + table + ";"; + + try + {//四条语句一起执行 + List sqlList = new ArrayList<>(4); + sqlList.add(createSQL); + sqlList.add(insertSQL); + sqlList.add(dropSQL); + sqlList.add(renameSQL); + + server.sql().execute(sqlList); + } + catch(Exception e) + {//失败尝试删除临时表 + server.sql().execute("drop table if exists " + tempTable); + throw new ORMException("表[%s][%s]时异常", e, table, intro); + } + } + + /** 内部创建表 */ + private String toTableSQL(String table, String key, List list) + { + //1.表头 + StringBuilder strb = new StringBuilder(); + strb.append("create table ").append(table.toUpperCase()).append(_BR_) + .append("("); + + //2.字段 PARENT_CODE varchar2(32) NOT NULL + for (LinkedMapSO map : list) + { + String column = (String)map.get("name"); + String columnType = (String)map.get("type"); + boolean notNull = (Integer)map.get("notnull") == 1; + strb.append(_BR_).append(_FOUR_).append(column.toUpperCase()).append(" ").append(columnType).append(" ").append(notNull?"NOT NULL":"NULL").append(","); + } + + //3.主键primary key (ITEM_CODE) + if (Validates.isEmpty(key)) + strb.setLength(strb.length()-1); + else + strb.append(_BR_).append(_FOUR_).append("primary key (").append(key.toUpperCase()).append(")"); + + //4.表尾 + strb.append(_BR_).append(");").append(_BR_); + + return strb.toString(); + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/ORMBoot.java b/zhiqim_orm/test/org/zhiqim/orm/test/ORMBoot.java new file mode 100644 index 0000000..9d1f860 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/ORMBoot.java @@ -0,0 +1,162 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.Zhiqim; +import org.zhiqim.orm.ORMConstants; +import org.zhiqim.orm.ORMParameter; +import org.zhiqim.orm.ORMServer; + + +public class ORMBoot implements ORMConstants +{ + public static void loadBin() + { + List pathList = new ArrayList<>(); + pathList.add("./bin"); + Zhiqim.loadClassAliasName(pathList); + } + + public static void initMySQLServer() throws Exception + { + loadBin(); + + ORMParameter parameter = new ORMParameter(); + parameter.setDbType("mysql"); + parameter.setDriver("com.mysql.jdbc.Driver"); + parameter.setUrl("jdbc:mysql://127.0.0.1:3306/zhiqim_orm?useUnicode=true&characterEncoding=UTF-8"); + parameter.setUser("root"); + parameter.setPass("root"); + parameter.setUpdateSqlLog(true); + parameter.setQuerySqlLog(true); + + ORMServer server = new ORMServer(); + server.setId("orm"); + server.create(parameter); + + Global.addService(server); + } + + public static void initOracleServer() throws Exception + { + loadBin(); + + ORMParameter parameter = new ORMParameter(); + parameter.setDbType("oracle"); + parameter.setDriver("oracle.jdbc.driver.OracleDriver"); + parameter.setUrl("jdbc:oracle:thin:@127.0.0.1:1521:ORCL"); + parameter.setUser("zhiqim"); + parameter.setPass("zhiqim"); + parameter.setUpdateSqlLog(true); + parameter.setQuerySqlLog(true); + + ORMServer server = new ORMServer(); + server.setId("orm"); + server.create(parameter); + + Global.addService(server); + } + + public static void initMSSQLServer() throws Exception + { + loadBin(); + + ORMParameter parameter = new ORMParameter(); + parameter.setDbType("mssql"); + parameter.setDriver("com.microsoft.sqlserver.jdbc.SQLServerDriver"); + parameter.setUrl("jdbc:sqlserver://127.0.0.1:1433;DatabaseName=zhiqim_orm_test"); + parameter.setUser("sa"); + parameter.setPass("taobug2012"); + parameter.setUpdateSqlLog(true); + parameter.setQuerySqlLog(true); + + ORMServer server = new ORMServer(); + server.setId("orm"); + server.create(parameter); + + Global.addService(server); + } + + public static void initPSQLServer() throws Exception + { + loadBin(); + + ORMParameter parameter = new ORMParameter(); + parameter.setDbType("postgresql"); + parameter.setDriver("org.postgresql.Driver"); + parameter.setUrl("jdbc:postgresql://127.0.0.1:5432/zhiqim_orm_test"); + parameter.setUser("postgres"); + parameter.setPass("taobug2012"); + parameter.setUpdateSqlLog(true); + parameter.setQuerySqlLog(true); + + ORMServer server = new ORMServer(); + server.setId("orm"); + server.create(parameter); + + Global.addService(server); + } + + public static void initSQLiteServer() throws Exception + { + loadBin(); + + ORMParameter parameter = new ORMParameter(); + parameter.setDbType("sqlite"); + parameter.setDriver("org.sqlite.JDBC"); + parameter.setUrl("jdbc:sqlite:./database/zhiqim_orm_test.db"); + parameter.setUser("root"); + parameter.setPass("root"); + parameter.setUpdateSqlLog(true); + parameter.setQuerySqlLog(true); + + ORMServer server = new ORMServer(); + server.setId("orm"); + server.create(parameter); + + Global.addService(server); + } + + public static void initHSQLServer() throws Exception + { + loadBin(); + + ORMParameter parameter = new ORMParameter(); + parameter.setDbType("hsql"); + parameter.setDriver("org.hsqldb.jdbc.JDBCDriver"); + parameter.setUrl("jdbc:hsqldb:./database/hsql"); + parameter.setUser("sa"); + parameter.setPass(""); + parameter.setUpdateSqlLog(true); + parameter.setQuerySqlLog(true); + + ORMServer server = new ORMServer(); + server.setId("orm"); + server.create(parameter); + + Global.addService(server); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/TestPrintSQL.java b/zhiqim_orm/test/org/zhiqim/orm/test/TestPrintSQL.java new file mode 100644 index 0000000..9743025 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/TestPrintSQL.java @@ -0,0 +1,48 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test; + +import org.zhiqim.kernel.util.Replaces; + +public class TestPrintSQL +{ + public static void main(String[] args) + { + String v = "~!@#$%^&*()_+?><:\"{}"; + + String str = "update TEST set abc=?"; + + //SQL转义 + v = v.replaceAll("'", "''"); + if (v.indexOf("?") == -1) + str = str.replaceFirst("\\?", "'"+ v +"'"); + else + {//转义 + v = Replaces.replaceAllEscape(v, "?", "-%6-%-3%-"); + v = Replaces.toReplaceEscape(v); + str = str.replaceFirst("\\?", "'"+ v +"'"); +// str = Replaces.replaceAllEscape(str, "?", "'"+ v +"'"); + } + + System.out.println(str); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/data/sql/test.sql.xml b/zhiqim_orm/test/org/zhiqim/orm/test/data/sql/test.sql.xml new file mode 100644 index 0000000..09bd9bd --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/data/sql/test.sql.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/data/sql2/test2.sql.xml b/zhiqim_orm/test/org/zhiqim/orm/test/data/sql2/test2.sql.xml new file mode 100644 index 0000000..d5b423c --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/data/sql2/test2.sql.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dbo/Admin.java b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/Admin.java new file mode 100644 index 0000000..6057402 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/Admin.java @@ -0,0 +1,78 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 管理员表 对应表《ADMIN》 + */ +@AnAlias("Admin") +@AnTable(table="ADMIN", key="ADMIN_NAME", type="InnoDB") +public class Admin implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ADMIN_NAME", type="string,32", notNull=true) private String adminName; //1.管理员名称 + @AnTableField(column="ADMIN_PASS", type="string,32", notNull=true) private String adminPass; //2.管理员密码 + @AnTableField(column="ADMIN_TIME", type="string,19,char", notNull=true) private String adminTime; //3.管理员时间 + + public String toString() + { + return Jsons.toString(this); + } + + public String getAdminName() + { + return adminName; + } + + public void setAdminName(String adminName) + { + this.adminName = adminName; + } + + public String getAdminPass() + { + return adminPass; + } + + public void setAdminPass(String adminPass) + { + this.adminPass = adminPass; + } + + public String getAdminTime() + { + return adminTime; + } + + public void setAdminTime(String adminTime) + { + this.adminTime = adminTime; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dbo/Message.java b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/Message.java new file mode 100644 index 0000000..c5422df --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/Message.java @@ -0,0 +1,122 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 留言表 对应表《MESSAGE》 + */ +@AnAlias("Message") +@AnTable(table="MESSAGE", key="MESSAGE_ID", type="InnoDB") +public class Message implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="MESSAGE_ID", type="long", notNull=true) private long messageId; //1.留言编号 + @AnTableField(column="MESSAGE_NAME", type="string,32", notNull=true) private String messageName; //2.访客称呼 + @AnTableField(column="MESSAGE_CONTACTING", type="string,50", notNull=false) private String messageContacting; //3.访客联系方式 + @AnTableField(column="MESSAGE_CONTENT", type="string,1000", notNull=true) private String messageContent; //4.访客留言内容 + @AnTableField(column="MESSAGE_TIME", type="string,19,char", notNull=true) private String messageTime; //5.访客留言时间 + @AnTableField(column="MESSAGE_RTIME", type="string,19,char", notNull=false) private String messageRtime; //6.管理员回复时间 + @AnTableField(column="MESSAGE_REPLY", type="string,1000", notNull=false) private String messageReply; //7.管理员回复内容 + + public String toString() + { + return Jsons.toString(this); + } + + public long getMessageId() + { + return messageId; + } + + public void setMessageId(long messageId) + { + this.messageId = messageId; + } + + public String getMessageName() + { + return messageName; + } + + public void setMessageName(String messageName) + { + this.messageName = messageName; + } + + public String getMessageContacting() + { + return messageContacting; + } + + public void setMessageContacting(String messageContacting) + { + this.messageContacting = messageContacting; + } + + public String getMessageContent() + { + return messageContent; + } + + public void setMessageContent(String messageContent) + { + this.messageContent = messageContent; + } + + public String getMessageTime() + { + return messageTime; + } + + public void setMessageTime(String messageTime) + { + this.messageTime = messageTime; + } + + public String getMessageRtime() + { + return messageRtime; + } + + public void setMessageRtime(String messageRtime) + { + this.messageRtime = messageRtime; + } + + public String getMessageReply() + { + return messageReply; + } + + public void setMessageReply(String messageReply) + { + this.messageReply = messageReply; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dbo/Order.java b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/Order.java new file mode 100644 index 0000000..e5eb29f --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/Order.java @@ -0,0 +1,56 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 订单表 对应表《ORDER》 + */ +@AnAlias("Order") +@AnTable(table="ORDER", key="ORDER_ID", type="InnoDB") +public class Order implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ORDER_ID", type="long", notNull=true) private long orderId; //1.订单编号 + + public String toString() + { + return Jsons.toString(this); + } + + public long getOrderId() + { + return orderId; + } + + public void setOrderId(long orderId) + { + this.orderId = orderId; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TAuto.java b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TAuto.java new file mode 100644 index 0000000..46e3b2e --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TAuto.java @@ -0,0 +1,67 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 测试自增长字段 对应表《T_AUTO》 + */ +@AnAlias("TAuto") +@AnTable(table="T_AUTO", key="T_ID", type="InnoDB") +public class TAuto implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="T_ID", type="long", notNull=true) private long tId; //1.测试编号 + @AnTableField(column="T_VARCHAR", type="string,32", notNull=false) private String tVarchar; //2.变长字符串 + + public String toString() + { + return Jsons.toString(this); + } + + public long getTId() + { + return tId; + } + + public void setTId(long tId) + { + this.tId = tId; + } + + public String getTVarchar() + { + return tVarchar; + } + + public void setTVarchar(String tVarchar) + { + this.tVarchar = tVarchar; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TDatetime.java b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TDatetime.java new file mode 100644 index 0000000..853873c --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TDatetime.java @@ -0,0 +1,79 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 测试日期格式 对应表《T_DATETIME》 + */ +@AnAlias("TDatetime") +@AnTable(table="T_DATETIME", key="T_ID", type="InnoDB") +public class TDatetime implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="T_ID", type="long", notNull=true) private long tId; //1.测试编号 + @AnTableField(column="T_DATETIME", type="datetime", notNull=true) private Timestamp tDatetime; //2.测试日期 + @AnTableField(column="T_DATETIME2", type="datetime", notNull=true) private Timestamp tDatetime2; //3.测试日期 + + public String toString() + { + return Jsons.toString(this); + } + + public long getTId() + { + return tId; + } + + public void setTId(long tId) + { + this.tId = tId; + } + + public Timestamp getTDatetime() + { + return tDatetime; + } + + public void setTDatetime(Timestamp tDatetime) + { + this.tDatetime = tDatetime; + } + + public Timestamp getTDatetime2() + { + return tDatetime2; + } + + public void setTDatetime2(Timestamp tDatetime2) + { + this.tDatetime2 = tDatetime2; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TDecimal.java b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TDecimal.java new file mode 100644 index 0000000..c35d4f7 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TDecimal.java @@ -0,0 +1,89 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 测试小数格式 对应表《T_DECIMAL》 + */ +@AnAlias("TDecimal") +@AnTable(table="T_DECIMAL", key="T_ID", type="InnoDB") +public class TDecimal implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="T_ID", type="long", notNull=true) private long tId; //1.测试编号 + @AnTableField(column="T_DM5_2", type="decimal,5,2", notNull=true) private double tDm52; //2.测试5位长度,小数2位 + @AnTableField(column="T_DM10_3", type="decimal,10,3", notNull=true) private double tDm103; //3.测试10位长度,小数3位 + @AnTableField(column="T_DM15_4", type="decimal,15,4", notNull=true) private double tDm154; //4.测试15位长度,小数4位 + + public String toString() + { + return Jsons.toString(this); + } + + public long getTId() + { + return tId; + } + + public void setTId(long tId) + { + this.tId = tId; + } + + public double getTDm52() + { + return tDm52; + } + + public void setTDm52(double tDm52) + { + this.tDm52 = tDm52; + } + + public double getTDm103() + { + return tDm103; + } + + public void setTDm103(double tDm103) + { + this.tDm103 = tDm103; + } + + public double getTDm154() + { + return tDm154; + } + + public void setTDm154(double tDm154) + { + this.tDm154 = tDm154; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TInteger.java b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TInteger.java new file mode 100644 index 0000000..219b443 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TInteger.java @@ -0,0 +1,111 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 整型测试表 对应表《T_INTEGER》 + */ +@AnAlias("TInteger") +@AnTable(table="T_INTEGER", key="T_ID", type="InnoDB") +public class TInteger implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="T_ID", type="long", notNull=true) private long tId; //1.测试编号 + @AnTableField(column="T_BOOLEAN", type="boolean", notNull=true) private boolean tBoolean; //2.布尔型 + @AnTableField(column="T_BYTE", type="byte", notNull=true) private int tByte; //3.字节型 + @AnTableField(column="T_SHORT", type="short", notNull=true) private int tShort; //4.短整型 + @AnTableField(column="T_INT", type="int", notNull=true) private int tInt; //5.整型 + @AnTableField(column="T_LONG", type="long", notNull=true) private long tLong; //6.长整型 + + public String toString() + { + return Jsons.toString(this); + } + + public long getTId() + { + return tId; + } + + public void setTId(long tId) + { + this.tId = tId; + } + + public boolean isTBoolean() + { + return tBoolean; + } + + public void setTBoolean(boolean tBoolean) + { + this.tBoolean = tBoolean; + } + + public int getTByte() + { + return tByte; + } + + public void setTByte(int tByte) + { + this.tByte = tByte; + } + + public int getTShort() + { + return tShort; + } + + public void setTShort(int tShort) + { + this.tShort = tShort; + } + + public int getTInt() + { + return tInt; + } + + public void setTInt(int tInt) + { + this.tInt = tInt; + } + + public long getTLong() + { + return tLong; + } + + public void setTLong(long tLong) + { + this.tLong = tLong; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TString.java b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TString.java new file mode 100644 index 0000000..67a326e --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/TString.java @@ -0,0 +1,122 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 测试字符串 对应表《T_STRING》 + */ +@AnAlias("TString") +@AnTable(table="T_STRING", key="T_ID", type="InnoDB") +public class TString implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="T_ID", type="long", notNull=true) private long tId; //1.测试编号 + @AnTableField(column="T_CHAR", type="string,19,char", notNull=false) private String tChar; //2.定长字符串 + @AnTableField(column="T_VARCHAR", type="string,32", notNull=false) private String tVarchar; //3.变长字符串 + @AnTableField(column="T_STRING2000", type="string,2000", notNull=false) private String tString2000; //4.变成2000长度 + @AnTableField(column="T_STRING4000", type="string,4000", notNull=false) private String tString4000; //5.变长4000长度 + @AnTableField(column="T_STRING8000", type="string,8000", notNull=false) private String tString8000; //6.变长8000长度 + @AnTableField(column="T_STRING16000", type="string,16000", notNull=false) private String tString16000; //7.变长16000长度 + + public String toString() + { + return Jsons.toString(this); + } + + public long getTId() + { + return tId; + } + + public void setTId(long tId) + { + this.tId = tId; + } + + public String getTChar() + { + return tChar; + } + + public void setTChar(String tChar) + { + this.tChar = tChar; + } + + public String getTVarchar() + { + return tVarchar; + } + + public void setTVarchar(String tVarchar) + { + this.tVarchar = tVarchar; + } + + public String getTString2000() + { + return tString2000; + } + + public void setTString2000(String tString2000) + { + this.tString2000 = tString2000; + } + + public String getTString4000() + { + return tString4000; + } + + public void setTString4000(String tString4000) + { + this.tString4000 = tString4000; + } + + public String getTString8000() + { + return tString8000; + } + + public void setTString8000(String tString8000) + { + this.tString8000 = tString8000; + } + + public String getTString16000() + { + return tString16000; + } + + public void setTString16000(String tString16000) + { + this.tString16000 = tString16000; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dbo/ZmrDept.java b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/ZmrDept.java new file mode 100644 index 0000000..fe31a99 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/ZmrDept.java @@ -0,0 +1,158 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 组织部门表 对应表《ZMR_DEPT》 + */ +@AnAlias("ZmrDept") +@AnNew +@AnTable(table="ZMR_DEPT", key="DEPT_ID", type="InnoDB") +@AnIndex({@AnIndexValue(name="IX_ORG_ID", column="ORG_ID", unique=false)}) +public class ZmrDept implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ORG_ID", type="long", notNull=true) private long orgId; //1.组织编号 + @AnTableField(column="PARENT_ID", type="long", notNull=true) private long parentId; //2.部门父编号 + @AnTableField(column="DEPT_ID", type="long", notNull=true) private long deptId; //3.部门编号 + @AnTableField(column="DEPT_NAME", type="string,32", notNull=true) private String deptName; //4.部门名称 + @AnTableField(column="DEPT_LEVEL", type="int", notNull=true) private int deptLevel; //5.部门级别 + @AnTableField(column="DEPT_STATUS", type="byte", notNull=true) private int deptStatus; //6.部门状态,0表示正常,1表示停用 + @AnTableField(column="DEPT_SEQ", type="int", notNull=true) private int deptSeq; //7.部门排序数 + @AnTableField(column="DEPT_PARENT_ALL", type="string,850", notNull=true) private String deptParentAll; //8.部门所有父节点,多个逗号隔开 + @AnTableField(column="DEPT_MANAGER", type="string,32", notNull=false) private String deptManager; //9.部门负责人 + @AnTableField(column="DEPT_DESC", type="string,100", notNull=false) private String deptDesc; //10.部门描述 + + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public long getParentId() + { + return parentId; + } + + public void setParentId(long parentId) + { + this.parentId = parentId; + } + + public long getDeptId() + { + return deptId; + } + + public void setDeptId(long deptId) + { + this.deptId = deptId; + } + + public String getDeptName() + { + return deptName; + } + + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public int getDeptLevel() + { + return deptLevel; + } + + public void setDeptLevel(int deptLevel) + { + this.deptLevel = deptLevel; + } + + public int getDeptStatus() + { + return deptStatus; + } + + public void setDeptStatus(int deptStatus) + { + this.deptStatus = deptStatus; + } + + public int getDeptSeq() + { + return deptSeq; + } + + public void setDeptSeq(int deptSeq) + { + this.deptSeq = deptSeq; + } + + public String getDeptParentAll() + { + return deptParentAll; + } + + public void setDeptParentAll(String deptParentAll) + { + this.deptParentAll = deptParentAll; + } + + public String getDeptManager() + { + return deptManager; + } + + public void setDeptManager(String deptManager) + { + this.deptManager = deptManager; + } + + public String getDeptDesc() + { + return deptDesc; + } + + public void setDeptDesc(String deptDesc) + { + this.deptDesc = deptDesc; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dbo/ZmrOperator.java b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/ZmrOperator.java new file mode 100644 index 0000000..37536b5 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dbo/ZmrOperator.java @@ -0,0 +1,257 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 操作员表 对应表《ZMR_OPERATOR》 + */ +@AnAlias("ZmrOperator") +@AnNew +@AnTable(table="ZMR_OPERATOR", key="OPERATOR_CODE", type="InnoDB") +@AnIndex({@AnIndexValue(name="IX_ORG_ID", column="ORG_ID", unique=false)}) +public class ZmrOperator implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="ORG_ID", type="long", notNull=true) private long orgId; //1.组织编号 + @AnTableField(column="OPERATOR_CODE", type="string,32", notNull=true) private String operatorCode; //2.操作员编码 + @AnTableField(column="OPERATOR_PASS", type="string,64,char", notNull=true) private String operatorPass; //3.操作员密码 + @AnTableField(column="OPERATOR_PASS_SALT", type="string,64,char", notNull=true) private String operatorPassSalt; //4.操作员密码盐值 + @AnTableField(column="OPERATOR_STATUS", type="byte", notNull=true) private int operatorStatus; //5.操作员状态:0正常,1停用 + @AnTableField(column="OPERATOR_TYPE", type="byte", notNull=true) private int operatorType; //6.操作员类型:0:超级管理员,1:管理员,2:操作员 + @AnTableField(column="OPERATOR_NAME", type="string,64", notNull=true) private String operatorName; //7.操作员名称 + @AnTableField(column="OPERATOR_AVATAR", type="long", notNull=false) private long operatorAvatar; //8.操作员头像编号 + @AnTableField(column="OPERATOR_DEPT", type="string,850", notNull=false) private String operatorDept; //9.操作员所属部门,多个用逗号隔开,当前支持关联50个部门 + @AnTableField(column="OPERATOR_DEPT_ALL", type="string,1700", notNull=false) private String operatorDeptAll; //10.操作员对应的所有部门,多个用逗号隔开,当前支持关联100个部门 + @AnTableField(column="OPERATOR_ROLE", type="string,850", notNull=false) private String operatorRole; //11.操作员角色,多个用逗号隔开,当前支持关联50个角色 + @AnTableField(column="OPERATOR_MOBILE", type="string,21", notNull=false) private String operatorMobile; //12.操作员手机号 + @AnTableField(column="OPERATOR_EMAIL", type="string,64", notNull=false) private String operatorEmail; //13.操作员邮箱 + @AnTableField(column="OPERATOR_SKIN", type="string,20", notNull=false) private String operatorSkin; //14.操作员主题肤色 + @AnTableField(column="OPERATOR_IP", type="string,18", notNull=false) private String operatorIp; //15.操作员工作IP + @AnTableField(column="OPERATOR_URL", type="string,50", notNull=false) private String operatorUrl; //16.操作员登录后首页 + @AnTableField(column="OPERATOR_PARAM", type="string,1024", notNull=false) private String operatorParam; //17.操作员参数,用于项目自定义设置 + @AnTableField(column="OPERATOR_CREATED", type="string,19,char", notNull=true) private String operatorCreated; //18.操作员创建时间,格式:yyyy-MM-dd hh:mm:ss + @AnTableField(column="OPERATOR_MODIFIED", type="string,19,char", notNull=true) private String operatorModified; //19.操作员修改时间,格式:yyyy-MM-dd hh:mm:ss + + public String toString() + { + return Jsons.toString(this); + } + + public long getOrgId() + { + return orgId; + } + + public void setOrgId(long orgId) + { + this.orgId = orgId; + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public String getOperatorPass() + { + return operatorPass; + } + + public void setOperatorPass(String operatorPass) + { + this.operatorPass = operatorPass; + } + + public String getOperatorPassSalt() + { + return operatorPassSalt; + } + + public void setOperatorPassSalt(String operatorPassSalt) + { + this.operatorPassSalt = operatorPassSalt; + } + + public int getOperatorStatus() + { + return operatorStatus; + } + + public void setOperatorStatus(int operatorStatus) + { + this.operatorStatus = operatorStatus; + } + + public int getOperatorType() + { + return operatorType; + } + + public void setOperatorType(int operatorType) + { + this.operatorType = operatorType; + } + + public String getOperatorName() + { + return operatorName; + } + + public void setOperatorName(String operatorName) + { + this.operatorName = operatorName; + } + + public long getOperatorAvatar() + { + return operatorAvatar; + } + + public void setOperatorAvatar(long operatorAvatar) + { + this.operatorAvatar = operatorAvatar; + } + + public String getOperatorDept() + { + return operatorDept; + } + + public void setOperatorDept(String operatorDept) + { + this.operatorDept = operatorDept; + } + + public String getOperatorDeptAll() + { + return operatorDeptAll; + } + + public void setOperatorDeptAll(String operatorDeptAll) + { + this.operatorDeptAll = operatorDeptAll; + } + + public String getOperatorRole() + { + return operatorRole; + } + + public void setOperatorRole(String operatorRole) + { + this.operatorRole = operatorRole; + } + + public String getOperatorMobile() + { + return operatorMobile; + } + + public void setOperatorMobile(String operatorMobile) + { + this.operatorMobile = operatorMobile; + } + + public String getOperatorEmail() + { + return operatorEmail; + } + + public void setOperatorEmail(String operatorEmail) + { + this.operatorEmail = operatorEmail; + } + + public String getOperatorSkin() + { + return operatorSkin; + } + + public void setOperatorSkin(String operatorSkin) + { + this.operatorSkin = operatorSkin; + } + + public String getOperatorIp() + { + return operatorIp; + } + + public void setOperatorIp(String operatorIp) + { + this.operatorIp = operatorIp; + } + + public String getOperatorUrl() + { + return operatorUrl; + } + + public void setOperatorUrl(String operatorUrl) + { + this.operatorUrl = operatorUrl; + } + + public String getOperatorParam() + { + return operatorParam; + } + + public void setOperatorParam(String operatorParam) + { + this.operatorParam = operatorParam; + } + + public String getOperatorCreated() + { + return operatorCreated; + } + + public void setOperatorCreated(String operatorCreated) + { + this.operatorCreated = operatorCreated; + } + + public String getOperatorModified() + { + return operatorModified; + } + + public void setOperatorModified(String operatorModified) + { + this.operatorModified = operatorModified; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dboext/TIntegerDatetime.java b/zhiqim_orm/test/org/zhiqim/orm/test/dboext/TIntegerDatetime.java new file mode 100644 index 0000000..607f2f4 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dboext/TIntegerDatetime.java @@ -0,0 +1,58 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dboext; + +import java.sql.Timestamp; +import org.zhiqim.orm.test.dbo.TInteger; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 整型和时间视图 对应视图《T_INTEGER_DATETIME》 + */ +@AnAlias("TIntegerDatetime") +@AnView("T_INTEGER,T_DATETIME") +@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="T_INTEGER", lColumn="T_ID", rTable="T_DATETIME", rColumn="T_ID")}) +public class TIntegerDatetime extends TInteger +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="T_DATETIME", column="T_DATETIME") private Timestamp tDatetime; //2.测试日期 + + public String toString() + { + return Jsons.toString(this); + } + + public Timestamp getTDatetime() + { + return tDatetime; + } + + public void setTDatetime(Timestamp tDatetime) + { + this.tDatetime = tDatetime; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dboext/TIntegerDecimal.java b/zhiqim_orm/test/org/zhiqim/orm/test/dboext/TIntegerDecimal.java new file mode 100644 index 0000000..e54916e --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dboext/TIntegerDecimal.java @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dboext; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 整型和小数视图 对应视图《T_INTEGER_DECIMAL》 + */ +@AnAlias("TIntegerDecimal") +@AnView("T_INTEGER,T_DECIMAL") +@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="T_INTEGER", lColumn="T_ID", rTable="T_DECIMAL", rColumn="T_ID")}) +public class TIntegerDecimal implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="T_INTEGER", column="T_ID") private long tId; //1.测试编号 + @AnViewField(table="T_INTEGER", column="T_BOOLEAN") private boolean tBoolean; //2.布尔型 + @AnViewField(table="T_DECIMAL", column="T_DM5_2") private double tDm52; //3.测试5位长度,小数2位 + @AnViewField(table="T_DECIMAL", column="T_DM10_3") private double tDm103; //4.测试10位长度,小数3位 + + public String toString() + { + return Jsons.toString(this); + } + + public long getTId() + { + return tId; + } + + public void setTId(long tId) + { + this.tId = tId; + } + + public boolean isTBoolean() + { + return tBoolean; + } + + public void setTBoolean(boolean tBoolean) + { + this.tBoolean = tBoolean; + } + + public double getTDm52() + { + return tDm52; + } + + public void setTDm52(double tDm52) + { + this.tDm52 = tDm52; + } + + public double getTDm103() + { + return tDm103; + } + + public void setTDm103(double tDm103) + { + this.tDm103 = tDm103; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dboext/TIntegerString.java b/zhiqim_orm/test/org/zhiqim/orm/test/dboext/TIntegerString.java new file mode 100644 index 0000000..fe20c9f --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dboext/TIntegerString.java @@ -0,0 +1,68 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dboext; + +import org.zhiqim.orm.test.dbo.TInteger; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 整型和字符串视图 对应视图《T_INTEGER_STRING》 + */ +@AnAlias("TIntegerString") +@AnView("T_INTEGER,T_STRING") +@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="T_INTEGER", lColumn="T_ID", rTable="T_STRING", rColumn="T_ID")}) +public class TIntegerString extends TInteger +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="T_STRING", column="T_CHAR") private String tChar; //2.定长字符串 + @AnViewField(table="T_STRING", column="T_VARCHAR") private String tVarchar; //3.变长字符串 + + public String toString() + { + return Jsons.toString(this); + } + + public String getTChar() + { + return tChar; + } + + public void setTChar(String tChar) + { + this.tChar = tChar; + } + + public String getTVarchar() + { + return tVarchar; + } + + public void setTVarchar(String tVarchar) + { + this.tVarchar = tVarchar; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/dboext/TIntegerStringLeft.java b/zhiqim_orm/test/org/zhiqim/orm/test/dboext/TIntegerStringLeft.java new file mode 100644 index 0000000..eee1467 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/dboext/TIntegerStringLeft.java @@ -0,0 +1,68 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.dboext; + +import org.zhiqim.orm.test.dbo.TInteger; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 整型和字符串左联视图 对应视图《T_INTEGER_STRING_LEFT》 + */ +@AnAlias("TIntegerStringLeft") +@AnView("T_INTEGER,T_STRING") +@AnViewJoin({@AnViewJoinValue(type="LEFT", lTable="T_INTEGER", lColumn="T_ID", rTable="T_STRING", rColumn="T_ID")}) +public class TIntegerStringLeft extends TInteger +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="T_STRING", column="T_CHAR") private String tChar; //2.定长字符串 + @AnViewField(table="T_STRING", column="T_VARCHAR") private String tVarchar; //3.变长字符串 + + public String toString() + { + return Jsons.toString(this); + } + + public String getTChar() + { + return tChar; + } + + public void setTChar(String tChar) + { + this.tChar = tChar; + } + + public String getTVarchar() + { + return tVarchar; + } + + public void setTVarchar(String tVarchar) + { + this.tVarchar = tVarchar; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/hsql/TableCreate.java b/zhiqim_orm/test/org/zhiqim/orm/test/hsql/TableCreate.java new file mode 100644 index 0000000..3022466 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/hsql/TableCreate.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.hsql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.ORMBoot; + +import org.zhiqim.orm.test.dbo.TDatetime; +import org.zhiqim.orm.test.dbo.TDecimal; +import org.zhiqim.orm.test.dbo.TInteger; +import org.zhiqim.orm.test.dbo.TString; + +public class TableCreate +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initHSQLServer(); + + Global.get(ZTable.class).create(TInteger.class); + Global.get(ZTable.class).create(TString.class); + Global.get(ZTable.class).create(TDatetime.class); + Global.get(ZTable.class).create(TDecimal.class); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/hsql/TestAlterColumn.java b/zhiqim_orm/test/org/zhiqim/orm/test/hsql/TestAlterColumn.java new file mode 100644 index 0000000..aeb0dfa --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/hsql/TestAlterColumn.java @@ -0,0 +1,62 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.hsql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ZDDL; +import org.zhiqim.orm.ZTabler; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.test.ORMBoot; + + +public class TestAlterColumn +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initHSQLServer(); + ORMServer server = Global.getService(ORMServer.class); + + _Table _table = new _Table("T_ALERT_COLUMN", "USER_NAME"); + _table.addField("USER_NAME", "string,32", true); + _table.addField("USER_PASS", "string,32", true); + _table.addIndex("USER_NAME", true); + + Global.get(ZTabler.class).drop(_table); + Global.get(ZTabler.class).create(_table); + + String intColumnType = server.getPolicy().toColumnType("int"); + String longColumnType = server.getPolicy().toColumnType("long"); + + Global.get(ZDDL.class).alterColumnAdd("T_ALERT_COLUMN", "USER_STATUS", intColumnType, true); + System.out.println("添加字段USER_STATUS"); + + Global.get(ZDDL.class).alterColumnName("T_ALERT_COLUMN", "USER_STATUS", "USER_STATUS_2"); + System.out.println("修改字段USER_STATUS"); + + Global.get(ZDDL.class).alterColumnType("T_ALERT_COLUMN", "USER_STATUS_2", longColumnType, true); + System.out.println("修改字段USER_STATUS"); + + Global.get(ZDDL.class).alterColumnDrop("T_ALERT_COLUMN", "USER_STATUS_2"); + System.out.println("删除字段USER_STATUS"); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mssql/TestAlterColumn.java b/zhiqim_orm/test/org/zhiqim/orm/test/mssql/TestAlterColumn.java new file mode 100644 index 0000000..915b60d --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mssql/TestAlterColumn.java @@ -0,0 +1,61 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mssql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ZDDL; +import org.zhiqim.orm.ZTabler; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.test.ORMBoot; + + +public class TestAlterColumn +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMSSQLServer(); + ORMServer server = Global.getService(ORMServer.class); + + _Table _table = new _Table("T_ALERT_COLUMN", "USER_NAME"); + _table.addField("USER_NAME", "string,32", true); + _table.addField("USER_PASS", "string,32", true); + _table.addIndex("USER_NAME", true); + + Global.get(ZTabler.class).truncate(_table); + + String intColumnType = server.getPolicy().toColumnType("int"); + String longColumnType = server.getPolicy().toColumnType("long"); + + Global.get(ZDDL.class).alterColumnAdd("T_ALERT_COLUMN", "USER_STATUS", intColumnType, true); + System.out.println("添加字段USER_STATUS"); + + Global.get(ZDDL.class).alterColumnName("T_ALERT_COLUMN", "USER_STATUS", "USER_STATUS_2"); + System.out.println("修改字段USER_STATUS"); + + Global.get(ZDDL.class).alterColumnType("T_ALERT_COLUMN", "USER_STATUS_2", longColumnType, true); + System.out.println("修改字段USER_STATUS"); + + Global.get(ZDDL.class).alterColumnDrop("T_ALERT_COLUMN", "USER_STATUS_2"); + System.out.println("删除字段USER_STATUS"); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mssql/Test_Insert.java b/zhiqim_orm/test/org/zhiqim/orm/test/mssql/Test_Insert.java new file mode 100644 index 0000000..0a2194b --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mssql/Test_Insert.java @@ -0,0 +1,55 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mssql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.dbo.TInteger; + +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.test.ORMBoot; + +public class Test_Insert +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMSSQLServer(); + + //1.数字 + for (int i=0;i<10;i++) + { + TInteger data = new TInteger(); + data.setTId(Ids.longId()); + data.setTBoolean(i%2==0); + data.setTByte((byte)i); + data.setTShort((short)i); + data.setTInt(i); + data.setTLong(i); + + Global.get(ZTable.class).insert(data); + System.out.println("插入数据["+i+"]条"); + } + + //2.文本 + + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mssql/Test_Page.java b/zhiqim_orm/test/org/zhiqim/orm/test/mssql/Test_Page.java new file mode 100644 index 0000000..e7e6935 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mssql/Test_Page.java @@ -0,0 +1,73 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mssql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.dbo.TInteger; + +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.test.ORMBoot; + +public class Test_Page +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMSSQLServer(); + + Global.get(ZTable.class).truncate(TInteger.class); + + for (int i=0;i<20;i++) + { + TInteger data = new TInteger(); + data.setTId(Ids.longId()); + data.setTBoolean(i%2==0); + data.setTByte((byte)i); + data.setTShort((short)i); + data.setTInt(i); + data.setTLong(i); + + Global.get(ZTable.class).insert(data); + System.out.println("插入数据["+i+"]条"); + } + + System.out.println("第1页"); + System.out.println(System.currentTimeMillis()); + PageResult result = Global.get(ZTable.class).page(TInteger.class, 1, 2); + System.out.println(System.currentTimeMillis()); + for (TInteger data : result.list()) + { + System.out.println(Jsons.toString(data)); + } + + System.out.println("第8页"); + System.out.println(System.currentTimeMillis()); + result = Global.get(ZTable.class).page(TInteger.class, 8, 2); + System.out.println(System.currentTimeMillis()); + for (TInteger data : result.list()) + { + System.out.println(Jsons.toString(data)); + } + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mssql/Test_TableCreate.java b/zhiqim_orm/test/org/zhiqim/orm/test/mssql/Test_TableCreate.java new file mode 100644 index 0000000..41fb117 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mssql/Test_TableCreate.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mssql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.ORMBoot; + +import org.zhiqim.orm.test.dbo.TDatetime; +import org.zhiqim.orm.test.dbo.TDecimal; +import org.zhiqim.orm.test.dbo.TInteger; +import org.zhiqim.orm.test.dbo.TString; + +public class Test_TableCreate +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMSSQLServer(); + + Global.get(ZTable.class).create(TInteger.class); + Global.get(ZTable.class).create(TString.class); + Global.get(ZTable.class).create(TDatetime.class); + Global.get(ZTable.class).create(TDecimal.class); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Statement.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Statement.java new file mode 100644 index 0000000..99c20a3 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Statement.java @@ -0,0 +1,55 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import java.sql.Connection; +import java.sql.ParameterMetaData; +import java.sql.PreparedStatement; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.test.ORMBoot; + + +public class Statement +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + String sql = "select * from USER where USER_ID=? and USER_STATUS = ?"; + Connection conn = Global.getService(ORMServer.class).getConnection(); + PreparedStatement pstmt = conn.prepareStatement(sql); + ParameterMetaData meta = pstmt.getParameterMetaData(); + + int count = meta.getParameterCount(); + System.out.println(count); + + for (int i=0;i. + */ +package org.zhiqim.orm.test.mysql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.ORMBoot; + +import org.zhiqim.orm.test.dbo.TDatetime; +import org.zhiqim.orm.test.dbo.TDecimal; +import org.zhiqim.orm.test.dbo.TInteger; +import org.zhiqim.orm.test.dbo.TString; + +public class TableCreate +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + Global.get(ZTable.class).create(TInteger.class); + Global.get(ZTable.class).create(TString.class); + Global.get(ZTable.class).create(TDatetime.class); + Global.get(ZTable.class).create(TDecimal.class); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestAlterColumn.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestAlterColumn.java new file mode 100644 index 0000000..ac7ee1f --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestAlterColumn.java @@ -0,0 +1,61 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ZDDL; +import org.zhiqim.orm.ZTabler; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.test.ORMBoot; + + +public class TestAlterColumn +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + ORMServer server = Global.getService(ORMServer.class); + + _Table _table = new _Table("T_ALERT_COLUMN", "USER_NAME"); + _table.addField("USER_NAME", "string,32", true); + _table.addField("USER_PASS", "string,32", true); + _table.addIndex("USER_NAME", true); + + Global.get(ZTabler.class).truncate(_table); + + String intColumnType = server.getPolicy().toColumnType("int"); + String longColumnType = server.getPolicy().toColumnType("long"); + + Global.get(ZDDL.class).alterColumnAdd("T_ALERT_COLUMN", "USER_STATUS", intColumnType, true); + System.out.println("添加字段USER_STATUS"); + + Global.get(ZDDL.class).alterColumnName("T_ALERT_COLUMN", "USER_STATUS", "USER_STATUS_2"); + System.out.println("修改字段名称USER_STATUS_2"); + + Global.get(ZDDL.class).alterColumnType("T_ALERT_COLUMN", "USER_STATUS_2", longColumnType, true); + System.out.println("修改字段USER_STATUS_2"); + + Global.get(ZDDL.class).alterColumnDrop("T_ALERT_COLUMN", "USER_STATUS_2"); + System.out.println("删除字段USER_STATUS_2"); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestBlob.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestBlob.java new file mode 100644 index 0000000..23272c3 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestBlob.java @@ -0,0 +1,69 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.test.ORMBoot; + +public class TestBlob +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + long id = Ids.longId(); + byte[] bytes = Files.read("./conf/zhiqim.xml"); + + ORMServer server = Global.get(ORMServer.class); + + String sql = "insert into TEST_BLOB (T_ID, T_BLOB) values (?,?)"; + Connection conn = server.getConnection(); + PreparedStatement pstmt = conn.prepareStatement(sql); + pstmt.setLong(1, id); + pstmt.setBytes(2, bytes); + pstmt.executeUpdate(); + + pstmt.close(); + conn.close(); + + sql = "select * from TEST_BLOB where T_ID = ?"; + conn = server.getConnection(); + pstmt = conn.prepareStatement(sql); + pstmt.setLong(1, id); + ResultSet rst = pstmt.executeQuery(); + if (rst.next()) + { + System.out.println(rst.getLong(1)); + System.out.println(new String(rst.getBytes(2))); + } + + ZDBClose.close(rst, pstmt, conn); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestDate.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestDate.java new file mode 100644 index 0000000..258b278 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestDate.java @@ -0,0 +1,78 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import java.sql.Connection; +import java.sql.Date; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Time; +import java.sql.Timestamp; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.test.ORMBoot; + +public class TestDate +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + long id = Ids.longId(); + Date date = new Date(System.currentTimeMillis()); + Time time = new Time(System.currentTimeMillis()); + Timestamp timestamp = new Timestamp(System.currentTimeMillis()); + + ORMServer server = Global.get(ORMServer.class); + + String sql = "insert into TEST_DATE (T_ID, T_DATE, T_TIME, T_DATETIME, T_TIMESTAMP) values (?,?,?,?,?)"; + Connection conn = server.getConnection(); + PreparedStatement pstmt = conn.prepareStatement(sql); + pstmt.setLong(1, id); + pstmt.setDate(2, date); + pstmt.setTime(3, time); + pstmt.setTimestamp(4, timestamp); + pstmt.setTimestamp(5, timestamp); + pstmt.executeUpdate(); + + ZDBClose.close(pstmt, conn); + + sql = "select * from TEST_DATE where T_ID = ?"; + conn = server.getConnection(); + pstmt = conn.prepareStatement(sql); + pstmt.setLong(1, id); + ResultSet rst = pstmt.executeQuery(); + if (rst.next()) + { + System.out.println(rst.getLong(1)); + System.out.println(rst.getDate(2)); + System.out.println(rst.getTime(3)); + System.out.println(rst.getTimestamp(4)); + System.out.println(rst.getTimestamp(5)); + } + + ZDBClose.close(rst, pstmt, conn); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestExpression.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestExpression.java new file mode 100644 index 0000000..175cb63 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestExpression.java @@ -0,0 +1,45 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import java.util.List; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.test.ORMBoot; + +import org.zhiqim.orm.test.dbo.TDatetime; + +public class TestExpression +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + Selector selector = new Selector(); + selector.addExpressionThenL("tDatetime", "tDatetime2+1000"); + + List list = Global.get(ZTable.class).list(TDatetime.class, selector); + System.out.println(list.size()); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestOrder.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestOrder.java new file mode 100644 index 0000000..1cd4086 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestOrder.java @@ -0,0 +1,46 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.dbo.Order; + +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.test.ORMBoot; + +public class TestOrder +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + Global.get(ZTable.class).truncate(Order.class); + + long id = Ids.longId(); + + Order order = new Order(); + order.setOrderId(id); + + Global.get(ZTable.class).insert(order); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestPrepareStatment.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestPrepareStatment.java new file mode 100644 index 0000000..140c48a --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestPrepareStatment.java @@ -0,0 +1,58 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import java.sql.Connection; +import java.sql.PreparedStatement; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.test.ORMBoot; + + +public class TestPrepareStatment +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + ORMServer server = Global.getService(ORMServer.class); + + Connection conn = server.getConnection(); + PreparedStatement pstmt = null; + + try + { + pstmt = conn.prepareStatement("truncate table T_STRING"); + } + catch (Exception e) + { + // TODO: handle exception + } + finally + { + ZDBClose.close(pstmt, conn); + } + + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestProcedure.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestProcedure.java new file mode 100644 index 0000000..ad2df0b --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestProcedure.java @@ -0,0 +1,97 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.dbo.CallParam; +import org.zhiqim.orm.dbo.CallResult; +import org.zhiqim.orm.test.ORMBoot; +import org.zhiqim.orm.test.dbo.ZmrDept; +import org.zhiqim.orm.test.dbo.ZmrOperator; + +public class TestProcedure +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + testParam(); + testParam2(); + testParam2Rst2(); + } + + private static void testParam() throws Exception + { + String sql="{call sp_test_param1_int(?)}"; + + List paramList = new ArrayList<>(); + paramList.add(CallParam.inout(100)); + + Global.get(ZSQL.class).call(sql, paramList); + + int count = (int)paramList.get(0).value(); + System.out.println(count); + } + + private static void testParam2() throws Exception + { + String sql="{call sp_test_param2_int_varchar(?, ?)}"; + + List paramList = new ArrayList<>(); + paramList.add(CallParam.inout(100)); + paramList.add(CallParam.out(String.class)); + + Global.get(ZSQL.class).call(sql, paramList); + + int count = (int)paramList.get(0).value(); + String string = (String)paramList.get(1).value(); + System.out.println(count + "," + string); + } + + private static void testParam2Rst2() throws Exception + { + String sql="{call sp_test_param2_rst2(?, ?)}"; + + List paramList = new ArrayList<>(); + paramList.add(CallParam.inout(100)); + paramList.add(CallParam.out(String.class)); + + List resultList = new ArrayList<>(); + resultList.add(CallResult.set(ZmrOperator.class)); + resultList.add(CallResult.set(ZmrDept.class)); + + Global.get(ZSQL.class).call(sql, paramList, resultList); + + int count = (int)paramList.get(0).value(); + String string = (String)paramList.get(1).value(); + System.out.println(count + "," + string); + + for (CallResult result : resultList) + { + System.out.println(result.getResultList()); + } + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestTable.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestTable.java new file mode 100644 index 0000000..cc6be22 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestTable.java @@ -0,0 +1,53 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.dbo.TInteger; + +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.test.ORMBoot; + +public class TestTable +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + long id = Ids.longId(); + TInteger obj = new TInteger(); + obj.setTId(id); + obj.setTBoolean(true); + obj.setTByte(1); + obj.setTShort(2); + obj.setTInt(3); + obj.setTLong(4); + + Global.get(ZTable.class).truncate(TInteger.class); + Global.get(ZTable.class).insert(obj); + + + TInteger item = Global.get(ZTable.class).item(TInteger.class, id); + System.out.println(item.getTByte()); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestTableNew.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestTableNew.java new file mode 100644 index 0000000..3dcfb03 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestTableNew.java @@ -0,0 +1,83 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import java.util.Map; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.orm.ZTabler; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.test.ORMBoot; + + +public class TestTableNew +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + _Table _table = new _Table("T_NEW_TABLE", "USER_NAME"); + _table.addField("USER_NAME", "string,32", true); + _table.addField("USER_PASS", "string,32", true); + _table.addIndex("USER_NAME", true); + + Global.get(ZTabler.class).truncate(_table); + + LinkedMapSO map = new LinkedMapSO(); + map.put("userName", "zhiqim"); + map.put("userPass", "zhiqim"); + + Global.get(ZTabler.class).insert(_table, map); + + Selector selector = new Selector(); + selector.addMust("userName", "zhiqim"); + + LinkedMapSO item = Global.get(ZTabler.class).item(_table, "zhiqim"); + + for (Map.Entry entry : item.entrySet()) + { + System.out.println(entry.getKey() + ":" + entry.getValue()); + } + + Object value = get(item, "userName", _table); + System.out.println(value); + } + + /** + * 通过表定义对象获取字段名对应的值 + * + * @param field 表字段 + * @param _table 表定义对象 + * @return 对应的值 + */ + public static Object get(LinkedMapSO instance, String field, _Table _table) + { + Object value = instance.get(field); + if (value != null) + return value; + + String column = _table.getColumn(field); + return instance.get(column); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestUserAccount.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestUserAccount.java new file mode 100644 index 0000000..9356a08 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestUserAccount.java @@ -0,0 +1,52 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.test.ORMBoot; +import org.zhiqim.orm.test.qc.dbo.UserAccount; + +public class TestUserAccount +{ + static String id = null; + + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + UserAccount account = new UserAccount(); + account.setUserId(Ids.longId()); + account.setUserNick("abc"); + + ORM.table().insert(account); + + UserAccount acct = ORM.table().item(UserAccount.class, 1811301701380001L); + System.out.println(acct); + + ORM.table().insert(account); + + acct = ORM.table().item(UserAccount.class, new Selector("userId", 1811301702270001L).addReplace("ID", "123456")); + System.out.println(acct); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestViewAlias.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestViewAlias.java new file mode 100644 index 0000000..38a8dcc --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/TestViewAlias.java @@ -0,0 +1,43 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import java.util.List; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.test.ORMBoot; +import org.zhiqim.orm.test.qc.ex.AnswerEx; + +public class TestViewAlias +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + List aliasList = Global.get(ZView.class).list(AnswerEx.class); + for (AnswerEx alias : aliasList) + { + System.out.println(alias); + } + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_Datetime.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_Datetime.java new file mode 100644 index 0000000..63ec2f4 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_Datetime.java @@ -0,0 +1,88 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.ORMBoot; +import org.zhiqim.orm.test.dbo.TDatetime; + +public class Test_Datetime +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + Global.get(ZTable.class).truncate(TDatetime.class); + + //1. + long id = Ids.longId(); + TDatetime time1 = new TDatetime(); + time1.setTId(id); + time1.setTDatetime(Sqls.toTimestamp(DateTimes.getDateTimeString())); + + System.out.println(time1); + Global.get(ZTable.class).insert(time1); + + TDatetime time11 = Global.get(ZTable.class).item(TDatetime.class, id); + System.out.println(time11); + + //2. + long id2 = Ids.longId(); + TDatetime time2 = new TDatetime(); + time2.setTId(id2); + time2.setTDatetime(Sqls.toTimestamp(DateTimes.getDateTimeString()+".123")); + + System.out.println(time2); + Global.get(ZTable.class).insert(time2); + + TDatetime time22 = Global.get(ZTable.class).item(TDatetime.class, id2); + System.out.println(time22); + + //3. + long id3 = Ids.longId(); + TDatetime time3 = new TDatetime(); + time3.setTId(id3); + time3.setTDatetime(Sqls.toTimestamp(DateTimes.getDateTimeString()+".123456")); + + System.out.println(time3); + Global.get(ZTable.class).insert(time3); + + TDatetime time33 = Global.get(ZTable.class).item(TDatetime.class, id3); + System.out.println(time33); + + //4. + long id4 = Ids.longId(); + TDatetime time4 = new TDatetime(); + time4.setTId(id4); + time4.setTDatetime(Sqls.toTimestamp(DateTimes.getDateTimeString()+".123456789")); + + System.out.println(time4); + Global.get(ZTable.class).insert(time4); + + TDatetime time44 = Global.get(ZTable.class).item(TDatetime.class, id4); + System.out.println(time44); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_InsertIntoOnDuplicateKeyUpdate.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_InsertIntoOnDuplicateKeyUpdate.java new file mode 100644 index 0000000..1c934d9 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_InsertIntoOnDuplicateKeyUpdate.java @@ -0,0 +1,56 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.test.ORMBoot; + +public class Test_InsertIntoOnDuplicateKeyUpdate +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + +// Global.get(ZTable.class).truncate(TDatetime.class); + + //1. +// long id = Ids.longId(); +// TDatetime time1 = new TDatetime(); +// time1.setTId(id); +// time1.setTDatetime(Sqls.toTimestamp("2011-11-11 11:11:11")); +// time1.setTDatetime2(Sqls.toTimestamp("2011-11-11 11:11:11")); +// +// System.out.println(time1); +// int ret = Global.get(ZTable.class).insert(time1); +// +// System.out.println(ret); + + //2.插入更新 + long id2=1609281739500001L; + String sql = "insert into T_DATETIME values(?,?,?) on duplicate key update T_DATETIME = ?"; + Object[] objs = new Object[]{id2, Sqls.toTimestamp("2011-11-11 11:11:11"), Sqls.toTimestamp("2011-11-11 11:11:11"), Sqls.toTimestamp("2012-12-12 12:12:12")}; + int ret2 = Global.get(ZSQL.class).executeUpdate(sql, objs); + System.out.println(ret2); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_InsertOrUpdate.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_InsertOrUpdate.java new file mode 100644 index 0000000..e820810 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_InsertOrUpdate.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.orm.test.ORMBoot; +import org.zhiqim.orm.test.dbo.TDatetime; + +public class Test_InsertOrUpdate +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + Global.get(ZTable.class).truncate(TDatetime.class); + + //1. + long id = Ids.longId(); + TDatetime time1 = new TDatetime(); + time1.setTId(id); + time1.setTDatetime(Sqls.toTimestamp("2011-11-11 11:11:11")); + time1.setTDatetime2(Sqls.toTimestamp("2011-11-11 11:11:11")); + + System.out.println(time1); + int ret = Global.get(ZTable.class).insert(time1); + + System.out.println(ret); + + //2.插入更新 + long id2=id; + TDatetime time2 = new TDatetime(); + time2.setTId(id2); + time2.setTDatetime(Sqls.toTimestamp("2011-11-11 11:11:11")); + time2.setTDatetime2(Sqls.toTimestamp("2011-11-11 11:11:11")); + + Updater updater = new Updater(); + updater.addField("tDatetime", Sqls.toTimestamp("2012-12-12 12:12:12")); + + int ret2 = Global.get(ZTable.class).insertOrUpdate(time2, updater); + System.out.println(ret2); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_InsertReturnIdentity.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_InsertReturnIdentity.java new file mode 100644 index 0000000..217e9bc --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_InsertReturnIdentity.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZSQL; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.dbo.TAuto; + +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.orm.test.ORMBoot; + +public class Test_InsertReturnIdentity +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + +// String sql = "insert T_AUTO (t_id,t_varchar) values(0,'abc');select @@IDENTITY;"; +// Global.get(FSQL.class).executeUpdate(sql); + + Transaction tx = TransactionManager.beginTransaction(); + + try + { + TAuto auto = new TAuto(); + auto.setTId(0); + auto.setTVarchar("abc"); + Global.get(ZTable.class).insert(auto); + + int id = Global.get(ZSQL.class).identityInt(); + System.out.println(id); + + tx.commit(); + } + catch (Exception e) + { + tx.rollback(); + } + finally + { + tx.close(); + } + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_Page.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_Page.java new file mode 100644 index 0000000..c878144 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_Page.java @@ -0,0 +1,71 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.dbo.TInteger; + +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.test.ORMBoot; + +public class Test_Page +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + Global.get(ZTable.class).truncate(TInteger.class); + + for (int i=0;i<10;i++) + { + TInteger data = new TInteger(); + data.setTId(Ids.longId()); + data.setTBoolean(i%2==0); + data.setTByte((byte)i); + data.setTShort((short)i); + data.setTInt(i); + data.setTLong(i); + + Global.get(ZTable.class).insert(data); + System.out.println("插入数据["+i+"]条"); + } + + System.out.println("第1页"); + + PageResult result = Global.get(ZTable.class).page(TInteger.class, 1, 2); + for (TInteger data : result.list()) + { + System.out.println(Jsons.toString(data)); + } + + System.out.println("第2页"); + + result = Global.get(ZTable.class).page(TInteger.class, 2, 2); + for (TInteger data : result.list()) + { + System.out.println(Jsons.toString(data)); + } + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_Transaction.java b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_Transaction.java new file mode 100644 index 0000000..71a16f7 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/mysql/Test_Transaction.java @@ -0,0 +1,100 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.mysql; + +import java.sql.SQLException; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.schedule.Interval; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.transaction.Transaction; +import org.zhiqim.kernel.transaction.TransactionManager; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORMException; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.ORMBoot; +import org.zhiqim.orm.test.dbo.TDatetime; + +public class Test_Transaction implements Task +{ + private static final Log log = LogFactory.getLog(Test_Transaction.class); + + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + Interval.shedule(new Test_Transaction(), 1000); + + Transaction tx = TransactionManager.beginTransaction(); + + try + { + Thread.sleep(2000); + + Global.get(ZTable.class).truncate(TDatetime.class); + log.info("已清除"); + + Thread.sleep(2000); + + long id = Ids.longId(); + TDatetime time1 = new TDatetime(); + time1.setTId(id); + time1.setTDatetime(Sqls.toTimestamp("2011-11-11 11:11:11")); + time1.setTDatetime2(Sqls.toTimestamp("2011-11-11 11:11:11")); + + Global.get(ZTable.class).insert(time1); + + log.info("已插入"); + + Thread.sleep(5000); + + tx.commit(); + log.info("提交成功"); + } + catch(Exception e) + { + tx.rollback(); + } + finally + { + tx.close(); + } + } + + @Override + public void execute() + { + try + { + int count = Global.get(ZTable.class).count(TDatetime.class); + log.info("Timer["+count+"]"); + } + catch (ORMException | SQLException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/oracle/TestAlterColumn.java b/zhiqim_orm/test/org/zhiqim/orm/test/oracle/TestAlterColumn.java new file mode 100644 index 0000000..ef9438c --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/oracle/TestAlterColumn.java @@ -0,0 +1,56 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.oracle; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZDDL; +import org.zhiqim.orm.ZTabler; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.test.ORMBoot; + + +public class TestAlterColumn +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initOracleServer(); + + _Table _table = new _Table("T_ALERT_COLUMN", "USER_NAME"); + _table.addField("USER_NAME", "string,32", true); + _table.addField("USER_PASS", "string,32", true); + _table.addIndex("USER_NAME", false); + + Global.get(ZTabler.class).truncate(_table); + + Global.get(ZDDL.class).alterColumnAdd("T_ALERT_COLUMN", "USER_STATUS", "int", true); + System.out.println("添加字段USER_STATUS"); + +// Global.get(FSQL.class).alterColumnModify("T_ALERT_COLUMN", "USER_STATUS", "USER_STATUS", "bigint", true); +// System.out.println("修改字段USER_STATUS"); + + Global.get(ZDDL.class).alterColumnInfo("T_ALERT_COLUMN", "USER_STATUS", "USER_STATUS_2", "bigint", true); + System.out.println("修改字段名称USER_STATUS_2"); + +// Global.get(FSQL.class).alterColumnDrop("T_ALERT_COLUMN", "USER_STATUS_2"); +// System.out.println("删除字段USER_STATUS"); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/oracle/Test_Insert.java b/zhiqim_orm/test/org/zhiqim/orm/test/oracle/Test_Insert.java new file mode 100644 index 0000000..ba9f0ae --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/oracle/Test_Insert.java @@ -0,0 +1,55 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.oracle; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.dbo.TInteger; + +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.test.ORMBoot; + +public class Test_Insert +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initOracleServer(); + + //1.数字 + for (int i=0;i<10;i++) + { + TInteger data = new TInteger(); + data.setTId(Ids.longId()); + data.setTBoolean(i%2==0); + data.setTByte((byte)i); + data.setTShort((short)i); + data.setTInt(i); + data.setTLong(i); + + Global.get(ZTable.class).insert(data); + System.out.println("插入数据["+i+"]条"); + } + + //2.文本 + + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/oracle/Test_Page.java b/zhiqim_orm/test/org/zhiqim/orm/test/oracle/Test_Page.java new file mode 100644 index 0000000..d955940 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/oracle/Test_Page.java @@ -0,0 +1,73 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.oracle; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.dbo.TInteger; + +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.test.ORMBoot; + +public class Test_Page +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initOracleServer(); + + Global.get(ZTable.class).truncate(TInteger.class); + + for (int i=0;i<20;i++) + { + TInteger data = new TInteger(); + data.setTId(Ids.longId()); + data.setTBoolean(i%2==0); + data.setTByte((byte)i); + data.setTShort((short)i); + data.setTInt(i); + data.setTLong(i); + + Global.get(ZTable.class).insert(data); + System.out.println("插入数据["+i+"]条"); + } + + System.out.println("第1页"); + System.out.println(System.currentTimeMillis()); + PageResult result = Global.get(ZTable.class).page(TInteger.class, 1, 2); + System.out.println(System.currentTimeMillis()); + for (TInteger data : result.list()) + { + System.out.println(Jsons.toString(data)); + } + + System.out.println("第8页"); + System.out.println(System.currentTimeMillis()); + result = Global.get(ZTable.class).page(TInteger.class, 8, 2); + System.out.println(System.currentTimeMillis()); + for (TInteger data : result.list()) + { + System.out.println(Jsons.toString(data)); + } + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/oracle/Test_TableCreate.java b/zhiqim_orm/test/org/zhiqim/orm/test/oracle/Test_TableCreate.java new file mode 100644 index 0000000..95b760f --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/oracle/Test_TableCreate.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.oracle; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.ORMBoot; + +import org.zhiqim.orm.test.dbo.TDatetime; +import org.zhiqim.orm.test.dbo.TDecimal; +import org.zhiqim.orm.test.dbo.TInteger; +import org.zhiqim.orm.test.dbo.TString; + +public class Test_TableCreate +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initOracleServer(); + + Global.get(ZTable.class).create(TInteger.class); + Global.get(ZTable.class).create(TString.class); + Global.get(ZTable.class).create(TDatetime.class); + Global.get(ZTable.class).create(TDecimal.class); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/postgresql/TestAlterColumn.java b/zhiqim_orm/test/org/zhiqim/orm/test/postgresql/TestAlterColumn.java new file mode 100644 index 0000000..e4e5310 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/postgresql/TestAlterColumn.java @@ -0,0 +1,61 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.postgresql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ZDDL; +import org.zhiqim.orm.ZTabler; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.test.ORMBoot; + + +public class TestAlterColumn +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initPSQLServer(); + ORMServer server = Global.getService(ORMServer.class); + + _Table _table = new _Table("T_ALERT_COLUMN", "USER_NAME"); + _table.addField("USER_NAME", "string,32", true); + _table.addField("USER_PASS", "string,32", true); + _table.addIndex("USER_NAME", true); + + Global.get(ZTabler.class).truncate(_table); + + String intColumnType = server.getPolicy().toColumnType("int"); + String longColumnType = server.getPolicy().toColumnType("long"); + + Global.get(ZDDL.class).alterColumnAdd("T_ALERT_COLUMN", "USER_STATUS", intColumnType, true); + System.out.println("添加字段USER_STATUS"); + + Global.get(ZDDL.class).alterColumnName("T_ALERT_COLUMN", "USER_STATUS", "USER_STATUS_2"); + System.out.println("修改字段名称USER_STATUS_2"); + + Global.get(ZDDL.class).alterColumnType("T_ALERT_COLUMN", "USER_STATUS_2", longColumnType, true); + System.out.println("修改字段USER_STATUS_2"); + + Global.get(ZDDL.class).alterColumnDrop("T_ALERT_COLUMN", "USER_STATUS_2"); + System.out.println("删除字段USER_STATUS_2"); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/postgresql/Test_Insert.java b/zhiqim_orm/test/org/zhiqim/orm/test/postgresql/Test_Insert.java new file mode 100644 index 0000000..ce23e16 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/postgresql/Test_Insert.java @@ -0,0 +1,55 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.postgresql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.dbo.TInteger; + +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.test.ORMBoot; + +public class Test_Insert +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initPSQLServer(); + + //1.数字 + for (int i=0;i<10;i++) + { + TInteger data = new TInteger(); + data.setTId(Ids.longId()); + data.setTBoolean(i%2==0); + data.setTByte((byte)i); + data.setTShort((short)i); + data.setTInt(i); + data.setTLong(i); + + Global.get(ZTable.class).insert(data); + System.out.println("插入数据["+i+"]条"); + } + + //2.文本 + + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/postgresql/Test_Page.java b/zhiqim_orm/test/org/zhiqim/orm/test/postgresql/Test_Page.java new file mode 100644 index 0000000..7976616 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/postgresql/Test_Page.java @@ -0,0 +1,73 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.postgresql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.dbo.TInteger; + +import org.zhiqim.kernel.paging.PageResult; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.test.ORMBoot; + +public class Test_Page +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initPSQLServer(); + + Global.get(ZTable.class).truncate(TInteger.class); + + for (int i=0;i<20;i++) + { + TInteger data = new TInteger(); + data.setTId(Ids.longId()); + data.setTBoolean(i%2==0); + data.setTByte((byte)i); + data.setTShort((short)i); + data.setTInt(i); + data.setTLong(i); + + Global.get(ZTable.class).insert(data); + System.out.println("插入数据["+i+"]条"); + } + + System.out.println("第1页"); + System.out.println(System.currentTimeMillis()); + PageResult result = Global.get(ZTable.class).page(TInteger.class, 1, 2); + System.out.println(System.currentTimeMillis()); + for (TInteger data : result.list()) + { + System.out.println(Jsons.toString(data)); + } + + System.out.println("第8页"); + System.out.println(System.currentTimeMillis()); + result = Global.get(ZTable.class).page(TInteger.class, 8, 2); + System.out.println(System.currentTimeMillis()); + for (TInteger data : result.list()) + { + System.out.println(Jsons.toString(data)); + } + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/postgresql/Test_TableCreate.java b/zhiqim_orm/test/org/zhiqim/orm/test/postgresql/Test_TableCreate.java new file mode 100644 index 0000000..41751ef --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/postgresql/Test_TableCreate.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.postgresql; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.ORMBoot; + +import org.zhiqim.orm.test.dbo.TDatetime; +import org.zhiqim.orm.test.dbo.TDecimal; +import org.zhiqim.orm.test.dbo.TInteger; +import org.zhiqim.orm.test.dbo.TString; + +public class Test_TableCreate +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initPSQLServer(); + + Global.get(ZTable.class).create(TInteger.class); + Global.get(ZTable.class).create(TString.class); + Global.get(ZTable.class).create(TDatetime.class); + Global.get(ZTable.class).create(TDecimal.class); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/qc/TestReplace.java b/zhiqim_orm/test/org/zhiqim/orm/test/qc/TestReplace.java new file mode 100644 index 0000000..b7c5d94 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/qc/TestReplace.java @@ -0,0 +1,78 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.qc; + +import java.util.List; + +import org.zhiqim.kernel.extend.HashMapSS; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.test.ORMBoot; +import org.zhiqim.orm.test.qc.dbo.QcQuestion; + +public class TestReplace +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initMySQLServer(); + + ORM.get(ZTable.class).create(QcQuestion.class, new HashMapSS("id", "18")); + + ORM.get(ZTable.class).create(QcQuestion.class); + + QcQuestion q = new QcQuestion(); + q.setIdInt(18); + q.setQuestionCreateTime(DateTimes.getDateTimeString()); + q.setQuestionDesc("ddd"); + q.setQuestionId(Ids.longId()); + q.setQuestionReadNum(0); + q.setQuestionTitle("标题"); + + ORM.table().insert(q); + + q = new QcQuestion(); + q.setQuestionCreateTime(DateTimes.getDateTimeString()); + q.setQuestionDesc("ddd"); + q.setQuestionId(Ids.longId()); + q.setQuestionReadNum(0); + q.setQuestionTitle("标题"); + + ORM.table().insert(q); + + List list = ORM.table().list(QcQuestion.class); + System.out.println(list.size()); + + q = list.get(0); + q.setQuestionStatus(3); + ORM.table().update(q); + + list = ORM.table().list(QcQuestion.class, new Selector().addReplace("id", "18")); + System.out.println(list.size()); + + q = list.get(0); + q.setQuestionStatus(3); + ORM.table().update(q); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/QcAnswer.java b/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/QcAnswer.java new file mode 100644 index 0000000..f763464 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/QcAnswer.java @@ -0,0 +1,124 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.qc.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 回复表 对应表《QC_ANSWER》 + */ +@AnAlias("QcAnswer") +@AnNew +@AnTable(table="QC_ANSWER", key="COMMENT_ID,ANSWER_ID", type="InnoDB") +public class QcAnswer implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="QUESTION_ID", type="long", notNull=true) private long questionId; //1.问题编号 + @AnTableField(column="COMMENT_ID", type="long", notNull=true) private long commentId; //2.评论编号 + @AnTableField(column="ANSWER_ID", type="long", notNull=true) private long answerId; //3.回复编号 + @AnTableField(column="COMMENT_USER_ID", type="long", notNull=true) private long commentUserId; //4.评论作者编号 + @AnTableField(column="ANSWER_CONTENT", type="string,2000", notNull=true) private String answerContent; //5.回复内容 + @AnTableField(column="ANSWER_USER_ID", type="long", notNull=true) private long answerUserId; //6.回复作者编号 + @AnTableField(column="ANSWER_TIME", type="string,19,char", notNull=true) private String answerTime; //7.回复时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getQuestionId() + { + return questionId; + } + + public void setQuestionId(long questionId) + { + this.questionId = questionId; + } + + public long getCommentId() + { + return commentId; + } + + public void setCommentId(long commentId) + { + this.commentId = commentId; + } + + public long getAnswerId() + { + return answerId; + } + + public void setAnswerId(long answerId) + { + this.answerId = answerId; + } + + public long getCommentUserId() + { + return commentUserId; + } + + public void setCommentUserId(long commentUserId) + { + this.commentUserId = commentUserId; + } + + public String getAnswerContent() + { + return answerContent; + } + + public void setAnswerContent(String answerContent) + { + this.answerContent = answerContent; + } + + public long getAnswerUserId() + { + return answerUserId; + } + + public void setAnswerUserId(long answerUserId) + { + this.answerUserId = answerUserId; + } + + public String getAnswerTime() + { + return answerTime; + } + + public void setAnswerTime(String answerTime) + { + this.answerTime = answerTime; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/QcComment.java b/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/QcComment.java new file mode 100644 index 0000000..116ee55 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/QcComment.java @@ -0,0 +1,113 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.qc.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 问答评论表 对应表《QC_COMMENT》 + */ +@AnAlias("QcComment") +@AnNew +@AnTable(table="QC_COMMENT", key="QUESTION_ID,COMMENT_ID", type="InnoDB") +public class QcComment implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="QUESTION_ID", type="long", notNull=true) private long questionId; //1.问题编号 + @AnTableField(column="COMMENT_ID", type="long", notNull=true) private long commentId; //2.评论编号 + @AnTableField(column="COMMENT_CONTENT", type="string,4000", notNull=true) private String commentContent; //3.评论内容 + @AnTableField(column="COMMENT_USER_ID", type="long", notNull=true) private long commentUserId; //4.评论作者编号 + @AnTableField(column="COMMENT_GOOD_NUM", type="int", notNull=true) private int commentGoodNum; //5.点赞数 + @AnTableField(column="COMMENT_CREATE_TIME", type="string,19,char", notNull=true) private String commentCreateTime; //6.评论发表时间 + + public String toString() + { + return Jsons.toString(this); + } + + public long getQuestionId() + { + return questionId; + } + + public void setQuestionId(long questionId) + { + this.questionId = questionId; + } + + public long getCommentId() + { + return commentId; + } + + public void setCommentId(long commentId) + { + this.commentId = commentId; + } + + public String getCommentContent() + { + return commentContent; + } + + public void setCommentContent(String commentContent) + { + this.commentContent = commentContent; + } + + public long getCommentUserId() + { + return commentUserId; + } + + public void setCommentUserId(long commentUserId) + { + this.commentUserId = commentUserId; + } + + public int getCommentGoodNum() + { + return commentGoodNum; + } + + public void setCommentGoodNum(int commentGoodNum) + { + this.commentGoodNum = commentGoodNum; + } + + public String getCommentCreateTime() + { + return commentCreateTime; + } + + public void setCommentCreateTime(String commentCreateTime) + { + this.commentCreateTime = commentCreateTime; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/QcGood.java b/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/QcGood.java new file mode 100644 index 0000000..b4dbec1 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/QcGood.java @@ -0,0 +1,69 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.qc.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 点赞表 对应表《QC_GOOD》 + */ +@AnAlias("QcGood") +@AnNew +@AnTable(table="QC_GOOD", key="COMMENT_ID,GOOD_USER_ID", type="InnoDB") +public class QcGood implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="COMMENT_ID", type="long", notNull=true) private long commentId; //1.评论编号 + @AnTableField(column="GOOD_USER_ID", type="long", notNull=true) private long goodUserId; //2.点赞人编号 + + public String toString() + { + return Jsons.toString(this); + } + + public long getCommentId() + { + return commentId; + } + + public void setCommentId(long commentId) + { + this.commentId = commentId; + } + + public long getGoodUserId() + { + return goodUserId; + } + + public void setGoodUserId(long goodUserId) + { + this.goodUserId = goodUserId; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/QcQuestion.java b/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/QcQuestion.java new file mode 100644 index 0000000..2c54387 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/QcQuestion.java @@ -0,0 +1,177 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.qc.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 问答问题表 对应表《QC_QUESTION$ID$》 + */ +@AnAlias("QcQuestion") +@AnNew +@AnTable(table="QC_QUESTION$ID$", key="QUESTION_ID", type="InnoDB") +public class QcQuestion implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableReplace("ID") private String id; + @AnTableField(column="QUESTION_ID", type="long", notNull=true) private long questionId; //1.问题编号 + @AnTableField(column="QUESTION_TYPE", type="int", notNull=true) private int questionType; //2.问题类型: 0技术疑问 1职业疑惑 2生活杂谈 3资讯动态 4其他 + @AnTableField(column="QUESTION_STATUS", type="int", notNull=true) private int questionStatus; //3.问题状态:0表示正常,1表示停用 + @AnTableField(column="QUESTION_TITLE", type="string,100", notNull=true) private String questionTitle; //4.问题标题 + @AnTableField(column="QUESTION_DESC", type="string,4000", notNull=true) private String questionDesc; //5.问题描述 + @AnTableField(column="QUESTION_USER_ID", type="long", notNull=true) private long questionUserId; //6.问题作者编号 + @AnTableField(column="QUESTION_CREATE_TIME", type="string,19,char", notNull=true) private String questionCreateTime; //7.问题发表时间 + @AnTableField(column="QUESTION_REPLY_NUM", type="int", notNull=true) private int questionReplyNum; //8.问题评论数 + @AnTableField(column="QUESTION_READ_NUM", type="int", notNull=true) private int questionReadNum; //9.问题阅读数 + + public String toString() + { + return Jsons.toString(this); + } + + public long getQuestionId() + { + return questionId; + } + + public void setQuestionId(long questionId) + { + this.questionId = questionId; + } + + public int getQuestionType() + { + return questionType; + } + + public void setQuestionType(int questionType) + { + this.questionType = questionType; + } + + public int getQuestionStatus() + { + return questionStatus; + } + + public void setQuestionStatus(int questionStatus) + { + this.questionStatus = questionStatus; + } + + public String getQuestionTitle() + { + return questionTitle; + } + + public void setQuestionTitle(String questionTitle) + { + this.questionTitle = questionTitle; + } + + public String getQuestionDesc() + { + return questionDesc; + } + + public void setQuestionDesc(String questionDesc) + { + this.questionDesc = questionDesc; + } + + public long getQuestionUserId() + { + return questionUserId; + } + + public void setQuestionUserId(long questionUserId) + { + this.questionUserId = questionUserId; + } + + public String getQuestionCreateTime() + { + return questionCreateTime; + } + + public void setQuestionCreateTime(String questionCreateTime) + { + this.questionCreateTime = questionCreateTime; + } + + public int getQuestionReplyNum() + { + return questionReplyNum; + } + + public void setQuestionReplyNum(int questionReplyNum) + { + this.questionReplyNum = questionReplyNum; + } + + public int getQuestionReadNum() + { + return questionReadNum; + } + + public void setQuestionReadNum(int questionReadNum) + { + this.questionReadNum = questionReadNum; + } + + public String getId() + { + return id; + } + + public int getIdInt() + { + return Integer.parseInt(id); + } + + public long getIdLong() + { + return Long.parseLong(id); + } + + public void setId(String id) + { + this.id = id; + } + + public void setIdInt(int id) + { + this.id = String.valueOf(id); + } + + public void setIdLong(long id) + { + this.id = String.valueOf(id); + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/UserAccount.java b/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/UserAccount.java new file mode 100644 index 0000000..df63a7a --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/qc/dbo/UserAccount.java @@ -0,0 +1,80 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.qc.dbo; + +import java.io.Serializable; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 用户表 对应表《USER_ACCOUNT》 + */ +@AnAlias("UserAccount") +@AnNew +@AnTable(table="USER_ACCOUNT", key="USER_ID", type="InnoDB") +public class UserAccount implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="USER_ID", type="long", notNull=true) private long userId; //1.用户编号 + @AnTableField(column="USER_NICK", type="string,32", notNull=false) private String userNick; //2.用户昵称 + @AnTableField(column="USER_AVATAR_50", type="string,200", notNull=false) private String userAvatar50; //3.用户头像 + + public String toString() + { + return Jsons.toString(this); + } + + public long getUserId() + { + return userId; + } + + public void setUserId(long userId) + { + this.userId = userId; + } + + public String getUserNick() + { + return userNick; + } + + public void setUserNick(String userNick) + { + this.userNick = userNick; + } + + public String getUserAvatar50() + { + return userAvatar50; + } + + public void setUserAvatar50(String userAvatar50) + { + this.userAvatar50 = userAvatar50; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/qc/ex/AnswerEx.java b/zhiqim_orm/test/org/zhiqim/orm/test/qc/ex/AnswerEx.java new file mode 100644 index 0000000..7bd2631 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/qc/ex/AnswerEx.java @@ -0,0 +1,93 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.qc.ex; + +import org.zhiqim.orm.test.qc.dbo.QcAnswer; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 回复扩展表 对应视图《ANSWER_EX》 + */ +@AnAlias("AnswerEx") +@AnNew +@AnView("QC_ANSWER,USER_ACCOUNT a,USER_ACCOUNT b") +@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="QC_ANSWER", lColumn="ANSWER_USER_ID", rTable="a", rColumn="USER_ID"), + @AnViewJoinValue(type="LEFT", lTable="QC_ANSWER", lColumn="COMMENT_USER_ID", rTable="b", rColumn="USER_ID")}) +public class AnswerEx extends QcAnswer +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="a", column="USER_NICK") private String answerUserNick; //1. + @AnViewField(table="a", column="USER_AVATAR_50") private String answerUserAvatar50; //2. + @AnViewField(table="b", column="USER_NICK") private String commentUserNick; //3. + @AnViewField(table="b", column="USER_AVATAR_50") private String commentUserAvatar50; //4. + + public String toString() + { + return Jsons.toString(this); + } + + public String getAnswerUserNick() + { + return answerUserNick; + } + + public void setAnswerUserNick(String answerUserNick) + { + this.answerUserNick = answerUserNick; + } + + public String getAnswerUserAvatar50() + { + return answerUserAvatar50; + } + + public void setAnswerUserAvatar50(String answerUserAvatar50) + { + this.answerUserAvatar50 = answerUserAvatar50; + } + + public String getCommentUserNick() + { + return commentUserNick; + } + + public void setCommentUserNick(String commentUserNick) + { + this.commentUserNick = commentUserNick; + } + + public String getCommentUserAvatar50() + { + return commentUserAvatar50; + } + + public void setCommentUserAvatar50(String commentUserAvatar50) + { + this.commentUserAvatar50 = commentUserAvatar50; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/qc/ex/CommentEx.java b/zhiqim_orm/test/org/zhiqim/orm/test/qc/ex/CommentEx.java new file mode 100644 index 0000000..30bb10f --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/qc/ex/CommentEx.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.qc.ex; + +import org.zhiqim.orm.test.qc.dbo.QcComment; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 评论扩展表 对应视图《COMMENT_EX》 + */ +@AnAlias("CommentEx") +@AnNew +@AnView("QC_COMMENT,USER_ACCOUNT") +@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="QC_COMMENT", lColumn="COMMENT_USER_ID", rTable="USER_ACCOUNT", rColumn="USER_ID")}) +public class CommentEx extends QcComment +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="USER_ACCOUNT", column="USER_NICK") private String userNick; //1.用户昵称 + @AnViewField(table="USER_ACCOUNT", column="USER_AVATAR_50") private String userAvatar50; //2.用户头像 + + public String toString() + { + return Jsons.toString(this); + } + + public String getUserNick() + { + return userNick; + } + + public void setUserNick(String userNick) + { + this.userNick = userNick; + } + + public String getUserAvatar50() + { + return userAvatar50; + } + + public void setUserAvatar50(String userAvatar50) + { + this.userAvatar50 = userAvatar50; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/qc/ex/QuestionEx.java b/zhiqim_orm/test/org/zhiqim/orm/test/qc/ex/QuestionEx.java new file mode 100644 index 0000000..9ddd5d7 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/qc/ex/QuestionEx.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.qc.ex; + +import org.zhiqim.orm.test.qc.dbo.QcQuestion; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.*; + +/** + * 问题扩展表 对应视图《QUESTION_EX》 + */ +@AnAlias("QuestionEx") +@AnNew +@AnView("QC_QUESTION$ID$,USER_ACCOUNT") +@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="QC_QUESTION$ID$", lColumn="QUESTION_USER_ID", rTable="USER_ACCOUNT", rColumn="USER_ID")}) +public class QuestionEx extends QcQuestion +{ + private static final long serialVersionUID = 1L; + + @AnViewField(table="USER_ACCOUNT", column="USER_NICK") private String userNick; //1.用户昵称 + @AnViewField(table="USER_ACCOUNT", column="USER_AVATAR_50") private String userAvatar50; //2.用户头像 + + public String toString() + { + return Jsons.toString(this); + } + + public String getUserNick() + { + return userNick; + } + + public void setUserNick(String userNick) + { + this.userNick = userNick; + } + + public String getUserAvatar50() + { + return userAvatar50; + } + + public void setUserAvatar50(String userAvatar50) + { + this.userAvatar50 = userAvatar50; + } + +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/FExecuteQueryTest.java b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/FExecuteQueryTest.java new file mode 100644 index 0000000..2b148ca --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/FExecuteQueryTest.java @@ -0,0 +1,36 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.sqlite; + + +public class FExecuteQueryTest +{ + public static void main(String[] args) + { +// String id = "query_user_info"; +// String param = "array"; +// String result = "org.zhiqim.orm.test.dbo.user.UserInfo"; +// String sql = "select * USER_INFO where USER_Name like '%?%' and USER_NICK like '%?%'"; +// + + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/FExecuteUpdateTest.java b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/FExecuteUpdateTest.java new file mode 100644 index 0000000..96d4890 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/FExecuteUpdateTest.java @@ -0,0 +1,34 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.sqlite; + + +public class FExecuteUpdateTest +{ + public static void main(String[] args) + { +// String id = "update_user_info"; +// String param = "array"; +// String sql = "update USER_INFO set USER_NAME=? where USER_ID=?"; +// + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/Statement.java b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/Statement.java new file mode 100644 index 0000000..b95a4ae --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/Statement.java @@ -0,0 +1,52 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.sqlite; + +import java.sql.Connection; +import java.sql.ParameterMetaData; +import java.sql.PreparedStatement; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.test.ORMBoot; + + +public class Statement +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initSQLiteServer(); + + String sql = "select * from ADMIN where ADMIN_NAME=? and status = ? and aaaa=? and bbbb=? and cccc=? and dddd=?"; + Connection conn = Global.getService(ORMServer.class).getConnection(); + PreparedStatement pstmt = conn.prepareStatement(sql); + ParameterMetaData meta = pstmt.getParameterMetaData(); + + int count = meta.getParameterCount(); + System.out.println(count); + + for (int i=0;i. + */ +package org.zhiqim.orm.test.sqlite; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.ORMBoot; + +import org.zhiqim.orm.test.dbo.Admin; +import org.zhiqim.orm.test.dbo.Message; + +public class TableCreate +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initSQLiteServer(); + + Global.get(ZTable.class).create(Message.class); + Global.get(ZTable.class).create(Admin.class); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestAlterColumn.java b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestAlterColumn.java new file mode 100644 index 0000000..b521814 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestAlterColumn.java @@ -0,0 +1,61 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.sqlite; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ZDDL; +import org.zhiqim.orm.ZTabler; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.test.ORMBoot; + + +public class TestAlterColumn +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initSQLiteServer(); + ORMServer server = Global.getService(ORMServer.class); + + _Table _table = new _Table("T_ALERT_COLUMN", "USER_NAME"); + _table.addField("USER_NAME", "string,32", true); + _table.addField("USER_PASS", "string,32", true); + _table.addIndex("USER_NAME", true); + + Global.get(ZTabler.class).truncate(_table); + + String intColumnType = server.getPolicy().toColumnType("string,10"); + String longColumnType = server.getPolicy().toColumnType("string,20"); + + Global.get(ZDDL.class).alterColumnAdd("T_ALERT_COLUMN", "USER_STATUS", intColumnType, true); + System.out.println("添加字段USER_STATUS"); + + Global.get(ZDDL.class).alterColumnType("T_ALERT_COLUMN", "USER_STATUS", longColumnType, true); + System.out.println("修改字段USER_STATUS"); + + Global.get(ZDDL.class).alterColumnName("T_ALERT_COLUMN", "USER_STATUS", "USER_STATUS2"); + System.out.println("修改字段名称USER_STATUS"); + + Global.get(ZDDL.class).alterColumnDrop("T_ALERT_COLUMN", "USER_STATUS2"); + System.out.println("删除字段USER_STATUS"); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestAlterColumnRename.java b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestAlterColumnRename.java new file mode 100644 index 0000000..63e67a9 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestAlterColumnRename.java @@ -0,0 +1,55 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.sqlite; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.extend.LinkedMapSO; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.ZDDL; +import org.zhiqim.orm.ZTabler; +import org.zhiqim.orm.dbo.defined._Table; +import org.zhiqim.orm.test.ORMBoot; + + +public class TestAlterColumnRename +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initSQLiteServer(); + Global.getService(ORMServer.class); + + _Table _table = new _Table("T_ALERT_COLUMN", "USER_NAME"); + _table.addField("USER_NAME", "string,32", true); + _table.addField("USER_PASS", "string,32", true); + _table.addIndex("USER_NAME", true); + + Global.get(ZTabler.class).truncate(_table); + Global.get(ZTabler.class).insert(_table, new LinkedMapSO("USER_NAME", "111").put("USER_PASS", "111")); + Global.get(ZTabler.class).insert(_table, new LinkedMapSO("USER_NAME", "222").put("USER_PASS", "222")); + + Global.get(ZDDL.class).alterColumnName("T_ALERT_COLUMN", "USER_NAME", "USER_NAME2"); + System.out.println("修改字段名称USER_STATUS"); + +// Global.get(FSQLer.class).alterColumnDrop("T_ALERT_COLUMN", "USER_STATUS"); +// System.out.println("删除字段USER_STATUS"); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestBlob.java b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestBlob.java new file mode 100644 index 0000000..bc8c0c4 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestBlob.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.sqlite; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; + +import org.zhiqim.kernel.Global; + + +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.test.ORMBoot; + +public class TestBlob +{ + public static void main(String[] args) throws Exception + { + byte[] bytes = Files.read("./conf/zhiqim.xml"); + long id = Ids.longId(); + + ORMBoot.initSQLiteServer(); + ORMServer server = Global.getService(ORMServer.class); + + String sql = "insert into TEST_BLOB (T_ID, T_BLOB) values (?,?)"; + Connection conn = server.getConnection(); + PreparedStatement pstmt = conn.prepareStatement(sql); + pstmt.setLong(1, id); + pstmt.setBytes(2, bytes); + pstmt.executeUpdate(); + + pstmt.close(); + conn.close(); + + sql = "select * from TEST_BLOB where T_ID = ?"; + conn = server.getConnection(); + pstmt = conn.prepareStatement(sql); + pstmt.setLong(1, id); + ResultSet rst = pstmt.executeQuery(); + if (rst.next()) + { + System.out.println(rst.getLong(1)); + System.out.println(new String(rst.getBytes(2))); + } + + ZDBClose.close(rst, pstmt, conn); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestDaoString.java b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestDaoString.java new file mode 100644 index 0000000..eb6489c --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestDaoString.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.sqlite; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.dbo.Admin; + +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.orm.test.ORMBoot; + +public class TestDaoString +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initSQLiteServer(); + + Admin admin = new Admin(); + admin.setAdminName("123456"); + admin.setAdminPass("123456"); + admin.setAdminTime(DateTimes.getDateTimeString()); + + Global.get(ZTable.class).insert(admin); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestDate.java b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestDate.java new file mode 100644 index 0000000..a451c1e --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestDate.java @@ -0,0 +1,73 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.sqlite; + +import java.sql.Connection; +import java.sql.Date; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Timestamp; + +import org.zhiqim.kernel.Global; + + +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORMServer; +import org.zhiqim.orm.datasource.ZDBClose; +import org.zhiqim.orm.test.ORMBoot; + +public class TestDate +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initSQLiteServer(); + ORMServer server = Global.getService(ORMServer.class); + + long id = Ids.longId(); + Date date = new Date(System.currentTimeMillis()); + Timestamp timestamp = new Timestamp(System.currentTimeMillis()); + + String sql = "insert into TEST_DATE (T_ID, T_DATE, T_DATETIME) values (?,?,?)"; + Connection conn = server.getConnection(); + PreparedStatement pstmt = conn.prepareStatement(sql); + pstmt.setLong(1, id); + pstmt.setDate(2, date); + pstmt.setTimestamp(3, timestamp); + pstmt.executeUpdate(); + + ZDBClose.close(pstmt, conn); + + sql = "select * from TEST_DATE where T_ID = ?"; + conn = server.getConnection(); + pstmt = conn.prepareStatement(sql); + pstmt.setLong(1, id); + ResultSet rst = pstmt.executeQuery(); + if (rst.next()) + { + System.out.println(rst.getLong(1)); + System.out.println(rst.getTimestamp(2)); + System.out.println(rst.getTimestamp(3)); + } + + ZDBClose.close(rst, pstmt, conn); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestInteger.java b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestInteger.java new file mode 100644 index 0000000..49a42b3 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestInteger.java @@ -0,0 +1,53 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.sqlite; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.test.dbo.TInteger; + +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.test.ORMBoot; + +public class TestInteger +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initSQLiteServer(); + + long id = Ids.longId(); + TInteger obj = new TInteger(); + obj.setTId(id); + obj.setTBoolean(true); + obj.setTByte(1); + obj.setTShort(2); + obj.setTInt(3); + obj.setTLong(4); + + Global.get(ZTable.class).truncate(TInteger.class); + Global.get(ZTable.class).insert(obj); + + + TInteger item = Global.get(ZTable.class).item(TInteger.class, id); + System.out.println(item.getTByte()); + } +} diff --git a/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestLeft.java b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestLeft.java new file mode 100644 index 0000000..8e3d2b8 --- /dev/null +++ b/zhiqim_orm/test/org/zhiqim/orm/test/sqlite/TestLeft.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm + * + * This file is part of [zhiqim_orm]. + * + * [zhiqim_orm] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_orm] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_orm]. + * If not, see . + */ +package org.zhiqim.orm.test.sqlite; + +import java.util.List; + +import org.zhiqim.kernel.Global; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.test.ORMBoot; + +import org.zhiqim.orm.test.dboext.TIntegerStringLeft; + +public class TestLeft +{ + public static void main(String[] args) throws Exception + { + ORMBoot.initSQLiteServer(); + + List leftList = Global.get(ZView.class).list(TIntegerStringLeft.class); + for (TIntegerStringLeft left : leftList) + { + System.out.println(left.getTId()); + } + } +} diff --git a/zhiqim_plan/.gitignore b/zhiqim_plan/.gitignore new file mode 100644 index 0000000..7da5aac --- /dev/null +++ b/zhiqim_plan/.gitignore @@ -0,0 +1,2 @@ +/bin +/logs diff --git a/zhiqim_plan/LICENSE b/zhiqim_plan/LICENSE new file mode 100644 index 0000000..e30b5a7 --- /dev/null +++ b/zhiqim_plan/LICENSE @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "{}" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright 2018 dengcj + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/zhiqim_plan/README.md b/zhiqim_plan/README.md new file mode 100644 index 0000000..6dff073 --- /dev/null +++ b/zhiqim_plan/README.md @@ -0,0 +1,90 @@ +### zhiqim_plan简介 +> zhiqim_plan是知启蒙计划组件,是开发过程管理的一部分。 + +### zhiqim_plan的特点和优势 +> 1、全程自主研发,无外部依赖包,限制少; +> +> 2、项目计划总结可以让项目规划更加清晰,增强团队的执行力。 +> +> 3、个人的计划总结有利于总结分析个人工作的进程,以及工作中的不足; + + +### zhiqim_plan项目依赖表格展示 +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +>
            依赖关系表格展示
            核心组件zhiqim_kernel知启蒙微内核
            zhiqim_httpd知启蒙WEB容器
            zhiqim_orm知启蒙数据库映射
            zhiqim_zml知启蒙语言标识
            zhiqim_ui知启蒙前端框架
            业务组件zhiqim_manager知启蒙后台管理组件
            zhiqim_project知启蒙项目组件
            zhiqim_calendar知启蒙日历组件
            数据库组件zhiqim_SQLite3.8.6知启蒙文件数据库组件
            + +### zhiqim_plan项目依赖文字解释 +> **依赖一**: +> +> ZhiqimDK:包括zhiqim_kernel、zhiqim_orm、zhiqim_zml、zhiqim_httpd四部分。 +> - zhiqim_kernel:是Zhiqim Development Kit的核心,负责工程的生命周期管理:包括工程开发和发布的目录结构管理、统一的配置规约、单多例服务接口定义、服务启动运行更新和销毁管理。并提供基础开发工具:包括工具类、日志类、线程池、JSON/XML编解析、HTTP客户端、时钟任务定时器等。 +> - zhiqim_orm:是Zhiqim Development Kit面向数据库开发的多例服务,包括ZSQL规范和三大映射关系(表映射、字段映射和指令映射)。 +> - zhiqim_zml:是实现ZML规范的引擎系统。支持两种ZML加载方式(按文件目录和按类路径)、能够在ZML文件改动后立即发现并在触发时重新加载、 并提供详细的“表达式合并运算优先级”、“变量多维作用域”和“无障碍访问Java代码”,以及设置上下文作用域的配置模板、对模板进行缓存等特性。 +> - zhiqim_httpd:是Zhiqim Development Kit面向WEB开发的多例服务,提供更简洁配置、积木式组件模块和天然的模型模板设计。 +> +> **依赖二**: +> +> -zhiqim_ui:是一套集成Javascript库、Css库、Font库、常用ico图标和Flash控件等,并在其上开发的大量UI组件组成的前端开发套件。 +> +> **依赖三** : +> - zhiqim_manager:是知启蒙团队自主研发的后台管理台,可独立使用,也可作为组件与其他组件配合使用,使用范围非常广。 +> - zhiqim_project:即知启蒙项目组件,包含了项目信息管理,项目成员管理,项目动态以及项目计划总结等汇报设置。 +> - zhiqim_calendar:即知启蒙日历组件,包含了工作日,休息日切换管理等功能。 +> +> **依赖四**: +> +> -MySQL:数据库。 + +### zhiqim_plan的功能展示 +1、项目计划的功能展示 +![输入图片说明](https://images.gitee.com/uploads/images/2018/0824/102920_15433f1a_2134900.jpeg "项目计划.JPG") + +2、个人计划的功能展示 +![输入图片说明](https://images.gitee.com/uploads/images/2018/0824/102950_2d4439bf_2134900.jpeg "个人计划.JPG") + + +### 知启蒙技术交流 + +> QQ群:加入交流群,请点击[【458171582】](https://jq.qq.com/?_wv=1027&k=5DWlB3b) +> +> 欲知晓更多详情,[请戳这里>>](https://www.zhiqim.com/index.htm) \ No newline at end of file diff --git a/zhiqim_plan/conf/httpd.xml b/zhiqim_plan/conf/httpd.xml new file mode 100644 index 0000000..b01e305 --- /dev/null +++ b/zhiqim_plan/conf/httpd.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_plan/conf/logging.xml b/zhiqim_plan/conf/logging.xml new file mode 100644 index 0000000..da3a326 --- /dev/null +++ b/zhiqim_plan/conf/logging.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_plan/conf/zhiqim.xml b/zhiqim_plan/conf/zhiqim.xml new file mode 100644 index 0000000..eb02e1a --- /dev/null +++ b/zhiqim_plan/conf/zhiqim.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_plan/document/export/component.exp.xml b/zhiqim_plan/document/export/component.exp.xml new file mode 100644 index 0000000..6096ee2 --- /dev/null +++ b/zhiqim_plan/document/export/component.exp.xml @@ -0,0 +1,15 @@ + +
            +
            + + + + + + + + + + +
            +
            diff --git a/zhiqim_plan/document/export/project.exp.xml b/zhiqim_plan/document/export/project.exp.xml new file mode 100644 index 0000000..05a21fd --- /dev/null +++ b/zhiqim_plan/document/export/project.exp.xml @@ -0,0 +1,19 @@ + +
            +
            + + + + + + + + + + + + + + +
            +
            diff --git a/zhiqim_plan/document/知启蒙项目计划组件数据库字典.dbo b/zhiqim_plan/document/知启蒙项目计划组件数据库字典.dbo new file mode 100644 index 0000000..c30df7d --- /dev/null +++ b/zhiqim_plan/document/知启蒙项目计划组件数据库字典.dbo @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + + + + + + + + + + + + + +
            + +
            + + + + + + + + + + + + + + + + +
            + + + + + + + + +
            + + + + + + + + + +
            + + + + + + + + +
            + +
            + +
            \ No newline at end of file diff --git a/zhiqim_plan/document/知启蒙项目计划组件管理菜单.menu b/zhiqim_plan/document/知启蒙项目计划组件管理菜单.menu new file mode 100644 index 0000000..9bf2c1c --- /dev/null +++ b/zhiqim_plan/document/知启蒙项目计划组件管理菜单.menu @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_plan/document/知启蒙项目计划组件管理菜单功能菜单.sql b/zhiqim_plan/document/知启蒙项目计划组件管理菜单功能菜单.sql new file mode 100644 index 0000000..2650176 --- /dev/null +++ b/zhiqim_plan/document/知启蒙项目计划组件管理菜单功能菜单.sql @@ -0,0 +1,61 @@ +-- --------------------------------------------------- +-- 知启蒙项目计划组件管理菜单 +-- --------------------------------------------------- + + +truncate table ZMR_MENU; +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('ROOT', 'MENU', '系统功能根菜单', '', 0, 0, 0, '', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU', 'MENU_010', '系统配置', '系统', 1, 0, 1, 'z-config', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_010', '系统基础设置', '', 2, 0, 1, 'z-setting', '/zhiqim_manager/menu.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_010', '增加系统菜单', '', 3, 0, 2, '', '/zhiqim_manager/menuAdd.htm,/zhiqim_manager/menuInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_020', '修改系统菜单', '', 3, 0, 2, '', '/zhiqim_manager/menuModify.htm,/zhiqim_manager/menuUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_030', '删除系统菜单', '', 3, 0, 2, '', '/zhiqim_manager/menuDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_100', '系统头像管理', '', 3, 0, 2, '', '/zhiqim_manager/avatar.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_110', '增加系统头像', '', 3, 0, 2, '', '/zhiqim_manager/avatarAdd.htm,/zhiqim_manager/avatarInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_120', '修改系统头像', '', 3, 0, 2, '', '/zhiqim_manager/avatarModify.htm,/zhiqim_manager/avatarUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_130', '删除系统头像', '', 3, 0, 2, '', '/zhiqim_manager/avatarDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_200', '系统配置管理', '', 3, 0, 2, '', '/zhiqim_manager/config.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_300', '系统参数设置', '', 3, 0, 2, '', '/zhiqim_manager/param.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_310', '首页主题设置', '', 3, 0, 2, '', '/zhiqim_manager/themeIndex.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_320', '主页主题设置', '', 3, 0, 2, '', '/zhiqim_manager/themeMain.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_050', '部门角色管理', '', 2, 0, 1, 'z-apps', '/zhiqim_manager/dept.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_010', '增加部门', '', 3, 0, 2, '', '/zhiqim_manager/deptAdd.htm,/zhiqim_manager/deptInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_020', '修改部门', '', 3, 0, 2, '', '/zhiqim_manager/deptModify.htm,/zhiqim_manager/deptUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_030', '删除部门', '', 3, 0, 2, '', '/zhiqim_manager/deptDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_040', '部门成员', '', 3, 0, 2, '', '/zhiqim_manager/deptOperator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_050', '部门权限', '', 3, 0, 2, '', '/zhiqim_manager/deptRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_100', '角色管理', '', 3, 0, 2, '', '/zhiqim_manager/role.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_110', '增加角色', '', 3, 0, 2, '', '/zhiqim_manager/roleAdd.htm,/zhiqim_manager/roleInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_120', '修改角色', '', 3, 0, 2, '', '/zhiqim_manager/roleModify.htm,/zhiqim_manager/roleUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_130', '删除角色', '', 3, 0, 2, '', '/zhiqim_manager/roleDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_140', '角色成员', '', 3, 0, 2, '', '/zhiqim_manager/roleOperator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_150', '角色权限', '', 3, 0, 2, '', '/zhiqim_manager/roleRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_110', '操作员管理', '', 2, 0, 1, 'z-customer', '/zhiqim_manager/operator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_010', '增加操作员', '', 3, 0, 2, '', '/zhiqim_manager/operatorAdd.htm,/zhiqim_manager/operatorInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_020', '修改操作员', '', 3, 0, 2, '', '/zhiqim_manager/operatorModify.htm,/zhiqim_manager/operatorUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_030', '删除操作员', '', 3, 0, 2, '', '/zhiqim_manager/operatorDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_040', '查看操作员权限', '', 3, 0, 2, '', '/zhiqim_manager/operatorRuleView.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_050', '设置操作员独立权限 ', '', 3, 0, 2, '', '/zhiqim_manager/operatorRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_060', '设置操作员部门', '', 3, 0, 2, '', '/zhiqim_manager/operatorDept.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_070', '设置操作员角色', '', 3, 0, 2, '', '/zhiqim_manager/operatorRole.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_150', '操作日志查询', '', 2, 0, 1, 'z-text', '/zhiqim_manager/operateLog.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_150', 'MENU_010_150_100', '操作员在线列表', '', 3, 0, 1, '', '/zhiqim_manager/operatorOnline.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU', 'MENU_020', '项目管理', '项目', 1, 0, 1, 'z-box', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020', 'MENU_020_010', '项目信息管理', '', 2, 0, 1, 'z-text', '/zhiqim_project/project.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020', 'MENU_020_020', '项目成员管理', '', 2, 0, 1, 'z-port', '/zhiqim_project/member.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020_010', 'MENU_020_010_010', '增加项目', '', 3, 0, 2, '', '/zhiqim_project/projectAdd.htm,/zhiqim_project/projectInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020_010', 'MENU_020_010_020', '修改项目', '', 3, 0, 2, '', '/zhiqim_project/projectModify.htm,/zhiqim_project/projectUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020_010', 'MENU_020_010_030', '删除项目', '', 3, 0, 2, '', '/zhiqim_project/projectDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020_010', 'MENU_020_010_040', '转让项目', '', 3, 0, 2, '', '/zhiqim_project/projectTransferSelector.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020_060', 'MENU_020_060_010', '设置工作日休息日', '', 3, 0, 2, '', '/zhiqim_calendar/setting.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020', 'MENU_020_060', '项目日历管理', '', 2, 0, 1, 'z-text', '/zhiqim_calendar/calendar.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020', 'MENU_020_070', '项目计划总结', '', 2, 0, 1, 'z-histogram', '/zhiqim_plan/projectMonth.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU', 'MENU_030', '我的动态', '动态', 1, 0, 1, 'z-list', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_030', 'MENU_030_010', '我的汇报设置', '', 2, 0, 1, 'z-text', '/zhiqim_project/personSetting.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_030', 'MENU_030_020', '我的项目动态', '', 2, 0, 1, 'z-text', '/zhiqim_project/personReport.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_030', 'MENU_030_040', '我的计划总结', '', 2, 0, 1, 'z-customer', '/zhiqim_plan/personMonth.htm', ''); +commit; + +-- --------------------------------------------------- +-- 知启蒙项目计划组件管理菜单创建完成 +-- --------------------------------------------------- diff --git a/zhiqim_plan/lib/zhiqim.jar b/zhiqim_plan/lib/zhiqim.jar new file mode 100644 index 0000000..29f481f Binary files /dev/null and b/zhiqim_plan/lib/zhiqim.jar differ diff --git a/zhiqim_plan/lib/zhiqim_calendar.jar b/zhiqim_plan/lib/zhiqim_calendar.jar new file mode 100644 index 0000000..ddc5a97 Binary files /dev/null and b/zhiqim_plan/lib/zhiqim_calendar.jar differ diff --git a/zhiqim_plan/lib/zhiqim_httpd.jar b/zhiqim_plan/lib/zhiqim_httpd.jar new file mode 100644 index 0000000..18099bd Binary files /dev/null and b/zhiqim_plan/lib/zhiqim_httpd.jar differ diff --git a/zhiqim_plan/lib/zhiqim_manager.jar b/zhiqim_plan/lib/zhiqim_manager.jar new file mode 100644 index 0000000..7917115 Binary files /dev/null and b/zhiqim_plan/lib/zhiqim_manager.jar differ diff --git a/zhiqim_plan/lib/zhiqim_mysql5.0.8_01.jar b/zhiqim_plan/lib/zhiqim_mysql5.0.8_01.jar new file mode 100644 index 0000000..3bc57b4 Binary files /dev/null and b/zhiqim_plan/lib/zhiqim_mysql5.0.8_01.jar differ diff --git a/zhiqim_plan/lib/zhiqim_orm.jar b/zhiqim_plan/lib/zhiqim_orm.jar new file mode 100644 index 0000000..932438f Binary files /dev/null and b/zhiqim_plan/lib/zhiqim_orm.jar differ diff --git a/zhiqim_plan/lib/zhiqim_project.jar b/zhiqim_plan/lib/zhiqim_project.jar new file mode 100644 index 0000000..6323075 Binary files /dev/null and b/zhiqim_plan/lib/zhiqim_project.jar differ diff --git a/zhiqim_plan/lib/zhiqim_ui.jar b/zhiqim_plan/lib/zhiqim_ui.jar new file mode 100644 index 0000000..e1aa5c1 Binary files /dev/null and b/zhiqim_plan/lib/zhiqim_ui.jar differ diff --git a/zhiqim_plan/lib/zhiqim_zml.jar b/zhiqim_plan/lib/zhiqim_zml.jar new file mode 100644 index 0000000..0e2aa82 Binary files /dev/null and b/zhiqim_plan/lib/zhiqim_zml.jar differ diff --git a/zhiqim_plan/resource/conf/config.xml b/zhiqim_plan/resource/conf/config.xml new file mode 100644 index 0000000..4d8386c --- /dev/null +++ b/zhiqim_plan/resource/conf/config.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_plan/resource/conf/zmr.menu.sql b/zhiqim_plan/resource/conf/zmr.menu.sql new file mode 100644 index 0000000..5111715 --- /dev/null +++ b/zhiqim_plan/resource/conf/zmr.menu.sql @@ -0,0 +1,61 @@ +-- --------------------------------------------------- +-- 知启蒙项目计划组件管理菜单 +-- --------------------------------------------------- + + +truncate table ZMR_MENU; +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('ROOT', 'MENU', '系统功能根菜单', '', 0, 0, 0, '', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU', 'MENU_010', '系统配置', '系统', 1, 0, 1, 'z-config', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_010', '系统基础设置', '', 2, 0, 1, 'z-setting', '/${zhiqim_manager}/menu.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_010', '增加系统菜单', '', 3, 0, 2, '', '/${zhiqim_manager}/menuAdd.htm,/${zhiqim_manager}/menuInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_020', '修改系统菜单', '', 3, 0, 2, '', '/${zhiqim_manager}/menuModify.htm,/${zhiqim_manager}/menuUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_030', '删除系统菜单', '', 3, 0, 2, '', '/${zhiqim_manager}/menuDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_100', '系统头像管理', '', 3, 0, 2, '', '/${zhiqim_manager}/avatar.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_110', '增加系统头像', '', 3, 0, 2, '', '/${zhiqim_manager}/avatarAdd.htm,/${zhiqim_manager}/avatarInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_120', '修改系统头像', '', 3, 0, 2, '', '/${zhiqim_manager}/avatarModify.htm,/${zhiqim_manager}/avatarUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_130', '删除系统头像', '', 3, 0, 2, '', '/${zhiqim_manager}/avatarDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_200', '系统配置管理', '', 3, 0, 2, '', '/${zhiqim_manager}/config.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_300', '系统参数设置', '', 3, 0, 2, '', '/${zhiqim_manager}/param.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_310', '首页主题设置', '', 3, 0, 2, '', '/${zhiqim_manager}/themeIndex.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_010', 'MENU_010_010_320', '主页主题设置', '', 3, 0, 2, '', '/${zhiqim_manager}/themeMain.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_050', '部门角色管理', '', 2, 0, 1, 'z-apps', '/${zhiqim_manager}/dept.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_010', '增加部门', '', 3, 0, 2, '', '/${zhiqim_manager}/deptAdd.htm,/${zhiqim_manager}/deptInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_020', '修改部门', '', 3, 0, 2, '', '/${zhiqim_manager}/deptModify.htm,/${zhiqim_manager}/deptUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_030', '删除部门', '', 3, 0, 2, '', '/${zhiqim_manager}/deptDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_040', '部门成员', '', 3, 0, 2, '', '/${zhiqim_manager}/deptOperator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_050', '部门权限', '', 3, 0, 2, '', '/${zhiqim_manager}/deptRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_100', '角色管理', '', 3, 0, 2, '', '/${zhiqim_manager}/role.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_110', '增加角色', '', 3, 0, 2, '', '/${zhiqim_manager}/roleAdd.htm,/${zhiqim_manager}/roleInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_120', '修改角色', '', 3, 0, 2, '', '/${zhiqim_manager}/roleModify.htm,/${zhiqim_manager}/roleUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_130', '删除角色', '', 3, 0, 2, '', '/${zhiqim_manager}/roleDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_140', '角色成员', '', 3, 0, 2, '', '/${zhiqim_manager}/roleOperator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_050', 'MENU_010_050_150', '角色权限', '', 3, 0, 2, '', '/${zhiqim_manager}/roleRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_110', '操作员管理', '', 2, 0, 1, 'z-customer', '/${zhiqim_manager}/operator.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_010', '增加操作员', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorAdd.htm,/${zhiqim_manager}/operatorInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_020', '修改操作员', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorModify.htm,/${zhiqim_manager}/operatorUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_030', '删除操作员', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_040', '查看操作员权限', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorRuleView.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_050', '设置操作员独立权限 ', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorRule.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_060', '设置操作员部门', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorDept.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_110', 'MENU_010_110_070', '设置操作员角色', '', 3, 0, 2, '', '/${zhiqim_manager}/operatorRole.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010', 'MENU_010_150', '操作日志查询', '', 2, 0, 1, 'z-text', '/${zhiqim_manager}/operateLog.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_010_150', 'MENU_010_150_100', '操作员在线列表', '', 3, 0, 1, '', '/${zhiqim_manager}/operatorOnline.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU', 'MENU_020', '项目管理', '项目', 1, 0, 1, 'z-box', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020', 'MENU_020_010', '项目信息管理', '', 2, 0, 1, 'z-text', '/zhiqim_project/project.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020', 'MENU_020_020', '项目成员管理', '', 2, 0, 1, 'z-port', '/zhiqim_project/member.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020_010', 'MENU_020_010_010', '增加项目', '', 3, 0, 2, '', '/zhiqim_project/projectAdd.htm,/zhiqim_project/projectInsert.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020_010', 'MENU_020_010_020', '修改项目', '', 3, 0, 2, '', '/zhiqim_project/projectModify.htm,/zhiqim_project/projectUpdate.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020_010', 'MENU_020_010_030', '删除项目', '', 3, 0, 2, '', '/zhiqim_project/projectDelete.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020_010', 'MENU_020_010_040', '转让项目', '', 3, 0, 2, '', '/zhiqim_project/projectTransferSelector.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020_060', 'MENU_020_060_010', '设置工作日休息日', '', 3, 0, 2, '', '/zhiqim_calendar/setting.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020', 'MENU_020_060', '项目日历管理', '', 2, 0, 1, 'z-text', '/zhiqim_calendar/calendar.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_020', 'MENU_020_070', '项目计划总结', '', 2, 0, 1, 'z-histogram', '/zhiqim_plan/projectMonth.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU', 'MENU_030', '我的动态', '动态', 1, 0, 1, 'z-list', '', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_030', 'MENU_030_010', '我的汇报设置', '', 2, 0, 1, 'z-text', '/zhiqim_project/personSetting.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_030', 'MENU_030_020', '我的项目动态', '', 2, 0, 1, 'z-text', '/zhiqim_project/personReport.htm', ''); +insert into ZMR_MENU (PARENT_CODE, MENU_CODE, MENU_NAME, MENU_NAME_ABBR, MENU_LEVEL, MENU_STATUS, MENU_TYPE, MENU_ICON, MENU_URL, MENU_DESC) values ('MENU_030', 'MENU_030_040', '我的计划总结', '', 2, 0, 1, 'z-customer', '/zhiqim_plan/personMonth.htm', ''); +commit; + +-- --------------------------------------------------- +-- 知启蒙项目计划组件管理菜单创建完成 +-- --------------------------------------------------- diff --git a/zhiqim_plan/resource/zview/zhiqim_plan/personMonth.zml b/zhiqim_plan/resource/zview/zhiqim_plan/personMonth.zml new file mode 100644 index 0000000..9ae634d --- /dev/null +++ b/zhiqim_plan/resource/zview/zhiqim_plan/personMonth.zml @@ -0,0 +1,197 @@ +<#function on_textarea(planTypeName, planRows)> +onpropertychange="resize(this)" onkeyup="resize(this)" oninput="resize(this)" ontextinput="resize(this)" placeholder="按下写${planTypeName},按回车键换行" data-rows="${planRows}" maxlength="512" spellcheck="false" + + + +${zhiqim_manager_breadcrumb ("我的计划总结")} +${zhiqim_manager_content()} +<#-- 导航 --> +
            + +
            + + + + + + + +
            我的 [${year}${month}月] 计划和总结
            + +<#for item : weekList> + + + + + + + + + + + + + + + + +<#for model : item.getPlanList()> +<#if model_index gt 0> + + + + + + + + + +<#for model : item.getDayList()> + + + + + + + + + + + + + + + + +
            日期名称计划总结项计划状态
            + ${item.getWeekBegin()}



            ${item.getWeekEnd()} +
            + 1 + + +
            ${model_index+1} + +
            ${model.getWeekString()}
            周总结
            ${year}-${Strings.prefixZero(month, 2)}

            月总结
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_plan/resource/zview/zhiqim_plan/personReader.zml b/zhiqim_plan/resource/zview/zhiqim_plan/personReader.zml new file mode 100644 index 0000000..2149f42 --- /dev/null +++ b/zhiqim_plan/resource/zview/zhiqim_plan/personReader.zml @@ -0,0 +1,52 @@ +<#def designatedPath="/zhiqim_plan/personMonth.htm"/> + + +${zhiqim_manager_breadcrumb ("向我汇报的成员")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + +${zhiqim_manager_tr_no_record(list, 4, "暂无向我汇报的成员")} +<#for item : list> + + + + + + + +
            操作员头像操作员编码操作员名称操作
            ${item.getOperatorCode()}${item.getOperatorName()}
            +${zhiqim_manager_list(list.size())} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_plan/resource/zview/zhiqim_plan/personReview.zml b/zhiqim_plan/resource/zview/zhiqim_plan/personReview.zml new file mode 100644 index 0000000..306668d --- /dev/null +++ b/zhiqim_plan/resource/zview/zhiqim_plan/personReview.zml @@ -0,0 +1,104 @@ +<#def designatedPath="/zhiqim_plan/personMonth.htm"/> +<#function on_textarea(planTypeName, planRows)> +rows="${planRows}" data-rows="${planRows}" spellcheck="false" readonly + + + +${zhiqim_manager_breadcrumb ("我的计划总结")} +${zhiqim_manager_content()} +<#-- 导航 --> +
            + +
            + + + + + + + +
            ${operator.getOperatorName()}(${operator.getOperatorCode()})的 [${year}${month}月] 计划和总结
            + +<#for item : weekList> + + + + + + + + + + + + + + +<#for model : item.getPlanList()> +<#if model_index gt 0> + + + + + + + + +<#for model : item.getDayList()> + + + + + + + + + + + + + + + + +
            日期名称计划总结项计划状态
            + ${item.getWeekBegin()}



            ${item.getWeekEnd()} +
            + 1 + + <#if item.getFirstPlan().getStatus() == 0>正常 + <#if item.getFirstPlan().getStatus() == 1>新增 + <#if item.getFirstPlan().getStatus() == 2>延误 + <#if item.getFirstPlan().getStatus() == 3>取消 + +
            ${model_index+1} + <#if model.getStatus() == 0>正常 + <#if model.getStatus() == 1>新增 + <#if model.getStatus() == 2>延误 + <#if model.getStatus() == 3>取消 +
            ${model.getWeekString()}
            周总结
            ${year}-${Strings.prefixZero(month, 2)}

            月总结
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_plan/resource/zview/zhiqim_plan/personSetting.zml b/zhiqim_plan/resource/zview/zhiqim_plan/personSetting.zml new file mode 100644 index 0000000..47384ec --- /dev/null +++ b/zhiqim_plan/resource/zview/zhiqim_plan/personSetting.zml @@ -0,0 +1,72 @@ + + +${zhiqim_manager_breadcrumb ("我的汇报设置")} +${zhiqim_manager_content()} + +<#-- 导航 --> +
            + +
            + +<#-- 列表 --> + + + + + + + +<#if list.isEmpty()> +${zhiqim_manager_no_record(4, "暂未设置汇报对象")} + +<#for item : list> + + + + + + + +
            操作员头像操作员编码操作员名称操作
            ${item.getReaderCode()}${item.getReaderName()}
            +${zhiqim_manager_list(list.size())} +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_plan/resource/zview/zhiqim_plan/personSettingSelector.zml b/zhiqim_plan/resource/zview/zhiqim_plan/personSettingSelector.zml new file mode 100644 index 0000000..5cb6dd5 --- /dev/null +++ b/zhiqim_plan/resource/zview/zhiqim_plan/personSettingSelector.zml @@ -0,0 +1,47 @@ + + +<#-- 查询 --> +
            +
            + + +
            +
            + +<#-- 列表 --> +
            + + + + + + + +${zhiqim_manager_tr_no_record(operatorList, 4, "没有可选择的操作员")} +<#for item : operatorList> + + + + + + + +
            操作员头像操作员编码操作员姓名
            ${item.getOperatorCode()}${item.getOperatorName()}
            +
            + +<#-- 操作 --> +
            + + +
            \ No newline at end of file diff --git a/zhiqim_plan/resource/zview/zhiqim_plan/projectMonth.zml b/zhiqim_plan/resource/zview/zhiqim_plan/projectMonth.zml new file mode 100644 index 0000000..4d8e340 --- /dev/null +++ b/zhiqim_plan/resource/zview/zhiqim_plan/projectMonth.zml @@ -0,0 +1,196 @@ +<#function on_textarea(planTypeName, planRows)> +onpropertychange="resize(this)" onkeyup="resize(this)" oninput="resize(this)" ontextinput="resize(this)" placeholder="按下写${planTypeName},按回车键换行" data-rows="${planRows}" maxlength="512" spellcheck="false" + + + +${zhiqim_manager_breadcrumb ("项目月度计划总结")} +${zhiqim_manager_content()} +<#-- 导航 --> +
            + +
            + + + + + + + +
            ${project.getProjectName()} [${year}${month}月] 计划总结
            + +<#for item : weekList> + + + + + + + + + + + + + + + + + + + + +<#for model : item.getPlanList()> + + + + + + + + + + + + + + + + + + + + + + + + +
            日期名称计划计划开始计划完成实际开始实际完成责任人完成进度计划状态
            ${item.getWeekName()}
            计划&总结
            周目标
            ${model_index+1}% + +
            周总结
            ${year}-${Strings.prefixZero(month, 2)}

            月总结
            +${zhiqim_manager_content_end()} \ No newline at end of file diff --git a/zhiqim_plan/src/org/zhiqim/plan/FpmPlanConstants.java b/zhiqim_plan/src/org/zhiqim/plan/FpmPlanConstants.java new file mode 100644 index 0000000..52d4a0c --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/FpmPlanConstants.java @@ -0,0 +1,38 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan; + +/** + * 个人计划总结常量定义 + * + * @version v1.0.0 @author zouzhigang 2017-11-7 新建与整理 + */ +public interface FpmPlanConstants +{ + //项目计划总结类型 + public static final int PJ_PLAN = 0; + public static final int PJ_WEEK_AIM = 1; + public static final int PJ_WEEK_SUM = 2; + public static final int PJ_MONTH_SUM = 3; + + //个人计划总结类型 + public static final int PS_PLAN = 0; + public static final int PS_SUM_DAY = 1; + public static final int PS_SUM_WEEK = 2; + public static final int PS_SUM_MONTH = 3; +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/ZpmPersonPresenter.java b/zhiqim_plan/src/org/zhiqim/plan/ZpmPersonPresenter.java new file mode 100644 index 0000000..aa25749 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/ZpmPersonPresenter.java @@ -0,0 +1,246 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Lists; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.plan.dbo.ZpmPersonPlan; +import org.zhiqim.plan.dbo.ZpmPersonSummary; +import org.zhiqim.project.dbo.ZpmPersonReader; + +/** + * 个人计划总结展示器 + * + * @version v1.0.0 @author zouzhigang 2017-11-7 新建与整理 + */ +@AnAlias("ZpmPersonPresenter") +@AnIntercept("chkZmrLogin") +public class ZpmPersonPresenter +{ + /***********************************************************************************************/ + //汇报增加&删除 + /***********************************************************************************************/ + + /** + * 批量增加汇报对象 + * + * @param request 请求对象 + * @param readerCodes 操作员编码组 + * @throws Exception 异常 + */ + public static void doAddReaders(HttpRequest request, String readerCodes) throws Exception + { + List readerList = Lists.toStringList(readerCodes); + for (String item : readerList) + { + ZpmPersonReader reader = new ZpmPersonReader(); + reader.setOperatorCode(request.getSessionName()); + reader.setReaderCode(item); + + ORM.get(ZTable.class, request).replace(reader); + } + } + + /** + * 删除汇报对象 + * + * @param request 请求对象 + * @param projectId 项目编号 + * @param readerCode 汇报对象编码 + * @throws Exception 异常 + */ + public static void doDeleteReader(HttpRequest request, String readerCode) throws Exception + { + Selector selector = new Selector(); + selector.addMust("operatorCode", request.getSessionName()); + selector.addMust("readerCode", readerCode); + + ORM.get(ZTable.class, request).delete(ZpmPersonReader.class, selector); + } + + /** + * 删除向我汇报的操作员 + * + * @param request 请求对象 + * @param projectId 项目编号 + * @param operatorCode 操作员编码 + * @throws Exception 异常 + */ + public static void doDeleteOperator(HttpRequest request, String operatorCode) throws Exception + { + Selector selector = new Selector(); + selector.addMust("readerCode", request.getSessionName()); + selector.addMust("operatorCode", operatorCode); + + ORM.get(ZTable.class, request).delete(ZpmPersonReader.class, selector); + } + + /***********************************************************************************************/ + //个人计划增加&更新内容&更新状态&删除 + /***********************************************************************************************/ + + /** + * 增加个人工作计划 + * + * @param request 请求 + * @param date 周起始日期 + * @param status 计划状态 + * @param content 计划内容 + * @throws Exception 异常 + */ + public static void doAddPersonPlan(HttpRequest request, int date, int status, String content) throws Exception + { + //1.先取出最大的sequence + Selector selector = new Selector("planSeq"); + selector.addMust("operatorCode", request.getSessionName()); + selector.addMust("planDate", date); + selector.addOrderbyDesc("planSeq"); + ZpmPersonPlan item = ORM.get(ZTable.class, request).item(ZpmPersonPlan.class, selector); + + //2.插入到数据库 + ZpmPersonPlan plan = new ZpmPersonPlan(); + plan.setOperatorCode(request.getSessionName()); + plan.setPlanId(Ids.longId()); + plan.setPlanDate(date); + plan.setPlanStatus(status); + plan.setPlanSeq((item == null)?1:item.getPlanSeq()+1); + plan.setPlanContent(content); + plan.setPlanModified(Sqls.nowTimestamp()); + + ORM.get(ZTable.class, request).insert(plan); + } + + /** + * 更新个人工作计划 + * + * @param request 请求 + * @param id 计划编号 + * @param date 周起始日期 + * @param content 计划内容 + * @throws Exception 异常 + */ + public static void doUpdatePersonPlan(HttpRequest request, long id, int date, String content) throws Exception + { + if (id == 0) + {//新增,默认状态正常 + doAddPersonPlan(request, date, 0, content); + return; + } + + //修改 + Updater updater = new Updater(); + updater.addMust("planId", id); + updater.addField("planModified", Sqls.nowTimestamp()); + updater.addField("planContent", content); + + ORM.get(ZTable.class, request).update(ZpmPersonPlan.class, updater); + } + + /** + * 更新个人工作总结 + * + * @param request 请求 + * @param id 计划编号 + * @param date 周起始日期 + * @param status 计划状态 + * @throws Exception 异常 + */ + public static void doUpdatePersonPlanStatus(HttpRequest request, long id, int date, int status) throws Exception + { + if (id == 0) + {//新增,默认内容为null + doAddPersonPlan(request, date, status, null); + return; + } + + //修改 + Updater updater = new Updater(); + updater.addMust("planId", id); + updater.addField("planModified", Sqls.nowTimestamp()); + updater.addField("planStatus", status); + + ORM.get(ZTable.class, request).update(ZpmPersonPlan.class, updater); + } + + /** + * 删除个人工作计划 + * + * @param request 请求 + * @param id 计划编号 + * @throws Exception 异常 + */ + public static void doDeletePersonPlan(HttpRequest request, long id) throws Exception + { + ORM.get(ZTable.class, request).delete(ZpmPersonPlan.class, id); + } + + /***********************************************************************************************/ + //个人总结更新(无则插入,有则更新) + /***********************************************************************************************/ + + + /** + * 更新个人工作总结 + * + * @param request 请求 + * @param type 总结类型 + * @param date 总结日期 + * @param content 总结内容 + * @throws Exception 异常 + */ + public static void doUpdatePersonSummary(HttpRequest request, int type, int date, String content) throws Exception + { + Selector selector = new Selector("summaryId"); + selector.addMust("operatorCode", request.getSessionName()); + selector.addMust("summaryType", type); + selector.addMust("summaryDate", date); + ZpmPersonSummary item = ORM.get(ZTable.class, request).item(ZpmPersonSummary.class, selector); + + if (item == null) + {//不存在则增加 + item = new ZpmPersonSummary(); + item.setOperatorCode(request.getSessionName()); + item.setSummaryId(Ids.longId()); + item.setSummaryType(type); + item.setSummaryDate(date); + item.setSummaryModified(Sqls.nowTimestamp()); + item.setSummaryContent(content); + + ORM.get(ZTable.class, request).insert(item); + } + else + { + Updater updater = new Updater(); + updater.addMust("summaryId", item.getSummaryId()); + updater.addField("summaryModified", Sqls.nowTimestamp()); + updater.addField("summaryContent", content); + + ORM.get(ZTable.class, request).update(ZpmPersonSummary.class, updater); + } + } +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/ZpmProjectPresenter.java b/zhiqim_plan/src/org/zhiqim/plan/ZpmProjectPresenter.java new file mode 100644 index 0000000..fd5857c --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/ZpmProjectPresenter.java @@ -0,0 +1,248 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.annotation.AnIntercept; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.kernel.util.Ints; +import org.zhiqim.kernel.util.Sqls; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.orm.dbo.Updater; +import org.zhiqim.plan.dbo.ZpmProjectPlan; +import org.zhiqim.plan.dbo.ZpmProjectSummary; +import org.zhiqim.project.ZpmMemberDao; +import org.zhiqim.project.ZpmProjectDao; + +/** + * 项目计划总结展示器 + * + * @version v1.0.0 @author zouzhigang 2017-11-7 新建与整理 + */ +@AnAlias("ZpmProjectPresenter") +@AnIntercept("chkZmrLogin") +public class ZpmProjectPresenter +{ + /***********************************************************************************************/ + //项目计划增加&更新内容&更新状态&删除 + /***********************************************************************************************/ + + /** + * 增加项目工作计划 + * + * @param request 请求 + * @param date 周起始日期 + * @param status 计划状态 + * @param content 计划内容 + * @throws Exception 异常 + */ + public static void doAddProjectPlan(HttpRequest request, long id, int date, String type, String value) throws Exception + { + if (id == 0) + id = Ids.longId(); + + ZpmProjectPlan plan = new ZpmProjectPlan(); + if ("planStatus".equals(type)) + plan.setPlanStatus(Ints.toInt(value)); + else if ("planBeginDate".equals(type)) + plan.setPlanBeginDate(value); + else if ("planEndDate".equals(type)) + plan.setPlanEndDate(value); + else if ("actualBeginDate".equals(type)) + plan.setActualBeginDate(value); + else if ("actualEndDate".equals(type)) + plan.setActualEndDate(value); + else if ("planManager".equals(type)) + plan.setPlanManager(value); + else if ("planProgress".equals(type)) + plan.setPlanProgress(Ints.toInt(value)); + else if ("planContent".equals(type)) + plan.setPlanContent(value); + else + { + request.setResponseError("类型不正确"); + return; + } + + plan.setProjectId(ZpmProjectDao.getProjectId(request)); + plan.setPlanId(id); + plan.setPlanDate(date); + plan.setPlanModified(Sqls.nowTimestamp()); + + //1.先取出最大的sequence + Selector selector = new Selector("planSeq"); + selector.addMust("projectId", ZpmProjectDao.getProjectId(request)); + selector.addMust("planDate", date); + selector.addOrderbyDesc("planSeq"); + ZpmProjectPlan item = ORM.get(ZTable.class, request).item(ZpmProjectPlan.class, selector); + + //2.+1设置到新的sequence + plan.setPlanSeq((item == null)?1:item.getPlanSeq()+1); + + ORM.get(ZTable.class, request).insert(plan); + + ZpmMemberDao.report(request, ZpmProjectDao.getProjectId(request), request.getSessionName(), "增加了计划", plan.getPlanContent()); + } + + /** + * 更新项目工作计划 + * + * @param request 请求 + * @param id 计划编号 + * @param date 周起始日期 + * @param content 计划内容 + * @throws Exception 异常 + */ + public static void doUpdateProjectPlan(HttpRequest request, long id, int date, String type, String value) throws Exception + { + ZpmProjectPlan plan = ORM.get(ZTable.class, request).item(ZpmProjectPlan.class, id); + if (plan == null) + {//新增,默认状态正常 + doAddProjectPlan(request, id, date, type, value); + return; + } + + //修改指定值 + Updater updater = new Updater(); + if ("planStatus".equals(type)) + updater.addField("planStatus", Ints.toInt(value)); + else if ("planBeginDate".equals(type)) + updater.addField("planBeginDate", value); + else if ("planEndDate".equals(type)) + updater.addField("planEndDate", value); + else if ("actualBeginDate".equals(type)) + updater.addField("actualBeginDate", value); + else if ("actualEndDate".equals(type)) + updater.addField("actualEndDate", value); + else if ("planManager".equals(type)) + updater.addField("planManager", value); + else if ("planProgress".equals(type)) + updater.addField("planProgress", Ints.toInt(value)); + else if ("planContent".equals(type)) + updater.addField("planContent", value); + else + { + request.setResponseError("类型不正确"); + return; + } + + updater.addMust("planId", id); + updater.addField("planModified", Sqls.nowTimestamp()); + + ORM.get(ZTable.class, request).update(ZpmProjectPlan.class, updater); + + ZpmMemberDao.report(request, ZpmProjectDao.getProjectId(request), request.getSessionName(), "修改了计划", plan.getPlanContent()); + } + + /** + * 更新项目工作总结 + * + * @param request 请求 + * @param id 计划编号 + * @param date 周起始日期 + * @param status 计划状态 + * @throws Exception 异常 + */ + public static void doUpdateProjectPlanStatus(HttpRequest request, long id, int date, int status) throws Exception + { + ZpmProjectPlan plan = ORM.get(ZTable.class, request).item(ZpmProjectPlan.class, id); + if (plan == null) + {//新增,默认内容为null + doAddProjectPlan(request, id, date, "planStatus", ""+status); + return; + } + + //修改状态 + Updater updater = new Updater(); + updater.addMust("planId", id); + updater.addField("planModified", Sqls.nowTimestamp()); + updater.addField("planStatus", status); + + ORM.get(ZTable.class, request).update(ZpmProjectPlan.class, updater); + + ZpmMemberDao.report(request, ZpmProjectDao.getProjectId(request), request.getSessionName(), "修改了计划状态", plan.getPlanContent()); + } + + /** + * 删除项目工作计划 + * + * @param request 请求 + * @param id 计划编号 + * @throws Exception 异常 + */ + public static void doDeleteProjectPlan(HttpRequest request, long id) throws Exception + { + ZpmProjectPlan plan = ORM.get(ZTable.class, request).item(ZpmProjectPlan.class, id); + + ORM.get(ZTable.class, request).delete(ZpmProjectPlan.class, id); + + ZpmMemberDao.report(request, ZpmProjectDao.getProjectId(request), request.getSessionName(), "删除了项目计划", plan.getPlanContent()); + } + + /***********************************************************************************************/ + //项目总结更新(无则插入,有则更新) + /***********************************************************************************************/ + + + /** + * 更新项目工作总结 + * + * @param request 请求 + * @param type 总结类型 + * @param date 总结日期 + * @param content 总结内容 + * @throws Exception 异常 + */ + public static void doUpdateProjectSummary(HttpRequest request, int type, int date, String content) throws Exception + { + Selector selector = new Selector("summaryId"); + selector.addMust("projectId", ZpmProjectDao.getProjectId(request)); + selector.addMust("summaryType", type); + selector.addMust("summaryDate", date); + ZpmProjectSummary item = ORM.get(ZTable.class, request).item(ZpmProjectSummary.class, selector); + + if (item == null) + {//不存在则增加 + item = new ZpmProjectSummary(); + item.setProjectId(ZpmProjectDao.getProjectId(request)); + item.setSummaryId(Ids.longId()); + item.setSummaryType(type); + item.setSummaryDate(date); + item.setSummaryModified(Sqls.nowTimestamp()); + item.setSummaryContent(content); + + ORM.get(ZTable.class, request).insert(item); + + ZpmMemberDao.report(request, ZpmProjectDao.getProjectId(request), request.getSessionName(), "增加了总结", item.getSummaryContent()); + } + else + { + Updater updater = new Updater(); + updater.addMust("summaryId", item.getSummaryId()); + updater.addField("summaryModified", Sqls.nowTimestamp()); + updater.addField("summaryContent", content); + + ORM.get(ZTable.class, request).update(ZpmProjectSummary.class, updater); + + ZpmMemberDao.report(request, ZpmProjectDao.getProjectId(request), request.getSessionName(), "修改了总结", item.getSummaryContent()); + } + } +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/action/PersonMonthAction.java b/zhiqim_plan/src/org/zhiqim/plan/action/PersonMonthAction.java new file mode 100644 index 0000000..0db1b46 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/action/PersonMonthAction.java @@ -0,0 +1,240 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.action; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.calendar.ZmrCalendarDao; +import org.zhiqim.calendar.model.CalendarWeekModel; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.plan.FpmPlanConstants; +import org.zhiqim.plan.dbo.ZpmPersonPlan; +import org.zhiqim.plan.dbo.ZpmPersonSummary; +import org.zhiqim.plan.model.PersonDayModel; +import org.zhiqim.plan.model.PersonModel; +import org.zhiqim.plan.model.PersonPlanModel; +import org.zhiqim.plan.model.PersonWeekModel; + +/** + * 个人计划总结月表 + * + * @version v1.0.0 @author zouzhigang 2017-11-2 新建与整理 + */ +public class PersonMonthAction implements Action, FpmPlanConstants +{ + @Override + public void execute(HttpRequest request) throws Exception + { + String operatorCode = request.getSessionName(); + person(request, operatorCode); + } + + public static void person(HttpRequest request, String operatorCode) throws Exception + { + //第一步,从页面中读出当前年月,并根据上下月参数找到对应的年月 + int year = request.getParameterInt("year", DateTimes.getCurrentYear()); + int month = request.getParameterInt("month", DateTimes.getCurrentMonth()); + + boolean isPrev = request.getParameterBoolean("prev"); + boolean isNext = request.getParameterBoolean("next"); + + if (isPrev) + { + year = month==1?year-1:year; + month = month==1?12:month-1; + } + else if (isNext) + { + year = month==12?year+1:year; + month = month==12?1:month+1; + } + + //第二步,查出上个月,当前月和下个月的个人计划&总结 + int prevYear = month==1?year-1:year; + int prevMonth = month==1?12:month-1; + + int nextYear = month==12?year+1:year; + int nextMonth = month==12?1:month+1; + + Selector selector = new Selector(); + selector.addMust("operatorCode", operatorCode); + selector.addMustThenG("planDate", prevYear * 10000 + prevMonth * 100); + selector.addMustThenL("planDate", nextYear * 10000 + (nextMonth+1) * 100); + List planList = ORM.get(ZTable.class, request).list(ZpmPersonPlan.class, selector); + + Selector selector2 = new Selector(); + selector2.addMust("operatorCode", operatorCode); + selector2.addMustThenG("summaryDate", prevYear * 10000 + prevMonth * 100); + selector2.addMustThenL("summaryDate", nextYear * 10000 + (nextMonth+1) * 100); + List summaryList = ORM.get(ZTable.class, request).list(ZpmPersonSummary.class, selector2); + + //第三步,组装有效周列表 + List weekList = new ArrayList<>(); + for (CalendarWeekModel week : ZmrCalendarDao.getCalendarWeekList(request, year, month)) + { + weekList.add(new PersonWeekModel(week)); + } + + /******************************************************************************/ + //以下为内容填充 + /******************************************************************************/ + + //第四步,找到周下面所有的计划 + for (PersonWeekModel week : weekList) + { + CalendarWeekModel key = week.getKey(); + List pList = getPlan(planList, key.getBeginDate(), key.getEndDate()); + if (pList.isEmpty()) + {//没有计划,则插入一个空项计划 + PersonPlanModel model = new PersonPlanModel(); + model.setDate(key.getBeginDate()); + model.setSeq(1); + + week.addPlanModel(model); + } + else + {//有则用计划表 + for (ZpmPersonPlan plan : pList) + { + PersonPlanModel model = new PersonPlanModel(); + model.setId(plan.getPlanId()); + model.setDate(plan.getPlanDate()); + model.setSeq(plan.getPlanSeq()); + model.setStatus(plan.getPlanStatus()); + model.setContent(plan.getPlanContent()); + + week.addPlanModel(model); + } + } + } + + //第五步,生成日总结 + for (PersonWeekModel week : weekList) + { + CalendarWeekModel key = week.getKey(); + int beginDate = key.getBeginDate(); + int endDate = key.getEndDate(); + for (int date=beginDate;date<=endDate;date=DateTimes.getNextDateInt(date)) + { + PersonDayModel model = new PersonDayModel(); + model.setDate(date); + model.setWeek(DateTimes.getDateWeek7(date)); + + ZpmPersonSummary summary = getPersonSummary(summaryList, date, PS_SUM_DAY); + if (summary != null) + { + model.setId(summary.getSummaryId()); + model.setContent(summary.getSummaryContent()); + } + + week.addDayModel(model); + } + } + + //第六步,生成周总结 + for (PersonWeekModel week : weekList) + { + CalendarWeekModel key = week.getKey(); + PersonModel model = new PersonModel(); + model.setType(PS_SUM_WEEK); + model.setDate(key.getBeginDate()); + + ZpmPersonSummary summary = getWeekSummary(summaryList, key.getBeginDate(), key.getEndDate()); + if (summary != null) + { + model.setId(summary.getSummaryId()); + model.setContent(summary.getSummaryContent()); + } + + week.setWeek(model); + } + + //第七步,生成月总结 + int monthDate = year * 10000 + month * 100 + 1; + + PersonModel monthModel = new PersonModel(); + monthModel.setType(PS_SUM_MONTH); + monthModel.setDate(monthDate); + + ZpmPersonSummary summary = getPersonSummary(summaryList, monthDate, PS_SUM_MONTH); + if (summary != null) + { + monthModel.setId(summary.getSummaryId()); + monthModel.setContent(summary.getSummaryContent()); + } + + request.setAttribute("year", year); + request.setAttribute("month", month); + request.setAttribute("weekList", weekList); + request.setAttribute("monthModel", monthModel); + } + + /*********************************************************************************************************/ + //内部实现方法 + /*********************************************************************************************************/ + + /** 找出本周的计划 */ + private static List getPlan(List planList, int beginDate, int endDate) + { + List pList = new ArrayList<>(); + for (ZpmPersonPlan item : planList) + { + if (item.getPlanDate() < beginDate || item.getPlanDate() > endDate) + continue; + + pList.add(item); + } + + return pList; + } + + /** 找出本周的总结 */ + private static ZpmPersonSummary getWeekSummary(List planList, int beginDate, int endDate) + { + for (ZpmPersonSummary item : planList) + { + if (item.getSummaryType() != PS_SUM_WEEK) + continue; + + if (item.getSummaryDate() < beginDate || item.getSummaryDate() > endDate) + continue; + + return item; + } + + return null; + } + + /** 找出类型和日期对应的总结 */ + private static ZpmPersonSummary getPersonSummary(List summaryList, int date, int type) + { + for (ZpmPersonSummary item : summaryList) + { + if (item.getSummaryDate() == date && item.getSummaryType() == type) + return item; + } + + return null; + } +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/action/PersonReaderAction.java b/zhiqim_plan/src/org/zhiqim/plan/action/PersonReaderAction.java new file mode 100644 index 0000000..fa497f2 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/action/PersonReaderAction.java @@ -0,0 +1,43 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.action; + +import java.util.List; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZView; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.project.dbo.ZpmPersonReaderEx; + +/** + * 向我汇报的成员列表 + * + * @version v1.0.0 @author zouzhigang 2017-11-7 新建与整理 + */ +public class PersonReaderAction implements Action +{ + @Override + public void execute(HttpRequest request) throws Exception + { + List list = ORM.get(ZView.class, request).list(ZpmPersonReaderEx.class, new Selector("readerCode", request.getSessionName())); + + request.setAttribute("list", list); + } +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/action/PersonReviewAction.java b/zhiqim_plan/src/org/zhiqim/plan/action/PersonReviewAction.java new file mode 100644 index 0000000..31be008 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/action/PersonReviewAction.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.action; + +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.manager.dbo.ZmrOperator; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.plan.FpmPlanConstants; +import org.zhiqim.project.dbo.ZpmPersonReader; + +/** + * 查看个人计划总结月表 + * + * @version v1.0.0 @author zouzhigang 2017-11-2 新建与整理 + */ +public class PersonReviewAction implements Action, FpmPlanConstants +{ + @Override + public void execute(HttpRequest request) throws Exception + { + String operatorCode = request.getParameter("operatorCode"); + if (Validates.isEmptyBlank(operatorCode)) + { + request.returnHistory("请选择一个成员"); + return; + } + + ZmrOperator operator = ORM.get(ZTable.class, request).item(ZmrOperator.class, operatorCode); + if (operator == null) + { + request.returnHistory("请选择一个有效成员"); + return; + } + + ZpmPersonReader reader = ORM.get(ZTable.class, request).item(ZpmPersonReader.class, operatorCode, request.getSessionName()); + if (reader == null) + { + request.returnHistory("请选择一个有权限的成员"); + return; + } + + request.setAttribute("operator", operator); + + //生成个人计划总结月表 + PersonMonthAction.person(request, operatorCode); + } +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/action/ProjectMonthAction.java b/zhiqim_plan/src/org/zhiqim/plan/action/ProjectMonthAction.java new file mode 100644 index 0000000..48e5c2b --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/action/ProjectMonthAction.java @@ -0,0 +1,263 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.action; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.calendar.ZmrCalendarDao; +import org.zhiqim.calendar.model.CalendarWeekModel; +import org.zhiqim.httpd.HttpRequest; +import org.zhiqim.httpd.context.core.Action; +import org.zhiqim.kernel.util.DateTimes; +import org.zhiqim.kernel.util.Ids; +import org.zhiqim.orm.ORM; +import org.zhiqim.orm.ZTable; +import org.zhiqim.orm.dbo.Selector; +import org.zhiqim.plan.FpmPlanConstants; +import org.zhiqim.plan.dbo.ZpmProjectPlan; +import org.zhiqim.plan.dbo.ZpmProjectSummary; +import org.zhiqim.plan.model.ProjectModel; +import org.zhiqim.plan.model.ProjectPlanModel; +import org.zhiqim.plan.model.ProjectWeekModel; +import org.zhiqim.project.ZpmProjectDao; +import org.zhiqim.project.dbo.ZpmProject; + +/** + * 项目计划总结月表 + * + * @version v1.0.0 @author zouzhigang 2017-11-2 新建与整理 + */ +public class ProjectMonthAction implements Action, FpmPlanConstants +{ + @Override + public void execute(HttpRequest request) throws Exception + { + long projectId = ZpmProjectDao.getProjectId(request); + ZpmProject project = ORM.get(ZTable.class, request).item(ZpmProject.class, projectId); + if(project == null) + { + request.returnHistory("请选择一个有效的项目"); + return; + } + + //第一步,从页面中读出当前年月,并根据上下月参数找到对应的年月 + int year = request.getParameterInt("year", DateTimes.getCurrentYear()); + int month = request.getParameterInt("month", DateTimes.getCurrentMonth()); + + boolean isPrev = request.getParameterBoolean("prev"); + boolean isNext = request.getParameterBoolean("next"); + + if (isPrev) + { + year = month==1?year-1:year; + month = month==1?12:month-1; + } + else if (isNext) + { + year = month==12?year+1:year; + month = month==12?1:month+1; + } + + //第二步,查出上个月,当前月和下个月的个人计划&总结 + int prevYear = month==1?year-1:year; + int prevMonth = month==1?12:month-1; + + int nextYear = month==12?year+1:year; + int nextMonth = month==12?1:month+1; + + Selector selector = new Selector(); + selector.addMust("projectId", projectId); + selector.addMustThenG("planDate", prevYear * 10000 + prevMonth * 100); + selector.addMustThenL("planDate", nextYear * 10000 + (nextMonth+1) * 100); + List planList = ORM.get(ZTable.class, request).list(ZpmProjectPlan.class, selector); + + Selector selector2 = new Selector(); + selector2.addMust("projectId", projectId); + selector2.addMustThenG("summaryDate", prevYear * 10000 + prevMonth * 100); + selector2.addMustThenL("summaryDate", nextYear * 10000 + (nextMonth+1) * 100); + List summaryList = ORM.get(ZTable.class, request).list(ZpmProjectSummary.class, selector2); + + //第三步,组装有效周列表 + List weekList = new ArrayList<>(); + for (CalendarWeekModel week : ZmrCalendarDao.getCalendarWeekList(request, year, month)) + { + weekList.add(new ProjectWeekModel(week)); + } + + /******************************************************************************/ + //以下为内容填充 + /******************************************************************************/ + + //第四步,找到周下面所有的计划 + for (ProjectWeekModel week : weekList) + { + CalendarWeekModel key = week.getKey(); + List pList = getPlan(planList, key.getBeginDate(), key.getEndDate()); + if (pList.isEmpty()) + {//没有计划,则插入一个空项计划 + ProjectPlanModel model = new ProjectPlanModel(); + model.setId(Ids.longId()); + model.setDate(key.getBeginDate()); + model.setPlanSeq(1); + + week.addPlanModel(model); + } + else + {//有则用计划表 + for (ZpmProjectPlan plan : pList) + { + ProjectPlanModel model = new ProjectPlanModel(); + model.setId(plan.getPlanId()); + model.setDate(plan.getPlanDate()); + model.setContent(plan.getPlanContent()); + + model.setPlanSeq(plan.getPlanSeq()); + model.setPlanStatus(plan.getPlanStatus()); + model.setPlanBeginDate(plan.getPlanBeginDate()); + model.setPlanEndDate(plan.getPlanEndDate()); + model.setActualBeginDate(plan.getActualBeginDate()); + model.setActualEndDate(plan.getActualEndDate()); + model.setPlanManager(plan.getPlanManager()); + model.setPlanProgress(plan.getPlanProgress()); + + week.addPlanModel(model); + } + } + } + + //第五步,生成周目标&周总结 + for (ProjectWeekModel week : weekList) + { + CalendarWeekModel key = week.getKey(); + + //周目标 + ProjectModel aModel = new ProjectModel(); + aModel.setType(PJ_WEEK_AIM); + aModel.setDate(key.getBeginDate()); + + ZpmProjectSummary summary = getWeekAim(summaryList, key.getBeginDate(), key.getEndDate()); + if (summary != null) + { + aModel.setId(summary.getSummaryId()); + aModel.setContent(summary.getSummaryContent()); + } + + week.setWeekAim(aModel); + + //周总结 + ProjectModel sModel = new ProjectModel(); + sModel.setType(PJ_WEEK_SUM); + sModel.setDate(key.getBeginDate()); + + summary = getWeekSummary(summaryList, key.getBeginDate(), key.getEndDate()); + if (summary != null) + { + sModel.setId(summary.getSummaryId()); + sModel.setContent(summary.getSummaryContent()); + } + + week.setWeekSummary(sModel); + } + + //第六步,生成月总结 + int monthDate = year * 10000 + month * 100 + 1; + + ProjectModel monthModel = new ProjectModel(); + monthModel.setType(PJ_MONTH_SUM); + monthModel.setDate(monthDate); + + ZpmProjectSummary summary = getProjectSummary(summaryList, monthDate, PJ_MONTH_SUM); + if (summary != null) + { + monthModel.setId(summary.getSummaryId()); + monthModel.setContent(summary.getSummaryContent()); + } + + request.setAttribute("project", project); + request.setAttribute("year", year); + request.setAttribute("month", month); + request.setAttribute("weekList", weekList); + request.setAttribute("monthModel", monthModel); + } + + /*********************************************************************************************************/ + //内部实现方法 + /*********************************************************************************************************/ + + /** 找出本周的计划 */ + private static List getPlan(List planList, int beginDate, int endDate) + { + List pList = new ArrayList<>(); + for (ZpmProjectPlan item : planList) + { + if (item.getPlanDate() < beginDate || item.getPlanDate() > endDate) + continue; + + pList.add(item); + } + + return pList; + } + + /** 找出本周的目标 */ + private static ZpmProjectSummary getWeekAim(List planList, int beginDate, int endDate) + { + for (ZpmProjectSummary item : planList) + { + if (item.getSummaryType() != PJ_WEEK_AIM) + continue; + + if (item.getSummaryDate() < beginDate || item.getSummaryDate() > endDate) + continue; + + return item; + } + + return null; + } + + /** 找出本周的总结 */ + private static ZpmProjectSummary getWeekSummary(List planList, int beginDate, int endDate) + { + for (ZpmProjectSummary item : planList) + { + if (item.getSummaryType() != PJ_WEEK_SUM) + continue; + + if (item.getSummaryDate() < beginDate || item.getSummaryDate() > endDate) + continue; + + return item; + } + + return null; + } + + /** 找出类型和日期对应的总结 */ + private static ZpmProjectSummary getProjectSummary(List summaryList, int date, int type) + { + for (ZpmProjectSummary item : summaryList) + { + if (item.getSummaryDate() == date && item.getSummaryType() == type) + return item; + } + + return null; + } +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/dbo/ZpmPersonPlan.java b/zhiqim_plan/src/org/zhiqim/plan/dbo/ZpmPersonPlan.java new file mode 100644 index 0000000..c6bf715 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/dbo/ZpmPersonPlan.java @@ -0,0 +1,120 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 个人计划表 对应表《ZPM_PERSON_PLAN》 + */ +@AnAlias("ZpmPersonPlan") +@AnTable(table="ZPM_PERSON_PLAN", key="PLAN_ID", type="InnoDB") +public class ZpmPersonPlan implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="OPERATOR_CODE", type="string,32", notNull=true) private String operatorCode; //1.操作员编号 + @AnTableField(column="PLAN_ID", type="long", notNull=true) private long planId; //2.计划编号 + @AnTableField(column="PLAN_DATE", type="int", notNull=true) private int planDate; //3.计划日期,格式yyyyMMdd,如20171101 + @AnTableField(column="PLAN_STATUS", type="byte", notNull=true) private int planStatus; //4.计划状态,0:正常,1:新增,2:延误,3:取消 + @AnTableField(column="PLAN_SEQ", type="byte", notNull=true) private int planSeq; //5.计划序号,从1开始,周内排序 + @AnTableField(column="PLAN_MODIFIED", type="datetime", notNull=true) private Timestamp planModified; //6.计划最后更新时间 + @AnTableField(column="PLAN_CONTENT", type="string,256", notNull=false) private String planContent; //7.计划内容 + + public String toString() + { + return Jsons.toString(this); + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getPlanId() + { + return planId; + } + + public void setPlanId(long planId) + { + this.planId = planId; + } + + public int getPlanDate() + { + return planDate; + } + + public void setPlanDate(int planDate) + { + this.planDate = planDate; + } + + public int getPlanStatus() + { + return planStatus; + } + + public void setPlanStatus(int planStatus) + { + this.planStatus = planStatus; + } + + public int getPlanSeq() + { + return planSeq; + } + + public void setPlanSeq(int planSeq) + { + this.planSeq = planSeq; + } + + public Timestamp getPlanModified() + { + return planModified; + } + + public void setPlanModified(Timestamp planModified) + { + this.planModified = planModified; + } + + public String getPlanContent() + { + return planContent; + } + + public void setPlanContent(String planContent) + { + this.planContent = planContent; + } + +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/dbo/ZpmPersonSummary.java b/zhiqim_plan/src/org/zhiqim/plan/dbo/ZpmPersonSummary.java new file mode 100644 index 0000000..48d66c0 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/dbo/ZpmPersonSummary.java @@ -0,0 +1,109 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 个人总结表 对应表《ZPM_PERSON_SUMMARY》 + */ +@AnAlias("ZpmPersonSummary") +@AnTable(table="ZPM_PERSON_SUMMARY", key="SUMMARY_ID", type="InnoDB") +public class ZpmPersonSummary implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="OPERATOR_CODE", type="string,32", notNull=true) private String operatorCode; //1.操作员编号 + @AnTableField(column="SUMMARY_ID", type="long", notNull=true) private long summaryId; //2.总结编号 + @AnTableField(column="SUMMARY_TYPE", type="byte", notNull=true) private int summaryType; //3.总结类型,1:日总结,2:周总结,3:月总结 + @AnTableField(column="SUMMARY_DATE", type="int", notNull=true) private int summaryDate; //4.总结日期,格式yyyyMMdd,如20171101 + @AnTableField(column="SUMMARY_MODIFIED", type="datetime", notNull=true) private Timestamp summaryModified; //5.总结最后更新时间 + @AnTableField(column="SUMMARY_CONTENT", type="string,1000", notNull=false) private String summaryContent; //6.总结内容,最长1000字 + + public String toString() + { + return Jsons.toString(this); + } + + public String getOperatorCode() + { + return operatorCode; + } + + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public long getSummaryId() + { + return summaryId; + } + + public void setSummaryId(long summaryId) + { + this.summaryId = summaryId; + } + + public int getSummaryType() + { + return summaryType; + } + + public void setSummaryType(int summaryType) + { + this.summaryType = summaryType; + } + + public int getSummaryDate() + { + return summaryDate; + } + + public void setSummaryDate(int summaryDate) + { + this.summaryDate = summaryDate; + } + + public Timestamp getSummaryModified() + { + return summaryModified; + } + + public void setSummaryModified(Timestamp summaryModified) + { + this.summaryModified = summaryModified; + } + + public String getSummaryContent() + { + return summaryContent; + } + + public void setSummaryContent(String summaryContent) + { + this.summaryContent = summaryContent; + } + +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/dbo/ZpmProjectPlan.java b/zhiqim_plan/src/org/zhiqim/plan/dbo/ZpmProjectPlan.java new file mode 100644 index 0000000..950eab8 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/dbo/ZpmProjectPlan.java @@ -0,0 +1,186 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 项目计划表 对应表《ZPM_PROJECT_PLAN》 + */ +@AnAlias("ZpmProjectPlan") +@AnTable(table="ZPM_PROJECT_PLAN", key="PLAN_ID", type="InnoDB") +public class ZpmProjectPlan implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="PROJECT_ID", type="long", notNull=true) private long projectId; //1.项目编号 + @AnTableField(column="PLAN_ID", type="long", notNull=true) private long planId; //2.计划编号 + @AnTableField(column="PLAN_DATE", type="int", notNull=true) private int planDate; //3.计划日期,格式yyyyMMdd,如20171101 + @AnTableField(column="PLAN_STATUS", type="byte", notNull=true) private int planStatus; //4.计划状态,0:正常,1:新增,2:延误,3:取消 + @AnTableField(column="PLAN_SEQ", type="byte", notNull=true) private int planSeq; //5.计划序号,从1开始,周内排序 + @AnTableField(column="PLAN_PROGRESS", type="byte", notNull=true) private int planProgress; //6.计划进度,0-100 + @AnTableField(column="PLAN_MODIFIED", type="datetime", notNull=true) private Timestamp planModified; //7.计划更新时间 + @AnTableField(column="PLAN_CONTENT", type="string,128", notNull=false) private String planContent; //8.计划内容 + @AnTableField(column="PLAN_MANAGER", type="string,32", notNull=false) private String planManager; //9.计划负责人,多个用逗号隔开 + @AnTableField(column="PLAN_BEGIN_DATE", type="string,10,char", notNull=false) private String planBeginDate; //10.计划开始日期 + @AnTableField(column="PLAN_END_DATE", type="string,10,char", notNull=false) private String planEndDate; //11.计划结束日期 + @AnTableField(column="ACTUAL_BEGIN_DATE", type="string,10,char", notNull=false) private String actualBeginDate; //12.实际开始日期 + @AnTableField(column="ACTUAL_END_DATE", type="string,10,char", notNull=false) private String actualEndDate; //13.实际结束日期 + + public String toString() + { + return Jsons.toString(this); + } + + public long getProjectId() + { + return projectId; + } + + public void setProjectId(long projectId) + { + this.projectId = projectId; + } + + public long getPlanId() + { + return planId; + } + + public void setPlanId(long planId) + { + this.planId = planId; + } + + public int getPlanDate() + { + return planDate; + } + + public void setPlanDate(int planDate) + { + this.planDate = planDate; + } + + public int getPlanStatus() + { + return planStatus; + } + + public void setPlanStatus(int planStatus) + { + this.planStatus = planStatus; + } + + public int getPlanSeq() + { + return planSeq; + } + + public void setPlanSeq(int planSeq) + { + this.planSeq = planSeq; + } + + public int getPlanProgress() + { + return planProgress; + } + + public void setPlanProgress(int planProgress) + { + this.planProgress = planProgress; + } + + public Timestamp getPlanModified() + { + return planModified; + } + + public void setPlanModified(Timestamp planModified) + { + this.planModified = planModified; + } + + public String getPlanContent() + { + return planContent; + } + + public void setPlanContent(String planContent) + { + this.planContent = planContent; + } + + public String getPlanManager() + { + return planManager; + } + + public void setPlanManager(String planManager) + { + this.planManager = planManager; + } + + public String getPlanBeginDate() + { + return planBeginDate; + } + + public void setPlanBeginDate(String planBeginDate) + { + this.planBeginDate = planBeginDate; + } + + public String getPlanEndDate() + { + return planEndDate; + } + + public void setPlanEndDate(String planEndDate) + { + this.planEndDate = planEndDate; + } + + public String getActualBeginDate() + { + return actualBeginDate; + } + + public void setActualBeginDate(String actualBeginDate) + { + this.actualBeginDate = actualBeginDate; + } + + public String getActualEndDate() + { + return actualEndDate; + } + + public void setActualEndDate(String actualEndDate) + { + this.actualEndDate = actualEndDate; + } + +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/dbo/ZpmProjectSummary.java b/zhiqim_plan/src/org/zhiqim/plan/dbo/ZpmProjectSummary.java new file mode 100644 index 0000000..b570885 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/dbo/ZpmProjectSummary.java @@ -0,0 +1,109 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.dbo; + +import java.io.Serializable; +import java.sql.Timestamp; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.orm.annotation.AnTable; +import org.zhiqim.orm.annotation.AnTableField; + +/** + * 项目总结表 对应表《ZPM_PROJECT_SUMMARY》 + */ +@AnAlias("ZpmProjectSummary") +@AnTable(table="ZPM_PROJECT_SUMMARY", key="SUMMARY_ID", type="InnoDB") +public class ZpmProjectSummary implements Serializable +{ + private static final long serialVersionUID = 1L; + + @AnTableField(column="PROJECT_ID", type="long", notNull=true) private long projectId; //1.项目编号 + @AnTableField(column="SUMMARY_ID", type="long", notNull=true) private long summaryId; //2.总结编号 + @AnTableField(column="SUMMARY_TYPE", type="byte", notNull=true) private int summaryType; //3.总结类型,1:周目标,2:周总结,3:月总结 + @AnTableField(column="SUMMARY_DATE", type="int", notNull=true) private int summaryDate; //4.总结日期,格式yyyyMMdd,如20171101 + @AnTableField(column="SUMMARY_MODIFIED", type="datetime", notNull=true) private Timestamp summaryModified; //5.总结最后更新时间 + @AnTableField(column="SUMMARY_CONTENT", type="string,1000", notNull=false) private String summaryContent; //6.总结内容,最长1000字 + + public String toString() + { + return Jsons.toString(this); + } + + public long getProjectId() + { + return projectId; + } + + public void setProjectId(long projectId) + { + this.projectId = projectId; + } + + public long getSummaryId() + { + return summaryId; + } + + public void setSummaryId(long summaryId) + { + this.summaryId = summaryId; + } + + public int getSummaryType() + { + return summaryType; + } + + public void setSummaryType(int summaryType) + { + this.summaryType = summaryType; + } + + public int getSummaryDate() + { + return summaryDate; + } + + public void setSummaryDate(int summaryDate) + { + this.summaryDate = summaryDate; + } + + public Timestamp getSummaryModified() + { + return summaryModified; + } + + public void setSummaryModified(Timestamp summaryModified) + { + this.summaryModified = summaryModified; + } + + public String getSummaryContent() + { + return summaryContent; + } + + public void setSummaryContent(String summaryContent) + { + this.summaryContent = summaryContent; + } + +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/model/PersonDayModel.java b/zhiqim_plan/src/org/zhiqim/plan/model/PersonDayModel.java new file mode 100644 index 0000000..8cf5588 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/model/PersonDayModel.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.model; + +/** + * 个人日总结模型,在个人计划总结模型上增加星期 + * + * @version v1.0.0 @author zouzhigang 2017-11-8 新建与整理 + */ +public class PersonDayModel extends PersonModel +{ + private int week; + + public int getType() + { + return PS_SUM_DAY; + } + + public int getWeek() + { + return week; + } + + public void setWeek(int week) + { + this.week = week; + } + + public String getWeekString() + { + switch (week) + { + case 1:return "周一"; + case 2:return "周二"; + case 3:return "周三"; + case 4:return "周四"; + case 5:return "周五"; + case 6:return "周六"; + case 7:return "周日"; + } + + return null; + } +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/model/PersonModel.java b/zhiqim_plan/src/org/zhiqim/plan/model/PersonModel.java new file mode 100644 index 0000000..0b9e3e1 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/model/PersonModel.java @@ -0,0 +1,109 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.model; + +import org.zhiqim.plan.FpmPlanConstants; + +/** + * 个人计划总结模型 + * + * @version v1.0.0 @author zouzhigang 2017-11-8 新建与整理 + */ +public class PersonModel implements FpmPlanConstants +{ + private long id; + private int type; + + private int date; + private int year; + private int month; + private int day; + + private String content; + + /***********************************************************/ + //设置标准参数 + /***********************************************************/ + + public void setId(long id) + { + this.id = id; + } + + public void setType(int type) + { + this.type = type; + } + + public void setDate(int date) + { + this.date = date; + + this.year = date / 10000; + this.month = date / 100 % 100; + this.day = date % 10000; + } + + public void setContent(String content) + { + this.content = content; + } + + /***********************************************************/ + //获取标准参数 + /***********************************************************/ + + public long getId() + { + return id; + } + + public int getType() + { + return type; + } + + public int getDate() + { + return date; + } + + public String getContent() + { + return content; + } + + /***********************************************************/ + //获取年月日明细 + /***********************************************************/ + + public int getYear() + { + return year; + } + + public int getMonth() + { + return month; + } + + public int getDay() + { + return day; + } +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/model/PersonPlanModel.java b/zhiqim_plan/src/org/zhiqim/plan/model/PersonPlanModel.java new file mode 100644 index 0000000..5608ab1 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/model/PersonPlanModel.java @@ -0,0 +1,60 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.model; + +public class PersonPlanModel extends PersonModel +{ + private int seq; + private int status; + + public int getType() + { + return PS_PLAN; + } + + public int getSeq() + { + return seq; + } + + public void setSeq(int seq) + { + this.seq = seq; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + public String getColor() + { + switch (status) + { + case 1: return "color:green"; + case 2: return "color:red"; + case 3: return "color:gray"; + default: return "color:#333"; + } + } +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/model/PersonWeekModel.java b/zhiqim_plan/src/org/zhiqim/plan/model/PersonWeekModel.java new file mode 100644 index 0000000..b96b8b6 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/model/PersonWeekModel.java @@ -0,0 +1,103 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.model; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.calendar.model.CalendarWeekModel; + +/** + * 个人计划总结一周模型 + * 1、日历星期KEY + * 2、计划列表 + * 3、日总结列表 + * 4、周总结 + * + * @version v1.0.0 @author zouzhigang 2017-11-8 新建与整理 + */ +public class PersonWeekModel +{ + private CalendarWeekModel key; + + private List planList; + private List dayList; + private PersonModel week; + + public PersonWeekModel(CalendarWeekModel key) + { + this.key = key; + this.planList = new ArrayList<>(); + this.dayList = new ArrayList<>(); + } + + public void addPlanModel(PersonPlanModel model) + { + planList.add(model); + } + + public void addDayModel(PersonDayModel model) + { + dayList.add(model); + } + + public CalendarWeekModel getKey() + { + return key; + } + + public PersonModel getWeek() + { + return week; + } + + public void setWeek(PersonModel week) + { + this.week = week; + } + + public List getPlanList() + { + return planList; + } + + public List getDayList() + { + return dayList; + } + + public int getRowSize() + { + return planList.size() + dayList.size() + 1; + } + + public String getWeekBegin() + { + return key.getWeekBegin(); + } + + public String getWeekEnd() + { + return key.getWeekEnd(); + } + + public PersonPlanModel getFirstPlan() + { + return planList.get(0); + } +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/model/ProjectModel.java b/zhiqim_plan/src/org/zhiqim/plan/model/ProjectModel.java new file mode 100644 index 0000000..7964f7c --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/model/ProjectModel.java @@ -0,0 +1,109 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.model; + +import org.zhiqim.plan.FpmPlanConstants; + +/** + * 项目计划总结模型 + * + * @version v1.0.0 @author zouzhigang 2017-11-8 新建与整理 + */ +public class ProjectModel implements FpmPlanConstants +{ + private long id; + private int type; + + private int date; + private int year; + private int month; + private int day; + + private String content; + + /***********************************************************/ + //设置标准参数 + /***********************************************************/ + + public void setId(long id) + { + this.id = id; + } + + public void setType(int type) + { + this.type = type; + } + + public void setDate(int date) + { + this.date = date; + + this.year = date / 10000; + this.month = date / 100 % 100; + this.day = date % 10000; + } + + public void setContent(String content) + { + this.content = content; + } + + /***********************************************************/ + //获取标准参数 + /***********************************************************/ + + public long getId() + { + return id; + } + + public int getType() + { + return type; + } + + public int getDate() + { + return date; + } + + public String getContent() + { + return content; + } + + /***********************************************************/ + //获取年月日明细 + /***********************************************************/ + + public int getYear() + { + return year; + } + + public int getMonth() + { + return month; + } + + public int getDay() + { + return day; + } +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/model/ProjectPlanModel.java b/zhiqim_plan/src/org/zhiqim/plan/model/ProjectPlanModel.java new file mode 100644 index 0000000..aa76b50 --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/model/ProjectPlanModel.java @@ -0,0 +1,133 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.model; + +/** + * 项目计划模型 + * + * @version v1.0.0 @author zouzhigang 2017-11-8 新建与整理 + */ +public class ProjectPlanModel extends ProjectModel +{ + private int planSeq; + private int planStatus; + + private String planBeginDate; + private String planEndDate; + private String planManager; + private int planProgress; + private String actualBeginDate; + private String actualEndDate; + + + public int getType() + { + return PJ_PLAN; + } + + public int getPlanSeq() + { + return planSeq; + } + + public void setPlanSeq(int planSeq) + { + this.planSeq = planSeq; + } + + public int getPlanStatus() + { + return planStatus; + } + + public void setPlanStatus(int planStatus) + { + this.planStatus = planStatus; + } + + public String getPlanBeginDate() + { + return planBeginDate; + } + + public void setPlanBeginDate(String planBeginDate) + { + this.planBeginDate = planBeginDate; + } + + public String getPlanEndDate() + { + return planEndDate; + } + + public void setPlanEndDate(String planEndDate) + { + this.planEndDate = planEndDate; + } + + public String getPlanManager() + { + return planManager; + } + + public void setPlanManager(String planManager) + { + this.planManager = planManager; + } + + public int getPlanProgress() + { + return planProgress; + } + + public void setPlanProgress(int planProgress) + { + this.planProgress = planProgress; + } + + public String getActualBeginDate() + { + return actualBeginDate; + } + + public void setActualBeginDate(String actualBeginDate) + { + this.actualBeginDate = actualBeginDate; + } + + public String getActualEndDate() + { + return actualEndDate; + } + + public void setActualEndDate(String actualEndDate) + { + this.actualEndDate = actualEndDate; + } + + public String getColor() + { + switch (planStatus) + { + case 1: return "color:green"; + case 2: return "color:red"; + case 3: return "color:gray"; + default: return "color:#333"; + } + } +} diff --git a/zhiqim_plan/src/org/zhiqim/plan/model/ProjectWeekModel.java b/zhiqim_plan/src/org/zhiqim/plan/model/ProjectWeekModel.java new file mode 100644 index 0000000..ebba77a --- /dev/null +++ b/zhiqim_plan/src/org/zhiqim/plan/model/ProjectWeekModel.java @@ -0,0 +1,114 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙,一起邂逅框架梦] + * + * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_plan.htm + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.zhiqim.plan.model; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.calendar.model.CalendarWeekModel; +import org.zhiqim.kernel.util.Strings; + +/** + * 项目计划总结一周模型 + * 1、日历星期KEY + * 2、计划列表 + * 3、周目标 + * 4、周总结 + * + * @version v1.0.0 @author zouzhigang 2017-11-8 新建与整理 + */ +public class ProjectWeekModel +{ + private CalendarWeekModel key; + + private List planList; + private ProjectModel weekAim; + private ProjectModel weekSummary; + + public ProjectWeekModel(CalendarWeekModel key) + { + this.key = key; + this.planList = new ArrayList<>(); + } + + public void addPlanModel(ProjectPlanModel model) + { + planList.add(model); + } + + public CalendarWeekModel getKey() + { + return key; + } + + public ProjectModel getWeekSummary() + { + return weekSummary; + } + + public void setWeekSummary(ProjectModel weekSummary) + { + this.weekSummary = weekSummary; + } + + public ProjectModel getWeekAim() + { + return weekAim; + } + + public void setWeekAim(ProjectModel weekAim) + { + this.weekAim = weekAim; + } + + public List getPlanList() + { + return planList; + } + + public int getRowSize() + { + return planList.size() + 2; + } + + public String getWeekName() + { + int beginMonth = key.getBeginMonth(); + int beginDay = key.getBeginDay(); + int endMonth = key.getEndMonth(); + int endDay = key.getEndDay(); + + return Strings.prefixZero(beginMonth, 2) + "." + Strings.prefixZero(beginDay, 2) + "-" + + Strings.prefixZero(endMonth, 2) + "." + Strings.prefixZero(endDay, 2); + } + + public String getWeekBegin() + { + return key.getWeekBegin(); + } + + public String getWeekEnd() + { + return key.getWeekEnd(); + } + + public ProjectPlanModel getFirstPlan() + { + return planList.get(0); + } +} diff --git a/zhiqim_sessioner/.classpath b/zhiqim_sessioner/.classpath new file mode 100644 index 0000000..e51089b --- /dev/null +++ b/zhiqim_sessioner/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/zhiqim_sessioner/.gitignore b/zhiqim_sessioner/.gitignore new file mode 100644 index 0000000..7da5aac --- /dev/null +++ b/zhiqim_sessioner/.gitignore @@ -0,0 +1,2 @@ +/bin +/logs diff --git a/zhiqim_sessioner/.project b/zhiqim_sessioner/.project new file mode 100644 index 0000000..d26cb25 --- /dev/null +++ b/zhiqim_sessioner/.project @@ -0,0 +1,17 @@ + + + zhiqim_sessioner + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/zhiqim_sessioner/.settings/org.eclipse.jdt.core.prefs b/zhiqim_sessioner/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..7341ab1 --- /dev/null +++ b/zhiqim_sessioner/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/zhiqim_sessioner/conf/httpd.xml b/zhiqim_sessioner/conf/httpd.xml new file mode 100644 index 0000000..0c7a045 --- /dev/null +++ b/zhiqim_sessioner/conf/httpd.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_sessioner/conf/logging.xml b/zhiqim_sessioner/conf/logging.xml new file mode 100644 index 0000000..3f7834a --- /dev/null +++ b/zhiqim_sessioner/conf/logging.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_sessioner/conf/zhiqim.xml b/zhiqim_sessioner/conf/zhiqim.xml new file mode 100644 index 0000000..714d92c --- /dev/null +++ b/zhiqim_sessioner/conf/zhiqim.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_sessioner/document/export/project.exp.xml b/zhiqim_sessioner/document/export/project.exp.xml new file mode 100644 index 0000000..652bd63 --- /dev/null +++ b/zhiqim_sessioner/document/export/project.exp.xml @@ -0,0 +1,20 @@ + +
            +
            + + + + + + + + + + + + + + + +
            +
            diff --git a/zhiqim_sessioner/lib/zhiqim.jar b/zhiqim_sessioner/lib/zhiqim.jar new file mode 100644 index 0000000..3ddac43 Binary files /dev/null and b/zhiqim_sessioner/lib/zhiqim.jar differ diff --git a/zhiqim_sessioner/lib/zhiqim_httpd.jar b/zhiqim_sessioner/lib/zhiqim_httpd.jar new file mode 100644 index 0000000..31f9b33 Binary files /dev/null and b/zhiqim_sessioner/lib/zhiqim_httpd.jar differ diff --git a/zhiqim_sessioner/lib/zhiqim_orm.jar b/zhiqim_sessioner/lib/zhiqim_orm.jar new file mode 100644 index 0000000..2e4dcef Binary files /dev/null and b/zhiqim_sessioner/lib/zhiqim_orm.jar differ diff --git a/zhiqim_sessioner/lib/zhiqim_ui.jar b/zhiqim_sessioner/lib/zhiqim_ui.jar new file mode 100644 index 0000000..20dcff2 Binary files /dev/null and b/zhiqim_sessioner/lib/zhiqim_ui.jar differ diff --git a/zhiqim_sessioner/lib/zhiqim_zml.jar b/zhiqim_sessioner/lib/zhiqim_zml.jar new file mode 100644 index 0000000..0e2aa82 Binary files /dev/null and b/zhiqim_sessioner/lib/zhiqim_zml.jar differ diff --git a/zhiqim_sessioner/libsrc/zhiqim-src.jar b/zhiqim_sessioner/libsrc/zhiqim-src.jar new file mode 100644 index 0000000..08461ed Binary files /dev/null and b/zhiqim_sessioner/libsrc/zhiqim-src.jar differ diff --git a/zhiqim_sessioner/libsrc/zhiqim_httpd-src.jar b/zhiqim_sessioner/libsrc/zhiqim_httpd-src.jar new file mode 100644 index 0000000..0ee9c73 Binary files /dev/null and b/zhiqim_sessioner/libsrc/zhiqim_httpd-src.jar differ diff --git a/zhiqim_sessioner/libsrc/zhiqim_orm-src.jar b/zhiqim_sessioner/libsrc/zhiqim_orm-src.jar new file mode 100644 index 0000000..e61c6f1 Binary files /dev/null and b/zhiqim_sessioner/libsrc/zhiqim_orm-src.jar differ diff --git a/zhiqim_sessioner/libsrc/zhiqim_zml-src.jar b/zhiqim_sessioner/libsrc/zhiqim_zml-src.jar new file mode 100644 index 0000000..bf03d29 Binary files /dev/null and b/zhiqim_sessioner/libsrc/zhiqim_zml-src.jar differ diff --git a/zhiqim_sessioner/resource/conf/config.xml b/zhiqim_sessioner/resource/conf/config.xml new file mode 100644 index 0000000..61021b5 --- /dev/null +++ b/zhiqim_sessioner/resource/conf/config.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_sessioner/resource/conf/config.zml b/zhiqim_sessioner/resource/conf/config.zml new file mode 100644 index 0000000..f6188bc --- /dev/null +++ b/zhiqim_sessioner/resource/conf/config.zml @@ -0,0 +1,12 @@ +<#----------------------------------------------------> +<#-- 以下为变量定义 ------------------------> +<#----------------------------------------------------> + +<#var name="知启蒙会话管理器"/> +<#var version="V1.5.0"/> +<#var keywords="知启蒙 开源 zhiqim zhiqimeng ZhiqimDK ZhiqimStudio ZhiqimPM"/> +<#var description="湖南知启蒙科技有限公司致力打造求知-启蒙的程序员社区、程序员文学、程序搜索、技术即服务平台"/> + +<#----------------------------------------------------> +<#-- 以下为函数定义 ------------------------> +<#----------------------------------------------------> \ No newline at end of file diff --git a/zhiqim_sessioner/resource/index.htm b/zhiqim_sessioner/resource/index.htm new file mode 100644 index 0000000..b602268 --- /dev/null +++ b/zhiqim_sessioner/resource/index.htm @@ -0,0 +1,18 @@ + + + + + + + + +${name} +${Styles.htmlOverflowHidden()} + + + +
            +
            ${name}
            +
            + + \ No newline at end of file diff --git a/zhiqim_sessioner/src/org/zhiqim/httpd/sessioner/Session.java b/zhiqim_sessioner/src/org/zhiqim/httpd/sessioner/Session.java new file mode 100644 index 0000000..7579b54 --- /dev/null +++ b/zhiqim_sessioner/src/org/zhiqim/httpd/sessioner/Session.java @@ -0,0 +1,143 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.sessioner; + +import org.zhiqim.kernel.json.Jsons; + +/** + * HTTP会话对象 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class Session +{ + private String oldSessionId; + + private String sessionId; + private long created; + private long accessed; + private int maxInactiveInterval; + private String sessionIp; + private String userAgent; + + private String sessionUser; + private String attributes; + + public String getOldSessionId() + { + return oldSessionId; + } + + public void setOldSessionId(String oldSessionId) + { + this.oldSessionId = oldSessionId; + } + + public String getSessionId() + { + return sessionId; + } + + public void setSessionId(String sessionId) + { + this.sessionId = sessionId; + } + + public long getCreated() + { + return created; + } + + public void setCreated(long created) + { + this.created = created; + } + + public long getAccessed() + { + return accessed; + } + + public void setAccessed(long accessed) + { + this.accessed = accessed; + } + + public int getMaxInactiveInterval() + { + return maxInactiveInterval; + } + + public void setMaxInactiveInterval(int maxInactiveInterval) + { + this.maxInactiveInterval = maxInactiveInterval; + } + + public String getSessionIp() + { + return sessionIp; + } + + public void setSessionIp(String sessionIp) + { + this.sessionIp = sessionIp; + } + + public String getUserAgent() + { + return userAgent; + } + + public void setUserAgent(String userAgent) + { + this.userAgent = userAgent; + } + + public String getSessionUser() + { + return sessionUser; + } + + public void setSessionUser(String sessionUser) + { + this.sessionUser = sessionUser; + } + + public String getAttributes() + { + return attributes; + } + + public void setAttributes(String attributes) + { + this.attributes = attributes; + } + + /**********************************************/ + //清理和转换成字符串 + /**********************************************/ + + public String toString() + { + return Jsons.toString(this); + } +} diff --git a/zhiqim_sessioner/src/org/zhiqim/httpd/sessioner/Sessioner.java b/zhiqim_sessioner/src/org/zhiqim/httpd/sessioner/Sessioner.java new file mode 100644 index 0000000..5f9babe --- /dev/null +++ b/zhiqim_sessioner/src/org/zhiqim/httpd/sessioner/Sessioner.java @@ -0,0 +1,288 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm + * + * This file is part of [zhiqim_httpd]. + * + * [zhiqim_httpd] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_httpd] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_httpd]. + * If not, see . + */ +package org.zhiqim.httpd.sessioner; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.zhiqim.httpd.HttpdConstants; +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.Servicer; +import org.zhiqim.kernel.annotation.AnFilterNot; +import org.zhiqim.kernel.extend.HashMapSV; +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.kernel.schedule.Interval; +import org.zhiqim.kernel.schedule.Task; +import org.zhiqim.kernel.util.Asserts; + +/** + * Hash会话管理器,通过HashMap对会话进行管理 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class Sessioner extends Servicer implements Task, HttpdConstants +{ + private int sessionTimeout; + private String sessionIdName; + private HashMapSV sessionMap; + private Interval interval; + + /** 创建服务 */ + public boolean create() throws Exception + { + this.sessionTimeout = Global.getInt(id, "session.timeout", 30 * 60); + this.sessionIdName = Global.getString(id, "session.idName", _JSESSIONID_); + + this.sessionMap = new HashMapSV<>(999, true); + this.interval = Interval.shedule(this, 29 * 1000);//定义29秒检查一次,保证最小1分钟清除即可,太频繁也不大合适 + return true; + } + + /** 销毁服务 */ + public void destroy() + { + if (this.interval != null) + { + this.interval.close(); + this.interval = null; + } + + if (this.sessionMap != null) + { + this.sessionMap.clear(); + this.sessionMap = null; + } + } + + /**************************************************/ + //获取参数部分 + /**************************************************/ + + /** 获取会话编号名称 */ + public String getSessionIdName() + { + return sessionIdName; + } + + /** 获取超时时长 */ + public int getSessionTimeout() + { + return sessionTimeout; + } + + /**************************************************/ + //设置 & 获取 & 失效 会话 + /**************************************************/ + + /** 设置一个会话 */ + @AnFilterNot + public void setSession(String sessionInfo) + { + Session session = Jsons.toObject(sessionInfo, Session.class); + sessionMap.put(session.getSessionId(), session); + } + + /** 通过会话编号获取会话对象 */ + public String getSession(String sessionId) + { + Session session = sessionMap.get(sessionId); + return Jsons.toString(session); + } + + /** 判断会话是否存在 */ + public boolean hasSession(String sessionId) + { + return sessionMap.containsKey(sessionId); + } + + /** 删除一个会话,指定会话编号 */ + public void invalidateSession(String sessionId) + { + sessionMap.remove(sessionId); + } + + /** 更新会话最后访问时间 */ + public void updateLastAccessed(String sessionId) + { + Session session = sessionMap.get(sessionId); + if (session == null) + return; + + session.setAccessed(System.currentTimeMillis()); + } + + /** 更新会话信息 */ + @AnFilterNot + public void updateInfo(String sessionId, String sessionIp, String userAgent) + { + Session session = sessionMap.get(sessionId); + if (session == null) + return; + + session.setAccessed(System.currentTimeMillis()); + session.setSessionId(sessionId); + session.setUserAgent(userAgent); + } + + /******************************************************************************************/ + //会话查询和统计 + /******************************************************************************************/ + + /** 查会话数 */ + public int size() + { + return sessionMap.size(); + } + + /** 获取会话列表 */ + public String getSessionList() + { + return Jsons.toString(sessionMap.values()); + } + + /** 获取会话分页信息 */ + public String getSessionList(int pageNo, int pageSize) + { + int size = sessionMap.size(); + if (size == 0) + return "[]"; + + int pageNoMax = (size-1) / pageSize + 1; + if (pageNo < 1) pageNo = 1; + if (pageNo > pageNoMax) pageNo = pageNoMax; + + int start = (pageNo-1) * pageSize; + int end = pageNo * pageSize; + + ArrayList list = new ArrayList<>(); + Iterator it = sessionMap.values().iterator(); + for (int i=0;it.hasNext();i++) + { + Session s = it.next(); + if (i < start) + continue; + else if (i >= end) + break; + else + list.add(s); + } + + return Jsons.toString(list); + } + + /******************************************************************************************/ + //会话用户查询和统计 + /******************************************************************************************/ + + /** 查用户数,有登录状态 */ + public int sizeUser() + { + int size = 0; + for (Session s : sessionMap.values()) + { + if (s.getSessionUser() != null) + size++; + } + + return size; + } + + /** 是否有会话名称对应的会话 */ + public boolean hasSessionName(String sessionName) + { + Asserts.notNull(sessionName, "sessionName"); + + for (Session s : sessionMap.values()) + { + String sessionUser = s.getSessionUser(); + if (sessionUser == null) + continue; + + if (sessionName.equals(Jsons.getString(sessionUser, "sessionName"))) + return true; + } + + return false; + } + + /** 获取会话登录用户列表,指定会话用户类名(如前后端共用session管理器的情况) */ + public String getSessionUserList() + { + List list = new ArrayList<>(); + for (Session s : sessionMap.values()) + { + String sessionUser = s.getSessionUser(); + if (sessionUser != null) + list.add(sessionUser); + } + + return Jsons.toString(list); + } + + /** 获取会话登录用户分页信息,指定会话用户类名(如前后端共用session管理器的情况) */ + public String getSessionUserList(int pageNo, int pageSize) + { + if (pageNo < 1) pageNo = 1; + int start = (pageNo-1) * pageSize; + int end = pageNo * pageSize; + + int total = 0; + List list = new ArrayList<>(); + for (Session s : sessionMap.values()) + { + String sessionUser = s.getSessionUser(); + if (sessionUser == null) + continue; + + total++; + if (total <= start || total > end) + continue;//非当前页 + else + list.add(sessionUser); + } + + return Jsons.toString(list); + } + + /********************************************************************/ + //定时任务 + /********************************************************************/ + + /** 定时检查超时用户 */ + public void execute() + { + for (Iterator it=sessionMap.values().iterator();it.hasNext();) + { + Session session = it.next(); + if (session.getMaxInactiveInterval() <= 0) + continue;//设置为0或负数表示永驻内存 + + if(System.currentTimeMillis()-session.getAccessed() < session.getMaxInactiveInterval() * 1000) + continue;//未超时 + + //已超时清理 + it.remove(); + session = null; + } + } +} diff --git a/zhiqim_ui/.gitignore b/zhiqim_ui/.gitignore new file mode 100644 index 0000000..b6d592e --- /dev/null +++ b/zhiqim_ui/.gitignore @@ -0,0 +1 @@ +/logs diff --git a/zhiqim_ui/.project b/zhiqim_ui/.project new file mode 100644 index 0000000..7f3c0a5 --- /dev/null +++ b/zhiqim_ui/.project @@ -0,0 +1,11 @@ + + + zhiqim_ui + + + + + + + + diff --git a/zhiqim_ui/LICENSE b/zhiqim_ui/LICENSE new file mode 100644 index 0000000..5cc63c2 --- /dev/null +++ b/zhiqim_ui/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. [http://fsf.org/] + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/zhiqim_ui/README.md b/zhiqim_ui/README.md new file mode 100644 index 0000000..ee4d088 --- /dev/null +++ b/zhiqim_ui/README.md @@ -0,0 +1,283 @@ +### 什么是“知启蒙前端框架”? +--------------------------------------- +      知启蒙前端框架(ZhiqimUI)是一套集成Javascript库、Css库、Font库、常用ico图标等,并在其上开发的大量UI控件组成的前端开发套件,是Zhiqim Development Kit的前端核心。 + +
            + +### “知启蒙前端框架”有什么优点? +--------------------------------------- +1、ZhiqimUI的JS库拥有类似于jQuery的DOM操作能力,通过Z(selector)方式访问,并集成了大量常用的静态工具。
            +2、ZhiqimUI的Css库类似于bootstrap,统一使用z-前缀约束,定义了大量常用的css规则,同时兼容其他的css库。
            +3、ZhiqimUI的插件库非常丰富并持续增加中,有对话框、Ajax调用、表单套件、日历、复制、标签页、文件上传等。
            +4、ZhiqimUI压缩打包成一个jar文件(zhiqim_ui.jar),配合ZhiqimHttpd使用,可直接通过/service/res/*访问。
            + +
            + + +### 知启蒙前端框架目录结构 +--------------------------------------- +![知启蒙前端框架目录结构](https://images.gitee.com/uploads/images/2018/0913/164626_37d2147a_2103954.png "知启蒙前端框架目录结构") +
            + + +### 如何使用知启蒙前端框架?                                                                                               打开演示地址 +--------------------------------------- + +``` + + + +知启蒙前端框架 + + + + + + + + + + + + + + + + + + + + + + + + + + +
            +    +
            + +
            + + +``` + +
            + + +### 知启蒙前端框架CSS核心库 +--------------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            功能说明
            全局定义全局定义是指在全局定义里的标签缺省下的样式规则
            颜色定义颜色定义是指在ZhiqimUI的核心CSS文件中,默认提供的全局、白色、黑色和红、橙、黄、绿、青、蓝、紫共十种颜色的定义,包括字体颜色、背景颜色和边框颜色等,以及对应的样式名称。
            字体图标“字体图标”是矢量图片按字体规范设计的一种新的图标,知启蒙字体图标放在/service/res/font/zhiqim.woff文件中,当前开发和收集的图标分 + 操作类、文档类、设备类、图表类、实体类五种,共五十九个图标。 + 字体图标不支持斜体,以便使用<i>标签来定义,如<i class="z-font z-config"></i> +
            图片图标“图片图标”是把一组小图标图片拼成一张大图,通过CSS的background-position特性指定小图标在大图中的位置和宽高显示图标, + 知启蒙图片图标放在/service/res/image目录下,根据大小和类型分为12px、16px、22px、36px以及文件图标、树图标等,在这里还利用三角型和圆型生成箭头和圆圈等样式。 +
            文本样式文本样式是指对文本文字增加样式规则,如指定文本粗斜体、文本上下标、文本字体大小、文本行高、文本强制换行、强制不换行、省略隐藏、文本标题属性、文本对齐方式和文本附带的下划线删除线、以及编码突出效果等。
            块样式块样式是指对一个块区域增加样式规则,如指定块隐藏显示、块定位、块宽、块宽百分比、块高、块高百分比、内边距、外边距等属性。
            表格样式表格样式是指对表格增加样式规则,如指定表格边框、表格圆角、表格行线、表格单元格内边距、表格单元格字体大小、表格单元格文本对齐方式、表格单元格文本行高等,默认表格无边框。 + 另外,CSS对底部圆角当有背景时需要手动对第一和最后单元格补圆角,当圆角首列合并单元格时也需要对被合并的行第一单元格补左边线。 +
            + +
            + + +### 知启蒙前端框架JS核心库 +--------------------------------------- + + + + + + + + + + + + + + + + + + + + + +
            功能说明
            全局定义知启蒙JS统一命名空间为“Z”,同时“Z”也是window下全局函数,如果“Z”有定义冲突请使用全称“zhiqim”。在全局“Z”命名空间下定义的全局属性、全局函数、全局正则表达式和全局类。
            静态对象静态对象是把一系列常用的对象定义成静态属性和函数。目前包括有浏览器对象(Z.B)、文档对象(Z.D)、 + 事件对象(Z.E)、元素对象(Z.EL)、HTML对象(Z.H)、地址对象(Z.L)、COOKIE对象(Z.CK)。 +
            工具对象工具对象也是静态对象的一种,把一系列常用的静态属性和函数归类到一个工具对象中。目前包括断言工具(Z.A/Z.Asserts)、对象工具(Z.O/Z.Objects)、类型工具(Z.T/Z.Types)、 + 验证工具(Z.V/Z.Validates)、表单工具(Z.F/Z.FM)、JSON工具(Z.J/Z.Jsons)、日期工具(Z.DT/Z.DateTimes)、数组工具(Z.AR/Z.Arrays)、字符串工具(Z.S/Z.Strings)、算术工具(Z.Maths)、 + 金额工具(Z.AM/Z.Amounts)和颜色工具(Z.Colors)。 +
            查询对象Z.QueryZ.Query是设计成类似jQuery的DOM操作类。Z.Query采用HTML5原生的document.querySelectorAll实现了大部分jQuery的API,如selector,DOM操作,事件方法,动画等。 + 并增加了自身的一些特性和命名,如offsetLeftBody()、focusEnd()等。 +
            + +
            + + +### 知启蒙前端框架插件库 +--------------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            功能说明
            表单插件库
            输入框输入框样式是指对输入框增加样式规则,如指定输入框长度大小、边框颜色、和输入控制等。
            按钮按钮样式是指对按钮增加样式规则,按钮分为三种,一是标准按钮、二为筛选按钮、三是多选按钮。样式规则包括按钮大小、颜色、边框颜色、选中特效等。
            多选框多选框样式是指参考多选按钮设计出有颜色设定的多选的方框样式。多选框默认1像素边框,移入时变为2像素边框,选中后增加背景颜色并显示打勾图标表示已选中,多选框默认黑色,支持红橙黄绿青蓝紫等颜色和大小5种设定。
            单选框单选框样式是指参考单选按钮设计出有颜色设定单选的圆框的样式。单选框默认1像素边框,移入时变为2像素边框,选中后增加背景颜色并显示打勾图标表示已选中,单选框默认黑色,支持红橙黄绿青蓝紫等颜色和大小5种设定。
            选择框选择框样式是参考选择按钮设计出有颜色设定下拉列表的样式。选择框是一种下拉列表样式,目标是和表单选择按钮联动,实现跨浏览器且更美观的样式。
            可编辑文本可编辑文本是定义一段文本(span),在该文本之后增加一个笔状图标,当点击笔状图标时显示输入框和保存按钮,输入框支持输入控制,点击保存按钮触发保存事件。
            日历日历控件是在输入框触发时展开一个年月日时分秒的日期界面,按日历格式显示出来,通过点击和选择得到要求的日期或时间。当前日历控件支持选择日期、选择日期+时间、选择日期+时分三种。
            对话框插件库
            自定义对话框自定义对话框是指根据业务要求,自动组装对话框参数,完成对话框的弹出。自定义对话框支持的参数有标题、宽度、高度、边框颜色、目标区域、指定弹出HTML、指定弹出URL等一系列参数,是各种对话框的基础。
            告警对话框警告对话框是自定义对话框的一种参考alert方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的警告对话框,支持设置警告内容和点击确定后回调函数。
            询问对话框询问对话框是自定义对话框的一种参考confirm方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的确认对话框,支持设置确认内容和点击确定后回调函数,点击取消不向下处理。
            提示对话框提示对话框是自定义对话框的一种参考prompt方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的提示对话框,支持设置提示内容和点击确定后回调函数,点击取消不向下处理。
            加载对话框加载对话框是自定义对话框的一种没有标题只有加载中提示的对话框。目标是在屏幕或用户指定的元素可视范围的中间提供没有警告声音且美观的加载对话框,支持设置九个参数来定义加载中界面,无关闭按钮,由业务实现关闭。
            导航插件库
            标签页标签页是参考tabnav设计出更简单易用的内容重叠布局的导航页。标签页使用nav和section作为是标签和内容显示。在nav中使用li表示每个标签,在section中使用div作为每个标签显示的内容。
            步骤条步骤条是通过指定多个步骤标签,在每步中展示激活的一个步骤标签的导航页。步骤条使用nav作为每个步骤。 + 样式通过before和after属性自动在每个步骤后加上白色箭头。 +
            提示框提示框是当鼠标移入或点击到重要的标志时,主动冒泡出一个浮动层,对该标志作解释的提示信息框。当前支持鼠标移入和点击两种事件,提示框在设计中有箭头、对齐方式、边框等属性。
            下拉列表下拉列表是设计出当移入或点击时下拉出一个列表的样式。下拉列表当前支持点击和移入触发下拉列表一层界面,支持列表颜色、激活颜色,指定下拉列表宽度和多列等样式。
            工具插件库
            Flash复制由于各浏览器剪贴板功能不一致,功能使用复杂,因此知启蒙是利用Flash的sprite容器制作的剪贴板功能,以达到跨浏览器支持对文本的复制功能。 + 设计方案是先用button占位,再利用flash透明的特性覆盖button。该功能需要开启flash的支持。
            Ajax调用AJAX即“Asynchronous Javascript And XML”(异步JavaScript和XML),是指一种创建交互式网页应用的网页开发技术。 + 知启蒙AJAX采用面向RMI的概念设计,通过指定类和方法,传入参数对应方法的参数,通过RMI访问JAVA类的方法获取执行结果。 +
            拖拽拖拽是指定一个可拖动的对象,当鼠标按下时拖拽到其他位置。缩放是指定一个可缩放的对象,当鼠标按下时拉动对象使之放大或缩小。
            文件上传知启蒙文件上传提供了多种上传方法,支持表单上传、单文件上传,多文件上传,预览再上传,大文件上传断点续传(HTML5和Flash两种)等。
            + +
            + +### 知启蒙技术框架与交流 +--------------------------------------- + +![知启蒙技术框架架构图](https://images.gitee.com/uploads/images/2018/0907/171951_230c3a33_2134900.png "知启蒙技术框架架构图.png") +

            +QQ群:加入QQ交流群,请点击[【458171582】](https://jq.qq.com/?_wv=1027&k=5DWlB3b)

            +教程:欲知更多知启蒙前端框架,[【请戳这里】](https://www.zhiqim.com/gitcan/zhiqim/zhiqim_ui/tutorial/index.htm) diff --git a/zhiqim_ui/conf/config.xml b/zhiqim_ui/conf/config.xml new file mode 100644 index 0000000..930dd9c --- /dev/null +++ b/zhiqim_ui/conf/config.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_ui/conf/config.zml b/zhiqim_ui/conf/config.zml new file mode 100644 index 0000000..b78800c --- /dev/null +++ b/zhiqim_ui/conf/config.zml @@ -0,0 +1,380 @@ +<#--定义变量--> +<#var upload.rootDir="./upload"/> +<#var document.index="/document/tutorial/ui/index.htm"/> + +<#--定义包含文件--> +<#include "/conf/mobile.zml"/> +<#include "/conf/sidebar.zml"/> + +<#----------------------------------------------------> +<#-- 以下为HEAD定义 ---------------------------------> +<#----------------------------------------------------> + +<#--头部起始--> +<#function zhiqim_com_header()> + + + +${context.getContextName()}<#if Validates.isNotEmpty(title)>_${title}</#if> + + + + + + +"/> +${Styles.src("/src/zhiqim.css")} +${Scripts.src("/src/zhiqim.js")} +${Scripts.src("/src/zhiqim_static.js")} +${Scripts.src("/src/zhiqim_static_util.js")} +${Scripts.src("/src/zhiqim_query.js")} +${Scripts.src("/src/zhiqim_md5.js")} +${Scripts.src("/src/zhiqim_dialog.js")} +${Scripts.src("/src/zhiqim_ajax.js")} +${Scripts.src("/src/zhiqim_calendar.js")} +${Scripts.src("/src/zhiqim_form.js")} +${Scripts.src("/src/zhiqim_drag.js")} +${Scripts.src("/src/zhiqim_dropdown.js")} +${Scripts.src("/src/zhiqim_tabnav.js")} +${Scripts.src("/src/zhiqim_floater.js")} +${Scripts.src("/src/zhiqim_editable.js")} +${Scripts.src("/src/zhiqim_upload.js")} +${Scripts.src("/src/zhiqim_uploadmult.js")} +${Styles.src(context.getRootPath("/zinc/www/main.css"))} +${zhiqim_account_www_header_autoLogin()} + +<#if Strings.startsWith(request.getPathInContext(), "/knowledgeLibrary/")> +${Scripts.src(context.getRootPath("/zinc/www/zhiqim_scrolltotop.js"))} + +<#if Strings.startsWith(request.getPathInContext(), "/document/")> +${Scripts.src(context.getRootPath("/zinc/www/zhiqim_scrolltotop.js"))} + + + + + +<#--自动登录--> +<#function zhiqim_account_www_header_autoLogin()> + + + +<#--顶部导航--> +<#function zhiqim_com_topnav(nav)> + +
            style="padding-right:17px;"> + +
            +
            + + + + + + + +
            +
            + + + + <#if request.hasSessionUser(ZacSessionUser.class)> + + + <#else> + + + +
            +
            + + +
            + + +<#--面包屑 --> +<#function zhiqim_com_breadcrumb(first, second, third)> + + + +<#--主页脚注--> +<#function zhiqim_com_footer()> +<#if request.getPathInContext() == "/index.htm"> + + + + + + + + +<#--上一章下一章--> +<#function zhiqim_com_chapter(prevUrl, nextUrl)> +<#if prevUrl != null || nextUrl != null> +
            +<#if prevUrl != null> + + +<#if nextUrl != null> + + +
            + + + +<#--内容转载--> +<#function zhiqim_com_content_source()> +
            + --内容来源于w3cSchool,如有侵权,请联系删除! +
            + + +<#---------------------------------------------------------------------> +<#-- 移动端函数定义 --> +<#---------------------------------------------------------------------> + +<#--头部--> +<#function zhiqim_com_mobile_header()> + + + +${context.getContextName()}<#if Validates.isNotEmpty(title)>_${title}</#if> + + + + + + +"/> + + +${Styles.src(context.getRootPath("/zinc/mobile/zhiqim.mobile_v1.4.0.r2018010101.css"))} +${Scripts.src(context.getRootPath("/zinc/mobile/zhiqim.mobile_v1.4.0.r2018010101.min.js"))} +${Styles.src(context.getRootPath("/zinc/mobile/zhiqim_account_v1.4.0.r2018042501.mobile.css"))} +${Scripts.src(context.getRootPath("/zinc/mobile/zhiqim_account_v1.4.0.r2018042501.mobile.js"))} +${Styles.src(context.getRootPath("/zinc/mobile/mainmobile.css"))} + + + + + +<#--顶部导航--> +<#function zhiqim_com_mobile_topnav(name)> + +
            +
            + +
            +
            +
            + <#if request.hasSessionUser(ZacSessionUser.class)> + + <#else> + + + +
            +
            + + +
            +
            +
            +
            + 功能菜单 +
            +
            +
            +

            首页

            +

            产品

            +

            文库

            +

            蚕云

            +

            图库

            +

            账户中心

            + +
            +
            +
            + + + +<#--脚注--> +<#function zhiqim_com_mobile_footer()> + + + + + +<#--右边浮动图标--> +<#function zhiqim_com_fixedicon()> + + + +<#-- 右边浮动--> +
            + +
            + + +<#--重写account顶部导航--> +<#function zhiqim_account_www_topnav(name)> +<#var path = request.getPathInContext()/> +<#var doc = Strings.startsWith(path, "/document/")/> +<#var product = Strings.startsWith(path, "/product/")/> +<#var git = Strings.startsWith(path, "/gitcan/")/> +<#var gallery = Strings.startsWith(path, "/gallery/")/> +<#var task = Strings.startsWith(path, "/task/")/> +<#var site = Strings.startsWith(path, "/minisite/")/> +<#var account = Strings.startsWith(path, "/account/")/> +<#var index = !doc && !product && !git && !gallery && !task && !site && !account/> + + +
            + +
            +
            + + + + + + + +
            +
            + + + + <#if request.hasSessionUser(ZacSessionUser.class)> + + + <#else> + + + +
            +
            + +
            + diff --git a/zhiqim_ui/conf/database.db b/zhiqim_ui/conf/database.db new file mode 100644 index 0000000..85a1632 Binary files /dev/null and b/zhiqim_ui/conf/database.db differ diff --git a/zhiqim_ui/conf/mobile.zml b/zhiqim_ui/conf/mobile.zml new file mode 100644 index 0000000..034585d --- /dev/null +++ b/zhiqim_ui/conf/mobile.zml @@ -0,0 +1,62 @@ +<#--头部主内容,mobileUI滚动条事件--> +<#function zhiqim_com_mobileUI_scrollJs()> + + + +<#-- zhiqim.mobile右侧demo --> +<#function zhiqim_com_ZmUI_demo_start(url)> +<#if url == undefined> +${Styles.src("/src/zhiqim.mobile.css")} +${Scripts.src("/src/zhiqim_dialog.mobile.js")} +${Scripts.src("/src/zhiqim_calendar.mobile.js")} +${Scripts.src("/src/zhiqim_tabnav.mobile.js")} +${Scripts.src("/src/zhiqim_numInput.mobile.js")} +${Scripts.src("/src/zhiqim_popUp.mobile.js")} +${Scripts.src("/src/zhiqim_slider.mobile.js")} + +
            +
            +<#else> +
            +
            + + + +<#function zhiqim_com_ZmUI_demo_end()> +
            +
            + \ No newline at end of file diff --git a/zhiqim_ui/conf/sidebar.zml b/zhiqim_ui/conf/sidebar.zml new file mode 100644 index 0000000..b7495d4 --- /dev/null +++ b/zhiqim_ui/conf/sidebar.zml @@ -0,0 +1,1079 @@ +<#----------------------------------------------------> +<#-- 以下为边导航定义 ---------------------------------> +<#----------------------------------------------------> + +<#--文库边导航开始--> +<#function zhiqim_com_sidebar(menu, item, subitem)> + + + + +<#--知启蒙框架边导航开始--> +<#function zhiqim_com_sidebar_frame(menu, item, subitem)> + + + +<#--微内核边导航开始--> +<#function zhiqim_com_kernel(menu, submenu, item, subitem)> + + + +<#--数据库映射容器开始--> +<#function zhiqim_com_orm(menu, submenu, item, subitem)> + + + +<#--模板引擎容器开始--> +<#function zhiqim_com_zml(menu, submenu, item, subitem)> + + + +<#--WEB容器开始--> +<#function zhiqim_com_httpd(menu, submenu, item, subitem)> + + + +<#--前端UI容器开始--> +<#function zhiqim_com_ui(menu, submenu, item, subitem)> + + + +<#--产品边导航开始--> +<#function zhiqim_com_sidebar_prpduct(menu, item, name, image)> + + + + +<#--重写边导航开始--> +<#function zhiqim_account_www_sidebar(menu, item)> + + + + +<#--边导航自定义块--> +<#function zhiqim_account_sidebar_defined()> +<#if ZacAdminRule.check(request)> +
          • class="active" onclick="Z.L.href('${context.getRootPath("/zhiqim_resource/resource.htm")}');">
            资源
          • +
          • class="active" onclick="Z.L.href('${context.getRootPath("/zhiqim_weixinmp/menu.htm")}');">
            微信
          • + + + +<#--子导航自定义块--> +<#function zhiqim_account_sidebar_child_defined()> + +<#if menu=="account"> + + + + +<#if menu=="resource"> + + + + +<#if menu=="weixinMp"> + + + + diff --git a/zhiqim_ui/document/export/component.exp.xml b/zhiqim_ui/document/export/component.exp.xml new file mode 100644 index 0000000..4f43a6b --- /dev/null +++ b/zhiqim_ui/document/export/component.exp.xml @@ -0,0 +1,15 @@ + +
            +
            + + + + + + + + + + +
            +
            diff --git a/zhiqim_ui/document/export/mobile.exp.xml b/zhiqim_ui/document/export/mobile.exp.xml new file mode 100644 index 0000000..a9d599e --- /dev/null +++ b/zhiqim_ui/document/export/mobile.exp.xml @@ -0,0 +1,12 @@ + +
            +
            + + + + + + + +
            +
            diff --git a/zhiqim_ui/document/export/www.exp.xml b/zhiqim_ui/document/export/www.exp.xml new file mode 100644 index 0000000..b1f32a3 --- /dev/null +++ b/zhiqim_ui/document/export/www.exp.xml @@ -0,0 +1,12 @@ + +
            +
            + + + + + + + +
            +
            diff --git a/zhiqim_ui/document/metainfo/version.txt b/zhiqim_ui/document/metainfo/version.txt new file mode 100644 index 0000000..fe2fd53 --- /dev/null +++ b/zhiqim_ui/document/metainfo/version.txt @@ -0,0 +1,86 @@ +V1.1.5R2016050301 + 1)从原FadfoxHttpd剥离出来,新建FadfoxWebUI工程,用于js/css开发和测试工作 + 2)从FadfoxWebUI工程打包,生成fadfox_res.jar。 +V1.2.0R2016062301 + 1)适配V1.2版本,包结构改为/com/zhiqim/fadfox/httpd/context/service/resource/下 +V1.2.1R2016100801 + 1)把CSS拆分成fadfox_pre.css和fadfox_pre.json两个文件,通过通配符把颜色等参数允许外部设置 + 2)所有的CSS都加f-开头,表明是凡狐专属的CSS + 3)完善文本、块、表格、等一系列CSS定义。 + 4)新增slideToggle/slideDown/slideUp方法 +V1.2.2R2017010101版本: + 1)新增fadfox_coder.js打包到fadfox.min.js中 + 2)新增IE8时HTML5新规定的标签支持,为使IE8及以下不要太难看 + 3)新增fadeIn/fadeOut,并修改fafox_dialog.js采用该方法 + 4)修改F.Browser.msieVer为function,原为属性有错误 +V1.3.0R2017022701版本: + 1)拆分原fadfox.js为fadfox.js,fadfox_static.js,fadfox_static_util.js,fadfox_jquery.js四个 + 2)对静态对象增加简写,如F.Validates简写成F.V,见http://fadfox.zhiqim.com文档 + 3)修改F.eval方法为F.evals,增加F.loads方法加载js文件并回调函数 + 4)增加F.Query.fn.beforeunload事件支持 + 5)对IE8的querySelectorAll,querySelector只支持CSS2.1,不支持的返回空数组,但不报错,后续版本再看加不加CSS3.0的支持 + 6)修改F.B.msieVer原来是函数,修改为属性,非IE值修改为100,这样就可以直接使用F.B.msieVer <= 8 来作比较了 + 7)增加/js/three.js,把thress.js默认放置到fadfox_res.jar包里 + 8)修改F.HashMap克隆BUG + 9)修改F.F为F.FM,因为F被定义成fadfox标准的命令,唯一 + 10)增加F.Ajax对paramForm,paramData,paramMap(key,value)三种参数支持,并保留原来的params + 11)修改F.AR.toString中,当数组为空时,返回F.O.toString,改为返回空字符串 + 12)修改F.alert,F.confirm,把内容放置到textarea中,有利于双击选中文本内容,边框和滚动条隐藏 + 13)修改firefox在表格的合并单元格中,计算offsetTop,offsetLeft的值的方法,原来采用设置为separate取值后恢复collapse的方法,但性能性,修改为取相邻边框和表格边框取最大值的方法 + 14)优化offsetTopBody和offsetLeftBody方法,把F.EL.slibingByTd重构,使得方法理解更清晰 + 15)修改F.EL.offsetBodyWebkit方法中cssName is not definde的BUG + 16)修改F.alert,F.confirm,F.prompt显示内容textarea为readonly,并增加回车键默认操作 + 17)修改F.Dialog,当设置target时采用appendToPos方式,保证对话框随指定位置隐显 + 18)修改F.Uploadlarge中HTML5上传方式为相对父节点定位 +V1.3.1R2017052801版本: + 1)修复f-table f-bordered和f-bordered-line对f-bd-t-none,f-bd-b-none的支持 + 2)修改F.Query中.un()方法为.off()方法,其他的如unclick等统一修改为offclick方法 + 3)修改默认f-input,f-select为默认30px,字体14px;f-textarea为14px + 4)增加F.Location.reload(target)代替window.location.reload(); + 5)调整F.Location.check()和F.Location.confirm()参数顺序为url,name,form,target和url,message,name,form,target + 6)增加按钮f-readonly属性时为默认按钮,无点击效果 + 7)修改下拉列表中右箭头固定为12PX,右偏移4PX,顶部偏移由于比文本小向上偏移1PX,下拉左对齐 + 8)修改F.T.isElement()函数的BUG + 9)调整fadfox_uploadlarge.js和fadfox_clipboard.js方式,当支持HTML5时优先,否则为Flash方式 + 10)修改fadfox_uploadlarge.js,当clear时置type="file"的值value为null,解决第二次选中该文件时onchange无反响问题 + 11)增加F.uuid()函数,fadfox_uploadlarge.js默认模式为不断点续传 + 12)增加F.random(len, 9)9表示特殊字符.`_~!@#$% +V1.3.2R2017080501版本: + 1)修改fadfox_uploadlarge,对tigger进行hidden/visible,以前是hide/show + 2)修改fadfox_uploadlarge,fileName取结果的X-Upload-File-Name,要求V1.3.1R2017072501版本支持 + 3)修改fadfox_dialog.js,增加弹出对话框后取消原窗口的活动对象 + 4)增加树型高度为30的样式 + 5)修改fadfox_form.js,整合f-textarea,支持maxlength检查和placeholder换行。 + 6)增加fadfox_ajax.js中setFailureAlert()方法显示错误信息,调整failure/success优先于callback + 7)增加fadfox_dialog.js中close函数的参数immediate,即不作fadeout,立即关闭,防止关闭是fadeout未完成闪屏 + 8)修改F.tigger为F.$elem函数,原tigger单词拼写错误,增加F.$cover方法,用于增加封套 + 9)修改f-select,f-checkbox,f-radio的处理方式为封套定位 + 10)修改callFrame的使用,在fadfox_form.js中增加data-role="f-call-frame"处理 + 11)修改单选按钮相同name下选择未清除其他按钮的BUG + 12)修改f-call-iframe中form参数frameTarget为fCallFrame=true,formIndex为fFormIndex + 13)增加对话框中的请求识别,参数为fDialogFrame=true + 14)修改click,focus等事件方法,当有参数时表示绑定事件,没有参数时表示触发事件 +V1.3.3R2017110601 + 1)修改f-checkbox点击事件,增加F.E.stop(e);防止f-checkbox在button中点击checkbox时向上冒泡有两次点击效果 + 2)修改f-dropdown点击事件参数data-options="stop:true",表示F.E.stop(e);防止f-select在tr点击时向上冒泡有两次点击效果 + 3)修改.f-table为默认border-collapse:separate;在合并单元格时要注意补边框 + 4)增加.f-table.f-h20-tr至.f-table.f-h100-tr表示tr高度 + 5)增加input中对日期格式的判断,data-options="type:Date;" + 6)增加fi-overflow-hidden,fi-overflow-x-hiddenfi-overflow-y-hidden和f-text-middle,fi-text-middle,f-text-top,fi-text-top,f-text-bottom,fi-text-bottom + 7)增加f-shadow-none,fi-shadow-none + 8)增加F.Q.cssMaybe(name, value),用于写入CSS时过滤掉Nil类型的值,修改F.$cover方法调用cssMaybe + 9)修改F.$cover增加显示指定宽度百分比的,在F.$cover中增加宽度,同时修改currentStyle优先于getComputedStyle + 10)修改.f-textarea-placeholder为.f-placeholder,因为input也要用到,同时增加pointer-events: none;这样就不要增加.f-event-none样式 + 11)修改F.prompt,isTextarea状态下不添加回车确认事件 +V1.4.0R2018010101 + 1)修改名称为ZhiqimUI,原F改成Z + 2)删除Z.Ajax类中的evalScript参数,增加Z.EL.html()中对Z.Select.load,Z.Checkbox.load,Z.Radio.load处理 + 3)修改Z.$elem()仅当class参数有时才必须有值,增加Z.$selector()函数 + 4)增加对Z.success和Z.failure函数 + 5)修改Z.L.access()中新开窗口为form提交方式 +V1.4.1R2018050801 + 1)整合 zhiqimUI.mobile + 2)添加 zhiqim_slider、zhiqim_magicZoom +V1.5.0.R2018091201 + 1)整理工程为ZML工程,更好管理,生成min.js和导出组件更方便 + 2)增加Z.Ajax中setFailureAlertRecovery和setSuccessLocationResponse方法 \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/css/block.htm b/zhiqim_ui/document/tutorial/ui/css/block.htm new file mode 100644 index 0000000..176c15e --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/css/block.htm @@ -0,0 +1,1552 @@ +<#def title = "块样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "块样式是指对一个块区域增加样式规则,如指定块隐藏显示、块定位、块宽、块宽百分比、块高、块高百分比、内边距、外边距等属性。"/> +<#def prevUrl = "text.htm"/> +<#def nextUrl = "table.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "css", "block")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "块样式")} +
            + +<#-- 标题 --> +
            +

            块样式:

            +

            + 块样式是指对一个块区域增加样式规则,如指定块隐藏显示、块定位、块宽、块宽百分比、块高、块高百分比、内边距、外边距等属性。 +

            +
            + +<#-- 一、块定位 --> +
            一、块定位
            + + + + + + + + + + + + + + + + + + + + + + +
            名称样式说明
            + .z-fixed
            + .zi-fixed +
            +        .z-fixed{position:fixed;}
            +        .zi-fixed{position:fixed !important;}
            +    
            固定定位
            + .z-absolute
            + .zi-absolute
            +        .z-absolute{position:absolute;}
            +        .zi-absolute{position:absolute !important;}
            +    
            绝对定位
            + .z-relative
            + .zi-relative
            +        .z-relative{position:relative;}
            +        .zi-relative{position:relative !important;}
            +    
            相对定位
            + +<#-- 二、块浮动对齐 --> +
            二、块浮动对齐
            + + + + + + + + + + + + + + + + + + + + + + +
            名称样式说明
            .z-float-left
            .zi-float-left
            +        .z-float-left{float:left;}
            +        .zi-float-left{float:left !important;}
            +    
            左对齐
            .z-float-center
            .zi-float-center
            +        .z-float-center{margin-left:auto;margin-right:auto;}
            +        .zi-float-center{margin-left:auto !important;margin-right:auto !important;}
            +    
            居中对齐
            .z-float-right
            .zi-float-right
            +        .z-float-right{float:right;}
            +        .zi-float-right{float:right !important;}
            +    
            右对齐
            + +<#-- 三、块定位+浮动对齐 --> +
            三、块定位+浮动对齐
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式说明
            + .z-relative-left
            + .zi-relative-left
            +        .z-relative-left{position:relative;float:left;}
            +        .zi-relative-left{position:relative !important;float:left !important;}
            +    
            相对左对齐
            + .z-relative-center
            + .zi-relative-center
            +        .z-relative-center{position:relative;margin-left:auto;margin-right:auto;}
            +        .zi-relative-center{position:relative !important;margin-left:auto !important;margin-right:auto !important;}
            +    
            相对居中
            + .z-relative-right
            + .zi-relative-right
            +        .z-relative-right{position:relative;float:right;}
            +        .zi-relative-right{position:relative !important;float:right !important;}
            +    
            相对右对齐
            + .z-absolute-center-middle
            + .zi-absolute-center-middle
            +        .z-absolute-center-middle{position:absolute;margin:auto;top:0;bottom:0;left:0;right:0;}
            +        .zi-absolute-center-middle{position:absolute !important;margin:auto !important;top:0 !important;bottom:0 !important;left:0 !important;right:0 !important;}
            +    
            绝对居中,内部块在父块的上下左右居中
            + +<#-- 四、块溢出 --> +
            四、块溢出
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式说明
            .z-overflow-auto
            +        .z-overflow-auto{overflow:auto;}
            +    
            块溢出自动设置,指定高度,当内部超时时显示滚动条
            .z-overflow-hidden
            +        .z-overflow-hidden{overflow:hidden;}
            +    
            块溢出的部分不显示
            .z-overflow-scroll
            +        .z-overflow-scroll{overflow:scroll;}
            +    
            块始终显示滚动条,不管内部高度是否超过
            .z-overflow-x-auto
            +        .z-overflow-x-auto{overflow-x:auto;}
            +    
            块X轴溢出自动设置,指定高度,当内部超时时显示滚动条
            .z-overflow-x-hidden
            +        .z-overflow-x-hidden{overflow-x:hidden;}
            +    
            块X轴溢出的部分不显示
            .z-overflow-x-scroll
            +        .z-overflow-x-scroll{overflow-x:scroll;}
            +    
            块X轴始终显示滚动条,不管内部高度是否超过
            .z-overflow-y-auto
            +        .z-overflow-y-auto{overflow-y:auto;}
            +    
            块Y轴溢出自动设置,指定高度,当内部超时时显示滚动条
            .z-overflow-y-hidden
            +        .z-overflow-y-hidden{overflow-y:hidden;}
            +    
            块Y轴溢出的部分不显示
            .z-overflow-y-scroll
            +        .z-overflow-y-scroll{overflow-y:scroll;}
            +    
            块Y轴始终显示滚动条,不管内部高度是否超过
            + +<#-- 五、块手势 --> +
            五、块鼠标标志
            + + + + + + + + + + + + + + + + +
            名称样式说明
            .z-pointer
            +        .z-pointer{cursor:pointer;}
            +    
            显示手标志,即可点击状态
            .z-forbidden
            +        .z-forbidden{cursor:not-allowed;}
            +    
            禁止使用,显示禁止标志
            + +<#-- 六、块隐藏和显示 --> +
            六、块隐藏和显示
            + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称举例说明
            .z-hide
            .zi-hide
            +        .z-hide{display:none;}
            +        .zi-hide{display:none !important;}
            +        
            +
            隐藏,不占位
            + .z-show
            .z-show-b
            .z-show-ib
            + .zi-show
            .zi-show-b
            .zi-show-ib +
            +        .z-show{display:inline;}
            +        .z-show-b{display:block;}
            +        .z-show-ib{display:inline-block;}
            +        .zi-show{display:inline !important;}
            +        .zi-show-b{display:block !important;}
            +        .zi-show-ib{display:inline-block !important;}
            +        
            + 显示的三种状态
            + 1、z-show适用于<span>,<a>,<label>,<input>,<img>
            + 2、z-show-b适用<div>,<p>,<h1>,<form>,<ul><li>
            + 3、z-show-ib适用于把块作为内联方式。 +
            .z-visible
            .zi-visible
            +        .z-visible{visibility:visible !important;}
            +        .zi-visible{visibility:visible !important;}
            +    
            用于保留占位的显示
            .z-hidden
            .zi-hidden
            +        .z-hidden{visibility:hidden !important;}
            +        .zi-hidden{visibility:hidden !important;}
            +    
            用于保留占位的隐藏
            + +<#-- 七、块宽度 --> +
            七、块宽度定义(像素宽度 & 百分比宽度)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            宽度(w20-w1200)
            .z-w20
            .zi-w20
            +        .z-w20{width:20px;}
            +        .zi-w20{width:20px !important;}
            +    
            宽度
            宽度20px
            .z-w30
            .zi-w30
            +        .z-w30{width:30px;}
            +        .zi-w30{width:30px !important;}
            +    
            宽度
            宽度30px
            .z-w40
            .zi-w40
            +        .z-w40{width:40px;}
            +        .zi-w40{width:40px !important;}
            +    
            宽度
            宽度40px
            .z-w50
            .zi-w50
            +        .z-w50{width:50px;}
            +        .zi-w50{width:50px !important;}
            +    
            宽度
            宽度50px
            .z-w60
            .zi-w60
            +        .z-w60{width:60px;}
            +        .zi-w60{width:60px !important;}
            +    
            宽度
            宽度60px
            .z-w70
            .zi-w70
            +        .z-w70{width:70px;}
            +        .zi-w70{width:70px !important;}
            +    
            宽度
            宽度70px
            .z-w80
            .zi-w80
            +        .z-w80{width:80px;}
            +        .zi-w80{width:80px !important;}
            +    
            宽度
            宽度80px
            .z-w90
            .zi-w90
            +        .z-w90{width:90px;}
            +        .zi-w90{width:90px !important;}
            +    
            宽度
            宽度90px
            .z-w100
            .zi-w100
            +        .z-w100{width:100px;}
            +        .zi-w100{width:100px !important;}
            +    
            宽度
            宽度100px
            .z-w110
            .zi-w110
            +        .z-w110{width:110px;}
            +        .zi-w110{width:110px !important;}
            +    
            宽度
            宽度110px
            .z-w120
            .zi-w120
            +        .z-w120{width:120px;}
            +        .zi-w120{width:120px !important;}
            +    
            宽度
            宽度120px
            .z-w130
            .zi-w130
            +        .z-w130{width:130px;}
            +        .zi-w130{width:130px !important;}
            +    
            宽度
            宽度130px
            .z-w140
            .zi-w140
            +        .z-w140{width:140px;}
            +        .zi-w140{width:140px !important;}
            +    
            宽度
            宽度140px
            .z-w150
            .zi-w150
            +        .z-w150{width:150px;}
            +        .zi-w150{width:150px !important;}
            +    
            宽度
            宽度150px
            + .z-w200
            .zi-w200
            + .z-w300
            .zi-w300
            + .z-w400
            .zi-w400
            + .z-w500
            .zi-w500
            + .z-w600
            .zi-w600
            + .z-w700
            .zi-w700
            + .z-w800
            .zi-w800
            + .z-w900
            .zi-w900
            + .z-w1000
            .zi-w1000
            + .z-w1200
            .zi-w1200
            +
            +        .z-w200{width:200px;}
            +        .z-w300{width:300px;}
            +        .z-w400{width:400px;}
            +        .z-w500{width:500px;}
            +        .z-w600{width:600px;}
            +        .z-w700{width:700px;}
            +        .z-w800{width:800px;}
            +        .z-w900{width:900px;}
            +        .z-w1000{width:1000px;}
            +        .z-w1200{width:1200px;}
            +        
            +        .zi-w200{width:200px !important;}
            +        .zi-w300{width:300px !important;}
            +        .zi-w400{width:400px !important;}
            +        .zi-w500{width:500px !important;}
            +        .zi-w600{width:600px !important;}
            +        .zi-w700{width:700px !important;}
            +        .zi-w800{width:800px !important;}
            +        .zi-w900{width:900px !important;}
            +        .zi-w1000{width:1000px !important;}
            +        .zi-w1200{width:1200px !important;}
            +    
            宽度
            宽度200px
            宽度百分比
            .z-w5p
            .zi-w5p
            +        .z-w5p{width:5%;}
            +        .zi-w5p{width:5% !important;}
            +    
            宽度
            宽度5%
            .z-w8p
            .zi-w8p
            +        .z-w8p{width:8%;}
            +        .zi-w8p{width:8% !important;}
            +    
            宽度
            宽度8%
            .z-w10p
            .zi-w10p
            +        .z-w10p{width:10%;}
            +        .zi-w10p{width:10% !important;}
            +    
            宽度
            宽度10%
            .z-w12p
            .zi-w12p
            +        .z-w12p{width:12%;}
            +        .zi-w12p{width:12% !important;}
            +    
            宽度
            宽度12%
            .z-w15p
            .zi-w15p
            +        .z-w15p{width:15%;}
            +        .zi-w15p{width:15% !important;}
            +    
            宽度
            宽度15%
            .z-w20p
            .zi-w20p
            +        .z-w20p{width:20%;}
            +        .zi-w20p{width:20% !important;}
            +    
            宽度
            宽度20%
            .z-w30p
            .zi-w30p
            +        .z-w30p{width:30%;}
            +        .zi-w30p{width:30% !important;}
            +    
            宽度
            宽度30%
            .z-w40p
            .zi-w40p
            +        .z-w40p{width:40%;}
            +        .zi-w40p{width:40% !important;}
            +    
            宽度
            宽度40%
            .z-w50p
            .zi-w50p
            +        .z-w50p{width:50%;}
            +        .zi-w50p{width:50% !important;}
            +    
            宽度
            宽度50%
            .z-w60p
            .zi-w60p
            +        .z-w60p{width:60%;}
            +        .zi-w60p{width:60% !important;}
            +    
            宽度
            宽度60%
            .z-w70p
            .zi-w70p
            +        .z-w70p{width:70%;}
            +        .zi-w70p{width:70% !important;}
            +    
            宽度
            宽度70%
            .z-w80p
            .zi-w80p
            +        .z-w80p{width:80%;}
            +        .zi-w80p{width:80% !important;}
            +    
            宽度
            宽度80%
            .z-w90p
            .zi-w90p
            +        .z-w90p{width:90%;}
            +        .zi-w90p{width:90% !important;}
            +    
            宽度
            宽度90%
            .z-w100p
            .zi-w100p
            +        .z-w100p{width:100%;}
            +        .zi-w100p{width:100% !important;}
            +    
            宽度
            宽度100%
            .z-w100p2
            .zi-w100p2
            +        .z-w100p2{width:50%;}
            +        .zi-w100p2{width:50% !important;}
            +    
            宽度
            宽度二分之一
            .z-w100p3
            .zi-w100p3
            +        .z-w100p3{width:33.333333%;}
            +        .zi-w100p3{width:33.333333% !important;}
            +    
            宽度
            宽度三分之一
            .z-w100p4
            .zi-w100p4
            +        .z-w100p4{width:25%;}
            +        .zi-w100p4{width:25% !important;}
            +    
            宽度
            宽度四分之一
            .z-w100p5
            .zi-w100p5
            +        .z-w100p5{width:20%;}
            +        .zi-w100p5{width:20% !important;}
            +    
            宽度
            宽度五分之一
            .z-w100p6
            .zi-w100p6
            +        .z-w100p6{width:16.666666%;}
            +        .zi-w100p6{width:16.666666% !important;}
            +    
            宽度
            宽度六分之一
            .z-w100p7
            .zi-w100p7
            +        .z-w100p7{width:14.285714%;}
            +        .zi-w100p7{width:14.285714% !important;}
            +    
            宽度
            宽度七分之一
            .z-w100p8
            .zi-w100p8
            +        .z-w100p8{width:12.5%;}
            +        .zi-w100p8{width:12.5% !important;}
            +    
            宽度
            宽度八分之一
            .z-w100p9
            .zi-w100p9
            +        .z-w100p9{width:11.111111%;}
            +        .zi-w100p9{width:11.111111% !important;}
            +    
            宽度
            宽度九分之一
            + +<#-- 八、块高度定义 --> +
            八、块高度定义(像素高度 & 百分比高度)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            高度定义h20-h1200
            .z-h20
            .zi-h20
            +        .z-h20{height:20px;}
            +        .zi-h20{height:20px !important;}
            +    
            高度
            高度20px
            .z-h30
            .zi-h30
            +        .z-h30{height:30px;}
            +        .zi-h30{height:30px !important;}
            +    
            高度
            高度30px
            .z-h40
            .zi-h40
            +        .z-h40{height:40px;}
            +        .zi-h40{height:40px !important;}
            +    
            高度
            高度40px
            .z-h50
            .zi-h50
            +        .z-h50{height:50px;}
            +        .zi-h50{height:50px !important;}
            +    
            高度
            高度50px
            .z-h60
            .zi-h60
            +        .z-h60{height:60px;}
            +        .zi-h60{height:60px !important;}
            +    
            高度
            高度60px
            .z-h70
            .zi-h70
            +        .z-h70{height:70px;}
            +        .zi-h70{height:70px !important;}
            +    
            高度
            高度70px
            .z-h80
            .zi-h80
            +        .z-h80{height:80px;}
            +        .zi-h80{height:80px !important;}
            +    
            高度
            高度80px
            .z-h90
            .zi-h90
            +        .z-h90{height:90px;}
            +        .zi-h90{height:90px !important;}
            +    
            高度
            高度90px
            .z-h100
            .zi-h100
            +        .z-h100{height:100px;}
            +        .zi-h100{height:100px !important;}
            +    
            高度
            高度100px
            .z-h110
            .zi-h110
            +        .z-h110{height:110px;}
            +        .zi-h110{height:110px !important;}
            +    
            高度
            高度110px
            .z-h120
            .zi-h120
            +        .z-h120{height:120px;}
            +        .zi-h120{height:120px !important;}
            +    
            高度
            高度120px
            .z-h130
            .zi-h130
            +        .z-h130{height:130px;}
            +        .zi-h130{height:130px !important;}
            +    
            高度
            高度130px
            .z-h140
            .zi-h140
            +        .z-h140{height:140px;}
            +        .zi-h140{height:140px !important;}
            +    
            高度
            高度140px
            .z-h150
            .zi-h150
            +        .z-h150{height:150px;}
            +        .zi-h150{height:150px !important;}
            +    
            高度
            高度150px
            + .z-h200
            .zi-h200
            + .z-h300
            .zi-h300
            + .z-h400
            .zi-h400
            + .z-h500
            .zi-h500
            + .z-h600
            .zi-h600
            + .z-h700
            .zi-h700
            + .z-h800
            .zi-h800
            + .z-h900
            .zi-h900
            + .z-h1000
            .zi-h1000
            + .z-h1200
            .zi-h1200
            +
            +        .z-h200{height:200px;}
            +        .z-h300{height:300px;}
            +        .z-h400{height:400px;}
            +        .z-h500{height:500px;}
            +        .z-h600{height:600px;}
            +        .z-h700{height:700px;}
            +        .z-h800{height:800px;}
            +        .z-h900{height:900px;}
            +        .z-h1000{height:1000px;}
            +        .z-h1200{height:1200px;}
            +        
            +        .zi-h200{height:200px !important;}
            +        .zi-h300{height:300px !important;}
            +        .zi-h400{height:400px !important;}
            +        .zi-h500{height:500px !important;}
            +        .zi-h600{height:600px !important;}
            +        .zi-h700{height:700px !important;}
            +        .zi-h800{height:800px !important;}
            +        .zi-h900{height:900px !important;}
            +        .zi-h1000{height:1000px !important;}
            +        .zi-h1200{height:1200px !important;}
            +    
            高度
            高度200px
            高度百分比
            .z-h5p
            .zi-h5p
            +        .z-h5p{height:5%;}
            +        .zi-h5p{height:5% !important;}
            +    
            高度
            高度5%
            .z-h8p
            .zi-h8p
            +        .z-h8p{height:8%;}
            +        .zi-h8p{height:8% !important;}
            +    
            高度
            高度8%
            .z-h10p
            .zi-h10p
            +        .z-h10p{height:10%;}
            +        .zi-h10p{height:10% !important;}
            +    
            高度
            高度10%
            .z-h12p
            .zi-h12p
            +        .z-h12p{height:12%;}
            +        .zi-h12p{height:12% !important;}
            +    
            高度
            高度12%
            .z-h15p
            .zi-h15p
            +        .z-h15p{height:15%;}
            +        .zi-h15p{height:15% !important;}
            +    
            高度
            高度15%
            .z-h20p
            .zi-h20p
            +        .z-h20p{height:20%;}
            +        .zi-h20p{height:20% !important;}
            +    
            高度
            高度20%
            .z-h30p
            .zi-h30p
            +        .z-h30p{height:30%;}
            +        .zi-h30p{height:30% !important;}
            +    
            高度
            高度30%
            .z-h40p
            .zi-h40p
            +        .z-h40p{height:40%;}
            +        .zi-h40p{height:40% !important;}
            +    
            高度
            高度40%
            .z-h50p
            .zi-h50p
            +        .z-h50p{height:50%;}
            +        .zi-h50p{height:50% !important;}
            +    
            高度
            高度50%
            .z-h60p
            .zi-h60p
            +        .z-h60p{height:60%;}
            +        .zi-h60p{height:60% !important;}
            +    
            高度
            高度60%
            .z-h70p
            .zi-h70p
            +        .z-h70p{height:70%;}
            +        .zi-h70p{height:70% !important;}
            +    
            高度
            高度70%
            .z-h80p
            .zi-h80p
            +        .z-h80p{height:80%;}
            +        .zi-h80p{height:80% !important;}
            +    
            高度
            高度80%
            .z-h90p
            .zi-h90p
            +        .z-h90p{height:90%;}
            +        .zi-h90p{height:90% !important;}
            +    
            高度
            高度90%
            .z-h100p
            .zi-h100p
            +        .z-h100p{height:100%;}
            +        .zi-h100p{height:100% !important;}
            +    
            高度
            高度100%
            + +<#-- 九、块内边距定义 --> +
            九、块内边距定义(pd0-pd20),由于定义靠前,后续定义会覆盖,如果.z-pd{x}无效时请使用.zi-pd{x}
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            .z-pd0系列
            +        .z-pd0{padding:0;}
            +        .z-pd-l0{padding-left:0;}
            +        .z-pd-r0{padding-right:0;}
            +        .z-pd-t0{padding-top:0;}
            +        .z-pd-b0{padding-bottom:0;}
            +        
            +        .zi-pd0{padding:0 !important;}
            +        .zi-pd-l0{padding-left:0 !important;}
            +        .zi-pd-r0{padding-right:0 !important;}
            +        .zi-pd-t0{padding-top:0 !important;}
            +        .zi-pd-b0{padding-bottom:0 !important;}
            +    
            内边距
            内边距为0
            .z-pd3系列
            +        .z-pd3{padding:3px;}
            +        .z-pd-l3{padding-left:3px;}
            +        .z-pd-r3{padding-right:3px;}
            +        .z-pd-t3{padding-top:3px;}
            +        .z-pd-b3{padding-bottom:3px;}
            +        
            +        .zi-pd3{padding:3px !important;}
            +        .zi-pd-l3{padding-left:3px !important;}
            +        .zi-pd-r3{padding-right:3px !important;}
            +        .zi-pd-t3{padding-top:3px !important;}
            +        .zi-pd-b3{padding-bottom:3px !important;}
            +    
            内边距
            内边距为3
            .z-pd4系列
            +        .z-pd4{padding:4px;}
            +        .z-pd-l4{padding-left:4px;}
            +        .z-pd-r4{padding-right:4px;}
            +        .z-pd-t4{padding-top:4px;}
            +        .z-pd-b4{padding-bottom:4px;}
            +        
            +        .zi-pd4{padding:4px !important;}
            +        .zi-pd-l4{padding-left:4px !important;}
            +        .zi-pd-r4{padding-right:4px !important;}
            +        .zi-pd-t4{padding-top:4px !important;}
            +        .zi-pd-b4{padding-bottom:4px !important;}
            +    
            内边距
            内边距为4
            .z-pd5系列
            +        .z-pd5{padding:5px;}
            +        .z-pd-l5{padding-left:5px;}
            +        .z-pd-r5{padding-right:5px;}
            +        .z-pd-t5{padding-top:5px;}
            +        .z-pd-b5{padding-bottom:5px;}
            +        
            +        .zi-pd5{padding:5px !important;}
            +        .zi-pd-l5{padding-left:5px !important;}
            +        .zi-pd-r5{padding-right:5px !important;}
            +        .zi-pd-t5{padding-top:5px !important;}
            +        .zi-pd-b5{padding-bottom:5px !important;}
            +    
            内边距
            内边距为5
            .z-pd6系列
            +        .z-pd6{padding:6px;}
            +        .z-pd-l6{padding-left:6px;}
            +        .z-pd-r6{padding-right:6px;}
            +        .z-pd-t6{padding-top:6px;}
            +        .z-pd-b6{padding-bottom:6px;}
            +        
            +        .zi-pd6{padding:6px !important;}
            +        .zi-pd-l6{padding-left:6px !important;}
            +        .zi-pd-r6{padding-right:6px !important;}
            +        .zi-pd-t6{padding-top:6px !important;}
            +        .zi-pd-b6{padding-bottom:6px !important;}
            +    
            内边距
            内边距为6
            .z-pd8系列
            +        .z-pd8{padding:8px;}
            +        .z-pd-l8{padding-left:8px;}
            +        .z-pd-r8{padding-right:8px;}
            +        .z-pd-t8{padding-top:8px;}
            +        .z-pd-b8{padding-bottom:8px;}
            +        
            +        .zi-pd8{padding:8px !important;}
            +        .zi-pd-l8{padding-left:8px !important;}
            +        .zi-pd-r8{padding-right:8px !important;}
            +        .zi-pd-t8{padding-top:8px !important;}
            +        .zi-pd-b8{padding-bottom:8px !important;}
            +    
            内边距
            内边距为8
            .z-pd10系列
            +        .z-pd10{padding:10px;}
            +        .z-pd-l10{padding-left:10px;}
            +        .z-pd-r10{padding-right:10px;}
            +        .z-pd-t10{padding-top:10px;}
            +        .z-pd-b10{padding-bottom:10px;}
            +        
            +        .zi-pd10{padding:10px !important;}
            +        .zi-pd-l10{padding-left:10px !important;}
            +        .zi-pd-r10{padding-right:10px !important;}
            +        .zi-pd-t10{padding-top:10px !important;}
            +        .zi-pd-b10{padding-bottom:10px !important;}
            +    
            内边距
            内边距为10
            .z-pd12系列
            +        .z-pd12{padding:12px;}
            +        .z-pd-l12{padding-left:12px;}
            +        .z-pd-r12{padding-right:12px;}
            +        .z-pd-t12{padding-top:12px;}
            +        .z-pd-b12{padding-bottom:12px;}
            +        
            +        .zi-pd12{padding:12px !important;}
            +        .zi-pd-l12{padding-left:12px !important;}
            +        .zi-pd-r12{padding-right:12px !important;}
            +        .zi-pd-t12{padding-top:12px !important;}
            +        .zi-pd-b12{padding-bottom:12px !important;}
            +    
            内边距
            内边距为12
            .z-pd14系列
            +        .z-pd14{padding:14px;}
            +        .z-pd-l14{padding-left:14px;}
            +        .z-pd-r14{padding-right:14px;}
            +        .z-pd-t14{padding-top:14px;}
            +        .z-pd-b14{padding-bottom:14px;}
            +        
            +        .zi-pd14{padding:14px !important;}
            +        .zi-pd-l14{padding-left:14px !important;}
            +        .zi-pd-r14{padding-right:14px !important;}
            +        .zi-pd-t14{padding-top:14px !important;}
            +        .zi-pd-b14{padding-bottom:14px !important;}
            +    
            内边距
            内边距为14
            .z-pd15系列
            +        .z-pd15{padding:15px;}
            +        .z-pd-l15{padding-left:15px;}
            +        .z-pd-r15{padding-right:15px;}
            +        .z-pd-t15{padding-top:15px;}
            +        .z-pd-b15{padding-bottom:15px;}
            +        
            +        .zi-pd15{padding:15px !important;}
            +        .zi-pd-l15{padding-left:15px !important;}
            +        .zi-pd-r15{padding-right:15px !important;}
            +        .zi-pd-t15{padding-top:15px !important;}
            +        .zi-pd-b15{padding-bottom:15px !important;}
            +    
            内边距
            内边距为15
            .z-pd16系列
            +        .z-pd16{padding:16px;}
            +        .z-pd-l16{padding-left:16px;}
            +        .z-pd-r16{padding-right:16px;}
            +        .z-pd-t16{padding-top:16px;}
            +        .z-pd-b16{padding-bottom:16px;}
            +        
            +        .zi-pd16{padding:16px !important;}
            +        .zi-pd-l16{padding-left:16px !important;}
            +        .zi-pd-r16{padding-right:16px !important;}
            +        .zi-pd-t16{padding-top:16px !important;}
            +        .zi-pd-b16{padding-bottom:16px !important;}
            +    
            内边距
            内边距为16
            .z-pd18系列
            +        .z-pd18{padding:18px;}
            +        .z-pd-l18{padding-left:18px;}
            +        .z-pd-r18{padding-right:18px;}
            +        .z-pd-t18{padding-top:18px;}
            +        .z-pd-b18{padding-bottom:18px;}
            +        
            +        .zi-pd18{padding:18px !important;}
            +        .zi-pd-l18{padding-left:18px !important;}
            +        .zi-pd-r18{padding-right:18px !important;}
            +        .zi-pd-t18{padding-top:18px !important;}
            +        .zi-pd-b18{padding-bottom:18px !important;}
            +    
            内边距
            内边距为18
            .z-pd20系列
            +        .z-pd20{padding:20px;}
            +        .z-pd-l20{padding-left:20px;}
            +        .z-pd-r20{padding-right:20px;}
            +        .z-pd-t20{padding-top:20px;}
            +        .z-pd-b20{padding-bottom:20px;}
            +        
            +        .zi-pd20{padding:20px !important;}
            +        .zi-pd-l20{padding-left:20px !important;}
            +        .zi-pd-r20{padding-right:20px !important;}
            +        .zi-pd-t20{padding-top:20px !important;}
            +        .zi-pd-b20{padding-bottom:20px !important;}
            +    
            内边距
            内边距为20
            + +<#-- 十、块外边距定义 --> +
            十、块外边距定义(mg0-mg20),由于定义靠前,后续定义会覆盖,如果.z-mg{x}无效时请使用.zi-mg{x}
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            .z-mg0系列
            +        .z-mg0{margin:0;}
            +        .z-mg-l0{margin-left:0;}
            +        .z-mg-r0{margin-right:0;}
            +        .z-mg-t0{margin-top:0;}
            +        .z-mg-b0{margin-bottom:0;}
            +        
            +        .zi-mg0{margin:0 !important;}
            +        .zi-mg-l0{margin-left:0 !important;}
            +        .zi-mg-r0{margin-right:0 !important;}
            +        .zi-mg-t0{margin-top:0 !important;}
            +        .zi-mg-b0{margin-bottom:0 !important;}
            +    
            外边距
            外边距为0
            .z-mg3系列
            +        .z-mg3{margin:3px;}
            +        .z-mg-l3{margin-left:3px;}
            +        .z-mg-r3{margin-right:3px;}
            +        .z-mg-t3{margin-top:3px;}
            +        .z-mg-b3{margin-bottom:3px;}
            +        
            +        .zi-mg3{margin:3px !important;}
            +        .zi-mg-l3{margin-left:3px !important;}
            +        .zi-mg-r3{margin-right:3px !important;}
            +        .zi-mg-t3{margin-top:3px !important;}
            +        .zi-mg-b3{margin-bottom:3px !important;}
            +    
            外边距
            外边距为3
            .z-mg4系列
            +        .z-mg4{margin:4px;}
            +        .z-mg-l4{margin-left:4px;}
            +        .z-mg-r4{margin-right:4px;}
            +        .z-mg-t4{margin-top:4px;}
            +        .z-mg-b4{margin-bottom:4px;}
            +        
            +        .zi-mg4{margin:4px !important;}
            +        .zi-mg-l4{margin-left:4px !important;}
            +        .zi-mg-r4{margin-right:4px !important;}
            +        .zi-mg-t4{margin-top:4px !important;}
            +        .zi-mg-b4{margin-bottom:4px !important;}
            +    
            外边距
            外边距为4
            .z-mg5系列
            +        .z-mg5{margin:5px;}
            +        .z-mg-l5{margin-left:5px;}
            +        .z-mg-r5{margin-right:5px;}
            +        .z-mg-t5{margin-top:5px;}
            +        .z-mg-b5{margin-bottom:5px;}
            +        
            +        .zi-mg5{margin:5px !important;}
            +        .zi-mg-l5{margin-left:5px !important;}
            +        .zi-mg-r5{margin-right:5px !important;}
            +        .zi-mg-t5{margin-top:5px !important;}
            +        .zi-mg-b5{margin-bottom:5px !important;}
            +    
            外边距
            外边距为5
            .z-mg6系列
            +        .z-mg6{margin:6px;}
            +        .z-mg-l6{margin-left:6px;}
            +        .z-mg-r6{margin-right:6px;}
            +        .z-mg-t6{margin-top:6px;}
            +        .z-mg-b6{margin-bottom:6px;}
            +        
            +        .zi-mg6{margin:6px !important;}
            +        .zi-mg-l6{margin-left:6px !important;}
            +        .zi-mg-r6{margin-right:6px !important;}
            +        .zi-mg-t6{margin-top:6px !important;}
            +        .zi-mg-b6{margin-bottom:6px !important;}
            +    
            外边距
            外边距为6
            .z-mg8系列
            +        .z-mg8{margin:8px;}
            +        .z-mg-l8{margin-left:8px;}
            +        .z-mg-r8{margin-right:8px;}
            +        .z-mg-t8{margin-top:8px;}
            +        .z-mg-b8{margin-bottom:8px;}
            +        
            +        .zi-mg8{margin:8px !important;}
            +        .zi-mg-l8{margin-left:8px !important;}
            +        .zi-mg-r8{margin-right:8px !important;}
            +        .zi-mg-t8{margin-top:8px !important;}
            +        .zi-mg-b8{margin-bottom:8px !important;}
            +    
            外边距
            外边距为8
            .z-mg10系列
            +        .z-mg10{margin:10px;}
            +        .z-mg-l10{margin-left:10px;}
            +        .z-mg-r10{margin-right:10px;}
            +        .z-mg-t10{margin-top:10px;}
            +        .z-mg-b10{margin-bottom:10px;}
            +        
            +        .zi-mg10{margin:10px !important;}
            +        .zi-mg-l10{margin-left:10px !important;}
            +        .zi-mg-r10{margin-right:10px !important;}
            +        .zi-mg-t10{margin-top:10px !important;}
            +        .zi-mg-b10{margin-bottom:10px !important;}
            +    
            外边距
            外边距为10
            .z-mg12系列
            +        .z-mg12{margin:12px;}
            +        .z-mg-l12{margin-left:12px;}
            +        .z-mg-r12{margin-right:12px;}
            +        .z-mg-t12{margin-top:12px;}
            +        .z-mg-b12{margin-bottom:12px;}
            +        
            +        .zi-mg12{margin:12px !important;}
            +        .zi-mg-l12{margin-left:12px !important;}
            +        .zi-mg-r12{margin-right:12px !important;}
            +        .zi-mg-t12{margin-top:12px !important;}
            +        .zi-mg-b12{margin-bottom:12px !important;}
            +    
            外边距
            外边距为12
            .z-mg14系列
            +        .z-mg14{margin:14px;}
            +        .z-mg-l14{margin-left:14px;}
            +        .z-mg-r14{margin-right:14px;}
            +        .z-mg-t14{margin-top:14px;}
            +        .z-mg-b14{margin-bottom:14px;}
            +        
            +        .zi-mg14{margin:14px !important;}
            +        .zi-mg-l14{margin-left:14px !important;}
            +        .zi-mg-r14{margin-right:14px !important;}
            +        .zi-mg-t14{margin-top:14px !important;}
            +        .zi-mg-b14{margin-bottom:14px !important;}
            +    
            外边距
            外边距为14
            .z-mg15系列
            +        .z-mg15{margin:15px;}
            +        .z-mg-l15{margin-left:15px;}
            +        .z-mg-r15{margin-right:15px;}
            +        .z-mg-t15{margin-top:15px;}
            +        .z-mg-b15{margin-bottom:15px;}
            +        
            +        .zi-mg15{margin:15px !important;}
            +        .zi-mg-l15{margin-left:15px !important;}
            +        .zi-mg-r15{margin-right:15px !important;}
            +        .zi-mg-t15{margin-top:15px !important;}
            +        .zi-mg-b15{margin-bottom:15px !important;}
            +    
            外边距
            外边距为15
            .z-mg16系列
            +        .z-mg16{margin:16px;}
            +        .z-mg-l16{margin-left:16px;}
            +        .z-mg-r16{margin-right:16px;}
            +        .z-mg-t16{margin-top:16px;}
            +        .z-mg-b16{margin-bottom:16px;}
            +        
            +        .zi-mg16{margin:16px !important;}
            +        .zi-mg-l16{margin-left:16px !important;}
            +        .zi-mg-r16{margin-right:16px !important;}
            +        .zi-mg-t16{margin-top:16px !important;}
            +        .zi-mg-b16{margin-bottom:16px !important;}
            +    
            外边距
            外边距为16
            .z-mg18系列
            +        .z-mg18{margin:18px;}
            +        .z-mg-l18{margin-left:18px;}
            +        .z-mg-r18{margin-right:18px;}
            +        .z-mg-t18{margin-top:18px;}
            +        .z-mg-b18{margin-bottom:18px;}
            +        
            +        .zi-mg18{margin:18px !important;}
            +        .zi-mg-l18{margin-left:18px !important;}
            +        .zi-mg-r18{margin-right:18px !important;}
            +        .zi-mg-t18{margin-top:18px !important;}
            +        .zi-mg-b18{margin-bottom:18px !important;}
            +    
            外边距
            外边距为18
            .z-mg20系列
            +        .z-mg20{margin:20px;}
            +        .z-mg-l20{margin-left:20px;}
            +        .z-mg-r20{margin-right:20px;}
            +        .z-mg-t20{margin-top:20px;}
            +        .z-mg-b20{margin-bottom:20px;}
            +        
            +        .zi-mg20{margin:20px !important;}
            +        .zi-mg-l20{margin-left:20px !important;}
            +        .zi-mg-r20{margin-right:20px !important;}
            +        .zi-mg-t20{margin-top:20px !important;}
            +        .zi-mg-b20{margin-bottom:20px !important;}
            +    
            外边距
            外边距为20
            .z-mg30系列
            +        .z-mg30{margin:30px;}
            +        .z-mg-l30{margin-left:30px;}
            +        .z-mg-r30{margin-right:30px;}
            +        .z-mg-t30{margin-top:30px;}
            +        .z-mg-b30{margin-bottom:30px;}
            +        
            +        .zi-mg30{margin:30px !important;}
            +        .zi-mg-l30{margin-left:30px !important;}
            +        .zi-mg-r30{margin-right:30px !important;}
            +        .zi-mg-t30{margin-top:30px !important;}
            +        .zi-mg-b30{margin-bottom:30px !important;}
            +    
            外边距
            外边距为30
            .z-mg40系列
            +        .z-mg40{margin:40px;}
            +        .z-mg-l40{margin-left:40px;}
            +        .z-mg-r40{margin-right:40px;}
            +        .z-mg-t40{margin-top:40px;}
            +        .z-mg-b40{margin-bottom:40px;}
            +        
            +        .zi-mg40{margin:40px !important;}
            +        .zi-mg-l40{margin-left:40px !important;}
            +        .zi-mg-r40{margin-right:40px !important;}
            +        .zi-mg-t40{margin-top:40px !important;}
            +        .zi-mg-b40{margin-bottom:40px !important;}
            +    
            外边距
            外边距为40
            .z-mg50系列
            +        .z-mg50{margin:50px;}
            +        .z-mg-l50{margin-left:50px;}
            +        .z-mg-r50{margin-right:50px;}
            +        .z-mg-t50{margin-top:50px;}
            +        .z-mg-b50{margin-bottom:50px;}
            +        
            +        .zi-mg50{margin:50px !important;}
            +        .zi-mg-l50{margin-left:50px !important;}
            +        .zi-mg-r50{margin-right:50px !important;}
            +        .zi-mg-t50{margin-top:50px !important;}
            +        .zi-mg-b50{margin-bottom:50px !important;}
            +    
            外边距
            外边距为50
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/css/color.htm b/zhiqim_ui/document/tutorial/ui/css/color.htm new file mode 100644 index 0000000..3f448bc --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/css/color.htm @@ -0,0 +1,613 @@ +<#def title = "颜色定义"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "颜色定义是指在ZhiqimUI的核心CSS文件中,默认提供的全局、白色、黑色和红、橙、黄、绿、青、蓝、紫共十种颜色的定义,包括字体颜色、背景颜色和边框颜色等,以及对应的样式名称。"/> +<#def prevUrl = "css.htm"/> +<#def nextUrl = "font.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "css", "color")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "颜色定义")} +
            + +<#-- 标题 --> +
            +

            颜色定义:

            +

            + 颜色定义是指在ZhiqimUI的核心CSS文件中,默认提供的全局、白色、黑色和红、橙、黄、绿、青、蓝、紫共十种颜色的定义,包括字体颜色、背景颜色和边框颜色等,以及对应的样式名称。 +

            +
            + +<#var colorMap = Jsons.toMapSS(context.getResourceString("/document/tutorial/ui/css/zhiqim.pre.json", "UTF-8"))/> + +<#-- 全局颜色 --> +
            全局颜色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            全局文本颜色${textColor}${colorMap.get("textColor")}全局颜色全局颜色定义,定义在body中
            全局背景颜色${bgColor}${colorMap.get("bgColor")}全局背景全局背景颜色,定义在body中
            全局链接颜色${linkColor}${colorMap.get("linkColor")}链接效果全局链接颜色,定义在a,a:visited中
            全局链接Hover颜色${linkHoverColor}${colorMap.get("linkHoverColor")}全局链接颜色,定义在a:hover,a:focus,a:active中
            + +<#-- 白色 --> +
            白色
            + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            白色文本${whiteTextColor}${colorMap.get("whiteTextColor")}白色文本.z-text-white
            白色背景${whiteBgColor}${colorMap.get("whiteBgColor")}白色背景.z-bg-white
            + +<#-- 黑色 --> +
            黑色
            + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            黑色文本${blackTextColor}${colorMap.get("blackTextColor")}黑色文本.z-text-black
            黑色背景${blackBgColor}${colorMap.get("blackBgColor")}黑色背景.z-bg-black
            + +<#-- 灰色 --> +
            灰色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            灰色文本${grayTextColor}${colorMap.get("grayTextColor")}灰色文本.z-text-gray
            灰色背景${grayBgColor}${colorMap.get("grayBgColor")}灰色背景.z-bg-gray
            灰色边框${grayBdColor}${colorMap.get("grayBdColor")}灰色边框.z-bd
            灰色按钮文本${btnTextColor}${colorMap.get("btnTextColor")}灰色按钮 +
            +
            灰色按钮
            +
            灰色按钮
            + (按钮、筛选按钮) +
            +
            +
            橙色按钮
            +
            橙色按钮
            +
            橙色按钮
            + (多选按钮三种状态) +
            +
            灰色按钮边框和背景${btnBdColor}
            ${btnBgColor}
            ${colorMap.get("btnBdColor")}
            ${colorMap.get("btnBgColor")}
            灰色按钮
            灰色hover背景${btnBgHoverColor}${colorMap.get("btnBgHoverColor")}
            灰色按钮
            灰色按钮active背景${btnBgActiveColor}${colorMap.get("btnBgActiveColor")}
            灰色按钮
            + +<#-- 红色 --> +
            红色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            红色文本${redTextColor}${colorMap.get("redTextColor")}红色文本.z-text-red
            红色背景${redBgColor}${colorMap.get("redBgColor")}红色背景.z-bg-red
            红色边框${redBdColor}${colorMap.get("redBdColor")}红色边框.z-bd.z-red
            红色按钮边框${redBtnBdColor}${colorMap.get("redBtnBdColor")}
            红色按钮
            +
            +
            红色按钮
            +
            红色按钮
            +
            红色按钮
            + (按钮、筛选按钮) +
            +
            +
            红色按钮
            +
            红色按钮
            +
            红色按钮
            + (多选按钮三种状态) +
            +
            红色hover背景${redHoverColor}${colorMap.get("redHoverColor")}
            红色按钮
            + +<#-- 橙色 --> +
            橙色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            橙色文本${orangeTextColor}${colorMap.get("orangeTextColor")}橙色文本.z-text-orange
            橙色背景${orangeBgColor}${colorMap.get("orangeBgColor")}橙色背景.z-bg-orange
            橙色边框${orangeBdColor}${colorMap.get("orangeBdColor")}橙色边框.z-bd.z-orange
            橙色按钮边框${orangeBtnBdColor}${colorMap.get("orangeBtnBdColor")}
            橙色按钮
            +
            +
            橙色按钮
            +
            橙色按钮
            +
            橙色按钮
            + (按钮、筛选按钮) +
            +
            +
            橙色按钮
            +
            橙色按钮
            +
            橙色按钮
            + (多选按钮三种状态) +
            +
            橙色hover背景${orangeHoverColor}${colorMap.get("orangeHoverColor")}
            橙色按钮
            + +<#-- 黄色 --> +
            黄色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            黄色文本${yellowTextColor}${colorMap.get("yellowTextColor")}黄色文本.z-text-yellow
            黄色背景${yellowBgColor}${colorMap.get("yellowBgColor")}黄色背景.z-bg-yellow
            黄色边框${yellowBdColor}${colorMap.get("yellowBdColor")}黄色边框.z-bd.z-yellow
            黄色按钮边框${yellowBtnBdColor}${colorMap.get("yellowBtnBdColor")}
            黄色按钮
            +
            +
            黄色按钮
            +
            黄色按钮
            +
            黄色按钮
            + (按钮、筛选按钮) +
            +
            +
            黄色按钮
            +
            黄色按钮
            +
            黄色按钮
            + (多选按钮三种状态) +
            +
            黄色hover背景${yellowHoverColor}${colorMap.get("yellowHoverColor")}
            黄色按钮
            + +<#-- 绿色 --> +
            绿色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            绿色文本${greenTextColor}${colorMap.get("greenTextColor")}绿色文本.z-text-green
            绿色背景${greenBgColor}${colorMap.get("greenBgColor")}绿色背景.z-bg-green
            绿色边框${greenBdColor}${colorMap.get("greenBdColor")}绿色边框.z-bd.z-green
            绿色按钮边框${greenBtnBdColor}${colorMap.get("greenBtnBdColor")}
            绿色按钮
            +
            +
            绿色按钮
            +
            绿色按钮
            +
            绿色按钮
            + (按钮、筛选按钮) +
            +
            +
            绿色按钮
            +
            绿色按钮
            +
            绿色按钮
            + (多选按钮三种状态) +
            +
            绿色hover背景${greenHoverColor}${colorMap.get("greenHoverColor")}
            绿色按钮
            + +<#--青色 --> +
            青色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            青色
            名称通配符缺省值举例说明
            青色文本${cyanTextColor}${colorMap.get("cyanTextColor")}青色文本.z-text-cyan
            青色背景${cyanBgColor}${colorMap.get("cyanBgColor")}青色背景.z-bg-cyan
            青色边框${cyanBdColor}${colorMap.get("cyanBdColor")}青色边框.z-bd.z-cyan
            青色按钮边框${cyanBtnBdColor}${colorMap.get("cyanBtnBdColor")}
            青色按钮
            +
            +
            青色按钮
            +
            青色按钮
            +
            青色按钮
            + (按钮、筛选按钮) +
            +
            +
            青色按钮
            +
            青色按钮
            +
            青色按钮
            + (多选按钮三种状态) +
            +
            青色hover背景${cyanHoverColor}${colorMap.get("cyanHoverColor")}
            青色按钮
            + +<#--蓝色 --> +
            蓝色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            蓝色文本${blueTextColor}${colorMap.get("blueTextColor")}蓝色文本.z-text-blue
            蓝色背景${blueBgColor}${colorMap.get("blueBgColor")}蓝色背景.z-bg-blue
            蓝色边框${blueBdColor}${colorMap.get("blueBdColor")}蓝色边框.z-bd.z-blue
            蓝色按钮边框${blueBtnBdColor}${colorMap.get("blueBtnBdColor")}
            蓝色按钮
            +
            +
            蓝色按钮
            +
            蓝色按钮
            +
            蓝色按钮
            + (按钮、筛选按钮) +
            +
            +
            蓝色按钮
            +
            蓝色按钮
            +
            蓝色按钮
            + (多选按钮三种状态) +
            +
            蓝色hover背景${blueHoverColor}${colorMap.get("blueHoverColor")}
            蓝色按钮
            + +<#--紫色 --> +
            紫色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            紫色文本${purpleTextColor}${colorMap.get("purpleTextColor")}紫色文本.z-text-purple
            紫色背景${purpleBgColor}${colorMap.get("purpleBgColor")}紫色背景.z-bg-purple
            紫色边框${purpleBdColor}${colorMap.get("purpleBdColor")}紫色边框.z-bd.z-purple
            紫色按钮边框${purpleBtnBdColor}${colorMap.get("purpleBtnBdColor")}
            紫色按钮
            +
            +
            紫色按钮
            +
            紫色按钮
            +
            紫色按钮
            + (按钮、筛选按钮) +
            +
            +
            紫色按钮
            +
            紫色按钮
            +
            紫色按钮
            + (多选按钮三种状态) +
            +
            紫色hover背景${purpleHoverColor}${colorMap.get("purpleHoverColor")}
            紫色按钮
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/css/css.htm b/zhiqim_ui/document/tutorial/ui/css/css.htm new file mode 100644 index 0000000..7f8cfb4 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/css/css.htm @@ -0,0 +1,250 @@ +<#def title = "全局定义"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "全局定义是指在全局定义里的标签缺省下的样式规则,包括三部分。"/> +<#def prevUrl = "../index.htm"/> +<#def nextUrl = "color.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "css", "global")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "全局定义")} +
            + +<#-- 标题 --> +
            +

            全局定义:

            +

            + 全局定义是指在全局定义里的标签缺省下的样式规则,包括三部分:
            + 1、HTML5新模板和兼容:包括十二个block新标签、三个inline-block新标签,以及隐藏等其他属性;
            + 2、全局标记一致性定义:约定html、body、img、p等标签在所有浏览器中一致性定义;
            + 3、表单一致性定义:约定button、input、checkbox、radio等表单属性在所有浏览器中一致性定义。
            +

            +
            + +<#-- 全局HTML5新模板和兼容问题 --> +
            全局HTML5新模板和兼容问题
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            一、十二个新标签(block):
            + +article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;} + +
            二、三个新标签(inline-block):
            + +audio,canvas,video{display:inline-block;vertical-align:baseline;} + +
            三、音频模块兼容性问题
            + +audio:not([controls]){display:none;height:0;} + +为防止主流浏览器中,显示"不带控制按钮的音频模块"这一问题。以及解决iOS5移动端显示多余高度的兼容性问题。 + +
            四、有隐藏属性或标记为模板的的设置为隐藏
            + +[hidden],template{display:none;} + +
            五、设置svg非根元素的元素不显示仅占位
            + +svg:not(:root){overflow:hidden;} + +只支持一个根元素如(<svg></svg>),除了<svg>内部的,其他的都不显示 + +
            + +<#-- 全局标记一致性定义 --> +
            全局标记一致性定义
            + + + + + + + + + + + + + + + + + + + + +
            一、所有标签(*,*:before,*:after)
            + +*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} +*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} + +默认所有元素含插入内容前后宽高设置采用border-box方式,即宽高包括border和padding,向内扩充 + +
            二、HTML标签
            + +html{ + font-family:"微软雅黑","宋体",Arial,sans-serif; + overflow-x:hidden;overflow-y:auto; + -ms-text-size-adjust:100%; + -webkit-text-size-adjust:100%; + -webkit-tap-highlight-color:rgba(0, 0, 0, 0);/*iOS高亮色不透明*/ + height:100%; +} + +1、设置全局字体,防止一些设备上字体随屏幕放大而改变字体大小,如webkit的Safari +2、指定文档隐藏X轴滚动条,Y轴滚动条自动 +3、当屏幕横坚切换时字体大小调整和以前一样 +4、iOS下链接点中是修改为黑色 + +
            二、默认字体大小行高颜色、背景颜色,无外边框
            + +body{color:#333;background-color:#fff;} +body,table,td,div{font-size:12px;line-height:120%;} +body,form,figure{margin:0;} + +
            三、图片无边框、居中、不超时父边框宽高,IE7以上支持缩放不失真(bicubic)
            + +img{border:0;vertical-align:middle;max-width:100%;max-height:100%;-ms-interpolation-mode:bicubic;} + +
            四、段落无内外边距,这样p和br功能相同
            + +p{margin:0px;padding:0px;} + +
            五、字段集合默认边框、左右两像素外边距,和内边距设置,名称无边框和内边距
            + +p{margin:0px;padding:0px;} + +
            六、分隔线修改为上边框一条1像素的线,上下1em高度
            + +hr{ + -webkit-box-sizing:content-box; + -moz-box-sizing:content-box; + box-sizing:content-box; + height:0;border:0;border-top:1px solid #eee;margin:1em 0; +} + +
            七、列表无前序号,无内外边距,行高1.25em
            + +ul,dl,ol,li{list-style:none;padding:0;margin:0;} +li{line-height:1.25em;} + +
            八、链接,初始和访问后相同,淡黑色背景透明,移入无下标线、默认淡青色
            + +a,a:visited{color:#333;text-decoration:none;background-color:transparent;} +a:focus{color:#43cd6e;outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +a:active,a:hover{color:#43cd6e;outline:0;text-decoration:underline;} + +这里是文本连接效果 + +
            + +<#-- 表单一致性定义 --> +
            表单一致性定义
            + + + + + + + + + + + + + + + + + + +
            一、统一按钮和输入框无内外边距(Firefox默认按扭和输入框padding 0 2px)
            + +button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;} + +
            二、输入框行高强制成正常(各个浏览器默认值不一样)
            + +input{line-height:normal;} + +
            三、表单控件不显示选中边框(webkit默认有边框)
            + +button,input,select,optgroup,textarea{color:inherit;font:inherit;margin:0;outline:none;} + +
            四、按钮可见,webkit渲染,不可用时手势为禁止,取消可能的大小写文本转换
            + +button{overflow:visible;} +button,html input[type="button"],input[type="reset"],input[type="submit"] {-webkit-appearance:button;cursor:pointer;} +button[disabled],html input[disabled]{cursor:not-allowed;} +button,select{text-transform:none;} + +
            五、单多选按钮有2像素偏下,IE高度和背景白色问题,修改成高度为13px,背景透明
            + +input[type="checkbox"],input[type="radio"]{margin-top:-2px;border:0;padding:0;vertical-align:middle;height:13px;background-color:transparent;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} + +
            六、选项框(select)中的分组默认加粗
            + +optgroup{font-weight:bold;} + +
            七、移动设备上webkit自定义数字框高度自动
            + +input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto;} + +
            八、移动设备上webkit自定义搜索框为文本字段,宽高设置采用content-box,按钮取消原生样式
            + +input[type="search"]{ + -webkit-appearance:textfield; + -webkit-box-sizing:content-box; + -moz-box-sizing:content-box; + box-sizing:content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration{ + -webkit-appearance:none; +} + +
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/css/font.htm b/zhiqim_ui/document/tutorial/ui/css/font.htm new file mode 100644 index 0000000..1265016 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/css/font.htm @@ -0,0 +1,917 @@ +<#def title = "字体图标"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "“字体图标”是矢量图片按字体规范设计的一种新的图标,知启蒙字体图标放在/service/res/font/zhiqim.woff文件中,当前开发和收集的图标分"/> +<#def prevUrl = "color.htm"/> +<#def nextUrl = "ico.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "css", "font")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "字体图标")} +
            + +<#-- 标题 --> +
            +

            什么是“字体图标”?

            +

            + “字体图标”是矢量图片按字体规范设计的一种新的图标,知启蒙字体图标放在/service/res/font/zhiqim.woff文件中,当前开发和收集的图标分 + 操作类、文档类、设备类、图表类、实体类五种,共五十九个图标。 + 字体图标不支持斜体,以便使用<i>标签来定义,如<i class="z-font z-config"></i> +

            +
            + +<#-- 操作类 --> +
            一、操作类图标,编码范围(f000-f03f),共18个
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            样式编码图标
            .z-font.z-config&#xf000; 字体 字体 字体
            .z-font.z-add&#xf001; 字体 字体 字体
            .z-font.z-modify&#xf002; 字体 字体 字体
            .z-font.z-delete&#xf003; 字体 字体 字体
            .z-font.z-query&#xf004; 字体 字体 字体
            .z-font.z-previous&#xf005; 字体 字体 字体
            .z-font.z-next&#xf006; 字体 字体 字体
            .z-font.z-open&#xf007; 字体 字体 字体
            .z-font.z-close&#xf008; 字体 字体 字体
            .z-font.z-upload&#xf009; 字体 字体 字体
            .z-font.z-save或.z-font.z-finish&#xf00a; 字体 字体 字体
            .z-font.z-return&#xf00b; 字体 字体 字体
            .z-font.z-refresh&#xf00c; 字体 字体 字体
            .z-font.z-success&#xf00d; 字体 字体 字体
            .z-font.z-error&#xf00e; 字体 字体 字体
            .z-font.z-setting&#xf00f; 字体 字体 字体
            .z-font.z-share&#xf010; 字体 字体 字体
            .z-font.z-download&#xf011; 字体 字体 字体
            + +<#-- 文档类 --> +
            二、文档类图标,编码范围(f040-f05f),共10个
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            样式编码图标
            .z-font.z-folder&#xf040; 字体
            .z-font.z-collect&#xf041; 字体
            .z-font.z-briefcase&#xf042; 字体
            .z-font.z-image-text&#xf043; 字体
            .z-font.z-text&#xf044; 字体
            .z-font.z-picture&#xf045; 字体
            .z-font.z-video&#xf046; 字体
            .z-font.z-voice&#xf047; 字体
            .z-font.z-camera&#xf048; 字体
            .z-font.z-print&#xf049; 字体
            + +<#-- 设备类 --> +
            三、设备类图标,编码范围(f060-f07f),共9个
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            样式编码图标
            .z-font.z-computer&#xf060; 字体
            .z-font.z-phone&#xf061; 字体
            .z-font.z-monitor&#xf062; 字体
            .z-font.z-email&#xf063; 字体
            .z-font.z-internet&#xf064; 字体
            .z-font.z-switch&#xf065; 字体
            .z-font.z-wifi&#xf066; 字体
            .z-font.z-cloud&#xf067; 字体
            .z-font.z-port&#xf068; 字体
            + +<#-- 图表类 --> +
            四、图表类图标,编码范围(f080-f09f),共14个
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            样式编码图标
            .z-font.z-list&#xf080;
            .z-font.z-apps&#xf081;
            .z-font.z-pie-chart&#xf082;
            .z-font.z-histogram&#xf083;
            .z-font.z-graph&#xf084;
            .z-font.z-diagram&#xf085;
            .z-font.z-arrow-down&#xf086;
            .z-font.z-arrow-up&#xf087;
            .z-font.z-arrow-left&#xf088;
            .z-font.z-arrow-right&#xf089;
            .z-font.z-arrowhead-down&#xf08a;
            .z-font.z-arrowhead-up&#xf08b;
            .z-font.z-arrowhead-left&#xf08c;
            .z-font.z-arrowhead-right&#xf08c;
            + +<#-- 实体类 --> +
            五、实体类图标,编码范围(f0a0-f0bf),共8个
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            样式编码图标
            .z-font.z-customer&#xf0a0;
            .z-font.z-cash&#xf0a1;
            .z-font.z-house&#xf0a2;
            .z-font.z-flower&#xf0a3;
            .z-font.z-box&#xf0a4;
            .z-font.z-desk&#xf0a5;
            .z-font.z-gift&#xf0a6;
            .z-font.z-lock&#xf0a7;
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/css/ico.htm b/zhiqim_ui/document/tutorial/ui/css/ico.htm new file mode 100644 index 0000000..86285b7 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/css/ico.htm @@ -0,0 +1,1098 @@ +<#def title = "图片图标"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "“图片图标”是把一组小图标图片拼成一张大图,通过CSS的background-position特性指定小图标在大图中的位置和宽高显示图标,"/> +<#def prevUrl = "font.htm"/> +<#def nextUrl = "text.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "css", "ico")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "图片图标")} +
            + +<#-- 标题 --> +
            +

            什么是“图片图标”?

            +

            + “图片图标”是把一组小图标图片拼成一张大图,通过CSS的background-position特性指定小图标在大图中的位置和宽高显示图标, + 知启蒙图片图标放在/service/res/image目录下,根据大小和类型分为12px、16px、22px、36px以及文件图标、树图标等,在这里还利用三角型和圆型生成箭头和圆圈等样式。 +

            +
            + +<#-- 操作类 --> +
            一、文件类型图标,共九个
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            样式编码举例说明
            .z-ico.z-file.z-word
            +    <i class="z-ico z-file z-word"></i>
            +        
            +
            word图标
            .z-ico.z-file.z-image
            +    <i class="z-ico z-file z-image"></i>
            +        
            +
            图片图标
            .z-ico.z-file.z-pdf
            +    <i class="z-ico z-file z-pdf"></i>
            +        
            +
            pdf图标
            .z-ico.z-file.z-video
            +    <i class="z-ico z-file z-video"></i>
            +        
            +
            影像图标
            .z-ico.z-file.z-music
            +    <i class="z-ico z-file z-music"></i>
            +        
            +
            音乐图标
            .z-ico.z-file.z-text
            +    <i class="z-ico z-file z-text"></i>
            +        
            +
            文本图标
            .z-ico.z-file.z-list
            +    <i class="z-ico z-file z-list"></i>
            +        
            +
            列表图标
            .z-ico.z-file.z-android
            +    <i class="z-ico z-file z-android"></i>
            +        
            +
            安卓图标
            .z-ico.z-file.z-png
            +    <i class="z-ico z-file z-png"></i>
            +        
            +
            图像文件图标
            + + + +<#-- 对话框图标 --> +
            二、对话框图标,共六个
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            样式编码举例说明
            .z-ico.z-confirm
            +    <i class="z-ico z-confirm"></i>
            +        
            +
            确认图标
            .z-ico.z-loading
            +    <i class="z-ico z-alert"></i>
            +        
            +
            警告图标
            .z-ico.z-loading
            +    <i class="z-ico z-loading"></i>
            +        
            +
            加载图标
            .z-ico.z-loading.z-small
            +    <i class="z-ico z-loading z-small"></i>
            +        
            +
            加载小图标
            .z-ico.z-pen
            +    <i class="z-ico z-pen"></i>
            +        
            +
            修改图标
            .z-ico.z-close.z-small
            +    <i class="z-ico z-close z-small"></i>
            +        
            +
            关闭图标
            + +<#-- 树形图标16px*22px --> +
            三、树型图标(16px * 22px),一组反白,一组正常,默认反白,正常加z-normal样式
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称代码举例说明
            .z-ico.z-tree
            +    <i class="z-ico z-tree"></i>
            +        
            +
            树形目录图标
            .z-ico.z-tree.z-root
            +    <i class="z-ico z-tree z-root"></i>
            +        
            +
            树形根节点图标
            .z-ico.z-tree.z-lastnode
            +    <i class="z-ico z-tree z-lastnode"></i>
            +        
            +
            指向下一个节点
            .z-ico.z-tree.z-mlastnode
            +    <i class="z-ico z-tree z-mlastnode"></i>
            +        
            +
            点击后收起菜单
            .z-ico.z-tree.z-mnode
            +    <i class="z-ico z-tree z-mnode"></i>
            +        
            +
            中间节点,点击后收起菜单
            .z-ico.z-tree.z-node
            +    <i class="z-ico z-tree z-node"></i>
            +        
            +
            指向节点
            .z-ico.z-tree.z-plastnode
            +    <i class="z-ico z-tree z-plastnode"></i>
            +        
            +
            点击后展开菜单
            .z-ico.z-tree.z-pnode
            +    <i class="z-ico z-tree z-pnode"></i>
            +        
            +
            中间节点,点击后展开菜单
            .z-ico.z-tree.z-vertline
            +    <i class="z-ico z-tree z-vertline"></i>
            +        
            +
            树形垂直线
            .z-ico.z-tree.z-blank
            +    <i class="z-ico z-tree z-blank"></i>
            +        
            +
            树形空白符
            标准树形图标
            .z-ico.z-tree.z-root.z-normal
            +    <i class="z-ico z-tree z-root z-normal"></i>
            +        
            +
            树形根节点
            .z-ico.z-tree.z-lastnode.z-normal
            +    <i class="z-ico z-tree z-lastnode z-normal"></i>
            +        
            +
            指向下一节点
            .z-ico.z-tree.z-mlastnode.z-normal
            +    <i class="z-ico z-tree z-mlastnode z-normal"></i>
            +        
            +
            点击后展开菜单
            .z-ico.z-tree.z-mnode.z-normal
            +    <i class="z-ico z-tree z-mnode z-normal"></i>
            +        
            +
            中间节点,点击后展开菜单
            .z-ico.z-tree.z-node.z-normal
            +    <i class="z-ico z-tree z-node z-normal"></i>
            +        
            +
            指向节点
            .z-ico.z-tree.z-plastnode.z-normal
            +    <i class="z-ico z-tree z-plastnode z-normal"></i>
            +        
            +
            点击后收起菜单
            .z-ico.z-tree.z-pnode.z-normal
            +    <i class="z-ico z-tree z-pnode z-normal"></i>
            +        
            +
            中间节点,点击后收起菜单
            .z-ico.z-tree.z-vertline.z-normal
            +    <i class="z-ico z-tree z-vertline z-normal"></i>
            +        
            +
            树形垂直线
            名称
            .z-ico.z-tree.z-30.z-root
            +    <i class="z-ico z-tree z-30 z-root"></i>
            +        
            +
            树形根节点图标
            .z-ico.z-tree.z-30.z-lastnode
            +    <i class="z-ico z-tree z-30 z-lastnode"></i>
            +        
            +
            指向下一个节点
            .z-ico.z-tree.z-30.z-mlastnode
            +    <i class="z-ico z-tree z-30 z-mlastnode"></i>
            +        
            +
            点击后收起菜单
            .z-ico.z-tree.z-30.z-mnode
            +    <i class="z-ico z-tree z-30 z-mnode"></i>
            +        
            +
            中间节点,点击后收起菜单
            .z-ico.z-tree.z-30.z-node
            +    <i class="z-ico z-tree z-30 z-node"></i>
            +        
            +
            指向节点
            .z-ico.z-tree.z-30.z-plastnode
            +    <i class="z-ico z-tree z-30 z-plastnode"></i>
            +        
            +
            点击后展开菜单
            .z-ico.z-tree.z-30.z-pnode
            +    <i class="z-ico z-tree z-30 z-pnode"></i>
            +        
            +
            中间节点,点击后展开菜单
            .z-ico.z-tree.z-30.z-vertline
            +    <i class="z-ico z-tree z-30 z-vertline"></i>
            +        
            +
            树形垂直线
            .z-ico.z-tree.z-30.z-blank
            +    <i class="z-ico z-tree z-30 z-blank"></i>
            +        
            +
            树形空白符
            标准树形图标
            .z-ico.z-tree.z-30.z-root.z-normal
            +    <i class="z-ico z-tree z-30 z-root z-normal"></i>
            +        
            +
            树形根节点
            .z-ico.z-tree.z-30.z-lastnode.z-normal
            +    <i class="z-ico z-tree z-30 z-lastnode z-normal"></i>
            +        
            +
            指向下一节点
            .z-ico.z-tree.z-30.z-mlastnode.z-normal
            +    <i class="z-ico z-tree z-30 z-mlastnode z-normal"></i>
            +        
            +
            点击后展开菜单
            .z-ico.z-tree.z-30.z-mnode.z-normal
            +    <i class="z-ico z-tree z-30 z-mnode z-normal"></i>
            +        
            +
            中间节点,点击后展开菜单
            .z-ico.z-tree.z-30.z-node.z-normal
            +    <i class="z-ico z-tree z-30 z-node z-normal"></i>
            +        
            +
            指向节点
            .z-ico.z-tree.z-30.z-plastnode.z-normal
            +    <i class="z-ico z-tree z-30 z-plastnode z-normal"></i>
            +        
            +
            点击后收起菜单
            .z-ico.z-tree.z-30.z-pnode.z-normal
            +    <i class="z-ico z-tree z-30 z-pnode z-normal"></i>
            +        
            +
            中间节点,点击后收起菜单
            .z-ico.z-tree.z-30.z-vertline.z-normal
            +    <i class="z-ico z-tree z-30 z-vertline z-normal"></i>
            +        
            +
            树形垂直线
            + +<#-- 常用小图标16px*16px --> +
            四、常用树型菜单中小图标(16px * 16px)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称代码举例说明
            .z-ico.z-tree.z-item
            <i class="z-ico z-tree z-item"></i>
            子节点图标
            .z-ico.z-tr z-tree z-30oup
            <i class="z-ico z-tree z-group"></i>
            组图标
            .z-ico.z-tree.z-attribute
            <i class="z-ico z-tree z-attribute"></i>
            属性图标
            .z-ico.z-tree.z-note
            <i class="z-ico z-tree z-note"></i>
            便笺图标
            .z-ico.z-tree.z-user
            <i class="z-ico z-tree z-user"></i>
            用户图标
            .z-ico.z-tree.z-close
            <i class="z-ico z-tree z-close"></i>
            文件夹图标,关闭状态
            .z-ico.z-tree.z-open
            <i class="z-ico z-tree z-open"></i>
            文件夹图标,打开状态
            .z-ico.z-tree.z-search
            <i class="z-ico z-tree z-search"></i>
            文件夹图标,搜索状态
            .z-ico.z-tree.z-briefcase
            <i class="z-ico z-tree z-briefcase"></i>
            公文包图标
            .z-ico.z-tree.z-users
            <i class="z-ico z-tree z-users"></i>
            多用户图标
            .z-ico.z-tree.z-pass
            <i class="z-ico z-tree z-pass"></i>
            钥匙图标
            .z-ico.z-tree.z-auth
            <i class="z-ico z-tree z-auth"></i>
            认证图标
            .z-ico.z-tree.z-address
            <i class="z-ico z-tree z-address"></i>
            地址图标
            .z-ico.z-tree.z-exit
            <i class="z-ico z-tree z-exit"></i>
            出口图标
            .z-ico.z-tree.z-help
            <i class="z-ico z-tree z-help"></i>
            帮助图标
            .z-ico.z-tree.z-network
            <i class="z-ico z-tree z-network"></i>
            网络图标
            .z-ico.z-tree.z-recycle
            <i class="z-ico z-tree z-recycle"></i>
            回收站图标
            .z-ico.z-tree.z-internet
            <i class="z-ico z-tree z-internet"></i>
            互联网图标
            + +<#-- 五、箭头定义(三角型样式) --> +
            五、箭头定义(三角型样式)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称代码举例说明
            .z-arrow
            <i class="z-arrow"></i>
            默认4像素向下
            .z-arrow.z-up
            <i class="z-arrow z-up"></i>
            4像素向上
            .z-arrow.z-left
            <i class="z-arrow z-left"></i>
            4像素向左
            .z-arrow.z-right
            <i class="z-arrow z-right"></i>
            4像素向右
            .z-arrow.z-px5
            <i class="z-arrow z-px5"></i>
            5像素向下
            .z-arrow.z-up.z-px5
            <i class="z-arrow z-up z-px5"></i>
            5像素向上
            .z-arrow.z-left.z-px5
            <i class="z-arrow z-left z-px5"></i>
            5像素向左
            .z-arrow.z-right.z-px5
            <i class="z-arrow z-right z-px5"></i>
            5像素向右
            .z-arrow.z-px8
            <i class="z-arrow z-px8"></i>
            8像素向下
            .z-arrow.z-up.z-px8
            <i class="z-arrow z-up z-px8"></i>
            8像素向上
            .z-arrow.z-left.z-px8
            <i class="z-arrow z-left z-px8"></i>
            8像素向左
            .z-arrow.z-right.z-px8
            <i class="z-arrow z-right z-px8"></i>
            8像素向右
            镂空箭头
            .z-arrow span
            <i class="z-arrow z-relative-left"><span></span></i>
            镂空4像素向下
            .z-arrow.z-up span
            <i class="z-arrow z-up z-relative-left"><span></span></i>
            镂空4像素向上
            .z-arrow.z-left span
            <i class="z-arrow z-left z-relative-left"><span></span></i>
            镂空4像素向左
            .z-arrow.z-right span
            <i class="z-arrow z-right z-relative-left"><span></span></i>
            镂空4像素向右
            .z-arrow z-px5 span
            <i class="z-arrow z-px5 z-relative-left"><span></span></i>
            镂空5像素向下
            .z-arrow z-up z-px5 span
            <i class="z-arrow z-up z-px5 z-relative-left"><span></span></i>
            镂空5像素向上
            .z-arrow z-left z-px5 span
            <i class="z-arrow z-left z-px5 z-relative-left"><span></span></i>
            镂空5像素向左
            .z-arrow z-right z-px5 span
            <i class="z-arrow z-right z-px5 z-relative-left"><span></span></i>
            镂空5像素向右
            .z-arrow z-px8 span
            <i class="z-arrow z-px8 z-relative-left"><span></span></i>
            镂空8像素向下
            .z-arrow z-up z-px8 span
            <i class="z-arrow z-up z-px8 z-relative-left"><span></span></i>
            镂空8像素向上
            .z-arrow z-left z-px8 span
            <i class="z-arrow z-left z-px8 z-relative-left"><span></span></i>
            镂空8像素向左
            .z-arrow z-right z-px8 span
            <i class="z-arrow z-right z-px8 z-relative-left"><span></span></i>
            镂空8像素向右
            箭头颜色
            .z-arrow.z-gray
            <i class="z-arrow z-gray"></i>
            默认4像素灰色向下
            .z-arrow.z-up.z-gray
            <i class="z-arrow z-up z-gray"></i>
            4像素灰色向上
            .z-arrow.z-left.z-gray
            <i class="z-arrow z-left z-gray"></i>
            4像素灰色向左
            .z-arrow.z-right.z-gray
            <i class="z-arrow z-right z-gray"></i>
            4像素灰色向右
            .z-arrow.z-px5.z-gray
            <i class="z-arrow z-px5 z-gray"></i>
            5像素灰色向下
            .z-arrow.z-up.z-px5.z-gray
            <i class="z-arrow z-up z-px5 z-gray"></i>
            5像素灰色向上
            .z-arrow.z-left.z-px5.z-gray
            <i class="z-arrow z-left z-px5 z-gray"></i>
            5像素灰色向左
            .z-arrow.z-right.z-px5.z-gray
            <i class="z-arrow z-right z-px5 z-gray"></i>
            5像素灰色向右
            .z-arrow.z-px8.z-gray
            <i class="z-arrow z-px8 z-gray"></i>
            8像素灰色向下
            .z-arrow.z-up.z-px8.z-gray
            <i class="z-arrow z-up z-px8 z-gray"></i>
            8像素灰色向上
            .z-arrow.z-left.z-px8.z-gray
            <i class="z-arrow z-left z-px8 z-gray"></i>
            8像素灰色向左
            .z-arrow.z-right.z-px8.z-gray
            <i class="z-arrow z-right z-px8 z-gray"></i>
            8像素灰色向右
            向上下、置顶底箭头图标
            .z-arrow-move
            <i class="z-arrow-move"></i>
            上移
            .z-arrow-move.z-bottom
            <z-arrow-move z-bottom"></i>
            下移
            .z-arrow-move.z-up
            <i class="z-arrow-move z-up"></i>
            上移,无横线
            .z-arrow-move.z-down
            <i class="z-arrow-move z-down"></i>
            下移,无横线
            .z-arrow-move.z-top.z-disabled
            <i class="z-arrow-move z-top z-disabled"></i>
            上移,灰色
            .z-arrow-move.z-bottom.z-disabled
            <z-arrow-move z-bottom z-disabled"></i>
            下移,灰色
            .z-arrow-move.z-up.z-disabled
            <i class="z-arrow-move z-up z-disabled"></i>
            上移,无横线,灰色
            .z-arrow-move.z-down.z-disabled
            <i class="z-arrow-move z-down z-disabled"></i>
            下移,无横线,灰色
            + +<#-- 六、圆圈圆角定义(radius) --> +
            六、圆圈圆角定义(radius)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            圆圈圆角定义
            名称代码举例说明
            .z-round.z-white
            <i class="z-round z-white"></i>
            白色圆圈
            .z-round.z-black
            <i class="z-round z-black"></i>
            黑色圆圈
            .z-round.z-gray
            <i class="z-round z-gray"></i>
            灰色圆圈
            .z-round.z-red
            <i class="z-round z-red"></i>
            红色圆圈
            .z-round.z-orange
            <i class="z-round z-orange"></i>
            橘色圆圈
            .z-round.z-yellow
            <i class="z-round z-yellow"></i>
            黄色圆圈
            .z-round.z-green
            <i class="z-round z-green"></i>
            绿色圆圈
            .z-round.z-cyan
            <i class="z-round z-cyan"></i>
            青色圆圈
            .z-round.z-blue
            <i class="z-round z-blue"></i>
            蓝色圆圈
            .z-round.z-purple
            <i class="z-round z-purple"></i>
            紫色圆圈
            .z-round.z-black.z-bd-rd0
            <i class="z-round z-black z-bd-rd0"></i>
            黑色圆角为0像素
            .z-round.z-black.z-bd-rd1
            <i class="z-round z-black z-bd-rd1"></i>
            黑色圆角为1个像素
            .z-round.z-black.z-bd-rd2
            <i class="z-round z-black z-bd-rd2"></i>
            黑色圆角为2个像素
            .z-round.z-black.z-bd-rd3
            <i class="z-round z-black z-bd-rd3"></i>
            黑色圆角为3个像素
            .z-round.z-black.z-bd-rd5
            <i class="z-round z-black z-bd-rd5"></i>
            黑色圆角为5个像素
            .z-round.z-black.z-bd-rd8
            <i class="z-round z-black z-bd-rd8"></i>
            黑色圆角为8个像素
            .z-round.z-black.z-bd-rd10
            <i class="z-round z-black z-bd-rd10"></i>
            黑色圆角为10个像素
            .z-round.z-black.z-bd-rd50p
            <i class="z-round z-black z-bd-rd50p"></i>
            黑色圆圈
            .z-round.z-black.z-bd-rd0
            <i class="z-round z-black z-bd-rd0"></i>
            黑色圆角为0像素,优先定义
            .z-round.z-black.z-bd-rd1
            <i class="z-round z-black z-bd-rd1"></i>
            黑色圆角为1个像素,优先定义
            .z-round.z-black.z-bd-rd2
            <i class="z-round z-black z-bd-rd2"></i>
            黑色圆角为2个像素,优先定义
            .z-round.z-black.z-bd-rd3
            <i class="z-round z-black z-bd-rd3"></i>
            黑色圆角为3个像素,优先定义
            .z-round.z-black.z-bd-rd5
            <i class="z-round z-black z-bd-rd5"></i>
            黑色圆角为5个像素,优先定义
            .z-round.z-black.z-bd-rd8
            <i class="z-round z-black z-bd-rd8"></i>
            黑色圆角为8个像素,优先定义
            .z-round.z-black.z-bd-rd10
            <i class="z-round z-black z-bd-rd10"></i>
            黑色圆角为10个像素,优先定义
            .z-round.z-black.z-bd-rd50p
            <i class="z-round z-black z-bd-rd50p"></i>
            黑色圆圈,优先定义
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/css/table.htm b/zhiqim_ui/document/tutorial/ui/css/table.htm new file mode 100644 index 0000000..2b1d6a7 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/css/table.htm @@ -0,0 +1,470 @@ +<#def title = "表格样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "表格样式是指对表格增加样式规则,如指定表格边框、表格圆角、表格行线、表格单元格内边距、表格单元格字体大小、表格单元格文本对齐方式、表格单元格文本行高等,默认表格无边框。"/> +<#def prevUrl = "block.htm"/> +<#def nextUrl = "../js/js.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "css", "table")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "表格样式")} +
            + +<#-- 标题 --> +
            +

            表格样式:

            +

            + 表格样式是指对表格增加样式规则,如指定表格边框、表格圆角、表格行线、表格单元格内边距、表格单元格字体大小、表格单元格文本对齐方式、表格单元格文本行高等,默认表格无边框。 + 另外,CSS对底部圆角当有背景时需要手动对第一和最后单元格补圆角,当圆角首列合并单元格时也需要对被合并的行第一单元格补左边线。 +

            +
            + +<#var colorMap = Jsons.toMapSS(context.getResourceString("/document/tutorial/ui/css/zhiqim.pre.json", "UTF-8"))/> + +<#-- 一、表格边框 --> +
            一、表格边框(默认灰色无圆角,单元格内边框10px)
            + +
            + +
            +
            + + + + + + + + + + + + + + + + + + + +
            示例
            用户名称&价格操作
            admin10000查看
            admin10000查看
            +
            + +
            + +
            + +
            默认有边框表格,格式为[class="z-table z-bordered"]
            + 1、[z-table]表示表格使用知启蒙表格样式
            + 2、[z-bordered]表示表格有边框,默认是灰色[#d3d3d3],可选支持7种颜色
            + 3、[z-pd10]表示单元格内边距,这里只列出了几个内边框值,可以去[块样式]查看更多定义
            +
            +
            +
            + +<#-- 二、表格单元格文本设置 --> +
            二、表格单元格文本设置(默认左对齐、字体继承14px、行高继承120%)
            + +
            + +
            +
            + + + + + + + + + + + + + + + + + + + +
            示例
            用户名称&价格操作
            admin10000查看
            修改
            删除
            admin10000查看
            修改
            删除
            +
            + +
            + +
            + +
            默认有边框表格,格式为[class="z-table z-bordered"]
            + 1、[z-table]表示表格使用知启蒙表格样式
            + 2、[z-bordered]表示表格有边框,默认是灰色[#d3d3d3],可选支持7种颜色
            + 3、[z-pd10]表示单元格内边距,这里只列出了几个内边框值,可以去[块样式]查看更多定义
            + 4、单元格文本对齐三种左对齐[z-text-left]、居中[z-text-center]、右对齐[z-text-right],未配置默认左对齐
            + 5、单元格文本字体大小,如[z-px16]、[z-px18]等,可以去[文本样式]查看更多定义
            + 6、单元格文本行高,如百分比行高[z-lh150p]、[z-lh200p]和固定行高[z-lh30]等,可以去[文本样式]查看更多定义
            +
            +
            +
            + +<#-- 三、表格圆角最后一行有背景补圆角 --> +
            三、表格圆角边框最后一行有背景补圆角
            + +
            + +
            +
            + + + + + + + + + + + + + + + + + + + + + + +
            示例
            序号用户名称操作
            1admin查看
            2admin查看
            脚注
            +
            + +
            + +
            + +
            圆角边框时,最后一行有背景时,需要对当前行第一列和最后一列增加[class="z-bd-rd-bl8"]和[class="z-bd-rd-br8"]
            + 1、[z-table]表示表格使用知启蒙表格样式
            + 2、[z-bordered]表示表格有边框,默认是灰色[#d3d3d3],可选支持7种颜色
            + 3、[z-pd10]表示单元格内边距,这里只列出了几个内边框值,可以去[块样式]查看更多定义
            + 4、[z-bd-rd8]表示圆角8像素,表格支持圆角5像素、8像素、10像素三种
            + 5、[z-bd-rd-bl8 z-bd-rd-br8]表示脚注最后一行,也增加下左和下右8像素圆角,这样就不会被背景遮住圆角 +
            +
            +
            + +<#-- 四、表格圆角边框第一列有向下合并单元格时被合并行首列补左边线 --> +
            四、表格圆角边框第一列有向下合并单元格时,被合并行剩余首列补左边线
            + +
            + +
            +
            + + + + + + + + + + + + + + + + + + + +
            示例用户名称操作
            admin查看
            admin查看
            脚注admin查看
            +
            + +
            + +
            + +
            圆角边框时,如果有第一列向下合并单元格的情况,被合并的行的第一列要求增加左边线,格式为[class="zi-bd-l"],有颜色还要加上颜色[class="zi-bd-l z-red"]
            + 1、[z-table]表示表格使用知启蒙表格样式
            + 2、[z-bordered]表示表格有边框,默认是灰色[#d3d3d3],可选支持7种颜色
            + 3、[z-pd10]表示单元格内边距,这里只列出了几个内边框值,可以去[块样式]查看更多定义
            + 4、[z-bd-rd8]表示圆角8像素,表格支持圆角5像素、8像素、10像素三种
            + 5、第二行和第三行的第一列被第一行第一列向下合并了,因此第二行和第三行剩余的第一列要求增加左边线,格式为[class="zi-bd-l"] +
            +
            +
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/css/text.htm b/zhiqim_ui/document/tutorial/ui/css/text.htm new file mode 100644 index 0000000..331ab3b --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/css/text.htm @@ -0,0 +1,782 @@ +<#def title = "文本样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "文本样式是指对文本文字增加样式规则,如指定文本粗斜体、文本上下标、文本字体大小、文本行高、文本强制换行、强制不换行、省略隐藏、文本标题属性、文本对齐方式和文本附带的下划线删除线、以及编码突出效果等"/> +<#def prevUrl = "ico.htm"/> +<#def nextUrl = "block.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "css", "text")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "文本样式")} +
            + +<#-- 标题 --> +
            +

            文本样式:

            +

            + 文本样式是指对文本文字增加样式规则,如指定文本粗斜体、文本上下标、文本字体大小、文本行高、文本强制换行、强制不换行、省略隐藏、文本标题属性、文本对齐方式和文本附带的下划线删除线、以及编码突出效果等。 +

            +
            + +<#-- 一、粗斜体上下标和删除线下划线文本 --> +
            一、粗斜体、上下标、删除线、下划线、标记字体、缩写效果等标签样式和定义样式
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            b
            b{font-weight:bold;}
            微软雅黑字体粗体
            i
            i{font-style:italic;}
            微软雅黑字体斜体
            u
            u{text-decoration:underline;}
            带下划线文本效果下划线体
            del
            del{text-decoration:line-through;}
            带删除线文本效果删除线体
            small
            small{font-size:80%;}
            这里是小号文本效果小号体,80%
            sup
            sub,sup {position:relative;vertical-align:baseline;line-height:0;font-size:75%;}
            sup{top:-0.5em;}
            文本上标效果superscript上标
            sub
            sub,sup {position:relative;vertical-align:baseline;line-height:0;font-size:75%;}
            sub{bottom:-0.25em;}
            文本下标效果subscript下标
            mark
            mark{background:#ff0;color:#000;}
            这里是标记字体效果标记体,颜色为通用的黑色+黄底#ffff00
            abbr[title]
            abbr[title]{border-bottom:1px dotted;}
            @-moz-document url-prefix(){abbr[title]{border-bottom:0;}}
            这里是MSYH缩写效果缩写体,显示下划虚线,firefox原来就有,所以要用hack去掉
            .z-bold
            .z-bold{font-weight:bold;}
            这里是字体加粗效果粗体
            .z-italic
            .z-italic{font-style:italic;}
            这里是文本斜体效果斜体
            .z-underline
            .z-underline{text-decoration:underline;}
            带下划线文本效果下划线体
            .z-delline
            .z-delline{text-decoration:line-through;}
            带删除线文本效果删除线体
            .z-small
            .z-small{font-size:80%;}
            这里是小号文本效果小号体,80%
            .z-sup
            .z-sub,.z-sup {position:relative;vertical-align:baseline;line-height:0;font-size:75%;}.z-sup{top:-0.5em;}
            文本上标效果superscript上标
            .z-sub
            .z-sub,.z-sup {position:relative;vertical-align:baseline;line-height:0;font-size:75%;}.z-sub{bottom:-0.25em;}
            文本下标效果subscript下标
            .z-mark
            .z-mark{background:#ff0;color:#000;}
            这里是标记字体效果标记体,颜色为通用的黑色+黄底#ffff00
            .z-abbr[title]
            .z-abbr[title]{border-bottom:1px dotted;}
            这里是MSYH缩写效果缩写体,显示下划虚线
            + +<#-- 二、文本换行、不换行、省略和隐藏等属性 --> +
            二、文本换行、不换行、省略和隐藏等属性
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            .z-text-break
            .z-text-break{word-break:break-all; word-wrap:break-word;}
            Except as required by law or in writing, the software is provided by the original code, without any express or implied warranties and conditions. See the full license for the rights and restrictions.国人是不管英文是不是单词的,直接换行
            .z-text-pre
            .z-text-pre{white-space:pre;}
            + + 第一行第一行第一行第一行第一行 + 第二行 + 第三行 + + 保留空白符列表,类似于<pre>,每行nowrap,撑大
            .z-text-prewrap
            .z-text-prewrap{white-space:pre-wrap;}
            + + 第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行
            + 第二行
            + 第三行
            +
            +
            保留空白符列表,超时自动换行。
            .z-text-preline
            .z-text-preline{white-space:pre-line;}
            + + 第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行
            + 第二行
            + 第三行
            +
            +
            合并空白符列表,但是保留换行符。如果第一个字符是\n,<pre>会清理,.z-text-preline不会,需借助JS删除该字符,:first-line设置行高为0时IE/Webkit可以,Firefox不行
            .z-text-nowrap
            .z-text-nowrap{white-space:nowrap;}
            Except as required by law or in writing, the so不换行,会把td撑大,直到遇到
            标签为止。
            .z-text-ellipsis
            .z-text-ellipsis{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:inline-block;}
            Except as required by law or in writing, the software is provided by the original code, without any express or implied warranties and conditions. See the full license for the rights and restrictions.超过的显示省略号,缺点是必须指定宽度,且只能是一行
            .z-text-clip
            .z-text-clip{text-overflow:clip;overflow:hidden;white-space:nowrap;display:inline-block;}
            Except as required by law or in writing, the software is provided by the original code, without any express or implied warranties and conditions. See the full license for the rights and restrictions.超过的省略也不显示省略号,缺点是必须指定宽度,且只能是一行
            + + +<#-- 三、正文文本对齐方式 --> +
            三、正文文本对齐方式,其中z-为常用,zi-为优先
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            .z-text-left
            .z-text-left{text-align:left;}
            文本左对齐
            文本左对齐
            左对齐
            .z-text-center
            .z-text-center{text-align:center;}
            文本居中对齐
            文本居中对齐
            居中对齐
            .z-text-right
            .z-text-right{text-align:right;}
            文本右对齐
            文本右对齐
            右对齐
            以下为文本对齐优先
            .zi-text-left
            .zi-text-left{text-align:left !important;}
            文本左对齐
            文本左对齐
            左对齐
            .zi-text-center
            .zi-text-center{text-align:center !important;}
            文本居中对齐
            文本居中对齐
            居中对齐
            .zi-text-right
            .zi-text-right{text-align:right !important;}
            文本右对齐
            文本右对齐
            右对齐
            + + +<#-- ;四、标题样式(h1-h3) --> +
            四、标题样式(h1-h3)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            h1
            h1{font-size:24px;color:#333;line-height:150%;}

            微软雅黑字体,24号字体
            微软雅黑字体,24号字体

            H1字体,上下边距14px
            h2
            h2{font-size:22px;color:#333;line-height:150%;}

            微软雅黑字体,22号字体
            微软雅黑字体,22号字体

            H2字体,上下边距14px
            h3
            h3{font-size:20px;color:#333;line-height:150%;}

            微软雅黑字体,20号字体
            微软雅黑字体,22号字体

            H3字体,上下边距14px
            .z-h1
            .z-h1{font-size:24px;color:#333;line-height:150%;display:block;margin:14px 0;font-weight:bold;}
            微软雅黑字体,24号字体
            微软雅黑字体,24号字体
            模拟H1,当H1被覆盖时可以使用z-h1
            .z-h2
            .z-h2{font-size:22px;color:#333;line-height:150%;display:block;margin:14px 0;font-weight:bold;}
            微软雅黑字体,22号字体
            微软雅黑字体,22号字体
            模拟H2,当H2被覆盖时可以使用z-h2
            .z-h3
            .z-h3{font-size:20px;color:#333;line-height:150%;display:block;margin:14px 0;font-weight:bold;}
            微软雅黑字体,20号字体
            微软雅黑字体,20号字体
            模拟H3,当H3被覆盖时可以使用z-h3
            + +<#-- 五、正文文本字体大小(px10-px30) --> +
            五、正文文本字体大小(px10-px30),其中z-为常用,zi-为优先
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例
            .z-px10
            .z-px10{font-size:10px;}
            微软雅黑字体,10号字体
            微软雅黑字体,10号字体
            .z-px11
            .z-px11{font-size:11px;}
            微软雅黑字体,11号字体
            微软雅黑字体,11号字体
            .z-px12
            .z-px12{font-size:12px;}
            微软雅黑字体,12号字体
            微软雅黑字体,12号字体
            .z-px13
            .z-px13{font-size:13px;}
            微软雅黑字体,13号字体
            微软雅黑字体,13号字体
            .z-px14
            .z-px14{font-size:14px;}
            微软雅黑字体,14号字体
            微软雅黑字体,14号字体
            .z-px15
            .z-px15{font-size:15px;}
            微软雅黑字体,15号字体
            微软雅黑字体,15号字体
            .z-px16
            .z-px16{font-size:16px;}
            微软雅黑字体,16号字体
            微软雅黑字体,16号字体
            .z-px17
            .z-px17{font-size:17px;}
            微软雅黑字体,17号字体
            微软雅黑字体,17号字体
            .z-px18
            .z-px18{font-size:18px;}
            微软雅黑字体,18号字体
            微软雅黑字体,18号字体
            .z-px19
            .z-px19{font-size:19px;}
            微软雅黑字体,19号字体
            微软雅黑字体,19号字体
            .z-px20
            .z-px20{font-size:20px;}
            微软雅黑字体,20号字体
            微软雅黑字体,20号字体
            .z-px22
            .z-px22{font-size:22px;}
            微软雅黑字体,22号字体
            微软雅黑字体,22号字体
            .z-px24
            .z-px24{font-size:24px;}
            微软雅黑字体,24号字体
            微软雅黑字体,24号字体
            .z-px26
            .z-px26{font-size:26px;}
            微软雅黑字体,26号字体
            微软雅黑字体,26号字体
            .z-px30
            .z-px30{font-size:30px;}
            微软雅黑字体,30号字体
            微软雅黑字体,30号字体
            以下为文本优先zi-px10 - zi-px30
            .zi-px10
            .zi-px10{font-size:10px !important;}
            微软雅黑字体,10号字体
            微软雅黑字体,10号字体
            .zi-px11
            .zi-px11{font-size:11px !important;}
            微软雅黑字体,11号字体
            微软雅黑字体,11号字体
            .zi-px12
            .zi-px12{font-size:12px !important;}
            微软雅黑字体,12号字体
            微软雅黑字体,12号字体
            .zi-px13
            .zi-px13{font-size:13px !important;}
            微软雅黑字体,13号字体
            微软雅黑字体,13号字体
            .zi-px14
            .zi-px14{font-size:14px !important;}
            微软雅黑字体,14号字体
            微软雅黑字体,14号字体
            .zi-px15
            .zi-px15{font-size:15px !important;}
            微软雅黑字体,15号字体
            微软雅黑字体,15号字体
            .zi-px16
            .zi-px16{font-size:16px !important;}
            微软雅黑字体,16号字体
            微软雅黑字体,16号字体
            .zi-px17
            .zi-px17{font-size:17px !important;}
            微软雅黑字体,17号字体
            微软雅黑字体,17号字体
            .zi-px18
            .zi-px18{font-size:18px !important;}
            微软雅黑字体,18号字体
            微软雅黑字体,18号字体
            .zi-px19
            .zi-px19{font-size:19px !important;}
            微软雅黑字体,19号字体
            微软雅黑字体,19号字体
            .zi-px20
            .zi-px20{font-size:20px !important;}
            微软雅黑字体,20号字体
            微软雅黑字体,20号字体
            .zi-px22
            .zi-px22{font-size:22px !important;}
            微软雅黑字体,22号字体
            微软雅黑字体,22号字体
            .zi-px24
            .zi-px24{font-size:24px !important;}
            微软雅黑字体,24号字体
            微软雅黑字体,24号字体
            .zi-px26
            .zi-px26{font-size:26px !important;}
            微软雅黑字体,26号字体
            微软雅黑字体,26号字体
            .zi-px30
            .zi-px30{font-size:30px !important;}
            微软雅黑字体,30号字体
            微软雅黑字体,30号字体
            + +<#-- 六、行高定义 --> +
            六、行高定义(像素高度 & 百分比高度)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            行高定义lh10-lh40
            .z-lh10
            .zi-lh10
            +        .z-lh10{height:10px;}
            +        .zi-lh10{height:10px !important;}
            +    
            行高
            行高
            行高10px
            .z-lh12
            .zi-lh12
            +        .z-lh12{height:12px;}
            +        .zi-lh12{height:12px !important;}
            +    
            行高
            行高
            行高12px
            .z-lh14
            .zi-lh14
            +        .z-lh14{height:14px;}
            +        .zi-lh14{height:14px !important;}
            +    
            行高
            行高
            行高14px
            .z-lh15
            .zi-lh15
            +        .z-lh15{height:15px;}
            +        .zi-lh15{height:15px !important;}
            +    
            行高
            行高
            行高15px
            .z-lh16
            .zi-lh16
            +        .z-lh16{height:16px;}
            +        .zi-lh16{height:16px !important;}
            +    
            行高
            行高
            行高16px
            .z-lh18
            .zi-lh18
            +        .z-lh18{height:18px;}
            +        .zi-lh18{height:18px !important;}
            +    
            行高
            行高
            行高18px
            .z-lh20
            .zi-lh20
            +        .z-lh20{height:20px;}
            +        .zi-lh20{height:20px !important;}
            +    
            行高
            行高
            行高20px
            .z-lh22
            .zi-lh22
            +        .z-lh22{height:22px;}
            +        .zi-lh22{height:22px !important;}
            +    
            行高
            行高
            行高22px
            .z-lh25
            .zi-lh25
            +        .z-lh25{height:25px;}
            +        .zi-lh25{height:25px !important;}
            +    
            行高
            行高
            行高25px
            .z-lh28
            .zi-lh28
            +        .z-lh28{height:28px;}
            +        .zi-lh28{height:28px !important;}
            +    
            行高
            行高
            行高28px
            .z-lh30
            .zi-lh30
            +        .z-lh30{height:30px;}
            +        .zi-lh30{height:30px !important;}
            +    
            行高
            行高
            行高30px
            .z-lh35
            .zi-lh35
            +        .z-lh35{height:35px;}
            +        .zi-lh35{height:35px !important;}
            +    
            行高
            行高
            行高35px
            .z-lh40
            .zi-lh40
            +        .z-lh40{height:40px;}
            +        .zi-lh40{height:40px !important;}
            +    
            行高
            行高
            行高40px
            行高百分比
            .z-lh100p
            .zi-lh100p
            +        .z-lh100p{line-height:100%;}
            +        .zi-lh100p{line-height:100% !important;}
            +    
            行高
            行高
            行高100%
            .z-lh110p
            .zi-lh110p
            +        .z-lh110p{line-height:110%;}
            +        .zi-lh110p{line-height:110% !important;}
            +    
            行高
            行高
            行高110%
            .z-lh120p
            .zi-lh120p
            +        .z-lh120p{line-height:120%;}
            +        .zi-lh120p{line-height:120% !important;}
            +    
            行高
            行高
            行高120%
            .z-lh130p
            .zi-lh130p
            +        .z-lh130p{line-height:130%;}
            +        .zi-lh130p{line-height:130% !important;}
            +    
            行高
            行高
            行高130%
            .z-lh140p
            .zi-lh140p
            +        .z-lh140p{line-height:140%;}
            +        .zi-lh140p{line-height:140% !important;}
            +    
            行高
            行高
            行高140%
            .z-lh150p
            .zi-lh150p
            +        .z-lh150p{line-height:150%;}
            +        .zi-lh150p{line-height:150% !important;}
            +    
            行高
            行高
            行高150%
            .z-lh180p
            .zi-lh180p
            +        .z-lh180p{line-height:180%;}
            +        .zi-lh180p{line-height:180% !important;}
            +    
            行高
            行高
            行高180%
            .z-lh200p
            .zi-lh200p
            +        .z-lh200p{line-height:200%;}
            +        .zi-lh200p{line-height:200% !important;}
            +    
            行高
            行高
            行高200%
            .z-lh250p
            .zi-lh250p
            +        .z-lh250p{line-height:250%;}
            +        .zi-lh250p{line-height:250% !important;}
            +    
            行高
            行高
            行高250%
            + +<#-- 七、文本编码样式 --> +
            七、文本编码样式(编码字体依次查找Consolas,"Courier New",monospace,Menlo,Monaco,"微软雅黑")
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            samp
            .z-samp
            +
            +        samp,.z-samp{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}
            +    
            +
            + samp{font-family:"Courier New"}

            + .z-samp{border-radius:4px;} +
            无背景编码字体
            kbd
            .z-kbd
            +
            +        kbd,.z-kbd{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}
            +        kbd,.z-kbd{border-radius:4px;}
            +        kbd,.z-kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.25);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.25);}
            +    
            +
            + kbd{font-family:"Courier New"}

            + .z-kbd{border-radius:4px;} +
            黑背景白字键盘输入字体
            pre
            .z-pre
            +
            +        pre{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}
            +        pre{border-radius:4px;}
            +        pre{overflow:auto;display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #cccccc;}
            +        pre code{padding:0;font-size:inherit;color:#c7254e;white-space:pre-wrap;background-color:transparent;border-radius:0;}
            +    
            +
            +
            +        pre{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}
            +    
            + .z-pre{border-radius:4px;} +
            预处理标记,默认是单行撑大、留白,这里增加了.z-text-preline,改为单行换行,留白合并

            显示红色的为里面使用<code>封装
            code
            .z-code
            +
            +        code,.z-code{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}
            +        code,.z-code{border-radius:4px;}
            +        code,.z-code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;}
            +        pre code,.z-pre .z-code{padding:0;font-size:inherit;color:#c7254e;white-space:pre-wrap;background-color:transparent;border-radius:0;}
            +    
            +
            + code{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}

            + .z-code{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}

            + code{border-radius:4px;} +
            编码标记,默认是自动换行,且不保留空白

            外边框是在显示红色的为使用<pre>内进行封装
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/css/zhiqim.pre.json b/zhiqim_ui/document/tutorial/ui/css/zhiqim.pre.json new file mode 100644 index 0000000..bd44b20 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/css/zhiqim.pre.json @@ -0,0 +1,70 @@ +{ +textColor:"#333", +bgColor:"#fff", +linkColor:"#333", +linkHoverColor:"#06c", + +whiteTextColor:"#fffff0", +whiteBgColor:"#fff", + +blackTextColor:"#333", +blackBgColor:"#000", + +grayTextColor:"#ccc", +grayBgColor:"#f5f5f5", +grayBdColor:"#d3d3d3", +btnTextColor:"#333", +btnBdColor:"#c3c3c3", +btnBgColor:"#f2f2f2", +btnBgHoverColor:"#f5f5f5", +btnBgActiveColor:"#dfdfdf", + +redTextColor:"#8b0000", +redBgColor:"#ffe4e1", +redBdColor:"#ea4a36", +redBtnBdColor:"#e8351f", +redBtnBgColor:"#ea4a36", +redHoverColor:"#ed6a5a", + +orangeTextColor:"#fe4615", +orangeBgColor:"#f5deb3", +orangeBdColor:"#ff6600", +orangeBtnBdColor:"#ff4e00", +orangeBtnBgColor:"#ff6600", +orangeHoverColor:"#ff8533", + +yellowTextColor:"#ffd700", +yellowBgColor:"#ffe", +yellowBdColor:"#fac603", +yellowBtnBdColor:"#e1b203", +yellowBtnBgColor:"#fac603", +yellowHoverColor:"#fbd238", + +greenTextColor:"#006400", +greenBgColor:"#f0fff0", +greenBdColor:"#43cd6e", +greenBtnBdColor:"#34c360", +greenBtnBgColor:"#43cd6e", +greenHoverColor:"#49de79", + +cyanTextColor:"#008b8b", +cyanBgColor:"#e1ffff", +cyanBdColor:"#009899", +cyanBtnBdColor:"#029394", +cyanBtnBgColor:"#009899", +cyanHoverColor:"#4bb0af", + +blueTextColor:"#0066cc", +blueBgColor:"#f0f8ff", +blueBdColor:"#2a689d", +blueBtnBdColor:"#1299ec", +blueBtnBgColor:"#28a3ef", +blueHoverColor:"#4cb9fc", + +purpleTextColor:"#ba55d3", +purpleBgColor:"#e6e6fa", +purpleBdColor:"#9e70ca", +purpleBtnBdColor:"#9469bd", +purpleBtnBgColor:"#9e70ca", +purpleHoverColor:"#ac7ed7" +} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/dialog/alert.htm b/zhiqim_ui/document/tutorial/ui/dialog/alert.htm new file mode 100644 index 0000000..c5b7a47 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/dialog/alert.htm @@ -0,0 +1,169 @@ +<#def title = "警告对话框"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "警告对话框是自定义对话框的一种参考alert方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的警告对话框,支持设置警告内容和点击确定后回调函数。"/> +<#def prevUrl = "dialog.htm"/> +<#def nextUrl = "confirm.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "dialog", "alert")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "警告对话框")} +
            + +<#-- 标题 --> +
            +

            警告对话框:

            +

            + 警告对话框是自定义对话框的一种参考alert方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的警告对话框,支持设置警告内容和点击确定后回调函数。 +

            +
            + +<#-- 一、弹出警告(仅文本,无回调函数和参数) --> +
            一、弹出警告(仅文本,无回调函数和参数)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个告警的对话框 +
            +
            +
            + +<#-- 二、弹出警告(文本,回调函数和有背景参数) --> +
            二、弹出警告(文本,回调函数和有背景参数)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个告警的对话框
            + 2、点击确定后回调函数
            + 3、设置有背景 +
            +
            +
            + +<#-- 三、弹出警告(文本,回调函数和指定高度参数) --> +
            三、弹出警告(文本,回调函数和指定高度参数)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个告警的对话框
            + 2、点击确定后回调函数
            + 3、指定对话框高度
            +
            +
            +
            + +<#-- 警告对话框参数说明 --> +
            警告对话框参数说明(基本参数两个,混合参数三个)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数说明
            基本参数
            text必填警告文本,显示在对话框中的内容
            callback可选警告点击确定之后回调函数
            混合参数,通过函数第三个参数param组合
            param.width{width:330}警告对话框宽度
            param.height指定或计算得到值警告对话框高度,可指定高度,未指定高度时,通过文本字数计算出大概高度
            param.hasBackground{hasBackground:false}警告对话框是否显示背景
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/dialog/confirm.htm b/zhiqim_ui/document/tutorial/ui/dialog/confirm.htm new file mode 100644 index 0000000..e18f1c9 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/dialog/confirm.htm @@ -0,0 +1,171 @@ +<#def title = "询问对话框"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "询问对话框是自定义对话框的一种参考confirm方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的确认对话框,支持设置确认内容和点击确定后回调函数,点击取消不向下处理。"/> +<#def prevUrl = "alert.htm"/> +<#def nextUrl = "prompt.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "dialog", "confirm")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "询问对话框")} +
            + +<#-- 标题 --> +
            +

            询问对话框:

            +

            + 询问对话框是自定义对话框的一种参考confirm方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的确认对话框,支持设置确认内容和点击确定后回调函数,点击取消不向下处理。 +

            +
            + +<#-- 一、弹出确认对话框(文本和回调函数) --> +
            一、弹出确认对话框(文本和回调函数)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个确认的对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数 +
            +
            +
            + +<#-- 二、弹出确认对话框(文本、回调函数和显示背景) --> +
            二、弹出确认对话框(文本、回调函数和显示背景)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个确认的对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数
            + 4、设置有背景 +
            +
            +
            + +<#-- 三、弹出确认对话框(文本、回调函数和指定高度) --> +
            三、弹出确认对话框(文本、回调函数和指定高度)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个确认的对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数
            + 4、指定对话框高度
            +
            +
            +
            + +<#-- 确认对话框参数说明 --> +
            确认对话框参数说明(基本参数两个,混合参数三个)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数说明
            基本参数
            text必填确认文本,显示在对话框中的内容
            callback可选确认点击确定之后回调函数
            混合参数,通过函数第三个参数param组合
            param.width{width:330}确认对话框宽度
            param.height指定或计算得到值确认对话框高度,可指定高度,未指定高度时,通过文本字数计算出大概高度
            param.hasBackground{hasBackground:false}确认对话框是否显示背景
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/dialog/dialog.htm b/zhiqim_ui/document/tutorial/ui/dialog/dialog.htm new file mode 100644 index 0000000..4c8f2ee --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/dialog/dialog.htm @@ -0,0 +1,434 @@ +<#def title = "自定义对话框"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "自定义对话框是指根据业务要求,自动组装对话框参数,完成对话框的弹出。自定义对话框支持的参数有标题、宽度、高度、边框颜色、目标区域、指定弹出HTML、指定弹出URL等一系列参数,是各种对话框的基础。"/> +<#def prevUrl = "../form/calendar.htm"/> +<#def nextUrl = "alert.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "dialog", "dialog")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "自定义对话框")} +
            + +<#-- 标题 --> +
            +

            自定义对话框:

            +

            + 自定义对话框是指根据业务要求,自动组装对话框参数,完成对话框的弹出。自定义对话框支持的参数有标题、宽度、高度、边框颜色、目标区域、指定弹出HTML、指定弹出URL等一系列参数,是各种对话框的基础。 +

            +
            + +<#-- 一、弹出HTML内容(对象方式) --> +
            一、弹出HTML内容(对象方式)
            + +
            + + +
            +
            + +

            +点我弹出对话框 + +
            + +
            + +
            + +
            +最简单的弹出对话框,要求标题、文本HTML、宽度和高度和固定位置五个值:
            +1、title指明对话框标题
            +2、text指定弹出对话框文本HTML
            +3、width指定对话框宽度
            +4、height指定对话框高度
            +5、fixed指定对话框在文档的位置固定
            +
            +
            +
            + +<#-- 二、弹出HTML内容(函数方式) --> +
            二、弹出HTML内容(函数方式)
            + +
            + + +
            +
            + +

            +调用Z.dialog函数弹出对话框 + +
            + +
            + +
            + +

            + 1、最简单的弹出对话框,要求标题、文本HTML、宽度和高度四个值
            + 2、这里定义了shadow: false表示无遮罩层
            +
            +
            +
            + +<#-- 三、弹出HTML内容(函数方式) --> +
            三、弹出HTML内容(函数方式)
            + +
            + + +
            +
            + +

            +调用Z.dialog函数弹出对话框 + +
            + +
            + +
            + +

            + 1、最简单的弹出对话框,要求标题、文本HTML、宽度和高度四个值
            + 2、这里定义了hasBackground: false表示无背景边框
            + 3、这里定义了shadow: false表示无遮罩层
            +
            +
            +
            + +<#-- 四、弹出URL(最简方式) --> +
            四、弹出URL(最简方式)
            + +
            + +
            +
            + +

            +点我弹出对话框,有控制台 +
            + +
            + +
            + +
            +1、最简单的弹出URL对话框,要求标题、URL、宽度和高度四个值
            +2、在弹出页中编写[关闭]按钮,通过JS关闭方法:parent.Z.Dialog.close(location.hash);或全部关闭parent.Z.Dialog.close();,如:
            + +<button class="z-button z-blue" onclick="parent.Z.Dialog.close(location.hash);">关闭</button> +<button class="z-button z-blue" onclick="parent.Z.Dialog.close();">关闭</button> + +3、设计控制台方式:通过设计两个DIV,第一个DIV指定块溢出为auto或scroll,第二个DIV底部绝对定位高度50,两个DIV的高度之和=dialog.height。如下: + +<div class="z-w100p z-overflow-x-hidden z-overflow-y-scroll" style="height:250px;"> +...正文内容... +</div> +<div class="z-absolute z-w100p z-h50" style="bottom:0;left:0;background-color:#e9f3fd;"> + <div class="z-button z-blue z-w100 z-absolute" style="left:160px;top:12px;" onclick="alert('我点了确定!');">确定</div> + <div class="z-button z-absolute" style="right:160px;top:12px;" onclick="parent.Z.Dialog.close();">关闭</div> +</div> + +
            +
            +
            + +<#-- 五、弹出URL(设置参数) --> +
            五、弹出URL(设置参数)
            + + +
            + +
            +
            + +

            + 点我弹出对话框,滚动最底部 +
            + +
            + +
            + +
            +1、最简单的弹出URL对话框,要求标题、URL、宽度和高度四个值
            +2、设置shadowOpacity = 0.1;遮罩层透明度为0.8
            +3、设置borderColor = "#e9fefd";边框颜色
            +4、设置scroll = true;滚动滚动条到最底部 +
            +
            +
            + +<#-- 对话框参数说明 --> +
            对话框参数说明(二十四个)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数说明
            基本参数
            idZ.random(10);该对话框使用的编号,如果未指定,则用系统取随机值,要求必须唯一
            title提示对话框标题
            width300对话框宽度
            height200对话框高度
            borderColor#ccc边框颜色
            targetdocument目标区域
            fixedfalse是否在document下固定位置,只有当target===document时有效
            position未配置默认居中1、数字0表示居中,1-3左中下,4-5中上下,6-8右上中下
            2、指定位置如:{top:100,left:100}
            timeout未配置不开启多少时间超时关闭,单位:毫秒
            callback未配置不开启操作回调函数
            内容相关2个参数
            url和text互斥,只能且必须填写一个对话框调用的URL,和text配置项互斥
            text和url互斥,只能且必须填写一个对话框显示的HTML文本,和url配置项互斥
            遮罩层参数
            shadowtrue遮罩层是否启用 true|false
            shadowColor#757575遮罩层颜色
            shadowOpacity0.6遮罩层透明度,值在0-1之间
            标题拖拽
            hasTitletrue标题栏是否显示,true|false 默认true,当=false时drag无意义
            titleBgColor#f5f5f5标题背景色
            dragtrue是否支持拖拽标题,true|false 默认true
            dragOpacity0.8拖拽时透明度,值在0-1之间,默认0.8
            背景参数
            hasBackgroundtrue背景是否显示,true|false 默认true
            backgroundColor#e9f3fd背景颜色,默认#e9fefd
            滚动滚动条
            scrollfalse是否滚动,true|false 默认false
            scrollHeight0指定滚动高度,(scrollHeight==0)表示到底部,即最大高度,!=0表示指定高度
            scrollPad0指定滚动高度时,保留一部分即height=scrollHeight-scrollPad
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/dialog/dialog_url.htm b/zhiqim_ui/document/tutorial/ui/dialog/dialog_url.htm new file mode 100644 index 0000000..2e45ff0 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/dialog/dialog_url.htm @@ -0,0 +1,35 @@ + + + +知启蒙管理控制台 + +${Styles.src("/src/zhiqim.css")} +${Scripts.src("/src/zhiqim.js")} +${Scripts.src("/src/zhiqim_static.js")} +${Scripts.src("/src/zhiqim_static_util.js")} +${Scripts.src("/src/zhiqim_query.js")} +${Scripts.src("/src/zhiqim_md5.js")} +${Scripts.src("/src/zhiqim_dialog.js")} +${Scripts.src("/src/zhiqim_ajax.js")} +${Scripts.src("/src/zhiqim_calendar.js")} +${Scripts.src("/src/zhiqim_clipboard.js")} +${Scripts.src("/src/zhiqim_coder.js")} +${Scripts.src("/src/zhiqim_form.js")} +${Scripts.src("/src/zhiqim_drag.js")} +${Scripts.src("/src/zhiqim_dropdown.js")} +${Scripts.src("/src/zhiqim_tabnav.js")} +${Scripts.src("/src/zhiqim_floater.js")} +${Scripts.src("/src/zhiqim_editable.js")} +${Scripts.src("/src/zhiqim_upload.js")} +${Scripts.src("/src/zhiqim_uploadmult.js")} +${Scripts.src("/src/zhiqim_uploadlarge.js")} + + + diff --git a/zhiqim_ui/document/tutorial/ui/dialog/dialog_url2.htm b/zhiqim_ui/document/tutorial/ui/dialog/dialog_url2.htm new file mode 100644 index 0000000..aacbaeb --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/dialog/dialog_url2.htm @@ -0,0 +1,29 @@ + + + +${context.getContextName()} +${Styles.src(zhiqim.css)} +${Styles.htmlOverflowYScroll()} + + + + +
            + + + + + + + + + + + + + +
            ${context.getContextName()}
            登录名:
            密   码:
            + +
            + + \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/dialog/loading.htm b/zhiqim_ui/document/tutorial/ui/dialog/loading.htm new file mode 100644 index 0000000..2da58ad --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/dialog/loading.htm @@ -0,0 +1,214 @@ +<#def title = "加载对话框"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "加载对话框是自定义对话框的一种没有标题只有加载中提示的对话框。目标是在屏幕或用户指定的元素可视范围的中间提供没有警告声音且美观的加载对话框,支持设置九个参数来定义加载中界面,无关闭按钮,由业务实现关闭。"/> +<#def prevUrl = "prompt.htm"/> +<#def nextUrl = "../nav/tabnav.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "dialog", "loading")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "加载对话框")} +
            + +<#-- 标题 --> +
            +

            加载对话框:

            +

            + 加载对话框是自定义对话框的一种没有标题只有加载中提示的对话框。目标是在屏幕或用户指定的元素可视范围的中间提供没有警告声音且美观的加载对话框,支持设置九个参数来定义加载中界面,无关闭按钮,由业务实现关闭。 +

            +
            + +<#-- 一、弹出全屏加载器,无遮罩层 --> +
            一、弹出全屏加载器,无遮罩层
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个正在加载的对话框
            + 2、无遮罩层 +
            +
            +
            + +<#-- 二、弹出全屏加载器,有遮罩层 --> +
            二、弹出全屏加载器,有遮罩层
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个正在加载的对话框
            + 2、全屏遮罩,不允许操作 +
            +
            +
            + +<#-- 三、弹出全屏加载器,指定区域加载器 --> +
            三、弹出全屏加载器,指定区域加载器
            + +
            + +
            + +
            + +
            +
            + 1、指定位置遮罩,超出屏幕情况,遮罩目标,不允许操作
            + 2、在可视中间显示正在加载的对话框 +
            +
            +
            + +<#-- 四、弹出全屏加载器,指定区域加载器,超出屏幕情况 --> +
            四、弹出全屏加载器,指定区域加载器,超出屏幕情况
            + +
            + +
            + +
            + +
            +
            + 1、指定位置遮罩,超出屏幕情况,遮罩目标,不允许操作
            + 2、在可视中间显示正在加载的对话框 +
            +
            +
            + +<#-- 加载对话框参数说明 --> +
            加载对话框参数说明(混合参数九个)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数说明
            混合参数
            param.radius{radius:"z-bd-rd5"}圆角,默认5像素
            param.background{background:"#fff"}背景颜色,默认白色
            param.text{text:"正在加载..."}加载中提示文本
            param.target{target:document}遮罩目标,默认document
            param.position未配置默认居中目标位置,参见自定义对话框位置说明
            param.shadow{shadow:false}是否显示遮罩层
            param.borderColor{borderColor:"#d8d8d8"}边框颜色,默认"#d8d8d8"
            param.width{width:150}加载框宽度
            param.height{height:50}加载框高度
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/dialog/prompt.htm b/zhiqim_ui/document/tutorial/ui/dialog/prompt.htm new file mode 100644 index 0000000..a1c01c6 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/dialog/prompt.htm @@ -0,0 +1,291 @@ +<#def title = "提示对话框"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "提示对话框是自定义对话框的一种参考prompt方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的提示对话框,支持设置提示内容和点击确定后回调函数,点击取消不向下处理。"/> +<#def prevUrl = "confirm.htm"/> +<#def nextUrl = "loading.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "dialog", "prompt")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "提示对话框")} +
            + +<#-- 标题 --> +
            +

            提示对话框:

            +

            + 提示对话框是自定义对话框的一种参考prompt方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的提示对话框,支持设置提示内容和点击确定后回调函数,点击取消不向下处理。 +

            +
            + +<#-- 一、弹出单行提示对话框(文本和回调函数) --> +
            一、弹出单行提示对话框(文本和回调函数)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个提示单行对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数 +
            +
            +
            + +<#-- 二、弹出单行提示对话框(文本和回调函数,提示和指定长度) --> +
            二、弹出单行提示对话框(文本和回调函数,提示和指定长度,加背景边框)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个提示单行对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数 +
            +
            +
            + +<#-- 三、弹出选择提示对话框(文本和回调函数,提示和指定长度) --> +
            三、弹出选择提示对话框(文本和回调函数,提示和指定长度,加背景边框)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个提示单行对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数 +
            +
            +
            + +<#-- 四、弹出多行提示对话框(文本、回调函数和类型参数) --> +
            四、弹出多行提示对话框(文本、回调函数和类型参数)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个提示单行对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数
            + 4、指定类型type=textarea +
            +
            +
            + +<#-- 五、弹出多行提示对话框(文本、回调函数和类型参数,提示和指定长度) --> +
            五、弹出多行提示对话框(文本、回调函数和类型参数,提示和指定长度)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个提示单行对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数
            + 4、指定类型type=textarea +
            +
            +
            + +<#-- 六、弹出多行提示对话框(回调把内容设置到文本域中) --> +
            六、弹出多行提示对话框(回调把内容设置到文本域中)
            + +
            + +
            +
            + 点我弹出多行提示对话框 +

            + +
            +
            + +
            +
            + 1、在全屏的中间显示一个提示单行对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数
            + 4、指定类型type=textarea
            + 5、点确定把值回填到文本域中 +
            +
            +
            + +<#-- 提示对话框参数说明 --> +
            提示对话框参数说明(基本参数三个,混合参数四个)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数说明
            基本参数
            text必填提示信息,显示在对话框中的提示
            value必填提示值,显示在对话框中的内容
            callback可选提示点击确定之后回调函数
            混合参数,通过函数第三个参数param组合
            param.width{width:330}提示对话框宽度
            param.height指定或计算得到值提示对话框高度,可指定高度,未指定高度时,通过文本字数计算出大概高度
            param.hasBackground{hasBackground:false}提示对话框是否显示背景
            param.type{type:"input"}内容是使用"select","input"还是"textarea",默认"input"
            param.style{className:"z-samp zi-px16"}为输入框增加样式
            param.className{className:"z-samp zi-px16"}为输入框增加样式类
            param.placeholder{placeholder:"请输入数字"}为输入框指定引导文字
            param.maxLength{maxLength:5}为输入框指定最大长度
            param.dataOptions{dataOptions:"type:Numeric"}为输入框指定输入控制(input时有效)
            param.selects{selects:[{name:"湖南",value:1},{name:"江西",value:2]}为选择框时指定option表,和value相等时表示selected
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/form/button.htm b/zhiqim_ui/document/tutorial/ui/form/button.htm new file mode 100644 index 0000000..13529b2 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/form/button.htm @@ -0,0 +1,709 @@ +<#def title = "按钮样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "按钮样式是指对按钮增加样式规则,按钮分为三种,一是标准按钮、二为筛选按钮、三是多选按钮。样式规则包括按钮大小、颜色、边框颜色、选中特效等。"/> +<#def prevUrl = "input.htm"/> +<#def nextUrl = "checkbox.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "form", "button")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "按钮样式")} +
            + +<#-- 标题 --> +
            +

            按钮样式:

            +

            + 按钮样式是指对按钮增加样式规则,按钮分为三种,一是标准按钮、二为筛选按钮、三是多选按钮。样式规则包括按钮大小、颜色、边框颜色、选中特效等。 +

            +
            + +<#-- 一、标准按钮 --> +
            一、标准按钮(标准大小)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 二、标准按钮(大号) --> +
            二、标准按钮(大号)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 三、标准按钮(加大) --> +
            三、标准按钮(加大)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 四、标准按钮(小号) --> +
            四、标准按钮(小号)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 五、标准按钮(加小) --> +
            五、标准按钮(加小)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 六、筛选按钮(标准大小) --> +
            六、筛选按钮(标准大小)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 七、多选按钮(标准大小) --> +
            七、多选按钮(标准大小)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 八、多选按钮(大号) --> +
            八、多选按钮(大号)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 九、多选按钮(加大) --> +
            九、多选按钮(加大)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 十、删除按钮列表 --> +
            十、删除按钮列表
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            默认
            默认
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/form/calendar.htm b/zhiqim_ui/document/tutorial/ui/form/calendar.htm new file mode 100644 index 0000000..5a6a5f9 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/form/calendar.htm @@ -0,0 +1,126 @@ +<#def title = "日历控件"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "日历控件是在输入框触发时展开一个年月日时分秒的日期界面,按日历格式显示出来,通过点击和选择得到要求的日期或时间。当前日历控件支持选择日期、选择日期+时间、选择日期+时分三种。"/> +<#def prevUrl = "editable.htm"/> +<#def nextUrl = "../dialog/dialog.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "form", "calendar")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "日历控件")} +
            + +<#-- 标题 --> +
            +

            日历控件:

            +

            + 日历控件是在输入框触发时展开一个年月日时分秒的日期界面,按日历格式显示出来,通过点击和选择得到要求的日期或时间。当前日历控件支持选择日期、选择日期+时间、选择日期+时分三种。 +

            +
            + +<#-- 一、日期选择器 --> +
            一、日期选择器
            + + + + + + + + + + + + + + + + + + + + + + +
            类型事例代码
            最简单的方式
            有默认值
            有默认值和onchange方法
            + +<#-- 二、日期+时间选择器 --> +
            二、日期+时间选择器
            + + + + + + + + + + + + + + + + + + + + + + +
            类型未指定代码
            最简单的方式
            有默认值
            有默认值和onchange方法
            + +<#-- 三、日期+时分选择器 --> +
            三、日期+时分选择器
            + + + + + + + + + + + + + + + + + + + + + + +
            类型未指定代码
            最简单的方式
            有默认值
            有默认值和onchange方法
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/form/checkbox.htm b/zhiqim_ui/document/tutorial/ui/form/checkbox.htm new file mode 100644 index 0000000..adcf033 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/form/checkbox.htm @@ -0,0 +1,429 @@ +<#def title = "多选框样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "多选框样式是指参考多选按钮设计出有颜色设定的多选的方框样式。多选框默认1像素边框,移入时变为2像素边框,选中后增加背景颜色并显示打勾图标表示已选中,多选框默认黑色,支持红橙黄绿青蓝紫等颜色和大小5种设定。"/> +<#def prevUrl = "button.htm"/> +<#def nextUrl = "radio.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "form", "checkbox")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "多选框样式")} +
            + +<#-- 标题 --> +
            +

            多选框样式:

            +

            + 多选框样式是指参考多选按钮设计出有颜色设定的多选的方框样式。多选框默认1像素边框,移入时变为2像素边框,选中后增加背景颜色并显示打勾图标表示已选中,多选框默认黑色,支持红橙黄绿青蓝紫等颜色和大小5种设定。 +

            +
            + +<#-- 一、纯多选框样式 --> +
            一、纯多选框样式(标准大小)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 二、纯多选框样式(大号) --> +
            二、纯多选框样式(大号)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 三、纯多选框样式(加大) --> +
            三、纯多选框样式(加大)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 四、多选框样式和多选按钮联动 --> +
            四、多选框样式和多选按钮联动
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 五、多选框样式和多选按钮联动和操作 --> +
            五、多选框样式和多选按钮联动和操作
            + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            + +<#-- 六、多选框全选取消 --> +
            六、多选框全选取消
            + + + + + + + + + + +
            选择代码
            + +<#-- 七、多选框全选取消反选按钮 --> +
            七、多选框全选取消反选按钮
            + + + + + + + + + + +
            选择代码
            + +<#-- 八、多选框在按钮中 --> +
            八、多选框在按钮中
            + + + + + + + + + + +
            选择代码
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/form/editable.htm b/zhiqim_ui/document/tutorial/ui/form/editable.htm new file mode 100644 index 0000000..c836b11 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/form/editable.htm @@ -0,0 +1,267 @@ +<#def title = "可编辑文本"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "可编辑文本是定义一段文本(span),在该文本之后增加一个笔状图标,当点击笔状图标时显示输入框和保存按钮,输入框支持输入控制,点击保存按钮触发保存事件。"/> +<#def prevUrl = "select.htm"/> +<#def nextUrl = "calendar.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "form", "editable")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "可编辑文本")} +
            + +<#-- 标题 --> +
            +

            可编辑文本:

            +

            + 可编辑文本是定义一段文本(span),在该文本之后增加一个笔状图标,当点击笔状图标时显示输入框和保存按钮,输入框支持输入控制,点击保存按钮触发保存事件。 +

            +
            + +<#-- 可编辑文本参数说明 --> +
            可编辑文本参数说明(三项必须,八项可选)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数是否必须说明
            data-rolez-editable必须表明该文本是可编辑的文本
            data-value1.0必须可编辑文本值,不要配置到<span></span>中
            data-savefunction(value){return true;}必须保存触发函数,无还回值和返回true表示成功,返回false表示失败,返回字符串表示弹出错误提示并且失败
            data-value-classz-bold可选可编辑文本样式类
            data-value-stylecolor:red;font-size:14px;font-weight:700;可选可编辑文本样式,遵循css规则
            data-input-classz-blue可选输入框样式类
            data-input-stylewidth:50px;可选输入框样式表
            data-input-maxlength10可选输入框支持的最大长度
            data-input-checktype:Discount;可选输入框控制,请参考输入框说明
            data-button-classz-blue可选按钮样式类
            data-button-stylewidth:50px;可选按钮样式表
            + +<#-- 一、无返回或返回true保存 --> +
            一、无返回或返回true保存
            + + + + + + + + + + + + + + + + + + +
            效果预览代码
            <span data-role="z-editable" data-value="内容可编辑" data-save="function(value){}"></span>
            <span data-role="z-editable" data-value="内容可编辑" data-save="function(value){return true;}"></span>
            <span data-role="z-editable" data-value="内容可编辑" data-save="function(value){alert('弹出提示但不返回值可保存');}"></span>
            + +<#-- 二、返回false不保存 --> +
            二、返回false不保存
            + + + + + + + + + + + + + + +
            效果预览代码
            <span data-role="z-editable" data-value="内容可编辑" data-save="function(value){return false;}"></span>
            <span data-role="z-editable" data-value="内容可编辑" data-save="function(value){alert('弹出提示返回false不保存');return false;}"></span>
            + +<#-- 三、返回字符串弹出对话框不保存 --> +
            三、返回字符串弹出对话框不保存
            + + + + + + + + + + +
            效果预览代码
            <span data-role="z-editable" data-value="内容可编辑" data-save="function(value){return '弹出提示信息';}"></span>
            + +<#-- 四、触发修改值 --> +
            四、触发修改值
            + + + + + + + + + + +
            效果预览代码
            +

            + +
            +<input id="modify" class="z-input z-blue z-w100" value="内容可编辑">
            +<button type="button" onclick="Z.Editable.get(Z('#modified')[0]).val(Z('#modify').val());" class="z-button z-blue">修改</button><br><br>
            +
            +<span id="modified" data-role="z-editable" data-value="内容可编辑" data-save="doSave"></span>
            +    
            + +<#-- 五、可选参数展示 --> +
            五、可选参数展示
            + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            说明效果预览代码
            文本样式类:加粗、16像素
            文本样式表:红色
            + +
            <span data-role="z-editable" data-value="内容可编辑" data-save="function(value){}" data-value-class="z-bold z-px16" data-value-style="color:red;"></span>
            输入框样式类:蓝色、大号
            输入框样式表:宽度90px
            + +
            <span data-role="z-editable" data-value="内容可编辑" data-save="function(value){}" data-input-class="z-blue z-large" data-input-style="width:90px;"></span>
            按钮样式类:蓝色、大号
            按钮样式表:宽度70px
            + +
            <span data-role="z-editable" data-value="内容可编辑" data-save="function(value){}" data-button-class="z-blue z-large" data-button-style="width:70px;"></span>
            输入控制:只能输入整数,且最大6个 + (整数) +
            <span data-role="z-editable" data-value="123456" data-save="function(value){}" data-input-maxlength="6" data-input-check="type:Integer;"></span>
            + +<#-- 六、完整参数展示 --> +
            六、完整参数展示
            + +
            + + + + + + + + + + + +
            说明效果预览
            + 1、文本样式类:加粗、16像素
            + 2、文本样式表:红色
            + 3、输入框样式类:蓝色、大号
            + 4、输入框样式表:宽度90px、高度38px
            + 5、按钮样式类:蓝色、大号
            + 6、按钮样式表:宽度70px
            + 7、输入控制:只能输入折扣值
            + 8、输入控制:最长6个 +
            +  折 +
            +<span data-role="z-editable" data-value="8.96" data-save="function(value){}" 
            +    data-value-class="z-bold z-px16" data-value-style="color:red;"
            +    data-input-class="z-blue z-large" data-input-style="width:90px;height:38px;"
            +    data-button-class="z-blue z-large" data-button-style="width:70px;"
            +    data-input-maxlength="6" data-input-check="type:Discount;">
            +</span>
            +<span class="z-px16"> 折</span>
            +
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/form/input.htm b/zhiqim_ui/document/tutorial/ui/form/input.htm new file mode 100644 index 0000000..66169c7 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/form/input.htm @@ -0,0 +1,172 @@ +<#def title = "输入框样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "输入框样式是指对输入框增加样式规则,如指定输入框长度大小、边框颜色、和输入控制等。"/> +<#def prevUrl = "../js/query.htm"/> +<#def nextUrl = "button.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "form", "input")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "输入框样式")} +
            + +<#-- 标题 --> +
            +

            输入框样式:

            +

            + 输入框样式是指对输入框增加样式规则,如指定输入框长度大小、边框颜色、和输入控制等。 +

            +
            + +<#-- 一、输入框长度大小样式 --> +
            一、输入框长度大小样式(默认边框灰色)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型效果预览代码
            默认input样式
            加大尺寸input
            大尺寸input
            小尺寸input
            加小尺寸input
            + +<#-- 二、输入框选中时颜色 --> +
            二、输入框选中时颜色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型效果预览代码
            触发边框为红色
            触发边框为橙色
            触发边框为黄色
            触发边框为绿色
            触发边框为青色
            触发边框为蓝色
            触发边框为紫色
            + +<#-- 三、输入框输入控制 --> +
            三、输入框输入控制
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            说明验证效果预览
            只允许输入数值型:
            只允许输入整型:
            只允许输入整数小数:
            只允许输入字母:
            只允许最多2位小数的金额:
            只允许输入折扣类型:
            只允许小时分钟格式(00:23):
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/form/radio.htm b/zhiqim_ui/document/tutorial/ui/form/radio.htm new file mode 100644 index 0000000..82a67ae --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/form/radio.htm @@ -0,0 +1,309 @@ +<#def title = "单选框样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "单选框样式是指参考单选按钮设计出有颜色设定单选的圆框的样式。单选框默认1像素边框,移入时变为2像素边框,选中后增加背景颜色并显示打勾图标表示已选中,单选框默认黑色,支持红橙黄绿青蓝紫等颜色和大小5种设定。"/> +<#def prevUrl = "checkbox.htm"/> +<#def nextUrl = "select.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "form", "radio")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "单选框样式")} +
            + +<#-- 标题 --> +
            +

            单选框样式:

            +

            + 单选框样式是指参考单选按钮设计出有颜色设定单选的圆框的样式。单选框默认1像素边框,移入时变为2像素边框,选中后增加背景颜色并显示打勾图标表示已选中,单选框默认黑色,支持红橙黄绿青蓝紫等颜色和大小5种设定。 +

            +
            + +<#-- 一、纯单选框样式 --> +
            一、纯单选框样式(标准大小)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            单选标准按钮
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 二、纯单选框样式(大号) --> +
            二、纯单选框样式(大号)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 三、纯单选框样式(加大) --> +
            三、纯单选框样式(加大)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            单选加大按钮
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 四、单选框样式和单选按钮联动 --> +
            四、单选框样式和单选按钮联动
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            有名称,点我也可以
            红色
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/form/select.htm b/zhiqim_ui/document/tutorial/ui/form/select.htm new file mode 100644 index 0000000..5a85ba6 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/form/select.htm @@ -0,0 +1,160 @@ +<#def title = "选择框样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "选择框样式是参考选择按钮设计出有颜色设定下拉列表的样式。选择框是一种下拉列表样式,目标是和表单选择按钮联动,实现跨浏览器且更美观的样式。"/> +<#def prevUrl = "radio.htm"/> +<#def nextUrl = "editable.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "form", "select")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "选择框样式")} +
            + +<#-- 标题 --> +
            +

            选择框样式:

            +

            + 选择框样式是参考选择按钮设计出有颜色设定下拉列表的样式。选择框是一种下拉列表样式,目标是和表单选择按钮联动,实现跨浏览器且更美观的样式。 +

            +
            + +<#-- 一、简单选择按钮转选择框 --> +
            一、简单选择按钮转选择框
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            1、原始选择按钮:
            +
            2、转化后的选择框(增加角色data-role="z-select"和颜色data-class="z-cyan")
            +<#-- 二、模糊输入匹配可选选择框 --> +
            二、模糊选择框
            + + + + + + + +
            可模糊搜索的选择框:
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/index.htm b/zhiqim_ui/document/tutorial/ui/index.htm new file mode 100644 index 0000000..92f691c --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/index.htm @@ -0,0 +1,287 @@ +<#def title = "ZhiqimUI"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "“ZhiqimUI”是一套集成Javascript库、Css库、Font库、常用ico图标和Flash控件等,并在其上开发的大量UI组件组成的前端开发套件。"/> +<#def prevUrl = "/index.htm"/> +<#def nextUrl = "./css/css.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "ui", "")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "前端UI")} +
            + +<#-- 标题 --> +
            +

            什么是“ZhiqimUI”

            +

            + “ZhiqimUI”是一套集成Javascript库、Css库、Font库、常用ico图标和Flash控件等,并在其上开发的大量UI组件组成的前端开发套件。
            + 1、ZhiqimUI压缩打包成一个jar文件(zhiqim_ui.jar),配合ZhiqimHttpd使用,可直接通过/service/res/*访问。
            + 2、ZhiqimUI的JS库拥有类似于jQuery的DOM操作能力,通过Z(selector)方式访问,并集成了大量常用的静态工具。
            + 3、ZhiqimUI的Css库类似于bootstrap,统一使用z-前缀约束,定义了大量常用的css规则,同时兼容其他的css库。
            + 4、ZhiqimUI的插件库非常丰富并持续增加中,有对话框、Ajax调用、表单套件、日历、复制、标签页、文件上传等。
            +

            +
            + +<#-- ZhiqimUI目录结构 --> +
            ZhiqimUI目录结构
            +
            + zhiqim_ui.jar +
              +
            • font
            • +
            • zhiqim.woff
            • +
            • image
            • +
            • ico_12.png
            • +
            • ......
            • +
            • ico_tree.png
            • +
            • zhiqim.mobile_v1.5.0.r2018091201.css
            • +
            • zhiqim.mobile_v1.5.0.r2018091201.min.js
            • +
            • zhiqim_v1.5.0.r2018091201.css
            • +
            • zhiqim_v1.5.0.r2018091201.min.js
            • +
            +
            +
            +
              +
            • + ZhiqimUI统一打包成[zhiqim_ui.jar]。包括font、image目录和核心的css、js文件。类路径为:org.zhiqim.httpd.context.service.resource +
            • +
            • 目录[font]存放的是z-font对应的字体文件,如等。
            • +
            • 目录[image]存放的CSS和插件常用到的一些图标素材,如文件图标、箭头图标等。
            • +
            • 文件[zhiqim_v1.5.0.r2018091201.css]是CSS核心库,为方便查找支持的样式,目前只作了空格处理,没有压缩,其中v1.5.0.r2018091201是版本号,升级会变动。
            • +
            • 文件[zhiqim_v1.5.0.r2018091201.min.js]是JS核心库,原文件比较大,压缩后大约100K左右,如需查看API或源文件,在文档中查看,其中v1.5.0.r2018091201是版本号,升级会变动。
            • +
            +
            + +<#-- 看一段简单的FTML代码风格 --> +
            如何使用ZhiqimUI?
            + +
            +<!-- 引入zhiqimUI的css文件 --> +<link rel="stylesheet" href="/service/res/zhiqim_v1.4.0.r2018010101.css"> + +<!-- 引入zhiqimUI的js文件 --> +<script src="/service/res/zhiqim_v1.4.0.r2018010101.min.js"></script> + +<!-- 使用zhiqimUI的CSS定义 --> +<table class="z-table z-bordered z-bd-rd8"> +<tr> + <td> + <input id="text" class="z-input" value="原内容"> + </td> +</tr> +</table> + +<!-- 使用zhiqimUI的JS代码修改值 --> +<script> + +// 以下代码将把id为text的input的value值改为"新的内容"。 +Z("#text").val("新的内容"); + +// 以下代码弹出一个对话框。 +var dialog = new Z.Dialog(); +dialog.url = "/new.htm"; +dialog.width = 400; +dialog.height = 200; +dialog.execute(); + +</script> +
            + +<#-- ZhiqimUI CSS核心库 --> +
            ZhiqimUI CSS核心库
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            功能说明
            全局定义全局定义是指在全局定义里的标签缺省下的样式规则
            颜色定义颜色定义是指在ZhiqimUI的核心CSS文件中,默认提供的全局、白色、黑色和红、橙、黄、绿、青、蓝、紫共十种颜色的定义,包括字体颜色、背景颜色和边框颜色等,以及对应的样式名称。
            字体图标“字体图标”是矢量图片按字体规范设计的一种新的图标,知启蒙字体图标放在/service/res/font/zhiqim.woff文件中,当前开发和收集的图标分 + 操作类、文档类、设备类、图表类、实体类五种,共五十九个图标。 + 字体图标不支持斜体,以便使用<i>标签来定义,如<i class="z-font z-config"></i> +
            图片图标“图片图标”是把一组小图标图片拼成一张大图,通过CSS的background-position特性指定小图标在大图中的位置和宽高显示图标, + 知启蒙图片图标放在/service/res/image目录下,根据大小和类型分为12px、16px、22px、36px以及文件图标、树图标等,在这里还利用三角型和圆型生成箭头和圆圈等样式。 +
            文本样式文本样式是指对文本文字增加样式规则,如指定文本粗斜体、文本上下标、文本字体大小、文本行高、文本强制换行、强制不换行、省略隐藏、文本标题属性、文本对齐方式和文本附带的下划线删除线、以及编码突出效果等。
            块样式块样式是指对一个块区域增加样式规则,如指定块隐藏显示、块定位、块宽、块宽百分比、块高、块高百分比、内边距、外边距等属性。
            表格样式表格样式是指对表格增加样式规则,如指定表格边框、表格圆角、表格行线、表格单元格内边距、表格单元格字体大小、表格单元格文本对齐方式、表格单元格文本行高等,默认表格无边框。 + 另外,CSS对底部圆角当有背景时需要手动对第一和最后单元格补圆角,当圆角首列合并单元格时也需要对被合并的行第一单元格补左边线。 +
            + +<#-- ZhiqimUI JS核心库 --> +
            ZhiqimUI JS核心库
            + + + + + + + + + + + + + + + + + + + + + + +
            功能说明
            全局定义知启蒙JS统一命名空间为“Z”,同时“Z”也是window下全局函数,如果“Z”有定义冲突请使用全称“zhiqim”。在全局“Z”命名空间下定义的全局属性、全局函数、全局正则表达式和全局类。
            静态对象静态对象是把一系列常用的对象定义成静态属性和函数。目前包括有浏览器对象(Z.B)、文档对象(Z.D)、 + 事件对象(Z.E)、元素对象(Z.EL)、HTML对象(Z.H)、地址对象(Z.L)、COOKIE对象(Z.CK)。 +
            工具对象工具对象也是静态对象的一种,把一系列常用的静态属性和函数归类到一个工具对象中。目前包括断言工具(Z.A/Z.Asserts)、对象工具(Z.O/Z.Objects)、类型工具(Z.T/Z.Types)、 + 验证工具(Z.V/Z.Validates)、表单工具(Z.F/Z.FM)、JSON工具(Z.J/Z.Jsons)、日期工具(Z.DT/Z.DateTimes)、数组工具(Z.AR/Z.Arrays)、字符串工具(Z.S/Z.Strings)、算术工具(Z.Maths)、 + 金额工具(Z.AM/Z.Amounts)和颜色工具(Z.Colors)。 +
            查询对象Z.QueryZ.Query是设计成类似jQuery的DOM操作类。Z.Query采用HTML5原生的document.querySelectorAll实现了大部分jQuery的API,如selector,DOM操作,事件方法,动画等。 + 并增加了自身的一些特性和命名,如offsetLeftBody()、focusEnd()等。 +
            + +<#-- ZhiqimUI 插件库 --> +
            ZhiqimUI 插件库
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            功能说明
            表单插件库
            输入框输入框样式是指对输入框增加样式规则,如指定输入框长度大小、边框颜色、和输入控制等。
            按钮按钮样式是指对按钮增加样式规则,按钮分为三种,一是标准按钮、二为筛选按钮、三是多选按钮。样式规则包括按钮大小、颜色、边框颜色、选中特效等。
            多选框多选框样式是指参考多选按钮设计出有颜色设定的多选的方框样式。多选框默认1像素边框,移入时变为2像素边框,选中后增加背景颜色并显示打勾图标表示已选中,多选框默认黑色,支持红橙黄绿青蓝紫等颜色和大小5种设定。
            单选框单选框样式是指参考单选按钮设计出有颜色设定单选的圆框的样式。单选框默认1像素边框,移入时变为2像素边框,选中后增加背景颜色并显示打勾图标表示已选中,单选框默认黑色,支持红橙黄绿青蓝紫等颜色和大小5种设定。
            选择框选择框样式是参考选择按钮设计出有颜色设定下拉列表的样式。选择框是一种下拉列表样式,目标是和表单选择按钮联动,实现跨浏览器且更美观的样式。
            可编辑文本可编辑文本是定义一段文本(span),在该文本之后增加一个笔状图标,当点击笔状图标时显示输入框和保存按钮,输入框支持输入控制,点击保存按钮触发保存事件。
            日历日历控件是在输入框触发时展开一个年月日时分秒的日期界面,按日历格式显示出来,通过点击和选择得到要求的日期或时间。当前日历控件支持选择日期、选择日期+时间、选择日期+时分三种。
            对话框插件库
            自定义对话框自定义对话框是指根据业务要求,自动组装对话框参数,完成对话框的弹出。自定义对话框支持的参数有标题、宽度、高度、边框颜色、目标区域、指定弹出HTML、指定弹出URL等一系列参数,是各种对话框的基础。
            告警对话框警告对话框是自定义对话框的一种参考alert方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的警告对话框,支持设置警告内容和点击确定后回调函数。
            询问对话框询问对话框是自定义对话框的一种参考confirm方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的确认对话框,支持设置确认内容和点击确定后回调函数,点击取消不向下处理。
            提示对话框提示对话框是自定义对话框的一种参考prompt方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的提示对话框,支持设置提示内容和点击确定后回调函数,点击取消不向下处理。
            加载对话框加载对话框是自定义对话框的一种没有标题只有加载中提示的对话框。目标是在屏幕或用户指定的元素可视范围的中间提供没有警告声音且美观的加载对话框,支持设置九个参数来定义加载中界面,无关闭按钮,由业务实现关闭。
            导航插件库
            标签页标签页是参考tabnav设计出更简单易用的内容重叠布局的导航页。标签页使用nav和section作为是标签和内容显示。在nav中使用li表示每个标签,在section中使用div作为每个标签显示的内容。
            步骤条步骤条是通过指定多个步骤标签,在每步中展示激活的一个步骤标签的导航页。步骤条使用nav作为每个步骤。 + 样式通过before和after属性自动在每个步骤后加上白色箭头。 +
            提示框提示框是当鼠标移入或点击到重要的标志时,主动冒泡出一个浮动层,对该标志作解释的提示信息框。当前支持鼠标移入和点击两种事件,提示框在设计中有箭头、对齐方式、边框等属性。
            下拉列表下拉列表是设计出当移入或点击时下拉出一个列表的样式。下拉列表当前支持点击和移入触发下拉列表一层界面,支持列表颜色、激活颜色,指定下拉列表宽度和多列等样式。
            工具插件库
            Flash复制由于各浏览器剪贴板功能不一致,功能使用复杂,因此知启蒙是利用Flash的sprite容器制作的剪贴板功能,以达到跨浏览器支持对文本的复制功能。 + 设计方案是先用button占位,再利用flash透明的特性覆盖button。该功能需要开启flash的支持。
            Ajax调用AJAX即“Asynchronous Javascript And XML”(异步JavaScript和XML),是指一种创建交互式网页应用的网页开发技术。 + 知启蒙AJAX采用面向RMI的概念设计,通过指定类和方法,传入参数对应方法的参数,通过RMI访问JAVA类的方法获取执行结果。 +
            拖拽拖拽是指定一个可拖动的对象,当鼠标按下时拖拽到其他位置。缩放是指定一个可缩放的对象,当鼠标按下时拉动对象使之放大或缩小。
            文件上传知启蒙文件上传提供了多种上传方法,支持表单上传、单文件上传,多文件上传,预览再上传,大文件上传断点续传(HTML5和Flash两种)等。
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/js/js.htm b/zhiqim_ui/document/tutorial/ui/js/js.htm new file mode 100644 index 0000000..7954e9e --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/js/js.htm @@ -0,0 +1,674 @@ +<#def title = "全局定义"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "知启蒙JS统一命名空间为“Z”,同时“Z”也是window下全局函数,如果“Z”有定义冲突请使用全称“zhiqim”。在全局“Z”命名空间下定义的全局属性、全局函数、全局正则表达式和全局类。"/> +<#def prevUrl = "../css/table.htm"/> +<#def nextUrl = "static.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "js", "js")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "全局js定义")} +
            + +<#-- 标题 --> +
            +

            全局定义:

            +

            + 知启蒙JS统一命名空间为“Z”,同时“Z”也是window下全局函数,如果“Z”有定义冲突请使用全称“zhiqim”。在全局“Z”命名空间下定义的全局属性、全局函数、全局正则表达式和全局类。 +

            +
            + +<#-- 全局属性定义 --> +
            全局属性定义
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            属性说明
            Z.v1.2.2ZhiqimJS的基线版本号
            Z.uundefindedundefinded的简写,如if (abc == Z.u)来判断是不是未定义
            Z.ddocumentdocument的简写
            Z.nnavigatornavigator的简写
            Z.llocationlocation的简写
            Z.uauserAgent.toLowerCase()userAgent的小写简写
            + +<#-- 全局函数定义 --> +
            全局函数定义
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.eval(expression)执行表达式语句expression表达式字符串,如:var abc = "abc";
            Z.alert(text, callback)弹出警告对话框text警告文本,链接暂不支持
            callback回调函数,点击确定后回调
            Z.confirm(text, callback, param)弹出询问对话框text询问文本,链接暂不支持
            callback回调函数,点击确定后回调,点击取消不处理
            param设置参数,支持参数有{height: 50}
            Z.prompt(text, value, callback, param)弹出修改对话框text 修改说明,链接暂不支持
            value修改的值
            callback回调函数,点击确定后回调
            param设置参数
            Z.bind(f, $this)返回一个新的函数,使得原函数this指向$this对象下执行f原函数
            $this指向$this对象
            Z.each(object, callback)减化循环处理,默认this绑定到item上object对象
            callback回调函数
            Z.eachof($this, object, callback)减化循环处理,支持对字符串,数字,类数组和纯对象处理,=true表示中途退出循环,默认this绑定到传入的$this上,如果未传则绑定到item上
            另外支持除$this,object,callback之外的参数也会出现在回调函数中
            $this回调函数指针
            object循环处理对象
            callback回调函数
            Z.clone(obj)克隆一个新值obj对象
            Z.onload(f)初始化后加载f对象
            Z.random(length, type)随机生成一定长度的字符或数字length 长度
            type类型表名生成的随机字符串是字母数字(0或undefinde),数字(1),字母(2),大写字母(3),小写字母(4),大写字母和数字(5),小写字母和数字(6)
            Z.timer(speed, times, $this, process, complete)定时任务speed速度,单位毫秒,如50
            times执行次数,-1表示一直运行
            $this回调函数时的this
            process运行时回调函数
            complete完成时回调函数
            Z.drag(elem, param, callback, $this)拖拽或滑动elem属性
            param拖放参数,如果为字符串或node表示拖放对象
            callback回调函数
            $this回调函数时的this
            Z.dragInParent(elem, drag, parent, callback, $this)拖拽或滑动elem属性
            drag拖放对象
            parent拖放对象的父对象
            callback回调函数
            $this回调函数时的this
            + +<#-- 全局正则表达式定义 --> +
            全局正则表达式定义(统一定义在Z.R中)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            正则表达式说明
            空格
            Z.R.SPACE空格/\s+/
            Z.R.SPACE_LEFT左空格/^\s+/
            Z.R.SPACE_RIGHT右空格/\s+$/
            数值型
            Z.R.NUMERIC数值型/^\d+$/
            Z.R.INTEGER整数,支持正负数/^(0|[\+\-]?[1-9]\d*)$/
            Z.R.INTEGER_P正整数/^[1-9]\d*$/
            Z.R.INTEGER_N_N非负整数/^(0|[1-9]\d*)$/
            小数型
            Z.R.FLOAT浮点值,支持多位小数点/^(0|[\+\-]?[1-9]\d*)(\.\d+)?$/
            Z.R.FLOAT_N_N非负浮点值,支持多位小数/^(0|[1-9]\d*)(\.\d+)?$/
            Z.R.AMOUNT_2R标准元金额,支持0-2位小数/^(0|[\+\-]?[1-9]\d*)(\.\d{1,2})?$/
            Z.R.AMOUNT_2R_FIXED固定元金额,两位小数/^(0|[\+\-]?[1-9]\d*)(\.\d{2})$/
            Z.R.AMOUNT_N_N_2R非负标准元金额,支持0-2位小数/^(0|[1-9]\d*)(\.\d{1,2})?$/
            Z.R.AMOUNT_N_N_2R_FIXED非负固定元金额,两位小数/^(0|[1-9]\d*)(\.\d{2})$/
            字符相关
            Z.R.ALPHABAT字母/^[A-Za-z]+$/
            Z.R.ALPHABAT_UPPER大写字母/^[A-Z]+$/
            Z.R.ALPHABAT_LOWER小写字母/^[a-z]+$/
            Z.R.ALPHA_LOWER_NUMERIC小写字母或数字/^[a-z0-9]+$/
            Z.R.ALPHA_UPPER_NUMERIC大写字母或数字/^[A-Z0-9]+$/
            Z.R.ALPHA_NUMERIC字母或数字/^[A-Za-z0-9]+$/
            Z.R.ALPHA_NUMERIC_PA大写小字母和数字,字母开头/^[A-Za-z][A-Za-z0-9]*$/
            Z.R.ALPHABAT_DOUBLE双字节/^[^x00-xff]+$/
            Z.R.CHINESE中文/^[\u4e00-\u9fa5]+$/
            Z.R.CHINESE_ALPHA_NUMERIC中文大小写字母和数字/^[\u4e00-\u9fa5A-Za-z0-9]+$/
            日期相关
            Z.R.DATE日期/^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))$/
            Z.R.TIME时间/^([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$/
            Z.R.DATE_TIME日期时间/^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s(([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9]))$/
            Z.R.DATE_TIME_MATCH日期时间简单匹配/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/
            HTML相关
            Z.R.HTML是否包含HTML/<|&#?\w+;/
            Z.R.HTML_XHTML_TAG适配HTML成XHTML标记/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig
            Z.R.HTML_TAG_NAME查找HTML标记名称/<([\w:]+)/
            其他
            Z.R.ACCOUNT账号,要求5-25位,中文大小写字母和数字和下划线、邮件符、点号,并且不能以@._开头和结尾/^(?!(_|@|\.))(?!.*?(_|@|\.)$)[\w@\.\u4e00-\u9fa5]{5,25}$/
            Z.R.PASSWORD密码,要求6-16位,大小写字母和.@_#$!~%符号/^[\w@\.#$!~%]{6,16}$/
            Z.R.MOBILE手机号,支持+86/^((\+86)|(86)|)?(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|170|18[0|1|2|3|5|6|7|8|9])\d{8}$/
            Z.R.MOBILE1111位手机号/^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|170|18[0|1|2|3|5|6|7|8|9])\d{8}$/
            Z.R.IPIP地址/^((?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])$/
            Z.R.MACMAC地址/^[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}$/
            Z.R.QQQQ号/^[1-9]\d{4,10}$/
            Z.R.POSTAL_CODE邮政编码/^[1-9]\d{5}$/
            Z.R.EMAIL邮箱/^([\w-_]+(?:\.[\w-_]+)*)@((?:[a-z0-9]+(?:-[a-zA-Z0-9]+)*)+\.[a-z]{2,6})$/
            Z.R.IDCARD身份证号/^(\d{6})((((19|20)[0-9]{2})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))(\d{3}[0-9xX*])$/
            + +<#-- 全局类定义 --> +
            全局类定义(由Z.Class.newInstance()派生的函数称为类)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            属性/方法属性/方法说明举例
            默认属性和方法
            immediate是否立即执行,默认false在构造函数中设置,如var draggable = new Draggable({immediate:true});
            set设置属性draggable.set(key, value);
            派出的类可定义的属性
            defaults缺省字段表defaults = {elem:null, id="123456"},
            派出的类可定义的方法
            init初始化函数,无参数init(){},
            execute执行函数,无参数execute(){},
            + + + + + +
            一、哈唏表类(Z.HashMap):
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            属性/方法属性/方法说明举例
            构造函数
            new构造函数var aMap = new Z.HashMap();
            方法
            put设置值aMap.put("abc", "ABC");
            get获取值var value = aMap.get("abc");
            remove删除值aMap.remove("abc");
            clear清空表aMap.clear();
            size获取表大小var size = aMap.size();
            isEmpty判断是否为空var isEmpty = aMap.isEmpty();
            containKey判断KEY中是否包含值var containKey = aMap.containKey("abc");
            containValue判断VALUE中是否包含值var containValue = aMap.containValue("ABC");
            keySet获取KEY数组var keys = aMap.keySet();
            values获取VALUE数组var values = aMap.values();
            + + + + + +
            二、可拖动类(Z.Draggable):
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            属性/函数属性/方法说明举例
            构造函数
            new构造函数var draggable = new Z.Draggable();
            属性
            elem拖拽对象draggable.elem = Z.D.id("drag");
            drag拖拽手把draggable.drag = Z.D.id("drag");
            param拖拽参数(支持left,top,right,bottom,width,height其中right,bottom时width,height无效)draggable.param = {left:0,top:0,width:500;height:300};
            cursor拖拽手势,默认movedraggable.cursor = "move";
            callback拖拽回调函数draggable.callback(){};
            callthis拖拽回调函数this指针draggable.callthis = $this;
            函数
            execute执行拖拽draggable.execute();
            close关闭拖拽draggable.close();
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/js/query.htm b/zhiqim_ui/document/tutorial/ui/js/query.htm new file mode 100644 index 0000000..64d5a41 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/js/query.htm @@ -0,0 +1,1363 @@ +<#def title = "Z.Query 查询对象"/> +<#def keyword = "Z.Query FQuery jQuery HTML5 selector"/> +<#def desc = "Z.Query是设计成类似jQuery的DOM操作类。Z.Query采用HTML5原生的document.querySelectorAll实现了大部分jQuery的API,如selector,DOM操作,事件方法,动画等。并增加了自身的一些特性和命名,如offsetLeftBody()、focusEnd()等。"/> +<#def prevUrl = "util.htm"/> +<#def nextUrl = "../form/input.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "js", "query")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "查询对象")} +
            + +<#-- 标题 --> +
            +

            查询对象(Z.Query):

            +

            + Z.Query是设计成类似jQuery的DOM操作类。Z.Query采用HTML5原生的document.querySelectorAll实现了大部分jQuery的API,如selector,DOM操作,事件方法,动画等。 + 并增加了自身的一些特性和命名,如offsetLeftBody()、focusEnd()等。 +

            +
            + +<#-- Z.Query属性 --> +
            Z.Query属性
            + + + + + + + + + + + + + + +
            属性说明
            selector选择器对象,支持是document、function、element、element列表、CSS3选择器、HTML文本等
            length包含顶级元素长度
            + +<#-- Z.Query选择器 --> +
            Z.Query选择器
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            选择器举例说明
            空参数选择器
            空参数Z(""), Z(null), Z(undefined)未选择任何元素
            元素参数选择器
            documentZ(document)选择document
            elementZ(element)选择元素对象
            函数参数选择器
            functionZ(function(){})初始化调用函数,相关于Z.onload(function(){})
            数组参数选择器
            Z.QueryZ(Z.Query)选择另一个查询对象
            ArrayZ(Array)选择元素数组
            HTMLCollectionZ(HTMLCollection)选择元素集合
            NodeListZ(NodeList)选择元素列表
            字符串选择器
            bodyZ("body")选择document.body
            <tag>Z("<div>"),Z("<INPUT>")选择HTML标签列表
            HTMLZ("<div>abc</div>")选择一段HTML文本,并封装成元素列表
            字符串的CSS选择器
            .classZ(".abc")选择 class="abc" 的所有元素
            #idZ("#zhiqim")选择 id="zhiqim" 的所有元素。
            *Z("*")选择所有元素
            tagZ("p")选择所有 <p> 元素
            tag,tagZ("div,p")选择所有 <div> 元素和所有 <p> 元素
            tag tagZ("div p")选择 <div> 元素的子孙 <p> 元素
            tag>tagZ("div>p")选择 <div> 元素的子 <p> 元素
            tag+tagZ("div+p")选择 <div> 元素同级之后的所有 <p> 元素。
            [attribute]Z("[target]")选择带有 target 属性所有元素
            [attribute=value]Z("[target=_blank]")选择 target="_blank" 的所有元素。
            [attribute~=value]Z("[title~=flower]")选择 title 属性包含单词 "flower" 的所有元素。
            [attribute|=value]Z("[lang|=en]")选择 lang 属性值以 "en" 开头的所有元素。
            :linkZ("a:link")选择所有未被访问的链接。
            :visitedZ("a:visited")选择所有已被访问的链接。
            :activeZ("a:active")选择活动链接。
            :hoverZ("a:hover")选择鼠标指针位于其上的链接。
            :focusZ("input:focus")选择获得焦点的 input 元素。
            :first-letterZ("p:first-letter")选择每个 <p> 元素的首字母。
            :first-lineZ("p:first-line")选择每个 <p> 元素的首行。
            :first-childZ("p:first-child")选择属于父元素的第一个子元素的每个 <p> 元素。
            :beforeZ("p:before")在每个 <p> 元素的内容之前插入内容。
            :afterZ("p:after")在每个 <p> 元素的内容之后插入内容。
            :lang(language)Z("p:lang(it)")选择带有以 "it" 开头的 lang 属性值的每个 <p> 元素。
            element1~element2Z("p~ul")选择前面有 <p> 元素的每个 <ul> 元素。
            [attribute^=value]Z("a[src^="https"]")选择其 src 属性值以 "https" 开头的每个 <a> 元素。
            [attribute$=value]Z("a[src$=".pdf"]")选择其 src 属性以 ".pdf" 结尾的所有 <a> 元素。
            [attribute*=value]Z("a[src*="abc"]")选择其 src 属性中包含 "abc" 子串的每个 <a> 元素。
            :first-oz-typeZ("p:first-oz-type")选择属于其父元素的首个 <p> 元素的每个 <p> 元素。
            :last-oz-typeZ("p:last-oz-type")选择属于其父元素的最后 <p> 元素的每个 <p> 元素。
            :only-oz-typeZ("p:only-oz-type")选择属于其父元素唯一的 <p> 元素的每个 <p> 元素。
            :only-childZ("p:only-child")选择属于其父元素的唯一子元素的每个 <p> 元素。
            :nth-child(n)Z("p:nth-child(2)")选择属于其父元素的第二个子元素的每个 <p> 元素。
            :nth-last-child(n)Z("p:nth-last-child(2)")同上,从最后一个子元素开始计数。
            :nth-oz-type(n)Z("p:nth-oz-type(2)")选择属于其父元素第二个 <p> 元素的每个 <p> 元素。
            :nth-last-oz-type(n)Z("p:nth-last-oz-type(2)")同上,但是从最后一个子元素开始计数。
            :last-childZ("p:last-child")选择属于其父元素最后一个子元素每个 <p> 元素。
            :rootZ(":root")选择文档的根元素。
            :emptyZ("p:empty")选择没有子元素的每个 <p> 元素(包括文本节点)。
            :targetZ("#zhiqim:target")选择当前活动的 #zhiqim 元素。
            :enabledZ("input:enabled")选择每个启用的 <input> 元素。
            :disabledZ("input:disabled")选择每个禁用的 <input> 元素
            :checkedZ("input:checked")选择每个被选中的 <input> 元素。
            :not(selector)Z(":not(p)")选择非 <p> 元素的每个元素。
            ::selectionZ("::selection")选择被用户选取的元素部分。
            + +<#-- Z.Query函数(内部操作) --> +
            Z.Query函数(内部操作)
            + + + + + + + + + + + + + + + + + +
            函数说明举例
            size()返回长度,同length,无参数
            Z(".abc").size()
            each(callback)
            each(callback, param)
            + 循环处理,支持多参数,其中第一个参数回调函数,后面的参数为回调函数的参数

            + 回调函数中和一个参数为elem,第二参数为i,第三参数开始和each的第二参数开始匹配 +
            +
            +Z(".abc").each(function(elem){
            +    console.info(elem);
            +});
            +
            +Z(".abc").each(function(elem, i){
            +    console.info(i);
            +});
            +
            +Z(".abc").each(function(elem, i, param){
            +    console.info(param);
            +}, param);
            +    
            + +<#-- Z.Query函数(元素相关操作) --> +
            Z.Query函数(元素相关操作)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            find(selector)在当前Z.Query中查找子元素selector指定的选择器
            parent()返回当前Z.Query第一个元素的父元素的Z.Query
            siblings(selector)在当前Z.Query中兄弟节点中查找selector指定的选择器
            next(selector)在当前Z.Query后面节点中查找selector指定的选择器
            nextAll(selector)在当前Z.Query后面所有节点中查找selector指定的选择器
            prev(selector)在当前Z.Query前面节点中查找selector指定的选择器
            prevAll(selector)在当前Z.Query前面所有节点中查找selector指定的选择器
            children(selector)在当前Z.Query子元素中查找selector指定的选择器
            nth(elem, selector)获取元素在查找器的索引号,索引号从1开始elem指定的元素
            selector指定的选择器
            + +<#-- Z.Query函数(文档相关操作) --> +
            Z.Query函数(元素相关操作)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            appendTo($selector)将元素增加到选择器元素中$selector指定的选择器
            appendToPos($selector))将元素增加到选择器元素中,并检查position:static标志转为position:relative$selector指定的选择器
            append($selector)向选择器元素内部追加内容$selector指定的选择器
            remove()移除本身元素
            + +<#-- Z.Query函数(属性相关操作) --> +
            Z.Query函数(属性相关操作)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            val(values)设置或获取值values指定的值,支持undefinde,String,Function类型: + 1、未传值表示获取值
            + 2、字符串表示获取属性为value的值
            + 3、函数表示回调函数得到值,再设置到value属性中 +
            attr(param, param2)设置或获取属性值param参数1,支持两种:
            + 1、字符串表示属性名称,设置或获取单个属性
            + 2、对象属性方式,如{href:"/zhiqim.htm",target:"_blank"}表示设置多个属性
            +
            param2参数2,设置单个属性时有效
            如:attr("href", "/zhiqim.htm")
            removeAttr(name)移除属性name指定属性名称
            className(className)设置或获取类样式表className指定类样式名称列表
            addClass(className)增加类样式className指定类样式名称
            removeClass(className)删除类样式className指定类样式名称
            hasClass(className)判断是否有类样式className指定类样式名称
            toggleClass(className)切换类样式,如果没有则加入,有则删除className指定类样式名称
            + +<#-- Z.Query函数(样式相关操作) --> +
            Z.Query函数(样式相关操作 style & css & cssNum &opacity & display)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            style(style)设置或获取元素的样式style指定样式,未传值表示获取
            css(param, param2)设置或获取CSS样式param参数1,支持两种:
            + 1、字符串表示样式名称,设置或获取单个样式
            + 2、对象属性方式,如{width:100,height:100}表示设置多个CSS样式
            + 对象方式参数["top", "bottom", "left", "right", "width", "height", "min-width", "max-width", "min-height", "max-height", "line-height"]支持数值型的值 +
            param2参数2,设置单个CSS样式时有效
            如:css("width", 100)
            cssNum(name)获取CSS样式的数值
            如:width:100px得到100
            name指定样式名称
            opacity(param)设置或获取透明度param指定参数,未传值表示获取
            display(param)设置或获取display属性param指定参数,未传值表示获取
            inline()文本行,相对于display:inline
            block()块,相对于display:block
            inBlock()行内块,相对于display:inline-block
            + +<#-- Z.Query函数(显示/隐藏) --> +
            Z.Query函数(显示/隐藏 保留占位)
            + + + + + + + + + + + + + + + + + + +
            函数说明
            isHidden()是否隐藏
            hidden()隐藏
            visible()显示
            + +<#-- Z.Query函数(显示/隐藏) --> +
            Z.Query函数(显示/隐藏)
            + + + + + + + + + + + + + + + + + + + + + + +
            函数说明
            isHide()是否隐藏
            hide()隐藏
            show()显示,先查是否有隐藏时的缓存,如果没有查elem缺省值
            toggle()切换元素的可见状态
            + +<#-- Z.Query函数(内容相关操作) --> +
            Z.Query函数(内容相关操作 text & html)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            text(text)设置或获取元素文本内容text指定的文本,如果未传值表示获取
            html(html)设置或获取元素innerHTMLhtml指定的HTML,如果未传值表示获取
            htmlx()获取HTML的扩展方式,对readonly、tbody等作处理
            htmlt()获取HTML的扩展方式,把<>转化为&lt;&gt;
            htmls()获取自己本身的HTML
            + +<#-- Z.Query函数(焦点选择) --> +
            Z.Query函数(焦点动作 focus & focusEnd & select & section)
            + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明
            focus()设置元素获取焦点
            focusEnd()设置元素获取焦点,并移动光标到最后
            select()设置元素获取焦点,并选中文本
            selection()选中的文本内容
            isSelection()是否选中内容
            + +<#-- Z.Query函数(偏移相关) --> +
            Z.Query函数(偏移宽度 & 可操作宽高)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明
            offsetParent()偏移父元素
            offsetWidth()元素偏移宽度 = style.width = border+padding+content,和style.width不同点:
            + 1.style.width可设置百分比并返回百分比,而offsetWidth返回百分比计算的数值
            + 2.style.width未设置返回空字符串,而offsetWidth一直返回计算的数值
            + 3.style.width带px后缀
            offsetHeight()元素偏移高度 = style.height = border+padding+content
            offsetLeft()元素相对父元素左偏移 = style.left,火狐需除去左边框
            offsetTop()元素相对父元素上偏移 = style.top
            offsetLeftBody()元素相对body左偏移(绝对左偏移)
            offsetTopBody()元素相对body上偏移(绝对上偏移)
            clientWidth()元素可操作宽度 = padding+content
            clientHeight()元素可操作高度 = padding+height
            clientLeft()元素左边框 = style.borderLeftWidth
            clientTop()元素上边框 = style.borderTopWidth
            clientX()元素X坐标(绝对坐标)
            clientY()元素Y坐标(绝对坐标)
            + +<#-- Z.Query函数(事件相关操作) --> +
            Z.Query函数(事件相关操作)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            事件增加删除
            on($event, $function, $this)增加事件$event事件
            $function回调函数
            $this回调函数this指针
            un($event, $function, $this)删除事件$event事件
            $function回调函数
            $this回调函数this指针
            按键事件(三项)
            keydown($function, $this)按键按下事件$function回调函数
            $this回调函数this指针
            unkeydown($function, $this)删除按键按下事件$function回调函数
            $this回调函数this指针
            keypress($function, $this)按键按下字符事件$function回调函数
            $this回调函数this指针
            unkeypress($function, $this)删除按键按下字符事件$function回调函数
            $this回调函数this指针
            keyup($function, $this)按键松开事件$function回调函数
            $this回调函数this指针
            unkeyup($function, $this)删除按键松开事件$function回调函数
            $this回调函数this指针
            点击事件(二项)
            click($function, $this)鼠标点击事件$function回调函数
            $this回调函数this指针
            unclick($function, $this)删除鼠标点击事件$function回调函数
            $this回调函数this指针
            dblclick($function, $this)鼠标双击事件$function回调函数
            $this回调函数this指针
            undblclick($function, $this)删除鼠标双击事件$function回调函数
            $this回调函数this指针
            变更事件(二项)
            change($function, $this)变更事件$function回调函数
            $this回调函数this指针
            unchange($function, $this)删除变更事件$function回调函数
            $this回调函数this指针
            blur($function, $this)跳出事件$function回调函数
            $this回调函数this指针
            unblur($function, $this)删除跳出事件$function回调函数
            $this回调函数this指针
            鼠标事件(八项)
            mouseenter($function, $this)鼠标进入事件$function回调函数
            $this回调函数this指针
            unmouseenter($function, $this)删除鼠标进入事件$function回调函数
            $this回调函数this指针
            mouseleave($function, $this)鼠标离开事件$function回调函数
            $this回调函数this指针
            unmouseleave($function, $this)删除鼠标离开事件$function回调函数
            $this回调函数this指针
            mouseover($function, $this)鼠标移入事件$function回调函数
            $this回调函数this指针
            unmouseover($function, $this)删除鼠标移入事件$function回调函数
            $this回调函数this指针
            mouseout($function, $this)鼠标移出事件$function回调函数
            $this回调函数this指针
            unmouseout($function, $this)删除鼠标移出事件$function回调函数
            $this回调函数this指针
            mouseup($function, $this)鼠标按下释放事件$function回调函数
            $this回调函数this指针
            unmouseup($function, $this)删除鼠标按下释放事件$function回调函数
            $this回调函数this指针
            mousedown($function, $this)鼠标按下事件$function回调函数
            $this回调函数this指针
            unmousedown($function, $this)删除鼠标按下事件$function回调函数
            $this回调函数this指针
            mousemove($function, $this)鼠标移动事件$function回调函数
            $this回调函数this指针
            unmousemove($function, $this)删除鼠标移动事件$function回调函数
            $this回调函数this指针
            mousewheel($function, $this)鼠标滚轮事件$function回调函数
            $this回调函数this指针
            unmousewheel($function, $this)删除鼠标滚轮事件$function回调函数
            $this回调函数this指针
            hover($function1, $function2, $this)鼠标进入和离开事件$function1鼠标进入回调函数
            $function2鼠标离开回调函数
            $this回调函数this指针
            unhover($function1, $function2, $this)删除鼠标进入和离开事件$function1鼠标进入回调函数
            $function2鼠标离开回调函数
            $this回调函数this指针
            窗体事件(四项)
            resize($function, $this)缩放事件$function回调函数
            $this回调函数this指针
            resize($function, $this)删除缩放事件$function回调函数
            $this回调函数this指针
            scroll($function, $this)滚动事件$function回调函数
            $this回调函数this指针
            unscroll($function, $this)删除滚动事件$function回调函数
            $this回调函数this指针
            load($function, $this)加载事件,删除请使用un("unload", $function, $this)函数$function回调函数
            $this回调函数this指针
            unload($function, $this)卸载事件,删除请使用un("unload", $function, $this)函数$function回调函数
            $this回调函数this指针
            + +<#-- Z.Query函数(动画相关操作) --> +
            Z.Query函数(动画相关操作 fade & slide & drag)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            fadeTo(duration, opacity, complete)淡入到指定的透明度duration持续时间
            opacity指定的透明度0-1之间
            complete完成后的回调函数
            fadeIn(duration, complete)淡入duration持续时间
            complete完成后的回调函数
            fadeOut(duration, complete)淡出duration持续时间
            complete完成后的回调函数
            slideDown(duration, complete)向下滑动duration持续时间
            complete完成后的回调函数
            slideUp(duration, complete)向上滑动duration持续时间
            complete完成后的回调函数
            slideToggle(duration, complete)上下滑动切换duration持续时间
            complete完成后的回调函数
            drag(param, callback, $this)拖拽或滑动param指定参数
            callback回调函数
            $this回调函数this指针
            dragInParent(drag, parent, callback, $this)拖拽或滑动drag无参数
            parent无参数
            callback回调函数
            $this回调函数this指针
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/js/static.htm b/zhiqim_ui/document/tutorial/ui/js/static.htm new file mode 100644 index 0000000..5ef1a3f --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/js/static.htm @@ -0,0 +1,849 @@ +<#def title = "静态对象"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "静态对象是把一系列常用的对象定义成静态属性和函数。目前包括有浏览器对象(Z.B)、文档对象(Z.D)、"/> +<#def prevUrl = "js.htm"/> +<#def nextUrl = "util.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "js", "static")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "静态对象")} +
            + +<#-- 标题 --> +
            +

            静态对象:

            +

            + 静态对象是把一系列常用的对象定义成静态属性和函数。目前包括有浏览器对象(Z.B)、文档对象(Z.D)、 + 事件对象(Z.E)、元素对象(Z.EL)、HTML对象(Z.H)、地址对象(Z.L)、COOKIE对象(Z.CK)。 +

            +
            + +<#-- 浏览器对象(Z.B) --> +
            浏览器对象(Z.B/Z.Browser)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            属性/函数值范围说明
            Z.B.win64true/false是否是64位系统
            Z.B.mobiletrue/false是否是移动端
            Z.B.firefoxtrue/false是否是firefox浏览器
            Z.B.webkittrue/false是否是webkit浏览器
            Z.B.safaritrue/false是否是safari浏览器
            Z.B.chrometrue/false是否是chrome浏览器
            Z.B.operatrue/false是否是opera浏览器
            Z.B.msietrue/false是否是msie浏览器(含trident)
            Z.B.msieOnlytrue/false是否是msie浏览器(不含trident)
            Z.B.msie11true/false是否是msie11浏览器
            Z.B.msie10true/false是否是msie10浏览器
            Z.B.msie9true/false是否是msie9浏览器
            Z.B.msie8true/false是否是msie8浏览器
            Z.B.msie7true/false是否是msie7浏览器
            Z.B.msie6true/false是否是msie6浏览器
            Z.B.msieVer6,7,8,9,10,11,12,100IE版本号,100表示不是IE
            + +<#-- 文档对象 --> +
            文档对象(Z.D/Z.Document)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.D.id(id, doc)通过ID获取元素
            document.getElementById(id);
            id元素id编码
            doc所在的文档对象,未传入取当前document
            Z.D.has(id, doc)通过ID获取元素判断是否存在
            document.getElementById(id)!=null;
            id元素id编码
            doc所在的文档对象,未传入取当前document
            Z.D.create(tag, doc)通过tag创建元素
            document.createElement(tag);
            tag元素标签,如div
            doc所在的文档对象,未传入取当前document
            Z.D.tagNames(name, doc)获取指定标记名称的对象列表
            document.getElementsByTagName(name);
            name名称
            doc所在的文档对象,未传入取当前document
            Z.D.names(name, doc)获取指定名称的对象列表
            document.getElementsByName(name);
            name 指定名称
            doc所在的文档对象,未传入取当前document
            Z.D.classNames(name, doc)获取指定类名的对象列表
            document.getElementsByClassName(name);
            name指定类名
            doc所在的文档对象,未传入取当前document
            Z.D.attrs(name, value, doc)获取指定属性名和属性值相等的对象列表name指定属性名
            value指定属性值
            doc所在的文档对象,未传入取当前document
            Z.D.scrollTop(doc)窗口垂直滚动条上偏移值doc指定的文档对象
            Z.D.scrollLeft(doc)窗口水平滚动条左偏移值 doc所在的文档对象,未传入取当前document
            Z.D.scrollWidth(doc)可滚动展示宽度 doc所在的文档对象,未传入取当前document
            Z.D.scrollHeight(doc)可滚动展示高度 doc所在的文档对象,未传入取当前document
            Z.D.clientWidth(doc)窗口可视宽度(看得见的宽度)doc所在的文档对象,未传入取当前document
            Z.D.clientHeight(doc)窗口可视高度(看得见的高度)doc所在的文档对象,未传入取当前document
            Z.D.offsetWidth(doc)可操作宽度(由元素决定,和窗口无关)doc所在的文档对象,未传入取当前document
            Z.D.offsetHeight(doc)可操作高度(由元素决定,和窗口无关)doc所在的文档对象,未传入取当前document
            + +<#-- 事件对象 --> +
            事件对象(Z.E/Z.Event)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.E.KEY{ + ESC: 27, + LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, DELETE: 46 + }事件键值属性
            Z.E.add(target, name, listener, $this)增加事件target目标地址
            name事件名称
            listener事件侦听器
            $this事件侦听器对应的this指针
            Z.E.remove(target, name, listener, $this)移除事件target目标地址
            name事件名称
            listener事件侦听器
            $this事件侦听器对应的this指针
            Z.E.event(e)对事件对象作适配,IE取window.evente事件对象
            Z.E.key(e)产生事件的键值e事件对象
            Z.E.target(e)产生事件的目标对象e事件对象
            Z.E.current(e)产生事件的当前目标对象e事件对象
            Z.E.cancel(e)取消缺省事件e事件对象
            Z.E.stop(e)停止冒泡e事件对象
            Z.E.forbidden(e)停止冒泡和取消缺省事件 e事件对象
            Z.E.clientX(e)点击位置相对于浏览器的X坐标e事件对象
            Z.E.clientY(e)点击位置相对于浏览器的Y坐标e事件对象
            Z.E.screenX(e)点击位置相对于屏幕的X坐标e事件对象
            Z.E.screenY(e)点击位置相对于屏幕的Y坐标 e事件对象
            Z.E.wheelDelta()滚轮增量e事件对象
            Z.E.isCtrl(e)是否按住了Ctrl键e事件对象
            Z.E.isEsc(e)是否退出键e事件对象
            Z.E.isBackspace(e)是否退格键e事件对象
            Z.E.isEnter(e)是否回车键e事件对象
            Z.E.isCtrlC(e)是否复制e事件对象
            Z.E.isCtrlV(e)是否粘贴e事件对象
            + + +<#-- 元素对象 --> +
            元素对象(Z.EL/Z.Element)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.EL.has(elem, name)是否有属性 elem元素
            name属性名称
            Z.EL.get(elem, name)获取属性值elem元素
            name属性名称
            Z.EL.set(elem, name, value)设置属性值 elem元素
            name属性名称
            value需要传入的值
            Z.EL.equals(elem, name, value)判断属性值是否等于指定值 elem元素
            name属性名称
            value传入的值
            Z.EL.style(elem, style)获取或设置样式字符串elem元素
            style未传值表示获取样式,传值表示设置样式
            Z.EL.css(elem, name, value)获取或设置一个样式elem元素
            name样式名称
            value未传值表示获取样式,传值表示设置样式
            Z.EL.cssNum(elem, name)获取样式数值型的值elem元素
            name样式名称
            Z.EL.opacity(elem, value)获取和设置透明度值0-1之间elem元素
            value未传值表示获取,传值表示设置
            Z.EL.className(elem)获取类样式名称值elem元素
            className类样式名称
            Z.EL.addClass(elem, className)增加类样式elem元素
            className类样式名称
            Z.EL.removeClass(elem, className)删除类样式elem元素
            className类样式名称
            Z.EL.hasClass(elem, className)判断是否有类样式elem元素
            className类样式名称
            Z.EL.toggleClass(elem, className)切换类样式,没有则加入,有则删除elem元素
            className类样式名称
            Z.EL.select(elem)选中对象文本elem元素
            Z.EL.selection(elem)选中对象的文本内容elem元素
            Z.EL.focus(elem)设置元素获取焦点elem元素
            Z.EL.focusEnd(elem, len)设置元素获取焦点,并把光标定位到结尾elem元素
            len长度
            Z.EL.parent(elem)获取元素父元素elem元素
            Z.EL.parentIndex(elem)获取元素在父元素的索引号elem元素
            Z.EL.childs(elem)获取元素子节点列表
            elem.childNodes
            elem元素
            Z.EL.children(elem)获取元素子元素列表
            elem.children
            elem元素
            Z.EL.html(elem, value)获取和设置HTML代码elem元素
            value未传值表示获取,传值表示设置
            Z.EL.text(elem, value)获取或设置元素文本elem元素
            value未传值表示获取,传值表示设置
            Z.EL.append(elem, child)增加子元素elem本元素
            child子元素
            Z.EL.remove(elem, name)删除元素或删除属性elem元素
            name未传值表示删除元素,传值表示删除元素的属性
            Z.EL.replace(elem, newElem)替代元素elem原元素
            newElem新元素
            Z.EL.offsetLeft(elem)获取相对于父对象的左偏移elem元素
            Z.EL.offsetTop(elem)获取相对于父对象的上偏移 elem元素
            Z.EL.offsetLeftBody(elem)获取相对body的左偏移(绝对左偏移)elem元素
            Z.EL.offsetTopBody(elem)获取相对body的上偏移(绝对上偏移)elem元素
            + +<#-- HTML对象 --> +
            HTML对象(Z.H/Z.Html)
            + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.H.createElement(html)通过HTML文本创建元素列表htmlHTML文本
            Z.H.displayDefault(tag)获取HTML标签缺省的display值 + tagHTML标签名
            + +<#-- 地址对象 --> +
            地址对象(Z.L/Z.Location)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.L.reload(target)刷新target目标对象,为空表示当前window
            Z.L.access(url, target)访问URLurlURL地址
            target目标对象,为空表示当前window
            Z.L.check(url, name, form, target)带检测访问URLurlURL地址
            name单选框或多选框名称
            form指定表单内的单选或多选框
            target目标对象
            Z.L.confirm(url, message, name, form, target)带询问访问URL
            +
            urlURL地址
            message询问的显示信息
            name单选框或多选框名称
            form确认的形式
            target目标对象
            Z.L.href(param, param2)含对象参数的访问URL
            +
            param参数1:
            字符串时表示URL,功能同access函数
            对象时取值{url:url,target:target,name:name,form:form,message:message},相应地判断是check|confirm方法
            param2参数2:
            传值时为target,优先于参数1中对象target
            + +<#-- COOKIE对象 --> +
            COOKIE对象(Z.CK/Z.Cookie)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.Cookie.all()设置或返回当前文档有关的所有Cookie,等同document.cookie
            Z.Cookie.add(cookie)添加Cookiecookie + Cookie对象:
            + name:Cookie名称,value:Cookie值
            + expires:Cookie到期时长,单位秒,未传值表示随浏览器关闭失效
            + path:Cookie有效路径,建议/结尾
            + domain:Cookie有效域名
            + secure:安全标识true|false,HTTPS时有效

            + 如:{name:"test", value:"value", expires=3600, path="/", domain="127.0.0.1", secure:false} +
            Z.Cookie.remove(name)删除CookienameCookie名称
            Z.Cookie.get(name)获取CookienameCookie名称
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/js/util.htm b/zhiqim_ui/document/tutorial/ui/js/util.htm new file mode 100644 index 0000000..ae6ac47 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/js/util.htm @@ -0,0 +1,1023 @@ +<#def title = "工具对象"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "工具对象也是静态对象的一种,把一系列常用的静态属性和函数归类到一个工具对象中。目前包括断言工具(Z.A/Z.Asserts)、对象工具(Z.O/Z.Objects)、类型工具(Z.T/Z.Types)、"/> +<#def prevUrl = "static.htm"/> +<#def nextUrl = "query.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "js", "util")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "工具对象")} +
            + +<#-- 标题 --> +
            +

            工具对象:

            +

            + 工具对象也是静态对象的一种,把一系列常用的静态属性和函数归类到一个工具对象中。目前包括断言工具(Z.A/Z.Asserts)、对象工具(Z.O/Z.Objects)、类型工具(Z.T/Z.Types)、 + 验证工具(Z.V/Z.Validates)、表单工具(Z.FM/Z.Forms)、JSON工具(Z.J/Z.Jsons)、日期工具(Z.DT/Z.DateTimes)、数组工具(Z.AR/Z.Arrays)、字符串工具(Z.S/Z.Strings)、算术工具(Z.Maths)、 + 金额工具(Z.AM/Z.Amounts)和颜色工具(Z.Colors)。 +

            +
            + +<#-- 断言工具(Z.A) --> +
            断言工具(Z.A/Z.Asserts)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.A.assertNotEmpty(value, message)断言不为空value断言的值
            message断言失败时告警信息
            Z.A.assertNotEmptyBlank(value, message)断言不为空白value断言的值
            message断言失败时告警信息
            + +<#-- 对象工具(Z.O) --> +
            对象工具(Z.O/Z.Objects)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.O.isOwn(obj, prop)是否自己的属性
            Object.prototype.hasOwnProperty
            obj指定的对象
            prop指定的属性名
            Z.O.isCommon(obj, prop)是否普通属性
            属性名是数字或字符串,属性值非函数的属性
            obj指定的对象
            prop指定的属性名
            Z.O.toString(obj)对象字符串并去掉“[object ”和“]”前后缀
            Object.prototype.toString
            obj指定的对象
            Z.O.toStyleString(obj)转化为样式风格字符串,分号分隔
            如:width:100px;height:100px;
            obj指定的对象
            Z.O.toJSONString(obj)转化为JSON字符串
            如:{width:"100px",height:"100px"}
            obj指定的对象
            + +<#-- ID工具(Z.Ids) --> +
            ID工具(Z.Ids)
            + + + + + + + + + + + + +
            函数说明备注
            Z.Ids.uuid()生成ID通过随机数和当前时间生成唯一编号,格式:
            + XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
            + 1、1-8位随机数
            + 2、3段4长度的随机数
            + 3、8位长度时间+4位随机数
            + +<#-- 类型工具(Z.T) --> +
            对象工具(Z.T/Z.Types)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.T.isBoolean(obj)是否布尔值obj指定的对象
            Z.T.isNumber(obj)是否数值类型obj指定的对象
            Z.T.isString(obj)是否字符串obj指定的对象
            Z.T.isPrimitive(obj)是否基本类型(布尔值或数值类型或字符串)obj指定的对象
            Z.T.isFunction(obj)是否函数obj指定的对象
            Z.T.isArray(obj)是否数组obj指定的对象
            Z.T.isDate(obj)是否日期obj指定的对象
            Z.T.isRegExp(obj)是否正则表达式obj指定的对象
            Z.T.isObject(obj)是否对象obj指定的对象
            Z.T.isPlainObject(obj)纯对象obj指定的对象
            Z.T.isLikeArray(obj)是否类似数组obj指定的对象
            Z.T.isNull(obj)是否为nullobj指定的对象
            Z.T.isUndefined(obj)是否未定义obj指定的对象
            Z.T.isNaN(obj))是否非数值obj指定的对象
            Z.T.isInfinity(obj)是否无限数obj指定的对象
            Z.T.isNonInfinity(obj)是否负无限数obj指定的对象
            Z.T.isNil(obj)是否无效数(未定义、null、非数值、无限数、负无限数)obj指定的对象
            Z.T.isWindow(obj)是否window对象obj指定的对象
            Z.T.isDocument(obj)是否文档对象obj指定的对象
            Z.T.isElement(obj)是否元素对象obj指定的对象
            Z.T.isArguments(obj)是否参数对象obj指定的对象
            + +<#-- 验证工具(Z.V) --> +
            对象工具(Z.V/Z.Validates)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            单字符验证,支持是否是数字、小数、字母、大写字母、小写字母、字母和数字
            Z.V.isDigit(c)是否是数字c指定的字符
            Z.V.isDot(c)单字字符c指定的字符
            Z.V.isColon(c)是否是冒号c指定的字符
            Z.V.isDigitOrDot(c)是否是数字或小数点c指定的字符
            Z.V.isDigitOrColon(c)是否是数字或冒号
            如时间表示
            c指定的字符
            Z.V.isLetter(c)是否是字母大小写c指定的字符
            Z.V.isLetterLowercase(c)是否是小写字母c指定的字符
            Z.V.isLetterUppercase(c)是否是大写字母c指定的字符
            Z.V.isLetterOrDigit(c)是否是字母或者数字c指定的字符
            字符串验证,支持是否符合正则表达式、为空、非空、空白、非空白、数值型等
            Z.V.isRegexp(regexp, s)是否是正则表达式regexp检查是否符合正则表达式规范
            s指定的字符串
            Z.V.isEmpty(s)检查是否为空s指定的字符串
            Z.V.isNotEmpty(s)检查是否不为空s指定的字符串
            Z.V.isEmptyBlank(s)检查是否为空白(空或长度为0或由空白符构成)s指定的字符串
            Z.V.isNotEmptyBlank(s)检查不为空白s指定的字符串
            Z.V.isNumeric(s)检查是否为数值字符串s指定的字符串
            Z.V.isNumericLen(s, min, max)检查是否为数值字符串且符合长度要求s指定的字符串
            min指定的最小长度
            max指定的最大长度
            Z.V.isInteger(s)检查是否为整数s指定的字符串
            Z.V.isIntegerValue(s, min, max)检查是否为整数且符合值范围s指定的字符串
            min指定的最小值
            max指定的最大值
            Z.V.isIntegerPositive(s)检查是否为正整数s指定的字符串
            Z.V.isFloat(s)检查是否为浮点型s指定的字符串
            Z.V.isAmount2R(s)检查是否为金额值s指定的字符串
            Z.V.isDate(s)检查是否为日期s指定的字符串
            Z.V.isTime(s)检查是否为时间s指定的字符串
            Z.V.isDateTime(s)检查是否为时间,格式为日期+时间s指定的字符串
            Z.V.isEmail(s)检查是否为邮件s指定的字符串
            Z.V.isMobile(s)检查是否为手机号s指定的字符串
            Z.V.isMobile11(s)检查是否为11位手机号s指定的字符串
            Z.V.isContain(strs, separator, s)检查是否包含字符串strs包含的字符串
            s指定的字符串
            其他验证
            Z.V.isLeapYear(year)检查是否闰年year输入的年份
            + +<#-- 表单工具(Z.FM) --> +
            表单工具(Z.FM/Z.Forms)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.FM.clearForm(form)清空表单form指定的表单
            Z.FM.clearSelect(elem)清空选择框的数据elem指定的选择框
            Z.FM.isChecked(name, form)判断是否选中单选框或多选框name名称
            form指定的表单,未传入查全部names
            Z.FM.getChecked(name, form)获取被选中单选框和多选框的值name名称
            form指定的表单,未传入查全部names
            Z.FM.getCheckBoxValue(name, form)获取多选框的值,多个用逗号隔开name名称
            form指定的表单,未传入查全部names
            Z.FM.doSelectCheckBox(name, policy, form)全选,反选和取消,三个参数都可以不传入name名称
            policy指定策略,1表示全选,2表示全取消,0表示反选,未传值默认0
            form指定的表单,未传入查全部names
            Z.FM.doSelectCheckBoxTree(name, checked, value, form)选择树,选中自己时同时选中所有子节点,和父继承节点name名称
            checked是否选中,true|false
            value当前选择多选框的值,用于子节点和父节点判断是否对应
            form指定的表单,未传入查全部names
            + +<#-- JSON工具(Z.Jsons) --> +
            JSON工具(Z.J/Z.Jsons)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.J.toObject(str)返回JSON对象str指定的字符串
            Z.J.toString(obj)转化为字符串obj指定的对象
            Z.J.toKey(key)转为带双引号的KEY字符串str指定的字符串
            Z.J.addEscapeChar(str, quotation)添加转义符str指定的字符串
            quotation引号字符,单引号或双引号
            + +<#-- 日期工具(Z.DT) --> +
            日期工具(Z.DT/Z.DateTimes)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.DT.getDateTimeString()取得当前的日期时间字符串,格式:yyyy-MM-dd HH:mm:ss
            Z.DT.getDateString()取得当前的日期时间字符串,格式:yyyy-MM-dd
            Z.DT.getCurrentYear()获取当前年份
            Z.DT.getCurrentMonth()获取当前月份
            Z.DT.getCurrentMonthDays()获取当前月天数
            Z.DT.getCurrentDay()获取当前日期
            Z.DT.getMonthDays(year, month)获取指定月天数year指定的年份(yyyy)
            month指定的月份(1-12)
            Z.DT.getDateWeek(year, month, day)求星期取值,获取指定时间的星期数:星期一=1;星期二=2;星期三=3;星期四=4;星期五=5;星期六=6;星期日=7year指定的年份(yyyy)
            month指定的月份(1-12)
            day指定的日期(1-31))
            Z.DT.toDateString(date)Date对象转换为String
            格式:“yyyy-MM-dd”
            +
            date指定的Date对象
            Z.DT.toTimeString(date)Date对象转换为String
            格式:“HH:mm:ss”
            date指定的Date对象
            Z.DT.toDateTimeString(date)Date对象转换为String
            格式为:"yyyy-MM-dd HH:mm:ss"
            date指定的Date对象
            Z.DT.toDate (date, time)String转为Date对象
            标准日期格式:"yyyy-MM-dd"
            标准时间格式:"HH:mm:ss"
            date字符串,格式:“yyyy-MM-dd”
            time字符串,格式:“HH:mm:ss”
            + +<#-- 数组工具(Z.AR) --> +
            数组工具(Z.AR/Z.Arrays)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.AR.first(objs)获取数组中第一个objs指定的数组
            Z.AR.last(objs)获取数组中最后一个objs指定的数组
            Z.AR.indexOf(objs, obj)获取对象在数组中的索引号
            +
            objs指定的数组
            obj指定的对象
            Z.AR.contains(objs, obj)判断对象是否在数组中
            +
            objs指定的数组
            obj指定的对象
            Z.AR.remove(objs, obj)从数组中删除指定的对象
            +
            objs指定的数组
            obj指定的对象
            Z.AR.toArray(strs, separator)字符串按分隔符转为数组strs指定的字符串
            Z.AR.toObject(strs, separator)字符串按分隔符转成对象
            如:width:100px;max-height:100px;
            转:{width:"100px",maxHeight:"100px"}
            注:中杠会去掉并下一字符大写
            strs指定的字符串
            Z.AR.toString(values, separator)数组按分隔符转换成字符串values指定的数组
            Z.AR.toJSONString(values)转换成JSON字符串values指定的数组
            + +<#-- 字符串工具(Z.S) --> +
            字符串工具(Z.S/Z.Strings)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.S.trim(s)去掉字符串左边及右边的空格s指定的字符串
            Z.S.trimLeft(s)去掉字符串左边的空格s指定的字符串
            Z.S.trimRight(s)去掉字符串右边的空格s指定的字符串
            Z.S.startWith(str, s)字符串str是否以s开始str原字符串
            s比较字符串
            Z.S.endWith(str, s)字符串str是否以s结尾str指定的原字符串
            s比较字符串
            Z.S.equalsIgnoreCase(s1, s2)忽略大小写两字符串是否相等s1指定的字符串1
            s2指定的字符串2
            Z.S.replaceAll(s, src, dest, ignoreCase)替换字符串,执行全部匹配s指定的字符串
            src被替换的字符串
            dest替换后的字符串
            ignoreCase是否忽略大小写,未传入值为false
            Z.S.lengthUnicode(s)转换为Unicode编码长度s指定的字符串
            Z.S.lengthUnicode35(s)转换为Unicode35位编码长度s指定的字符串
            Z.S.toUTF8(s)转换为UTF8编码s指定的字符串
            Z.S.toHexString(b)转换成ASCII字符s指定的字符串
            Z.S.prefixZero(str, len)前缀补零,得到给定长度的值,补足0str初始str
            len指定的长度
            Z.S.prefixLen(str, len, prefix)前缀补齐,通过给定初始str,和前置char,得到给定长度的值, 通常用于前补0等str初始str
            len指定的长度
            prefix前置char
            Z.S.prefixNum(text)取前缀数字text指定的字符串
            Z.S.prefixZeroRemove(value)删除整型的前缀0value指定的需要删除前缀的数据
            Z.S.removeSecondDot(value)删除小数第二个小数点后面的数据value指定的数据
            Z.S.removeAmountZero(value)金额抹零value指定的金额值
            + +<#-- 算术工具(Z.Maths) --> +
            算术工具(Z.Maths)
            + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.Maths.multiply(m, m2)数字相乘m数字1
            m2数字2
            + +<#-- 金额工具(Z.Amounts) --> +
            金额工具(Z.AM/Z.Amounts)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.Amounts.toYuan(amount)金额分,转为字符串元,转化后最大2位小数点,没有的不保留小数点amount金额分值
            Z.Amounts.toYuanMustRadix(amount)金额分,转为字符串元,转化后强制为2位小数点,没有的为.00amount金额分值
            Z.Amounts.toFen(str, defaultValue)金额元字符串转int金额分,支持整数、1位小数和2位小数点的金额字符串str金额元的字符串
            defaultValue缺省值
            + +<#-- 颜色工具(Z.Colors) --> +
            颜色工具(Z.Colors)
            + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.Colors.toString(iColor) 数字的颜色转为字符串十六进制格式(#750848)iColor指定的颜色
            Z.Colors.toInt(sColor)字符串十六进制(#750848)格式转为数字的颜色sColor指定的颜色
            Z.Colors.toArray(color)颜色(数字型或字符串#750848)转为红绿蓝数组color指定的颜色
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/nav/dropdown.htm b/zhiqim_ui/document/tutorial/ui/nav/dropdown.htm new file mode 100644 index 0000000..2a87673 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/nav/dropdown.htm @@ -0,0 +1,214 @@ +<#def title = "下拉列表"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = " 下拉列表是设计出当移入或点击时下拉出一个列表的样式。下拉列表当前支持点击和移入触发下拉列表一层界面,支持列表颜色、激活颜色,指定下拉列表宽度和多列等样式。"/> +<#def prevUrl = "tooltip.htm"/> +<#def nextUrl = "../tool/copy.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "nav", "dropdown")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "下拉列表")} +
            + +<#-- 标题 --> +
            +

            下拉列表:

            +

            + 下拉列表是设计出当移入或点击时下拉出一个列表的样式。下拉列表当前支持点击和移入触发下拉列表一层界面,支持列表颜色、激活颜色,指定下拉列表宽度和多列等样式。 +

            +
            + +<#-- 一、点击单列效果 --> +
            一、点击单列效果
            + +
            + +
            +
            + +
            + 选择省份 +
              + 广东省 + 湖南省 + 广西壮族自治区 + 江西省 +
            +
            +
            +
            + +
            + +
            + 1、定义一个div,指定为下拉列表[data-role="z-dropdown"],包含样式类[class="z-dropdown"],指定点击触发[data-options="event:click;"]和宽度[width:160px]
            + 2、指定点击内容[span],和右对齐箭头[<i class="z-float-right z-font z-arrowhead-down"></i>]
            +
            +
            +
            + +<#-- 二、点击多列效果(含颜色) --> +
            二、点击多列效果(两列、颜色边框背景)
            + +<#var colorMap = Jsons.toMapSS(context.getResourceString("/document/tutorial/ui/css/zhiqim.pre.json", "UTF-8"))/> +
            + +
            +
            + +
            + 更多 +
              + 广东省 + 湖南省 + 广西壮族自治区 + 江西省 + 北京市 + 福建省 +
            +
            +
            +
            + +
            + +
            + 1、定义一个div,指定为下拉列表[data-role="z-dropdown"],包含样式类[class="z-dropdown"],指定点击触发[data-options="event:click;"]和宽度[width:160px]
            + 2、指定点击内容[span],和右对齐箭头[<i class="z-float-right z-font z-arrowhead-down"></i>]
            + 3、在div上指定选择的颜色[class="z-dropdown z-red"]表示显示红色边框、红色背景和红色选中信息 + 4、指定多列设计,如两列,总宽度[width:320px],每列宽度[item-width:159px],注意预留1像素的边框 + 5、当有更变时,可用事件data-onchange。 +
            +
            +
            + +<#-- 三、移入移出菜单下拉列表 --> +
            三、移入移出菜单下拉列表
            + +
            + +
            +
            + +
            + 选择省份 +
              + 广东省 + 湖南省 + 广西壮族自治区 + 江西省 +
            +
            + 选择省份 +
              + 广东省 + 湖南省 + 广西壮族自治区 + 江西省 +
            +
            + 选择省份 +
              + 广东省 + 湖南省 + 广西壮族自治区 + 江西省 +
            +
            + 选择省份 +
              + 广东省 + 湖南省 + 广西壮族自治区 + 江西省 +
            +
            +
            +
            + +
            + +
            + 1、定义一个div,指定为下拉列表[data-role="z-dropdown"],包含样式类[class="z-dropdown"],指定移入触发[data-options="event:hover;"]和宽度[width:160px]
            + 2、指定点击内容[span],和右对齐箭头[<i class="z-float-right z-font z-arrowhead-down"></i>]
            + 3、多个下拉列表在一起组成一组时,注意中间有inline-block产生的间隙,可利用zi-mg-l-3 zi-mg-r-3来去除,或保持div相连用zi-mg-l-1去除。 +
            +
            +
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/nav/stepbar.htm b/zhiqim_ui/document/tutorial/ui/nav/stepbar.htm new file mode 100644 index 0000000..284f94f --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/nav/stepbar.htm @@ -0,0 +1,179 @@ +<#def title = "步骤条"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "步骤条是通过指定多个步骤标签,在每步中展示激活的一个步骤标签的导航页。步骤条使用nav作为每个步骤。"/> +<#def prevUrl = "tabnav.htm"/> +<#def nextUrl = "tooltip.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "nav", "stepbar")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "步骤条")} +
            + +<#-- 标题 --> +
            +

            步骤条:

            +

            + 步骤条是通过指定多个步骤标签,在每步中展示激活的一个步骤标签的导航页。步骤条使用nav作为每个步骤。 + 样式通过before和after属性自动在每个步骤后加上白色箭头。 +

            +
            + +<#-- 一、默认步骤条效果 --> +
            一、默认步骤条效果
            + +
            + +
            +
            + +
            + + + + +
            +
            +
            + +
            + +
            + 1、定义一个div,包含样式类[class="z-stepbar"],默认步骤条width:100%,height:32px
            + 2、在div下包括多个nav,每个nav即一个步骤,其中有[class="z-active"]的nav表示当前步骤
            +
            +
            +
            + +<#-- 二、各种颜色步骤条效果 --> +
            二、各种颜色步骤条效果
            + +<#var colorMap = Jsons.toMapSS(context.getResourceString("/document/tutorial/ui/css/zhiqim.pre.json", "UTF-8"))/> +
            + +
            +
            + +
            + + + + +
            +
            +
            + +
            + +
            + 1、定义一个div,包含样式类[class="z-stepbar"],默认步骤条width:100%,height:32px,加上颜色[class="z-red"]表示红色,共支持七种颜色,请选择查看
            + 2、在div下包括多个nav,每个nav即一个步骤,其中有[class="z-active"]的nav表示当前步骤
            +
            +
            +
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/nav/tabnav.htm b/zhiqim_ui/document/tutorial/ui/nav/tabnav.htm new file mode 100644 index 0000000..8e79bfb --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/nav/tabnav.htm @@ -0,0 +1,195 @@ +<#def title = "标签页"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = " 标签页是参考tabnav设计出更简单易用的内容重叠布局的导航页。标签页使用nav和section作为是标签和内容显示。在nav中使用li表示每个标签,在section中使用div作为每个标签显示的内容。"/> +<#def prevUrl = "../dialog/loading.htm"/> +<#def nextUrl = "stepbar.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "nav", "tabnav")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "标签页")} +
            + +<#-- 标题 --> +
            +

            标签页:

            +

            + 标签页是参考tabnav设计出更简单易用的内容重叠布局的导航页。标签页使用nav和section作为是标签和内容显示。在nav中使用li表示每个标签,在section中使用div作为每个标签显示的内容。 +

            +
            + +<#-- 一、无边框和无标题,标签在左侧 --> +
            一、无边框和无标题,标签在左侧
            + +
            + +
            +
            + +
            + +
            +
            + 标签一内容 +
            +
            + 标签二内容 +
            +
            + 标签三内容 +
            +
            +
            +
            +
            + +
            + +
            + 1、定义一个div,包含属性[data-role="z-tabnav"]和[class="z-tabnav"]
            + 2、在div下包括两大元素nav和section。其中nav表示标签部分,section表示内容显示部分
            + 3、在nav中通过ul和li把标签设定好,如例子中标签一、标签二、标签三。其中有[class="z-active"]的表示当前激活标签
            + 4、在section中对应li编写三个标签内容div和li个数和顺序对应。其中有[class="z-active"]的表示当前激活标签,[class="z-pd10"]表示标签内容内边距10px +
            +
            +
            + +<#-- 二、无边框和有标题,标签在右侧,内容有边框 --> +
            二、无边框和有标题,标签在右侧,内容有边框
            + +
            + +
            +
            + +
            + +
            +
            + 标签一内容 +
            +
            + 标签二内容 +
            +
            + 标签三内容 +
            +
            +
            +
            +
            + +
            + +
            + 1、定义一个div,包含属性[data-role="z-tabnav"]和[class="z-tabnav"]
            + 2、在div下包括两大元素nav和section。其中nav表示标签部分,section表示内容显示部分
            + 3、在nav中通过ul和li把标签设定好,如例子中标签一、标签二、标签三。其中有[class="z-active"]的表示当前激活标签
            + 4、在section中对应li编写三个标签内容div和li个数和顺序对应。其中在section中定义[class="z-pd-t20"]表示所有标签内容顶部内边距为20px
            + 5、在section标签内容中[class="z-active"]的表示当前激活标签,[class="z-pd10"]表示标签内容内边距10px,[class="z-bd z-bd-rd5"]表示标签内容有5像素圆角边框 +
            +
            +
            + +<#-- 三、有边框和有标题,标签在右侧,加大字体 --> +
            三、有边框和有标题,标签在右侧,加大字体
            + +
            + +
            +
            + +
            + +
            +
            + 标签一内容 +
            +
            + 标签二内容 +
            +
            + 标签三内容 +
            +
            +
            +
            +
            + +
            + +
            + 1、定义一个div,包含属性[data-role="z-tabnav"]和[class="z-tabnav z-bordered"]表示有边框
            + 2、在div下包括两大元素nav和section。其中nav表示标签部分,section表示内容显示部分
            + 3、在nav中通过ul和li把标签设定好,如例子中标签一、标签二、标签三。其中有[class="z-active"]的表示当前激活标签
            + 4、在section中对应li编写三个标签内容div和li个数和顺序对应。其中有[class="z-active"]的表示当前激活标签,[class="z-pd10"]表示标签内容内边距10px +
            +
            +
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/nav/tooltip.htm b/zhiqim_ui/document/tutorial/ui/nav/tooltip.htm new file mode 100644 index 0000000..a7d5c09 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/nav/tooltip.htm @@ -0,0 +1,300 @@ +<#def title = "提示框"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = " 提示框是当鼠标移入或点击到重要的标志时,主动冒泡出一个浮动层,对该标志作解释的提示信息框。当前支持鼠标移入和点击两种事件,提示框在设计中有箭头、对齐方式、边框等属性。"/> +<#def prevUrl = "stepbar.htm"/> +<#def nextUrl = "dropdown.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "nav", "tooltip")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "提示框")} +
            + +<#-- 标题 --> +
            +

            提示框:

            +

            + 提示框是当鼠标移入或点击到重要的标志时,主动冒泡出一个浮动层,对该标志作解释的提示信息框。当前支持鼠标移入和点击两种事件,提示框在设计中有箭头、对齐方式、边框等属性。 +

            +
            + +<#-- 一、鼠标移入事件 --> +
            一、鼠标移入事件,文本下方显示提示框
            + + + + + + + + + + + + + + + + + + + + + + +
            类型效果预览代码
            靠左对齐移动鼠标到我上面 +
            居中对齐移动鼠标到我上面 +
            靠右对齐移动鼠标到我上面 +
            + +<#-- 二、鼠标移入事件 --> +
            二、鼠标移入事件,文本上方显示提示框(边框红色)
            + + + + + + + + + + + + + + + + + + + + + + +
            类型效果预览代码
            靠左对齐移动鼠标到我上面 +
            居中对齐移动鼠标到我上面 +
            靠右对齐移动鼠标到我上面 +
            + +<#-- 三、鼠标移入事件 --> +
            三、鼠标移入事件,文本右方显示提示框(无箭头,无边框,默认宽度)
            + + + + + + + + + + + + + + + + + + + + + + + + + +
            文本右方显示提示框(无箭头,无边框,默认宽度)
            类型效果预览代码
            靠上对齐移动鼠标到我上面 +
            居中对齐移动鼠标到我上面 +
            靠下对齐移动鼠标到我上面 +
            + +<#-- 四、鼠标移入事件 --> +
            四、鼠标移入事件,文本左方显示提示框(背景红色,字白色)
            + + + + + + + + + + + + + + + + + + + + + + + + + +
            文本左方显示提示框(背景红色,字白色)
            类型效果预览代码
            靠上对齐移动鼠标到我上面 +
            居中对齐移动鼠标到我上面 +
            靠下对齐移动鼠标到我上面 +
            + +<#-- 五、点击事件 --> +
            五、点击事件,文本下方显示提示框
            + + + + + + + + + + + + + + + + + + + + + + +
            类型效果预览代码
            靠左对齐点击我打开,点其他地方关闭 +
            居中对齐点击我打开,点其他地方关闭 +
            靠右对齐点击我打开,点其他地方关闭 +
            + +<#-- 六、点击事件 --> +
            六、点击事件,文本下方显示提示框
            + + + + + + + + + + + +
            类型效果预览代码
            指定data-id修改:点击我打开,点其他地方关闭 +
            + +<#-- 七、输入控制事件 --> +
            七、输入控制事件
            + + + + + + + + + + + + + + + + + + + + + +
            类型效果预览代码
            靠左对齐 + 小于5提示,>=5关闭 +
            居中对齐 + 小于5提示,>=5关闭 +
            靠右对齐 + 小于5提示,>=5关闭 +
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/test.htm b/zhiqim_ui/document/tutorial/ui/test.htm new file mode 100644 index 0000000..83c8b03 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/test.htm @@ -0,0 +1,55 @@ + + + +知启蒙前端框架 + + + + + + + + + + + + + + + + + + + + + + + + + + +
            +    +
            + +
            + + diff --git a/zhiqim_ui/document/tutorial/ui/tool/ajax.htm b/zhiqim_ui/document/tutorial/ui/tool/ajax.htm new file mode 100644 index 0000000..e6d3db6 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/tool/ajax.htm @@ -0,0 +1,728 @@ +<#def title = "AJAX"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = " AJAX即“Asynchronous Javascript And XML”(异步JavaScript和XML),是指一种创建交互式网页应用的网页开发技术"/> +<#def prevUrl = "flexcopy.htm"/> +<#def nextUrl = "drag.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav("document")} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "tool", "ajax")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "Ajax")} +
            + +<#-- 标题 --> +
            +

            AJAX:

            +

            + AJAX即“Asynchronous Javascript And XML”(异步JavaScript和XML),是指一种创建交互式网页应用的网页开发技术。 + 知启蒙AJAX采用面向RMI的概念设计,通过指定类和方法,传入参数对应方法的参数,通过RMI访问JAVA类的方法获取执行结果。 +

            +
            + +<#-- 一、调用成功,回调函数(无参数的方法) --> +
            一、调用成功,回调函数(无参数的方法)
            + +
            + +
            +
            + + + + 点我执行[doTestSuccess]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类名或类别名、类方法和回调函数,然后执行
            + 2、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 二、调用成功,回调函数(带参数、使用类别名@AnAlias) --> +
            二、调用成功,回调函数(带参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestParam]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、通过ajax.addParam();设置参数,参数个数和类型要和后端对应,支持字符串和基本类型 + 3、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 三、调用成功,显示到元素中(无参数、使用类别名@AnAlias) --> +
            三、调用成功,显示到元素中(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestSuccess]函数

            + + 返回内容: +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类名或类别名、类方法和回调函数,然后执行
            + 2、在页面上设置点击执行函数,把结果放置到Z("#"+id)中
            +
            +
            +
            + +<#-- 四、调用成功,加载器,后端等待5秒(无参数、使用类别名@AnAlias) --> +
            四、调用成功,加载器,后端等待8秒(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestLoading]函数

            +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、通过ajax.setLoading(document, true);设置全屏加载器且遮罩,然后执行
            + 3、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 五、调用成功,指定加载器元素,后端等待5秒(无参数、使用类别名@AnAlias) --> +
            五、调用成功,指定加载器元素,后端等待8秒(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestLoading2]函数

            + + +
            +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、通过ajax.setLoading("testLoading2");设置在testLoading2上显示加载器无遮罩,然后执行
            + 3、如果需要遮罩层,设置为ajax.setLoading("testLoading2", true); + 4、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 六、调用成功,自定义加载器,后端等待5秒(无参数、使用类别名@AnAlias) --> +
            六、调用成功,自定义加载器,后端等待8秒(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestLoading3]函数

            + + +
            +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、通过Z.loading()函数自定义加载器,然后通过ajax.setLoading();设置到Z.Ajax中
            + 3、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 七、调用失败(无参数、使用类别名@AnAlias) --> +
            七、调用失败(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestError]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 八、调用异常(无参数、使用类别名@AnAlias) --> +
            八、调用异常(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestException]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 九、拦截器,未通过显示未通过信息(无参数、使用类别名@AnAlias) --> +
            九、拦截器,未通过显示未通过信息(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestInterceptor]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            + 3、拦截器由Java后端设置,如: + + @AnInterceptor("chkAjax1") + public static void doTestInterceptor(HttpRequest request) + { + request.setResponseResult("返回成功信息"); + } + + + @AnAlias("chkAjax1") + public class AjaxChk1Interceptor implements Interceptor + { + @Override + public void intercept(HttpRequest request) throws Exception + { + request.setResponseError("拦截器不通过"); + } + } + +
            +
            +
            + +<#-- 十、拦截器,未通过显示未通过信息(同步调用、无参数、使用类别名@AnAlias) --> +
            十、拦截器(同步调用、无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestSyncInterceptor]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法
            + 2、通过ajax.setSync();设置表示设置成同步等待,同步调用时无需提供回调函数,直接在执行后读出结果即可
            + 3、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            + 4、拦截器由Java后端设置,如: + + @AnInterceptor("chkAjax1") + public static void doTestInterceptor(HttpRequest request) + { + request.setResponseResult("返回成功信息"); + } + + + @AnAlias("chkAjax1") + public class AjaxChk1Interceptor implements Interceptor + { + @Override + public void intercept(HttpRequest request) throws Exception + { + request.setResponseError("拦截器不通过"); + } + } + +
            +
            +
            + +<#-- 十一、拦截器,未通过跳转到新页面(无参数、使用类别名@AnAlias) --> +
            十一、拦截器,未通过跳转到新页面(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestInterceptor2]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            + 3、拦截器由Java后端设置,如: + + @AnInterceptor("chkAjax2") + public static void doTestInterceptor2(HttpRequest request) + { + request.setResponseResult("返回成功信息"); + } + + + @AnAlias("chkAjax2") + public class AjaxChk2Interceptor implements Interceptor + { + + @Override + public void intercept(HttpRequest request) throws Exception + { + request.setRedirectTop(request.getRootPath("/index.htm"), "拦截器要求,正地跳转到首页"); + } + } + +
            +
            +
            + +<#-- 十二、拦截器,未通过跳转到新页面(同步调用、无参数、使用类别名@AnAlias) --> +
            十二、拦截器,未通过跳转到新页面(同步调用、无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestSyncInterceptor2]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法
            + 2、通过ajax.setSync();设置表示设置成同步等待,同步调用时无需提供回调函数,直接在执行后读出结果即可
            + 3、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            + 4、拦截器由Java后端设置,如: + + @AnInterceptor("chkTutorialRedirect") + public static void doTestInterceptor2(HttpRequest request) + { + request.setResponseResult("返回成功信息"); + } + + + @AnAlias("chkTutorialRedirect") + public class AjaxChk2Interceptor implements Interceptor + { + + @Override + public void intercept(HttpRequest request) throws Exception + { + request.setRedirectTop(request.getRootPath("/index.htm"), "拦截器要求,正地跳转到首页"); + } + } + +
            +
            +
            + +<#-- AJAX调用参数说明 --> +
            AJAX调用参数说明(请求参数十个,响应结果两个)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数说明
            请求参数
            contextPath默认为空当前上下文环境路径,如/admin,默认为空表示根上下文路径
            className必须调用的类名或类别名,如ZuiPresenter/com.zhiqim.document.tutorial.ui.ZuiPresenter
            methodName必须调用的类的方法名,如doTestInterceptor
            asynctrue异常还是同步调用,默认异步,true|false
            params[]参数数组,可通过addParam();函数设置参数,如addParam("abc");
            callbacknull回调函数或回调elem的id
            + 1、函数的this为Z.Ajax对象,可以通过this.responseStatus和this.responseText获取结果状态和结果文本
            + 2、回调ID时,填写elem的id,即把this.responseText的值填充到elem中,有三种填充方式,见callbackMethod参数 +
            callbackMethod"html"回调ID时的方法,三种"html"|"text"|"val"
            callScripttrue是否在AJAX结果的改变重置由data-role的缓存,如Z.Tooltip,Z.Select等,true|false,默认true
            loadingnull三种加载器,通过方法setLoading();方法来设置
            + 1、传入Z.loading对象,参数由对象指定,如ajax.setLoading(Z.loading({target: "testLoading3", shadow: true, position: 1})); + 2、传入target和是否遮罩,如ajax.setLoading(document, true);或无遮罩ajax.setLoading(document); + 3、传入targetId和是否遮罩,如ajax.setLoading("testLoading3", true);或无遮罩ajax.setLoading("testLoading3"); + 4、传入一个函数,在加载时回调该函数,如ajax.setLoading(function(){});此方式用于自定义操作 +
            loadingParamnull加载器参数,通过方法setLoading();方法来设置,是第二个参数
            + 1、当loading是Z.loading和字符串时表示是否遮罩
            + 2、当#ID时指定的HTML,成功后换回原始HTML +
            响应参数
            responseStatus0响应状态,0表示成功,601-603表示跳转,其他表示错误
            responseTextnull响应文本字符串,默认是text/plain格式,XML或JSON格式自行转化
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/tool/copy.htm b/zhiqim_ui/document/tutorial/ui/tool/copy.htm new file mode 100644 index 0000000..c65e3e3 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/tool/copy.htm @@ -0,0 +1,83 @@ +<#def title = "复制功能"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "由于各浏览器剪贴板功能不一致,功能使用复杂,因此知启蒙是利用Flash的sprite容器制作的剪贴板功能,以达到跨浏览器支持对文本的复制功能。"/> +<#def prevUrl = "../nav/dropdown.htm"/> +<#def nextUrl = "ajax.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav("document")} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "tool", "copy")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "复制功能")} +
            + +<#-- 标题 --> +
            +

            复制功能:

            +

            + 在ZhiqimUI中,提供Z.copy(value);方法用于复制内容,该方法需要浏览器的支持HTML5,当前主流浏览器都支持 +

            +
            + +<#-- 一、HTML5复制模式 --> +
            HTML5复制模式
            + +
            + +
            +
            + + +

            + + +
            +
            + +
            + +
            + 1、定义一个button,编写onclick方法,方法内调用Z.copy函数即可
            + 2、调用完成后,还可以使用Z.tips函数显示一下复制成功信息 +
            +
            +
            + +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/tool/drag.htm b/zhiqim_ui/document/tutorial/ui/tool/drag.htm new file mode 100644 index 0000000..15aa6be --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/tool/drag.htm @@ -0,0 +1,281 @@ +<#def title = "拖拽与缩放"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = " 拖拽是指定一个可拖动的对象,当鼠标按下时拖拽到其他位置。缩放是指定一个可缩放的对象,当鼠标按下时拉动对象使之放大或缩小。"/> +<#def prevUrl = "ajax.htm"/> +<#def nextUrl = "imageClipper.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav("document")} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "tool", "drag")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "拖拽与缩放")} +
            + +<#-- 标题 --> +
            +

            拖拽与缩放:

            +

            + 拖拽是指定一个可拖动的对象,当鼠标按下时拖拽到其他位置。缩放是指定一个可缩放的对象,当鼠标按下时拉动对象使之放大或缩小。 +

            +
            + +<#-- 一、简单拖拽 --> +
            一、简单拖拽
            + +
            + +
            +
            + + + +
            +
            +
            全屏(z-index范围)拖拽(可拖动)
            +
            +
            +
            +
            +
            +
            + +
            + +
            + 1、拖拽三要求,可拖拽对象、拖把和拖拽父范围,这三个对象都需要设置id
            + 2、简单拖拽只需要配置可拖拽对象、拖把两个id,简单拖拽不固定范围
            +
            +
            +
            + +<#-- 二、拖拽范围 --> +
            二、拖拽范围
            + +
            + +
            +
            + + + +
            +
            +
            在指定范围拖动(可拖动)
            +
            +
            +
            +
            +
            +
            + +
            + +
            + 1、拖拽三要求,可拖拽对象、拖把和拖拽父范围,这三个对象都需要设置id
            + 2、通过Z.dragInParent方法进行初始化,三个参数为三要求的id
            +
            +
            +
            + +<#-- 三、在一定范围内增加、删除和拖放图片和方框 --> +
            三、在一定范围内增加、删除和拖拽和缩放图片和方框
            + +
            + +
            +
            + + +
            + + + + +
            + +
            + + +
            + + +
            +
            标签位置:
            + + + + +
            注:图标可拖放
            + +
            设置宽度:
            +
            +  像素   +
            +
            + 宽: 像素     + 高: 像素 +
            +
            +
            +
            +
            + +
            + +
            + 1、比较复制的拖拽和缩放,支持IMG和DIV两种
            +
            +
            +
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/tool/imageClipper.htm b/zhiqim_ui/document/tutorial/ui/tool/imageClipper.htm new file mode 100644 index 0000000..54c5845 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/tool/imageClipper.htm @@ -0,0 +1,87 @@ +<#def title = "头像裁剪"/> +<#def keyword = "Avatar"/> +<#def desc = "头像裁剪是指对上传的图片,根据要求裁剪成指定大小的图片。支持放大和缩小图片,和通过移动图片,锁定裁剪位置"/> +<#def prevUrl = "drag.htm"/> +<#def nextUrl = "upload.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav("document")} +${Scripts.src("//zhiqim-org.oss-cn-shenzhen.aliyuncs.com/ztmpl/zhiqim_manager/zhiqim_image_clipper.js")} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "tool", "imageClipper")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "头像裁剪")} +
            + +<#-- 标题 --> +
            +

            头像裁剪:

            +

            + 头像裁剪是指对上传的图片,根据要求裁剪成指定大小的图片。支持放大和缩小图片,和通过移动图片,锁定裁剪位置 +

            +
            + +<#-- 一、简单拖拽 --> +
            一、头像裁剪
            + +
            + +
            +
            + +
            +
            +
            + +
            + +
            + 1、拖拽三要求,可拖拽对象、拖把和拖拽父范围,这三个对象都需要设置id
            + 2、简单拖拽只需要配置可拖拽对象、拖把两个id,简单拖拽不固定范围
            +
            +
            +
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/tool/upload.htm b/zhiqim_ui/document/tutorial/ui/tool/upload.htm new file mode 100644 index 0000000..59028d6 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/tool/upload.htm @@ -0,0 +1,314 @@ +<#def title = "文件上传"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = " 知启蒙文件上传提供了多种上传方法,支持表单上传、单文件上传,多文件上传,预览再上传等。"/> +<#def prevUrl = "imageClipper.htm"/> +<#def nextUrl = "uploadLarge.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav("document")} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "tool", "upload")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "文件上传")} +
            + +<#-- 标题 --> +
            +

            文件上传:

            +

            + 知启蒙文件上传提供了多种上传方法,支持表单上传、单文件上传,多文件上传,预览再上传等。 +

            +
            + +<#-- 一、最简单文件上传 --> +
            一、最简单文件上传
            + +
            + +
            +
            + + + +

            + + + +
            +
            + +
            + +
            + 1、最简文件上传,是初始化单个文件上传控件
            + 2、参数只需要指定上传按钮id和上传成功事件onCompleted
            + 3、在后台配置上下文环境属性upload.rootDir即可 +
            +
            +
            + +<#-- 二、单文件上传(先预览后上传) --> +
            二、单文件上传(先预览后上传)
            + +
            + +
            +
            + + + + +
            + + + +

            + + + +
            +
            + +
            + +
            + 1、最简文件上传,是初始化单个文件上传控件
            + 2、参数只需要指定上传按钮id和上传成功事件onCompleted
            + 3、在后台配置上下文环境属性upload.rootDir
            + 4、如果需要分成两步,先预览后上传,则增加预览处理 +
            +
            +
            + +<#-- 三、多文件上传(先预览后上传,默认图片) --> +
            三、多文件上传(先预览后上传,默认图片)
            + +
            + +
            +
            + + + + +
            + + +
            + + +
            + + +
            +
            +
            + +
            + +
            + 1、最简文件上传,是初始化多个文件上传控件
            + 2、参数只需要指定上传按钮id和上传成功事件onCompleted
            + 3、在后台配置上下文环境属性upload.rootDir
            + 4、如果需要分成两步,先预览后上传,则增加预览处理 +
            +
            +
            + +<#-- 四、表单文件上传,可以含参数 --> +
            四、表单文件上传,可以含参数
            + +
            + +
            +
            + + ${Htmls.toCallFrame()} +
            + 参数1:
            + 参数2:
            + + + + +
            +
            +
            + +
            + +
            + 1、表单文件上传的特点是支持参数一起传递,采用multipart/form-data格式
            + 2、把真实的文件上传按钮隐藏起来(各浏览器表现不一样,太不美观),使用一个button代替
            + 3、提供一个span用户显示文件选择的路径,这里也可以设计成预览
            + 4、上传button,和提供一个Action处理数据。如下: + + public class UploadFormAction implements Action, HttpdConstants + { + private static final Log log = LogFactory.getLog(UploadFormAction.class); + + @Override + public void execute(HttpRequest request) throws Exception + { + String rootDir = request.getContextAttributeString(_SERV_UPLOAD_ROOT_DIR_); + if (Validates.isEmptyBlank(rootDir) || !Files.mkDirectory(rootDir)) + { + request.setAlertMsg("未配置上传目录,不支持上传"); + return; + } + + HttpUploader uploader = new HttpUploader(); + + try + {//最大支持2M + uploader.parseHttpRequest(request, 2*1024*1024); + + String fileExt = uploader.getFileExt(); + if(Validates.isEmpty(fileExt) || !Validates.isContain("jpg,png,gif", ",", fileExt)) + { + request.setAlertMsg("仅支持图片,请重新上传"); + return; + } + + //文件字节比较 + byte[] content = uploader.getBytes(); + if (!(Bytes.isGIZ(content) || Bytes.isPNG(content) || Bytes.isJPG(content))) + { + request.setAlertMsg("图片格式不正确,请重新上传"); + return; + } + + //读出参数 + String param1 = uploader.getParameter("p1"); + String param2 = uploader.getParameter("p2"); + log.info("参数1:"+param1+",参数2:"+param2); + + //保存文件 + String fileDir = Strings.addEndsWith(Files.toLinuxPath(rootDir), "/"); + String fileName = Ids.longId() + "." + fileExt; + uploader.writeToFile(fileDir + fileName); + + request.setAlertMsg("上传成功"); + } + catch(Exception e) + { + request.setAlertMsg("上传失败"); + } + finally + { + uploader.close(); + } + } + } + +
            +
            +
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/tool/uploadLarge.htm b/zhiqim_ui/document/tutorial/ui/tool/uploadLarge.htm new file mode 100644 index 0000000..0ce3c80 --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/tool/uploadLarge.htm @@ -0,0 +1,136 @@ +<#def title = "大文件上传"/> +<#def keyword = "大文件上传 ZhiqimUI zhiqim"/> +<#def desc = " 知启蒙文件上传提供了多种上传方法,支持表单上传、单文件上传,多文件上传,预览再上传,大文件上传断点续传(HTML5和Flash两种)等。"/> +<#def prevUrl = "upload.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav("document")} + + + + +
            + +${zhiqim_com_ui("tutorial", "ui", "tool", "uploadlarge")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "大文件上传")} +
            + +<#-- 标题 --> +
            +

            大文件上传:

            +

            + 知启蒙大文件上传提供了(HTML5和Flash两种)的上传方式,支持断点续传、数据库存储文件碎片和文件信息,提供指定目录和文件名等功能。 +

            +
            + +<#-- 一、HTML5大文件断点续传 --> +
            一、HTML5大文件断点续传
            + +
            + +
            +
            + + + + + +
            +
            + +
            + +
            + 1、需要zhiqim_uploader组件,或者自己实现com.zhiqim.zhiqim.httpd.context.service.upload.Upload接口
            + 2、设计目标是针对大文件分块上传,支持断点续传和秒传(MD5码相同认为已上传)
            + 3、在后台配置上下文环境属性upload.rootDir
            + 4、指定目录:upload.fileDir = "html5"; + 5、指定文件格式:upload.setFileFormatExt("image/gif, image/jpeg"); + 6、需支持HTML5协议的浏览器支持 +
            +
            +
            + +<#-- 二、Flash大文件断点续传 --> +
            二、Flash大文件断点续传
            + +
            + +
            +
            + + + + + +
            +
            + +
            + +
            + 1、需要zhiqim_uploader组件,或者自己实现com.zhiqim.zhiqim.httpd.context.service.upload.Upload接口
            + 2、设计目标是针对大文件分块上传,支持断点续传和秒传(MD5码相同认为已上传)
            + 3、在后台配置上下文环境属性upload.rootDir
            + 4、指定目录:upload.fileDir = "html5"; + 5、指定文件格式描述:upload.setFileFormatDesc("PNG和GIF图片(*.png;*.gif)"); + 6、指定文件格式:upload.setFileFormatExt("*.png;*.gif"); + 7、需支持Flash的浏览器 +
            +
            +
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/ui/tool/zteditor.htm b/zhiqim_ui/document/tutorial/ui/tool/zteditor.htm new file mode 100644 index 0000000..9badb1a --- /dev/null +++ b/zhiqim_ui/document/tutorial/ui/tool/zteditor.htm @@ -0,0 +1,72 @@ +<#def title = "富文本编辑器"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = " 实现源码编辑、撤销、重做、字体样式、文本对齐、超链接、图片上传、复制粘贴等功能。"/> +<#def prevUrl = "drag.htm"/> +<#def nextUrl = "uploadLarge.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav("document")} +${Styles.src(context.getRootPath("/src/zteditor/zteditor.css"))} +${Scripts.src(context.getRootPath("/src/zteditor/zteditor.js"))} + + +
            + +${zhiqim_com_ui("tutorial", "ui", "tool", "zteditor")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "富文本编辑器")} +
            + +<#-- 标题 --> +
            +

            富文本编辑器:

            +

            + 实现源码编辑、撤销、重做、字体样式、文本对齐、超链接、图片上传、复制粘贴等功能。 +

            +
            + +<#-- 一、示例样式 --> +
            一、示例
            + + + + + + + + + + +
            效果预览
            + + + + +
            +
            查看结果
            +
            
            +    
            + +
            +${zhiqim_com_chapter()} +
            + + +
            + + +
            +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/css/block.htm b/zhiqim_ui/document/tutorial/uim/css/block.htm new file mode 100644 index 0000000..1fbf744 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/css/block.htm @@ -0,0 +1,342 @@ +<#def title = "块样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "块样式是指对一个块区域增加样式规则,如指定块隐藏显示、块定位、块宽、块宽百分比、块高、块高百分比、内边距、外边距等属性。"/> +<#def prevUrl = "text.htm"/> +<#def nextUrl = "../js/js.htm"/> +${zhiqim_com_header()} +${zhiqim_com_topnav()} + +${zhiqim_com_mobileUI_scrollJs()} + + +
            +${zhiqim_com_ui("tutorial", "ui", "css", "block")} + + +
            +${zhiqim_com_breadcrumb("文库", "教程", "块样式")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            块样式:

            +

            + 块样式是指对一个块区域增加样式规则,如指定块隐藏显示、块定位、块宽、块宽百分比、块高、块高百分比、内边距、外边距等属性。 +

            +
            + +<#-- 一、块定位 --> +
            一、块定位
            + + + + + + + + + + + + + + + + + + + + + + +
            名称样式说明
            + .z-fixed
            + .zi-fixed +
            +        .z-fixed{position:fixed;}
            +        .zi-fixed{position:fixed !important;}
            +    
            固定定位
            + .z-absolute
            + .zi-absolute
            +        .z-absolute{position:absolute;}
            +        .zi-absolute{position:absolute !important;}
            +    
            绝对定位
            + .z-relative
            + .zi-relative
            +        .z-relative{position:relative;}
            +        .zi-relative{position:relative !important;}
            +    
            相对定位
            + +<#-- 二、块浮动对齐 --> +
            二、块浮动对齐
            + + + + + + + + + + + + + + + + + + + + + + +
            名称样式说明
            .z-float-left
            .zi-float-left
            +        .z-float-left{float:left;}
            +        .zi-float-left{float:left !important;}
            +    
            左对齐
            .z-float-center
            .zi-float-center
            +        .z-float-center{margin-left:auto;margin-right:auto;}
            +        .zi-float-center{margin-left:auto !important;margin-right:auto !important;}
            +    
            居中对齐
            .z-float-right
            .zi-float-right
            +        .z-float-right{float:right;}
            +        .zi-float-right{float:right !important;}
            +    
            右对齐
            + +<#-- 三、块定位+浮动对齐 --> +
            三、块定位+浮动对齐
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式说明
            + .z-relative-left
            + .zi-relative-left
            +        .z-relative-left{position:relative;float:left;}
            +        .zi-relative-left{position:relative !important;float:left !important;}
            +    
            相对左对齐
            + .z-relative-center
            + .zi-relative-center
            +        .z-relative-center{position:relative;margin-left:auto;margin-right:auto;}
            +        .zi-relative-center{position:relative !important;margin-left:auto !important;margin-right:auto !important;}
            +    
            相对居中
            + .z-relative-right
            + .zi-relative-right
            +        .z-relative-right{position:relative;float:right;}
            +        .zi-relative-right{position:relative !important;float:right !important;}
            +    
            相对右对齐
            + .z-absolute-center-middle
            + .zi-absolute-center-middle
            +        .z-absolute-center-middle{position:absolute;margin:auto;top:0;bottom:0;left:0;right:0;}
            +        .zi-absolute-center-middle{position:absolute !important;margin:auto !important;top:0 !important;bottom:0 !important;left:0 !important;right:0 !important;}
            +    
            绝对居中,内部块在父块的上下左右居中
            + +<#-- 四、块溢出 --> +
            四、块溢出
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式说明
            .z-overflow-auto
            +        .z-overflow-auto{overflow:auto;}
            +    
            块溢出自动设置,指定高度,当内部超时时显示滚动条
            .z-overflow-hidden
            +        .z-overflow-hidden{overflow:hidden;}
            +    
            块溢出的部分不显示
            .z-overflow-scroll
            +        .z-overflow-scroll{overflow:scroll;}
            +    
            块始终显示滚动条,不管内部高度是否超过
            .z-overflow-x-auto
            +        .z-overflow-x-auto{overflow-x:auto;}
            +    
            块X轴溢出自动设置,指定高度,当内部超时时显示滚动条
            .z-overflow-x-hidden
            +        .z-overflow-x-hidden{overflow-x:hidden;}
            +    
            块X轴溢出的部分不显示
            .z-overflow-x-scroll
            +        .z-overflow-x-scroll{overflow-x:scroll;}
            +    
            块X轴始终显示滚动条,不管内部高度是否超过
            .z-overflow-y-auto
            +        .z-overflow-y-auto{overflow-y:auto;}
            +    
            块Y轴溢出自动设置,指定高度,当内部超时时显示滚动条
            .z-overflow-y-hidden
            +        .z-overflow-y-hidden{overflow-y:hidden;}
            +    
            块Y轴溢出的部分不显示
            .z-overflow-y-scroll
            +        .z-overflow-y-scroll{overflow-y:scroll;}
            +    
            块Y轴始终显示滚动条,不管内部高度是否超过
            + +<#-- 五、块手势 --> +
            五、块鼠标标志
            + + + + + + + + + + + + + + + + +
            名称样式说明
            .z-pointer
            +        .z-pointer{cursor:pointer;}
            +    
            显示手标志,即可点击状态
            .z-forbidden
            +        .z-forbidden{cursor:not-allowed;}
            +    
            禁止使用,显示禁止标志
            + +<#-- 六、块隐藏和显示 --> +
            六、块隐藏和显示
            + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称举例说明
            .z-hide
            .zi-hide
            +        .z-hide{display:none;}
            +        .zi-hide{display:none !important;}
            +        
            +
            隐藏,不占位
            + .z-show
            .z-show-b
            .z-show-ib
            + .zi-show
            .zi-show-b
            .zi-show-ib +
            +        .z-show{display:inline;}
            +        .z-show-b{display:block;}
            +        .z-show-ib{display:inline-block;}
            +        .zi-show{display:inline !important;}
            +        .zi-show-b{display:block !important;}
            +        .zi-show-ib{display:inline-block !important;}
            +        
            + 显示的三种状态
            + 1、z-show适用于<span>,<a>,<label>,<input>,<img>
            + 2、z-show-b适用<div>,<p>,<h1>,<form>,<ul><li>
            + 3、z-show-ib适用于把块作为内联方式。 +
            .z-visible
            .zi-visible
            +        .z-visible{visibility:visible !important;}
            +        .zi-visible{visibility:visible !important;}
            +    
            用于保留占位的显示
            .z-hidden
            .zi-hidden
            +        .z-hidden{visibility:hidden !important;}
            +        .zi-hidden{visibility:hidden !important;}
            +    
            用于保留占位的隐藏
            + + +${zhiqim_com_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_com_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/css/color.htm b/zhiqim_ui/document/tutorial/uim/css/color.htm new file mode 100644 index 0000000..d01b4f4 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/css/color.htm @@ -0,0 +1,645 @@ +<#def title = "颜色定义"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "颜色定义基本保持ZhiqimUI的风格不变,仍然使用z-前缀;默认提供的全局、白色、黑色和红、橙、黄、绿、青、蓝、紫共十种颜色的定义,包括字体颜色、背景颜色和边框颜色等,以及对应的样式名称。"/> +<#def prevUrl = "rem.htm"/> +<#def nextUrl = "font.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "css", "color")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "全局CSS定义", "颜色定义")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            颜色定义:

            +

            + 颜色定义基本保持ZhiqimUI的风格不变,仍然使用z-前缀;默认提供的全局、白色、黑色和红、橙、黄、绿、青、蓝、紫共十种颜色的定义,包括字体颜色、背景颜色和边框颜色等,以及对应的样式名称。 +

            +
            + +<#var colorMap = Jsons.toMap(context.getResourceString("/zhiqimUI/css/zhiqim.pre.json", "UTF-8"))/> + +<#-- 全局颜色 --> +
            全局颜色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            全局文本颜色${textColor}${colorMap.get("textColor")}全局颜色全局颜色定义,定义在body中
            全局背景颜色${bgColor}${colorMap.get("bgColor")}全局背景全局背景颜色,定义在body中
            全局链接颜色${linkColor}${colorMap.get("linkColor")}链接效果全局链接颜色,定义在a,a:visited中
            全局链接Hover颜色${linkHoverColor}${colorMap.get("linkHoverColor")}全局链接颜色,定义在a:hover,a:focus,a:active中
            + +<#-- 白色 --> +
            白色
            + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            白色文本${whiteTextColor}${colorMap.get("whiteTextColor")}白色文本.z-text-white
            白色背景${whiteBgColor}${colorMap.get("whiteBgColor")}白色背景.z-bg-white
            + +<#-- 黑色 --> +
            黑色
            + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            黑色文本${blackTextColor}${colorMap.get("blackTextColor")}黑色文本.z-text-black
            黑色背景${blackBgColor}${colorMap.get("blackBgColor")}黑色背景.z-bg-black
            + +<#-- 灰色 --> +
            灰色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            灰色文本${grayTextColor}${colorMap.get("grayTextColor")}灰色文本.z-text-gray
            灰色背景${grayBgColor}${colorMap.get("grayBgColor")}灰色背景.z-bg-gray
            灰色边框${grayBdColor}${colorMap.get("grayBdColor")}灰色边框.z-bd
            灰色按钮文本${btnTextColor}${colorMap.get("btnTextColor")}灰色按钮 +
            +
            灰色按钮
            +
            灰色按钮
            + (按钮、筛选按钮) +
            +
            +
            橙色按钮
            +
            橙色按钮
            +
            橙色按钮
            + (多选按钮三种状态) +
            +
            灰色按钮边框和背景${btnBdColor}
            ${btnBgColor}
            ${colorMap.get("btnBdColor")}
            ${colorMap.get("btnBgColor")}
            灰色按钮
            灰色hover背景${btnBgHoverColor}${colorMap.get("btnBgHoverColor")}
            灰色按钮
            灰色按钮active背景${btnBgActiveColor}${colorMap.get("btnBgActiveColor")}
            灰色按钮
            + +<#-- 红色 --> +
            红色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            红色文本${redTextColor}${colorMap.get("redTextColor")}红色文本.z-text-red
            红色背景${redBgColor}${colorMap.get("redBgColor")}红色背景.z-bg-red
            红色边框${redBdColor}${colorMap.get("redBdColor")}红色边框.z-bd.z-red
            红色按钮边框${redBtnBdColor}${colorMap.get("redBtnBdColor")}
            红色按钮
            +
            +
            红色按钮
            +
            红色按钮
            +
            红色按钮
            + (按钮、筛选按钮) +
            +
            +
            红色按钮
            +
            红色按钮
            +
            红色按钮
            + (多选按钮三种状态) +
            +
            红色hover背景${redHoverColor}${colorMap.get("redHoverColor")}
            红色按钮
            + +<#-- 橙色 --> +
            橙色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            橙色文本${orangeTextColor}${colorMap.get("orangeTextColor")}橙色文本.z-text-orange
            橙色背景${orangeBgColor}${colorMap.get("orangeBgColor")}橙色背景.z-bg-orange
            橙色边框${orangeBdColor}${colorMap.get("orangeBdColor")}橙色边框.z-bd.z-orange
            橙色按钮边框${orangeBtnBdColor}${colorMap.get("orangeBtnBdColor")}
            橙色按钮
            +
            +
            橙色按钮
            +
            橙色按钮
            +
            橙色按钮
            + (按钮、筛选按钮) +
            +
            +
            橙色按钮
            +
            橙色按钮
            +
            橙色按钮
            + (多选按钮三种状态) +
            +
            橙色hover背景${orangeHoverColor}${colorMap.get("orangeHoverColor")}
            橙色按钮
            + +<#-- 黄色 --> +
            黄色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            黄色文本${yellowTextColor}${colorMap.get("yellowTextColor")}黄色文本.z-text-yellow
            黄色背景${yellowBgColor}${colorMap.get("yellowBgColor")}黄色背景.z-bg-yellow
            黄色边框${yellowBdColor}${colorMap.get("yellowBdColor")}黄色边框.z-bd.z-yellow
            黄色按钮边框${yellowBtnBdColor}${colorMap.get("yellowBtnBdColor")}
            黄色按钮
            +
            +
            黄色按钮
            +
            黄色按钮
            +
            黄色按钮
            + (按钮、筛选按钮) +
            +
            +
            黄色按钮
            +
            黄色按钮
            +
            黄色按钮
            + (多选按钮三种状态) +
            +
            黄色hover背景${yellowHoverColor}${colorMap.get("yellowHoverColor")}
            黄色按钮
            + +<#-- 绿色 --> +
            绿色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            绿色文本${greenTextColor}${colorMap.get("greenTextColor")}绿色文本.z-text-green
            绿色背景${greenBgColor}${colorMap.get("greenBgColor")}绿色背景.z-bg-green
            绿色边框${greenBdColor}${colorMap.get("greenBdColor")}绿色边框.z-bd.z-green
            绿色按钮边框${greenBtnBdColor}${colorMap.get("greenBtnBdColor")}
            绿色按钮
            +
            +
            绿色按钮
            +
            绿色按钮
            +
            绿色按钮
            + (按钮、筛选按钮) +
            +
            +
            绿色按钮
            +
            绿色按钮
            +
            绿色按钮
            + (多选按钮三种状态) +
            +
            绿色hover背景${greenHoverColor}${colorMap.get("greenHoverColor")}
            绿色按钮
            + +<#--青色 --> +
            青色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            青色
            名称通配符缺省值举例说明
            青色文本${cyanTextColor}${colorMap.get("cyanTextColor")}青色文本.z-text-cyan
            青色背景${cyanBgColor}${colorMap.get("cyanBgColor")}青色背景.z-bg-cyan
            青色边框${cyanBdColor}${colorMap.get("cyanBdColor")}青色边框.z-bd.z-cyan
            青色按钮边框${cyanBtnBdColor}${colorMap.get("cyanBtnBdColor")}
            青色按钮
            +
            +
            青色按钮
            +
            青色按钮
            +
            青色按钮
            + (按钮、筛选按钮) +
            +
            +
            青色按钮
            +
            青色按钮
            +
            青色按钮
            + (多选按钮三种状态) +
            +
            青色hover背景${cyanHoverColor}${colorMap.get("cyanHoverColor")}
            青色按钮
            + +<#--蓝色 --> +
            蓝色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            蓝色文本${blueTextColor}${colorMap.get("blueTextColor")}蓝色文本.z-text-blue
            蓝色背景${blueBgColor}${colorMap.get("blueBgColor")}蓝色背景.z-bg-blue
            蓝色边框${blueBdColor}${colorMap.get("blueBdColor")}蓝色边框.z-bd.z-blue
            蓝色按钮边框${blueBtnBdColor}${colorMap.get("blueBtnBdColor")}
            蓝色按钮
            +
            +
            蓝色按钮
            +
            蓝色按钮
            +
            蓝色按钮
            + (按钮、筛选按钮) +
            +
            +
            蓝色按钮
            +
            蓝色按钮
            +
            蓝色按钮
            + (多选按钮三种状态) +
            +
            蓝色hover背景${blueHoverColor}${colorMap.get("blueHoverColor")}
            蓝色按钮
            + +<#--紫色 --> +
            紫色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称通配符缺省值举例说明
            紫色文本${purpleTextColor}${colorMap.get("purpleTextColor")}紫色文本.z-text-purple
            紫色背景${purpleBgColor}${colorMap.get("purpleBgColor")}紫色背景.z-bg-purple
            紫色边框${purpleBdColor}${colorMap.get("purpleBdColor")}紫色边框.z-bd.z-purple
            紫色按钮边框${purpleBtnBdColor}${colorMap.get("purpleBtnBdColor")}
            紫色按钮
            +
            +
            紫色按钮
            +
            紫色按钮
            +
            紫色按钮
            + (按钮、筛选按钮) +
            +
            +
            紫色按钮
            +
            紫色按钮
            +
            紫色按钮
            + (多选按钮三种状态) +
            +
            紫色hover背景${purpleHoverColor}${colorMap.get("purpleHoverColor")}
            紫色按钮
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/css/css.htm b/zhiqim_ui/document/tutorial/uim/css/css.htm new file mode 100644 index 0000000..87edc22 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/css/css.htm @@ -0,0 +1,294 @@ +<#def title = "全局定义"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "全局定义是指在全局定义里的标签缺省下的样式规则,包括三部分。"/> +<#def prevUrl = "../index.htm"/> +<#def nextUrl = "rem.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "css", "global")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "全局CSS定义", "全局定义")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            全局定义:

            +

            + 全局定义是指在全局定义里的标签缺省下的样式规则,包括三部分:
            + 1、HTML5新模板和兼容:包括十二个block新标签、三个inline-block新标签,以及隐藏等其他属性;
            + 2、全局标记一致性定义:约定html、body、img、p等标签在所有浏览器中一致性定义;
            + 3、表单一致性定义:约定button、input、checkbox、radio等表单属性在所有浏览器中一致性定义。
            +

            +
            + +<#-- 全局HTML5新模板和兼容问题 --> +
            全局HTML5新模板和兼容问题
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            一、十二个新标签(block):
            + +article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;} + +
            二、三个新标签(inline-block):
            + +audio,canvas,video{display:inline-block;vertical-align:baseline;} + +
            三、音频模块兼容性问题
            + +audio:not([controls]){display:none;height:0;} + +为防止主流浏览器中,显示"不带控制按钮的音频模块"这一问题。以及解决iOS5移动端显示多余高度的兼容性问题。 + +
            四、有隐藏属性或标记为模板的的设置为隐藏
            + +[hidden],template{display:none;} + +
            五、设置svg非根元素的元素不显示仅占位
            + +svg:not(:root){overflow:hidden;} + +只支持一个根元素如(<svg></svg>),除了<svg>内部的,其他的都不显示 + +
            + +<#-- 全局标记一致性定义 --> +
            全局标记一致性定义
            + + + + + + + + + + + + + + + + + + + + +
            一、所有标签(*,*:before,*:after)
            + +*{border-box;box-sizing:border-box;} +*:before,*:after{box-sizing:border-box;} + +默认所有元素含插入内容前后宽高设置采用border-box方式,即宽高包括border和padding,向内扩充 + +
            二、HTML标签
            + +html{ + font-family:"微软雅黑","宋体",Arial,sans-serif; + overflow-x:hidden;overflow-y:auto; + -ms-text-size-adjust:100%; + -webkit-text-size-adjust:100%; + -webkit-tap-highlight-color:rgba(0, 0, 0, 0); +} +@media screen and (max-width: 320px) { + html { + font-size:83.33px; + font-size:26.66667vw + } +} +... ... +@media screen and (min-width: 769px) { + html { + font-size:204.8px + } +} +html,body{width:100%;height:100%;position:relative;overflow:hidden;} + +1、设置全局字体,防止一些设备上字体随屏幕放大而改变字体大小,如webkit的Safari +2、指定文档宽高并隐藏超出 +3、当屏幕横坚切换时字体大小调整和以前一样 +4、文档字体大小以rem为主,所以用@media screen自定义不同的html字体大小 + +
            二、默认字体大小行高颜色、背景颜色,无外边框
            + +body{color:#333;background-color:#fff;} +body,table,td,div{font-size:12px;line-height:120%;} +body,form,figure{margin:0;} + +
            三、图片无边框、居中、不超时父边框宽高,IE7以上支持缩放不失真(bicubic)
            + +img{border:0;vertical-align:middle;max-width:100%;max-height:100%;-ms-interpolation-mode:bicubic;} + +
            四、段落无内外边距,这样p和br功能相同
            + +p{margin:0px;padding:0px;} + +
            五、字段集合默认边框、左右两像素外边距,和内边距设置,名称无边框和内边距
            + +p{margin:0px;padding:0px;} + +
            六、分隔线修改为上边框一条1像素的线,上下1em高度
            + +hr{ + -webkit-box-sizing:content-box; + -moz-box-sizing:content-box; + box-sizing:content-box; + height:0;border:0;border-top:1px solid #eee;margin:1em 0; +} + +
            七、列表无前序号,无内外边距,行高1.25em
            + +ul,dl,ol,li{list-style:none;padding:0;margin:0;} +li{line-height:1.25em;} + +
            八、链接,初始和访问后相同,淡黑色背景透明,移入无下标线、默认淡青色
            + +a,a:visited{color:#333;text-decoration:none;background-color:transparent;} +a:focus{color:#43cd6e;outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +a:active,a:hover{color:#43cd6e;outline:0;text-decoration:underline;} + +这里是文本连接效果 + +
            + +<#-- 表单一致性定义 --> +
            表单一致性定义
            + + + + + + + + + + + + + + + + + + +
            一、统一按钮和输入框无内外边距(Firefox默认按扭和输入框padding 0 2px)
            + +button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;} + +
            二、输入框行高强制成正常(各个浏览器默认值不一样)
            + +input{line-height:normal;} + +
            三、表单控件不显示选中边框(webkit默认有边框)
            + +button,input,select,optgroup,textarea{color:inherit;font:inherit;margin:0;outline:none;} + +
            四、按钮可见,webkit渲染,不可用时手势为禁止,取消可能的大小写文本转换
            + +button{overflow:visible;} +button,html input[type="button"],input[type="reset"],input[type="submit"] {-webkit-appearance:button;cursor:pointer;} +button[disabled],html input[disabled]{cursor:not-allowed;} +button,select{text-transform:none;} + +
            五、单多选按钮有2像素偏下,IE高度和背景白色问题,修改成高度为13px,背景透明
            + +input[type="checkbox"],input[type="radio"]{margin-top:-2px;border:0;padding:0;vertical-align:middle;height:13px;background-color:transparent;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} + +
            六、选项框(select)中的分组默认加粗
            + +optgroup{font-weight:bold;} + +
            七、移动设备上webkit自定义数字框高度自动
            + +input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto;} + +
            八、移动设备上webkit自定义搜索框为文本字段,宽高设置采用content-box,按钮取消原生样式
            + +input[type="search"]{ + -webkit-appearance:textfield; + -webkit-box-sizing:content-box; + -moz-box-sizing:content-box; + box-sizing:content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration{ + -webkit-appearance:none; +} + +
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/css/fadfox.pre.json b/zhiqim_ui/document/tutorial/uim/css/fadfox.pre.json new file mode 100644 index 0000000..bd44b20 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/css/fadfox.pre.json @@ -0,0 +1,70 @@ +{ +textColor:"#333", +bgColor:"#fff", +linkColor:"#333", +linkHoverColor:"#06c", + +whiteTextColor:"#fffff0", +whiteBgColor:"#fff", + +blackTextColor:"#333", +blackBgColor:"#000", + +grayTextColor:"#ccc", +grayBgColor:"#f5f5f5", +grayBdColor:"#d3d3d3", +btnTextColor:"#333", +btnBdColor:"#c3c3c3", +btnBgColor:"#f2f2f2", +btnBgHoverColor:"#f5f5f5", +btnBgActiveColor:"#dfdfdf", + +redTextColor:"#8b0000", +redBgColor:"#ffe4e1", +redBdColor:"#ea4a36", +redBtnBdColor:"#e8351f", +redBtnBgColor:"#ea4a36", +redHoverColor:"#ed6a5a", + +orangeTextColor:"#fe4615", +orangeBgColor:"#f5deb3", +orangeBdColor:"#ff6600", +orangeBtnBdColor:"#ff4e00", +orangeBtnBgColor:"#ff6600", +orangeHoverColor:"#ff8533", + +yellowTextColor:"#ffd700", +yellowBgColor:"#ffe", +yellowBdColor:"#fac603", +yellowBtnBdColor:"#e1b203", +yellowBtnBgColor:"#fac603", +yellowHoverColor:"#fbd238", + +greenTextColor:"#006400", +greenBgColor:"#f0fff0", +greenBdColor:"#43cd6e", +greenBtnBdColor:"#34c360", +greenBtnBgColor:"#43cd6e", +greenHoverColor:"#49de79", + +cyanTextColor:"#008b8b", +cyanBgColor:"#e1ffff", +cyanBdColor:"#009899", +cyanBtnBdColor:"#029394", +cyanBtnBgColor:"#009899", +cyanHoverColor:"#4bb0af", + +blueTextColor:"#0066cc", +blueBgColor:"#f0f8ff", +blueBdColor:"#2a689d", +blueBtnBdColor:"#1299ec", +blueBtnBgColor:"#28a3ef", +blueHoverColor:"#4cb9fc", + +purpleTextColor:"#ba55d3", +purpleBgColor:"#e6e6fa", +purpleBdColor:"#9e70ca", +purpleBtnBdColor:"#9469bd", +purpleBtnBgColor:"#9e70ca", +purpleHoverColor:"#ac7ed7" +} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/css/font.htm b/zhiqim_ui/document/tutorial/uim/css/font.htm new file mode 100644 index 0000000..4e1115c --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/css/font.htm @@ -0,0 +1,949 @@ +<#def title = "字体图标"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "“字体图标”是矢量图片按字体规范设计的一种新的图标,凡狐字体图标放在/service/res/font/zhiqim.woff文件中,当前开发和收集的图标分"/> +<#def prevUrl = "color.htm"/> +<#def nextUrl = "ico.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "css", "font")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "全局CSS定义", "字体图标")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            什么是“字体图标”?

            +

            + “字体图标”是矢量图片按字体规范设计的一种新的图标,凡狐字体图标放在/service/res/font/zhiqim.woff文件中,当前开发和收集的图标分 + 操作类、文档类、设备类、图表类、实体类五种,共五十九个图标。 + 字体图标不支持斜体,以便使用<i>标签来定义,如<i class="z-font z-config"></i> +

            +
            + +<#-- 操作类 --> +
            一、操作类图标,编码范围(f000-f03f),共18个
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            样式编码图标
            .z-font.z-config&#xf000; 字体 字体 字体
            .z-font.z-add&#xf001; 字体 字体 字体
            .z-font.z-modify&#xf002; 字体 字体 字体
            .z-font.z-delete&#xf003; 字体 字体 字体
            .z-font.z-query&#xf004; 字体 字体 字体
            .z-font.z-previous&#xf005; 字体 字体 字体
            .z-font.z-next&#xf006; 字体 字体 字体
            .z-font.z-open&#xf007; 字体 字体 字体
            .z-font.z-close&#xf008; 字体 字体 字体
            .z-font.z-upload&#xf009; 字体 字体 字体
            .z-font.z-save或.z-font.z-finish&#xf00a; 字体 字体 字体
            .z-font.z-return&#xf00b; 字体 字体 字体
            .z-font.z-refresh&#xf00c; 字体 字体 字体
            .z-font.z-success&#xf00d; 字体 字体 字体
            .z-font.z-error&#xf00e; 字体 字体 字体
            .z-font.z-setting&#xf00f; 字体 字体 字体
            .z-font.z-share&#xf010; 字体 字体 字体
            .z-font.z-download&#xf011; 字体 字体 字体
            + +<#-- 文档类 --> +
            二、文档类图标,编码范围(f040-f05f),共10个
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            样式编码图标
            .z-font.z-folder&#xf040; 字体
            .z-font.z-collect&#xf041; 字体
            .z-font.z-briefcase&#xf042; 字体
            .z-font.z-image-text&#xf043; 字体
            .z-font.z-text&#xf044; 字体
            .z-font.z-picture&#xf045; 字体
            .z-font.z-video&#xf046; 字体
            .z-font.z-voice&#xf047; 字体
            .z-font.z-camera&#xf048; 字体
            .z-font.z-print&#xf049; 字体
            + +<#-- 设备类 --> +
            三、设备类图标,编码范围(f060-f07f),共9个
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            样式编码图标
            .z-font.z-computer&#xf060; 字体
            .z-font.z-phone&#xf061; 字体
            .z-font.z-monitor&#xf062; 字体
            .z-font.z-email&#xf063; 字体
            .z-font.z-internet&#xf064; 字体
            .z-font.z-switch&#xf065; 字体
            .z-font.z-wifi&#xf066; 字体
            .z-font.z-cloud&#xf067; 字体
            .z-font.z-port&#xf068; 字体
            + +<#-- 图表类 --> +
            四、图表类图标,编码范围(f080-f09f),共14个
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            样式编码图标
            .z-font.z-list&#xf080;
            .z-font.z-apps&#xf081;
            .z-font.z-pie-chart&#xf082;
            .z-font.z-histogram&#xf083;
            .z-font.z-graph&#xf084;
            .z-font.z-diagram&#xf085;
            .z-font.z-arrow-down&#xf086;
            .z-font.z-arrow-up&#xf087;
            .z-font.z-arrow-left&#xf088;
            .z-font.z-arrow-right&#xf089;
            .z-font.z-arrowhead-down&#xf08a;
            .z-font.z-arrowhead-up&#xf08b;
            .z-font.z-arrowhead-left&#xf08c;
            .z-font.z-arrowhead-right&#xf08c;
            + +<#-- 实体类 --> +
            五、实体类图标,编码范围(f0a0-f0bf),共8个
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            样式编码图标
            .z-font.z-customer&#xf0a0;
            .z-font.z-cash&#xf0a1;
            .z-font.z-house&#xf0a2;
            .z-font.z-flower&#xf0a3;
            .z-font.z-box&#xf0a4;
            .z-font.z-desk&#xf0a5;
            .z-font.z-gift&#xf0a6;
            .z-font.z-lock&#xf0a7;
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/css/rem.htm b/zhiqim_ui/document/tutorial/uim/css/rem.htm new file mode 100644 index 0000000..a91c33a --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/css/rem.htm @@ -0,0 +1,440 @@ +<#def title = "使用rem"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "ZmUI整体风格使用rem作为长度单位,它是相对于html元素的font-size的一个单位。建议大家对需要适应页面大小的任何元素都使用rem为单位来定义。"/> +<#def prevUrl = "css.htm"/> +<#def nextUrl = "color.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "css", "rem")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "全局CSS定义", "使用rem")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            使用rem:

            +

            + ZmUI整体风格使用 rem 作为长度单位,它是相对于 html 元素的 font-size 的一个单位。建议大家对需要适应页面大小的任何元素都使用 rem 为单位来定义。
            + 关于其定义,可以参考 MDN上的定义。 +

            +
            + +<#-- HTML 标签的 font-size 定义 --> +
            HTML 标签的 font-size 定义
            + +
            +
            一、以 iphone6 为基准
            +
            + 以 iphone6 的屏宽 375 作为媒体查询 font-size 计算的标准,再向更大更小进行变化;
            + 此时 html 标签的 font-size 为 100px,默认字体大小为 .16rem(16px),所有以 rem 定义的大小、长度均以此为基准进行计算。
            +
            + + +
            +
            二、媒体查询计算 font-size
            +
            + +@media screen and (max-width: 320px) { + html { + font-size:83.33px; + font-size:26.66667vw + } +} +... +@media screen and (min-width: 376px) and (max-width:393px) { + html { + font-size:104.8px; + font-size:26.66667vw + } +} +... +@media screen and (min-width: 769px) { + html { + font-size:204.8px + } +} + +
            +
            + +<#-- 通用的字体大小定义 --> +
            通用的字体大小定义
            +
            +
              +
            • 暂时保留 ZhiqimUI 中 px 的定义,如:z-px12、zi-px20。
            • +
            • 新增 rem 的定义方式,如:z-rem12、zi-rem20,分别表示 font-size:.12rem 和 font-size:.2rem !important。
            • +
            + + +.z-px10{font-size:10px;} +.z-px11{font-size:11px;} +.z-px12{font-size:12px;} +.z-px13{font-size:13px;} +.z-px14{font-size:14px;} +.z-px15{font-size:15px;} +.z-px16{font-size:16px;} +.z-px17{font-size:17px;} +.z-px18{font-size:18px;} +.z-px19{font-size:19px;} +.z-px20{font-size:20px;} +.z-px22{font-size:22px;} +.z-px24{font-size:24px;} +.z-px26{font-size:26px;} +.z-px30{font-size:30px;} +.z-px40{font-size:40px;} +.z-px50{font-size:50px;} + +.zi-px10{font-size:10px !important;} +... +.zi-px50{font-size:50px !important;} + +.z-rem12{font-size:.12rem;} +.z-rem13{font-size:.13rem;} +.z-rem14{font-size:.14rem;} +.z-rem15{font-size:.15rem;} +.z-rem16{font-size:.16rem;} +.z-rem17{font-size:.17rem;} +.z-rem18{font-size:.18rem;} +.z-rem19{font-size:.19rem;} +.z-rem20{font-size:.2rem;} +.z-rem22{font-size:.22rem;} +.z-rem24{font-size:.24rem;} +.z-rem25{font-size:.25rem;} +.z-rem26{font-size:.26rem;} +.z-rem28{font-size:.28rem;} +.z-rem30{font-size:.3rem;} +.z-rem32{font-size:.32rem;} +.z-rem35{font-size:.35rem;} +.z-rem36{font-size:.36rem;} +.z-rem40{font-size:.4rem;} +.z-rem50{font-size:.50rem;} + +.zi-rem12{font-size:.12rem !important;} +... +.zi-rem50{font-size:.50rem !important;} + +
            + +<#-- width 和 height 定义 --> +
            width 和 height 定义
            +
            +
              +
            • 原 ZhiqimUI 中的定义具体数值的 z-w*、z-h* ,如: z-w100、z-h100;统一改成用 z- 前缀,单位为 rem,如: z-w100、z-h100。
            • +
            • 原 ZhiqimUI 中的定义百分比的 z-w5p、z-h50p 保留。
            • +
            + + +.z-w0{width:0;} +.z-w10{width:.1rem;}.z-w12{width:.12rem;} +.z-w14{width:.14rem;}.z-w15{width:.15rem;} +.z-w16{width:.16rem;}.z-w18{width:.18rem;} +.z-w20{width:.2rem;}.z-w22{width:.22rem;} +.z-w24{width:.24rem;}.z-w25{width:.25rem;} +.z-w28{width:.28rem;}.z-w30{width:.3rem;} +.z-w35{width:.35rem;}.z-w40{width:.4rem;} +.z-w45{width:.45rem;}.z-w50{width:.5rem;} +.z-w55{width:.55rem;}.z-w60{width:.6rem;} +.z-w65{width:.65rem;}.z-w70{width:.7rem;} +.z-w75{width:.75rem;}.z-w80{width:.8rem;} +.z-w85{width:.85rem;}.z-w90{width:.9rem;} +.z-w95{width:.95rem;}.z-w100{width:1rem;} +.z-w110{width:1.1rem;}.z-w120{width:1.2rem;} +.z-w130{width:1.3rem;}.z-w140{width:1.4rem;} +.z-w150{width:1.5rem;}.z-w160{width:1.6rem;} +.z-w170{width:1.7rem;}.z-w180{width:1.8rem;} +.z-w190{width:1.9rem;}.z-w200{width:2rem;} +.z-w230{width:2.3rem;}.z-w250{width:2.5rem;} +.z-w270{width:2.7rem;}.z-w300{width:3rem;} +.z-w400{width:4rem;}.z-w500{width:5rem;} +.z-w600{width:6rem;}.z-w700{width:7rem;} +.z-w800{width:8rem;} + +.zi-w0{width:0 !important;} +... +.zi-w800{width:8rem !important;} + +.z-w5p{width:5%;}.z-w8p{width:8%;} +.z-w10p{width:10%;}.z-w12p{width:12%;} +.z-w15p{width:15%;}.z-w30p{width:30%;} +.z-w40p{width:40%;}.z-w60p{width:60%;} +.z-w70p{width:70%;}.z-w80p{width:80%;} +.z-w90p{width:90%;}.z-w100p{width:100%;} +.z-w100p2,.z-w50p{width:50%;} +.z-w100p3{width:33.333333%;} +.z-w100p4,.z-w25p{width:25%;} +.z-w100p5,.z-w20p{width:20%;} +.z-w100p6{width:16.666666%;} +.z-w100p7{width:14.285714%;} +.z-w100p8{width:12.5%;} +.z-w100p9{width:11.111111%;} + +.zi-w5p{width:5% !important;}.zi-w8p{width:8% !important;} +... +.zi-w100p9{width:11.111111% !important;} + +.z-h0{height:0;} +.z-h10{height:.1rem;}.z-h12{height:.12rem;} +.z-h14{height:.14rem;}.z-h15{height:.15rem;} +.z-h16{height:.16rem;}.z-h18{height:.18rem;} +.z-h20{height:.2rem;}.z-h22{height:.22rem;} +.z-h24{height:.24rem;}.z-h25{height:.25rem;} +.z-h28{height:.28rem;}.z-h30{height:.3rem;} +.z-h32{height:.32rem;}.z-h35{height:.35rem;} +.z-h40{height:.4rem;}.z-h45{height:.45rem;} +.z-h50{height:.5rem;}.z-h55{height:.55rem;} +.z-h60{height:.6rem;}.z-h65{height:.65rem;} +.z-h70{height:.7rem;}.z-h75{height:.75rem;} +.z-h80{height:.8rem;}.z-h85{height:.85rem;} +.z-h90{height:.9rem;}.z-h95{height:.95rem;} +.z-h100{height:1rem;}.z-h110{height:1.1rem;} +.z-h120{height:1.2rem;}.z-h130{height:1.3rem;} +.z-h140{height:1.4rem;}.z-h150{height:1.5rem;} +.z-h160{height:1.6rem;}.z-h170{height:1.7rem;} +.z-h180{height:1.8rem;}.z-h190{height:1.9rem;} +.z-h200{height:2rem;}.z-h300{height:3rem;} +.z-h400{height:4rem;}.z-h500{height:5rem;} + +.zi-h0{height:0 !important;} +... +.zi-h400{height:4rem !important;}.zi-h500{height:5rem !important;} + +.z-h5p{height:5%;}.z-h8p{height:8%;} +.z-h10p{height:10%;}.z-h12p{height:12%;} +.z-h15p{height:15%;}.z-h20p{height:20%;} +.z-h30p{height:30%;}.z-h40p{height:40%;} +.z-h50p{height:50%;}.z-h60p{height:60%;} +.z-h70p{height:70%;}.z-h80p{height:80%;} +.z-h90p{height:90%;}.z-h100p{height:100%;} + +.zi-h5p{height:5% !important;}.zi-h8p{height:8% !important;} +... +.zi-h90p{height:90% !important;}.zi-h100p{height:100% !important;} + +
            + +<#-- 行高 --> +
            行高
            +
            +
              +
            • 原 ZhiqimUI 中的定义具体数值的 z-lh*,如: z-lh15;统一改成用 z- 前缀,单位为 rem,如:z-lh15。
            • +
            • 原 ZhiqimUI 中的定义百分比的 z-lh100p、zi-lh50p 保留。
            • +
            + +.z-lh0{line-height:0;}.z-lh10{line-height:.1rem;} +.z-lh12{line-height:.12rem;}.z-lh14{line-height:.14rem;} +.z-lh15{line-height:.15rem;}.z-lh16{line-height:.16rem;} +.z-lh18{line-height:.18rem;}.z-lh20{line-height:.2rem;} +.z-lh22{line-height:.22rem;}.z-lh24{line-height:.24rem;} +.z-lh25{line-height:.25rem;}.z-lh28{line-height:.28rem;} +.z-lh30{line-height:.3rem;}.z-lh32{line-height:.32rem;} +.z-lh35{line-height:.35rem;}.z-lh40{line-height:.4rem;} +.z-lh45{line-height:.45rem;}.z-lh50{line-height:.5rem;} +.z-lh55{line-height:.55rem;}.z-lh60{line-height:.6rem;} +.z-lh70{line-height:.7rem;}.z-lh80{line-height:.8rem;} +.z-lh90{line-height:.9rem;}.z-lh100{line-height:1rem;} + +.zi-lh0{line-height:0 !important;}.zi-lh10{line-height:.1rem !important;} +... +.zi-lh90{line-height:.9rem !important;}.zi-lh100{line-height:1rem !important;} + +.z-lh100p{line-height:100%;}.z-lh110p{line-height:110%;} +.z-lh120p{line-height:120%;}.z-lh130p{line-height:130%;} +.z-lh140p{line-height:140%;}.z-lh150p{line-height:150%;} +.z-lh180p{line-height:180%;}.z-lh200p{line-height:200%;} +.z-lh250p{line-height:250%;}.z-lh300p{line-height:300%;} + +.zi-lh100p{line-height:100% !important;}.zi-lh110p{line-height:110% !important;} +.zi-lh120p{line-height:120% !important;}.zi-lh130p{line-height:130% !important;} +.zi-lh140p{line-height:140% !important;}.zi-lh150p{line-height:150% !important;} +.zi-lh180p{line-height:180% !important;}.zi-lh200p{line-height:200% !important;} +.zi-lh250p{line-height:250% !important;}.zi-lh300p{line-height:300% !important;} + +
            + +<#-- 内边距和外边距 --> +
            内边距和外边距
            +
            +
              +
            • 原 ZhiqimUI 中的定义具体数值的 z-pd*、z-pd-l*、z-mg*、z-mg-r* ,如: z-pd5、z-pd-l5、z-mg10、z-mg-t-10;统一改成用 z- 前缀,单位为 rem。
            • +
            • 新增 z-pd-lr*、z-pd-tb*、z-mg-lr*、z-mg-tb* 表示左右、上下的边距统一设置。
            • +
            • 针对 1px 边框,可能存在的 负偏移,新增 z-mg-t-1px 表示向上偏移 -1px;left、right、bottom方向同理。
            • +
            • 外边距新增 auto属性。
            • +
            + +.z-pd0{padding:0;}.z-pd1{padding:.01rem;} +.z-pd2{padding:.02rem;}.z-pd3{padding:.03rem;} +.z-pd4{padding:.04rem;}.z-pd5{padding:.05rem;} +.z-pd6{padding:.06rem;}.z-pd7{padding:.07rem;} +.z-pd8{padding:.08rem;}.z-pd9{padding:.09rem;} +.z-pd10{padding:.1rem;}.z-pd12{padding:.12rem;} +.z-pd14{padding:.14rem;}.z-pd15{padding:.15rem;} +.z-pd16{padding:.16rem;}.z-pd18{padding:.18rem;} +.z-pd20{padding:.2rem;}.z-pd24{padding:.24rem;} +.z-pd25{padding:.25rem;}.z-pd26{padding:.25rem;} +.z-pd28{padding:.28rem;}.z-pd30{padding:.3rem;} + +.zi-pd0{padding:0 !important;}.zi-pd1{padding:.01rem !important;} +... +.zi-pd28{padding:.28rem !important;}.zi-pd30{padding:.3rem !important;} + +.z-pd-l0{padding-left:0;}.z-pd-l1{padding-left:.01rem;} +.z-pd-l2{padding-left:.02rem;}.z-pd-l3{padding-left:.03rem;} +.z-pd-l4{padding-left:.04rem;}.z-pd-l5{padding-left:.05rem;} +.z-pd-l6{padding-left:.06rem;}.z-pd-l7{padding-left:.07rem;} +.z-pd-l8{padding-left:.08rem;}.z-pd-l9{padding-left:.09rem;} +.z-pd-l10{padding-left:.1rem;}.z-pd-l12{padding-left:.12rem;} +.z-pd-l14{padding-left:.14rem;}.z-pd-l15{padding-left:.15rem;} +.z-pd-l16{padding-left:.16rem;}.z-pd-l18{padding-left:.18rem;} +.z-pd-l20{padding-left:.2rem;}.z-pd-l24{padding-left:.24rem;} +.z-pd-l25{padding-left:.25rem;}.z-pd-l26{padding-left:.25rem;} +.z-pd-l28{padding-left:.28rem;}.z-pd-l30{padding-left:.3rem;} + +.zi-pd-l0{padding-left:0 !important;}.zi-pd-l1{padding-left:.01rem !important;} +... +.zi-pd-l28{padding-left:.28rem !important;}.zi-pd-l30{padding-left:.3rem !important;} + +...为省略篇幅,类似代码省略... + +.z-pd-lr0{padding-left:0;padding-right:0;}.z-pd-lr1{padding-left:.01rem;padding-right:.01rem;} +.z-pd-lr2{padding-left:.02rem;padding-right:.02rem;}.z-pd-lr3{padding-left:.03rem;padding-right:.03rem;} +.z-pd-lr4{padding-left:.04rem;padding-right:.04rem;}.z-pd-lr5{padding-left:.05rem;padding-right:.05rem;} +.z-pd-lr6{padding-left:.06rem;padding-right:.06rem;}.z-pd-lr7{padding-left:.07rem;padding-right:.07rem;} +.z-pd-lr8{padding-left:.08rem;padding-right:.08rem;}.z-pd-lr9{padding-left:.09rem;padding-right:.09rem;} +.z-pd-lr10{padding-left:.1rem;padding-right:.1rem;}.z-pd-lr12{padding-left:.12rem;padding-right:.12rem;} +.z-pd-lr14{padding-left:.14rem;padding-right:.14rem;}.z-pd-lr15{padding-left:.15rem;padding-right:.15rem;} +.z-pd-lr16{padding-left:.16rem;padding-right:.16rem;}.z-pd-lr18{padding-left:.18rem;padding-right:.18rem;} +.z-pd-lr20{padding-left:.2rem;padding-right:.2rem;}.z-pd-lr24{padding-left:.24rem;padding-right:.24rem;} +.z-pd-lr25{padding-left:.25rem;padding-right:.25rem;}.z-pd-lr26{padding-left:.25rem;padding-right:.25rem;} +.z-pd-lr28{padding-left:.28rem;padding-right:.28rem;}.z-pd-lr30{padding-left:.3rem;padding-right:.3rem;} + +.zi-pd-lr0{padding-left:0 !important;padding-right:0 !important;}.zi-pd-lr1{padding-left:.01rem !important;padding-right:.01rem !important;} +... +.zi-pd-lr28{padding-left:.28rem !important;padding-right:.28rem !important;}.zi-pd-lr30{padding-left:.3rem !important;padding-right:.3rem !important;} + +...为省略篇幅,类似代码省略... + +.z-mg-0{margin:0;}.z-mg1{margin:.01rem;} +.z-mg2{margin:.02rem;}.z-mg3{margin:.03rem;} +.z-mg4{margin:.04rem;}.z-mg5{margin:.05rem;} +.z-mg6{margin:.06rem;}.z-mg7{margin:.07rem;} +.z-mg8{margin:.08rem;}.z-mg9{margin:.09rem;} +.z-mg10{margin:.1rem;}.z-mg12{margin:.12rem;} +.z-mg14{margin:.14rem;}.z-mg15{margin:.15rem;} +.z-mg16{margin:.16rem;}.z-mg18{margin:.18rem;} +.z-mg20{margin:.2rem;}.z-mg24{margin:.24rem;} +.z-mg25{margin:.25rem;}.z-mg26{margin:.25rem;} +.z-mg28{margin:.28rem;}.z-mg30{margin:.3rem;} + +.zi-mg0{margin:0 !important;}.zi-mg1{margin:.01rem !important;} +... +.zi-mg28{margin:.28rem !important;}.zi-mg30{margin:.3rem !important;} + +.z-mg-t0{margin-top:0;}.z-mg-t1{margin-top:.01rem;} +.z-mg-t2{margin-top:.02rem;}.z-mg-t3{margin-top:.03rem;} +.z-mg-t4{margin-top:.04rem;}.z-mg-t5{margin-top:.05rem;} +.z-mg-t6{margin-top:.06rem;}.z-mg-t7{margin-top:.07rem;} +.z-mg-t8{margin-top:.08rem;}.z-mg-t9{margin-top:.09rem;} +.z-mg-t10{margin-top:.1rem;}.z-mg-t12{margin-top:.12rem;} +.z-mg-t14{margin-top:.14rem;}.z-mg-t15{margin-top:.15rem;} +.z-mg-t16{margin-top:.16rem;}.z-mg-t18{margin-top:.18rem;} +.z-mg-t20{margin-top:.2rem;}.z-mg-t24{margin-top:.24rem;} +.z-mg-t25{margin-top:.25rem;}.z-mg-t26{margin-top:.25rem;} +.z-mg-t28{margin-top:.28rem;}.z-mg-t30{margin-top:.3rem;} + +.zi-mg-t0{margin-top:0 !important;}.zi-mg-t1{margin-top:.01rem !important;} +... +.zi-mg-t28{margin-top:.28rem !important;}.zi-mg-t30{margin-top:.3rem !important;} + +...为省略篇幅,类似代码省略... + +.z-mg-t-1{margin-top:-.01rem;}.z-mg-t-2{margin-top:-.02rem;} +.z-mg-t-3{margin-top:-.03rem;}.z-mg-t-4{margin-top:-.04rem;} +.z-mg-t-5{margin-top:-.05rem;}.z-mg-t-6{margin-top:-.06rem;} +.z-mg-t-7{margin-top:-.07rem;}.z-mg-t-8{margin-top:-.08rem;} +.z-mg-t-9{margin-top:-.09rem;}.z-mg-t-10{margin-top:-.1rem;} +.z-mg-t-12{margin-top:-.12rem;}.z-mg-t-14{margin-top:-.14rem;} +.z-mg-t-15{margin-top:-.15rem;}.z-mg-t-16{margin-top:-.16rem;} +.z-mg-t-18{margin-top:-.18rem;}.z-mg-t-20{margin-top:-.2rem;} +.z-mg-t-24{margin-top:-.24rem;}.z-mg-t-25{margin-top:-.25rem;} +.z-mg-t-26{margin-top:-.25rem;}.z-mg-t-28{margin-top:-.28rem;} +.z-mg-t-30{margin-top:-.3rem;} + +.zi-mg-t-1{margin-top:-.01rem !important;}.zi-mg-t-2{margin-top:-.02rem !important;} +... +.zi-mg-t-30{margin-top:-.3rem !important;} + +...为省略篇幅,类似代码省略... + +.z-mg-t-1px{margin-top:-1px;} +.z-mg-r-1px{margin-right:-1px;} +.z-mg-l-1px{margin-left:-1px;} +.z-mg-b-1px{margin-bottom:-1px;} + +.zi-mg-t-1px{margin-top:-1px !important;} +.zi-mg-r-1px{margin-right:-1px !important;} +.zi-mg-l-1px{margin-left:-1px !important;} +.zi-mg-b-1px{margin-bottom:-1px !important;} + +.z-mg-auto{margin:auto;} +.z-mg-l-auto{margin-left:auto;} +.z-mg-r-auto{margin-right:auto;} +.z-mg-t-auto{margin-top:auto;} +.z-mg-b-auto{margin-bottom:auto;} +.z-mg-lr-auto{margin-left:auto;margin-right:auto;} +.z-mg-tb-auto{margin-top:auto;margin-bottom:auto;} + +.zi-mg-auto{margin:auto !important;} +.zi-mg-l-auto{margin-left:auto !important;} +.zi-mg-r-auto{margin-right:auto !important;} +.zi-mg-t-auto{margin-top:auto !important;} +.zi-mg-b-auto{margin-bottom:auto !important;} +.zi-mg-lr-auto{margin-left:auto !important;margin-right:auto !important;} +.zi-mg-tb-auto{margin-top:auto !important;margin-bottom:auto !important;} + +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/css/text.htm b/zhiqim_ui/document/tutorial/uim/css/text.htm new file mode 100644 index 0000000..adfc13a --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/css/text.htm @@ -0,0 +1,460 @@ +<#def title = "文本样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "文本样式是指对文本文字增加样式规则,如指定文本粗斜体、文本上下标、文本字体大小、文本行高、文本强制换行、强制不换行、省略隐藏、文本标题属性、文本对齐方式和文本附带的下划线删除线、以及编码突出效果等"/> +<#def prevUrl = "font.htm"/> +<#def nextUrl = "block.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "css", "text")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "全局CSS定义", "文本样式")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            文本样式:

            +

            + 文本样式是指对文本文字增加样式规则,如指定文本粗斜体、文本上下标、文本字体大小、文本行高、文本强制换行、强制不换行、省略隐藏、文本标题属性、文本对齐方式和文本附带的下划线删除线、以及编码突出效果等。 +

            +
            + +<#-- 一、粗斜体上下标和删除线下划线文本 --> +
            一、粗斜体、上下标、删除线、下划线、标记字体、缩写效果等标签样式和定义样式
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            b
            b{font-weight:bold;}
            微软雅黑字体粗体
            i
            i{font-style:italic;}
            微软雅黑字体斜体
            u
            u{text-decoration:underline;}
            带下划线文本效果下划线体
            del
            del{text-decoration:line-through;}
            带删除线文本效果删除线体
            small
            small{font-size:80%;}
            这里是小号文本效果小号体,80%
            sup
            sub,sup {position:relative;vertical-align:baseline;line-height:0;font-size:75%;}
            sup{top:-0.5em;}
            文本上标效果superscript上标
            sub
            sub,sup {position:relative;vertical-align:baseline;line-height:0;font-size:75%;}
            sub{bottom:-0.25em;}
            文本下标效果subscript下标
            mark
            mark{background:#ff0;color:#000;}
            这里是标记字体效果标记体,颜色为通用的黑色+黄底#ffff00
            abbr[title]
            abbr[title]{border-bottom:1px dotted;}
            @-moz-document url-prefix(){abbr[title]{border-bottom:0;}}
            这里是MSYH缩写效果缩写体,显示下划虚线,firefox原来就有,所以要用hack去掉
            .z-bold
            .z-bold{font-weight:bold;}
            这里是字体加粗效果粗体
            .z-italic
            .z-italic{font-style:italic;}
            这里是文本斜体效果斜体
            .z-underline
            .z-underline{text-decoration:underline;}
            带下划线文本效果下划线体
            .z-delline
            .z-delline{text-decoration:line-through;}
            带删除线文本效果删除线体
            .z-weight-normal
            .z-weight-normal{font-weight:normal;}
            粗体正常普通大小
            .z-style-normal
            .z-style-normal{font-style:normal;}
            斜体正常普通样式
            .z-small
            .z-small{font-size:80%;}
            这里是小号文本效果小号体,80%
            .z-sup
            .z-sub,.z-sup {position:relative;vertical-align:baseline;line-height:0;font-size:75%;}.z-sup{top:-0.5em;}
            文本上标效果superscript上标
            .z-sub
            .z-sub,.z-sup {position:relative;vertical-align:baseline;line-height:0;font-size:75%;}.z-sub{bottom:-0.25em;}
            文本下标效果subscript下标
            .z-mark
            .z-mark{background:#ff0;color:#000;}
            这里是标记字体效果标记体,颜色为通用的黑色+黄底#ffff00
            .z-abbr[title]
            .z-abbr[title]{border-bottom:1px dotted;}
            这里是MSYH缩写效果缩写体,显示下划虚线
            + +<#-- 二、文本换行、不换行、省略和隐藏等属性 --> +
            二、文本换行、不换行、省略和隐藏等属性
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            .z-text-break
            .z-text-break{word-break:break-all; word-wrap:break-word;}
            Except as required by law or in writing, the software is provided by the original code, without any express or implied warranties and conditions. See the full license for the rights and restrictions.国人是不管英文是不是单词的,直接换行
            .z-text-pre
            .z-text-pre{white-space:pre;}
            + + 第一行第一行第一行第一行第一行 + 第二行 + 第三行 + + 保留空白符列表,类似于<pre>,每行nowrap,撑大
            .z-text-prewrap
            .z-text-prewrap{white-space:pre-wrap;}
            + + 第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行
            + 第二行
            + 第三行
            +
            +
            保留空白符列表,超时自动换行。
            .z-text-preline
            .z-text-preline{white-space:pre-line;}
            + + 第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行第一行
            + 第二行
            + 第三行
            +
            +
            合并空白符列表,但是保留换行符。如果第一个字符是\n,<pre>会清理,.z-text-preline不会,需借助JS删除该字符,:first-line设置行高为0时IE/Webkit可以,Firefox不行
            .z-text-nowrap
            .z-text-nowrap{white-space:nowrap;}
            Except as required by law or in writing, the so不换行,会把td撑大,直到遇到
            标签为止。
            .z-text-ellipsis
            .z-text-ellipsis{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:inline-block;}
            Except as required by law or in writing, the software is provided by the original code, without any express or implied warranties and conditions. See the full license for the rights and restrictions.超过的显示省略号,缺点是必须指定宽度,且只能是一行
            + .z-text-ellipsis
            + .z-text-ellipsis-line
            + .z-text-ellipsis-2line
            + .z-text-ellipsis-3line
            +
            .z-text-ellipsis{text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;word-break:break-word;-webkit-line-clamp:1;}
            Except as required by law or in writing, the software is provided by the original code, without any express or implied warranties and conditions. See the full license for the rights and restrictions. + 超过的显示省略号,为展示效果,最好依需要显示的行数指定行高、高度
            + 因PC端兼容性较差,仅在 ZmUI 中定义 +
            .z-text-clip
            .z-text-clip{text-overflow:clip;overflow:hidden;white-space:nowrap;display:inline-block;}
            Except as required by law or in writing, the software is provided by the original code, without any express or implied warranties and conditions. See the full license for the rights and restrictions.超过的省略也不显示省略号,缺点是必须指定宽度,且只能是一行
            + + +<#-- 三、正文文本对齐方式 --> +
            三、正文文本对齐方式,其中z-为常用,zi-为优先
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            .z-text-left
            .z-text-left{text-align:left;}
            文本左对齐
            文本左对齐
            左对齐
            .z-text-center
            .z-text-center{text-align:center;}
            文本居中对齐
            文本居中对齐
            居中对齐
            .z-text-right
            .z-text-right{text-align:right;}
            文本右对齐
            文本右对齐
            右对齐
            以下为文本对齐优先
            .zi-text-left
            .zi-text-left{text-align:left !important;}
            文本左对齐
            文本左对齐
            左对齐
            .zi-text-center
            .zi-text-center{text-align:center !important;}
            文本居中对齐
            文本居中对齐
            居中对齐
            .zi-text-right
            .zi-text-right{text-align:right !important;}
            文本右对齐
            文本右对齐
            右对齐
            + + +<#-- ;四、标题样式(h1-h3) --> +
            四、标题样式(h1-h3)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            h1
            h1{font-size:2em;margin:.67em 0;}

            微软雅黑字体,24号字体
            微软雅黑字体,24号字体

            H1字体,上下边距14px
            h2
            h2{font-size:1.5em;margin:.83em 0;}

            微软雅黑字体,22号字体
            微软雅黑字体,22号字体

            H2字体,上下边距14px
            h3
            h3{font-size:1.17em;margin:1em 0;}

            微软雅黑字体,20号字体
            微软雅黑字体,22号字体

            H3字体,上下边距14px
            .z-h1
            .z-h1{font-size:0.32rem;line-height:normal;font-weight:bold;display:block;margin:0.2rem 0;}
            微软雅黑字体,24号字体
            微软雅黑字体,24号字体
            模拟H1,当H1被覆盖时可以使用z-h1
            .z-h2
            .z-h2{font-size:0.24rem;line-height:normal;font-weight:bold;display:block;margin:0.19rem 0;}
            微软雅黑字体,22号字体
            微软雅黑字体,22号字体
            模拟H2,当H2被覆盖时可以使用z-h2
            .z-h3
            .z-h3{font-size:0.18rem;line-height:normal;font-weight:bold;display:block;margin:0.18rem 0;}
            微软雅黑字体,20号字体
            微软雅黑字体,20号字体
            模拟H3,当H3被覆盖时可以使用z-h3
            + +<#-- 五、文本编码样式 --> +
            五、文本编码样式(编码字体依次查找Consolas,"Courier New",monospace,Menlo,Monaco,"微软雅黑")
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            名称样式举例说明
            samp
            .z-samp
            +
            +        samp,.z-samp{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}
            +    
            +
            + samp{font-family:"Courier New"}

            + .z-samp{border-radius:4px;} +
            无背景编码字体
            kbd
            .z-kbd
            +
            +        kbd,.z-kbd{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}
            +        kbd,.z-kbd{border-radius:4px;}
            +        kbd,.z-kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.25);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.25);}
            +    
            +
            + kbd{font-family:"Courier New"}

            + .z-kbd{border-radius:4px;} +
            黑背景白字键盘输入字体
            pre
            .z-pre
            +
            +        pre{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}
            +        pre{border-radius:4px;}
            +        pre{overflow:auto;display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #cccccc;}
            +        pre code{padding:0;font-size:inherit;color:#c7254e;white-space:pre-wrap;background-color:transparent;border-radius:0;}
            +    
            +
            +
            +        pre{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}
            +    
            + .z-pre{border-radius:4px;} +
            预处理标记,默认是单行撑大、留白,这里增加了.z-text-preline,改为单行换行,留白合并

            显示红色的为里面使用<code>封装
            code
            .z-code
            +
            +        code,.z-code{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}
            +        code,.z-code{border-radius:4px;}
            +        code,.z-code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;}
            +        pre code,.z-pre .z-code{padding:0;font-size:inherit;color:#c7254e;white-space:pre-wrap;background-color:transparent;border-radius:0;}
            +    
            +
            + code{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}

            + .z-code{font-family:Consolas,"Courier New",monospace,Menlo,Monaco;font-size:1em;}

            + code{border-radius:4px;} +
            编码标记,默认是自动换行,且不保留空白

            外边框是在显示红色的为使用<pre>内进行封装
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/dialog/alert.htm b/zhiqim_ui/document/tutorial/uim/dialog/alert.htm new file mode 100644 index 0000000..da100de --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/dialog/alert.htm @@ -0,0 +1,200 @@ +<#def title = "警告对话框"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "警告对话框是自定义对话框的一种参考alert方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的警告对话框,支持设置警告内容和点击确定后回调函数。"/> +<#def prevUrl = "../form/checkInput.htm"/> +<#def nextUrl = "confirm.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "dialog", "alert")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "对话框", "警告对话框")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            警告对话框:

            +

            + 警告对话框是自定义对话框的一种参考alert方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的警告对话框,支持设置警告内容和点击确定后回调函数。 +

            +
            + +<#-- 一、弹出警告(仅文本,无回调函数和参数) --> +
            一、弹出警告(仅文本,无回调函数和参数)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个告警的对话框 +
            +
            +
            + +<#-- 二、弹出警告(文本,回调函数和有背景参数) --> +
            二、弹出警告(文本,回调函数和有背景参数)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个告警的对话框
            + 2、点击确定后回调函数
            + 3、设置有背景 +
            +
            +
            + +<#-- 三、弹出警告(文本,回调函数和指定高度参数) --> +
            三、弹出警告(文本,回调函数和指定高度参数)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个告警的对话框
            + 2、点击确定后回调函数
            + 3、指定对话框高度
            +
            +
            +
            + +<#-- 警告对话框参数说明 --> +
            警告对话框参数说明(基本参数两个,混合参数三个)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数说明
            基本参数
            text必填警告文本,显示在对话框中的内容
            callback可选警告点击确定之后回调函数
            混合参数,通过函数第三个参数param组合
            param.width{width:330}警告对话框宽度
            param.height指定或计算得到值警告对话框高度,可指定高度,未指定高度时,通过文本字数计算出大概高度
            param.hasBackground{hasBackground:false}警告对话框是否显示背景
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/dialog/confirm.htm b/zhiqim_ui/document/tutorial/uim/dialog/confirm.htm new file mode 100644 index 0000000..c5de253 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/dialog/confirm.htm @@ -0,0 +1,204 @@ +<#def title = "询问对话框"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "询问对话框是自定义对话框的一种参考confirm方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的确认对话框,支持设置确认内容和点击确定后回调函数,点击取消不向下处理。"/> +<#def prevUrl = "alert.htm"/> +<#def nextUrl = "prompt.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "dialog", "confirm")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "对话框", "询问对话框")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            询问对话框:

            +

            + 询问对话框是自定义对话框的一种参考confirm方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的确认对话框,支持设置确认内容和点击确定后回调函数,点击取消不向下处理。 +

            +
            + +<#-- 一、弹出确认对话框(文本和回调函数) --> +
            一、弹出确认对话框(文本和回调函数)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个确认的对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数 +
            +
            +
            + +<#-- 二、弹出确认对话框(文本、回调函数和显示背景) --> +
            二、弹出确认对话框(文本、回调函数和显示背景)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个确认的对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数
            + 4、设置有背景 +
            +
            +
            + +<#-- 三、弹出确认对话框(文本、回调函数和指定高度) --> +
            三、弹出确认对话框(文本、回调函数和指定高度)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个确认的对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数
            + 4、指定对话框高度
            +
            +
            +
            + +<#-- 确认对话框参数说明 --> +
            确认对话框参数说明(基本参数两个,混合参数三个)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数说明
            基本参数
            text必填确认文本,显示在对话框中的内容
            callback可选确认点击确定之后回调函数
            混合参数,通过函数第三个参数param组合
            param.width{width:330}确认对话框宽度
            param.height指定或计算得到值确认对话框高度,可指定高度,未指定高度时,通过文本字数计算出大概高度
            param.hasBackground{hasBackground:false}确认对话框是否显示背景
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/dialog/dialog_url.htm b/zhiqim_ui/document/tutorial/uim/dialog/dialog_url.htm new file mode 100644 index 0000000..0db308c --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/dialog/dialog_url.htm @@ -0,0 +1,35 @@ + + + +凡狐管理控制台 + +${Styles.src("/src/zhiqim.css")} +${Scripts.src("/src/zhiqim.js")} +${Scripts.src("/src/zhiqim_static.js")} +${Scripts.src("/src/zhiqim_static_util.js")} +${Scripts.src("/src/zhiqim_query.js")} +${Scripts.src("/src/zhiqim_md5.js")} +${Scripts.src("/src/zhiqim_dialog.js")} +${Scripts.src("/src/zhiqim_ajax.js")} +${Scripts.src("/src/zhiqim_calendar.js")} +${Scripts.src("/src/zhiqim_clipboard.js")} +${Scripts.src("/src/zhiqim_coder.js")} +${Scripts.src("/src/zhiqim_form.js")} +${Scripts.src("/src/zhiqim_drag.js")} +${Scripts.src("/src/zhiqim_dropdown.js")} +${Scripts.src("/src/zhiqim_tabnav.js")} +${Scripts.src("/src/zhiqim_floater.js")} +${Scripts.src("/src/zhiqim_editable.js")} +${Scripts.src("/src/zhiqim_upload.js")} +${Scripts.src("/src/zhiqim_uploadmult.js")} +${Scripts.src("/src/zhiqim_uploadlarge.js")} + + + diff --git a/zhiqim_ui/document/tutorial/uim/dialog/dialog_url2.htm b/zhiqim_ui/document/tutorial/uim/dialog/dialog_url2.htm new file mode 100644 index 0000000..aacbaeb --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/dialog/dialog_url2.htm @@ -0,0 +1,29 @@ + + + +${context.getContextName()} +${Styles.src(zhiqim.css)} +${Styles.htmlOverflowYScroll()} + + + + +
            + + + + + + + + + + + + + +
            ${context.getContextName()}
            登录名:
            密   码:
            + +
            + + \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/dialog/loading.htm b/zhiqim_ui/document/tutorial/uim/dialog/loading.htm new file mode 100644 index 0000000..f264127 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/dialog/loading.htm @@ -0,0 +1,247 @@ +<#def title = "加载对话框"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "加载对话框是自定义对话框的一种没有标题只有加载中提示的对话框。目标是在屏幕或用户指定的元素可视范围的中间提供没有警告声音且美观的加载对话框,支持设置九个参数来定义加载中界面,无关闭按钮,由业务实现关闭。"/> +<#def prevUrl = "prompt.htm"/> +<#def nextUrl = "tips.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "dialog", "loading")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "对话框", "加载对话框")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            加载对话框:

            +

            + 加载对话框是自定义对话框的一种没有标题只有加载中提示的对话框。目标是在屏幕或用户指定的元素可视范围的中间提供没有警告声音且美观的加载对话框,支持设置九个参数来定义加载中界面,无关闭按钮,由业务实现关闭。 +

            +
            + +<#-- 一、弹出全屏加载器,无遮罩层 --> +
            一、弹出全屏加载器,无遮罩层
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个正在加载的对话框
            + 2、无遮罩层 +
            +
            +
            + +<#-- 二、弹出全屏加载器,有遮罩层 --> +
            二、弹出全屏加载器,有遮罩层
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个正在加载的对话框
            + 2、全屏遮罩,不允许操作 +
            +
            +
            + +<#-- 三、弹出全屏加载器,指定区域加载器 --> +
            三、弹出全屏加载器,指定区域加载器
            + +
            + +
            + +
            + +
            +
            + 1、指定位置遮罩,超出屏幕情况,遮罩目标,不允许操作
            + 2、在可视中间显示正在加载的对话框 +
            +
            +
            + +<#-- 四、弹出全屏加载器,指定区域加载器,超出屏幕情况 --> +
            四、弹出全屏加载器,指定区域加载器,超出屏幕情况
            + +
            + +
            + +
            + +
            +
            + 1、指定位置遮罩,超出屏幕情况,遮罩目标,不允许操作
            + 2、在可视中间显示正在加载的对话框 +
            +
            +
            + +<#-- 加载对话框参数说明 --> +
            加载对话框参数说明(混合参数九个)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数说明
            混合参数
            param.radius{radius:"z-bd-rd5"}圆角,默认5像素
            param.background{background:"#fff"}背景颜色,默认白色
            param.text{text:"正在加载..."}加载中提示文本
            param.target{target:document}遮罩目标,默认document
            param.position未配置默认居中目标位置,参见自定义对话框位置说明
            param.shadow{shadow:false}是否显示遮罩层
            param.borderColor{borderColor:"#d8d8d8"}边框颜色,默认"#d8d8d8"
            param.width{width:150}加载框宽度
            param.height{height:50}加载框高度
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/dialog/prompt.htm b/zhiqim_ui/document/tutorial/uim/dialog/prompt.htm new file mode 100644 index 0000000..3987635 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/dialog/prompt.htm @@ -0,0 +1,216 @@ +<#def title = "提示对话框"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "提示对话框是自定义对话框的一种参考prompt方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的提示对话框,支持设置提示内容和点击确定后回调函数,点击取消不向下处理。"/> +<#def prevUrl = "confirm.htm"/> +<#def nextUrl = "loading.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "dialog", "prompt")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "对话框", "提示对话框")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            提示对话框:

            +

            + 提示对话框是自定义对话框的一种参考prompt方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的提示对话框,支持设置提示内容和点击确定后回调函数,点击取消不向下处理。 +

            +
            + +<#-- 一、弹出单行提示对话框(文本和回调函数) --> +
            一、弹出单行提示对话框(文本和回调函数)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个提示单行对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数 +
            +
            +
            + +<#-- 二、弹出多行提示对话框(文本、回调函数和类型参数) --> +
            二、弹出多行提示对话框(文本、回调函数和类型参数)
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个提示单行对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数
            + 4、指定类型type=textarea +
            +
            +
            + + +<#-- 三、弹出多行提示对话框(回调把内容设置到文本域中) --> +
            三、弹出多行提示对话框(回调把内容设置到文本域中)
            + +
            + +
            +
            + 点我弹出多行提示对话框 +

            + +
            +
            + +
            +
            + 1、在全屏的中间显示一个提示单行对话框
            + 2、当选择取消时,不向下处理
            + 3、当选择确定时,进入回调函数
            + 4、指定类型type=textarea
            + 5、点确定把值回填到文本域中 +
            +
            +
            + +<#-- 提示对话框参数说明 --> +
            提示对话框参数说明(基本参数三个,混合参数四个)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数说明
            基本参数
            text必填提示信息,显示在对话框中的提示
            value必填提示值,显示在对话框中的内容
            callback可选提示点击确定之后回调函数
            混合参数,通过函数第三个参数param组合
            param.width{width:330}提示对话框宽度
            param.height指定或计算得到值提示对话框高度,可指定高度,未指定高度时,通过文本字数计算出大概高度
            param.hasBackground{hasBackground:false}提示对话框是否显示背景
            param.type{type:"input"}提示对话框内容是使用"input"还是"textarea",默认"input"
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/dialog/tips.htm b/zhiqim_ui/document/tutorial/uim/dialog/tips.htm new file mode 100644 index 0000000..84b595d --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/dialog/tips.htm @@ -0,0 +1,248 @@ +<#def title = "提示对话框"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "提示对话框是自定义对话框的一种参考prompt方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的提示对话框,支持设置提示内容和点击确定后回调函数,点击取消不向下处理。"/> +<#def prevUrl = "loading.htm"/> +<#def nextUrl = "../nav/tabnav.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "dialog", "tips")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "对话框", "提示对话框")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            提示对话框:

            +

            + 提示对话框是自定义对话框的一种提示成功之后5秒后自动关闭的对话框。目标是不需要点击确认和关闭,自动隐藏 +

            +
            + + +<#-- 一、弹出全屏提示框,无遮罩层 --> +
            一、弹出全屏提示框,无遮罩层
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个正在加载的对话框
            + 2、无遮罩层 +
            +
            +
            + +<#-- 二、弹出全屏加载器,有遮罩层 --> +
            二、弹出全屏加载器,有遮罩层
            + +
            + +
            + +
            + +
            +
            + 1、在全屏的中间显示一个正在加载的对话框
            + 2、全屏遮罩,不允许操作 +
            +
            +
            + +<#-- 三、弹出全屏加载器,指定区域加载器 --> +
            三、弹出全屏加载器,指定区域加载器
            + +
            + +
            + +
            + +
            +
            + 1、指定位置遮罩,超出屏幕情况,遮罩目标,不允许操作
            + 2、在可视中间显示正在加载的对话框 +
            +
            +
            + +<#-- 四、弹出全屏加载器,指定区域加载器,超出屏幕情况 --> +
            四、弹出全屏加载器,指定区域加载器,超出屏幕情况
            + +
            + +
            + +
            + +
            +
            + 1、指定位置遮罩,超出屏幕情况,遮罩目标,不允许操作
            + 2、在可视中间显示正在加载的对话框 +
            +
            +
            + +<#-- 加载对话框参数说明 --> +
            加载对话框参数说明(混合参数九个)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数说明
            混合参数
            param.radius{radius:"z-bd-rd5"}圆角,默认5像素
            param.background{background:"#fff"}背景颜色,默认白色
            param.text{text:"正在加载..."}加载中提示文本
            param.target{target:document}遮罩目标,默认document
            param.position未配置默认居中目标位置,参见自定义对话框位置说明
            param.shadow{shadow:false}是否显示遮罩层
            param.borderColor{borderColor:"#d8d8d8"}边框颜色,默认"#d8d8d8"
            param.width{width:150}加载框宽度
            param.height{height:50}加载框高度
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/form/autoInput.htm b/zhiqim_ui/document/tutorial/uim/form/autoInput.htm new file mode 100644 index 0000000..6b40fed --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/form/autoInput.htm @@ -0,0 +1,453 @@ +<#def title = "输入框样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "输入框样式是指对输入框增加样式规则,如指定输入框长度大小、边框颜色、和输入控制等。"/> +<#def prevUrl = "../js/query.htm"/> +<#def nextUrl = "button.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "form", "input")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "表单", "输入框")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            自动提示关键字:

            +

            + 输入内容,匹配数据库显示可选项;支持键盘“上”、“下”键选择,鼠标、“回车”选中 +

            +
            + +<#-- 一、自动提示关键字 --> +
            一、纯文本框,不显示历史记录、显示高度为5条选框高度
            +
            + +
            +
            + +
            +
            + +
            + +
            + 1、前三个参数为必填项,缺一不可
            + 2、Ajax的回调结果为字符串型,字符的分隔符号由类方法决定
            + 3、splitType 为可选项,默认值为 “;”,字符的分隔符号不为 “;” 时需要定义
            +
            +
            +
            二、带按钮的搜索框,显示历史记录,显示高度为10条选项高度
            +
            + +
            +
            + + + +
            +
            + +
            + +
            + 1、前三个参数为必填项,缺一不可
            + 2、Ajax的回调结果为字符串型,字符的分隔符号由类方法决定
            + 3、splitType 为可选项,默认值为 “;”,字符的分隔符号不为 “;” 时需要定义
            + 4、callback 为可选项,表示选中后需要做的操作,默认值为 “null”,this 为定义的 Z.SearchAutoList 本身
            + 5、callback 函数中可用到的值:this.value 为输入框内容,this.responseText 为返回的搜索结果字符串 +
            +
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} + + diff --git a/zhiqim_ui/document/tutorial/uim/form/button.htm b/zhiqim_ui/document/tutorial/uim/form/button.htm new file mode 100644 index 0000000..c5e890f --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/form/button.htm @@ -0,0 +1,742 @@ +<#def title = "按钮样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "按钮样式是指对按钮增加样式规则,按钮分为三种,一是标准按钮、二为筛选按钮、三是多选按钮。样式规则包括按钮大小、颜色、边框颜色、选中特效等。"/> +<#def prevUrl = "input.htm"/> +<#def nextUrl = "calendar.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "form", "button")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "表单", "按钮")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            按钮样式:

            +

            + 按钮样式是指对按钮增加样式规则,按钮分为三种,一是标准按钮、二为筛选按钮、三是多选按钮。样式规则包括按钮大小、颜色、边框颜色、选中特效等。 +

            +
            + +<#-- 一、标准按钮 --> +
            一、标准按钮(标准大小)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 二、标准按钮(大号) --> +
            二、标准按钮(大号)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 三、标准按钮(加大) --> +
            三、标准按钮(加大)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 四、标准按钮(小号) --> +
            四、标准按钮(小号)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 五、标准按钮(加小) --> +
            五、标准按钮(加小)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 六、筛选按钮(标准大小) --> +
            六、筛选按钮(标准大小)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 七、多选按钮(标准大小) --> +
            七、多选按钮(标准大小)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 八、多选按钮(大号) --> +
            八、多选按钮(大号)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 九、多选按钮(加大) --> +
            九、多选按钮(加大)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            红色
            橙色
            黄色
            绿色
            青色
            蓝色
            紫色
            + +<#-- 十、删除按钮列表 --> +
            十、删除按钮列表
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未选中未选中代码已选中未选中代码
            默认
            默认
            默认
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/form/calendar.htm b/zhiqim_ui/document/tutorial/uim/form/calendar.htm new file mode 100644 index 0000000..2f39b3b --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/form/calendar.htm @@ -0,0 +1,157 @@ +<#def title = "日历控件"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "日历控件是在输入框触发时展开一个年月日时分秒的日期界面,按日历格式显示出来,通过点击和选择得到要求的日期或时间。当前日历控件支持选择日期、选择日期+时间、选择日期+时分三种。"/> +<#def prevUrl = "button.htm"/> +<#def nextUrl = "checkInput.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "form", "calendar")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "表单", "日历控件")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            日历控件:

            +

            + 日历控件是在输入框触发时展开一个年月日时分秒的日期界面,按日历格式显示出来,通过点击和选择得到要求的日期或时间。当前日历控件支持选择日期、选择日期+时间、选择日期+时分三种。 +

            +
            + +<#-- 一、日期选择器 --> +
            一、日期选择器
            + + + + + + + + + + + + + + + + + + + + + + +
            类型事例代码
            最简单的方式
            有默认值
            有默认值和onchange方法
            + +<#-- 二、日期+时间选择器 --> +
            二、日期+时间选择器
            + + + + + + + + + + + + + + + + + + + + + + +
            类型未指定代码
            最简单的方式
            有默认值
            有默认值和onchange方法
            + +<#-- 三、日期+时分选择器 --> +
            三、日期+时分选择器
            + + + + + + + + + + + + + + + + + + + + + + +
            类型未指定代码
            最简单的方式
            有默认值
            有默认值和onchange方法
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/form/checkInput.htm b/zhiqim_ui/document/tutorial/uim/form/checkInput.htm new file mode 100644 index 0000000..dd7b38a --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/form/checkInput.htm @@ -0,0 +1,184 @@ +<#def title = "日历控件"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "日历控件是在输入框触发时展开一个年月日时分秒的日期界面,按日历格式显示出来,通过点击和选择得到要求的日期或时间。当前日历控件支持选择日期、选择日期+时间、选择日期+时分三种。"/> +<#def prevUrl = "calendar.htm"/> +<#def nextUrl = "../dialog/dialog.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "form", "checkInput")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "表单", "选择按钮")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            选中按钮:

            +

            + 选中按钮,包括单选框、多选框、切换按钮;采用 :before 、:after 伪类元素实现,尽可能的减少代码量,而且做到手机上较好的兼容性,因为 input 伪类在桌面端 firefox、edge 不兼容。 +

            +
            + +<#-- 一、单选框 --> +
            一、单选框
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型事例代码
            超小
            小型
            默认
            大型
            超大
            + +<#-- 二、多选框 --> +
            二、多选框
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未指定代码
            超小
            小型
            默认
            大型
            超大
            + +<#-- 三、切换按钮 --> +
            三、切换按钮
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型未指定代码
            超小
            小型
            默认
            大型
            超大
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/form/input.htm b/zhiqim_ui/document/tutorial/uim/form/input.htm new file mode 100644 index 0000000..542dfef --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/form/input.htm @@ -0,0 +1,203 @@ +<#def title = "输入框样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "输入框样式是指对输入框增加样式规则,如指定输入框长度大小、边框颜色、和输入控制等。"/> +<#def prevUrl = "../js/query.htm"/> +<#def nextUrl = "button.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "form", "input")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "表单", "输入框")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            输入框样式:

            +

            + 输入框样式是指对输入框增加样式规则,如指定输入框长度大小、边框颜色、和输入控制等。 +

            +
            + +<#-- 一、输入框长度大小样式 --> +
            一、输入框长度大小样式(默认边框灰色)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型效果预览代码
            默认input样式
            加大尺寸input
            大尺寸input
            小尺寸input
            加小尺寸input
            + +<#-- 二、输入框选中时颜色 --> +
            二、输入框选中时颜色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型效果预览代码
            触发边框为红色
            触发边框为橙色
            触发边框为黄色
            触发边框为绿色
            触发边框为青色
            触发边框为蓝色
            触发边框为紫色
            + +<#-- 三、输入框输入控制 --> +
            三、输入框输入控制
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            说明验证效果预览
            只允许输入数值型:
            只允许输入整型:
            只允许输入整数小数:
            只允许输入字母:
            只允许最多2位小数的金额:
            只允许输入折扣类型:
            只允许小时分钟格式(00:23):
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/form/input_group.htm b/zhiqim_ui/document/tutorial/uim/form/input_group.htm new file mode 100644 index 0000000..40ec76b --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/form/input_group.htm @@ -0,0 +1,271 @@ +<#def title = "输入框样式"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "输入框样式是指对输入框增加样式规则,如指定输入框长度大小、边框颜色、和输入控制等。"/> +<#def prevUrl = "../js/query.htm"/> +<#def nextUrl = "button.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + +
            + +${zhiqim_com_container_ui("ZmUI", "form", "input")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "表单", "输入框")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            输入框样式:

            +

            + 输入框样式是指对输入框增加样式规则,如指定输入框长度大小、边框颜色、和输入控制等。 +

            +
            + +<#-- 一、输入框长度大小样式 --> +
            一、输入框长度大小样式(默认边框灰色)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型效果预览代码
            默认input样式
            加大尺寸input
            大尺寸input
            小尺寸input
            加小尺寸input
            + +<#-- 二、输入框选中时颜色 --> +
            二、输入框选中时颜色
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            类型效果预览代码
            触发边框为红色
            触发边框为橙色
            触发边框为黄色
            触发边框为绿色
            触发边框为青色
            触发边框为蓝色
            触发边框为紫色
            + + +<#-- 三、输入框联合体 --> +
            三、输入框联合体
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            说明验证效果预览
            指示图标前置
            指示图标后置
            指示图标两边
            指示图标置中
            加大尺寸
            大尺寸
            小尺寸
            加小尺寸
            + +<#-- 四、输入框输入控制 --> +
            四、输入框输入控制
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            说明验证效果预览
            只允许输入数值型:
            只允许输入整型:
            只允许输入整数小数:
            只允许输入字母:
            只允许最多2位小数的金额:
            只允许输入折扣类型:
            只允许小时分钟格式(00:23):
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/index.htm b/zhiqim_ui/document/tutorial/uim/index.htm new file mode 100644 index 0000000..9adaa8b --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/index.htm @@ -0,0 +1,265 @@ +<#def title = "ZhiqimUI"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "“ZhiqimUI”是一套集成Javascript库、Css库、Font库、常用ico图标和Flash控件等,并在其上开发的大量UI组件组成的前端开发套件。"/> +<#def prevUrl = "../index.htm"/> +<#def nextUrl = "./css/css.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "index", "")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "", "")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            什么是“ZmUI”

            +

            + “ZmUI”是“ZhiqimUI.mobile”的简写,是在“ZhiqimUI”的基础上进行修改、优化得到的一套更适用于mobile端的前端开发套件。
            + 1、使用方法同“ZhiqimUI”。
            + 2、ZhiqimUI中通用的css样式仍使用z-、zi-前缀;mobile端新增的css样式,则统一使用z-前缀约束。
            + 3、mobile端专用的插件库后续也会持续增加。
            +

            +
            + +<#-- ZmUI目录结构 --> +
            ZmUI目录结构
            +
            + zhiqim_res.jar +
              +
            • font
            • +
            • zhiqim.woff
            • +
            • image
            • +
            • ico_12.png
            • +
            • ......
            • +
            • ico_tree.png
            • +
            • zhiqim.mobile_2017010101.css
            • +
            • zhiqim.mobile_2017010101.min.js
            • +
            +
            +
            +
              +
            • + ZhiqimUI统一打包成[zhiqim_res.jar]。包括font、image和核心的css、js文件。
              + 类路径为:com.zhiqim.zhiqim.httpd.context.service.resource +
            • +
            • 目录[font]存放的是z-font对应的字体文件,如等。
            • +
            • 目录[image]存放的CSS和插件常用到的一些图标素材,如文件图标、箭头图标等。
            • +
            • 文件[zhiqim.mobile_2017010101.css]是CSS核心库,为方便查找支持的样式,目前只作了空格处理,没有作最大压缩,其中2017010101是版本号,升级会变动。
            • +
            • 文件[zhiqim.mobile_2017010101.min.js]是JS核心库,原文件比较大,压缩后大约100K左右,如需查看API或源文件,在文档中查看,其中2017010101是版本号,升级会变动。
            • +
            +
            + +<#-- 看一段简单的FTML代码风格 --> +
            如何使用ZmUI?
            + +
            +<!-- 引入zhiqimUI的css文件 --> +<link rel="stylesheet" href="/service/res/zhiqim.mobile_2017010101.css"> + +<!-- 引入zhiqimUI的js文件 --> +<script src="/service/res/zhiqim.mobile_2017010101.min.js"></script> + +<!-- 使用zhiqimUI的整体布局架构 --> + +<!-- 顶部导航 --> +<div class="z-bar-top"> + <a href="#" class="z-left"><i class="z-font z-rem18 z-arrowhead-left"></i></a> + <div class="z-title">ZhiqimUI.mobile</div> +</div> + +<!-- 底部导航 --> +<div class="z-bar-bottom"> + <a href="#" class="z-direction-column z-active"><i class="z-font z-apps"></i><span class="z-mg-t3">文案</span></a> + <a href="#" class="z-direction-column"><i class="z-font z-apps"></i><span class="z-mg-t3">文案</span></a> + <a href="#" class="z-direction-column"><i class="z-font z-apps"></i><span class="z-mg-t3">文案</span></a> + <a href="#" class="z-direction-column"><i class="z-font z-apps"></i><span class="z-mg-t3">文案</span></a> +</div> + +<!-- 内容盒子 --> +<div class="z-container"> + <div class="z-flexBox-list z-h100p"><div id="testText" class="z-rem30 z-text-center">这里是内容</div></div> +</div> + +<!-- 使用zhiqimUI的JS代码修改值 --> +<script> +    // 这里用来写就是代码 + Z("#testText").html("这里是内容"); +</script> +
            + +<#-- ZhiqimUI CSS核心库 --> +
            ZhiqimUI CSS核心库
            + + + + + + + + + + + + + + + + + + + + + + + + + + +
            功能说明
            全局定义全局定义是指在全局定义里的标签缺省下的样式规则
            颜色定义颜色定义是指在ZhiqimUI的核心CSS文件中,默认提供的全局、白色、黑色和红、橙、黄、绿、青、蓝、紫共十种颜色的定义,包括字体颜色、背景颜色和边框颜色等,以及对应的样式名称。
            字体图标“字体图标”是矢量图片按字体规范设计的一种新的图标,凡狐字体图标放在/service/res/font/zhiqim.woff文件中,当前开发和收集的图标分 + 操作类、文档类、设备类、图表类、实体类五种,共五十九个图标。 + 字体图标不支持斜体,以便使用<i>标签来定义,如<i class="z-font z-config"></i> +
            文本样式文本样式是指对文本文字增加样式规则,如指定文本粗斜体、文本上下标、文本字体大小、文本行高、文本强制换行、强制不换行、省略隐藏、文本标题属性、文本对齐方式和文本附带的下划线删除线、以及编码突出效果等。
            块样式块样式是指对一个块区域增加样式规则,如指定块隐藏显示、块定位、块宽、块宽百分比、块高、块高百分比、内边距、外边距等属性。
            + +<#-- ZhiqimUI JS核心库 --> +
            ZhiqimUI JS核心库
            + + + + + + + + + + + + + + + + + + + + + + +
            功能说明
            全局定义凡狐JS统一命名空间为“F”,同时“F”也是window下全局函数,如果“F”有定义冲突请使用全称“zhiqim”。在全局“F”命名空间下定义的全局属性、全局函数、全局正则表达式和全局类。
            静态对象静态对象是把一系列常用的对象定义成静态属性和函数。目前包括有浏览器对象(Z.B)、文档对象(Z.D)、 + 事件对象(Z.E)、元素对象(Z.EL)、HTML对象(Z.H)、地址对象(Z.L)、COOKIE对象(Z.CK)。 +
            工具对象工具对象也是静态对象的一种,把一系列常用的静态属性和函数归类到一个工具对象中。目前包括断言工具(Z.A/Z.Asserts)、对象工具(Z.O/Z.Objects)、类型工具(Z.T/Z.Types)、 + 验证工具(Z.V/Z.Validates)、表单工具(Z.F/Z.FM)、JSON工具(Z.J/Z.Jsons)、日期工具(Z.DT/Z.DateTimes)、数组工具(Z.AR/Z.Arrays)、字符串工具(Z.S/Z.Strings)、算术工具(Z.Maths)、 + 金额工具(Z.AM/Z.Amounts)和颜色工具(Z.Colors)。 +
            查询对象Z.QueryZ.Query是设计成类似jQuery的DOM操作类。Z.Query采用HTML5原生的document.querySelectorAll实现了大部分jQuery的API,如selector,DOM操作,事件方法,动画等。 + 并增加了自身的一些特性和命名,如offsetLeftBody()、focusEnd()等。 +
            + +<#-- ZhiqimUI 插件库 --> +
            ZhiqimUI 插件库
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            功能说明
            表单插件库
            输入框输入框样式是指对输入框增加样式规则,如指定输入框长度大小、边框颜色、和输入控制等。
            按钮按钮样式是指对按钮增加样式规则,按钮分为三种,一是标准按钮、二为筛选按钮、三是多选按钮。样式规则包括按钮大小、颜色、边框颜色、选中特效等。
            日历日历控件是在输入框触发时展开一个年月日时分秒的日期界面,按日历格式显示出来,通过点击和选择得到要求的日期或时间。当前日历控件支持选择日期、选择日期+时间、选择日期+时分三种。
            对话框插件库
            告警对话框警告对话框是自定义对话框的一种参考alert方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的警告对话框,支持设置警告内容和点击确定后回调函数。
            询问对话框询问对话框是自定义对话框的一种参考confirm方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的确认对话框,支持设置确认内容和点击确定后回调函数,点击取消不向下处理。
            提示对话框提示对话框是自定义对话框的一种参考prompt方法生成的对话框。目标是在屏幕的中间提供没有警告声音且美观的提示对话框,支持设置提示内容和点击确定后回调函数,点击取消不向下处理。
            加载对话框加载对话框是自定义对话框的一种没有标题只有加载中提示的对话框。目标是在屏幕或用户指定的元素可视范围的中间提供没有警告声音且美观的加载对话框,支持设置九个参数来定义加载中界面,无关闭按钮,由业务实现关闭。
            导航插件库
            标签页标签页是参考tabnav设计出更简单易用的内容重叠布局的导航页。标签页使用nav和section作为是标签和内容显示。在nav中使用li表示每个标签,在section中使用div作为每个标签显示的内容。
            工具插件库
            Ajax调用AJAX即“Asynchronous Javascript And XML”(异步JavaScript和XML),是指一种创建交互式网页应用的网页开发技术。 + 凡狐AJAX采用面向RMI的概念设计,通过指定类和方法,传入参数对应方法的参数,通过RMI访问JAVA类的方法获取执行结果。 +
            文件上传凡狐文件上传提供了多种上传方法,支持表单上传、单文件上传,多文件上传,预览再上传,大文件上传断点续传(HTML5和Flash两种)等。
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/js/js.htm b/zhiqim_ui/document/tutorial/uim/js/js.htm new file mode 100644 index 0000000..403ffd5 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/js/js.htm @@ -0,0 +1,706 @@ +<#def title = "全局定义"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "凡狐JS统一命名空间为“F”,同时“F”也是window下全局函数,如果“F”有定义冲突请使用全称“zhiqim”。在全局“F”命名空间下定义的全局属性、全局函数、全局正则表达式和全局类。"/> +<#def prevUrl = "../css/block.htm"/> +<#def nextUrl = "static.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "js", "js")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "全局JS定义", "全局定义")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            全局定义:

            +

            + 凡狐JS统一命名空间为“F”,同时“F”也是window下全局函数,如果“F”有定义冲突请使用全称“zhiqim”。在全局“F”命名空间下定义的全局属性、全局函数、全局正则表达式和全局类。 +

            +
            + +<#-- 全局属性定义 --> +
            全局属性定义
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            属性说明
            Z.v1.2.2ZhiqimJS的基线版本号
            Z.uundefindedundefinded的简写,如if (abc == Z.u)来判断是不是未定义
            Z.ddocumentdocument的简写
            Z.nnavigatornavigator的简写
            Z.llocationlocation的简写
            Z.uauserAgent.toLowerCase()userAgent的小写简写
            + +<#-- 全局函数定义 --> +
            全局函数定义
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.eval(expression)执行表达式语句expression表达式字符串,如:var abc = "abc";
            Z.alert(text, callback)弹出警告对话框text警告文本,链接暂不支持
            callback回调函数,点击确定后回调
            Z.confirm(text, callback, param)弹出询问对话框text询问文本,链接暂不支持
            callback回调函数,点击确定后回调,点击取消不处理
            param设置参数,支持参数有{height: 50}
            Z.prompt(text, value, callback, param)弹出修改对话框text 修改说明,链接暂不支持
            value修改的值
            callback回调函数,点击确定后回调
            param设置参数
            Z.bind(f, $this)返回一个新的函数,使得原函数this指向$this对象下执行f原函数
            $this指向$this对象
            Z.each(object, callback)减化循环处理,默认this绑定到item上object对象
            callback回调函数
            Z.eachof($this, object, callback)减化循环处理,支持对字符串,数字,类数组和纯对象处理,=true表示中途退出循环,默认this绑定到传入的$this上,如果未传则绑定到item上
            另外支持除$this,object,callback之外的参数也会出现在回调函数中
            $this回调函数指针
            object循环处理对象
            callback回调函数
            Z.clone(obj)克隆一个新值obj对象
            Z.onload(f)初始化后加载f对象
            Z.random(length, type)随机生成一定长度的字符或数字length 长度
            type类型表名生成的随机字符串是字母数字(0或undefinde),数字(1),字母(2),大写字母(3),小写字母(4),大写字母和数字(5),小写字母和数字(6)
            Z.timer(speed, times, $this, process, complete)定时任务speed速度,单位毫秒,如50
            times执行次数,-1表示一直运行
            $this回调函数时的this
            process运行时回调函数
            complete完成时回调函数
            Z.drag(elem, param, callback, $this)拖拽或滑动elem属性
            param拖放参数,如果为字符串或node表示拖放对象
            callback回调函数
            $this回调函数时的this
            Z.dragInParent(elem, drag, parent, callback, $this)拖拽或滑动elem属性
            drag拖放对象
            parent拖放对象的父对象
            callback回调函数
            $this回调函数时的this
            + +<#-- 全局正则表达式定义 --> +
            全局正则表达式定义(统一定义在Z.R中)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            正则表达式说明
            空格
            Z.R.SPACE空格/\s+/
            Z.R.SPACE_LEFT左空格/^\s+/
            Z.R.SPACE_RIGHT右空格/\s+$/
            数值型
            Z.R.NUMERIC数值型/^\d+$/
            Z.R.INTEGER整数,支持正负数/^(0|[\+\-]?[1-9]\d*)$/
            Z.R.INTEGER_P正整数/^[1-9]\d*$/
            Z.R.INTEGER_N_N非负整数/^(0|[1-9]\d*)$/
            小数型
            Z.R.FLOAT浮点值,支持多位小数点/^(0|[\+\-]?[1-9]\d*)(\.\d+)?$/
            Z.R.FLOAT_N_N非负浮点值,支持多位小数/^(0|[1-9]\d*)(\.\d+)?$/
            Z.R.AMOUNT_2R标准元金额,支持0-2位小数/^(0|[\+\-]?[1-9]\d*)(\.\d{1,2})?$/
            Z.R.AMOUNT_2R_FIXED固定元金额,两位小数/^(0|[\+\-]?[1-9]\d*)(\.\d{2})$/
            Z.R.AMOUNT_N_N_2R非负标准元金额,支持0-2位小数/^(0|[1-9]\d*)(\.\d{1,2})?$/
            Z.R.AMOUNT_N_N_2R_FIXED非负固定元金额,两位小数/^(0|[1-9]\d*)(\.\d{2})$/
            字符相关
            Z.R.ALPHABAT字母/^[A-Za-z]+$/
            Z.R.ALPHABAT_UPPER大写字母/^[A-Z]+$/
            Z.R.ALPHABAT_LOWER小写字母/^[a-z]+$/
            Z.R.ALPHA_LOWER_NUMERIC小写字母或数字/^[a-z0-9]+$/
            Z.R.ALPHA_UPPER_NUMERIC大写字母或数字/^[A-Z0-9]+$/
            Z.R.ALPHA_NUMERIC字母或数字/^[A-Za-z0-9]+$/
            Z.R.ALPHA_NUMERIC_PA大写小字母和数字,字母开头/^[A-Za-z][A-Za-z0-9]*$/
            Z.R.ALPHABAT_DOUBLE双字节/^[^x00-xff]+$/
            Z.R.CHINESE中文/^[\u4e00-\u9fa5]+$/
            Z.R.CHINESE_ALPHA_NUMERIC中文大小写字母和数字/^[\u4e00-\u9fa5A-Za-z0-9]+$/
            日期相关
            Z.R.DATE日期/^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))$/
            Z.R.TIME时间/^([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$/
            Z.R.DATE_TIME日期时间/^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s(([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9]))$/
            Z.R.DATE_TIME_MATCH日期时间简单匹配/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/
            HTML相关
            Z.R.HTML是否包含HTML/<|&#?\w+;/
            Z.R.HTML_XHTML_TAG适配HTML成XHTML标记/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig
            Z.R.HTML_TAG_NAME查找HTML标记名称/<([\w:]+)/
            其他
            Z.R.ACCOUNT账号,要求5-25位,中文大小写字母和数字和下划线、邮件符、点号,并且不能以@._开头和结尾/^(?!(_|@|\.))(?!.*?(_|@|\.)$)[\w@\.\u4e00-\u9fa5]{5,25}$/
            Z.R.PASSWORD密码,要求6-16位,大小写字母和.@_#$!~%符号/^[\w@\.#$!~%]{6,16}$/
            Z.R.MOBILE手机号,支持+86/^((\+86)|(86)|)?(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|170|18[0|1|2|3|5|6|7|8|9])\d{8}$/
            Z.R.MOBILE1111位手机号/^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|170|18[0|1|2|3|5|6|7|8|9])\d{8}$/
            Z.R.IPIP地址/^((?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])$/
            Z.R.MACMAC地址/^[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}$/
            Z.R.QQQQ号/^[1-9]\d{4,10}$/
            Z.R.POSTAL_CODE邮政编码/^[1-9]\d{5}$/
            Z.R.EMAIL邮箱/^([\w-_]+(?:\.[\w-_]+)*)@((?:[a-z0-9]+(?:-[a-zA-Z0-9]+)*)+\.[a-z]{2,6})$/
            Z.R.IDCARD身份证号/^(\d{6})((((19|20)[0-9]{2})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))(\d{3}[0-9xX*])$/
            + +<#-- 全局类定义 --> +
            全局类定义(由Z.Class.newInstance()派生的函数称为类)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            属性/方法属性/方法说明举例
            默认属性和方法
            immediate是否立即执行,默认false在构造函数中设置,如var draggable = new Draggable({immediate:true});
            set设置属性draggable.set(key, value);
            派出的类可定义的属性
            defaults缺省字段表defaults = {elem:null, id="123456"},
            派出的类可定义的方法
            init初始化函数,无参数init(){},
            execute执行函数,无参数execute(){},
            + + + + + +
            一、哈唏表类(Z.HashMap):
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            属性/方法属性/方法说明举例
            构造函数
            new构造函数var aMap = new Z.HashMap();
            方法
            put设置值aMap.put("abc", "ABC");
            get获取值var value = aMap.get("abc");
            remove删除值aMap.remove("abc");
            clear清空表aMap.clear();
            size获取表大小var size = aMap.size();
            isEmpty判断是否为空var isEmpty = aMap.isEmpty();
            containKey判断KEY中是否包含值var containKey = aMap.containKey("abc");
            containValue判断VALUE中是否包含值var containValue = aMap.containValue("ABC");
            keySet获取KEY数组var keys = aMap.keySet();
            values获取VALUE数组var values = aMap.values();
            + + + + + +
            二、可拖动类(Z.Draggable):
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            属性/函数属性/方法说明举例
            构造函数
            new构造函数var draggable = new Z.Draggable();
            属性
            elem拖拽对象draggable.elem = Z.D.id("drag");
            drag拖拽手把draggable.drag = Z.D.id("drag");
            param拖拽参数(支持left,top,right,bottom,width,height其中right,bottom时width,height无效)draggable.param = {left:0,top:0,width:500;height:300};
            cursor拖拽手势,默认movedraggable.cursor = "move";
            callback拖拽回调函数draggable.callback(){};
            callthis拖拽回调函数this指针draggable.callthis = $this;
            函数
            execute执行拖拽draggable.execute();
            close关闭拖拽draggable.close();
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/js/query.htm b/zhiqim_ui/document/tutorial/uim/js/query.htm new file mode 100644 index 0000000..7710a4c --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/js/query.htm @@ -0,0 +1,1395 @@ +<#def title = "Z.Query 查询对象"/> +<#def keyword = "Z.Query FQuery jQuery HTML5 selector"/> +<#def desc = "Z.Query是设计成类似jQuery的DOM操作类。Z.Query采用HTML5原生的document.querySelectorAll实现了大部分jQuery的API,如selector,DOM操作,事件方法,动画等。并增加了自身的一些特性和命名,如offsetLeftBody()、focusEnd()等。"/> +<#def prevUrl = "util.htm"/> +<#def nextUrl = "../form/input.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "js", "query")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "全局JS定义", "查询对象")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            查询对象(Z.Query):

            +

            + Z.Query是设计成类似jQuery的DOM操作类。Z.Query采用HTML5原生的document.querySelectorAll实现了大部分jQuery的API,如selector,DOM操作,事件方法,动画等。 + 并增加了自身的一些特性和命名,如offsetLeftBody()、focusEnd()等。 +

            +
            + +<#-- Z.Query属性 --> +
            Z.Query属性
            + + + + + + + + + + + + + + +
            属性说明
            selector选择器对象,支持是document、function、element、element列表、CSS3选择器、HTML文本等
            length包含顶级元素长度
            + +<#-- Z.Query选择器 --> +
            Z.Query选择器
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            选择器举例说明
            空参数选择器
            空参数Z(""), Z(null), Z(undefined)未选择任何元素
            元素参数选择器
            documentZ(document)选择document
            elementZ(element)选择元素对象
            函数参数选择器
            functionZ(function(){})初始化调用函数,相关于Z.onload(function(){})
            数组参数选择器
            Z.QueryZ(Z.Query)选择另一个查询对象
            ArrayZ(Array)选择元素数组
            HTMLCollectionZ(HTMLCollection)选择元素集合
            NodeListZ(NodeList)选择元素列表
            字符串选择器
            bodyZ("body")选择document.body
            <tag>Z("<div>"),Z("<INPUT>")选择HTML标签列表
            HTMLZ("<div>abc</div>")选择一段HTML文本,并封装成元素列表
            字符串的CSS选择器
            .classZ(".abc")选择 class="abc" 的所有元素
            #idZ("#zhiqim")选择 id="zhiqim" 的所有元素。
            *Z("*")选择所有元素
            tagZ("p")选择所有 <p> 元素
            tag,tagZ("div,p")选择所有 <div> 元素和所有 <p> 元素
            tag tagZ("div p")选择 <div> 元素的子孙 <p> 元素
            tag>tagZ("div>p")选择 <div> 元素的子 <p> 元素
            tag+tagZ("div+p")选择 <div> 元素同级之后的所有 <p> 元素。
            [attribute]Z("[target]")选择带有 target 属性所有元素
            [attribute=value]Z("[target=_blank]")选择 target="_blank" 的所有元素。
            [attribute~=value]Z("[title~=flower]")选择 title 属性包含单词 "flower" 的所有元素。
            [attribute|=value]Z("[lang|=en]")选择 lang 属性值以 "en" 开头的所有元素。
            :linkZ("a:link")选择所有未被访问的链接。
            :visitedZ("a:visited")选择所有已被访问的链接。
            :activeZ("a:active")选择活动链接。
            :hoverZ("a:hover")选择鼠标指针位于其上的链接。
            :focusZ("input:focus")选择获得焦点的 input 元素。
            :first-letterZ("p:first-letter")选择每个 <p> 元素的首字母。
            :first-lineZ("p:first-line")选择每个 <p> 元素的首行。
            :first-childZ("p:first-child")选择属于父元素的第一个子元素的每个 <p> 元素。
            :beforeZ("p:before")在每个 <p> 元素的内容之前插入内容。
            :afterZ("p:after")在每个 <p> 元素的内容之后插入内容。
            :lang(language)Z("p:lang(it)")选择带有以 "it" 开头的 lang 属性值的每个 <p> 元素。
            element1~element2Z("p~ul")选择前面有 <p> 元素的每个 <ul> 元素。
            [attribute^=value]Z("a[src^="https"]")选择其 src 属性值以 "https" 开头的每个 <a> 元素。
            [attribute$=value]Z("a[src$=".pdf"]")选择其 src 属性以 ".pdf" 结尾的所有 <a> 元素。
            [attribute*=value]Z("a[src*="abc"]")选择其 src 属性中包含 "abc" 子串的每个 <a> 元素。
            :first-oz-typeZ("p:first-oz-type")选择属于其父元素的首个 <p> 元素的每个 <p> 元素。
            :last-oz-typeZ("p:last-oz-type")选择属于其父元素的最后 <p> 元素的每个 <p> 元素。
            :only-oz-typeZ("p:only-oz-type")选择属于其父元素唯一的 <p> 元素的每个 <p> 元素。
            :only-childZ("p:only-child")选择属于其父元素的唯一子元素的每个 <p> 元素。
            :nth-child(n)Z("p:nth-child(2)")选择属于其父元素的第二个子元素的每个 <p> 元素。
            :nth-last-child(n)Z("p:nth-last-child(2)")同上,从最后一个子元素开始计数。
            :nth-oz-type(n)Z("p:nth-oz-type(2)")选择属于其父元素第二个 <p> 元素的每个 <p> 元素。
            :nth-last-oz-type(n)Z("p:nth-last-oz-type(2)")同上,但是从最后一个子元素开始计数。
            :last-childZ("p:last-child")选择属于其父元素最后一个子元素每个 <p> 元素。
            :rootZ(":root")选择文档的根元素。
            :emptyZ("p:empty")选择没有子元素的每个 <p> 元素(包括文本节点)。
            :targetZ("#zhiqim:target")选择当前活动的 #zhiqim 元素。
            :enabledZ("input:enabled")选择每个启用的 <input> 元素。
            :disabledZ("input:disabled")选择每个禁用的 <input> 元素
            :checkedZ("input:checked")选择每个被选中的 <input> 元素。
            :not(selector)Z(":not(p)")选择非 <p> 元素的每个元素。
            ::selectionZ("::selection")选择被用户选取的元素部分。
            + +<#-- Z.Query函数(内部操作) --> +
            Z.Query函数(内部操作)
            + + + + + + + + + + + + + + + + + +
            函数说明举例
            size()返回长度,同length,无参数
            Z(".abc").size()
            each(callback)
            each(callback, param)
            + 循环处理,支持多参数,其中第一个参数回调函数,后面的参数为回调函数的参数

            + 回调函数中和一个参数为elem,第二参数为i,第三参数开始和each的第二参数开始匹配 +
            +
            +Z(".abc").each(function(elem){
            +    console.info(elem);
            +});
            +
            +Z(".abc").each(function(elem, i){
            +    console.info(i);
            +});
            +
            +Z(".abc").each(function(elem, i, param){
            +    console.info(param);
            +}, param);
            +    
            + +<#-- Z.Query函数(元素相关操作) --> +
            Z.Query函数(元素相关操作)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            find(selector)在当前Z.Query中查找子元素selector指定的选择器
            parent()返回当前Z.Query第一个元素的父元素的Z.Query
            siblings(selector)在当前Z.Query中兄弟节点中查找selector指定的选择器
            next(selector)在当前Z.Query后面节点中查找selector指定的选择器
            nextAll(selector)在当前Z.Query后面所有节点中查找selector指定的选择器
            prev(selector)在当前Z.Query前面节点中查找selector指定的选择器
            prevAll(selector)在当前Z.Query前面所有节点中查找selector指定的选择器
            children(selector)在当前Z.Query子元素中查找selector指定的选择器
            nth(elem, selector)获取元素在查找器的索引号,索引号从1开始elem指定的元素
            selector指定的选择器
            + +<#-- Z.Query函数(文档相关操作) --> +
            Z.Query函数(元素相关操作)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            appendTo($selector)将元素增加到选择器元素中$selector指定的选择器
            appendToPos($selector))将元素增加到选择器元素中,并检查position:static标志转为position:relative$selector指定的选择器
            append($selector)向选择器元素内部追加内容$selector指定的选择器
            remove()移除本身元素
            + +<#-- Z.Query函数(属性相关操作) --> +
            Z.Query函数(属性相关操作)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            val(values)设置或获取值values指定的值,支持undefinde,String,Function类型: + 1、未传值表示获取值
            + 2、字符串表示获取属性为value的值
            + 3、函数表示回调函数得到值,再设置到value属性中 +
            attr(param, param2)设置或获取属性值param参数1,支持两种:
            + 1、字符串表示属性名称,设置或获取单个属性
            + 2、对象属性方式,如{href:"/zhiqim.htm",target:"_blank"}表示设置多个属性
            +
            param2参数2,设置单个属性时有效
            如:attr("href", "/zhiqim.htm")
            removeAttr(name)移除属性name指定属性名称
            className(className)设置或获取类样式表className指定类样式名称列表
            addClass(className)增加类样式className指定类样式名称
            removeClass(className)删除类样式className指定类样式名称
            hasClass(className)判断是否有类样式className指定类样式名称
            toggleClass(className)切换类样式,如果没有则加入,有则删除className指定类样式名称
            + +<#-- Z.Query函数(样式相关操作) --> +
            Z.Query函数(样式相关操作 style & css & cssNum &opacity & display)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            style(style)设置或获取元素的样式style指定样式,未传值表示获取
            css(param, param2)设置或获取CSS样式param参数1,支持两种:
            + 1、字符串表示样式名称,设置或获取单个样式
            + 2、对象属性方式,如{width:100,height:100}表示设置多个CSS样式
            + 对象方式参数["top", "bottom", "left", "right", "width", "height", "min-width", "max-width", "min-height", "max-height", "line-height"]支持数值型的值 +
            param2参数2,设置单个CSS样式时有效
            如:css("width", 100)
            cssNum(name)获取CSS样式的数值
            如:width:100px得到100
            name指定样式名称
            opacity(param)设置或获取透明度param指定参数,未传值表示获取
            display(param)设置或获取display属性param指定参数,未传值表示获取
            inline()文本行,相对于display:inline
            block()块,相对于display:block
            inBlock()行内块,相对于display:inline-block
            + +<#-- Z.Query函数(显示/隐藏) --> +
            Z.Query函数(显示/隐藏 保留占位)
            + + + + + + + + + + + + + + + + + + +
            函数说明
            isHidden()是否隐藏
            hidden()隐藏
            visible()显示
            + +<#-- Z.Query函数(显示/隐藏) --> +
            Z.Query函数(显示/隐藏)
            + + + + + + + + + + + + + + + + + + + + + + +
            函数说明
            isHide()是否隐藏
            hide()隐藏
            show()显示,先查是否有隐藏时的缓存,如果没有查elem缺省值
            toggle()切换元素的可见状态
            + +<#-- Z.Query函数(内容相关操作) --> +
            Z.Query函数(内容相关操作 text & html)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            text(text)设置或获取元素文本内容text指定的文本,如果未传值表示获取
            html(html)设置或获取元素innerHTMLhtml指定的HTML,如果未传值表示获取
            htmlx()获取HTML的扩展方式,对readonly、tbody等作处理
            htmlt()获取HTML的扩展方式,把<>转化为&lt;&gt;
            htmls()获取自己本身的HTML
            + +<#-- Z.Query函数(焦点选择) --> +
            Z.Query函数(焦点动作 focus & focusEnd & select & section)
            + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明
            focus()设置元素获取焦点
            focusEnd()设置元素获取焦点,并移动光标到最后
            select()设置元素获取焦点,并选中文本
            selection()选中的文本内容
            isSelection()是否选中内容
            + +<#-- Z.Query函数(偏移相关) --> +
            Z.Query函数(偏移宽度 & 可操作宽高)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明
            offsetParent()偏移父元素
            offsetWidth()元素偏移宽度 = style.width = border+padding+content,和style.width不同点:
            + 1.style.width可设置百分比并返回百分比,而offsetWidth返回百分比计算的数值
            + 2.style.width未设置返回空字符串,而offsetWidth一直返回计算的数值
            + 3.style.width带px后缀
            offsetHeight()元素偏移高度 = style.height = border+padding+content
            offsetLeft()元素相对父元素左偏移 = style.left,火狐需除去左边框
            offsetTop()元素相对父元素上偏移 = style.top
            offsetLeftBody()元素相对body左偏移(绝对左偏移)
            offsetTopBody()元素相对body上偏移(绝对上偏移)
            clientWidth()元素可操作宽度 = padding+content
            clientHeight()元素可操作高度 = padding+height
            clientLeft()元素左边框 = style.borderLeftWidth
            clientTop()元素上边框 = style.borderTopWidth
            clientX()元素X坐标(绝对坐标)
            clientY()元素Y坐标(绝对坐标)
            + +<#-- Z.Query函数(事件相关操作) --> +
            Z.Query函数(事件相关操作)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            事件增加删除
            on($event, $function, $this)增加事件$event事件
            $function回调函数
            $this回调函数this指针
            un($event, $function, $this)删除事件$event事件
            $function回调函数
            $this回调函数this指针
            按键事件(三项)
            keydown($function, $this)按键按下事件$function回调函数
            $this回调函数this指针
            unkeydown($function, $this)删除按键按下事件$function回调函数
            $this回调函数this指针
            keypress($function, $this)按键按下字符事件$function回调函数
            $this回调函数this指针
            unkeypress($function, $this)删除按键按下字符事件$function回调函数
            $this回调函数this指针
            keyup($function, $this)按键松开事件$function回调函数
            $this回调函数this指针
            unkeyup($function, $this)删除按键松开事件$function回调函数
            $this回调函数this指针
            点击事件(二项)
            click($function, $this)鼠标点击事件$function回调函数
            $this回调函数this指针
            unclick($function, $this)删除鼠标点击事件$function回调函数
            $this回调函数this指针
            dblclick($function, $this)鼠标双击事件$function回调函数
            $this回调函数this指针
            undblclick($function, $this)删除鼠标双击事件$function回调函数
            $this回调函数this指针
            变更事件(二项)
            change($function, $this)变更事件$function回调函数
            $this回调函数this指针
            unchange($function, $this)删除变更事件$function回调函数
            $this回调函数this指针
            blur($function, $this)跳出事件$function回调函数
            $this回调函数this指针
            unblur($function, $this)删除跳出事件$function回调函数
            $this回调函数this指针
            鼠标事件(八项)
            mouseenter($function, $this)鼠标进入事件$function回调函数
            $this回调函数this指针
            unmouseenter($function, $this)删除鼠标进入事件$function回调函数
            $this回调函数this指针
            mouseleave($function, $this)鼠标离开事件$function回调函数
            $this回调函数this指针
            unmouseleave($function, $this)删除鼠标离开事件$function回调函数
            $this回调函数this指针
            mouseover($function, $this)鼠标移入事件$function回调函数
            $this回调函数this指针
            unmouseover($function, $this)删除鼠标移入事件$function回调函数
            $this回调函数this指针
            mouseout($function, $this)鼠标移出事件$function回调函数
            $this回调函数this指针
            unmouseout($function, $this)删除鼠标移出事件$function回调函数
            $this回调函数this指针
            mouseup($function, $this)鼠标按下释放事件$function回调函数
            $this回调函数this指针
            unmouseup($function, $this)删除鼠标按下释放事件$function回调函数
            $this回调函数this指针
            mousedown($function, $this)鼠标按下事件$function回调函数
            $this回调函数this指针
            unmousedown($function, $this)删除鼠标按下事件$function回调函数
            $this回调函数this指针
            mousemove($function, $this)鼠标移动事件$function回调函数
            $this回调函数this指针
            unmousemove($function, $this)删除鼠标移动事件$function回调函数
            $this回调函数this指针
            mousewheel($function, $this)鼠标滚轮事件$function回调函数
            $this回调函数this指针
            unmousewheel($function, $this)删除鼠标滚轮事件$function回调函数
            $this回调函数this指针
            hover($function1, $function2, $this)鼠标进入和离开事件$function1鼠标进入回调函数
            $function2鼠标离开回调函数
            $this回调函数this指针
            unhover($function1, $function2, $this)删除鼠标进入和离开事件$function1鼠标进入回调函数
            $function2鼠标离开回调函数
            $this回调函数this指针
            窗体事件(四项)
            resize($function, $this)缩放事件$function回调函数
            $this回调函数this指针
            resize($function, $this)删除缩放事件$function回调函数
            $this回调函数this指针
            scroll($function, $this)滚动事件$function回调函数
            $this回调函数this指针
            unscroll($function, $this)删除滚动事件$function回调函数
            $this回调函数this指针
            load($function, $this)加载事件,删除请使用un("unload", $function, $this)函数$function回调函数
            $this回调函数this指针
            unload($function, $this)卸载事件,删除请使用un("unload", $function, $this)函数$function回调函数
            $this回调函数this指针
            + +<#-- Z.Query函数(动画相关操作) --> +
            Z.Query函数(动画相关操作 fade & slide & drag)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            fadeTo(duration, opacity, complete)淡入到指定的透明度duration持续时间
            opacity指定的透明度0-1之间
            complete完成后的回调函数
            fadeIn(duration, complete)淡入duration持续时间
            complete完成后的回调函数
            fadeOut(duration, complete)淡出duration持续时间
            complete完成后的回调函数
            slideDown(duration, complete)向下滑动duration持续时间
            complete完成后的回调函数
            slideUp(duration, complete)向上滑动duration持续时间
            complete完成后的回调函数
            slideToggle(duration, complete)上下滑动切换duration持续时间
            complete完成后的回调函数
            drag(param, callback, $this)拖拽或滑动param指定参数
            callback回调函数
            $this回调函数this指针
            dragInParent(drag, parent, callback, $this)拖拽或滑动drag无参数
            parent无参数
            callback回调函数
            $this回调函数this指针
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/js/static.htm b/zhiqim_ui/document/tutorial/uim/js/static.htm new file mode 100644 index 0000000..d73de87 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/js/static.htm @@ -0,0 +1,881 @@ +<#def title = "静态对象"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "静态对象是把一系列常用的对象定义成静态属性和函数。目前包括有浏览器对象(Z.B)、文档对象(Z.D)、"/> +<#def prevUrl = "js.htm"/> +<#def nextUrl = "util.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "js", "static")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "全局JS定义", "静态对象")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            静态对象:

            +

            + 静态对象是把一系列常用的对象定义成静态属性和函数。目前包括有浏览器对象(Z.B)、文档对象(Z.D)、 + 事件对象(Z.E)、元素对象(Z.EL)、HTML对象(Z.H)、地址对象(Z.L)、COOKIE对象(Z.CK)。 +

            +
            + +<#-- 浏览器对象(Z.B) --> +
            浏览器对象(Z.B/Z.Browser)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            属性/函数值范围说明
            Z.B.win64true/false是否是64位系统
            Z.B.mobiletrue/false是否是移动端
            Z.B.firefoxtrue/false是否是firefox浏览器
            Z.B.webkittrue/false是否是webkit浏览器
            Z.B.safaritrue/false是否是safari浏览器
            Z.B.chrometrue/false是否是chrome浏览器
            Z.B.operatrue/false是否是opera浏览器
            Z.B.msietrue/false是否是msie浏览器(含trident)
            Z.B.msieOnlytrue/false是否是msie浏览器(不含trident)
            Z.B.msie11true/false是否是msie11浏览器
            Z.B.msie10true/false是否是msie10浏览器
            Z.B.msie9true/false是否是msie9浏览器
            Z.B.msie8true/false是否是msie8浏览器
            Z.B.msie7true/false是否是msie7浏览器
            Z.B.msie6true/false是否是msie6浏览器
            Z.B.msieVer6,7,8,9,10,11,12,100IE版本号,100表示不是IE
            + +<#-- 文档对象 --> +
            文档对象(Z.D/Z.Document)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.D.id(id, doc)通过ID获取元素
            document.getElementById(id);
            id元素id编码
            doc所在的文档对象,未传入取当前document
            Z.D.has(id, doc)通过ID获取元素判断是否存在
            document.getElementById(id)!=null;
            id元素id编码
            doc所在的文档对象,未传入取当前document
            Z.D.create(tag, doc)通过tag创建元素
            document.createElement(tag);
            tag元素标签,如div
            doc所在的文档对象,未传入取当前document
            Z.D.tagNames(name, doc)获取指定标记名称的对象列表
            document.getElementsByTagName(name);
            name名称
            doc所在的文档对象,未传入取当前document
            Z.D.names(name, doc)获取指定名称的对象列表
            document.getElementsByName(name);
            name 指定名称
            doc所在的文档对象,未传入取当前document
            Z.D.classNames(name, doc)获取指定类名的对象列表
            document.getElementsByClassName(name);
            name指定类名
            doc所在的文档对象,未传入取当前document
            Z.D.attrs(name, value, doc)获取指定属性名和属性值相等的对象列表name指定属性名
            value指定属性值
            doc所在的文档对象,未传入取当前document
            Z.D.scrollTop(doc)窗口垂直滚动条上偏移值doc指定的文档对象
            Z.D.scrollLeft(doc)窗口水平滚动条左偏移值 doc所在的文档对象,未传入取当前document
            Z.D.scrollWidth(doc)可滚动展示宽度 doc所在的文档对象,未传入取当前document
            Z.D.scrollHeight(doc)可滚动展示高度 doc所在的文档对象,未传入取当前document
            Z.D.clientWidth(doc)窗口可视宽度(看得见的宽度)doc所在的文档对象,未传入取当前document
            Z.D.clientHeight(doc)窗口可视高度(看得见的高度)doc所在的文档对象,未传入取当前document
            Z.D.offsetWidth(doc)可操作宽度(由元素决定,和窗口无关)doc所在的文档对象,未传入取当前document
            Z.D.offsetHeight(doc)可操作高度(由元素决定,和窗口无关)doc所在的文档对象,未传入取当前document
            + +<#-- 事件对象 --> +
            事件对象(Z.E/Z.Event)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.E.KEY{ + ESC: 27, + LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, DELETE: 46 + }事件键值属性
            Z.E.add(target, name, listener, $this)增加事件target目标地址
            name事件名称
            listener事件侦听器
            $this事件侦听器对应的this指针
            Z.E.remove(target, name, listener, $this)移除事件target目标地址
            name事件名称
            listener事件侦听器
            $this事件侦听器对应的this指针
            Z.E.event(e)对事件对象作适配,IE取window.evente事件对象
            Z.E.key(e)产生事件的键值e事件对象
            Z.E.target(e)产生事件的目标对象e事件对象
            Z.E.current(e)产生事件的当前目标对象e事件对象
            Z.E.cancel(e)取消缺省事件e事件对象
            Z.E.stop(e)停止冒泡e事件对象
            Z.E.forbidden(e)停止冒泡和取消缺省事件 e事件对象
            Z.E.clientX(e)点击位置相对于浏览器的X坐标e事件对象
            Z.E.clientY(e)点击位置相对于浏览器的Y坐标e事件对象
            Z.E.screenX(e)点击位置相对于屏幕的X坐标e事件对象
            Z.E.screenY(e)点击位置相对于屏幕的Y坐标 e事件对象
            Z.E.wheelDelta()滚轮增量e事件对象
            Z.E.isCtrl(e)是否按住了Ctrl键e事件对象
            Z.E.isEsc(e)是否退出键e事件对象
            Z.E.isBackspace(e)是否退格键e事件对象
            Z.E.isEnter(e)是否回车键e事件对象
            Z.E.isCtrlC(e)是否复制e事件对象
            Z.E.isCtrlV(e)是否粘贴e事件对象
            + + +<#-- 元素对象 --> +
            元素对象(Z.EL/Z.Element)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.EL.has(elem, name)是否有属性 elem元素
            name属性名称
            Z.EL.get(elem, name)获取属性值elem元素
            name属性名称
            Z.EL.set(elem, name, value)设置属性值 elem元素
            name属性名称
            value需要传入的值
            Z.EL.equals(elem, name, value)判断属性值是否等于指定值 elem元素
            name属性名称
            value传入的值
            Z.EL.style(elem, style)获取或设置样式字符串elem元素
            style未传值表示获取样式,传值表示设置样式
            Z.EL.css(elem, name, value)获取或设置一个样式elem元素
            name样式名称
            value未传值表示获取样式,传值表示设置样式
            Z.EL.cssNum(elem, name)获取样式数值型的值elem元素
            name样式名称
            Z.EL.opacity(elem, value)获取和设置透明度值0-1之间elem元素
            value未传值表示获取,传值表示设置
            Z.EL.className(elem)获取类样式名称值elem元素
            className类样式名称
            Z.EL.addClass(elem, className)增加类样式elem元素
            className类样式名称
            Z.EL.removeClass(elem, className)删除类样式elem元素
            className类样式名称
            Z.EL.hasClass(elem, className)判断是否有类样式elem元素
            className类样式名称
            Z.EL.toggleClass(elem, className)切换类样式,没有则加入,有则删除elem元素
            className类样式名称
            Z.EL.select(elem)选中对象文本elem元素
            Z.EL.selection(elem)选中对象的文本内容elem元素
            Z.EL.focus(elem)设置元素获取焦点elem元素
            Z.EL.focusEnd(elem, len)设置元素获取焦点,并把光标定位到结尾elem元素
            len长度
            Z.EL.parent(elem)获取元素父元素elem元素
            Z.EL.parentIndex(elem)获取元素在父元素的索引号elem元素
            Z.EL.childs(elem)获取元素子节点列表
            elem.childNodes
            elem元素
            Z.EL.children(elem)获取元素子元素列表
            elem.children
            elem元素
            Z.EL.html(elem, value)获取和设置HTML代码elem元素
            value未传值表示获取,传值表示设置
            Z.EL.text(elem, value)获取或设置元素文本elem元素
            value未传值表示获取,传值表示设置
            Z.EL.append(elem, child)增加子元素elem本元素
            child子元素
            Z.EL.remove(elem, name)删除元素或删除属性elem元素
            name未传值表示删除元素,传值表示删除元素的属性
            Z.EL.replace(elem, newElem)替代元素elem原元素
            newElem新元素
            Z.EL.offsetLeft(elem)获取相对于父对象的左偏移elem元素
            Z.EL.offsetTop(elem)获取相对于父对象的上偏移 elem元素
            Z.EL.offsetLeftBody(elem)获取相对body的左偏移(绝对左偏移)elem元素
            Z.EL.offsetTopBody(elem)获取相对body的上偏移(绝对上偏移)elem元素
            + +<#-- HTML对象 --> +
            HTML对象(Z.H/Z.Html)
            + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.H.createElement(html)通过HTML文本创建元素列表htmlHTML文本
            Z.H.displayDefault(tag)获取HTML标签缺省的display值 + tagHTML标签名
            + +<#-- 地址对象 --> +
            地址对象(Z.L/Z.Location)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.L.reload(target)刷新target目标对象,为空表示当前window
            Z.L.access(url, target)访问URLurlURL地址
            target目标对象,为空表示当前window
            Z.L.check(url, name, form, target)带检测访问URLurlURL地址
            name单选框或多选框名称
            form指定表单内的单选或多选框
            target目标对象
            Z.L.confirm(url, message, name, form, target)带询问访问URL
            +
            urlURL地址
            message询问的显示信息
            name单选框或多选框名称
            form确认的形式
            target目标对象
            Z.L.href(param, param2)含对象参数的访问URL
            +
            param参数1:
            字符串时表示URL,功能同access函数
            对象时取值{url:url,target:target,name:name,form:form,message:message},相应地判断是check|confirm方法
            param2参数2:
            传值时为target,优先于参数1中对象target
            + +<#-- COOKIE对象 --> +
            COOKIE对象(Z.CK/Z.Cookie)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.Cookie.all()设置或返回当前文档有关的所有Cookie,等同document.cookie
            Z.Cookie.add(cookie)添加Cookiecookie + Cookie对象:
            + name:Cookie名称,value:Cookie值
            + expires:Cookie到期时长,单位秒,未传值表示随浏览器关闭失效
            + path:Cookie有效路径,建议/结尾
            + domain:Cookie有效域名
            + secure:安全标识true|false,HTTPS时有效

            + 如:{name:"test", value:"value", expires=3600, path="/", domain="127.0.0.1", secure:false} +
            Z.Cookie.remove(name)删除CookienameCookie名称
            Z.Cookie.get(name)获取CookienameCookie名称
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/js/util.htm b/zhiqim_ui/document/tutorial/uim/js/util.htm new file mode 100644 index 0000000..e304d91 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/js/util.htm @@ -0,0 +1,1055 @@ +<#def title = "工具对象"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = "工具对象也是静态对象的一种,把一系列常用的静态属性和函数归类到一个工具对象中。目前包括断言工具(Z.A/Z.Asserts)、对象工具(Z.O/Z.Objects)、类型工具(Z.T/Z.Types)、"/> +<#def prevUrl = "static.htm"/> +<#def nextUrl = "query.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "js", "util")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "全局JS定义", "工具对象")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            工具对象:

            +

            + 工具对象也是静态对象的一种,把一系列常用的静态属性和函数归类到一个工具对象中。目前包括断言工具(Z.A/Z.Asserts)、对象工具(Z.O/Z.Objects)、类型工具(Z.T/Z.Types)、 + 验证工具(Z.V/Z.Validates)、表单工具(Z.FM/Z.Forms)、JSON工具(Z.J/Z.Jsons)、日期工具(Z.DT/Z.DateTimes)、数组工具(Z.AR/Z.Arrays)、字符串工具(Z.S/Z.Strings)、算术工具(Z.Maths)、 + 金额工具(Z.AM/Z.Amounts)和颜色工具(Z.Colors)。 +

            +
            + +<#-- 断言工具(Z.A) --> +
            断言工具(Z.A/Z.Asserts)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.A.assertNotEmpty(value, message)断言不为空value断言的值
            message断言失败时告警信息
            Z.A.assertNotEmptyBlank(value, message)断言不为空白value断言的值
            message断言失败时告警信息
            + +<#-- 对象工具(Z.O) --> +
            对象工具(Z.O/Z.Objects)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.O.isOwn(obj, prop)是否自己的属性
            Object.prototype.hasOwnProperty
            obj指定的对象
            prop指定的属性名
            Z.O.isCommon(obj, prop)是否普通属性
            属性名是数字或字符串,属性值非函数的属性
            obj指定的对象
            prop指定的属性名
            Z.O.toString(obj)对象字符串并去掉“[object ”和“]”前后缀
            Object.prototype.toString
            obj指定的对象
            Z.O.toStyleString(obj)转化为样式风格字符串,分号分隔
            如:width:100px;height:100px;
            obj指定的对象
            Z.O.toJSONString(obj)转化为JSON字符串
            如:{width:"100px",height:"100px"}
            obj指定的对象
            + +<#-- ID工具(Z.Ids) --> +
            ID工具(Z.Ids)
            + + + + + + + + + + + + +
            函数说明备注
            Z.Ids.uuid()生成ID通过随机数和当前时间生成唯一编号,格式:
            + XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
            + 1、1-8位随机数
            + 2、3段4长度的随机数
            + 3、8位长度时间+4位随机数
            + +<#-- 类型工具(Z.T) --> +
            对象工具(Z.T/Z.Types)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.T.isBoolean(obj)是否布尔值obj指定的对象
            Z.T.isNumber(obj)是否数值类型obj指定的对象
            Z.T.isString(obj)是否字符串obj指定的对象
            Z.T.isPrimitive(obj)是否基本类型(布尔值或数值类型或字符串)obj指定的对象
            Z.T.isFunction(obj)是否函数obj指定的对象
            Z.T.isArray(obj)是否数组obj指定的对象
            Z.T.isDate(obj)是否日期obj指定的对象
            Z.T.isRegExp(obj)是否正则表达式obj指定的对象
            Z.T.isObject(obj)是否对象obj指定的对象
            Z.T.isPlainObject(obj)纯对象obj指定的对象
            Z.T.isLikeArray(obj)是否类似数组obj指定的对象
            Z.T.isNull(obj)是否为nullobj指定的对象
            Z.T.isUndefined(obj)是否未定义obj指定的对象
            Z.T.isNaN(obj))是否非数值obj指定的对象
            Z.T.isInfinity(obj)是否无限数obj指定的对象
            Z.T.isNonInfinity(obj)是否负无限数obj指定的对象
            Z.T.isNil(obj)是否无效数(未定义、null、非数值、无限数、负无限数)obj指定的对象
            Z.T.isWindow(obj)是否window对象obj指定的对象
            Z.T.isDocument(obj)是否文档对象obj指定的对象
            Z.T.isElement(obj)是否元素对象obj指定的对象
            Z.T.isArguments(obj)是否参数对象obj指定的对象
            + +<#-- 验证工具(Z.V) --> +
            对象工具(Z.V/Z.Validates)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            单字符验证,支持是否是数字、小数、字母、大写字母、小写字母、字母和数字
            Z.V.isDigit(c)是否是数字c指定的字符
            Z.V.isDot(c)单字字符c指定的字符
            Z.V.isColon(c)是否是冒号c指定的字符
            Z.V.isDigitOrDot(c)是否是数字或小数点c指定的字符
            Z.V.isDigitOrColon(c)是否是数字或冒号
            如时间表示
            c指定的字符
            Z.V.isLetter(c)是否是字母大小写c指定的字符
            Z.V.isLetterLowercase(c)是否是小写字母c指定的字符
            Z.V.isLetterUppercase(c)是否是大写字母c指定的字符
            Z.V.isLetterOrDigit(c)是否是字母或者数字c指定的字符
            字符串验证,支持是否符合正则表达式、为空、非空、空白、非空白、数值型等
            Z.V.isRegexp(regexp, s)是否是正则表达式regexp检查是否符合正则表达式规范
            s指定的字符串
            Z.V.isEmpty(s)检查是否为空s指定的字符串
            Z.V.isNotEmpty(s)检查是否不为空s指定的字符串
            Z.V.isEmptyBlank(s)检查是否为空白(空或长度为0或由空白符构成)s指定的字符串
            Z.V.isNotEmptyBlank(s)检查不为空白s指定的字符串
            Z.V.isNumeric(s)检查是否为数值字符串s指定的字符串
            Z.V.isNumericLen(s, min, max)检查是否为数值字符串且符合长度要求s指定的字符串
            min指定的最小长度
            max指定的最大长度
            Z.V.isInteger(s)检查是否为整数s指定的字符串
            Z.V.isIntegerValue(s, min, max)检查是否为整数且符合值范围s指定的字符串
            min指定的最小值
            max指定的最大值
            Z.V.isIntegerPositive(s)检查是否为正整数s指定的字符串
            Z.V.isFloat(s)检查是否为浮点型s指定的字符串
            Z.V.isAmount2R(s)检查是否为金额值s指定的字符串
            Z.V.isDate(s)检查是否为日期s指定的字符串
            Z.V.isTime(s)检查是否为时间s指定的字符串
            Z.V.isDateTime(s)检查是否为时间,格式为日期+时间s指定的字符串
            Z.V.isEmail(s)检查是否为邮件s指定的字符串
            Z.V.isMobile(s)检查是否为手机号s指定的字符串
            Z.V.isMobile11(s)检查是否为11位手机号s指定的字符串
            Z.V.isContain(strs, separator, s)检查是否包含字符串strs包含的字符串
            s指定的字符串
            其他验证
            Z.V.isLeapYear(year)检查是否闰年year输入的年份
            + +<#-- 表单工具(Z.FM) --> +
            表单工具(Z.FM/Z.Forms)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.FM.clearForm(form)清空表单form指定的表单
            Z.FM.clearSelect(elem)清空选择框的数据elem指定的选择框
            Z.FM.isChecked(name, form)判断是否选中单选框或多选框name名称
            form指定的表单,未传入查全部names
            Z.FM.getChecked(name, form)获取被选中单选框和多选框的值name名称
            form指定的表单,未传入查全部names
            Z.FM.getCheckBoxValue(name, form)获取多选框的值,多个用逗号隔开name名称
            form指定的表单,未传入查全部names
            Z.FM.doSelectCheckBox(name, policy, form)全选,反选和取消,三个参数都可以不传入name名称
            policy指定策略,1表示全选,2表示全取消,0表示反选,未传值默认0
            form指定的表单,未传入查全部names
            Z.FM.doSelectCheckBoxTree(name, checked, value, form)选择树,选中自己时同时选中所有子节点,和父继承节点name名称
            checked是否选中,true|false
            value当前选择多选框的值,用于子节点和父节点判断是否对应
            form指定的表单,未传入查全部names
            + +<#-- JSON工具(Z.Jsons) --> +
            JSON工具(Z.J/Z.Jsons)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.J.toObject(str)返回JSON对象str指定的字符串
            Z.J.toString(obj)转化为字符串obj指定的对象
            Z.J.toKey(key)转为带双引号的KEY字符串str指定的字符串
            Z.J.addEscapeChar(str, quotation)添加转义符str指定的字符串
            quotation引号字符,单引号或双引号
            + +<#-- 日期工具(Z.DT) --> +
            日期工具(Z.DT/Z.DateTimes)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.DT.getDateTimeString()取得当前的日期时间字符串,格式:yyyy-MM-dd HH:mm:ss
            Z.DT.getDateString()取得当前的日期时间字符串,格式:yyyy-MM-dd
            Z.DT.getCurrentYear()获取当前年份
            Z.DT.getCurrentMonth()获取当前月份
            Z.DT.getCurrentMonthDays()获取当前月天数
            Z.DT.getCurrentDay()获取当前日期
            Z.DT.getMonthDays(year, month)获取指定月天数year指定的年份(yyyy)
            month指定的月份(1-12)
            Z.DT.getDateWeek(year, month, day)求星期取值,获取指定时间的星期数:星期一=1;星期二=2;星期三=3;星期四=4;星期五=5;星期六=6;星期日=7year指定的年份(yyyy)
            month指定的月份(1-12)
            day指定的日期(1-31))
            Z.DT.toDateString(date)Date对象转换为String
            格式:“yyyy-MM-dd”
            +
            date指定的Date对象
            Z.DT.toTimeString(date)Date对象转换为String
            格式:“HH:mm:ss”
            date指定的Date对象
            Z.DT.toDateTimeString(date)Date对象转换为String
            格式为:"yyyy-MM-dd HH:mm:ss"
            date指定的Date对象
            Z.DT.toDate (date, time)String转为Date对象
            标准日期格式:"yyyy-MM-dd"
            标准时间格式:"HH:mm:ss"
            date字符串,格式:“yyyy-MM-dd”
            time字符串,格式:“HH:mm:ss”
            + +<#-- 数组工具(Z.AR) --> +
            数组工具(Z.AR/Z.Arrays)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.AR.first(objs)获取数组中第一个objs指定的数组
            Z.AR.last(objs)获取数组中最后一个objs指定的数组
            Z.AR.indexOf(objs, obj)获取对象在数组中的索引号
            +
            objs指定的数组
            obj指定的对象
            Z.AR.contains(objs, obj)判断对象是否在数组中
            +
            objs指定的数组
            obj指定的对象
            Z.AR.remove(objs, obj)从数组中删除指定的对象
            +
            objs指定的数组
            obj指定的对象
            Z.AR.toArray(strs, separator)字符串按分隔符转为数组strs指定的字符串
            Z.AR.toObject(strs, separator)字符串按分隔符转成对象
            如:width:100px;max-height:100px;
            转:{width:"100px",maxHeight:"100px"}
            注:中杠会去掉并下一字符大写
            strs指定的字符串
            Z.AR.toString(values, separator)数组按分隔符转换成字符串values指定的数组
            Z.AR.toJSONString(values)转换成JSON字符串values指定的数组
            + +<#-- 字符串工具(Z.S) --> +
            字符串工具(Z.S/Z.Strings)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.S.trim(s)去掉字符串左边及右边的空格s指定的字符串
            Z.S.trimLeft(s)去掉字符串左边的空格s指定的字符串
            Z.S.trimRight(s)去掉字符串右边的空格s指定的字符串
            Z.S.startWith(str, s)字符串str是否以s开始str原字符串
            s比较字符串
            Z.S.endWith(str, s)字符串str是否以s结尾str指定的原字符串
            s比较字符串
            Z.S.equalsIgnoreCase(s1, s2)忽略大小写两字符串是否相等s1指定的字符串1
            s2指定的字符串2
            Z.S.replaceAll(s, src, dest, ignoreCase)替换字符串,执行全部匹配s指定的字符串
            src被替换的字符串
            dest替换后的字符串
            ignoreCase是否忽略大小写,未传入值为false
            Z.S.lengthUnicode(s)转换为Unicode编码长度s指定的字符串
            Z.S.lengthUnicode35(s)转换为Unicode35位编码长度s指定的字符串
            Z.S.toUTF8(s)转换为UTF8编码s指定的字符串
            Z.S.toHexString(b)转换成ASCII字符s指定的字符串
            Z.S.prefixZero(str, len)前缀补零,得到给定长度的值,补足0str初始str
            len指定的长度
            Z.S.prefixLen(str, len, prefix)前缀补齐,通过给定初始str,和前置char,得到给定长度的值, 通常用于前补0等str初始str
            len指定的长度
            prefix前置char
            Z.S.prefixNum(text)取前缀数字text指定的字符串
            Z.S.prefixZeroRemove(value)删除整型的前缀0value指定的需要删除前缀的数据
            Z.S.removeSecondDot(value)删除小数第二个小数点后面的数据value指定的数据
            Z.S.removeAmountZero(value)金额抹零value指定的金额值
            + +<#-- 算术工具(Z.Maths) --> +
            算术工具(Z.Maths)
            + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.Maths.multiply(m, m2)数字相乘m数字1
            m2数字2
            + +<#-- 金额工具(Z.Amounts) --> +
            金额工具(Z.AM/Z.Amounts)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.Amounts.toYuan(amount)金额分,转为字符串元,转化后最大2位小数点,没有的不保留小数点amount金额分值
            Z.Amounts.toYuanMustRadix(amount)金额分,转为字符串元,转化后强制为2位小数点,没有的为.00amount金额分值
            Z.Amounts.toFen(str, defaultValue)金额元字符串转int金额分,支持整数、1位小数和2位小数点的金额字符串str金额元的字符串
            defaultValue缺省值
            + +<#-- 颜色工具(Z.Colors) --> +
            颜色工具(Z.Colors)
            + + + + + + + + + + + + + + + + + + + + + + + + + + +
            函数说明参数参数说明
            Z.Colors.toString(iColor) 数字的颜色转为字符串十六进制格式(#750848)iColor指定的颜色
            Z.Colors.toInt(sColor)字符串十六进制(#750848)格式转为数字的颜色sColor指定的颜色
            Z.Colors.toArray(color)颜色(数字型或字符串#750848)转为红绿蓝数组color指定的颜色
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/nav/tabnav.htm b/zhiqim_ui/document/tutorial/uim/nav/tabnav.htm new file mode 100644 index 0000000..7aa6895 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/nav/tabnav.htm @@ -0,0 +1,227 @@ +<#def title = "标签页"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = " 标签页是参考tabnav设计出更简单易用的内容重叠布局的导航页。标签页使用nav和section作为是标签和内容显示。在nav中使用li表示每个标签,在section中使用div作为每个标签显示的内容。"/> +<#def prevUrl = "../dialog/loading.htm"/> +<#def nextUrl = "../tool/ajax.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "nav", "tabnav")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "导航和提醒", "标签页")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            标签页:

            +

            + 标签页是参考tabnav设计出更简单易用的内容重叠布局的导航页。标签页使用nav和section作为是标签和内容显示。在nav中使用li表示每个标签,在section中使用div作为每个标签显示的内容。 +

            +
            + +<#-- 一、无边框和无标题,标签在左侧 --> +
            一、无边框和无标题,标签在左侧
            + +
            + +
            +
            + +
            + +
            +
            + 标签一内容 +
            +
            + 标签二内容 +
            +
            + 标签三内容 +
            +
            +
            +
            +
            + +
            + +
            + 1、定义一个div,包含属性[data-role="z-tabnav"]和[class="z-tabnav"]
            + 2、在div下包括两大元素nav和section。其中nav表示标签部分,section表示内容显示部分
            + 3、在nav中通过ul和li把标签设定好,如例子中标签一、标签二、标签三。其中有[class="z-active"]的表示当前激活标签
            + 4、在section中对应li编写三个标签内容div和li个数和顺序对应。其中有[class="z-active"]的表示当前激活标签,[class="z-pd10"]表示标签内容内边距10px +
            +
            +
            + +<#-- 二、无边框和有标题,标签在右侧,内容有边框 --> +
            二、无边框和有标题,标签在右侧,内容有边框
            + +
            + +
            +
            + +
            + +
            +
            + 标签一内容 +
            +
            + 标签二内容 +
            +
            + 标签三内容 +
            +
            +
            +
            +
            + +
            + +
            + 1、定义一个div,包含属性[data-role="z-tabnav"]和[class="z-tabnav"]
            + 2、在div下包括两大元素nav和section。其中nav表示标签部分,section表示内容显示部分
            + 3、在nav中通过ul和li把标签设定好,如例子中标签一、标签二、标签三。其中有[class="z-active"]的表示当前激活标签
            + 4、在section中对应li编写三个标签内容div和li个数和顺序对应。其中在section中定义[class="z-pd-t20"]表示所有标签内容顶部内边距为20px
            + 5、在section标签内容中[class="z-active"]的表示当前激活标签,[class="z-pd10"]表示标签内容内边距10px,[class="z-bd z-bd-rd5"]表示标签内容有5像素圆角边框 +
            +
            +
            + +<#-- 三、有边框和有标题,标签在右侧,加大字体 --> +
            三、有边框和有标题,标签在右侧,加大字体
            + +
            + +
            +
            + +
            + +
            +
            + 标签一内容 +
            +
            + 标签二内容 +
            +
            + 标签三内容 +
            +
            +
            +
            +
            + +
            + +
            + 1、定义一个div,包含属性[data-role="z-tabnav"]和[class="z-tabnav z-bordered"]表示有边框
            + 2、在div下包括两大元素nav和section。其中nav表示标签部分,section表示内容显示部分
            + 3、在nav中通过ul和li把标签设定好,如例子中标签一、标签二、标签三。其中有[class="z-active"]的表示当前激活标签
            + 4、在section中对应li编写三个标签内容div和li个数和顺序对应。其中有[class="z-active"]的表示当前激活标签,[class="z-pd10"]表示标签内容内边距10px +
            +
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/tool/ajax.htm b/zhiqim_ui/document/tutorial/uim/tool/ajax.htm new file mode 100644 index 0000000..dbc7261 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/tool/ajax.htm @@ -0,0 +1,759 @@ +<#def title = "AJAX"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = " AJAX即“Asynchronous Javascript And XML”(异步JavaScript和XML),是指一种创建交互式网页应用的网页开发技术"/> +<#def prevUrl = "../nav/tabnav.htm"/> +<#def nextUrl = "imageClipper.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "tool", "ajax")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "工具", "Ajax")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            AJAX:

            +

            + AJAX即“Asynchronous Javascript And XML”(异步JavaScript和XML),是指一种创建交互式网页应用的网页开发技术。 + 凡狐AJAX采用面向RMI的概念设计,通过指定类和方法,传入参数对应方法的参数,通过RMI访问JAVA类的方法获取执行结果。 +

            +
            + +<#-- 一、调用成功,回调函数(无参数的方法) --> +
            一、调用成功,回调函数(无参数的方法)
            + +
            + +
            +
            + + + + 点我执行[doTestSuccess]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类名或类别名、类方法和回调函数,然后执行
            + 2、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 二、调用成功,回调函数(带参数、使用类别名@AnAlias) --> +
            二、调用成功,回调函数(带参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestParam]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、通过ajax.addParam();设置参数,参数个数和类型要和后端对应,支持字符串和基本类型 + 3、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 三、调用成功,显示到元素中(无参数、使用类别名@AnAlias) --> +
            三、调用成功,显示到元素中(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestSuccess]函数

            + + 返回内容: +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类名或类别名、类方法和回调函数,然后执行
            + 2、在页面上设置点击执行函数,把结果放置到Z("#"+id)中
            +
            +
            +
            + +<#-- 四、调用成功,加载器,后端等待5秒(无参数、使用类别名@AnAlias) --> +
            四、调用成功,加载器,后端等待5秒(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestLoading]函数

            +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、通过ajax.setLoading(document, true);设置全屏加载器且遮罩,然后执行
            + 3、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 五、调用成功,指定加载器元素,后端等待5秒(无参数、使用类别名@AnAlias) --> +
            五、调用成功,指定加载器元素,后端等待5秒(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestLoading2]函数

            + + +
            +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、通过ajax.setLoading("testLoading2");设置在testLoading2上显示加载器无遮罩,然后执行
            + 3、如果需要遮罩层,设置为ajax.setLoading("testLoading2", true); + 4、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 六、调用成功,自定义加载器,后端等待5秒(无参数、使用类别名@AnAlias) --> +
            六、调用成功,自定义加载器,后端等待5秒(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestLoading3]函数

            + + +
            +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、通过Z.loading()函数自定义加载器,然后通过ajax.setLoading();设置到Z.Ajax中
            + 3、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 七、调用失败(无参数、使用类别名@AnAlias) --> +
            七、调用失败(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestError]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 八、调用异常(无参数、使用类别名@AnAlias) --> +
            八、调用异常(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestException]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            +
            +
            +
            + +<#-- 九、拦截器,未通过显示未通过信息(无参数、使用类别名@AnAlias) --> +
            九、拦截器,未通过显示未通过信息(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestInterceptor]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            + 3、拦截器由Java后端设置,如: + + @AnInterceptor("chkAjax1") + public static void doTestInterceptor(HttpRequest request) + { + request.setResponseResult("返回成功信息"); + } + + + @AnAlias("chkAjax1") + public class AjaxChk1Interceptor implements Interceptor + { + @Override + public void intercept(HttpRequest request) throws Exception + { + request.setResponseError("拦截器不通过"); + } + } + +
            +
            +
            + +<#-- 十、拦截器,未通过显示未通过信息(同步调用、无参数、使用类别名@AnAlias) --> +
            十、拦截器(同步调用、无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestSyncInterceptor]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法
            + 2、通过ajax.setSync();设置表示设置成同步等待,同步调用时无需提供回调函数,直接在执行后读出结果即可
            + 3、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            + 4、拦截器由Java后端设置,如: + + @AnInterceptor("chkAjax1") + public static void doTestInterceptor(HttpRequest request) + { + request.setResponseResult("返回成功信息"); + } + + + @AnAlias("chkAjax1") + public class AjaxChk1Interceptor implements Interceptor + { + @Override + public void intercept(HttpRequest request) throws Exception + { + request.setResponseError("拦截器不通过"); + } + } + +
            +
            +
            + +<#-- 十一、拦截器,未通过跳转到新页面(无参数、使用类别名@AnAlias) --> +
            十一、拦截器,未通过跳转到新页面(无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestInterceptor2]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法和回调函数
            + 2、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            + 3、拦截器由Java后端设置,如: + + @AnInterceptor("chkAjax2") + public static void doTestInterceptor2(HttpRequest request) + { + request.setResponseResult("返回成功信息"); + } + + + @AnAlias("chkAjax2") + public class AjaxChk2Interceptor implements Interceptor + { + + @Override + public void intercept(HttpRequest request) throws Exception + { + request.setRedirectTop(request.getRootPath("/index.htm"), "拦截器要求,正地跳转到首页"); + } + } + +
            +
            +
            + +<#-- 十二、拦截器,未通过跳转到新页面(同步调用、无参数、使用类别名@AnAlias) --> +
            十二、拦截器,未通过跳转到新页面(同步调用、无参数、使用类别名@AnAlias)
            + +
            + +
            +
            + + + + 点我执行[doTestSyncInterceptor2]函数 +
            +
            + +
            + +
            + 1、定义一个AJAX调用函数,设置类类别名、类方法
            + 2、通过ajax.setSync();设置表示设置成同步等待,同步调用时无需提供回调函数,直接在执行后读出结果即可
            + 3、在页面上设置点击执行函数,通过设置callback回调得到responseStatus和responseText
            + 4、拦截器由Java后端设置,如: + + @AnInterceptor("chkAjax2") + public static void doTestInterceptor2(HttpRequest request) + { + request.setResponseResult("返回成功信息"); + } + + + @AnAlias("chkAjax2") + public class AjaxChk2Interceptor implements Interceptor + { + + @Override + public void intercept(HttpRequest request) throws Exception + { + request.setRedirectTop(request.getRootPath("/index.htm"), "拦截器要求,正地跳转到首页"); + } + } + +
            +
            +
            + +<#-- AJAX调用参数说明 --> +
            AJAX调用参数说明(请求参数十个,响应结果两个)
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            参数说明
            请求参数
            contextPath默认为空当前上下文环境路径,如/admin,默认为空表示根上下文路径
            className必须调用的类名或类别名,如AjaxPresenter/com.zhiqim.zhiqim.tutorial.presenter.AjaxPresenter
            methodName必须调用的类的方法名,如doTestInterceptor
            asynctrue异常还是同步调用,默认异步,true|false
            params[]参数数组,可通过addParam();函数设置参数,如addParam("abc");
            callbacknull回调函数或回调elem的id
            + 1、函数的this为Z.Ajax对象,可以通过this.responseStatus和this.responseText获取结果状态和结果文本
            + 2、回调ID时,填写elem的id,即把this.responseText的值填充到elem中,有三种填充方式,见callbackMethod参数 +
            callbackMethod"html"回调ID时的方法,三种"html"|"text"|"val"
            callScripttrue是否在AJAX结果的改变重置由data-role的缓存,如Z.Tooltip,Z.Select等,true|false,默认true
            loadingnull三种加载器,通过方法setLoading();方法来设置
            + 1、传入Z.loading对象,参数由对象指定,如ajax.setLoading(Z.loading({target: "testLoading3", shadow: true, position: 1})); + 2、传入target和是否遮罩,如ajax.setLoading(document, true);或无遮罩ajax.setLoading(document); + 3、传入targetId和是否遮罩,如ajax.setLoading("testLoading3", true);或无遮罩ajax.setLoading("testLoading3"); + 4、传入一个函数,在加载时回调该函数,如ajax.setLoading(function(){});此方式用于自定义操作 +
            loadingParamnull加载器参数,通过方法setLoading();方法来设置,是第二个参数
            + 1、当loading是Z.loading和字符串时表示是否遮罩
            + 2、当#ID时指定的HTML,成功后换回原始HTML +
            响应参数
            responseStatus0响应状态,0表示成功,601-603表示跳转,其他表示错误
            responseTextnull响应文本字符串,默认是text/plain格式,XML或JSON格式自行转化
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/tool/imageClipper.htm b/zhiqim_ui/document/tutorial/uim/tool/imageClipper.htm new file mode 100644 index 0000000..fc3b129 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/tool/imageClipper.htm @@ -0,0 +1,113 @@ +<#def title = "头像裁剪"/> +<#def keyword = "Avatar"/> +<#def desc = "头像裁剪是指对上传的图片,根据要求裁剪成指定大小的图片。支持放大和缩小图片,和通过移动图片,锁定裁剪位置"/> +<#def prevUrl = "ajax.htm"/> +<#def nextUrl = "upload.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} +${Scripts.src("/zinc/www/zhiqim_image_clipper.js")} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "tool", "imageClipper")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "工具", "头像裁剪")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            头像裁剪:

            +

            + 头像裁剪是指对上传的图片,根据要求裁剪成指定大小的图片。支持放大和缩小图片,和通过移动图片,锁定裁剪位置 +

            +
            + +<#-- 一、简单拖拽 --> +
            一、头像裁剪
            + +
            + +
            +
            + +
            +
            +
            + +
            + +
            + 1、拖拽三要求,可拖拽对象、拖把和拖拽父范围,这三个对象都需要设置id
            + 2、简单拖拽只需要配置可拖拽对象、拖把两个id,简单拖拽不固定范围
            +
            +
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/tool/qrcode.htm b/zhiqim_ui/document/tutorial/uim/tool/qrcode.htm new file mode 100644 index 0000000..a86ef14 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/tool/qrcode.htm @@ -0,0 +1,191 @@ +<#def title = "文件上传"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = " 凡狐文件上传提供了多种上传方法,支持表单上传、单文件上传,多文件上传,预览再上传等。"/> +<#def prevUrl = "zeditor.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${Scripts.src(context.getRootPath("/src/qrcode/qrcode.js"))} +${Scripts.src(context.getRootPath("/src/qrcode/zhiqim_qrcode.js"))} +${zhiqim_com_head_end()} + +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "tool", "qrcode")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "工具", "生成二维码")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            生成二维码:

            +

            + 通过本地 JS 将字符串转成二维码图形输出,支持方法定义、实例定义两种。 +

            +
            + +<#-- 一、调用方法的方式 --> +
            一、调用方法的方式
            + +
            + +
            +
            + + + + +

            + + + +
            +
            + +
            + +
            + 1、text 参数必须传入非空值,只有字符串一个参数时,无需详细写明,如方式一
            + 2、这种方法不需要传入 elem 参数
            +
            +
            +
            + +<#-- 二、定义实例的方式 --> +
            二、定义实例的方式
            + +
            + +
            +
            + + + + +

            + + + +
            +
            + +
            + +
            + 1、text 参数必须传入非空值
            + 2、实例方式清晰明了,必须传入 elem 的值
            +
            +
            +
            + +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            + +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/tool/upload.htm b/zhiqim_ui/document/tutorial/uim/tool/upload.htm new file mode 100644 index 0000000..64f2be9 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/tool/upload.htm @@ -0,0 +1,342 @@ +<#def title = "文件上传"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = " 凡狐文件上传提供了多种上传方法,支持表单上传、单文件上传,多文件上传,预览再上传等。"/> +<#def prevUrl = "imageClipper.htm"/> +<#def nextUrl = "uploadLarge.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "tool", "upload")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "工具", "文件上传")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            文件上传:

            +

            + 凡狐文件上传提供了多种上传方法,支持表单上传、单文件上传,多文件上传,预览再上传等。 +

            +
            + +<#-- 一、最简单文件上传 --> +
            一、最简单文件上传
            + +
            + +
            +
            + + + +

            + + + +
            +
            + +
            + +
            + 1、最简文件上传,是初始化单个文件上传控件
            + 2、参数只需要指定上传按钮id和上传成功事件onCompleted
            + 3、在后台配置上下文环境属性upload.rootDir即可 +
            +
            +
            + +<#-- 二、单文件上传(先预览后上传) --> +
            二、单文件上传(先预览后上传)
            + +
            + +
            +
            + + + + +
            + + + +

            + + + +
            +
            + +
            + +
            + 1、最简文件上传,是初始化单个文件上传控件
            + 2、参数只需要指定上传按钮id和上传成功事件onCompleted
            + 3、在后台配置上下文环境属性upload.rootDir
            + 4、如果需要分成两步,先预览后上传,则增加预览处理 +
            +
            +
            + +<#-- 三、多文件上传(先预览后上传,默认图片) --> +
            三、多文件上传(先预览后上传,默认图片)
            + +
            + +
            +
            + + + + +
            + + +
            + + +
            + + +
            +
            +
            + +
            + +
            + 1、最简文件上传,是初始化多个文件上传控件
            + 2、参数只需要指定上传按钮id和上传成功事件onCompleted
            + 3、在后台配置上下文环境属性upload.rootDir
            + 4、如果需要分成两步,先预览后上传,则增加预览处理 +
            +
            +
            + +<#-- 四、表单文件上传,可以含参数 --> +
            四、表单文件上传,可以含参数
            + +
            + +
            +
            + +
            + 参数1:
            + 参数2:
            + + + + +
            +
            +
            + +
            + +
            + 1、表单文件上传的特点是支持参数一起传递,采用multipart/form-data格式
            + 2、把真实的文件上传按钮隐藏起来(各浏览器表现不一样,太不美观),使用一个button代替
            + 3、提供一个span用户显示文件选择的路径,这里也可以设计成预览
            + 4、上传button,和提供一个Action处理数据。如下: + + public class UploadFormAction implements Action, HttpdConstants + { + private static final Log log = LogFactory.getLog(UploadFormAction.class); + + @Override + public void execute(HttpRequest request) throws Exception + { + String rootDir = request.getContextAttributeString(_SERV_UPLOAD_ROOT_DIR_); + if (Validates.isEmptyBlank(rootDir) || !Files.mkDirectory(rootDir)) + { + request.setAlertMsg("未配置上传目录,不支持上传"); + return; + } + + HttpUploader uploader = new HttpUploader(); + + try + {//最大支持2M + uploader.parseHttpRequest(request, 2*1024*1024); + + String fileExt = uploader.getFileExt(); + if(Validates.isEmpty(fileExt) || !Validates.isContain("jpg,png,gif", ",", fileExt)) + { + request.setAlertMsg("仅支持图片,请重新上传"); + return; + } + + //文件字节比较 + byte[] content = uploader.getBytes(); + if (!(Bytes.isGIZ(content) || Bytes.isPNG(content) || Bytes.isJPG(content))) + { + request.setAlertMsg("图片格式不正确,请重新上传"); + return; + } + + //读出参数 + String param1 = uploader.getParameter("p1"); + String param2 = uploader.getParameter("p2"); + log.info("参数1:"+param1+",参数2:"+param2); + + //保存文件 + String fileDir = Strings.addEndsWith(Files.toLinuxPath(rootDir), "/"); + String fileName = Ids.longId() + "." + fileExt; + uploader.writeToFile(fileDir + fileName); + + request.setAlertMsg("上传成功"); + } + catch(Exception e) + { + request.setAlertMsg("上传失败"); + } + finally + { + uploader.close(); + } + } + } + +
            +
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/tool/uploadLarge.htm b/zhiqim_ui/document/tutorial/uim/tool/uploadLarge.htm new file mode 100644 index 0000000..0d79856 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/tool/uploadLarge.htm @@ -0,0 +1,169 @@ +<#def title = "大文件上传"/> +<#def keyword = "大文件上传 ZhiqimUI zhiqim"/> +<#def desc = " 凡狐文件上传提供了多种上传方法,支持表单上传、单文件上传,多文件上传,预览再上传,大文件上传断点续传(HTML5和Flash两种)等。"/> +<#def prevUrl = "upload.htm"/> +<#def nextUrl = "zeditor.htm"/> +${zhiqim_com_head()} +${zhiqim_com_head_main()} + +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "tool", "uploadlarge")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "工具", "大文件上传")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            大文件上传:

            +

            + 凡狐大文件上传提供了(HTML5和Flash两种)的上传方式,支持断点续传、数据库存储文件碎片和文件信息,提供指定目录和文件名等功能。 +

            +
            + +<#-- 一、HTML5大文件断点续传 --> +
            一、HTML5大文件断点续传
            + +
            + +
            +
            + + + + + +
            +
            + +
            + +
            + 1、需要zhiqim_uploader组件,或者自己实现com.zhiqim.zhiqim.httpd.context.service.upload.Upload接口
            + 2、设计目标是针对大文件分块上传,支持断点续传和秒传(MD5码相同认为已上传)
            + 3、在后台配置上下文环境属性upload.rootDir
            + 4、指定目录:upload.fileDir = "html5"; + 5、指定文件格式:upload.setFileFormatExt("image/gif, image/jpeg"); + 6、需支持HTML5协议的浏览器支持 +
            +
            +
            + +<#-- 二、Flash大文件断点续传 --> +
            二、Flash大文件断点续传
            + +
            + +
            +
            + + + + + +
            +
            + +
            + +
            + 1、需要zhiqim_uploader组件,或者自己实现com.zhiqim.zhiqim.httpd.context.service.upload.Upload接口
            + 2、设计目标是针对大文件分块上传,支持断点续传和秒传(MD5码相同认为已上传)
            + 3、在后台配置上下文环境属性upload.rootDir
            + 4、指定目录:upload.fileDir = "html5"; + 5、指定文件格式描述:upload.setFileFormatDesc("PNG和GIF图片(*.png;*.gif)"); + 6、指定文件格式:upload.setFileFormatExt("*.png;*.gif"); + 7、需支持Flash的浏览器 +
            +
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/document/tutorial/uim/tool/zeditor.htm b/zhiqim_ui/document/tutorial/uim/tool/zeditor.htm new file mode 100644 index 0000000..02302d9 --- /dev/null +++ b/zhiqim_ui/document/tutorial/uim/tool/zeditor.htm @@ -0,0 +1,106 @@ +<#def title = "富文本编辑器"/> +<#def keyword = "ZhiqimUI"/> +<#def desc = " 实现源码编辑、撤销、重做、字体样式、文本对齐、超链接、图片上传、复制粘贴等功能。"/> +<#def prevUrl = "uploadLarge.htm"/> +<#def nextUrl = "qrcode.htm"/> +${zhiqim_com_head()} +<#var zRTEditor.css=context.getRootPath("/src/zRTEditor/zRTEditor.css")/> +<#var zRTEditor.js=context.getRootPath("/src/zRTEditor/zRTEditor.js")/> +${Styles.src(zRTEditor.css)} +${Scripts.src(zRTEditor.js)} +${zhiqim_com_head_main()} +${zhiqim_com_head_end()} + +${zhiqim_com_mobileUI_scrollJs()} +${zhiqim_com_body()} +${zhiqim_com_topnav("ui")} + + +
            + +${zhiqim_com_container_ui("ZmUI", "tool", "zeditor")} + + +
            + +${zhiqim_com_breadcrumb("UI", "ZmUI", "工具", "富文本编辑器")} + + +
            + + +
            + +<#-- 标题 --> +
            +

            富文本编辑器:

            +

            + 实现源码编辑、撤销、重做、字体样式、文本对齐、超链接、图片上传、复制粘贴等功能。 +

            +
            + +<#-- 一、示例样式 --> +
            一、示例
            + + + + + + + + + + +
            效果预览
            + + + + +
            +
            查看结果
            +
            
            +    
            + +
            +
            + + +${zhiqim_turorial_ZmUI_demo_start()} +
            + +
            ZhiqimUI.mobile
            +
            + +
            +
            这里是内容
            +
            +${zhiqim_turorial_ZmUI_demo_end()} + + +
            + +${zhiqim_com_chapter()} + +
            + + +
            + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_ui/index.htm b/zhiqim_ui/index.htm new file mode 100644 index 0000000..7e620ac --- /dev/null +++ b/zhiqim_ui/index.htm @@ -0,0 +1,5 @@ +<#if request.isMobile()> +<#include "/zview/zhiqim_com/index_mobile.htm"/> +<#else> +<#include "/zview/zhiqim_com/index_pc.htm"/> + \ No newline at end of file diff --git a/zhiqim_ui/lib/zhiqim_ui_lib.jar b/zhiqim_ui/lib/zhiqim_ui_lib.jar new file mode 100644 index 0000000..562a406 Binary files /dev/null and b/zhiqim_ui/lib/zhiqim_ui_lib.jar differ diff --git a/zhiqim_ui/lib/zhiqim_upload_large.jar b/zhiqim_ui/lib/zhiqim_upload_large.jar new file mode 100644 index 0000000..3d13a2b Binary files /dev/null and b/zhiqim_ui/lib/zhiqim_upload_large.jar differ diff --git a/zhiqim_ui/release/zhiqim.mobile_v1.5.0.r2019010101.css b/zhiqim_ui/release/zhiqim.mobile_v1.5.0.r2019010101.css new file mode 100644 index 0000000..1855ebe --- /dev/null +++ b/zhiqim_ui/release/zhiqim.mobile_v1.5.0.r2019010101.css @@ -0,0 +1,2714 @@ +@charset "utf-8"; +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙登记发行许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ + +/*********************************************************/ +/*********************************************************/ +/***************** Ⅰ:通用定义 ******************/ +/*********************************************************/ +/*********************************************************/ + +/***********************************************/ +/* 第一部分:标准标记定义 */ +/***********************************************/ + +/***********************************************/ +/* 1.1:HTML5新增模块 */ +/***********************************************/ + +article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;} +audio,canvas,video{display:inline-block;vertical-align:baseline;} +audio:not([controls]){display:none;height:0;} +[hidden],template{display:none;} +svg:not(:root){overflow:hidden;} + +/***********************************************/ +/* 1.2:全局标记一致性定义 */ +/***********************************************/ +*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} +*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} +html{ + font-family:"微软雅黑","宋体",Arial,sans-serif; + overflow-x:hidden;overflow-y:auto; + -ms-text-size-adjust:100%; + -webkit-text-size-adjust:100%; + -webkit-tap-highlight-color:rgba(0, 0, 0, 0); + height:100%; +} +body{color:#333;background-color:#fff;} +body,form,figure{margin:0;} +img{border:0;vertical-align:middle;max-width:100%;max-height:100%;-ms-interpolation-mode:bicubic;} +p{margin:0px;padding:0px;} +hr{ + -webkit-box-sizing:content-box; + -moz-box-sizing:content-box; + box-sizing:content-box; + height:0;border:0;border-top:1px solid #eee;margin:1em 0;} + +fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;} +legend{border:0;padding:0;} + +ul,dl,ol,li{list-style:none;padding:0;margin:0;} +li{line-height:1.25em;} + +/* 设置A标签透明背景无下划线 ,获取焦点时为虚线,覆盖时无突出效果,有下划线*/ +a,a:visited{color:#333;text-decoration:none;background-color:transparent;} +a:active,a:hover{color:#06c;outline:0;text-decoration:underline;} + +/***********************************************/ +/* 1.3:表单一致性定义 */ +/***********************************************/ + +/** 统一Firefox默认按扭和输入框padding 0 2px,修改成统一无内边距 */ +button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;} +input{line-height:normal;} +optgroup{font-weight:bold;} +button,input,select,optgroup,textarea{color:inherit;font:inherit;margin:0;outline:none;/** 取消webkit默认选中边框 */} +button{overflow:visible;} +button,html input[type="button"],input[type="reset"],input[type="submit"] {-webkit-appearance:button;cursor:pointer;} +button[disabled],html input[disabled]{cursor:not-allowed;} +textarea{overflow:auto;word-wrap:break-word;resize:none;/**不支持缩放*/} +button,select{text-transform:none;}/*capitalize首字母大写 | uppercase统一大写 | lowercase | none | inherit*/ +/** 单多选按钮有2像素偏下,IE高度和背景白色问题,修改成高度为13px,背景透明 */ +input[type="checkbox"],input[type="radio"]{margin-top:-2px;border:0;padding:0;vertical-align:middle;height:13px;background-color:transparent;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} +/** 移动设备上webkit自定义数字框高度自动 */ +input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto;} +/** 移动设备上webkit自定义搜索框为文本字段,宽高设置采用content-box */ +input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;} +/** 移动设备上webkit自定义搜索框按钮取消原生样式 */ +input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration {-webkit-appearance:none;} + + +/***********************************************/ +/* 1.4:文本标记一致性定义 */ +/***********************************************/ + +/** 设置上标和下标字体是系统定义的75%,元素放置在父元素的基线上,以便在下面单独定义上下浮 */ +b{font-weight:bold;} +i{font-style:italic;} +u{text-decoration:underline;} +del{text-decoration:line-through;} +sub,sup{position:relative;vertical-align:baseline;line-height:0;font-size:75%;} +sup{top:-0.5em;} +sub{bottom:-0.25em;} +small{font-size:80%;}/* 设置小号字体是系统定义字体的80% */ +mark{background:#ff0;color:#000;}/* 设置文本标记颜色为通用的黑色+黄底#ffff00 */ +abbr[title]{border-bottom:1px dotted;}/* 设置缩短标签下加虚线 */ +@-moz-document url-prefix() {abbr[title]{border-bottom:none;}} + +/** 设置代码字体为linux默认字体,风格等 */ +code,kbd,pre,samp{font-family:Consolas,"Courier New",monospace,Menlo,Monaco,"微软雅黑";font-size:1em;} +code,kbd,pre{border-radius:4px;} +code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;} +kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333; + -webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.25); + box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.25); +} +kbd kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none;} +pre{overflow:auto;display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;} +pre code{padding:0;font-size:inherit;color:#c7254e;white-space:pre-wrap;background-color:transparent;border-radius:0;} + +zcover{position:relative;display:inline-block;} + +/***********************************************/ +/* 第二部分:图标定义 */ +/***********************************************/ + +/***********************************************/ +/* 2.1:字体图标 */ +/***********************************************/ + +@font-face { + font-family:"z-font"; + src:url('font/zhiqim.eot'); + src:url('font/zhiqim.eot?#iefix') format('embedded-opentype'), + url('font/zhiqim.woff') format('woff'), + url('font/zhiqim.ttf') format('truetype'), + url('font/zhiqim.svg#z-font') format('svg'); +} + +/** 字体图标不支持斜体,以便使用i标签来定义 */ +.z-font{ + font-family:"z-font" !important; + font-style:normal; + -webkit-font-smoothing:antialiased; + -webkit-text-stroke-width:0.2px; + -moz-osx-font-smoothing:grayscale; + position:relative; + bottom:-2px; +} +/** 操作类(f000-f03f) */ +.z-font.z-config:before{content:"\f000";} +.z-font.z-add:before{content:"\f001";} +.z-font.z-modify:before{content:"\f002";} +.z-font.z-delete:before{content:"\f003";} +.z-font.z-query:before{content:"\f004";} +.z-font.z-previous:before{content:"\f005";} +.z-font.z-next:before{content:"\f006";} +.z-font.z-open:before{content:"\f007";} +.z-font.z-close:before{content:"\f008";} +.z-font.z-upload:before{content:"\f009";} +.z-font.z-save:before{content:"\f00a";} +.z-font.z-finish:before{content:"\f00a";} +.z-font.z-return:before{content:"\f00b";} +.z-font.z-refresh:before{content:"\f00c";} +.z-font.z-success:before{content:"\f00d";} +.z-font.z-error:before{content:"\f00e";} +.z-font.z-setting:before{content:"\f00f";} +.z-font.z-share:before{content:"\f010";} +.z-font.z-download:before{content:"\f011";position:relative;bottom:1px;} + +.z-font.z-addfile:before{content:"\f012";} +.z-font.z-address:before{content:"\f013";} +.z-font.z-praise:before{content:"\f014";} +.z-font.z-diss:before{content:"\f015";} +.z-font.z-display:before{content:"\f016";} +.z-font.z-hide:before{content:"\f017";} +.z-font.z-negative:before{content:"\f018";} +.z-font.z-skin:before{content:"\f019";} +.z-font.z-copy:before{content:"\f01a";} +.z-font.z-tips:before{content:"\f01b";} +.z-font.z-notice:before{content:"\f01c";} +.z-font.z-signin:before{content:"\f01d";} +.z-font.z-consult:before{content:"\f01e";} +.z-font.z-message:before{content:"\f01f";} +.z-font.z-community:before{content:"\f020";} +.z-font.z-info:before{content:"\f021";} +.z-font.z-wangwang:before{content:"\f022";} +.z-font.z-space:before{content:"\f023";} +.z-font.z-problem:before{content:"\f024";} +.z-font.z-warning:before{content:"\f025";} +.z-font.z-play:before{content:"\f026";} +.z-font.z-hot:before{content:"\f027";} +.z-font.z-safe:before{content:"\f028";} +.z-font.z-task:before{content:"\f029";} +.z-font.z-assignment:before{content:"\f02a";} +.z-font.z-activity:before{content:"\f02b";} +.z-font.z-edit:before{content:"\f02c";} +.z-font.z-function:before{content:"\f02d";} +.z-font.z-serve:before{content:"\f02e";} +.z-font.z-more:before{content:"\f02f";} +.z-font.z-on:before{content:"\f030";} +.z-font.z-off:before{content:"\f031";} +/** 文档类(f040-f05f) */ +.z-font.z-folder:before{content:"\f040";} +.z-font.z-collect:before{content:"\f041";} +.z-font.z-briefcase:before{content:"\f042";} +.z-font.z-image-text:before{content:"\f043";} +.z-font.z-text:before{content:"\f044";} +.z-font.z-picture:before{content:"\f045";} +.z-font.z-video:before{content:"\f046";} +.z-font.z-voice:before{content:"\f047";} +.z-font.z-camera:before{content:"\f048";} +.z-font.z-print:before{content:"\f049";} + +.z-font.z-codesign:before{content:"\f04a";} +.z-font.z-order:before{content:"\f04b";} +.z-font.z-news:before{content:"\f04c";} +.z-font.z-course:before{content:"\f04d";} +.z-font.z-userinfo:before{content:"\f04e";} +.z-font.z-tag:before{content:"\f04f";} +.z-font.z-templet:before{content:"\f050";} +.z-font.z-project:before{content:"\f051";} +.z-font.z-w-doc:before{content:"\f052";} +.z-font.z-w-htm:before{content:"\f053";} +.z-font.z-w-pdf:before{content:"\f054";} +.z-font.z-w-ppt:before{content:"\f055";} +.z-font.z-w-txt:before{content:"\f056";} +.z-font.z-w-srt:before{content:"\f057";} +.z-font.z-w-xls:before{content:"\f058";} +.z-font.z-w-iso:before{content:"\f059";} +.z-font.z-w-rar:before{content:"\f05a";} +.z-font.z-w-zip:before{content:"\f05b";} +/** 设备类(f060-f07f) */ +.z-font.z-computer:before{content:"\f060";} +.z-font.z-phone:before{content:"\f061";} +.z-font.z-monitor:before{content:"\f062";} +.z-font.z-email:before{content:"\f063";} +.z-font.z-internet:before{content:"\f064";} +.z-font.z-switch:before{content:"\f065";} +.z-font.z-wifi:before{content:"\f066";} +.z-font.z-cloud:before{content:"\f067";} +.z-font.z-port:before{content:"\f068";} + +.z-font.z-telephone:before{content:"\f069";} +.z-font.z-treemodel:before{content:"\f06a";} +.z-font.z-qrcode:before{content:"\f06b";} +.z-font.z-database:before{content:"\f06c";} +.z-font.z-email-open:before{content:"\f06d";} +/** 图表类(f080-f09f) */ +.z-font.z-list:before{content:"\f080";} +.z-font.z-apps:before{content:"\f081";} +.z-font.z-pie-chart:before{content:"\f082";} +.z-font.z-histogram:before{content:"\f083";} +.z-font.z-graph:before{content:"\f084";} +.z-font.z-diagram:before{content:"\f085";} +.z-font.z-arrow-down:before{content:"\f086";} +.z-font.z-arrow-up:before{content:"\f087";} +.z-font.z-arrow-left:before{content:"\f088";} +.z-font.z-arrow-right:before{content:"\f089";} +.z-font.z-arrowhead-down:before{content:"\f08a";} +.z-font.z-arrowhead-up:before{content:"\f08b";} +.z-font.z-arrowhead-left:before{content:"\f08c";} +.z-font.z-arrowhead-right:before{content:"\f08d";} + +.z-font.z-list01:before{content:"\f08e";} +.z-font.z-bill:before{content:"\f08f";} +.z-font.z-pie-chart01:before{content:"\f090";} +.z-font.z-report-forms:before{content:"\f091";} +.z-font.z-table:before{content:"\f092";} +.z-font.z-line-chart:before{content:"\f093";} +/** 实体类(f0a0-f0bf) */ +.z-font.z-customer:before{content:"\f0a0";} +.z-font.z-cash:before{content:"\f0a1";} +.z-font.z-house:before{content:"\f0a2";} +.z-font.z-flower:before{content:"\f0a3";} +.z-font.z-box:before{content:"\f0a4";} +.z-font.z-desk:before{content:"\f0a5";} +.z-font.z-gift:before{content:"\f0a6";} +.z-font.z-lock:before{content:"\f0a7";} + +.z-font.z-flag:before{content:"\f0a8";} +.z-font.z-lock01:before{content:"\f0a9";} +.z-font.z-unlock:before{content:"\f0aa";} +.z-font.z-money:before{content:"\f0ab";} +.z-font.z-upstage:before{content:"\f0ac";} +.z-font.z-shopcart:before{content:"\f0ad";} +.z-font.z-heart:before{content:"\f0ae";} +.z-font.z-bell:before{content:"\f0af";} +.z-font.z-alarm-clock:before{content:"\f0b0";} +.z-font.z-clock:before{content:"\f0b1";} +.z-font.z-timetable:before{content:"\f0b2";} +.z-font.z-shop:before{content:"\f0b3";} +.z-font.z-five-star:before{content:"\f0b4";} +.z-font.z-warehouse:before{content:"\f0b5";} +.z-font.z-coupon:before{content:"\f0b6";} +.z-font.z-card:before{content:"\f0b7";} +.z-font.z-diamond:before{content:"\f0b8";} +.z-font.z-compass:before{content:"\f0b9";} +.z-font.z-goods:before{content:"\f0ba";} +.z-font.z-key:before{content:"\f0bb";} +.z-font.z-gold:before{content:"\f0bc";} +.z-font.z-smiling:before{content:"\f0bd";} +.z-font.z-car:before{content:"\f0be";} +.z-font.z-people:before{content:"\f0bf";} + +/***********************************************/ +/* 2.4:圆圈圆角定义 */ +/***********************************************/ + +.z-round{display:inline-block;width:16px;height:16px;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;text-align:center;line-height:16px;} +.z-round.z-white{background-color:#fff;color:#999;} +.z-round.z-black{background-color:#000;color:#fff;} +.z-round.z-gray{background-color:#666;color:#fff;} +.z-round.z-red{background-color:#ea4a36;color:#fff;} +.z-round.z-orange{background-color:#ff6600;color:#fff;} +.z-round.z-yellow{background-color:#fac603;color:#fff;} +.z-round.z-green{background-color:#43cd6e;color:#fff;} +.z-round.z-cyan{background-color:#009899;color:#fff;} +.z-round.z-blue{background-color:#28a3ef;color:#fff;} +.z-round.z-purple{background-color:#9e70ca;color:#fff;} + +/***********************************************/ +/* 第三部分:文本、颜色和块定义 */ +/***********************************************/ + +/***********************************************/ +/* 3.1:文本通用样式定义 */ +/***********************************************/ + +/** 文本粗斜体,下划线删除线,小号上下标等 **/ +.z-bold{font-weight:bold;} +.z-italic{font-style:italic;} +.z-underline{text-decoration:underline;} +.z-delline{text-decoration:line-through;} +.z-small{font-size:80%;} +.z-sub,.z-sup{position:relative;vertical-align:baseline;line-height:0;font-size:75%;} +.z-sup{top:-0.5em;} +.z-sub{bottom:-0.25em;} +.z-mark{background:#ff0;color:#000;}/* 设置文本标记颜色为通用的黑色+黄底#ffff00 */ +.z-abbr[title]{border-bottom:1px dotted;}/* 设置缩短标签下加虚线 */ +.z-event-none{pointer-events: none;} +.z-placeholder{position:absolute;left:0;top:0;fallback:false;overflow:hidden;color:#999;font-size:14px;line-height:22px;pointer-events: none;} +.z-weight-normal{font-weight:normal;} +.z-style-normal{font-style:normal;} + +/** 文本字体大小 */ +.z-px10{font-size:10px;} +.z-px11{font-size:11px;} +.z-px12{font-size:12px;} +.z-px13{font-size:13px;} +.z-px14{font-size:14px;} +.z-px15{font-size:15px;} +.z-px16{font-size:16px;} +.z-px17{font-size:17px;} +.z-px18{font-size:18px;} +.z-px19{font-size:19px;} +.z-px20{font-size:20px;} +.z-px22{font-size:22px;} +.z-px24{font-size:24px;} +.z-px26{font-size:26px;} +.z-px30{font-size:30px;} +.z-px40{font-size:40px;} +.z-px50{font-size:50px;} + +.zi-px10{font-size:10px !important;} +.zi-px11{font-size:11px !important;} +.zi-px12{font-size:12px !important;} +.zi-px13{font-size:13px !important;} +.zi-px14{font-size:14px !important;} +.zi-px15{font-size:15px !important;} +.zi-px16{font-size:16px !important;} +.zi-px17{font-size:17px !important;} +.zi-px18{font-size:18px !important;} +.zi-px19{font-size:19px !important;} +.zi-px20{font-size:20px !important;} +.zi-px22{font-size:22px !important;} +.zi-px24{font-size:24px !important;} +.zi-px26{font-size:26px !important;} +.zi-px30{font-size:30px !important;} +.zi-px40{font-size:40px !important;} +.zi-px50{font-size:50px !important;} + +/** 文本排列方式 */ +.z-text-left{text-align:left;} +.z-text-right{text-align:right;} +.z-text-center{text-align:center;} +.z-text-top{vertical-align:top;} +.z-text-middle{vertical-align:middle;} +.z-text-bottom{vertical-align:bottom;} + +.zi-text-left{text-align:left !important;} +.zi-text-right{text-align:right !important;} +.zi-text-center{text-align:center !important;} +.zi-text-top{vertical-align:top !important;} +.zi-text-middle{vertical-align:middle !important;} +.zi-text-bottom{vertical-align:bottom !important;} + +/** 文本换行、不换行,省略和隐藏 */ +.z-text-break{word-break:break-all; word-wrap:break-word;} +.z-text-pre{white-space:pre;} +.z-text-prewrap{white-space:pre-wrap;} +.z-text-preline{white-space:pre-line;} +.z-text-nowrap{white-space:nowrap;} +.z-text-ellipsis{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:inline-block;} +.z-text-clip{text-overflow:clip;overflow:hidden;white-space:nowrap;display:inline-block;} +.z-text-hide{display:none;font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;} + +/** 设置代码字体为linux默认字体,风格等 */ +.z-code,.z-kbd,.z-pre,.z-samp{font-family:Consolas,"Courier New",monospace,Menlo,Monaco,"微软雅黑";font-size:1em;} +.z-code,.z-kbd,.z-pre{border-radius:4px;display:block;} +.z-code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;line-height:1.42857143;} +.z-kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333; + -webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.25); + box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.z-kbd .z-kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none;} +.z-pre{overflow:auto;display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;} +.z-pre .z-code{padding:0;font-size:inherit;color:#c7254e;white-space:pre-wrap;background-color:transparent;border-radius:0;} + +.zi-code,.zi-kbd,.zi-pre,.zi-samp{font-family:Consolas,"Courier New",monospace,Menlo,Monaco,"微软雅黑" !important;} + +.z-user-select-none{ + -webkit-user-select:none; + -moz-user-select:none; + -ms-user-select:none; + -o-user-select:none; + user-select:none; +} + +/***********************************************/ +/* 3.2:颜色通用样式定义 */ +/***********************************************/ + +/** 标准颜色定义 */ +.z-color-white{color:white;} +.z-color-black{color:black;} +.z-color-gray{color:gray;} +.z-color-red{color:red;} +.z-color-orange{color:orange;} +.z-color-yellow{color:yellow;} +.z-color-green{color:green;} +.z-color-cyan{color:cyan;} +.z-color-blue{color:blue;} +.z-color-purple{color:purple;} +.z-color-333{color:#333;} +.z-color-666{color:#666;} +.z-color-999{color:#999;} +.z-color-ccc{color:#ccc;} + +.zi-color-white{color:white !important;} +.zi-color-black{color:black !important;} +.zi-color-gray{color:gray !important;} +.zi-color-red{color:red !important;} +.zi-color-orange{color:orange !important;} +.zi-color-yellow{color:yellow !important;} +.zi-color-green{color:green !important;} +.zi-color-cyan{color:cyan !important;} +.zi-color-blue{color:blue !important;} +.zi-color-purple{color:purple !important;} +.zi-color-333{color:#333 !important;} +.zi-color-666{color:#666 !important;} +.zi-color-999{color:#999 !important;} +.zi-color-ccc{color:#ccc !important;} + +/** 文本颜色定义 **/ +.z-text-black{color:#333;} +.z-text-white{color:#fffff0;} +.z-text-gray{color:#ccc;} +.z-text-red{color:#e8351f;} +.z-text-orange{color:#fe4615;} +.z-text-yellow{color:#ffd700;} +.z-text-green{color:#006400;} +.z-text-cyan{color:#008b8b;} +.z-text-blue{color:#0066cc;} +.z-text-purple{color:#ba55d3;} + +.zi-text-black{color:#333 !important;} +.zi-text-white{color:#fffff0 !important;} +.zi-text-gray{color:#ccc !important;} +.zi-text-red{color:#e8351f !important;} +.zi-text-orange{color:#fe4615 !important;} +.zi-text-yellow{color:#ffd700 !important;} +.zi-text-green{color:#006400 !important;} +.zi-text-cyan{color:#008b8b !important;} +.zi-text-blue{color:#0066cc !important;} +.zi-text-purple{color:#ba55d3 !important;} + +/** 背景颜色定义 **/ +.z-bg-333{background-color:#333;} +.z-bg-666{background-color:#666;} +.z-bg-999{background-color:#999;} +.z-bg-ccc{background-color:#ccc;} + +.z-bg-black{background-color:#000;} +.z-bg-white{background-color:#fff;} +.z-bg-gray{background-color:#f5f5f5;} +.z-bg-red{background-color:#ffe4e1;} +.z-bg-orange{background-color:#f5deb3;} +.z-bg-yellow{background-color:#ffe;} +.z-bg-green{background-color:#f0fff0;} +.z-bg-cyan{background-color:#e1ffff;} +.z-bg-blue{background-color:#f0f8ff;} +.z-bg-purple{background-color:#e6e6fa;} + +.z-bg-none{background:none;} + +.zi-bg-black{background-color:#000 !important;} +.zi-bg-white{background-color:#fff !important;} +.zi-bg-gray{background-color:#f5f5f5 !important;} +.zi-bg-red{background-color:#ffe4e1 !important;} +.zi-bg-orange{background-color:#f5deb3 !important;} +.zi-bg-yellow{background-color:#ffe !important;} +.zi-bg-green{background-color:#f0fff0 !important;} +.zi-bg-cyan{background-color:#e1ffff !important;} +.zi-bg-blue{background-color:#f0f8ff !important;} +.zi-bg-purple{background-color:#e6e6fa !important;} + +.z-bg-gray-deep{background-color:#d3d3d3;} +.z-bg-red-deep{background-color:#ea4a36;} +.z-bg-orange-deep{background-color:#ff6600;} +.z-bg-yellow-deep{background-color:#fac603;} +.z-bg-green-deep{background-color:#43cd6e;} +.z-bg-cyan-deep{background-color:#009899;} +.z-bg-blue-deep{background-color:#2a689d;} +.z-bg-purple-deep{background-color:#9e70ca;} + +.zi-bg-gray-deep{background-color:#d3d3d3 !important;} +.zi-bg-red-deep{background-color:#ea4a36 !important;} +.zi-bg-orange-deep{background-color:#ff6600 !important;} +.zi-bg-yellow-deep{background-color:#fac603 !important;} +.zi-bg-green-deep{background-color:#43cd6e !important;} +.zi-bg-cyan-deep{background-color:#009899 !important;} +.zi-bg-blue-deep{background-color:#2a689d !important;} +.zi-bg-purple-deep{background-color:#9e70ca !important;} + +.zi-bg-none{background:none !important;} + +/** 边框颜色定义 **/ +.z-bd{border:1px solid #d3d3d3;} +.z-bd-t{border-top:1px solid #d3d3d3;} +.z-bd-l{border-left:1px solid #d3d3d3;} +.z-bd-r{border-right:1px solid #d3d3d3;} +.z-bd-b{border-bottom:1px solid #d3d3d3;} +.z-bd.z-red{border:1px solid #ea4a36;} +.z-bd-t.z-red{border-top:1px solid #ea4a36;} +.z-bd-l.z-red{border-left:1px solid #ea4a36;} +.z-bd-r.z-red{border-right:1px solid #ea4a36;} +.z-bd-b.z-red{border-bottom:1px solid #ea4a36;} +.z-bd.z-orange{border:1px solid #ff6600;} +.z-bd-t.z-orange{border-top:1px solid #ff6600;} +.z-bd-l.z-orange{border-left:1px solid #ff6600;} +.z-bd-r.z-orange{border-right:1px solid #ff6600;} +.z-bd-b.z-orange{border-bottom:1px solid #ff6600;} +.z-bd.z-yellow{border:1px solid #fac603;} +.z-bd-t.z-yellow{border-top:1px solid #fac603;} +.z-bd-l.z-yellow{border-left:1px solid #fac603;} +.z-bd-r.z-yellow{border-right:1px solid #fac603;} +.z-bd-b.z-yellow{border-bottom:1px solid #fac603;} +.z-bd.z-green{border:1px solid #43cd6e;} +.z-bd-t.z-green{border-top:1px solid #43cd6e;} +.z-bd-l.z-green{border-left:1px solid #43cd6e;} +.z-bd-r.z-green{border-right:1px solid #43cd6e;} +.z-bd-b.z-green{border-bottom:1px solid #43cd6e;} +.z-bd.z-cyan{border:1px solid #009899;} +.z-bd-t.z-cyan{border-top:1px solid #009899;} +.z-bd-l.z-cyan{border-left:1px solid #009899;} +.z-bd-r.z-cyan{border-right:1px solid #009899;} +.z-bd-b.z-cyan{border-bottom:1px solid #009899;} +.z-bd.z-blue{border:1px solid #2a689d;} +.z-bd-t.z-blue{border-top:1px solid #2a689d;} +.z-bd-l.z-blue{border-left:1px solid #2a689d;} +.z-bd-r.z-blue{border-right:1px solid #2a689d;} +.z-bd-b.z-blue{border-bottom:1px solid #2a689d;} +.z-bd.z-purple{border:1px solid #9e70ca;} +.z-bd-t.z-purple{border-top:1px solid #9e70ca;} +.z-bd-l.z-purple{border-left:1px solid #9e70ca;} +.z-bd-r.z-purple{border-right:1px solid #9e70ca;} +.z-bd-b.z-purple{border-bottom:1px solid #9e70ca;} + +/** 边框圆角定义 **/ +.z-bd-rd0{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.z-bd-rd1{-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;} +.z-bd-rd2{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;} +.z-bd-rd3{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.z-bd-rd5{-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.z-bd-rd8{-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;} +.z-bd-rd10{-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;} +.z-bd-rd50p{-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;} +.z-bd-rd-circle{-webkit-border-radius:1000px;-moz-border-radius:1000px;border-radius:1000px;} + +.z-bd-rd-tl3{-webkit-border-top-left-radius:3px;-moz-border-top-left-radius:3px;border-top-left-radius:3px;} +.z-bd-rd-tl5{-webkit-border-top-left-radius:5px;-moz-border-top-left-radius:5px;border-top-left-radius:5px;} +.z-bd-rd-tl8{-webkit-border-top-left-radius:8px;-moz-border-top-left-radius:8px;border-top-left-radius:8px;} +.z-bd-rd-tl10{-webkit-border-top-left-radius:10px;-moz-border-top-left-radius:10px;border-top-left-radius:10px;} + +.z-bd-rd-tr3{-webkit-border-top-right-radius:3px;-moz-border-top-right-radius:3px;border-top-right-radius:3px;} +.z-bd-rd-tr5{-webkit-border-top-right-radius:5px;-moz-border-top-right-radius:5px;border-top-right-radius:5px;} +.z-bd-rd-tr8{-webkit-border-top-right-radius:8px;-moz-border-top-right-radius:8px;border-top-right-radius:8px;} +.z-bd-rd-tr10{-webkit-border-top-right-radius:10px;-moz-border-top-right-radius:10px;border-top-right-radius:10px;} + +.z-bd-rd-bl3{-webkit-border-bottom-left-radius:3px;-moz-border-bottom-left-radius:3px;border-bottom-left-radius:3px;} +.z-bd-rd-bl5{-webkit-border-bottom-left-radius:5px;-moz-border-bottom-left-radius:5px;border-bottom-left-radius:5px;} +.z-bd-rd-bl8{-webkit-border-bottom-left-radius:8px;-moz-border-bottom-left-radius:8px;border-bottom-left-radius:8px;} +.z-bd-rd-bl10{-webkit-border-bottom-left-radius:10px;-moz-border-bottom-left-radius:10px;border-bottom-left-radius:10px;} + +.z-bd-rd-br3{-webkit-border-bottom-right-radius:3px;-moz-border-bottom-right-radius:3px;border-bottom-right-radius:3px;} +.z-bd-rd-br5{-webkit-border-bottom-right-radius:5px;-moz-border-bottom-right-radius:5px;border-bottom-right-radius:5px;} +.z-bd-rd-br8{-webkit-border-bottom-right-radius:8px;-moz-border-bottom-right-radius:8px;border-bottom-right-radius:8px;} +.z-bd-rd-br10{-webkit-border-bottom-right-radius:10px;-moz-border-bottom-right-radius:10px;border-bottom-right-radius:10px;} + +.z-bd-rd-l3{ + -webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px; + -moz-border-top-left-radius:3px;-moz-border-bottom-left-radius:3px;border-bottom-left-radius:3px; +} +.z-bd-rd-l5{ + -webkit-border-top-left-radius:5px;-webkit-border-bottom-left-radius:5px;border-bottom-left-radius:5px; + -moz-border-top-left-radius:5px;-moz-border-bottom-left-radius:5px;bottom-left-radius:5px; +} +.z-bd-rd-l8{ + -webkit-border-top-left-radius:8px;-webkit-border-bottom-left-radius:8px;border-bottom-left-radius:8px; + -moz-border-top-left-radius:8px;-moz-border-bottom-left-radius:8px;bottom-left-radius:8px; +} +.z-bd-rd-l10{ + -webkit-border-top-left-radius:10px;-webkit-border-bottom-left-radius:10px;border-bottom-left-radius:10px; + -moz-border-top-left-radius:10px;-moz-border-bottom-left-radius:10px;bottom-left-radius:10px; +} +.z-bd-rd-l-circle{ + -webkit-border-top-left-radius:1000px;-webkit-border-bottom-left-radius:1000px;border-bottom-left-radius:1000px; + -moz-border-top-left-radius:1000px;-moz-border-bottom-left-radius:1000px;bottom-left-radius:1000px; +} + +.z-bd-rd-r3{ + -webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;bottom-right-radius:3px; + -moz-border-top-right-radius:3px;-moz-border-bottom-right-radius:3px;bottom-right-radius:3px; +} +.z-bd-rd-r5{ + -webkit-border-top-right-radius:5px;-webkit-border-bottom-right-radius:5px;border-bottom-right-radius:5px; + -moz-border-top-right-radius:5px;-moz-border-bottom-right-radius:5px;bottom-right-radius:5px; +} +.z-bd-rd-r8{ + -webkit-border-top-right-radius:8px;-webkit-border-bottom-right-radius:8px;border-bottom-right-radius:8px; + -moz-border-top-right-radius:8px;-moz-border-bottom-right-radius:8px;bottom-right-radius:8px; +} +.z-bd-rd-r10{ + -webkit-border-top-right-radius:10px;-webkit-border-bottom-right-radius:10px;border-bottom-right-radius:10px; + -moz-border-top-right-radius:10px;-moz-border-bottom-right-radius:10px;border-bottom-right-radius:10px; +} +.z-bd-rd-r-circle{ + -webkit-border-top-right-radius:1000px;-webkit-border-bottom-right-radius:1000px;border-bottom-right-radius:1000px; + -moz-border-top-right-radius:1000px;-moz-border-bottom-right-radius:1000px;border-bottom-right-radius:1000px; +} + +.z-bd-rd-t3{ + -webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px; + -moz-border-top-left-radius:3px;-moz-border-top-right-radius:3px;border-top-right-radius:3px; +} +.z-bd-rd-t5{ + -webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;border-top-right-radius:5px; + -moz-border-top-left-radius:5px;-moz-border-top-right-radius:5px;border-top-right-radius:5px; +} +.z-bd-rd-t8{ + -webkit-border-top-left-radius:8px;-webkit-border-top-right-radius:8px;border-top-right-radius:8px; + -moz-border-top-left-radius:8px;-moz-border-top-right-radius:8px;border-top-right-radius:8px; +} +.z-bd-rd-t10{ + -webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:10px;border-top-right-radius:10px; + -moz-border-top-left-radius:10px;-moz-border-top-right-radius:10px;border-top-right-radius:10px; +} +.z-bd-rd-t-circle{ + -webkit-border-top-left-radius:1000px;-webkit-border-top-right-radius:1000px;border-top-right-radius:1000px; + -moz-border-top-left-radius:1000px;-moz-border-top-right-radius:1000px;border-top-right-radius:1000px; +} + +.z-bd-rd-b3{ + -webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px; + -moz-border-bottom-left-radius:3px;-moz-border-bottom-right-radius:3px;border-bottom-right-radius:3px; +} +.z-bd-rd-b5{ + -webkit-border-bottom-left-radius:5px;-webkit-border-bottom-right-radius:5px;border-bottom-right-radius:5px; + -moz-border-bottom-left-radius:5px;-moz-border-bottom-right-radius:5px;border-bottom-right-radius:5px; +} +.z-bd-rd-b8{ + -webkit-border-bottom-left-radius:8px;-webkit-border-bottom-right-radius:8px;border-bottom-right-radius:8px; + -moz-border-bottom-left-radius:8px;-moz-border-bottom-right-radius:8px;bottom-right-radius:8px; +} +.z-bd-rd-b10{ + -webkit-border-bottom-left-radius:10px;-webkit-border-bottom-right-radius:10px;border-bottom-right-radius:10px; + -moz-border-bottom-left-radius:10px;-moz-border-bottom-right-radius:10px;border-bottom-right-radius:10px; +} +.z-bd-rd-b-circle{ + -webkit-border-bottom-left-radius:1000px;-webkit-border-bottom-right-radius:1000px;border-bottom-right-radius:1000px; + -moz-border-bottom-left-radius:1000px;-moz-border-bottom-right-radius:1000px;border-bottom-right-radius:1000px; +} + +.z-bd-none{border:none;} +.z-bd-t-none{border-top:none;} +.z-bd-b-none{border-bottom:none;} +.z-bd-l-none{border-left:none;} +.z-bd-r-none{border-right:none;} + +.zi-bd{border:1px solid #d3d3d3 !important;} +.zi-bd-t{border-top:1px solid #d3d3d3 !important;} +.zi-bd-l{border-left:1px solid #d3d3d3 !important;} +.zi-bd-r{border-right:1px solid #d3d3d3 !important;} +.zi-bd-b{border-bottom:1px solid #d3d3d3 !important;} +.zi-bd.z-red{border:1px solid #ea4a36 !important;} +.zi-bd-t.z-red{border-top:1px solid #ea4a36 !important;} +.zi-bd-l.z-red{border-left:1px solid #ea4a36 !important;} +.zi-bd-r.z-red{border-right:1px solid #ea4a36 !important;} +.zi-bd-b.z-red{border-bottom:1px solid #ea4a36 !important;} +.zi-bd.z-orange{border:1px solid #ff6600 !important;} +.zi-bd-t.z-orange{border-top:1px solid #ff6600 !important;} +.zi-bd-l.z-orange{border-left:1px solid #ff6600 !important;} +.zi-bd-r.z-orange{border-right:1px solid #ff6600 !important;} +.zi-bd-b.z-orange{border-bottom:1px solid #ff6600 !important;} +.zi-bd.z-yellow{border:1px solid #fac603 !important;} +.zi-bd-t.z-yellow{border-top:1px solid #fac603 !important;} +.zi-bd-l.z-yellow{border-left:1px solid #fac603 !important;} +.zi-bd-r.z-yellow{border-right:1px solid #fac603 !important;} +.zi-bd-b.z-yellow{border-bottom:1px solid #fac603 !important;} +.zi-bd.z-green{border:1px solid #43cd6e !important;} +.zi-bd-t.z-green{border-top:1px solid #43cd6e !important;} +.zi-bd-l.z-green{border-left:1px solid #43cd6e !important;} +.zi-bd-r.z-green{border-right:1px solid #43cd6e !important;} +.zi-bd-b.z-green{border-bottom:1px solid #43cd6e !important;} +.zi-bd.z-cyan{border:1px solid #009899 !important;} +.zi-bd-t.z-cyan{border-top:1px solid #009899 !important;} +.zi-bd-l.z-cyan{border-left:1px solid #009899 !important;} +.zi-bd-r.z-cyan{border-right:1px solid #009899 !important;} +.zi-bd-b.z-cyan{border-bottom:1px solid #009899 !important;} +.zi-bd.z-blue{border:1px solid #2a689d !important;} +.zi-bd-t.z-blue{border-top:1px solid #2a689d !important;} +.zi-bd-l.z-blue{border-left:1px solid #2a689d !important;} +.zi-bd-r.z-blue{border-right:1px solid #2a689d !important;} +.zi-bd-b.z-blue{border-bottom:1px solid #2a689d !important;} +.zi-bd.z-purple{border:1px solid #9e70ca !important;} +.zi-bd-t.z-purple{border-top:1px solid #9e70ca !important;} +.zi-bd-l.z-purple{border-left:1px solid #9e70ca !important;} +.zi-bd-r.z-purple{border-right:1px solid #9e70ca !important;} +.zi-bd-b.z-purple{border-bottom:1px solid #9e70ca !important;} + +.zi-bd-rd0{-webkit-border-radius:0 !important;-moz-border-radius:0 !important;border-radius:0 !important;} +.zi-bd-rd1{-webkit-border-radius:1px !important;-moz-border-radius:1px !important;border-radius:1px !important;} +.zi-bd-rd2{-webkit-border-radius:2px !important;-moz-border-radius:2px !important;border-radius:2px !important;} +.zi-bd-rd3{-webkit-border-radius:3px !important;-moz-border-radius:3px !important;border-radius:3px !important;} +.zi-bd-rd5{-webkit-border-radius:5px !important;-moz-border-radius:5px !important;border-radius:5px !important;} +.zi-bd-rd8{-webkit-border-radius:8px !important;-moz-border-radius:8px !important;border-radius:8px !important;} +.zi-bd-rd10{-webkit-border-radius:10px !important;-moz-border-radius:10px !important;border-radius:10px !important;} +.zi-bd-rd50p{-webkit-border-radius:50% !important;-moz-border-radius:50% !important;border-radius:50% !important;} +.zi-bd-rd-circle{-webkit-border-radius:1000px !important;-moz-border-radius:1000px !important;border-radius:1000px !important;} + +.zi-bd-rd-tl3{-webkit-border-top-left-radius:3px !important;-moz-border-top-left-radius:3px !important;border-top-left-radius:3px !important;} +.zi-bd-rd-tl5{-webkit-border-top-left-radius:5px !important;-moz-border-top-left-radius:5px !important;border-top-left-radius:5px !important;} +.zi-bd-rd-tl8{-webkit-border-top-left-radius:8px !important;-moz-border-top-left-radius:8px !important;border-top-left-radius:8px !important;} +.zi-bd-rd-tl10{-webkit-border-top-left-radius:10px !important;-moz-border-top-left-radius:10px !important;border-top-left-radius:10px !important;} + +.zi-bd-rd-tr3{-webkit-border-top-right-radius:3px !important;-moz-border-top-right-radius:3px !important;border-top-right-radius:3px !important;} +.zi-bd-rd-tr5{-webkit-border-top-right-radius:5px !important;-moz-border-top-right-radius:5px !important;border-top-right-radius:5px !important;} +.zi-bd-rd-tr8{-webkit-border-top-right-radius:8px !important;-moz-border-top-right-radius:8px !important;border-top-right-radius:8px !important;} +.zi-bd-rd-tr10{-webkit-border-top-right-radius:10px !important;-moz-border-top-right-radius:10px !important;border-top-right-radius:10px !important;} + +.zi-bd-rd-bl3{-webkit-border-bottom-left-radius:3px !important;-moz-border-bottom-left-radius:3px !important;border-bottom-left-radius:3px !important;} +.zi-bd-rd-bl5{-webkit-border-bottom-left-radius:5px !important;-moz-border-bottom-left-radius:5px !important;border-bottom-left-radius:5px !important;} +.zi-bd-rd-bl8{-webkit-border-bottom-left-radius:8px !important;-moz-border-bottom-left-radius:8px !important;border-bottom-left-radius:8px !important;} +.zi-bd-rd-bl10{-webkit-border-bottom-left-radius:10px !important;-moz-border-bottom-left-radius:10px !important;border-bottom-left-radius:10px !important;} + +.zi-bd-rd-br3{-webkit-border-bottom-right-radius:3px !important;-moz-border-bottom-right-radius:3px !important;border-bottom-right-radius:3px !important;} +.zi-bd-rd-br5{-webkit-border-bottom-right-radius:5px !important;-moz-border-bottom-right-radius:5px !important;border-bottom-right-radius:5px !important;} +.zi-bd-rd-br8{-webkit-border-bottom-right-radius:8px !important;-moz-border-bottom-right-radius:8px !important;border-bottom-right-radius:8px !important;} +.zi-bd-rd-br10{-webkit-border-bottom-right-radius:10px !important;-moz-border-bottom-right-radius:10px !important;border-bottom-right-radius:10px !important;} + +.zi-bd-rd-l3{ + -webkit-border-top-left-radius:3px !important;-webkit-border-bottom-left-radius:3px !important;border-bottom-left-radius:3px !important; + -moz-border-top-left-radius:3px !important;-moz-border-bottom-left-radius:3px !important;border-bottom-left-radius:3px !important; +} +.zi-bd-rd-l5{ + -webkit-border-top-left-radius:5px !important;-webkit-border-bottom-left-radius:5px !important;border-bottom-left-radius:5px !important; + -moz-border-top-left-radius:5px !important;-moz-border-bottom-left-radius:5px !important;border-bottom-left-radius:5px !important; +} +.zi-bd-rd-l8{ + -webkit-border-top-left-radius:8px !important;-webkit-border-bottom-left-radius:8px !important;border-bottom-left-radius:8px !important; + -moz-border-top-left-radius:8px !important;-moz-border-bottom-left-radius:8px !important;border-bottom-left-radius:8px !important; +} +.zi-bd-rd-l10{ + -webkit-border-top-left-radius:10px !important;-webkit-border-bottom-left-radius:10px !important;border-bottom-left-radius:10px !important; + -moz-border-top-left-radius:10px !important;-moz-border-bottom-left-radius:10px !important;border-bottom-left-radius:10px !important; +} +.zi-bd-rd-l-circle{ + -webkit-border-top-left-radius:1000px !important;-webkit-border-bottom-left-radius:1000px !important;border-bottom-left-radius:1000px !important; + -moz-border-top-left-radius:1000px !important;-moz-border-bottom-left-radius:1000px !important;border-bottom-left-radius:1000px !important; +} + +.zi-bd-rd-r3{ + -webkit-border-top-right-radius:3px !important;-webkit-border-bottom-right-radius:3px !important;border-bottom-right-radius:3px !important; + -moz-border-top-right-radius:3px !important;-moz-border-bottom-right-radius:3px !important;border-bottom-right-radius:3px !important; +} +.zi-bd-rd-r5{ + -webkit-border-top-right-radius:5px !important;-webkit-border-bottom-right-radius:5px !important;border-bottom-right-radius:5px !important; + -moz-border-top-right-radius:5px !important;-moz-border-bottom-right-radius:5px !important;border-bottom-right-radius:5px !important; +} +.zi-bd-rd-r8{ + -webkit-border-top-right-radius:8px !important;-webkit-border-bottom-right-radius:8px !important;border-bottom-right-radius:8px !important; + -moz-border-top-right-radius:8px !important;-moz-border-bottom-right-radius:8px !important;border-bottom-right-radius:8px !important; +} +.zi-bd-rd-r10{ + -webkit-border-top-right-radius:10px !important;-webkit-border-bottom-right-radius:10px !important;border-bottom-right-radius:10px !important; + -moz-border-top-right-radius:10px !important;-moz-border-bottom-right-radius:10px !important;border-bottom-right-radius:10px !important; +} +.zi-bd-rd-r-circle{ + -webkit-border-top-right-radius:1000px !important;-webkit-border-bottom-right-radius:1000px !important;border-bottom-right-radius:1000px !important; + -moz-border-top-right-radius:1000px !important;-moz-border-bottom-right-radius:1000px !important;border-bottom-right-radius:1000px !important; +} + +.zi-bd-rd-t3{ + -webkit-border-top-left-radius:3px !important;-webkit-border-top-right-radius:3px !important;border-top-right-radius:3px !important; + -moz-border-top-left-radius:3px !important;-moz-border-top-right-radius:3px !important;border-top-right-radius:3px !important; +} +.zi-bd-rd-t5{ + -webkit-border-top-left-radius:5px !important;-webkit-border-top-right-radius:5px !important;border-top-right-radius:5px !important; + -moz-border-top-left-radius:5px !important;-moz-border-top-right-radius:5px !important;border-top-right-radius:5px !important; +} +.zi-bd-rd-t8{ + -webkit-border-top-left-radius:8px !important;-webkit-border-top-right-radius:8px !important;border-top-right-radius:8px !important; + -moz-border-top-left-radius:8px !important;-moz-border-top-right-radius:8px !important;border-top-right-radius:8px !important; +} +.zi-bd-rd-t10{ + -webkit-border-top-left-radius:10px !important;-webkit-border-top-right-radius:10px !important;border-top-right-radius:10px !important; + -moz-border-top-left-radius:10px !important;-moz-border-top-right-radius:10px !important;border-top-right-radius:10px !important; +} +.zi-bd-rd-t-circle{ + -webkit-border-top-left-radius:1000px !important;-webkit-border-top-right-radius:1000px !important;border-top-right-radius:1000px !important; + -moz-border-top-left-radius:1000px !important;-moz-border-top-right-radius:1000px !important;border-top-right-radius:1000px !important; +} + +.zi-bd-rd-b3{ + -webkit-border-bottom-left-radius:3px !important;-webkit-border-bottom-right-radius:3px !important;border-bottom-right-radius:3px !important; + -moz-border-bottom-left-radius:3px !important;-moz-border-bottom-right-radius:3px !important;border-bottom-right-radius:3px !important; +} +.zi-bd-rd-b5{ + -webkit-border-bottom-left-radius:5px !important;-webkit-border-bottom-right-radius:5px !important;border-bottom-right-radius:5px !important; + -moz-border-bottom-left-radius:5px !important;-moz-border-bottom-right-radius:5px !important;border-bottom-right-radius:5px !important; +} +.zi-bd-rd-b8{ + -webkit-border-bottom-left-radius:8px !important;-webkit-border-bottom-right-radius:8px !important;border-bottom-right-radius:8px !important; + -moz-border-bottom-left-radius:8px !important;-moz-border-bottom-right-radius:8px !important;border-bottom-right-radius:8px !important; +} +.zi-bd-rd-b10{ + -webkit-border-bottom-left-radius:10px !important;-webkit-border-bottom-right-radius:10px !important;border-bottom-right-radius:10px !important; + -moz-border-bottom-left-radius:10px !important;-moz-border-bottom-right-radius:10px !important;border-bottom-right-radius:10px !important; +} +.zi-bd-rd-b-circle{ + -webkit-border-bottom-left-radius:1000px !important;-webkit-border-bottom-right-radius:1000px !important;border-bottom-right-radius:1000px !important; + -moz-border-bottom-left-radius:1000px !important;-moz-border-bottom-right-radius:1000px !important;border-bottom-right-radius:1000px !important; +} + +.zi-bd-none{border:none !important;} +.zi-bd-t-none{border-top:none !important;} +.zi-bd-b-none{border-bottom:none !important;} +.zi-bd-l-none{border-left:none !important;} +.zi-bd-r-none{border-right:none !important;} + +/***********************************************/ +/* 3.3:块状态通用样式定义 */ +/***********************************************/ + +/** 清除浮动层 **/ +.z-clearfix:{*zoom:1;} +.z-clearfix:before,.z-clearfix:after {content:"";display:table;} +.z-clearfix:after{clear:both;} + +/** 清除阴影效果 **/ +.z-shadow-none{box-shadow:none;} +.zi-shadow-none{box-shadow:none !important;} + +/** 块状态 **/ +.z-hide{display:none;} +.z-show{display:inline;} +.z-show-b{display:block;} +.z-show-ib{display:inline-block;} + +.zi-hide{display:none !important;} +.zi-show{display:inline !important;} +.zi-show-b{display:block !important;} +.zi-show-ib{display:inline-block !important;} + +/** 保留占位的显示和隐藏 **/ +.z-visible{visibility:visible;} +.z-hidden{visibility:hidden;} +.z-hidden-fixed{position:fixed;top:0;left:0;width:1px;height:1px;background:transparent !important;border:none !important;box-shadow:none !important;} + +.zi-visible{visibility:visible !important;} +.zi-hidden{visibility:hidden !important;} + +/** 块对齐 **/ +.z-float-left{float:left;} +.z-float-right{float:right;} +.z-float-center{margin-left:auto;margin-right:auto;} + +.zi-float-left{float:left !important;} +.zi-float-right{float:right !important;} +.zi-float-center{margin-left:auto !important;margin-right:auto !important;} + +/** 块定位 **/ +.z-fixed{position:fixed;} +.z-absolute{position:absolute;} +.z-relative{position:relative;} +.z-relative-left{position:relative;float:left;} +.z-relative-right{position:relative;float:right;} +.z-relative-center{position:relative;margin-left:auto;margin-right:auto;} + +.z-fixed-tl0{position:fixed;top:0;left:0;} +.z-absolute-tl0{position:absolute;top:0;left:0;} +.z-absolute-center-middle{position:absolute;margin:auto;top:0;bottom:0;left:0;right:0;} + +.zi-fixed{position:fixed !important;} +.zi-absolute{position:absolute !important;} +.zi-relative{position:relative !important;} +.zi-relative-left{position:relative !important;float:left !important;} +.zi-relative-right{position:relative !important;float:right !important;} +.zi-relative-center{position:relative !important;margin-left:auto !important;margin-right:auto !important;} +.zi-absolute-center-middle{position:absolute !important;margin:auto !important;top:0 !important;bottom:0 !important;left:0 !important;right:0 !important;} + +.z-t0{top:0;}.z-b0{bottom:0;}.z-l0{left:0;}.z-r0{right:0;} + +/** 块溢出的三种情况 **/ +.z-overflow-scroll{overflow:scroll;} +.z-overflow-hidden{overflow:hidden;} +.z-overflow-auto{overflow:auto;} +.z-overflow-x-scroll{overflow-x:scroll;} +.z-overflow-x-hidden{overflow-x:hidden;} +.z-overflow-x-auto{overflow-x:auto;} +.z-overflow-y-scroll{overflow-y:scroll;} +.z-overflow-y-hidden{overflow-y:hidden;} +.z-overflow-y-auto{overflow-y:auto;} + +.zi-overflow-hidden{overflow:hidden !important;} +.zi-overflow-x-hidden{overflow-x:hidden !important;} +.zi-overflow-y-hidden{overflow-y:hidden !important;} + +/** 块鼠标和输入法样式 **/ +.z-pointer{cursor:pointer;} +.z-forbidden{cursor:not-allowed;} +.z-ime-disabled{ime-mode: disabled;} +.zi-pointer{cursor:pointer !important;} +.zi-forbidden{cursor:not-allowed !important;} +.zi-ime-disabled{ime-mode: disabled !important;} + +/*********************************************************/ +/*********************************************************/ +/***************** Ⅱ:mobile 定义 ******************/ +/*********************************************************/ +/*********************************************************/ + + +/***********************************************/ +/* 第一部分:标准标记定义 */ +/***********************************************/ + +/***********************************************/ +/* 1.2:全局标记一致性定义 */ +/***********************************************/ + +a:active,a:hover{text-decoration:none;} + +input,select,textarea{-webkit-box-shadow: 0 0 0px 1000px #fff inset !important;box-shadow: 0 0 0px 1000px #fff inset !important;} +input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none !important;margin:0;} + +@media screen and (max-width: 320px) { + html { + font-size:83.33px; + font-size:26.66667vw + } +} +@media screen and (min-width: 321px) and (max-width:360px) { + html { + font-size:96px; + font-size:26.66667vw + } +} +@media screen and (min-width: 361px) and (max-width:375px) { + html { + font-size:100px; + font-size:26.66667vw + } +} +@media screen and (min-width: 376px) and (max-width:393px) { + html { + font-size:104.8px; + font-size:26.66667vw + } +} +@media screen and (min-width: 394px) and (max-width:412px) { + html { + font-size:109.86px; + font-size:26.66667vw + } +} +@media screen and (min-width: 413px) and (max-width:414px) { + html { + font-size:110.4px; + font-size:26.66667vw + } +} +@media screen and (min-width: 415px) and (max-width:480px) { + html { + font-size:128px; + font-size:26.66667vw + } +} +@media screen and (min-width: 481px) and (max-width:540px) { + html { + font-size:144px; + font-size:26.66667vw + } +} +@media screen and (min-width: 541px) and (max-width:640px) { + html { + font-size:170.66px; + font-size:26.66667vw + } +} +@media screen and (min-width: 641px) and (max-width:720px) { + html { + font-size:192px; + font-size:26.66667vw + } +} +@media screen and (min-width: 721px) and (max-width:768px) { + html { + font-size:204.8px; + font-size:26.66667vw + } +} +@media screen and (min-width: 769px) { + html { + font-size:204.8px + } +} + +html,body{width:100%;height:100%;position:relative;overflow:hidden;} +body{font-size:0.16rem;} + +/***********************************************/ +/* 1.4:文本标记一致性定义 */ +/***********************************************/ + +/* 设置标题文字大小 颜色*/ +h1{font-size:2em;margin:.67em 0;} +h2{font-size:1.5em;margin:.83em 0;} +h3{font-size:1.17em;margin:1em 0;} + +/***********************************************/ +/* 第二部分:图标定义 */ +/***********************************************/ + +/***********************************************/ +/* 2.1:字体图标 */ +/***********************************************/ + +/***********************************************/ +/* 2.2:图片图标 */ +/***********************************************/ + +/** 图标,默认16px,其他尺寸在里面设置 */ +.z-ico{display:inline-block;vertical-align:middle;width:16px;height:16px;background-repeat:no-repeat;} + +/** 定义充值图标 */ +.z-ico.z-pay{width:56px;height:56px;background-image:url(image/ico_pay.png);background-position:0 0;} +.z-ico.z-pay.alipay{background-position:0 0;} +.z-ico.z-pay.weixin{background-position:-61px 0;} +.z-ico.z-pay.qq{background-position:-122px 0;} +.z-ico.z-pay.chinaunion{background-position:-183px 0;} +.z-ico.z-pay.sms{background-position:0 -61px;} +.z-ico.z-pay.phone{background-position:-61px -61px;} +.z-ico.z-pay.paypal{background-position:-122px -61px;} +.z-ico.z-pay.atm{background-position:-183px -61px;} +.z-ico.z-pay.tenpay{background-position:0 -122px;} + +.z-ico.z-pay.weibo{background-position:-61px -122px;} +.z-ico.z-pay.baidu{background-position:-122px -122px;} +.z-ico.z-pay.chinamobile{background-position:-183px -122px;} +.z-ico.z-pay.unicom{background-position:0 -183px;} +.z-ico.z-pay.telecom{background-position:-61px -183px;} + +/***********************************************/ +/* 2.4:圆圈圆角定义 */ +/***********************************************/ + +.z-round{display:inline-block;width:.16rem;height:.16rem;line-height:.16rem;font-size:.2rem;border-radius:50%;text-align:center;} + +/* 小气泡/徽章 */ +.z-badge{ + position:absolute; + top:.02rem; + left:50%; + margin-left:.1rem; + z-index:99; + height:.16rem; + min-width:.16rem; + padding:0 .04rem; + font-size:.12rem; + line-height:.16rem; + color:white; + vertical-align:top; + background:red; + border-radius:.16rem; +} + +/***********************************************/ +/* 第三部分:文本、颜色和块定义 */ +/***********************************************/ + +/***********************************************/ +/* 3.1:文本通用样式定义 */ +/***********************************************/ + +/** 文本字体大小 */ +.z-h1{font-size:0.32rem;line-height:normal;font-weight:bold;display:block;margin:0.2rem 0;} +.z-h2{font-size:0.24rem;line-height:normal;font-weight:bold;display:block;margin:0.19rem 0;} +.z-h3{font-size:0.18rem;line-height:normal;font-weight:bold;display:block;margin:0.18rem 0;} + +.z-rem12{font-size:.12rem;} +.z-rem13{font-size:.13rem;} +.z-rem14{font-size:.14rem;} +.z-rem15{font-size:.15rem;} +.z-rem16{font-size:.16rem;} +.z-rem17{font-size:.17rem;} +.z-rem18{font-size:.18rem;} +.z-rem19{font-size:.19rem;} +.z-rem20{font-size:.2rem;} +.z-rem22{font-size:.22rem;} +.z-rem24{font-size:.24rem;} +.z-rem25{font-size:.25rem;} +.z-rem26{font-size:.26rem;} +.z-rem28{font-size:.28rem;} +.z-rem30{font-size:.3rem;} +.z-rem32{font-size:.32rem;} +.z-rem35{font-size:.35rem;} +.z-rem36{font-size:.36rem;} +.z-rem40{font-size:.4rem;} +.z-rem50{font-size:.50rem;} + +.zi-rem12{font-size:.12rem !important;} +.zi-rem13{font-size:.13rem !important;} +.zi-rem14{font-size:.14rem !important;} +.zi-rem15{font-size:.15rem !important;} +.zi-rem16{font-size:.16rem !important;} +.zi-rem17{font-size:.17rem !important;} +.zi-rem18{font-size:.18rem !important;} +.zi-rem19{font-size:.19rem !important;} +.zi-rem20{font-size:.2rem !important;} +.zi-rem22{font-size:.22rem !important;} +.zi-rem24{font-size:.24rem !important;} +.zi-rem25{font-size:.25rem !important;} +.zi-rem26{font-size:.26rem !important;} +.zi-rem28{font-size:.28rem !important;} +.zi-rem30{font-size:.3rem !important;} +.zi-rem32{font-size:.32rem !important;} +.zi-rem35{font-size:.35rem !important;} +.zi-rem36{font-size:.36rem !important;} +.zi-rem40{font-size:.4rem !important;} +.zi-rem50{font-size:.50rem !important;} + +/** box盒子隐藏文本 **/ +[class*=z-text-ellipsis-]{display:-webkit-box;-webkit-box-orient:vertical;word-break:break-word;overflow:hidden;text-overflow:ellipsis;} +.z-text-ellipsis-line{-webkit-line-clamp:1;} +.z-text-ellipsis-2line{-webkit-line-clamp:2;} +.z-text-ellipsis-3line{-webkit-line-clamp:3;} +.z-text-ellipsis-4line{-webkit-line-clamp:4;} + +/***********************************************/ +/* 3.2:颜色通用样式定义 */ +/***********************************************/ + +/** 边框颜色定义 **/ +.z-bd,[class*=z-bd-]{border-color:#e5e5e5;} +.zi-bd,[class*=zi-bd-]{border-color:#e5e5e5 !important;} + +.z-bd-rem{border:.05rem solid #e5e5e5;} +.z-bd-t-rem{border-top:.05rem solid #e5e5e5;} +.z-bd-r-rem{border-right:.05rem solid #e5e5e5;} +.z-bd-b-rem{border-bottom:.05rem solid #e5e5e5;} +.z-bd-l-rem{border-left:.05rem solid #e5e5e5;} + +.z-bd-rem{border:.05rem solid #e5e5e5 !important;} +.z-bd-t-rem{border-top:.05rem solid #e5e5e5 !important;} +.z-bd-r-rem{border-right:.05rem solid #e5e5e5 !important;} +.z-bd-b-rem{border-bottom:.05rem solid #e5e5e5 !important;} +.z-bd-l-rem{border-left:.05rem solid #e5e5e5 !important;} + +.zi-bd-rem{border:.05rem solid #e5e5e5 !important;} + +/** 块宽度 **/ +.z-w0{width:0;} +.z-w10{width:.1rem;}.z-w12{width:.12rem;} +.z-w14{width:.14rem;}.z-w15{width:.15rem;} +.z-w16{width:.16rem;}.z-w18{width:.18rem;} +.z-w20{width:.2rem;}.z-w22{width:.22rem;} +.z-w24{width:.24rem;}.z-w25{width:.25rem;} +.z-w28{width:.28rem;}.z-w30{width:.3rem;} +.z-w35{width:.35rem;}.z-w40{width:.4rem;} +.z-w45{width:.45rem;}.z-w50{width:.5rem;} +.z-w55{width:.55rem;}.z-w60{width:.6rem;} +.z-w65{width:.65rem;}.z-w70{width:.7rem;} +.z-w75{width:.75rem;}.z-w80{width:.8rem;} +.z-w85{width:.85rem;}.z-w90{width:.9rem;} +.z-w95{width:.95rem;}.z-w100{width:1rem;} +.z-w110{width:1.1rem;}.z-w120{width:1.2rem;} +.z-w130{width:1.3rem;}.z-w140{width:1.4rem;} +.z-w150{width:1.5rem;}.z-w160{width:1.6rem;} +.z-w170{width:1.7rem;}.z-w180{width:1.8rem;} +.z-w190{width:1.9rem;}.z-w200{width:2rem;} +.z-w230{width:2.3rem;}.z-w250{width:2.5rem;} +.z-w270{width:2.7rem;}.z-w300{width:3rem;} +.z-w400{width:4rem;}.z-w500{width:5rem;} +.z-w600{width:6rem;}.z-w700{width:7rem;} +.z-w800{width:8rem;} + +.zi-w0{width:0 !important;} +.zi-w10{width:.1rem !important;}.zi-w12{width:.12rem !important;} +.zi-w14{width:.14rem !important;}.zi-w15{width:.15rem !important;} +.zi-w16{width:.16rem !important;}.zi-w18{width:.18rem !important;} +.zi-w20{width:.2rem !important;}.zi-w22{width:.22rem !important;} +.zi-w24{width:.24rem !important;}.zi-w25{width:.25rem !important;} +.zi-w28{width:.28rem !important;}.zi-w30{width:.3rem !important;} +.zi-w35{width:.35rem !important;}.zi-w40{width:.4rem !important;} +.zi-w45{width:.45rem !important;}.zi-w50{width:.5rem !important;} +.zi-w55{width:.55rem !important;}.zi-w60{width:.6rem !important;} +.zi-w65{width:.65rem !important;}.zi-w70{width:.7rem !important;} +.zi-w75{width:.75rem !important;}.zi-w80{width:.8rem !important;} +.zi-w85{width:.85rem !important;}.zi-w90{width:.9rem !important;} +.zi-w95{width:.95rem !important;}.zi-w100{width:1rem !important;} +.zi-w110{width:1.1rem !important;}.zi-w120{width:1.2rem !important;} +.zi-w130{width:1.3rem !important;}.zi-w140{width:1.4rem !important;} +.zi-w150{width:1.5rem !important;}.zi-w160{width:1.6rem !important;} +.zi-w170{width:1.7rem !important;}.zi-w180{width:1.8rem !important;} +.zi-w190{width:1.9rem !important;}.zi-w200{width:2rem !important;} +.zi-w230{width:2.3rem !important;}.zi-w250{width:2.5rem !important;} +.zi-w270{width:2.7rem !important;}.zi-w300{width:3rem !important;} +.zi-w400{width:4rem !important;}.zi-w500{width:5rem !important;} +.zi-w600{width:6rem !important;}.zi-w700{width:7rem !important;} +.zi-w800{width:8rem !important;} + +.z-w5p{width:5%;}.z-w8p{width:8%;} +.z-w10p{width:10%;}.z-w12p{width:12%;} +.z-w15p{width:15%;}.z-w30p{width:30%;} +.z-w40p{width:40%;}.z-w60p{width:60%;} +.z-w70p{width:70%;}.z-w80p{width:80%;} +.z-w90p{width:90%;}.z-w100p{width:100%;} +.z-w100p2,.z-w50p{width:50%;} +.z-w100p3{width:33.333333%;} +.z-w100p4,.z-w25p{width:25%;} +.z-w100p5,.z-w20p{width:20%;} +.z-w100p6{width:16.666666%;} +.z-w100p7{width:14.285714%;} +.z-w100p8{width:12.5%;} +.z-w100p9{width:11.111111%;} + +.zi-w5p{width:5% !important;}.zi-w8p{width:8% !important;} +.zi-w10p{width:10% !important;}.zi-w12p{width:12% !important;} +.zi-w15p{width:15% !important;}.zi-w30p{width:30% !important;} +.zi-w40p{width:40% !important;}.zi-w60p{width:60% !important;} +.zi-w70p{width:70% !important;}.zi-w80p{width:80% !important;} +.zi-w90p{width:90% !important;}.zi-w100p{width:100% !important;} +.zi-w100p2,.zi-w50p{width:50% !important;} +.zi-w100p3{width:33.333333% !important;} +.zi-w100p4,.zi-w25p{width:25% !important;} +.zi-w100p5,.zi-w20p{width:20% !important;} +.zi-w100p6{width:16.666666% !important;} +.zi-w100p7{width:14.285714% !important;} +.zi-w100p8{width:12.5% !important;} +.zi-w100p9{width:11.111111% !important;} + +.z-h0{height:0;} +.z-h10{height:.1rem;}.z-h12{height:.12rem;} +.z-h14{height:.14rem;}.z-h15{height:.15rem;} +.z-h16{height:.16rem;}.z-h18{height:.18rem;} +.z-h20{height:.2rem;}.z-h22{height:.22rem;} +.z-h24{height:.24rem;}.z-h25{height:.25rem;} +.z-h28{height:.28rem;}.z-h30{height:.3rem;} +.z-h32{height:.32rem;}.z-h35{height:.35rem;} +.z-h40{height:.4rem;}.z-h45{height:.45rem;} +.z-h50{height:.5rem;}.z-h55{height:.55rem;} +.z-h60{height:.6rem;}.z-h65{height:.65rem;} +.z-h70{height:.7rem;}.z-h75{height:.75rem;} +.z-h80{height:.8rem;}.z-h85{height:.85rem;} +.z-h90{height:.9rem;}.z-h95{height:.95rem;} +.z-h100{height:1rem;}.z-h110{height:1.1rem;} +.z-h120{height:1.2rem;}.z-h130{height:1.3rem;} +.z-h140{height:1.4rem;}.z-h150{height:1.5rem;} +.z-h160{height:1.6rem;}.z-h170{height:1.7rem;} +.z-h180{height:1.8rem;}.z-h190{height:1.9rem;} +.z-h200{height:2rem;}.z-h300{height:3rem;} +.z-h400{height:4rem;}.z-h500{height:5rem;} + +.zi-h0{height:0 !important;} +.zi-h10{height:.1rem !important;}.zi-h12{height:.12rem !important;} +.zi-h14{height:.14rem !important;}.zi-h15{height:.15rem !important;} +.zi-h16{height:.16rem !important;}.zi-h18{height:.18rem !important;} +.zi-h20{height:.2rem !important;}.zi-h22{height:.22rem !important;} +.zi-h24{height:.24rem !important;}.zi-h25{height:.25rem !important;} +.zi-h28{height:.28rem !important;}.zi-h30{height:.3rem !important;} +.zi-h32{height:.32rem !important;}.zi-h35{height:.35rem !important;} +.zi-h40{height:.4rem !important;}.zi-h45{height:.45rem !important;} +.zi-h50{height:.5rem !important;}.zi-h55{height:.55rem !important;} +.zi-h60{height:.6rem !important;}.zi-h65{height:.65rem !important;} +.zi-h70{height:.7rem !important;}.zi-h75{height:.75rem !important;} +.zi-h80{height:.8rem !important;}.zi-h85{height:.85rem !important;} +.zi-h90{height:.9rem !important;}.zi-h95{height:.95rem !important;} +.zi-h100{height:1rem !important;}.zi-h110{height:1.1rem !important;} +.zi-h120{height:1.2rem !important;}.zi-h130{height:1.3rem !important;} +.zi-h140{height:1.4rem !important;}.zi-h150{height:1.5rem !important;} +.zi-h160{height:1.6rem !important;}.zi-h170{height:1.7rem !important;} +.zi-h180{height:1.8rem !important;}.zi-h190{height:1.9rem !important;} +.zi-h200{height:2rem !important;}.zi-h300{height:3rem !important;} +.zi-h400{height:4rem !important;}.zi-h500{height:5rem !important;} + +.z-h5p{height:5%;}.z-h8p{height:8%;} +.z-h10p{height:10%;}.z-h12p{height:12%;} +.z-h15p{height:15%;}.z-h20p{height:20%;} +.z-h30p{height:30%;}.z-h40p{height:40%;} +.z-h50p{height:50%;}.z-h60p{height:60%;} +.z-h70p{height:70%;}.z-h80p{height:80%;} +.z-h90p{height:90%;}.z-h100p{height:100%;} + +.zi-h5p{height:5% !important;}.zi-h8p{height:8% !important;} +.zi-h10p{height:10% !important;}.zi-h12p{height:12% !important;} +.zi-h15p{height:15% !important;}.zi-h20p{height:20% !important;} +.zi-h30p{height:30% !important;}.zi-h40p{height:40% !important;} +.zi-h50p{height:50% !important;}.zi-h60p{height:60% !important;} +.zi-h70p{height:70% !important;}.zi-h80p{height:80% !important;} +.zi-h90p{height:90% !important;}.zi-h100p{height:100% !important;} + +.z-lh0{line-height:0;}.z-lh10{line-height:.1rem;} +.z-lh12{line-height:.12rem;}.z-lh14{line-height:.14rem;} +.z-lh15{line-height:.15rem;}.z-lh16{line-height:.16rem;} +.z-lh18{line-height:.18rem;}.z-lh20{line-height:.2rem;} +.z-lh22{line-height:.22rem;}.z-lh24{line-height:.24rem;} +.z-lh25{line-height:.25rem;}.z-lh28{line-height:.28rem;} +.z-lh30{line-height:.3rem;}.z-lh32{line-height:.32rem;} +.z-lh35{line-height:.35rem;}.z-lh40{line-height:.4rem;} +.z-lh45{line-height:.45rem;}.z-lh50{line-height:.5rem;} +.z-lh55{line-height:.55rem;}.z-lh60{line-height:.6rem;} +.z-lh70{line-height:.7rem;}.z-lh80{line-height:.8rem;} +.z-lh90{line-height:.9rem;}.z-lh100{line-height:1rem;} + +.zi-lh0{line-height:0 !important;}.zi-lh10{line-height:.1rem !important;} +.zi-lh12{line-height:.12rem !important;}.zi-lh14{line-height:.14rem !important;} +.zi-lh15{line-height:.15rem !important;}.zi-lh16{line-height:.16rem !important;} +.zi-lh18{line-height:.18rem !important;}.zi-lh20{line-height:.2rem !important;} +.zi-lh22{line-height:.22rem !important;}.zi-lh24{line-height:.24rem !important;} +.zi-lh25{line-height:.25rem !important;}.zi-lh28{line-height:.28rem !important;} +.zi-lh30{line-height:.3rem !important;}.zi-lh32{line-height:.32rem !important;} +.zi-lh35{line-height:.35rem !important;}.zi-lh40{line-height:.4rem !important;} +.zi-lh45{line-height:.45rem !important;}.zi-lh50{line-height:.5rem !important;} +.zi-lh55{line-height:.55rem !important;}.zi-lh60{line-height:.6rem !important;} +.zi-lh70{line-height:.7rem !important;}.zi-lh80{line-height:.8rem !important;} +.zi-lh90{line-height:.9rem !important;}.zi-lh100{line-height:1rem !important;} + +.z-lh100p{line-height:100%;}.z-lh110p{line-height:110%;} +.z-lh120p{line-height:120%;}.z-lh130p{line-height:130%;} +.z-lh140p{line-height:140%;}.z-lh150p{line-height:150%;} +.z-lh180p{line-height:180%;}.z-lh200p{line-height:200%;} +.z-lh250p{line-height:250%;}.z-lh300p{line-height:300%;} + +.zi-lh100p{line-height:100% !important;}.zi-lh110p{line-height:110% !important;} +.zi-lh120p{line-height:120% !important;}.zi-lh130p{line-height:130% !important;} +.zi-lh140p{line-height:140% !important;}.zi-lh150p{line-height:150% !important;} +.zi-lh180p{line-height:180% !important;}.zi-lh200p{line-height:200% !important;} +.zi-lh250p{line-height:250% !important;}.zi-lh300p{line-height:300% !important;} + +.z-pd0{padding:0;}.z-pd1{padding:.01rem;} +.z-pd2{padding:.02rem;}.z-pd3{padding:.03rem;} +.z-pd4{padding:.04rem;}.z-pd5{padding:.05rem;} +.z-pd6{padding:.06rem;}.z-pd7{padding:.07rem;} +.z-pd8{padding:.08rem;}.z-pd9{padding:.09rem;} +.z-pd10{padding:.1rem;}.z-pd12{padding:.12rem;} +.z-pd14{padding:.14rem;}.z-pd15{padding:.15rem;} +.z-pd16{padding:.16rem;}.z-pd18{padding:.18rem;} +.z-pd20{padding:.2rem;}.z-pd24{padding:.24rem;} +.z-pd25{padding:.25rem;}.z-pd26{padding:.26rem;} +.z-pd28{padding:.28rem;}.z-pd30{padding:.3rem;} + +.z-pd-l0{padding-left:0;}.z-pd-l1{padding-left:.01rem;} +.z-pd-l2{padding-left:.02rem;}.z-pd-l3{padding-left:.03rem;} +.z-pd-l4{padding-left:.04rem;}.z-pd-l5{padding-left:.05rem;} +.z-pd-l6{padding-left:.06rem;}.z-pd-l7{padding-left:.07rem;} +.z-pd-l8{padding-left:.08rem;}.z-pd-l9{padding-left:.09rem;} +.z-pd-l10{padding-left:.1rem;}.z-pd-l12{padding-left:.12rem;} +.z-pd-l14{padding-left:.14rem;}.z-pd-l15{padding-left:.15rem;} +.z-pd-l16{padding-left:.16rem;}.z-pd-l18{padding-left:.18rem;} +.z-pd-l20{padding-left:.2rem;}.z-pd-l24{padding-left:.24rem;} +.z-pd-l25{padding-left:.25rem;}.z-pd-l26{padding-left:.26rem;} +.z-pd-l28{padding-left:.28rem;}.z-pd-l30{padding-left:.3rem;} + +.z-pd-r0{padding-right:0;}.z-pd-r1{padding-right:.01rem;} +.z-pd-r2{padding-right:.02rem;}.z-pd-r3{padding-right:.03rem;} +.z-pd-r4{padding-right:.04rem;}.z-pd-r5{padding-right:.05rem;} +.z-pd-r6{padding-right:.06rem;}.z-pd-r7{padding-right:.07rem;} +.z-pd-r8{padding-right:.08rem;}.z-pd-r9{padding-right:.09rem;} +.z-pd-r10{padding-right:.1rem;}.z-pd-r12{padding-right:.12rem;} +.z-pd-r14{padding-right:.14rem;}.z-pd-r15{padding-right:.15rem;} +.z-pd-r16{padding-right:.16rem;}.z-pd-r18{padding-right:.18rem;} +.z-pd-r20{padding-right:.2rem;}.z-pd-r24{padding-right:.24rem;} +.z-pd-r25{padding-right:.25rem;}.z-pd-r26{padding-right:.26rem;} +.z-pd-r28{padding-right:.28rem;}.z-pd-r30{padding-right:.3rem;} + +.z-pd-t0{padding-top:0;}.z-pd-t1{padding-top:.01rem;} +.z-pd-t2{padding-top:.02rem;}.z-pd-t3{padding-top:.03rem;} +.z-pd-t4{padding-top:.04rem;}.z-pd-t5{padding-top:.05rem;} +.z-pd-t6{padding-top:.06rem;}.z-pd-t7{padding-top:.07rem;} +.z-pd-t8{padding-top:.08rem;}.z-pd-t9{padding-top:.09rem;} +.z-pd-t10{padding-top:.1rem;}.z-pd-t12{padding-top:.12rem;} +.z-pd-t14{padding-top:.14rem;}.z-pd-t15{padding-top:.15rem;} +.z-pd-t16{padding-top:.16rem;}.z-pd-t18{padding-top:.18rem;} +.z-pd-t20{padding-top:.2rem;}.z-pd-t24{padding-top:.24rem;} +.z-pd-t25{padding-top:.25rem;}.z-pd-t26{padding-top:.26rem;} +.z-pd-t28{padding-top:.28rem;}.z-pd-t30{padding-top:.3rem;} + +.z-pd-b0{padding-bottom:0;}.z-pd-b1{padding-bottom:.01rem;} +.z-pd-b2{padding-bottom:.02rem;}.z-pd-b3{padding-bottom:.03rem;} +.z-pd-b4{padding-bottom:.04rem;}.z-pd-b5{padding-bottom:.05rem;} +.z-pd-b6{padding-bottom:.06rem;}.z-pd-b7{padding-bottom:.07rem;} +.z-pd-b8{padding-bottom:.08rem;}.z-pd-b9{padding-bottom:.09rem;} +.z-pd-b10{padding-bottom:.1rem;}.z-pd-b12{padding-bottom:.12rem;} +.z-pd-b14{padding-bottom:.14rem;}.z-pd-b15{padding-bottom:.15rem;} +.z-pd-b16{padding-bottom:.16rem;}.z-pd-b18{padding-bottom:.18rem;} +.z-pd-b20{padding-bottom:.2rem;}.z-pd-b24{padding-bottom:.24rem;} +.z-pd-b25{padding-bottom:.25rem;}.z-pd-b26{padding-bottom:.26rem;} +.z-pd-b28{padding-bottom:.28rem;}.z-pd-b30{padding-bottom:.3rem;} + +.z-pd-lr0{padding-left:0;padding-right:0;}.z-pd-lr1{padding-left:.01rem;padding-right:.01rem;} +.z-pd-lr2{padding-left:.02rem;padding-right:.02rem;}.z-pd-lr3{padding-left:.03rem;padding-right:.03rem;} +.z-pd-lr4{padding-left:.04rem;padding-right:.04rem;}.z-pd-lr5{padding-left:.05rem;padding-right:.05rem;} +.z-pd-lr6{padding-left:.06rem;padding-right:.06rem;}.z-pd-lr7{padding-left:.07rem;padding-right:.07rem;} +.z-pd-lr8{padding-left:.08rem;padding-right:.08rem;}.z-pd-lr9{padding-left:.09rem;padding-right:.09rem;} +.z-pd-lr10{padding-left:.1rem;padding-right:.1rem;}.z-pd-lr12{padding-left:.12rem;padding-right:.12rem;} +.z-pd-lr14{padding-left:.14rem;padding-right:.14rem;}.z-pd-lr15{padding-left:.15rem;padding-right:.15rem;} +.z-pd-lr16{padding-left:.16rem;padding-right:.16rem;}.z-pd-lr18{padding-left:.18rem;padding-right:.18rem;} +.z-pd-lr20{padding-left:.2rem;padding-right:.2rem;}.z-pd-lr24{padding-left:.24rem;padding-right:.24rem;} +.z-pd-lr25{padding-left:.25rem;padding-right:.25rem;}.z-pd-lr26{padding-left:.26rem;padding-right:.26rem;} +.z-pd-lr28{padding-left:.28rem;padding-right:.28rem;}.z-pd-lr30{padding-left:.3rem;padding-right:.3rem;} + +.z-pd-tb0{padding-top:0;padding-bottom:0;}.z-pd-tb1{padding-top:.01rem;padding-bottom:.01rem;} +.z-pd-tb2{padding-top:.02rem;padding-bottom:.02rem;}.z-pd-tb3{padding-top:.03rem;padding-bottom:.03rem;} +.z-pd-tb4{padding-top:.04rem;padding-bottom:.04rem;}.z-pd-tb5{padding-top:.05rem;padding-bottom:.05rem;} +.z-pd-tb6{padding-top:.06rem;padding-bottom:.06rem;}.z-pd-tb7{padding-top:.07rem;padding-bottom:.07rem;} +.z-pd-tb8{padding-top:.08rem;padding-bottom:.08rem;}.z-pd-tb9{padding-top:.09rem;padding-bottom:.09rem;} +.z-pd-tb10{padding-top:.1rem;padding-bottom:.1rem;}.z-pd-tb12{padding-top:.12rem;padding-bottom:.12rem;} +.z-pd-tb14{padding-top:.14rem;padding-bottom:.14rem;}.z-pd-tb15{padding-top:.15rem;padding-bottom:.15rem;} +.z-pd-tb16{padding-top:.16rem;padding-bottom:.16rem;}.z-pd-tb18{padding-top:.18rem;padding-bottom:.18rem;} +.z-pd-tb20{padding-top:.2rem;padding-bottom:.2rem;}.z-pd-tb24{padding-top:.24rem;padding-bottom:.24rem;} +.z-pd-tb25{padding-top:.25rem;padding-bottom:.25rem;}.z-pd-tb26{padding-top:.26rem;padding-bottom:.26rem;} +.z-pd-tb28{padding-top:.28rem;padding-bottom:.28rem;}.z-pd-tb30{padding-top:.3rem;padding-bottom:.3rem;} + +.zi-pd0{padding:0 !important;}.zi-pd1{padding:.01rem !important;} +.zi-pd2{padding:.02rem !important;}.zi-pd3{padding:.03rem !important;} +.zi-pd4{padding:.04rem !important;}.zi-pd5{padding:.05rem !important;} +.zi-pd6{padding:.06rem !important;}.zi-pd7{padding:.07rem !important;} +.zi-pd8{padding:.08rem !important;}.zi-pd9{padding:.09rem !important;} +.zi-pd10{padding:.1rem !important;}.zi-pd12{padding:.12rem !important;} +.zi-pd14{padding:.14rem !important;}.zi-pd15{padding:.15rem !important;} +.zi-pd16{padding:.16rem !important;}.zi-pd18{padding:.18rem !important;} +.zi-pd20{padding:.2rem !important;}.zi-pd24{padding:.24rem !important;} +.zi-pd25{padding:.25rem !important;}.zi-pd26{padding:.26rem !important;} +.zi-pd28{padding:.28rem !important;}.zi-pd30{padding:.3rem !important;} + +.zi-pd-l0{padding-left:0 !important;}.zi-pd-l1{padding-left:.01rem !important;} +.zi-pd-l2{padding-left:.02rem !important;}.zi-pd-l3{padding-left:.03rem !important;} +.zi-pd-l4{padding-left:.04rem !important;}.zi-pd-l5{padding-left:.05rem !important;} +.zi-pd-l6{padding-left:.06rem !important;}.zi-pd-l7{padding-left:.07rem !important;} +.zi-pd-l8{padding-left:.08rem !important;}.zi-pd-l9{padding-left:.09rem !important;} +.zi-pd-l10{padding-left:.1rem !important;}.zi-pd-l12{padding-left:.12rem !important;} +.zi-pd-l14{padding-left:.14rem !important;}.zi-pd-l15{padding-left:.15rem !important;} +.zi-pd-l16{padding-left:.16rem !important;}.zi-pd-l18{padding-left:.18rem !important;} +.zi-pd-l20{padding-left:.2rem !important;}.zi-pd-l24{padding-left:.24rem !important;} +.zi-pd-l25{padding-left:.25rem !important;}.zi-pd-l26{padding-left:.26rem !important;} +.zi-pd-l28{padding-left:.28rem !important;}.zi-pd-l30{padding-left:.3rem !important;} + +.zi-pd-r0{padding-right:0 !important;}.zi-pd-r1{padding-right:.01rem !important;} +.zi-pd-r2{padding-right:.02rem !important;}.zi-pd-r3{padding-right:.03rem !important;} +.zi-pd-r4{padding-right:.04rem !important;}.zi-pd-r5{padding-right:.05rem !important;} +.zi-pd-r6{padding-right:.06rem !important;}.zi-pd-r7{padding-right:.07rem !important;} +.zi-pd-r8{padding-right:.08rem !important;}.zi-pd-r9{padding-right:.09rem !important;} +.zi-pd-r10{padding-right:.1rem !important;}.zi-pd-r12{padding-right:.12rem !important;} +.zi-pd-r14{padding-right:.14rem !important;}.zi-pd-r15{padding-right:.15rem !important;} +.zi-pd-r16{padding-right:.16rem !important;}.zi-pd-r18{padding-right:.18rem !important;} +.zi-pd-r20{padding-right:.2rem !important;}.zi-pd-r24{padding-right:.24rem !important;} +.zi-pd-r25{padding-right:.25rem !important;}.zi-pd-r26{padding-right:.26rem !important;} +.zi-pd-r28{padding-right:.28rem !important;}.zi-pd-r30{padding-right:.3rem !important;} + +.zi-pd-t0{padding-top:0 !important;}.zi-pd-t1{padding-top:.01rem !important;} +.zi-pd-t2{padding-top:.02rem !important;}.zi-pd-t3{padding-top:.03rem !important;} +.zi-pd-t4{padding-top:.04rem !important;}.zi-pd-t5{padding-top:.05rem !important;} +.zi-pd-t6{padding-top:.06rem !important;}.zi-pd-t7{padding-top:.07rem !important;} +.zi-pd-t8{padding-top:.08rem !important;}.zi-pd-t9{padding-top:.09rem !important;} +.zi-pd-t10{padding-top:.1rem !important;}.zi-pd-t12{padding-top:.12rem !important;} +.zi-pd-t14{padding-top:.14rem !important;}.zi-pd-t15{padding-top:.15rem !important;} +.zi-pd-t16{padding-top:.16rem !important;}.zi-pd-t18{padding-top:.18rem !important;} +.zi-pd-t20{padding-top:.2rem !important;}.zi-pd-t24{padding-top:.24rem !important;} +.zi-pd-t25{padding-top:.25rem !important;}.zi-pd-t26{padding-top:.26rem !important;} +.zi-pd-t28{padding-top:.28rem !important;}.zi-pd-t30{padding-top:.3rem !important;} + +.zi-pd-b0{padding-bottom:0 !important;}.zi-pd-b1{padding-bottom:.01rem !important;} +.zi-pd-b2{padding-bottom:.02rem !important;}.zi-pd-b3{padding-bottom:.03rem !important;} +.zi-pd-b4{padding-bottom:.04rem !important;}.zi-pd-b5{padding-bottom:.05rem !important;} +.zi-pd-b6{padding-bottom:.06rem !important;}.zi-pd-b7{padding-bottom:.07rem !important;} +.zi-pd-b8{padding-bottom:.08rem !important;}.zi-pd-b9{padding-bottom:.09rem !important;} +.zi-pd-b10{padding-bottom:.1rem !important;}.zi-pd-b12{padding-bottom:.12rem !important;} +.zi-pd-b14{padding-bottom:.14rem !important;}.zi-pd-b15{padding-bottom:.15rem !important;} +.zi-pd-b16{padding-bottom:.16rem !important;}.zi-pd-b18{padding-bottom:.18rem !important;} +.zi-pd-b20{padding-bottom:.2rem !important;}.zi-pd-b24{padding-bottom:.24rem !important;} +.zi-pd-b25{padding-bottom:.25rem !important;}.zi-pd-b26{padding-bottom:.26rem !important;} +.zi-pd-b28{padding-bottom:.28rem !important;}.zi-pd-b30{padding-bottom:.3rem !important;} + +.zi-pd-lr0{padding-left:0 !important;padding-right:0 !important;}.zi-pd-lr1{padding-left:.01rem !important;padding-right:.01rem !important;} +.zi-pd-lr2{padding-left:.02rem !important;padding-right:.02rem !important;}.zi-pd-lr3{padding-left:.03rem !important;padding-right:.03rem !important;} +.zi-pd-lr4{padding-left:.04rem !important;padding-right:.04rem !important;}.zi-pd-lr5{padding-left:.05rem !important;padding-right:.05rem !important;} +.zi-pd-lr6{padding-left:.06rem !important;padding-right:.06rem !important;}.zi-pd-lr7{padding-left:.07rem !important;padding-right:.07rem !important;} +.zi-pd-lr8{padding-left:.08rem !important;padding-right:.08rem !important;}.zi-pd-lr9{padding-left:.09rem !important;padding-right:.09rem !important;} +.zi-pd-lr10{padding-left:.1rem !important;padding-right:.1rem !important;}.zi-pd-lr12{padding-left:.12rem !important;padding-right:.12rem !important;} +.zi-pd-lr14{padding-left:.14rem !important;padding-right:.14rem !important;}.zi-pd-lr15{padding-left:.15rem !important;padding-right:.15rem !important;} +.zi-pd-lr16{padding-left:.16rem !important;padding-right:.16rem !important;}.zi-pd-lr18{padding-left:.18rem !important;padding-right:.18rem !important;} +.zi-pd-lr20{padding-left:.2rem !important;padding-right:.2rem !important;}.zi-pd-lr24{padding-left:.24rem !important;padding-right:.24rem !important;} +.zi-pd-lr25{padding-left:.25rem !important;padding-right:.25rem !important;}.zi-pd-lr26{padding-left:.26rem !important;padding-right:.26rem !important;} +.zi-pd-lr28{padding-left:.28rem !important;padding-right:.28rem !important;}.zi-pd-lr30{padding-left:.3rem !important;padding-right:.3rem !important;} + +.zi-pd-tb0{padding-top:0 !important;padding-bottom:0 !important;}.zi-pd-tb1{padding-top:.01rem !important;padding-bottom:.01rem !important;} +.zi-pd-tb2{padding-top:.02rem !important;padding-bottom:.02rem !important;}.zi-pd-tb3{padding-top:.03rem !important;padding-bottom:.03rem !important;} +.zi-pd-tb4{padding-top:.04rem !important;padding-bottom:.04rem !important;}.zi-pd-tb5{padding-top:.05rem !important;padding-bottom:.05rem !important;} +.zi-pd-tb6{padding-top:.06rem !important;padding-bottom:.06rem !important;}.zi-pd-tb7{padding-top:.07rem !important;padding-bottom:.07rem !important;} +.zi-pd-tb8{padding-top:.08rem !important;padding-bottom:.08rem !important;}.zi-pd-tb9{padding-top:.09rem !important;padding-bottom:.09rem !important;} +.zi-pd-tb10{padding-top:.1rem !important;padding-bottom:.1rem !important;}.zi-pd-tb12{padding-top:.12rem !important;padding-bottom:.12rem !important;} +.zi-pd-tb14{padding-top:.14rem !important;padding-bottom:.14rem !important;}.zi-pd-tb15{padding-top:.15rem !important;padding-bottom:.15rem !important;} +.zi-pd-tb16{padding-top:.16rem !important;padding-bottom:.16rem !important;}.zi-pd-tb18{padding-top:.18rem !important;padding-bottom:.18rem !important;} +.zi-pd-tb20{padding-top:.2rem !important;padding-bottom:.2rem !important;}.zi-pd-tb24{padding-top:.24rem !important;padding-bottom:.24rem !important;} +.zi-pd-tb25{padding-top:.25rem !important;padding-bottom:.25rem !important;}.zi-pd-tb26{padding-top:.26rem !important;padding-bottom:.26rem !important;} +.zi-pd-tb28{padding-top:.28rem !important;padding-bottom:.28rem !important;}.zi-pd-tb30{padding-top:.3rem !important;padding-bottom:.3rem !important;} + +.z-mg-0{margin:0;}.z-mg1{margin:.01rem;} +.z-mg2{margin:.02rem;}.z-mg3{margin:.03rem;} +.z-mg4{margin:.04rem;}.z-mg5{margin:.05rem;} +.z-mg6{margin:.06rem;}.z-mg7{margin:.07rem;} +.z-mg8{margin:.08rem;}.z-mg9{margin:.09rem;} +.z-mg10{margin:.1rem;}.z-mg12{margin:.12rem;} +.z-mg14{margin:.14rem;}.z-mg15{margin:.15rem;} +.z-mg16{margin:.16rem;}.z-mg18{margin:.18rem;} +.z-mg20{margin:.2rem;}.z-mg24{margin:.24rem;} +.z-mg25{margin:.25rem;}.z-mg26{margin:.26rem;} +.z-mg28{margin:.28rem;}.z-mg30{margin:.3rem;} + +.z-mg-l0{margin-left:0;}.z-mg-l1{margin-left:.01rem;} +.z-mg-l2{margin-left:.02rem;}.z-mg-l3{margin-left:.03rem;} +.z-mg-l4{margin-left:.04rem;}.z-mg-l5{margin-left:.05rem;} +.z-mg-l6{margin-left:.06rem;}.z-mg-l7{margin-left:.07rem;} +.z-mg-l8{margin-left:.08rem;}.z-mg-l9{margin-left:.09rem;} +.z-mg-l10{margin-left:.1rem;}.z-mg-l12{margin-left:.12rem;} +.z-mg-l14{margin-left:.14rem;}.z-mg-l15{margin-left:.15rem;} +.z-mg-l16{margin-left:.16rem;}.z-mg-l18{margin-left:.18rem;} +.z-mg-l20{margin-left:.2rem;}.z-mg-l24{margin-left:.24rem;} +.z-mg-l25{margin-left:.25rem;}.z-mg-l26{margin-left:.26rem;} +.z-mg-l28{margin-left:.28rem;}.z-mg-l30{margin-left:.3rem;} + +.z-mg-r0{margin-right:0;}.z-mg-r1{margin-right:.01rem;} +.z-mg-r2{margin-right:.02rem;}.z-mg-r3{margin-right:.03rem;} +.z-mg-r4{margin-right:.04rem;}.z-mg-r5{margin-right:.05rem;} +.z-mg-r6{margin-right:.06rem;}.z-mg-r7{margin-right:.07rem;} +.z-mg-r8{margin-right:.08rem;}.z-mg-r9{margin-right:.09rem;} +.z-mg-r10{margin-right:.1rem;}.z-mg-r12{margin-right:.12rem;} +.z-mg-r14{margin-right:.14rem;}.z-mg-r15{margin-right:.15rem;} +.z-mg-r16{margin-right:.16rem;}.z-mg-r18{margin-right:.18rem;} +.z-mg-r20{margin-right:.2rem;}.z-mg-r24{margin-right:.24rem;} +.z-mg-r25{margin-right:.25rem;}.z-mg-r26{margin-right:.26rem;} +.z-mg-r28{margin-right:.28rem;}.z-mg-r30{margin-right:.3rem;} + +.z-mg-t0{margin-top:0;}.z-mg-t1{margin-top:.01rem;} +.z-mg-t2{margin-top:.02rem;}.z-mg-t3{margin-top:.03rem;} +.z-mg-t4{margin-top:.04rem;}.z-mg-t5{margin-top:.05rem;} +.z-mg-t6{margin-top:.06rem;}.z-mg-t7{margin-top:.07rem;} +.z-mg-t8{margin-top:.08rem;}.z-mg-t9{margin-top:.09rem;} +.z-mg-t10{margin-top:.1rem;}.z-mg-t12{margin-top:.12rem;} +.z-mg-t14{margin-top:.14rem;}.z-mg-t15{margin-top:.15rem;} +.z-mg-t16{margin-top:.16rem;}.z-mg-t18{margin-top:.18rem;} +.z-mg-t20{margin-top:.2rem;}.z-mg-t24{margin-top:.24rem;} +.z-mg-t25{margin-top:.25rem;}.z-mg-t26{margin-top:.26rem;} +.z-mg-t28{margin-top:.28rem;}.z-mg-t30{margin-top:.3rem;} + +.z-mg-b0{margin-bottom:0;}.z-mg-b1{margin-bottom:.01rem;} +.z-mg-b2{margin-bottom:.02rem;}.z-mg-b3{margin-bottom:.03rem;} +.z-mg-b4{margin-bottom:.04rem;}.z-mg-b5{margin-bottom:.05rem;} +.z-mg-b6{margin-bottom:.06rem;}.z-mg-b7{margin-bottom:.07rem;} +.z-mg-b8{margin-bottom:.08rem;}.z-mg-b9{margin-bottom:.09rem;} +.z-mg-b10{margin-bottom:.1rem;}.z-mg-b12{margin-bottom:.12rem;} +.z-mg-b14{margin-bottom:.14rem;}.z-mg-b15{margin-bottom:.15rem;} +.z-mg-b16{margin-bottom:.16rem;}.z-mg-b18{margin-bottom:.18rem;} +.z-mg-b20{margin-bottom:.2rem;}.z-mg-b24{margin-bottom:.24rem;} +.z-mg-b25{margin-bottom:.25rem;}.z-mg-b26{margin-bottom:.26rem;} +.z-mg-b28{margin-bottom:.28rem;}.z-mg-b30{margin-bottom:.3rem;} + +.z-mg-l-1{margin-left:-.01rem;}.z-mg-l-2{margin-left:-.02rem;} +.z-mg-l-3{margin-left:-.03rem;}.z-mg-l-4{margin-left:-.04rem;} +.z-mg-l-5{margin-left:-.05rem;}.z-mg-l-6{margin-left:-.06rem;} +.z-mg-l-7{margin-left:-.07rem;}.z-mg-l-8{margin-left:-.08rem;} +.z-mg-l-9{margin-left:-.09rem;}.z-mg-l-10{margin-left:-.1rem;} +.z-mg-l-12{margin-left:-.12rem;}.z-mg-l-14{margin-left:-.14rem;} +.z-mg-l-15{margin-left:-.15rem;}.z-mg-l-16{margin-left:-.16rem;} +.z-mg-l-18{margin-left:-.18rem;}.z-mg-l-20{margin-left:-.2rem;} +.z-mg-l-24{margin-left:-.24rem;}.z-mg-l-25{margin-left:-.25rem;} +.z-mg-l-26{margin-left:-.26rem;}.z-mg-l-28{margin-left:-.28rem;} +.z-mg-l-30{margin-left:-.3rem;} + +.z-mg-r-1{margin-right:-.01rem;}.z-mg-r-2{margin-right:-.02rem;} +.z-mg-r-3{margin-right:-.03rem;}.z-mg-r-4{margin-right:-.04rem;} +.z-mg-r-5{margin-right:-.05rem;}.z-mg-r-6{margin-right:-.06rem;} +.z-mg-r-7{margin-right:-.07rem;}.z-mg-r-8{margin-right:-.08rem;} +.z-mg-r-9{margin-right:-.09rem;}.z-mg-r-10{margin-right:-.1rem;} +.z-mg-r-12{margin-right:-.12rem;}.z-mg-r-14{margin-right:-.14rem;} +.z-mg-r-15{margin-right:-.15rem;}.z-mg-r-16{margin-right:-.16rem;} +.z-mg-r-18{margin-right:-.18rem;}.z-mg-r-20{margin-right:-.2rem;} +.z-mg-r-24{margin-right:-.24rem;}.z-mg-r-25{margin-right:-.25rem;} +.z-mg-r-26{margin-right:-.26rem;}.z-mg-r-28{margin-right:-.28rem;} +.z-mg-r-30{margin-right:-.3rem;} + +.z-mg-t-1{margin-top:-.01rem;}.z-mg-t-2{margin-top:-.02rem;} +.z-mg-t-3{margin-top:-.03rem;}.z-mg-t-4{margin-top:-.04rem;} +.z-mg-t-5{margin-top:-.05rem;}.z-mg-t-6{margin-top:-.06rem;} +.z-mg-t-7{margin-top:-.07rem;}.z-mg-t-8{margin-top:-.08rem;} +.z-mg-t-9{margin-top:-.09rem;}.z-mg-t-10{margin-top:-.1rem;} +.z-mg-t-12{margin-top:-.12rem;}.z-mg-t-14{margin-top:-.14rem;} +.z-mg-t-15{margin-top:-.15rem;}.z-mg-t-16{margin-top:-.16rem;} +.z-mg-t-18{margin-top:-.18rem;}.z-mg-t-20{margin-top:-.2rem;} +.z-mg-t-24{margin-top:-.24rem;}.z-mg-t-25{margin-top:-.25rem;} +.z-mg-t-26{margin-top:-.26rem;}.z-mg-t-28{margin-top:-.28rem;} +.z-mg-t-30{margin-top:-.3rem;} + +.z-mg-b-1{margin-bottom:-.01rem;}.z-mg-b-2{margin-bottom:-.02rem;} +.z-mg-b-3{margin-bottom:-.03rem;}.z-mg-b-4{margin-bottom:-.04rem;} +.z-mg-b-5{margin-bottom:-.05rem;}.z-mg-b-6{margin-bottom:-.06rem;} +.z-mg-b-7{margin-bottom:-.07rem;}.z-mg-b-8{margin-bottom:-.08rem;} +.z-mg-b-9{margin-bottom:-.09rem;}.z-mg-b-10{margin-bottom:-.1rem;} +.z-mg-b-12{margin-bottom:-.12rem;}.z-mg-b-14{margin-bottom:-.14rem;} +.z-mg-b-15{margin-bottom:-.15rem;}.z-mg-b-16{margin-bottom:-.16rem;} +.z-mg-b-18{margin-bottom:-.18rem;}.z-mg-b-20{margin-bottom:-.2rem;} +.z-mg-b-24{margin-bottom:-.24rem;}.z-mg-b-25{margin-bottom:-.25rem;} +.z-mg-b-26{margin-bottom:-.26rem;}.z-mg-b-28{margin-bottom:-.28rem;} +.z-mg-b-30{margin-bottom:-.3rem;} + +.z-mg-lr1{margin-left:.01rem;margin-right:.01rem;}.z-mg-lr2{margin-left:.02rem;margin-right:.02rem;} +.z-mg-lr3{margin-left:.03rem;margin-right:.03rem;}.z-mg-lr4{margin-left:.04rem;margin-right:.04rem;} +.z-mg-lr5{margin-left:.05rem;margin-right:.05rem;}.z-mg-lr6{margin-left:.06rem;margin-right:.06rem;} +.z-mg-lr7{margin-left:.07rem;margin-right:.07rem;}.z-mg-lr8{margin-left:.08rem;margin-right:.08rem;} +.z-mg-lr9{margin-left:.09rem;margin-right:.09rem;}.z-mg-lr10{margin-left:.1rem;margin-right:.1rem;} +.z-mg-lr12{margin-left:.12rem;margin-right:.12rem;}.z-mg-lr14{margin-left:.14rem;margin-right:.14rem;} +.z-mg-lr15{margin-left:.15rem;margin-right:.15rem;}.z-mg-lr16{margin-left:.16rem;margin-right:.16rem;} +.z-mg-lr18{margin-left:.18rem;margin-right:.18rem;}.z-mg-lr20{margin-left:.2rem;margin-right:.2rem;} +.z-mg-lr24{margin-left:.24rem;margin-right:.24rem;}.z-mg-lr25{margin-left:.25rem;margin-right:.25rem;} +.z-mg-lr26{margin-left:.26rem;margin-right:.26rem;}.z-mg-lr28{margin-left:.28rem;margin-right:.28rem;} +.z-mg-lr30{margin-left:.3rem;margin-right:.3rem;} + +.z-mg-tb1{margin-top:.01rem;margin-bottom:.01rem;}.z-mg-tb2{margin-top:.02rem;margin-bottom:.02rem;} +.z-mg-tb3{margin-top:.03rem;margin-bottom:.03rem;}.z-mg-tb4{margin-top:.04rem;margin-bottom:.04rem;} +.z-mg-tb5{margin-top:.05rem;margin-bottom:.05rem;}.z-mg-tb6{margin-top:.06rem;margin-bottom:.06rem;} +.z-mg-tb7{margin-top:.07rem;margin-bottom:.07rem;}.z-mg-tb8{margin-top:.08rem;margin-bottom:.08rem;} +.z-mg-tb9{margin-top:.09rem;margin-bottom:.09rem;}.z-mg-tb10{margin-top:.1rem;margin-bottom:.1rem;} +.z-mg-tb12{margin-top:.12rem;margin-bottom:.12rem;}.z-mg-tb14{margin-top:.14rem;margin-bottom:.14rem;} +.z-mg-tb15{margin-top:.15rem;margin-bottom:.15rem;}.z-mg-tb16{margin-top:.16rem;margin-bottom:.16rem;} +.z-mg-tb18{margin-top:.18rem;margin-bottom:.18rem;}.z-mg-tb20{margin-top:.2rem;margin-bottom:.2rem;} +.z-mg-tb24{margin-top:.24rem;margin-bottom:.24rem;}.z-mg-tb25{margin-top:.25rem;margin-bottom:.25rem;} +.z-mg-tb26{margin-top:.26rem;margin-bottom:.26rem;}.z-mg-tb28{margin-top:.28rem;margin-bottom:.28rem;} +.z-mg-tb30{margin-top:.3rem;margin-bottom:.3rem;} + +.z-mg-auto{margin:auto;} +.z-mg-l-auto{margin-left:auto;} +.z-mg-r-auto{margin-right:auto;} +.z-mg-t-auto{margin-top:auto;} +.z-mg-b-auto{margin-bottom:auto;} +.z-mg-lr-auto{margin-left:auto;margin-right:auto;} +.z-mg-tb-auto{margin-top:auto;margin-bottom:auto;} + +.zi-mg0{margin:0 !important;}.zi-mg1{margin:.01rem !important;} +.zi-mg2{margin:.02rem !important;}.zi-mg3{margin:.03rem !important;} +.zi-mg4{margin:.04rem !important;}.zi-mg5{margin:.05rem !important;} +.zi-mg6{margin:.06rem !important;}.zi-mg7{margin:.07rem !important;} +.zi-mg8{margin:.08rem !important;}.zi-mg9{margin:.09rem !important;} +.zi-mg10{margin:.1rem !important;}.zi-mg12{margin:.12rem !important;} +.zi-mg14{margin:.14rem !important;}.zi-mg15{margin:.15rem !important;} +.zi-mg16{margin:.16rem !important;}.zi-mg18{margin:.18rem !important;} +.zi-mg20{margin:.2rem !important;}.zi-mg24{margin:.24rem !important;} +.zi-mg25{margin:.25rem !important;}.zi-mg26{margin:.26rem !important;} +.zi-mg28{margin:.28rem !important;}.zi-mg30{margin:.3rem !important;} + +.zi-mg-l0{margin-left:0 !important;}.zi-mg-l1{margin-left:.01rem !important;} +.zi-mg-l2{margin-left:.02rem !important;}.zi-mg-l3{margin-left:.03rem !important;} +.zi-mg-l4{margin-left:.04rem !important;}.zi-mg-l5{margin-left:.05rem !important;} +.zi-mg-l6{margin-left:.06rem !important;}.zi-mg-l7{margin-left:.07rem !important;} +.zi-mg-l8{margin-left:.08rem !important;}.zi-mg-l9{margin-left:.09rem !important;} +.zi-mg-l10{margin-left:.1rem !important;}.zi-mg-l12{margin-left:.12rem !important;} +.zi-mg-l14{margin-left:.14rem !important;}.zi-mg-l15{margin-left:.15rem !important;} +.zi-mg-l16{margin-left:.16rem !important;}.zi-mg-l18{margin-left:.18rem !important;} +.zi-mg-l20{margin-left:.2rem !important;}.zi-mg-l24{margin-left:.24rem !important;} +.zi-mg-l25{margin-left:.25rem !important;}.zi-mg-l26{margin-left:.26rem !important;} +.zi-mg-l28{margin-left:.28rem !important;}.zi-mg-l30{margin-left:.3rem !important;} + +.zi-mg-r0{margin-right:0 !important;}.zi-mg-r1{margin-right:.01rem !important;} +.zi-mg-r2{margin-right:.02rem !important;}.zi-mg-r3{margin-right:.03rem !important;} +.zi-mg-r4{margin-right:.04rem !important;}.zi-mg-r5{margin-right:.05rem !important;} +.zi-mg-r6{margin-right:.06rem !important;}.zi-mg-r7{margin-right:.07rem !important;} +.zi-mg-r8{margin-right:.08rem !important;}.zi-mg-r9{margin-right:.09rem !important;} +.zi-mg-r10{margin-right:.1rem !important;}.zi-mg-r12{margin-right:.12rem !important;} +.zi-mg-r14{margin-right:.14rem !important;}.zi-mg-r15{margin-right:.15rem !important;} +.zi-mg-r16{margin-right:.16rem !important;}.zi-mg-r18{margin-right:.18rem !important;} +.zi-mg-r20{margin-right:.2rem !important;}.zi-mg-r24{margin-right:.24rem !important;} +.zi-mg-r25{margin-right:.25rem !important;}.zi-mg-r26{margin-right:.26rem !important;} +.zi-mg-r28{margin-right:.28rem !important;}.zi-mg-r30{margin-right:.3rem !important;} + +.zi-mg-t0{margin-top:0 !important;}.zi-mg-t1{margin-top:.01rem !important;} +.zi-mg-t2{margin-top:.02rem !important;}.zi-mg-t3{margin-top:.03rem !important;} +.zi-mg-t4{margin-top:.04rem !important;}.zi-mg-t5{margin-top:.05rem !important;} +.zi-mg-t6{margin-top:.06rem !important;}.zi-mg-t7{margin-top:.07rem !important;} +.zi-mg-t8{margin-top:.08rem !important;}.zi-mg-t9{margin-top:.09rem !important;} +.zi-mg-t10{margin-top:.1rem !important;}.zi-mg-t12{margin-top:.12rem !important;} +.zi-mg-t14{margin-top:.14rem !important;}.zi-mg-t15{margin-top:.15rem !important;} +.zi-mg-t16{margin-top:.16rem !important;}.zi-mg-t18{margin-top:.18rem !important;} +.zi-mg-t20{margin-top:.2rem !important;}.zi-mg-t24{margin-top:.24rem !important;} +.zi-mg-t25{margin-top:.25rem !important;}.zi-mg-t26{margin-top:.26rem !important;} +.zi-mg-t28{margin-top:.28rem !important;}.zi-mg-t30{margin-top:.3rem !important;} + +.zi-mg-b0{margin-bottom:0 !important;}.zi-mg-b1{margin-bottom:.01rem !important;} +.zi-mg-b2{margin-bottom:.02rem !important;}.zi-mg-b3{margin-bottom:.03rem !important;} +.zi-mg-b4{margin-bottom:.04rem !important;}.zi-mg-b5{margin-bottom:.05rem !important;} +.zi-mg-b6{margin-bottom:.06rem !important;}.zi-mg-b7{margin-bottom:.07rem !important;} +.zi-mg-b8{margin-bottom:.08rem !important;}.zi-mg-b9{margin-bottom:.09rem !important;} +.zi-mg-b10{margin-bottom:.1rem !important;}.zi-mg-b12{margin-bottom:.12rem !important;} +.zi-mg-b14{margin-bottom:.14rem !important;}.zi-mg-b15{margin-bottom:.15rem !important;} +.zi-mg-b16{margin-bottom:.16rem !important;}.zi-mg-b18{margin-bottom:.18rem !important;} +.zi-mg-b20{margin-bottom:.2rem !important;}.zi-mg-b24{margin-bottom:.24rem !important;} +.zi-mg-b25{margin-bottom:.25rem !important;}.zi-mg-b26{margin-bottom:.26rem !important;} +.zi-mg-b28{margin-bottom:.28rem !important;}.zi-mg-b30{margin-bottom:.3rem !important;} + +.zi-mg-l-1{margin-left:-.01rem !important;}.zi-mg-l-2{margin-left:-.02rem !important;} +.zi-mg-l-3{margin-left:-.03rem !important;}.zi-mg-l-4{margin-left:-.04rem !important;} +.zi-mg-l-5{margin-left:-.05rem !important;}.zi-mg-l-6{margin-left:-.06rem !important;} +.zi-mg-l-7{margin-left:-.07rem !important;}.zi-mg-l-8{margin-left:-.08rem !important;} +.zi-mg-l-9{margin-left:-.09rem !important;}.zi-mg-l-10{margin-left:-.1rem !important;} +.zi-mg-l-12{margin-left:-.12rem !important;}.zi-mg-l-14{margin-left:-.14rem !important;} +.zi-mg-l-15{margin-left:-.15rem !important;}.zi-mg-l-16{margin-left:-.16rem !important;} +.zi-mg-l-18{margin-left:-.18rem !important;}.zi-mg-l-20{margin-left:-.2rem !important;} +.zi-mg-l-24{margin-left:-.24rem !important;}.zi-mg-l-25{margin-left:-.25rem !important;} +.zi-mg-l-26{margin-left:-.26rem !important;}.zi-mg-l-28{margin-left:-.28rem !important;} +.zi-mg-l-30{margin-left:-.3rem !important;} + +.zi-mg-r-1{margin-right:-.01rem !important;}.zi-mg-r-2{margin-right:-.02rem !important;} +.zi-mg-r-3{margin-right:-.03rem !important;}.zi-mg-r-4{margin-right:-.04rem !important;} +.zi-mg-r-5{margin-right:-.05rem !important;}.zi-mg-r-6{margin-right:-.06rem !important;} +.zi-mg-r-7{margin-right:-.07rem !important;}.zi-mg-r-8{margin-right:-.08rem !important;} +.zi-mg-r-9{margin-right:-.09rem !important;}.zi-mg-r-10{margin-right:-.1rem !important;} +.zi-mg-r-12{margin-right:-.12rem !important;}.zi-mg-r-14{margin-right:-.14rem !important;} +.zi-mg-r-15{margin-right:-.15rem !important;}.zi-mg-r-16{margin-right:-.16rem !important;} +.zi-mg-r-18{margin-right:-.18rem !important;}.zi-mg-r-20{margin-right:-.2rem !important;} +.zi-mg-r-24{margin-right:-.24rem !important;}.zi-mg-r-25{margin-right:-.25rem !important;} +.zi-mg-r-26{margin-right:-.26rem !important;}.zi-mg-r-28{margin-right:-.28rem !important;} +.zi-mg-r-30{margin-right:-.3rem !important;} + +.zi-mg-t-1{margin-top:-.01rem !important;}.zi-mg-t-2{margin-top:-.02rem !important;} +.zi-mg-t-3{margin-top:-.03rem !important;}.zi-mg-t-4{margin-top:-.04rem !important;} +.zi-mg-t-5{margin-top:-.05rem !important;}.zi-mg-t-6{margin-top:-.06rem !important;} +.zi-mg-t-7{margin-top:-.07rem !important;}.zi-mg-t-8{margin-top:-.08rem !important;} +.zi-mg-t-9{margin-top:-.09rem !important;}.zi-mg-t-10{margin-top:-.1rem !important;} +.zi-mg-t-12{margin-top:-.12rem !important;}.zi-mg-t-14{margin-top:-.14rem !important;} +.zi-mg-t-15{margin-top:-.15rem !important;}.zi-mg-t-16{margin-top:-.16rem !important;} +.zi-mg-t-18{margin-top:-.18rem !important;}.zi-mg-t-20{margin-top:-.2rem !important;} +.zi-mg-t-24{margin-top:-.24rem !important;}.zi-mg-t-25{margin-top:-.25rem !important;} +.zi-mg-t-26{margin-top:-.26rem !important;}.zi-mg-t-28{margin-top:-.28rem !important;} +.zi-mg-t-30{margin-top:-.3rem !important;} + +.zi-mg-b-1{margin-bottom:.01rem !important;}.zi-mg-b-2{margin-bottom:.02rem !important;} +.zi-mg-b-3{margin-bottom:.03rem !important;}.zi-mg-b-4{margin-bottom:.04rem !important;} +.zi-mg-b-5{margin-bottom:.05rem !important;}.zi-mg-b-6{margin-bottom:.06rem !important;} +.zi-mg-b-7{margin-bottom:.07rem !important;}.zi-mg-b-8{margin-bottom:.08rem !important;} +.zi-mg-b-9{margin-bottom:.09rem !important;}.zi-mg-b-10{margin-bottom:.1rem !important;} +.zi-mg-b-12{margin-bottom:.12rem !important;}.zi-mg-b-14{margin-bottom:.14rem !important;} +.zi-mg-b-15{margin-bottom:.15rem !important;}.zi-mg-b-16{margin-bottom:.16rem !important;} +.zi-mg-b-18{margin-bottom:.18rem !important;}.zi-mg-b-20{margin-bottom:.2rem !important;} +.zi-mg-b-24{margin-bottom:.24rem !important;}.zi-mg-b-25{margin-bottom:.25rem !important;} +.zi-mg-b-26{margin-bottom:.26rem !important;}.zi-mg-b-28{margin-bottom:.28rem !important;} +.zi-mg-b-30{margin-bottom:.3rem !important;} + +.zi-mg-lr1{margin-left:.01rem !important;margin-right:.01rem !important;}.zi-mg-lr2{margin-left:.02rem !important;margin-right:.02rem !important;} +.zi-mg-lr3{margin-left:.03rem !important;margin-right:.03rem !important;}.zi-mg-lr4{margin-left:.04rem !important;margin-right:.04rem !important;} +.zi-mg-lr5{margin-left:.05rem !important;margin-right:.05rem !important;}.zi-mg-lr6{margin-left:.06rem !important;margin-right:.06rem !important;} +.zi-mg-lr7{margin-left:.07rem !important;margin-right:.07rem !important;}.zi-mg-lr8{margin-left:.08rem !important;margin-right:.08rem !important;} +.zi-mg-lr9{margin-left:.09rem !important;margin-right:.09rem !important;}.zi-mg-lr10{margin-left:.1rem !important;margin-right:.1rem !important;} +.zi-mg-lr12{margin-left:.12rem !important;margin-right:.12rem !important;}.zi-mg-lr14{margin-left:.14rem !important;margin-right:.14rem !important;} +.zi-mg-lr15{margin-left:.15rem !important;margin-right:.15rem !important;}.zi-mg-lr16{margin-left:.16rem !important;margin-right:.16rem !important;} +.zi-mg-lr18{margin-left:.18rem !important;margin-right:.18rem !important;}.zi-mg-lr20{margin-left:.2rem !important;margin-right:.2rem !important;} +.zi-mg-lr24{margin-left:.24rem !important;margin-right:.24rem !important;}.zi-mg-lr25{margin-left:.25rem !important;margin-right:.25rem !important;} +.zi-mg-lr26{margin-left:.26rem !important;margin-right:.26rem !important;}.zi-mg-lr28{margin-left:.28rem !important;margin-right:.28rem !important;} +.zi-mg-lr30{margin-left:.3rem !important;margin-right:.3rem !important;} + +.zi-mg-tb1{margin-top:.01rem !important;margin-bottom:.01rem !important;}.zi-mg-tb2{margin-top:.02rem !important;margin-bottom:.02rem !important;} +.zi-mg-tb3{margin-top:.03rem !important;margin-bottom:.03rem !important;}.zi-mg-tb4{margin-top:.04rem !important;margin-bottom:.04rem !important;} +.zi-mg-tb5{margin-top:.05rem !important;margin-bottom:.05rem !important;}.zi-mg-tb6{margin-top:.06rem !important;margin-bottom:.06rem !important;} +.zi-mg-tb7{margin-top:.07rem !important;margin-bottom:.07rem !important;}.zi-mg-tb8{margin-top:.08rem !important;margin-bottom:.08rem !important;} +.zi-mg-tb9{margin-top:.09rem !important;margin-bottom:.09rem !important;}.zi-mg-tb10{margin-top:.1rem !important;margin-bottom:.1rem !important;} +.zi-mg-tb12{margin-top:.12rem !important;margin-bottom:.12rem !important;}.zi-mg-tb14{margin-top:.14rem !important;margin-bottom:.14rem !important;} +.zi-mg-tb15{margin-top:.15rem !important;margin-bottom:.15rem !important;}.zi-mg-tb16{margin-top:.16rem !important;margin-bottom:.16rem !important;} +.zi-mg-tb18{margin-top:.18rem !important;margin-bottom:.18rem !important;}.zi-mg-tb20{margin-top:.2rem !important;margin-bottom:.2rem !important;} +.zi-mg-tb24{margin-top:.24rem !important;margin-bottom:.24rem !important;}.zi-mg-tb25{margin-top:.25rem !important;margin-bottom:.25rem !important;} +.zi-mg-tb26{margin-top:.26rem !important;margin-bottom:.26rem !important;}.zi-mg-tb28{margin-top:.28rem !important;margin-bottom:.28rem !important;} +.zi-mg-tb30{margin-top:.3rem !important;margin-bottom:.3rem !important;} + +.z-mg-t-1px{margin-top:-1px;} +.z-mg-r-1px{margin-right:-1px;} +.z-mg-l-1px{margin-left:-1px;} +.z-mg-b-1px{margin-bottom:-1px;} + +.zi-mg-t-1px{margin-top:-1px !important;} +.zi-mg-r-1px{margin-right:-1px !important;} +.zi-mg-l-1px{margin-left:-1px !important;} +.zi-mg-b-1px{margin-bottom:-1px !important;} + +.zi-mg-auto{margin:auto !important;} +.zi-mg-l-auto{margin-left:auto !important;} +.zi-mg-r-auto{margin-right:auto !important;} +.zi-mg-t-auto{margin-top:auto !important;} +.zi-mg-b-auto{margin-bottom:auto !important;} +.zi-mg-lr-auto{margin-left:auto !important;margin-right:auto !important;} +.zi-mg-tb-auto{margin-top:auto !important;margin-bottom:auto !important;} + +/***********************************************/ +/* 第四部分:表格样式定义 */ +/***********************************************/ + +/***********************************************/ +/* 第五部分:表单样式定义 */ +/***********************************************/ + +/** 输入框相关 */ +.z-input { + -webkit-appearance:none; + -moz-appearance:none; + -ms-appearance:none; + appearance:none; + font-family:inherit; + display:block; + width:100%; + height:.45rem; + padding:0; + margin:0; + font-size:.16rem; + color:#333; + background:none; + border-width:0 0 1px 0; + border-style:solid; + border-color:#e5e5e5; + vertical-align:middle; + border-radius:0; + outline:0; + /*box-shadow:none;*/ + -webkit-transition:border .2s; + transition:border .2s; + position:relative; +} + +.z-input:focus,.z-input.z-active{border-color:#cccccc;} +.z-input.z-red:focus,.z-input.z-red.z-active{border-color:#ea4a36;} +.z-input.z-orange:focus,.z-input.z-orange.z-active{border-color:#ff6600;} +.z-input.z-yellow:focus,.z-input.z-yellow.z-active{border-color:#fac603;} +.z-input.z-green:focus,.z-input.z-green.z-active{border-color:#43cd6e;} +.z-input.z-cyan:focus,.z-input.z-cyan.z-active{border-color:#009899;} +.z-input.z-blue:focus,.z-input.z-blue.z-active{border-color:#28a3ef;} +.z-input.z-purple:focus,.z-input.z-purple.z-active{border-color:#9e70ca;} + +.z-input.z-xsmall{padding:0 .03rem;font-size:.12rem;height:.3rem;} +.z-input.z-small {padding:0 .03rem;font-size:.14rem;height:.4rem;} +.z-input.z-large {padding:0 .06rem;font-size:.17rem;height:.5rem;} +.z-input.z-xlarge {padding:0 .08rem;font-size:.18rem;height:.6rem;} + +/** 输入列表 **/ +.z-input-list{font-size:.16rem;margin-top:.15rem;} +.z-input-list>li{ + display:-webkit-flex; + display:flex; + -webkit-flex-wrap:nowrap; + flex-wrap:nowrap; + -webkit-justify-content:center; + justify-content:center; + -webkit-align-items:center; + align-items:center; + margin-bottom:.12rem; + line-height:.45rem; + position:relative; + border-bottom:1px solid #e5e5e5; +} +.z-input-list>li:last-child{margin-bottom:0;} +.z-input-list>li>*{white-space:nowrap;} +.z-input-list>li>*:not(input){-webkit-flex:none;flex:none;} +.z-input-list>li>*:first-child:not(input),.z-input-list>li>*:not(input)+input{margin-left:.1rem;} +.z-input-list>li>*:last-child:not(input){margin-right:.1rem;} +.z-input-list input{-webkit-flex:auto;flex:auto;border-width:0;} +/*按钮处理*/ +.z-input-list .z-button,.z-input-list .z-button-flex{width:auto;height:.45rem;line-height:.45rem;border:none;} + +/** 输入框组 **/ +.z-input-row{ + -webkit-align-self:center; + align-self:center; + display:-webkit-flex; + display:flex; + -webkit-flex-wrap:nowrap; + flex-wrap:nowrap; + -webkit-align-items:center; + align-items:center; + height:.5rem; + padding:.03rem .15rem .02rem; + position:relative; +} +.z-input-row:after{content:"";width:100%;height:1px;position:absolute;right:0;bottom:0;left:0;background:#e5e5e5;z-index:9;} +.z-input-row>label, +.z-input-row>label>.z-font, +.z-input-row>label>.z-input-text, +.z-input-row>input, +.z-input-row>select{height:100%;min-width:0;} +.z-input-row>label{-ms-flex:0 0 auto;flex:0 0 auto;max-width:50%;} +.z-input-row>label,.z-input-row>label>.z-font, +.z-input-row>label>.z-input-text{ + -webkit-align-self:center; + align-self:center; + display:-webkit-flex; + display:flex; + -webkit-align-items:center; + align-items:center; +} + +.z-input-row>label>.z-input-text{max-width:100%;white-space:nowrap;position:relative;overflow:hidden;text-overflow:ellipsis;} +.z-input-row>label>.z-font{bottom:0;font-size:.2rem;margin-right:.02rem;} +.z-input-row>input,.z-input-row>select{ + -ms-flex:1 1 auto; + flex:1 1 auto; + color:#333; + background-color:#fff; + padding:0 .08rem; + /*box-shadow:none;*/ + border-width:1px; + border-style:solid; + border-radius:inherit; +} +.z-input-row:not(.z-bordered)>input, +.z-input-row:not(.z-bordered)>select{border:none;} +.z-input-row:not(.z-bordered)>input:first-child, +.z-input-row:not(.z-bordered)>select:first-child{padding:0;} +.z-input-row>select{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;} + +/* 选择按钮的输入组 */ +.z-input-row>input[type=checkbox],.z-input-row>input[type=radio]{padding:0;margin:0 .08rem;-webkit-flex:0 0 auto;flex:0 0 auto;} + + +/* 带边框输入组 */ +.z-input-row.z-bordered{padding:0;margin-top:.15rem;margin-bottom:.15rem;} +.z-input-row.z-bordered:after{content:none;} +.z-input-row.z-bordered>label{padding-left:.12rem;padding-right:.12rem;background:#fcfcfc;background-clip:padding-box;border-style:solid;border-color:#e5e5e5;} +.z-input-row.z-bordered>label:first-child{border-width:1px 0 1px 1px;} +.z-input-row.z-bordered>label:last-child{border-width:1px 1px 1px 0;} + +/* 带圆角输入组 */ +[class*=z-bd-rd].z-input-row.z-bordered{border-radius:0 0 0 0 !important;} +.z-input-row.z-bordered.z-bd-rd3>label:first-child, +.z-input-row.z-bordered.z-bd-rd3>input:first-child, +.z-input-row.z-bordered.z-bd-rd3>select:first-child{border-top-left-radius:3px !important;border-bottom-left-radius:3px !important;} +.z-input-row.z-bordered.z-bd-rd3>label:last-child, +.z-input-row.z-bordered.z-bd-rd3>input:last-child, +.z-input-row.z-bordered.z-bd-rd3>select:last-child{border-top-right-radius:3px !important;border-bottom-right-radius:3px !important;} + +.z-input-row.z-bordered.z-bd-rd5>label:first-child, +.z-input-row.z-bordered.z-bd-rd5>input:first-child, +.z-input-row.z-bordered.z-bd-rd5>select:first-child{border-top-left-radius:5px !important;border-bottom-left-radius:5px !important;} +.z-input-row.z-bordered.z-bd-rd5>label:last-child, +.z-input-row.z-bordered.z-bd-rd5>input:last-child, +.z-input-row.z-bordered.z-bd-rd5>select:last-child{border-top-right-radius:5px !important;border-bottom-right-radius:5px !important;} + +.z-input-row.z-bordered.z-bd-rd10>label:first-child, +.z-input-row.z-bordered.z-bd-rd10>input:first-child, +.z-input-row.z-bordered.z-bd-rd10>select:first-child{border-top-left-radius:10px !important;border-bottom-left-radius:10px !important;} +.z-input-row.z-bordered.z-bd-rd10>label:last-child, +.z-input-row.z-bordered.z-bd-rd10>input:last-child, +.z-input-row.z-bordered.z-bd-rd10>select:last-child{border-top-right-radius:10px !important;border-bottom-right-radius:10px !important;} + +.z-input-row.z-bordered.z-bd-rd-circle>label:first-child, +.z-input-row.z-bordered.z-bd-rd-circle>input:first-child, +.z-input-row.z-bordered.z-bd-rd-circle>select:first-child{padding-left:.4rem;border-top-left-radius:1000px !important;border-bottom-left-radius:1000px !important;} +.z-input-row.z-bordered.z-bd-rd-circle>label:last-child, +.z-input-row.z-bordered.z-bd-rd-circle>input:last-child, +.z-input-row.z-bordered.z-bd-rd-circle>select:last-child{padding-right:.4rem;border-top-right-radius:1000px !important;border-bottom-right-radius:1000px !important;} + +/** 数字输入框,支持增减按钮 **/ +.z-numInput,.z-numInput>.z-btn-minus,.z-numInput>.z-btn-plus,.z-numInput>input[type=text]{ + -webkit-align-self:center; + align-self:center; + display:-webkit-flex; + display:flex; + -webkit-flex-wrap:nowrap; + flex-wrap:nowrap; + -webkit-justify-content:center; + justify-content:center; + -webkit-align-items:center; + align-items:center; +} +.z-numInput>.z-btn-minus,.z-numInput>.z-btn-plus,.z-numInput>input[type=text]{height:.24rem;border-style:solid;border-color:#d5d5d5;font-size:.14rem;} +.z-numInput>input[type=text]{width:.3rem;border-width:1px;text-align:center;color:#333;} +.z-numInput>.z-btn-minus,.z-numInput>.z-btn-plus{width:.24rem;color:#999;font-size:.16rem;background:#fcfcfc;} +.z-numInput>.z-btn-minus{border-width:1px 0 1px 1px;} +.z-numInput>.z-btn-plus{border-width:1px 1px 1px 0;} +/**竖版**/ +.z-numInput.z-direction-column{width:.3rem;} +.z-numInput.z-direction-column>.z-btn-minus,.z-numInput.z-direction-column>.z-btn-plus,.z-numInput.z-direction-column>input[type=text]{width:100%;} +.z-numInput.z-direction-column>.z-btn-minus{border-width:1px 1px 0 1px;} +.z-numInput.z-direction-column>.z-btn-plus{border-width:0 1px 1px 1px;} + +/** 多选框 / 单选框 / 切换按钮*/ +input.z-checkbox,input.z-radio,input.z-switch{ + display:inline-block; + width:.24rem; + height:.24rem; + padding:0; + margin:0; + position:relative; + -webkit-appearance:none; + border:0; + background:0 0; + outline:0; + vertical-align:middle; + box-shadow:none; +} +input.z-checkbox:hover,input.z-radio:hover,input.z-switch:hover{border:none;} +input.z-switch{width:.4rem} +input.z-checkbox:before,input.z-radio:before,input.z-switch:before{ + content:""; + display:block; + width:100%; + height:100%; + position:absolute; + left:0;top:0;right:0;bottom:0; + border:1px solid #dfe0e1; + border-radius:1000px; + box-sizing:border-box; + background-clip:content-box; +} + +/** 多选框 */ +input.z-checkbox:before{ + color:#ffffff; + font-family:"z-font"; + font-style:normal; + -webkit-font-smoothing:antialiased; + -webkit-text-stroke-width:0.2px; + -moz-osx-font-smoothing:grayscale; + position:relative; + text-align:center; + line-height:.25rem; + font-size:.15rem; +} +input.z-checkbox:checked:before{content:"\f00d";background:#00a2eb;border:none;} + +/*几种大小的多选框*/ +input.z-checkbox.z-xsmall{width:.18rem;height:.18rem;} +input.z-checkbox.z-small{width:.2rem;height:.2rem;} +input.z-checkbox.z-large{width:.28rem;height:.28rem;} +input.z-checkbox.z-xlarge{width:.32rem;height:.32rem;} + +input.z-checkbox.z-xsmall:before{line-height:.19rem;font-size:.12rem;} +input.z-checkbox.z-small:before{line-height:.21rem;font-size:.14rem;} +input.z-checkbox.z-large:before{line-height:.29rem;font-size:.16rem;} +input.z-checkbox.z-xlarge:before{line-height:.33rem;font-size:.18rem;} + +/** 单选框 */ +input.z-radio:checked:after{ + content:""; + display:block; + width:60%; + height:60%; + position:absolute; + left:20%; + top:20%; + border-radius:1000px; + background-clip:content-box; + background:#00a2eb; +} + +/*几种大小的单选框*/ +input.z-radio.z-xsmall{width:.18rem;height:.18rem;} +input.z-radio.z-small{width:.2rem;height:.2rem;} +input.z-radio.z-large{width:.28rem;height:.28rem;} +input.z-radio.z-xlarge{width:.32rem;height:.32rem;} + +/** 切换按钮 */ +input.z-switch:before{background:#fcfcfc;-webkit-transition:background-color .2s;transition:background-color .2s;} +input.z-switch:after{ + content:""; + width:.24rem; + height:.24rem; + border:1px solid #dfe0e1; + border-radius:1000px; + position:absolute; + background-color:#ffffff; + left:0; + -webkit-transition:left .2s; + transition:left .2s; +} +input.z-switch:checked:before{background-color:#00a2eb;} +input.z-switch:checked:after{left:.16rem;} + +/*几种大小的切换按钮*/ +input.z-switch.z-xsmall{width:.3rem;height:.18rem;} +input.z-switch.z-small{width:.35rem;height:.2rem;} +input.z-switch.z-large{width:.5rem;height:.28rem;} +input.z-switch.z-xlarge{width:.6rem;height:.32rem;} + +input.z-switch.z-xsmall:after{width:.18rem;height:.18rem;} +input.z-switch.z-xsmall:checked:after{left:.12rem;} +input.z-switch.z-small:after{width:.2rem;height:.2rem;} +input.z-switch.z-small:checked:after{left:.15rem;} +input.z-switch.z-large:after{width:.28rem;height:.28rem;} +input.z-switch.z-large:checked:after{left:.22rem;} +input.z-switch.z-xlarge:after{width:.32rem;height:.32rem;} +input.z-switch.z-xlarge:checked:after{left:.28rem;} + + +/** 文本框相关 */ +.z-textarea{ + font-family:"微软雅黑","宋体"; + width:100%; + padding:.05rem; + font-size:.14rem; + background-color:#fff; + border:1px solid #e5e5e5; + /*box-shadow:none;*/ +} + +.z-textarea.z-red:focus,.z-textarea.z-red.z-active{border-color:#ea4a36;} +.z-textarea.z-orange:focus,.z-textarea.z-orange.z-active{border-color:#ff6600;} +.z-textarea.z-yellow:focus,.z-textarea.z-yellow.z-active{border-color:#fac603;} +.z-textarea.z-green:focus,.z-textarea.z-green.z-active{border-color:#43cd6e;} +.z-textarea.z-cyan:focus,.z-textarea.z-cyan.z-active{border-color:#009899;} +.z-textarea.z-blue:focus,.z-textarea.z-blue.z-active{border-color:#28a3ef;} +.z-textarea.z-purple:focus,.z-textarea.z-purple.z-active{border-color:#9e70ca;} + +/** 选择框相关 */ +.z-select{ + font-family:"微软雅黑","宋体"; + display:inline-block; + vertical-align:middle; + padding:.03rem .04rem; + height:.3rem; + line-height:.22rem; + font-size:.16rem; + color:#000; + background-color:#fff; + border:1px solid #e5e5e5; + /*box-shadow:none;*/ +} + +.z-select.z-red:focus,.z-select.z-red.z-active{border-color:#ea4a36;} +.z-select.z-orange:focus,.z-select.z-orange.z-active{border-color:#ff6600;} +.z-select.z-yellow:focus,.z-select.z-yellow.z-active{border-color:#fac603;} +.z-select.z-green:focus,.z-select.z-green.z-active{border-color:#43cd6e;} +.z-select.z-cyan:focus,.z-select.z-cyan.z-active{border-color:#009899;} +.z-select.z-blue:focus,.z-select.z-blue.z-active{border-color:#28a3ef;} +.z-select.z-purple:focus,.z-select.z-purple.z-active{border-color:#9e70ca;} + +/** 按钮相关--行内按钮 */ +.z-button,.z-button-flex{ + background-color:#FFFFFF; + color:#008bd2; + text-align:center; + cursor:pointer; + font-size:.16rem; + box-shadow:none; +} +.z-button{ + display:inline-block; + vertical-align:middle; + padding:0 .16rem; + height:.4rem; + line-height:.39rem; + margin-bottom:0; + position:relative; +} +/** 默认为灰色确认按钮 */ +.z-button{color:#333;border:1px solid #e5e5e5;} +.z-button:active{background-color:#dfdfdf;} + +/** 提供除默认之外的四种默认大小风格 */ +.z-button.z-xsmall{padding:0 .08rem;height:.25rem;line-height:.23rem;font-size:.12rem;} +.z-button.z-small{padding:0 .1rem;height:.3rem;line-height:.29rem;font-size:.14rem;} +.z-button.z-large{padding:0 .24rem;height:.45rem;line-height:.44rem;font-size:.18rem;} +.z-button.z-xlarge{padding:0 .3rem;height:.5rem;line-height:.49rem;font-size:.2rem;} + +/** 定义字体图标比文本大2像素,和文本间隔4像素 */ +.z-button.z-font{bottom:0;} +.z-button .z-font{margin-right:.04rem;font-size:.14rem;line-height:1;} +.z-button.z-large .z-font{font-size:.17rem;} +.z-button.z-xlarge .z-font{font-size:.18rem;} + +/** 定义图片上移2像素并,提供默认的图标 */ +.z-button img{display:inline-block;vertical-align:middle;margin-top:-2px;} +.z-button .z-checkbox,.z-button .z-radio{margin-right:5px;margin-top:-1px;} +.z-button.z-large .z-checkbox,.z-button.z-xlarge .z-checkbox,.z-button.z-large .z-radio,.z-button.z-xlarge .z-radio{margin-right:.08rem;margin-top:-2px;} + +/** 按钮--块按钮 **/ +.z-button-flex{ + display:-webkit-flex; + display:flex; + -webkit-flex:1 1 0; + flex:1 1 0; + -webkit-justify-content:center; + justify-content:center; + -webkit-align-items:center; + align-items:center; + width:100%; + height:.45rem; + padding:0 .1rem; + position:relative; + white-space:nowrap; + overflow:hidden; + text-overflow:ellipsis; + border:none; +} +/** 定义确认按钮,背景色为红橙黄绿青蓝紫 */ +.z-button.z-red, +.z-button-flex.z-red{color:#fff;background:#ea4a36;border-color:#ea4a36;} +.z-button.z-orange, +.z-button-flex.z-orange{color:#fff;background:#ff6600;border-color:#ff6600;} +.z-button.z-yellow, +.z-button-flex.z-yellow{color:#fff;background:#fac603;border-color:#fac603;} +.z-button.z-green, +.z-button-flex.z-green{color:#fff;background:#43cd6e;border-color:#43cd6e;} +.z-button.z-cyan, +.z-button-flex.z-cyan{color:#fff;background:#009899;border-color:#009899;} +.z-button.z-blue, +.z-button-flex.z-blue{color:#fff;background:#28a3ef;border-color:#28a3ef;} +.z-button.z-purple, +.z-button-flex.z-purple{color:#fff;background:#9e70ca;border-color:#9e70ca;} + +/** 定义纯色按钮,选中时为指定的颜色,支持红橙黄绿青蓝紫*/ +.z-button.z-red.z-active, +.z-button-flex.z-red.z-active{color:#ea4a36;background:none;border-color:#ea4a36;} +.z-button.z-orange, +.z-button-flex.z-orange{color:#fff;background:#ff6600;border-color:#ff6600;} +.z-button.z-yellow, +.z-button-flex.z-yellow{color:#fff;background:#fac603;border-color:#fac603;} +.z-button.z-green, +.z-button-flex.z-green{color:#fff;background:#43cd6e;border-color:#43cd6e;} +.z-button.z-cyan, +.z-button-flex.z-cyan{color:#fff;background:#009899;border-color:#009899;} +.z-button.z-blue, +.z-button-flex.z-blue{color:#fff;background:#28a3ef;border-color:#28a3ef;} +.z-button.z-purple, +.z-button-flex.z-purple{color:#fff;background:#9e70ca;border-color:#9e70ca;} + +/** 定义确认按钮,边框色为红橙黄绿青蓝紫 */ +.z-button.z-active{color:#333;background:none;border-color:#333;} +.z-button.z-red-bd, +.z-button-flex.z-red-bd{color:#ea4a36;background:none;border-color:#ea4a36;} +.z-button.z-orange-bd, +.z-button-flex.z-orange-bd{color:#ff6600;background:none;border-color:#ff6600;} +.z-button.z-yellow-bd, +.z-button-flex.z-yellow-bd{color:#fac603;background:none;border-color:#fac603;} +.z-button.z-green-bd, +.z-button-flex.z-green-bd{color:#43cd6e;background:none;border-color:#43cd6e;} +.z-button.z-cyan-bd, +.z-button-flex.z-cyan-bd{color:#009899;background:none;border-color:#009899;} +.z-button.z-blue-bd, +.z-button-flex.z-blue-bd{color:#28a3ef;background:none;border-color:#28a3ef;} +.z-button.z-purple-bd, +.z-button-flex.z-purple-bd{color:#9e70ca;background:none;border-color:#9e70ca;} + +/** 定义边框按钮,选中时为指定的颜色,支持红橙黄绿青蓝紫*/ +.z-button.z-red-bd.z-active:after, +.z-button.z-orange-bd.z-active:after, +.z-button.z-yellow-bd.z-active:after, +.z-button.z-green-bd.z-active:after, +.z-button.z-cyan-bd.z-active:after, +.z-button.z-blue-bd.z-active:after, +.z-button.z-purple-bd.z-active:after{ + position:absolute; + width:10px; + height:10px; + line-height:0; + bottom:0; + right:0; + content:url(image/ico_button_bg_black.png); +} +.z-button.z-purple-bd.z-active{border-color:#9e70ca;} +.z-button.z-red-bd.z-active:after{content:url(image/ico_button_bg_red.png);} +.z-button.z-orange-bd.z-active:after{content:url(image/ico_button_bg_orange.png);} +.z-button.z-yellow-bd.z-active:after{content:url(image/ico_button_bg_yellow.png);} +.z-button.z-green-bd.z-active:after{content:url(image/ico_button_bg_green.png);} +.z-button.z-cyan-bd.z-active:after{content:url(image/ico_button_bg_cyan.png);} +.z-button.z-blue-bd.z-active:after{content:url(image/ico_button_bg_blue.png);} +.z-button.z-purple-bd.z-active:after{content:url(image/ico_button_bg_purple.png);} + +/** 块按钮的选中 */ +.z-button-flex.z-red-bd.z-active{color:#fff;background:#ea4a36;border-color:#ea4a36;} +.z-button-flex.z-orange-bd.z-active{color:#fff;background:#ff6600;border-color:#ff6600;} +.z-button-flex.z-yellow-bd.z-active{color:#fff;background:#fac603;border-color:#fac603;} +.z-button-flex.z-green-bd.z-active{color:#fff;background:#43cd6e;border-color:#43cd6e;} +.z-button-flex.z-cyan-bd.z-active{color:#fff;background:#009899;border-color:#009899;} +.z-button-flex.z-blue-bd.z-active{color:#fff;background:#28a3ef;border-color:#28a3ef;} +.z-button-flex.z-purple-bd.z-active{color:#fff;background:#9e70ca;border-color:#9e70ca;} + +/** 定义按钮不可用 */ +.z-button.z-disabled, +.z-button-flex.z-disabled, +.z-button[disabled], +.z-button-flex[disabled], +.z-button.z-disabled.z-active, +.z-button-flex.z-disabled.z-active, +.z-button[disabled].z-active, +.z-button-flex[disabled].z-active{ + color:#bbb !important; + cursor:not-allowed !important; + events-pointer:none !important; +} + +/* 按钮组(并列按钮) */ +.z-button-row,.z-button-column{ + -webkit-align-self:center; + align-self:center; + display:-webkit-flex; + display:flex; + -webkit-flex-wrap:nowrap; + flex-wrap:nowrap; + -webkit-justify-content:space-between; + justify-content:space-between; + background-color:#ffffff; +} +.z-button-column{-webkit-flex-direction:column;flex-direction:column;} + +.z-button-row>.z-button, +.z-button-row>.z-button-flex, +.z-button-column>.z-button, +.z-button-column>.z-button-flex{border-radius:0 0 0 0;width:100%;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;border:1px solid #e5e5e5;} +.z-button-row>.z-button[class*=z-w],.z-button-row>.z-button-flex[class*=z-w], +.z-button-row>.z-button[class*=zi-w],.z-button-row>.z-button-flex[class*=zi-w]{-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;} +.z-button-row>.z-button{margin:.1rem 0 .1rem .1rem;} +.z-button-row>.z-button-flex{margin-left:-1px;} +.z-button-row>.z-button:first-child, +.z-button-row>.z-button-flex:first-child{margin-left:0;} + +.z-button-column>.z-button{margin-top:.1rem;} +.z-button-column>.z-button-flex{margin-top:-1px;} +.z-button-column>.z-button:first-child, +.z-button-column>.z-button-flex:first-child{margin-top:0;} + +/* 按钮组的圆角 */ +[class*=z-bd-rd].z-button-row, +[class*=z-bd-rd].z-button-row>.z-button-flex{border-radius:0;} + +.z-button-row.z-bd-rd1>.z-button{border-radius:1px;} +.z-button-row.z-bd-rd1>.z-button-flex:first-child{border-top-left-radius:1px;border-bottom-left-radius:1px;} +.z-button-row.z-bd-rd1>.z-button-flex:last-child{border-top-right-radius:1px;border-bottom-right-radius:1px;} +.z-button-row.z-bd-rd2>.z-button{border-radius:2px;} +.z-button-row.z-bd-rd2>.z-button-flex:first-child{border-top-left-radius:2px;border-bottom-left-radius:2px;} +.z-button-row.z-bd-rd2>.z-button-flex:last-child{border-top-right-radius:2px;border-bottom-right-radius:2px;} +.z-button-row.z-bd-rd3>.z-button{border-radius:3px;} +.z-button-row.z-bd-rd3>.z-button-flex:first-child{border-top-left-radius:3px;border-bottom-left-radius:3px;} +.z-button-row.z-bd-rd3>.z-button-flex:last-child{border-top-right-radius:3px;border-bottom-right-radius:3px;} +.z-button-row.z-bd-rd5>.z-button{border-radius:5px;} +.z-button-row.z-bd-rd5>.z-button-flex:first-child{border-top-left-radius:5px;border-bottom-left-radius:5px;} +.z-button-row.z-bd-rd5>.z-button-flex:last-child{border-top-right-radius:5px;border-bottom-right-radius:5px;} +.z-button-row.z-bd-rd8>.z-button{border-radius:8px;} +.z-button-row.z-bd-rd8>.z-button-flex:first-child{border-top-left-radius:8px;border-bottom-left-radius:8px;} +.z-button-row.z-bd-rd8>.z-button-flex:last-child{border-top-right-radius:8px;border-bottom-right-radius:8px;} +.z-button-row.z-bd-rd10>.z-button{border-radius:10px;} +.z-button-row.z-bd-rd10>.z-button-flex:first-child{border-top-left-radius:10px;border-bottom-left-radius:10px;} +.z-button-row.z-bd-rd10>.z-button-flex:last-child{border-top-right-radius:10px;border-bottom-right-radius:10px;} +.z-button-row.z-bd-rd-circle>.z-button{border-radius:1000px;} +.z-button-row.z-bd-rd-circle>.z-button-flex:first-child{border-top-left-radius:1000px;border-bottom-left-radius:1000px;} +.z-button-row.z-bd-rd-circle>.z-button-flex:last-child{border-top-right-radius:1000px;border-bottom-right-radius:1000px;} + +/***********************************************/ +/* 第六部分:步骤条定义 */ +/***********************************************/ + +/************************************************************/ +/* 第七部分:标签页定义 +/************************************************************/ +.z-tabnav>.z-active{color:#0894ec;border-color:#0894ec;z-index:100;} +.z-tabs>*{display:none !important;} +.z-tabs>.z-active{display:block !important;} +.z-tabnav{position:relative} +.z-tabnav>nav>ul,.z-tabnav-main>nav>ul{ + -webkit-align-self:center; + align-self:center; + display:-webkit-flex; + display:flex; + -webkit-flex-wrap:nowrap; + flex-wrap:nowrap; + position:relative; + font-size:0; +} +.z-tabnav>nav li,.z-tabnav-main>nav li{ + display:block; + text-decoration:none; + text-align:center; + color:#5f646e; + font-size:0.16rem; + width:100%; + height:.45rem; + line-height:.45rem; + -webkit-flex:1 1 auto; + -ms-flex:1 1 auto; + flex:1 1 auto; + border-width:0 0 1px 0; + border-style:solid; + border-color:#e5e5e5; + border-radius:0; + white-space:nowrap; + overflow:hidden; + position:relative; + text-overflow:ellipsis; +} +.z-tabnav>nav li.z-active{border-color:#28a3ef;color:#28a3ef;cursor:default;} +.z-tabnav>section{position:relative;width:100%;height:auto;min-height:1rem;} +.z-tabnav>section>div{position:relative;width:100%;height:auto;min-height:1rem;background-color:#fff;display:none;} +.z-tabnav>section>div.z-active{display:block !important;} + +.z-tabnav.z-bordered>nav{border:1px solid #e5e5e5;border-bottom:none;background-color:#f5f5f5;} +.z-tabnav.z-bordered>nav>ul{margin-top:.18rem;} +.z-tabnav.z-bordered>nav li{border:1px solid transparent;} +.z-tabnav.z-bordered>nav li:first-child{border-left:none;} +.z-tabnav.z-bordered>nav li:last-child{border-right:none;} +.z-tabnav.z-bordered>nav li.z-active{color:#5f646e;border-color:#e5e5e5 #e5e5e5 transparent #e5e5e5;background-color:#fff;cursor:default;} +.z-tabnav.z-bordered>section,.z-tabnav>section.z-bordered {border:1px solid #e5e5e5;border-top:none;} + +.z-tabnav.z-default{min-height:.45rem;color:#666;border-radius:2px;} +.z-tabnav.z-default>nav{font-size:.16rem;line-height:.45rem;} +.z-tabnav.z-default>nav>ul,.z-tabnav.z-red>nav>ul,.z-tabnav.z-orange>nav>ul,.z-tabnav.z-yellow>nav>ul, +.z-tabnav.z-green>nav>ul,.z-tabnav.z-cyan>nav>ul,.z-tabnav.z-blue>nav>ul,.z-tabnav.z-purple>nav>ul{ + margin-top:0; +} +.z-tabnav.z-default>nav>ul li,.z-tabnav.z-red>nav>ul li,.z-tabnav.z-orange>nav>ul li,.z-tabnav.z-yellow>nav>ul li, +.z-tabnav.z-green>nav>ul li,.z-tabnav.z-cyan>nav>ul li,.z-tabnav.z-blue>nav>ul li,.z-tabnav.z-purple>nav>ul li{ + background:#f6f6f6; + border-color:transparent !important; +} +.z-tabnav.z-default>nav li.z-active{color:#fff;border-color:transparent;background:#333;cursor:default;} + +.z-tabnav.z-red>nav li.z-active{color:#fff;background:#ea4a36;} +.z-tabnav.z-orange>nav li.z-active{color:#fff;background:#ff6600;} +.z-tabnav.z-yellow>nav li.z-active{color:#fff;background:#fac603;} +.z-tabnav.z-green>nav li.z-active{color:#fff;background:#43cd6e;} +.z-tabnav.z-cyan>nav li.z-active{color:#fff;background:#009899;} +.z-tabnav.z-blue>nav li.z-active{color:#fff;background:#28a3ef;} +.z-tabnav.z-purple>nav li.z-active{color:#fff;background:#9e70ca;} + +/************************************************************/ +/* 第八部分:可编辑文本定义 +/************************************************************/ + +/************************************************************/ +/* 第九部分:对话框样式定义 +/************************************************************/ + +/***********************************************/ +/* 第十部分:浮动窗定义 */ +/***********************************************/ + +/***********************************************/ +/* 第十一部分:日历样式定义 */ +/***********************************************/ + +/***********************************************/ +/* 第十二部分:下拉列表定义 */ +/***********************************************/ + +/***********************************************/ +/* 第十三部分:整体容器布局定义 */ +/***********************************************/ +.z-bar-top,.z-bar-bottom{position:absolute;width:100%;height:.5rem;left:0;right:0;text-align:center;background-color:#ffffff;} +.z-bar-top .z-font,.z-bar-bottom .z-font{bottom:0;} +.z-bar-top.z-small,.z-bar-bottom.z-small{height:.45rem;} +.z-container{position:absolute;width:100%;left:0;right:0;top:0;bottom:0;background-color:#ffffff;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;} +.z-bar-top~.z-container{top:.5rem;} +.z-bar-bottom~.z-container{bottom:.5rem;} +.z-bar-top.z-small~.z-container{top:.45rem;} +.z-bar-bottom.z-small~.z-container{bottom:.45rem;} + +/* 顶部bar条 */ +.z-bar-top{line-height:.5rem;top:0;border-bottom:1px solid #e7e7e7;} +.z-bar-top.z-small{line-height:.45rem;} +.z-bar-top>.top-title,.z-bar-top-inner>.top-title{ + padding:0 .9rem; + text-align:center; + text-overflow:ellipsis; + overflow:hidden; + display:-webkit-box; + -webkit-box-orient:vertical; + word-break:break-word; + -webkit-line-clamp:1; +} +.z-bar-top>.top-left,.z-bar-top>.top-right, +.z-bar-top-inner>.top-left,.z-bar-top-inner>.top-right{position:absolute;top:0;bottom:0;} +.z-bar-top>.top-left,.z-bar-top-inner>.top-left{left:0;padding-left:.1rem;} +.z-bar-top>.top-right,.z-bar-top-inner>.top-right{right:0;padding-right:.1rem;} +/* 内容内部顶部 bar 条 */ +.z-bar-top-inner{height:.45rem;line-height:.4rem;position:relative;border-bottom:.05rem solid #e5e5e5;} + +/* 底部bar条 */ +.z-bar-bottom{ + line-height:1.1; + bottom:0; + border-top:1px solid #e7e7e7; + display:-webkit-flex; + display:flex; + -webkit-justify-content:space-between; + justify-content:space-between; + font-size:.12rem; +} +.z-bar-bottom>*{display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center; + -webkit-align-items:center;align-items:center;-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;} +.z-bar-bottom .z-font{font-size:.22rem;margin-bottom:.01rem;} +.z-bar-bottom>[class*=z-w], +.z-bar-bottom>[class*=zi-w]{-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;} +.z-bar-bottom.z-small{line-height:1.1;} +.z-bar-bottom.z-small .z-font{font-size:.2rem;} +.z-bar-bottom .z-button,.z-bar-bottom .z-button-flex{height:100%;} + +/*限制分布*/ +.z-direction-column{-webkit-flex-direction:column;flex-direction:column;} +.z-flex-none{-webkit-flex:0 0 auto !important;-ms-flex:0 0 auto;flex:0 0 auto !important;} +.z-justify-start{-webkit-justify-content:flex-start !important;justify-content:flex-start !important;} +.z-justify-end{-webkit-justify-content:flex-end !important;justify-content:flex-end !important;} +.z-justify-center{-webkit-justify-content:center !important;justify-content:center !important;} +.z-justify-between{-webkit-justify-content:space-between !important;justify-content:space-between !important;} +.z-justify-around{-webkit-justify-content:space-around !important;justify-content:space-around !important;} +.z-flex-start{-webkit-align-items:flex-start !important;align-items:flex-start !important;} +.z-flex-end{-webkit-align-items:flex-end !important;align-items:flex-end !important;} +.z-flex-center{-webkit-align-items:center !important;align-items:center !important;} +.z-flex-stretch{-webkit-align-items:stretch !important;align-items:stretch !important;} + +/***********************************************/ +/* 第十四部分:卡片列表 */ +/***********************************************/ +.z-card-list{margin-top:.08rem;background-color:#ffffff;} +.z-card-list .list-item, +.z-card-list .list-item .item-left, +.z-card-list .list-item .item-right{ + display:-webkit-flex; + display:flex; + -webkit-flex-wrap:nowrap; + flex-wrap:nowrap; + -webkit-align-items:center; + align-items:center; + line-height:.2rem; + border:none; + position:relative; +} +.z-card-list .list-item{min-height:.5rem;padding:.1rem .15rem;-webkit-justify-content:space-between;justify-content:space-between;} +.z-card-list .list-item+.list-item{border-top:1px solid #e5e5e5;} +.z-card-list .list-item .item-left{font-size:.16rem;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:flex-start;align-items:flex-start;} +.z-card-list .list-item .item-right{color:#999;font-size:.14rem;-webkit-justify-content:flex-end;justify-content:flex-end;} +.z-card-list .list-item .item-list{font-size:.14rem;} +.z-card-list .list-item .item-list>li{line-height:inherit;display:-webkit-flex;display:flex;} +.z-card-list .list-item .item-list>li>.list-name{ + -webkit-flex:none; + flex:none; + color:#999; + width:.75rem; + text-overflow:ellipsis; + overflow:hidden; + display:-webkit-box; + -webkit-box-orient:vertical; + word-break:break-word; + -webkit-line-clamp:1; +} +.z-card-list .list-item .item-list>li>.list-cont{} +.z-card-list .z-font{bottom:0px;font-size:.16rem;} +.z-card-list .z-font:last-child{margin-left:.1rem;} + +/***********************************************/ +/* 第十五部分:图文列表/链接 */ +/***********************************************/ +.z-flexBox{ + -webkit-align-self:center; + align-self:center; + display:-webkit-flex; + display:flex; + -webkit-flex-wrap:nowrap; + flex-wrap:nowrap; + -webkit-align-items:center; + align-items:center; + -webkit-justify-content:space-between; + justify-content:space-between; + border-width:0; + border-style:solid; + border-color:#e5e5e5; + position:relative; + background-color:#ffffff; +} + +/*边框*/ +.z-flexBox+.z-flexBox:before, +.z-flexBox.z-last:after{content:"";width:100%;height:1px;right:0;left:0;position:absolute;background:#e5e5e5;z-index:9;} + +.z-flexBox+.z-flexBox:before{top:0;} +.z-flexBox:not(.z-direction-column)>.z-flexBox+.z-flexBox:before{width:1px;height:100%;right:auto;top:0;} + +.z-flexBox.z-last:after{bottom:0;} +.z-flexBox:not(.z-direction-column)>.z-flexBox.z-last:after{width:1px;height:100%;left:auto;top:0;} +.z-flexBox.z-left{-webkit-align-items:flex-start;align-items:flex-start;} + +/*定义自动缩放列排版*/ +.z-flexBox>*{-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;} +.z-flexBox>[class*=z-w], +.z-flexBox>[class*=z-w], +.z-flexBox>[class*=zi-w]{-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;} + +/*图文混排*/ +.z-flexBox>.z-list-main,.z-flexBox>.z-list-after{ + display:-webkit-flex; + display:flex; + -webkit-justify-content:center; + justify-content:center; + overflow:hidden; + position:relative; +} +/*图片*/ +.z-flexBox>.z-list-media{margin-right:.1rem;max-width:1.5rem;max-height:1.5rem;position:relative;background-color:#f5f5f5;} +.z-flexBox>.z-list-media>img{position:absolute;width:auto;height:auto;left:0;top:0;right:0;bottom:0;margin:auto;} +/*文本*/ +.z-flexBox>.z-list-main{-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-flex-direction:column;flex-direction:column;-webkit-align-self:flex-start;align-self:flex-start;} +.z-flexBox>.z-list-main>.z-list-title, +.z-flexBox>.z-list-main>.z-list-info, +.z-flexBox>.z-list-main>.z-list-desc{display:-webkit-box;-webkit-box-orient:vertical;word-break:break-word;text-overflow:ellipsis;overflow:hidden;line-height:.18rem;} +.z-flexBox>.z-list-main>.z-list-title{font-size:.14rem;height:.36rem;-webkit-line-clamp:2;} +.z-flexBox>.z-list-main>.z-list-info{margin-top:.02rem;color:#777;font-size:.12rem;height:.18rem;-webkit-line-clamp:1;} +.z-flexBox>.z-list-main>.z-list-desc{margin-top:.05rem;font-size:.14rem;-webkit-line-clamp:1;} +/*精简图文排版*/ +.z-flexBox.z-simple>.z-list-media{max-width:1rem;max-height:1rem;} +.z-flexBox.z-simple>.z-list-main{-webkit-align-self:center;align-self:center;} +.z-flexBox.z-simple>.z-list-main>.z-list-title{height:.18rem;-webkit-line-clamp:1;} +.z-flexBox.z-simple>.z-list-main>.z-list-desc{display:none;} +/*图文排版右侧*/ +.z-flexBox>.z-list-after{-webkit-align-lists:center;align-lists:center;color:#999;margin-left:.1rem;font-size:.12rem;} +.z-flexBox>.z-list-after .z-font{bottom:0;margin-left:.05rem;font-size:.18rem;} + +/***********************************************/ +/* 第十六部分:滚动banner图 */ +/***********************************************/ +.z-slider{position:relative;width:100%;} +.z-slider .z-slider-touch, +.z-slider .z-slider-touch>li{position:absolute;width:100%;height:100%;left:0;top:0;transition-property:transform;background:#fff;} +.z-slider .z-slider-touch>li.z-active{z-index:9;} +.z-slider .z-slider-touch>li a{display:-webkit-flex;display:flex;width:100%;height:100%;position:relative;overflow:hidden;-webkit-justify-content:center;justify-content:center;-webkit-align-items:center;align-items:center;} +.z-slider .z-slider-touch>li img{-webkit-flex:1 1 auto;flex:1 1 auto;max-height:none;} +.z-slider .z-slider-tab{position:absolute;width:100%;height:.2rem;padding-top:.07rem;left:0;bottom:0;text-align:center;z-index:10;background-color:rgba(255,255,255,.15)} +.z-slider .z-slider-tab>span{display:inline-block;width:.06rem;height:.06rem;vertical-align:top;margin:0 .02rem;border-radius:50%;background-color:rgba(0,0,0,.5);} +.z-slider .z-slider-tab>span.z-active{background-color:#ffffff;} + +/***********************************************/ +/* 第十七部分:手机端popup */ +/***********************************************/ +.z-popup{position:absolute;width:100%;height:100%;top:0;right:0;bottom:0;left:0;z-index:999;display:none;} + +.z-popup .z-popup-bg,.z-popup .z-popup-main{position:absolute;top:0;right:0;bottom:0;left:0;} +.z-popup .z-popup-bg{background:rgba(0,0,0,.3);z-index:1;visibility:hidden;opacity:0;-webkit-transition:all .4s;transition:all .4s;} +.z-popup .z-popup-main{background:#ffffff;z-index:2;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;} +.z-popup.z-left .z-popup-main{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);} +.z-popup.z-top .z-popup-main{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0);} +.z-popup.z-right .z-popup-main{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);} +.z-popup.z-bottom .z-popup-main{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);} + +.z-popup.z-popup-fadeIn .z-popup-bg{visibility:visible;opacity:1;} +.z-popup.z-popup-fadeOut .z-popup-main, +.z-popup.z-popup-fadeIn .z-popup-main{-webkit-transition:-webkit-transform .4s;transition:transform .4s;} +.z-popup.z-popup-fadeIn .z-popup-main{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);} + +.z-popup.z-left.z-overlay-part .z-popup-main{right:25%;} +.z-popup.z-top.z-overlay-part .z-popup-main{bottom:auto;} +.z-popup.z-right.z-overlay-part .z-popup-main{left:25%;} +.z-popup.z-bottom.z-overlay-part .z-popup-main{top:auto;} + +.z-popup .z-popup-title{line-height:.45rem;text-align:center;position:relative;border-bottom:1px solid #f5f5f5;} +.z-popup .z-popup-sure,.z-popup .z-popup-cancel{height:.45rem;line-height:.45rem;font-size:.14rem;position:absolute;top:0;padding:0 .1rem;color:#777;} +.z-popup .z-popup-sure.z-font,.z-popup .z-popup-cancel.z-font, +.z-popup .z-popup-sure .z-font,.z-popup .z-popup-cancel .z-font{font-size:.2rem;} +.z-popup.z-top .z-popup-title .z-popup-sure, +.z-popup.z-bottom .z-popup-title .z-popup-sure, +.z-popup.z-left .z-popup-title .z-popup-sure{right:0;} +.z-popup.z-top .z-popup-title .z-popup-cancel, +.z-popup.z-bottom .z-popup-title .z-popup-cancel, +.z-popup.z-left .z-popup-title .z-popup-cancel{left:0;} +.z-popup.z-right .z-popup-title .z-popup-sure{left:0;} +.z-popup.z-right .z-popup-title .z-popup-cancel{right:0;} +.z-popup .z-popup-main>.z-popup-cancel{height:.35rem;line-height:.35rem;right:0;} + +.z-popup-main .z-popup-content{-webkit-flex:1 1 auto;flex:1 1 auto;} + +/***********************************************/ +/* 第十八部分:定义动画 */ +/***********************************************/ +@keyframes rotate360 { + 0% {-webkit-transform:rotate(0deg);transform:rotate(0deg);} + 100% {-webkit-transform:rotate(360deg);transform:rotate(360deg);} +} +@-webkit-keyframes rotate360 { + from {-webkit-transform: rotate(0deg);} + to {-webkit-transform: rotate(360deg);} +} diff --git a/zhiqim_ui/release/zhiqim.mobile_v1.5.0.r2019010101.min.js b/zhiqim_ui/release/zhiqim.mobile_v1.5.0.r2019010101.min.js new file mode 100644 index 0000000..5dfdd24 --- /dev/null +++ b/zhiqim_ui/release/zhiqim.mobile_v1.5.0.r2019010101.min.js @@ -0,0 +1 @@ ++(function(window,undefined){var document=window.document;document.createElement("zcover");var Z=window.Z=window.zhiqim=function(selector){return new Z.Query({selector:selector})};Z.v="1.4.0";Z.u=undefined;Z.d=window.document;Z.l=window.location;Z.n=window.navigator;Z.ua=Z.n.userAgent.toLowerCase();Z._D_="0123456789";Z._LU_="ABCDEFGHIJKLMNOPQRSTUVWXYZ";Z._LL_="abcdefghijklmnopqrstuvwxyz";Z._L_=Z._LU_+Z._LL_;Z._DL_=Z._D_+Z._L_;Z._DLL_=Z._D_+Z._LL_;Z._DLU_=Z._D_+Z._LU_;Z._DH_=Z._D_+"abcdefABCDEF";Z._DHL_=Z._D_+"abcdef";Z._DHU_=Z._D_+"ABCDEF";Z._SYM_="._-`~!@#$%";Z.body=function(){if(Z.d.body){return Z.d.body}else{Z.alert("未初始化body,请在Z.onload之后调用!");throw"nobody"}};Z.assert=function(require,exception,message){if(!require){Z.alert(message);throw exception}};Z.evals=function(expression){try{return eval("("+expression+")")}catch(e){return null}};Z.loads=function(src,callback){var $script=document.createElement("script");$script.src=src;$script.onload=callback;document.body.appendChild($script)};Z.alert=function(text,callback,param){alert(text);if(Z.T.isFunction(callback)){callback()}};Z.success=function(text,callback,param){param=param||{};param.type="success";Z.alert(text,callback,param)};Z.failure=function(text,callback,param){param=param||{};param.type="failure";Z.alert(text,callback,param)};Z.confirm=function(text,callback,param){if(confirm(text)){callback()}};Z.prompt=function(text,value,callback,param){if(prompt(text,value)){callback()}};Z.copy=function(text,type){if(!text){Z.alert("请输入要复制的文本");return}if(!document.execCommand){Z.alert("当前浏览器不支持复制");return}var $textarea=Z("").appendTo("body");type=type||"text";if(type=="val"){$textarea.val(text)}else{if(type=="html"){$textarea.html(text)}else{$textarea.text(text)}}$textarea.select();document.execCommand("copy");$textarea.remove()};Z.bind=function(f,$this){if(!Z.bind.fs){Z.bind.fs=[];Z.bind.ts=[];Z.bind.ns=[]}var ind=-1;Z.each(Z.bind.fs,function(_f,i){if(_f!==f){return}if(Z.bind.ts[i]!==$this){return}ind=i;return true});if(ind==-1){ind=Z.bind.fs.length;Z.bind.fs[ind]=f;Z.bind.ts[ind]=$this;Z.bind.ns[ind]=function(){f.apply($this,arguments)}}return Z.bind.ns[ind]};Z.each=function(object,callback){return Z.eachof(null,object,callback)};Z.eachof=function($this,object,callback){if(!object||!Z.T.isFunction(callback)){return}if(!Z.T.isLikeArray(object)&&!Z.T.isPlainObject(object)&&!Z.T.isString(object)&&!Z.T.isNumber(object)){return}var args=[];for(var a=0;a=times){clearInterval(timer);if(complete){complete.call($this)}}else{if(process){process.call($this,curTimes)}}}return timer};Z.rootPath=function(contextPath,path){return((contextPath==null||contextPath=="/")?"":contextPath)+(Z.S.startWith(path,"/")?"":"/")+path};Z.textLineNum=function(text,width,fontSize,fontFamily,letterSpacing){fontFamily=fontFamily||('"微软雅黑","宋体",Arial,sans-serif');letterSpacing=letterSpacing||"normal";var $textarea=Z('").css("width",width).css("fontSize",fontSize).css("fontFamily",fontFamily).css("letterSpacing",letterSpacing).appendTo("body");var lineNum=$textarea[0].scrollHeight/50;if(window.devicePixelRatio&&window.devicePixelRatio!==1){}$textarea.remove();return Math.ceil(lineNum)};Z.drag=function(elem,param,callback,$this){if(Z.T.isString(elem)){elem=Z.D.id(elem)}if(!elem||!elem.nodeType){return null}if(Z.T.isString(param)){param={drag:Z.D.id(param)}}else{if(param.nodeType){param={drag:param}}}return new Z.Draggable({immediate:true,elem:elem,param:param,callback:callback,callthis:$this})};Z.dragInParent=function(elem,drag,parent,callback,$this){if(Z.T.isString(elem)){elem=Z.D.id(elem)}if(!elem||!elem.nodeType){return null}if(Z.T.isString(drag)){drag=Z.D.id(drag)}if(!drag||!drag.nodeType){return null}if(Z.T.isString(parent)){parent=Z.D.id(parent)}if(!parent||!parent.nodeType){return null}var width=parent.offsetWidth-elem.offsetWidth;var height=parent.offsetHeight-elem.offsetHeight;var param={drag:drag,left:parent.offsetLeft,top:parent.offsetTop,width:width,height:height};return new Z.Draggable({immediate:true,elem:elem,param:param,callback:callback,callthis:$this})};Z.$elem=function(elem,clazz){if(elem instanceof Z.Query){if(!elem[0]){Z.alert("["+clazz+"]的[elem]参数无效");throw"elem does not exist"}return elem}else{if(Z.T.isElement(elem)||Z.T.isWindow(elem)||Z.T.isDocument(elem)){return Z(elem)}else{if(Z.T.isString(elem)){if(Z(elem)[0]){return Z(elem)}if(!/^#/.test(elem)&&Z("#"+elem)[0]){return Z("#"+elem)}}}}if(clazz){Z.alert("["+clazz+"]的[elem]参数必须是元素对象或元素编号");throw"elem does not exist"}return Z("")};Z.$selector=function(selector,target){return target==null?Z(selector):Z.$elem(target).find(selector)};Z.$cover=function($elem){$elem=Z.$elem($elem);var $parent=$elem.parent();if($parent.length>0&&$parent[0].tagName.toLowerCase()=="zcover"){return $parent}var $cover=Z("").insertAfter($elem).cssMaybe("float",$elem.css("float")).cssMaybe("margin-left",$elem.css("marginLeft")).cssMaybe("margin-right",$elem.css("marginRight")).cssMaybe("margin-top",$elem.css("marginTop")).cssMaybe("margin-bottom",$elem.css("marginBottom"));if($elem.css("width").indexOf("%")!=-1){$cover.cssMaybe("width",$elem.css("width"));$elem.css("width","100%")}$elem.appendTo($cover).css("margin",0);return $cover};Z.R=Z.Regexps={SPACE:/\s+/,SPACE_LEFT:/^\s+/,SPACE_RIGHT:/\s+$/,NUMERIC:/^\d+$/,INTEGER:/^(0|[\+\-]?[1-9]\d*)$/,INTEGER_P:/^[1-9]\d*$/,INTEGER_N_N:/^(0|[1-9]\d*)$/,FLOAT:/^(0|[\+\-]?[1-9]\d*)(\.\d+)?$/,FLOAT_N_N:/^(0|[1-9]\d*)(\.\d+)?$/,AMOUNT_2R:/^(0|[\+\-]?[1-9]\d*)(\.\d{1,2})?$/,AMOUNT_2R_FIXED:/^(0|[\+\-]?[1-9]\d*)(\.\d{2})$/,AMOUNT_N_N_2R:/^(0|[1-9]\d*)(\.\d{1,2})?$/,AMOUNT_N_N_2R_FIXED:/^(0|[1-9]\d*)(\.\d{2})$/,ALPHABAT:/^[A-Za-z]+$/,ALPHABAT_UPPER:/^[A-Z]+$/,ALPHABAT_LOWER:/^[a-z]+$/,ALPHA_LOWER_NUMERIC:/^[a-z0-9]+$/,ALPHA_UPPER_NUMERIC:/^[A-Z0-9]+$/,ALPHA_NUMERIC:/^[A-Za-z0-9]+$/,ALPHA_NUMERIC_PA:/^[A-Za-z][A-Za-z0-9]*$/,ALPHABAT_DOUBLE:/^[^x00-xff]+$/,CHINESE:/^[\u4e00-\u9fa5]+$/,CHINESE_ALPHA_NUMERIC:/^[\u4e00-\u9fa5A-Za-z0-9]+$/,DATE:/^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))$/,TIME:/^([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$/,DATE_TIME:/^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s(([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9]))$/,DATE_TIME_MATCH:/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/,HTML:/<|&#?\w+;/,HTML_TAG:/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,HTML_TAG_NAME:/<([\w:]+)/,ACCOUNT:/^(?!(_|@|\.))(?!.*?(_|@|\.)$)[\w@\.\u4e00-\u9fa5]{5,25}$/,PASSWORD:/^[\w@\.#$!~%]{6,16}$/,MOBILE:/^((\+86)|(86)|)?(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|170|18[0|1|2|3|5|6|7|8|9])\d{8}$/,MOBILE_11:/^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|170|18[0|1|2|3|5|6|7|8|9])\d{8}$/,IP:/^((?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])$/,MAC:/^[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}$/,QQ:/^[1-9]\d{4,10}$/,POSTAL_CODE:/^[1-9]\d{5}$/,EMAIL:/^([\w-_]+(?:\.[\w-_]+)*)@((?:[a-z0-9]+(?:-[a-zA-Z0-9]+)*)+\.[a-z]{2,6})$/,IDCARD:/^(\d{6})((((19|20)[0-9]{2})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))(\d{3}[0-9xX*])$/};Z.C=Z.Class={newInstance:function(){return function(){this.immediate=false;this.set=function(name,value){this[name]=value};Z.C.copyFields(this,this.defaults);Z.C.copyFields(this,arguments);if(this.init){this.init.apply(this)}if(this.immediate&&this.execute){this.execute.apply(this)}}},copyFields:function(target,obj){if(!target||!obj){return}if(Z.T.isLikeArray(obj)){for(var i=0;ithis.right){offsetLeft=this.right}if("top" in this&&offsetTopthis.bottom){offsetTop=this.bottom}}if(Z.T.isFunction(this.callback)){this.callback.call(this.callthis||this,e,this.dragging)}Z(this.elem).css({left:offsetLeft,top:offsetTop});Z.D.clearSelection()},doStopDrag:function(e){Z(document).offmousemove(this.doDragging,this).offmouseup(this.doStopDrag,this);if(Z.T.isFunction(this.callback)){this.callback.call(this.callthis||this,e,this.dragging)}}}})(window);+(function(b){b.B=b.Browser={mobile:/mobile/.test(b.ua),iphone:/iphone/.test(b.ua),ipad:/ipad/.test(b.ua),win64:/wow64/.test(b.ua),firefox:/firefox/.test(b.ua),webkit:/webkit/.test(b.ua),safari:/safari/.test(b.ua),chrome:/chrome/.test(b.ua),opera:/opera/.test(b.ua),mozilla:/mozilla/.test(b.ua)&&!/compatible/.test(b.ua),msie:(/msie/.test(b.ua)||/trident/.test(b.ua))&&!/opera/.test(b.ua),msieOnly:/msie/.test(b.ua),msie11:/trident\/7/.test(b.ua),msie10:/msie 10/.test(b.ua),msie9:/msie 9/.test(b.ua),msie8:/msie 8/.test(b.ua),msie7:/msie 7/.test(b.ua),msie6:/msie 6/.test(b.ua),msieVer:/msie/.test(b.ua)?parseInt(b.ua.match(/msie (\d+)/)[1]):100};if(b.B.msieVer<=8){var c=["abbr","article","aside","datalist","details","dialog","eventsource","figure","footer","header","hgroup","main","mark","menu","meter","nav","output","progress","section","time","audio","canvas","video"];var a=c.length;while(a--){document.createElement(c[a])}}b.D=b.Document={id:function(e,d){d=d||document;return d.getElementById(e)},has:function(e,d){d=d||document;return d.getElementById(e)!=null},create:function(d,e){e=e||document;return e.createElement(d)},names:function(d,e){e=e||document;return e.getElementsByName(d)},tagNames:function(d,e){e=e||document;return e.getElementsByTagName(d)},classNames:function(e,f){f=f||document;if(f.getElementsByClassName){return f.getElementsByClassName(e)}var d=[];b.each(this.tagNames("*"),function(g){b.each(g.className.split(" "),function(h){if(h==e){d.push(g)}})});return d},attrs:function(e,f,g){g=g||document;var d=[];b.each(this.tagNames("*"),function(h){if(f==b.EL.get(h,e)){d.push(h)}});return d},scrollTop:function(d){d=d||document;return d.body.scrollTop+d.documentElement.scrollTop},scrollLeft:function(d){d=d||document;return d.body.scrollLeft+d.documentElement.scrollLeft},scrollWidth:function(d){d=d||document;return Math.max(d.body.scrollWidth,d.documentElement.scrollWidth)},scrollHeight:function(d){d=d||document;return Math.max(d.body.scrollHeight,d.documentElement.scrollHeight)},clientWidth:function(d){d=d||document;return d.documentElement.clientWidth||d.body.clientWidth},clientHeight:function(d){d=d||document;return d.documentElement.clientHeight||d.body.clientHeight},offsetWidth:function(d){d=d||document;return Math.max(d.body.offsetWidth,d.documentElement.offsetWidth)},offsetHeight:function(d){d=d||document;return Math.max(d.body.offsetHeight,d.documentElement.offsetHeight)},clearSelection:function(){window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}};b.E=b.Event={KEY:{ESC:27,ENTER:13,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},add:function(g,d,e,f){e=f?b.bind(e,f):e;if(g.addEventListener){g.addEventListener(d,e,false)}else{if(g.attachEvent){g.attachEvent("on"+d,e)}else{g["on"+d]=e}}},remove:function(g,d,e,f){e=f?b.bind(e,f):e;if(g.removeEventListener){g.removeEventListener(d,e,false)}else{if(g.detachEvent){g.detachEvent("on"+d,e)}else{g["on"+d]=null}}},event:function(d){return d||window.event},key:function(d){d=this.event(d);return d.which||d.keyCode},target:function(d){d=this.event(d);return d.target||d.srcElement},current:function(d){d=this.event(d);return d.currentTarget||d.srcElement},cancel:function(d){if(d&&d.preventDefault){d.preventDefault()}else{if(window.event){window.event.returnValue=false}}return false},stop:function(d){if(d&&d.stopPropagation){d.stopPropagation()}else{if(window.event){window.event.cancelBubble=true}}return false},forbidden:function(d){b.E.stop(d);b.E.cancel(d)},clientX:function(d){return this.event(d).clientX},clientY:function(d){return this.event(d).clientY},screenX:function(d){return this.event(d).clientX},screenY:function(d){return this.event(d).clientY},wheelDelta:function(d){return b.B.firefox?(-this.event(d).detail*40):this.event(d).wheelDelta},isCtrl:function(d){return b.E.event(d).ctrlKey},isEsc:function(d){return b.E.key(d)===27},isBackspace:function(d){return b.E.key(d)===8},isEnter:function(d){return b.E.key(d)===13},isCtrlC:function(d){return b.E.isCtrl(d)&&b.E.key(d)==67},isCtrlV:function(d){return b.E.isCtrl(d)&&b.E.key(d)==86}};b.EL=b.Element={PX:["top","bottom","left","right","width","height","min-width","max-width","min-height","max-height","line-height","text-indent","minWidth","maxWidth","minHeight","maxHeight","lineHeight","textIndent","margin-top","margin-bottom","margin-left","margin-right","padding-top","padding-bottom","padding-left","padding-right","font-size","marginTop","marginBottom","marginLeft","marginRight","paddingTop","paddingBottom","padding-Left","paddingRight","fontSize"],has:function(e,d){if(!e||!e.nodeType){return false}if(d in e){return true}else{if(e.hasAttribute&&e.hasAttribute(d)){return true}}return false},get:function(e,d){if(!e||!e.nodeType){return null}if(d in e){return e[d]}else{if(e.getAttribute){return e.getAttribute(d)}}return null},set:function(e,d,f){if(!e||!e.nodeType){return}if(d in e){e[d]=f}else{if(e.setAttribute){e.setAttribute(d,f)}}},equals:function(e,d,f){if(!e||!e.nodeType){return false}return b.EL.get(e,d)==f},style:function(f,e){if(!this.has(f,"style")){return}if(e===b.u){return f.style}var g=b.AR.toObject(e,";");for(var d in g){f.style[d]=g[d]}},css:function(e,d,f){if(!this.has(e,"style")){return}if(d=="opacity"){return this.opacity(e,f)}if(arguments.length==2){if(e.style[d]){return e.style[d]}if(e.currentStyle){return e.currentStyle[d]}if(document.defaultView){return document.defaultView.getComputedStyle(e,null)[d]}return""}else{if(arguments.length==3){if(b.AR.contains(b.EL.PX,d)){f=(b.T.isNumber(f)||b.V.isInteger(f)||b.V.isFloat(f))?f+"px":f}e.style[d]=f}}},cssNum:function(e,d){return b.S.prefixNum(this.css(e,d))},opacity:function(f,g){if(!this.has(f,"style")){return}if(g===b.u){if("opacity" in f.style){return f.style.opacity?parseFloat(f.style.opacity):0}else{var e=f.style.filter;var d=(!e)?null:e.match(/opacity=([\d.]*)[\)\,\s]/i);if(!d||d.length<2){return 0}return d[1]/100}}else{if(b.T.isNumber(g)||b.V.isFloat(g)){g=+g;if("opacity" in f.style){f.style.opacity=g}else{f.style.filter="alpha(opacity="+g*100+")"}}}},className:function(e,d){if(!this.has(e,"className")){return null}if(d===b.u){return e.className}e.className=d},addClass:function(e,d){if(!this.has(e,"className")){return}var f=b.AR.toArray(e.className,b.R.SPACE);if(b.AR.contains(f,d)){return}f.push(d);e.className=b.AR.toString(f," ")},removeClass:function(e,d){if(!this.has(e,"className")){return}var g=b.AR.toArray(e.className,b.R.SPACE);var f=b.AR.indexOf(g,d);if(f==-1){return}g.splice(f,1);e.className=b.AR.toString(g," ")},hasClass:function(e,d){if(!this.has(e,"className")){return false}var f=b.AR.toArray(e.className,b.R.SPACE);return b.AR.contains(f,d)},toggleClass:function(e,d){this.hasClass(e,d)?this.removeClass(e,d):this.addClass(e,d)},select:function(d){if(!d||!d.nodeType){return}d.select()},selection:function(e){if(!this.has(e,"value")){return""}var f=this.get(e,"value");if(b.V.isEmpty(f)){return""}if(!("selectionStart" in e)){return""}var g=e.selectionStart;var d=e.selectionEnd;return f.substring(g,d)},isSelection:function(d){return b.V.isNotEmpty(this.selection(d))},focus:function(d){if(!d||!d.nodeType){return}d.focus()},focusEnd:function(f,d){if(!f||!f.nodeType){return}d=d||0;if(b.B.msieOnly){var e=f.createTextRange();(d==0)?e.collapse(false):e.move("character",d);e.select()}else{d=(d==0)?f.value.length:d;f.setSelectionRange(d,d);f.focus()}},parent:function(e){if(!e||!e.nodeType){return null}var d=e.parentNode;return d&&d.nodeType!==11?d:null},parentIndex:function(d){var e=0;while(d=d.previousSibling){if(d.nodeType==1){e++}}return e},childs:function(d){if(!d||!d.nodeType){return null}return d.childNodes},children:function(d){if(!d||!d.nodeType){return null}return d.children},html:function(d,e){if(!d||!d.nodeType){return}if(e===b.u){return d.innerHTML}else{d.innerHTML=e}},htmlc:function(d,k){if(!d||!d.nodeType){return}if(k===b.u){return d.innerHTML}d.innerHTML=k;if(b.Input&&b.Input.load){b.Input.load(d)}if(b.ButtonGroup&&b.ButtonGroup.load){b.ButtonGroup.load(d)}if(b.Checkbox&&b.Checkbox.load){b.Checkbox.load(d)}if(b.Radio&&b.Radio.load){b.Radio.load(d)}if(b.Select&&b.Select.load){b.Select.load(d)}if(b.Dropdown&&b.Dropdown.load){b.Dropdown.load(d)}if(b.Textarea&&b.Textarea.load){b.Textarea.load(d)}if(b.CallFrame&&b.CallFrame.load){b.CallFrame.load()}if(b.Tooltip&&b.Tooltip.load){b.Tooltip.load()}if(b.Clipboard&&b.Clipboard.onload){b.Clipboard.onload()}var n=d.querySelectorAll("script");for(var g=0;g",""],optgroup:[1,""],legend:[1,"
            ","
            "],thead:[1,"","
            "],tbody:[1,"","
            "],tfoot:[1,"","
            "],colgroup:[1,"","
            "],caption:[1,"","
            "],tr:[2,"","
            "],td:[3,"","
            "],th:[3,"","
            "],col:[2,"","
            "],area:[1,"",""],_default:[0,"",""]},createElement:function(e){if(!e){return[]}if(e.nodeType){return[e]}if(b.T.isNumber(e)){e+=""}if(!b.T.isString(e)){return[]}if(!b.R.HTML.test(e)){return[document.createTextNode(e)]}e=e.replace(b.R.HTML_XHTML_TAG,"<$1>");var d=(b.R.HTML_TAG_NAME.exec(e)||["",""])[1].toLowerCase(),f=b.H.wrapMap[d]||b.H.wrapMap._default,g=f[0],h=document.createElement("div");h.innerHTML=f[1]+e+f[2];while(g--){h=h.lastChild}return h.childNodes},displayCache:{},displayDefault:function(e){if(this.displayCache[e]){return this.displayCache[e]}var d=document.body;var g=b.D.create(e);d.appendChild(g);var h=b.EL.css(g,"display");d.removeChild(g);if(h!==""&&h!=="none"){this.displayCache[e]=h;return h}var f=b.D.create("iframe");f.frameBorder=f.width=f.height=0;d.appendChild(f);var i=(f.contentWindow||f.contentDocument).document;i.write((document.compatMode==="CSS1Compat"?"":"")+"");i.close();g=i.createElement(e);i.body.appendChild(g);h=this.css(g,"display");d.removeChild(f);this.displayCache[e]=h;return h}};b.L=b.Location={protocol:location.href.match(/^https/i)?"https":"http",reload:function(d){d=d||window;d.location.reload()},access:function(e,f){b.A.assertNotEmptyBlank(e,"Z.Location的所有函数url不能为空");f=f||window;if(f==="open"){var d=b("
            ").appendTo("body");d.attr({action:e,method:"post",target:"blank"})[0].submit();d.remove()}else{if(f.name&&f.name=="zCallFrame"){e+=((e.indexOf("?")==-1)?"?":"&")+"zCallFrame=true";f.location.href=e}else{f.location.href=e}}},check:function(e,d,f,h){b.A.assertNotEmptyBlank(e,"Z.Location的所有函数url不能为空");if(f){if(!(f instanceof HTMLFormElement)&&h==null){h=f;f=null}}var g=b.FM.getChecked(d,f);if(!g){return}e+=(e.indexOf("?")==-1)?"?":"&";e+=d+"="+encodeURIComponent(g);b.L.access(e,h)},confirm:function(e,g,d,f,i){b.A.assertNotEmptyBlank(e,"Z.Location的所有函数url不能为空");if(f){if(!(f instanceof HTMLFormElement)&&i==null){i=f;f=null}}if(d){var h=b.FM.getChecked(d,f);if(!h){return}e+=(e.indexOf("?")==-1)?"?":"&";e+=d+"="+encodeURIComponent(h)}b.confirm(g,function(){b.L.access(e,i)})},href:function(j,i){if(b.T.isString(j)){b.L.access(j,i)}else{if(b.T.isPlainObject(j)){var e=j.url||null;var g=j.message||null;var d=j.name||null;var f=j.form||null;var h=i||j.target||null;if(d==null){b.L.access(e,h)}else{if(g==null){b.L.check(e,d,f,h)}else{b.L.confirm(e,g,d,f,h)}}}else{b.alert("Z.L.href函数第一个参数必须是字符串或纯对象")}}}};b.CK=b.Cookie={all:function(){return document.cookie},add:function(g,i,d,k,h,j){if(!cookie||!cookie.name||b.V.isEmptyBlank(cookie.name)){return}var g=escape(b.S.trim(cookie.name));var i=escape(cookie.value||"");var e=g+"="+i;if(b.T.isNumber(cookie.expires)||b.V.isInteger(cookie.expires)){var f=new Date();f.setTime(f.getTime()+(+cookie.expires*1000));e+=";expires="+f.toGMTString()}e+=(cookie.path)?";path="+cookie.path:"";e+=(cookie.domain)?";domain="+cookie.domain:"";e+=(cookie.secure===true)?";secure":"";document.cookie=e},remove:function(e){var d=new Date();d.setTime(d.getTime()-10*1000);document.cookie=e+"=value;expires="+d.toGMTString()},get:function(d){if(b.V.isEmptyBlank(d)){return""}d=escape(b.S.trim(d));var g=b.AR.toArray(document.cookie,";");for(var f=0;f1){e=e.slice(0,-1)}e+="}";return e}};d.Ids={HEX_LETTERS:[48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70],uuid:function(){var h=new Array(32);var f=0,g=0,e=0;for(g=0;g<8;g++){h[f++]=this.HEX_LETTERS[Math.floor(Math.random()*16)]}for(g=0;g<3;g++){for(e=0;e<4;e++){h[f++]=this.HEX_LETTERS[Math.floor(Math.random()*16)]}}var l=new Date().getTime();var k=("0000000"+l.toString(16).toUpperCase()).substr(-8);for(g=0;g<8;g++){h[f++]=k.charCodeAt(g)}for(g=0;g<4;g++){h[f++]=this.HEX_LETTERS[Math.floor(Math.random()*16)]}return String.fromCharCode.apply(null,h)}};d.T=d.Types={isBoolean:function(e){return d.O.toString(e)==="Boolean"},isNumber:function(e){return d.O.toString(e)==="Number"},isString:function(e){return d.O.toString(e)==="String"},isPrimitive:function(e){return d.T.isBoolean(e)||d.T.isNumber(e)||d.T.isString(e)},isFunction:function(e){return d.O.toString(e)==="Function"},isArray:function(e){return d.O.toString(e)==="Array"},isDate:function(e){return d.O.toString(e)==="Date"},isRegExp:function(e){return d.O.toString(e)==="RegExp"},isObject:function(e){return d.O.toString(e)==="Object"},isPlainObject:function(f){if(!f||!d.T.isObject(f)||f.nodeType||d.T.isWindow(f)){return false}if(f.constructor&&!b.call(f,"constructor")&&!b.call(f.constructor.prototype,"isPrototypeOf")){return false}var e;for(e in f){}return e===d.u||b.call(f,e)},isLikeArray:function(f){if(!f||!d.T.isNumber(f.length)){return false}if(d.T.isFunction(f)&&f instanceof d.Query){return true}var e=d.O.toString(f);if(e==="Array"||e==="Arguments"||e==="HTMLCollection"||e==="NodeList"||f.callee||f.item){return true}if(d.T.isString(f)||d.T.isFunction(f)||d.T.isWindow(f)){return false}return f[0]!=d.u},isNull:function(e){return e===null},isUndefined:function(e){return e===d.u},isNaN:function(e){return !(e==e)},isInfinity:function(e){return e===Infinity},isNonInfinity:function(e){return e===-Infinity},isNil:function(e){return e===null||e===d.u||!(e==e)||e===Infinity||e===-Infinity},isWindow:function(e){return e&&typeof(e)==="object"&&"setInterval" in e},isNode:function(e){return e&&e.nodeType},isDocument:function(e){return e&&e.nodeType===9},isElement:function(e){return e&&e.nodeType&&e.nodeType!==9},isArguments:function(e){return e&&d.O.toString(e)==="Arguments"&&d.T.isNumber(e.length)}};d.V=d.Validates={isDigit:function(e){return e>=48&&e<=57},isMinus:function(e){return e==45},isDot:function(e){return e===46},isColon:function(e){return e==58},isDigitOrMinus:function(e){return(e>=48&&e<=57)||e===45},isDigitOrDot:function(e){return(e>=48&&e<=57)||e===46},isDigitOrColon:function(e){return(e>=48&&e<=57)||e===58},isLetter:function(e){return(e>=65&&e<=90)||(e>=97&&e<=122)},isLetterLowercase:function(e){return e>=97&&e<=122},isLetterUppercase:function(e){return e>=65&&e<=90},isLetterOrDigit:function(e){return isLetter(e)||isDigit(e)},isRegexp:function(f,e){return f.test(e)},isEmpty:function(e){return(e==null||e==""||e.length<1)},isNotEmpty:function(e){return !d.V.isEmpty(e)},isEmptyBlank:function(f){if(f==null||f==""||f.length<1){return true}for(var e=0;eString.fromCharCode(32)){return false}}return true},isNotEmptyBlank:function(e){return !d.V.isEmptyBlank(e)},isNumeric:function(e){return d.R.NUMERIC.test(e)},isNumericLen:function(g,f,e){return d.R.NUMERIC.test(g)&&g.length>=f&&g.length<=e},isInteger:function(e){return d.R.INTEGER.test(e)},isIntegerValue:function(g,f,e){return d.R.INTEGER.test(g)&&+g>=f&&+g<=e},isIntegerPositive:function(e){return d.R.INTEGER_P.test(e)},isFloat:function(e){return d.R.FLOAT.test(e)},isAmount2R:function(e){return d.R.AMOUNT_2R.test(e)},isDate:function(e){return d.R.DATE.test(e)},isTime:function(e){return d.R.TIME.test(e)},isDateTime:function(e){return d.R.DATE_TIME.test(e)},isEmail:function(e){return d.R.EMAIL.test(e)},isMobile:function(e){return d.R.MOBILE.test(e)},isMobile11:function(e){return d.R.MOBILE_11.test(e)},isContain:function(g,h,e){var f=d.AR.toArray(g,h);return d.AR.contains(f,e)},isLeapYear:function(e){return(e%4==0)&&((!(e%100==0))||(e%400==0))},};d.FM=d.Forms={formData:function(e){if(!e||!e.length){return null}var f="";d.each(e,function(g){if(g.disabled||!g.name||!g.value){return}f+=g.name+"="+encodeURIComponent(g.value)+"&"});return(f.length>0)?f.slice(0,-1):null},clearForm:function(h){if(!h){return}h.reset();var g=h.elements.length;for(var e=0;e0){f.options[0].selected=true}}}}},clearSelect:function(e){e.options.length=0},isChecked:function(f,g){if(!f){return false}var e=g?g[f]:d.D.names(f);if(!e){return false}if(!d.T.isNumber(e.length)){return e.checked}else{return d.each(e,function(h){if(h.checked){return true}})}},getChecked:function(f,h){if(!f){d.alert("[Z.FM.getChecked]第一个参数必传");throw"[Z.FM.getChecked]第一个参数必传"}var e=h?h[f]:d.D.names(f);if(!e){d.alert("[Z.FM.getChecked]没有找到["+f+"]的对象");throw"[Z.FM.getChecked]没有找到["+f+"]的对象"}if(!d.T.isNumber(e.length)){if(e.checked){return e.value}else{d.alert("请选择一个选项");throw"请选择一个选项"}}else{for(var g=0;gi.length){var l=k.value.substring(0,i.length);if(l==i){if(h){k.checked=true}else{k.checked=false}}}else{if(k.value.length0){e=e.slice(0,-g.length)}return e},toJSONString:function(f){if(!f){return"[]"}var e="[";d.each(f,function(g){e+=d.Jsons.toString(g)+","});if(e.length>1){e=e.slice(0,-1)}e+="]";return e}};d.S=d.Strings={trim:a?function(e){return e==null?"":a.call(e)}:function(e){return e==null?"":e.toString().replace(d.R.SPACE_LEFT,"").replace(d.R.SPACE_RIGHT,"")},trimLeft:function(e){return e==null?"":e.toString().replace(d.R.SPACE_LEFT,"")},trimRight:function(e){return e==null?"":e.toString().replace(d.R.SPACE_RIGHT,"")},startWith:function(f,e){if(f==null||e==null||f.length==0||e.length==0||e.length>f.length){return false}return new RegExp("^"+e).test(f)},endWith:function(f,e){if(f==null||e==null||f.length==0||e.length==0||e.length>f.length){return false}return new RegExp(e+"$").test(f)},equalsIgnoreCase:function(f,e){if(!d.T.isString(f)||!d.T.isString(e)){return false}return f.toUpperCase()==e.toUpperCase()},replaceAll:function(g,h,f,e){if(!RegExp.prototype.isPrototypeOf(h)){return g.replace(new RegExp(h,(e?"gi":"g")),f)}else{return g.replace(h,f)}},lengthUnicode:function(g){if(g==null||g.length==0){return 0}var e=0;for(var f=0;f127){e+=2}else{e+=1}}return e},lengthUnicode35:function(g){if(g==null||g.length==0){return 0}var e=0;for(var f=0;f127){e+=5}else{e+=3}}return e},toString:function(e){if(e===d.u){return"undefined"}else{if(e===null){return""}else{if(d.T.isString(e)){return e}else{return e.toString()}}}},toUTF8:function(g){var e=[];for(var f=0;f>6)&31));e.push(128|(h&63))}else{e.push(224|((h>>12)&15));e.push(128|((h>>6)&63));e.push(128|(h&63))}}}return new Int8Array(e)},toHexString:function(e){var f="";for(var g=0;g"9")&&h!="."){return true}f+=h});if(f.length==0){return 0}return e?-parseFloat(f,10):parseFloat(f,10)},prefixZeroRemove:function(e){while(e.length>1&&e.charAt(0)=="0"&&e.charAt(1)!="."){e=e.substring(1)}return e},removeSecondDot:function(f){var e=f.indexOf(".");if(e==-1){return f}var g=f.indexOf(".",e+1);return(g==-1)?f:f.substring(0,g)},removeAmountZero:function(h){var g=h.indexOf(".");if(g==-1){return h}var f=-1;for(var e=h.length-1;e>=g;e--){var j=h.charAt(e);if(j!="0"&&j!="."){break}f=e}return(f==-1)?h:h.substring(0,f)}};d.Maths={multiply:function(h,x){if(d.T.isNumber(h)){h=h.toString()}else{if(!d.T.isString(h)||!d.V.isFloat(h)){d.alert("不支持["+h+"]["+x+"]非数字相乘")}}if(d.T.isNumber(x)){x=x.toString()}else{if(!d.T.isString(x)||!d.V.isFloat(h)){d.alert("不支持["+h+"]["+x+"]非数字相乘")}}var u,q,f,n;var g=h.indexOf(".");if(g==-1){u=h;q="0";f=0;n=false}else{u=h.substring(0,g);q=h.substring(g+1);f=q.length;if(u.charAt(0)=="-"){n=true}}var o,k,e,r;var s=x.indexOf(".");if(s==-1){o=x;k="0";e=0;r=false}else{o=x.substring(0,s);k=x.substring(s+1);e=k.length;if(o.charAt(0)=="-"){r=true}}var p=parseInt(u)*parseInt(o);if(f==0&&e==0){return p}var w=0,v=0,t=0,j;if(f!=0){w=((n)?-q:q)*o;for(j=0;j"&&this.selector.length>=3){if(this.selector.length<=12){var f=this.selector.substring(1,this.selector.length-1);if(d.AR.contains(a,f)){this[0]=document.createElement(f);this.length=1;return this}}var j=d.H.createElement(this.selector);d.eachof(this,j,function(l,k){this[k]=l});this.length=j.length;return this}var h=document.querySelectorAll(this.selector);for(g=0;g "+f+':not([id="'+g+'"])')}try{g="_zhiqim_siblings_"+d.random(4)+"_";d.EL.set(this[0],"id",g);return this.parent().find("> "+f+':not([id="'+g+'"])')}finally{d.EL.remove(this[0],"id")}},next:function(f){f=f||"*";return this.find("+ "+f)},nextAll:function(f){f=f||"*";return this.find("~ "+f)},prev:function(f){var g=[];this.each(function(i){var h=i.previousSibling;if(h){g.push(h)}});return d(g).find(f)},prevAll:function(f){var g=[];this.each(function(i){var h=i.previousSibling;while(h){g.push(h);h=h.previousSibling}});return d(g).find(f)},children:function(f){f=f||"*";return this.find("> "+f)},nth:function(h,f){var g=-1;this.find(f).each(function(k,j){if(k!=h){return}g=j;return true});return(g==-1)?-1:(g+1)},appendToPos:function(f){if(!(f instanceof d.Query)){f=d(f)}if(f.css("position")==="static"){f.css("position","relative")}return this.appendTo(f)},remove:function(){for(var f=0;f0)?d.EL.get(this[0],"value"):null}if(d.T.isFunction(f)){this.each(function(h,g){var j=f.call(h,h,g);if(d.T.isString(j)){d.EL.set(h,"value",j)}})}else{this.each(function(g){d.EL.set(g,"value",f)})}return this},attr:function(i,h){if(arguments.length==1){if(d.T.isString(i)){return d.EL.get(this[0],i)}for(var f in i){var g=i[f];this.each(function(j){d.EL.set(j,f,g)})}}else{if(arguments.length==2){this.each(function(j){d.EL.set(j,i,h)})}}return this},removeAttr:function(f){this.each(function(g){d.EL.remove(g,f)});return this},className:function(f){if(this.length==0){return this}if(f===d.u){return d.EL.className(this[0])}d.EL.className(this[0],f);return this},addClass:function(f){this.each(function(h){var j=d.AR.toArray(f,d.R.SPACE);for(var g=0;g0)?d.EL.hasClass(this[0],f):false},toggleClass:function(f){return this.hasClass(f)?this.removeClass(f):this.addClass(f)},style:function(f){if(f===d.u){return d.EL.style(this[0])}this.each(function(g){d.EL.style(g,f)});return this},css:function(g,f){if(!g){return this}if(f===d.u){if(d.T.isString(g)){return d.EL.css(this[0],g)}this.each(function(h){d.each(g,function(j,i){d.EL.css(h,i,j)})})}else{this.each(function(h){d.EL.css(h,g,f)})}return this},cssNum:function(f){return d.EL.cssNum(this[0],f)},cssMaybe:function(f,g){if(d.T.isNil(g)){return this}this.css(f,g);return this},opacity:function(f){return this.css("opacity",f)},display:function(f){return this.css("display",f)},inline:function(){return this.display("inline")},block:function(){return this.display("block")},inBlock:function(){return this.display("inline-block")},isHidden:function(){return"hidden"===this.css("visibility")},hidden:function(){return this.css("visibility","hidden")},visible:function(){return this.css("visibility","visible")},isHide:function(){return"none"===this.display()},hide:function(){this.each(function(f){var g=d.EL.css(f,"display");if(g!=null&&g!=="none"){d.EL.set(f,"data-zhiqim-display",g)}d.EL.css(f,"display","none")});return this},show:function(){this.each(function(f){var g=d.EL.get(f,"data-zhiqim-display");if(g==null||g==="none"){g=d.H.displayDefault(f.nodeName)}d.EL.css(f,"display",g)});return this},toggle:function(){return this.isHide()?this.show():this.hide()},text:function(f){if(this.length>0){if(f===d.u){return d.EL.text(this[0])}else{d.EL.text(this[0],f)}}return this},html:function(f){if(this.length>0){if(f===d.u){return d.EL.html(this[0])}else{d.EL.html(this[0],f)}}return this},htmlc:function(f){if(this.length>0){if(f===d.u){return d.EL.htmlc(this[0])}else{d.EL.htmlc(this[0],f)}}return this},htmlx:function(){if(this.length==0){return null}var f=d.EL.html(this[0]);f=d.S.replaceAll(f,'readonly=""',"readonly");f=d.S.replaceAll(f,'disabled=""',"disabled");f=d.S.replaceAll(f,'checked=""',"checked");f=d.S.replaceAll(f,'selected=""',"selected");f=d.S.replaceAll(f,'single=""',"single");f=d.S.replaceAll(f,'multiple=""',"multiple");if(f.indexOf("")==-1){f=d.S.replaceAll(f,"","");f=d.S.replaceAll(f,"","")}return f},htmlt:function(){if(this.length==0){return null}var f=this.htmlx();f=d.S.replaceAll(f,"<","<");f=d.S.replaceAll(f,">",">");return f},htmls:function(){if(this.length==0){return null}return d("
            ").append(this[0]).html()},focusEnd:function(){if(this.length>0&&this[0].nodeType){d.EL.focusEnd(this[0])}return this},select:function(){if(this.length>0&&this[0].nodeType){this[0].select()}return this},selection:function(){return(this.length>0)?d.EL.selection(this[0]):""},isSelection:function(){return d.V.isNotEmpty(this.selection())},offsetParent:function(){if(this.length==0||!this[0].nodeType){return null}return d(this[0].offsetParent)},offsetWidth:function(){if(this.length==0||!this[0].nodeType){return 0}if(d.T.isDocument(this[0])){return d.D.offsetWidth(this[0])}else{return this[0].offsetWidth}},offsetHeight:function(){if(this.length==0||!this[0].nodeType){return 0}if(d.T.isDocument(this[0])){return d.D.offsetHeight(this[0])}else{return this[0].offsetHeight}},offsetLeft:function(){if(this.length==0||!this[0].nodeType){return 0}return d.EL.offsetLeft(this[0])},offsetTop:function(){if(this.length==0||!this[0].nodeType){return 0}return d.EL.offsetTop(this[0])},offsetLeftBody:function(){if(this.length==0||!this[0].nodeType||this[0].nodeType===9){return 0}return d.EL.offsetLeftBody(this[0])},offsetTopBody:function(){if(this.length==0||!this[0].nodeType||this[0].nodeType===9){return 0}return d.EL.offsetTopBody(this[0])},clientWidth:function(){if(this.length==0||!this[0].nodeType){return 0}if(d.T.isDocument(this[0])){return d.D.clientWidth(this[0])}else{return this[0].clientWidth}},clientHeight:function(){if(this.length==0||!this[0].nodeType){return 0}if(d.T.isDocument(this[0])){return d.D.clientHeight(this[0])}else{return this[0].clientHeight}},clientLeft:function(){if(this.length==0||!this[0].nodeType){return 0}return this[0].clientLeft},clientTop:function(){if(this.length==0||!this[0].nodeType){return 0}return this[0].clientHeight},clientX:function(){if(this.length==0||!this[0].nodeType){return 0}return this.offsetLeftBody()-(d.body().scrollLeft+document.documentElement.scrollLeft)},clientY:function(){if(this.length==0||!this[0].nodeType){return 0}return this.offsetTopBody()-(d.body().scrollTop+document.documentElement.scrollTop)},scrollIntoView:function(f,g){if(this.length==0||!this[0].nodeType){return this}this[0].scrollIntoView(f);if(g){window.scrollTo(d.D.scrollLeft(),d.D.scrollTop()+g)}},animate:function(q,k,h){if(this.length==0||!this[0].nodeType){return this}if(!q||!d.T.isPlainObject(q)){return this}k=(!d.T.isNumber(k)||k<13)?200:k;var g=Math.ceil(k/13);var n=[],p=[],o=[],m=[],j=0;for(var f in q){var l=j++;n[l]=f;if(f in this[0]){p[l]=d.S.prefixNum(this[0][f])}else{p[l]=d.EL.cssNum(this[0],f)}o[l]=+d.S.prefixNum(q[f]);m[l]=(o[l]-p[l])/g}d.timer(13,g,this,function(){for(var i=0;i0&&h.length>0&&this[0].nodeType){var g=(this[0].nodeType===9)?d("body"):this;d.EL[f].call(null,g[0],h[0])}return this}});var e=["appendTo","prependTo","insertBefore","insertAfter"];d.each(e,function(g,f){d.Q.fn[g]=function(i){if(!(i instanceof d.Query)){i=d(i)}if(this.length>0&&i.length>0&&i[0].nodeType){var h=(i[0].nodeType===9)?d("body"):i;d.EL[c[f]].call(null,h[0],this[0])}return this}});var b=["keydown","keypress","keyup","click","dblclick","change","blur","focusin","focusout","focus","input","mouseenter","mouseleave","mouseover","mouseout","mouseup","mousedown","mousemove","resize","scroll","load","unload","beforeunload"];d.each(b,function(f){d.Q.fn[f]=function(h,g){if(arguments.length>0){return this.on(f,h,g)}this.each(function(i){if(i[f]){i[f]()}});return this};d.Q.fn["off"+f]=function(h,g){return this.off(f,h,g)}})})(zhiqim);+(function(a){a.MD5=a.Class.newInstance();a.MD5.V=[1732584193,-271733879,-1732584194,271733878];a.MD5.S=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21];a.MD5.T=[3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745];a.MD5.PAD=128;a.MD5.prototype={defaults:{abcd:a.MD5.V},digest:function(e){var g;var f=Math.floor((e.length+8)/64)+1;var h=f*64-8-e.length-1;var d=new Int8Array(64*f);for(g=0;g>>(32-i));return this.add(g,f)},ff:function(g,f,k,j,e,i,h){return this.cc(this.f(f,k,j),g,f,k,j,e,i,h)},gg:function(g,f,k,j,e,i,h){return this.cc(this.g(f,k,j),g,f,k,j,e,i,h)},hh:function(g,f,k,j,e,i,h){return this.cc(this.h(f,k,j),g,f,k,j,e,i,h)},ii:function(g,f,k,j,e,i,h){return this.cc(this.i(f,k,j),g,f,k,j,e,i,h)},f:function(b,d,c){return(b&d)|((~b)&c)},g:function(b,d,c){return(b&c)|(d&(~c))},h:function(b,d,c){return b^d^c},i:function(b,d,c){return d^(b|(~c))},getInt:function(c,d){return((c[d+0]&255)<<0)+((c[d+1]&255)<<8)+((c[d+2]&255)<<16)+((c[d+3]&255)<<24)},putInt:function(c,e,d){c[e+0]=(d>>>0);c[e+1]=(d>>>8);c[e+2]=(d>>>16);c[e+3]=(d>>>24)},add:function(b,e){var d=(b&65535)+(e&65535);var c=(b>>16)+(e>>16)+(d>>16);return(c<<16)|(d&65535)},slice:function(d,h,e){var c=e-h,f=0;var b=new Int32Array(c);for(var g=h;g5||Math.abs(e)>5){this.$elem.attr("data-touchMoved",1)}},onTouchend:function(b){if(this.$elem.attr("data-touchMoved")=="1"){b.stopImmediatePropagation();return false}this.endEvent(b)},getAttributeTouchend:function(){},removeAttributeTouchend:function(){if("hasAttribute" in this.$elem[0]&&this.$elem[0].hasAttribute("ontouchend")){this.$elem.removeAttr("ontouchend")}},};a.ResetTouchEnd.resetAdd=function(){a.E.add=a.Event.add=function(e,b,c,d){if(b=="touchend"){c=d?a.bind(c,d):a.bind(c,e);new a.ResetTouchEnd({elem:e,endEvent:c});return}c=d?a.bind(c,d):c;if(e.addEventListener){e.addEventListener(b,c,false)}else{if(e.attachEvent){e.attachEvent("on"+b,c)}else{e["on"+b]=c}}}};a.ResetTouchEnd.load=function(b){a.$selector("[ontouchend]",b).each(function(d){var e;if("ontouchend" in d){e=d.ontouchend}else{e=d.getAttributeNode("ontouchend")}if(typeof e=="string"){return}var c=function(){e.apply(d,arguments)};new a.ResetTouchEnd({elem:d,endEvent:c})})};a.onload(function(){a.ResetTouchEnd.load();a.ResetTouchEnd.resetAdd()})})(zhiqim);+(function(a){a.Dialog=a.Class.newInstance();a.Dialog.v="1.4.0";a.Dialog.cache=new a.HashMap();a.Dialog.close=function(d,b){d=d?((d.charAt(0)=="#")?d.substring(1):d):d;if(!d){a.each(a.Dialog.cache.values(),function(e){e.remove(b)});a.Dialog.cache.clear()}else{var c=a.Dialog.cache.get(d);if(c){c.remove(b);a.Dialog.cache.remove(d)}}};a.Dialog.get=function(b){b=b?((b.charAt(0)=="#")?b.substring(1):b):b;return a.Dialog.cache.get(b)};a.Dialog.prototype={defaults:{id:null,title:"提示",borderColor:"#ccc",timeout:0,callback:null,text:null,url:null,hasTitle:true,titleBgColor:"#ffffff",shadow:true,shadowColor:"#555555",shadowOpacity:0.6,status:0},init:function(){if(!this.id){this.id=a.random(10)}},validate:function(){if(a.D.has("Z_Dialog_"+this.id)){alert("[Z.Dialog]您传入了相同的窗口ID,如无必须可以不传入由系统随机生成");return false}if(!this.text){alert("[Z.Dialog]您需传入的text参数值");return false}return true},execute:function(){if(!this.validate()){return}var b='
            ';var e='

            '+this.title+"

            ";var d='
            '+(this.hasTitle?e:"")+"
            ";var g='
            ';this.$dialog=a(b).appendTo("body");this.$content=a(d).appendTo(this.$dialog);this.$title=this.$content.find("h4");if(this.shadow){this.$shadow=a(g).appendTo("body");this.$shadow.fadeTo(500,this.shadowOpacity)}a.Dialog.cache.put(this.id,this);this.active=document.activeElement;if(this.active!=null&&this.active.blur){this.active.blur()}this.$content[0].insertAdjacentHTML("beforeend",this.text);this.status=1;if(a.T.isFunction(this.callback)){this.callback.call(this,this.status)}if(this.timeout>0){var c=this;var f=setTimeout(function(){c.$dialog.fadeOut(c.timeout,a.bind(c.close,c))},1000)}},close:function(b,c){if(b instanceof Event){a.E.forbidden(b)}if(this.status==0){return}a.Dialog.cache.remove(this.id);this.remove(b===true);if(a.T.isFunction(c)){c.call(this,b)}},remove:function(b){if(this.status==0){return}this.$dialog.remove();window.focus();if(this.shadow){if(b){this.$shadow.remove()}else{this.$shadow.fadeOut(500,function(){a(this).remove()})}}this.status=0;if(a.T.isFunction(this.callback)){this.callback.call(this,this.status)}},};a.dialog=function(d){var c=new a.Dialog();for(var b in d){c.set(b,d[b])}c.execute()};a.alert=function(f,g,e){var c=e&&e.type||"alert";var d='
            '+f+"
            ";d+='
            确定
            ';var b=new a.Dialog();b.title=c=="success"?"成功":c=="failure"?"失败":"注意";b.hasTitle=false;b.text=d;b.execute();b.$content.find(".z-button-flex").on("touchstart",function(h){b.close(h,g)})};a.confirm=function(e,f,d){var c='
            '+e+"
            ";c+='
            确定
            取消
            ';var b=new a.Dialog();b.hasBackground=d&&d.hasBackground||false;b.title="询问";b.hasTitle=false;b.text=c;b.execute();b.$content.css("overflow","hidden");b.$content.find(".z-button-row").find(".z-red-bd").focus().on("touchend",function(g){b.close(g)});b.$content.find(".z-button-row").find(".z-blue-bd").on("touchend",function(g){b.close(g,f)});throw"stop"};a.prompt=function(l,j,k,c){var d=c&&c.type=="textarea";var b=c&&c.width||a.Dialog.innerWidth();var m=c&&c.height||(d)?150:120;var e='
            ';if(d){e+='"}else{e+='';a(document).keydown(i)}e+='
            确定
            取消
            ';var f=new a.Dialog();f.fixed=true;f.hasBackground=c&&c.hasBackground||false;f.title=a.S.toString(l||"提示修改");f.text=e;f.width=b;f.height=m;f.execute();f.$dialog.css("position","fixed");f.$content.css("overflow","hidden");f.$content.find(".z-console").find(".z-cancel").click(function(){f.close()});var h=f.$content.find(".z-container").find(".z-prompt").find(d?"textarea":"input").focusEnd();function g(){f.close();if(a.T.isFunction(k)){k(h.val())}}f.$content.find(".z-console").find(".z-ok").click(g);function i(n){if(a.E.key(n)!=a.E.KEY.ENTER){return}a(document).offkeydown(i);g()}throw"stop"};a.loading=function(g){var f="正在加载...";if(a.T.isString(g)){f=g;g=null}f=g&&g.text||f;var b=g&&g.radius||"z-bd-rd5";var e='
            ';e+='';e+=''+f+"
            ";var c=new a.Dialog();c.hasTitle=false;c.shadow=g&&g.shadow||false;c.text=d;c.execute();c.$content.addClass(b).addClass("z-flex-none");if(!c.shadow){c.$content.css("background","rgba(85,85,85,.6)")}return c};a.tips=function(c){var k="处理成功";if(a.T.isString(c)){k=c;c=null}k=c&&c.text||k;var g=c&&c.radius||"z-bd-rd5";var d=c&&c.color||"#fff";var b=c&&c.background||"#333";var f=c&&c.ico||"finish";var j=c&&c.timeout||300;var e='
            ';switch(f){case"finish":e+='';e+=''+e+'
            '+k+"
            ";var i=new a.Dialog();i.hasTitle=false;i.shadow=c&&c.shadow||false;i.text=h;i.timeout=j;i.execute();i.$dialog.addClass("z-event-none");i.$content.css("overflow","hidden").addClass(g).addClass("z-flex-none").css("background",b).css("color",d);return i}})(zhiqim);+(function(a){a.Ajax=a.Class.newInstance();a.Ajax.v="1.4.0";a.Ajax.prototype={defaults:{contextPath:null,className:null,methodName:null,token:"",async:true,params:[],paramMap:new a.HashMap(),paramData:null,callback:null,callbackMethod:"htmlc",success:null,failure:null,loading:null,loadingParam:null,loadingAttr:null,loadingProcess:false,responseStatus:0,responseText:null},init:function(){if(window.ActiveXObject){try{this.httpRequest=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{this.httpRequest=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}}else{if(window.XMLHttpRequest){this.httpRequest=new XMLHttpRequest()}}},execute:function(){if(!this.httpRequest){a.failure("[Z.Ajax]浏览器不支持AJAX");return false}if(!this.className){a.failure("[Z.Ajax]未设置className");return false}if(!this.methodName){a.failure("[Z.Ajax]未设置methodName");return false}var b=null;try{b=window.location.pathname}catch(h){b="null"}var d=a.rootPath(this.contextPath,"/service/ajax?path="+b+"&time="+(new Date()).getTime());var c=null;if(this.paramMap.size()>0){c="";a.eachof(this,this.paramMap.keySet(),function(e){c+=e+"="+encodeURIComponent(this.paramMap.get(e))+"&"});c=c.slice(0,-1)}else{if(this.paramData){c=this.paramData}else{if(this.params.length>0){c="";a.eachof(this,this.params,function(e){e=""+e;if(e.indexOf("#")!=-1){e=e.replace(/\#/g,"-%2-%-3%-")}c+="%23"+encodeURIComponent(e)+"%23"})}}}if(this.async){this.httpRequest.onreadystatechange=a.bind(this.receive,this)}this.httpRequest.open("POST",d,this.async);this.httpRequest.setRequestHeader("X-Requested-With","XMLHttpRequest");this.httpRequest.setRequestHeader("X-RMI-Class",this.className);this.httpRequest.setRequestHeader("X-RMI-Method",this.methodName);if(this.token){this.httpRequest.setRequestHeader("X-RMI-Token",this.token)}if(this.paramMap.size()>0||this.paramData){this.httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8")}else{this.httpRequest.setRequestHeader("Content-Type","text/plain; charset=UTF-8")}this.httpRequest.send(c);if(!this.async){this.processResult();return}if(!this.loading||(a.Dialog&&this.loading instanceof a.Dialog)){return}if(a.T.isFunction(this.loading)){this.loading.call(this)}else{if(a.T.isDocument(this.loading)){this.loading=a.loading({target:document,shadow:true===this.loadingParam})}else{if(a.T.isElement(this.loading)||a.T.isString(this.loading)){if(a.T.isString(this.loadingParam)){var g=a.T.isString(this.loading)?a("#"+this.loading):a(this.loading);var f=g.html();g.html(this.loadingParam);this.loadingParam=f;if(this.loadingAttr&&this.loadingAttr.disabled===true){g.attr("disabled",true)}}else{if(a.loading){this.loading=a.loading({target:this.loading,shadow:true===this.loadingParam})}}}else{if(a.T.isObject(this.loading)&&this.loading.execute){this.loading.execute()}}}}},receive:function(){if(this.httpRequest.readyState!=4){return}if(this.loading){if(a.T.isObject(this.loading)&&this.loading.close){this.loading.close(true)}else{if((a.T.isString(this.loading)||a.T.isElement(this.loading))&&this.loading!=this.callback){this.processRecoveryLoading()}}}this.processResult()},processRecoveryLoading:function(){if(this.loadingProcess){return}var b=a.T.isString(this.loading)?a("#"+this.loading):a(this.loading);if(!(this.loadingAttr&&this.loadingAttr.recovery===false)){if(this.loadingParam){b.html(this.loadingParam)}}if(this.loadingAttr&&this.loadingAttr.disabled===true&&this.loadingAttr.recovery!==false){b.attr("disabled",false)}},processResult:function(){if(this.httpRequest.status==200){this.responseStatus=0;this.responseText=this.httpRequest.responseText}else{this.responseStatus=(this.httpRequest.status==0)?91:this.httpRequest.status;this.responseText=this.httpRequest.responseText}this.httpRequest=null;if(this.responseStatus>=601&&this.responseStatus<=603){var b;var c=this.responseText.lastIndexOf("#");if(c!=-1){b=this.responseText.substring(c+1);this.responseText=this.responseText.substring(0,c)}if(a.V.isEmpty(b)){this.processRedirect()}else{a.failure(b,a.bind(this.processRedirect,this))}throw"stop"}else{if(this.responseStatus!=0&&a.T.isFunction(this.failure)){this.failure.call(this,this.responseText,this.responseStatus)}else{if(this.responseStatus!=0&&a.T.isString(this.failure)){this.showValue(this.failure)}else{if(this.responseStatus==0&&a.T.isFunction(this.success)){this.success.call(this,this.responseText,this.responseStatus)}else{if(this.responseStatus==0&&a.T.isString(this.success)){this.showValue(this.success)}else{if(a.T.isFunction(this.callback)){this.callback.call(this,this.responseText,this.responseStatus)}else{if(a.T.isString(this.callback)){this.showValue(this.callback)}}}}}}}},showValue:function(b){if(this.callbackMethod=="val"){a("#"+b).val(this.responseText)}else{if(this.callbackMethod=="text"){a("#"+b).text(this.responseText)}else{if(this.callbackMethod=="html"){a("#"+b).html(this.responseText)}else{a("#"+b).htmlc(this.responseText)}}}},processRedirect:function(){switch(this.responseStatus){case 601:window.parent.location.href=this.responseText;break;case 602:window.location.href=this.responseText;break;case 603:window.top.location.href=this.responseText;break}},setContextPath:function(b){this.contextPath=b;return this},setClassName:function(b){this.className=b;return this},setMethodName:function(b){this.methodName=b;return this},setToken:function(b){this.token=b;return this},setSync:function(){this.async=false;return this},setCallback:function(b){this.callback=b;return this},setCallbackMethod:function(b){this.callbackMethod=b;return this},setSuccess:function(b){this.success=b;return this},setSuccessLocation:function(c,b){this.success=function(){a.L.href(c,b)}},setSuccessLocationResponse:function(c,b){this.success=function(){a.L.href(this.responseText,b)}},setSuccessReload:function(){this.success=function(){a.L.reload()}},setSuccessReloadParent:function(){this.success=function(){parent.Z.L.reload()}},setSuccessReloadTop:function(){this.success=function(){top.Z.L.reload()}},setSuccessAlertLocation:function(d,c,b){this.success=function(){a.success(d,function(){a.L.href(c,b)})}},setSuccessAlertReload:function(b){this.success=function(){a.success(b,function(){a.L.reload()})}},setSuccessAlertReloadParent:function(b){this.success=function(){a.success(b,function(){parent.Z.L.reload()})}},setSuccessAlertReloadTop:function(b){this.success=function(){a.success(b,function(){top.Z.L.reload()})}},setFailure:function(b){this.failure=b;return this},setFailureAlert:function(){this.failure=function(){a.failure(this.responseText)};return this},setFailureAlertRecovery:function(){this.failure=function(){if(this.loadingAttr){this.loadingAttr.recovery=true;this.processRecoveryLoading()}a.failure(this.responseText)};return this},addParam:function(c,b){(b==a.u)?this.params.push(c):this.paramMap.put(c,b);return this},setParamData:function(b){this.paramData=b;return this},setParamForm:function(b){this.paramData=a.FM.formData(b);return this},setLoading:function(c,d,b){this.loading=c;this.loadingParam=d;this.loadingAttr=b;return this}};a.ajax=function(b,e,d){var c=new a.Ajax();if(b){c.setClassName(b)}if(e){c.setMethodName(e)}if(d){c.setCallback(d)}return c};a.submit=function(b,h,g,c,f,d){a(c).attr("type","button");if(validateForm&&validateForm(c.form)){return}var e=a.ajax(b,h,g);e.setParamData(a.FM.formData(c.form));e.setLoading(c,f,d);e.execute()};a.log=function(b,c){a.ajax("Logs",c||"info").addParam(b).execute()}})(zhiqim);+(function(a){})(zhiqim);+(function(a){a.Input=a.Class.newInstance();a.Input.types=["Numeric","Alphabetic","AlphaNumeric","Integer","Decimal","Amount2R","Discount","Date","HourMinute"];a.Input.speTypes=["number","email"];a.Input.prototype={defaults:{elem:null,options:null},init:function(){if(!this.elem){return}this.$elem=a(this.elem);if(!this.options&&!a.AR.contains(a.Input.speTypes,this.$elem.attr("type"))){return}if(this.$elem.attr("max")!=null){this.$elem.max=parseFloat(this.$elem.attr("max"))}if(this.$elem.attr("maxlength")!=null){this.$elem.maxlength=parseInt(this.$elem.attr("maxlength"))}this.$elem.on("input",this.onInput,this)},onInput:function(b){this.call("on",b)},call:function(b,c){if(!this.options){this.$elem.val(this.inputMax(this.$elem.val()))}else{if(this.options.type&&b+this.options.type in this){this[b+this.options.type].call(this,c)}}},inputMax:function(b){if(this.$elem.max&&+b>this.$elem.max){return b=this.$elem.max}if(this.$elem.maxlength&&(""+b).length>this.$elem.maxlength){return b=b.substring(0,this.$elem.maxlength)}return b},onNumeric:function(c){var b=this.$elem.val();if(!/^[0-9]*$/.test(b)){b=b.replace(/[^0-9]/g,"");this.inputMax(b);this.$elem.val(b)}},onInteger:function(c){var b=this.$elem.val();if(!/^[0-9]*$/.test(b)){b=b.replace(/[^0-9]/g,"")}b=a.S.prefixZeroRemove(b);this.inputMax(b);this.$elem.val(b)},onDecimal:function(c){var b=this.$elem.val();if(!/^[0-9.]*$/.test(b)){b=b.replace(/[^0-9.]/g,"")}b=a.S.prefixZeroRemove(b);b=a.S.removeSecondDot(b);if(b.length>0&&b.charAt(0)=="."){b="0"+b}this.inputMax(b);this.$elem.val(b)},onAlphabetic:function(c){var b=this.$elem.val();if(!/^[a-zA-Z]*$/.test(b)){b=b.replace(/[^a-zA-Z]/g,"");this.$elem.val(b)}},onAlphabeticNumeric:function(c){var b=this.$elem.val();if(!/^[0-9a-zA-Z]*$/.test(b)){b=b.replace(/[^0-9a-zA-Z]/g,"");this.$elem.val(b)}},onAmount2R:function(d){var c=this.$elem.val();if(!/^[0-9.]*$/.test(c)){c=c.replace(/[^0-9.]/g,"")}c=a.S.prefixZeroRemove(c);c=a.S.removeSecondDot(c);if(c.length>0&&c.charAt(0)=="."){c="0"+c}var b=c.indexOf(".");if(b!=-1&&b<=c.length-1-2){c=c.substring(0,b+1+2)}this.inputMax(c);this.$elem.val(c)},onDiscount:function(d){var c=this.$elem.val();if(!/^[0-9.]*$/.test(c)){c=c.replace(/[^0-9.]/g,"")}c=a.S.prefixZeroRemove(c);c=a.S.removeSecondDot(c);if(c.length>0&&c.charAt(0)=="."){c="0"+c}var b=c.indexOf(".");if(b!=-1&&b<=c.length-1-2){c=c.substring(0,b+1+2)}this.$elem.val((parseFloat(c)>10)?"":c)},onDate:function(d){var c=this.$elem.val();if(!/^[0-9\-]*$/.test(c)){c=c.replace(/[^0-9\-]/g,"")}var b=null;switch(c.length){case 1:b=/^[0-9]$/;break;case 2:b=/^[0-9]{2}$/;break;case 3:b=/^[0-9]{3}$/;break;case 4:b=/^[0-9]{4}$/;break;case 5:b=/^[0-9]{4}\-$/;break;case 6:b=/^[0-9]{4}\-[0-1]$/;break;case 7:b=/^[0-9]{4}\-(0[1-9]|1[0-2])$/;break;case 8:b=/^[0-9]{4}\-(0[1-9]|1[0-2])\-$/;break;case 9:b=/^[0-9]{4}\-(0[1-9]|1[0-2])\-[0-3]$/;break;case 10:b=a.R.DATE;break}this.$elem.val((!b||!b.test(c))?"":c)},onHourMinute:function(d){var c=this.$elem.val();if(!/^[0-9:]*$/.test(c)){c=c.replace(/[^0-9:]/g,"")}var b=null;switch(c.length){case 1:b=/^[0-2]$/;break;case 2:b=/^([0-1][0-9]|[2][0-3])$/;break;case 3:b=/^([0-1][0-9]|[2][0-3]):$/;break;case 4:b=/^([0-1][0-9]|[2][0-3]):([0-5])$/;break;case 5:b=/^([0-1][0-9]|[2][0-3]):([0-5][0-9])$/;break}this.$elem.val((!b||!b.test(c))?"":c)}};a.Input.load=function(b){a.$selector("input",b).each(function(e){if(a.B.msie){a.placeholder(e)}if(a.EL.get(e,"readonly")!=null){a.E.add(e,"keydown",a.E.forbidden);return}if(!a.EL.has(e,"data-options")){var d=a.EL.get(e,"type");if(a.AR.contains(a.Input.speTypes,d)){if(a.EL.get(e,"max")!=null||a.EL.get(e,"maxlength")!=null){return new a.Input({elem:e})}}return}var f=a.EL.get(e,"data-options");var c=a.AR.toObject(f,";");if(!c.type||!a.AR.contains(a.Input.types,c.type)){return}a.EL.addClass(e,"z-ime-disabled");new a.Input({elem:e,options:c})})};a.onload(a.Input.load);a.NumInput={};a.NumInput.load=function(b){a.$selector("[data-role=z-numInput]",b).each(function(e){var c=a(e).find(".z-btn-minus");var d=a(e).find(".z-btn-plus");var f=a(e).find("input[type=text]");if(!c[0]||!d[0]||!f[0]){return false}f.off("input",a.NumInput.numInput).on("input",a.NumInput.numInput);d.off("touchend",a.NumInput.numPlus).on("touchend",a.NumInput.numPlus);c.off("touchend",a.NumInput.numMinus).on("touchend",a.NumInput.numMinus)})};a.NumInput.numInput=function(c){var e=a(this);var d=e.val();var b=parseInt(e.attr("data-min"))||1;d=d.replace(/[^\d]/g,"");while(d.charAt(0)=="0"&&d.length>1){d=d.substring(1)}if(d==""){d=b}e.val(d)};a.NumInput.numPlus=function(c){a.E.forbidden(c);var b=a(this);var e=b.parent().find("input[type=text]");var d=parseInt(e.val());d++;e.val(d)};a.NumInput.numMinus=function(d){a.E.forbidden(d);var b=a(this);var f=b.parent().find("input[type=text]");var c=parseInt(f.attr("data-min"))||1;var e=parseInt(f.val());e--;e=(e').prependTo("body")}f.target="zCallFrame";if(!f.zFormIndex){var c=document.createElement("input");c.name="zFormIndex";c.type="hidden";f.insertBefore(c,f.firstNode)}var g=-1;for(var d=0;d'+h+"
            ");d.appendTo(e).opacity(0.8).css({width:f,height:b}).cssMaybe("padding-left",c.cssNum("paddingLeft")+2).cssMaybe("padding-right",c.css("paddingRight")).cssMaybe("padding-top",c.css("paddingTop")).cssMaybe("padding-bottom",c.css("paddingBottom")).cssMaybe("font-family",c.css("fontFamily")).cssMaybe("font-size",c.css("fontSize")).cssMaybe("line-height",c.css("lineHeight")).cssMaybe("text-indent",c.css("textIndent"));if(c.val().length>0){d.hide()}c.keydown(function(){d.hide()});c.keyup(function(){if(c.val().length>0){d.hide()}else{d.show()}})};a.preRemoveBR=function(){a(".z-text-preline:not(pre),.z-text-prewrap:not(pre)").each(function(d){var b=a(d);var c=b.html();if(a.V.isEmpty(c)){return}if(c.charAt(0)=="\n"){b.html(c.substring(1))}})};a.onload(a.preRemoveBR)})(zhiqim);+(function(a){})(zhiqim);+(function(a){a.Popup=a.Class.newInstance();a.Popup.cache=new a.HashMap();a.Popup.close=function(d,c){d=d?((d.charAt(0)=="#")?d.substring(1):d):d;if(!d){a.each(a.Popup.cache.values(),function(e){e.fadeOut(c)});a.Popup.cache.clear()}else{var b=a.Popup.cache.get(d);if(b){b.fadeOut(c);a.Popup.cache.remove(d)}}};a.Popup.get=function(b){b=b?((b.charAt(0)=="#")?b.substring(1):b):b;return a.Popup.cache.get(b)};a.Popup.prototype={defaults:{target:null,start:"left",overlay:"all",overlayRatio:"75",},validate:function(){if(!this.target){a.alert("Z.Popup参数“target”未设置!");return false}if(a.T.isString(this.target)||a.T.isObject(this.target)){if(!a(this.target)[0]){a.alert("Z.Popup参数“target”设置不正确!");return false}}if(!a.AR.contains(["left","top","right","bottom"],this.start)){this.start="left"}if(!a.AR.contains(["part","all"],this.overlay)){this.start="part"}return true},execute:function(){if(!this.validate()){return}this.id=a(this.target).attr("id");if(!this.id){this.id="Z_zmPopup_"+a.Ids.uuid();a(this.target).attr(this.id)}a.Popup.cache.put(this.id,this);this.creatPopup();this.attachEvent();this.fadeIn()},creatPopup:function(){this.$popup=a(this.target);this.$popup.removeClass("z-overlay-all").removeClass("z-overlay-part").addClass("z-overlay-"+this.overlay);this.$popup.removeClass("z-top").removeClass("z-right").removeClass("z-bottom").removeClass("z-left").addClass("z-"+this.start).css("display","none");this.$bg=this.$popup.find(".z-popup-bg");this.$main=this.$popup.find(".z-popup-main");this.$title=this.$popup.find(".z-popup-title");this.$sure=this.$popup.find(".z-popup-sure");this.$cancel=this.$popup.find(".z-popup-cancel");this.$con=this.$popup.find(".z-popup-content")},attachEvent:function(){this.$bg.on("touchstart",this.fadeOut,this);this.$cancel.on("touchstart",this.fadeOut,this);if(this.$sure[0]){this.$sure[0].$this=this;this.$sure.on("touchstart",function(c){this.$this.fadeOut(c)})}var b=this.transitionFixed();this.$main.on(b,this.transitionEnd,this)},fadeIn:function(){var c=this;var b=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||function(d){window.setTimeout(d,1000/60)};b(function(){c.$popup.css("display","block");b(function(){c.$popup.addClass("z-popup-fadeIn");c=null})})},fadeOut:function(b){a.E.forbidden(b);this.$popup.removeClass("z-popup-fadeIn");this.$popup.addClass("z-popup-fadeOut");a.Popup.cache.remove(this.id);if(a(this.target).attr("id").indexOf("Z_zmPopup_")>-1){a(this.target).removeAttr("id")}},transitionEnd:function(b){if(this.$popup.hasClass("z-popup-fadeOut")){this.$popup.css("display","none");this.$popup.removeClass("z-popup-fadeOut")}},transitionFixed:function(){var b=document.createElement("div");if(b.style.transition!==undefined){b=null;return"transitionend"}if(b.style.OTransition!==undefined){b=null;return"oTransitionEnd"}if(b.style.WebkitTransition!==undefined){b=null;return"webkitTransitionEnd"}},};a.ActionList=a.Class.newInstance();a.ActionList.cache=new a.HashMap();a.ActionList.close=function(d,b){d=d?((d.charAt(0)=="#")?d.substring(1):d):d;if(!d){a.each(a.ActionList.cache.values(),function(e){e.fadeOut(b)});a.ActionList.cache.clear()}else{var c=a.ActionList.cache.get(d);if(c){c.fadeOut(b);a.ActionList.cache.remove(d)}}};a.ActionList.get=function(b){b=b?((b.charAt(0)=="#")?b.substring(1):b):b;return a.ActionList.cache.get(b)};a.ActionList.prototype={defaults:{id:"",html:"",height:0.7,},validate:function(){if(a.V.isEmpty(this.html)){a.alert("Z.ActionList参数“html”未设置!");return false}if(!this.id){this.id="Z_actionList_"+a.Ids.uuid()}return true},execute:function(){if(!this.validate){return}a.ActionList.cache.put(this.id,this);this.creatActionList();this.attachEvent();this.fadeIn()},creatActionList:function(){var e='
            ';this.$action=a(e);this.$action.appendTo(a("body"));a.ResetTouchEnd.load(this.$action);var d=this.$action.find(".z-popup-content");d.htmlc(this.html);if(this.html.match(/data-role\s*=\s*"z-numInput"/)){a.ZmNumInput.load(d)}this.$bg=this.$action.find(".z-popup-bg");this.$main=this.$action.find(".z-popup-main");this.$con=this.$action.find(".z-popup-content");var c=parseInt(a.D.clientHeight());var b=c*this.height;this.$con.css("height",b)},attachEvent:function(){this.$bg.on("touchstart",this.fadeOut,this);var b=this.transitionFixed();this.$main.on(b,this.transitionEnd,this)},fadeIn:function(){var c=this;var b=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||function(d){window.setTimeout(d,1000/60)};b(function(){c.$action[0].style.display="block";b(function(){c.$action.addClass("z-popup-fadeIn")})})},fadeOut:function(){a.ActionList.cache.remove(this.id);this.$action.removeClass("z-popup-fadeIn");this.$action.addClass("z-popup-fadeOut")},transitionEnd:function(b){if(this.$action.hasClass("z-popup-fadeOut")){this.$action.remove()}},transitionFixed:function(){var b=document.createElement("div");if(b.style.transition!==undefined){b=null;return"transitionend"}if(b.style.OTransition!==undefined){b=null;return"oTransitionEnd"}if(b.style.WebkitTransition!==undefined){b=null;return"webkitTransitionEnd"}},}})(zhiqim);+(function(a){a.ScrollLoad=a.Class.newInstance();a.ScrollLoad.prototype={defaults:{elem:"",ajaxClass:"",ajaxMethod:"",ajaxParams:null,paramPage:"page",ajaxSuccess:null,ajaxFailue:null,loading:false,loadPage:2,distance:30,},validate:function(){if(!a("body>.z-container")[0]){return false}this.$scroller=a("body>.z-container");this.sOffsetHeight=this.$scroller[0].offsetHeight;var b=this.$scroller[0].scrollHeight;if(this.sOffsetHeight>=b){return false}if(!this.ajaxClass){a.alert("Z.ScrollLoad 参数 ajaxClass 配置有误");return false}if(!this.ajaxMethod){a.alert("Z.ScrollLoad 参数 ajaxMethod 配置有误");return false}if(typeof this.ajaxParams!="object"){a.alert("Z.ScrollLoad 参数 ajaxParams 配置有误");return false}return true},execute:function(){if(!this.validate()){return}this.$elem=a.$elem(this.elem,"Z.ScrollLoad");this.loading=false;this.distance=+this.distance;if(this.distance>this.sOffsetHeight||this.distance<0){this.distance=30}var b='
            ';b+='';b+='");this.$file.appendTo("body").change(this.onFileOpenWindow,this);this.$elem.click(function(){this.clear();this.$file[0].click()},this)},onFileOpenWindow:function(){this.file=this.$file[0].files[0];if(!a.T.isFunction(this.onPreview)){this.upload()}else{var b=new FileReader();b.onload=a.bind(function(c){this.onPreview(c.target.result)},this);b.readAsDataURL(this.file)}},onUploadError:function(){this.$elem.text(this.text);this.clear();alert("文件上传连接服务器失败:"+this.request.responseText)},onUploadSuccess:function(){if(this.request.readyState!=4){return}this.$elem.text(this.text);this.clear();switch(this.request.status){case 404:alert("文件上传时服务器不支持");return;case 403:alert("文件上传时被服务器拒绝");return;case 412:alert("文件上传时服务器诊断参数格式错误");return;case 400:alert("文件上传时服务器诊断参数传值错误");return;case 200:var b=this.request.getResponseHeader("X-Upload-File-Url");if(!b){alert("文件上传时服务器异常");return}if(a.T.isFunction(this.onCompleted)){this.onCompleted(b)}return;default:alert("文件上传时服务器未知错误:"+this.request.status);return}},upload:function(){this.$elem.text("正在上传");this.request=new XMLHttpRequest();this.request.open("POST",a.rootPath(this.contextPath,"/service/upload"),true);this.request.setRequestHeader("Content-Type",this.file.type);this.request.setRequestHeader("Content-Length",this.file.size);if(this.fileDir){this.request.setRequestHeader("X-Upload-File-Dir",encodeURIComponent(this.fileDir))}this.request.setRequestHeader("X-Upload-File-Name",encodeURIComponent(this.file.name));this.request.onreadystatechange=a.bind(this.onUploadSuccess,this);this.request.onerror=a.bind(this.onUploadError,this);this.request.send(this.file)},clear:function(){this.$file[0].value=null;this.file=null},setFileDir:function(b){this.fileDir=b;return this},setFileFormatExt:function(b){this.fileFormatExt=b;return this}}})(zhiqim);+(function(a){a.Uploadmult=a.Class.newInstance();a.Uploadmult.prototype={defaults:{elem:null,contextPath:null,onPreview:null,onCompleted:null,fileFormatExt:"image/png,image/jpeg,image/jpg,image/gif",},execute:function(){this.$elem=a.$elem(this.elem,"Z.Uploadmult");this.random=a.random(10);this.text=this.$elem.text();this.$file=a("
            ");d.append("
            "+this.results[c].name+" ("+(Math.floor(this.results[c].size/1024))+"K)
            ");d.append("");var b=a("
            ").appendTo(d);b.css({position:"absolute",top:2,right:2,cursor:"pointer"}).attr("name",this.results[c].name).html("×").click(this.onFileRemove,this);e.append(d)}},clear:function(){this.$file[0].value=null;this.files=null;this.results=null;this.fileResults=null},setFileDir:function(b){this.fileDir=b;return this},setFileFormatExt:function(b){this.fileFormatExt=b;return this}}})(zhiqim); \ No newline at end of file diff --git a/zhiqim_ui/release/zhiqim_v1.5.0.r2019010101.css b/zhiqim_ui/release/zhiqim_v1.5.0.r2019010101.css new file mode 100644 index 0000000..e97e038 --- /dev/null +++ b/zhiqim_ui/release/zhiqim_v1.5.0.r2019010101.css @@ -0,0 +1,2653 @@ +@charset "utf-8"; +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙登记发行许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ + +/*********************************************************/ +/*********************************************************/ +/***************** Ⅰ:通用定义 ******************/ +/*********************************************************/ +/*********************************************************/ + +/***********************************************/ +/* 第一部分:标准标记定义 */ +/***********************************************/ + +/***********************************************/ +/* 1.1:HTML5新增模块 */ +/***********************************************/ + +article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;} +audio,canvas,video{display:inline-block;vertical-align:baseline;} +audio:not([controls]){display:none;height:0;} +[hidden],template{display:none;} +svg:not(:root){overflow:hidden;} + +/***********************************************/ +/* 1.2:全局标记一致性定义 */ +/***********************************************/ +*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} +*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} +html{ + font-family:"微软雅黑","宋体",Arial,sans-serif; + overflow-x:hidden;overflow-y:auto; + -ms-text-size-adjust:100%; + -webkit-text-size-adjust:100%; + -webkit-tap-highlight-color:rgba(0, 0, 0, 0); + height:100%; +} +body{color:#333;background-color:#fff;} +body,form,figure{margin:0;} +img{border:0;vertical-align:middle;max-width:100%;max-height:100%;-ms-interpolation-mode:bicubic;} +p{margin:0px;padding:0px;} +hr{ + -webkit-box-sizing:content-box; + -moz-box-sizing:content-box; + box-sizing:content-box; + height:0;border:0;border-top:1px solid #eee;margin:1em 0;} + +fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;} +legend{border:0;padding:0;} + +ul,dl,ol,li{list-style:none;padding:0;margin:0;} +li{line-height:1.25em;} + +/* 设置A标签透明背景无下划线 ,获取焦点时为虚线,覆盖时无突出效果,有下划线*/ +a,a:visited{color:#333;text-decoration:none;background-color:transparent;} +a:active,a:hover{color:#06c;outline:0;text-decoration:underline;} + +/***********************************************/ +/* 1.3:表单一致性定义 */ +/***********************************************/ + +/** 统一Firefox默认按扭和输入框padding 0 2px,修改成统一无内边距 */ +button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;} +input{line-height:normal;} +optgroup{font-weight:bold;} +button,input,select,optgroup,textarea{color:inherit;font:inherit;margin:0;outline:none;/** 取消webkit默认选中边框 */} +button{overflow:visible;} +button,html input[type="button"],input[type="reset"],input[type="submit"] {-webkit-appearance:button;cursor:pointer;} +button[disabled],html input[disabled]{cursor:not-allowed;} +textarea{overflow:auto;word-wrap:break-word;resize:none;/**不支持缩放*/} +button,select{text-transform:none;}/*capitalize首字母大写 | uppercase统一大写 | lowercase | none | inherit*/ +/** 单多选按钮有2像素偏下,IE高度和背景白色问题,修改成高度为13px,背景透明 */ +input[type="checkbox"],input[type="radio"]{margin-top:-2px;border:0;padding:0;vertical-align:middle;height:13px;background-color:transparent;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} +/** 移动设备上webkit自定义数字框高度自动 */ +input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto;} +/** 移动设备上webkit自定义搜索框为文本字段,宽高设置采用content-box */ +input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;} +/** 移动设备上webkit自定义搜索框按钮取消原生样式 */ +input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration {-webkit-appearance:none;} + + +/***********************************************/ +/* 1.4:文本标记一致性定义 */ +/***********************************************/ + +/** 设置上标和下标字体是系统定义的75%,元素放置在父元素的基线上,以便在下面单独定义上下浮 */ +b{font-weight:bold;} +i{font-style:italic;} +u{text-decoration:underline;} +del{text-decoration:line-through;} +sub,sup{position:relative;vertical-align:baseline;line-height:0;font-size:75%;} +sup{top:-0.5em;} +sub{bottom:-0.25em;} +small{font-size:80%;}/* 设置小号字体是系统定义字体的80% */ +mark{background:#ff0;color:#000;}/* 设置文本标记颜色为通用的黑色+黄底#ffff00 */ +abbr[title]{border-bottom:1px dotted;}/* 设置缩短标签下加虚线 */ +@-moz-document url-prefix() {abbr[title]{border-bottom:none;}} + +/** 设置代码字体为linux默认字体,风格等 */ +code,kbd,pre,samp{font-family:Consolas,"Courier New",monospace,Menlo,Monaco,"微软雅黑";font-size:1em;} +code,kbd,pre{border-radius:4px;} +code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;} +kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333; + -webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.25); + box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.25); +} +kbd kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none;} +pre{overflow:auto;display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;} +pre code{padding:0;font-size:inherit;color:#c7254e;white-space:pre-wrap;background-color:transparent;border-radius:0;} + +zcover{position:relative;display:inline-block;} + +/***********************************************/ +/* 第二部分:图标定义 */ +/***********************************************/ + +/***********************************************/ +/* 2.1:字体图标 */ +/***********************************************/ + +@font-face { + font-family:"z-font"; + src:url('font/zhiqim.eot'); + src:url('font/zhiqim.eot?#iefix') format('embedded-opentype'), + url('font/zhiqim.woff') format('woff'), + url('font/zhiqim.ttf') format('truetype'), + url('font/zhiqim.svg#z-font') format('svg'); +} + +/** 字体图标不支持斜体,以便使用i标签来定义 */ +.z-font{ + font-family:"z-font" !important; + font-style:normal; + -webkit-font-smoothing:antialiased; + -webkit-text-stroke-width:0.2px; + -moz-osx-font-smoothing:grayscale; + position:relative; + bottom:-2px; +} +/** 操作类(f000-f03f) */ +.z-font.z-config:before{content:"\f000";} +.z-font.z-add:before{content:"\f001";} +.z-font.z-modify:before{content:"\f002";} +.z-font.z-delete:before{content:"\f003";} +.z-font.z-query:before{content:"\f004";} +.z-font.z-previous:before{content:"\f005";} +.z-font.z-next:before{content:"\f006";} +.z-font.z-open:before{content:"\f007";} +.z-font.z-close:before{content:"\f008";} +.z-font.z-upload:before{content:"\f009";} +.z-font.z-save:before{content:"\f00a";} +.z-font.z-finish:before{content:"\f00a";} +.z-font.z-return:before{content:"\f00b";} +.z-font.z-refresh:before{content:"\f00c";} +.z-font.z-success:before{content:"\f00d";} +.z-font.z-error:before{content:"\f00e";} +.z-font.z-setting:before{content:"\f00f";} +.z-font.z-share:before{content:"\f010";} +.z-font.z-download:before{content:"\f011";position:relative;bottom:1px;} + +.z-font.z-addfile:before{content:"\f012";} +.z-font.z-address:before{content:"\f013";} +.z-font.z-praise:before{content:"\f014";} +.z-font.z-diss:before{content:"\f015";} +.z-font.z-display:before{content:"\f016";} +.z-font.z-hide:before{content:"\f017";} +.z-font.z-negative:before{content:"\f018";} +.z-font.z-skin:before{content:"\f019";} +.z-font.z-copy:before{content:"\f01a";} +.z-font.z-tips:before{content:"\f01b";} +.z-font.z-notice:before{content:"\f01c";} +.z-font.z-signin:before{content:"\f01d";} +.z-font.z-consult:before{content:"\f01e";} +.z-font.z-message:before{content:"\f01f";} +.z-font.z-community:before{content:"\f020";} +.z-font.z-info:before{content:"\f021";} +.z-font.z-wangwang:before{content:"\f022";} +.z-font.z-space:before{content:"\f023";} +.z-font.z-problem:before{content:"\f024";} +.z-font.z-warning:before{content:"\f025";} +.z-font.z-play:before{content:"\f026";} +.z-font.z-hot:before{content:"\f027";} +.z-font.z-safe:before{content:"\f028";} +.z-font.z-task:before{content:"\f029";} +.z-font.z-assignment:before{content:"\f02a";} +.z-font.z-activity:before{content:"\f02b";} +.z-font.z-edit:before{content:"\f02c";} +.z-font.z-function:before{content:"\f02d";} +.z-font.z-serve:before{content:"\f02e";} +.z-font.z-more:before{content:"\f02f";} +.z-font.z-on:before{content:"\f030";} +.z-font.z-off:before{content:"\f031";} +/** 文档类(f040-f05f) */ +.z-font.z-folder:before{content:"\f040";} +.z-font.z-collect:before{content:"\f041";} +.z-font.z-briefcase:before{content:"\f042";} +.z-font.z-image-text:before{content:"\f043";} +.z-font.z-text:before{content:"\f044";} +.z-font.z-picture:before{content:"\f045";} +.z-font.z-video:before{content:"\f046";} +.z-font.z-voice:before{content:"\f047";} +.z-font.z-camera:before{content:"\f048";} +.z-font.z-print:before{content:"\f049";} + +.z-font.z-codesign:before{content:"\f04a";} +.z-font.z-order:before{content:"\f04b";} +.z-font.z-news:before{content:"\f04c";} +.z-font.z-course:before{content:"\f04d";} +.z-font.z-userinfo:before{content:"\f04e";} +.z-font.z-tag:before{content:"\f04f";} +.z-font.z-templet:before{content:"\f050";} +.z-font.z-project:before{content:"\f051";} +.z-font.z-w-doc:before{content:"\f052";} +.z-font.z-w-htm:before{content:"\f053";} +.z-font.z-w-pdf:before{content:"\f054";} +.z-font.z-w-ppt:before{content:"\f055";} +.z-font.z-w-txt:before{content:"\f056";} +.z-font.z-w-srt:before{content:"\f057";} +.z-font.z-w-xls:before{content:"\f058";} +.z-font.z-w-iso:before{content:"\f059";} +.z-font.z-w-rar:before{content:"\f05a";} +.z-font.z-w-zip:before{content:"\f05b";} +/** 设备类(f060-f07f) */ +.z-font.z-computer:before{content:"\f060";} +.z-font.z-phone:before{content:"\f061";} +.z-font.z-monitor:before{content:"\f062";} +.z-font.z-email:before{content:"\f063";} +.z-font.z-internet:before{content:"\f064";} +.z-font.z-switch:before{content:"\f065";} +.z-font.z-wifi:before{content:"\f066";} +.z-font.z-cloud:before{content:"\f067";} +.z-font.z-port:before{content:"\f068";} + +.z-font.z-telephone:before{content:"\f069";} +.z-font.z-treemodel:before{content:"\f06a";} +.z-font.z-qrcode:before{content:"\f06b";} +.z-font.z-database:before{content:"\f06c";} +.z-font.z-email-open:before{content:"\f06d";} +/** 图表类(f080-f09f) */ +.z-font.z-list:before{content:"\f080";} +.z-font.z-apps:before{content:"\f081";} +.z-font.z-pie-chart:before{content:"\f082";} +.z-font.z-histogram:before{content:"\f083";} +.z-font.z-graph:before{content:"\f084";} +.z-font.z-diagram:before{content:"\f085";} +.z-font.z-arrow-down:before{content:"\f086";} +.z-font.z-arrow-up:before{content:"\f087";} +.z-font.z-arrow-left:before{content:"\f088";} +.z-font.z-arrow-right:before{content:"\f089";} +.z-font.z-arrowhead-down:before{content:"\f08a";} +.z-font.z-arrowhead-up:before{content:"\f08b";} +.z-font.z-arrowhead-left:before{content:"\f08c";} +.z-font.z-arrowhead-right:before{content:"\f08d";} + +.z-font.z-list01:before{content:"\f08e";} +.z-font.z-bill:before{content:"\f08f";} +.z-font.z-pie-chart01:before{content:"\f090";} +.z-font.z-report-forms:before{content:"\f091";} +.z-font.z-table:before{content:"\f092";} +.z-font.z-line-chart:before{content:"\f093";} +/** 实体类(f0a0-f0bf) */ +.z-font.z-customer:before{content:"\f0a0";} +.z-font.z-cash:before{content:"\f0a1";} +.z-font.z-house:before{content:"\f0a2";} +.z-font.z-flower:before{content:"\f0a3";} +.z-font.z-box:before{content:"\f0a4";} +.z-font.z-desk:before{content:"\f0a5";} +.z-font.z-gift:before{content:"\f0a6";} +.z-font.z-lock:before{content:"\f0a7";} + +.z-font.z-flag:before{content:"\f0a8";} +.z-font.z-lock01:before{content:"\f0a9";} +.z-font.z-unlock:before{content:"\f0aa";} +.z-font.z-money:before{content:"\f0ab";} +.z-font.z-upstage:before{content:"\f0ac";} +.z-font.z-shopcart:before{content:"\f0ad";} +.z-font.z-heart:before{content:"\f0ae";} +.z-font.z-bell:before{content:"\f0af";} +.z-font.z-alarm-clock:before{content:"\f0b0";} +.z-font.z-clock:before{content:"\f0b1";} +.z-font.z-timetable:before{content:"\f0b2";} +.z-font.z-shop:before{content:"\f0b3";} +.z-font.z-five-star:before{content:"\f0b4";} +.z-font.z-warehouse:before{content:"\f0b5";} +.z-font.z-coupon:before{content:"\f0b6";} +.z-font.z-card:before{content:"\f0b7";} +.z-font.z-diamond:before{content:"\f0b8";} +.z-font.z-compass:before{content:"\f0b9";} +.z-font.z-goods:before{content:"\f0ba";} +.z-font.z-key:before{content:"\f0bb";} +.z-font.z-gold:before{content:"\f0bc";} +.z-font.z-smiling:before{content:"\f0bd";} +.z-font.z-car:before{content:"\f0be";} +.z-font.z-people:before{content:"\f0bf";} + +/***********************************************/ +/* 2.4:圆圈圆角定义 */ +/***********************************************/ + +.z-round{display:inline-block;width:16px;height:16px;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;text-align:center;line-height:16px;} +.z-round.z-white{background-color:#fff;color:#999;} +.z-round.z-black{background-color:#000;color:#fff;} +.z-round.z-gray{background-color:#666;color:#fff;} +.z-round.z-red{background-color:#ea4a36;color:#fff;} +.z-round.z-orange{background-color:#ff6600;color:#fff;} +.z-round.z-yellow{background-color:#fac603;color:#fff;} +.z-round.z-green{background-color:#43cd6e;color:#fff;} +.z-round.z-cyan{background-color:#009899;color:#fff;} +.z-round.z-blue{background-color:#28a3ef;color:#fff;} +.z-round.z-purple{background-color:#9e70ca;color:#fff;} + +/***********************************************/ +/* 第三部分:文本、颜色和块定义 */ +/***********************************************/ + +/***********************************************/ +/* 3.1:文本通用样式定义 */ +/***********************************************/ + +/** 文本粗斜体,下划线删除线,小号上下标等 **/ +.z-bold{font-weight:bold;} +.z-italic{font-style:italic;} +.z-underline{text-decoration:underline;} +.z-delline{text-decoration:line-through;} +.z-small{font-size:80%;} +.z-sub,.z-sup{position:relative;vertical-align:baseline;line-height:0;font-size:75%;} +.z-sup{top:-0.5em;} +.z-sub{bottom:-0.25em;} +.z-mark{background:#ff0;color:#000;}/* 设置文本标记颜色为通用的黑色+黄底#ffff00 */ +.z-abbr[title]{border-bottom:1px dotted;}/* 设置缩短标签下加虚线 */ +.z-event-none{pointer-events: none;} +.z-placeholder{position:absolute;left:0;top:0;fallback:false;overflow:hidden;color:#999;font-size:14px;line-height:22px;pointer-events: none;} +.z-weight-normal{font-weight:normal;} +.z-style-normal{font-style:normal;} + +/** 文本字体大小 */ +.z-px10{font-size:10px;} +.z-px11{font-size:11px;} +.z-px12{font-size:12px;} +.z-px13{font-size:13px;} +.z-px14{font-size:14px;} +.z-px15{font-size:15px;} +.z-px16{font-size:16px;} +.z-px17{font-size:17px;} +.z-px18{font-size:18px;} +.z-px19{font-size:19px;} +.z-px20{font-size:20px;} +.z-px22{font-size:22px;} +.z-px24{font-size:24px;} +.z-px26{font-size:26px;} +.z-px30{font-size:30px;} +.z-px40{font-size:40px;} +.z-px50{font-size:50px;} + +.zi-px10{font-size:10px !important;} +.zi-px11{font-size:11px !important;} +.zi-px12{font-size:12px !important;} +.zi-px13{font-size:13px !important;} +.zi-px14{font-size:14px !important;} +.zi-px15{font-size:15px !important;} +.zi-px16{font-size:16px !important;} +.zi-px17{font-size:17px !important;} +.zi-px18{font-size:18px !important;} +.zi-px19{font-size:19px !important;} +.zi-px20{font-size:20px !important;} +.zi-px22{font-size:22px !important;} +.zi-px24{font-size:24px !important;} +.zi-px26{font-size:26px !important;} +.zi-px30{font-size:30px !important;} +.zi-px40{font-size:40px !important;} +.zi-px50{font-size:50px !important;} + +/** 文本排列方式 */ +.z-text-left{text-align:left;} +.z-text-right{text-align:right;} +.z-text-center{text-align:center;} +.z-text-top{vertical-align:top;} +.z-text-middle{vertical-align:middle;} +.z-text-bottom{vertical-align:bottom;} + +.zi-text-left{text-align:left !important;} +.zi-text-right{text-align:right !important;} +.zi-text-center{text-align:center !important;} +.zi-text-top{vertical-align:top !important;} +.zi-text-middle{vertical-align:middle !important;} +.zi-text-bottom{vertical-align:bottom !important;} + +/** 文本换行、不换行,省略和隐藏 */ +.z-text-break{word-break:break-all; word-wrap:break-word;} +.z-text-pre{white-space:pre;} +.z-text-prewrap{white-space:pre-wrap;} +.z-text-preline{white-space:pre-line;} +.z-text-nowrap{white-space:nowrap;} +.z-text-ellipsis{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:inline-block;} +.z-text-clip{text-overflow:clip;overflow:hidden;white-space:nowrap;display:inline-block;} +.z-text-hide{display:none;font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;} + +/** 设置代码字体为linux默认字体,风格等 */ +.z-code,.z-kbd,.z-pre,.z-samp{font-family:Consolas,"Courier New",monospace,Menlo,Monaco,"微软雅黑";font-size:1em;} +.z-code,.z-kbd,.z-pre{border-radius:4px;display:block;} +.z-code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;line-height:1.42857143;} +.z-kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333; + -webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.25); + box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.z-kbd .z-kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none;} +.z-pre{overflow:auto;display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;} +.z-pre .z-code{padding:0;font-size:inherit;color:#c7254e;white-space:pre-wrap;background-color:transparent;border-radius:0;} + +.zi-code,.zi-kbd,.zi-pre,.zi-samp{font-family:Consolas,"Courier New",monospace,Menlo,Monaco,"微软雅黑" !important;} + +.z-user-select-none{ + -webkit-user-select:none; + -moz-user-select:none; + -ms-user-select:none; + -o-user-select:none; + user-select:none; +} + +/***********************************************/ +/* 3.2:颜色通用样式定义 */ +/***********************************************/ + +/** 标准颜色定义 */ +.z-color-white{color:white;} +.z-color-black{color:black;} +.z-color-gray{color:gray;} +.z-color-red{color:red;} +.z-color-orange{color:orange;} +.z-color-yellow{color:yellow;} +.z-color-green{color:green;} +.z-color-cyan{color:cyan;} +.z-color-blue{color:blue;} +.z-color-purple{color:purple;} +.z-color-333{color:#333;} +.z-color-666{color:#666;} +.z-color-999{color:#999;} +.z-color-ccc{color:#ccc;} + +.zi-color-white{color:white !important;} +.zi-color-black{color:black !important;} +.zi-color-gray{color:gray !important;} +.zi-color-red{color:red !important;} +.zi-color-orange{color:orange !important;} +.zi-color-yellow{color:yellow !important;} +.zi-color-green{color:green !important;} +.zi-color-cyan{color:cyan !important;} +.zi-color-blue{color:blue !important;} +.zi-color-purple{color:purple !important;} +.zi-color-333{color:#333 !important;} +.zi-color-666{color:#666 !important;} +.zi-color-999{color:#999 !important;} +.zi-color-ccc{color:#ccc !important;} + +/** 文本颜色定义 **/ +.z-text-black{color:#333;} +.z-text-white{color:#fffff0;} +.z-text-gray{color:#ccc;} +.z-text-red{color:#e8351f;} +.z-text-orange{color:#fe4615;} +.z-text-yellow{color:#ffd700;} +.z-text-green{color:#006400;} +.z-text-cyan{color:#008b8b;} +.z-text-blue{color:#0066cc;} +.z-text-purple{color:#ba55d3;} + +.zi-text-black{color:#333 !important;} +.zi-text-white{color:#fffff0 !important;} +.zi-text-gray{color:#ccc !important;} +.zi-text-red{color:#e8351f !important;} +.zi-text-orange{color:#fe4615 !important;} +.zi-text-yellow{color:#ffd700 !important;} +.zi-text-green{color:#006400 !important;} +.zi-text-cyan{color:#008b8b !important;} +.zi-text-blue{color:#0066cc !important;} +.zi-text-purple{color:#ba55d3 !important;} + +/** 背景颜色定义 **/ +.z-bg-333{background-color:#333;} +.z-bg-666{background-color:#666;} +.z-bg-999{background-color:#999;} +.z-bg-ccc{background-color:#ccc;} + +.z-bg-black{background-color:#000;} +.z-bg-white{background-color:#fff;} +.z-bg-gray{background-color:#f5f5f5;} +.z-bg-red{background-color:#ffe4e1;} +.z-bg-orange{background-color:#f5deb3;} +.z-bg-yellow{background-color:#ffe;} +.z-bg-green{background-color:#f0fff0;} +.z-bg-cyan{background-color:#e1ffff;} +.z-bg-blue{background-color:#f0f8ff;} +.z-bg-purple{background-color:#e6e6fa;} + +.z-bg-none{background:none;} + +.zi-bg-black{background-color:#000 !important;} +.zi-bg-white{background-color:#fff !important;} +.zi-bg-gray{background-color:#f5f5f5 !important;} +.zi-bg-red{background-color:#ffe4e1 !important;} +.zi-bg-orange{background-color:#f5deb3 !important;} +.zi-bg-yellow{background-color:#ffe !important;} +.zi-bg-green{background-color:#f0fff0 !important;} +.zi-bg-cyan{background-color:#e1ffff !important;} +.zi-bg-blue{background-color:#f0f8ff !important;} +.zi-bg-purple{background-color:#e6e6fa !important;} + +.z-bg-gray-deep{background-color:#d3d3d3;} +.z-bg-red-deep{background-color:#ea4a36;} +.z-bg-orange-deep{background-color:#ff6600;} +.z-bg-yellow-deep{background-color:#fac603;} +.z-bg-green-deep{background-color:#43cd6e;} +.z-bg-cyan-deep{background-color:#009899;} +.z-bg-blue-deep{background-color:#2a689d;} +.z-bg-purple-deep{background-color:#9e70ca;} + +.zi-bg-gray-deep{background-color:#d3d3d3 !important;} +.zi-bg-red-deep{background-color:#ea4a36 !important;} +.zi-bg-orange-deep{background-color:#ff6600 !important;} +.zi-bg-yellow-deep{background-color:#fac603 !important;} +.zi-bg-green-deep{background-color:#43cd6e !important;} +.zi-bg-cyan-deep{background-color:#009899 !important;} +.zi-bg-blue-deep{background-color:#2a689d !important;} +.zi-bg-purple-deep{background-color:#9e70ca !important;} + +.zi-bg-none{background:none !important;} + +/** 边框颜色定义 **/ +.z-bd{border:1px solid #d3d3d3;} +.z-bd-t{border-top:1px solid #d3d3d3;} +.z-bd-l{border-left:1px solid #d3d3d3;} +.z-bd-r{border-right:1px solid #d3d3d3;} +.z-bd-b{border-bottom:1px solid #d3d3d3;} +.z-bd.z-red{border:1px solid #ea4a36;} +.z-bd-t.z-red{border-top:1px solid #ea4a36;} +.z-bd-l.z-red{border-left:1px solid #ea4a36;} +.z-bd-r.z-red{border-right:1px solid #ea4a36;} +.z-bd-b.z-red{border-bottom:1px solid #ea4a36;} +.z-bd.z-orange{border:1px solid #ff6600;} +.z-bd-t.z-orange{border-top:1px solid #ff6600;} +.z-bd-l.z-orange{border-left:1px solid #ff6600;} +.z-bd-r.z-orange{border-right:1px solid #ff6600;} +.z-bd-b.z-orange{border-bottom:1px solid #ff6600;} +.z-bd.z-yellow{border:1px solid #fac603;} +.z-bd-t.z-yellow{border-top:1px solid #fac603;} +.z-bd-l.z-yellow{border-left:1px solid #fac603;} +.z-bd-r.z-yellow{border-right:1px solid #fac603;} +.z-bd-b.z-yellow{border-bottom:1px solid #fac603;} +.z-bd.z-green{border:1px solid #43cd6e;} +.z-bd-t.z-green{border-top:1px solid #43cd6e;} +.z-bd-l.z-green{border-left:1px solid #43cd6e;} +.z-bd-r.z-green{border-right:1px solid #43cd6e;} +.z-bd-b.z-green{border-bottom:1px solid #43cd6e;} +.z-bd.z-cyan{border:1px solid #009899;} +.z-bd-t.z-cyan{border-top:1px solid #009899;} +.z-bd-l.z-cyan{border-left:1px solid #009899;} +.z-bd-r.z-cyan{border-right:1px solid #009899;} +.z-bd-b.z-cyan{border-bottom:1px solid #009899;} +.z-bd.z-blue{border:1px solid #2a689d;} +.z-bd-t.z-blue{border-top:1px solid #2a689d;} +.z-bd-l.z-blue{border-left:1px solid #2a689d;} +.z-bd-r.z-blue{border-right:1px solid #2a689d;} +.z-bd-b.z-blue{border-bottom:1px solid #2a689d;} +.z-bd.z-purple{border:1px solid #9e70ca;} +.z-bd-t.z-purple{border-top:1px solid #9e70ca;} +.z-bd-l.z-purple{border-left:1px solid #9e70ca;} +.z-bd-r.z-purple{border-right:1px solid #9e70ca;} +.z-bd-b.z-purple{border-bottom:1px solid #9e70ca;} + +/** 边框圆角定义 **/ +.z-bd-rd0{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.z-bd-rd1{-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;} +.z-bd-rd2{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;} +.z-bd-rd3{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.z-bd-rd5{-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.z-bd-rd8{-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;} +.z-bd-rd10{-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;} +.z-bd-rd50p{-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;} +.z-bd-rd-circle{-webkit-border-radius:1000px;-moz-border-radius:1000px;border-radius:1000px;} + +.z-bd-rd-tl3{-webkit-border-top-left-radius:3px;-moz-border-top-left-radius:3px;border-top-left-radius:3px;} +.z-bd-rd-tl5{-webkit-border-top-left-radius:5px;-moz-border-top-left-radius:5px;border-top-left-radius:5px;} +.z-bd-rd-tl8{-webkit-border-top-left-radius:8px;-moz-border-top-left-radius:8px;border-top-left-radius:8px;} +.z-bd-rd-tl10{-webkit-border-top-left-radius:10px;-moz-border-top-left-radius:10px;border-top-left-radius:10px;} + +.z-bd-rd-tr3{-webkit-border-top-right-radius:3px;-moz-border-top-right-radius:3px;border-top-right-radius:3px;} +.z-bd-rd-tr5{-webkit-border-top-right-radius:5px;-moz-border-top-right-radius:5px;border-top-right-radius:5px;} +.z-bd-rd-tr8{-webkit-border-top-right-radius:8px;-moz-border-top-right-radius:8px;border-top-right-radius:8px;} +.z-bd-rd-tr10{-webkit-border-top-right-radius:10px;-moz-border-top-right-radius:10px;border-top-right-radius:10px;} + +.z-bd-rd-bl3{-webkit-border-bottom-left-radius:3px;-moz-border-bottom-left-radius:3px;border-bottom-left-radius:3px;} +.z-bd-rd-bl5{-webkit-border-bottom-left-radius:5px;-moz-border-bottom-left-radius:5px;border-bottom-left-radius:5px;} +.z-bd-rd-bl8{-webkit-border-bottom-left-radius:8px;-moz-border-bottom-left-radius:8px;border-bottom-left-radius:8px;} +.z-bd-rd-bl10{-webkit-border-bottom-left-radius:10px;-moz-border-bottom-left-radius:10px;border-bottom-left-radius:10px;} + +.z-bd-rd-br3{-webkit-border-bottom-right-radius:3px;-moz-border-bottom-right-radius:3px;border-bottom-right-radius:3px;} +.z-bd-rd-br5{-webkit-border-bottom-right-radius:5px;-moz-border-bottom-right-radius:5px;border-bottom-right-radius:5px;} +.z-bd-rd-br8{-webkit-border-bottom-right-radius:8px;-moz-border-bottom-right-radius:8px;border-bottom-right-radius:8px;} +.z-bd-rd-br10{-webkit-border-bottom-right-radius:10px;-moz-border-bottom-right-radius:10px;border-bottom-right-radius:10px;} + +.z-bd-rd-l3{ + -webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px; + -moz-border-top-left-radius:3px;-moz-border-bottom-left-radius:3px;border-bottom-left-radius:3px; +} +.z-bd-rd-l5{ + -webkit-border-top-left-radius:5px;-webkit-border-bottom-left-radius:5px;border-bottom-left-radius:5px; + -moz-border-top-left-radius:5px;-moz-border-bottom-left-radius:5px;bottom-left-radius:5px; +} +.z-bd-rd-l8{ + -webkit-border-top-left-radius:8px;-webkit-border-bottom-left-radius:8px;border-bottom-left-radius:8px; + -moz-border-top-left-radius:8px;-moz-border-bottom-left-radius:8px;bottom-left-radius:8px; +} +.z-bd-rd-l10{ + -webkit-border-top-left-radius:10px;-webkit-border-bottom-left-radius:10px;border-bottom-left-radius:10px; + -moz-border-top-left-radius:10px;-moz-border-bottom-left-radius:10px;bottom-left-radius:10px; +} +.z-bd-rd-l-circle{ + -webkit-border-top-left-radius:1000px;-webkit-border-bottom-left-radius:1000px;border-bottom-left-radius:1000px; + -moz-border-top-left-radius:1000px;-moz-border-bottom-left-radius:1000px;bottom-left-radius:1000px; +} + +.z-bd-rd-r3{ + -webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;bottom-right-radius:3px; + -moz-border-top-right-radius:3px;-moz-border-bottom-right-radius:3px;bottom-right-radius:3px; +} +.z-bd-rd-r5{ + -webkit-border-top-right-radius:5px;-webkit-border-bottom-right-radius:5px;border-bottom-right-radius:5px; + -moz-border-top-right-radius:5px;-moz-border-bottom-right-radius:5px;bottom-right-radius:5px; +} +.z-bd-rd-r8{ + -webkit-border-top-right-radius:8px;-webkit-border-bottom-right-radius:8px;border-bottom-right-radius:8px; + -moz-border-top-right-radius:8px;-moz-border-bottom-right-radius:8px;bottom-right-radius:8px; +} +.z-bd-rd-r10{ + -webkit-border-top-right-radius:10px;-webkit-border-bottom-right-radius:10px;border-bottom-right-radius:10px; + -moz-border-top-right-radius:10px;-moz-border-bottom-right-radius:10px;border-bottom-right-radius:10px; +} +.z-bd-rd-r-circle{ + -webkit-border-top-right-radius:1000px;-webkit-border-bottom-right-radius:1000px;border-bottom-right-radius:1000px; + -moz-border-top-right-radius:1000px;-moz-border-bottom-right-radius:1000px;border-bottom-right-radius:1000px; +} + +.z-bd-rd-t3{ + -webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px; + -moz-border-top-left-radius:3px;-moz-border-top-right-radius:3px;border-top-right-radius:3px; +} +.z-bd-rd-t5{ + -webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;border-top-right-radius:5px; + -moz-border-top-left-radius:5px;-moz-border-top-right-radius:5px;border-top-right-radius:5px; +} +.z-bd-rd-t8{ + -webkit-border-top-left-radius:8px;-webkit-border-top-right-radius:8px;border-top-right-radius:8px; + -moz-border-top-left-radius:8px;-moz-border-top-right-radius:8px;border-top-right-radius:8px; +} +.z-bd-rd-t10{ + -webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:10px;border-top-right-radius:10px; + -moz-border-top-left-radius:10px;-moz-border-top-right-radius:10px;border-top-right-radius:10px; +} +.z-bd-rd-t-circle{ + -webkit-border-top-left-radius:1000px;-webkit-border-top-right-radius:1000px;border-top-right-radius:1000px; + -moz-border-top-left-radius:1000px;-moz-border-top-right-radius:1000px;border-top-right-radius:1000px; +} + +.z-bd-rd-b3{ + -webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px; + -moz-border-bottom-left-radius:3px;-moz-border-bottom-right-radius:3px;border-bottom-right-radius:3px; +} +.z-bd-rd-b5{ + -webkit-border-bottom-left-radius:5px;-webkit-border-bottom-right-radius:5px;border-bottom-right-radius:5px; + -moz-border-bottom-left-radius:5px;-moz-border-bottom-right-radius:5px;border-bottom-right-radius:5px; +} +.z-bd-rd-b8{ + -webkit-border-bottom-left-radius:8px;-webkit-border-bottom-right-radius:8px;border-bottom-right-radius:8px; + -moz-border-bottom-left-radius:8px;-moz-border-bottom-right-radius:8px;bottom-right-radius:8px; +} +.z-bd-rd-b10{ + -webkit-border-bottom-left-radius:10px;-webkit-border-bottom-right-radius:10px;border-bottom-right-radius:10px; + -moz-border-bottom-left-radius:10px;-moz-border-bottom-right-radius:10px;border-bottom-right-radius:10px; +} +.z-bd-rd-b-circle{ + -webkit-border-bottom-left-radius:1000px;-webkit-border-bottom-right-radius:1000px;border-bottom-right-radius:1000px; + -moz-border-bottom-left-radius:1000px;-moz-border-bottom-right-radius:1000px;border-bottom-right-radius:1000px; +} + +.z-bd-none{border:none;} +.z-bd-t-none{border-top:none;} +.z-bd-b-none{border-bottom:none;} +.z-bd-l-none{border-left:none;} +.z-bd-r-none{border-right:none;} + +.zi-bd{border:1px solid #d3d3d3 !important;} +.zi-bd-t{border-top:1px solid #d3d3d3 !important;} +.zi-bd-l{border-left:1px solid #d3d3d3 !important;} +.zi-bd-r{border-right:1px solid #d3d3d3 !important;} +.zi-bd-b{border-bottom:1px solid #d3d3d3 !important;} +.zi-bd.z-red{border:1px solid #ea4a36 !important;} +.zi-bd-t.z-red{border-top:1px solid #ea4a36 !important;} +.zi-bd-l.z-red{border-left:1px solid #ea4a36 !important;} +.zi-bd-r.z-red{border-right:1px solid #ea4a36 !important;} +.zi-bd-b.z-red{border-bottom:1px solid #ea4a36 !important;} +.zi-bd.z-orange{border:1px solid #ff6600 !important;} +.zi-bd-t.z-orange{border-top:1px solid #ff6600 !important;} +.zi-bd-l.z-orange{border-left:1px solid #ff6600 !important;} +.zi-bd-r.z-orange{border-right:1px solid #ff6600 !important;} +.zi-bd-b.z-orange{border-bottom:1px solid #ff6600 !important;} +.zi-bd.z-yellow{border:1px solid #fac603 !important;} +.zi-bd-t.z-yellow{border-top:1px solid #fac603 !important;} +.zi-bd-l.z-yellow{border-left:1px solid #fac603 !important;} +.zi-bd-r.z-yellow{border-right:1px solid #fac603 !important;} +.zi-bd-b.z-yellow{border-bottom:1px solid #fac603 !important;} +.zi-bd.z-green{border:1px solid #43cd6e !important;} +.zi-bd-t.z-green{border-top:1px solid #43cd6e !important;} +.zi-bd-l.z-green{border-left:1px solid #43cd6e !important;} +.zi-bd-r.z-green{border-right:1px solid #43cd6e !important;} +.zi-bd-b.z-green{border-bottom:1px solid #43cd6e !important;} +.zi-bd.z-cyan{border:1px solid #009899 !important;} +.zi-bd-t.z-cyan{border-top:1px solid #009899 !important;} +.zi-bd-l.z-cyan{border-left:1px solid #009899 !important;} +.zi-bd-r.z-cyan{border-right:1px solid #009899 !important;} +.zi-bd-b.z-cyan{border-bottom:1px solid #009899 !important;} +.zi-bd.z-blue{border:1px solid #2a689d !important;} +.zi-bd-t.z-blue{border-top:1px solid #2a689d !important;} +.zi-bd-l.z-blue{border-left:1px solid #2a689d !important;} +.zi-bd-r.z-blue{border-right:1px solid #2a689d !important;} +.zi-bd-b.z-blue{border-bottom:1px solid #2a689d !important;} +.zi-bd.z-purple{border:1px solid #9e70ca !important;} +.zi-bd-t.z-purple{border-top:1px solid #9e70ca !important;} +.zi-bd-l.z-purple{border-left:1px solid #9e70ca !important;} +.zi-bd-r.z-purple{border-right:1px solid #9e70ca !important;} +.zi-bd-b.z-purple{border-bottom:1px solid #9e70ca !important;} + +.zi-bd-rd0{-webkit-border-radius:0 !important;-moz-border-radius:0 !important;border-radius:0 !important;} +.zi-bd-rd1{-webkit-border-radius:1px !important;-moz-border-radius:1px !important;border-radius:1px !important;} +.zi-bd-rd2{-webkit-border-radius:2px !important;-moz-border-radius:2px !important;border-radius:2px !important;} +.zi-bd-rd3{-webkit-border-radius:3px !important;-moz-border-radius:3px !important;border-radius:3px !important;} +.zi-bd-rd5{-webkit-border-radius:5px !important;-moz-border-radius:5px !important;border-radius:5px !important;} +.zi-bd-rd8{-webkit-border-radius:8px !important;-moz-border-radius:8px !important;border-radius:8px !important;} +.zi-bd-rd10{-webkit-border-radius:10px !important;-moz-border-radius:10px !important;border-radius:10px !important;} +.zi-bd-rd50p{-webkit-border-radius:50% !important;-moz-border-radius:50% !important;border-radius:50% !important;} +.zi-bd-rd-circle{-webkit-border-radius:1000px !important;-moz-border-radius:1000px !important;border-radius:1000px !important;} + +.zi-bd-rd-tl3{-webkit-border-top-left-radius:3px !important;-moz-border-top-left-radius:3px !important;border-top-left-radius:3px !important;} +.zi-bd-rd-tl5{-webkit-border-top-left-radius:5px !important;-moz-border-top-left-radius:5px !important;border-top-left-radius:5px !important;} +.zi-bd-rd-tl8{-webkit-border-top-left-radius:8px !important;-moz-border-top-left-radius:8px !important;border-top-left-radius:8px !important;} +.zi-bd-rd-tl10{-webkit-border-top-left-radius:10px !important;-moz-border-top-left-radius:10px !important;border-top-left-radius:10px !important;} + +.zi-bd-rd-tr3{-webkit-border-top-right-radius:3px !important;-moz-border-top-right-radius:3px !important;border-top-right-radius:3px !important;} +.zi-bd-rd-tr5{-webkit-border-top-right-radius:5px !important;-moz-border-top-right-radius:5px !important;border-top-right-radius:5px !important;} +.zi-bd-rd-tr8{-webkit-border-top-right-radius:8px !important;-moz-border-top-right-radius:8px !important;border-top-right-radius:8px !important;} +.zi-bd-rd-tr10{-webkit-border-top-right-radius:10px !important;-moz-border-top-right-radius:10px !important;border-top-right-radius:10px !important;} + +.zi-bd-rd-bl3{-webkit-border-bottom-left-radius:3px !important;-moz-border-bottom-left-radius:3px !important;border-bottom-left-radius:3px !important;} +.zi-bd-rd-bl5{-webkit-border-bottom-left-radius:5px !important;-moz-border-bottom-left-radius:5px !important;border-bottom-left-radius:5px !important;} +.zi-bd-rd-bl8{-webkit-border-bottom-left-radius:8px !important;-moz-border-bottom-left-radius:8px !important;border-bottom-left-radius:8px !important;} +.zi-bd-rd-bl10{-webkit-border-bottom-left-radius:10px !important;-moz-border-bottom-left-radius:10px !important;border-bottom-left-radius:10px !important;} + +.zi-bd-rd-br3{-webkit-border-bottom-right-radius:3px !important;-moz-border-bottom-right-radius:3px !important;border-bottom-right-radius:3px !important;} +.zi-bd-rd-br5{-webkit-border-bottom-right-radius:5px !important;-moz-border-bottom-right-radius:5px !important;border-bottom-right-radius:5px !important;} +.zi-bd-rd-br8{-webkit-border-bottom-right-radius:8px !important;-moz-border-bottom-right-radius:8px !important;border-bottom-right-radius:8px !important;} +.zi-bd-rd-br10{-webkit-border-bottom-right-radius:10px !important;-moz-border-bottom-right-radius:10px !important;border-bottom-right-radius:10px !important;} + +.zi-bd-rd-l3{ + -webkit-border-top-left-radius:3px !important;-webkit-border-bottom-left-radius:3px !important;border-bottom-left-radius:3px !important; + -moz-border-top-left-radius:3px !important;-moz-border-bottom-left-radius:3px !important;border-bottom-left-radius:3px !important; +} +.zi-bd-rd-l5{ + -webkit-border-top-left-radius:5px !important;-webkit-border-bottom-left-radius:5px !important;border-bottom-left-radius:5px !important; + -moz-border-top-left-radius:5px !important;-moz-border-bottom-left-radius:5px !important;border-bottom-left-radius:5px !important; +} +.zi-bd-rd-l8{ + -webkit-border-top-left-radius:8px !important;-webkit-border-bottom-left-radius:8px !important;border-bottom-left-radius:8px !important; + -moz-border-top-left-radius:8px !important;-moz-border-bottom-left-radius:8px !important;border-bottom-left-radius:8px !important; +} +.zi-bd-rd-l10{ + -webkit-border-top-left-radius:10px !important;-webkit-border-bottom-left-radius:10px !important;border-bottom-left-radius:10px !important; + -moz-border-top-left-radius:10px !important;-moz-border-bottom-left-radius:10px !important;border-bottom-left-radius:10px !important; +} +.zi-bd-rd-l-circle{ + -webkit-border-top-left-radius:1000px !important;-webkit-border-bottom-left-radius:1000px !important;border-bottom-left-radius:1000px !important; + -moz-border-top-left-radius:1000px !important;-moz-border-bottom-left-radius:1000px !important;border-bottom-left-radius:1000px !important; +} + +.zi-bd-rd-r3{ + -webkit-border-top-right-radius:3px !important;-webkit-border-bottom-right-radius:3px !important;border-bottom-right-radius:3px !important; + -moz-border-top-right-radius:3px !important;-moz-border-bottom-right-radius:3px !important;border-bottom-right-radius:3px !important; +} +.zi-bd-rd-r5{ + -webkit-border-top-right-radius:5px !important;-webkit-border-bottom-right-radius:5px !important;border-bottom-right-radius:5px !important; + -moz-border-top-right-radius:5px !important;-moz-border-bottom-right-radius:5px !important;border-bottom-right-radius:5px !important; +} +.zi-bd-rd-r8{ + -webkit-border-top-right-radius:8px !important;-webkit-border-bottom-right-radius:8px !important;border-bottom-right-radius:8px !important; + -moz-border-top-right-radius:8px !important;-moz-border-bottom-right-radius:8px !important;border-bottom-right-radius:8px !important; +} +.zi-bd-rd-r10{ + -webkit-border-top-right-radius:10px !important;-webkit-border-bottom-right-radius:10px !important;border-bottom-right-radius:10px !important; + -moz-border-top-right-radius:10px !important;-moz-border-bottom-right-radius:10px !important;border-bottom-right-radius:10px !important; +} +.zi-bd-rd-r-circle{ + -webkit-border-top-right-radius:1000px !important;-webkit-border-bottom-right-radius:1000px !important;border-bottom-right-radius:1000px !important; + -moz-border-top-right-radius:1000px !important;-moz-border-bottom-right-radius:1000px !important;border-bottom-right-radius:1000px !important; +} + +.zi-bd-rd-t3{ + -webkit-border-top-left-radius:3px !important;-webkit-border-top-right-radius:3px !important;border-top-right-radius:3px !important; + -moz-border-top-left-radius:3px !important;-moz-border-top-right-radius:3px !important;border-top-right-radius:3px !important; +} +.zi-bd-rd-t5{ + -webkit-border-top-left-radius:5px !important;-webkit-border-top-right-radius:5px !important;border-top-right-radius:5px !important; + -moz-border-top-left-radius:5px !important;-moz-border-top-right-radius:5px !important;border-top-right-radius:5px !important; +} +.zi-bd-rd-t8{ + -webkit-border-top-left-radius:8px !important;-webkit-border-top-right-radius:8px !important;border-top-right-radius:8px !important; + -moz-border-top-left-radius:8px !important;-moz-border-top-right-radius:8px !important;border-top-right-radius:8px !important; +} +.zi-bd-rd-t10{ + -webkit-border-top-left-radius:10px !important;-webkit-border-top-right-radius:10px !important;border-top-right-radius:10px !important; + -moz-border-top-left-radius:10px !important;-moz-border-top-right-radius:10px !important;border-top-right-radius:10px !important; +} +.zi-bd-rd-t-circle{ + -webkit-border-top-left-radius:1000px !important;-webkit-border-top-right-radius:1000px !important;border-top-right-radius:1000px !important; + -moz-border-top-left-radius:1000px !important;-moz-border-top-right-radius:1000px !important;border-top-right-radius:1000px !important; +} + +.zi-bd-rd-b3{ + -webkit-border-bottom-left-radius:3px !important;-webkit-border-bottom-right-radius:3px !important;border-bottom-right-radius:3px !important; + -moz-border-bottom-left-radius:3px !important;-moz-border-bottom-right-radius:3px !important;border-bottom-right-radius:3px !important; +} +.zi-bd-rd-b5{ + -webkit-border-bottom-left-radius:5px !important;-webkit-border-bottom-right-radius:5px !important;border-bottom-right-radius:5px !important; + -moz-border-bottom-left-radius:5px !important;-moz-border-bottom-right-radius:5px !important;border-bottom-right-radius:5px !important; +} +.zi-bd-rd-b8{ + -webkit-border-bottom-left-radius:8px !important;-webkit-border-bottom-right-radius:8px !important;border-bottom-right-radius:8px !important; + -moz-border-bottom-left-radius:8px !important;-moz-border-bottom-right-radius:8px !important;border-bottom-right-radius:8px !important; +} +.zi-bd-rd-b10{ + -webkit-border-bottom-left-radius:10px !important;-webkit-border-bottom-right-radius:10px !important;border-bottom-right-radius:10px !important; + -moz-border-bottom-left-radius:10px !important;-moz-border-bottom-right-radius:10px !important;border-bottom-right-radius:10px !important; +} +.zi-bd-rd-b-circle{ + -webkit-border-bottom-left-radius:1000px !important;-webkit-border-bottom-right-radius:1000px !important;border-bottom-right-radius:1000px !important; + -moz-border-bottom-left-radius:1000px !important;-moz-border-bottom-right-radius:1000px !important;border-bottom-right-radius:1000px !important; +} + +.zi-bd-none{border:none !important;} +.zi-bd-t-none{border-top:none !important;} +.zi-bd-b-none{border-bottom:none !important;} +.zi-bd-l-none{border-left:none !important;} +.zi-bd-r-none{border-right:none !important;} + +/***********************************************/ +/* 3.3:块状态通用样式定义 */ +/***********************************************/ + +/** 清除浮动层 **/ +.z-clearfix:{*zoom:1;} +.z-clearfix:before,.z-clearfix:after {content:"";display:table;} +.z-clearfix:after{clear:both;} + +/** 清除阴影效果 **/ +.z-shadow-none{box-shadow:none;} +.zi-shadow-none{box-shadow:none !important;} + +/** 块状态 **/ +.z-hide{display:none;} +.z-show{display:inline;} +.z-show-b{display:block;} +.z-show-ib{display:inline-block;} + +.zi-hide{display:none !important;} +.zi-show{display:inline !important;} +.zi-show-b{display:block !important;} +.zi-show-ib{display:inline-block !important;} + +/** 保留占位的显示和隐藏 **/ +.z-visible{visibility:visible;} +.z-hidden{visibility:hidden;} +.z-hidden-fixed{position:fixed;top:0;left:0;width:1px;height:1px;background:transparent !important;border:none !important;box-shadow:none !important;} + +.zi-visible{visibility:visible !important;} +.zi-hidden{visibility:hidden !important;} + +/** 块对齐 **/ +.z-float-left{float:left;} +.z-float-right{float:right;} +.z-float-center{margin-left:auto;margin-right:auto;} + +.zi-float-left{float:left !important;} +.zi-float-right{float:right !important;} +.zi-float-center{margin-left:auto !important;margin-right:auto !important;} + +/** 块定位 **/ +.z-fixed{position:fixed;} +.z-absolute{position:absolute;} +.z-relative{position:relative;} +.z-relative-left{position:relative;float:left;} +.z-relative-right{position:relative;float:right;} +.z-relative-center{position:relative;margin-left:auto;margin-right:auto;} + +.z-fixed-tl0{position:fixed;top:0;left:0;} +.z-absolute-tl0{position:absolute;top:0;left:0;} +.z-absolute-center-middle{position:absolute;margin:auto;top:0;bottom:0;left:0;right:0;} + +.zi-fixed{position:fixed !important;} +.zi-absolute{position:absolute !important;} +.zi-relative{position:relative !important;} +.zi-relative-left{position:relative !important;float:left !important;} +.zi-relative-right{position:relative !important;float:right !important;} +.zi-relative-center{position:relative !important;margin-left:auto !important;margin-right:auto !important;} +.zi-absolute-center-middle{position:absolute !important;margin:auto !important;top:0 !important;bottom:0 !important;left:0 !important;right:0 !important;} + +.z-t0{top:0;}.z-b0{bottom:0;}.z-l0{left:0;}.z-r0{right:0;} + +/** 块溢出的三种情况 **/ +.z-overflow-scroll{overflow:scroll;} +.z-overflow-hidden{overflow:hidden;} +.z-overflow-auto{overflow:auto;} +.z-overflow-x-scroll{overflow-x:scroll;} +.z-overflow-x-hidden{overflow-x:hidden;} +.z-overflow-x-auto{overflow-x:auto;} +.z-overflow-y-scroll{overflow-y:scroll;} +.z-overflow-y-hidden{overflow-y:hidden;} +.z-overflow-y-auto{overflow-y:auto;} + +.zi-overflow-hidden{overflow:hidden !important;} +.zi-overflow-x-hidden{overflow-x:hidden !important;} +.zi-overflow-y-hidden{overflow-y:hidden !important;} + +/** 块鼠标和输入法样式 **/ +.z-pointer{cursor:pointer;} +.z-forbidden{cursor:not-allowed;} +.z-ime-disabled{ime-mode: disabled;} +.zi-pointer{cursor:pointer !important;} +.zi-forbidden{cursor:not-allowed !important;} +.zi-ime-disabled{ime-mode: disabled !important;} + +/*********************************************************/ +/*********************************************************/ +/***************** Ⅱ:WWW 定义 ******************/ +/*********************************************************/ +/*********************************************************/ + + +/***********************************************/ +/* 第一部分:标准标记定义 */ +/***********************************************/ + +/***********************************************/ +/* 1.2:全局标记一致性定义 */ +/***********************************************/ + +body,table,td,div{font-size:12px;line-height:120%;} + +a:focus{color:#06c;outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} + +/***********************************************/ +/* 1.4:文本标记一致性定义 */ +/***********************************************/ + +/* 设置标题文字大小 颜色*/ +h1{font-size:24px;color:#333;line-height:150%;} +h2{font-size:22px;color:#333;line-height:150%;} +h3{font-size:20px;color:#333;line-height:150%;} + +/***********************************************/ +/* 第二部分:图标定义 */ +/***********************************************/ + +/***********************************************/ +/* 2.1:字体图标 */ +/***********************************************/ + +/***********************************************/ +/* 2.2:图片图标 */ +/***********************************************/ + +/** 图标,默认16px,其他尺寸在里面设置 */ +.z-ico{display:inline-block;vertical-align:middle;width:16px;height:16px;background-repeat:no-repeat;} +.z-ico.z-confirm{width:36px;height:36px;background-image:url(image/ico_36.png);background-position:0 0;} +.z-ico.z-alert{width:36px;height:36px;background-image:url(image/ico_36.png);background-position:0 -36px;} +.z-ico.z-failure{width:36px;height:36px;background-image:url(image/ico_36.png);background-position:0 -72px;} +.z-ico.z-success{width:36px;height:36px;background-image:url(image/ico_36.png);background-position:0 -108px;} +.z-ico.z-loading{width:33px;height:33px;background-image:url(image/ico_gif_loading_33.gif);} +.z-ico.z-loading.z-small{width:16px;height:16px;background-image:url(image/ico_gif_loading_16.gif);} +.z-ico.z-pen{width:12px;height:12px;background-image:url(image/ico_12.png);background-position:0 0;} +.z-ico.z-close.z-small{width:12px;height:12px;background-image:url(image/ico_12.png);background-position:0 -12px;} +.z-ico.z-close.z-small:hover{background-position:0 -24px;} + +.z-ico.z-file{width:32px;height:36px;background-image:url(image/ico_file.png);background-position:0 0;} +.z-ico.z-file.z-word{background-position:-37px 0;} +.z-ico.z-file.z-image{background-position:-74px 0;} +.z-ico.z-file.z-pdf{background-position:-111px 0;} +.z-ico.z-file.z-video{background-position:-148px 0;} +.z-ico.z-file.z-music{background-position:-185px 0;} +.z-ico.z-file.z-text{background-position:-222px 0;} +.z-ico.z-file.z-list{background-position:-259px 0;} +.z-ico.z-file.z-android{background-position:-296px 0;} +.z-ico.z-file.z-png{background-position:-333px 0;} + +/** 定义树形菜单图标 16*22px*/ +.z-ico.z-tree{background-image:url(image/ico_tree.png);} +.z-ico.z-tree.z-root{background-position:0 0;height:22px;} +.z-ico.z-tree.z-lastnode{background-position:-16px 0;height:22px;} +.z-ico.z-tree.z-mlastnode{background-position:-32px 0;height:22px;} +.z-ico.z-tree.z-mnode{background-position:-48px 0;height:22px;} +.z-ico.z-tree.z-node{background-position:-64px 0;height:22px;} +.z-ico.z-tree.z-plastnode{background-position:-80px 0;height:22px;} +.z-ico.z-tree.z-pnode{background-position:-96px 0;height:22px;} +.z-ico.z-tree.z-vertline{background-position:-112px 0;height:22px;} +.z-ico.z-tree.z-blank{background-position:-128px 0;height:22px;} + +.z-ico.z-tree.z-root.z-normal{background-position:0 -22px;} +.z-ico.z-tree.z-lastnode.z-normal{background-position:-16px -22px;} +.z-ico.z-tree.z-mlastnode.z-normal{background-position:-32px -22px;} +.z-ico.z-tree.z-mnode.z-normal{background-position:-48px -22px;} +.z-ico.z-tree.z-node.z-normal{background-position:-64px -22px;} +.z-ico.z-tree.z-plastnode.z-normal{background-position:-80px -22px;} +.z-ico.z-tree.z-pnode.z-normal{background-position:-96px -22px;} +.z-ico.z-tree.z-vertline.z-normal{background-position:-112px -22px;} + +/** 定义树形菜单图标 16*16px*/ +.z-ico.z-tree.z-item{background-position:0 -44px;} +.z-ico.z-tree.z-group{background-position:-16px -44px;} +.z-ico.z-tree.z-attribute{background-position:-32px -44px;} +.z-ico.z-tree.z-note{background-position:-48px -44px;} +.z-ico.z-tree.z-user{background-position:-64px -44px;} +.z-ico.z-tree.z-close{background-position:-80px -44px;} +.z-ico.z-tree.z-open{background-position:-96px -44px;} +.z-ico.z-tree.z-search{background-position:-112px -44px;} +.z-ico.z-tree.z-briefcase{background-position:-128px -44px;} + +.z-ico.z-tree.z-users{background-position:0 -60px;} +.z-ico.z-tree.z-pass{background-position:-16px -60px;} +.z-ico.z-tree.z-auth{background-position:-32px -60px;} +.z-ico.z-tree.z-address{background-position:-48px -60px;} +.z-ico.z-tree.z-exit{background-position:-64px -60px;} +.z-ico.z-tree.z-help{background-position:-80px -60px;} +.z-ico.z-tree.z-network{background-position:-96px -60px;} +.z-ico.z-tree.z-recycle{background-position:-112px -60px;} +.z-ico.z-tree.z-internet{background-position:-128px -60px;} + +/** 定义树形菜单图标 16*30px*/ +.z-ico.z-tree.z-30{height:30px;} +.z-ico.z-tree.z-30.z-root{background-position:0 -76px;height:30px;} +.z-ico.z-tree.z-30.z-lastnode{background-position:-16px -76px;height:30px;} +.z-ico.z-tree.z-30.z-mlastnode{background-position:-32px -76px;height:30px;} +.z-ico.z-tree.z-30.z-mnode{background-position:-48px -76px;height:30px;} +.z-ico.z-tree.z-30.z-node{background-position:-64px -76px;height:30px;} +.z-ico.z-tree.z-30.z-plastnode{background-position:-80px -76px;height:30px;} +.z-ico.z-tree.z-30.z-pnode{background-position:-96px -76px;height:30px;} +.z-ico.z-tree.z-30.z-vertline{background-position:-112px -76px;height:30px;} +.z-ico.z-tree.z-30.z-blank{background-position:-128px -76px;height:30px;} + +.z-ico.z-tree.z-30.z-root.z-normal{background-position:0 -106px;height:30px;} +.z-ico.z-tree.z-30.z-lastnode.z-normal{background-position:-16px -106px;height:30px;} +.z-ico.z-tree.z-30.z-mlastnode.z-normal{background-position:-32px -106px;height:30px;} +.z-ico.z-tree.z-30.z-mnode.z-normal{background-position:-48px -106px;height:30px;} +.z-ico.z-tree.z-30.z-node.z-normal{background-position:-64px -106px;height:30px;} +.z-ico.z-tree.z-30.z-plastnode.z-normal{background-position:-80px -106px;height:30px;} +.z-ico.z-tree.z-30.z-pnode.z-normal{background-position:-96px -106px;height:30px;} +.z-ico.z-tree.z-30.z-vertline.z-normal{background-position:-112px -106px;height:30px;} + +/** 定义充值图标 */ +.z-ico.z-pay{width:56px;height:56px;background-image:url(image/ico_pay.png);background-position:0 0;} +.z-ico.z-pay.alipay{background-position:0 0;} +.z-ico.z-pay.weixin{background-position:-61px 0;} +.z-ico.z-pay.qq{background-position:-122px 0;} +.z-ico.z-pay.chinaunion{background-position:-183px 0;} +.z-ico.z-pay.sms{background-position:0 -61px;} +.z-ico.z-pay.phone{background-position:-61px -61px;} +.z-ico.z-pay.paypal{background-position:-122px -61px;} +.z-ico.z-pay.atm{background-position:-183px -61px;} +.z-ico.z-pay.tenpay{background-position:0 -122px;} + +.z-ico.z-pay.weibo{background-position:-61px -122px;} +.z-ico.z-pay.baidu{background-position:-122px -122px;} +.z-ico.z-pay.chinamobile{background-position:-183px -122px;} +.z-ico.z-pay.unicom{background-position:0 -183px;} +.z-ico.z-pay.telecom{background-position:-61px -183px;} + +/***********************************************/ +/* 2.3:箭头定义 */ +/***********************************************/ + +/** 箭头标志,默认4像素向下 */ +.z-arrow{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;z-index:201;border:solid;border-width:4px 4px 0;border-color:#000 transparent transparent;} +.z-arrow.z-up{border-width:0 4px 4px;border-color:transparent transparent #000;} +.z-arrow.z-left{border-width:4px 4px 4px 0;border-color:transparent #000 transparent transparent;} +.z-arrow.z-right{border-width:4px 0 4px 4px;border-color:transparent transparent transparent #000;} + +.z-arrow.z-px5{border-width:5px 5px 0;} +.z-arrow.z-up.z-px5{border-width:0 5px 5px;} +.z-arrow.z-left.z-px5{border-width:5px 5px 5px 0;} +.z-arrow.z-right.z-px5{border-width:5px 0 5px 5px;} + +.z-arrow.z-px8{border-width:8px 8px 0;} +.z-arrow.z-up.z-px8{border-width:0 8px 8px;} +.z-arrow.z-left.z-px8{border-width:8px 8px 8px 0;} +.z-arrow.z-right.z-px8{border-width:8px 0 8px 8px;} + +/** 上下左右的搂空箭头 */ +.z-arrow span{position:absolute;top:-4px;left:-3px;border-style:solid;border-width:3px 3px 0;border-color:#fff transparent transparent;} +.z-arrow.z-px5 span{top:-5px;left:-4px;border-width:4px 4px 0;} +.z-arrow.z-px8 span{top:-8px;left:-7px;border-width:7px 7px 0;} + +.z-arrow.z-up span{top:1px;left:-3px;border-width:0 3px 3px;border-color:transparent transparent #fff;} +.z-arrow.z-up.z-px5 span{left:-4px;border-width:0 4px 4px;} +.z-arrow.z-up.z-px8 span{left:-7px;border-width:0 7px 7px;} + +.z-arrow.z-left span{left:1px;top:-3px;border-width:3px 3px 3px 0;border-color:transparent #fff transparent transparent;} +.z-arrow.z-left.z-px5 span{top:-4px;border-width:4px 4px 4px 0;} +.z-arrow.z-left.z-px8 span{top:-7px;border-width:7px 7px 7px 0;} + +.z-arrow.z-right span{left:-4px;top:-3px;border-width:3px 0 3px 3px;border-color:transparent transparent transparent #fff;} +.z-arrow.z-right.z-px5 span{left:-5px;top:-4px;border-width:4px 0 4px 4px;} +.z-arrow.z-right.z-px8 span{left:-8px;top:-7px;border-width:7px 0 7px 7px;} + +/** 上下左右的箭头颜色 */ +.z-arrow.z-gray{border-color:#bcbcbc transparent transparent;} +.z-arrow.z-up.z-gray{border-color:transparent transparent #bcbcbc;} +.z-arrow.z-left.z-gray{border-color:transparent #bcbcbc transparent transparent;} +.z-arrow.z-right.z-gray{border-color:transparent transparent transparent #bcbcbc;} + +/** 向上下/置顶底箭头图标 */ +.z-arrow-move{display:inline-block;width:17px;height:19px;vertical-align:middle;background-image:url(image/ico_arrow_move.png);background-repeat:no-repeat;} +.z-arrow-move.z-top{background-position:0 0;} +.z-arrow-move.z-top:hover{background-position:-17px 0;} +.z-arrow-move.z-top.z-disabled{background-position:-34px 0;} +.z-arrow-move.z-up{background-position:-51px 0;} +.z-arrow-move.z-up:hover{background-position:-68px 0;} +.z-arrow-move.z-up.z-disabled{background-position:-85px 0;} +.z-arrow-move.z-down{background-position:0 -19px;} +.z-arrow-move.z-down:hover{background-position:-17px -19px;} +.z-arrow-move.z-down.z-disabled{background-position:-34px -19px;} +.z-arrow-move.z-bottom{background-position:-51px -19px;} +.z-arrow-move.z-bottom:hover{background-position:-68px -19px;} +.z-arrow-move.z-bottom.z-disabled{background-position:-85px -19px;} + +/***********************************************/ +/* 2.4:圆圈圆角定义 */ +/***********************************************/ + + +/***********************************************/ +/* 第三部分:文本、颜色和块定义 */ +/***********************************************/ + +/***********************************************/ +/* 3.1:文本通用样式定义 */ +/***********************************************/ + +/** 文本字体大小 */ +.z-h1{font-size:24px;font-weight:bold;color:#333;line-height:150%;display:block;margin:14px 0;} +.z-h2{font-size:22px;font-weight:bold;color:#333;line-height:150%;display:block;margin:14px 0;} +.z-h3{font-size:20px;font-weight:bold;color:#333;line-height:150%;display:block;margin:14px 0;} + +/***********************************************/ +/* 3.2:颜色通用样式定义 */ +/***********************************************/ + +/** 块宽度 **/ +.z-w20{width:20px;}.z-w30{width:30px;} +.z-w40{width:40px;}.z-w50{width:50px;} +.z-w60{width:60px;}.z-w70{width:70px;} +.z-w80{width:80px;}.z-w90{width:90px;} +.z-w100{width:100px;}.z-w110{width:110px;} +.z-w120{width:120px;}.z-w130{width:130px;} +.z-w140{width:140px;}.z-w150{width:150px;} +.z-w160{width:160px;}.z-w180{width:180px;} +.z-w200{width:200px;}.z-w300{width:300px;} +.z-w400{width:400px;}.z-w500{width:500px;} +.z-w600{width:600px;}.z-w700{width:700px;} +.z-w800{width:800px;}.z-w900{width:900px;} +.z-w1000{width:1000px;}.z-w1200{width:1200px;} + +.zi-w20{width:20px !important;}.zi-w30{width:30px !important;} +.zi-w40{width:40px !important;}.zi-w50{width:50px !important;} +.zi-w60{width:60px !important;}.zi-w70{width:70px !important;} +.zi-w80{width:80px !important;}.zi-w90{width:90px !important;} +.zi-w100{width:100px !important;}.zi-w110{width:110px !important;} +.zi-w120{width:120px !important;}.zi-w130{width:130px !important;} +.zi-w140{width:140px !important;}.zi-w150{width:150px !important;} +.zi-w160{width:160px !important;}.zi-w180{width:180px !important;} +.zi-w200{width:200px !important;}.zi-w300{width:300px !important;} +.zi-w400{width:400px !important;}.zi-w500{width:500px !important;} +.zi-w600{width:600px !important;}.zi-w700{width:700px !important;} +.zi-w800{width:800px !important;}.zi-w900{width:900px !important;} +.zi-w1000{width:1000px !important;}.zi-w1200{width:1200px !important;} + +.z-w5p{width:5%;}.z-w8p{width:8%;} +.z-w10p{width:10%;}.z-w12p{width:12%;} +.z-w15p{width:15%;}.z-w30p{width:30%;} +.z-w40p{width:40%;}.z-w60p{width:60%;} +.z-w70p{width:70%;}.z-w80p{width:80%;} +.z-w90p{width:90%;}.z-w100p{width:100%;} +.z-w100p2,.z-w50p{width:50%;} +.z-w100p3{width:33.333333%;} +.z-w100p4,.z-w25p{width:25%;} +.z-w100p5,.z-w20p{width:20%;} +.z-w100p6{width:16.666666%;} +.z-w100p7{width:14.285714%;} +.z-w100p8{width:12.5%;} +.z-w100p9{width:11.111111%;} + +.zi-w5p{width:5% !important;}.zi-w8p{width:8% !important;} +.zi-w10p{width:10% !important;}.zi-w12p{width:12% !important;} +.zi-w15p{width:15% !important;}.zi-w30p{width:30% !important;} +.zi-w40p{width:40% !important;}.zi-w60p{width:60% !important;} +.zi-w70p{width:70% !important;}.zi-w80p{width:80% !important;} +.zi-w90p{width:90% !important;}.zi-w100p{width:100% !important;} +.zi-w100p2,.zi-w50p{width:50% !important;} +.zi-w100p3{width:33.333333% !important;} +.zi-w100p4,.zi-w25p{width:25% !important;} +.zi-w100p5,.zi-w20p{width:20% !important;} +.zi-w100p6{width:16.666666% !important;} +.zi-w100p7{width:14.285714% !important;} +.zi-w100p8{width:12.5% !important;} +.zi-w100p9{width:11.111111% !important;} + +.z-h0{height:0;} +.z-h12{height:12px;}.z-h14{height:14px;} +.z-h16{height:16px;}.z-h18{height:18px;} +.z-h20{height:20px;}.z-h22{height:22px;} +.z-h25{height:25px;}.z-h30{height:30px;} +.z-h35{height:35px;}.z-h40{height:40px;} +.z-h50{height:50px;}.z-h60{height:60px;} +.z-h70{height:70px;}.z-h80{height:80px;} +.z-h90{height:90px;}.z-h100{height:100px;} +.z-h110{height:110px;}.z-h120{height:120px;} +.z-h130{height:130px;}.z-h140{height:140px;} +.z-h150{height:150px;}.z-h200{height:200px;} +.z-h300{height:300px;}.z-h400{height:400px;} +.z-h500{height:500px;}.z-h600{height:600px;} +.z-h700{height:700px;}.z-h800{height:800px;} +.z-h900{height:900px;}.z-h1000{height:1000px;} +.z-h1200{height:1200px;} + +.zi-h0{height:0 !important;} +.zi-h12{height:12px !important;}.zi-h14{height:14px !important;} +.zi-h16{height:16px !important;}.zi-h18{height:18px !important;} +.zi-h20{height:20px !important;}.zi-h22{height:22px !important;} +.zi-h25{height:25px !important;}.zi-h30{height:30px !important;} +.zi-h35{height:35px !important;}.zi-h40{height:40px !important;} +.zi-h50{height:50px !important;}.zi-h60{height:60px !important;} +.zi-h70{height:70px !important;}.zi-h80{height:80px !important;} +.zi-h90{height:90px !important;}.zi-h100{height:100px !important;} +.zi-h110{height:110px !important;}.zi-h120{height:120px !important;} +.zi-h130{height:130px !important;}.zi-h140{height:140px !important;} +.zi-h150{height:150px !important;}.zi-h200{height:200px !important;} +.zi-h300{height:300px !important;}.zi-h400{height:400px !important;} +.zi-h500{height:500px !important;}.zi-h600{height:600px !important;} +.zi-h700{height:700px !important;}.zi-h800{height:800px !important;} +.zi-h900{height:900px !important;}.zi-h1000{height:1000px !important;} +.zi-h1200{height:1200px !important;} + +.z-h5p{height:5%;}.z-h8p{height:8%;} +.z-h10p{height:10%;}.z-h12p{height:12%;} +.z-h15p{height:15%;}.z-h20p{height:20%;} +.z-h30p{height:30%;}.z-h40p{height:40%;} +.z-h50p{height:50%;}.z-h60p{height:60%;} +.z-h70p{height:70%;}.z-h80p{height:80%;} +.z-h90p{height:90%;}.z-h100p{height:100%;} + +.zi-h5p{height:5% !important;}.zi-h8p{height:8% !important;} +.zi-h10p{height:10% !important;}.zi-h12p{height:12% !important;} +.zi-h15p{height:15% !important;}.zi-h20p{height:20% !important;} +.zi-h30p{height:30% !important;}.zi-h40p{height:40% !important;} +.zi-h50p{height:50% !important;}.zi-h60p{height:60% !important;} +.zi-h70p{height:70% !important;}.zi-h80p{height:80% !important;} +.zi-h90p{height:90% !important;}.zi-h100p{height:100% !important;} + +.z-lh10{line-height:10px;}.z-lh12{line-height:12px;} +.z-lh14{line-height:14px;}.z-lh15{line-height:15px;} +.z-lh16{line-height:16px;}.z-lh18{line-height:18px;} +.z-lh20{line-height:20px;}.z-lh22{line-height:22px;} +.z-lh25{line-height:25px;}.z-lh28{line-height:28px;} +.z-lh30{line-height:30px;}.z-lh35{line-height:35px;} +.z-lh40{line-height:40px;}.z-lh50{line-height:50px;} + +.zi-lh10{line-height:10px !important;}.zi-lh12{line-height:12px !important;} +.zi-lh14{line-height:14px !important;}.zi-lh15{line-height:15px !important;} +.zi-lh16{line-height:16px !important;}.zi-lh18{line-height:18px !important;} +.zi-lh20{line-height:20px !important;}.zi-lh22{line-height:22px !important;} +.zi-lh25{line-height:25px !important;}.zi-lh28{line-height:28px !important;} +.zi-lh30{line-height:30px !important;}.zi-lh35{line-height:35px !important;} +.zi-lh40{line-height:40px !important;}.zi-lh50{line-height:50px !important;} + +.z-lh100p{line-height:100%;}.z-lh110p{line-height:110%;} +.z-lh120p{line-height:120%;}.z-lh130p{line-height:130%;} +.z-lh140p{line-height:140%;}.z-lh150p{line-height:150%;} +.z-lh180p{line-height:180%;}.z-lh200p{line-height:200%;} +.z-lh250p{line-height:250%;}.z-lh300p{line-height:300%;} + +.zi-lh100p{line-height:100% !important;}.zi-lh110p{line-height:110% !important;} +.zi-lh120p{line-height:120% !important;}.zi-lh130p{line-height:130% !important;} +.zi-lh140p{line-height:140% !important;}.zi-lh150p{line-height:150% !important;} +.zi-lh180p{line-height:180% !important;}.zi-lh200p{line-height:200% !important;} +.zi-lh250p{line-height:250% !important;}.zi-lh300p{line-height:300% !important;} + +.z-pd0{padding:0;} +.z-pd3{padding:3px;}.z-pd4{padding:4px;} +.z-pd5{padding:5px;}.z-pd6{padding:6px;} +.z-pd8{padding:8px;}.z-pd10{padding:10px;} +.z-pd12{padding:12px;}.z-pd14{padding:14px;} +.z-pd15{padding:15px;}.z-pd16{padding:16px;} +.z-pd18{padding:18px;}.z-pd20{padding:20px;} + +.z-pd-l0{padding-left:0;} +.z-pd-l3{padding-left:3px;}.z-pd-l4{padding-left:4px;} +.z-pd-l5{padding-left:5px;}.z-pd-l6{padding-left:6px;} +.z-pd-l8{padding-left:8px;}.z-pd-l10{padding-left:10px;} +.z-pd-l12{padding-left:12px;}.z-pd-l14{padding-left:14px;} +.z-pd-l15{padding-left:15px;}.z-pd-l16{padding-left:16px;} +.z-pd-l18{padding-left:18px;}.z-pd-l20{padding-left:20px;} + +.z-pd-r0{padding-right:0;} +.z-pd-r3{padding-right:3px;}.z-pd-r4{padding-right:4px;} +.z-pd-r5{padding-right:6px;}.z-pd-r6{padding-right:6px;} +.z-pd-r8{padding-right:8px;}.z-pd-r10{padding-right:10px;} +.z-pd-r12{padding-right:12px;}.z-pd-r14{padding-right:14px;} +.z-pd-r15{padding-right:15px;}.z-pd-r16{padding-right:16px;} +.z-pd-r18{padding-right:18px;}.z-pd-r20{padding-right:20px;} + +.z-pd-t0{padding-top:0;} +.z-pd-t3{padding-top:3px;}.z-pd-t4{padding-top:4px;} +.z-pd-t5{padding-top:5px;}.z-pd-t6{padding-top:6px;} +.z-pd-t8{padding-top:8px;}.z-pd-t10{padding-top:10px;} +.z-pd-t12{padding-top:12px;}.z-pd-t14{padding-top:14px;} +.z-pd-t15{padding-top:15px;}.z-pd-t16{padding-top:16px;} +.z-pd-t18{padding-top:18px;}.z-pd-t20{padding-top:20px;} + +.z-pd-b0{padding-bottom:0;} +.z-pd-b3{padding-bottom:3px;}.z-pd-b4{padding-bottom:4px;} +.z-pd-b5{padding-bottom:5px;}.z-pd-b6{padding-bottom:6px;} +.z-pd-b8{padding-bottom:8px;}.z-pd-b10{padding-bottom:10px;} +.z-pd-b12{padding-bottom:12px;}.z-pd-b14{padding-bottom:14px;} +.z-pd-b15{padding-bottom:15px;}.z-pd-b16{padding-bottom:16px;} +.z-pd-b18{padding-bottom:18px;}.z-pd-b20{padding-bottom:20px;} + +.z-pd-lr0{padding-left:0;padding-right:0;} +.z-pd-lr3{padding-left:3px;padding-right:3px;}.z-pd-lr4{padding-left:4px;padding-right:4px;} +.z-pd-lr5{padding-left:5px;padding-right:5px;}.z-pd-lr6{padding-left:6px;padding-right:6px;} +.z-pd-lr8{padding-left:8px;padding-right:8px;}.z-pd-lr10{padding-left:8px;padding-right:8px;} +.z-pd-lr12{padding-left:12px;padding-right:12px;}.z-pd-lr14{padding-left:14px;padding-right:14px;} +.z-pd-lr15{padding-left:15px;padding-right:15px;}.z-pd-lr16{padding-left:16px;padding-right:16px;} +.z-pd-lr18{padding-left:18px;padding-right:18px;}.z-pd-lr20{padding-left:20px;padding-right:20px;} + +.z-pd-tb0{padding-top:0;padding-bottom:0;} +.z-pd-tb3{padding-top:3px;padding-bottom:3px;}.z-pd-tb4{padding-top:4px;padding-bottom:4px;} +.z-pd-tb5{padding-top:5px;padding-bottom:5px;}.z-pd-tb6{padding-top:6px;padding-bottom:6px;} +.z-pd-tb8{padding-top:8px;padding-bottom:8px;}.z-pd-tb10{padding-top:8px;padding-bottom:8px;} +.z-pd-tb12{padding-top:12px;padding-bottom:12px;}.z-pd-tb14{padding-top:14px;padding-bottom:14px;} +.z-pd-tb15{padding-top:15px;padding-bottom:15px;}.z-pd-tb16{padding-top:16px;padding-bottom:16px;} +.z-pd-tb18{padding-top:18px;padding-bottom:18px;}.z-pd-tb20{padding-top:20px;padding-bottom:20px;} + +.zi-pd0{padding:0 !important;} +.zi-pd3{padding:3px !important;}.zi-pd4{padding:4px !important;} +.zi-pd5{padding:5px !important;}.zi-pd6{padding:6px !important;} +.zi-pd8{padding:8px !important;}.zi-pd10{padding:10px !important;} +.zi-pd12{padding:12px !important;}.zi-pd14{padding:14px !important;} +.zi-pd15{padding:15px !important;}.zi-pd16{padding:16px !important;} +.zi-pd18{padding:18px !important;}.zi-pd20{padding:20px !important;} + +.zi-pd-l0{padding-left:0 !important;} +.zi-pd-l3{padding-left:3px !important;}.zi-pd-l4{padding-left:4px !important;} +.zi-pd-l5{padding-left:5px !important;}.zi-pd-l6{padding-left:6px !important;} +.zi-pd-l8{padding-left:8px !important;}.zi-pd-l10{padding-left:10px !important;} +.zi-pd-l12{padding-left:12px !important;}.zi-pd-l14{padding-left:14px !important;} +.zi-pd-l15{padding-left:15px !important;}.zi-pd-l16{padding-left:16px !important;} +.zi-pd-l18{padding-left:18px !important;}.zi-pd-l20{padding-left:20px !important;} + +.zi-pd-r0{padding-right:0 !important;} +.zi-pd-r3{padding-right:3px !important;}.zi-pd-r4{padding-right:4px !important;} +.zi-pd-r5{padding-right:6px !important;}.zi-pd-r6{padding-right:6px !important;} +.zi-pd-r8{padding-right:8px !important;}.zi-pd-r10{padding-right:10px !important;} +.zi-pd-r12{padding-right:12px !important;}.zi-pd-r14{padding-right:14px !important;} +.zi-pd-r15{padding-right:15px !important;}.zi-pd-r16{padding-right:16px !important;} +.zi-pd-r18{padding-right:18px !important;}.zi-pd-r20{padding-right:20px !important;} + +.zi-pd-t0{padding-top:0 !important;} +.zi-pd-t3{padding-top:3px !important;}.zi-pd-t4{padding-top:4px !important;} +.zi-pd-t5{padding-top:5px !important;}.zi-pd-t6{padding-top:6px !important;} +.zi-pd-t8{padding-top:8px !important;}.zi-pd-t10{padding-top:10px !important;} +.zi-pd-t12{padding-top:12px !important;}.zi-pd-t14{padding-top:14px !important;} +.zi-pd-t15{padding-top:15px !important;}.zi-pd-t16{padding-top:16px !important;} +.zi-pd-t18{padding-top:18px !important;}.zi-pd-t20{padding-top:20px !important;} + +.zi-pd-b0{padding-bottom:0 !important;} +.zi-pd-b3{padding-bottom:3px !important;}.zi-pd-b4{padding-bottom:4px !important;} +.zi-pd-b5{padding-bottom:5px !important;}.zi-pd-b6{padding-bottom:6px !important;} +.zi-pd-b8{padding-bottom:8px !important;}.zi-pd-b10{padding-bottom:10px !important;} +.zi-pd-b12{padding-bottom:12px !important;}.zi-pd-b14{padding-bottom:14px !important;} +.zi-pd-b15{padding-bottom:15px !important;}.zi-pd-b16{padding-bottom:16px !important;} +.zi-pd-b18{padding-bottom:18px !important;}.zi-pd-b20{padding-bottom:20px !important;} + +.zi-pd-lr0{padding-left:0 !important;padding-right:0 !important;} +.zi-pd-lr3{padding-left:3px !important;padding-right:3px !important;}.zi-pd-lr4{padding-left:4px !important;padding-right:4px !important;} +.zi-pd-lr5{padding-left:5px !important;padding-right:5px !important;}.zi-pd-lr6{padding-left:6px !important;padding-right:6px !important;} +.zi-pd-lr8{padding-left:8px !important;padding-right:8px !important;}.zi-pd-lr10{padding-left:8px !important;padding-right:8px !important;} +.zi-pd-lr12{padding-left:12px !important;padding-right:12px !important;}.zi-pd-lr14{padding-left:14px !important;padding-right:14px !important;} +.zi-pd-lr15{padding-left:15px !important;padding-right:15px !important;}.zi-pd-lr16{padding-left:16px !important;padding-right:16px !important;} +.zi-pd-lr18{padding-left:18px !important;padding-right:18px !important;}.zi-pd-lr20{padding-left:20px !important;padding-right:20px !important;} + +.zi-pd-tb0{padding-top:0 !important;padding-bottom:0 !important;} +.zi-pd-tb3{padding-top:3px !important;padding-bottom:3px !important;}.zi-pd-tb4{padding-top:4px !important;padding-bottom:4px !important;} +.zi-pd-tb5{padding-top:5px !important;padding-bottom:5px !important;}.zi-pd-tb6{padding-top:6px !important;padding-bottom:6px !important;} +.zi-pd-tb8{padding-top:8px !important;padding-bottom:8px !important;}.zi-pd-tb10{padding-top:8px !important;padding-bottom:8px !important;} +.zi-pd-tb12{padding-top:12px !important;padding-bottom:12px !important;}.zi-pd-tb14{padding-top:14px !important;padding-bottom:14px !important;} +.zi-pd-tb15{padding-top:15px !important;padding-bottom:15px !important;}.zi-pd-tb16{padding-top:16px !important;padding-bottom:16px !important;} +.zi-pd-tb18{padding-top:18px !important;padding-bottom:18px !important;}.zi-pd-tb20{padding-top:20px !important;padding-bottom:20px !important;} + +.z-mg0{margin:0;}.z-mg3{margin:3px;} +.z-mg4{margin:4px;}.z-mg5{margin:5px;} +.z-mg6{margin:6px;}.z-mg8{margin:8px;} +.z-mg10{margin:10px;}.z-mg12{margin:12px;} +.z-mg14{margin:14px;}.z-mg15{margin:15px;} +.z-mg16{margin:16px;}.z-mg18{margin:18px;} +.z-mg20{margin:20px;}.z-mg30{margin:30px;} +.z-mg40{margin:40px;}.z-mg50{margin:50px;} + +.z-mg-l0{margin-left:0;}.z-mg-l3{margin-left:3px;} +.z-mg-l4{margin-left:4px;}.z-mg-l5{margin-left:5px;} +.z-mg-l6{margin-left:6px;}.z-mg-l8{margin-left:8px;} +.z-mg-l10{margin-left:10px;}.z-mg-l12{margin-left:12px;} +.z-mg-l14{margin-left:14px;}.z-mg-l15{margin-left:15px;} +.z-mg-l16{margin-left:16px;}.z-mg-l18{margin-left:18px;} +.z-mg-l20{margin-left:20px;}.z-mg-l30{margin-left:30px;} +.z-mg-l40{margin-left:40px;}.z-mg-l50{margin-left:50px;} + +.z-mg-r0{margin-right:0;}.z-mg-r3{margin-right:3px;} +.z-mg-r4{margin-right:4px;}.z-mg-r5{margin-right:6px;} +.z-mg-r6{margin-right:6px;}.z-mg-r8{margin-right:8px;} +.z-mg-r10{margin-right:10px;}.z-mg-r12{margin-right:12px;} +.z-mg-r14{margin-right:14px;}.z-mg-r15{margin-right:15px;} +.z-mg-r16{margin-right:16px;}.z-mg-r18{margin-right:18px;} +.z-mg-r20{margin-right:20px;}.z-mg-r30{margin-right:30px;} +.z-mg-r40{margin-right:40px;}.z-mg-r50{margin-right:50px;} + +.z-mg-t0{margin-top:0;}.z-mg-t3{margin-top:3px;} +.z-mg-t4{margin-top:4px;}.z-mg-t5{margin-top:5px;} +.z-mg-t6{margin-top:6px;}.z-mg-t8{margin-top:8px;} +.z-mg-t10{margin-top:10px;}.z-mg-t12{margin-top:12px;} +.z-mg-t14{margin-top:14px;}.z-mg-t15{margin-top:15px;} +.z-mg-t16{margin-top:16px;}.z-mg-t18{margin-top:18px;} +.z-mg-t20{margin-top:20px;}.z-mg-t30{margin-top:30px;} +.z-mg-t40{margin-top:40px;}.z-mg-t50{margin-top:50px;} + +.z-mg-b0{margin-bottom:0;}.z-mg-b3{margin-bottom:3px;} +.z-mg-b4{margin-bottom:4px;}.z-mg-b5{margin-bottom:5px;} +.z-mg-b6{margin-bottom:6px;}.z-mg-b8{margin-bottom:8px;} +.z-mg-b10{margin-bottom:10px;}.z-mg-b12{margin-bottom:12px;} +.z-mg-b14{margin-bottom:14px;}.z-mg-b15{margin-bottom:15px;} +.z-mg-b16{margin-bottom:16px;}.z-mg-b18{margin-bottom:18px;} +.z-mg-b20{margin-bottom:20px;}.z-mg-b30{margin-bottom:30px;} +.z-mg-b40{margin-bottom:40px;}.z-mg-b50{margin-bottom:50px;} + +.z-mg-l-1{margin-left:-1px;}.z-mg-l-2{margin-left:-2px;} +.z-mg-l-3{margin-left:-3px;}.z-mg-l-4{margin-left:-4px;} +.z-mg-l-5{margin-left:-5px;}.z-mg-l-6{margin-left:-6px;} +.z-mg-l-8{margin-left:-8px;}.z-mg-l-10{margin-left:-10px;} +.z-mg-l-12{margin-left:-12px;}.z-mg-l-14{margin-left:-14px;} +.z-mg-l-15{margin-left:-15px;}.z-mg-l-16{margin-left:-16px;} +.z-mg-l-18{margin-left:-18px;}.z-mg-l-20{margin-left:-20px;} + +.z-mg-r-1{margin-right:-1px;}.z-mg-r-2{margin-right:-2px;} +.z-mg-r-3{margin-right:-3px;}.z-mg-r-4{margin-right:-4px;} +.z-mg-r-5{margin-right:-5px;}.z-mg-r-6{margin-right:-6px;} +.z-mg-r-8{margin-right:-8px;}.z-mg-r-10{margin-right:-10px;} +.z-mg-r-12{margin-right:-12px;}.z-mg-r-14{margin-right:-14px;} +.z-mg-r-15{margin-right:-15px;}.z-mg-r-16{margin-right:-16px;} +.z-mg-r-18{margin-right:-18px;}.z-mg-r-20{margin-right:-20px;} + +.z-mg-t-1{margin-top:-1px;}.z-mg-t-2{margin-top:-2px;} +.z-mg-t-3{margin-top:-3px;}.z-mg-t-4{margin-top:-4px;} +.z-mg-t-5{margin-top:-5px;}.z-mg-t-6{margin-top:-6px;} +.z-mg-t-8{margin-top:-8px;}.z-mg-t-10{margin-top:-10px;} +.z-mg-t-12{margin-top:-12px;}.z-mg-t-14{margin-top:-14px;} +.z-mg-t-15{margin-top:-15px;}.z-mg-t-15{margin-top:-15px;} +.z-mg-t-18{margin-top:-18px;}.z-mg-t-20{margin-top:-20px;} + +.z-mg-b-1{margin-bottom:-1px;}.z-mg-b-2{margin-bottom:-2px;} +.z-mg-b-3{margin-bottom:-3px;}.z-mg-b-4{margin-bottom:-4px;} +.z-mg-b-5{margin-bottom:-5px;}.z-mg-b-6{margin-bottom:-6px;} +.z-mg-b-8{margin-bottom:-8px;}.z-mg-b-10{margin-bottom:-10px;} +.z-mg-b-12{margin-bottom:-12px;}.z-mg-b-14{margin-bottom:-14px;} +.z-mg-b-15{margin-bottom:-15px;}.z-mg-b-16{margin-bottom:-16px;} +.z-mg-b-18{margin-bottom:-18px;}.z-mg-b-20{margin-bottom:-20px;} + +.z-mg-lr1{margin-left:1px;margin-right:1px;}.z-mg-lr2{margin-left:2px;margin-right:2px;} +.z-mg-lr3{margin-left:3px;margin-right:3px;}.z-mg-lr4{margin-left:4px;margin-right:4px;} +.z-mg-lr5{margin-left:5px;margin-right:5px;}.z-mg-lr6{margin-left:6px;margin-right:6px;} +.z-mg-lr7{margin-left:7px;margin-right:7px;}.z-mg-lr8{margin-left:8px;margin-right:8px;} +.z-mg-lr9{margin-left:9px;margin-right:9px;}.z-mg-lr10{margin-left:10px;margin-right:10px;} +.z-mg-lr12{margin-left:12px;margin-right:12px;}.z-mg-lr14{margin-left:14px;margin-right:14px;} +.z-mg-lr15{margin-left:15px;margin-right:15px;}.z-mg-lr16{margin-left:16px;margin-right:16px;} +.z-mg-lr18{margin-left:18px;margin-right:18px;}.z-mg-lr20{margin-left:20px;margin-right:20px;} +.z-mg-lr24{margin-left:24px;margin-right:24px;}.z-mg-lr25{margin-left:25px;margin-right:25px;} +.z-mg-lr26{margin-left:26px;margin-right:26px;}.z-mg-lr28{margin-left:28px;margin-right:28px;} +.z-mg-lr30{margin-left:30px;margin-right:30px;} + +.z-mg-tb1{margin-top:1px;margin-bottom:1px;}.z-mg-tb2{margin-top:2px;margin-bottom:2px;} +.z-mg-tb3{margin-top:3px;margin-bottom:3px;}.z-mg-tb4{margin-top:4px;margin-bottom:4px;} +.z-mg-tb5{margin-top:5px;margin-bottom:5px;}.z-mg-tb6{margin-top:6px;margin-bottom:6px;} +.z-mg-tb7{margin-top:7px;margin-bottom:7px;}.z-mg-tb8{margin-top:8px;margin-bottom:8px;} +.z-mg-tb9{margin-top:9px;margin-bottom:9px;}.z-mg-tb10{margin-top:10px;margin-bottom:10px;} +.z-mg-tb12{margin-top:12px;margin-bottom:12px;}.z-mg-tb14{margin-top:14px;margin-bottom:14px;} +.z-mg-tb15{margin-top:15px;margin-bottom:15px;}.z-mg-tb16{margin-top:16px;margin-bottom:16px;} +.z-mg-tb18{margin-top:18px;margin-bottom:18px;}.z-mg-tb20{margin-top:20px;margin-bottom:20px;} +.z-mg-tb24{margin-top:24px;margin-bottom:24px;}.z-mg-tb25{margin-top:25px;margin-bottom:25px;} +.z-mg-tb26{margin-top:26px;margin-bottom:26px;}.z-mg-tb28{margin-top:28px;margin-bottom:28px;} +.z-mg-tb30{margin-top:30px;margin-bottom:30px;} + +.z-mg-auto{margin:auto;} +.z-mg-l-auto{margin-left:auto;} +.z-mg-r-auto{margin-right:auto;} +.z-mg-t-auto{margin-top:auto;} +.z-mg-b-auto{margin-bottom:auto;} +.z-mg-lr-auto{margin-left:auto;margin-right:auto;} +.z-mg-tb-auto{margin-top:auto;margin-bottom:auto;} + +.zi-mg0{margin:0 !important;}.zi-mg3{margin:3px !important;} +.zi-mg4{margin:4px !important;}.zi-mg5{margin:5px !important;} +.zi-mg6{margin:6px !important;}.zi-mg8{margin:8px !important;} +.zi-mg10{margin:10px !important;}.zi-mg12{margin:12px !important;} +.zi-mg14{margin:14px !important;}.zi-mg15{margin:15px !important;} +.zi-mg16{margin:16px !important;}.zi-mg18{margin:18px !important;} +.zi-mg20{margin:20px !important;}.zi-mg30{margin:30px !important;} +.zi-mg40{margin:40px !important;}.zi-mg50{margin:50px !important;} + +.zi-mg-l0{margin-left:0 !important;}.zi-mg-l3{margin-left:3px !important;} +.zi-mg-l4{margin-left:4px !important;}.zi-mg-l5{margin-left:5px !important;} +.zi-mg-l6{margin-left:6px !important;}.zi-mg-l8{margin-left:8px !important;} +.zi-mg-l10{margin-left:10px !important;}.zi-mg-l12{margin-left:12px !important;} +.zi-mg-l14{margin-left:14px !important;}.zi-mg-l15{margin-left:15px !important;} +.zi-mg-l16{margin-left:16px !important;}.zi-mg-l18{margin-left:18px !important;} +.zi-mg-l20{margin-left:20px !important;}.zi-mg-l30{margin-left:30px !important;} +.zi-mg-l40{margin-left:40px !important;}.zi-mg-l50{margin-left:50px !important;} + +.zi-mg-r0{margin-right:0 !important;}.zi-mg-r3{margin-right:3px !important;} +.zi-mg-r4{margin-right:4px !important;}.zi-mg-r5{margin-right:6px !important;} +.zi-mg-r6{margin-right:6px !important;}.zi-mg-r8{margin-right:8px !important;} +.zi-mg-r10{margin-right:10px !important;}.zi-mg-r12{margin-right:12px !important;} +.zi-mg-r14{margin-right:14px !important;}.zi-mg-r15{margin-right:15px !important;} +.zi-mg-r16{margin-right:16px !important;}.zi-mg-r18{margin-right:18px !important;} +.zi-mg-r20{margin-right:20px !important;}.zi-mg-r30{margin-right:30px !important;} +.zi-mg-r40{margin-right:40px !important;}.zi-mg-r50{margin-right:50px !important;} + +.zi-mg-t0{margin-top:0 !important;}.zi-mg-t3{margin-top:3px !important;} +.zi-mg-t4{margin-top:4px !important;}.zi-mg-t5{margin-top:5px !important;} +.zi-mg-t6{margin-top:6px !important;}.zi-mg-t8{margin-top:8px !important;} +.zi-mg-t10{margin-top:10px !important;}.zi-mg-t12{margin-top:12px !important;} +.zi-mg-t14{margin-top:14px !important;}.zi-mg-t15{margin-top:15px !important;} +.zi-mg-t16{margin-top:16px !important;}.zi-mg-t18{margin-top:18px !important;} +.zi-mg-t20{margin-top:20px !important;}.zi-mg-t30{margin-top:30px !important;} +.zi-mg-t40{margin-top:40px !important;}.zi-mg-t50{margin-top:50px !important;} + +.zi-mg-b0{margin-bottom:0 !important;}.zi-mg-b3{margin-bottom:3px !important;} +.zi-mg-b4{margin-bottom:4px !important;}.zi-mg-b5{margin-bottom:5px !important;} +.zi-mg-b6{margin-bottom:6px !important;}.zi-mg-b8{margin-bottom:8px !important;} +.zi-mg-b10{margin-bottom:10px !important;}.zi-mg-b12{margin-bottom:12px !important;} +.zi-mg-b14{margin-bottom:14px !important;}.zi-mg-b15{margin-bottom:15px !important;} +.zi-mg-b16{margin-bottom:16px !important;}.zi-mg-b18{margin-bottom:18px !important;} +.zi-mg-b20{margin-bottom:20px !important;}.zi-mg-b30{margin-bottom:30px !important;} +.zi-mg-b40{margin-bottom:40px !important;}.zi-mg-b50{margin-bottom:50px !important;} + +.zi-mg-t-1{margin-top:-1px !important;}.zi-mg-t-2{margin-top:-2px !important;} +.zi-mg-t-3{margin-top:-3px !important;}.zi-mg-t-4{margin-top:-4px !important;} +.zi-mg-t-5{margin-top:-5px !important;}.zi-mg-t-6{margin-top:-6px !important;} +.zi-mg-t-8{margin-top:-8px !important;}.zi-mg-t-10{margin-top:-10px !important;} +.zi-mg-t-12{margin-top:-12px !important;}.zi-mg-t-14{margin-top:-14px !important;} +.zi-mg-t-15{margin-top:-15px !important;}.zi-mg-t-15{margin-top:-15px !important;} +.zi-mg-t-18{margin-top:-18px !important;}.zi-mg-t-20{margin-top:-20px !important;} + +.zi-mg-r-1{margin-right:-1px !important;}.zi-mg-r-2{margin-right:-2px !important;} +.zi-mg-r-3{margin-right:-3px !important;}.zi-mg-r-4{margin-right:-4px !important;} +.zi-mg-r-5{margin-right:-5px !important;}.zi-mg-r-6{margin-right:-6px !important;} +.zi-mg-r-8{margin-right:-8px !important;}.zi-mg-r-10{margin-right:-10px !important;} +.zi-mg-r-12{margin-right:-12px !important;}.zi-mg-r-14{margin-right:-14px !important;} +.zi-mg-r-15{margin-right:-15px !important;}.zi-mg-r-16{margin-right:-16px !important;} +.zi-mg-r-18{margin-right:-18px !important;}.zi-mg-r-20{margin-right:-20px !important;} + +.zi-mg-b-1{margin-bottom:-1px !important;}.zi-mg-b-2{margin-bottom:-2px !important;} +.zi-mg-b-3{margin-bottom:-3px !important;}.zi-mg-b-4{margin-bottom:-4px !important;} +.zi-mg-b-5{margin-bottom:-5px !important;}.zi-mg-b-6{margin-bottom:-6px !important;} +.zi-mg-b-8{margin-bottom:-8px !important;}.zi-mg-b-10{margin-bottom:-10px !important;} +.zi-mg-b-12{margin-bottom:-12px !important;}.zi-mg-b-14{margin-bottom:-14px !important;} +.zi-mg-b-15{margin-bottom:-15px !important;}.zi-mg-b-16{margin-bottom:-16px !important;} +.zi-mg-b-18{margin-bottom:-18px !important;}.zi-mg-b-20{margin-bottom:-20px !important;} + +.zi-mg-l-1{margin-left:-1px !important;}.zi-mg-l-2{margin-left:-2px !important;} +.zi-mg-l-3{margin-left:-3px !important;}.zi-mg-l-4{margin-left:-4px !important;} +.zi-mg-l-5{margin-left:-5px !important;}.zi-mg-l-6{margin-left:-6px !important;} +.zi-mg-l-8{margin-left:-8px !important;}.zi-mg-l-10{margin-left:-10px !important;} +.zi-mg-l-12{margin-left:-12px !important;}.zi-mg-l-14{margin-left:-14px !important;} +.zi-mg-l-15{margin-left:-15px !important;}.zi-mg-l-16{margin-left:-16px !important;} +.zi-mg-l-18{margin-left:-18px !important;}.zi-mg-l-20{margin-left:-20px !important;} + +.zi-mg-lr1{margin-left:1px !important;margin-right:1px !important;}.zi-mg-lr2{margin-left:2px !important;margin-right:2px !important;} +.zi-mg-lr3{margin-left:3px !important;margin-right:3px !important;}.zi-mg-lr4{margin-left:4px !important;margin-right:4px !important;} +.zi-mg-lr5{margin-left:5px !important;margin-right:5px !important;}.zi-mg-lr6{margin-left:6px !important;margin-right:6px !important;} +.zi-mg-lr7{margin-left:7px !important;margin-right:7px !important;}.zi-mg-lr8{margin-left:8px !important;margin-right:8px !important;} +.zi-mg-lr9{margin-left:9px !important;margin-right:9px !important;}.zi-mg-lr10{margin-left:10px !important;margin-right:10px !important;} +.zi-mg-lr12{margin-left:12px !important;margin-right:12px !important;}.zi-mg-lr14{margin-left:14px !important;margin-right:14px !important;} +.zi-mg-lr15{margin-left:15px !important;margin-right:15px !important;}.zi-mg-lr16{margin-left:16px !important;margin-right:16px !important;} +.zi-mg-lr18{margin-left:18px !important;margin-right:18px !important;}.zi-mg-lr20{margin-left:20px !important;margin-right:20px !important;} +.zi-mg-lr24{margin-left:24px !important;margin-right:24px !important;}.zi-mg-lr25{margin-left:25px !important;margin-right:25px !important;} +.zi-mg-lr26{margin-left:26px !important;margin-right:26px !important;}.zi-mg-lr28{margin-left:28px !important;margin-right:28px !important;} +.zi-mg-lr30{margin-left:30px !important;margin-right:30px !important;} + +.zi-mg-tb1{margin-top:1px !important;margin-bottom:1px !important;}.zi-mg-tb2{margin-top:2px !important;margin-bottom:2px !important;} +.zi-mg-tb3{margin-top:3px !important;margin-bottom:3px !important;}.zi-mg-tb4{margin-top:4px !important;margin-bottom:4px !important;} +.zi-mg-tb5{margin-top:5px !important;margin-bottom:5px !important;}.zi-mg-tb6{margin-top:6px !important;margin-bottom:6px !important;} +.zi-mg-tb7{margin-top:7px !important;margin-bottom:7px !important;}.zi-mg-tb8{margin-top:8px !important;margin-bottom:8px !important;} +.zi-mg-tb9{margin-top:9px !important;margin-bottom:9px !important;}.zi-mg-tb10{margin-top:10px !important;margin-bottom:10px !important;} +.zi-mg-tb12{margin-top:12px !important;margin-bottom:12px !important;}.zi-mg-tb14{margin-top:14px !important;margin-bottom:14px !important;} +.zi-mg-tb15{margin-top:15px !important;margin-bottom:15px !important;}.zi-mg-tb16{margin-top:16px !important;margin-bottom:16px !important;} +.zi-mg-tb18{margin-top:18px !important;margin-bottom:18px !important;}.zi-mg-tb20{margin-top:20px !important;margin-bottom:20px !important;} +.zi-mg-tb24{margin-top:24px !important;margin-bottom:24px !important;}.zi-mg-tb25{margin-top:25px !important;margin-bottom:25px !important;} +.zi-mg-tb26{margin-top:26px !important;margin-bottom:26px !important;}.zi-mg-tb28{margin-top:28px !important;margin-bottom:28px !important;} +.zi-mg-tb30{margin-top:30px !important;margin-bottom:30px !important;} + +.zi-mg-auto{margin:auto !important;} +.zi-mg-l-auto{margin-left:auto !important;} +.zi-mg-r-auto{margin-right:auto !important;} +.zi-mg-t-auto{margin-top:auto !important;} +.zi-mg-b-auto{margin-bottom:auto !important;} +.zi-mg-lr-auto{margin-left:auto !important;margin-right:auto !important;} +.zi-mg-tb-auto{margin-top:auto !important;margin-bottom:auto !important;} + +/***********************************************/ +/* 第四部分:表格样式定义 */ +/***********************************************/ + +/** 默认表格无边框,单元格内边距为0 */ +.z-table{border-collapse:separate;border-spacing:0;border:0;width:100%;} +.z-table td,.z-table th{padding:0;word-break:break-all;word-wrap:break-word;background-clip:padding-box;} + +/** 改成表格td中去 */ +.z-table.z-pd3{padding:0;}.z-table.z-pd3>tbody>tr>td,.z-table.z-pd3>tbody>tr>th,.z-table.z-pd3>thead>tr>td,.z-table.z-pd3>thead>tr>th{padding:3px;} +.z-table.z-pd4{padding:0;}.z-table.z-pd4>tbody>tr>td,.z-table.z-pd4>tbody>tr>th,.z-table.z-pd4>thead>tr>td,.z-table.z-pd4>thead>tr>th{padding:4px;} +.z-table.z-pd5{padding:0;}.z-table.z-pd5>tbody>tr>td,.z-table.z-pd5>tbody>tr>th,.z-table.z-pd5>thead>tr>td,.z-table.z-pd5>thead>tr>th{padding:5px;} +.z-table.z-pd6{padding:0;}.z-table.z-pd6>tbody>tr>td,.z-table.z-pd6>tbody>tr>th,.z-table.z-pd6>thead>tr>td,.z-table.z-pd6>thead>tr>th{padding:6px;} +.z-table.z-pd8{padding:0;}.z-table.z-pd8>tbody>tr>td,.z-table.z-pd8>tbody>tr>th,.z-table.z-pd8>thead>tr>td,.z-table.z-pd8>thead>tr>th{padding:8px;} +.z-table.z-pd10{padding:0;}.z-table.z-pd10>tbody>tr>td,.z-table.z-pd10>tbody>tr>th,.z-table.z-pd10>thead>tr>td,.z-table.z-pd10>thead>tr>th{padding:10px;} +.z-table.z-pd12{padding:0;}.z-table.z-pd12>tbody>tr>td,.z-table.z-pd12>tbody>tr>th,.z-table.z-pd12>thead>tr>td,.z-table.z-pd12>thead>tr>th{padding:12px;} +.z-table.z-pd14{padding:0;}.z-table.z-pd14>tbody>tr>td,.z-table.z-pd14>tbody>tr>th,.z-table.z-pd14>thead>tr>td,.z-table.z-pd14>thead>tr>th{padding:14px;} +.z-table.z-pd16{padding:0;}.z-table.z-pd16>tbody>tr>td,.z-table.z-pd16>tbody>tr>th,.z-table.z-pd16>thead>tr>td,.z-table.z-pd16>thead>tr>th{padding:16px;} +.z-table.z-pd18{padding:0;}.z-table.z-pd18>tbody>tr>td,.z-table.z-pd18>tbody>tr>th,.z-table.z-pd18>thead>tr>td,.z-table.z-pd18>thead>tr>th{padding:18px;} +.z-table.z-pd20{padding:0;}.z-table.z-pd20>tbody>tr>td,.z-table.z-pd20>tbody>tr>th,.z-table.z-pd20>thead>tr>td,.z-table.z-pd20>thead>tr>th{padding:20px;} + +.z-table.z-pd-t3{padding-top:0;}.z-table.z-pd-t3>tbody>tr>td,.z-table.z-pd-t3>tbody>tr>th,.z-table.z-pd-t3>thead>tr>td,.z-table.z-pd-t3>thead>tr>th{padding-top:3px;} +.z-table.z-pd-t4{padding-top:0;}.z-table.z-pd-t4>tbody>tr>td,.z-table.z-pd-t4>tbody>tr>th,.z-table.z-pd-t4>thead>tr>td,.z-table.z-pd-t4>thead>tr>th{padding-top:4px;} +.z-table.z-pd-t5{padding-top:0;}.z-table.z-pd-t5>tbody>tr>td,.z-table.z-pd-t5>tbody>tr>th,.z-table.z-pd-t5>thead>tr>td,.z-table.z-pd-t5>thead>tr>th{padding-top:5px;} +.z-table.z-pd-t6{padding-top:0;}.z-table.z-pd-t6>tbody>tr>td,.z-table.z-pd-t6>tbody>tr>th,.z-table.z-pd-t6>thead>tr>td,.z-table.z-pd-t6>thead>tr>th{padding-top:6px;} +.z-table.z-pd-t8{padding-top:0;}.z-table.z-pd-t8>tbody>tr>td,.z-table.z-pd-t8>tbody>tr>th,.z-table.z-pd-t8>thead>tr>td,.z-table.z-pd-t8>thead>tr>th{padding-top:8px;} +.z-table.z-pd-t10{padding-top:0;}.z-table.z-pd-t10>tbody>tr>td,.z-table.z-pd-t10>tbody>tr>th,.z-table.z-pd-t10>thead>tr>td,.z-table.z-pd-t10>thead>tr>th{padding-top:10px;} +.z-table.z-pd-t12{padding-top:0;}.z-table.z-pd-t12>tbody>tr>td,.z-table.z-pd-t12>tbody>tr>th,.z-table.z-pd-t12>thead>tr>td,.z-table.z-pd-t12>thead>tr>th{padding-top:12px;} +.z-table.z-pd-t14{padding-top:0;}.z-table.z-pd-t14>tbody>tr>td,.z-table.z-pd-t14>tbody>tr>th,.z-table.z-pd-t14>thead>tr>td,.z-table.z-pd-t14>thead>tr>th{padding-top:14px;} +.z-table.z-pd-t16{padding-top:0;}.z-table.z-pd-t16>tbody>tr>td,.z-table.z-pd-t16>tbody>tr>th,.z-table.z-pd-t16>thead>tr>td,.z-table.z-pd-t16>thead>tr>th{padding-top:16px;} +.z-table.z-pd-t18{padding-top:0;}.z-table.z-pd-t18>tbody>tr>td,.z-table.z-pd-t18>tbody>tr>th,.z-table.z-pd-t18>thead>tr>td,.z-table.z-pd-t18>thead>tr>th{padding-top:18px;} +.z-table.z-pd-t20{padding-top:0;}.z-table.z-pd-t20>tbody>tr>td,.z-table.z-pd-t20>tbody>tr>th,.z-table.z-pd-t20>thead>tr>td,.z-table.z-pd-t20>thead>tr>th{padding-top:20px;} + +.z-table.z-pd-l3{padding-left:0;}.z-table.z-pd-l3>tbody>tr>td,.z-table.z-pd-l3>tbody>tr>th,.z-table.z-pd-l3>thead>tr>td,.z-table.z-pd-l3>thead>tr>th{padding-left:3px;} +.z-table.z-pd-l4{padding-left:0;}.z-table.z-pd-l4>tbody>tr>td,.z-table.z-pd-l4>tbody>tr>th,.z-table.z-pd-l4>thead>tr>td,.z-table.z-pd-l4>thead>tr>th{padding-left:4px;} +.z-table.z-pd-l5{padding-left:0;}.z-table.z-pd-l5>tbody>tr>td,.z-table.z-pd-l5>tbody>tr>th,.z-table.z-pd-l5>thead>tr>td,.z-table.z-pd-l5>thead>tr>th{padding-left:5px;} +.z-table.z-pd-l6{padding-left:0;}.z-table.z-pd-l6>tbody>tr>td,.z-table.z-pd-l6>tbody>tr>th,.z-table.z-pd-l6>thead>tr>td,.z-table.z-pd-l6>thead>tr>th{padding-left:6px;} +.z-table.z-pd-l8{padding-left:0;}.z-table.z-pd-l8>tbody>tr>td,.z-table.z-pd-l8>tbody>tr>th,.z-table.z-pd-l8>thead>tr>td,.z-table.z-pd-l8>thead>tr>th{padding-left:8px;} +.z-table.z-pd-l10{padding-left:0;}.z-table.z-pd-l10>tbody>tr>td,.z-table.z-pd-l10>tbody>tr>th,.z-table.z-pd-l10>thead>tr>td,.z-table.z-pd-l10>thead>tr>th{padding-left:10px;} +.z-table.z-pd-l12{padding-left:0;}.z-table.z-pd-l12>tbody>tr>td,.z-table.z-pd-l12>tbody>tr>th,.z-table.z-pd-l12>thead>tr>td,.z-table.z-pd-l12>thead>tr>th{padding-left:12px;} +.z-table.z-pd-l14{padding-left:0;}.z-table.z-pd-l14>tbody>tr>td,.z-table.z-pd-l14>tbody>tr>th,.z-table.z-pd-l14>thead>tr>td,.z-table.z-pd-l14>thead>tr>th{padding-left:14px;} +.z-table.z-pd-l16{padding-left:0;}.z-table.z-pd-l16>tbody>tr>td,.z-table.z-pd-l16>tbody>tr>th,.z-table.z-pd-l16>thead>tr>td,.z-table.z-pd-l16>thead>tr>th{padding-left:16px;} +.z-table.z-pd-l18{padding-left:0;}.z-table.z-pd-l18>tbody>tr>td,.z-table.z-pd-l18>tbody>tr>th,.z-table.z-pd-l18>thead>tr>td,.z-table.z-pd-l18>thead>tr>th{padding-left:18px;} +.z-table.z-pd-l20{padding-left:0;}.z-table.z-pd-l20>tbody>tr>td,.z-table.z-pd-l20>tbody>tr>th,.z-table.z-pd-l20>thead>tr>td,.z-table.z-pd-l20>thead>tr>th{padding-left:20px;} + +.z-table.z-pd-r3{padding-right:0;}.z-table.z-pd-r3>tbody>tr>td,.z-table.z-pd-r3>tbody>tr>th,.z-table.z-pd-r3>thead>tr>td,.z-table.z-pd-r3>thead>tr>th{padding-right:3px;} +.z-table.z-pd-r4{padding-right:0;}.z-table.z-pd-r4>tbody>tr>td,.z-table.z-pd-r4>tbody>tr>th,.z-table.z-pd-r4>thead>tr>td,.z-table.z-pd-r4>thead>tr>th{padding-right:4px;} +.z-table.z-pd-r5{padding-right:0;}.z-table.z-pd-r5>tbody>tr>td,.z-table.z-pd-r5>tbody>tr>th,.z-table.z-pd-r5>thead>tr>td,.z-table.z-pd-r5>thead>tr>th{padding-right:5px;} +.z-table.z-pd-r6{padding-right:0;}.z-table.z-pd-r6>tbody>tr>td,.z-table.z-pd-r6>tbody>tr>th,.z-table.z-pd-r6>thead>tr>td,.z-table.z-pd-r6>thead>tr>th{padding-right:6px;} +.z-table.z-pd-r8{padding-right:0;}.z-table.z-pd-r8>tbody>tr>td,.z-table.z-pd-r8>tbody>tr>th,.z-table.z-pd-r8>thead>tr>td,.z-table.z-pd-r8>thead>tr>th{padding-right:8px;} +.z-table.z-pd-r10{padding-right:0;}.z-table.z-pd-r10>tbody>tr>td,.z-table.z-pd-r10>tbody>tr>th,.z-table.z-pd-r10>thead>tr>td,.z-table.z-pd-r10>thead>tr>th{padding-right:10px;} +.z-table.z-pd-r12{padding-right:0;}.z-table.z-pd-r12>tbody>tr>td,.z-table.z-pd-r12>tbody>tr>th,.z-table.z-pd-r12>thead>tr>td,.z-table.z-pd-r12>thead>tr>th{padding-right:12px;} +.z-table.z-pd-r14{padding-right:0;}.z-table.z-pd-r14>tbody>tr>td,.z-table.z-pd-r14>tbody>tr>th,.z-table.z-pd-r14>thead>tr>td,.z-table.z-pd-r14>thead>tr>th{padding-right:14px;} +.z-table.z-pd-r16{padding-right:0;}.z-table.z-pd-r16>tbody>tr>td,.z-table.z-pd-r16>tbody>tr>th,.z-table.z-pd-r16>thead>tr>td,.z-table.z-pd-r16>thead>tr>th{padding-right:16px;} +.z-table.z-pd-r18{padding-right:0;}.z-table.z-pd-r18>tbody>tr>td,.z-table.z-pd-r18>tbody>tr>th,.z-table.z-pd-r18>thead>tr>td,.z-table.z-pd-r18>thead>tr>th{padding-right:18px;} +.z-table.z-pd-r20{padding-right:0;}.z-table.z-pd-r20>tbody>tr>td,.z-table.z-pd-r20>tbody>tr>th,.z-table.z-pd-r20>thead>tr>td,.z-table.z-pd-r20>thead>tr>th{padding-right:20px;} + +.z-table.z-pd-b3{padding-bottom:0;}.z-table.z-pd-b3>tbody>tr>td,.z-table.z-pd-b3>tbody>tr>th,.z-table.z-pd-b3>thead>tr>td,.z-table.z-pd-b3>thead>tr>th{padding-bottom:3px;} +.z-table.z-pd-b4{padding-bottom:0;}.z-table.z-pd-b4>tbody>tr>td,.z-table.z-pd-b4>tbody>tr>th,.z-table.z-pd-b4>thead>tr>td,.z-table.z-pd-b4>thead>tr>th{padding-bottom:4px;} +.z-table.z-pd-b5{padding-bottom:0;}.z-table.z-pd-b5>tbody>tr>td,.z-table.z-pd-b5>tbody>tr>th,.z-table.z-pd-b5>thead>tr>td,.z-table.z-pd-b5>thead>tr>th{padding-bottom:5px;} +.z-table.z-pd-b6{padding-bottom:0;}.z-table.z-pd-b6>tbody>tr>td,.z-table.z-pd-b6>tbody>tr>th,.z-table.z-pd-b6>thead>tr>td,.z-table.z-pd-b6>thead>tr>th{padding-bottom:6px;} +.z-table.z-pd-b8{padding-bottom:0;}.z-table.z-pd-b8>tbody>tr>td,.z-table.z-pd-b8>tbody>tr>th,.z-table.z-pd-b8>thead>tr>td,.z-table.z-pd-b8>thead>tr>th{padding-bottom:8px;} +.z-table.z-pd-b10{padding-bottom:0;}.z-table.z-pd-b10>tbody>tr>td,.z-table.z-pd-b10>tbody>tr>th,.z-table.z-pd-b10>thead>tr>td,.z-table.z-pd-b10>thead>tr>th{padding-bottom:10px;} +.z-table.z-pd-b12{padding-bottom:0;}.z-table.z-pd-b12>tbody>tr>td,.z-table.z-pd-b12>tbody>tr>th,.z-table.z-pd-b12>thead>tr>td,.z-table.z-pd-b12>thead>tr>th{padding-bottom:12px;} +.z-table.z-pd-b14{padding-bottom:0;}.z-table.z-pd-b14>tbody>tr>td,.z-table.z-pd-b14>tbody>tr>th,.z-table.z-pd-b14>thead>tr>td,.z-table.z-pd-b14>thead>tr>th{padding-bottom:14px;} +.z-table.z-pd-b16{padding-bottom:0;}.z-table.z-pd-b16>tbody>tr>td,.z-table.z-pd-b16>tbody>tr>th,.z-table.z-pd-b16>thead>tr>td,.z-table.z-pd-b16>thead>tr>th{padding-bottom:16px;} +.z-table.z-pd-b18{padding-bottom:0;}.z-table.z-pd-b18>tbody>tr>td,.z-table.z-pd-b18>tbody>tr>th,.z-table.z-pd-b18>thead>tr>td,.z-table.z-pd-b18>thead>tr>th{padding-bottom:18px;} +.z-table.z-pd-b20{padding-bottom:0;}.z-table.z-pd-b20>tbody>tr>td,.z-table.z-pd-b20>tbody>tr>th,.z-table.z-pd-b20>thead>tr>td,.z-table.z-pd-b20>thead>tr>th{padding-bottom:20px;} + +.z-table.z-px10>tbody>tr>td,.z-table.z-px10>tbody>tr>th,.z-table.z-px10>thead>tr>td,.z-table.z-px10>thead>tr>th{font-size:10px;} +.z-table.z-px11>tbody>tr>td,.z-table.z-px11>tbody>tr>th,.z-table.z-px11>thead>tr>td,.z-table.z-px11>thead>tr>th{font-size:11px;} +.z-table.z-px12>tbody>tr>td,.z-table.z-px12>tbody>tr>th,.z-table.z-px12>thead>tr>td,.z-table.z-px12>thead>tr>th{font-size:12px;} +.z-table.z-px13>tbody>tr>td,.z-table.z-px13>tbody>tr>th,.z-table.z-px13>thead>tr>td,.z-table.z-px13>thead>tr>th{font-size:13px;} +.z-table.z-px14>tbody>tr>td,.z-table.z-px14>tbody>tr>th,.z-table.z-px14>thead>tr>td,.z-table.z-px14>thead>tr>th{font-size:14px;} +.z-table.z-px15>tbody>tr>td,.z-table.z-px15>tbody>tr>th,.z-table.z-px15>thead>tr>td,.z-table.z-px15>thead>tr>th{font-size:15px;} +.z-table.z-px16>tbody>tr>td,.z-table.z-px16>tbody>tr>th,.z-table.z-px16>thead>tr>td,.z-table.z-px16>thead>tr>th{font-size:16px;} +.z-table.z-px17>tbody>tr>td,.z-table.z-px17>tbody>tr>th,.z-table.z-px17>thead>tr>td,.z-table.z-px17>thead>tr>th{font-size:17px;} +.z-table.z-px18>tbody>tr>td,.z-table.z-px18>tbody>tr>th,.z-table.z-px18>thead>tr>td,.z-table.z-px18>thead>tr>th{font-size:18px;} +.z-table.z-px19>tbody>tr>td,.z-table.z-px19>tbody>tr>th,.z-table.z-px19>thead>tr>td,.z-table.z-px19>thead>tr>th{font-size:19px;} +.z-table.z-px20>tbody>tr>td,.z-table.z-px20>tbody>tr>th,.z-table.z-px20>thead>tr>td,.z-table.z-px20>thead>tr>th{font-size:20px;} +.z-table.z-px22>tbody>tr>td,.z-table.z-px22>tbody>tr>th,.z-table.z-px22>thead>tr>td,.z-table.z-px22>thead>tr>th{font-size:22px;} +.z-table.z-px24>tbody>tr>td,.z-table.z-px24>tbody>tr>th,.z-table.z-px24>thead>tr>td,.z-table.z-px24>thead>tr>th{font-size:24px;} +.z-table.z-px26>tbody>tr>td,.z-table.z-px26>tbody>tr>th,.z-table.z-px26>thead>tr>td,.z-table.z-px26>thead>tr>th{font-size:26px;} +.z-table.z-px30>tbody>tr>td,.z-table.z-px30>tbody>tr>th,.z-table.z-px30>thead>tr>td,.z-table.z-px30>thead>tr>th{font-size:30px;} +.z-table.z-px40>tbody>tr>td,.z-table.z-px40>tbody>tr>th,.z-table.z-px40>thead>tr>td,.z-table.z-px40>thead>tr>th{font-size:40px;} +.z-table.z-px50>tbody>tr>td,.z-table.z-px50>tbody>tr>th,.z-table.z-px50>thead>tr>td,.z-table.z-px50>thead>tr>th{font-size:50px;} + +.z-table.z-lh100p>tbody>tr>td,.z-table.z-lh100p>tbody>tr>th,.z-table.z-lh100p>thead>tr>td,.z-table.z-lh100p>thead>tr>th{line-height:100%;} +.z-table.z-lh110p>tbody>tr>td,.z-table.z-lh110p>tbody>tr>th,.z-table.z-lh110p>thead>tr>td,.z-table.z-lh110p>thead>tr>th{line-height:110%;} +.z-table.z-lh120p>tbody>tr>td,.z-table.z-lh120p>tbody>tr>th,.z-table.z-lh120p>thead>tr>td,.z-table.z-lh120p>thead>tr>th{line-height:120%;} +.z-table.z-lh130p>tbody>tr>td,.z-table.z-lh130p>tbody>tr>th,.z-table.z-lh130p>thead>tr>td,.z-table.z-lh130p>thead>tr>th{line-height:130%;} +.z-table.z-lh140p>tbody>tr>td,.z-table.z-lh140p>tbody>tr>th,.z-table.z-lh140p>thead>tr>td,.z-table.z-lh140p>thead>tr>th{line-height:140%;} +.z-table.z-lh150p>tbody>tr>td,.z-table.z-lh150p>tbody>tr>th,.z-table.z-lh150p>thead>tr>td,.z-table.z-lh150p>thead>tr>th{line-height:150%;} +.z-table.z-lh180p>tbody>tr>td,.z-table.z-lh180p>tbody>tr>th,.z-table.z-lh180p>thead>tr>td,.z-table.z-lh180p>thead>tr>th{line-height:180%;} +.z-table.z-lh200p>tbody>tr>td,.z-table.z-lh200p>tbody>tr>th,.z-table.z-lh200p>thead>tr>td,.z-table.z-lh200p>thead>tr>th{line-height:200%;} +.z-table.z-lh250p>tbody>tr>td,.z-table.z-lh250p>tbody>tr>th,.z-table.z-lh250p>thead>tr>td,.z-table.z-lh250p>thead>tr>th{line-height:250%;} + +.z-table.z-lh12>tbody>tr>td,.z-table.z-lh12>tbody>tr>th,.z-table.z-lh12>thead>tr>td,.z-table.z-lh12>thead>tr>th{line-height:12px;} +.z-table.z-lh14>tbody>tr>td,.z-table.z-lh14>tbody>tr>th,.z-table.z-lh14>thead>tr>td,.z-table.z-lh14>thead>tr>th{line-height:14px;} +.z-table.z-lh15>tbody>tr>td,.z-table.z-lh15>tbody>tr>th,.z-table.z-lh15>thead>tr>td,.z-table.z-lh15>thead>tr>th{line-height:15px;} +.z-table.z-lh16>tbody>tr>td,.z-table.z-lh16>tbody>tr>th,.z-table.z-lh16>thead>tr>td,.z-table.z-lh16>thead>tr>th{line-height:16px;} +.z-table.z-lh18>tbody>tr>td,.z-table.z-lh18>tbody>tr>th,.z-table.z-lh18>thead>tr>td,.z-table.z-lh18>thead>tr>th{line-height:18px;} +.z-table.z-lh20>tbody>tr>td,.z-table.z-lh20>tbody>tr>th,.z-table.z-lh20>thead>tr>td,.z-table.z-lh20>thead>tr>th{line-height:20px;} +.z-table.z-lh25>tbody>tr>td,.z-table.z-lh25>tbody>tr>th,.z-table.z-lh25>thead>tr>td,.z-table.z-lh25>thead>tr>th{line-height:25px;} +.z-table.z-lh30>tbody>tr>td,.z-table.z-lh30>tbody>tr>th,.z-table.z-lh30>thead>tr>td,.z-table.z-lh30>thead>tr>th{line-height:30px;} +.z-table.z-lh35>tbody>tr>td,.z-table.z-lh35>tbody>tr>th,.z-table.z-lh35>thead>tr>td,.z-table.z-lh35>thead>tr>th{line-height:35px;} +.z-table.z-lh40>tbody>tr>td,.z-table.z-lh40>tbody>tr>th,.z-table.z-lh40>thead>tr>td,.z-table.z-lh40>thead>tr>th{line-height:40px;} + +.z-table.z-h20-tr>tbody>tr,.z-table.z-h20-tr>thead>tr{height:20px;} +.z-table.z-h22-tr>tbody>tr,.z-table.z-h22-tr>thead>tr{height:22px;} +.z-table.z-h25-tr>tbody>tr,.z-table.z-h25-tr>thead>tr{height:25px;} +.z-table.z-h30-tr>tbody>tr,.z-table.z-h30-tr>thead>tr{height:30px;} +.z-table.z-h35-tr>tbody>tr,.z-table.z-h35-tr>thead>tr{height:35px;} +.z-table.z-h40-tr>tbody>tr,.z-table.z-h40-tr>thead>tr{height:40px;} +.z-table.z-h50-tr>tbody>tr,.z-table.z-h50-tr>thead>tr{height:50px;} +.z-table.z-h60-tr>tbody>tr,.z-table.z-h60-tr>thead>tr{height:60px;} +.z-table.z-h70-tr>tbody>tr,.z-table.z-h70-tr>thead>tr{height:70px;} +.z-table.z-h80-tr>tbody>tr,.z-table.z-h80-tr>thead>tr{height:80px;} +.z-table.z-h90-tr>tbody>tr,.z-table.z-h90-tr>thead>tr{height:90px;} +.z-table.z-h100-tr>tbody>tr,.z-table.z-h100-tr>thead>tr{height:100px;} + +/** 表格行线,合并边框 */ +.z-table.z-bordered-line{border-collapse:collapse;} +.z-table.z-bordered-line>thead>tr>th, +.z-table.z-bordered-line>thead>tr>td, +.z-table.z-bordered-line>tbody>tr>th, +.z-table.z-bordered-line>tbody>tr>td{border:1px solid #d3d3d3;border-left:none;border-right:none;} + +.z-table.z-bordered-line.z-red>thead>tr>th, +.z-table.z-bordered-line.z-red>thead>tr>td, +.z-table.z-bordered-line.z-red>tbody>tr>th, +.z-table.z-bordered-line.z-red>tbody>tr>td{border:1px solid #ea4a36;border-left:none;border-right:none;} +.z-table.z-bordered-line.z-orange>thead>tr>th, +.z-table.z-bordered-line.z-orange>thead>tr>td, +.z-table.z-bordered-line.z-orange>tbody>tr>th, +.z-table.z-bordered-line.z-orange>tbody>tr>td{border:1px solid #ff6600;border-left:none;border-right:none;} +.z-table.z-bordered-line.z-yellow>thead>tr>th, +.z-table.z-bordered-line.z-yellow>thead>tr>td, +.z-table.z-bordered-line.z-yellow>tbody>tr>th, +.z-table.z-bordered-line.z-yellow>tbody>tr>td{border:1px solid #fac603;border-left:none;border-right:none;} +.z-table.z-bordered-line.z-green>thead>tr>th, +.z-table.z-bordered-line.z-green>thead>tr>td, +.z-table.z-bordered-line.z-green>tbody>tr>th, +.z-table.z-bordered-line.z-green>tbody>tr>td{border:1px solid #43cd6e;border-left:none;border-right:none;} +.z-table.z-bordered-line.z-cyan>thead>tr>th, +.z-table.z-bordered-line.z-cyan>thead>tr>td, +.z-table.z-bordered-line.z-cyan>tbody>tr>th, +.z-table.z-bordered-line.z-cyan>tbody>tr>td{border:1px solid #009899;border-left:none;border-right:none;} +.z-table.z-bordered-line.z-blue>thead>tr>th, +.z-table.z-bordered-line.z-blue>thead>tr>td, +.z-table.z-bordered-line.z-blue>tbody>tr>th, +.z-table.z-bordered-line.z-blue>tbody>tr>td{border:1px solid #2a689d;border-left:none;border-right:none;} +.z-table.z-bordered-line.z-purple>thead>tr>th, +.z-table.z-bordered-line.z-purple>thead>tr>td, +.z-table.z-bordered-line.z-purple>tbody>tr>th, +.z-table.z-bordered-line.z-purple>tbody>tr>td{border:1px solid #9e70ca;border-left:none;border-right:none;} + +/* 删除表格上下边框 */ +.z-table.z-bordered-line.zi-bd-t-none>thead>tr:first-child>th, +.z-table.z-bordered-line.zi-bd-t-none>thead>tr:first-child>td, +.z-table.z-bordered-line.zi-bd-t-none>tbody>tr:first-child>th, +.z-table.z-bordered-line.zi-bd-t-none>tbody>tr:first-child>td{border-top:none !important;} + +.z-table.z-bordered-line.zi-bd-b-none>thead>tr:first-child>th, +.z-table.z-bordered-line.zi-bd-b-none>thead>tr:first-child>td, +.z-table.z-bordered-line.zi-bd-b-none>tbody>tr:first-child>th, +.z-table.z-bordered-line.zi-bd-b-none>tbody>tr:first-child>td{border-bottom:none !important;} + +/** 表格边框 */ +.z-table.z-bordered{border:1px solid #d3d3d3;} +.z-table.z-bordered>thead>tr>th, +.z-table.z-bordered>thead>tr>td, +.z-table.z-bordered>tbody>tr>th, +.z-table.z-bordered>tbody>tr>td{border:1px solid #d3d3d3;border-right:none;border-bottom:none;} +.z-table.z-bordered>thead>tr:last-child>th, +.z-table.z-bordered>thead>tr:last-child>td{border-bottom:1px solid #d3d3d3;} + +.z-table.z-bordered.z-red{border:1px solid #ea4a36;} +.z-table.z-bordered.z-red>thead>tr>th, +.z-table.z-bordered.z-red>thead>tr>td, +.z-table.z-bordered.z-red>tbody>tr>th, +.z-table.z-bordered.z-red>tbody>tr>td{border:1px solid #ea4a36;border-right:none;border-bottom:none;} +.z-table.z-bordered.z-red>thead>tr:last-child>th, +.z-table.z-bordered.z-red>thead>tr:last-child>td{border-bottom:1px solid #ea4a36;} +.z-table.z-bordered.z-orange{border:1px solid #ff6600;} +.z-table.z-bordered.z-orange>thead>tr>th, +.z-table.z-bordered.z-orange>thead>tr>td, +.z-table.z-bordered.z-orange>tbody>tr>th, +.z-table.z-bordered.z-orange>tbody>tr>td{border:1px solid #ff6600;border-right:none;border-bottom:none;} +.z-table.z-bordered.z-orange>thead>tr:last-child>th, +.z-table.z-bordered.z-orange>thead>tr:last-child>td{border-bottom:1px solid #ff6600;} +.z-table.z-bordered.z-yellow{border:1px solid #fac603;} +.z-table.z-bordered.z-yellow>thead>tr>th, +.z-table.z-bordered.z-yellow>thead>tr>td, +.z-table.z-bordered.z-yellow>tbody>tr>th, +.z-table.z-bordered.z-yellow>tbody>tr>td{border:1px solid #fac603;border-right:none;border-bottom:none;} +.z-table.z-bordered.z-yellow>thead>tr:last-child>th, +.z-table.z-bordered.z-yellow>thead>tr:last-child>td{border-bottom:1px solid #fac603;} +.z-table.z-bordered.z-green{border:1px solid #43cd6e;} +.z-table.z-bordered.z-green>thead>tr>th, +.z-table.z-bordered.z-green>thead>tr>td, +.z-table.z-bordered.z-green>tbody>tr>th, +.z-table.z-bordered.z-green>tbody>tr>td{border:1px solid #43cd6e;border-right:none;border-bottom:none;} +.z-table.z-bordered.z-green>thead>tr:last-child>th, +.z-table.z-bordered.z-green>thead>tr:last-child>td{border-bottom:1px solid #43cd6e;} +.z-table.z-bordered.z-cyan{border:1px solid #009899;} +.z-table.z-bordered.z-cyan>thead>tr>th, +.z-table.z-bordered.z-cyan>thead>tr>td, +.z-table.z-bordered.z-cyan>tbody>tr>th, +.z-table.z-bordered.z-cyan>tbody>tr>td{border:1px solid #009899;border-right:none;border-bottom:none;} +.z-table.z-bordered.z-cyan>thead>tr:last-child>th, +.z-table.z-bordered.z-cyan>thead>tr:last-child>td{border-bottom:1px solid #009899;} +.z-table.z-bordered.z-blue{border:1px solid #2a689d;} +.z-table.z-bordered.z-blue>thead>tr>th, +.z-table.z-bordered.z-blue>thead>tr>td, +.z-table.z-bordered.z-blue>tbody>tr>th, +.z-table.z-bordered.z-blue>tbody>tr>td{border:1px solid #2a689d;border-right:none;border-bottom:none;} +.z-table.z-bordered.z-blue>thead>tr:last-child>th, +.z-table.z-bordered.z-blue>thead>tr:last-child>td{border-bottom:1px solid #2a689d;} +.z-table.z-bordered.z-purple{border:1px solid #9e70ca;} +.z-table.z-bordered.z-purple>thead>tr>th, +.z-table.z-bordered.z-purple>thead>tr>td, +.z-table.z-bordered.z-purple>tbody>tr>th, +.z-table.z-bordered.z-purple>tbody>tr>td{border:1px solid #9e70ca;border-right:none;border-bottom:none;} +.z-table.z-bordered.z-purple>thead>tr:last-child>th, +.z-table.z-bordered.z-purple>thead>tr:last-child>td{border-bottom:1px solid #9e70ca;} + +/** 表格第一行上边框不要,第一列左边框不要,放置在颜色之后保证所有颜色上左边框都生效 */ +.z-table.z-bordered>thead>tr>th:first-child, +.z-table.z-bordered>thead>tr>td:first-child, +.z-table.z-bordered>tbody>tr>th:first-child, +.z-table.z-bordered>tbody>tr>td:first-child{border-left:none;} +.z-table.z-bordered>thead>tr:first-child>th, +.z-table.z-bordered>thead>tr:first-child>td, +.z-table.z-bordered>tbody>tr:first-child>th, +.z-table.z-bordered>tbody>tr:first-child>td{border-top:none;} + +/** 表格边框圆角时要求第一行第一列和最后一列圆角,保证有背景时上面两个是圆角,下面两个需要手动设置 */ +.z-table.z-bordered.z-bd-rd5>thead>tr:first-child>th:first-child, +.z-table.z-bordered.z-bd-rd5>thead>tr:first-child>td:first-child, +.z-table.z-bordered.z-bd-rd5>tbody>tr:first-child>th:first-child, +.z-table.z-bordered.z-bd-rd5>tbody>tr:first-child>td:first-child, +.z-table.z-bordered.zi-bd-rd5>thead>tr:first-child>th:first-child, +.z-table.z-bordered.zi-bd-rd5>thead>tr:first-child>td:first-child, +.z-table.z-bordered.zi-bd-rd5>tbody>tr:first-child>th:first-child, +.z-table.z-bordered.zi-bd-rd5>tbody>tr:first-child>td:first-child{border-top-left-radius:5px;} + +.z-table.z-bordered.z-bd-rd5>thead>tr:first-child>th:last-child, +.z-table.z-bordered.z-bd-rd5>thead>tr:first-child>td:last-child, +.z-table.z-bordered.z-bd-rd5>tbody>tr:first-child>th:last-child, +.z-table.z-bordered.z-bd-rd5>tbody>tr:first-child>td:last-child, +.z-table.z-bordered.zi-bd-rd5>thead>tr:first-child>th:last-child, +.z-table.z-bordered.zi-bd-rd5>thead>tr:first-child>td:last-child, +.z-table.z-bordered.zi-bd-rd5>tbody>tr:first-child>th:last-child, +.z-table.z-bordered.zi-bd-rd5>tbody>tr:first-child>td:last-child{border-top-right-radius:5px;} + +.z-table.z-bordered.z-bd-rd8>thead>tr:first-child>th:first-child, +.z-table.z-bordered.z-bd-rd8>thead>tr:first-child>td:first-child, +.z-table.z-bordered.z-bd-rd8>tbody>tr:first-child>th:first-child, +.z-table.z-bordered.z-bd-rd8>tbody>tr:first-child>td:first-child, +.z-table.z-bordered.zi-bd-rd8>thead>tr:first-child>th:first-child, +.z-table.z-bordered.zi-bd-rd8>thead>tr:first-child>td:first-child, +.z-table.z-bordered.zi-bd-rd8>tbody>tr:first-child>th:first-child, +.z-table.z-bordered.zi-bd-rd8>tbody>tr:first-child>td:first-child{border-top-left-radius:8px;} + +.z-table.z-bordered.z-bd-rd8>thead>tr:first-child>th:last-child, +.z-table.z-bordered.z-bd-rd8>thead>tr:first-child>td:last-child, +.z-table.z-bordered.z-bd-rd8>tbody>tr:first-child>th:last-child, +.z-table.z-bordered.z-bd-rd8>tbody>tr:first-child>td:last-child, +.z-table.z-bordered.zi-bd-rd8>thead>tr:first-child>th:last-child, +.z-table.z-bordered.zi-bd-rd8>thead>tr:first-child>td:last-child, +.z-table.z-bordered.zi-bd-rd8>tbody>tr:first-child>th:last-child, +.z-table.z-bordered.zi-bd-rd8>tbody>tr:first-child>td:last-child{border-top-right-radius:8px;} + +.z-table.z-bordered.z-bd-rd10>thead>tr:first-child>th:first-child, +.z-table.z-bordered.z-bd-rd10>thead>tr:first-child>td:first-child, +.z-table.z-bordered.z-bd-rd10>tbody>tr:first-child>th:first-child, +.z-table.z-bordered.z-bd-rd10>tbody>tr:first-child>td:first-child, +.z-table.z-bordered.zi-bd-rd10>thead>tr:first-child>th:first-child, +.z-table.z-bordered.zi-bd-rd10>thead>tr:first-child>td:first-child, +.z-table.z-bordered.zi-bd-rd10>tbody>tr:first-child>th:first-child, +.z-table.z-bordered.zi-bd-rd10>tbody>tr:first-child>td:first-child{border-top-left-radius:10px;} + +.z-table.z-bordered.z-bd-rd10>thead>tr:first-child>th:last-child, +.z-table.z-bordered.z-bd-rd10>thead>tr:first-child>td:last-child, +.z-table.z-bordered.z-bd-rd10>tbody>tr:first-child>th:last-child, +.z-table.z-bordered.z-bd-rd10>tbody>tr:first-child>td:last-child, +.z-table.z-bordered.zi-bd-rd10>thead>tr:first-child>th:last-child, +.z-table.z-bordered.zi-bd-rd10>thead>tr:first-child>td:last-child, +.z-table.z-bordered.zi-bd-rd10>tbody>tr:first-child>th:last-child, +.z-table.z-bordered.zi-bd-rd10>tbody>tr:first-child>td:last-child{border-top-right-radius:10px;} + +/* 删除表格上下边框 */ +.z-table.z-bordered.zi-bd-t-none>thead>tr:first-child>th, +.z-table.z-bordered.zi-bd-t-none>thead>tr:first-child>td, +.z-table.z-bordered.zi-bd-t-none>tbody>tr:first-child>th, +.z-table.z-bordered.zi-bd-t-none>tbody>tr:first-child>td{border-top:none !important;} + +.z-table.z-bordered.zi-bd-b-none>thead>tr:first-child>th, +.z-table.z-bordered.zi-bd-b-none>thead>tr:first-child>td, +.z-table.z-bordered.zi-bd-b-none>tbody>tr:first-child>th, +.z-table.z-bordered.zi-bd-b-none>tbody>tr:first-child>td{border-bottom:none !important;} + +/***********************************************/ +/* 第五部分:表单样式定义 */ +/***********************************************/ + +/** 输入框相关 */ +.z-input { + font-family:"微软雅黑","宋体"; + display:inline-block; + vertical-align:middle; + padding:3px 4px; + height:30px; + line-height:22px; + font-size:14px; + color:#000; + background-color:#fff; + border:1px solid #999; + -webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition:border linear .2s, box-shadow linear .2s; + -moz-transition:border linear .2s, box-shadow linear .2s; + -o-transition:border linear .2s, box-shadow linear .2s; + transition:border linear .2s, box-shadow linear .2s; +} + +.z-input.z-red:focus,.z-input.z-red.z-active{border-color:#ea4a36;} +.z-input.z-orange:focus,.z-input.z-orange.z-active{border-color:#ff6600;} +.z-input.z-yellow:focus,.z-input.z-yellow.z-active{border-color:#fac603;} +.z-input.z-green:focus,.z-input.z-green.z-active{border-color:#43cd6e;} +.z-input.z-cyan:focus,.z-input.z-cyan.z-active{border-color:#009899;} +.z-input.z-blue:focus,.z-input.z-blue.z-active{border-color:#28a3ef;} +.z-input.z-purple:focus,.z-input.z-purple.z-active{border-color:#9e70ca;} + +.z-input.z-xsmall{padding:1px 4px;line-height:18px;font-size:12px;height:22px;} +.z-input.z-small {padding:2px 4px;line-height:18px;font-size:12px;height:26px;} +.z-input.z-medium {padding:3px 4px;line-height:22px;font-size:14px;height:30px;} +.z-input.z-large {padding:4px 6px;line-height:24px;font-size:16px;height:34px;} +.z-input.z-xlarge {padding:5px 8px;line-height:26px;font-size:18px;height:38px;} + +/** 多选框 */ +.z-checkbox{display:inline-block;vertical-align:middle;width:16px;height:16px;border:1px solid #909090;cursor:pointer;} +.z-checkbox:hover{border:2px solid #333;} +.z-checkbox.z-red:hover{border:2px solid #ea4a36;} +.z-checkbox.z-orange:hover{border:2px solid #ff6600;} +.z-checkbox.z-yellow:hover{border:2px solid #fac603;} +.z-checkbox.z-green:hover{border:2px solid #43cd6e;} +.z-checkbox.z-cyan:hover{border:2px solid #009899;} +.z-checkbox.z-blue:hover{border:2px solid #28a3ef;} +.z-checkbox.z-purple:hover{border:2px solid #9e70ca;} + +.z-checkbox.z-active{border:1px solid #333;background-color:#333;background-image:url(image/ico_16.png);background-repeat:no-repeat;background-position:0 -192px;} +.z-checkbox.z-red.z-active{border:1px solid #ea4a36;background-color:#ea4a36;} +.z-checkbox.z-orange.z-active{border:1px solid #ff6600;background-color:#ff6600;} +.z-checkbox.z-yellow.z-active{border:1px solid #fac603;background-color:#fac603;} +.z-checkbox.z-green.z-active{border:1px solid #43cd6e;background-color:#43cd6e;} +.z-checkbox.z-cyan.z-active{border:1px solid #009899;background-color:#009899;} +.z-checkbox.z-blue.z-active{border:1px solid #28a3ef;background-color:#28a3ef;} +.z-checkbox.z-purple.z-active{border:1px solid #9e70ca;background-color:#9e70ca;} + +.z-checkbox.z-large{width:18px;height:18px;} +.z-checkbox.z-large.z-active{background-position:1px -191px;width:18px;height:18px;} +.z-checkbox.z-xlarge{width:22px;height:22px;} +.z-checkbox.z-xlarge.z-active{background-image:url(image/ico_22.png);background-position:0 -264px;width:22px;height:22px;} + + +/** 单选框 */ +.z-radio{display:inline-block;vertical-align:middle;width:16px;height:16px;border:1px solid #909090;cursor:pointer;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;} +.z-radio:hover{border:2px solid #333;} +.z-radio.z-red:hover{border:2px solid #ea4a36;} +.z-radio.z-orange:hover{border:2px solid #ff6600;} +.z-radio.z-yellow:hover{border:2px solid #fac603;} +.z-radio.z-green:hover{border:2px solid #43cd6e;} +.z-radio.z-cyan:hover{border:2px solid #009899;} +.z-radio.z-blue:hover{border:2px solid #28a3ef;} +.z-radio.z-purple:hover{border:2px solid #9e70ca;} + +.z-radio.z-active{border:1px solid #333;background-color:#333;background-image:url(image/ico_16.png);background-repeat:no-repeat;background-position:0 -192px;} +.z-radio.z-red.z-active{border:1px solid #ea4a36;background-color:#ea4a36;} +.z-radio.z-orange.z-active{border:1px solid #ff6600;background-color:#ff6600;} +.z-radio.z-yellow.z-active{border:1px solid #fac603;background-color:#fac603;} +.z-radio.z-green.z-active{border:1px solid #43cd6e;background-color:#43cd6e;} +.z-radio.z-cyan.z-active{border:1px solid #009899;background-color:#009899;} +.z-radio.z-blue.z-active{border:1px solid #28a3ef;background-color:#28a3ef;} +.z-radio.z-purple.z-active{border:1px solid #9e70ca;background-color:#9e70ca;} + +.z-radio.z-large{width:18px;height:18px;-moz-border-radius:9px;-webkit-border-radius:9px;border-radius:9px;margin-right:2px;} +.z-radio.z-large.z-active{background-position:1px -191px;width:18px;height:18px;} +.z-radio.z-xlarge{width:22px;height:22px;-moz-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;margin-right:6px;} +.z-radio.z-xlarge.z-active{background-image:url(image/ico_22.png);background-position:0 -264px;width:22px;height:22px;} + +/** 文本框相关 */ +.z-textarea{ + font-family:"微软雅黑","宋体"; + padding:3px 4px; + line-height:22px; + font-size:14px; + color:#000; + background-color:#fff; + border:1px solid #999; + -webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition:border linear .2s, box-shadow linear .2s; + -moz-transition:border linear .2s, box-shadow linear .2s; + -o-transition:border linear .2s, box-shadow linear .2s; + transition:border linear .2s, box-shadow linear .2s; +} + +.z-textarea.z-red:focus,.z-textarea.z-red.z-active{border-color:#ea4a36;} +.z-textarea.z-orange:focus,.z-textarea.z-orange.z-active{border-color:#ff6600;} +.z-textarea.z-yellow:focus,.z-textarea.z-yellow.z-active{border-color:#fac603;} +.z-textarea.z-green:focus,.z-textarea.z-green.z-active{border-color:#43cd6e;} +.z-textarea.z-cyan:focus,.z-textarea.z-cyan.z-active{border-color:#009899;} +.z-textarea.z-blue:focus,.z-textarea.z-blue.z-active{border-color:#28a3ef;} +.z-textarea.z-purple:focus,.z-textarea.z-purple.z-active{border-color:#9e70ca;} + +.z-textarea.z-xsmall{padding:1px 4px;line-height:18px;font-size:12px;} +.z-textarea.z-small {padding:2px 4px;line-height:18px;font-size:12px;} +.z-textarea.z-medium {padding:3px 4px;line-height:22px;font-size:14px;} +.z-textarea.z-large {padding:4px 6px;line-height:24px;font-size:16px;} +.z-textarea.z-xlarge {padding:5px 8px;line-height:26px;font-size:18px;} + +/** 选择框相关 */ +.z-select{ + font-family:"微软雅黑","宋体"; + display:inline-block; + vertical-align:middle; + padding:3px 4px; + height:30px; + line-height:22px; + font-size:14px; + color:#000; + background-color:#fff; + border:1px solid #999; + -webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition:border linear .2s, box-shadow linear .2s; + -moz-transition:border linear .2s, box-shadow linear .2s; + -o-transition:border linear .2s, box-shadow linear .2s; + transition:border linear .2s, box-shadow linear .2s; +} + +.z-select.z-red:focus,.z-select.z-red.z-active{border-color:#ea4a36;} +.z-select.z-orange:focus,.z-select.z-orange.z-active{border-color:#ff6600;} +.z-select.z-yellow:focus,.z-select.z-yellow.z-active{border-color:#fac603;} +.z-select.z-green:focus,.z-select.z-green.z-active{border-color:#43cd6e;} +.z-select.z-cyan:focus,.z-select.z-cyan.z-active{border-color:#009899;} +.z-select.z-blue:focus,.z-select.z-blue.z-active{border-color:#28a3ef;} +.z-select.z-purple:focus,.z-select.z-purple.z-active{border-color:#9e70ca;} + +.z-select.z-xsmall{padding:1px 4px;line-height:18px;font-size:12px;height:22px;} +.z-select.z-small {padding:2px 4px;line-height:18px;font-size:12px;height:26px;} +.z-select.z-medium {padding:3px 4px;line-height:22px;font-size:14px;height:30px;} +.z-select.z-large {padding:4px 6px;line-height:24px;font-size:16px;height:34px;} +.z-select.z-xlarge {padding:5px 8px;line-height:26px;font-size:18px;height:38px;} + +/** 按钮相关 */ +.z-button{ + font-family:"微软雅黑","宋体"; + display:inline-block; + vertical-align:middle; + text-align:center; + margin-bottom:0; + padding:4px 12px; + line-height:20px; + cursor:pointer; + font-size:12px; + filter:progid:DXImageTransform.Microsoft.gradient(enabled = false); + -webkit-user-select:none; + -moz-user-select:none; + -ms-user-select:none; + -o-user-select:none; + user-select:none; + -webkit-border-radius:2px; + -moz-border-radius:2px; + border-radius:2px; + box-sizing:border-box; +} +/** 默认为灰色确认按钮 */ +.z-button{color:#333;background-color:#f2f2f2;border:1px solid #c3c3c3;box-shadow:inset 0 0 .5px .5px #f6f6f6;} +.z-button:hover,.z-button:focus{background-color:#f5f5f5;} +.z-button:active{background-color:#dfdfdf;} + +/** 默认为灰色确认按钮只读 */ +.z-button.z-readonly,.z-button.z-readonly:hover,.z-button.z-readonly:focus,.z-button.z-readonly:active,.z-button.z-readonly.z-active, +.z-button[readonly],.z-button[readonly]:hover,.z-button[readonly]:focus,.z-button[readonly]:active,.z-button[readonly].z-active{ + color:#333;background-color:#f2f2f2;border:1px solid #c3c3c3;box-shadow:inset 0 0 .5px .5px #f6f6f6;cursor:default; +} + +/** 定义确认按钮,颜色为红橙黄绿青蓝紫 */ +.z-button.z-red{box-shadow:none;color:#fff;background-color:#ea4a36;border:1px solid #e8351f;} +.z-button.z-red:hover,.z-button.z-red:focus{background-color:#ed6a5a;} +.z-button.z-red:active{background-color:#ea4a36;} +.z-button.z-orange{box-shadow:none;color:#fff;background-color:#ff6600;border:1px solid #ff4e00;} +.z-button.z-orange:hover,.z-button.z-orange:focus{background-color:#ff8533;} +.z-button.z-orange:active{background-color:#ff6600;} +.z-button.z-yellow{box-shadow:none;color:#fff;background-color:#fac603;border:1px solid #e1b203;} +.z-button.z-yellow:hover,.z-button.z-yellow:focus{background-color:#fbd238;} +.z-button.z-yellow:active{background-color:#fac603;} +.z-button.z-green{box-shadow:none;color:#fff;background-color:#43cd6e;border:1px solid #34c360;} +.z-button.z-green:hover,.z-button.z-green:focus{background-color:;} +.z-button.z-green:active{background-color:#43cd6e;} +.z-button.z-cyan{box-shadow:none;color:#fff;background-color:#009899;border:1px solid #029394;} +.z-button.z-cyan:hover,.z-button.z-cyan:focus{background-color:#4bb0af;} +.z-button.z-cyan:active{background-color:#009899;} +.z-button.z-blue{box-shadow:none;color:#ffffff;background-color:#28a3ef;border:1px solid #1299ec;} +.z-button.z-blue:hover,.z-button.z-blue:focus{background-color:#4cb9fc;} +.z-button.z-blue:active{background-color:#28a3ef} +.z-button.z-purple{box-shadow:none;color:#fff;background-color:#9e70ca;border:1px solid #9469bd;} +.z-button.z-purple:hover,.z-button.z-purple:focus{background-color:#ac7ed7;} +.z-button.z-purple:active{background-color:#9e70ca;} + +/** 定义确认按钮,颜色为红橙黄绿青蓝紫,只读 */ +.z-button.z-red.z-readonly,.z-button.z-red.z-readonly:hover,.z-button.z-red.z-readonly:focus,.z-button.z-red.z-readonly:active,.z-button.z-red.z-readonly.z-active, +.z-button.z-red[readonly],.z-button.z-red[readonly]:hover,.z-button.z-red[readonly]:focus,.z-button.z-red[readonly]:active,.z-button.z-red[readonly].z-active{ + box-shadow:none;color:#fff;background-color:#ea4a36;border:1px solid #e8351f;cursor:default; +} +.z-button.z-orange.z-readonly,.z-button.z-orange.z-readonly:hover,.z-button.z-orange.z-readonly:focus,.z-button.z-orange.z-readonly:active,.z-button.z-orange.z-readonly.z-active, +.z-button.z-orange[readonly],.z-button.z-orange[readonly]:hover,.z-button.z-orange[readonly]:focus,.z-button.z-orange[readonly]:active,.z-button.z-orange[readonly].z-active{ + box-shadow:none;color:#fff;background-color:#ff6600;border:1px solid #ff4e00;cursor:default; +} +.z-button.z-yellow.z-readonly,.z-button.z-yellow.z-readonly:hover,.z-button.z-yellow.z-readonly:focus,.z-button.z-yellow.z-readonly:active,.z-button.z-yellow.z-readonly.z-active, +.z-button.z-yellow[readonly],.z-button.z-yellow[readonly]:hover,.z-button.z-yellow[readonly]:focus,.z-button.z-yellow[readonly]:active,.z-button.z-yellow[readonly].z-active{ + box-shadow:none;color:#fff;background-color:#fac603;border:1px solid #e1b203;cursor:default; +} +.z-button.z-green.z-readonly,.z-button.z-green.z-readonly:hover,.z-button.z-green.z-readonly:focus,.z-button.z-green.z-readonly:active,.z-button.z-green.z-readonly.z-active, +.z-button.z-green[readonly],.z-button.z-green[readonly]:hover,.z-button.z-green[readonly]:focus,.z-button.z-green[readonly]:active,.z-button.z-green[readonly].z-active{ + box-shadow:none;color:#fff;background-color:#43cd6e;border:1px solid #34c360;cursor:default; +} +.z-button.z-cyan.z-readonly,.z-button.z-cyan.z-readonly:hover,.z-button.z-cyan.z-readonly:focus,.z-button.z-cyan.z-readonly:active,.z-button.z-cyan.z-readonly.z-active, +.z-button.z-cyan[readonly],.z-button.z-cyan[readonly]:hover,.z-button.z-cyan[readonly]:focus,.z-button.z-cyan[readonly]:active,.z-button.z-cyan[readonly].z-active{ + box-shadow:none;color:#fff;background-color:#009899;border:1px solid #029394;cursor:default; +} +.z-button.z-blue.z-readonly,.z-button.z-blue.z-readonly:hover,.z-button.z-blue.z-readonly:focus,.z-button.z-blue.z-readonly:active,.z-button.z-blue.z-readonly.z-active, +.z-button.z-blue[readonly],.z-button.z-blue[readonly]:hover,.z-button.z-blue[readonly]:focus,.z-button.z-blue[readonly]:active,.z-button.z-blue[readonly].z-active{ + box-shadow:none;color:#ffffff;background-color:#28a3ef;border:1px solid #1299ec;cursor:default; +} +.z-button.z-purple.z-readonly,.z-button.z-purple.z-readonly:hover,.z-button.z-purple.z-readonly:focus,.z-button.z-purple.z-readonly:active,.z-button.z-purple.z-readonly.z-active, +.z-button.z-purple[readonly],.z-button.z-purple[readonly]:hover,.z-button.z-purple[readonly]:focus,.z-button.z-purple[readonly]:active,.z-button.z-purple[readonly].z-active{ + box-shadow:none;color:#fff;background-color:#9e70ca;border:1px solid #9469bd;cursor:default; +} + +/** 定义边框按钮,选中时为指定的颜色,支持红橙黄绿青蓝紫,1px选中后变2px,相应地padding-1 */ +.z-button.z-bordered{box-shadow:none;color:#333;background-color:#fff;position:relative;} +.z-button.z-bordered.z-hover:hover,.z-button.z-bordered.z-active{border:2px solid #333;padding:3px 11px;} +.z-button.z-bordered.z-large.z-hover:hover,.z-button.z-bordered.z-large.z-active{padding:5px 15px;} +.z-button.z-bordered.z-xlarge.z-hover:hover,.z-button.z-bordered.z-xlarge.z-active{padding:7px 19px;} +.z-button.z-bordered.z-small.z-hover:hover,.z-button.z-bordered.z-small.z-active{padding:1px 11px;} +.z-button.z-bordered.z-xsmall.z-hover:hover,.z-button.z-bordered.z-xsmall.z-active{padding:0px 7px;} +.z-button.z-bordered.z-active:after{ + position:absolute; + width:10px; + height:10px; + line-height:0; + bottom:0; + right:0; + content:url(image/ico_button_bg_black.png); +} + +.z-button.z-bordered.z-red-bd.z-hover:hover,.z-button.z-bordered.z-red-bd.z-active{border:2px solid #ea4a36;} +.z-button.z-bordered.z-orange-bd.z-hover:hover,.z-button.z-bordered.z-orange-bd.z-active{border:2px solid #ff6600;} +.z-button.z-bordered.z-yellow-bd.z-hover:hover,.z-button.z-bordered.z-yellow-bd.z-active{border:2px solid #fac603;} +.z-button.z-bordered.z-green-bd.z-hover:hover,.z-button.z-bordered.z-green-bd.z-active{border:2px solid #43cd6e;} +.z-button.z-bordered.z-cyan-bd.z-hover:hover,.z-button.z-bordered.z-cyan-bd.z-active{border:2px solid #009899;} +.z-button.z-bordered.z-blue-bd.z-hover:hover,.z-button.z-bordered.z-blue-bd.z-active{border:2px solid #28a3ef;} +.z-button.z-bordered.z-purple-bd.z-hover:hover,.z-button.z-bordered.z-purple-bd.z-active{border:2px solid #9e70ca;} +.z-button.z-bordered.z-red-bd.z-active:after{content:url(image/ico_button_bg_red.png);} +.z-button.z-bordered.z-orange-bd.z-active:after{content:url(image/ico_button_bg_orange.png);} +.z-button.z-bordered.z-yellow-bd.z-active:after{content:url(image/ico_button_bg_yellow.png);} +.z-button.z-bordered.z-green-bd.z-active:after{content:url(image/ico_button_bg_green.png);} +.z-button.z-bordered.z-cyan-bd.z-active:after{content:url(image/ico_button_bg_cyan.png);} +.z-button.z-bordered.z-blue-bd.z-active:after{content:url(image/ico_button_bg_blue.png);} +.z-button.z-bordered.z-purple-bd.z-active:after{content:url(image/ico_button_bg_purple.png);} + +/** 定义边框背景筛选按钮,默认移上和选中时背景变颜色,颜色支持红橙黄绿青蓝紫 */ +.z-button.z-bordered-bg{box-shadow:none;color:#333;background-color:#fff;} +.z-button.z-bordered-bg:hover,.z-button.z-bordered-bg.z-active{color:#fff;border:1px solid #333;background-color:#333;} + +.z-button.z-bordered-bg.z-red-bd{border:1px solid #ea4a36;} +.z-button.z-bordered-bg.z-orange-bd{border:1px solid #ff6600;} +.z-button.z-bordered-bg.z-yellow-bd{border:1px solid #fac603;} +.z-button.z-bordered-bg.z-green-bd{border:1px solid #43cd6e;} +.z-button.z-bordered-bg.z-cyan-bd{border:1px solid #009899;} +.z-button.z-bordered-bg.z-blue-bd{border:1px solid #28a3ef;} +.z-button.z-bordered-bg.z-purple-bd{border:1px solid #9e70ca;} + +.z-button.z-bordered-bg.z-red-bg:hover,.z-button.z-bordered-bg.z-red-bg.z-active{color:#fff;border:1px solid #ea4a36;background-color:#ea4a36;} +.z-button.z-bordered-bg.z-orange-bg:hover,.z-button.z-bordered-bg.z-orange-bg.z-active{color:#fff;border:1px solid #ff6600;background-color:#ff6600;} +.z-button.z-bordered-bg.z-yellow-bg:hover,.z-button.z-bordered-bg.z-yellow-bg.z-active{color:#fff;border:1px solid #fac603;background-color:#fac603;} +.z-button.z-bordered-bg.z-green-bg:hover,.z-button.z-bordered-bg.z-green-bg.z-active{color:#fff;border:1px solid #43cd6e;background-color:#43cd6e;} +.z-button.z-bordered-bg.z-cyan-bg:hover,.z-button.z-bordered-bg.z-cyan-bg.z-active{color:#fff;border:1px solid #009899;background-color:#009899;} +.z-button.z-bordered-bg.z-blue-bg:hover,.z-button.z-bordered-bg.z-blue-bg.z-active{color:#fff;border:1px solid #28a3ef;background-color:#28a3ef;} +.z-button.z-bordered-bg.z-purple-bg:hover,.z-button.z-bordered-bg.z-purple-bg.z-active{color:#fff;border:1px solid #9e70ca;background-color:#9e70ca;} + +/** 定义删除按钮,颜色支持红橙黄绿青蓝紫 */ +.z-button.z-bordered-del{box-shadow:none;color:#333;background-color:#fff;position:relative;padding-right:32px;border:1px solid #333;} +.z-button.z-bordered-del:after{position:absolute;top:0;right:0;width:20px;height:100%;border:1px solid #333;background-color:#333;padding:inherit;padding-left:0;padding-right:0;content:"╳";text-indent:0;color:#fff;font-size:16px;font-weight:700;} + +.z-button.z-bordered-del.z-red-bd{border:1px solid #ea4a36;} +.z-button.z-bordered-del.z-orange-bd{border:1px solid #ff6600;} +.z-button.z-bordered-del.z-yellow-bd{border:1px solid #fac603;} +.z-button.z-bordered-del.z-green-bd{border:1px solid #43cd6e;} +.z-button.z-bordered-del.z-cyan-bd{border:1px solid #009899;} +.z-button.z-bordered-del.z-blue-bd{border:1px solid #28a3ef;} +.z-button.z-bordered-del.z-purple-bd{border:1px solid #9e70ca;} + +.z-button.z-bordered-del.z-red-bd:after{border:1px solid #ea4a36;background-color:#ea4a36;} +.z-button.z-bordered-del.z-orange-bd:after{border:1px solid #ff6600;background-color:#ff6600;} +.z-button.z-bordered-del.z-yellow-bd:after{border:1px solid #fac603;background-color:#fac603;} +.z-button.z-bordered-del.z-green-bd:after{border:1px solid #43cd6e;background-color:#43cd6e;} +.z-button.z-bordered-del.z-cyan-bd:after{border:1px solid #009899;background-color:#009899;} +.z-button.z-bordered-del.z-blue-bd:after{border:1px solid #28a3ef;background-color:#28a3ef;} +.z-button.z-bordered-del.z-purple-bd:after{border:1px solid #9e70ca;background-color:#9e70ca;} + +.z-button.z-bordered-del.z-xlarge{padding-right:54px;} +.z-button.z-bordered-del.z-large{padding-right:44px;} +.z-button.z-bordered-del.z-small{padding-right:32px;} +.z-button.z-bordered-del.z-xsmall{padding-right:28px;} + +.z-button.z-bordered-del.z-xlarge:after{width:32px;font-size:22px;} +.z-button.z-bordered-del.z-large:after{width:28px;font-size:20px;} + +/** 提供除默认之外的四种默认大小风格 */ +.z-button.z-xlarge{padding:8px 20px;line-height:24px;font-size:16px;} +.z-button.z-large{padding:6px 16px;line-height:24px;font-size:14px;} +.z-button.z-small{padding:2px 12px;line-height:18px;font-size:12px;} +.z-button.z-xsmall{padding:1px 8px;line-height:18px;font-size:12px;} + +/** 定义字体图标比文本大2像素,和文本间隔4像素 */ +.z-button.z-font{bottom:0;} +.z-button .z-font{margin-right:4px;font-size:14px;line-height:1;} +.z-button.z-large .z-font{font-size:16px;} +.z-button.z-xlarge .z-font{font-size:18px;} + +/** 定义图片上移2像素并,提供默认的图标 */ +.z-button img{display:inline-block;vertical-align:middle;margin-top:-2px;} +.z-button .z-checkbox,.z-button .z-radio{margin-right:5px;margin-top:-1px;} +.z-button.z-large .z-checkbox,.z-button.z-xlarge .z-checkbox,.z-button.z-large .z-radio,.z-button.z-xlarge .z-radio{margin-right:8px;margin-top:-2px;} + +/** 定义按钮不可用 */ +.z-button.z-disabled, +.z-button[disabled], +.z-button.z-disabled:hover, +.z-button[disabled]:hover, +.z-button.z-disabled:focus, +.z-button[disabled]:focus, +.z-button.z-disabled:active, +.z-button[disabled]:active, +.z-button.z-disabled.z-active, +.z-button[disabled].z-active{ + color:#bbb; + background-color:#ddd; + border:1px solid #ccc; + cursor:not-allowed; +} + +/***********************************************/ +/* 第六部分:步骤条定义 */ +/***********************************************/ +.z-stepbar {display:table;width:100%;color:#999;font-size:12px;background-color:#eee;overflow:hidden;} +.z-stepbar>nav {display:table-cell;position:relative;vertical-align:middle;padding-left:26px;cursor:default;line-height:32px;} +.z-stepbar>nav:before,.z-stepbar>nav:after{content:"";display:inline-block;position:absolute;width:0px;height:0px;border-style:solid;z-index:1;} +.z-stepbar>nav:before{top:-4px;right:-40px;border-width:20px;border-color:transparent transparent transparent #fff;} +.z-stepbar>nav:after{right:-31px;border-width:16px;border-color:transparent transparent transparent #eee;} + +.z-stepbar>nav.z-active{color:#fff;background-color:#666;} +.z-stepbar>nav.z-active:after{border-color:transparent transparent transparent #666;} +.z-stepbar>nav.z-active .z-round{color:#666;} + +/** 步骤条颜色 */ +.z-stepbar.z-red>nav.z-active{background-color:#ea4a36;} +.z-stepbar.z-red>nav.z-active:after{border-color:transparent transparent transparent #ea4a36;} +.z-stepbar.z-red>nav.z-active .z-round{color:#ea4a36;} +.z-stepbar.z-orange>nav.z-active{background-color:#ff6600;} +.z-stepbar.z-orange>nav.z-active:after{border-color:transparent transparent transparent #ff6600;} +.z-stepbar.z-orange>nav.z-active .z-round{color:#ff6600;} +.z-stepbar.z-yellow>nav.z-active{background-color:#fac603;} +.z-stepbar.z-yellow>nav.z-active:after{border-color:transparent transparent transparent #fac603;} +.z-stepbar.z-yellow>nav.z-active .z-round{color:#fac603;} +.z-stepbar.z-green>nav.z-active{background-color:#43cd6e;} +.z-stepbar.z-green>nav.z-active:after{border-color:transparent transparent transparent #43cd6e;} +.z-stepbar.z-green>nav.z-active .z-round{color:#43cd6e;} +.z-stepbar.z-cyan>nav.z-active{background-color:#009899;} +.z-stepbar.z-cyan>nav.z-active:after{border-color:transparent transparent transparent #009899;} +.z-stepbar.z-cyan>nav.z-active .z-round{color:#009899;} +.z-stepbar.z-blue>nav.z-active{background-color:#28a3ef;} +.z-stepbar.z-blue>nav.z-active:after{border-color:transparent transparent transparent #28a3ef;} +.z-stepbar.z-blue>nav.z-active .z-round{color:#28a3ef;} +.z-stepbar.z-purple>nav.z-active{background-color:#9e70ca;} +.z-stepbar.z-purple>nav.z-active:after{border-color:transparent transparent transparent #9e70ca;} +.z-stepbar.z-purple>nav.z-active .z-round{color:#9e70ca;} + +/************************************************************/ +/* 第七部分:标签页定义 +/************************************************************/ +.z-tabnav{position:relative;float:left;width:100%;} +.z-tabnav>nav {position:relative;float:left;width:100%;height:43px;font-size:14px;z-index:20;border-bottom:1px solid #d3d3d3;} +.z-tabnav>nav>span{position:relative;float:left;margin-top:2px;height:43px;line-height:43px;color:#333;font-weight:700;font-size:16px;} +.z-tabnav>nav>ul {position:relative;float:left;margin:10px 20px 0 20px;font-size:12px;height:33px;} +.z-tabnav>nav li {position:relative;float:left;height:100%;margin-right:5px;padding:10px 20px 0 20px;border:1px solid transparent;display:inline-block;vertical-align:middle;cursor:pointer;} +.z-tabnav>nav li:hover{border:1px solid #d7d7d7;background-color:#d7d7d7;} +.z-tabnav>nav li.z-active{border:1px solid #d3d3d3;border-bottom:1px solid #fff;cursor:default;} +.z-tabnav>nav li.z-active:hover{background-color:#fff;} +.z-tabnav>section{position:relative;float:left;width:100%;height:auto;min-height:43px;} +.z-tabnav>section>div{position:relative;float:left;width:100%;height:auto;min-height:43px;background-color:#fff;display:none;} +.z-tabnav>section>div.z-active{display:block !important;} + +.z-tabnav.z-bordered>nav {border:1px solid #d3d3d3;background-color:#f5f5f5;} +.z-tabnav.z-bordered>nav>span:not(.z-cover){text-indent:20px;} +.z-tabnav.z-bordered>nav>ul {margin-top:9px;} +.z-tabnav.z-bordered>nav li {border:1px solid transparent;} +.z-tabnav.z-bordered>nav li.z-active{border:1px solid #d3d3d3;border-bottom:none;background-color:#fff;cursor:default;} +.z-tabnav.z-bordered>section{border:1px solid #d3d3d3;border-top:none;} + +.z-tabnav>nav>ul.z-left{float:left;} +.z-tabnav>nav>ul.z-right{float:right;} +.z-tabnav>section.z-bordered {border:1px solid #d3d3d3;border-top:none;} + +.z-tabnav-main{position:relative;float:left;width:100%;min-height:50px;height:50px;background:#f6f6f6;color:#666; border:1px solid #dcdcdc; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius:2px;} +.z-tabnav-main>nav{position:relative;float:left;width:100%;font-size:16px;line-height:50px;} +.z-tabnav-main>nav>span{position:relative;float:left;margin-top:2px;height:48px;line-height:48px;color:#333;font-weight:700;font-size:16px;} +.z-tabnav-main>nav>ul {position:relative;float:left;height:50px;} +.z-tabnav-main>nav li {position:relative;float:left;line-height:48px; height:48px;padding:0 15px;border-right:1px solid #dcdcdc;cursor:pointer;} +.z-tabnav-main>nav li:hover{background-color:#fff;} +.z-tabnav-main>nav li.z-active{color:#fff;background:#333;cursor:default;} +.z-tabnav-main>nav li.z-active:hover{background-color:#333;} +.z-tabnav-main>section{position:relative;float:left;width:100%;height:auto;min-height:43px;} +.z-tabnav-main>section>div{position:relative;float:left;width:100%;height:auto;min-height:43px;background-color:#fff;display:none;} +.z-tabnav-main>section>div.z-active{display:block !important;} + +.z-tabnav-main.z-red>nav li.z-active{color:#fff;background:#ea4a36;} +.z-tabnav-main.z-red>nav li.z-active:hover{background-color:#ea4a36;} +.z-tabnav-main.z-orange>nav li.z-active{color:#fff;background:#ff6600;} +.z-tabnav-main.z-orange>nav li.z-active:hover{background-color:#ff6600;} +.z-tabnav-main.z-yellow>nav li.z-active{color:#fff;background:#fac603;} +.z-tabnav-main.z-yellow>nav li.z-active:hover{background-color:#fac603;} +.z-tabnav-main.z-green>nav li.z-active{color:#fff;background:#43cd6e;} +.z-tabnav-main.z-green>nav li.z-active:hover{background-color:#43cd6e;} +.z-tabnav-main.z-cyan>nav li.z-active{color:#fff;background:#009899;} +.z-tabnav-main.z-cyan>nav li.z-active:hover{background-color:#009899;} +.z-tabnav-main.z-blue>nav li.z-active{color:#fff;background:#28a3ef;} +.z-tabnav-main.z-blue>nav li.z-active:hover{background-color:#28a3ef;} +.z-tabnav-main.z-purple>nav li.z-active{color:#fff;background:#9e70ca;} +.z-tabnav-main.z-purple>nav li.z-active:hover{background-color:#9e70ca;} + +/************************************************************/ +/* 第八部分:可编辑文本定义 +/************************************************************/ + +.z-editable{display:inline-block;} +.z-editable .z-show{display:inline-block;} +.z-editable .z-pen{display:inline-block;vertical-align:middle;margin-left:4px;margin-bottom:2px;overflow:hidden;cursor:pointer;background-repeat:no-repeat;} +.z-editable .z-edit{display:none;vertical-align:middle;} + +/************************************************************/ +/* 第九部分:对话框样式定义 +/************************************************************/ +.z-dialog-shadow{position:absolute;z-index:19999;} +.z-dialog {font-family:"微软雅黑";position:absolute;width:100%;height:100%;z-index:20000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} +.z-dialog .z-background{position:absolute;top:0; height:0;width:100%; height:100%;z-index:20001;} +.z-dialog .z-wrap{position:absolute;top:0;left:0;width:100%; height:100%;overflow:hidden;z-Index:20002;} +.z-dialog .z-title {position:absolute;top:0;left:0;width:100%;height:40px;line-height:40px;border:1px solid #ccc;border-bottom:none;background-color:#f5f5f5;} +.z-dialog .z-title span{float:left;margin:0;color:#333;font-size:14px;font-weight:normal;text-indent:10px;} +.z-dialog .z-title i{position:absolute;top:0;right:10px;cursor:pointer;font-size:18px;color:#666;} +.z-dialog .z-title i:hover,.z-dialog .z-title i:active,.z-dialog .z-title i:focus{color:#333;} + +.z-dialog .z-content{position:absolute;top:40px;left:0;width:100%;padding:0;overflow:auto;border:1px solid #a6c9e1;background-color:#fff;} +.z-dialog .z-content>.z-container{position:absolute;top:0;left:0;width:100%;height:auto !important;font-size:14px;} +.z-dialog .z-content>.z-container>span{position:absolute;top:0;left:0;width:100%;height:100%;padding:15px 15px 0 60px;line-height:20px;} +.z-dialog .z-content>.z-container>.z-alert, +.z-dialog .z-content>.z-container>.z-confirm, +.z-dialog .z-content>.z-container>.z-failure, +.z-dialog .z-content>.z-container>.z-success{position:absolute;top:15px;left:15px;} +.z-dialog .z-content>.z-container>.z-prompt{margin:15px 0;padding:0 10px;line-height:20px;width:100%;} +.z-dialog .z-content>.z-container>.z-prompt input{width:100%;height:40px;} +.z-dialog .z-content>.z-container>.z-prompt textarea{width:100%;height:70px;font-size:14px;} +.z-dialog .z-content>.z-container>.z-loading{position:absolute;top:9px;left:15px;} +.z-dialog .z-content>.z-console{position:absolute;bottom:0;left:0;width:100%;height:44px;background-color:#f5f5f5;} +.z-dialog .z-content>.z-console .z-ok{position:absolute;top:8px;right:80px;} +.z-dialog .z-content>.z-console .z-cancel{position:absolute;top:8px;right:10px;} +.z-dialog:focus,.z-dialog-shadow:focus{outline:none;} +/***********************************************/ +/* 第十部分:浮动窗定义 */ +/***********************************************/ + +.z-floater{position:absolute;top:0;left:0;z-index:200;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} +.z-floater .z-arrow{position:absolute;top:0;left:0;} +.z-floater .z-content{position:absolute;top:0;left:0;min-width:130px;min-height:25px;padding:6px;font-size:12px;border:1px solid #c6c6c6;line-height:25px;text-align:left;background:#fff;} + +/***********************************************/ +/* 第十一部分:日历样式定义 */ +/***********************************************/ +.z-calendar{font-family:"微软雅黑",Arial;color:#333;width:283px !important;height:auto !important;border:1px solid #ccc;background-color:#fff;} +.z-calendar tr{height:auto !important;} + +/** 定义顶部年月样式 */ +.z-calendar .z-top{height:40px !important;line-height:40px;text-align:center;border-bottom:1px solid #ccc;} +.z-calendar .z-top .z-arrow{position:relative;width:0;height:0;border-style:solid;} +.z-calendar .z-top .z-arrow.z-left{border-width:8px 8px 8px 0;border-color:transparent #bcbcbc transparent transparent;} +.z-calendar .z-top .z-arrow.z-right{border-width:8px 0 8px 8px;border-color:transparent transparent transparent #bcbcbc;} +.z-calendar .z-top .z-year-month{height:40px;font-size:18px;text-align:center;font-weight:700;cursor:pointer;} +.z-calendar .z-top .z-year-month:hover, +.z-calendar .z-top .z-year-month:focus{background-color:#bcbcbc;} + +/** 定义下拉列表参数列表 */ +.z-calendar .z-top .z-year-list{position:absolute;top:40px;width:221px;max-height:212px;border:1px solid #ccc;border-collapse:collapse;background-color:#fff;overflow-x:hidden;overflow-y:auto;z-index:110;} +.z-calendar .z-top .z-year-list span{display:inline-block;float:left;width:65px;color:#333;font-size:12px;font-weight:500;cursor:pointer;padding:4px 8px;} + +/** 定义下拉列表参数已选中和关闭按钮(年最后一个) */ +.z-calendar .z-top .z-year-list span.z-selected, +.z-calendar .z-top .z-year-list span.z-close{color:#fff;background-color:#84c1ff;} + +.z-calendar .z-top .z-year-list span:hover, +.z-calendar .z-top .z-year-list span:focus, +.z-calendar .z-top .z-year-list span:active{color:#fff;background-color:#28a3ef;} + +/** 星期安排 */ +.z-calendar .z-week{height:30px !important;line-height:30px;text-align:center;color:#999;text-align:center;border-bottom:1px solid #ccc;} + +/** 日期安排 */ +.z-calendar .z-day td{width:40px !important;height:30px !important;line-height:30px;font-size:14px;text-align:center;background-color:#fff;cursor:pointer;color:#bcbabc;} +.z-calendar .z-day td.z-nomonth{color:#bcbabc;} +.z-calendar .z-day td.z-tomonth{color:#333;} +.z-calendar .z-day td.z-today{color:#ff8533;} +.z-calendar .z-day td:hover,.z-calendar .z-day td:focus{background-color:#eee;} +.z-calendar .z-day td.z-selected{color:#fff;background-color:#2e92d9;} + +/** 时间控件 */ +.z-calendar .z-timebox{border-top:1px solid #ccc;} +.z-calendar .z-timebox .z-sliderline {position:relative;margin-top:10px;width:100%;height:20px;} +.z-calendar .z-timebox .z-sliderline dt{position:absolute;top:1px;left:8px;} +.z-calendar .z-timebox .z-sliderline .z-scrollbar{position:absolute;top:5px;left:53px;height:8px;width:216px;background-color:#d9d9d9;} +.z-calendar .z-timebox .z-sliderline .z-sliderbox{position:absolute;top:1px;left:53px;width:216px;height:16px;} +.z-calendar .z-timebox .z-sliderline .z-sliderbox .z-slider{position:absolute;top:0px;left:0px;width:16px;height:16px;cursor:pointer;background:#28a3ef;} +.z-calendar .z-timebox .z-time{display:inline-block;font-size:12px;width:180px;height:30px;line-height:30px;padding-left:8px;} +.z-calendar .z-timebox .z-close{float:right;margin-right:3px;margin-top:4px;} + +/***********************************************/ +/* 第十二部分:下拉列表定义 */ +/***********************************************/ +.z-dropdown { + font-family:"微软雅黑"; + position:relative; + display:inline-block; + vertical-align:middle; + box-sizing:border-box; + padding:3px 4px; + cursor:pointer; + margin-bottom:0; + margin-right:0; + font-size:14px; + line-height:22px; + text-align:left; + color:#333; + border:1px solid #999; + background-color:#fff; + filter:progid:DXImageTransform.Microsoft.gradient(enabled = false); + -webkit-user-select:none; + -moz-user-select:none; + -ms-user-select:none; + -o-user-select:none; + user-select:none; +} + +/* 箭头固定12px,上偏移和右偏移 */ +.z-dropdown>i{font-size:12px;margin-top:-1px;margin-right:4px;} +.z-dropdown.z-active{border:1px solid #999;} +.z-dropdown>.z-default{display:inline-block;height:100%;width:calc(100% - 22px);} +.z-dropdown>.z-default>input{padding:0;} + +.z-dropdown>.z-list{position:absolute;border:1px solid #999;background-color:#fff;max-height:200px;overflow-x:hidden;overflow-y:auto; display:none;z-index:110;} +.z-dropdown>.z-list.z-none::before{content:'';display:inline-block;width:100%;text-align:center;} +.z-dropdown>.z-list>span{float:left;color:#333;font-size:12px;cursor:pointer;padding:3px 4px;display:inline-block;} +.z-dropdown>.z-list>span[selected], +.z-dropdown>.z-list>span.z-selected{color:#fff;background-color:#ccc;} +.z-dropdown>.z-list>span[selected]:hover, +.z-dropdown>.z-list>span[selected]:focus, +.z-dropdown>.z-list>span[selected]:active, +.z-dropdown>.z-list>span:hover, +.z-dropdown>.z-list>span:focus, +.z-dropdown>.z-list>span:active{color:#fff;background-color:#999;} + +/** 下拉列表颜色 */ +.z-dropdown.z-red.z-active, +.z-dropdown.z-red>.z-list{border:1px solid #ea4a36;} +.z-dropdown.z-red>.z-list>span[selected], +.z-dropdown.z-red>.z-list>span.z-selected{background-color:#ed6a5a;} +.z-dropdown.z-red>.z-list>span[selected]:hover, +.z-dropdown.z-red>.z-list>span[selected]:focus, +.z-dropdown.z-red>.z-list>span[selected]:active, +.z-dropdown.z-red>.z-list>span:hover, +.z-dropdown.z-red>.z-list>span:focus, +.z-dropdown.z-red>.z-list>span:active{background-color:#ea4a36;} + +.z-dropdown.z-orange.z-active, +.z-dropdown.z-orange>.z-list{border:1px solid #ff6600;} +.z-dropdown.z-orange>.z-list>span[selected], +.z-dropdown.z-orange>.z-list>span.z-selected{background-color:#ff8533;} +.z-dropdown.z-orange>.z-list>span[selected]:hover, +.z-dropdown.z-orange>.z-list>span[selected]:focus, +.z-dropdown.z-orange>.z-list>span[selected]:active, +.z-dropdown.z-orange>.z-list>span:hover, +.z-dropdown.z-orange>.z-list>span:focus, +.z-dropdown.z-orange>.z-list>span:active{background-color:#ff6600;} + +.z-dropdown.z-yellow.z-active, +.z-dropdown.z-yellow>.z-list{border:1px solid #fac603;} +.z-dropdown.z-yellow>.z-list>span[selected], +.z-dropdown.z-yellow>.z-list>span.z-selected{background-color:#fbd238;} +.z-dropdown.z-yellow>.z-list>span[selected]:hover, +.z-dropdown.z-yellow>.z-list>span[selected]:focus, +.z-dropdown.z-yellow>.z-list>span[selected]:active, +.z-dropdown.z-yellow>.z-list>span:hover, +.z-dropdown.z-yellow>.z-list>span:focus, +.z-dropdown.z-yellow>.z-list>span:active{background-color:#fac603;} + +.z-dropdown.z-green.z-active, +.z-dropdown.z-green>.z-list{border:1px solid #43cd6e;} +.z-dropdown.z-green>.z-list>span[selected], +.z-dropdown.z-green>.z-list>span.z-selected{background-color:#49de79;} +.z-dropdown.z-green>.z-list>span[selected]:hover, +.z-dropdown.z-green>.z-list>span[selected]:focus, +.z-dropdown.z-green>.z-list>span[selected]:active, +.z-dropdown.z-green>.z-list>span:hover, +.z-dropdown.z-green>.z-list>span:focus, +.z-dropdown.z-green>.z-list>span:active{background-color:#43cd6e;} + +.z-dropdown.z-cyan.z-active, +.z-dropdown.z-cyan>.z-list{border:1px solid #009899;} +.z-dropdown.z-cyan>.z-list>span[selected], +.z-dropdown.z-cyan>.z-list>span.z-selected{background-color:#4bb0af;} +.z-dropdown.z-cyan>.z-list>span[selected]:hover, +.z-dropdown.z-cyan>.z-list>span[selected]:focus, +.z-dropdown.z-cyan>.z-list>span[selected]:active, +.z-dropdown.z-cyan>.z-list>span:hover, +.z-dropdown.z-cyan>.z-list>span:focus, +.z-dropdown.z-cyan>.z-list>span:active{background-color:#009899;} + +.z-dropdown.z-blue.z-active, +.z-dropdown.z-blue>.z-list{border:1px solid #28a3ef;} +.z-dropdown.z-blue>.z-list>span[selected], +.z-dropdown.z-blue>.z-list>span.z-selected{background-color:#4cb9fc;} +.z-dropdown.z-blue>.z-list>span[selected]:hover, +.z-dropdown.z-blue>.z-list>span[selected]:focus, +.z-dropdown.z-blue>.z-list>span[selected]:active, +.z-dropdown.z-blue>.z-list>span:hover, +.z-dropdown.z-blue>.z-list>span:focus, +.z-dropdown.z-blue>.z-list>span:active{background-color:#28a3ef;} + +.z-dropdown.z-purple.z-active, +.z-dropdown.z-purple>.z-list{border:1px solid #9e70ca;} +.z-dropdown.z-purple>.z-list>span[selected], +.z-dropdown.z-purple>.z-list>span.z-selected{background-color:#ac7ed7;} +.z-dropdown.z-purple>.z-list>span[selected]:hover, +.z-dropdown.z-purple>.z-list>span[selected]:focus, +.z-dropdown.z-purple>.z-list>span[selected]:active, +.z-dropdown.z-purple>.z-list>span:hover, +.z-dropdown.z-purple>.z-list>span:focus, +.z-dropdown.z-purple>.z-list>span:active{background-color:#9e70ca;} + +.z-dropdown.z-xsmall,.z-dropdown.z-xsmall>.z-list>span{padding:1px 4px;line-height:18px;font-size:12px;height:22px;} +.z-dropdown.z-small,.z-dropdown.z-small>.z-list>span {padding:2px 4px;line-height:18px;font-size:12px;height:26px;} +.z-dropdown.z-medium,.z-dropdown.z-medium>.z-list>span {padding:3px 4px;line-height:22px;font-size:14px;height:30px;} +.z-dropdown.z-large,.z-dropdown.z-large>.z-list>span {padding:4px 6px;line-height:24px;font-size:16px;height:34px;} +.z-dropdown.z-xlarge,.z-dropdown.z-xlarge>.z-list>span {padding:5px 8px;line-height:26px;font-size:18px;height:38px;} + +/***********************************************/ +/* 第十三部分:产品图放大器 */ +/***********************************************/ +.z-magicZoom{z-index:89;} +.z-magicZoom .z-zoomImg{width:100%;} +.z-magicZoom .z-zoomImg>.z-font{background:rgba(0,0,0,.05);} +.z-magicZoom .z-zoomImg>.z-zoomCover{background-color:rgba(255,220,80,.3);cursor:move;} +.z-magicZoom .z-zoomList>div>ul{position:absolute;left:0;top:0;margin-left:2px;-webkit-transition:left 500ms;transition:left 500ms;} +.z-magicZoom .z-zoomList>div>ul>li{float:left;margin:3px;cursor:pointer;} +.z-magicZoom .z-zoomShow{z-index:89;background-color:#fcfcfc;} +.z-magicZoom .z-zoomShow>img{max-width:none;max-height:none;} + +/***********************************************/ +/* 第十三部分:banner 滚动图 */ +/***********************************************/ +.z-slider{z-index:9;} +.z-slider .z-sliderList>ul,.z-slider .z-sliderList>ul>li{position:absolute;width:100%;height:100%;} +.z-slider .z-sliderList>ul{-webkit-transition-property:transform;transition-property:transform;} +.z-slider .z-sliderList>ul>li{-webkit-transition-timing-function:ease;transition-timing-function:ease;z-index:2;} +.z-slider .z-sliderList>ul>li.z-active{z-index:1;} + +/* tab导航 */ +.z-sliderTab{z-index:2;} +.z-sliderTab>div{display:inline-block;margin:0 3px;cursor:pointer;position:relative;top:-30px;} + +.z-sliderTab-disc>div{width:12px;height:12px;border-radius:50%;background:rgba(255,255,255,.4);} +.z-sliderTab-disc>div.z-active,.z-sliderTab-square>div.z-active{background:rgba(255,255,255,1);} + +.z-sliderTab-circle>div{width:12px;height:12px;border-radius:50%;border:2px solid rgba(255,255,255,.4);} +.z-sliderTab-circle>div.z-active{border-color:rgba(255,255,255,1);} + +.z-sliderTab-square>div{width:26px;height:4px;background:rgba(255,255,255,.4);} + +/* 左右按钮 */ +.z-sliderBtn{top:50%;z-index:2;} +.z-sliderBtn>div{margin-top:-50px;opacity:.2;} +.z-sliderBtn.z-active>div{opacity:1;} +.z-sliderBtn>div>.z-font{font-size:40px;line-height:40px;top:50%;margin-top:-20px;} + diff --git a/zhiqim_ui/release/zhiqim_v1.5.0.r2019010101.min.js b/zhiqim_ui/release/zhiqim_v1.5.0.r2019010101.min.js new file mode 100644 index 0000000..cafa370 --- /dev/null +++ b/zhiqim_ui/release/zhiqim_v1.5.0.r2019010101.min.js @@ -0,0 +1 @@ ++(function(window,undefined){var document=window.document;document.createElement("zcover");var Z=window.Z=window.zhiqim=function(selector){return new Z.Query({selector:selector})};Z.v="1.4.0";Z.u=undefined;Z.d=window.document;Z.l=window.location;Z.n=window.navigator;Z.ua=Z.n.userAgent.toLowerCase();Z._D_="0123456789";Z._LU_="ABCDEFGHIJKLMNOPQRSTUVWXYZ";Z._LL_="abcdefghijklmnopqrstuvwxyz";Z._L_=Z._LU_+Z._LL_;Z._DL_=Z._D_+Z._L_;Z._DLL_=Z._D_+Z._LL_;Z._DLU_=Z._D_+Z._LU_;Z._DH_=Z._D_+"abcdefABCDEF";Z._DHL_=Z._D_+"abcdef";Z._DHU_=Z._D_+"ABCDEF";Z._SYM_="._-`~!@#$%";Z.body=function(){if(Z.d.body){return Z.d.body}else{Z.alert("未初始化body,请在Z.onload之后调用!");throw"nobody"}};Z.assert=function(require,exception,message){if(!require){Z.alert(message);throw exception}};Z.evals=function(expression){try{return eval("("+expression+")")}catch(e){return null}};Z.loads=function(src,callback){var $script=document.createElement("script");$script.src=src;$script.onload=callback;document.body.appendChild($script)};Z.alert=function(text,callback,param){alert(text);if(Z.T.isFunction(callback)){callback()}};Z.success=function(text,callback,param){param=param||{};param.type="success";Z.alert(text,callback,param)};Z.failure=function(text,callback,param){param=param||{};param.type="failure";Z.alert(text,callback,param)};Z.confirm=function(text,callback,param){if(confirm(text)){callback()}};Z.prompt=function(text,value,callback,param){if(prompt(text,value)){callback()}};Z.copy=function(text,type){if(!text){Z.alert("请输入要复制的文本");return}if(!document.execCommand){Z.alert("当前浏览器不支持复制");return}var $textarea=Z("").appendTo("body");type=type||"text";if(type=="val"){$textarea.val(text)}else{if(type=="html"){$textarea.html(text)}else{$textarea.text(text)}}$textarea.select();document.execCommand("copy");$textarea.remove()};Z.bind=function(f,$this){if(!Z.bind.fs){Z.bind.fs=[];Z.bind.ts=[];Z.bind.ns=[]}var ind=-1;Z.each(Z.bind.fs,function(_f,i){if(_f!==f){return}if(Z.bind.ts[i]!==$this){return}ind=i;return true});if(ind==-1){ind=Z.bind.fs.length;Z.bind.fs[ind]=f;Z.bind.ts[ind]=$this;Z.bind.ns[ind]=function(){f.apply($this,arguments)}}return Z.bind.ns[ind]};Z.each=function(object,callback){return Z.eachof(null,object,callback)};Z.eachof=function($this,object,callback){if(!object||!Z.T.isFunction(callback)){return}if(!Z.T.isLikeArray(object)&&!Z.T.isPlainObject(object)&&!Z.T.isString(object)&&!Z.T.isNumber(object)){return}var args=[];for(var a=0;a=times){clearInterval(timer);if(complete){complete.call($this)}}else{if(process){process.call($this,curTimes)}}}return timer};Z.rootPath=function(contextPath,path){return((contextPath==null||contextPath=="/")?"":contextPath)+(Z.S.startWith(path,"/")?"":"/")+path};Z.textLineNum=function(text,width,fontSize,fontFamily,letterSpacing){fontFamily=fontFamily||('"微软雅黑","宋体",Arial,sans-serif');letterSpacing=letterSpacing||"normal";var $textarea=Z('").css("width",width).css("fontSize",fontSize).css("fontFamily",fontFamily).css("letterSpacing",letterSpacing).appendTo("body");var lineNum=$textarea[0].scrollHeight/50;if(window.devicePixelRatio&&window.devicePixelRatio!==1){}$textarea.remove();return Math.ceil(lineNum)};Z.drag=function(elem,param,callback,$this){if(Z.T.isString(elem)){elem=Z.D.id(elem)}if(!elem||!elem.nodeType){return null}if(Z.T.isString(param)){param={drag:Z.D.id(param)}}else{if(param.nodeType){param={drag:param}}}return new Z.Draggable({immediate:true,elem:elem,param:param,callback:callback,callthis:$this})};Z.dragInParent=function(elem,drag,parent,callback,$this){if(Z.T.isString(elem)){elem=Z.D.id(elem)}if(!elem||!elem.nodeType){return null}if(Z.T.isString(drag)){drag=Z.D.id(drag)}if(!drag||!drag.nodeType){return null}if(Z.T.isString(parent)){parent=Z.D.id(parent)}if(!parent||!parent.nodeType){return null}var width=parent.offsetWidth-elem.offsetWidth;var height=parent.offsetHeight-elem.offsetHeight;var param={drag:drag,left:parent.offsetLeft,top:parent.offsetTop,width:width,height:height};return new Z.Draggable({immediate:true,elem:elem,param:param,callback:callback,callthis:$this})};Z.$elem=function(elem,clazz){if(elem instanceof Z.Query){if(!elem[0]){Z.alert("["+clazz+"]的[elem]参数无效");throw"elem does not exist"}return elem}else{if(Z.T.isElement(elem)||Z.T.isWindow(elem)||Z.T.isDocument(elem)){return Z(elem)}else{if(Z.T.isString(elem)){if(Z(elem)[0]){return Z(elem)}if(!/^#/.test(elem)&&Z("#"+elem)[0]){return Z("#"+elem)}}}}if(clazz){Z.alert("["+clazz+"]的[elem]参数必须是元素对象或元素编号");throw"elem does not exist"}return Z("")};Z.$selector=function(selector,target){return target==null?Z(selector):Z.$elem(target).find(selector)};Z.$cover=function($elem){$elem=Z.$elem($elem);var $parent=$elem.parent();if($parent.length>0&&$parent[0].tagName.toLowerCase()=="zcover"){return $parent}var $cover=Z("").insertAfter($elem).cssMaybe("float",$elem.css("float")).cssMaybe("margin-left",$elem.css("marginLeft")).cssMaybe("margin-right",$elem.css("marginRight")).cssMaybe("margin-top",$elem.css("marginTop")).cssMaybe("margin-bottom",$elem.css("marginBottom"));if($elem.css("width").indexOf("%")!=-1){$cover.cssMaybe("width",$elem.css("width"));$elem.css("width","100%")}$elem.appendTo($cover).css("margin",0);return $cover};Z.R=Z.Regexps={SPACE:/\s+/,SPACE_LEFT:/^\s+/,SPACE_RIGHT:/\s+$/,NUMERIC:/^\d+$/,INTEGER:/^(0|[\+\-]?[1-9]\d*)$/,INTEGER_P:/^[1-9]\d*$/,INTEGER_N_N:/^(0|[1-9]\d*)$/,FLOAT:/^(0|[\+\-]?[1-9]\d*)(\.\d+)?$/,FLOAT_N_N:/^(0|[1-9]\d*)(\.\d+)?$/,AMOUNT_2R:/^(0|[\+\-]?[1-9]\d*)(\.\d{1,2})?$/,AMOUNT_2R_FIXED:/^(0|[\+\-]?[1-9]\d*)(\.\d{2})$/,AMOUNT_N_N_2R:/^(0|[1-9]\d*)(\.\d{1,2})?$/,AMOUNT_N_N_2R_FIXED:/^(0|[1-9]\d*)(\.\d{2})$/,ALPHABAT:/^[A-Za-z]+$/,ALPHABAT_UPPER:/^[A-Z]+$/,ALPHABAT_LOWER:/^[a-z]+$/,ALPHA_LOWER_NUMERIC:/^[a-z0-9]+$/,ALPHA_UPPER_NUMERIC:/^[A-Z0-9]+$/,ALPHA_NUMERIC:/^[A-Za-z0-9]+$/,ALPHA_NUMERIC_PA:/^[A-Za-z][A-Za-z0-9]*$/,ALPHABAT_DOUBLE:/^[^x00-xff]+$/,CHINESE:/^[\u4e00-\u9fa5]+$/,CHINESE_ALPHA_NUMERIC:/^[\u4e00-\u9fa5A-Za-z0-9]+$/,DATE:/^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))$/,TIME:/^([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$/,DATE_TIME:/^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s(([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9]))$/,DATE_TIME_MATCH:/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/,HTML:/<|&#?\w+;/,HTML_TAG:/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,HTML_TAG_NAME:/<([\w:]+)/,ACCOUNT:/^(?!(_|@|\.))(?!.*?(_|@|\.)$)[\w@\.\u4e00-\u9fa5]{5,25}$/,PASSWORD:/^[\w@\.#$!~%]{6,16}$/,MOBILE:/^((\+86)|(86)|)?(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|170|18[0|1|2|3|5|6|7|8|9])\d{8}$/,MOBILE_11:/^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|170|18[0|1|2|3|5|6|7|8|9])\d{8}$/,IP:/^((?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])$/,MAC:/^[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}$/,QQ:/^[1-9]\d{4,10}$/,POSTAL_CODE:/^[1-9]\d{5}$/,EMAIL:/^([\w-_]+(?:\.[\w-_]+)*)@((?:[a-z0-9]+(?:-[a-zA-Z0-9]+)*)+\.[a-z]{2,6})$/,IDCARD:/^(\d{6})((((19|20)[0-9]{2})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))(\d{3}[0-9xX*])$/};Z.C=Z.Class={newInstance:function(){return function(){this.immediate=false;this.set=function(name,value){this[name]=value};Z.C.copyFields(this,this.defaults);Z.C.copyFields(this,arguments);if(this.init){this.init.apply(this)}if(this.immediate&&this.execute){this.execute.apply(this)}}},copyFields:function(target,obj){if(!target||!obj){return}if(Z.T.isLikeArray(obj)){for(var i=0;ithis.right){offsetLeft=this.right}if("top" in this&&offsetTopthis.bottom){offsetTop=this.bottom}}if(Z.T.isFunction(this.callback)){this.callback.call(this.callthis||this,e,this.dragging)}Z(this.elem).css({left:offsetLeft,top:offsetTop});Z.D.clearSelection()},doStopDrag:function(e){Z(document).offmousemove(this.doDragging,this).offmouseup(this.doStopDrag,this);if(Z.T.isFunction(this.callback)){this.callback.call(this.callthis||this,e,this.dragging)}}}})(window);+(function(b){b.B=b.Browser={mobile:/mobile/.test(b.ua),iphone:/iphone/.test(b.ua),ipad:/ipad/.test(b.ua),win64:/wow64/.test(b.ua),firefox:/firefox/.test(b.ua),webkit:/webkit/.test(b.ua),safari:/safari/.test(b.ua),chrome:/chrome/.test(b.ua),opera:/opera/.test(b.ua),mozilla:/mozilla/.test(b.ua)&&!/compatible/.test(b.ua),msie:(/msie/.test(b.ua)||/trident/.test(b.ua))&&!/opera/.test(b.ua),msieOnly:/msie/.test(b.ua),msie11:/trident\/7/.test(b.ua),msie10:/msie 10/.test(b.ua),msie9:/msie 9/.test(b.ua),msie8:/msie 8/.test(b.ua),msie7:/msie 7/.test(b.ua),msie6:/msie 6/.test(b.ua),msieVer:/msie/.test(b.ua)?parseInt(b.ua.match(/msie (\d+)/)[1]):100};if(b.B.msieVer<=8){var c=["abbr","article","aside","datalist","details","dialog","eventsource","figure","footer","header","hgroup","main","mark","menu","meter","nav","output","progress","section","time","audio","canvas","video"];var a=c.length;while(a--){document.createElement(c[a])}}b.D=b.Document={id:function(e,d){d=d||document;return d.getElementById(e)},has:function(e,d){d=d||document;return d.getElementById(e)!=null},create:function(d,e){e=e||document;return e.createElement(d)},names:function(d,e){e=e||document;return e.getElementsByName(d)},tagNames:function(d,e){e=e||document;return e.getElementsByTagName(d)},classNames:function(e,f){f=f||document;if(f.getElementsByClassName){return f.getElementsByClassName(e)}var d=[];b.each(this.tagNames("*"),function(g){b.each(g.className.split(" "),function(h){if(h==e){d.push(g)}})});return d},attrs:function(e,f,g){g=g||document;var d=[];b.each(this.tagNames("*"),function(h){if(f==b.EL.get(h,e)){d.push(h)}});return d},scrollTop:function(d){d=d||document;return d.body.scrollTop+d.documentElement.scrollTop},scrollLeft:function(d){d=d||document;return d.body.scrollLeft+d.documentElement.scrollLeft},scrollWidth:function(d){d=d||document;return Math.max(d.body.scrollWidth,d.documentElement.scrollWidth)},scrollHeight:function(d){d=d||document;return Math.max(d.body.scrollHeight,d.documentElement.scrollHeight)},clientWidth:function(d){d=d||document;return d.documentElement.clientWidth||d.body.clientWidth},clientHeight:function(d){d=d||document;return d.documentElement.clientHeight||d.body.clientHeight},offsetWidth:function(d){d=d||document;return Math.max(d.body.offsetWidth,d.documentElement.offsetWidth)},offsetHeight:function(d){d=d||document;return Math.max(d.body.offsetHeight,d.documentElement.offsetHeight)},clearSelection:function(){window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}};b.E=b.Event={KEY:{ESC:27,ENTER:13,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},add:function(g,d,e,f){e=f?b.bind(e,f):e;if(g.addEventListener){g.addEventListener(d,e,false)}else{if(g.attachEvent){g.attachEvent("on"+d,e)}else{g["on"+d]=e}}},remove:function(g,d,e,f){e=f?b.bind(e,f):e;if(g.removeEventListener){g.removeEventListener(d,e,false)}else{if(g.detachEvent){g.detachEvent("on"+d,e)}else{g["on"+d]=null}}},event:function(d){return d||window.event},key:function(d){d=this.event(d);return d.which||d.keyCode},target:function(d){d=this.event(d);return d.target||d.srcElement},current:function(d){d=this.event(d);return d.currentTarget||d.srcElement},cancel:function(d){if(d&&d.preventDefault){d.preventDefault()}else{if(window.event){window.event.returnValue=false}}return false},stop:function(d){if(d&&d.stopPropagation){d.stopPropagation()}else{if(window.event){window.event.cancelBubble=true}}return false},forbidden:function(d){b.E.stop(d);b.E.cancel(d)},clientX:function(d){return this.event(d).clientX},clientY:function(d){return this.event(d).clientY},screenX:function(d){return this.event(d).clientX},screenY:function(d){return this.event(d).clientY},wheelDelta:function(d){return b.B.firefox?(-this.event(d).detail*40):this.event(d).wheelDelta},isCtrl:function(d){return b.E.event(d).ctrlKey},isEsc:function(d){return b.E.key(d)===27},isBackspace:function(d){return b.E.key(d)===8},isEnter:function(d){return b.E.key(d)===13},isCtrlC:function(d){return b.E.isCtrl(d)&&b.E.key(d)==67},isCtrlV:function(d){return b.E.isCtrl(d)&&b.E.key(d)==86}};b.EL=b.Element={PX:["top","bottom","left","right","width","height","min-width","max-width","min-height","max-height","line-height","text-indent","minWidth","maxWidth","minHeight","maxHeight","lineHeight","textIndent","margin-top","margin-bottom","margin-left","margin-right","padding-top","padding-bottom","padding-left","padding-right","font-size","marginTop","marginBottom","marginLeft","marginRight","paddingTop","paddingBottom","padding-Left","paddingRight","fontSize"],has:function(e,d){if(!e||!e.nodeType){return false}if(d in e){return true}else{if(e.hasAttribute&&e.hasAttribute(d)){return true}}return false},get:function(e,d){if(!e||!e.nodeType){return null}if(d in e){return e[d]}else{if(e.getAttribute){return e.getAttribute(d)}}return null},set:function(e,d,f){if(!e||!e.nodeType){return}if(d in e){e[d]=f}else{if(e.setAttribute){e.setAttribute(d,f)}}},equals:function(e,d,f){if(!e||!e.nodeType){return false}return b.EL.get(e,d)==f},style:function(f,e){if(!this.has(f,"style")){return}if(e===b.u){return f.style}var g=b.AR.toObject(e,";");for(var d in g){f.style[d]=g[d]}},css:function(e,d,f){if(!this.has(e,"style")){return}if(d=="opacity"){return this.opacity(e,f)}if(arguments.length==2){if(e.style[d]){return e.style[d]}if(e.currentStyle){return e.currentStyle[d]}if(document.defaultView){return document.defaultView.getComputedStyle(e,null)[d]}return""}else{if(arguments.length==3){if(b.AR.contains(b.EL.PX,d)){f=(b.T.isNumber(f)||b.V.isInteger(f)||b.V.isFloat(f))?f+"px":f}e.style[d]=f}}},cssNum:function(e,d){return b.S.prefixNum(this.css(e,d))},opacity:function(f,g){if(!this.has(f,"style")){return}if(g===b.u){if("opacity" in f.style){return f.style.opacity?parseFloat(f.style.opacity):0}else{var e=f.style.filter;var d=(!e)?null:e.match(/opacity=([\d.]*)[\)\,\s]/i);if(!d||d.length<2){return 0}return d[1]/100}}else{if(b.T.isNumber(g)||b.V.isFloat(g)){g=+g;if("opacity" in f.style){f.style.opacity=g}else{f.style.filter="alpha(opacity="+g*100+")"}}}},className:function(e,d){if(!this.has(e,"className")){return null}if(d===b.u){return e.className}e.className=d},addClass:function(e,d){if(!this.has(e,"className")){return}var f=b.AR.toArray(e.className,b.R.SPACE);if(b.AR.contains(f,d)){return}f.push(d);e.className=b.AR.toString(f," ")},removeClass:function(e,d){if(!this.has(e,"className")){return}var g=b.AR.toArray(e.className,b.R.SPACE);var f=b.AR.indexOf(g,d);if(f==-1){return}g.splice(f,1);e.className=b.AR.toString(g," ")},hasClass:function(e,d){if(!this.has(e,"className")){return false}var f=b.AR.toArray(e.className,b.R.SPACE);return b.AR.contains(f,d)},toggleClass:function(e,d){this.hasClass(e,d)?this.removeClass(e,d):this.addClass(e,d)},select:function(d){if(!d||!d.nodeType){return}d.select()},selection:function(e){if(!this.has(e,"value")){return""}var f=this.get(e,"value");if(b.V.isEmpty(f)){return""}if(!("selectionStart" in e)){return""}var g=e.selectionStart;var d=e.selectionEnd;return f.substring(g,d)},isSelection:function(d){return b.V.isNotEmpty(this.selection(d))},focus:function(d){if(!d||!d.nodeType){return}d.focus()},focusEnd:function(f,d){if(!f||!f.nodeType){return}d=d||0;if(b.B.msieOnly){var e=f.createTextRange();(d==0)?e.collapse(false):e.move("character",d);e.select()}else{d=(d==0)?f.value.length:d;f.setSelectionRange(d,d);f.focus()}},parent:function(e){if(!e||!e.nodeType){return null}var d=e.parentNode;return d&&d.nodeType!==11?d:null},parentIndex:function(d){var e=0;while(d=d.previousSibling){if(d.nodeType==1){e++}}return e},childs:function(d){if(!d||!d.nodeType){return null}return d.childNodes},children:function(d){if(!d||!d.nodeType){return null}return d.children},html:function(d,e){if(!d||!d.nodeType){return}if(e===b.u){return d.innerHTML}else{d.innerHTML=e}},htmlc:function(d,k){if(!d||!d.nodeType){return}if(k===b.u){return d.innerHTML}d.innerHTML=k;if(b.Input&&b.Input.load){b.Input.load(d)}if(b.ButtonGroup&&b.ButtonGroup.load){b.ButtonGroup.load(d)}if(b.Checkbox&&b.Checkbox.load){b.Checkbox.load(d)}if(b.Radio&&b.Radio.load){b.Radio.load(d)}if(b.Select&&b.Select.load){b.Select.load(d)}if(b.Dropdown&&b.Dropdown.load){b.Dropdown.load(d)}if(b.Textarea&&b.Textarea.load){b.Textarea.load(d)}if(b.CallFrame&&b.CallFrame.load){b.CallFrame.load()}if(b.Tooltip&&b.Tooltip.load){b.Tooltip.load()}if(b.Clipboard&&b.Clipboard.onload){b.Clipboard.onload()}var n=d.querySelectorAll("script");for(var g=0;g",""],optgroup:[1,""],legend:[1,"
            ","
            "],thead:[1,"","
            "],tbody:[1,"","
            "],tfoot:[1,"","
            "],colgroup:[1,"","
            "],caption:[1,"","
            "],tr:[2,"","
            "],td:[3,"","
            "],th:[3,"","
            "],col:[2,"","
            "],area:[1,"",""],_default:[0,"",""]},createElement:function(e){if(!e){return[]}if(e.nodeType){return[e]}if(b.T.isNumber(e)){e+=""}if(!b.T.isString(e)){return[]}if(!b.R.HTML.test(e)){return[document.createTextNode(e)]}e=e.replace(b.R.HTML_XHTML_TAG,"<$1>");var d=(b.R.HTML_TAG_NAME.exec(e)||["",""])[1].toLowerCase(),f=b.H.wrapMap[d]||b.H.wrapMap._default,g=f[0],h=document.createElement("div");h.innerHTML=f[1]+e+f[2];while(g--){h=h.lastChild}return h.childNodes},displayCache:{},displayDefault:function(e){if(this.displayCache[e]){return this.displayCache[e]}var d=document.body;var g=b.D.create(e);d.appendChild(g);var h=b.EL.css(g,"display");d.removeChild(g);if(h!==""&&h!=="none"){this.displayCache[e]=h;return h}var f=b.D.create("iframe");f.frameBorder=f.width=f.height=0;d.appendChild(f);var i=(f.contentWindow||f.contentDocument).document;i.write((document.compatMode==="CSS1Compat"?"":"")+"");i.close();g=i.createElement(e);i.body.appendChild(g);h=this.css(g,"display");d.removeChild(f);this.displayCache[e]=h;return h}};b.L=b.Location={protocol:location.href.match(/^https/i)?"https":"http",reload:function(d){d=d||window;d.location.reload()},access:function(e,f){b.A.assertNotEmptyBlank(e,"Z.Location的所有函数url不能为空");f=f||window;if(f==="open"){var d=b("
            ").appendTo("body");d.attr({action:e,method:"post",target:"blank"})[0].submit();d.remove()}else{if(f.name&&f.name=="zCallFrame"){e+=((e.indexOf("?")==-1)?"?":"&")+"zCallFrame=true";f.location.href=e}else{f.location.href=e}}},check:function(e,d,f,h){b.A.assertNotEmptyBlank(e,"Z.Location的所有函数url不能为空");if(f){if(!(f instanceof HTMLFormElement)&&h==null){h=f;f=null}}var g=b.FM.getChecked(d,f);if(!g){return}e+=(e.indexOf("?")==-1)?"?":"&";e+=d+"="+encodeURIComponent(g);b.L.access(e,h)},confirm:function(e,g,d,f,i){b.A.assertNotEmptyBlank(e,"Z.Location的所有函数url不能为空");if(f){if(!(f instanceof HTMLFormElement)&&i==null){i=f;f=null}}if(d){var h=b.FM.getChecked(d,f);if(!h){return}e+=(e.indexOf("?")==-1)?"?":"&";e+=d+"="+encodeURIComponent(h)}b.confirm(g,function(){b.L.access(e,i)})},href:function(j,i){if(b.T.isString(j)){b.L.access(j,i)}else{if(b.T.isPlainObject(j)){var e=j.url||null;var g=j.message||null;var d=j.name||null;var f=j.form||null;var h=i||j.target||null;if(d==null){b.L.access(e,h)}else{if(g==null){b.L.check(e,d,f,h)}else{b.L.confirm(e,g,d,f,h)}}}else{b.alert("Z.L.href函数第一个参数必须是字符串或纯对象")}}}};b.CK=b.Cookie={all:function(){return document.cookie},add:function(g,i,d,k,h,j){if(!cookie||!cookie.name||b.V.isEmptyBlank(cookie.name)){return}var g=escape(b.S.trim(cookie.name));var i=escape(cookie.value||"");var e=g+"="+i;if(b.T.isNumber(cookie.expires)||b.V.isInteger(cookie.expires)){var f=new Date();f.setTime(f.getTime()+(+cookie.expires*1000));e+=";expires="+f.toGMTString()}e+=(cookie.path)?";path="+cookie.path:"";e+=(cookie.domain)?";domain="+cookie.domain:"";e+=(cookie.secure===true)?";secure":"";document.cookie=e},remove:function(e){var d=new Date();d.setTime(d.getTime()-10*1000);document.cookie=e+"=value;expires="+d.toGMTString()},get:function(d){if(b.V.isEmptyBlank(d)){return""}d=escape(b.S.trim(d));var g=b.AR.toArray(document.cookie,";");for(var f=0;f1){e=e.slice(0,-1)}e+="}";return e}};d.Ids={HEX_LETTERS:[48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70],uuid:function(){var h=new Array(32);var f=0,g=0,e=0;for(g=0;g<8;g++){h[f++]=this.HEX_LETTERS[Math.floor(Math.random()*16)]}for(g=0;g<3;g++){for(e=0;e<4;e++){h[f++]=this.HEX_LETTERS[Math.floor(Math.random()*16)]}}var l=new Date().getTime();var k=("0000000"+l.toString(16).toUpperCase()).substr(-8);for(g=0;g<8;g++){h[f++]=k.charCodeAt(g)}for(g=0;g<4;g++){h[f++]=this.HEX_LETTERS[Math.floor(Math.random()*16)]}return String.fromCharCode.apply(null,h)}};d.T=d.Types={isBoolean:function(e){return d.O.toString(e)==="Boolean"},isNumber:function(e){return d.O.toString(e)==="Number"},isString:function(e){return d.O.toString(e)==="String"},isPrimitive:function(e){return d.T.isBoolean(e)||d.T.isNumber(e)||d.T.isString(e)},isFunction:function(e){return d.O.toString(e)==="Function"},isArray:function(e){return d.O.toString(e)==="Array"},isDate:function(e){return d.O.toString(e)==="Date"},isRegExp:function(e){return d.O.toString(e)==="RegExp"},isObject:function(e){return d.O.toString(e)==="Object"},isPlainObject:function(f){if(!f||!d.T.isObject(f)||f.nodeType||d.T.isWindow(f)){return false}if(f.constructor&&!b.call(f,"constructor")&&!b.call(f.constructor.prototype,"isPrototypeOf")){return false}var e;for(e in f){}return e===d.u||b.call(f,e)},isLikeArray:function(f){if(!f||!d.T.isNumber(f.length)){return false}if(d.T.isFunction(f)&&f instanceof d.Query){return true}var e=d.O.toString(f);if(e==="Array"||e==="Arguments"||e==="HTMLCollection"||e==="NodeList"||f.callee||f.item){return true}if(d.T.isString(f)||d.T.isFunction(f)||d.T.isWindow(f)){return false}return f[0]!=d.u},isNull:function(e){return e===null},isUndefined:function(e){return e===d.u},isNaN:function(e){return !(e==e)},isInfinity:function(e){return e===Infinity},isNonInfinity:function(e){return e===-Infinity},isNil:function(e){return e===null||e===d.u||!(e==e)||e===Infinity||e===-Infinity},isWindow:function(e){return e&&typeof(e)==="object"&&"setInterval" in e},isNode:function(e){return e&&e.nodeType},isDocument:function(e){return e&&e.nodeType===9},isElement:function(e){return e&&e.nodeType&&e.nodeType!==9},isArguments:function(e){return e&&d.O.toString(e)==="Arguments"&&d.T.isNumber(e.length)}};d.V=d.Validates={isDigit:function(e){return e>=48&&e<=57},isMinus:function(e){return e==45},isDot:function(e){return e===46},isColon:function(e){return e==58},isDigitOrMinus:function(e){return(e>=48&&e<=57)||e===45},isDigitOrDot:function(e){return(e>=48&&e<=57)||e===46},isDigitOrColon:function(e){return(e>=48&&e<=57)||e===58},isLetter:function(e){return(e>=65&&e<=90)||(e>=97&&e<=122)},isLetterLowercase:function(e){return e>=97&&e<=122},isLetterUppercase:function(e){return e>=65&&e<=90},isLetterOrDigit:function(e){return isLetter(e)||isDigit(e)},isRegexp:function(f,e){return f.test(e)},isEmpty:function(e){return(e==null||e==""||e.length<1)},isNotEmpty:function(e){return !d.V.isEmpty(e)},isEmptyBlank:function(f){if(f==null||f==""||f.length<1){return true}for(var e=0;eString.fromCharCode(32)){return false}}return true},isNotEmptyBlank:function(e){return !d.V.isEmptyBlank(e)},isNumeric:function(e){return d.R.NUMERIC.test(e)},isNumericLen:function(g,f,e){return d.R.NUMERIC.test(g)&&g.length>=f&&g.length<=e},isInteger:function(e){return d.R.INTEGER.test(e)},isIntegerValue:function(g,f,e){return d.R.INTEGER.test(g)&&+g>=f&&+g<=e},isIntegerPositive:function(e){return d.R.INTEGER_P.test(e)},isFloat:function(e){return d.R.FLOAT.test(e)},isAmount2R:function(e){return d.R.AMOUNT_2R.test(e)},isDate:function(e){return d.R.DATE.test(e)},isTime:function(e){return d.R.TIME.test(e)},isDateTime:function(e){return d.R.DATE_TIME.test(e)},isEmail:function(e){return d.R.EMAIL.test(e)},isMobile:function(e){return d.R.MOBILE.test(e)},isMobile11:function(e){return d.R.MOBILE_11.test(e)},isContain:function(g,h,e){var f=d.AR.toArray(g,h);return d.AR.contains(f,e)},isLeapYear:function(e){return(e%4==0)&&((!(e%100==0))||(e%400==0))},};d.FM=d.Forms={formData:function(e){if(!e||!e.length){return null}var f="";d.each(e,function(g){if(g.disabled||!g.name||!g.value){return}f+=g.name+"="+encodeURIComponent(g.value)+"&"});return(f.length>0)?f.slice(0,-1):null},clearForm:function(h){if(!h){return}h.reset();var g=h.elements.length;for(var e=0;e0){f.options[0].selected=true}}}}},clearSelect:function(e){e.options.length=0},isChecked:function(f,g){if(!f){return false}var e=g?g[f]:d.D.names(f);if(!e){return false}if(!d.T.isNumber(e.length)){return e.checked}else{return d.each(e,function(h){if(h.checked){return true}})}},getChecked:function(f,h){if(!f){d.alert("[Z.FM.getChecked]第一个参数必传");throw"[Z.FM.getChecked]第一个参数必传"}var e=h?h[f]:d.D.names(f);if(!e){d.alert("[Z.FM.getChecked]没有找到["+f+"]的对象");throw"[Z.FM.getChecked]没有找到["+f+"]的对象"}if(!d.T.isNumber(e.length)){if(e.checked){return e.value}else{d.alert("请选择一个选项");throw"请选择一个选项"}}else{for(var g=0;gi.length){var l=k.value.substring(0,i.length);if(l==i){if(h){k.checked=true}else{k.checked=false}}}else{if(k.value.length0){e=e.slice(0,-g.length)}return e},toJSONString:function(f){if(!f){return"[]"}var e="[";d.each(f,function(g){e+=d.Jsons.toString(g)+","});if(e.length>1){e=e.slice(0,-1)}e+="]";return e}};d.S=d.Strings={trim:a?function(e){return e==null?"":a.call(e)}:function(e){return e==null?"":e.toString().replace(d.R.SPACE_LEFT,"").replace(d.R.SPACE_RIGHT,"")},trimLeft:function(e){return e==null?"":e.toString().replace(d.R.SPACE_LEFT,"")},trimRight:function(e){return e==null?"":e.toString().replace(d.R.SPACE_RIGHT,"")},startWith:function(f,e){if(f==null||e==null||f.length==0||e.length==0||e.length>f.length){return false}return new RegExp("^"+e).test(f)},endWith:function(f,e){if(f==null||e==null||f.length==0||e.length==0||e.length>f.length){return false}return new RegExp(e+"$").test(f)},equalsIgnoreCase:function(f,e){if(!d.T.isString(f)||!d.T.isString(e)){return false}return f.toUpperCase()==e.toUpperCase()},replaceAll:function(g,h,f,e){if(!RegExp.prototype.isPrototypeOf(h)){return g.replace(new RegExp(h,(e?"gi":"g")),f)}else{return g.replace(h,f)}},lengthUnicode:function(g){if(g==null||g.length==0){return 0}var e=0;for(var f=0;f127){e+=2}else{e+=1}}return e},lengthUnicode35:function(g){if(g==null||g.length==0){return 0}var e=0;for(var f=0;f127){e+=5}else{e+=3}}return e},toString:function(e){if(e===d.u){return"undefined"}else{if(e===null){return""}else{if(d.T.isString(e)){return e}else{return e.toString()}}}},toUTF8:function(g){var e=[];for(var f=0;f>6)&31));e.push(128|(h&63))}else{e.push(224|((h>>12)&15));e.push(128|((h>>6)&63));e.push(128|(h&63))}}}return new Int8Array(e)},toHexString:function(e){var f="";for(var g=0;g"9")&&h!="."){return true}f+=h});if(f.length==0){return 0}return e?-parseFloat(f,10):parseFloat(f,10)},prefixZeroRemove:function(e){while(e.length>1&&e.charAt(0)=="0"&&e.charAt(1)!="."){e=e.substring(1)}return e},removeSecondDot:function(f){var e=f.indexOf(".");if(e==-1){return f}var g=f.indexOf(".",e+1);return(g==-1)?f:f.substring(0,g)},removeAmountZero:function(h){var g=h.indexOf(".");if(g==-1){return h}var f=-1;for(var e=h.length-1;e>=g;e--){var j=h.charAt(e);if(j!="0"&&j!="."){break}f=e}return(f==-1)?h:h.substring(0,f)}};d.Maths={multiply:function(h,x){if(d.T.isNumber(h)){h=h.toString()}else{if(!d.T.isString(h)||!d.V.isFloat(h)){d.alert("不支持["+h+"]["+x+"]非数字相乘")}}if(d.T.isNumber(x)){x=x.toString()}else{if(!d.T.isString(x)||!d.V.isFloat(h)){d.alert("不支持["+h+"]["+x+"]非数字相乘")}}var u,q,f,n;var g=h.indexOf(".");if(g==-1){u=h;q="0";f=0;n=false}else{u=h.substring(0,g);q=h.substring(g+1);f=q.length;if(u.charAt(0)=="-"){n=true}}var o,k,e,r;var s=x.indexOf(".");if(s==-1){o=x;k="0";e=0;r=false}else{o=x.substring(0,s);k=x.substring(s+1);e=k.length;if(o.charAt(0)=="-"){r=true}}var p=parseInt(u)*parseInt(o);if(f==0&&e==0){return p}var w=0,v=0,t=0,j;if(f!=0){w=((n)?-q:q)*o;for(j=0;j"&&this.selector.length>=3){if(this.selector.length<=12){var f=this.selector.substring(1,this.selector.length-1);if(d.AR.contains(a,f)){this[0]=document.createElement(f);this.length=1;return this}}var j=d.H.createElement(this.selector);d.eachof(this,j,function(l,k){this[k]=l});this.length=j.length;return this}var h=document.querySelectorAll(this.selector);for(g=0;g "+f+':not([id="'+g+'"])')}try{g="_zhiqim_siblings_"+d.random(4)+"_";d.EL.set(this[0],"id",g);return this.parent().find("> "+f+':not([id="'+g+'"])')}finally{d.EL.remove(this[0],"id")}},next:function(f){f=f||"*";return this.find("+ "+f)},nextAll:function(f){f=f||"*";return this.find("~ "+f)},prev:function(f){var g=[];this.each(function(i){var h=i.previousSibling;if(h){g.push(h)}});return d(g).find(f)},prevAll:function(f){var g=[];this.each(function(i){var h=i.previousSibling;while(h){g.push(h);h=h.previousSibling}});return d(g).find(f)},children:function(f){f=f||"*";return this.find("> "+f)},nth:function(h,f){var g=-1;this.find(f).each(function(k,j){if(k!=h){return}g=j;return true});return(g==-1)?-1:(g+1)},appendToPos:function(f){if(!(f instanceof d.Query)){f=d(f)}if(f.css("position")==="static"){f.css("position","relative")}return this.appendTo(f)},remove:function(){for(var f=0;f0)?d.EL.get(this[0],"value"):null}if(d.T.isFunction(f)){this.each(function(h,g){var j=f.call(h,h,g);if(d.T.isString(j)){d.EL.set(h,"value",j)}})}else{this.each(function(g){d.EL.set(g,"value",f)})}return this},attr:function(i,h){if(arguments.length==1){if(d.T.isString(i)){return d.EL.get(this[0],i)}for(var f in i){var g=i[f];this.each(function(j){d.EL.set(j,f,g)})}}else{if(arguments.length==2){this.each(function(j){d.EL.set(j,i,h)})}}return this},removeAttr:function(f){this.each(function(g){d.EL.remove(g,f)});return this},className:function(f){if(this.length==0){return this}if(f===d.u){return d.EL.className(this[0])}d.EL.className(this[0],f);return this},addClass:function(f){this.each(function(h){var j=d.AR.toArray(f,d.R.SPACE);for(var g=0;g0)?d.EL.hasClass(this[0],f):false},toggleClass:function(f){return this.hasClass(f)?this.removeClass(f):this.addClass(f)},style:function(f){if(f===d.u){return d.EL.style(this[0])}this.each(function(g){d.EL.style(g,f)});return this},css:function(g,f){if(!g){return this}if(f===d.u){if(d.T.isString(g)){return d.EL.css(this[0],g)}this.each(function(h){d.each(g,function(j,i){d.EL.css(h,i,j)})})}else{this.each(function(h){d.EL.css(h,g,f)})}return this},cssNum:function(f){return d.EL.cssNum(this[0],f)},cssMaybe:function(f,g){if(d.T.isNil(g)){return this}this.css(f,g);return this},opacity:function(f){return this.css("opacity",f)},display:function(f){return this.css("display",f)},inline:function(){return this.display("inline")},block:function(){return this.display("block")},inBlock:function(){return this.display("inline-block")},isHidden:function(){return"hidden"===this.css("visibility")},hidden:function(){return this.css("visibility","hidden")},visible:function(){return this.css("visibility","visible")},isHide:function(){return"none"===this.display()},hide:function(){this.each(function(f){var g=d.EL.css(f,"display");if(g!=null&&g!=="none"){d.EL.set(f,"data-zhiqim-display",g)}d.EL.css(f,"display","none")});return this},show:function(){this.each(function(f){var g=d.EL.get(f,"data-zhiqim-display");if(g==null||g==="none"){g=d.H.displayDefault(f.nodeName)}d.EL.css(f,"display",g)});return this},toggle:function(){return this.isHide()?this.show():this.hide()},text:function(f){if(this.length>0){if(f===d.u){return d.EL.text(this[0])}else{d.EL.text(this[0],f)}}return this},html:function(f){if(this.length>0){if(f===d.u){return d.EL.html(this[0])}else{d.EL.html(this[0],f)}}return this},htmlc:function(f){if(this.length>0){if(f===d.u){return d.EL.htmlc(this[0])}else{d.EL.htmlc(this[0],f)}}return this},htmlx:function(){if(this.length==0){return null}var f=d.EL.html(this[0]);f=d.S.replaceAll(f,'readonly=""',"readonly");f=d.S.replaceAll(f,'disabled=""',"disabled");f=d.S.replaceAll(f,'checked=""',"checked");f=d.S.replaceAll(f,'selected=""',"selected");f=d.S.replaceAll(f,'single=""',"single");f=d.S.replaceAll(f,'multiple=""',"multiple");if(f.indexOf("")==-1){f=d.S.replaceAll(f,"","");f=d.S.replaceAll(f,"","")}return f},htmlt:function(){if(this.length==0){return null}var f=this.htmlx();f=d.S.replaceAll(f,"<","<");f=d.S.replaceAll(f,">",">");return f},htmls:function(){if(this.length==0){return null}return d("
            ").append(this[0]).html()},focusEnd:function(){if(this.length>0&&this[0].nodeType){d.EL.focusEnd(this[0])}return this},select:function(){if(this.length>0&&this[0].nodeType){this[0].select()}return this},selection:function(){return(this.length>0)?d.EL.selection(this[0]):""},isSelection:function(){return d.V.isNotEmpty(this.selection())},offsetParent:function(){if(this.length==0||!this[0].nodeType){return null}return d(this[0].offsetParent)},offsetWidth:function(){if(this.length==0||!this[0].nodeType){return 0}if(d.T.isDocument(this[0])){return d.D.offsetWidth(this[0])}else{return this[0].offsetWidth}},offsetHeight:function(){if(this.length==0||!this[0].nodeType){return 0}if(d.T.isDocument(this[0])){return d.D.offsetHeight(this[0])}else{return this[0].offsetHeight}},offsetLeft:function(){if(this.length==0||!this[0].nodeType){return 0}return d.EL.offsetLeft(this[0])},offsetTop:function(){if(this.length==0||!this[0].nodeType){return 0}return d.EL.offsetTop(this[0])},offsetLeftBody:function(){if(this.length==0||!this[0].nodeType||this[0].nodeType===9){return 0}return d.EL.offsetLeftBody(this[0])},offsetTopBody:function(){if(this.length==0||!this[0].nodeType||this[0].nodeType===9){return 0}return d.EL.offsetTopBody(this[0])},clientWidth:function(){if(this.length==0||!this[0].nodeType){return 0}if(d.T.isDocument(this[0])){return d.D.clientWidth(this[0])}else{return this[0].clientWidth}},clientHeight:function(){if(this.length==0||!this[0].nodeType){return 0}if(d.T.isDocument(this[0])){return d.D.clientHeight(this[0])}else{return this[0].clientHeight}},clientLeft:function(){if(this.length==0||!this[0].nodeType){return 0}return this[0].clientLeft},clientTop:function(){if(this.length==0||!this[0].nodeType){return 0}return this[0].clientHeight},clientX:function(){if(this.length==0||!this[0].nodeType){return 0}return this.offsetLeftBody()-(d.body().scrollLeft+document.documentElement.scrollLeft)},clientY:function(){if(this.length==0||!this[0].nodeType){return 0}return this.offsetTopBody()-(d.body().scrollTop+document.documentElement.scrollTop)},scrollIntoView:function(f,g){if(this.length==0||!this[0].nodeType){return this}this[0].scrollIntoView(f);if(g){window.scrollTo(d.D.scrollLeft(),d.D.scrollTop()+g)}},animate:function(q,k,h){if(this.length==0||!this[0].nodeType){return this}if(!q||!d.T.isPlainObject(q)){return this}k=(!d.T.isNumber(k)||k<13)?200:k;var g=Math.ceil(k/13);var n=[],p=[],o=[],m=[],j=0;for(var f in q){var l=j++;n[l]=f;if(f in this[0]){p[l]=d.S.prefixNum(this[0][f])}else{p[l]=d.EL.cssNum(this[0],f)}o[l]=+d.S.prefixNum(q[f]);m[l]=(o[l]-p[l])/g}d.timer(13,g,this,function(){for(var i=0;i0&&h.length>0&&this[0].nodeType){var g=(this[0].nodeType===9)?d("body"):this;d.EL[f].call(null,g[0],h[0])}return this}});var e=["appendTo","prependTo","insertBefore","insertAfter"];d.each(e,function(g,f){d.Q.fn[g]=function(i){if(!(i instanceof d.Query)){i=d(i)}if(this.length>0&&i.length>0&&i[0].nodeType){var h=(i[0].nodeType===9)?d("body"):i;d.EL[c[f]].call(null,h[0],this[0])}return this}});var b=["keydown","keypress","keyup","click","dblclick","change","blur","focusin","focusout","focus","input","mouseenter","mouseleave","mouseover","mouseout","mouseup","mousedown","mousemove","resize","scroll","load","unload","beforeunload"];d.each(b,function(f){d.Q.fn[f]=function(h,g){if(arguments.length>0){return this.on(f,h,g)}this.each(function(i){if(i[f]){i[f]()}});return this};d.Q.fn["off"+f]=function(h,g){return this.off(f,h,g)}})})(zhiqim);+(function(a){a.MD5=a.Class.newInstance();a.MD5.V=[1732584193,-271733879,-1732584194,271733878];a.MD5.S=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21];a.MD5.T=[3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745];a.MD5.PAD=128;a.MD5.prototype={defaults:{abcd:a.MD5.V},digest:function(e){var g;var f=Math.floor((e.length+8)/64)+1;var h=f*64-8-e.length-1;var d=new Int8Array(64*f);for(g=0;g>>(32-i));return this.add(g,f)},ff:function(g,f,k,j,e,i,h){return this.cc(this.f(f,k,j),g,f,k,j,e,i,h)},gg:function(g,f,k,j,e,i,h){return this.cc(this.g(f,k,j),g,f,k,j,e,i,h)},hh:function(g,f,k,j,e,i,h){return this.cc(this.h(f,k,j),g,f,k,j,e,i,h)},ii:function(g,f,k,j,e,i,h){return this.cc(this.i(f,k,j),g,f,k,j,e,i,h)},f:function(b,d,c){return(b&d)|((~b)&c)},g:function(b,d,c){return(b&c)|(d&(~c))},h:function(b,d,c){return b^d^c},i:function(b,d,c){return d^(b|(~c))},getInt:function(c,d){return((c[d+0]&255)<<0)+((c[d+1]&255)<<8)+((c[d+2]&255)<<16)+((c[d+3]&255)<<24)},putInt:function(c,e,d){c[e+0]=(d>>>0);c[e+1]=(d>>>8);c[e+2]=(d>>>16);c[e+3]=(d>>>24)},add:function(b,e){var d=(b&65535)+(e&65535);var c=(b>>16)+(e>>16)+(d>>16);return(c<<16)|(d&65535)},slice:function(d,h,e){var c=e-h,f=0;var b=new Int32Array(c);for(var g=h;g';f+='
            ';f+='
            ';f+='
            ';f+='
            ';f+="
            ";f+="
            ";this.$dialog=a(f);if(a.T.isDocument(this.target)){this.$dialog.appendTo("body")}else{this.$dialog.appendToPos(this.target)}a.Dialog.cache.put(this.id,this);this.active=document.activeElement;if(this.active!=null&&this.active.blur){this.active.blur()}var c=this.width+(this.hasBackground?10:0);var e=this.height+(this.hasBackground?10:0)+(this.hasTitle?40:0);var b=this.calcPosition(c,e);this.$dialog.css(b);this.$dialog.css({width:c,height:e});this.$background=this.$dialog.find(".z-background");this.$wrap=this.$dialog.find(".z-wrap");if(!this.hasBackground){this.$background.remove();this.$wrap.css({top:0,left:0,width:c,height:e})}else{this.$background.css("backgroundColor",this.backgroundColor);this.$wrap.css({top:5,left:5,width:(c-10),height:(e-10)})}this.$title=this.$wrap.find(".z-title");this.$content=this.$wrap.find(".z-content");this.$content.css({height:this.height,borderColor:this.borderColor});if(!this.hasTitle){this.$title.remove();this.$content.css("top",0)}else{this.$title.css({borderColor:this.borderColor,backgroundColor:this.titleBgColor});this.$title.find("span").html(this.title);this.$title.find("i").click(this.close,this).mouseover(function(g){a.E.stop(g)})}if(this.fixed&&this.target===document){this.$dialog.css("position","fixed")}if(this.text){this.$content.html(this.text)}else{var d=this.url+((this.url.indexOf("?")==-1)?"?":"&")+"zDialogFrame=true";this.$content.css({overflowY:"hidden"});this.$content.append("")}if(this.scroll){this.doScroll()}if(this.shadow){this.$shadow=a('
            ');if(a.T.isDocument(this.target)){this.$shadow.appendTo("body").css({left:this.targetLeft,top:this.targetTop})}else{this.$shadow.appendToPos(this.target)}this.$shadow.css({backgroundColor:this.shadowColor}).css({width:this.targetWidth,height:this.targetHeight}).fadeTo(500,this.shadowOpacity)}if(this.drag&&this.hasTitle){this.$dialog.drag(this.$title,this.doDrag,this)}this.status=1;if(a.T.isFunction(this.callback)){this.callback.call(this,this.status)}if(this.timeout>0){this.$dialog.fadeOut(this.timeout,a.bind(this.close,this))}},calcPosition:function(b,e){if(a.T.isPlainObject(this.position)){return this.position}var h=0,g=0;if(a.T.isDocument(this.target)){h+=this.targetLeft;g+=this.targetTop}var i=h+(this.targetClientWidth-b)/2;var f=g+(this.targetClientHeight-e)/2;if(!a.T.isNumber(this.position)){return{left:i,top:f}}var d=this.targetWidth-b;var c=this.targetHeight-e;if(a.T.isDocument(this.target)){d+=this.targetLeft;c+=this.targetTop}switch(this.position){case 1:return{left:h,top:g};case 2:return{left:h,top:f};case 3:return{left:h,top:c};case 4:return{left:i,top:g};case 5:return{left:i,top:c};case 6:return{left:d,top:g};case 7:return{left:d,top:f};case 8:return{left:d,top:c};default:return{left:i,top:f}}},close:function(b,c){if(b instanceof Event){a.E.forbidden(b)}if(this.status==0){return}a.Dialog.cache.remove(this.id);this.remove(b===true);if(a.T.isFunction(c)){c.call(this,b)}},remove:function(b){if(this.status==0){return}this.$dialog.remove();window.focus();if(this.shadow===true){if(b){this.$shadow.remove()}else{this.$shadow.fadeOut(500,function(){a(this).remove()})}}this.status=0;if(a.T.isFunction(this.callback)){this.callback.call(this,this.status)}},doDrag:function(c,b){if(!this.dragOpacity){return}this.$dialog.children("div").css("opacity",b?this.dragOpacity:1)},doScroll:function(){if(this.text||/http(s?):\/\//i.test(this.url)){return}var c=this.$content.find("iframe")[0].contentWindow;var b=c.document;a.E.add(b,"DOMContentLoaded",this.doScrollLoaded,this);a.E.add(c,"load",this.doScrollLoaded,this)},doScrollLoaded:function(d){var f=this.$content.find("iframe")[0].contentWindow;var c=f.document;var b=this.scrollHeight;if(!b){b=a.D.scrollHeight(c)-a.D.clientHeight(c)}b-=this.scrollPad;f.scrollTo(0,b);a.E.remove(f,"DOMContentLoaded",this.doScrollLoaded,this);a.E.remove(c,"load",this.doScrollLoaded,this)}};a.dialog=function(d){var c=new a.Dialog();for(var b in d){c.set(b,d[b])}c.execute()};a.Dialog.innerWidth=function(){var b=250;if(screen.width>1440){b=450}else{if(screen.width>1024){b=350}else{if(screen.width>800){b=300}}}var c=a.D.clientWidth();return(c>0)?Math.min(b,parseInt(c*0.8)):b};a.alert=function(l,k,c){var b=c&&c.width||a.Dialog.innerWidth();var d=a.textLineNum(l,b-77,14);var h=d==1?36:d*22;var j=d==1?36:22;var m=c&&c.height||(80+h);var g=c&&c.type||"alert";var e='
            确定
            ';var f=new a.Dialog();f.fixed=true;f.hasBackground=c&&c.hasBackground||false;f.title=g=="success"?"成功":g=="failure"?"失败":"注意";f.text=e;f.width=b;f.height=m;f.execute();f.$content.css("overflow","hidden");f.$content.find(".z-console").find(".z-cancel").focus().click(function(n){f.close(n,k)});if(a.T.isFunction(k)){f.$title.find("i").click(k)}function i(n){if(a.E.key(n)!=a.E.KEY.ENTER){return}if(f.shadow){f.$shadow.offkeydown(i)}f.$dialog.offkeydown(i);f.close(n,k)}if(f.shadow){f.$shadow.keydown(i)}f.$dialog.focus().keydown(i)};a.confirm=function(k,j,c){var b=c&&c.width||a.Dialog.innerWidth();var d=a.textLineNum(k,b-77,14);var g=d==1?36:d*22;var i=d==1?36:22;var l=c&&c.height||(80+g);var e='
            确定
            取消
            ';var f=new a.Dialog();f.fixed=true;f.hasBackground=c&&c.hasBackground||false;f.title="询问";f.text=e;f.width=b;f.height=l;f.execute();f.$content.css("overflow","hidden");f.$content.find(".z-console").find(".z-cancel").click(function(m){f.close(m)});f.$content.find(".z-console").find(".z-ok").focus().click(function(m){f.close(m,j)});function h(m){if(a.E.key(m)!=a.E.KEY.ENTER){return}if(f.shadow){f.$shadow.offkeydown(h)}f.$dialog.offkeydown(h);f.close(m,j)}if(f.shadow){f.$shadow.keydown(h)}f.$dialog.focus().keydown(h);throw"stop"};a.prompt=function(o,s,g,k){var l=k&&k.type=="textarea";var c=k&&k.type=="select";var r=k&&k.width||a.Dialog.innerWidth();var p=k&&k.height||(l?150:120);var w=k&&k.style||"";var d="";if(k&&k.className){d=" "+k.className}var h="";if(k&&k.maxLength){h=" maxlength='"+k.maxLength+"'"}var j="";if(k&&k.placeholder){j=" placeholder='"+k.placeholder+"'";if(l){j+=" data-role='z-placeholder'"}}var f=p-75;var t='
            ';if(l){t+='"}else{if(c){var x=k&&k.selects||[];t+='"}else{var m="";if(k&&k.dataOptions){m=" data-options='"+k.dataOptions+"'"}t+='"}}t+='
            确定
            取消
            ';var v=new a.Dialog();v.fixed=true;v.hasBackground=k&&k.hasBackground||false;v.title=a.S.toString(o||"提示修改");v.text=t;v.width=r;v.height=p;v.execute();v.$dialog.css("position","fixed");v.$content.css("overflow","hidden");v.$content.find(".z-console").find(".z-cancel").click(function(){v.close()});if(c){a.Select.load(v.$content)}else{if(l&&(h||j)){a.Textarea.load(v.$content)}else{if(!l&&!c&&m){a.Input.load(v.$content)}}}var e=v.$content.find(".z-container").find(".z-prompt").find(l?"textarea":c?"select":"input");if(!c){e.focusEnd()}function n(){v.close();if(a.T.isFunction(g)){g(e.val())}}v.$content.find(".z-console").find(".z-ok").click(n);function b(i){if(a.E.key(i)!=a.E.KEY.ENTER){return}if(v.shadow){v.$shadow.offkeydown(b)}v.$dialog.offkeydown(b);n()}if(!l){if(v.shadow){v.$shadow.keydown(b)}v.$dialog.focus().keydown(b)}throw"stop"};a.loading=function(i){var h="正在加载...";if(a.T.isString(i)){h=i;i=null}h=i&&i.text||h;var c=i&&i.radius||"z-bd-rd5";var e=i&&i.background||"#fff";var g=i&&i.target||document;var b=i&&i.position||null;var f='
            '+h+"
            ";var d=new a.Dialog();d.fixed=g===document;d.hasTitle=false;d.hasBackground=false;d.target=g;d.position=b;d.shadow=i&&i.shadow||false;d.borderColor=i&&i.borderColor||"#d8d8d8";d.width=i&&i.width||150;d.height=i&&i.height||50;d.text=f;d.execute();d.$content.css("overflow","hidden");d.$content.addClass(c);d.$content.css("background",e);return d};a.tips=function(c){var l="处理成功";if(a.T.isString(c)){l=c;c=null}l=c&&c.text||l;var g=c&&c.radius||"z-bd-rd5";var d=c&&c.color||"#fff";var b=c&&c.background||"#333";var i=c&&c.target||document;var e=c&&c.position||null;var f=c&&c.ico||"z-finish";var k=c&&c.timeout||1500;var h='
            '+l+"
            ";var j=new a.Dialog();j.fixed=i===document;j.hasTitle=false;j.hasBackground=false;j.target=i;j.position=e;j.shadow=c&&c.shadow||false;j.borderColor=c&&c.borderColor||"#d8d8d8";j.width=c&&c.width||120;j.height=c&&c.height||50;j.text=h;j.timeout=k;j.execute();j.$content.css("overflow","hidden").addClass(g).css("background",b).css("color",d);return j}})(zhiqim);+(function(a){a.Ajax=a.Class.newInstance();a.Ajax.v="1.4.0";a.Ajax.prototype={defaults:{contextPath:null,className:null,methodName:null,token:"",async:true,params:[],paramMap:new a.HashMap(),paramData:null,callback:null,callbackMethod:"htmlc",success:null,failure:null,loading:null,loadingParam:null,loadingAttr:null,loadingProcess:false,responseStatus:0,responseText:null},init:function(){if(window.ActiveXObject){try{this.httpRequest=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{this.httpRequest=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}}else{if(window.XMLHttpRequest){this.httpRequest=new XMLHttpRequest()}}},execute:function(){if(!this.httpRequest){a.failure("[Z.Ajax]浏览器不支持AJAX");return false}if(!this.className){a.failure("[Z.Ajax]未设置className");return false}if(!this.methodName){a.failure("[Z.Ajax]未设置methodName");return false}var b=null;try{b=window.location.pathname}catch(h){b="null"}var d=a.rootPath(this.contextPath,"/service/ajax?path="+b+"&time="+(new Date()).getTime());var c=null;if(this.paramMap.size()>0){c="";a.eachof(this,this.paramMap.keySet(),function(e){c+=e+"="+encodeURIComponent(this.paramMap.get(e))+"&"});c=c.slice(0,-1)}else{if(this.paramData){c=this.paramData}else{if(this.params.length>0){c="";a.eachof(this,this.params,function(e){e=""+e;if(e.indexOf("#")!=-1){e=e.replace(/\#/g,"-%2-%-3%-")}c+="%23"+encodeURIComponent(e)+"%23"})}}}if(this.async){this.httpRequest.onreadystatechange=a.bind(this.receive,this)}this.httpRequest.open("POST",d,this.async);this.httpRequest.setRequestHeader("X-Requested-With","XMLHttpRequest");this.httpRequest.setRequestHeader("X-RMI-Class",this.className);this.httpRequest.setRequestHeader("X-RMI-Method",this.methodName);if(this.token){this.httpRequest.setRequestHeader("X-RMI-Token",this.token)}if(this.paramMap.size()>0||this.paramData){this.httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8")}else{this.httpRequest.setRequestHeader("Content-Type","text/plain; charset=UTF-8")}this.httpRequest.send(c);if(!this.async){this.processResult();return}if(!this.loading||(a.Dialog&&this.loading instanceof a.Dialog)){return}if(a.T.isFunction(this.loading)){this.loading.call(this)}else{if(a.T.isDocument(this.loading)){this.loading=a.loading({target:document,shadow:true===this.loadingParam})}else{if(a.T.isElement(this.loading)||a.T.isString(this.loading)){if(a.T.isString(this.loadingParam)){var g=a.T.isString(this.loading)?a("#"+this.loading):a(this.loading);var f=g.html();g.html(this.loadingParam);this.loadingParam=f;if(this.loadingAttr&&this.loadingAttr.disabled===true){g.attr("disabled",true)}}else{if(a.loading){this.loading=a.loading({target:this.loading,shadow:true===this.loadingParam})}}}else{if(a.T.isObject(this.loading)&&this.loading.execute){this.loading.execute()}}}}},receive:function(){if(this.httpRequest.readyState!=4){return}if(this.loading){if(a.T.isObject(this.loading)&&this.loading.close){this.loading.close(true)}else{if((a.T.isString(this.loading)||a.T.isElement(this.loading))&&this.loading!=this.callback){this.processRecoveryLoading()}}}this.processResult()},processRecoveryLoading:function(){if(this.loadingProcess){return}var b=a.T.isString(this.loading)?a("#"+this.loading):a(this.loading);if(!(this.loadingAttr&&this.loadingAttr.recovery===false)){if(this.loadingParam){b.html(this.loadingParam)}}if(this.loadingAttr&&this.loadingAttr.disabled===true&&this.loadingAttr.recovery!==false){b.attr("disabled",false)}},processResult:function(){if(this.httpRequest.status==200){this.responseStatus=0;this.responseText=this.httpRequest.responseText}else{this.responseStatus=(this.httpRequest.status==0)?91:this.httpRequest.status;this.responseText=this.httpRequest.responseText}this.httpRequest=null;if(this.responseStatus>=601&&this.responseStatus<=603){var b;var c=this.responseText.lastIndexOf("#");if(c!=-1){b=this.responseText.substring(c+1);this.responseText=this.responseText.substring(0,c)}if(a.V.isEmpty(b)){this.processRedirect()}else{a.failure(b,a.bind(this.processRedirect,this))}throw"stop"}else{if(this.responseStatus!=0&&a.T.isFunction(this.failure)){this.failure.call(this,this.responseText,this.responseStatus)}else{if(this.responseStatus!=0&&a.T.isString(this.failure)){this.showValue(this.failure)}else{if(this.responseStatus==0&&a.T.isFunction(this.success)){this.success.call(this,this.responseText,this.responseStatus)}else{if(this.responseStatus==0&&a.T.isString(this.success)){this.showValue(this.success)}else{if(a.T.isFunction(this.callback)){this.callback.call(this,this.responseText,this.responseStatus)}else{if(a.T.isString(this.callback)){this.showValue(this.callback)}}}}}}}},showValue:function(b){if(this.callbackMethod=="val"){a("#"+b).val(this.responseText)}else{if(this.callbackMethod=="text"){a("#"+b).text(this.responseText)}else{if(this.callbackMethod=="html"){a("#"+b).html(this.responseText)}else{a("#"+b).htmlc(this.responseText)}}}},processRedirect:function(){switch(this.responseStatus){case 601:window.parent.location.href=this.responseText;break;case 602:window.location.href=this.responseText;break;case 603:window.top.location.href=this.responseText;break}},setContextPath:function(b){this.contextPath=b;return this},setClassName:function(b){this.className=b;return this},setMethodName:function(b){this.methodName=b;return this},setToken:function(b){this.token=b;return this},setSync:function(){this.async=false;return this},setCallback:function(b){this.callback=b;return this},setCallbackMethod:function(b){this.callbackMethod=b;return this},setSuccess:function(b){this.success=b;return this},setSuccessLocation:function(c,b){this.success=function(){a.L.href(c,b)}},setSuccessLocationResponse:function(c,b){this.success=function(){a.L.href(this.responseText,b)}},setSuccessReload:function(){this.success=function(){a.L.reload()}},setSuccessReloadParent:function(){this.success=function(){parent.Z.L.reload()}},setSuccessReloadTop:function(){this.success=function(){top.Z.L.reload()}},setSuccessAlertLocation:function(d,c,b){this.success=function(){a.success(d,function(){a.L.href(c,b)})}},setSuccessAlertReload:function(b){this.success=function(){a.success(b,function(){a.L.reload()})}},setSuccessAlertReloadParent:function(b){this.success=function(){a.success(b,function(){parent.Z.L.reload()})}},setSuccessAlertReloadTop:function(b){this.success=function(){a.success(b,function(){top.Z.L.reload()})}},setFailure:function(b){this.failure=b;return this},setFailureAlert:function(){this.failure=function(){a.failure(this.responseText)};return this},setFailureAlertRecovery:function(){this.failure=function(){if(this.loadingAttr){this.loadingAttr.recovery=true;this.processRecoveryLoading()}a.failure(this.responseText)};return this},addParam:function(c,b){(b==a.u)?this.params.push(c):this.paramMap.put(c,b);return this},setParamData:function(b){this.paramData=b;return this},setParamForm:function(b){this.paramData=a.FM.formData(b);return this},setLoading:function(c,d,b){this.loading=c;this.loadingParam=d;this.loadingAttr=b;return this}};a.ajax=function(b,e,d){var c=new a.Ajax();if(b){c.setClassName(b)}if(e){c.setMethodName(e)}if(d){c.setCallback(d)}return c};a.submit=function(b,h,g,c,f,d){a(c).attr("type","button");if(validateForm&&validateForm(c.form)){return}var e=a.ajax(b,h,g);e.setParamData(a.FM.formData(c.form));e.setLoading(c,f,d);e.execute()};a.log=function(b,c){a.ajax("Logs",c||"info").addParam(b).execute()}})(zhiqim);+(function(a){a.Calendar=a.Class.newInstance();a.Calendar.v="1.4.0";a.Calendar.prototype={defaults:{hasTime:false,hasSecond:true,selectYear:null,selectMonth:null,selectDay:null,selectHour:null,selectMinute:null,selectSecond:null,elem:null,elemDate:null,currDate:new Date(),dateMap:new a.HashMap()},init:function(){this.$elem=a.$elem(this.elem,"Z.Calendar");this.random=a.random(10);this.html=''; + }, + + execute: function() + { + //解析对象中年月,如果不是年月格式置为当前月 + if (!Z.V.isDate(this.element.value+"-01")) + this.elemDate = this.currDate; + else + {//有值时选中月 + this.elemDate = Z.DT.toDate(this.element.value+"-01"); + this.selectMonth = this.elemDate.getMonth()+1; + } + + this.selectYear = this.elemDate.getFullYear(); + + //组装日历DIV,和设置好位置和事件 + this.height = 271; + + var $element = Z(this.element); + var top = $element.offsetTopBody() + $element.offsetHeight() + this.top; + var left = $element.offsetLeftBody() + this.left; + + if (top > this.height && Z.D.clientHeight() - top - this.height < 0) + {//如果顶部够高,底部不够高时,则向上弹出 + top -= this.height; + } + + var $calendar = Z(this.html); + $calendar.appendTo("body").css({top:top, left:left, display:'block'}); + + //当前点击时阻止冒泡,其他点击时关闭 + $calendar.click(function(e){Z.E.stop(e);}); + Z(document).click(this.close, this); + + //设置向左和向右移动一年 + Z("#Z_Month_prev_"+this.id).click(this.doPrevYear, this); + Z("#Z_Month_next_"+this.id).click(this.doNextYear, this); + + Z("#Z_Month_clear_"+this.id).click(function(e){this.element.value="";this.close(e);}, this); + Z("#Z_Month_close_"+this.id).click(function(e){this.close(e);}, this); + + //设置选择年份月份时打开年份列表事件 + Z("#Z_Month_year_"+this.id).click(this.doOpenYearList, this); + + //最后显示选择年份,月份信息 + this.showYear(); + this.showMonth(); + }, + + doOpenYearList: function(e) + {//打开选择年份列表 + var $list = Z("#Z_Month_year_"+this.id).find("ul"); + if ($list.length > 0) + $list.remove(); + else + { + var min = this.selectYear - 50; + var max = this.selectYear + 50; + var $ul = Z("
              ").addClass("z-year-list"); + for (var i=min;i<=max;i++) + { + var $option = Z("" + i + "年" + ""); + $option.click(this.onChangeYear, this); + if (i == this.selectYear) + $option.addClass("z-selected"); + $ul.append($option); + } + $ul.append("关闭"); + Z("#Z_Month_year_"+this.id).append($ul); + //把滚动条移到中间位置 + $ul[0].scrollTop = $ul[0].scrollHeight/2 - 117; + } + }, + + onChangeYear: function(e) + {//修改年份 + var value = Z(Z.E.target(e)).val(); + this.selectYear = parseInt(value); + + Z("#Z_Month_year_"+this.id).find("ul").hide().remove(); + + this.showYear(); + this.showMonth(); + + Z.E.stop(e); + }, + + doPrevYear: function() + {//上一年 + this.selectYear -= 1; + this.showYear(); + this.showMonth(); + }, + + doNextYear: function() + {//下一年 + this.selectYear += 1; + this.showYear(); + this.showMonth(); + }, + + close: function(e) + {//关闭 + var target = Z.E.target(e); + if (target === this.element) + {//如果是指定的元素不关闭 + Z.E.cancel(e); + return; + } + + Z(document).offclick(this.close, this); + Z("#Z_Month_"+this.id).remove(); + }, + + showYear: function() + {//显示年 + Z("#Z_Month_year_"+this.id).find(".z-default").html(this.selectYear+"年"); + }, + + showMonth: function() + {//显示月 + //先统一背景等数据 + for (var i=1;i<=12;i++) + { + Z("#Z_Month_month_"+this.id+"_"+i).removeClass("z-today").removeClass("z-selected").click(function(e) + { + var id = Z.E.current(e).id; + var ind = id.lastIndexOf("_"); + this.selectMonth = parseInt(id.substring(ind+1)); + this.setSelectValue(); + this.close(e); + + }, this); + } + + if (this.selectYear == this.currDate.getFullYear()) + Z("#Z_Month_month_"+this.id+"_"+(this.currDate.getMonth()+1)).addClass("z-today"); + + if (this.selectMonth != null) + Z("#Z_Month_month_"+this.id+"_"+this.selectMonth).addClass("z-selected"); + }, + + setSelectValue: function() + { + this.setValue(this.selectYear + "-" + Z.S.prefixZero(this.selectMonth, 2)); + }, + + setValue: function(newValue) + { + var oldValue = this.element.value; + this.element.value = newValue; + if (this.element.onchange && oldValue != this.element.value) + this.element.onchange(); + } +}; + +Z.month = function($elem) +{ + return new Z.Month({immediate:true, element:$elem}); +} + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_ui/src_extend/zhiqim_clipboard.js b/zhiqim_ui/src_extend/zhiqim_clipboard.js new file mode 100644 index 0000000..5fec97b --- /dev/null +++ b/zhiqim_ui/src_extend/zhiqim_clipboard.js @@ -0,0 +1,227 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙登记发行许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ + ++(function(Z) +{//BEGIN +// @version v1.1.0 @author zouzhigang 2015-11-12 新建与整理 + +// 调用举例: +// var clip = new Z.Clipboard(); +// clip.id = "clip_button"; +// clip.onClick = function(){clip.setText(Z('#text').val());}; +// clip.onCompleted = function(){alert("成功复制代码到剪贴板!");}; +// clip.execute(); + +Z.Clipboard = Z.Class.newInstance(); +Z.Clipboard.v = "1.4.0"; +/****************************************/ +//定义Z.Clipboard下缓存和Flash事件方法 +/****************************************/ +Z.Clipboard.cache = new Z.HashMap(); +Z.Clipboard.load = function(id) +{//加载成功 + if (!id || !Z.Clipboard.cache.containsKey(id)) + return; + + Z.Clipboard.cache.get(id).load(); +}; +Z.Clipboard.click = function(id) +{//鼠标点击开始(传入复制文本) + if (!id || !Z.Clipboard.cache.containsKey(id)) + return; + + return Z.Clipboard.cache.get(id).onClick(); +}; +Z.Clipboard.complete = function(id, text) +{//鼠标点击完成(完成复制回调) + if (!id || !Z.Clipboard.cache.containsKey(id)) + return; + + Z.Clipboard.cache.get(id).complete(text); +}; + +/****************************************/ +//定义Z.Clipboard下的原型属性和方法 +/****************************************/ +Z.Clipboard.prototype = +{ + defaults: + { + //公共参数 + elem: null, + onClick: null, + onCompleted: null, + + //H5参数 + text: null, + + //Flash参数 + flash: false, + flashPath: null, + contextPath: null, + background: "transparent", + opacity: 1 + }, + + init: function() + { + this.ready = false; + }, + + execute: function() + { + this.$elem = Z.$elem(this.elem, "Z.Clipboard"); + if (!Z.T.isFunction(this.onClick)) + {//必须的函数 + Z.alert("[Z.Clipboard]的[onClick]参数必须是函数"); + return; + } + + if (!this.flash && document.execCommand) + {//未强制flash,且支持执行命令的,默认使用H5 + this.$elem.click(this.doClick, this); + } + else + {//否则默认Flash + //创建一个DIV覆盖该元素 + var left = this.$elem.offsetLeft(); + var top = this.$elem.offsetTop(); + var width = this.$elem.offsetWidth(); + var height = this.$elem.offsetHeight(); + var zIndex = this.$elem.css("zIndex"); + zIndex = Z.V.isInteger(zIndex)?parseInt(zIndex)+1:99; + + this.$flashDiv = Z("
              ").appendToPos(this.$elem.parent()) + .css({position: "absolute", top: top, left: left, width: width, height: height, zIndex: zIndex}) + .css("backgroundColor", this.background).opacity(this.opacity); + + //获取Flash对象 + this.flashId = "Z_Clipboard_"+Z.random(10); + var flashVars = "flashId="+this.flashId; + var flashPath = Z.rootPath(this.contextPath, this.flashPath || "/service/res/swf/ZClipboard.swf"); + + if (Z.B.msieOnly) + {//ie10以前 + this.$flashDiv.html(''); + } + else + {//firefox,chrome,trident + this.$flashDiv.html(''); + } + + this.flashObj = Z.D.id(this.flashId); + Z.Clipboard.cache.put(this.flashId, this); + } + }, + + setText: function(text) + {//设置复制文本 + if (!this.flash && document.execCommand) + this.text = text; + else + this.ready && this.flashObj.setText(text); + }, + + doClick: function() + {//H5复制文本 + + //1.先回调点击函数 + var text = this.onClick.call(this); + if (text && Z.T.isString(text)){ + this.text = text; + } + + //2.创建一个文本域固定在顶端隐藏, + var $textarea = Z("") + .addClass("z-hidden-fixed").text(this.text) + .appendTo("body"); + + //3.选中文本域内容,执行复制命令 + $textarea.select(); + document.execCommand("copy"); + + //4.最后回调成功函数 + this.complete(this.text); + }, + + load: function() + {//Flash加载完成 + this.ready = true; + }, + + complete: function(text) + {//复制完成 + Z.T.isFunction(this.onCompleted) && this.onCompleted.call(this, text); + }, + + remove: function() + { + if (!this.flash && document.execCommand) + this.$elem.offclick(this.doClick, this); + else + { + Z.Clipboard.cache.remove(this.flashId); + this.$flashDiv.remove(); + } + } +}; + +/********************************************/ +//刷新静态函数和第一次加载 +/********************************************/ +Z.Clipboard.oncache = []; +Z.Clipboard.onload = function() +{ + //1.先删除原来的缓存 + Z.each(Z.Clipboard.oncache, function(clipboard){ + clipboard.remove(); + }); + Z.Clipboard.oncache = []; + + //2.再加载所有的下拉列表 + var elements = Z.D.attrs("data-role", "z-clipboard"); + if (!elements || elements.length == 0){ + return; + } + + Z.each(elements, function(elem) + { + if (!Z.EL.has(elem, "data-click")) + return; + + var $elem = Z(elem); + if ($elem.attr("type") == "submit"){ + $elem.attr("type", "button"); + } + + var clipboard = new Z.Clipboard(); + clipboard.elem = elem; + clipboard.onClick = Z.evals($elem.attr("data-click")); + clipboard.onCompleted = Z.evals($elem.attr("data-completed")); + clipboard.flash = "true" == $elem.attr("data-flash"); + clipboard.flashPath = $elem.attr("data-flashPath"); + clipboard.contextPath = $elem.attr("data-context"); + clipboard.execute(); + + Z.Clipboard.oncache.push(clipboard); + }); +}; + +Z.onload(Z.Clipboard.onload); + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_ui/src_extend/zhiqim_coder.js b/zhiqim_ui/src_extend/zhiqim_coder.js new file mode 100644 index 0000000..175c358 --- /dev/null +++ b/zhiqim_ui/src_extend/zhiqim_coder.js @@ -0,0 +1,86 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙登记发行许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ + ++(function(Z) +{//BEGIN +// @version v1.1.0 @author zouzhigang 2015-11-12 新建与整理 + +/********************************************/ +//选择框定义和加载转换成下拉列表对象 +/********************************************/ +Z.Coder = Z.Class.newInstance(); +Z.Coder.v = "1.4.0"; +Z.Coder.prototype = +{ + defaults: + { + elem: null + }, + + init: function() + {//初始化 + if (!this.elem) + return; + + this.$elem = Z(this.elem); + } +}; + +//缓存加载函数 +Z.Coder.cache = []; +Z.Coder.load = function() +{ + //1.先删除原来的缓存 + Z.each(Z.Coder.cache, function(coder){ + coder.remove(); + }); + Z.Coder.cache = []; + + //2.再加载所有的选择框 + var elements = Z.D.attrs("data-role", "z-coder"); + if (!elements || elements.length == 0) + return; + + Z.each(elements, function(elem) + { + var $textarea = Z(elem).hidden(); + //取出父节点的绝对位置 + + var offsetTop = $textarea.offsetTop(); + var offsetLeft = $textarea.offsetLeft(); + var width = $textarea.offsetWidth(); + var height = $textarea.offsetHeight(); + + var id = Z.S.trim($textarea.attr("id")); + var name = Z.S.trim($textarea.attr("name")) + var classes = Z.S.trim($textarea.attr("data-class")); + + var coder = '
              ' + + '
              '; + + var $elem = Z(coder).appendToPos($textarea.parent()); + $elem.addClass(classes).css({position: "absolute", top: offsetTop, left: offsetLeft, width: width, height: height}); + $elem.attr("data-id", id).attr("data-name", name); + + Z.Coder.cache.push(new Z.Coder({elem: $elem[0]})); + }); +}; + +Z.onload(Z.Coder.load); + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_ui/src_extend/zhiqim_fullscreen.js b/zhiqim_ui/src_extend/zhiqim_fullscreen.js new file mode 100644 index 0000000..5efb4b0 --- /dev/null +++ b/zhiqim_ui/src_extend/zhiqim_fullscreen.js @@ -0,0 +1,90 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙登记发行许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ + ++(function(Z) +{//BEGIN +// @version v1.1.0 @author zouzhigang 2015-11-12 新建与整理 + +Z.Fullscreen = +{//moz是FullScreen,其他都是Fullscreen + target: null, + elem: function() + {//全屏对象 + return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement + || document.msFullscreenElement || document.oFullscreenElement || Z.Fullscreen.target; + }, + enabled: function() + {//是否开启全屏 + return document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled + || document.msFullscreenEnabled || document.oFullscreenEnabled; + }, + change: function(func) + {//更改方法 + var name = null; + if (document.body.requestFullscreen) + name = "fullscreenchange"; + else if(document.body.webkitRequestFullscreen) + name = "webkitfullscreenchange"; + else if(document.body.mozRequestFullScreen) + name = "mozfullscreenchange"; + else if(document.body.msRequestFullscreen) + name = "msfullscreenchange"; + else if(document.body.oRequestFullscreen) + name = "ofullscreenchange"; + + if (name != null) + {//支持则增加监听 + Z.E.add(document, name, func); + } + }, + full: function(id) + { + var elem = Z.D.id(id); + if (elem.requestFullscreen) + elem.requestFullscreen(); + else if(elem.webkitRequestFullscreen) + elem.webkitRequestFullScreen(); + else if(elem.mozRequestFullScreen) + elem.mozRequestFullScreen(); + else if(elem.msRequestFullscreen) + elem.msRequestFullscreen(); + else if(elem.oRequestFullscreen) + elem.oRequestFullscreen(); + + Z.Fullscreen.target = elem; + }, + toggle: function() + { + Z.Fullscreen.change(Z.Fullscreen.toggleHandler); + }, + toggleHandler: function() + { + var elem = Z.Fullscreen.elem(); + if (elem.paused) + elem.play(); + else + elem.pause(); + } +}; + +Z.onload(function() +{//全屏播放,退出暂停 + Z.Fullscreen.toggle(); +}); + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_ui/src_extend/zhiqim_image_clipper.js b/zhiqim_ui/src_extend/zhiqim_image_clipper.js new file mode 100644 index 0000000..37b418d --- /dev/null +++ b/zhiqim_ui/src_extend/zhiqim_image_clipper.js @@ -0,0 +1,208 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站进行实名登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/LICENSE.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ ++(function(Z) +{ +//BEGIN + +/** + * 图片裁切 +*/ +Z.ImageClipper = Z.Class.newInstance(); +Z.ImageClipper.prototype = +{ + defaults: + { + elem : null, + ratio: 1, + state : {}, + img: null, + clipWidth: [50, 100, 150], + save: null + }, + + execute: function() + { + this.$elem = Z.$elem(this.elem, "Z.ImageClipper"); + if (this.clipWidth == null || this.clipWidth.length == 0) + { + Z.alert("[Z.ImageClipper]没有设置clipWidth,或不是数组"); + return; + } + + this.id = Z.random(10); + var html = '
              ' + + '
              ' + + '
              ' + + '
              加载中...
              ' + + '
              ' + + '
              ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '
              ' + + '
              ' + + '
              '; + + this.$elem.html(html); + this.$imageBox = this.$elem.find("#ZImageClipper_image_"+this.id); + this.$square = this.$elem.find("#ZImageClipper_square_"+this.id); + this.$loading = this.$elem.find("#ZImageClipper_loading_"+this.id).show(); + + this.image = new Image(); + Z(this.image).load(function() + { + this.$loading.hide(); + this.setBackground(); + + this.$imageBox.mousedown(this.onMouseDown, this).mousemove(this.onMouseMove, this); + Z(window).mouseup(this.onMouseUp, this); + }, this); + this.image.src = this.img; + + Z("#ZImageClipper_zoomIn_"+this.id).click(this.onZoomIn, this); + Z("#ZImageClipper_zoomOut_"+this.id).click(this.onZoomOut, this); + + this.$file = Z(""); + this.$file.appendTo("body").change(function() + { + var file = this.$file[0].files[0]; + var reader = new FileReader(); + reader.onload = Z.bind(function(e) + { + this.img = e.target.result; + this.image.src = this.img; + }, this); + + reader.readAsDataURL(file); + }, this); + + Z("#ZImageClipper_upload_"+this.id).click(function(){this.$file[0].click();}, this); + Z("#ZImageClipper_clip_"+this.id).click(function() + { + var imgData = this.getDataURL(); + var imgDiv = ''; + Z.each(this.clipWidth, function(elem){ + imgDiv += '

              '+elem+' * '+elem+'
              ' + }); + Z("#ZImageClipper_clipped_"+this.id).html(imgDiv); + }, this); + + if (Z.T.isFunction(this.save)){ + Z("#ZImageClipper_save_"+this.id).click(this.save, this); + } + }, + + setBackground: function() + { + var w = parseInt(this.image.width) * this.ratio; + var h = parseInt(this.image.height) * this.ratio; + + var pw = (400 - w) / 2; + var ph = (400 - h) / 2; + + this.$imageBox.css({ + "background-image": "url(" + this.image.src + ")", + "background-size": w +"px " + h + "px", + "background-position": pw + "px " + ph + "px", + "background-repeat": "no-repeat"}); + }, + + onMouseDown: function(e) + { + Z.E.stop(e); + this.state.dragging = true; + this.state.mouseX = e.clientX; + this.state.mouseY = e.clientY; + }, + + onMouseMove: function(e) + { + Z.E.stop(e); + if (!this.state.dragging) + return; + + var x = e.clientX - this.state.mouseX; + var y = e.clientY - this.state.mouseY; + + var bg = this.$imageBox.css('background-position').split(' '); + + var bgX = x + parseInt(bg[0]); + var bgY = y + parseInt(bg[1]); + + this.$imageBox.css('background-position', bgX +'px ' + bgY + 'px'); + + this.state.mouseX = e.clientX; + this.state.mouseY = e.clientY; + }, + + onMouseUp: function(e) + { + Z.E.stop(e); + this.state.dragging = false; + }, + + onZoomIn: function() + { + this.ratio *= 1.1; + this.setBackground(); + }, + + onZoomOut: function() + { + this.ratio *= 0.9; + this.setBackground(); + }, + + getDataURL: function() + { + var width = this.$square.offsetWidth(), + height = this.$square.offsetHeight(), + canvas = document.createElement("canvas"), + dim = this.$imageBox.css('background-position').split(' '), + size = this.$imageBox.css('background-size').split(' '), + dx = parseInt(dim[0]) - this.$imageBox.offsetWidth()/2 + width/2, + dy = parseInt(dim[1]) - this.$imageBox.offsetHeight()/2 + height/2, + dw = parseInt(size[0]), + dh = parseInt(size[1]), + sh = parseInt(this.image.height), + sw = parseInt(this.image.width); + + canvas.width = width; + canvas.height = height; + var context = canvas.getContext("2d"); + context.drawImage(this.image, 0, 0, sw, sh, dx, dy, dw, dh); + var imageData = canvas.toDataURL('image/png'); + return imageData; + }, + + getBlob: function() + { + var imageData = this.getDataURL(); + var b64 = imageData.replace('data:image/png;base64,',''); + var binary = atob(b64); + var array = []; + for (var i = 0; i < binary.length; i++) { + array.push(binary.charCodeAt(i)); + } + return new Blob([new Uint8Array(array)], {type: 'image/png'}); + } +} + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_ui/src_extend/zhiqim_image_clipper.mobile.js b/zhiqim_ui/src_extend/zhiqim_image_clipper.mobile.js new file mode 100644 index 0000000..5211777 --- /dev/null +++ b/zhiqim_ui/src_extend/zhiqim_image_clipper.mobile.js @@ -0,0 +1,206 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙许可证》,除非符合许可证,否则不可使该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站进行实名登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/LICENSE.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ ++(function(Z) +{ +//BEGIN + +/** + * mobile 端图片裁切 +*/ +Z.ImageClipper = Z.Class.newInstance(); +Z.ImageClipper.prototype = +{ + defaults: + { + elem : null, + ratio: 1, + state : {}, + img: null, + clipWidth: [50, 100, 150], + save: null + }, + + execute: function() + { + this.$elem = Z.$elem(this.elem, "Z.Floater"); + + if (this.clipWidth == null || this.clipWidth.length == 0) + { + Z.alert("[Z.ImageClipper]没有设置clipWidth,或不是数组"); + return; + } + + this.id = Z.random(10); + + //判断是不是手机端 + this.width = this.$elem.offsetWidth(); + var html = '
              ' + + '
              ' + + '
              ' + + '
              加载中...
              ' + + '
              ' + + '
              ' + + '
              ' + + ' ' + + ' ' + + ' ' + + ' ' + + '
              ' + + '
              '; + + this.$elem.html(html); + this.$imageBox = this.$elem.find("#ZImageClipper_image_"+this.id); + this.$square = this.$elem.find("#ZImageClipper_square_"+this.id); + this.$loading = this.$elem.find("#ZImageClipper_loading_"+this.id).show(); + this.$$button = this.$elem.find("button"); + + this.image = new Image(); + Z(this.image).load(function() + { + this.$loading.hide(); + this.setBackground(); + + this.$imageBox.on("touchstart", this.onTouchStart, this) + .on("touchmove", this.onTouchMove, this) + .on("mouseup mouseleave", this.onTouchEnd, this); + }, this); + this.image.src = this.img; + + Z("#ZImageClipper_zoomIn_"+this.id).on("touchstart", this.onZoomIn, this); + Z("#ZImageClipper_zoomOut_"+this.id).on("touchstart", this.onZoomOut, this); + + this.$file = Z(""); + this.$file.appendTo("body").change(function() + { + var file = this.$file[0].files[0]; + var reader = new FileReader(); + reader.onload = Z.bind(function(e) + { + this.img = e.target.result; + this.image.src = this.img; + }, this); + + reader.readAsDataURL(file); + }, this); + + Z("#ZImageClipper_upload_"+this.id).on("touchstart",function(){this.$file[0].click();}, this); + + if (Z.T.isFunction(this.save)){ + Z("#ZImageClipper_save_"+this.id).on("touchstart", this.save, this); + } + }, + + setBackground: function() + { + var w = parseInt(this.image.width) * this.ratio; + var h = parseInt(this.image.height) * this.ratio; + + var pw = (400 - w) / 2; + var ph = (400 - h) / 2; + + this.$imageBox.css({ + "background-image": "url(" + this.image.src + ")", + "background-size": w +"px " + h + "px", + "background-position": pw + "px " + ph + "px", + "background-repeat": "no-repeat"}); + }, + + onTouchStart: function(e) + { + Z.E.forbidden(e); + this.state.dragging = true; + var theTouch = e.touches[0]; + this.state.mouseX = theTouch.clientX; + this.state.mouseY = theTouch.clientY; + }, + + onTouchMove: function(e) + { + Z.E.forbidden(e); + if (!this.state.dragging) + return; + + var theTouch = e.touches[0]; + var x = theTouch.clientX - this.state.mouseX; + var y = theTouch.clientY - this.state.mouseY; + + var bg = this.$imageBox.css('background-position').split(' '); + + var bgX = x + parseInt(bg[0]); + var bgY = y + parseInt(bg[1]); + + this.$imageBox.css('background-position', bgX +'px ' + bgY + 'px'); + + this.state.mouseX = theTouch.clientX; + this.state.mouseY = theTouch.clientY; + }, + + onTouchEnd: function(e) + { + Z.E.forbidden(e); + this.state.dragging = false; + }, + + onZoomIn: function() + { + this.ratio *= 1.1; + this.setBackground(); + }, + + onZoomOut: function() + { + this.ratio *= 0.9; + this.setBackground(); + }, + + getDataURL: function() + { + var width = this.$square.offsetWidth(), + height = this.$square.offsetHeight(), + canvas = document.createElement("canvas"), + dim = this.$imageBox.css('background-position').split(' '), + size = this.$imageBox.css('background-size').split(' '), + dx = parseInt(dim[0]) - this.$imageBox.offsetWidth()/2 + width/2, + dy = parseInt(dim[1]) - this.$imageBox.offsetHeight()/2 + height/2, + dw = parseInt(size[0]), + dh = parseInt(size[1]), + sh = parseInt(this.image.height), + sw = parseInt(this.image.width); + + canvas.width = width; + canvas.height = height; + var context = canvas.getContext("2d"); + context.drawImage(this.image, 0, 0, sw, sh, dx, dy, dw, dh); + var imageData = canvas.toDataURL('image/png'); + return imageData; + }, + + getBlob: function() + { + var imageData = this.getDataURL(); + var b64 = imageData.replace('data:image/png;base64,',''); + var binary = atob(b64); + var array = []; + for (var i = 0; i < binary.length; i++) { + array.push(binary.charCodeAt(i)); + } + return new Blob([new Uint8Array(array)], {type: 'image/png'}); + } +} + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_ui/src_extend/zhiqim_magic_zoom.js b/zhiqim_ui/src_extend/zhiqim_magic_zoom.js new file mode 100644 index 0000000..fa4866f --- /dev/null +++ b/zhiqim_ui/src_extend/zhiqim_magic_zoom.js @@ -0,0 +1,254 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙登记发行许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ + ++(function(Z) +{ +/****************************************/ +//“图片放大镜” +/****************************************/ + +// 1、配置举例: +//
                +//
              • +//
              • +//
              • +//
              • +//
              +// +// + +/************************************************************************/ +/********************************************/ + +Z.MagicZoom = Z.Class.newInstance(); +Z.MagicZoom.prototype = +{ + //start of Z.MagicZoom.prototype + defaults: + {//定义 + elem: null, // 列表对象 + width: -1, // 容器宽度,默认为 -1,动态计算 + listShow: 5, // 导航最多展示图片数量 + zoomRatio: 2, // 缩放倍数,默认两倍 + }, + init: function() + {//初始化 + }, + execute: function() + {//执行 + this.$elem = Z.$elem(this.elem, "Z.MagicZoom"); + if (this.width < 0){ + this.width = this.$elem.offsetWidth(); + } + + //重新组装排版 + var wrapHtml = '
              '; + wrapHtml += '
              '; + wrapHtml += ''; + wrapHtml += ''; + wrapHtml += '
              '; + wrapHtml += '
              '; + wrapHtml += '
              '; + wrapHtml += '
              '; + wrapHtml += '
              '; + + this.$wrap = Z(wrapHtml).insertAfter(this.$elem); + this.$zoom = this.$wrap.find(".z-zoomImg"); + this.$zoomImg = this.$zoom.find("img"); + this.$zoomIcon = this.$zoom.find(".z-font"); + this.$list = this.$wrap.children(".z-zoomList"); + this.$listUl = this.$list.find("div").append(this.$elem); + this.$lis = this.$elem.find("li").css("opacity",.5); + + //常量 + this.length = this.$lis.length; + this.zoomWidth = this.$zoom.offsetWidth()-2; + this.zoomHeight = this.$zoom.offsetHeight()-2; + this.coverWidth = this.zoomWidth / this.zoomRatio; + this.coverHeight = this.zoomHeight / this.zoomRatio; + this.maxX = this.zoomWidth - this.coverWidth; + this.maxY = this.zoomHeight - this.coverHeight; + this.minCx = this.coverWidth/2; + this.minCy = this.coverHeight/2; + this.maxCx = this.maxX + this.coverWidth/2; + this.maxCy = this.maxY + this.coverHeight/2; + + //遮罩层、展示层 + this.$zoomCover = this.$wrap.find(".z-zoomCover").css("width",this.coverWidth).css("height",this.coverHeight); + this.$zoomShow = this.$wrap.find(".z-zoomShow").css("width",this.zoomWidth).css("height",this.zoomHeight) + .css("left",this.zoomWidth + 10).css("top",0); + this.$showImg = this.$zoomShow.find("img"); + + if (this.length > this.listShow){ + this.hasBtn = true; + this.$btnPrev = Z('
              ').appendTo(this.$list); + this.$btnNext = Z('
              ').appendTo(this.$list); + this.$listUl.addClass("z-mg-l20 z-mg-r20"); + this.$btnPrev.on("click", this.prevList, this); + this.$btnNext.on("click", this.nextList, this); + } + + //计算每个小图大小 + var ulWidth = this.$listUl.offsetWidth() - 6; + this.liWidth = Math.round(ulWidth/this.listShow); + + this.$listUl.css("height",this.liWidth); + this.$list.css("height",this.liWidth); + this.$elem.css("width",this.liWidth * this.length).css("height",this.liWidth); + this.$lis.css("width",this.liWidth - 6).css("height",this.liWidth - 6); + + this.ulShow = ulWidth; + this.ulWidth = this.$elem.offsetWidth(); + + //第一张图 + this.setImgSrc(0); + + //绑定事件 + this.$zoom.on("mouseenter", this.zoomEnter, this).on("mousemove", this.zoomMove, this).on("mouseleave", this.zoomLeave, this); + this.$lis.on("mouseenter", this.lisEnter, this); + }, + setImgSrc: function(index) + { + var $li = Z(this.$lis[index]); + $li.css("opacity",1).siblings("li").css("opacity",.5); + var imgSrc = $li.find("img").attr("src"); + this.$zoomImg.attr("src", imgSrc); + this.$showImg.attr("src", imgSrc); + }, + zoomEnter: function(ev) + {//进入 zoom ,显示放大镜 + Z.E.forbidden(ev); + this.$zoomCover.show(); + this.$zoomShow.show(); + + //设置位置 + var mX = ev.clientX; + var mY = ev.clientY; + var rect = this.$zoom[0].getBoundingClientRect(); + var cX = rect.left + rect.width/2; + var cy = rect.top + rect.height/2; + + this.$zoomCover.css("left", (mX > cX)?this.maxX:0) + .css("top", (mY > cy)?this.maxY:0); + + this.$showImg.css("width",this.$zoomImg.offsetWidth() * this.zoomRatio) + .css("height",this.$zoomImg.offsetHeight() * this.zoomRatio) + .css("margin-left",parseInt(this.$zoomImg.css("margin-left")) * this.zoomRatio) + .css("margin-top",parseInt(this.$zoomImg.css("margin-top")) * this.zoomRatio); + }, + zoomMove: function(ev) + {//移动放大镜 + Z.E.forbidden(ev); + + // cover 位置计算 + var mX = ev.clientX; + var mY = ev.clientY; + var rect = this.$zoom[0].getBoundingClientRect(); + mX -= rect.left; + mY -= rect.top; + var setX, setY; + if (mX < this.minCx){ + setX = 0; + } else if (mX > this.maxCx){ + setX = this.maxX; + } else { + setX = mX - this.minCx; + } + if (mY < this.minCy){ + setY = 0; + } else if (mY > this.maxCy){ + setY = this.maxY; + } else { + setY = mY - this.minCy; + } + + //cover 位置定义 + this.$zoomCover.css("left", setX).css("top", setY); + + //show 位置计算 + setX = -(setX * this.zoomRatio); + setY = -(setY * this.zoomRatio); + this.$showImg.css("left", setX).css("top", setY); + }, + zoomLeave: function(ev) + {//离开 zoom ,隐藏放大镜 + Z.E.forbidden(ev); + this.$zoomCover.hide(); + this.$zoomShow.hide(); + }, + lisEnter: function(ev) + {//hover 小图片,切换图片显示 + Z.E.forbidden(ev); + var $li = Z(Z.E.current(ev)); + if ($li.css("opacity") == "1") + return; + var liIndex = this.getParentIndex($li[0]); + this.setImgSrc(liIndex) + }, + prevList: function(ev) + {//向前切换图片列表 + Z.E.forbidden(ev); + var nLeft = parseInt(this.$elem.css("left")); + nLeft += this.ulWidth; + nLeft = nLeft > 0 ? 0 : nLeft; + this.$elem.css("left", nLeft); + + //按钮状态 + this.$btnNext.removeClass("z-event-none").removeClass("z-text-gray"); + if (nLeft == 0){ + this.$btnPrev.addClass("z-event-none z-text-gray"); + } + + }, + nextList: function(ev) + {//向后切换图片列表 + Z.E.forbidden(ev); + var nLeft = parseInt(this.$elem.css("left")); + nLeft -= this.ulShow; + if ((this.ulShow - nLeft)> this.ulWidth){ + nLeft = this.ulShow - this.ulWidth; + } + this.$elem.css("left", nLeft); + + //按钮状态 + this.$btnPrev.removeClass("z-event-none").removeClass("z-text-gray"); + if (nLeft == (this.ulShow - this.ulWidth)){ + this.$btnNext.addClass("z-event-none z-text-gray"); + } + }, + getParentIndex: function(elem) + {//获取 elem 在父级的 索引值 + var ind = 0; + while (elem = elem.previousSibling) { + if (elem.nodeType == 1) + ind++ + } + return ind; + }, + //end of Z.MagicZoom.prototype +} + + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_ui/src_extend/zhiqim_scroll_screen.js b/zhiqim_ui/src_extend/zhiqim_scroll_screen.js new file mode 100644 index 0000000..9d4b0a0 --- /dev/null +++ b/zhiqim_ui/src_extend/zhiqim_scroll_screen.js @@ -0,0 +1,198 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙登记发行许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ + ++(function(Z) +{ +//BEGIN +/************************************************************************************************/ +//滚屏,每次滚轮滚动一个屏幕高度,并增加上下两个按钮点击切换屏幕,支持指定固定顶部高度和滚动速度 +/************************************************************************************************/ +//var sScreen = new Z.ScrollScreen(); +//sScreen.fixHeight = 55; +//sScreen.execute(); + +Z.ScrollScreen = Z.Class.newInstance(); +Z.ScrollScreen.prototype = +{ + defaults: + { + speed: 13, + times: 13, + fixHeight:0, + zIndex: 0 + }, + + execute: function() + { + //支持滚屏的对象 + this.$screen = Z("[data-role=z-screen]"); + + //监听初始化事件、窗口变化事件和滚轮事件 + if (!Z.B.firefox) + {//非火狐刷新时执行window.scrollTo(0, 0)后会被浏览器跳转到原来位置,所以预先scrollTo(0, 0) + Z(window).beforeunload(this.onLoad, this); + } + Z(window).load(this.onLoad, this).resize(this.onResize, this); + Z(document).mousewheel(this.onMouseWheel, this); + + //向上按钮 + this.$up = Z('
              '); + this.$up.appendTo("body").css({top: this.fixHeight+20, right: 20}).css({backgroundColor: "#d3d3d3", zIndex: this.zIndex}) + .click(this.onUp, this).mouseover(this.onUpMouseOver, this).mouseout(this.onUpMouseOut, this); + + //向下按钮 + this.$down = Z('
              '); + this.$down.appendTo("body").css({bottom: 20, right: 20}).css({backgroundColor: "#d3d3d3", zIndex: this.zIndex}) + .click(this.onDown, this).mouseover(this.onDownMouseOver, this).mouseout(this.onDownMouseOut, this); + + //初始化高度和设置滚屏高度 + this.onResize(); + }, + + onLoad: function(e) + {//刷新时回最上面 + window.scrollTo(0, 0); + }, + + onResize: function(e) + {//重新设置高度和滚屏高度 + window.scrollTo(0, 0); + this.running = false; + this.height = Z.D.clientHeight() - this.fixHeight; + this.$screen.css("height", this.height); + this.maxHeight = Z.D.scrollHeight() - Z.D.clientHeight(); + this.$up.hide(); + }, + + onUpMouseOver: function(e) + { + this.$up.css("backgroundColor", "#333") + .find("i").css("borderBottomColor", "#fff") + .find("span").css("borderBottomColor", "#333"); + }, + + onUpMouseOut: function(e) + { + this.$up.css("backgroundColor", "#d3d3d3") + .find("i").css("borderBottomColor", "#000") + .find("span").css("borderBottomColor", "#d3d3d3"); + }, + + onDownMouseOver: function(e) + { + this.$down.css("backgroundColor", "#333") + .find("i").css("borderTopColor", "#fff") + .find("span").css("borderTopColor", "#333"); + }, + + onDownMouseOut: function(e) + { + this.$down.css("backgroundColor", "#d3d3d3") + .find("i").css("borderTopColor", "#000") + .find("span").css("borderTopColor", "#d3d3d3"); + }, + + onUp: function() + {//点击向上按钮 + if (this.running) + return; + + this.running = true; + this.scrollTo(false); + }, + + onDown: function() + {//点击向下按钮 + if (this.running) + return; + + this.running = true; + this.scrollTo(true); + }, + + onMouseWheel: function(e) + {//滚动滚轮 + Z.E.forbidden(e); + if (this.running) + return; + + this.running = true; + this.scrollTo(Z.E.wheelDelta(e) < 0); + }, + + scrollTo: function(down) + {//滚动操作 + var curHeight = Z.D.scrollTop(); + + var index = 1;var endHeight, midHeight; + if (down) + {//向下 + if (this.maxHeight <= curHeight){ + this.running = false; + return; + } + + endHeight = curHeight + this.height; + + midHeight = Math.floor(this.height / this.times); + Z.timer(this.speed, this.times, this, + function(){window.scrollTo(0, curHeight + midHeight * index++);}, + function(){window.scrollTo(0, endHeight);this.running=false;} + ); + + if (curHeight >= this.maxHeight - this.height) + this.$down.fadeOut(this.speed * this.times); + + if (curHeight == 0) + this.$up.fadeIn(this.speed * this.times); + } + else + {//向上 + if (curHeight <= 0){ + this.running = false; + return; + } + + if (this.maxHeight == curHeight) + { + endHeight = Math.floor(curHeight / this.height) * this.height; + this.$down.fadeIn(this.speed * this.times); + } + else + { + endHeight = curHeight - this.height; + } + + midHeight = (curHeight - endHeight) / this.times; + Z.timer(this.speed, this.times, this, + function(){window.scrollTo(0, curHeight - midHeight * index++);}, + function(){window.scrollTo(0, endHeight);this.running=false;} + ); + + if (endHeight <= 0) + this.$up.fadeOut(this.speed * this.times); + } + } +}; + +Z.ScrollScreen.onload = function(f) +{//增加滚屏加载,当本JS加载完成之后才加载函数 + Z.onload(f); +}; + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_ui/src_extend/zhiqim_slider.js b/zhiqim_ui/src_extend/zhiqim_slider.js new file mode 100644 index 0000000..760f155 --- /dev/null +++ b/zhiqim_ui/src_extend/zhiqim_slider.js @@ -0,0 +1,413 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙登记发行许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ + ++(function(Z) +{ +/****************************************/ +//“轮播图” +/****************************************/ +// 1、配置举例: +//
                +//
              • +//
              • +//
              • +//
              • +//
              +// +// + +Z.Zslider = Z.Class.newInstance(); +Z.Zslider.prototype = +{ + //start of Z.Zslider.prototype + defaults: + {//定义 + elem: null, // 列表对象 + width: 0, // 容器宽度 + height: 300, // 容器高度 + + hasBtn: true, // 左右按钮是否显示,默认为 true + doResize: false, // 是否自适应缩放 + slideStyle: "slide", // 播放类型:slide(滑动)fade(渐显),默认为 slide + tabStyle: "disc", // tab 菜单类型:disc(实心圆点)circle(空心圆)square(实心方块),默认为 disc + tabEvent: "click", // tab 菜单触发方式:click(点击)hover(悬浮) + + playGapless: true, // 无缝轮播 + playAuto: true, // 设定自动滚动 + playSpeed: 4000, // 播放间隔 + playDuration: 800, // 动画时长 + }, + init: function() + {//初始化 + }, + validate: function() + {//验证参数 + this.$ul = Z.$elem(this.elem, "Z.Zslider"); + + if (!Z.AR.contains(["slide", "fade"], this.slideStyle)) + return false; + + if (!Z.AR.contains(["disc", "circle", "square"], this.tabStyle)) + return false; + + if (!Z.AR.contains(["click", "hover"], this.tabEvent)) + return false; + + return true; + }, + execute: function() + {//执行 + //1:检验、设置参数 + if (!this.validate()) + return; + + + this.height = this.getRectSize(this.height, this.$ul.offsetHeight()); + if (this.width) + { + this.doResize = false; + this.width = this.getRectSize(this.width, this.$ul.offsetWidth()); + } else { + this.width = Math.round(this.$ul.offsetWidth()); + } + + if (this.playSpeed < this.playDuration){ + this.playSpeed = this.playDuration; + } + + if (!this.width || !this.height) + return Z.alert("[Z.Zslider]参数[width][height]设置有误!"); + + //2:重新组装排版 + var wrapHtml = '
              '; + wrapHtml += '
              '; + wrapHtml += '
              '; + wrapHtml += '
              '; + + this.$wrap = Z(wrapHtml).insertAfter(this.$ul); + this.$list = this.$wrap.find(".z-sliderList").append(this.$ul); + this.$$items = this.$ul.find("li"); + this.$tab = this.$wrap.find(".z-sliderTab"); + + this.length = this.$$items.length; + + //3:左右操作按钮 + if (this.hasBtn){ + var btnHtml = '
              '; + btnHtml += '
              '; + btnHtml += ''; + btnHtml += '
              '; + btnHtml += '
              '; + btnHtml += ''; + btnHtml += '
              '; + btnHtml += '
              '; + this.$btn = Z(btnHtml).appendTo(this.$wrap); + this.$btn.find(".z-sliderBtn-prev").on("click", this.sliderPrev, this); + this.$btn.find(".z-sliderBtn-next").on("click", this.sliderNext, this); + } + + //4:底部导航 tab 按钮 + var tabsHtml = ""; + var i = 0; + for (i;i < this.length;i++){ + tabsHtml += '
              '; + } + this.$tab[0].insertAdjacentHTML("beforeend",tabsHtml); + this.$$tabs = this.$tab.find("div"); + Z(this.$$tabs[0]).addClass("z-active"); + + //5:list 样式 + if (this.slideStyle === "slide") + {//滑动处理 + this.$ul.css("width", this.length * this.width).css("transition-duration",this.playDuration+"ms"); + var $item; + for (i = 0;i < this.length;i++) + { + $item = this.$$items[i]; + Z($item).css({ + "width": this.width, + "transform": "translate3d(" + i * this.width + "px,0,0)" + }); + if (i === 0){ + this.$firstClone = Z($item.cloneNode("deep")).css("transform","translate3d(" + this.length * this.width + "px,0,0)"); + } + if (i === this.length - 1){ + this.$lastClone = Z($item.cloneNode("deep")).css("transform","translate3d(-" + this.width + "px,0,0)"); + } + } + + //插入克隆体 + this.$firstClone.appendTo(this.$ul); + this.$lastClone.appendTo(this.$ul); + + //滑动结束,判断是否可滑动 + this.$ul.on(this.transitionFixed(), this.slideEnd, this); + } + else if (this.slideStyle === "fade") + {//渐显处理 + this.$$items.css("top","0").css("transition-property","opacity,top"); + Z(this.$$items[0]).css("opacity",1).siblings("li").css("opacity",0).addClass("z-hide"); + + //渐隐结束,隐藏该元素 + this.$$items.on(this.transitionFixed(), this.fadeEnd, this); + } + this.$$items.css("transition-duration",this.playDuration+"ms"); + Z(this.$$items[0]).addClass("z-active"); + + //6:绑定事件 + var tabEvent = (this.tabEvent === "click")?"click":"mouseenter"; + this.$$tabs.on(tabEvent, this.tabTrigger, this); + this.$wrap.on("mouseenter", this.wrapEnter, this); + this.$wrap.on("mouseleave", this.wrapLeave, this); + if (this.doResize) + Z(window).on('resize', this.resize, this); + + //7:开始执行动画 + this.autoPlay(); + }, + autoPlay: function() + {//自动播放 + if(this.playAuto && !this.playAutoTimer) + this.playAutoTimer = setInterval(this.sliderNext, this.playSpeed, null, this); + }, + wrapEnter: function() + { + if(this.$btn){ + this.$btn.addClass("z-active"); + } + //清除自动 + clearInterval(this.playAutoTimer); + this.playAutoTimer = null; + }, + wrapLeave: function() + { + if(this.$btn){ + this.$btn.removeClass("z-active"); + } + this.autoPlay(); + }, + sliderNext: function(event, thisObj) + {//后一个展示 + thisObj = thisObj || this; + thisObj.sliderPlay(1); + }, + sliderStay: function () + {//保持展示 + this.sliderPlay(0); + }, + sliderPrev: function() + {//前一个展示 + this.sliderPlay(-1); + }, + sliderPlay: function(step) + {//播放方法 + if (this.sliding){ + return; + } + this[this.slideStyle+"ToPlay"](step); + }, + slideToPlay: function(step) + {//滑动方法 + this.sliding = true; + + step = +step; + var $activeItem = this.$ul.find(".z-active"); + var activeIndex = Z.AR.indexOf(this.$$items, $activeItem[0]); + $activeItem.removeClass("z-active"); + + //即将展示对象的索引值 + var shouldIndex = activeIndex + step; + if (shouldIndex >= this.length) shouldIndex = 0; + if (shouldIndex <= -1) shouldIndex = this.length - 1; + + //定义定位 + var $shouldActive = Z(this.$$items[shouldIndex]); + var ulTrans = -shouldIndex * this.width; + + //逐步滚动 |step| = 1 到边缘时,实现无缝滚动 + if (this.playGapless) + { + if (step === 1 && shouldIndex === 0) { + $shouldActive = this.$firstClone; + ulTrans = -this.length * this.width; + } + if (step === -1 && shouldIndex === this.length - 1) { + $shouldActive = this.$lastClone; + ulTrans = this.width; + } + } + // 新定位 + this.$ul.css("transform", "translate3d("+ulTrans+"px,0,0)"); + if (this.$ul.css("transition-property") === "none"){ + this.$ul.css("transition-property", "transform"); + } + $shouldActive.addClass("z-active"); + + //tab 展示 + Z(this.$$tabs[shouldIndex]).addClass("z-active").siblings("div").removeClass("z-active"); + }, + fadeToPlay: function(step) + {//渐显方法 + step = +step; + var $activeItem = this.$ul.find(".z-active"); + var activeIndex = Z.AR.indexOf(this.$$items, $activeItem[0]); + $activeItem.removeClass("z-active").css("opacity",0).css("top",-10); + + var shouldIndex = activeIndex + step; + if (shouldIndex >= this.length) shouldIndex = 0; + if (shouldIndex <= -1) shouldIndex = this.length - 1; + var $shouldActive = Z(this.$$items[shouldIndex]); + $shouldActive.removeClass("z-hide").addClass("z-active").css("opacity",1); + + //tab 展示 + Z(this.$$tabs[shouldIndex]).addClass("z-active").siblings("div").removeClass("z-active"); + }, + fadeEnd: function(ev) + { + var $thisItem = Z(Z.E.current(ev)); + if (!$thisItem.hasClass("z-active")){ + $thisItem.addClass("z-hide").css("top",0); + } + }, + slideEnd: function(ev) + { + //判断是否处于 list 边缘 + var $activeItem = this.$ul.find(".z-active"); + var activeIndex = Z.AR.indexOf(this.$$items, $activeItem[0]); + if (activeIndex > -1){ + return this.sliding = false; + } + $activeItem.removeClass("z-active"); + //无缝播放 + if (this.playGapless) + { + this.$ul.css("transition-property","none"); + if ($activeItem[0] === this.$firstClone[0]){ + this.$ul.css("transform","translate3d(0,0,0)"); + Z(this.$$items[0]).addClass("z-active"); + } + if ($activeItem[0] === this.$lastClone[0]){ + this.$ul.css("transform","translate3d(-"+(this.length - 1) * this.width+"px,0,0)"); + Z(this.$$items[this.length - 1]).addClass("z-active"); + } + } + this.sliding = false; + }, + tabTrigger: function(ev) + {//tab 触发 + var $activeTab = this.$tab.find(".z-active"); + var activeIndex = Z.AR.indexOf(this.$$tabs, $activeTab[0]); + + var $shouldTab = Z(Z.E.current(ev)); + var shouldIndex = Z.AR.indexOf(this.$$tabs, $shouldTab[0]); + + var step = shouldIndex - activeIndex; + this.sliderPlay(step); + }, + resize: function() + { + // 停止自动播放 + this.sliding = true; + if (this.playAutoTimer) + { + clearInterval(this.playAutoTimer); + this.playAutoTimer = null; + } + + // 设置延迟,自动播放 + if (!this.resizeStep) + this.resizeStep = 0; + this.resizeStep++; + if (this.delayAutoPlay) + clearTimeout(this.delayAutoPlay); + this.delayAutoPlay = setTimeout(this.delayResize, this.playDuration, this, this.resizeStep); + + // 重置大小 + this.$wrap.css('width', 'auto'); + this.width = this.$wrap.offsetWidth(); + this.$wrap.css({ + "width": this.width, + }); + this.$ul.css("width", this.length * this.width); + this.$ul.find('li').css('width', this.width); + for (var i = 0;i < this.length;i++) { + Z(this.$$items[i]).css({"transform": "translate3d(" + i * this.width + "px,0,0)"}); + } + this.$firstClone.css({"transform": "translate3d(" + this.length * this.width + "px,0,0)"}); + this.$lastClone.css({"transform":"translate3d(-" + this.width + "px,0,0)"}); + + // 定位当前 + var $activeItem = this.$ul.find(".z-active"); + var activeIndex = Z.AR.indexOf(this.$$items, $activeItem[0]); + var ulTrans = -activeIndex * this.width; + this.$ul.css("transform", "translate3d("+ ulTrans +"px,0,0)"); + }, + delayResize: function(thisObj, resizeStep) + { + clearTimeout(thisObj.delayAutoPlay); + if (resizeStep !== thisObj.resizeStep) + return; + + thisObj.resizeStep = null; + thisObj.autoPlay(); + }, + transitionFixed: function() + {//兼容写法 + var $div = document.createElement('div'); + if ($div.style["transition"] !== undefined ){ + $div = null; + return "transitionend"; + } + if ($div.style["OTransition"] !== undefined ){ + $div = null; + return "oTransitionEnd"; + } + if ($div.style["WebkitTransition"] !== undefined ){ + $div = null; + return "webkitTransitionEnd"; + } + }, + + getRectSize: function(val, all) + { + if (/^\d+(\.\d+)?%$/.test(val)) + { + val = parseFloat(val) / 100 * all; + } + else + { + val = parseFloat(val) || all; + if (val < 0) + val = all; + } + return Math.round(val); + }, + //end of Z.Zslider.prototype +} + + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_ui/src_extend/zhiqim_slider.mobile.js b/zhiqim_ui/src_extend/zhiqim_slider.mobile.js new file mode 100644 index 0000000..fbcdb34 --- /dev/null +++ b/zhiqim_ui/src_extend/zhiqim_slider.mobile.js @@ -0,0 +1,322 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙登记发行许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ + + ++(function(Z) +{ + +/****************************************/ +//“轮播图” +/****************************************/ +Z.ZmSlider = Z.Class.newInstance(); +Z.ZmSlider.prototype = +{ + //start of Z.ZmSlider.prototype + defaults: + {//定义 + elem: '', // 主容器 + rectRatio: 2, // 宽度比例 + playAuto: true, // 设定自动滚动 + playSpeed: 2000, // 播放间隔 + transDur: 300, // 动画时长 + transFun: "ease", // 动画轨迹 + }, + init: function() + {//初始化 + }, + execute: function() + {//执行 + //1:重新组装排版 + this.$touch = Z.$elem(this.elem, "Z.ZmSlider").addClass("z-slider-touch"); + + this.$wrap = Z('
              ').insertAfter(this.$touch); + this.$wrap.append(this.$touch); + this.$tab = Z('
              ').appendTo(this.$wrap); + this.$$items = this.$touch.children("li"); + + //2:基本参数 + this.width = this.$wrap.offsetWidth(); + this.height = this.width/this.rectRatio; + this.length = this.$$items.length; + if (this.rectRatio < 0){ + this.rectRatio = 2; + } + if (this.playSpeed < this.transDur){ + this.playSpeed = this.transDur; + } + + //3:插入展示按钮html + var btnsHtml = ""; + for(var i = 0;i < this.length;i++){ + btnsHtml += ''; + } + this.$tab.html(btnsHtml); + this.$$tabs = this.$tab.children("span"); + + //4:初始化样式、位置 + this.$wrap.css("height",this.height); + + if (this.length <= 1) + {/*一张图片时*/ + return; + } + + if (this.length == 2) + {/*两个滚动素材的情况*/ + this.$touch.css("transition-timing-function",this.transFun).css("transition-duration",this.transDur+"ms") + .css("transform","translate3d(0,0,0)"); + + Z(this.$$items[0]).css("transform","translate3d(0,0,0)").addClass("z-active"); + Z(this.$$items[1]).css("transform","translate3d("+this.width+"px,0,0)"); + + //要实现无缝滚动,需复制节点 + this.$firstClone = Z(this.$$items[0].cloneNode(true)).appendTo(this.$touch); + this.$lastClone = Z(this.$$items[1].cloneNode(true)).appendTo(this.$touch); + this.$firstClone.css("transform","translate3d("+2*this.width+"px,0,0)"); + this.$lastClone.css("transform","translate3d(-"+this.width+"px,0,0)"); + + //动画结束,位置调整 + this.$touch.on(this.transitionFixed(), this.doubleSlideEnd, this); + } + else + {/*两张以上滚动素材的情况*/ + this.$$items.css("transition-timing-function",this.transFun).css("transition-duration",this.transDur+"ms"); + var that = this; + Z.each(this.$$items, function($item,index){ + var translateX = index * that.width + "px"; + if (index == 0) { + Z($item).addClass("z-active"); + } + if (index == that.length - 1) { + translateX = -that.width + "px"; + } + Z($item).css("transform","translate3d("+translateX+",0,0)"); + }); + } + Z(this.$$tabs[0]).addClass("z-active"); + + //5:滑动事件绑定 + this.touchmoving = false; + this.$touch.on("touchstart",this.touchStart,this); + this.$touch.on("touchmove",this.touchMove,this); + this.$touch.on("touchend",this.touchEnd,this); + + //6:开始执行动画 + this.autoPlay(); + }, + autoPlay: function() + { + if(this.playAuto){ + var that = this; + that.timer = setInterval(function(){ + that.sliderNext(that); + },that.playSpeed); + } + }, + touchStart:function(ev) + {//触摸事件开始 + Z.E.forbidden(ev); + var touch = ev.touches[0]; + this.touchStartX = touch.pageX; + + //清除自动 + clearInterval(this.timer); + + //两个滚动素材的情况 + if (this.length == 2){ + var step = +step; + var $activeItem = this.$touch.find(".z-active"); + var activeIndex = Z.AR.indexOf(this.$$items, $activeItem[0]); + this.touchBase = -activeIndex*this.width; + this.$touch.css("transition-property","none"); + return; + } + + //当前、前一个、后一个 + this.$activeItem = this.$touch.find(".z-active"); + var activeIndex = Z.AR.indexOf(this.$$items, this.$activeItem[0]); + this.$activeNext = Z(this.$$items[activeIndex + 1] || this.$$items[0]); + this.$activePrev = Z(this.$$items[activeIndex - 1] || this.$$items[this.length - 1]); + + //清除transition + this.$activeItem.css("transition-duration","0ms"); + this.$activeNext.css("transition-duration","0ms"); + this.$activePrev.css("transition-duration","0ms"); + }, + touchMove: function(ev) + {//滑动中 + if(this.touchmoving == false){ + this.touchmoving = true; + } + Z.E.forbidden(ev); + var touch = ev.touches[0]; + this.touchMoveX = touch.pageX; + + //设置translate + var metabolicX = this.touchMoveX - this.touchStartX; + + //两个滚动素材的情况 + if (this.length == 2){ + this.$touch.css("transform","translate3d("+(metabolicX+this.touchBase)+"px,0,0)"); + return; + } + + this.$activeItem.css("transform","translate3d("+metabolicX+"px,0,0)"); + this.$activeNext.css("transform","translate3d("+(metabolicX + this.width)+"px,0,0)"); + this.$activePrev.css("transform","translate3d("+(metabolicX - this.width)+"px,0,0)"); + }, + touchEnd: function(ev) + {//触摸事件结束 + if (this.touchmoving == false){ + return; + } + this.touchmoving = false; + Z.E.forbidden(ev); + + //执行自动 + this.autoPlay(); + + //判断滑动结果 + var metabolicX = this.touchMoveX - this.touchStartX; + + if (metabolicX == 0 || Math.abs(metabolicX) < this.width/2){ + this.sliderStay(); + return; + } + + if (this.$activeItem) this.$activeItem.css("transition-duration",this.transDur+"ms"); + if (metabolicX < 0){ + if (this.$activeNext) this.$activeNext.css("transition-duration",this.transDur+"ms"); + this.sliderNext(); + } else { + if (this.$activePrev) this.$activePrev.css("transition-duration",this.transDur+"ms"); + this.sliderPrev(); + } + }, + sliderNext: function() + {//后一个展示 + if (this.length == 2){ + this.doubleSlide(1); + return; + } + this.sliderPlay(1); + }, + sliderStay: function () + {//保持展示 + if (this.length == 2){ + this.doubleSlide(0); + return; + } + this.sliderPlay(0); + }, + sliderPrev: function() + {//前一个展示 + if (this.length == 2){ + this.doubleSlide(-1); + return; + } + this.sliderPlay(-1); + }, + sliderPlay: function(step) + {//滑动方法 + var step = +step; + var $activeItem = this.$touch.find(".z-active"); + var activeIndex = Z.AR.indexOf(this.$$items, $activeItem[0]); + $activeItem.removeClass("z-active"); + + //即将展示对象的索引值 + var shouldIndex = activeIndex + step; + if (shouldIndex >= this.length) shouldIndex = 0; + if (shouldIndex <= -1) shouldIndex = this.length - 1; + + //即将新定位的active,以及前后两个 + var $shouldActive = Z(this.$$items[shouldIndex]); + var $shouldNext = Z(this.$$items[shouldIndex + 1] || this.$$items[0]); + var $shouldPrev = Z(this.$$items[shouldIndex - 1] || this.$$items[this.length - 1]); + + //touch item新定位 + $shouldActive.addClass("z-active").css("transform","translate3d(0,0,0)") + .css("transition-duration",this.transDur+"ms"); + $shouldNext.css("transform","translate3d("+this.width+"px,0,0)"); + $shouldPrev.css("transform","translate3d(-"+this.width+"px,0,0)"); + + //前后两个判断是否动画 + var nextDur = prevDur = this.transDur+"ms"; + if (step > 0){ nextDur = "0ms";} + else if(step < 0){ prevDur = "0ms";} + $shouldNext.css("transition-duration",nextDur); + $shouldPrev.css("transition-duration",prevDur); + + //btn 展示 + Z(this.$$tabs[shouldIndex]).addClass("z-active") + .siblings("span").removeClass("z-active"); + }, + doubleSlide: function(step) + {//两个滚动素材的动画 + var step = +step; + var $activeItem = this.$touch.find(".z-active"); + var activeIndex = Z.AR.indexOf(this.$$items, $activeItem[0]); + $activeItem.removeClass("z-active"); + + var num = shouldIndex = activeIndex + step; + if (shouldIndex >= this.length) shouldIndex = 0; + if (shouldIndex <= -1) shouldIndex = this.length - 1; + Z(this.$$items[shouldIndex]).addClass("z-active"); + + this.$touch.css("transform", "translate3d("+(-num*this.width)+"px,0,0)") + .css("transition-property","transform"); + + //btn 展示 + Z(this.$$tabs[shouldIndex]).addClass("z-active") + .siblings("span").removeClass("z-active"); + }, + doubleSlideEnd: function() + {//两图片的滚动结束 + var $activeItem = this.$touch.find(".z-active"); + var activeIndex = Z.AR.indexOf(this.$$items, $activeItem[0]); + this.$touch.css("transition-property","none"); + if(activeIndex == 0){ + this.$touch.css("transform", "translate3d(0,0,0)"); + } + if(activeIndex == 1){ + this.$touch.css("transform", "translate3d("+(-this.width)+"px,0,0)"); + } + }, + transitionFixed: function() + {//兼容写法 + var $div = document.createElement('div'); + if ($div.style["transition"] !== undefined ){ + $div = null; + return "transitionend"; + } + if ($div.style["OTransition"] !== undefined ){ + $div = null; + return "oTransitionEnd"; + } + if ($div.style["WebkitTransition"] !== undefined ){ + $div = null; + return "webkitTransitionEnd"; + } + }, + //end of Z.ZmSlider.prototype +} + + + + +//END +})(zhiqim); diff --git a/zhiqim_ui/src_extend/zhiqim_webgl_three.js b/zhiqim_ui/src_extend/zhiqim_webgl_three.js new file mode 100644 index 0000000..b88d86b --- /dev/null +++ b/zhiqim_ui/src_extend/zhiqim_webgl_three.js @@ -0,0 +1,272 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * 指定登记&发行网站: https://www.zhiqim.com/ 欢迎加盟知启蒙,[编程有你,知启蒙一路随行]。 + * + * 本文采用《知启蒙登记发行许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ + ++(function(Z) +{ +//BEGIN + +/** + * WebGL+three.js 3D动画,当前有波浪和光线球两种 +*/ +Z.WebGLThree = Z.Class.newInstance(); +Z.WebGLThree.prototype = +{ + defaults: + { + //常量 + SEPARATION: 125, + AMOUNTX: 35, + AMOUNTY: 35, + + //传入参数 + threePath: null, + target: null, + + //内部对象 + camera: null, + scene: null, + renderer: null, + particles_ware: [], + particles_globe: [], + + //运行时 + count: 0, + mouseX: 0, + mouseY: 0, + windowHalfX: window.innerWidth / 2, + windowHalfY: window.innerHeight / 2, + rotation_speed: .002, + timeout: null + }, + + execute: function() + { + if (Z.B.mobile || Z.B.msieVer <= 9) + {//移动端和IE9以下不支持 + return; + } + + if (this.threePath == null || this.target == null) + {//两个参数必须 + return; + } + + if (Z.Types.isString(this.target)) + this.target = Z("#"+this.target); + else if (Z.Types.isElement(this.target)) + this.target = Z(this.target); + else + return; + + //先加载three.js,再初始化init + Z.loads(this.threePath, Z.bind(this.initWebGL, this)); + }, + + initWebGL: function() + { + var animationType = Math.floor(2 * Math.random()); + if (animationType == 0) + {//波浪 + this.initWave(); + this.animateWave(); + } + else + {//光球 + this.initGlobe(); + this.animateGlobe(); + } + + //增加事件处理 + Z(document).mousemove(this.onDocumentMouseMove, this) + .on("touchstart", this.onDocumentTouchStart, this) + .on("touchmove", this.onDocumentTouchMove, this); + Z(window).resize(this.onWindowResize, this); + }, + + /******************************************************************************************/ + //光球 + /******************************************************************************************/ + initGlobe: function initGlobe() + { + this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 1e4), + this.camera.position.z = 500, + this.scene = new THREE.Scene; + + for (var t = 2 * Math.PI, i = function (e) {e.beginPath(), e.arc(0, 0, 25, 0, t, true), e.fill()}, t = 2 * Math.PI, n = 0; 500 > n; n++) + { + var o = new THREE.SpriteCanvasMaterial({color: 16777215, + transparent: true, + program: function (e) {e.beginPath(), e.arc(0, 0, .5, 0, t, true), e.fill()}}); + var particle = new THREE.Sprite(o); + particle.position.x = 2 * Math.random() - 1; + particle.position.y = 2 * Math.random() - 1; + particle.position.z = 2 * Math.random() - 1; + particle.position.normalize(); + particle.position.multiplyScalar(10 * Math.random() + 450); + particle.scale.multiplyScalar(4 + 2 * Math.random()); + particle.material.opacity = .1; + this.scene.add(particle); + this.particles_globe.push(particle); + } + for (var n = 0; 500 > n; n++) + { + var s = new THREE.Geometry; + var r = new THREE.Vector3(2 * Math.random() - 1, 2 * Math.random() - 1, 2 * Math.random() - 1); + r.normalize(); + r.multiplyScalar(450); + s.vertices.push(r); + + var a = r.clone(); + a.multiplyScalar(.3 * Math.random() + 1), s.vertices.push(a); + var l = new THREE.Line(s, new THREE.LineBasicMaterial({color: 16777215, opacity: .3})); + this.scene.add(l) + } + this.renderer = new THREE.CanvasRenderer({alpha: true}); + this.renderer.setClearColor(0, 0); + this.renderer.setSize(window.innerWidth, window.innerHeight); + this.target.append(this.renderer.domElement) + }, + + animateGlobe: function() + { + requestAnimationFrame(Z.bind(this.animateGlobe, this)); + this.renderGlobe(); + }, + + renderGlobe: function() + { + var e = Z("body:hover"), t = this.camera.position.x, i = this.camera.position.y, n = this.camera.position.z; + if (e.length != 0 && this.timeout != null) + { + this.camera.position.x += .05 * (this.mouseX - this.camera.position.x); + } + else + { + this.camera.position.x = t * Math.cos(this.rotation_speed) - n * Math.sin(this.rotation_speed); + this.camera.position.z = n * Math.cos(this.rotation_speed) + t * Math.sin(this.rotation_speed); + } + + this.camera.position.y += .05 * (-this.mouseY + 200 - this.camera.position.y); + this.camera.lookAt(this.scene.position); + + Z(document).mousemove(function () { + this.timeout !== null && clearTimeout(this.timeout), this.timeout = setTimeout(function () {this.timeout = null}, 600) + }); + + for (var o = 0; o < this.particles_globe.length; o++) + { + var particle = this.particles_globe[o++]; + temp = 50 * Math.sin(.3 * (o + this.count)) + .5 * Math.sin(.5 * (o + this.count)); + opacity = Math.abs(temp) / 50 + .1; + opacity > 1 && (opacity = 1); + particle.material.opacity = opacity; + } + + this.renderer.render(this.scene, this.camera); + this.count += .1; + }, + + /******************************************************************************************/ + //波浪 + /******************************************************************************************/ + initWave: function() + { + this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 1e4); + this.camera.position.z = 1e3; + this.camera.position.y = 100; + this.camera.position.y = 1e3; + + this.scene = new THREE.Scene; + for (var t = 2 * Math.PI, i = 0, n = 0; this.AMOUNTX > n; n++)for (var o = 0; this.AMOUNTY > o; o++) + { + var s = new THREE.SpriteCanvasMaterial({color: 16777215, + transparent: true, + program: function (e) {e.beginPath(), e.arc(0, 0, .5, 0, t, true), e.fill()}}); + + var particle = this.particles_ware[i++] = new THREE.Sprite(s); + particle.position.x = n * this.SEPARATION - this.AMOUNTX * this.SEPARATION / 2; + particle.position.z = o * this.SEPARATION - this.AMOUNTY * this.SEPARATION / 2; + this.scene.add(particle), particle.material.opacity = .4; + } + + this.renderer = new THREE.CanvasRenderer({alpha: true}); + this.renderer.setClearColor(0, 0); + this.renderer.setSize(window.innerWidth, window.innerHeight); + this.target.append(this.renderer.domElement); + }, + + animateWave: function() + { + requestAnimationFrame(Z.bind(this.animateWave, this)); + this.renderWave(); + }, + + renderWave: function() + { + this.camera.position.x += .01 * (this.mouseX - this.camera.position.x), + this.camera.position.y += .005 * (this.mouseY - this.camera.position.y), + this.camera.lookAt(this.scene.position); + + for (var e = 0, t = 0; this.AMOUNTX > t; t++) + { + for (var i = 0; this.AMOUNTY > i; i++) + { + var particle = this.particles_ware[e++]; + particle.position.y = 50 * Math.sin(.3 * (t + this.count)) + 50 * Math.sin(.5 * (i + this.count)); + particle.scale.x = particle.scale.y = 4 * (Math.sin(.3 * (t + this.count)) + 1) + 4 * (Math.sin(.5 * (i + this.count)) + 1); + opacity = Math.abs(particle.position.y) / 100; + opacity < .5 && (opacity = .5); + opacity > 1 && (opacity = 1); + particle.material.opacity = opacity; + } + } + + this.renderer.render(this.scene, this.camera); + this.count += .03 + }, + + /******************************************************************************************/ + //事件处理 + /******************************************************************************************/ + + onWindowResize: function() + {//缩放 + this.windowHalfX = window.innerWidth / 2, + this.windowHalfY = window.innerHeight / 2, + this.camera.aspect = window.innerWidth / window.innerHeight, + this.camera.updateProjectionMatrix(), + this.renderer.setSize(window.innerWidth, window.innerHeight); + }, + + onDocumentMouseMove: function(e) + {//鼠标移动 + this.mouseX = e.clientX - this.windowHalfX, this.mouseY = e.clientY + 150; + }, + + onDocumentTouchStart: function(e) + {//iOS触摸开始 + 1 === e.touches.length && (e.preventDefault(), this.mouseX = e.touches[0].pageX - this.windowHalfX, this.mouseY = -e.touches[0].pageY); + }, + + onDocumentTouchMove: function(e) + {//iOS触摸移动 + 1 === e.touches.length && (e.preventDefault(), this.mouseX = e.touches[0].pageX - this.windowHalfX, this.mouseY = -e.touches[0].pageY); + } +}; + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_ui/test.htm b/zhiqim_ui/test.htm new file mode 100644 index 0000000..bd35691 --- /dev/null +++ b/zhiqim_ui/test.htm @@ -0,0 +1,72 @@ + + + +知启蒙前端框架 + + + + + + + +${Styles.src("/src/zhiqim.css")} + + + + + + + + + + + + + + + + + + +
              +    +
              + +
              + + + + + + + +
              + + + + + + +
              + +
              + + diff --git a/zhiqim_ui/zinc/mobile/images/case.png b/zhiqim_ui/zinc/mobile/images/case.png new file mode 100644 index 0000000..22d17d1 Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/case.png differ diff --git a/zhiqim_ui/zinc/mobile/images/download-m.png b/zhiqim_ui/zinc/mobile/images/download-m.png new file mode 100644 index 0000000..dbb65ba Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/download-m.png differ diff --git a/zhiqim_ui/zinc/mobile/images/download.png b/zhiqim_ui/zinc/mobile/images/download.png new file mode 100644 index 0000000..f59aa4f Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/download.png differ diff --git a/zhiqim_ui/zinc/mobile/images/fadfoxico.png b/zhiqim_ui/zinc/mobile/images/fadfoxico.png new file mode 100644 index 0000000..7fea253 Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/fadfoxico.png differ diff --git a/zhiqim_ui/zinc/mobile/images/file.png b/zhiqim_ui/zinc/mobile/images/file.png new file mode 100644 index 0000000..913e761 Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/file.png differ diff --git a/zhiqim_ui/zinc/mobile/images/four.png b/zhiqim_ui/zinc/mobile/images/four.png new file mode 100644 index 0000000..944898d Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/four.png differ diff --git a/zhiqim_ui/zinc/mobile/images/hello.jpg b/zhiqim_ui/zinc/mobile/images/hello.jpg new file mode 100644 index 0000000..4fe3bb3 Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/hello.jpg differ diff --git a/zhiqim_ui/zinc/mobile/images/httpd.jpg b/zhiqim_ui/zinc/mobile/images/httpd.jpg new file mode 100644 index 0000000..3e5698e Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/httpd.jpg differ diff --git a/zhiqim_ui/zinc/mobile/images/login.jpg b/zhiqim_ui/zinc/mobile/images/login.jpg new file mode 100644 index 0000000..4ade50d Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/login.jpg differ diff --git a/zhiqim_ui/zinc/mobile/images/logo.png b/zhiqim_ui/zinc/mobile/images/logo.png new file mode 100644 index 0000000..d9da6f7 Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/logo.png differ diff --git a/zhiqim_ui/zinc/mobile/images/menuico.png b/zhiqim_ui/zinc/mobile/images/menuico.png new file mode 100644 index 0000000..44b4fe5 Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/menuico.png differ diff --git a/zhiqim_ui/zinc/mobile/images/microcore.jpg b/zhiqim_ui/zinc/mobile/images/microcore.jpg new file mode 100644 index 0000000..42ae13d Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/microcore.jpg differ diff --git a/zhiqim_ui/zinc/mobile/images/one.png b/zhiqim_ui/zinc/mobile/images/one.png new file mode 100644 index 0000000..9353f21 Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/one.png differ diff --git a/zhiqim_ui/zinc/mobile/images/orm.jpg b/zhiqim_ui/zinc/mobile/images/orm.jpg new file mode 100644 index 0000000..6b6179f Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/orm.jpg differ diff --git a/zhiqim_ui/zinc/mobile/images/project.jpg b/zhiqim_ui/zinc/mobile/images/project.jpg new file mode 100644 index 0000000..dc19c67 Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/project.jpg differ diff --git a/zhiqim_ui/zinc/mobile/images/slogan.png b/zhiqim_ui/zinc/mobile/images/slogan.png new file mode 100644 index 0000000..b29ee6f Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/slogan.png differ diff --git a/zhiqim_ui/zinc/mobile/images/template.jpg b/zhiqim_ui/zinc/mobile/images/template.jpg new file mode 100644 index 0000000..a04cf87 Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/template.jpg differ diff --git a/zhiqim_ui/zinc/mobile/images/three.png b/zhiqim_ui/zinc/mobile/images/three.png new file mode 100644 index 0000000..ac9251e Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/three.png differ diff --git a/zhiqim_ui/zinc/mobile/images/time.jpg b/zhiqim_ui/zinc/mobile/images/time.jpg new file mode 100644 index 0000000..919c649 Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/time.jpg differ diff --git a/zhiqim_ui/zinc/mobile/images/two.png b/zhiqim_ui/zinc/mobile/images/two.png new file mode 100644 index 0000000..2587728 Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/two.png differ diff --git a/zhiqim_ui/zinc/mobile/images/ui.jpg b/zhiqim_ui/zinc/mobile/images/ui.jpg new file mode 100644 index 0000000..fa817bf Binary files /dev/null and b/zhiqim_ui/zinc/mobile/images/ui.jpg differ diff --git a/zhiqim_ui/zinc/www/clipboard.js b/zhiqim_ui/zinc/www/clipboard.js new file mode 100644 index 0000000..75b60e7 --- /dev/null +++ b/zhiqim_ui/zinc/www/clipboard.js @@ -0,0 +1,790 @@ +/*! + * clipboard.js v1.7.1 + * https://zenorocha.github.io/clipboard.js + * + * Licensed MIT © Zeno Rocha + */ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Clipboard = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0 && arguments[0] !== undefined ? arguments[0] : {}; + + this.action = options.action; + this.container = options.container; + this.emitter = options.emitter; + this.target = options.target; + this.text = options.text; + this.trigger = options.trigger; + + this.selectedText = ''; + } + }, { + key: 'initSelection', + value: function initSelection() { + if (this.text) { + this.selectFake(); + } else if (this.target) { + this.selectTarget(); + } + } + }, { + key: 'selectFake', + value: function selectFake() { + var _this = this; + + var isRTL = document.documentElement.getAttribute('dir') == 'rtl'; + + this.removeFake(); + + this.fakeHandlerCallback = function () { + return _this.removeFake(); + }; + this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true; + + this.fakeElem = document.createElement('textarea'); + // Prevent zooming on iOS + this.fakeElem.style.fontSize = '12pt'; + // Reset box model + this.fakeElem.style.border = '0'; + this.fakeElem.style.padding = '0'; + this.fakeElem.style.margin = '0'; + // Move element out of screen horizontally + this.fakeElem.style.position = 'absolute'; + this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px'; + // Move element to the same position vertically + var yPosition = window.pageYOffset || document.documentElement.scrollTop; + this.fakeElem.style.top = yPosition + 'px'; + + this.fakeElem.setAttribute('readonly', ''); + this.fakeElem.value = this.text; + + this.container.appendChild(this.fakeElem); + + this.selectedText = (0, _select2.default)(this.fakeElem); + this.copyText(); + } + }, { + key: 'removeFake', + value: function removeFake() { + if (this.fakeHandler) { + this.container.removeEventListener('click', this.fakeHandlerCallback); + this.fakeHandler = null; + this.fakeHandlerCallback = null; + } + + if (this.fakeElem) { + this.container.removeChild(this.fakeElem); + this.fakeElem = null; + } + } + }, { + key: 'selectTarget', + value: function selectTarget() { + this.selectedText = (0, _select2.default)(this.target); + this.copyText(); + } + }, { + key: 'copyText', + value: function copyText() { + var succeeded = void 0; + + try { + succeeded = document.execCommand(this.action); + } catch (err) { + succeeded = false; + } + + this.handleResult(succeeded); + } + }, { + key: 'handleResult', + value: function handleResult(succeeded) { + this.emitter.emit(succeeded ? 'success' : 'error', { + action: this.action, + text: this.selectedText, + trigger: this.trigger, + clearSelection: this.clearSelection.bind(this) + }); + } + }, { + key: 'clearSelection', + value: function clearSelection() { + if (this.trigger) { + this.trigger.focus(); + } + + window.getSelection().removeAllRanges(); + } + }, { + key: 'destroy', + value: function destroy() { + this.removeFake(); + } + }, { + key: 'action', + set: function set() { + var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy'; + + this._action = action; + + if (this._action !== 'copy' && this._action !== 'cut') { + throw new Error('Invalid "action" value, use either "copy" or "cut"'); + } + }, + get: function get() { + return this._action; + } + }, { + key: 'target', + set: function set(target) { + if (target !== undefined) { + if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) { + if (this.action === 'copy' && target.hasAttribute('disabled')) { + throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); + } + + if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { + throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); + } + + this._target = target; + } else { + throw new Error('Invalid "target" value, use a valid Element'); + } + } + }, + get: function get() { + return this._target; + } + }]); + + return ClipboardAction; + }(); + + module.exports = ClipboardAction; +}); + +},{"select":5}],8:[function(require,module,exports){ +(function (global, factory) { + if (typeof define === "function" && define.amd) { + define(['module', './clipboard-action', 'tiny-emitter', 'good-listener'], factory); + } else if (typeof exports !== "undefined") { + factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener')); + } else { + var mod = { + exports: {} + }; + factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener); + global.clipboard = mod.exports; + } +})(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) { + 'use strict'; + + var _clipboardAction2 = _interopRequireDefault(_clipboardAction); + + var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter); + + var _goodListener2 = _interopRequireDefault(_goodListener); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + + var Clipboard = function (_Emitter) { + _inherits(Clipboard, _Emitter); + + /** + * @param {String|HTMLElement|HTMLCollection|NodeList} trigger + * @param {Object} options + */ + function Clipboard(trigger, options) { + _classCallCheck(this, Clipboard); + + var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this)); + + _this.resolveOptions(options); + _this.listenClick(trigger); + return _this; + } + + /** + * Defines if attributes would be resolved using internal setter functions + * or custom functions that were passed in the constructor. + * @param {Object} options + */ + + + _createClass(Clipboard, [{ + key: 'resolveOptions', + value: function resolveOptions() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + this.action = typeof options.action === 'function' ? options.action : this.defaultAction; + this.target = typeof options.target === 'function' ? options.target : this.defaultTarget; + this.text = typeof options.text === 'function' ? options.text : this.defaultText; + this.container = _typeof(options.container) === 'object' ? options.container : document.body; + } + }, { + key: 'listenClick', + value: function listenClick(trigger) { + var _this2 = this; + + this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) { + return _this2.onClick(e); + }); + } + }, { + key: 'onClick', + value: function onClick(e) { + var trigger = e.delegateTarget || e.currentTarget; + + if (this.clipboardAction) { + this.clipboardAction = null; + } + + this.clipboardAction = new _clipboardAction2.default({ + action: this.action(trigger), + target: this.target(trigger), + text: this.text(trigger), + container: this.container, + trigger: trigger, + emitter: this + }); + } + }, { + key: 'defaultAction', + value: function defaultAction(trigger) { + return getAttributeValue('action', trigger); + } + }, { + key: 'defaultTarget', + value: function defaultTarget(trigger) { + var selector = getAttributeValue('target', trigger); + + if (selector) { + return document.querySelector(selector); + } + } + }, { + key: 'defaultText', + value: function defaultText(trigger) { + return getAttributeValue('text', trigger); + } + }, { + key: 'destroy', + value: function destroy() { + this.listener.destroy(); + + if (this.clipboardAction) { + this.clipboardAction.destroy(); + this.clipboardAction = null; + } + } + }], [{ + key: 'isSupported', + value: function isSupported() { + var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut']; + + var actions = typeof action === 'string' ? [action] : action; + var support = !!document.queryCommandSupported; + + actions.forEach(function (action) { + support = support && !!document.queryCommandSupported(action); + }); + + return support; + } + }]); + + return Clipboard; + }(_tinyEmitter2.default); + + /** + * Helper function to retrieve attribute value. + * @param {String} suffix + * @param {Element} element + */ + function getAttributeValue(suffix, element) { + var attribute = 'data-clipboard-' + suffix; + + if (!element.hasAttribute(attribute)) { + return; + } + + return element.getAttribute(attribute); + } + + module.exports = Clipboard; +}); + +},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8) +}); \ No newline at end of file diff --git a/zhiqim_ui/zinc/www/default.jpg b/zhiqim_ui/zinc/www/default.jpg new file mode 100644 index 0000000..7c69caa Binary files /dev/null and b/zhiqim_ui/zinc/www/default.jpg differ diff --git a/zhiqim_ui/zinc/www/editor.css b/zhiqim_ui/zinc/www/editor.css new file mode 100644 index 0000000..ff3c970 --- /dev/null +++ b/zhiqim_ui/zinc/www/editor.css @@ -0,0 +1,40 @@ +/** 编辑器颜色定义 */ +.f-color-html-tag{color:#3f7f7f;} +.f-color-html-name{color:#7f0055;} +.f-color-html-value{color:#2a00ff;} +.f-color-html-comment{color:#808080;} +.f-color-ftml-echo{color:#cc3352;} +.f-color-ftml-call{color:#cc3352;} +.f-color-ftml-directive{color:#00f;} +.f-color-ftml-directive-related{color:#ffff80;} +.f-color-ftml-string{color:#008080;} +.f-color-ftml-comment{color:#a00;} +.f-color-css-name{color:#000;} +.f-color-css-property{color:#7f0055;} +.f-color-css-value{color:#000;} +.f-color-css-string{color:#2a00ff;} +.f-color-css-comment{color:#3f7f5f;} +.f-color-js-key{color:#7f0055;} +.f-color-js-string{color:#2a00ff;} +.f-color-js-comment{color:#3f7f5f;} +.f-color-js-comment-multi{color:#7f9fbf;} + +.fi-color-html-tag{color:#3f7f7f !important;} +.fi-color-html-name{color:#7f0055 !important;} +.fi-color-html-value{color:#2a00ff !important;} +.fi-color-html-comment{color:#808080 !important;} +.fi-color-ftml-echo{color:#cc3352 !important;} +.fi-color-ftml-call{color:#cc3352 !important;} +.fi-color-ftml-directive{color:#00f !important;} +.fi-color-ftml-directive-related{color:#ffff80 !important;} +.fi-color-ftml-string{color:#008080 !important;} +.fi-color-ftml-comment{color:#a00 !important;} +.fi-color-css-name{color:#000 !important;} +.fi-color-css-property{color:#7f0055 !important;} +.fi-color-css-value{color:#000 !important;} +.fi-color-css-string{color:#2a00ff !important;} +.fi-color-css-comment{color:#3f7f5f !important;} +.fi-color-js-key{color:#7f0055 !important;} +.fi-color-js-string{color:#2a00ff !important;} +.fi-color-js-comment{color:#3f7f5f !important;} +.fi-color-js-comment-multi{color:#7f9fbf !important;} diff --git a/zhiqim_ui/zinc/www/ie8media.js b/zhiqim_ui/zinc/www/ie8media.js new file mode 100644 index 0000000..1768200 --- /dev/null +++ b/zhiqim_ui/zinc/www/ie8media.js @@ -0,0 +1,39 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。 + * + * Download http://fadfox.zhiqim.com/ 欢迎加盟[凡狐]兴趣小组。 + * + * 本文采用《知启蒙登记发行许可证》,除非符合许可证,否则不可使用该文件! + * 1、您可以免费使用、修改、合并、出版发行和分发,再授权软件、软件副本及衍生软件; + * 2、您用于商业用途时,必须在原作者指定的登记网站,按原作者要求进行登记; + * 3、您在使用、修改、合并、出版发行和分发时,必须包含版权声明、许可声明,及保留原作者的著作权、商标和专利等知识产权; + * 4、您在互联网、移动互联网等大众网络下发行和分发再授权软件、软件副本及衍生软件时,必须在原作者指定的发行网站进行发行和分发; + * 5、您可以在以下链接获取一个完整的许可证副本。 + * + * 许可证链接:http://zhiqim.org/licenses/zhiqim_register_publish_license.htm + * + * 除非法律需要或书面同意,软件由原始码方式提供,无任何明示或暗示的保证和条件。详见完整许可证的权限和限制。 + */ + +(function(F) +{ +//BEGIN + +if (F.B.msieVer > 8 || screen.width > 1071) + return; + +F.onload(function() +{ + F(".mainnav .menu").css("marginLeft", "18px"); + F(".mainnav .menu li").css("margin", "12px 2px;"); + + F(".footer li.fproduct").css("width", "140px"); + F(".footer li.fhelp").css("width", "180px"); + F(".footer li.fabout").css("width", "140px"); + F(".footer li.abountus").css("width", "280px"); + + F(".footer-cp-wrap").css("width", "1000px"); + F(".footer-cp .footer-text").css("width", "1000px").css("marginLeft", "-100px"); +}); + +//END +})(fadfox); \ No newline at end of file diff --git a/zhiqim_ui/zinc/www/images/aboutus.png b/zhiqim_ui/zinc/www/images/aboutus.png new file mode 100644 index 0000000..080ff7a Binary files /dev/null and b/zhiqim_ui/zinc/www/images/aboutus.png differ diff --git a/zhiqim_ui/zinc/www/images/case.png b/zhiqim_ui/zinc/www/images/case.png new file mode 100644 index 0000000..1fd3191 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/case.png differ diff --git a/zhiqim_ui/zinc/www/images/code.jpg b/zhiqim_ui/zinc/www/images/code.jpg new file mode 100644 index 0000000..66fb95c Binary files /dev/null and b/zhiqim_ui/zinc/www/images/code.jpg differ diff --git a/zhiqim_ui/zinc/www/images/component.png b/zhiqim_ui/zinc/www/images/component.png new file mode 100644 index 0000000..b6ca3ab Binary files /dev/null and b/zhiqim_ui/zinc/www/images/component.png differ diff --git a/zhiqim_ui/zinc/www/images/default.jpg b/zhiqim_ui/zinc/www/images/default.jpg new file mode 100644 index 0000000..8bbe286 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/default.jpg differ diff --git a/zhiqim_ui/zinc/www/images/disc.png b/zhiqim_ui/zinc/www/images/disc.png new file mode 100644 index 0000000..1d94403 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/disc.png differ diff --git a/zhiqim_ui/zinc/www/images/download.png b/zhiqim_ui/zinc/www/images/download.png new file mode 100644 index 0000000..193c3f0 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/download.png differ diff --git a/zhiqim_ui/zinc/www/images/file.png b/zhiqim_ui/zinc/www/images/file.png new file mode 100644 index 0000000..7fe6775 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/file.png differ diff --git a/zhiqim_ui/zinc/www/images/fixicon.png b/zhiqim_ui/zinc/www/images/fixicon.png new file mode 100644 index 0000000..3f8bdbc Binary files /dev/null and b/zhiqim_ui/zinc/www/images/fixicon.png differ diff --git a/zhiqim_ui/zinc/www/images/four.png b/zhiqim_ui/zinc/www/images/four.png new file mode 100644 index 0000000..ef799da Binary files /dev/null and b/zhiqim_ui/zinc/www/images/four.png differ diff --git a/zhiqim_ui/zinc/www/images/httpd.jpg b/zhiqim_ui/zinc/www/images/httpd.jpg new file mode 100644 index 0000000..1c9be2e Binary files /dev/null and b/zhiqim_ui/zinc/www/images/httpd.jpg differ diff --git a/zhiqim_ui/zinc/www/images/ico-fde.png b/zhiqim_ui/zinc/www/images/ico-fde.png new file mode 100644 index 0000000..5a356bb Binary files /dev/null and b/zhiqim_ui/zinc/www/images/ico-fde.png differ diff --git a/zhiqim_ui/zinc/www/images/ico-fdk.png b/zhiqim_ui/zinc/www/images/ico-fdk.png new file mode 100644 index 0000000..87dd491 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/ico-fdk.png differ diff --git a/zhiqim_ui/zinc/www/images/ico-fpm.png b/zhiqim_ui/zinc/www/images/ico-fpm.png new file mode 100644 index 0000000..78a0f39 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/ico-fpm.png differ diff --git a/zhiqim_ui/zinc/www/images/ico_dk.png b/zhiqim_ui/zinc/www/images/ico_dk.png new file mode 100644 index 0000000..f7a0fd1 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/ico_dk.png differ diff --git a/zhiqim_ui/zinc/www/images/ico_pm.png b/zhiqim_ui/zinc/www/images/ico_pm.png new file mode 100644 index 0000000..c7383ad Binary files /dev/null and b/zhiqim_ui/zinc/www/images/ico_pm.png differ diff --git a/zhiqim_ui/zinc/www/images/ico_studio.png b/zhiqim_ui/zinc/www/images/ico_studio.png new file mode 100644 index 0000000..9f0d312 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/ico_studio.png differ diff --git a/zhiqim_ui/zinc/www/images/icon_bei.png b/zhiqim_ui/zinc/www/images/icon_bei.png new file mode 100644 index 0000000..9f76394 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/icon_bei.png differ diff --git a/zhiqim_ui/zinc/www/images/iphone.png b/zhiqim_ui/zinc/www/images/iphone.png new file mode 100644 index 0000000..3bdb6cd Binary files /dev/null and b/zhiqim_ui/zinc/www/images/iphone.png differ diff --git a/zhiqim_ui/zinc/www/images/logo_z.png b/zhiqim_ui/zinc/www/images/logo_z.png new file mode 100644 index 0000000..9153928 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/logo_z.png differ diff --git a/zhiqim_ui/zinc/www/images/logo_zhiqim.png b/zhiqim_ui/zinc/www/images/logo_zhiqim.png new file mode 100644 index 0000000..986a3c9 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/logo_zhiqim.png differ diff --git a/zhiqim_ui/zinc/www/images/logo_zhiqimeng.png b/zhiqim_ui/zinc/www/images/logo_zhiqimeng.png new file mode 100644 index 0000000..6b5be8c Binary files /dev/null and b/zhiqim_ui/zinc/www/images/logo_zhiqimeng.png differ diff --git a/zhiqim_ui/zinc/www/images/logofont.png b/zhiqim_ui/zinc/www/images/logofont.png new file mode 100644 index 0000000..1c1deee Binary files /dev/null and b/zhiqim_ui/zinc/www/images/logofont.png differ diff --git a/zhiqim_ui/zinc/www/images/microcore.jpg b/zhiqim_ui/zinc/www/images/microcore.jpg new file mode 100644 index 0000000..6c909e2 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/microcore.jpg differ diff --git a/zhiqim_ui/zinc/www/images/one.png b/zhiqim_ui/zinc/www/images/one.png new file mode 100644 index 0000000..83eeb67 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/one.png differ diff --git a/zhiqim_ui/zinc/www/images/orm.jpg b/zhiqim_ui/zinc/www/images/orm.jpg new file mode 100644 index 0000000..37504f9 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/orm.jpg differ diff --git a/zhiqim_ui/zinc/www/images/play.png b/zhiqim_ui/zinc/www/images/play.png new file mode 100644 index 0000000..2e1cd58 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/play.png differ diff --git a/zhiqim_ui/zinc/www/images/product.png b/zhiqim_ui/zinc/www/images/product.png new file mode 100644 index 0000000..43877b9 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/product.png differ diff --git a/zhiqim_ui/zinc/www/images/scrolltotop.png b/zhiqim_ui/zinc/www/images/scrolltotop.png new file mode 100644 index 0000000..5cf37eb Binary files /dev/null and b/zhiqim_ui/zinc/www/images/scrolltotop.png differ diff --git a/zhiqim_ui/zinc/www/images/slogan.png b/zhiqim_ui/zinc/www/images/slogan.png new file mode 100644 index 0000000..06b45a8 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/slogan.png differ diff --git a/zhiqim_ui/zinc/www/images/template.jpg b/zhiqim_ui/zinc/www/images/template.jpg new file mode 100644 index 0000000..066daa4 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/template.jpg differ diff --git a/zhiqim_ui/zinc/www/images/three.png b/zhiqim_ui/zinc/www/images/three.png new file mode 100644 index 0000000..856878b Binary files /dev/null and b/zhiqim_ui/zinc/www/images/three.png differ diff --git a/zhiqim_ui/zinc/www/images/two.png b/zhiqim_ui/zinc/www/images/two.png new file mode 100644 index 0000000..a5d64e3 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/two.png differ diff --git a/zhiqim_ui/zinc/www/images/ui.jpg b/zhiqim_ui/zinc/www/images/ui.jpg new file mode 100644 index 0000000..4ccb387 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/ui.jpg differ diff --git a/zhiqim_ui/zinc/www/images/zhiqimico.png b/zhiqim_ui/zinc/www/images/zhiqimico.png new file mode 100644 index 0000000..986a3c9 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/zhiqimico.png differ diff --git a/zhiqim_ui/zinc/www/images/zlogo.png b/zhiqim_ui/zinc/www/images/zlogo.png new file mode 100644 index 0000000..9153928 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/zlogo.png differ diff --git a/zhiqim_ui/zinc/www/images/zqmlogo.png b/zhiqim_ui/zinc/www/images/zqmlogo.png new file mode 100644 index 0000000..ff64692 Binary files /dev/null and b/zhiqim_ui/zinc/www/images/zqmlogo.png differ diff --git a/zhiqim_ui/zinc/www/main.css b/zhiqim_ui/zinc/www/main.css new file mode 100644 index 0000000..bbc12a1 --- /dev/null +++ b/zhiqim_ui/zinc/www/main.css @@ -0,0 +1,273 @@ +/**************************************************************************************/ +/* 布局(全局、导航、脚注) */ +/**************************************************************************************/ + +/* [全局定义] */ +html{overflow-x:hidden;} +body,table,td,div{font-size:14px;line-height:120%;} +a,a:visited{color:#333;text-decoration:none;cursor:pointer;} +a:active,a:hover{color:#008bd2;text-decoration:none;} +a.blue,a.blue:visited{color:#0066cc;text-decoration:none;cursor:pointer;} +a.blue:active,a.blue:hover{color:#0066cc;text-decoration:underline;} + +/* [顶导航] */ +.topnav {position:fixed;top:0;left:0;width:100%;min-width:1250px;color: #fff;background-color:#00a2eb;height:55px;z-index:99;} +.topnav .logo {float:left;width:60px;height:55px;line-height:55px;background-color:#008bd2;} +.topnav .logoname {float:left;font-size:28px;width:240px;height:55px;line-height:52px;background-color:#00a2eb;color:#fff;padding-left:10px;border-right:1px solid #008bd2;} + +.topnav .topnavleft {float:left;height:55px;line-height:55px;} +.topnav .topnavleft .nav {float:left;width:96px;height:55px;line-height:55px;font-size:16px;margin-right:5px;text-align:center;letter-spacing:2px;cursor:pointer;} +.topnav .topnavleft .nav:hover{color:#fff;background-color:#008bd2;border-left:1px solid #0583cc;border-right:1px solid #0583cc;} +.topnav .topnavleft .nav.active{color:#fff;background-color:#008bd2;border-left:1px solid #0583cc;border-right:1px solid #0583cc;} + +.topnav .topnavright {float:right;height:55px;} +.topnav .topnavright .nav {float:left;height:55px;line-height:55px;font-size:14px;border-left:1px solid #008bd2;} +.topnav .topnavright .nav:hover {background-color:#01a7f2; color:#fff;} +.topnav .topnavright .query{float:left;width:300px;margin-right:15px;height:55px;line-height:50px;text-align:center;} +.topnav .topnavright .query input{width:85%;color:#ffffff;border-bottom:1px solid #f5f5f5;border-top:0px;border-left:0px;border-right:0px; -webkit-box-shadow:none;-moz-box-shadow:none; box-shadow:none;background-color:transparent;} +@media screen and (max-width:1430px){.topnav .topnavleft .nav {width:93px;}.topnav .topnavright .query{width:250px;}} +@media screen and (max-width:1360px){.topnav .topnavleft .nav {width:88px;}.topnav .topnavright .query{width:200px;}} + +.topnav .topnavright .navcray {float:left;height:55px;line-height:55px;font-size:14px;border-left:1px solid #008bd2;background-color:#08c2c0;} +.topnav .topnavright .navcray:hover {background-color:#1fcdcb; color:#fff;} + +/* [顶导航固定55px] */ +.topnav-margin{position:relative;width:100%;height:55px;} + +/* [顶导航通知] */ +.noticenum{position:absolute;top:0;right:8px;padding:0 2px;border-radius:50px;box-shadow:0 0 0 2px #ffffff;min-width:20px;line-height:20px;font-style:normal;background-color:#ff0000;color:#fff;font-size:12px;} + +/**************************************************************************************/ +/* 首页分屏 */ +/**************************************************************************************/ + +.sectiontitle{font-size:30px;margin-bottom:10px;font-weight:bold;} + +/* 区域 */ +.section{position:relative;width:100%;height:600px;background-color:#f8f8f8;} +.section .first, +.section .second, +.section .third, +.section .fourth, +.section .fifth, +.section .sixth{position:absolute;margin:auto;top:0;left:0;bottom:0;right:0;width:100%;max-width:1250px;} + +/* 首屏 */ +.section .first{height:550px;width:100%} +.section .first .title{position:relative;margin:20px auto 0 auto;width:706px;height:84px;text-align:center;} +.section .first .intro{padding:0 50px; display: -webkit-flex; /* Safari */ display: flex; flex-direction:row;flex-wrap:nowrap;justify-content:space-between;align-items:center;margin:80px auto 0 auto;color:#fff;} +.section .first .intro button{border:1px solid #fff;background-color:transparent;border-radius:4px;color:#fff;font-size:16px;} +.section .first .count{margin-top:50px;padding-right:40px;text-align:right;font-size:24px;color:#fff;} + +/* 第二屏 */ +.section .second{height:550px;} +.section .second .brief{margin-top:90px;padding-left:20px;} +.section .second .brief a{color:#1e7eec;} + +/* 第三屏 */ +.section .third{height:460px;} +.section .third .producttitle{font-size:40px;margin-bottom:10px;font-weight:bold;} +.section .third .productfont{font-size:18px;color:#555;} +.section .third .productfont ul{margin-top:15px;} +.section .third .productfont li{color:#555;line-height:38px;list-style:none;list-style-image: url(images/disc.png);list-style-position: inside;} + +.fadeInDown .z-float-left{ +display : block !important; +animation:fadeInDown 1s; +/* Firefox: */ +-moz-animation:fadeInDown 1s; +/* Safari and Chrome: */ +-webkit-animation:fadeInDown 1s; +/* Opera: */ +-o-animation:fadeInDown 1s;} +@keyframes fadeInDown +{ +0% {opacity: 0;-webkit-transform: translate3d(0,-600px,0);transform: translate3d(0,-600px,0);} +100% {opacity: 1;-webkit-transform: none;transform: none;} +} + +@-moz-keyframes fadeInDown /* Firefox */ +{ +0% {opacity: 0;-webkit-transform: translate3d(0,-600px,0);transform: translate3d(0,-600px,0);} +100% {opacity: 1;-webkit-transform: none;transform: none;} +} + +@-webkit-keyframes fadeInDown /* Safari and Chrome */ +{ +0% {opacity: 0;-webkit-transform: translate3d(0,-600px,0);transform: translate3d(0,-600px,0);} +100% {opacity: 1;-webkit-transform: none;transform: none;} +} + +@-o-keyframes fadeInDown /* Opera */ +{ +0% {opacity: 0;-webkit-transform: translate3d(0,-600px,0);transform: translate3d(0,-600px,0);} +100% {opacity: 1;-webkit-transform: none;transform: none;} +} + +/* 第四屏 */ +.section .fourth{height:460px;} +.section .fourth .brief{margin-top:90px;padding-left:20px;} +.section .fourth .brief a{color:#1e7eec;} +.section .fourth .brief .corporate{font-size:30px;margin-bottom:10px;font-weight:bold;} + +/* 第五屏 */ +.section .fifth{height:460px;} +.section .fifth .brief{margin-top:110px;} +.section .fifth .brief a{color:#1e7eec;} + +/* 第六屏 */ +.section .sixth{height:460px;} +.section .sixth .brief{margin-top:90px;} +.section .sixth .brief a{color:#1e7eec;} + +/**************************************************************************************/ +/* 容器内容 */ +/**************************************************************************************/ + +/** [容器定义] */ +.container {display: flex;width:100%;min-width:1250px;height:100%;min-height:1000px;overflow:hidden;background-color:#fff;} + +/* [左导航] */ +.sidebar-top{position:relative;float:left;width:60px;height:100%;overflow:hidden; background-color:#333;z-index:20;padding-bottom: 9999px;margin-bottom: -9999px;} +.sidebar-top li{position:relative;float:left;width:60px;height:70px;display:inline-block;text-align:center;color:#fff;padding:13px 0;line-height:22px;} +.sidebar-top li:hover{background-color:#414750;cursor:pointer;} +.sidebar-top li.active{background-color:#5c5c5c;} +.sidebar-top li i{font-size:22px;} +.sidebar-top .avatar{text-align:center;padding:16px 5px;cursor:pointer;} + +.sidebar-child{position:relative;margin-left:60px;width:240px;height:100%;overflow:hidden; background-color:#f2f2f2;border-right:1px solid #d8dce5;z-index:20;padding-bottom: 9999px;margin-bottom: -9999px;} +.sidebar-child p{position:relative;float:left;width:240px; height:40px;line-height:40px;color:#333; padding-left:25px; background-color:#f2f2f2;cursor:pointer;} +.sidebar-child p a{color:#333;} +.sidebar-child p .f-arrow>span{border-color:#eff6fc transparent transparent;} +.sidebar-child p:hover{background-color:#f2f1ed;color:#008bd2;} +.sidebar-child p.active{background-color:#e4e3df;color:#008bd2;} +.sidebar-child p:hover>.f-arrow>span{border-color:#333 transparent transparent;} +.sidebar-child p.active>.f-arrow>span{border-color:#333 transparent transparent;} + +.sidebar-child ul{position:relative;width:240px;height:auto;overflow:hidden;} +.sidebar-child ul li{float:left;width:240px;height:40px;color:#666;line-height:40px;padding-left:40px;cursor:pointer;} +.sidebar-child ul li a{color:#666;} +.sidebar-child ul li:hover{background-color:#f2f1ed; color:#008bd2;} +.sidebar-child ul li.active{background-color:#e4e3df; color:#008bd2;} + +.sidebar-child .info{position:relative;width:100%;padding:25px;} + +.sidebar-child .coursenav{position:relative;width:100%;padding:20px;} +.sidebar-child .coursenav a{width:95px;line-height:30px;display:inline-block;} +.sidebar-child .coursenav a.active{color:#008bd2;display:inline-block;} + +.ueseroperate{position:relative;width:100%;overflow:hidden;padding-top:15px;min-height:200px; padding-left:25px;border-top:1px solid #e5e5e5;} +.ueseroperate .operatemenu{position:relative;cursor: pointer;color: #999;height:40px;line-height:40px;} +.ueseroperate .operatemenu:hover{color:#333;} + +/* 边导航用户信息 */ +.sidebar-child .userinfo{position:relative;width:100%;padding:5px 20px 5px 20px;} +.sidebar-child .recommend{position:relative;width:100%;padding:20px 20px 20px 20px;margin-top:20px;} + +/* [主体部分] */ +.mainbody{position:relative;width:100%;} +.mainbody .content{position:relative;float:left;width:100%;padding:25px;} +.mainbody.componentBody{margin-left:60px;} + +/* 当前位置 */ +.breadcrumb{position:relative;float:left;width:100%;padding-left:25px;} + +.scrolltotop{position:fixed;right:20px;bottom:20px;display:none;z-index:99999;border:1px solid #d3d3d3;padding:10px;cursor:pointer;} +.scrolltotop:hover{background-color:#333;} + +/* 产品 */ +.productwarp{position:relative;width:100%;padding-bottom:20px;border-bottom:1px dashed #ccc;margin-bottom:30px;overflow: hidden;} +.productwarp .twoellipsis{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-all;} + +.productlist{position:relative;width:100%;padding:20px;margin-bottom:20px;border:1px solid #d8dce5;background-color:#fff;overflow: hidden;box-shadow:0px 0px 2px 2px #ebebeb;} +.productlist:hover{box-shadow:0px 0px 3px 3px #ebebeb;} +.projectlist-right{width:100%;padding-left:240px;margin-left:-200px;text-align:left;} + +/* 产品优势 */ +.advantagelist{float:left;width:50%;padding:15px 10px;margin-bottom:20px;height:150px;} +.advantagelist:nth-child(odd){padding-right:50px;} +.advantagelist:nth-child(even){padding-left:50px;} +.advantagelist .advantagelist-right{width:100%;padding-left:140px;margin-left:-140px;margin-top:25px;} + +.advantage{font-size:18px;color:#555;margin-top:40px;} +.advantage li{color:#555;line-height:45px;list-style:none;list-style-image: url(images/disc.png);list-style-position: inside;} + +.dktitle{font-size:30px;margin-bottom:20px;} +.dkadvantage{font-size:18px;color:#555;margin-top:40px;} +.dkadvantage ul{margin-top:15px;} +.dkadvantage li{color:#555;line-height:38px;list-style:none;list-style-image: url(images/disc.png);list-style-position: inside;} + +.twoellipsis{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-all;} + +/* [脚注] */ +.footer {position:relative;width:100%;min-width:1250px;z-index:0;display:block;border-top:1px solid #e6e6e6;overflow:hidden;} +.footer-wrap {margin:10px auto;height:160px;width:1250px;text-align:center;color:#333;font-size:14px;} +.footer li {float:left;height:130px;margin:10px 20px 10px 0;text-align:left;line-height:30px;color:#888;} +.footer li a {margin:10px;color:#888;} +.footer li a:hover {color:#1e7eec;} +.footer li.fproduct{width:180px;margin-left:30px;} +.footer li.fhelp{width:222px;} +.footer li.fabout{width:190px;} +.footer li.abountus {width:300px;} +.footer li.fproduct,.footer li.fhelp,.footer li.fabout{border-right:1px dashed #ccc;} + +@media screen and (max-width: 1071px) { + .footer li.fproduct{width:140px;} + .footer li.fhelp{width:180px;} + .footer li.fabout{width:150px;} + .footer li.abountus {width:280px;} +} + +.footer-cp {position:relative;width:100%;min-width:1250px;height:85px;line-height:85px;background-color:#eee;overflow:hidden;} +.footer-cp-wrap{position:relative;margin:0 auto;width:1250px;height:85px;z-index:0;display:block;overflow:hidden;} +.footer-cp .footer-text{width:1250px;height:85px;line-height:85px;text-align:center;} +@media screen and (max-width: 1071px) { + .footer-cp-wrap{width:1000px;} + .footer-cp .footer-text{width:1000px;margin-left:-100px;} +} + +/* 指南标题 */ +.tutorial.title {position:relative;float:left;font-size:20px;font-weight:bold;color:#555;width:100%;height:45px;margin-top:30px;margin-bottom:30px;line-height:45px;border-bottom:1px solid #e7e7e7;} +.tutorial.title .right{float:right;} + +/* 指南内部标题 */ +.tutorial.ctitle {position:relative;float:left;font-size:18px !important; color:#444;width:100%;height:25px;line-height:40px;} +.tutorial.ctitle .right{float:right;} +/* 指南内部内容 */ +.tutorial.csamp{display:table-cell; background-color:#f8f8f8; font-size:13px !important; padding:6px !important; line-height:1.42857143 !important;} +.tutorial.ccontent{position:relative;font-size:18px !important; color:#555;width:100%;line-height:25px; margin-top:40px;} + +/* 功能列表 */ +.tutorial header {font-size:28px;font-weight:700;line-height:200%;} +.tutorial li {list-style-type:disc;line-height:180%;margin-left:25px;margin-bottom:10px;} +.tutorial.decimal li {list-style-type:decimal;} + +/* 功能链接 */ +.tutorial.feature {font-size:16px;} +.tutorial.feature a{color:#08c;text-decoration:none;} +.tutorial.feature a:hover{text-decoration:underline;} + +/* 右边浮动图标 */ +.fixedright{position:fixed;top:120px;right:25px;width:60px;background-color:#fff;border:1px solid #d5d5d5;border-bottom:0;} +.fixedright li{background-color:#fff;text-align:center;padding:10px 0;border-bottom:1px solid #d5d5d5;cursor:pointer;color:#999;} +.fixedright li:hover{background-color:#f8f8f8;color:#00a2eb;} + +/** 定义右边浮动图标 */ +.fixedicon{display:inline-block;width:24px;height:24px;vertical-align: middle;background-image:url(/zinc/www/images/fixicon.png);background-repeat: no-repeat;} +.collection{background-position:0 0;} /* 收藏 */ +.consultant{background-position:0 -24px;} /* 客服咨询 */ +.wechat{background-position:0 -48px;} /* 微信 */ +.microblog{background-position:0 -72px;} /* 微博 */ +.qq{background-position:0 -96px;} /* qq */ +.praise{background-position:0 -120px;} /* 点赞 */ +.copy{background-position:0 -144px;} /* 复制 */ +.follow{background-position:0 -168px;} /* 关注 */ + +li:hover .collection{background-position:-24px 0;} /* 收藏 */ +li:hover .consultant{background-position:-24px -24px;} /* 客服咨询 */ +li:hover .wechat{background-position:-24px -48px;} /* 微信 */ +li:hover .microblog{background-position:-24px -72px;} /* 微博 */ +li:hover .qq{background-position:-24px -96px;} /* qq */ +li:hover .praise{background-position:-24px -120px;} /* 点赞 */ +li:hover .copy{background-position:-24px -144px;} /* 复制 */ +li:hover .follow{background-position:-24px -168px;} /* 关注 */ diff --git a/zhiqim_ui/zinc/www/three.js b/zhiqim_ui/zinc/www/three.js new file mode 100644 index 0000000..4b20d21 --- /dev/null +++ b/zhiqim_ui/zinc/www/three.js @@ -0,0 +1,827 @@ +// threejs.org/license +'use strict';var THREE={REVISION:"68"};"object"===typeof module&&(module.exports=THREE);THREE.CullFaceNone=0;THREE.CullFaceBack=1;THREE.CullFaceFront=2;THREE.CullFaceFrontBack=3;THREE.FrontFaceDirectionCW=0;THREE.FrontFaceDirectionCCW=1;THREE.BasicShadowMap=0;THREE.PCFShadowMap=1;THREE.PCFSoftShadowMap=2;THREE.FrontSide=0;THREE.BackSide=1;THREE.DoubleSide=2;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NoBlending=0; +THREE.NormalBlending=1;THREE.AdditiveBlending=2;THREE.SubtractiveBlending=3;THREE.MultiplyBlending=4;THREE.CustomBlending=5;THREE.AddEquation=100;THREE.SubtractEquation=101;THREE.ReverseSubtractEquation=102;THREE.ZeroFactor=200;THREE.OneFactor=201;THREE.SrcColorFactor=202;THREE.OneMinusSrcColorFactor=203;THREE.SrcAlphaFactor=204;THREE.OneMinusSrcAlphaFactor=205;THREE.DstAlphaFactor=206;THREE.OneMinusDstAlphaFactor=207;THREE.DstColorFactor=208;THREE.OneMinusDstColorFactor=209; +THREE.SrcAlphaSaturateFactor=210;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.AddOperation=2;THREE.UVMapping=function(){};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.RepeatWrapping=1E3;THREE.ClampToEdgeWrapping=1001;THREE.MirroredRepeatWrapping=1002;THREE.NearestFilter=1003;THREE.NearestMipMapNearestFilter=1004;THREE.NearestMipMapLinearFilter=1005; +THREE.LinearFilter=1006;THREE.LinearMipMapNearestFilter=1007;THREE.LinearMipMapLinearFilter=1008;THREE.UnsignedByteType=1009;THREE.ByteType=1010;THREE.ShortType=1011;THREE.UnsignedShortType=1012;THREE.IntType=1013;THREE.UnsignedIntType=1014;THREE.FloatType=1015;THREE.UnsignedShort4444Type=1016;THREE.UnsignedShort5551Type=1017;THREE.UnsignedShort565Type=1018;THREE.AlphaFormat=1019;THREE.RGBFormat=1020;THREE.RGBAFormat=1021;THREE.LuminanceFormat=1022;THREE.LuminanceAlphaFormat=1023; +THREE.RGB_S3TC_DXT1_Format=2001;THREE.RGBA_S3TC_DXT1_Format=2002;THREE.RGBA_S3TC_DXT3_Format=2003;THREE.RGBA_S3TC_DXT5_Format=2004;THREE.Color=function(a){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(a)}; +THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(a){a instanceof THREE.Color?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(a,b,c){if(0===b)this.r=this.g=this.b=c;else{var d=function(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a};b=0.5>=c?c*(1+b):c+b-c*b;c=2*c-b;this.r=d(c,b,a+1/3);this.g=d(c,b,a);this.b=d(c,b,a-1/3)}return this},setStyle:function(a){if(/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(a))return a=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(a),this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,this;if(/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(a))return a=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(a),this.r= +Math.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,this;if(/^\#([0-9a-f]{6})$/i.test(a))return a=/^\#([0-9a-f]{6})$/i.exec(a),this.setHex(parseInt(a[1],16)),this;if(/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(a))return a=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a),this.setHex(parseInt(a[1]+a[1]+a[2]+a[2]+a[3]+a[3],16)),this;if(/^(\w+)$/i.test(a))return this.setHex(THREE.ColorKeywords[a]),this},copy:function(a){this.r=a.r;this.g= +a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);this.b=Math.sqrt(this.b);return this},getHex:function(){return 255*this.r<<16^255*this.g<< +8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){a=a||{h:0,s:0,l:0};var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h=(f+e)/2;if(f===e)f=g=0;else{var k=e-f,f=0.5>=h?k/(e+f):k/(2-e-f);switch(e){case b:g=(c-d)/k+(cf&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=0.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y= +0.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=0.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*= +-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this}, +multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,l=b._w;this._x=c*l+f*g+d*k-e*h;this._y=d*l+f*h+e*g-c*k;this._z=e*l+f*k+c*h-d*g;this._w=f*l-c*g-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."); +return a.applyQuaternion(this)},slerp:function(a,b){var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),k=Math.sqrt(1-g*g);if(0.001>Math.abs(k))return this._w=0.5*(f+this._w),this._x=0.5*(c+this._x),this._y=0.5*(d+this._y),this._z=0.5*(e+this._z),this;g=Math.sin((1-b)*h)/k;h=Math.sin(b*h)/k;this._w=f*g+this._w*h;this._x= +c*g+this._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];this._w=a[3];this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._w]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y, +this._z,this._w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; +THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a, +b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this}, +subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2);a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this}, +roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b= +this.x-a.x;a=this.y-a.y;return b*b+a*a},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a){this.x=a[0];this.y=a[1];return this},toArray:function(){return[this.x,this.y]},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; +THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+ +a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), +this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y= +a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a;return function(b){!1===b instanceof THREE.Euler&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.");void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromEuler(b));return this}}(),applyAxisAngle:function(){var a;return function(b,c){void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromAxisAngle(b,c));return this}}(),applyMatrix3:function(a){var b=this.x, +c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12];this.y=a[1]*b+a[5]*c+a[9]*d+a[13];this.z=a[2]*b+a[6]*c+a[10]*d+a[14];return this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z= +(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,l=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-l*-f;this.y=k*a+b*-f+l*-e-h*-g;this.z=l*a+b*-g+h*-f-k*-e;return this},transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x; +this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z= +b.z);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3);a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x= +0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+ +Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},cross:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y= +e*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;this.x=d*h-e*g;this.y=e*f-c*h;this.z=c*g-d*f;return this},projectOnVector:function(){var a,b;return function(c){void 0===a&&(a=new THREE.Vector3);a.copy(c).normalize();b=this.dot(a);return this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a;return function(b){void 0=== +a&&(a=new THREE.Vector3);return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/(this.length()*a.length());return Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},setEulerFromRotationMatrix:function(a,b){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")}, +setEulerFromQuaternion:function(a,b){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(a){console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a, +b){console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(a,b)},setFromMatrixPosition:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z= +a;return this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;this.x=d[c];this.y=d[c+1];this.z=d[c+2];return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];return this},toArray:function(){return[this.x,this.y,this.z]},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}; +THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x; +case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this}, +addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b= +this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a):(this.z=this.y=this.x=0,this.w=1);return this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this}, +setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var l=a[10];if(0.01>Math.abs(d-g)&&0.01>Math.abs(f-c)&&0.01>Math.abs(k-b)){if(0.1>Math.abs(d+g)&&0.1>Math.abs(f+c)&&0.1>Math.abs(k+b)&&0.1>Math.abs(e+h+l-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;l=(l+1)/2;d=(d+g)/4;f=(f+c)/4;k=(k+b)/4;e>h&&e>l?0.01>e?(b=0,d=c=0.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>l?0.01>h?(b=0.707106781,c=0,d=0.707106781):(c= +Math.sqrt(h),b=d/c,d=k/c):0.01>l?(c=b=0.707106781,d=0):(d=Math.sqrt(l),b=f/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(f-c)*(f-c)+(g-d)*(g-d));0.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(f-c)/a;this.z=(g-d)/a;this.w=Math.acos((e+h+l-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z=b.z);this.wb.w&&(this.w=b.w);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z); +this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w): +Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())}, +setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3];return this},toArray:function(){return[this.x,this.y,this.z,this.w]},clone:function(){return new THREE.Vector4(this.x,this.y,this.z, +this.w)}};THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ"; +THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x= +a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[1],k=d[5],l=d[9],n=d[2],q=d[6],d=d[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(c(g,-1,1)),0.99999>Math.abs(g)?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-f,e)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-c(l,-1,1)),0.99999>Math.abs(l)?(this._y=Math.atan2(g,d),this._z=Math.atan2(h,k)): +(this._y=Math.atan2(-n,e),this._z=0)):"ZXY"===b?(this._x=Math.asin(c(q,-1,1)),0.99999>Math.abs(q)?(this._y=Math.atan2(-n,d),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,e))):"ZYX"===b?(this._y=Math.asin(-c(n,-1,1)),0.99999>Math.abs(n)?(this._x=Math.atan2(q,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(c(h,-1,1)),0.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-n,e)):(this._x=0,this._y=Math.atan2(g,d))):"XZY"===b?(this._z= +Math.asin(-c(f,-1,1)),0.99999>Math.abs(f)?(this._x=Math.atan2(q,k),this._y=Math.atan2(g,e)):(this._x=Math.atan2(-l,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;this.onChangeCallback();return this},setFromQuaternion:function(a,b,c){var d=THREE.Math.clamp,e=a.x*a.x,f=a.y*a.y,g=a.z*a.z,h=a.w*a.w;b=b||this._order;"XYZ"===b?(this._x=Math.atan2(2*(a.x*a.w-a.y*a.z),h-e-f+g),this._y=Math.asin(d(2*(a.x*a.z+a.y*a.w),-1,1)),this._z=Math.atan2(2* +(a.z*a.w-a.x*a.y),h+e-f-g)):"YXZ"===b?(this._x=Math.asin(d(2*(a.x*a.w-a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h-e-f+g),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h-e+f-g)):"ZXY"===b?(this._x=Math.asin(d(2*(a.x*a.w+a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.y*a.w-a.z*a.x),h-e-f+g),this._z=Math.atan2(2*(a.z*a.w-a.x*a.y),h-e+f-g)):"ZYX"===b?(this._x=Math.atan2(2*(a.x*a.w+a.z*a.y),h-e-f+g),this._y=Math.asin(d(2*(a.y*a.w-a.x*a.z),-1,1)),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h+e-f-g)):"YZX"=== +b?(this._x=Math.atan2(2*(a.x*a.w-a.z*a.y),h-e+f-g),this._y=Math.atan2(2*(a.y*a.w-a.x*a.z),h+e-f-g),this._z=Math.asin(d(2*(a.x*a.y+a.z*a.w),-1,1))):"XZY"===b?(this._x=Math.atan2(2*(a.x*a.w+a.y*a.z),h-e+f-g),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h+e-f-g),this._z=Math.asin(d(2*(a.z*a.w-a.x*a.y),-1,1))):console.warn("THREE.Euler: .setFromQuaternion() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this); +this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._order]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}}; +THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3}; +THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(0.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a, +b){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);var e=b.dot(b),e=b.dot(a)/e;d&&(e=THREE.Math.clamp(e,0,1));return e}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);c=c||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a); +this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}};THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector2(-Infinity,-Infinity)}; +THREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.y +this.max.y?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&& +a.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}};THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector3(-Infinity,-Infinity,-Infinity)}; +THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y|| +a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y|| +a.max.zthis.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new THREE.Vector3;return function(b){b=b||new THREE.Sphere;b.center=this.center();b.radius=0.5*this.size(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this}, +union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b); +a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.makeEmpty();this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}}; +THREE.Matrix3=function(a,b,c,d,e,f,g,h,k){var l=this.elements=new Float32Array(9);l[0]=void 0!==a?a:1;l[3]=b||0;l[6]=c||0;l[1]=d||0;l[4]=void 0!==e?e:1;l[7]=f||0;l[2]=g||0;l[5]=h||0;l[8]=void 0!==k?k:1}; +THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,f,g,h,k){var l=this.elements;l[0]=a;l[3]=b;l[6]=c;l[1]=d;l[4]=e;l[7]=f;l[2]=g;l[5]=h;l[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)}, +multiplyVector3Array:function(a){console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;ethis.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.elements.set(this.elements);c=1/g;var f=1/h,l=1/k;b.elements[0]*=c;b.elements[1]*= +c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=l;b.elements[9]*=l;b.elements[10]*=l;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(0.5*a)); +var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,k=c-d,l=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/k;g[9]=0;g[13]=-((c+d)/k);g[2]=0;g[6]=0;g[10]=-2/l;g[14]=-((f+e)/l);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){var a= +this.elements;return new THREE.Matrix4(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15])}};THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3}; +THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin); +var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(a,b,c,d){var e=a.clone().add(b).multiplyScalar(0.5),f=b.clone().sub(a).normalize(),g=0.5*a.distanceTo(b), +h=this.origin.clone().sub(e);a=-this.direction.dot(f);b=h.dot(this.direction);var k=-h.dot(f),l=h.lengthSq(),n=Math.abs(1-a*a),q,r;0<=n?(h=a*k-b,q=a*b-k,r=g*n,0<=h?q>=-r?q<=r?(g=1/n,h*=g,q*=g,a=h*(h+a*q+2*b)+q*(a*h+q+2*k)+l):(q=g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l):(q=-g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l):q<=-r?(h=Math.max(0,-(-a*g+b)),q=0f)return null;f=Math.sqrt(f-e);e=d-f; +d+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3; +return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(fg||e>d)return null;if(e>c||c!== +c)c=e;if(gd?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));if(0>g||e+g>f)return null; +e=-h*a.dot(d);return 0>e?null:this.at(e/f,k)}}(),applyMatrix4:function(a){this.direction.add(this.origin).applyMatrix4(a);this.origin.applyMatrix4(a);this.direction.sub(this.origin);this.direction.normalize();return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}};THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3;this.radius=void 0!==b?b:0}; +THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,f=0,g=b.length;f=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<= +this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius); +return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}}; +THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]}; +THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],n=c[8],q=c[9],r=c[10],t=c[11],s=c[12],p=c[13],v=c[14],c=c[15];b[0].setComponents(f-a,l-g,t-n,c-s).normalize();b[1].setComponents(f+ +a,l+g,t+n,c+s).normalize();b[2].setComponents(f+d,l+h,t+q,c+p).normalize();b[3].setComponents(f-d,l-h,t-q,c-p).normalize();b[4].setComponents(f-e,l-k,t-r,c-v).normalize();b[5].setComponents(f+e,l+k,t+r,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes, +c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)e;e++){var f=d[e];a.x=0g&&0>f)return!1}return!0}}(), +containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0}; +THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d, +c);return this}}(),copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a, +b){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0a&&0f||1e;e++)8==e||13==e||18==e||23==e?b[e]="-":14==e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return ac?c:a},clampBottom:function(a,b){return a=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(0.5-Math.random())},sign:function(a){return 0>a?-1:0this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1: +f+2;l=this.points[c[0]];n=this.points[c[1]];q=this.points[c[2]];r=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,n.x,q.x,r.x,g,h,k);d.y=b(l.y,n.y,q.y,r.y,g,h,k);d.z=b(l.z,n.z,q.z,r.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a=b.x+b.y}}(); +THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return 0.5*a.cross(b).length()}}(),midpoint:function(a){return(a|| +new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}, +clone:function(){return(new THREE.Triangle).copy(this)}};THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}; +THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(), +a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){}; +THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&& +c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;ee&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},l=function(a, +b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;L[0]=a.positionScreen;L[1]=b.positionScreen;L[2]=c.positionScreen;return E.isIntersectionBox(Q.setFromPoints(L))},q=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){f=a;g=f.material;h.getNormalMatrix(f.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:l, +checkBackfaceCulling:q,pushVertex:function(b,c,d){n=a();n.position.set(b,c,d);k(n)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=r[a],e=r[b];u=c();u.id=f.id;u.v1.copy(d);u.v2.copy(e);u.z=(d.positionScreen.z+e.positionScreen.z)/2;u.material=f.material;K.elements.push(u)},pushTriangle:function(a,c,k){var n=r[a],p=r[c],t=r[k];if(!1!==l(n,p,t)&&(g.side===THREE.DoubleSide||!0===q(n,p,t))){s=b();s.id=f.id;s.v1.copy(n);s.v2.copy(p);s.v3.copy(t); +s.z=(n.positionScreen.z+p.positionScreen.z+t.positionScreen.z)/3;for(n=0;3>n;n++)p=3*arguments[n],t=s.vertexNormalsModel[n],t.set(d[p],d[p+1],d[p+2]),t.applyMatrix3(h).normalize(),p=2*arguments[n],s.uvs[n].set(e[p],e[p+1]);s.vertexNormalsLength=3;s.material=f.material;K.elements.push(s)}}}};this.projectScene=function(n,t,w,v){I=D=p=0;K.elements.length=0;!0===n.autoUpdate&&n.updateMatrixWorld();void 0===t.parent&&t.updateMatrixWorld();R.copy(t.matrixWorldInverse.getInverse(t.matrixWorld));B.multiplyMatrices(t.projectionMatrix, +R);H.setFromMatrix(B);h=0;K.objects.length=0;K.lights.length=0;n.traverseVisible(function(a){if(a instanceof THREE.Light)K.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===H.intersectsObject(a)){if(h===l){var b=new THREE.RenderableObject;k.push(b);l++;h++;g=b}else g=k[h++];g.id=a.id;g.object=a;null!==a.renderDepth?g.z=a.renderDepth:(O.setFromMatrixPosition(a.matrixWorld),O.applyProjection(B),g.z=O.z);K.objects.push(g)}}); +!0===w&&K.objects.sort(e);n=0;for(w=K.objects.length;nva;va++)s.uvs[va].copy(ua[va]); +s.color=ca.color;s.material=qa;s.z=(la.positionScreen.z+ja.positionScreen.z+Fa.positionScreen.z)/3;K.elements.push(s)}}}}}else if(A instanceof THREE.Line)if(x instanceof THREE.BufferGeometry){if(z=x.attributes,void 0!==z.position){G=z.position.array;x=0;for(y=G.length;x=J.z&&(C=d(),C.id=A.id,C.x=J.x*x,C.y=J.y*x,C.z=J.z,C.object=A,C.rotation=A.rotation,C.scale.x=A.scale.x*Math.abs(C.x-(J.x+t.projectionMatrix.elements[0])/(J.w+t.projectionMatrix.elements[12])),C.scale.y=A.scale.y*Math.abs(C.y-(J.y+t.projectionMatrix.elements[5])/ +(J.w+t.projectionMatrix.elements[13])),C.material=A.material,K.elements.push(C)))}!0===v&&K.elements.sort(e);return K}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0}; +THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.materialIndex=this.materialIndex;for(var b=0,c=this.vertexNormals.length;bb.max.x&&(b.max.x=e);fb.max.y&& +(b.max.y=f);gb.max.z&&(b.max.z=g)}}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')},computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&& +(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;eBa?-1:1;h[4*a]=Ea.x;h[4*a+1]=Ea.y;h[4*a+2]=Ea.z;h[4*a+3]=Pa}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent= +{itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;np;p++)s=a[3*c+p],-1==r[s]?(q[2*p]=s,q[2*p+1]=-1,n++):r[s]k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)p=q[n+1],-1n;n+=2)s=q[n],p=q[n+1],-1===p&&(p=g++),r[s]=p,t[p]=s,e[f++]=p-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},normalizeNormals:function(){for(var a=this.attributes.normal.array, +b,c,d,e=0,f=a.length;ed?-1:1,e.vertexTangents[c]=new THREE.Vector4(A.x,A.y,A.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;cd;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;cc&&(h[f].counter+=1,g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:f,vertices:0,numMorphTargets:l,numMorphNormals:n},this.geometryGroups[g]=k,this.geometryGroupsList.push(k))),this.geometryGroups[g].faces3.push(d),this.geometryGroups[g].vertices+=3}}(),clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;ca.opacity)h.transparent=a.transparent;void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);void 0!==a.vertexColors&&("face"=== +a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorAmbient&&(h.ambient=e(a.colorAmbient));a.colorEmissive&&(h.emissive=e(a.colorEmissive));a.transparency&&(h.opacity=a.transparency);a.specularCoef&&(h.shininess=a.specularCoef);a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap, +a.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&d(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy);a.mapAlpha&& +b&&d(h,"alphaMap",a.mapAlpha,a.mapAlphaRepeat,a.mapAlphaOffset,a.mapAlphaWrap,a.mapAlphaAnisotropy);a.mapBumpScale&&(h.bumpScale=a.mapBumpScale);a.mapNormal?(g=THREE.ShaderLib.normalmap,k=THREE.UniformsUtils.clone(g.uniforms),k.tNormal.value=h.normalMap,a.mapNormalFactor&&k.uNormalScale.value.set(a.mapNormalFactor,a.mapNormalFactor),h.map&&(k.tDiffuse.value=h.map,k.enableDiffuse.value=!0),h.specularMap&&(k.tSpecular.value=h.specularMap,k.enableSpecular.value=!0),h.lightMap&&(k.tAO.value=h.lightMap, +k.enableAO.value=!0),k.diffuse.value.setHex(h.color),k.specular.value.setHex(h.specular),k.ambient.value.setHex(h.ambient),k.shininess.value=h.shininess,void 0!==h.opacity&&(k.opacity.value=h.opacity),g=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:k,lights:!0,fog:!0}),h.transparent&&(g.transparent=!0)):g=new THREE[g](h);void 0!==a.DbgName&&(g.name=a.DbgName);return g}}; +THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;bg;g++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],t.normal.set(D[q++],D[q++],D[q]),p.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*u[k++],s=new THREE.Vector3(D[q++], +D[q++],D[q]),2!==d&&t.vertexNormals.push(s),0!==d&&p.vertexNormals.push(s);n&&(n=u[k++],n=A[n],t.color.setHex(n),p.color.setHex(n));if(b)for(d=0;4>d;d++)n=u[k++],n=A[n],2!==d&&t.vertexColors.push(new THREE.Color(n)),0!==d&&p.vertexColors.push(new THREE.Color(n));c.faces.push(t);c.faces.push(p)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;dg;g++)r=u[k++],w=v[2*r],r=v[2*r+1], +w=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],t.normal.set(D[q++],D[q++],D[q]));if(s)for(d=0;3>d;d++)q=3*u[k++],s=new THREE.Vector3(D[q++],D[q++],D[q]),t.vertexNormals.push(s);n&&(n=u[k++],t.color.setHex(A[n]));if(b)for(d=0;3>d;d++)n=u[k++],t.vertexColors.push(new THREE.Color(A[n]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;df)){var r=b.origin.distanceTo(l);rd.far||e.push({distance:r,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.type));THREE.Object3D.prototype.clone.call(this,a);return a}; +THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype); +THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0g.far||h.push({distance:C,point:x,indices:[n,q,r],face:null,faceIndex:null,object:this})}}}else for(p=n.position.array,s=k=0,A=p.length;kg.far||h.push({distance:C,point:x,indices:[n,q,r],face:null,faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,p=!0===s?this.material.materials:null,t=g.precision,v=k.vertices,w=0,u=k.faces.length;wg.far||h.push({distance:C,point:x,face:D,faceIndex:w,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype); +THREE.Bone.prototype.updateMatrixWorld=function(a){THREE.Object3D.prototype.updateMatrixWorld.call(this,a);this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0}; +THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256h.end&&(h.end=e);b||(b=g)}}a.firstAnimation=b}; +THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={});this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1E3,this.time=0):console.warn("animation["+a+"] undefined")}; +THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||0>this.time)this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)}else this.time%=this.duration,0>this.time&&(this.time+=this.duration);a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1);a!==this.currentKeyframe&& +(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a);b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b}; +THREE.MorphAnimMesh.prototype.interpolateTargets=function(a,b,c){for(var d=this.morphTargetInfluences,e=0,f=d.length;e=this.objects[d].distance)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;else break;for(;dthis.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.updateMatrix=function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0}; +THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Particle=THREE.Sprite;THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1;this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype); +THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)){this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}this.dispatchEvent({type:"objectAdded",object:a});a.dispatchEvent({type:"addedToScene",scene:this});for(b=0;bE&&O.clearRect(aa.min.x|0,aa.min.y|0,aa.max.x-aa.min.x|0,aa.max.y-aa.min.y|0),0$.positionScreen.z||1<$.positionScreen.z)continue;if(-1>X.positionScreen.z||1T.positionScreen.z||1=S||(S*=V.intensity,R.add(Za.multiplyScalar(S)))):V instanceof THREE.PointLight&&(da=Ga.setFromMatrixPosition(V.matrixWorld),S=ea.dot(Ga.subVectors(da,H).normalize()),0>=S||(S*=0==V.distance?1:1-Math.min(H.distanceTo(da)/V.distance,1),0!=S&&(S*=V.intensity,R.add(Za.multiplyScalar(S)))));G.multiply(Ba).add(Ya);!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(G)}else E instanceof THREE.MeshBasicMaterial||E instanceof THREE.MeshLambertMaterial||E instanceof +THREE.MeshPhongMaterial?null!==E.map?E.map.mapping instanceof THREE.UVMapping&&(ca=J.uvs,f(ya,Ea,Aa,za,Oa,Pa,ca[0].x,ca[0].y,ca[1].x,ca[1].y,ca[2].x,ca[2].y,E.map)):null!==E.envMap?E.envMap.mapping instanceof THREE.SphericalReflectionMapping?(ma.copy(J.vertexNormalsModel[0]).applyMatrix3(Ja),la=0.5*ma.x+0.5,qa=0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[1]).applyMatrix3(Ja),ua=0.5*ma.x+0.5,ja=0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[2]).applyMatrix3(Ja),Fa=0.5*ma.x+0.5,va=0.5*ma.y+0.5,f(ya,Ea,Aa,za, +Oa,Pa,la,qa,ua,ja,Fa,va,E.envMap)):E.envMap.mapping instanceof THREE.SphericalRefractionMapping&&(ma.copy(J.vertexNormalsModel[0]).applyMatrix3(Ja),la=-0.5*ma.x+0.5,qa=-0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[1]).applyMatrix3(Ja),ua=-0.5*ma.x+0.5,ja=-0.5*ma.y+0.5,ma.copy(J.vertexNormalsModel[2]).applyMatrix3(Ja),Fa=-0.5*ma.x+0.5,va=-0.5*ma.y+0.5,f(ya,Ea,Aa,za,Oa,Pa,la,qa,ua,ja,Fa,va,E.envMap)):(G.copy(E.color),E.vertexColors===THREE.FaceColors&&G.multiply(J.color),!0===E.wireframe?b(G,E.wireframeLinewidth, +E.wireframeLinecap,E.wireframeLinejoin):c(G)):(E instanceof THREE.MeshDepthMaterial?G.r=G.g=G.b=1-p(H.positionScreen.z*H.positionScreen.w,oa.near,oa.far):E instanceof THREE.MeshNormalMaterial?(ma.copy(J.normalModel).applyMatrix3(Ja),G.setRGB(ma.x,ma.y,ma.z).multiplyScalar(0.5).addScalar(0.5)):G.setRGB(1,1,1),!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(G))}}aa.union(ra)}}O.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={}; +THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n\tif ( gl_FragColor.a < ALPHATEST ) discard;\n\n#endif\n";THREE.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n\tvec3 dirVector = normalize( lDirection.xyz );\n\n\tfloat dotProduct = dot( transformedNormal, dirVector );\n\tvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t#endif\n\n\t#endif\n\n\t#ifdef WRAP_AROUND\n\n\t\tvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\tdirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tdirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n\t\t#endif\n\n\t#endif\n\n\tvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n\t#endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat lDistance = 1.0;\n\t\tif ( pointLightDistance[ i ] > 0.0 )\n\t\t\tlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\n\n\t\tlVector = normalize( lVector );\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\tpointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tpointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\tvLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\tfloat lDistance = 1.0;\n\t\t\tif ( spotLightDistance[ i ] > 0.0 )\n\t\t\t\tlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\n\n\t\t\tlVector = normalize( lVector );\n\n\t\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\t\t\tvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\t\tvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\t\tspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n\t\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\t\tspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvLightFront += spotLightColor[ i ] * spotLightWeighting * lDistance * spotEffect;\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvLightBack += spotLightColor[ i ] * spotLightWeightingBack * lDistance * spotEffect;\n\n\t\t\t#endif\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n\t\tvec3 lVector = normalize( lDirection.xyz );\n\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\tfloat hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n\t\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n\t\t#endif\n\n\t}\n\n#endif\n\nvLightFront = vLightFront * diffuse + ambient * ambientLightColor + emissive;\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vLightBack * diffuse + ambient * ambientLightColor + emissive;\n\n#endif"; +THREE.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif";THREE.ShaderChunk.default_vertex="vec4 mvPosition;\n\n#ifdef USE_SKINNING\n\n\tmvPosition = modelViewMatrix * skinned;\n\n#endif\n\n#if !defined( USE_SKINNING ) && defined( USE_MORPHTARGETS )\n\n\tmvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#endif\n\n#if !defined( USE_SKINNING ) && ! defined( USE_MORPHTARGETS )\n\n\tmvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;"; +THREE.ShaderChunk.map_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif";THREE.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\t#ifdef USE_MORPHNORMALS\n\n\tvec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n\t#else\n\n\tvec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n\t#endif\n\n#endif\n"; +THREE.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n\tuniform float logDepthBufFC;\n\n#endif";THREE.ShaderChunk.lightmap_pars_vertex="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\n#endif";THREE.ShaderChunk.lights_phong_fragment="vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef DOUBLE_SIDED\n\n\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n#endif\n\n#ifdef USE_NORMALMAP\n\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tvec3 pointDiffuse = vec3( 0.0 );\n\tvec3 pointSpecular = vec3( 0.0 );\n\n\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat lDistance = 1.0;\n\t\tif ( pointLightDistance[ i ] > 0.0 )\n\t\t\tlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\n\n\t\tlVector = normalize( lVector );\n\n\t\t\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat pointDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\tpointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * lDistance;\n\n\t\t\t\t// specular\n\n\t\tvec3 pointHalfVector = normalize( lVector + viewPosition );\n\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\tfloat pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\tpointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance * specularNormalization;\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tvec3 spotDiffuse = vec3( 0.0 );\n\tvec3 spotSpecular = vec3( 0.0 );\n\n\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat lDistance = 1.0;\n\t\tif ( spotLightDistance[ i ] > 0.0 )\n\t\t\tlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\n\n\t\tlVector = normalize( lVector );\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\t\t\t// diffuse\n\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n\t\t\t#else\n\n\t\t\t\tfloat spotDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t\t#endif\n\n\t\t\tspotDiffuse += diffuse * spotLightColor[ i ] * spotDiffuseWeight * lDistance * spotEffect;\n\n\t\t\t\t\t// specular\n\n\t\t\tvec3 spotHalfVector = normalize( lVector + viewPosition );\n\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\tfloat spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\tspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * specularNormalization * spotEffect;\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n\tvec3 dirDiffuse = vec3( 0.0 );\n\tvec3 dirSpecular = vec3( 0.0 );\n\n\tfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\t\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n\t\tvec3 dirVector = normalize( lDirection.xyz );\n\n\t\t\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, dirVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat dirDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\tdirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\n\n\t\t// specular\n\n\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\tfloat dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n\t\t/*\n\t\t// fresnel term from skin shader\n\t\tconst float F0 = 0.128;\n\n\t\tfloat base = 1.0 - dot( viewPosition, dirHalfVector );\n\t\tfloat exponential = pow( base, 5.0 );\n\n\t\tfloat fresnel = exponential + F0 * ( 1.0 - exponential );\n\t\t*/\n\n\t\t/*\n\t\t// fresnel term from fresnel shader\n\t\tconst float mFresnelBias = 0.08;\n\t\tconst float mFresnelScale = 0.3;\n\t\tconst float mFresnelPower = 5.0;\n\n\t\tfloat fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n\t\t*/\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t// \t\tdirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\tdirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tvec3 hemiDiffuse = vec3( 0.0 );\n\tvec3 hemiSpecular = vec3( 0.0 );\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n\t\tvec3 lVector = normalize( lDirection.xyz );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\themiDiffuse += diffuse * hemiColor;\n\n\t\t// specular (sky light)\n\n\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\tfloat hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n\t\t// specular (ground light)\n\n\t\tvec3 lVectorGround = -lVector;\n\n\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\tfloat hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\themiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n\t}\n\n#endif\n\nvec3 totalDiffuse = vec3( 0.0 );\nvec3 totalSpecular = vec3( 0.0 );\n\n#if MAX_DIR_LIGHTS > 0\n\n\ttotalDiffuse += dirDiffuse;\n\ttotalSpecular += dirSpecular;\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\ttotalDiffuse += hemiDiffuse;\n\ttotalSpecular += hemiSpecular;\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\ttotalDiffuse += pointDiffuse;\n\ttotalSpecular += pointSpecular;\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\ttotalDiffuse += spotDiffuse;\n\ttotalSpecular += spotSpecular;\n\n#endif\n\n#ifdef METAL\n\n\tgl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient + totalSpecular );\n\n#else\n\n\tgl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\n\n#endif"; +THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n\n#endif";THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n\tvec3 morphedNormal = vec3( 0.0 );\n\n\tmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n\tmorphedNormal += normal;\n\n#endif"; +THREE.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\tuniform samplerCube envMap;\n\tuniform float flipEnvMap;\n\tuniform int combine;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\n\t\tuniform bool useRefract;\n\t\tuniform float refractionRatio;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif"; +THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n\t\t\t// Per-Pixel Tangent Space Normal Mapping\n\t\t\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n"; +THREE.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n";THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\tuniform sampler2D lightMap;\n\n#endif";THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n\t}\n\n#endif"; +THREE.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif";THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\t#ifdef GAMMA_INPUT\n\n\t\ttexelColor.xyz *= texelColor.xyz;\n\n\t#endif\n\n\tgl_FragColor = gl_FragColor * texelColor;\n\n#endif";THREE.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n\tvUv2 = uv2;\n\n#endif"; +THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n\tgl_FragColor = gl_FragColor * texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) );\n\n#endif";THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n";THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n\t#ifdef GAMMA_INPUT\n\n\t\tvColor = color * color;\n\n\t#else\n\n\t\tvColor = color;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n\t#ifdef USE_MORPHTARGETS\n\n\tvec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n\n#endif\n"; +THREE.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\n\tvarying vec3 vReflect;\n\n\tuniform float refractionRatio;\n\tuniform bool useRefract;\n\n#endif\n";THREE.ShaderChunk.linear_to_gamma_fragment="#ifdef GAMMA_OUTPUT\n\n\tgl_FragColor.xyz = sqrt( gl_FragColor.xyz );\n\n#endif";THREE.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif";THREE.ShaderChunk.lights_lambert_pars_vertex="uniform vec3 ambient;\nuniform vec3 diffuse;\nuniform vec3 emissive;\n\nuniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n"; +THREE.ShaderChunk.map_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n\n#endif\n";THREE.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n\tvec3 reflectVec;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n\t\t// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\n\t\tvec3 worldNormal = normalize( vec3( vec4( normal, 0.0 ) * viewMatrix ) );\n\n\t\tif ( useRefract ) {\n\n\t\t\treflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t} else { \n\n\t\t\treflectVec = reflect( cameraToVertex, worldNormal );\n\n\t\t}\n\n\t#else\n\n\t\treflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t\tvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#else\n\n\t\tvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#endif\n\n\t#ifdef GAMMA_INPUT\n\n\t\tcubeColor.xyz *= cubeColor.xyz;\n\n\t#endif\n\n\tif ( combine == 1 ) {\n\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n\n\t} else if ( combine == 2 ) {\n\n\t\tgl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n\n\t} else {\n\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n\n\t}\n\n#endif"; +THREE.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif";THREE.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n\tgl_Position.z = log2(max(1e-6, gl_Position.w + 1.0)) * logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif"; +THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif";THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n\t#else\n\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\n\t#endif\n\n\t#ifdef FOG_EXP2\n\n\t\tconst float LOG2 = 1.442695;\n\t\tfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\n\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\n\t#endif\n\t\n\tgl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n\n#endif"; +THREE.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t\t\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n\t\t\t//\thttp://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n\t\t\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif"; +THREE.ShaderChunk.defaultnormal_vertex="vec3 objectNormal;\n\n#ifdef USE_SKINNING\n\n\tobjectNormal = skinnedNormal.xyz;\n\n#endif\n\n#if !defined( USE_SKINNING ) && defined( USE_MORPHNORMALS )\n\n\tobjectNormal = morphedNormal;\n\n#endif\n\n#if !defined( USE_SKINNING ) && ! defined( USE_MORPHNORMALS )\n\n\tobjectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n\tobjectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;"; +THREE.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;"; +THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif";THREE.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif"; +THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n\tgl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );\n\n#endif";THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif";THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n\tgl_FragColor = gl_FragColor * vec4( vColor, 1.0 );\n\n#endif";THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n\tvec3 morphed = vec3( 0.0 );\n\tmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\tmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\tmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\tmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\tmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\tmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\tmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\tmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n\tmorphed += position;\n\n#endif"; +THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\n\tvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\n\tworldNormal = normalize( worldNormal );\n\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\tif ( useRefract ) {\n\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t} else {\n\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t}\n\n#endif"; +THREE.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n\t#ifdef SHADOWMAP_DEBUG\n\n\t\tvec3 frustumColors[3];\n\t\tfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n\t\tfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n\t\tfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n\t#endif\n\n\t#ifdef SHADOWMAP_CASCADE\n\n\t\tint inFrustumCount = 0;\n\n\t#endif\n\n\tfloat fDepth;\n\tvec3 shadowColor = vec3( 1.0 );\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\t\t\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t\t\t// if ( all( something, something ) ) using this instead\n\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\n\t\t\t\t// don't shadow pixels outside of light frustum\n\t\t\t\t// use just first frustum (for cascades)\n\t\t\t\t// don't shadow pixels behind far plane of light frustum\n\n\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\tinFrustumCount += int( inFrustum );\n\t\t\tbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n\t\t#else\n\n\t\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\t#endif\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t/*\n\t\t\t\t\t\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n\t\t\t\t\t\t// must enroll loop manually\n\n\t\t\t\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\n\t\t\t\t\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n\t\t\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n\t\t\t\t\t\t\t\t// doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n\t\t\t\t\t\t\t\t//vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n\t\t\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\t\t\tif ( fDepth < shadowCoord.z )\n\t\t\t\t\t\t\tshadow += 1.0;\n\n\t\t\t\t}\n\n\t\t\t\tshadow /= 9.0;\n\n\t\t*/\n\n\t\t\t\tconst float shadowDelta = 1.0 / 9.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.25 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.25 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.25 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.25 * yPixelOffset;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.0 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.0 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.0 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.0 * yPixelOffset;\n\n\t\t\t\tmat3 shadowKernel;\n\t\t\t\tmat3 depthKernel;\n\n\t\t\t\tdepthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tdepthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tdepthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tdepthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tdepthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tdepthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tdepthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tdepthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tdepthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n\t\t\t\tvec3 shadowZ = vec3( shadowCoord.z );\n\t\t\t\tshadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n\t\t\t\tshadowKernel[0] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n\t\t\t\tshadowKernel[1] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n\t\t\t\tshadowKernel[2] *= vec3(0.25);\n\n\t\t\t\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n\t\t\t\tshadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n\t\t\t\tshadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n\t\t\t\tvec4 shadowValues;\n\t\t\t\tshadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n\t\t\t\tshadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n\t\t\t\tshadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n\t\t\t\tshadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n\t\t\t\tshadow = dot( shadowValues, vec4( 1.0 ) );\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#else\n\n\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\tif ( fDepth < shadowCoord.z )\n\n\t\t// spot with multiple shadows is darker\n\n\t\t\t\t\tshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n\t\t// spot with multiple shadows has the same color as single shadow spot\n\n\t\t// \t\t\t\t\tshadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n\t\t\t#endif\n\n\t\t}\n\n\n\t\t#ifdef SHADOWMAP_DEBUG\n\n\t\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\t\tif ( inFrustum && inFrustumCount == 1 ) gl_FragColor.xyz *= frustumColors[ i ];\n\n\t\t\t#else\n\n\t\t\t\tif ( inFrustum ) gl_FragColor.xyz *= frustumColors[ i ];\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t}\n\n\t#ifdef GAMMA_OUTPUT\n\n\t\tshadowColor *= shadowColor;\n\n\t#endif\n\n\tgl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\n\n#endif\n"; +THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n\t#ifdef USE_SKINNING\n\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\n\t#endif\n\n\t#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n\t#endif\n\n\t#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n#endif"; +THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n#endif"; +THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n"; +THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\t#extension GL_EXT_frag_depth : enable\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n\tgl_FragColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n";THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n"; +THREE.UniformsUtils={merge:function(a){var b,c,d,e={};for(b=0;b dashSize ) {\n\t\tdiscard;\n\t}\n\tgl_FragColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.fog_fragment, +"}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2E3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment, +"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvNormal = normalize( normalMatrix * normal );", +THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},normalmap:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{enableAO:{type:"i", +value:0},enableDiffuse:{type:"i",value:0},enableSpecular:{type:"i",value:0},enableReflection:{type:"i",value:0},enableDisplacement:{type:"i",value:0},tDisplacement:{type:"t",value:null},tDiffuse:{type:"t",value:null},tCube:{type:"t",value:null},tNormal:{type:"t",value:null},tSpecular:{type:"t",value:null},tAO:{type:"t",value:null},uNormalScale:{type:"v2",value:new THREE.Vector2(1,1)},uDisplacementBias:{type:"f",value:0},uDisplacementScale:{type:"f",value:1},diffuse:{type:"c",value:new THREE.Color(16777215)}, +specular:{type:"c",value:new THREE.Color(1118481)},ambient:{type:"c",value:new THREE.Color(16777215)},shininess:{type:"f",value:30},opacity:{type:"f",value:1},useRefract:{type:"i",value:0},refractionRatio:{type:"f",value:0.98},reflectivity:{type:"f",value:0.5},uOffset:{type:"v2",value:new THREE.Vector2(0,0)},uRepeat:{type:"v2",value:new THREE.Vector2(1,1)},wrapRGB:{type:"v3",value:new THREE.Vector3(1,1,1)}}]),fragmentShader:["uniform vec3 ambient;\nuniform vec3 diffuse;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\nuniform bool enableDiffuse;\nuniform bool enableSpecular;\nuniform bool enableAO;\nuniform bool enableReflection;\nuniform sampler2D tDiffuse;\nuniform sampler2D tNormal;\nuniform sampler2D tSpecular;\nuniform sampler2D tAO;\nuniform samplerCube tCube;\nuniform vec2 uNormalScale;\nuniform bool useRefract;\nuniform float refractionRatio;\nuniform float reflectivity;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nuniform vec3 ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_HEMI_LIGHTS > 0\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#endif\n#if MAX_SPOT_LIGHTS > 0\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n#endif\n#ifdef WRAP_AROUND\n\tuniform vec3 wrapRGB;\n#endif\nvarying vec3 vWorldPosition;\nvarying vec3 vViewPosition;", +THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\tgl_FragColor = vec4( vec3( 1.0 ), opacity );\n\tvec3 specularTex = vec3( 1.0 );\n\tvec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\n\tnormalTex.xy *= uNormalScale;\n\tnormalTex = normalize( normalTex );\n\tif( enableDiffuse ) {\n\t\t#ifdef GAMMA_INPUT\n\t\t\tvec4 texelColor = texture2D( tDiffuse, vUv );\n\t\t\ttexelColor.xyz *= texelColor.xyz;\n\t\t\tgl_FragColor = gl_FragColor * texelColor;\n\t\t#else\n\t\t\tgl_FragColor = gl_FragColor * texture2D( tDiffuse, vUv );\n\t\t#endif\n\t}\n\tif( enableAO ) {\n\t\t#ifdef GAMMA_INPUT\n\t\t\tvec4 aoColor = texture2D( tAO, vUv );\n\t\t\taoColor.xyz *= aoColor.xyz;\n\t\t\tgl_FragColor.xyz = gl_FragColor.xyz * aoColor.xyz;\n\t\t#else\n\t\t\tgl_FragColor.xyz = gl_FragColor.xyz * texture2D( tAO, vUv ).xyz;\n\t\t#endif\n\t}", +THREE.ShaderChunk.alphatest_fragment,"\tif( enableSpecular )\n\t\tspecularTex = texture2D( tSpecular, vUv ).xyz;\n\tmat3 tsb = mat3( normalize( vTangent ), normalize( vBinormal ), normalize( vNormal ) );\n\tvec3 finalNormal = tsb * normalTex;\n\t#ifdef FLIP_SIDED\n\t\tfinalNormal = -finalNormal;\n\t#endif\n\tvec3 normal = normalize( finalNormal );\n\tvec3 viewPosition = normalize( vViewPosition );\n\t#if MAX_POINT_LIGHTS > 0\n\t\tvec3 pointDiffuse = vec3( 0.0 );\n\t\tvec3 pointSpecular = vec3( 0.0 );\n\t\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\t\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\t\tvec3 pointVector = lPosition.xyz + vViewPosition.xyz;\n\t\t\tfloat pointDistance = 1.0;\n\t\t\tif ( pointLightDistance[ i ] > 0.0 )\n\t\t\t\tpointDistance = 1.0 - min( ( length( pointVector ) / pointLightDistance[ i ] ), 1.0 );\n\t\t\tpointVector = normalize( pointVector );\n\t\t\t#ifdef WRAP_AROUND\n\t\t\t\tfloat pointDiffuseWeightFull = max( dot( normal, pointVector ), 0.0 );\n\t\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dot( normal, pointVector ) + 0.5, 0.0 );\n\t\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\t\t\t#else\n\t\t\t\tfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\n\t\t\t#endif\n\t\t\tpointDiffuse += pointDistance * pointLightColor[ i ] * diffuse * pointDiffuseWeight;\n\t\t\tvec3 pointHalfVector = normalize( pointVector + viewPosition );\n\t\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\t\tfloat pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( pointVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\t\tpointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance * specularNormalization;\n\t\t}\n\t#endif\n\t#if MAX_SPOT_LIGHTS > 0\n\t\tvec3 spotDiffuse = vec3( 0.0 );\n\t\tvec3 spotSpecular = vec3( 0.0 );\n\t\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\t\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\t\tvec3 spotVector = lPosition.xyz + vViewPosition.xyz;\n\t\t\tfloat spotDistance = 1.0;\n\t\t\tif ( spotLightDistance[ i ] > 0.0 )\n\t\t\t\tspotDistance = 1.0 - min( ( length( spotVector ) / spotLightDistance[ i ] ), 1.0 );\n\t\t\tspotVector = normalize( spotVector );\n\t\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\t\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\t\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\t\t\t\t#ifdef WRAP_AROUND\n\t\t\t\t\tfloat spotDiffuseWeightFull = max( dot( normal, spotVector ), 0.0 );\n\t\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dot( normal, spotVector ) + 0.5, 0.0 );\n\t\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\t\t\t\t#else\n\t\t\t\t\tfloat spotDiffuseWeight = max( dot( normal, spotVector ), 0.0 );\n\t\t\t\t#endif\n\t\t\t\tspotDiffuse += spotDistance * spotLightColor[ i ] * diffuse * spotDiffuseWeight * spotEffect;\n\t\t\t\tvec3 spotHalfVector = normalize( spotVector + viewPosition );\n\t\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\t\tfloat spotSpecularWeight = specularTex.r * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\t\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( spotVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\t\tspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * spotDistance * specularNormalization * spotEffect;\n\t\t\t}\n\t\t}\n\t#endif\n\t#if MAX_DIR_LIGHTS > 0\n\t\tvec3 dirDiffuse = vec3( 0.0 );\n\t\tvec3 dirSpecular = vec3( 0.0 );\n\t\tfor( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\n\t\t\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n\t\t\tvec3 dirVector = normalize( lDirection.xyz );\n\t\t\t#ifdef WRAP_AROUND\n\t\t\t\tfloat directionalLightWeightingFull = max( dot( normal, dirVector ), 0.0 );\n\t\t\t\tfloat directionalLightWeightingHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );\n\t\t\t\tvec3 dirDiffuseWeight = mix( vec3( directionalLightWeightingFull ), vec3( directionalLightWeightingHalf ), wrapRGB );\n\t\t\t#else\n\t\t\t\tfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\n\t\t\t#endif\n\t\t\tdirDiffuse += directionalLightColor[ i ] * diffuse * dirDiffuseWeight;\n\t\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\t\tfloat dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\t\tdirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\t\t}\n\t#endif\n\t#if MAX_HEMI_LIGHTS > 0\n\t\tvec3 hemiDiffuse = vec3( 0.0 );\n\t\tvec3 hemiSpecular = vec3( 0.0 );\n\t\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\t\t\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n\t\t\tvec3 lVector = normalize( lDirection.xyz );\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\t\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\t\t\themiDiffuse += diffuse * hemiColor;\n\t\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\t\tfloat hemiSpecularWeightSky = specularTex.r * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\t\t\tvec3 lVectorGround = -lVector;\n\t\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\t\tfloat hemiSpecularWeightGround = specularTex.r * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\t\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\t\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\t\themiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\t\t}\n\t#endif\n\tvec3 totalDiffuse = vec3( 0.0 );\n\tvec3 totalSpecular = vec3( 0.0 );\n\t#if MAX_DIR_LIGHTS > 0\n\t\ttotalDiffuse += dirDiffuse;\n\t\ttotalSpecular += dirSpecular;\n\t#endif\n\t#if MAX_HEMI_LIGHTS > 0\n\t\ttotalDiffuse += hemiDiffuse;\n\t\ttotalSpecular += hemiSpecular;\n\t#endif\n\t#if MAX_POINT_LIGHTS > 0\n\t\ttotalDiffuse += pointDiffuse;\n\t\ttotalSpecular += pointSpecular;\n\t#endif\n\t#if MAX_SPOT_LIGHTS > 0\n\t\ttotalDiffuse += spotDiffuse;\n\t\ttotalSpecular += spotSpecular;\n\t#endif\n\t#ifdef METAL\n\t\tgl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient + totalSpecular );\n\t#else\n\t\tgl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\n\t#endif\n\tif ( enableReflection ) {\n\t\tvec3 vReflect;\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tif ( useRefract ) {\n\t\t\tvReflect = refract( cameraToVertex, normal, refractionRatio );\n\t\t} else {\n\t\t\tvReflect = reflect( cameraToVertex, normal );\n\t\t}\n\t\tvec4 cubeColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\n\t\t#ifdef GAMMA_INPUT\n\t\t\tcubeColor.xyz *= cubeColor.xyz;\n\t\t#endif\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularTex.r * reflectivity );\n\t}", +THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["attribute vec4 tangent;\nuniform vec2 uOffset;\nuniform vec2 uRepeat;\nuniform bool enableDisplacement;\n#ifdef VERTEX_TEXTURES\n\tuniform sampler2D tDisplacement;\n\tuniform float uDisplacementScale;\n\tuniform float uDisplacementBias;\n#endif\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 vViewPosition;", +THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,"\t#ifdef USE_SKINNING\n\t\tvNormal = normalize( normalMatrix * skinnedNormal.xyz );\n\t\tvec4 skinnedTangent = skinMatrix * vec4( tangent.xyz, 0.0 );\n\t\tvTangent = normalize( normalMatrix * skinnedTangent.xyz );\n\t#else\n\t\tvNormal = normalize( normalMatrix * normal );\n\t\tvTangent = normalize( normalMatrix * tangent.xyz );\n\t#endif\n\tvBinormal = normalize( cross( vNormal, vTangent ) * tangent.w );\n\tvUv = uv * uRepeat + uOffset;\n\tvec3 displacedPosition;\n\t#ifdef VERTEX_TEXTURES\n\t\tif ( enableDisplacement ) {\n\t\t\tvec3 dv = texture2D( tDisplacement, uv ).xyz;\n\t\t\tfloat df = uDisplacementScale * dv.x + uDisplacementBias;\n\t\t\tdisplacedPosition = position + normalize( normal ) * df;\n\t\t} else {\n\t\t\t#ifdef USE_SKINNING\n\t\t\t\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\t\t\t\tvec4 skinned = vec4( 0.0 );\n\t\t\t\tskinned += boneMatX * skinVertex * skinWeight.x;\n\t\t\t\tskinned += boneMatY * skinVertex * skinWeight.y;\n\t\t\t\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\t\t\t\tskinned += boneMatW * skinVertex * skinWeight.w;\n\t\t\t\tskinned = bindMatrixInverse * skinned;\n\t\t\t\tdisplacedPosition = skinned.xyz;\n\t\t\t#else\n\t\t\t\tdisplacedPosition = position;\n\t\t\t#endif\n\t\t}\n\t#else\n\t\t#ifdef USE_SKINNING\n\t\t\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\t\t\tvec4 skinned = vec4( 0.0 );\n\t\t\tskinned += boneMatX * skinVertex * skinWeight.x;\n\t\t\tskinned += boneMatY * skinVertex * skinWeight.y;\n\t\t\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\t\t\tskinned += boneMatW * skinVertex * skinWeight.w;\n\t\t\tskinned = bindMatrixInverse * skinned;\n\t\t\tdisplacedPosition = skinned.xyz;\n\t\t#else\n\t\t\tdisplacedPosition = position;\n\t\t#endif\n\t#endif\n\tvec4 mvPosition = modelViewMatrix * vec4( displacedPosition, 1.0 );\n\tvec4 worldPosition = modelMatrix * vec4( displacedPosition, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;", +THREE.ShaderChunk.logdepthbuf_vertex,"\tvWorldPosition = worldPosition.xyz;\n\tvViewPosition = -mvPosition.xyz;\n\t#ifdef USE_SHADOWMAP\n\t\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\t\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\t\t}\n\t#endif\n}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\tvWorldPosition = worldPosition.xyz;\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", +THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex, +"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {", +THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}}; +THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var e in d.attributes){var f=d.attributes[e];if(!f.__webglInitialized||f.createUniqueBuffers){f.__webglInitialized=!0;var g=1;"v2"===f.type?g=2:"v3"===f.type?g=3:"v4"===f.type?g=4:"c"===f.type&&(g=3);f.size=g;f.array=new Float32Array(c*g);f.buffer=m.createBuffer();f.buffer.belongsToAttribute=e;f.needsUpdate=!0}a.__webglCustomAttributesList.push(f)}}} +function c(a,b){var c=b.geometry,g=a.faces3,h=3*g.length,k=1*g.length,l=3*g.length,g=d(b,a),n=f(g),r=e(g),p=g.vertexColors?g.vertexColors:!1;a.__vertexArray=new Float32Array(3*h);r&&(a.__normalArray=new Float32Array(3*h));c.hasTangents&&(a.__tangentArray=new Float32Array(4*h));p&&(a.__colorArray=new Float32Array(3*h));n&&(0ja;ja++)Da=R[ja], +yb[gb]=Da.x,yb[gb+1]=Da.y,yb[gb+2]=Da.z,gb+=3;else for(ja=0;3>ja;ja++)yb[gb]=ba.x,yb[gb+1]=ba.y,yb[gb+2]=ba.z,gb+=3;m.bindBuffer(m.ARRAY_BUFFER,y.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,yb,I)}if(xb&&Hb&&Q){B=0;for(N=ka.length;Bja;ja++)Ga=V[ja],cb[Sa]=Ga.x,cb[Sa+1]=Ga.y,Sa+=2;0ja;ja++)Ya=za[ja],fb[Za]=Ya.x,fb[Za+1]=Ya.y,Za+=2;0c;c++)G.autoScaleCubemaps&&!U?(g=h,f=c,r=a.image[c],u=sc,r.width<=u&&r.height<=u||(v=Math.max(r.width,r.height),q=Math.floor(r.width*u/v),u=Math.floor(r.height*u/v),v=document.createElement("canvas"),v.width=q,v.height=u,v.getContext("2d").drawImage(r,0,0,r.width,r.height,0,0,q,u),r=v),g[f]=r):h[c]=a.image[c];c=h[0];g=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height); +f=B(a.format);r=B(a.type);E(m.TEXTURE_CUBE_MAP,a,g);for(c=0;6>c;c++)if(U)for(u=h[c].mipmaps,v=0,x=u.length;v=Qb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Qb);qa+=1;return a}function N(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)} +function ba(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function P(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function O(a){a!==xa&&(m.lineWidth(a),xa=a)}function J(a,b,c){Qa!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),Qa=a);!a||cb===b&&Ga===c||(m.polygonOffset(b,c),cb=b,Ga=c)}function E(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,B(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,B(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,B(b.magFilter)),m.texParameteri(a, +m.TEXTURE_MIN_FILTER,B(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,R(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,R(b.minFilter)));Ta&&b.type!==THREE.FloatType&&(1b;b++)m.deleteFramebuffer(a.__webglFramebuffer[b]),m.deleteRenderbuffer(a.__webglRenderbuffer[b]);else m.deleteFramebuffer(a.__webglFramebuffer),m.deleteRenderbuffer(a.__webglRenderbuffer); +G.info.memory.textures--},ic=function(a){a=a.target;a.removeEventListener("dispose",ic);Nb(a)},Tb=function(a){void 0!==a.__webglVertexBuffer&&m.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&m.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&m.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&m.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&m.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&m.deleteBuffer(a.__webglUV2Buffer); +void 0!==a.__webglSkinIndicesBuffer&&m.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&m.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&m.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&m.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&m.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)m.deleteBuffer(a.__webglCustomAttributesList[b].buffer); +G.info.memory.geometries--},Nb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Ba.length;ad.numSupportedMorphTargets?(h.sort(t),h.length=d.numSupportedMorphTargets):h.length>d.numSupportedMorphNormals?h.sort(t):0===h.length&&h.push([0,0]);for(p=0;pf;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer(); +m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);Q(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture), +E(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer): +Q(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=wb,a=sb,d=ma,e=Ja);b!==Za&&(m.bindFramebuffer(m.FRAMEBUFFER,b),m.viewport(d,e,c,a),Za=b);Hb=c;Ib=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin); +this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)}; +THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format: +THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null}; +THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps; +a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype); +THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,l=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var r="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?r="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(r="SHADOWMAP_TYPE_PCF_SOFT");var t,s;t=[];for(var p in g)s=g[p],!1!==s&&(s="#define "+p+" "+s,t.push(s)); +t=t.join("\n");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",t,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+ +e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND": +"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"), +b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",t,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG": +"",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP": +"",e.shadowMapEnabled?"#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));l=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+l);n=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+n);f.attachShader(g,l);f.attachShader(g,n);void 0!==q&&f.bindAttribLocation(g,0,q);f.linkProgram(g);!1===f.getProgramParameter(g,f.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."), +console.error("gl.VALIDATE_STATUS",f.getProgramParameter(g,f.VALIDATE_STATUS)),console.error("gl.getError()",f.getError()));""!==f.getProgramInfoLog(g)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f.getProgramInfoLog(g));f.deleteShader(l);f.deleteShader(n);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")): +q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var v in h)q.push(v);h=q;v={};q=0;for(b=h.length;qq-1?0:q-1,t=q+1>e-1?e-1:q+1,s=0>n-1?0:n-1,p=n+1>d-1?d-1:n+1,v=[],w=[0,0,h[4*(q*d+n)]/255*b];v.push([-1,0,h[4*(q*d+s)]/255*b]);v.push([-1,-1,h[4*(r*d+s)]/255*b]);v.push([0,-1,h[4*(r*d+n)]/255*b]);v.push([1,-1,h[4*(r*d+p)]/255*b]);v.push([1,0,h[4*(q*d+p)]/255*b]);v.push([1,1,h[4*(t*d+p)]/255*b]);v.push([0,1,h[4*(t*d+n)]/255* +b]);v.push([-1,1,h[4*(t*d+s)]/255*b]);r=[];s=v.length;for(t=0;te)return null;var f=[],g=[],h=[],k,l,n;if(0=q--){console.log("Warning, unable to triangulate polygon!");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var r;a:{var t=r=void 0,s=void 0,p=void 0,v=void 0,w=void 0,u=void 0,D=void 0,A= +void 0,t=a[g[k]].x,s=a[g[k]].y,p=a[g[l]].x,v=a[g[l]].y,w=a[g[n]].x,u=a[g[n]].y;if(1E-10>(p-t)*(u-s)-(v-s)*(w-t))r=!1;else{var x=void 0,C=void 0,I=void 0,z=void 0,y=void 0,K=void 0,N=void 0,ba=void 0,P=void 0,O=void 0,P=ba=N=A=D=void 0,x=w-p,C=u-v,I=t-w,z=s-u,y=p-t,K=v-s;for(r=0;rk)g=d+1;else if(0b&&(b=0);1=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]}; +THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;cb?b=h.x:h.xc?c=h.y:h.yd?d=h.z:h.zMath.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c}; +THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;cl&&(g=b[f],k=-k,h=b[e],l=-l),!(a.yh.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<= +h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;bz||z>I)return[];k=l*n-k*q;if(0>k||k>I)return[]}else{if(0d?[]:k==d?f?[]:[g]:a<=d?[g,h]: +[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1; +d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;cO){console.log("Infinite Loop! Holes left:"+ +l.length+", Probably Hole outside Shape!");break}for(q=K;qh;h++)l=k[h].x+":"+k[h].y, +l=n[l],void 0!==l&&(k[h]=l);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a, +b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()}; +THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)}; +THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype); +THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b}; +THREE.SplineCurve=function(a){this.points=void 0==a?[]:a};THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],d=this.points,e;e=(d.length-1)*a;a=Math.floor(e);e-=a;c[0]=0==a?a:a-1;c[1]=a;c[2]=a>d.length-2?d.length-1:a+1;c[3]=a>d.length-3?d.length-1:a+2;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);return b}; +THREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a;this.aY=b;this.xRadius=c;this.yRadius=d;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=g};THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype); +THREE.EllipseCurve.prototype.getPoint=function(a){var b;b=this.aEndAngle-this.aStartAngle;0>b&&(b+=2*Math.PI);b>2*Math.PI&&(b-=2*Math.PI);b=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b;a=this.aX+this.xRadius*Math.cos(b);b=this.aY+this.yRadius*Math.sin(b);return new THREE.Vector2(a,b)};THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)};THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype); +THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.subVectors(this.v2,this.v1);b.multiplyScalar(a);b.add(this.v1);return b});THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b,c;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);c=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);a=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(b,c,a)}); +THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b,c;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);c=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);a=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(b,c,a)}); +THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;a*=d.length-1;e=Math.floor(a);a-=e;c[0]=0==e?e:e-1;c[1]=e;c[2]=e>d.length-2?d.length-1:e+1;c[3]=e>d.length-3?d.length-1:e+2;e=d[c[0]];var f=d[c[1]],g=d[c[2]],c=d[c[3]];b.x=THREE.Curve.Utils.interpolate(e.x,f.x,g.x,c.x,a);b.y=THREE.Curve.Utils.interpolate(e.y,f.y,g.y,c.y,a);b.z=THREE.Curve.Utils.interpolate(e.z,f.z,g.z,c.z,a);return b}); +THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;e=(d.length-0)*a;a=Math.floor(e);e-=a;a+=0a.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time= +0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){d={};for(c=0;cd;d++){for(var e= +this.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.timef.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}}; +THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,r,t,s,p;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];s=a[c[2]];p=a[c[3]];c=e*e;r=e*c;d[0]=f(q[0],t[0],s[0],p[0],e,c,r);d[1]=f(q[1],t[1],s[1],p[1],e,c,r);d[2]=f(q[2],t[2],s[2],p[2],e,c,r);return d},f=function(a,b,c,d,e,f,r){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)* +r+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(!0===this.loop&&this.currentTime>f)this.currentTime%=f,this.reset();else if(!1===this.loop&&this.currentTime>f){this.stop();return}f=0;for(var h=this.hierarchy.length;fn;n++){var q=this.keyTypes[n],r=l.prevKey[q],t=l.nextKey[q];if(t.time<=this.currentTime){r=this.data.hierarchy[f].keys[0]; +for(t=this.getNextKeyWith(q,f,1);t.timer.index;)r=t,t=this.getNextKeyWith(q,f,t.index+1);l.prevKey[q]=r;l.nextKey[q]=t}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var s=(this.currentTime-r.time)/(t.time-r.time),p=r[q],v=t[q];0>s&&(s=0);1a&&(this.currentTime%=a);this.currentTime=Math.min(this.currentTime,a);a=0;for(var b=this.hierarchy.length;af.index;)f=g,g=e[f.index+1];d.prevKey= +f;d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.interpolate(g,g.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorldNeedsUpdate=!0}}}};THREE.KeyFrameAnimation.prototype.getNextKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c%=b.length;cthis.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);c=this.duration/this.frames;var d=Math.floor(this.currentTime/c);d!=b&&(this.mesh.morphTargetInfluences[a]=0,this.mesh.morphTargetInfluences[b]=1,this.mesh.morphTargetInfluences[d]= +0,a=b,b=d);this.mesh.morphTargetInfluences[d]=this.currentTime%c/c;this.mesh.morphTargetInfluences[a]=1-this.mesh.morphTargetInfluences[d]}}}()}; +THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,p){var v,w=h.widthSegments,u=h.heightSegments,D=e/2,A=f/2,x=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",u=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var C=w+1,I=u+1,z=e/w,y=f/u,K=new THREE.Vector3;K[v]=0=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else a=!1,1E-10e?-1E-10>g&& +(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(H=c.length;0<=--H;){e=H;f=H-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;gMath.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(l,1-g),new THREE.Vector2(q,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-f),new THREE.Vector2(n,1-g),new THREE.Vector2(r,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2; +THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;cc&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+0.5, +a.y));return a.clone()}THREE.Geometry.call(this);c=c||1;d=d||0;for(var k=this,l=0,n=a.length;lt&&(0.2>d&&(b[0].x+=1),0.2>a&&(b[1].x+=1),0.2>q&&(b[2].x+=1));l=0;for(n=this.vertices.length;lc.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}(); +THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=0.2*a);void 0===c&&(c=0.2*b);this.line.scale.set(1,a,1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)}; +THREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3));THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);void 0!==a&&this.update(a)};THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype); +THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.geometry.attributes.position.array;d[0]=b.x;d[1]=b.y;d[2]=b.z;d[3]=c.x;d[4]=b.y;d[5]=b.z;d[6]=c.x;d[7]=b.y;d[8]=b.z;d[9]=c.x;d[10]=c.y;d[11]=b.z;d[12]=c.x;d[13]=c.y;d[14]=b.z;d[15]=b.x;d[16]=c.y;d[17]=b.z;d[18]=b.x;d[19]=c.y;d[20]=b.z;d[21]=b.x;d[22]=b.y;d[23]=b.z;d[24]=b.x;d[25]=b.y;d[26]=c.z;d[27]=c.x;d[28]=b.y;d[29]=c.z;d[30]=c.x;d[31]=b.y; +d[32]=c.z;d[33]=c.x;d[34]=c.y;d[35]=c.z;d[36]=c.x;d[37]=c.y;d[38]=c.z;d[39]=b.x;d[40]=c.y;d[41]=c.z;d[42]=b.x;d[43]=c.y;d[44]=c.z;d[45]=b.x;d[46]=b.y;d[47]=c.z;d[48]=b.x;d[49]=b.y;d[50]=b.z;d[51]=b.x;d[52]=b.y;d[53]=c.z;d[54]=c.x;d[55]=b.y;d[56]=b.z;d[57]=c.x;d[58]=b.y;d[59]=c.z;d[60]=c.x;d[61]=c.y;d[62]=b.z;d[63]=c.x;d[64]=c.y;d[65]=c.z;d[66]=b.x;d[67]=c.y;d[68]=b.z;d[69]=b.x;d[70]=c.y;d[71]=c.z;this.geometry.attributes.position.needsUpdate=!0;this.geometry.computeBoundingSphere();this.matrixAutoUpdate= +!1;this.matrixWorld=a.matrixWorld};THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a;this.box=new THREE.Box3;THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)}; +THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3);d.colors.push(new THREE.Color(b));void 0===f[a]&&(f[a]=[]);f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b("n1","n2",16755200);b("n2","n4",16755200);b("n4","n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);b("n1","f1",16755200); +b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()}; +THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype); +THREE.CameraHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Camera,c=new THREE.Projector;return function(){function d(d,g,h,k){a.set(g,h,k);c.unprojectVector(a,b);d=e.pointMap[d];if(void 0!==d)for(g=0,h=d.length;gs;s++){d[0]=t[g[s]];d[1]=t[g[(s+1)%3]];d.sort(f);var p=d.toString();void 0===e[p]?(e[p]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},n++):e[p].face2=q}h.addAttribute("position",new THREE.Float32Attribute(6*n,3));d=h.attributes.position.array; +f=0;for(p in e)if(g=e[p],void 0===g.face2||0.9999>k[g.face1].normal.dot(k[g.face2].normal))n=l[g.vert1],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z,n=l[g.vert2],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z;THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype); +THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;cb;b++)a.faces[b].color=this.colors[4>b?0:1];b=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(a,b);this.add(this.lightSphere); +this.update()};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose();this.lightSphere.material.dispose()}; +THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=!0}}(); +THREE.PointLightHelper=function(a,b){this.light=a;this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrixWorld=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()}; +THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}; +THREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;cp;p++){d[0]=s[g[p]];d[1]=s[g[(p+1)%3]];d.sort(f);var v=d.toString();void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++)}d=new Float32Array(6*n);r=0;for(t=n;rp;p++)n= +k[q[2*r+p]],g=6*r+3*p,d[g+0]=n.x,d[g+1]=n.y,d[g+2]=n.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){for(var k=a.geometry.attributes.position.array,t=a.geometry.attributes.index.array,l=a.geometry.offsets,n=0,q=new Uint32Array(2*t.length),s=0,w=l.length;sp;p++)d[0]=g+t[r+p],d[1]=g+t[r+(p+1)%3],d.sort(f),v=d.toString(), +void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++);d=new Float32Array(6*n);r=0;for(t=n;rp;p++)g=6*r+3*p,n=3*q[2*r+p],d[g+0]=k[n],d[g+1]=k[n+1],d[g+2]=k[n+2]}else for(k=a.geometry.attributes.position.array,n=k.length/3,q=n/3,d=new Float32Array(6*n),r=0,t=q;rp;p++)g=18*r+6*p,q=9*r+3*p,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],n=9*r+(p+1)%3*3,d[g+3]=k[n],d[g+4]=k[n+1],d[g+5]=k[n+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}), +THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)}; +THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})}; +THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;ah.end&&(h.end=f);c||(c=k)}}for(k in d)h=d[k],this.createAnimation(k,h.start,h.end,a);this.firstAnimation=c}; +THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a])a.direction=1,a.directionBackwards=!1};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){if(a=this.animationsMap[a])a.direction=-1,a.directionBackwards=!0};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)}; +THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b}; +THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1}; +THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;bd.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight; +f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}}; +THREE.LensFlarePlugin=function(){function a(a,b){var d=c.createProgram(),e=c.createShader(c.FRAGMENT_SHADER),f=c.createShader(c.VERTEX_SHADER),g="precision "+b+" float;\n";c.shaderSource(e,g+a.fragmentShader);c.shaderSource(f,g+a.vertexShader);c.compileShader(e);c.compileShader(f);c.attachShader(d,e);c.attachShader(d,f);c.linkProgram(d);return d}var b=[],c,d,e,f,g,h,k,l,n,q,r,t,s;this.init=function(b){c=b.context;d=b;e=b.getPrecision();f=new Float32Array(16);g=new Uint16Array(6);b=0;f[b++]=-1;f[b++]= +-1;f[b++]=0;f[b++]=0;f[b++]=1;f[b++]=-1;f[b++]=1;f[b++]=0;f[b++]=1;f[b++]=1;f[b++]=1;f[b++]=1;f[b++]=-1;f[b++]=1;f[b++]=0;f[b++]=1;b=0;g[b++]=0;g[b++]=1;g[b++]=2;g[b++]=0;g[b++]=2;g[b++]=3;h=c.createBuffer();k=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,h);c.bufferData(c.ARRAY_BUFFER,f,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.bufferData(c.ELEMENT_ARRAY_BUFFER,g,c.STATIC_DRAW);l=c.createTexture();n=c.createTexture();c.bindTexture(c.TEXTURE_2D,l);c.texImage2D(c.TEXTURE_2D,0,c.RGB,16, +16,0,c.RGB,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);c.bindTexture(c.TEXTURE_2D,n);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,16,16,0,c.RGBA,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE); +c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);0>=c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(q=!1,r=a(THREE.ShaderFlares.lensFlare,e)):(q=!0,r=a(THREE.ShaderFlares.lensFlareVertexTexture,e));t={};s={};t.vertex=c.getAttribLocation(r,"position");t.uv=c.getAttribLocation(r,"uv");s.renderType=c.getUniformLocation(r,"renderType");s.map=c.getUniformLocation(r,"map");s.occlusionMap=c.getUniformLocation(r,"occlusionMap");s.opacity= +c.getUniformLocation(r,"opacity");s.color=c.getUniformLocation(r,"color");s.scale=c.getUniformLocation(r,"scale");s.rotation=c.getUniformLocation(r,"rotation");s.screenPosition=c.getUniformLocation(r,"screenPosition")};this.render=function(a,e,f,g){b.length=0;a.traverseVisible(function(a){a instanceof THREE.LensFlare&&b.push(a)});if(0!==b.length){a=new THREE.Vector3;var D=g/f,A=0.5*f,x=0.5*g,C=16/g,I=new THREE.Vector2(C*D,C),z=new THREE.Vector3(1,1,0),y=new THREE.Vector2(1,1),K=s,C=t;c.useProgram(r); +c.enableVertexAttribArray(t.vertex);c.enableVertexAttribArray(t.uv);c.uniform1i(K.occlusionMap,0);c.uniform1i(K.map,1);c.bindBuffer(c.ARRAY_BUFFER,h);c.vertexAttribPointer(C.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(C.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.disable(c.CULL_FACE);c.depthMask(!1);for(var N=0,ba=b.length;NK;K++)C[K]=new THREE.Vector3,A[K]=new THREE.Vector3;C=x.shadowCascadeNearZ[y];x=x.shadowCascadeFarZ[y];A[0].set(-1,-1,C);A[1].set(1,-1,C);A[2].set(-1,1,C);A[3].set(1,1,C);A[4].set(-1,-1,x);A[5].set(1,-1,x);A[6].set(-1,1,x);A[7].set(1,1,x);z.originalCamera=s;A=new THREE.Gyroscope; +A.position.copy(w.shadowCascadeOffset);A.add(z);A.add(z.target);s.add(A);w.shadowCascadeArray[D]=z;console.log("Created virtualLight",z)}y=w;C=D;x=y.shadowCascadeArray[C];x.position.copy(y.position);x.target.position.copy(y.target.position);x.lookAt(x.target);x.shadowCameraVisible=y.shadowCameraVisible;x.shadowDarkness=y.shadowDarkness;x.shadowBias=y.shadowCascadeBias[C];A=y.shadowCascadeNearZ[C];y=y.shadowCascadeFarZ[C];x=x.pointsFrustum;x[0].z=A;x[1].z=A;x[2].z=A;x[3].z=A;x[4].z=y;x[5].z=y;x[6].z= +y;x[7].z=y;I[u]=z;u++}else I[u]=w,u++;p=0;for(v=I.length;py;y++)C=x[y],C.copy(A[y]),THREE.ShadowMapPlugin.__projector.unprojectVector(C,D),C.applyMatrix4(u.matrixWorldInverse),C.xn.x&&(n.x=C.x),C.yn.y&&(n.y=C.y),C.zn.z&&(n.z=C.z);u.left=l.x;u.right=n.x;u.top=n.y;u.bottom=l.y;u.updateProjectionMatrix()}u=w.shadowMap;A=w.shadowMatrix; +D=w.shadowCamera;D.position.setFromMatrixPosition(w.matrixWorld);q.setFromMatrixPosition(w.target.matrixWorld);D.lookAt(q);D.updateMatrixWorld();D.matrixWorldInverse.getInverse(D.matrixWorld);w.cameraHelper&&(w.cameraHelper.visible=w.shadowCameraVisible);w.shadowCameraVisible&&w.cameraHelper.update();A.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);A.multiply(D.projectionMatrix);A.multiply(D.matrixWorldInverse);k.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse);h.setFromMatrix(k);c.setRenderTarget(u); +c.clear();r.length=0;a(t,t,D);w=0;for(u=r.length;w 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); +u.compileShader(x);u.compileShader(P);u.attachShader(w,x);u.attachShader(w,P);u.linkProgram(w);K=w;p=u.getAttribLocation(K,"position");v=u.getAttribLocation(K,"uv");a=u.getUniformLocation(K,"uvOffset");b=u.getUniformLocation(K,"uvScale");c=u.getUniformLocation(K,"rotation");d=u.getUniformLocation(K,"scale");e=u.getUniformLocation(K,"color");f=u.getUniformLocation(K,"map");g=u.getUniformLocation(K,"opacity");h=u.getUniformLocation(K,"modelViewMatrix");k=u.getUniformLocation(K,"projectionMatrix");l= +u.getUniformLocation(K,"fogType");n=u.getUniformLocation(K,"fogDensity");q=u.getUniformLocation(K,"fogNear");r=u.getUniformLocation(K,"fogFar");t=u.getUniformLocation(K,"fogColor");s=u.getUniformLocation(K,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;x=w.getContext("2d");x.fillStyle="white";x.fillRect(0,0,8,8);A=new THREE.Texture(w);A.needsUpdate=!0};this.render=function(C,I,P,O){x.length=0;C.traverseVisible(function(a){a instanceof THREE.Sprite&&x.push(a)});if(0!==x.length){u.useProgram(K); +u.enableVertexAttribArray(p);u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,z);u.vertexAttribPointer(p,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,y);u.uniformMatrix4fv(k,!1,I.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(f,0);O=P=0;var J=C.fog;J?(u.uniform3f(t,J.color.r,J.color.g,J.color.b),J instanceof THREE.Fog?(u.uniform1f(q,J.near),u.uniform1f(r,J.far),u.uniform1i(l,1), +O=P=1):J instanceof THREE.FogExp2&&(u.uniform1f(n,J.density),u.uniform1i(l,2),O=P=2)):(u.uniform1i(l,0),O=P=0);for(var J=0,E=x.length;J
              ") + .addClass("z-fixed z-pointer z-bd z-pd-t20 z-text-center z-bg-white") + .css({"top":513,"right":25,"width":60, "height":65,"z-index":99999}) + .click(function(){window.scrollTo(0,0);}) + .hover(function(){$top.css("background-color", "#f8f8f8")}, function(){$top.css("background-color", "transparent")}) + .html("") + .appendTo("body") + .hide(); + + Z(document).scroll(function() + { + if (Z.D.scrollTop() > 0) + $top.show(); + else + $top.hide(); + }); +}); + +//END +})(zhiqim); \ No newline at end of file diff --git a/zhiqim_ui/zview/zhiqim_com/index_mobile.htm b/zhiqim_ui/zview/zhiqim_com/index_mobile.htm new file mode 100644 index 0000000..e679ef7 --- /dev/null +++ b/zhiqim_ui/zview/zhiqim_com/index_mobile.htm @@ -0,0 +1,58 @@ +<#def htmlOverflowHidden = true/> +${zhiqim_com_mobile_header()} +${zhiqim_com_mobile_topnav("index")} +
              + +
              +
              +
              +
              +
              +
              +
              +

              ZhiqimDK

              +
              +
              +
              +

              ZhiqimStudio

              +
              +
              +
              +

              zhiqim_pm

              +
              +
              +
              +
              + + +
              +
              +
              + gitsolo是由知启蒙团队自主研发的一个极简的git仓库管理器,支持HTT(S)协议,包含部门角色权限等管理,用户可在此基础上进行二次开发,也可作为其他大项目下的组件使用。
              +
              +
              + + +
              +
              +
              + 组件是封装了一个或多个实体程序模块的实体。采用类似于搭积木的方法快速的形成新的组件或产品,不仅可以缩短软件项目的开发周期,同时也提高了系统的稳定性。知启蒙现已形成如zhiqim_manager、zhiqim_account等多个组件。 +
              +
              + + +
              +
              +
              +

              湖南知启蒙科技有限公司专业致力于互联网领域,是集互联网平台,技术框架,技术组件等开发服务于一体的网络科技公司,公司凭借多年在互联网等信息领域的沉淀积累,为客户提供了优质的互联网产品及服务。

              +

              知启蒙技术平台是由知启蒙团队开发的整合Java & HTML5,前后端于一体的技术体系,其特点为积木式组件模块化和模型模板化。

              +

              我们拥有
              + ----安全、轻便的技术框架
              + ----先进、专业的技术支持
              + ----多样、强大的技术组件 +

              +
              +
              + +${zhiqim_com_mobile_footer()} +
              diff --git a/zhiqim_ui/zview/zhiqim_com/index_pc.htm b/zhiqim_ui/zview/zhiqim_com/index_pc.htm new file mode 100644 index 0000000..6d463b9 --- /dev/null +++ b/zhiqim_ui/zview/zhiqim_com/index_pc.htm @@ -0,0 +1,166 @@ +<#def htmlOverflowHidden = true/> +${zhiqim_com_header()} +${zhiqim_com_topnav("index")} +${Styles.htmlOverflowHidden()} +${Scripts.src("/src_extend/zhiqim_scroll_screen.js")} +${Scripts.src("/src_extend/zhiqim_webgl_three.js")} + + + +
              +
              +
              +
              +
              +
              +
              +

              ZhiqimDK

              +

              一套颠覆传统Tomcat和servlet的完整型、开放型、创新型的技术体系。

              +
              +
              +
              +
              +

              ZhiqimStudio

              +

              快速搭建基于ZhiqimDK的web工程,大幅提升HTML、js、css的开发效率。

              +
              +
              +
              +
              +

              ZhiqimPM

              +

              一款融合了代码托管、协同开发、开发过程管理的强大的软件管理工具。

              +
              +
              +
              +
              0+ 程序员,0+ 家公司正在使用
              +
              +
              + + +
              +
              +
              +
              +
              gitsolo
              +
              gitsolo是首个独立命名,由知启蒙团队自主研发的一个极简的git仓库管理器,支持HTT(S)协议,包含部门角色权限等管理,用户可在此基础上进行二次开发,也可作为其他大项目下的组件使用。 + (Demo用户名:zhiqim 密码:zhiqim@2015) +
              +
              +
                +
              • 依赖于zhiqim_manager,自带管理和权限功能。
              • +
              • 集成了sqlite文件数据库,安装使用方便。
              • +
              • 全程自主研发,无外部包依赖,开发环境纯净。
              • +
              • 安装简单,启动容易,一键式启动方式。
              • +
              • 隶属于zhiqim_pm下的,基于git规范的开源代码仓库系统
              • +
              +
              +
              + + +
              +
              + +
              +
              + + +
              +
              +
              +
              + + + + + + + + + + + + + + + + + + +
              组件中心
              可重用性组件可扩展性
              组件类型多样化缩短软件开发周期 提高效率
              组件是封装了一个或多个实体程序模块的实体。采用类似于搭积木的方法快速的形成新的组件或产品,不仅可以缩短软件项目的开发周期,同时也提高了系统的稳定性。知启蒙现已形成如zhiqim_manager、zhiqim_account等多个组件。
              了解更多》
              +
              +
              +
              + + +
              +
              +
              +
              +
              关于知启蒙
              +
              +

              湖南知启蒙科技有限公司专业致力于互联网领域,是集互联网平台,技术框架,技术组件等开发服务于一体的网络科技公司,公司凭借多年在互联网等信息领域的沉淀积累,为客户提供了优质的互联网产品及服务。

              +

              知启蒙技术平台是由知启蒙团队开发的整合Java & HTML5,前后端于一体的技术体系,其特点为积木式组件模块化和模型模板化。

              +

              我们拥有
              + ----安全、轻便的技术框架
              + ----先进、专业的技术支持
              + ----多样、强大的技术组件 +

              +
              +
              +
              +
              + +${zhiqim_com_footer()} \ No newline at end of file diff --git a/zhiqim_zml/.classpath b/zhiqim_zml/.classpath new file mode 100644 index 0000000..9c0945b --- /dev/null +++ b/zhiqim_zml/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/zhiqim_zml/.gitignore b/zhiqim_zml/.gitignore new file mode 100644 index 0000000..5e56e04 --- /dev/null +++ b/zhiqim_zml/.gitignore @@ -0,0 +1 @@ +/bin diff --git a/zhiqim_zml/.project b/zhiqim_zml/.project new file mode 100644 index 0000000..30b8a34 --- /dev/null +++ b/zhiqim_zml/.project @@ -0,0 +1,17 @@ + + + zhiqim_zml + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/zhiqim_zml/.settings/org.eclipse.jdt.core.prefs b/zhiqim_zml/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..87b7a7a --- /dev/null +++ b/zhiqim_zml/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/zhiqim_zml/.settings/org.eclipse.jdt.ui.prefs b/zhiqim_zml/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..44a79f5 --- /dev/null +++ b/zhiqim_zml/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/zhiqim_zml/LICENSE b/zhiqim_zml/LICENSE new file mode 100644 index 0000000..5cc63c2 --- /dev/null +++ b/zhiqim_zml/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. [http://fsf.org/] + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/zhiqim_zml/README.md b/zhiqim_zml/README.md new file mode 100644 index 0000000..3bd7748 --- /dev/null +++ b/zhiqim_zml/README.md @@ -0,0 +1,255 @@ +### 什么是“ZML”? +--------------------------------------- +      ZML(Zhiqim Markup Language)即“知启蒙标记语言”,是知启蒙定义的、类似于Java & Javascript语法的语句和表达式,通常和XML/HTML混编在一起形成的一种新的标记语言。ZML力求简单易用,目前支持常用的十二种标记语句和五十种表达式,在知启蒙框架体系中被用来代替JSP。 + +
              + +### 什么是“ZML引擎”? +--------------------------------------- +      ZML引擎(ZhiqimZML)即“知启蒙标识语言引擎”,是实现ZML规范的引擎系统。支持两种ZML加载方式(按文件目录和按类路径)、能够在ZML文件改动后立即发现并在触发时重新加载、并提供详细的“表达式合并运算优先级”、“变量多维作用域”和“无障碍访问Java代码”,以及设置上下文作用域的配置模板、对模板进行缓存等特性。 + +
              + +### “ZML引擎”有哪些优点? +--------------------------------------- +1、ZhiqimZML仅依赖JDK1.7+和ZhiqimKernel。15年的坚持,值得信赖。
              +2、ZhiqimZML支持十二种语句和五十种表达式基本覆盖业务操作,是[知启蒙WEB容器](https://gitee.com/zhiqim/zhiqim_httpd)的重要组成部分,在ZhiqimDK家族中占据非常重要的位置。
              +3、对比国外模板引擎Freemarker和Velocity,ZhiqimZML更有优势,结合[知启蒙微内核](https://gitee.com/zhiqim/zhiqim_kernel)的大量工具类(如Strings/Validatest),使得ZhiqimZML可无障碍访问Java代码,称之为Java的标识语言都不为过。
              +4、最后**自荐一下**,比Spring更轻量、更齐全的J2EE框架 **zhiqim** 正式开源啦,不服来试用。 + +
              + +### 最简单的ZML引擎使用方法 +--------------------------------------- + + + + + + +
              + 1、准备好一段符合ZML规格的字符串,和一个变量表,即可解析出结果。
              + 2、支持全局变量表中@AnAlias注解别名表和预定义Java类名的静态变量和静态方法调用。
              + 3、详细见org.zhiqim.zml.Zmls静态类中的方法,如下提供的parse方法。 +
              + +
              + +
              + +### ZML支持的十二种语句                                                                                          前往五十种表达式 +--------------------------------------- +一、变量定义语句(_Var)
              +``` +<#var name = "知启蒙模板引擎"/> + +表示定义变量name的值为“知启蒙模板引擎”。 +``` +二、函数定义语句(_Function) +``` +<#function functionName(param1, param2)> +
              param1 = ${param1}
              +
              param2 = ${param2}
              + +``` +三、文件包含语句(_Include) +``` +<#include "/zml/inc.zml"/> + +表示包含文件“/zml/inc.zml”的内容到该页面中。 +``` +四、判断语句(_If) +``` +<#if (!Validates.isEmpty(name) && name.startWith("知启蒙"))> + ${name} + +``` +五、遍历语句(_For) +``` +<#for (var item : list)> + <#if (Validates.isNotEmpty(item))> + ${item} + + + +简写: + +<#for item : list> + <#if (Validates.isNotEmpty(item))> + ${item} + + +``` +六、拦截器语句(_Interceptor) +``` +<#interceptor "chkLogin"/> + +拦截器语句用于在执行之前判断是否支持定义的参数的值,如"chkLogin"表示是一个拦截器名称 +``` +七、显示结果语句(_Echo) +``` +显示结果语句是通过连接、计算和合并的方式执行多个表达式,得到执行结果,然后把结果显示在页面上,值为(null)不显示结果,如: + +<#var name = "知启蒙"/> + +${name} 表示执行表达式name,得到结果“知启蒙” + +${name + "引擎"} 表示执行表达式name + "引擎",得到结果“知启蒙引擎” + +${functionName(name, "edf")} 表示调用函数并显示结果 + +${Strings.trimLeft(name, "知")} 表示类Strings的trimLeft方法,显示结果“启蒙” +``` +八、显示格式化结果语句(_Format) +``` +显示格式化结果语句是通过连接、计算和合并的方式执行多个表达式,得到执行结果,值为(null)不显示结果,
              +并对其他Zmls.format(zml)格式化,对<,>,\",\',${,@{,#{格式化,保证浏览器解释成字符串而不是ZML代码,如: + +<#var name = "知${abc}启蒙"/> +#{name} 表示执行表达式name,得到结果是“知${abc}启蒙”,$符号转为$ + +#{name + "引\"擎"} 表示执行表达式name + "引\"擎",得到结果“知${abc}启蒙引"擎”,$符号转为$,引号变成" + +#{functionName(name, "edf")} 表示调用函数并显示结果 + +#{Strings.trimLeft(name, "知")} 表示类Strings的trimLeft方法,显示结果“${abc}启蒙” +``` +九、调用不显示结果语句(_Call) +``` +调用语句是通过连接、计算和合并的方式执行多个表达式,执行,但不显示结果到页面上,如: + +@{System.out.println("显示信息到控制台,不是显示到页面")} 表示执行System.out.println(); +``` +十、返回语句(_Return) +``` +返回语句应用于标识当前页执行结束,直接返回,和函数function中返回值: + +<#if Validates.isEmpty(sessionKey)> + <#return/> + + +<#function functionName(param1, param2)> + <#var ret = param1+param2/> + <#return ret/> + +``` +十一、继续语句(_Continue) +``` +继续语句应用于_For语句中,表示结束当次处理,继续下一次: + +<#for item : list> + <#if (Validates.isNotEmpty(item))> + <#continue/> + + +``` +十二、中断语句(_Break) +``` +<#for item : list> + <#if (Validates.isNotEmpty(item))> + <#break/> + + +``` + +
              + +### 常用的ZML页面和ZML配置模板 +--------------------------------------- +![常用的ZML页面](https://images.gitee.com/uploads/images/2018/0907/202448_e96bd2c6_2103954.png "zhiqim_zml_readme_2.png") +![常用的ZML配置模板](https://images.gitee.com/uploads/images/2018/0907/202500_0e1e767c_2103954.png "zhiqim_zml_readme_3.png") +
              +
              + +### 强大的ZML引擎解析文件 +--------------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              + 1、支持对文件目录/类路径加载配置定义的变量和函数到上下文变量表中,支持根据path查找ZML文件加载。
              + 2、支持多个组件加载器,依次查找组件配置模板中定义的变量和函数到上下文变量表,和根据path查找的ZML文件加载。
              + 3、支持自定义设置全局变量。
              + 4、支持对ZML文件监视,有变动立即知晓,并在被触发时加载文件,如是配置模板会回调通知。
              + 5、支持对ZML文件缓存,并提供缓存参数maxIdleTime/maxKeepTime。 +
              参数参数类型描述
              noticeZmlVarNotice设置模板变量变动通知,当/conf/config.zml有变动并触发时回调doUpdate方法
              encodingString模板加载编码
              maxIdleTimeint模板最大空闲时长,建议1小时
              maxKeepTimeint模板最大保持时长,建议24小时
              isAscQueryboolean当有组件配置模板时,是否按顺序查找
              patternsString模板匹配模式,默认*.zml,*.htm
              loaderClassZmlLoader
              FileZmlLoader
              设置根配置模板加载器,类路径/目录
              cLoaderMapClassZmlLoader组件配置模板加载器,类路径/目录,支持多个,
              通过addComponentZmlLoader()添加
              globalMapHashMap全局变量表,通过addGlobalVariable添加
              + + +``` +//先创建ZML引擎,可以保存起来 +ZmlEngine engine = new ZmlEngine(); +engine.setFileZmlLoader(new File("./resource")); +engine.setConfigZml("/conf/config.zml"); + +//调用和解析ZML文件 +Zml zml = engine.getZml("/zml/abc.zml"); +HashMapSO variableMap = new HashMapSO(); +variableMap.put("abc", "知启蒙"); +variableMap.put("def", "标识语言"); +variableMap.put("isAbc", false); + +String result = Zmls.parese(zml, variableMap); +``` + +
              + +
              + +### 知启蒙技术框架与交流 +--------------------------------------- +![知启蒙技术框架架构图](https://images.gitee.com/uploads/images/2018/0907/101431_93f5c39d_2103954.jpeg "知启蒙技术框架架构图.jpg")

              +QQ群:加入QQ交流群,请点击[【458171582】](https://jq.qq.com/?_wv=1027&k=5DWlB3b)

              +教程:欲知更多知启蒙标识语言,[【请戳这里】](https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml/tutorial/index.htm) \ No newline at end of file diff --git a/zhiqim_zml/document/export/V1.5.0.exp.xml b/zhiqim_zml/document/export/V1.5.0.exp.xml new file mode 100644 index 0000000..d879fff --- /dev/null +++ b/zhiqim_zml/document/export/V1.5.0.exp.xml @@ -0,0 +1,15 @@ + +
              +
              + + + + + + + + + + +
              +
              diff --git a/zhiqim_zml/document/export/V1.5.1.exp.xml b/zhiqim_zml/document/export/V1.5.1.exp.xml new file mode 100644 index 0000000..7230844 --- /dev/null +++ b/zhiqim_zml/document/export/V1.5.1.exp.xml @@ -0,0 +1,14 @@ + +
              +
              + + + + + + + + + +
              +
              diff --git a/zhiqim_zml/document/metainfo/MANIFEST.MF b/zhiqim_zml/document/metainfo/MANIFEST.MF new file mode 100644 index 0000000..743d7da --- /dev/null +++ b/zhiqim_zml/document/metainfo/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: ZhiqimML +Bundle-SymbolicName: zhiqim_ml +Bundle-Version: 1.5.0 +Export-Package: org.zhiqim.zml, + org.zhiqim.zml.exception, + org.zhiqim.zml.expression, + org.zhiqim.zml.expression.operator, + org.zhiqim.zml.expression.primitive, + org.zhiqim.zml.expression.symbol, + org.zhiqim.zml.loader, + org.zhiqim.zml.statement +Require-Bundle: zhiqim +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/zhiqim_zml/document/metainfo/version.txt b/zhiqim_zml/document/metainfo/version.txt new file mode 100644 index 0000000..7ea3146 --- /dev/null +++ b/zhiqim_zml/document/metainfo/version.txt @@ -0,0 +1,70 @@ +V1.1.0.R2015072901版本:从原V1.0的fadfox_httpd.jar中分离出来 +V1.1.0.R2015090201版本:根据fadfox整理成统一该版本 +V1.1.1.R2015091401版本:使用JDK1.7编译 +V1.1.2.R2015093001版本:要求使用V1.1.2版本的fadfox.jar +V1.1.2.R2015102201版本:支持从AnStatic,AnGlobal,AnNew中读取系统变量 +V1.1.2.R2015102601版本:修改for语句方法 +V1.1.3.R2015112501版本:整理版本,用于生产系统 +V1.1.3.R2015122901版本:根据FTimer改动修改的版本 +V1.1.3.R2016020301版本:春节前整理版本号 +V1.1.4.R2016041701版本:增加<#include> +V1.2.0.R2016072101版本: + 1)修改<#for>标签为<#for (item : list)>支持括号和<#for (var item : list)>严格模式 + 2)增加new和.class表达式,以支持<#var abc = new Abc()/>和<#var list=Global.get(FTable.class).list(Abc.class)> + 3)增加<#interceptor>支持在ftm中写拦截器 + 4)增加包和点号的参数的支持,如com.zhiqim.fadfox.Boot可以是包名,fadfox.manager可以是变量名,属性请使用["property"],如fadfox["key"] + 5)增加TemplateVarNotice,当上下文文件context.ftml有改动时,回调更新 +V1.2.1.R2016100801版本: + 1)增加TemplateEngine.hasTemplate方法,用于使用前先判断是否存在 + 2)修改原后缀.ftml,.ftm为三个(.ftml,.ftm,.htm) + 3)增加<#def>语句,表<#var>类似用于定义变量,但<#def>会优先从include中执行 + 4)修改${}原名_Apply,修改为_Echo,调用并显示结果,意思更清晰 +V1.2.2.R2017010101版本: + 1)配合fadfox.jar调整HashMap为FHashMapSO + 2)增加return,break,continue的支持,其中function支持<#return "result"/>带结果,template结果会强制转为字符串,for支持break,continue + 3)修改TemplateVariable为支持传入variableMap和contextMap数组(原功能写死只支持requestVariableMap和contextVariableMap) + 4)增加<#break> <#return>和<#continue>,完善了function,for,和if语句 + 5)增加对类属性的支持,如variable.property时,如果variable是变量会判断是否有属性[property],但优先级低于本身[variable.property]是一个变量 + 6)调整对类全称的支持,如com.zhiqim.fadfox.bootstrap.Global.get(Abc.class),会把(com.zhiqim.fadfox.bootstrap.Global)作为类名,为后续引入<#import>作准备 + 7)增加Java.util和java.lang一些常用类,如String,List等作了全称和别名的配置,以使支持<#var abc = new ArrayList()/>常用类的写法 + 8)删除AnStatic的支持,增加当变量是类时,先暂存变量结构到_Variable中,在碰到_Method,_Property时支持读取静态变量/常量和调用静态方法, + 1、如${FadfoxConstants.F_NAME}是支持的 + 2、如@{System.out.println("abc")}也支持 + 9)调整和TemplateNotice接口,统一把Map通知,以前是逐个通知,不利于刷新整个变量表 + 10)修改_Interceptor拦截后成异常的BUG + 11)增加pattern的设置的支持,以前固定为["*.ftml",*.htm,*.ftm] + 12)修改process(OutputStream out)时不主动out.flush(),由业务自己触发,否则会引起chuncked +V1.3.0.R2017022701版本: + 1)增加Templates.format(ftml)方法,格式化后不显示代码,而显示字符串 + 2)增加_Format语句(#{})支持,对${}的结果进行格式化,相当于${Templates.format(value)} +V1.3.1.R2017052801 + 1)修改Asserts.asserts为Asserts.as()方法,使用三目运算断言,防止断言为真时需要初始化无意义的断言失败字符串 + 2)增加双点号支持括号 +V1.3.2.R2017080501 + 1)修改<#for>的遍历,原为Collection,改为Iterable,扩大遍历范围 + 2)修改<#function>,原在include时有效,修改为当前模板都有效 + 3)修改变量表定义为FLinkedHashMapSV,原来是HashMap,没有顺序 + 4)修改#{},格式化增加对\',\"处理成'" +V1.3.3.R2017110601 + 1)解决<#for>里面注释<#---->的BUG +V1.4.0.R2018010101 + 1)正式启用ZhiqimML名称,原所有Fadfox改为Zhiqim,原所有fadfox改为zhiqim,原所有FADFOX改为ZHIQIM + 2)增加支持自定义的TemplateLoader的子类,如数据库的模板方式 + 3)调整模板查找方式为倒序查找 + 4)支持三目运算?: + 5)解决三个系统(Windows,Linux,Mac)对\r\n的处理上的不同导致的BUG + 6)增加_Method对前面的_New进行检查,如果是_New,则优先组合成构造函数,比后面的_Dot操作优先级高 + 7)修改模板未找到时响应FileNotFoundException,原来显示不正确 + 8)删除对@AnNew的自动newInstance的支持,改成要求前缀new,如new Selector(),而不能直接使用Selector + 9)修改Template为ZML,统一使用ZML代替模板 + 10)增加ZmlVarRuntime类,以支持变量运行时实时调用build生成结果 + 11)增加对ZmlVarRuntime在_Method中检查,得到build结果 + 12)增加三目运算对null的判断为false(采用js的判断方式,有利于该字段未定义表示false) +V1.4.1.R2018072501 + 1)修改Timer为Every,使用ZhiqimKernelV1.4.1.R2018072501版本 + 2)修改比较大于时double使用了longValue()方法导致的BUG +V1.5.0.R2019010101 + 1)替换为zhiqim_zml名称 + 2)替换zhiqim_kernel_v1.5.0_r2019010101的库 + 3)修改Every为Interval,删除Tasker改为实现Task等修改 + 4)执行程序和源码分开打包 \ No newline at end of file diff --git a/zhiqim_zml/lib/zhiqim.jar b/zhiqim_zml/lib/zhiqim.jar new file mode 100644 index 0000000..3ddac43 Binary files /dev/null and b/zhiqim_zml/lib/zhiqim.jar differ diff --git a/zhiqim_zml/libsrc/zhiqim-src.jar b/zhiqim_zml/libsrc/zhiqim-src.jar new file mode 100644 index 0000000..08461ed Binary files /dev/null and b/zhiqim_zml/libsrc/zhiqim-src.jar differ diff --git a/zhiqim_zml/resource/echo.zml b/zhiqim_zml/resource/echo.zml new file mode 100644 index 0000000..7b49911 --- /dev/null +++ b/zhiqim_zml/resource/echo.zml @@ -0,0 +1,69 @@ + + + +${name} + + + ${name} + ${Styles.src("/service/res/fadfox_2016100801.css")} + ${Scripts.src("/service/res/fadfox_2016100801.min.js")} + ${Styles.htmlOverflowHidden()} + <#var abc="abc"/> + @{name} + <#-- dd --> + <#-- + dd + --> + + + + + + + + +
              +
              + + + + + + + + + + + + + + + + +
              ${name}
              登录名: + autocomplete="off">   + checked>  记住用户名 +
              密   码: + autocomplete="off">   + checked/>  记住密码 +
              +
              +
              + + diff --git a/zhiqim_zml/resource/for.zml b/zhiqim_zml/resource/for.zml new file mode 100644 index 0000000..bf156e3 --- /dev/null +++ b/zhiqim_zml/resource/for.zml @@ -0,0 +1,20 @@ + + + <#for it : list> + <#for item : it> + 双循环开始 ${item} 双循环结束 + + + + ${Styles.htmlOverflowHidden()} + ${name} + ${Styles.htmlOverflowHidden()} + <#for item : list1> + as ${item} sd + + + +<#for item : list1>as ${item} sd 最后加数据 + +<#for item : list1>as ${item} sd + diff --git a/zhiqim_zml/resource/function.zml b/zhiqim_zml/resource/function.zml new file mode 100644 index 0000000..abfbb2f --- /dev/null +++ b/zhiqim_zml/resource/function.zml @@ -0,0 +1,86 @@ +<#var list = new FArrayListS()/> +@{list.add("11111")} +@{list.add("222222")} + +<#function showList(list)> + +<#for item : list> +${showChild(item)} + +
              + + +<#function showChild(item)> + + ${item} + + + + + +${name} + + + ${name} + ${Styles.src("/service/res/fadfox_2016100801.css")} + ${Scripts.src("/service/res/fadfox_2016100801.min.js")} + ${Styles.htmlOverflowHidden()} + <#function abc()> + dass + dddf + + +${abc()} + + ${abc()}333 + +${showList()} + + + + +
              +
              + + + + + + + + + + + + + + + + +
              ${name}
              登录名: + autocomplete="off">   + checked>  记住用户名 +
              密   码: + autocomplete="off">   + checked/>  记住密码 +
              +
              +
              + + diff --git a/zhiqim_zml/resource/if.zml b/zhiqim_zml/resource/if.zml new file mode 100644 index 0000000..4f1eec0 --- /dev/null +++ b/zhiqim_zml/resource/if.zml @@ -0,0 +1,39 @@ + + <#if hasAutoComplete>${hasAutoComplete} + <#if status == 1>${status}<#elseif status == 2>${status} + <#else>${status} + <#if type == 1>${type}<#elseif type == 2>${type}<#else>${type} + + ${Styles.htmlOverflowHidden()} + ${name} + ${Styles.htmlOverflowHidden()} + <#if !hasAutoComplete> + ${hasAutoComplete} + + + <#if hasAutoComplete> + ${hasAutoComplete} + + + <#if hasAutoComplete> + ${hasAutoComplete} + <#else> + ${hasAutoComplete} + + + <#if status == 1> + ${status} + <#elseif status == 2> + ${status} + <#else> + ${status} + + + <#if type == 1> + ${type} + <#elseif type == 2> + ${type} + <#else> + ${type} + + \ No newline at end of file diff --git a/zhiqim_zml/resource/include.zml b/zhiqim_zml/resource/include.zml new file mode 100644 index 0000000..4af269d --- /dev/null +++ b/zhiqim_zml/resource/include.zml @@ -0,0 +1 @@ +<#include "/include_include.ftml"/> \ No newline at end of file diff --git a/zhiqim_zml/resource/include_include.zml b/zhiqim_zml/resource/include_include.zml new file mode 100644 index 0000000..5e78d79 --- /dev/null +++ b/zhiqim_zml/resource/include_include.zml @@ -0,0 +1,13 @@ +<#var a="a"/> + + + +凡狐管理控制台 + + + ${Styles.bodyNoBackground()} + + + + + \ No newline at end of file diff --git a/zhiqim_zml/resource/one.zml b/zhiqim_zml/resource/one.zml new file mode 100644 index 0000000..ef0adab --- /dev/null +++ b/zhiqim_zml/resource/one.zml @@ -0,0 +1 @@ +${false?"a":true?"b":"c"} \ No newline at end of file diff --git a/zhiqim_zml/resource/var.zml b/zhiqim_zml/resource/var.zml new file mode 100644 index 0000000..f5f2bed --- /dev/null +++ b/zhiqim_zml/resource/var.zml @@ -0,0 +1,3 @@ +<#var ins = new ArrayListS().instance() /> +<#var var = TestVar /> +${var} \ No newline at end of file diff --git a/zhiqim_zml/resource/xml.xml b/zhiqim_zml/resource/xml.xml new file mode 100644 index 0000000..3e9f27c --- /dev/null +++ b/zhiqim_zml/resource/xml.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/zhiqim_zml/src/org/zhiqim/zml/Expression.java b/zhiqim_zml/src/org/zhiqim/zml/Expression.java new file mode 100644 index 0000000..0938d70 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/Expression.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; +import org.zhiqim.zml.expression.Primitive; + +/** + * 表达式基类

              + * + * @see Operator 运算符表达式
              + * @see Primitive 对象原型表达式
              + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface Expression extends ZmlConstants +{ + /** + * 强制子类实现toString方法 + * + * @return 表达式原型字符串 + */ + public String toString(); + + /** + * 强制子类提供表达式类型,方便switch + * + * @return 表达式int类型 + */ + public int getType(); + + /** + * 根据变量列表生成结果值 + * + * @param variableMap 变量表 + * @return 结果值 + * @throws ExpressionException 可能的表达式异常 + */ + public Object build(ZmlVariable variableMap) throws ExpressionException; +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/ExpressionPair.java b/zhiqim_zml/src/org/zhiqim/zml/ExpressionPair.java new file mode 100644 index 0000000..6173df8 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/ExpressionPair.java @@ -0,0 +1,48 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import org.zhiqim.zml.expression.symbol._Ampersand; +import org.zhiqim.zml.expression.symbol._Dot; +import org.zhiqim.zml.expression.symbol._Equal; +import org.zhiqim.zml.expression.symbol._Exclamation; +import org.zhiqim.zml.expression.symbol._VerticalBar; + +/** + * 定义需要配对标点符号接口,共5个 + * + * @see _Ampersand 连接符&,由&&组成逻辑与_And + * @see _VerticalBar 竖杠符|,由||组成逻辑或_Or + * @see _Dot 点号符.,由..组成整数数组_IntegerArray + * @see _Equal 等号符=,由==组成恒等_EqualEqual + * @see _Exclamation 感叹号!,由!=组成不等_EqualNot + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface ExpressionPair +{ + /** 是否已配对 */ + public boolean isPaired(); + + /** 设置已配对 */ + public void setPaired(); +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/ExpressionParser.java b/zhiqim_zml/src/org/zhiqim/zml/ExpressionParser.java new file mode 100644 index 0000000..1b6aba8 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/ExpressionParser.java @@ -0,0 +1,1679 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import java.util.ArrayList; +import java.util.ListIterator; + +import org.zhiqim.kernel.util.Types; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; +import org.zhiqim.zml.expression.Primitive; +import org.zhiqim.zml.expression.operator._Add; +import org.zhiqim.zml.expression.operator._And; +import org.zhiqim.zml.expression.operator._Bracket; +import org.zhiqim.zml.expression.operator._Division; +import org.zhiqim.zml.expression.operator._EqualEqual; +import org.zhiqim.zml.expression.operator._EqualNot; +import org.zhiqim.zml.expression.operator._GreateThen; +import org.zhiqim.zml.expression.operator._GreateThenEqual; +import org.zhiqim.zml.expression.operator._Indexable; +import org.zhiqim.zml.expression.operator._IntegerArray; +import org.zhiqim.zml.expression.operator._LessThen; +import org.zhiqim.zml.expression.operator._LessThenEqual; +import org.zhiqim.zml.expression.operator._Method; +import org.zhiqim.zml.expression.operator._Modulus; +import org.zhiqim.zml.expression.operator._Multiplication; +import org.zhiqim.zml.expression.operator._Negative; +import org.zhiqim.zml.expression.operator._New; +import org.zhiqim.zml.expression.operator._Not; +import org.zhiqim.zml.expression.operator._Or; +import org.zhiqim.zml.expression.operator._Subtraction; +import org.zhiqim.zml.expression.operator._Ternary; +import org.zhiqim.zml.expression.primitive._Boolean; +import org.zhiqim.zml.expression.primitive._Char; +import org.zhiqim.zml.expression.primitive._Class; +import org.zhiqim.zml.expression.primitive._Decimal; +import org.zhiqim.zml.expression.primitive._Integer; +import org.zhiqim.zml.expression.primitive._Null; +import org.zhiqim.zml.expression.primitive._String; +import org.zhiqim.zml.expression.primitive._Variable; +import org.zhiqim.zml.expression.symbol._Ampersand; +import org.zhiqim.zml.expression.symbol._Asterisk; +import org.zhiqim.zml.expression.symbol._CloseBracket; +import org.zhiqim.zml.expression.symbol._CloseParenthesis; +import org.zhiqim.zml.expression.symbol._Colon; +import org.zhiqim.zml.expression.symbol._Comma; +import org.zhiqim.zml.expression.symbol._Dot; +import org.zhiqim.zml.expression.symbol._DotDot; +import org.zhiqim.zml.expression.symbol._Equal; +import org.zhiqim.zml.expression.symbol._Exclamation; +import org.zhiqim.zml.expression.symbol._Gt; +import org.zhiqim.zml.expression.symbol._Gte; +import org.zhiqim.zml.expression.symbol._Inequal; +import org.zhiqim.zml.expression.symbol._Lt; +import org.zhiqim.zml.expression.symbol._Lte; +import org.zhiqim.zml.expression.symbol._Minus; +import org.zhiqim.zml.expression.symbol._OpenBracket; +import org.zhiqim.zml.expression.symbol._OpenParenthesis; +import org.zhiqim.zml.expression.symbol._Percent; +import org.zhiqim.zml.expression.symbol._Plus; +import org.zhiqim.zml.expression.symbol._Question; +import org.zhiqim.zml.expression.symbol._Slash; +import org.zhiqim.zml.expression.symbol._VerticalBar; + +/** + * 表达式基类

              + * + * @see Operator 运算符表达式
              + * @see Primitive 对象原型表达式
              + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ExpressionParser implements ZmlConstants +{ + /** + * 完整解析表达式,由字符串解析成最后一个表达式 + * + * @param expression 表达式语句 + * @return 表达式对象 + * @throws ExpressionException 可能产生的异常 + */ + public static Expression parseExpression(String expression) throws ExpressionException + { + //第一步,找到_String原型,并去除多余的空格 + ArrayList list = ExpressionParser.parse_String(expression); + + //第二步,找到_Char原型 + for (ListIterator it=list.listIterator();it.hasNext();) + { + Object obj = it.next(); + if (!(obj instanceof String)) + continue; + + it.remove(); + ArrayList charList = ExpressionParser.parse_Char((String)obj); + for (Object value : charList) + it.add(value); + } + + //第三步,找到_Numberic原型,并检查有没有不支持的字符 + for (ListIterator it=list.listIterator();it.hasNext();) + { + Object obj = it.next(); + if (!(obj instanceof String)) + continue; + + it.remove(); + ArrayList charList = ExpressionParser.parse_Numberic((String)obj); + for (Object value : charList) + it.add(value); + } + + //第四步,找到_Variable原型,包括_Null,_Boolean,_Gt,_Gte,_Lt,_Lte + for (ListIterator it=list.listIterator();it.hasNext();) + { + Object obj = it.next(); + if (!(obj instanceof String)) + continue; + + it.remove(); + ArrayList charList = ExpressionParser.parse_Variable((String)obj); + for (Object value : charList) + it.add(value); + } + + //第五步,对符号进行检查,生成子表达式列表 + ArrayList eList = ExpressionParser.parse_Symbol(list); + + //第六步,开始按优先级解析操作符,进行合并,最终表达式 + parse_Operator(eList); + + //第七步,最后,判断是否有效并得到最终表达式 + if (eList.size() > 1) + throw new ExpressionException("存在无法处理的表达式"); + + Expression _expression = eList.get(0); + eList.clear();eList = null;list.clear();list = null; + + return _expression; + } + + /** + * 解析操作符表达式,并合并成最终一个表达式 + * + * @param eList 解析标点符号之后的表达式列表 + * @throws ExpressionException 可能产生的异常 + */ + public static void parse_Operator(ArrayList eList) throws ExpressionException + {//第六步,开始按优先级解析操作符,进行合并,最终表达式 + if (eList.size() <= 1) + return; + + //6.1括号,并拆分出括号表达式和方法表达式,和对_Variable中可能是方法名进行替换,得到未设置目标对象的方法表达式 + parse_Bracket(eList); + if (eList.size() <= 1) + return; + + //6.2方括号,把方括号转为未设置目标对应的可索引表达式 + parse_BracketSquare(eList); + if (eList.size() <= 1) + return; + + //6.3点号对应的方法和小数、双点号对应的整数数组、方括号对应的可索引表达式 + parse_DotIndexable(eList); + + //6.4双点号 + parse_DotDot(eList); + if (eList.size() <= 1) + return; + + //6.5感叹号 + parse_Not(eList); + if (eList.size() <= 1) + return; + + //6.6取负号 + parse_Negative(eList); + if (eList.size() <= 1) + return; + + //6.7new + parse_New(eList); + if (eList.size() <= 1) + return; + + //6.8乘除模表达式 + parse_MuliplicationDivisionModulus(eList); + if (eList.size() <= 1) + return; + + //6.9加减表达式 + parse_AddSubtraction(eList); + if (eList.size() <= 1) + return; + + //6.10大于小于/大等于/小等于表达式 + parse_GtGteLtLte(eList); + if (eList.size() <= 1) + return; + + //6.11恒等不等表达式 + parse_EqualEqualNot(eList); + if (eList.size() <= 1) + return; + + //6.12逻辑与表达式 + parse_AndOr(eList, CONNECTOR); + if (eList.size() <= 1) + return; + + //6.13逻辑或表达式 + parse_AndOr(eList, VERTICAL); + if (eList.size() <= 1) + return; + + //6.14三目运算 + parse_Ternary(eList); + } + + /** + * 解析三目运算表达式 + * + * @param eList 表达式列表 + * @throws ExpressionException 表达式异常 + */ + public static void parse_Ternary(ArrayList eList) throws ExpressionException + {//从右到左 + boolean isDoLoop = false; + for (int i=eList.size()-1;i>=0;i--) + { + Expression expression = eList.get(i); + if (expression.getType() != COLON) + continue; + + if (i == eList.size()-1 || i < 2)//?a:b + throw new ExpressionException(COLON+"格式不正确,前面或后面无内容"); + + Expression colon = eList.get(i-2); + if (colon.getType() != QUESTION) + throw new ExpressionException(COLON+"格式不正确,前面没找到符号(?)"); + + Expression condition = eList.get(i-3); + Expression first = eList.get(i-1); + Expression second = eList.get(i+1); + + Expression _tarnary = new _Ternary(condition, first, second); + eList.remove(i);//当前 : + eList.remove(i);//NEXT b + eList.remove(i-1);//PREV a + eList.remove(i-2);//PREV2 ? + eList.remove(i-3);//PREV3 c + eList.add(i-3, _tarnary);//加入当前 + isDoLoop = true; + break; + } + + if (isDoLoop) + parse_Ternary(eList); + + eList.trimToSize(); + } + + /** + * 解析逻辑与/逻辑或表达式 + * + * @param eList 表达式列表 + * @param oprType 表达式类型 CONNECTOR | VERTICAL + * @throws ExpressionException 除号格式不正确 + */ + public static void parse_AndOr(ArrayList eList, int oprType) throws ExpressionException + { + boolean isDoLoop = false; + for (int i=0;i eList) throws ExpressionException + { + boolean isDoLoop = false; + for (int i=0;i eList) throws ExpressionException + { + boolean isDoLoop = false; + for (int i=0;i eList) throws ExpressionException + { + boolean isDoLoop = false; + for (int i=0;i eList) throws ExpressionException + { + boolean isDoLoop = false; + for (int i=0;i eList) throws ExpressionException + { + boolean isDoLoop = false; + for (int i=0;i eList) throws ExpressionException + { + boolean isDoLoop = false; + for (int i=0;i 0) + { + Expression last = eList.get(i-1); + int type = last.getType(); + if (type != CONNECTOR && type != VERTICAL && type != EQUAL && type != INEQUAL) + continue;//取负,前面有内容时仅支持(&&、|| == !=)四种情况,如果不是则认为是减号,不处理,等减号时再处理 + } + + Expression next = eList.get(i+1); + int type = next.getType(); + if (type != NUMBERIC && type != DECIMAL && type != VARIABLE && type != BRACKET && type != METHOD && type != INDEXABLE) + continue;//取负,只支持整数、小数和括号、变量和方法、属性六种,前三种为数值,后三种为对象 + + _Negative _negative = new _Negative(next); + eList.remove(i);//当前 + eList.remove(i);//NEXT + eList.add(i, _negative);//加入当前 + isDoLoop = true; + break; + } + + if (isDoLoop) + parse_Negative(eList); + + eList.trimToSize(); + } + + /** + * 解析感叹号,取反表达式 + * + * @param eList 表达式列表 + * @throws ExpressionException 感叹号格式不正确 + */ + public static void parse_Not(ArrayList eList) throws ExpressionException + { + boolean isDoLoop = false; + for (int i=0;i 0) + { + Expression last = eList.get(i-1); + if (last.getType() != CONNECTOR && last.getType() != VERTICAL) + throw new ExpressionException("感叹号格式不正确,前面有内容时仅支持&&、||两种情况"); + } + + Expression nextExpression = eList.get(i+1); + _Not _not = new _Not(nextExpression); + eList.remove(i);//当前 + eList.remove(i);//NEXT + eList.add(i, _not);//加入当前 + isDoLoop = true; + break; + } + + if (isDoLoop) + parse_Not(eList); + + eList.trimToSize(); + } + + /** + * 解析双点号,整型数组表达式 + * + * @param eList 表达式列表 + * @throws ExpressionException 除号格式不正确 + */ + public static void parse_DotDot(ArrayList eList) throws ExpressionException + { + boolean isDoLoop = false; + for (int i=0;i eList, int i) throws ExpressionException + { + if (i == 0 || i == eList.size()-1) + throw new ExpressionException("点号格式不正确,前面或后面无内容"); + + //找到_Dot,有两种情况1、_Numberic,2、_Method + Expression last = eList.get(i-1); + Expression nextExpression = eList.get(i+1); + if (last.getType() == NUMBERIC) + {//前面是整数 + if (nextExpression.getType() != NUMBERIC)//要求后面也是整数 + throw new ExpressionException("点号格式不正确,不是正确的小数类型"); + + _Integer lastInteger = (_Integer)last; + _Integer nextInteger = (_Integer)nextExpression; + _Decimal _double = new _Decimal(lastInteger.toString()+"."+nextInteger.toString()); + eList.remove(i);//当前 + eList.remove(i);//NEXT + eList.remove(i-1);//LAST + eList.add(i-1, _double);//加入当前 + } + else if (last.getType() == VARIABLE) + {//前面是变量 + if (nextExpression.getType() == METHOD) + {//后面要求是方法,对象或方法并到后面的方法中 + _Method _method = (_Method)nextExpression; + _method.setObject(last); + eList.remove(i);//当前 + eList.remove(i-1);//LAST + } + else if (nextExpression.getType() == VARIABLE) + {//后面也是变量,则认为是含点号的变量或包名,如rmi.secret或org.zhiqim.kernel.Global,注意属性请使用rmi["secret"] + _Variable _last = (_Variable)last; + _Variable _next = (_Variable)nextExpression; + _next.setValue(_last.getValue()+"."+_next.getValue()); + eList.remove(i);//当前 + eList.remove(i-1);//LAST + } + else if (nextExpression.getType() == CLASS) + {//后面是类,则认为是包名,如org.zhiqim.kernel.Global.class + _Variable _last = (_Variable)last; + _Class _next = (_Class)nextExpression; + _next.setValue(_last.getValue()+"."+_next.getValue()); + eList.remove(i);//当前 + eList.remove(i-1);//LAST + } + else + {//其他的不支持 + throw new ExpressionException("点号格式不正确,不是正确的方法F.类型"); + } + + } + else if (last.getType() == METHOD || last.getType() == INDEXABLE) + {//前面是方法或属性 + if (nextExpression.getType() == METHOD) + {//后面要求是方法,对象或方法并到后面的方法中 + _Method _method = (_Method)nextExpression; + _method.setObject(last); + eList.remove(i);//当前 + eList.remove(i-1);//LAST + } + else + {//其他的不支持 + throw new ExpressionException("点号格式不正确,不是正确的方法类型"); + } + } + else + {//不支持的类型 + throw new ExpressionException("点号格式不正确,不是正确的方法类型或小数类型"); + } + + eList.trimToSize(); + return true; + } + + /** + * 解析点号对应的小数、方法,方括号对应的属性,以及双点号对应的整数数组 + * + * @param eList 表达式列表 + * @throws ExpressionException 点号格式不正确 + */ + public static void parse_DotIndexable(ArrayList eList) throws ExpressionException + { + boolean isDoLoop = false; + for (int i=0;i eList, int i) throws ExpressionException + { + Expression expression = eList.get(i); + _Indexable _indexKey = (_Indexable)expression; + if (_indexKey.hasObject()) + return false;//已有索引目标对象不重新循环处理 + + if (i == 0) + {//前面没有 + throw new ExpressionException("解析方括号时,前面没有要求的格式"); + } + + Expression last = eList.get(i-1); + if (last.getType() != BRACKET && last.getType() != VARIABLE && last.getType() != STRING && last.getType() != METHOD && last.getType() != INDEXABLE) + {//前面不是括号,变量,字符串,整数数组,方法,属性有问题 + if (last.getType() == NUMBERIC) + throw new ExpressionException("解析方括号时,如果前面是整数数组如1..3,请使用括号(1..3)"); + else + throw new ExpressionException("解析方括号时,前面不是要求的格式"); + } + + //把上一个作为方括号的目标对象,找到退出再找 + _indexKey.setObject(last); + _indexKey.parseBracketSquare(); + eList.remove(i-1);//LAST + return true; + } + + + /** + * 解析左右方括号,成方括号表达式 + * + * @param eList 原型表达式 + * @throws ExpressionException 括号未成对出现 + */ + public static void parse_BracketSquare(ArrayList eList) throws ExpressionException + { + int num = 0;_Indexable _bracket = null; + for (ListIterator it=eList.listIterator();it.hasNext();) + { + Expression expression = it.next(); + if (expression.getType() == BRACKET_SQUARE_LEFT) + {//左方括号 + num++; + it.remove(); + if (num == 1) + {//开始 + _bracket = null; + _bracket = new _Indexable(); + it.add(_bracket); + } + + _bracket.addExpression(expression); + } + else if (expression.getType() == BRACKET_SQUARE_RIGHT) + {//右方括号 + num--; + it.remove(); + _bracket.addExpression(expression); + } + else + {//其他表达式 + if (num > 0) + {//如果在方括号中,删除该节点,加入到括号中 + it.remove(); + _bracket.addExpression(expression); + } + } + } + + if (num > 0) + throw new ExpressionException("方括号[]未成对出现"); + + eList.trimToSize(); + } + + /** + * 解析左右括号,成括号表达式 + * + * @param eList 原型表达式 + * @throws ExpressionException 括号未成对出现 + */ + public static void parse_Bracket(ArrayList eList) throws ExpressionException + { + int num = 0;_Bracket _bracket = null; + for (ListIterator it=eList.listIterator();it.hasNext();) + { + Expression expression = it.next(); + if (expression.getType() == BRACKET_LEFT) + {//左括号 + num++; + it.remove(); + if (num == 1) + {//开始 + _bracket = null; + _bracket = new _Bracket(); + it.add(_bracket); + } + + _bracket.addExpression(expression); + } + else if (expression.getType() == BRACKET_RIGHT) + {//右括号 + num--; + it.remove(); + _bracket.addExpression(expression); + } + else + {//其他表达式 + if (num > 0) + {//如果在括号中,删除该节点,加入到括号中 + it.remove(); + _bracket.addExpression(expression); + } + } + } + + if (num > 0) + throw new ExpressionException("括号()未成对出现"); + + //判断是否前面是 _Variable,如果是则该括号是_Method + boolean isDoLoop = true; + while(isDoLoop) + { + isDoLoop = false; + for (int i=0;i= 2 && eList.get(i-2).getType() == NEW) + { + _method.setObject(eList.get(i-2)); + eList.remove(i-1);//当前 + eList.remove(i-2);//_New + eList.add(i-2, _method);//加入当前 + } + + isDoLoop = true; + break; + } + } + + for (Expression expression : eList) + { + if (expression.getType() != BRACKET) + continue; + + ((_Bracket)expression).parseBracket(); + } + + eList.trimToSize(); + } + + /** + * 根据操作符整理成由原型表达式组成的表达式 + * + * @param list 原型表达式和操作符混合的表达式列表 + * @return 全部原型表达式列表 + * @throws ExpressionException 不支持的字符格式 + */ + public static ArrayList parse_Symbol(ArrayList list) throws ExpressionException + { + ArrayList eList = new ArrayList(); + for (Object obj : list) + { + if (!(obj instanceof String)) + { + Expression expression = (Expression)obj; + eList.add(expression); + continue; + } + + //检查操作符 + String str = ((String)obj).trim(); + if (Validates.isEmpty(str)) + continue; + + //当前支持的操作符 + for (int i=0;i parse_Variable(String expression) throws ExpressionException + { + ArrayList expList = new ArrayList();char lastChar = 0; + boolean isVariableString = false;StringBuilder strb = new StringBuilder(); + for (int i=0;i 0) + { + expList.add(strb.toString()); + } + + strb = null; + strb = new StringBuilder(); + } + + strb.append(c); + lastChar = c; + } + + if (isVariableString) + expList.add(buildNameValue(strb.toString())); + else + expList.add(strb.toString()); + + strb = null; + expList.trimToSize(); + return expList; + } + + /** + * 对表达式中的整型进行解析 + * + * @param expression 原表达式 + * @return 返回由_Integer和字符串表组成的列表 + * @throws ExpressionException 字符串结束符不匹配 + */ + public static ArrayList parse_Numberic(String expression) throws ExpressionException + { + ArrayList expList = new ArrayList();char lastChar = 0; + boolean isInteger = false;StringBuilder strb = new StringBuilder(); + for (int i=0;i '9') + {//不是数字 + if (isExpressionSeparator(c)) + {//如果是分隔符 + if (isInteger) + { + expList.add(new _Integer(strb.toString())); + strb = null; + strb = new StringBuilder(); + strb.append(c); + lastChar = c; + isInteger = false; + continue; + } + } + + //不是分隔符,或者是分隔符但以前不是整数 + strb.append(c); + lastChar = c; + continue; + } + + //是数字 + if (isInteger) + {//还是数字 + strb.append(c); + lastChar = c; + continue; + } + + if (lastChar == 0) + {//第一个字符是变量字符 + isInteger = true; + strb.append(c); + lastChar = c; + continue; + } + + if (isExpressionSeparator(lastChar)) + {//上一个是分隔符,当前是数字,置为数字,结束上一次字符串 + isInteger = true; + if (strb.length() > 0) + { + expList.add(strb.toString()); + } + + strb = null; + strb = new StringBuilder(); + } + + strb.append(c); + lastChar = c; + } + + if (isInteger) + expList.add(new _Integer(strb.toString())); + else if (strb.length() > 0) + expList.add(strb.toString()); + + strb = null; + expList.trimToSize(); + return expList; + } + + /** + * 对表达式中的字符进行解析 + * + * @param expression 原表达式 + * @return 返回由_Char和字符串表组成的列表 + * @throws ExpressionException 字符串结束符不匹配 + */ + public static ArrayList parse_Char(String expression) throws ExpressionException + { + ArrayList expList = new ArrayList();char lastChar = 0; + boolean isChar = false;StringBuilder strb = new StringBuilder(); + for (int i=0;i 0) + { + expList.add(strb.toString()); + strb = null; + strb = new StringBuilder(); + strb.append(c); + } + } + else + { + //在字符中,如果前面是转义符,则认为是字符为需转义的字符 + if (lastChar == '\\') + { + strb.append(c); + } + else + { + //字符串内遇到下一个双引号,且前面不是转议符,则认为该字符串结束 + strb.append(c); + expList.add(new _Char(strb.toString())); + strb = null; + strb = new StringBuilder(); + isChar = false; + } + } + + lastChar = c; + } + + if (isChar) + throw new ExpressionException("字符结束符不匹配"); + + if (strb.length() > 0) + { + expList.add(strb.toString()); + strb = null; + } + + expList.trimToSize(); + return expList; + } + + /** + * 对表达式中的字符串进行解析 + * + * @param expression 原表达式 + * @return 返回由_String和字符串表组成的列表 + * @throws ExpressionException 字符串结束符不匹配 + */ + public static ArrayList parse_String(String expression) throws ExpressionException + { + ArrayList expList = new ArrayList();char lastChar = 0; + boolean isString = false;StringBuilder strb = new StringBuilder(); + for (int i=0;i 0) + { + expList.add(strb.toString()); + } + + strb = null; + strb = new StringBuilder(); + strb.append(c);//第一个双引号加入 + } + else + { + //在字符串中,如果前面是转义符,则认为是字符串中的双引号 + if (lastChar == '\\') + { + strb.append(c); + } + else + { + //字符串内遇到下一个双引号,且前面不是转议符,则认为该字符串结束 + strb.append(c); + expList.add(new _String(strb.toString())); + strb = null; + strb = new StringBuilder(); + isString = false; + } + } + + lastChar = c; + } + + if (isString) + throw new ExpressionException("字符串结束符不匹配"); + + if (strb.length() > 0) + { + expList.add(strb.toString()); + strb = null; + } + + expList.trimToSize(); + return expList; + } + + /** + * 判断字符是否是表达式分隔符 + * + * @param c 要求判断的字符 + * @return =true表示是/=false表示否 + */ + public static boolean isExpressionSeparator(char c) + { + return (c == ' '//前面是空格的情况,如${ 1 + 3 }, 1 gt 3 + || c == ','//前面是逗号的情况,如${abc.getValue(1,3)} + || c == '(' || c == ')'//如(1+3) + || c == '[' || c == ']'//如[1] + || c == '.'//如1.1 + || c == '!'//如!item.isSuccess() + || c == '-' || c == '+' || c == '*' || c == '/' || c == '%'//四则运算 + || c == '&' || c == '|'//如 item.isSuccess()&&item.isFailure(), item.isSuccess()||item.isFailure() + || c == '?' || c == ':'//三目运算 + || c == '='//如 1!=2,3==4 + //gt,gte,lt,lte这些两边要求空格 + ); + } + + /** + * 判断是字符是否是变量字符 + * + * @param c 要求判断的字符 + * @return =true表示是/=false表示否 + */ + public static boolean isVariableChar(char c) + { + return (c == '_' || (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')); + } + + /** + * 判断字符是表达式支持的字符 + * + * @param c 要求判断的字符 + * @return =true表示是/=false表示否 + */ + public static boolean isValidChar(char c) + { + if (isVariableChar(c)) + return true; + + if (isExpressionSeparator(c)) + return true; + + if (c == '\"' || c == '\'') + return true; + + return false; + } + + /** + * 根据名称的值创建对象的表达式原型 + * + * @param value 名称对称的值 + * @return 原型表达式对象 + */ + private static Expression buildNameValue(String value) + { + if ("true".equals(value) || "false".equals(value)) + return new _Boolean(Boolean.parseBoolean(value)); + else if ("null".equals(value)) + return new _Null(); + else if ("gt".equals(value)) + return new _Gt(); + else if ("gte".equals(value)) + return new _Gte(); + else if ("lt".equals(value)) + return new _Lt(); + else if ("lte".equals(value)) + return new _Lte(); + else if ("class".equals(value)) + return new _Class(value); + else if ("new".equals(value)) + return new _New(); + else + return new _Variable(value); + } + + /** + * 去除表达式中多余的空格,有利于分析表达式 + * + * @param expression 表达式 + * @return 去除空格后的表达式 + * @throws ExpressionException + */ + public static String replaceBlank(String expression) + { + StringBuilder strb = new StringBuilder(); + boolean isString = false;char lastChar = 0; + for (int i=0;i 0; + } + else if ((!Types.isNumber(privous) && !Types.isChar(privous)) + || (!Types.isNumber(next) && !Types.isChar(next))) + {//不是整数和小数 + throw new ExpressionException(typeDesc+"表达式{"+expression+"},格式不正确,出现值不是数值型和字符串"); + } + else + { + if (Types.isInteger(privous)) + {//整数 + long num1 = ((Number)privous).longValue(); + if (Types.isInteger(next)) + { + long num2 = ((Number)next).longValue(); + switch (expression.getType()) + { + case GTHEN:return num1 > num2; + case GTEQUAL:return num1 >= num2; + case LTHEN:return num1 < num2; + case LTEQUAL:return num1 <= num2; + } + } + else if (Types.isDecimal(next)) + { + double num2 = ((Number)next).doubleValue(); + switch (expression.getType()) + { + case GTHEN:return num1 > num2; + case GTEQUAL:return num1 >= num2; + case LTHEN:return num1 < num2; + case LTEQUAL:return num1 <= num2; + } + } + else + { + char num2 = (Character)next; + switch (expression.getType()) + { + case GTHEN:return num1 > num2; + case GTEQUAL:return num1 >= num2; + case LTHEN:return num1 < num2; + case LTEQUAL:return num1 <= num2; + } + } + } + else if (Types.isDecimal(privous)) + {//小数 + double num1 = ((Number)privous).doubleValue(); + if (Types.isInteger(next)) + { + long num2 = ((Number)next).longValue(); + switch (expression.getType()) + { + case GTHEN:return num1 > num2; + case GTEQUAL:return num1 >= num2; + case LTHEN:return num1 < num2; + case LTEQUAL:return num1 <= num2; + } + } + else if (Types.isDecimal(next)) + { + double num2 = ((Number)next).doubleValue(); + switch (expression.getType()) + { + case GTHEN:return num1 > num2; + case GTEQUAL:return num1 >= num2; + case LTHEN:return num1 < num2; + case LTEQUAL:return num1 <= num2; + } + } + else + { + char num2 = (Character)next; + switch (expression.getType()) + { + case GTHEN:return num1 > num2; + case GTEQUAL:return num1 >= num2; + case LTHEN:return num1 < num2; + case LTEQUAL:return num1 <= num2; + } + } + } + else + {//字符 + char num1 = (Character)privous; + if (Types.isInteger(next)) + { + long num2 = ((Number)next).longValue(); + switch (expression.getType()) + { + case GTHEN:return num1 > num2; + case GTEQUAL:return num1 >= num2; + case LTHEN:return num1 < num2; + case LTEQUAL:return num1 <= num2; + } + } + else if (Types.isDecimal(next)) + { + double num2 = ((Number)next).doubleValue(); + switch (expression.getType()) + { + case GTHEN:return num1 > num2; + case GTEQUAL:return num1 >= num2; + case LTHEN:return num1 < num2; + case LTEQUAL:return num1 <= num2; + } + } + else + { + char num2 = (Character)next; + switch (expression.getType()) + { + case GTHEN:return num1 > num2; + case GTEQUAL:return num1 >= num2; + case LTHEN:return num1 < num2; + case LTEQUAL:return num1 <= num2; + } + } + } + } + + throw new ExpressionException("不支持的表达式"); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/Statement.java b/zhiqim_zml/src/org/zhiqim/zml/Statement.java new file mode 100644 index 0000000..96bb4e0 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/Statement.java @@ -0,0 +1,298 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import java.util.Comparator; +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.exception.StatementException; +import org.zhiqim.zml.statement._Echo; +import org.zhiqim.zml.statement._For; +import org.zhiqim.zml.statement._Function; +import org.zhiqim.zml.statement._If; +import org.zhiqim.zml.statement._Include; +import org.zhiqim.zml.statement._Var; + +/** + * 定义ZhiqimML语句接口,有两类语句 + * + * 1、嵌套语句 + * @see _If 判断语句,格式为:<#if a=1>内容1<#elseif a==2>内容2<#elseif a==3>内容3<#else>其他内容<#if> + * @see _For 迭代语句,格式为:<#for item : list> + * @see _Function 全局函数定义语句,格式为:<#function name(param1, param2)> + * + * 2、非嵌套语句 + * @see _Text 纯文本语句 + * @see _Var 变量定义语句,格式为:<#var i=1/> + * @see _Echo 表达式语句,格式为:${obj.getName()} + * @see _Include 包含语句,本身不嵌套,调用后转到父ZML进行嵌套处理,格式为<#include "/zview/include.zml"/> + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class Statement implements ZmlConstants, SignConstants +{ + public static final StatementComparator COMPARATOR = new StatementComparator(); + + private Zml zml; + private StatementNesting parent; + + private String statement; + private int beginLine; + private int beginColumn; + private int endLine; + private int endColumn; + + private int beginIndex; + private int endIndex; + + private int innerBeginIndex; + private int innerEndIndex; + + /**************************************************************************/ + //定义抽象方法,子类必须实现 + /**************************************************************************/ + + /** + * 是否是嵌套语句 + * + * @return =true表示是,=false表示不是 + */ + public abstract boolean isNesting(); + + /** + * 由各子类实现解析语句成不同的表达式 + * + * @throws StatementException + */ + public abstract void parseStatement() throws StatementException; + + /** + * 由各子类实现生成HTML代码 + * + * @param variableMap 变量表 + * @return HTML内容 + * @throws StatementException + */ + public abstract String process(ZmlVariable variableMap) throws StatementException; + + /**************************************************************************/ + //父类定义的通用方法 + /**************************************************************************/ + + /** + * 本基类保存语句基本参数,语句由子类解析 + * + * @param zml ZML对象 + * @param parent 父语句对象 + * @param statement 语句 + */ + public void setStatement(Zml zml, StatementNesting parent, String statement) + { + this.zml = zml; + this.parent = parent; + this.statement = statement; + } + + /** + * 本基类保存语句基本参数,语句由子类解析 + * + * @param beginIndex 起始索引 + * @param endIndex 结束索引 + */ + public void setIndexAll(int beginIndex, int endIndex) + { + this.beginIndex = beginIndex; + this.endIndex = endIndex; + + int[] begins = StatementParser.getLineColumnNoByIndex(zml.getIndexList(), beginIndex); + int[] ends = StatementParser.getLineColumnNoByIndex(zml.getIndexList(), endIndex); + this.beginLine = begins[0]; + this.beginColumn = begins[1]; + this.endLine = ends[0]; + this.endColumn = ends[1]; + } + + /** + * 本基类保存语句基本参数,语句由子类解析 + * + * @param innerBeginIndex 内部起始索引 + * @param innerEndIndex 内部结束索引 + */ + public void setIndexInner(int innerBeginIndex, int innerEndIndex) + { + this.innerBeginIndex = innerBeginIndex; + this.innerEndIndex = innerEndIndex; + } + + /** + * 是否语句指令独占一行 + * + * @return =true表示是,=false表示不是 + */ + public boolean isExclusiveLine() throws StatementException + { + //1.先比前面,查看指令前面是否是空白 + if (beginColumn > 1) + {//前面有字符不是空白的,认为不是独占一行 + String content = parent.getPrevStatement(this); + if (content != null) + { + if (content.length() < beginColumn-1) + return false;//嵌套里前面的语句未顶格 + + String previous = content.substring(content.length()-(beginColumn-1)); + if (!Validates.isEmptyBlank(previous)) + return false; + } + } + + //2.再比后面,查看指令结束之后是否为空或是换行符 + if (beginLine == endLine) + {//在同一行查看结束是不是回车换行 + return isEndBreak(); + } + else + {//不在同一行直接返回true,由子类解析语句后设置 + return true; + } + } + + /** + * 是否语句结束后被换行 + * + * @return =true表示被换行或结束,=false表示未被换行,后面有数据 + */ + public boolean isEndBreak() throws StatementException + { + String content = parent.getNextStatement(this); + return (content == null || content.startsWith("\r") || content.startsWith("\n")); + } + + /** + * 获取嵌套的_For语句,用于break,continue + * + * @return =null表示 + */ + public _For getNearestNestingFor() + { + if (this instanceof _For) + return (_For)this; + + StatementNesting sp = parent; + while (sp != null) + { + if (sp instanceof _For) + return (_For)sp; + + if (sp instanceof Zml) + return null; + + sp = ((Statement)sp).parent; + } + + return null; + } + + /**************************************************************************/ + //父类定义的获取参数方法 + /**************************************************************************/ + + /** 获取ZML */ + public Zml getZml() + { + return zml; + } + + /** 获取ZML路径 */ + public String getPath() + { + return getZml().getPath(); + } + + /** 获取ZML索引表 */ + public List getIndexList() + { + return zml.getIndexList(); + } + + public String getStatement() + { + return statement; + } + + public int getBeginIndex() + { + return beginIndex; + } + + public int getEndIndex() + { + return endIndex; + } + + public int getBeginLine() + { + return beginLine; + } + + public int getBeginColumn() + { + return beginColumn; + } + + public int getEndLine() + { + return endLine; + } + + public int getEndColumn() + { + return endColumn; + } + + public int getInnerBeginIndex() + { + return innerBeginIndex; + } + + public int getInnerEndIndex() + { + return innerEndIndex; + } + + @Override + public String toString() + { + return statement; + } + + /** 语句比较器 */ + private static class StatementComparator implements Comparator + { + @Override + public int compare(Statement o1, Statement o2) + { + return o1.getBeginIndex() - o2.getBeginIndex(); + } + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/StatementNesting.java b/zhiqim_zml/src/org/zhiqim/zml/StatementNesting.java new file mode 100644 index 0000000..85e7364 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/StatementNesting.java @@ -0,0 +1,91 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.zml.exception.StatementException; +import org.zhiqim.zml.statement._For; +import org.zhiqim.zml.statement._Function; +import org.zhiqim.zml.statement._If; + +/** + * ZML和嵌套语句解析接口,在解析时需实现该接口 + * @see Zml ZML本身支持嵌套,内部有_If,_For或者_Function语句 + * @see _If 判断语句内部会嵌套_If,_For + * @see _For 循环语句内部会嵌套_If,_For + * @see _Function 全局函数定义语句内部会嵌套_If,_For和_Function + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface StatementNesting extends ZmlConstants, SignConstants +{ + /** + * 获取语句中对应的ZML + * + * @return ZML + */ + public Zml getZml(); + + /** + * 获取对应ZML的路径 + * + * @return String + */ + public String getPath(); + + /** + * 获取ZML中的行列索引表 + * + * @return List + */ + public List getIndexList(); + + /** + * 获取需要处理的ZML或语句内容 + * + * @return String + */ + public String getContent(); + + /** + * 获取语句/ZML内容对应ZML起始索引号 + * + * @return int + */ + public int getContentBeginIndex(); + + /** + * 获取上一个语句内容 + * + * @param stmt 当前语句 + */ + public String getPrevStatement(Statement stmt) throws StatementException; + + /** + * 获取下一个语句内容 + * + * @param stmt 当前语句 + */ + public String getNextStatement(Statement stmt) throws StatementException; +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/StatementParser.java b/zhiqim_zml/src/org/zhiqim/zml/StatementParser.java new file mode 100644 index 0000000..d09327e --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/StatementParser.java @@ -0,0 +1,653 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.StringTokenizer; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.exception.StatementException; +import org.zhiqim.zml.statement._Break; +import org.zhiqim.zml.statement._Call; +import org.zhiqim.zml.statement._Comment; +import org.zhiqim.zml.statement._Continue; +import org.zhiqim.zml.statement._Define; +import org.zhiqim.zml.statement._Echo; +import org.zhiqim.zml.statement._For; +import org.zhiqim.zml.statement._Format; +import org.zhiqim.zml.statement._Function; +import org.zhiqim.zml.statement._If; +import org.zhiqim.zml.statement._Include; +import org.zhiqim.zml.statement._Interceptor; +import org.zhiqim.zml.statement._Return; +import org.zhiqim.zml.statement._Text; +import org.zhiqim.zml.statement._Var; + +/** + * 语句解析静态类 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class StatementParser implements ZmlConstants, SignConstants +{ + /** + * 解析全局定义文件,得到函数列表 + * + * @param zml 全局定义文件 + * @param _functionList 函数列表 + * @param _varList 变量列表 + * @param _includeList 包含列表 + * @throws StatementException 语句异常 + */ + public static void parseContextZml(Zml zml, List<_Function> _functionList, List<_Var> _varList, List<_Include> _includeList) throws StatementException + { + List<_Function> functionList = getStatementOutLineAndNesting(zml, _Function.class, FUNCTION, FUNCTION_BEGIN, FUNCTION_END); + List<_Comment> commentList = getStatementOutLineAndNesting(zml, _Comment.class, COMMENT, COMMENT_BEGIN, COMMENT_END); + + List<_Var> varList = getStatementListInLine(zml, _Var.class, VAR, VAR_BEGIN, VAR_END); + List<_Include> includeList = getStatementListInLine(zml, _Include.class, INCLUDE, INCLUDE_BEGIN, INCLUDE_END); + + for (Iterator<_Function> it=functionList.iterator();it.hasNext();) + { + _Function _function = it.next(); + if (isInCommentStatement(_function, commentList)) + {//_function在comment中,则删除该function + it.remove(); + } + } + + for (Iterator<_Var> it=varList.iterator();it.hasNext();) + { + _Var _var = it.next(); + if (isInFunctionStatement(_var, functionList) || isInCommentStatement(_var, commentList)) + {//_var在function或comment里,则删除该var + it.remove(); + } + } + + for (Iterator<_Include> it=includeList.iterator();it.hasNext();) + { + _Include _include = it.next(); + if (isInFunctionStatement(_include, functionList) || isInCommentStatement(_include, commentList)) + {//_include在function或comment则删除该<#include> + it.remove(); + } + } + + _functionList.addAll(functionList); + _varList.addAll(varList); + _includeList.addAll(includeList); + } + + /** + * 解析ZML中的第一层的嵌套,得到嵌套列表,第一层以下的嵌套的在第一层嵌套中递归处理 + * + * @param nesting 嵌套ZML或嵌套语句 + * @return 得到第一层的嵌套列表 + * @throws StatementException 语句异常 + */ + public static List parseStatementNesting(StatementNesting nesting) throws StatementException + { + //第一步,得到除_Text外的所有语句 + List<_Function> functionList = getStatementOutLineAndNesting(nesting, _Function.class, FUNCTION, FUNCTION_BEGIN, FUNCTION_END); + List<_For> forList = getStatementOutLineAndNesting(nesting, _For.class, FOR, FOR_BEGIN, FOR_END); + List<_If> ifList = getStatementOutLineAndNesting(nesting, _If.class, IF, IF_BEGIN, IF_END); + List<_Comment> commentList = getStatementOutLineAndNesting(nesting, _Comment.class, COMMENT, COMMENT_BEGIN, COMMENT_END); + + List<_Include> includeList = getStatementListInLine(nesting, _Include.class, INCLUDE, INCLUDE_BEGIN, INCLUDE_END); + List<_Interceptor> interceptorList = getStatementListInLine(nesting, _Interceptor.class, INTERCEPTOR, INTERCEPTOR_BEGIN, INTERCEPTOR_END); + List<_Var> varList = getStatementListInLine(nesting, _Var.class, VAR, VAR_BEGIN, VAR_END); + List<_Define> defList = getStatementListInLine(nesting, _Define.class, DEF, DEF_BEGIN, DEF_END); + List<_Echo> echoList = getStatementListInLine(nesting, _Echo.class, ECHO, ECHO_BEGIN, ECHO_END); + List<_Format> formatList = getStatementListInLine(nesting, _Format.class, FORMAT, FORMAT_BEGIN, FORMAT_END); + List<_Call> callList = getStatementListInLine(nesting, _Call.class, CALL, CALL_BEGIN, CALL_END); + List<_Return> returnList = getStatementListInLine(nesting, _Return.class, RETURN, RETURN_BEGIN, RETURN_END); + List<_Break> breakList = getStatementListInLine(nesting, _Break.class, BREAK, BREAK_BEGIN, BREAK_END); + List<_Continue> continueList = getStatementListInLine(nesting, _Continue.class, CONTINUE, CONTINUE_BEGIN, CONTINUE_END); + + //第二步,去掉孙语句,得到ZML的第一层子语句 + for (Iterator<_Return> it=returnList.iterator();it.hasNext();) + { + _Return _return = it.next(); + if (isInFunctionStatement(_return, functionList) || isInForStatement(_return, forList) || isInIfStatement(_return, ifList) || isInCommentStatement(_return, commentList)) + {//_return在function,for,if或comment则删除该<#include> + it.remove(); + } + } + + for (Iterator<_Break> it=breakList.iterator();it.hasNext();) + { + _Break _break = it.next(); + if (isInFunctionStatement(_break, functionList) || isInForStatement(_break, forList) || isInIfStatement(_break, ifList) || isInCommentStatement(_break, commentList)) + {//_break在function,for,if或comment则删除该<#include> + it.remove(); + } + } + + for (Iterator<_Continue> it=continueList.iterator();it.hasNext();) + { + _Continue _continue = it.next(); + if (isInFunctionStatement(_continue, functionList) || isInForStatement(_continue, forList) || isInIfStatement(_continue, ifList) || isInCommentStatement(_continue, commentList)) + {//_include在function,for,if或comment则删除该<#include> + it.remove(); + } + } + + for (Iterator<_Include> it=includeList.iterator();it.hasNext();) + { + _Include _include = it.next(); + if (isInFunctionStatement(_include, functionList) || isInForStatement(_include, forList) || isInIfStatement(_include, ifList) || isInCommentStatement(_include, commentList)) + {//_include在function,for,if或comment则删除该<#include> + it.remove(); + } + } + + for (Iterator<_Var> it=varList.iterator();it.hasNext();) + { + _Var _var = it.next(); + if (isInFunctionStatement(_var, functionList) || isInForStatement(_var, forList) || isInIfStatement(_var, ifList) || isInCommentStatement(_var, commentList)) + {//_var在function,for,if或comment里,则删除该var + it.remove(); + } + } + + for (Iterator<_Define> it=defList.iterator();it.hasNext();) + { + _Define _def = it.next(); + if (isInFunctionStatement(_def, functionList) || isInForStatement(_def, forList) || isInIfStatement(_def, ifList) || isInCommentStatement(_def, commentList)) + {//_def在function,for,if或comment里,则删除该var + it.remove(); + } + } + + for (Iterator<_Echo> it=echoList.iterator();it.hasNext();) + { + _Echo _echo = it.next(); + if (isInFunctionStatement(_echo, functionList) || isInForStatement(_echo, forList) || isInIfStatement(_echo, ifList) || isInCommentStatement(_echo, commentList)) + {//_echo在function,for,if或comment里,则删除该${} + it.remove(); + } + } + + for (Iterator<_Format> it=formatList.iterator();it.hasNext();) + { + _Format _format = it.next(); + if (isInFunctionStatement(_format, functionList) || isInForStatement(_format, forList) || isInIfStatement(_format, ifList) || isInCommentStatement(_format, commentList)) + {//_format在function,for,if或comment里,则删除该#{} + it.remove(); + } + } + + for (Iterator<_Call> it=callList.iterator();it.hasNext();) + { + _Call _call = it.next(); + if (isInFunctionStatement(_call, functionList) || isInForStatement(_call, forList) || isInIfStatement(_call, ifList) || isInCommentStatement(_call, commentList)) + {//_call在function,for,if或comment里,则删除该@{} + it.remove(); + } + } + + for (Iterator<_Function> it=functionList.iterator();it.hasNext();) + { + _Function _function = it.next(); + if (isInIfStatement(_function, ifList) || isInForStatement(_function, forList) || isInCommentStatement(_function, commentList)) + {//_function在if,for或comment中,则删除该function + it.remove(); + } + } + + for (Iterator<_If> it=ifList.iterator();it.hasNext();) + { + _If _if = it.next(); + if (isInFunctionStatement(_if, functionList) || isInForStatement(_if, forList) || isInCommentStatement(_if, commentList)) + {//_if在function,for或comment中,则删除该if + it.remove(); + } + } + + for (Iterator<_For> it=forList.iterator();it.hasNext();) + { + _For _for = it.next(); + if (isInFunctionStatement(_for, functionList) || isInIfStatement(_for, ifList) || isInCommentStatement(_for, commentList)) + {//_for在function,if或comment中,则删除该for + it.remove(); + } + } + + //第三步,把<#for>、<#if>、<#include>、<#var>和${}整理到一个列表中,并把未在列表中的,使用_Text加入填充 + ArrayList statementList = new ArrayList(); + statementList.addAll(functionList); + statementList.addAll(forList); + statementList.addAll(ifList); + statementList.addAll(commentList); + statementList.addAll(includeList); + statementList.addAll(interceptorList); + statementList.addAll(varList); + statementList.addAll(defList); + statementList.addAll(echoList); + statementList.addAll(formatList); + statementList.addAll(callList); + statementList.addAll(returnList); + statementList.addAll(breakList); + statementList.addAll(continueList); + statementList.trimToSize(); + Collections.sort(statementList, Statement.COMPARATOR); + + //把未在语句中的HTML转化成_Text补全到语句列表中 + if (statementList.isEmpty()) + {//如果没有一条语句,则全是html + String content = nesting.getContent(); + _Text _txt = new _Text(); + _txt.setStatement(nesting.getZml(), nesting, content); + _txt.setIndexInner(0, content.length()); + _txt.setIndexAll(nesting.getContentBeginIndex(), nesting.getContentBeginIndex() + content.length()); + + List tsList = new ArrayList(1); + tsList.add(_txt); + return tsList; + } + else + { + ArrayList tsList = new ArrayList(statementList.size()*2); + + //第一个 + String content = nesting.getContent(); + Statement lastTs = statementList.get(0); + if (lastTs.getBeginIndex() > 0) + { + String statement = content.substring(0, lastTs.getInnerBeginIndex()); + if (!Validates.isEmpty(statement)) + { + _Text _txt = new _Text(); + _txt.setStatement(nesting.getZml(), nesting, statement); + _txt.setIndexInner(0, lastTs.getInnerBeginIndex()); + _txt.setIndexAll(nesting.getContentBeginIndex(), nesting.getContentBeginIndex() + lastTs.getInnerBeginIndex()); + + tsList.add(_txt); + } + } + tsList.add(lastTs); + + //中间的 + for (int i=1;i lastTs.getEndIndex()) + { + String statement = content.substring(lastTs.getInnerEndIndex(), ts.getInnerBeginIndex()); + if (!Validates.isEmpty(statement)) + { + _Text _txt = new _Text(); + _txt.setStatement(nesting.getZml(), nesting, statement); + _txt.setIndexInner(lastTs.getInnerEndIndex(), ts.getInnerBeginIndex()); + _txt.setIndexAll(nesting.getContentBeginIndex() + lastTs.getInnerEndIndex(), nesting.getContentBeginIndex() + ts.getInnerBeginIndex()); + + tsList.add(_txt); + } + } + + tsList.add(ts); + lastTs = ts; + } + + //最后一个 + if (lastTs.getInnerEndIndex() < content.length()) + { + String statement = content.substring(lastTs.getInnerEndIndex(), content.length()); + if (!Validates.isEmpty(statement)) + { + _Text _txt = new _Text(); + _txt.setStatement(nesting.getZml(), nesting, statement); + _txt.setIndexInner(lastTs.getInnerEndIndex(), content.length()); + _txt.setIndexAll(nesting.getContentBeginIndex() + lastTs.getInnerEndIndex(), nesting.getContentBeginIndex() + content.length()); + + tsList.add(_txt); + } + } + + tsList.trimToSize(); + return tsList; + } + } + + /** + * 获取指定语句类型,且语句类型一行不能表达的语句,且可能存在嵌套的语句列表 + * + * @see _If 判断语句,里面可能还有判断,如<#if a = "a"><#if b = "b">bb + * @see _For 循环语句,里面可能还有循环,如<#for item : list><#for sub : item.list()>${sub} + * + * @param nesting 嵌套ZML对象或嵌套语句,Zml,_Include,_If,_For,_Function等 + * @param cls 语句类 + * @param name 语句名称 + * @param begin 语句起始标志 + * @param end 语句结束标志 + * @return 得到嵌套语句列表,如_If,_For + * @throws StatementException 语句异常 + */ + public static List getStatementOutLineAndNesting(StatementNesting nesting, Class cls, String name, String begin, String end) throws StatementException + { + String content = nesting.getContent(); + List indexList = nesting.getIndexList(); + + int indBegin = 0, indEnd = 0; + ArrayList statementList = new ArrayList(); + while(true) + { + indBegin = content.indexOf(begin, indEnd); + if (indBegin == -1) + break; + + int indBeginTemp = indBegin;int indNest = indBegin; + while(true) + { + int indEndTemp = content.indexOf(end, indBeginTemp); + if (indEndTemp == -1) + { + int[] begins = getLineColumnNoByIndex(indexList, indBegin + nesting.getContentBeginIndex()); + throw new StatementException(nesting.getPath(), begins[0], begins[1], "检查"+name+"时未找到"+end+"结尾"); + } + + //查看下一个开始是否嵌套 + indNest = content.indexOf(begin, indNest+begin.length()); + if (indNest == -1 || indNest > indEndTemp) + {//未找到下一个开始或下一个对在结束之后,表示没有嵌套 + indEnd = indEndTemp + end.length(); + break; + } + else + {//找到了,并且小于结束,则该开始和结束成对,是嵌套,那么设置开始为结束之后继续查找 + indBeginTemp = indEndTemp + end.length(); + } + } + + String statement = content.substring(indBegin, indEnd); + T obj = Classes.newInstance(cls); + Statement stmt = (Statement)obj; + stmt.setStatement(nesting.getZml(), nesting, statement); + stmt.setIndexInner(indBegin, indEnd); + stmt.setIndexAll(nesting.getContentBeginIndex() + indBegin, nesting.getContentBeginIndex() + indEnd); + stmt.parseStatement(); + statementList.add(obj); + } + + return statementList; + } + + /** + * 获取指定语句类型,且语句类型一行即可表达的语句列表 + * + * @see _Echo 表达式语句,格式如:${obj.getName()} + * @see _Var 变量语句,格式如:<#var abc="ddd"/> + * @see _Include 包含语句,格式如:<#include "/zview/include.zml"/> + * + * @param nesting 嵌套ZML对象或嵌套语句,Zml,_Include,_Interceptor,_If,_For,_Function等 + * @param cls 语句类 + * @param name 语句名称 + * @param begin 语句起始标志 + * @param end 语句结束标志 + * @return 得到非嵌套语句列表 + * @throws StatementException 语句异常 + */ + public static List getStatementListInLine(StatementNesting nesting, Class cls, String name, String begin, String end) throws StatementException + { + String content = nesting.getContent(); + List indexList = nesting.getIndexList(); + + int indBegin = 0, indEnd = 0; + ArrayList list = new ArrayList(); + while(true) + { + indBegin = content.indexOf(begin, indEnd); + if (indBegin == -1) + break; + + indEnd = content.indexOf(end, indBegin); + if (indEnd == -1) + { + int[] begins = getLineColumnNoByIndex(indexList, indBegin + nesting.getContentBeginIndex()); + throw new StatementException(nesting.getPath(), begins[0], begins[1], "检查"+name+"时未找到"+end+"结尾"); + } + + indEnd = indEnd + end.length(); + int[] begins = getLineColumnNoByIndex(indexList, indBegin + nesting.getContentBeginIndex()); + int[] ends = getLineColumnNoByIndex(indexList, indEnd + nesting.getContentBeginIndex()); + if (begins[0] != ends[0]) + throw new StatementException(nesting.getPath(), begins[0], begins[1], "检查"+name+"时找到"+end+"不在同一行"); + + String statement = content.substring(indBegin, indEnd); + T obj = Classes.newInstance(cls); + Statement stmt = (Statement)obj; + stmt.setStatement(nesting.getZml(), nesting, statement); + stmt.setIndexInner(indBegin, indEnd); + stmt.setIndexAll(nesting.getContentBeginIndex() + indBegin, nesting.getContentBeginIndex() + indEnd); + stmt.parseStatement(); + list.add(obj); + } + + list.trimToSize(); + return list; + } + + /** + * 指定内容,得到每行的起始和结尾在内容的总索引位置列表 + * + * @param content 需要指定的内容 + * @return List 行索引号列表 + */ + public static List getIndexList(String content) + { + int index = 0, lineNo = 0; + ArrayList indexList = new ArrayList(); + StringTokenizer tokener = new StringTokenizer(content, _BR_, true); + while(tokener.hasMoreTokens()) + {//注意转化为第一行开始 + String line = tokener.nextToken(); + if (_LN_.equals(line) || _LR_.equals(line)) + {//空行不加入 + index++; + continue; + } + + lineNo++; + ZmlLineIndex lineIndex = new ZmlLineIndex(); + lineIndex.setLineNo(lineNo); + lineIndex.setBeginIndex(index); + + index += line.length(); + lineIndex.setEndIndex(index); + indexList.add(lineIndex); + } + + indexList.trimToSize(); + return indexList; + } + + /** + * 指定行索引号列表和索引号,取得该索引号对应的行列号 + * + * @param indexList 行索引列表 + * @param index 当前行号 + * @return 得到当前行号对应的行列号 + */ + public static int[] getLineColumnNoByIndex(List indexList, int index) + { + int lineNo = -1,columnNo = -1; + for (ZmlLineIndex lineIndex : indexList) + { + lineNo = lineIndex.getLineNo(index); + if (lineNo == -1) + continue; + + columnNo = lineIndex.getColumnNo(index); + break; + } + + return new int[]{lineNo, columnNo}; + } + + /** 是否其语语句嵌套在<#if>语句中 */ + public static boolean isInFunctionStatement(Statement ts, List<_Function> functionList) + { + for (_Function _function : functionList) + { + if (ts.getBeginIndex() <= _function.getBeginIndex()) + continue;//<#var>在<#function之前 + + if (ts.getEndIndex() >= _function.getEndIndex()) + continue;//<#var>在之后 + + //<#var>在<#function之间 + return true; + } + + return false; + } + + /** 是否其语语句嵌套在<#if>语句中 */ + public static boolean isInIfStatement(Statement ts, List<_If> ifList) + { + for (_If _if : ifList) + { + if (ts.getBeginIndex() <= _if.getBeginIndex()) + continue;//ts在<#if之前 + + if (ts.getEndIndex() >= _if.getEndIndex()) + continue;//ts在之后 + + //ts在<#if>在之间 + return true; + } + + return false; + } + + /** 是否其语语句嵌套在<#for>语句中 */ + public static boolean isInForStatement(Statement ts, List<_For> forList) + { + for (_For _for : forList) + { + if (ts.getBeginIndex() < _for.getBeginIndex()) + continue;//ts在<#for之前 + + if (ts.getEndIndex() > _for.getEndIndex()) + continue;//ts在之后 + + //ts在<#for>在之间 + return true; + } + + return false; + } + + /** 是否其语语句嵌套在<#---->语句中 */ + public static boolean isInCommentStatement(Statement ts, List<_Comment> commentList) + { + for (_Comment _comment : commentList) + { + if (ts.getBeginIndex() <= _comment.getBeginIndex()) + continue;//<#var>在<#--之前 + + if (ts.getEndIndex() >= _comment.getEndIndex()) + continue;//<#var>在-->之后 + + //<#var>在<#-->之间 + return true; + } + + return false; + } + + /** 判断是否含有定义变量语句 */ + public static boolean hasVar(List stList) + { + for (Statement st : stList) + { + if (st instanceof _Var) + return true; + } + return false; + } + + public static void processStatementList(List statementList, ZmlVariable variableMap, StringBuilder strb) throws StatementException + { + Statement last = null; + for (Statement stmt : statementList) + { + if (stmt instanceof _Return) + {//处理return,可能是返回值 + last = stmt; + throw new _Return.ReturnException(((_Return)stmt).build(variableMap)); + } + else if (stmt instanceof _Break) + {//处理break; + last = stmt; + _For _for = stmt.getNearestNestingFor(); + if (_for != null) + {//找到嵌套的_For抛异常到_For处理,跳过中间的所有环节 + throw new _Break.BreakException(); + } + } + else if (stmt instanceof _Continue) + {//处理continue; + last = stmt; + _For _for = stmt.getNearestNestingFor(); + if (_for != null) + {//找到嵌套的_For抛异常到_For处理,跳过中间的所有环节 + throw new _Continue.ContinueException(); + } + } + else + {//正常语句 + String text = stmt.process(variableMap); + if (Validates.isEmpty(text)) + {//为null和为空不写入,如_Var,或者结果是空字符串 + if (stmt.isExclusiveLine()) + {//如果是独占一行,则删除独占行 + Strings.removeRightMaybeEmptyBlankLine(strb); + } + } + else + { + if (stmt.isNesting() && stmt.isExclusiveLine()) + {//删除独占行前的空白,如_For,_If,保留\r\n + Strings.removeRightMaybeEmptyBlank(strb); + } + + if ((stmt instanceof _Text) && strb.length() == 0 && last != null && last.isExclusiveLine()) + {//首行文本时,检查前面是否有独占行的语句,有则删除多余的第一个\r\n + text = Strings.trimLeftOneBR(text); + } + + strb.append(text); + } + + last = stmt; + } + } + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/Zml.java b/zhiqim_zml/src/org/zhiqim/zml/Zml.java new file mode 100644 index 0000000..e7451a4 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/Zml.java @@ -0,0 +1,347 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.Writer; +import java.util.List; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.extend.MapS; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.zml.exception.StatementException; +import org.zhiqim.zml.statement._Define; +import org.zhiqim.zml.statement._Function; +import org.zhiqim.zml.statement._Include; +import org.zhiqim.zml.statement._Return.ReturnException; + +/** + * ZhiqimML主类 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class Zml implements StatementNesting, SignConstants +{ + private ZmlEngine engine; //ZML引擎 + private Zml parent; //父ZML,在<#include>中有用 + + // ZML三要素 + private String path; //ZML相对路径 + private long lastModified; //ZML最后修改时间 + private String content; //ZML内容 + + private boolean isParsed; //ZML是否已解析,在缓存中则不需要再解析 + private List stmtList; //ZML语句列表 + private List indexList; //ZML行索引 + + private long lastAccessed; //最后访问时间 + + /** + * 由业务创建ZML,加载当前内容生成ZML对象 + * + * @param content ZML内容 + */ + public Zml(String content) + { + this(null, null, 0, content); + } + + /** + * 由业务创建ZML,需传入内容和ZML引擎 + * + * @param engine ZML引擎 + * @param content ZML内容 + */ + public Zml(ZmlEngine engine, String content) + { + this(engine, null, 0, content); + } + + /** + * 由ZmlLoader 加载ZML字符串进行处理 + * + * @param engine ZML引擎 + * @param path ZML相对路径 + * @param lastModified ZML最后修改时间 + * @param content ZML内容 + */ + public Zml(ZmlEngine engine, String path, long lastModified, String content) + { + this.engine = engine; + this.path = path; + this.lastModified = lastModified; + this.content = content; + this.lastAccessed = System.currentTimeMillis(); + } + + /** 获取ZML索引列表 */ + public List getIndexList() + { + if (indexList != null) + return indexList; + + synchronized (this) + { + if (indexList == null) + indexList = StatementParser.getIndexList(content); + } + + return indexList; + } + + /** 解析ZML得到语句列表 */ + public void parse() throws StatementException + { + this.stmtList = StatementParser.parseStatementNesting(this); + + //解析完之后把内容置为NULL,因为这个占用内存比较大 + this.isParsed = true; + this.content = null; + } + + /** + * 输出到返回结果中 + * + * @param variableMap 指定的变量表,如_Include中调用 + * @return 输出的内容 + * @throws Exception 异常 + */ + public void define(ZmlVariable variableMap) throws StatementException + { + if (!isParsed) + {//没有解析,优先作解析,验证表达式和语句级是否有异常 + parse(); + } + + //把_Define的执行一遍 + for (Statement statement : stmtList) + { + if (statement instanceof _Define) + {//执行预定义 + ((_Define)statement).define(variableMap); + } + else if (statement instanceof _Include) + {//递归回调预定义 + ((_Include)statement).define(variableMap); + } + } + } + + /** + * 输出到返回结果中,在_Include中调用 + * + * @param variableMap 指定的变量表 + * @param parent 指定父ZML + * @return 输出的内容 + * @throws Exception 异常 + */ + public String process(ZmlVariable variableMap, Zml parent) throws StatementException + { + this.parent = parent; + return process(variableMap); + } + + /** + * 输出到字节流中,不会调用flush() + * + * @param pageVariableMap 全页变量表 + * @param contextVariableMap 上下文变量表 + * @param out 输出流 + * @param encoding 输出编码 + * @throws StatementException 可能产生的语句异常 + * @throws IOException 可能产生的IO异常 + */ + public void process(OutputStream out, String encoding, MapSO pageVariableMap, MapS... contextVariableMap) throws StatementException, IOException + { + ZmlVariable variableMap = new ZmlVariable(); + variableMap.setZml(this); + variableMap.setVariableMap(pageVariableMap); + variableMap.setContextMap(contextVariableMap); + + out.write(process(variableMap).getBytes(encoding)); + } + + /** + * 输出到字符流中,不会调用flush() + * + * @param pageVariableMap 全页变量表 + * @param contextVariableMap 上下文变量表 + * @param writer 字符流 + * @throws StatementException 可能产生的语句异常 + * @throws IOException 可能产生的IO异常 + */ + public void process(Writer writer, MapSO pageVariableMap, MapS... contextVariableMap) throws StatementException, IOException + { + ZmlVariable variableMap = new ZmlVariable(); + variableMap.setZml(this); + variableMap.setVariableMap(pageVariableMap); + variableMap.setContextMap(contextVariableMap); + + writer.write(process(variableMap)); + } + + + /** + * 输出到返回结果中 + * + * @param variableMap 指定的变量表,如_Include中调用 + * @return 输出的内容 + * @throws Exception 异常 + */ + private String process(ZmlVariable variableMap) throws StatementException + { + if (!isParsed) + {//没有解析,优先作解析,验证表达式和语句级是否有异常 + parse(); + } + + //1.优先把_Def的执行一遍 + define(variableMap); + + //2.循环执行语句 + StringBuilder strb = new StringBuilder(); + try + { + StatementParser.processStatementList(stmtList, variableMap, strb); + return strb.toString(); + } + catch(ReturnException e) + { + return e.hasValue()?String.valueOf(e.getValue()):strb.toString(); + } + } + + @Override + public String getPrevStatement(Statement stmt) throws StatementException + { + List statementList = getStatementList(); + int ind = statementList.indexOf(stmt); + if (ind <= 0) + return null; + + return statementList.get(ind-1).getStatement(); + } + + @Override + public String getNextStatement(Statement stmt) throws StatementException + { + List statementList = getStatementList(); + int ind = statementList.indexOf(stmt); + if (ind == -1 || ind >= statementList.size()-1) + return null; + + return statementList.get(ind+1).getStatement(); + } + + public ZmlEngine getEngine() + { + return engine; + } + + public List getStatementList() throws StatementException + { + if (!isParsed) + {//没有解析,优先作解析,验证表达式和语句级是否有异常 + parse(); + } + + return stmtList; + } + + public _Function getFunction(String name) throws StatementException + { + for (Statement stmt : getStatementList()) + { + if (!(stmt instanceof _Function)) + continue; + + _Function function = (_Function)stmt; + if (!function.getName().equals(name)) + continue; + + return function; + } + + return null; + } + + public boolean hasParent() + { + return parent != null; + } + + public String getPath() + { + return path; + } + + public long getLastModified() + { + return lastModified; + } + + public long getLastAccessed() + { + return lastAccessed; + } + + /** 获取ZML内容,当被解析之后内容将清空置为NULL */ + public String getContent() + { + return content; + } + + /** 允许设置最后修改时间 */ + public void setLastModified(long lastModified) + { + this.lastModified = lastModified; + } + + /** 允许设置内容 */ + public void setContent(String content) + { + this.content = content; + } + + /** 重新设置最后访问时间 */ + public void setLastAccessed() + { + this.lastAccessed = System.currentTimeMillis(); + } + + /**************************************************************/ + //定义ZML内容从0开始,通过方向获取自身,适配Statement + /**************************************************************/ + + @Override + public Zml getZml() + { + return this; + } + + @Override + public int getContentBeginIndex() + { + return 0; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/ZmlCache.java b/zhiqim_zml/src/org/zhiqim/zml/ZmlCache.java new file mode 100644 index 0000000..3a88145 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/ZmlCache.java @@ -0,0 +1,128 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import java.util.Iterator; + +import org.zhiqim.kernel.extend.HashMapSV; +import org.zhiqim.kernel.schedule.Interval; +import org.zhiqim.kernel.schedule.Task; + +/** + * ZML缓存 + * + * @version v1.0.0 @author zouzhigang 2017-11-21 新建与整理 + */ +public class ZmlCache implements Task +{ + private final HashMapSV cache = new HashMapSV<>(); + + private int maxIdleTime;//最长空闲时长,单位秒 + private int maxKeepTime;//最长保持时长,单位秒 + + public ZmlCache(int maxIdleTime, int maxKeepTime) + { + this.maxIdleTime = maxIdleTime; + this.maxKeepTime = maxKeepTime; + + //每15分钟检查一次 + Interval.shedule(this, 15 * 60 * 1000); + } + + public Zml get(String path) + { + synchronized (cache) + { + Zml zml = cache.get(path); + if (zml != null) + zml.setLastAccessed(); + + return zml; + } + } + + public void put(String path, Zml zml) + { + synchronized (cache) + { + if (cache.containsKey(path)) + cache.remove(path); + + cache.put(path, zml); + } + } + + public void remove(String path) + { + synchronized (cache) + { + cache.remove(path); + } + } + + @Override + public void execute() + { + boolean hasMaxIdleTime = maxIdleTime > 0; + boolean hasMaxKeepTime = maxKeepTime > 0; + + if (!hasMaxIdleTime && !hasMaxKeepTime) + return; + + long lastKeepTimeMs = System.currentTimeMillis() - maxKeepTime * 1000; + long lastIdleTimeMs = System.currentTimeMillis() - maxIdleTime * 1000; + + synchronized (cache) + { + for (Iterator it=cache.values().iterator();it.hasNext();) + { + Zml zml = it.next(); + long lastAccessed = zml.getLastAccessed(); + if ((hasMaxKeepTime && lastAccessed < lastKeepTimeMs) + || (hasMaxIdleTime && lastAccessed < lastIdleTimeMs)) + {//超时删除 + it.remove(); + } + } + } + } + + public int getMaxIdleTime() + { + return maxIdleTime; + } + + public int getMaxKeepTime() + { + return maxKeepTime; + } + + public void setMaxIdleTime(int maxIdleTime) + { + this.maxIdleTime = maxIdleTime; + } + + public void setMaxKeepTime(int maxKeepTime) + { + this.maxKeepTime = maxKeepTime; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/ZmlConstants.java b/zhiqim_zml/src/org/zhiqim/zml/ZmlConstants.java new file mode 100644 index 0000000..c478bc6 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/ZmlConstants.java @@ -0,0 +1,199 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import org.zhiqim.kernel.constants.CodeConstants; + +/** + * ZhiqimML常量定义 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface ZmlConstants extends CodeConstants +{ + /********************************************************************/ + //ZML文件缺省支持的模式 + /********************************************************************/ + + public static final String[] ZML_PATTERN_DEFAULT = {"*.zml", "*.htm"}; + + /********************************************************************/ + //ZML语句定义 + /********************************************************************/ + + public static final String TAG_END = ">"; + + //ZML语句 + public static final String ECHO = "${}"; + public static final String CALL = "@{}"; + public static final String FORMAT = "#{}"; + public static final String COMMENT = "<#---->"; + public static final String INCLUDE = "<#include>"; + public static final String INTERCEPTOR = "<#interceptor>"; + public static final String FUNCTION = "<#function>"; + public static final String VAR = "<#var>"; + public static final String DEF = "<#def>"; + public static final String IF = "<#if>"; + public static final String ELSEIF = "<#elseif>"; + public static final String FOR = "<#for>"; + public static final String RETURN = "<#return>"; + public static final String BREAK = "<#break/>"; + public static final String CONTINUE = "<#continue/>"; + + public static final String ECHO_BEGIN = "${"; + public static final String ECHO_END = "}"; + public static final String CALL_BEGIN = "@{"; + public static final String CALL_END = "}"; + public static final String FORMAT_BEGIN = "#{"; + public static final String FORMAT_END = "}"; + public static final String COMMENT_BEGIN = "<#--"; + public static final String COMMENT_END = "-->"; + public static final String INCLUDE_BEGIN = "<#include "; + public static final String INCLUDE_END = "/>"; + public static final String INTERCEPTOR_BEGIN = "<#interceptor "; + public static final String INTERCEPTOR_END = "/>"; + public static final String FUNCTION_BEGIN = "<#function "; + public static final String FUNCTION_END = ""; + public static final String VAR_BEGIN = "<#var "; + public static final String VAR_END = "/>"; + public static final String DEF_BEGIN = "<#def "; + public static final String DEF_END = "/>"; + public static final String IF_BEGIN = "<#if "; + public static final String IF_ELSEIF = "<#elseif "; + public static final String IF_ELSE = "<#else>"; + public static final String IF_END = ""; + public static final String FOR_BEGIN = "<#for "; + public static final String FOR_SEPARATOR = ":"; + public static final String FOR_END = ""; + public static final String RETURN_BEGIN = "<#return"; + public static final String RETURN_END = "/>"; + public static final String BREAK_BEGIN = "<#break"; + public static final String BREAK_END = "/>"; + public static final String CONTINUE_BEGIN = "<#continue"; + public static final String CONTINUE_END = "/>"; + + /********************************************************************/ + //ZML表达式定义 + /********************************************************************/ + + //原型-最基本 + public static final int NULL = 0;//null + public static final int STRING = 1;//字符串 + public static final int CHAR = 2;//字符 + public static final int NUMBERIC = 3;//整数(数值型,允许前面是0开头) + public static final int VARIABLE = 4;//变量 + public static final int BOOLEAN = 5;//布尔 + public static final int CLASS = 6;//类结构 + + //原型-扩展 + public static final int DECIMAL = 7;//小数 + + + //符号,从变量中转化 + public static final int GT = 11; + public static final int GTE = 12; + public static final int LT = 13; + public static final int LTE = 14; + + //符号,单标点13个 + public static final int BRACKET_LEFT = '(';//(40 + public static final int BRACKET_RIGHT = ')';//)41 + public static final int ASTERISK = '*';//*42 + + public static final int BRACKET_SQUARE_LEFT = '[';//[91 + public static final int BRACKET_SQUARE_RIGHT = ']';//]93 + + public static final int COMMA = ',';//,44 + public static final int DOT = '.';//.46 + public static final int EQUAL = '=';//=61 + public static final int EXCLAMATION = '!';//!33 + public static final int MINUS = '-';//-45 + public static final int PERCENT = '%';//%37 + public static final int PLUS = '+';//+43 + public static final int SLASH = '/';///47 + public static final int QUESTION = '?';//?63 + public static final int COLON = ':';//:58 + + //符号,双标点2个 + public static final int CONNECTOR = '&';//&&38 + public static final int VERTICAL = '|';//||124 + + //符号,标点扩展 + public static final int INEQUAL = 3361;//!= + public static final int DOTDOT = 4646;//.. + public static final int TERNARY = 6358;//?: + + //操作符 + public static final int BRACKET = 4041;//()括号 + + public static final int NEW = 110101119;//new,实例化newInstance + public static final int METHOD = 40410;//()0,方法 + public static final int PROPERTY = 460;//.0,属性 + public static final int INDEXABLE = 9193;//[],可索引对象(含数组索引、列表索引和MAP取值) + + + public static final int ADD = 430;//+0加法 + public static final int NEGATIVE = 451;//-1取负 + public static final int SUBTRACTION = 452;//-2减法 + public static final int MULTIPLICATION = 420;//*0乘法 + public static final int DIVISION = 470;///0除法 + public static final int MODULUS = 370;//%0取模 + + public static final int GTHEN = 110;//大于 + public static final int GTEQUAL = 120;//大于等于 + public static final int LTHEN = 130;//小于 + public static final int LTEQUAL = 140;//小于等于 + + public static final int EQUAL_EQUAL = 61610;//恒等 + public static final int EQUAL_NOT = 33610;//不等 + + public static final int AND = 3800;//逻辑与 + public static final int OR = 1240;//逻辑或 + public static final int NOT = 3300;//取反 + + public static final int INTEGER_ARR = 46460;//整型数组 + + //标点操作符 + public static final String _BRACKET_LEFT = "("; + public static final String _BRACKET_RIGHT = ")"; + public static final String _BRACKET_BOTH = "()"; + public static final String _ASTERISK = "*"; + + public static final String _BRACKET_SQUARE_LEFT = "["; + public static final String _BRACKET_SQUARE_RIGHT = "]"; + + public static final String _COMMA = ","; + public static final String _DOT = "."; + public static final String _CONNECTOR = "&&"; + public static final String _EQUAL = "="; + public static final String _EXCLAMATION = "!"; + public static final String _MINUS = "-"; + public static final String _PERCENT = "%"; + public static final String _PLUS = "+"; + public static final String _SLASH = "/"; + public static final String _VERTICAL = "|"; + + //标点扩展 + public static final String _DOTDOT = ".."; + public static final String _INEQUAL = "!="; + public static final String _EQUALEQUAL = "=="; +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/ZmlEngine.java b/zhiqim_zml/src/org/zhiqim/zml/ZmlEngine.java new file mode 100644 index 0000000..bf04900 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/ZmlEngine.java @@ -0,0 +1,684 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map.Entry; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.LinkedMapSV; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.zml.loader.ClassZmlLoader; +import org.zhiqim.zml.loader.FileZmlLoader; +import org.zhiqim.zml.statement._Function; +import org.zhiqim.zml.statement._Include; +import org.zhiqim.zml.statement._Var; + +/** + * ZhiqimML引擎主程序

              + * + * 1、设置引擎参数,如加载器、编码等
              + * 2、加载全局函数定义文件。
              + * 3、设置共享变量。
              + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZmlEngine extends ZmlPredefinded implements ZmlConstants +{ + //ZML引擎基本参数 + private ZmlVarNotice notice; + private String encoding; + private int maxIdleTime; + private int maxKeepTime; + private boolean isAscQuery; + private String[] patterns; + + //ZML引擎加载器和全局变量 + private ZmlLoader loader; + private final LinkedMapSV cLoaderMap; + private final HashMapSO globalMap; + + //ZML引擎配置ZML(最后修改时间、函数表和变量表) + private final LinkedHashMap fileMap; + private final LinkedHashMap> functionMap; + private final LinkedHashMap> variableMap; + + /** 默认ZML引擎构造方法,编码格式默认为UTF-8 */ + public ZmlEngine() + { + this(_UTF_8_); + } + + /** + * ZML引擎构造方法,传入编码格式 + * + * @param encoding ZML通用的编码格式 + */ + public ZmlEngine(String encoding) + { + this.encoding = encoding; + this.patterns = ZML_PATTERN_DEFAULT; + + this.cLoaderMap = new LinkedMapSV<>(); + this.globalMap = new HashMapSO(); + + this.fileMap = new LinkedHashMap<>(); + this.functionMap = new LinkedHashMap<>(); + this.variableMap = new LinkedHashMap<>(); + } + + /**************************************************************************/ + //ZML引擎基本参数 + /**************************************************************************/ + + public void setZmlVarNotice(ZmlVarNotice notice) + { + this.notice = notice; + } + + public void setAscQuery(boolean isAscQuery) + { + this.isAscQuery = isAscQuery; + } + + public void setEncoding(String encoding) + { + this.encoding = encoding; + } + + public void setMaxIdleTime(int maxIdleTime) + { + this.maxIdleTime = maxIdleTime; + } + + public void setMaxKeepTime(int maxKeepTime) + { + this.maxKeepTime = maxKeepTime; + } + + public void setPatterns(String[] patterns) + { + this.patterns = patterns; + } + + public void setPatterns(String patterns) + { + this.patterns = Arrays.toStringArray(patterns); + } + + public String getEncoding() + { + return encoding; + } + + public int getMaxIdleTime() + { + return maxIdleTime; + } + + public int getMaxKeepTime() + { + return maxKeepTime; + } + + public String[] getPatterns() + { + return patterns; + } + + /**************************************************************************/ + //ZML引擎加载器和全局变量 + /**************************************************************************/ + + /** + * 设置ZML加载器,如果是默认的类加载器和文件加载器,请使用setClassZmlLoader/setFileZmlLoader方法 + * + * @param loader ZML加载器 + */ + public void setZmlLoader(ZmlLoader loader) + { + this.loader = loader; + } + + /** + * 设置类ZML加载器 + * + * @param clazz 给定一个能访问到ZML文件的类,防止跨ClassLoader加载失败 + * @param pathPrefix ZML文件路径前缀,格式为/org/zhiqim/example + */ + public void setClassZmlLoader(Class clazz, String pathPrefix) + { + this.loader = new ClassZmlLoader(this, clazz, pathPrefix); + } + + /** + * 设置文件夹加载器 + * + * @param dir ZML文件根目录,如new File("./resource"); + * @throws IOException 检查文件根目录异常 + */ + public void setFileZmlLoader(File dir) throws IOException + { + this.loader = new FileZmlLoader(this, dir.getCanonicalPath()); + } + + /** + * 增加组件ZML加载器 + * + * @param clazz 给定一个能访问到ZML文件的类,防止跨ClassLoader加载失败 + * @param pathPrefix ZML文件路径前缀,格式为/org/zhiqim/example + */ + public void addComponentZmlLoader(Class clazz, String pathPrefix) + { + this.cLoaderMap.put(pathPrefix, new ClassZmlLoader(this, clazz, pathPrefix)); + } + + public void addComponentZmlLoader(String componentPath, ZmlLoader loader) + { + this.cLoaderMap.put(componentPath, loader); + } + + public ZmlLoader getLoader(ConfigKey ck) + { + return getLoader(ck.configPath, ck.componentPath); + } + + public ZmlLoader getLoader(String contextPath, String componentPath) + { + return (componentPath==null)?this.loader:this.cLoaderMap.get(componentPath); + } + + /** + * 增加全局变量 + * + * @param name 变量名 + * @param obj 变量值 + */ + public void addGlobalVariable(String name, Object obj) + { + globalMap.put(name, obj); + } + + public Object getGlobalVariable(String key) + { + return globalMap.get(key); + } + + public HashMapSO getGlobalMap() + { + return globalMap; + } + + /**************************************************************************/ + //ZML引擎配置ZML(最后修改时间、函数表和变量表) + /**************************************************************************/ + + /** + * 添加上下文配置ZML + * + * @param configPath 上下文配置ZML路径 + */ + public void addConfigZml(String configPath) + { + Asserts.as(this.loader != null?null:"未设置加载器上不支持添加上下文配置ZML"); + this.loadConfigZml(new ConfigKey(configPath, null)); + } + + /** + * 添加组件上下文配置ZML,带组件路径 + * + * @param configPath 上下文配置ZML路径 + * @param componentPath 组件路径 + */ + public void addConfigZml(String configPath, String componentPath) + { + Asserts.as(this.cLoaderMap.containsKey(componentPath)?null:"未设置该组件加载器上不支持添加组件上下文配置ZML"); + this.loadConfigZml(new ConfigKey(configPath, componentPath)); + } + + /** 检查当前配置更新 */ + public void chkCurConfigModified() + { + for (Entry entry : fileMap.entrySet()) + { + if (entry.getKey().componentPath != null) + continue; + + try + { + long lastModified = getConfigLastModified(entry.getKey()); + if (lastModified != entry.getValue()) + loadConfigZml(entry.getKey()); + } + catch (Exception e) + { + throw Asserts.exception("加载上下文ZML["+entry.getKey().configPath+"]异常", e); + } + } + } + + /** 检查所有配置更新 */ + private void chkAllConfigModified() + { + for (Entry entry : fileMap.entrySet()) + { + try + { + long lastModified = getConfigLastModified(entry.getKey()); + if (lastModified != entry.getValue()) + loadConfigZml(entry.getKey()); + } + catch (Exception e) + { + throw Asserts.exception("加载上下文ZML["+entry.getKey().configPath+"]异常", e); + } + } + } + + /** 获取配置ZML最后修改时间 */ + private long getConfigLastModified(ConfigKey ck) throws Exception + { + ZmlLoader loader = getLoader(ck); + return loader.getLastModified(ck.configPath); + } + + /** 获取配置ZML里的函数表 */ + public LinkedMapSV<_Function> getFunctionMap(String contextPath, String componentPath) + { + return functionMap.get(new ConfigKey(contextPath, componentPath)); + } + + /** 获取配置ZML里的变量表 */ + public LinkedMapSV<_Var> getVarMap(String contextPath, String componentPath) + { + return variableMap.get(new ConfigKey(contextPath, componentPath)); + } + + /** 查找配置ZML中函数语句 */ + public _Function getFunction(String name) throws Exception + { + if (loader == null) + throw new Exception("未定义加载器,不支持获取函数调用"); + + //先检查上下文文件更新标志 + chkAllConfigModified(); + + if (isAscQuery) + {//按顺序查找对应的函数 + for (LinkedMapSV<_Function> fMap : functionMap.values()) + { + _Function _function = fMap.get(name); + if (_function != null) + return _function; + } + } + else + {//按倒序查找对应的函数 + _Function _function = null; + for (LinkedMapSV<_Function> fMap : functionMap.values()) + { + if (fMap.containsKey(name)) + _function = fMap.get(name); + } + + if (_function != null) + return _function; + } + + //如果没找到抛异常 + throw new Exception("加载上下文ZML失败,不支持获取函数"); + } + + /** 查找配置ZML中变量语句 */ + public _Var getVar(String name) + { + if (loader == null) + return null; + + //先检查上下文文件更新标志 + chkAllConfigModified(); + + if (isAscQuery) + {//按顺序查找对应的变量 + for (LinkedMapSV<_Var> vMap : variableMap.values()) + { + _Var _var = vMap.get(name); + if (_var != null) + return _var; + } + } + else + {//按倒序查找对应的变量 + _Var _var = null; + for (LinkedMapSV<_Var> vMap : variableMap.values()) + { + if (vMap.containsKey(name)) + _var = vMap.get(name); + } + + if (_var != null) + return _var; + } + + //如果没找到返回null + return null; + } + + /**************************************************************************/ + //指定路径判断和查找ZML信息 has & get + /**************************************************************************/ + + /** + * 判断是否存在ZML信息 + * + * @param path ZML相对路径 + * @return =true表示存在,=false表示不存在 + */ + public boolean hasZml(String path) + { + Asserts.as(this.loader != null?null:"未设置加载器上不支持增通过引擎获取ZML"); + + try + { + //优先本地查找 + if (loader.hasZml(path)) + return true; + + //再到组件中查找 + List list = new ArrayList<>(cLoaderMap.values()); + for (int i=list.size()-1;i>=0;i--) + { + ZmlLoader ld = list.get(i); + if (ld.hasZml(path)) + return true; + } + + return false; + } + catch (Exception e) + { + throw Asserts.exception("加载ZML文件["+path+"]异常", e); + } + } + + /** + * 判断是否存在ZML信息 + * + * @param path ZML相对路径 + * @return 存在返回加载器,不存在返回false + */ + public ZmlLoader getZmlLoader(String path) + { + Asserts.as(this.loader != null?null:"未设置加载器上不支持增通过引擎获取ZML"); + + try + { + //优先本地查找 + if (loader.hasZml(path)) + return loader; + + //再到组件中查找 + List list = new ArrayList<>(cLoaderMap.values()); + for (int i=list.size()-1;i>=0;i--) + { + ZmlLoader ld = list.get(i); + if (ld.hasZml(path)) + return ld; + } + + return null; + } + catch (Exception e) + { + throw Asserts.exception("加载ZML文件["+path+"]异常", e); + } + } + + /** + * 获取ZML信息 + * + * @param path ZML相对路径 + * @return ZML信息 + * @throws IOException 读取ZML文件时产生的异常 + */ + public Zml getZml(String path) throws FileNotFoundException + { + Asserts.as(this.loader != null?null:"未设置加载器上不支持增通过引擎获取ZML"); + + try + { + //优先本地查找 + Zml zml = loader.loadZml(path); + if (zml != null) + return zml; + + //再到组件中查找 + List list = new ArrayList<>(cLoaderMap.values()); + for (int i=list.size()-1;i>=0;i--) + { + ZmlLoader ld = list.get(i); + zml = ld.loadZml(path); + if (zml != null) + return zml; + } + } + catch (Exception e) + { + throw Asserts.exception("加载ZML文件["+path+"]异常", e); + } + + throw Asserts.notFound("未找到ZML文件["+path+"]"); + } + + /**************************************************************************/ + //加载配置ZML + /**************************************************************************/ + + /** 加载配置ZML */ + private void loadConfigZml(ConfigKey mk) + { + String configPath = mk.configPath; + String componentPath = mk.componentPath; + + //1.1 先加载ZML + Zml zml = null; + try + { + ZmlLoader theLoader = componentPath==null?this.loader:this.cLoaderMap.get(componentPath); + zml = theLoader.loadZml(configPath); + if (zml == null) + return;//未找到不加载 + + //修改ZML文件的最后修改时间 + fileMap.put(mk, zml.getLastModified()); + } + catch (Exception e) + { + throw Asserts.exception("加载上下文ZML["+configPath+"]异常", e); + } + + //1.2 从ZML中找到函数列表,变量列表和包含列表 + List<_Function> funcList = new ArrayList<>(); + List<_Var> varList = new ArrayList<>(); + List<_Include> includeList = new ArrayList<>(); + + try + { + StatementParser.parseContextZml(zml, funcList, varList, includeList); + } + catch (Exception e) + { + throw Asserts.exception("加载上下文ZML["+configPath+"]异常", e); + } + + //2.1 找到上下文对应的全局函数表 + LinkedMapSV<_Function> funcMap = null; + synchronized (functionMap) + { + LinkedMapSV<_Function> fMap = functionMap.get(mk); + if (fMap == null) + { + fMap = new LinkedMapSV<_Function>(); + functionMap.put(mk, fMap); + } + + funcMap = fMap; + } + + //2.2 把ZML中的函数表加入到全局函数表中 + synchronized (funcMap) + { + try + { + funcMap.clear(); + for (_Function func : funcList) + { + String name = func.getName(); + if (funcMap.containsKey(name))//一个上下文文件定义全局函数不允许重复,多文件之间支持,按优先顺序读取 + throw Asserts.exception("找到上下文ZML文件["+configPath+"]中全局函数["+name+"]有重复"); + + funcMap.put(name, func); + } + + } + catch (Exception e) + { + throw Asserts.exception("加载上下文ZML["+configPath+"]异常", e); + } + } + + //3.1 找到上下文对应的全局变量表 + LinkedMapSV<_Var> varMap = null; + synchronized (variableMap) + { + LinkedMapSV<_Var> vMap = variableMap.get(mk); + if (vMap == null) + { + vMap = new LinkedMapSV<_Var>(); + variableMap.put(mk, vMap); + } + + varMap = vMap; + } + + //3.2 把ZML中的变量表并加入到全局变量表中 + synchronized (varMap) + { + try + { + varMap.clear(); + for (_Var var : varList) + { + String name = var.getVariableName(); + if (varMap.containsKey(name))//一个上下文文件定义全局变量不允许重复,多文件之间支持,按优先顺序读取 + throw Asserts.exception("找到上下文ZML文件["+configPath+"]中全局变量["+name+"]有重复"); + + varMap.put(name, var); + } + + if (notice != null) + {//变量更新通知 + notice.doUpdateVariable(zml, configPath, componentPath, varMap); + } + } + catch (Exception e) + { + throw Asserts.exception("加载上下文ZML["+configPath+"]异常", e); + } + } + + //4 递归加载里面包含表的函数和变量 + try + { + ZmlVariable variable = new ZmlVariable(); + for (_Include include : includeList) + { + String path = include.getIncludePath(variable); + loadConfigZml(new ConfigKey(path, componentPath)); + } + } + catch (Exception e) + { + throw Asserts.exception("加载上下文ZML["+configPath+"]异常", e); + } + } + + /**************************************************************************/ + //ZML引擎配置键(配置路径和组件路径组合成唯一) + /**************************************************************************/ + + private class ConfigKey + { + private String configPath; + private String componentPath; + + public ConfigKey(String contextPath, String componentPath) + { + this.configPath = contextPath; + this.componentPath = componentPath; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((componentPath == null) ? 0 : componentPath.hashCode()); + result = prime * result + ((configPath == null) ? 0 : configPath.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + + ConfigKey other = (ConfigKey)obj; + if (componentPath == null) + { + if (other.componentPath != null) + return false; + } + else if (!componentPath.equals(other.componentPath)) + return false; + if (configPath == null) + { + if (other.configPath != null) + return false; + } + else if (!configPath.equals(other.configPath)) + return false; + return true; + } + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/ZmlLineIndex.java b/zhiqim_zml/src/org/zhiqim/zml/ZmlLineIndex.java new file mode 100644 index 0000000..475cd2f --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/ZmlLineIndex.java @@ -0,0 +1,83 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +/** + * ZhiqimML行索引,定义每行对应的索引 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZmlLineIndex +{ + private int lineNo; + + private int beginIndex; + private int endIndex; + + /** 指定总索引号,判断是否在该行,如果不在返回-1,否则返在该行号 */ + public int getLineNo(int ind) + { + if (ind < beginIndex || ind > endIndex) + return -1; + else + return lineNo + 1; + } + + /** 指定总索引号,判断是否在该行,如果不在返回-1,否则返在该行对应的列号 */ + public int getColumnNo(int ind) + { + if (ind < beginIndex || ind > endIndex) + return -1; + + return ind - beginIndex + 1; + } + + public int getBeginIndex() + { + return beginIndex; + } + + public void setBeginIndex(int beginIndex) + { + this.beginIndex = beginIndex; + } + + public int getEndIndex() + { + return endIndex; + } + + public void setEndIndex(int endIndex) + { + this.endIndex = endIndex; + } + + public int getLineNo() + { + return lineNo; + } + + public void setLineNo(int lineNo) + { + this.lineNo = lineNo; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/ZmlLoader.java b/zhiqim_zml/src/org/zhiqim/zml/ZmlLoader.java new file mode 100644 index 0000000..6253195 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/ZmlLoader.java @@ -0,0 +1,74 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +/** + * ZhiqimML加载接口定义 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public interface ZmlLoader extends ZmlConstants +{ + /** 获取上下文环境路径 */ + public String getContextPath(); + + /** + * 判断ZML是否存在 + * + * @param path ZML路径 + * @return 是否存在true/false + * @throws 可能的异常 + */ + public boolean hasZml(String path) throws Exception; + + /** + * 加载ZML接口 + * + * @param path 相对于根配置的路径,如/zview/include.zml + * @return 返回Zml对象 + * @throws 可能的异常 + */ + public Zml loadZml(String path) throws Exception; + + /** + * 获取ZML资源最后更新时间 + * + * @param path 相对于根配置的路径,如/zview/include.zml + * @return long 最后修改时间 + * @throws 可能的异常 + */ + public long getLastModified(String path) throws Exception; + + /** + * 设置ZML缓存最长空闲时长 + * + * @param maxIdleTime 最长空闲时长,单位:秒 + */ + public void setMaxIdleTime(int maxIdleTime); + + /** + * 设置ZML缓存最长保持时长 + * + * @param maxKeepTime 最长保持时长,单位:秒 + */ + public void setMaxKeepTime(int maxKeepTime); +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/ZmlPredefinded.java b/zhiqim_zml/src/org/zhiqim/zml/ZmlPredefinded.java new file mode 100644 index 0000000..d50e7d8 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/ZmlPredefinded.java @@ -0,0 +1,115 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.Random; +import java.util.Vector; + +import org.zhiqim.kernel.extend.HashMapSC; +import org.zhiqim.kernel.extend.HashMapSO; + +/** + * ZhiqimML预定义: + * 1、预定义的JAVA核心类表 + * 2、预定义的系统变量表 + * + * @version v1.0.0 @author zouzhigang 2016-12-23 新建与整理 + */ +public class ZmlPredefinded +{ + private static final HashMapSC javaMap = new HashMapSC(); + private static final HashMapSO systemMap = new HashMapSO(); + + static + { + //java.lang.* + javaMap.put("Object", Object.class); + javaMap.put("Boolean", Boolean.class); + javaMap.put("Byte", Byte.class); + javaMap.put("Character", Character.class); + javaMap.put("Short", Short.class); + javaMap.put("Integer", Integer.class); + javaMap.put("Long", Long.class); + javaMap.put("Float", Float.class); + javaMap.put("Double", Double.class); + javaMap.put("Class", Class.class); + javaMap.put("String", String.class); + javaMap.put("StringBuffer", StringBuffer.class); + javaMap.put("StringBuilder", StringBuilder.class); + javaMap.put("System", System.class); + javaMap.put("Thread", Thread.class); + javaMap.put("Runtime", Runtime.class); + javaMap.put("Process", Process.class); + + //java.util.* + javaMap.put("ArrayList", ArrayList.class); + javaMap.put("LinkedList", LinkedList.class); + javaMap.put("Vector", Vector.class); + javaMap.put("HashMap", HashMap.class); + javaMap.put("HashSet", HashSet.class); + javaMap.put("Hashtable", Hashtable.class); + javaMap.put("LinkedHashMap", LinkedHashMap.class); + javaMap.put("LinkedHashSet", LinkedHashSet.class); + javaMap.put("Calendar", Calendar.class); + javaMap.put("Date", Date.class); + javaMap.put("Random", Random.class); + } + + /** 获取Java预定义简称表 */ + public static HashMapSC getJavaMap() + { + return javaMap; + } + + /** 获取Java预定义简称表 */ + public static Class getJavaClass(String className) + { + return javaMap.get(className); + } + + /** 获取系统变量表 */ + public static HashMapSO getSystemMap() + { + return systemMap; + } + + /** 获取系统变量 */ + public static Object getSystemVariable(String key) + { + return ZmlVariable.chkDynamicVar(systemMap.get(key)); + } + + /** 增加系统变量 */ + public static void addSystemVariable(String key, Object value) + { + systemMap.put(key, value); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/ZmlVarNotice.java b/zhiqim_zml/src/org/zhiqim/zml/ZmlVarNotice.java new file mode 100644 index 0000000..155be1a --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/ZmlVarNotice.java @@ -0,0 +1,43 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import org.zhiqim.kernel.extend.LinkedMapSV; +import org.zhiqim.zml.statement._Var; + +/** + * ZhiqimML变量更新通知 + * + * @version v1.0.0 @author zouzhigang 2016-7-13 新建与整理 + */ +public interface ZmlVarNotice +{ + /** + * 回调更新变量的接口定义 + * + * @param zml ZML对象 + * @param configPath 配置路径 + * @param componentPath 组件路径 + * @param varMap 变量表 + */ + public void doUpdateVariable(Zml zml, String configPath, String componentPath, LinkedMapSV<_Var> varMap); +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/ZmlVarRuntime.java b/zhiqim_zml/src/org/zhiqim/zml/ZmlVarRuntime.java new file mode 100644 index 0000000..d733e16 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/ZmlVarRuntime.java @@ -0,0 +1,32 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +/** + * ZhiqimML变量运行时生成最终结果 + * + * @version v1.0.0 @author zouzhigang 2018-2-26 新建与整理 + */ +public interface ZmlVarRuntime +{ + public Object build(); +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/ZmlVariable.java b/zhiqim_zml/src/org/zhiqim/zml/ZmlVariable.java new file mode 100644 index 0000000..603d8a7 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/ZmlVariable.java @@ -0,0 +1,263 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapS; +import org.zhiqim.kernel.extend.HashMapSV; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.extend.MapSV; +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.exception.StatementException; +import org.zhiqim.zml.statement._Function; +import org.zhiqim.zml.statement._Var; + +/** + * ZhiqimML变量表

              + * + * 1、最高优先级__局部变量表,按排序先进优先级更高
              + * 2、次优化级__页面全局变量表,来自Action属性表和URL参数表,重名时属性覆盖参数
              + * 3、三级优化级__请求级变量表,来自请求、响应、会话和上下文环境变量定义表
              + * 4、四级优化级__上下文定义变量表,由工程配置启动时指定对象
              + * 5、最低优化级__框架中定义的工程全局变量表,由框架中负责更新
              + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ZmlVariable +{ + private Zml zml; + + private MapSO variableMap; + private MapS[] contextMap; + private MapSV<_Function> functionMap; + + //局部变量,用于_If,_For,_Function + private List localList; + + /**************************************************************************************************/ + //设置变量&函数 + /**************************************************************************************************/ + + public void setZml(Zml zml) + { + this.zml = zml; + } + + public void setVariableMap(MapSO variableMap) + { + this.variableMap = variableMap; + } + + public void setContextMap(MapS... contextMap) + { + this.contextMap = contextMap; + } + + public void setFunctionMap(MapSV<_Function> functionMap) + { + this.functionMap = functionMap; + } + + public void addFunction(_Function function) throws StatementException + { + if (functionMap == null) + functionMap = new HashMapSV<>(); + else if (functionMap.containsKey(function.getName())) + throw new StatementException(function, "存在相同的函数名["+function.getName()+"]"); + + functionMap.put(function.getName(), function); + } + + public void addLocalVariable(MapSO localMap) + { + if (localList == null) + localList = new ArrayList<>(2); + + localList.add(localMap); + } + + public void removeLocalVariable(MapSO localMap) + { + localList.remove(localMap); + } + + /** + * 增加变量值, + * 1)如果没有局部变量表,则增加到页变量表 + * 2)有局部变量表,且存在变量定义,更新到局部变量 + * 3)有局部变量表,但不在局变量表中,且在页变量表中,认为是更新页变量表,更新到页变量表 + * 4)有局部变量表,但不在局变量表和页变量表中,认为是新增局变量,在最内层增加。 + * + * @param name 变量名 + * @param value 变量值 + */ + public void addVariable(String name, Object value) + { + //1.如果没有局部作用域,则直接放置到全页面作用域 + if (localList == null || localList.isEmpty()) + { + if (variableMap == null) + variableMap = new HashMapSO(); + + variableMap.put(name, value); + return; + } + + //2.先检查局部作用域,如果存在定义则赋值到局部作用域 + for (int i=localList.size()-1;i>=0;i--) + { + MapSO localMap = localList.get(i); + if (localMap.containsKey(name)) + { + localMap.put(name, value); + return; + } + } + + //3.再检查全页面作用域,如果在全页面作用域有定义,则赋值到全页面作用域 + if (variableMap != null && variableMap.containsKey(name)) + { + variableMap.put(name, value); + return; + } + + //4.如果局部和全页面都没找到定义,则在最内层局部作用域增加变量 + MapSO localMap = localList.get(localList.size()-1); + localMap.put(name, value); + } + + /**************************************************************************************************/ + //获取基本信息 + /**************************************************************************************************/ + + public Zml getZml() + { + return zml; + } + + public ZmlEngine getEngine() + { + return zml.getEngine(); + } + + public MapSO getVariableMap() + { + return variableMap; + } + + public MapS[] getContextMap() + { + return contextMap; + } + + public MapSV<_Function> getFunctionMap() + { + return functionMap; + } + + /**************************************************************************************************/ + //获取变量&函数 + /**************************************************************************************************/ + + public Object get(String key) + { + //1.在if,for局部作用域中找 + if (localList != null && !localList.isEmpty()) + { + for (int i=localList.size()-1;i>=0;i--) + { + MapSO loaclMap = localList.get(i); + Object value = loaclMap.get(key); + if (value != null) + return chkDynamicVar(value); + } + } + + //2.在全页面作用域中找 + if (variableMap != null) + { + Object value = variableMap.get(key); + if (value != null) + return chkDynamicVar(value); + } + + //3.在context作用域中找 + if (contextMap != null) + { + for (MapS map : contextMap) + { + Object value = map.get(key); + if (value != null) + return chkDynamicVar(value); + } + } + + //4.在引擎作用域中找 + ZmlEngine engine = zml.getEngine(); + if (engine != null) + { + //5.1 在引擎global作用域中找 + Object value = engine.getGlobalVariable(key); + if (value != null) + return chkDynamicVar(value); + + //5.2 在引擎config变量中找 + _Var var = engine.getVar(key); + if (var != null) + { + try + { + return var.getExpression().build(this); + } + catch (ExpressionException e) + { + throw Asserts.exception("执行全局变量表达式时异常["+var.getVariableName()+"]", e); + } + } + } + + //5.在system作用域中找 + return ZmlEngine.getSystemVariable(key); + } + + public _Function getFunction(String name) throws StatementException + { + _Function function = (functionMap == null)?null:functionMap.get(name); + if (function != null) + return function; + else + return zml.getFunction(name); + } + + /**************************************************************************************************/ + //对动态变量进行处理 + /**************************************************************************************************/ + + public static Object chkDynamicVar(Object value) + { + return (value instanceof ZmlVarRuntime)?((ZmlVarRuntime)value).build():value; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/Zmls.java b/zhiqim_zml/src/org/zhiqim/zml/Zmls.java new file mode 100644 index 0000000..8a63af0 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/Zmls.java @@ -0,0 +1,184 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml; + +import java.io.StringWriter; + +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.kernel.extend.MapS; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; + +/** + * ZhiqimML工具类 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +@AnAlias("Zmls") +public class Zmls implements SignConstants +{ + /******************************************************************/ + //指定内容,把ZML标签转义为浏览器可读标签 + /******************************************************************/ + + /** + * 内容格式化,对<,>,\",\',${,@{,#{格式化,保证浏览器解释成字符串而不是ZML代码 + * + * @param content 要格式化的字符串 + * @return 格式化后的字符串 + */ + public static String format(String content) + { + if (content == null) + return ""; + + StringBuilder strb = new StringBuilder(); + for (int i=0;i':strb.append(">");break; + case '\'':strb.append("'");break; + case '\"':strb.append(""");break; + case '{': + {//检查ZML表达式语句标签,进行转化 + if (i == 0) + strb.append(c); + else + { + switch (content.charAt(i-1)) + { + case '$':strb.setLength(strb.length()-1);strb.append("${");break; + case '@':strb.setLength(strb.length()-1);strb.append("@{");break; + case '#':strb.setLength(strb.length()-1);strb.append("#{");break; + default:strb.append(c);break; + } + } + break; + } + default:strb.append(c);break; + } + } + + return strb.toString(); + } + + /******************************************************************/ + //指定内容,解释内容生成结果 + /******************************************************************/ + + /** + * 解析ZML内容和属性表得到解析之后的内容 + * + * @param content 指定ZML的内容 + * @param key 变量KEY + * @param value 变量VALUE + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parse(String content, String key, Object value) throws Exception + { + return parse(new Zml(content), key, value); + } + + /** + * 解析ZML内容和属性表得到解析之后的内容 + * + * @param content 指定ZML的内容 + * @param variableMap 页变量表 + * @param contextMap 上下文变量表 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parse(String content, MapSO variableMap, MapS... contextMap) throws Exception + { + return parse(new Zml(content), variableMap, contextMap); + } + + /** + * 解析ZML内容和属性表得到解析之后的内容 + * + * @param content 指定ZML的内容 + * @param contextMap 上下文变量表 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseContext(String content, MapS... contextMap) throws Exception + { + return parseContext(new Zml(content), contextMap); + } + + /******************************************************************/ + //指定ZML,解释ZML生成结果 + /******************************************************************/ + + /** + * 解析ZML和属性表得到解析之后的内容 + * + * @param zml ZML对象 + * @param key 变量KEY + * @param value 变量VALUE + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parse(Zml zml, String key, Object value) throws Exception + { + return parse(zml, new HashMapSO(key, value)); + } + + /** + * 解析ZML和属性表得到解析之后的内容 + * + * @param zml ZML对象 + * @param variableMap 页变量表 + * @param contextMap 上下文变量表 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parse(Zml zml, MapSO variableMap, MapS... contextMap) throws Exception + { + StringWriter writer = new StringWriter(); + zml.process(writer, variableMap, contextMap); + + return writer.toString(); + } + + /** + * 解析ZML和属性表得到解析之后的内容 + * + * @param zml ZML对象 + * @param contextMap 上下文变量表 + * @return String 解析之后的内容 + * @throws Exception 可能解析的异常 + */ + public static String parseContext(Zml zml, MapS... contextMap) throws Exception + { + StringWriter writer = new StringWriter(); + zml.process(writer, null, contextMap); + + return writer.toString(); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/exception/ExpressionException.java b/zhiqim_zml/src/org/zhiqim/zml/exception/ExpressionException.java new file mode 100644 index 0000000..2f413c9 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/exception/ExpressionException.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.exception; + +/** + * 定义表达式解析异常 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ExpressionException extends Exception +{ + private static final long serialVersionUID = 1L; + + /** + * 断言,传入要断言的判断,为false时抛出非法的参数异常 + * + * @param param 断言为false时抛出非法的参数异常 + * @param exception 异常信息 + * @throws ExpressionException 异常 + */ + public static void asserts(boolean param, String exception) throws ExpressionException + { + if (!param){ + throw new ExpressionException(exception); + } + } + + /** + * 断言对象不为null,如果为null则抛出非法的参数异常 + * + * @param param 参数 + * @param exception 异常信息 + * @throws ExpressionException 异常 + */ + public static void assertNotNull(Object param, String exception) throws ExpressionException + { + if (param == null){ + throw new ExpressionException(exception); + } + } + + public ExpressionException(String message) + { + super(message); + } + + public ExpressionException(String message, Throwable cause) + { + super(message, cause); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/exception/PropertNotExistException.java b/zhiqim_zml/src/org/zhiqim/zml/exception/PropertNotExistException.java new file mode 100644 index 0000000..e16ead8 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/exception/PropertNotExistException.java @@ -0,0 +1,37 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.exception; + +/** + * 属性未找到异常,区别于返回值 + * + * @version v1.0.0 @author zouzhigang 2016-12-23 新建与整理 + */ +public class PropertNotExistException extends ExpressionException +{ + private static final long serialVersionUID = 1L; + + public PropertNotExistException(String message) + { + super(message); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/exception/StatementException.java b/zhiqim_zml/src/org/zhiqim/zml/exception/StatementException.java new file mode 100644 index 0000000..c1093f4 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/exception/StatementException.java @@ -0,0 +1,86 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.exception; + +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.Statement; + +/** + * 定义语句解析异常,可以得到出错的路径、行列号 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class StatementException extends Exception +{ + private static final long serialVersionUID = 1L; + + private String path; + private int lineNo; + private int columnNo; + + public StatementException(Statement s, String message) + { + this(s.getPath(), s.getBeginLine(), s.getBeginColumn(), message); + } + + public StatementException(Statement s, String message, Throwable exception) + { + this(s.getPath(), s.getBeginLine(), s.getBeginColumn(), message, exception); + } + + public StatementException(String path, int lineNo, int columnNo, String message) + { + super(new StringBuilder("[").append(Validates.isEmptyBlank(path)?"自定义ZML":path).append("]").append("[第").append(lineNo).append("行],[第").append(columnNo).append("列][").append(message).append("]").toString()); + + this.path = path; + this.lineNo = lineNo; + this.columnNo = columnNo; + } + + public StatementException(String path, int lineNo, int columnNo, String message, Throwable exception) + { + super(new StringBuilder("[").append(Validates.isEmptyBlank(path)?"自定义ZML":path).append("]").append("[第").append(lineNo).append("行],[第").append(columnNo).append("列][").append(message).append("]").toString(), exception); + + this.path = path; + this.lineNo = lineNo; + this.columnNo = columnNo; + } + + /************************************************/ + //异常时获取文件对应的路径、行号和列号 + /************************************************/ + + public String getPath() + { + return path; + } + + public int getLineNo() + { + return lineNo; + } + + public int getColumnNo() + { + return columnNo; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/Operator.java b/zhiqim_zml/src/org/zhiqim/zml/expression/Operator.java new file mode 100644 index 0000000..296ff7b --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/Operator.java @@ -0,0 +1,68 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression; + +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.expression.operator._Or; +import org.zhiqim.zml.statement._Var; + +/** + * ZhiqimML运算符表达式基类

              + * + * 以下为Java操作符优先级排序
              + * 优先级 操作 结合性]
              + * 1 后缀运算符 [] . () (函数呼叫) 从左到右
              + * 2 单目运算符 ! ~ ++ -- +(单操作数) –(单操作数) 从右到左
              + * 3 创建 new 从左到右
              + * 4 乘除取模 * / % 从左到右
              + * 5 加减 + - 从左到右
              + * 6 移位 << >> >>> 从左到右
              + * 7 关系 < <= > >= instanceof 从左到右
              + * 8 相等 == != 从左到右
              + * 9 按位与 & 从左到右
              + * 10 按位异或 ^ 从左到右
              + * 11 按位或 | 从左到右
              + * 12 逻辑与 && 从左到右
              + * 13 逻辑或 || 从左到右
              + * 14 条件 ? : 从右到左
              + * 15 赋值 = += -= *= /= %= ^= <<= >>= >>>= 从右到左
              + * + * ZhiqimML操作符只实现如下操作符,共22个(其中1个赋值/20个运算表达式):
              + * 1 后缀运算符 [ ] . ( )(方法调用或表达式括号) 从左到右
              + * 2 单目运算符 ! –(数值取负) ..(数值最小最大值)   从右到左
              + * 3 创建 new 从左到右
              + * 4 乘除取模 * / % 从左到右
              + * 5 加减 + - 从左到右
              + * 6 关系 lt lte gt gte 从左到右
              + * 7 相等 == != 从左到右
              + * 8 逻辑与 && 从左到右
              + * 9 逻辑或 || 从左到右
              + * 10 赋值 = 从右到左
              + * + * @see _Var 其中赋值操作符(=)只存在于定义中
              + * @see _Or 其他操作符都可能出现在表达式中,以逻辑或 优化级最低,默认为_Or,依优化级从低到高依次判断
              + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class Operator implements Expression +{ + +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/Primitive.java b/zhiqim_zml/src/org/zhiqim/zml/expression/Primitive.java new file mode 100644 index 0000000..e073261 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/Primitive.java @@ -0,0 +1,48 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression; + +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.expression.primitive._Boolean; +import org.zhiqim.zml.expression.primitive._Char; +import org.zhiqim.zml.expression.primitive._Decimal; +import org.zhiqim.zml.expression.primitive._Integer; +import org.zhiqim.zml.expression.primitive._Null; +import org.zhiqim.zml.expression.primitive._String; +import org.zhiqim.zml.expression.primitive._Variable; + +/** + * 原生类型对象表达式基类 + * + * @see _Null 原生的null类型,表示null + * @see _String 字符串原型,双引号""之内的内容 + * @see _Char 字符原型,单引号''之内的一个字符 + * @see _Boolean 为true/false的两个值 + * @see _Integer 整数原型,非零开头全数字组成 + * @see _Decimal 小数原型,零点开头接全数字,或非零开头后接一个点和数字 + * @see _Variable 变量原型,字母或下划线开头,后面接字母、下划线和数字 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class Primitive implements Expression +{ + +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/Symbol.java b/zhiqim_zml/src/org/zhiqim/zml/expression/Symbol.java new file mode 100644 index 0000000..40785d6 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/Symbol.java @@ -0,0 +1,40 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression; + +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; + +/** + * 标点符号表达式 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public abstract class Symbol implements Expression +{ + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + throw new ExpressionException("禁止调用标点符号表达式"); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Add.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Add.java new file mode 100644 index 0000000..f6d5ba1 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Add.java @@ -0,0 +1,137 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.kernel.util.Types; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 加法运算(+)

              + * + * 1、数值型相加
              + * 2、字符串相连
              + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Add extends Operator +{ + private final Expression left; + private final Expression right; + + public _Add(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return ADD; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + Object next = right.build(variableMap); + if (privous instanceof String || next instanceof String) + {//有一个是字符串则认为是字符串相连 + String str1 = String.valueOf(privous); + String str2 = String.valueOf(next); + return str1 + str2; + } + else if ((!Types.isNumber(privous) && !Types.isChar(privous)) + || (!Types.isNumber(next) && !Types.isChar(next))) + {//不是整数和小数 + throw new ExpressionException("加法表达式{"+this+"},格式不正确,出现加数不是数值型和字符串"); + } + else + { + if (Types.isInteger(privous)) + {//整数 + long add1 = ((Number)privous).longValue(); + if (Types.isInteger(next)) + { + long add2 = ((Number)next).longValue(); + return add1 + add2; + } + else if (Types.isDecimal(next)) + { + double add2 = ((Number)next).doubleValue(); + return add1 + add2; + } + else + { + char add2 = (Character)next; + return add1 + add2; + } + } + else if (Types.isDecimal(privous)) + {//小数 + double add1 = (Double)privous; + if (Types.isInteger(next)) + { + long add2 = ((Number)next).longValue(); + return add1 + add2; + } + else if (Types.isDecimal(next)) + { + double add2 = ((Number)next).doubleValue(); + return add1 + add2; + } + else + { + char add2 = (Character)next; + return add1 + add2; + } + } + else + {//字符 + char add1 = (Character)privous; + if (Types.isInteger(next)) + { + long add2 = ((Number)next).longValue(); + return add1 + add2; + } + else if (Types.isDecimal(next)) + { + double add2 = ((Number)next).doubleValue(); + return add1 + add2; + } + else + { + char add2 = (Character)next; + return add1 + add2; + } + } + } + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" + ").append(right).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_And.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_And.java new file mode 100644 index 0000000..0ae2456 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_And.java @@ -0,0 +1,74 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.kernel.util.Types; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 逻辑与运算(&&) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _And extends Operator +{ + private final Expression left; + private final Expression right; + + public _And(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return AND; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + if (!Types.isBoolean(privous)) + throw new ExpressionException("逻辑与表达式{"+this+"}格式不正常,要求结果为布尔型时为非"); + + if (!(Boolean)privous) + return false;//当左值为否时,不处理右值 + + Object next = right.build(variableMap); + if (!Types.isBoolean(next)) + throw new ExpressionException("逻辑与表达式{"+this+"}格式不正常,要求结果为布尔型时为非"); + + return (Boolean)next; + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" && ").append(right).toString() ; + } +} \ No newline at end of file diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Bracket.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Bracket.java new file mode 100644 index 0000000..d6d990f --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Bracket.java @@ -0,0 +1,97 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import java.util.ArrayList; + +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 括号运算() + * + * @see _Method 括号操作符,和方法操作符不同的是内部是表达式,方法操作符括号内为参数 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Bracket extends Operator +{ + private Expression _expression; //编译后的表达式列表 + + private transient ArrayList eList; //预编译的表达式列表 + + public _Bracket() + { + eList = new ArrayList(); + } + + @Override + public int getType() + { + return BRACKET; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + return _expression.build(variableMap); + } + + @Override + public String toString() + { + return new StringBuilder("(").append(_expression).append(")").toString() ; + } + + public void addExpression(Expression expression) + { + eList.add(expression); + } + + public ArrayList getExpressionList() + { + return eList; + } + + public Expression getExpression() + { + return _expression; + } + + public void parseBracket() throws ExpressionException + { + //左右括号去除 + eList.remove(0); + eList.remove(eList.size()-1); + + ExpressionParser.parse_Operator(eList); + + if (eList.size() > 1) + throw new ExpressionException("括号表达式存在无法处理的表达式"); + + _expression = eList.get(0); + eList.clear();eList = null; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Division.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Division.java new file mode 100644 index 0000000..a6376b0 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Division.java @@ -0,0 +1,87 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.kernel.util.Types; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 除法运算(/) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Division extends Operator +{ + private final Expression left; + private final Expression right; + + public _Division(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return DIVISION; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + Object next = right.build(variableMap); + + if (!Types.isNumber(privous) || !Types.isNumber(next)) + {//不是整数和小数 + throw new ExpressionException("除法表达式{"+this+"},格式不正确,除数或被除数不是数值型"); + } + + Number dividend = (Number)privous; + Number divisor = (Number)next; + + if (Types.isInteger(privous)) + {//整数 + if (Types.isInteger(next)) + return dividend.longValue() / divisor.longValue(); + else + return dividend.longValue() / divisor.doubleValue(); + } + else + {//小数 + if (Types.isInteger(next)) + return dividend.doubleValue() / divisor.longValue(); + else + return dividend.doubleValue() / divisor.doubleValue(); + } + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" / ").append(right).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_EqualEqual.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_EqualEqual.java new file mode 100644 index 0000000..3b71c00 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_EqualEqual.java @@ -0,0 +1,97 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.kernel.util.Types; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 恒等比较(==) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _EqualEqual extends Operator +{ + private final Expression left; + private final Expression right; + + public _EqualEqual(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return EQUAL_EQUAL; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + Object next = right.build(variableMap); + + if (privous == null || next == null) + {//出现一个为null + return (privous == null)?(next == null):(next != null); + } + + if (privous instanceof String || next instanceof String) + {//出现一个为字符串 + return String.valueOf(privous).equals(String.valueOf(next)); + } + + //判断是否数值型 + if (!Types.isNumber(privous)) + return privous.equals(next); + + //数值型 + if (!Types.isNumber(next)) + return false; + + if (Types.isInteger(privous)) + {//整数 + if (!Types.isInteger(next)) + return false; + + return ((Number)privous).longValue() == ((Number)next).longValue(); + } + else + {//小数 + if (!Types.isDecimal(next)) + return false; + + return ((Number)privous).doubleValue() == ((Number)next).doubleValue(); + } + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" == ").append(right).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_EqualNot.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_EqualNot.java new file mode 100644 index 0000000..da3e6c6 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_EqualNot.java @@ -0,0 +1,99 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.kernel.util.Types; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 不等比较(!=) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _EqualNot extends Operator +{ + private final Expression left; + private final Expression right; + + public _EqualNot(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return EQUAL_NOT; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + Object next = right.build(variableMap); + + if (privous == null || next == null) + {//出现一个为null + return (privous == null)?(next != null):(next == null); + } + + if (privous instanceof String || next instanceof String) + {//出现一个为字符串 + return !String.valueOf(privous).equals(String.valueOf(next)); + } + + //判断是否数值型,不是数值型,进行对象相等判断 + if (!Types.isNumber(privous)) + return !privous.equals(next); + + //是数值型,进行数值比较 + + //next不是数值型 + if (!Types.isNumber(next)) + return true; + + if (Types.isInteger(privous)) + {//整数 + if (!Types.isInteger(next)) + return true; + + return ((Number)privous).longValue() != ((Number)next).longValue(); + } + else + {//小数 + if (!Types.isDecimal(next)) + return true; + + return ((Number)privous).doubleValue() != ((Number)next).doubleValue(); + } + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" != ").append(right).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_GreateThen.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_GreateThen.java new file mode 100644 index 0000000..5a9d9cb --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_GreateThen.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 大于比较(>),对_Gt左右两值进行大于比较操作 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _GreateThen extends Operator +{ + private final Expression left; + private final Expression right; + + public _GreateThen(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return GTHEN; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + Object next = right.build(variableMap); + return ExpressionParser.compare(privous, next, this); + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" gt ").append(right).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_GreateThenEqual.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_GreateThenEqual.java new file mode 100644 index 0000000..499abf9 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_GreateThenEqual.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 大于等于比较(>=),对_Gte左右两值进行大于等于比较操作 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _GreateThenEqual extends Operator +{ + private final Expression left; + private final Expression right; + + public _GreateThenEqual(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return GTEQUAL; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + Object next = right.build(variableMap); + return ExpressionParser.compare(privous, next, this); + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" gte ").append(right).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Indexable.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Indexable.java new file mode 100644 index 0000000..6322c5e --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Indexable.java @@ -0,0 +1,245 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Maps; +import org.zhiqim.kernel.util.Types; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.exception.PropertNotExistException; +import org.zhiqim.zml.expression.Operator; +import org.zhiqim.zml.expression.primitive._Variable; + +/** + * 可索引表达式,对应方括号[]: + * 1、数组下标,如array[0] + * 2、列表坐标、如list[0] + * 3、MAP取值、如map["key"] + * 4、对象属性,如object["name"] + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Indexable extends Operator +{ + private Expression obj;//数组、列表、MAP等 + private Expression key;//键值 + + private transient ArrayList eList; + + public _Indexable() + { + this.eList = new ArrayList(1); + } + + @Override + public int getType() + { + return INDEXABLE; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object target = obj.build(variableMap); + Object tk = key.build(variableMap); + if (target == null && tk == null) + throw new ExpressionException("可索引表达式{"+this+"},目标对象和键对象不能都为null"); + + if (target == null) + {//转到静态属性处理 + if (obj instanceof _Variable && tk instanceof String) + { + Class clazz = ((_Variable)obj).buildClass(); + if (clazz == null) + throw new ExpressionException("属性表达式{"+this+"},目标对象不能为null"); + + try + { + return new _Property(clazz, (String)tk).build(variableMap); + } + catch(PropertNotExistException e) + { + //属性未找到不返回值 + } + } + + throw new ExpressionException("可索引表达式{"+this+"},目标对象或键对象不正确"); + } + + if (tk == null) + {//转到MAP处理,MAP支持null键 + if (target instanceof Map) + {//MAP类型 + return Maps.get(target, tk); + } + + throw new ExpressionException("可索引表达式{"+this+"},目标对象或键对象不正确"); + } + + //目标对象和键都不为null + return buildIndexable(variableMap, target, tk); + } + + /** + * 生成可索引对象 + * + * @param variableMap 变量表 + * @param target 目标对象 + * @param tk 键对象 + * @return 索引后对象 + * @throws ExpressionException 异常 + */ + private Object buildIndexable(ZmlVariable variableMap, Object target, Object tk) throws ExpressionException + { + if (target.getClass().isArray()) + {//数组类型 + if (!Types.isInteger(tk) && !Types.isIntArray(tk)) + throw new ExpressionException("属性表达式{"+this+"},格式不正确,数组要求键值为整型"); + + Object[] ts = Arrays.toArray(target); + if (Types.isInteger(tk)) + { + int index = ((Number)tk).intValue(); + return ts[index]; + } + else + { + int[] indexs = (int[])tk; + if (indexs.length < 2) + return null; + + Object[] ds = new Object[indexs[indexs.length-1] - indexs[0]]; + for (int i=indexs[0];i list = (List)target; + if (Types.isInteger(tk)) + { + int index = ((Number)tk).intValue(); + return list.get(index); + } + else + { + int[] indexs = (int[])tk; + if (indexs.length < 2) + return null; + + List list2 = new ArrayList(indexs[indexs.length-1] - indexs[0]); + for (int i=indexs[0];i map = (Map)target; + return map.get(tk); + } + else if (tk instanceof String) + {//对象取属性 + try + { + return new _Property(target, (String)tk).build(variableMap); + } + catch (PropertNotExistException e) + { + //属性未找到不返回 + } + } + + throw new ExpressionException("可索引表达式{"+this+"},格式不正确,目标对象不是数组|列表|MAP"); + } + + @Override + public String toString() + { + return new StringBuilder().append(obj).append("[").append(key).append("]").toString() ; + } + + public void addExpression(Expression expression) + { + eList.add(expression); + } + + public void setObject(Expression obj) + { + this.obj = obj; + } + + public boolean hasObject() + { + return obj != null; + } + + public void parseBracketSquare() throws ExpressionException + { + //左右括号去除 + eList.remove(0); + eList.remove(eList.size()-1); + + ExpressionParser.parse_Operator(eList); + + if (eList.size() > 1) + throw new ExpressionException("属性表达式存在无法处理的表达式"); + + key = eList.get(0); + eList.clear();eList = null; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_IntegerArray.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_IntegerArray.java new file mode 100644 index 0000000..8929ea5 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_IntegerArray.java @@ -0,0 +1,81 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.kernel.util.Types; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 整数数组,双点号运算符(..) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _IntegerArray extends Operator +{ + private final Expression left; + private final Expression right; + + public _IntegerArray(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return INTEGER_ARR; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + if (!Types.isInteger(privous)) + throw new ExpressionException("整数数组表达式{"+this+"}格式不正常,要求结果不是整数"); + + Object next = right.build(variableMap); + if (!Types.isInteger(next)) + throw new ExpressionException("整数数组表达式{"+this+"}格式不正常,要求结果不是整数"); + + int v1 = ((Number)privous).intValue(); + int v2 = ((Number)next).intValue(); + if (v1 > v2) + return new int[0]; + + int[] ints = new int[v2 - v1 + 1]; + for (int i=0;i. + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 小于比较(<),对_Lt左右两值进行小于比较操作 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _LessThen extends Operator +{ + private final Expression left; + private final Expression right; + + public _LessThen(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return LTHEN; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + Object next = right.build(variableMap); + return ExpressionParser.compare(privous, next, this); + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" lt ").append(right).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_LessThenEqual.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_LessThenEqual.java new file mode 100644 index 0000000..a32d200 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_LessThenEqual.java @@ -0,0 +1,65 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 小于等于比较(<=),对_Lte左右两值进行小于等于比较操作 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _LessThenEqual extends Operator +{ + private final Expression left; + private final Expression right; + + public _LessThenEqual(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return LTEQUAL; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + Object next = right.build(variableMap); + return ExpressionParser.compare(privous, next, this); + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" lte ").append(right).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Method.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Method.java new file mode 100644 index 0000000..2232a7f --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Method.java @@ -0,0 +1,526 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Types; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.exception.StatementException; +import org.zhiqim.zml.expression.Operator; +import org.zhiqim.zml.expression.primitive._Variable; +import org.zhiqim.zml.statement._Function; + +/** + * 方法操作符,括号function(param1, param2)或obj.method(param1, param2) + * + * @see _Bracket 括号操作符,和方法操作符不同的是内部是表达式,方法操作符括号内为参数 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Method extends Operator +{ + private String methodName; + + private Expression obj; + private ArrayList paramList; + + public _Method(String methodName) + { + this.methodName = methodName; + this.paramList = new ArrayList(); + } + + @Override + public int getType() + { + return METHOD; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + if (obj == null) + {//如果前置对象不存在,则认为是调用全局函数 + return ZmlVariable.chkDynamicVar(buildFunction(variableMap)); + } + else if (obj instanceof _New) + {//如果前置对象是_New表示调用构造函数 + return ZmlVariable.chkDynamicVar(buildNewInstance(variableMap)); + } + else + {//对象存在则认为是调用对象的方法 + return ZmlVariable.chkDynamicVar(buildMethod(variableMap)); + } + } + + /** 方法是全局函数 */ + private Object buildFunction(ZmlVariable variableMap) throws ExpressionException + { + //先查本身是否有函数和是否包含里有函数 + _Function _function = null; + try{_function = variableMap.getFunction(methodName);}catch (StatementException e){throw new ExpressionException("方法表达式{"+this+"}"+e.getMessage(), e);} + + if (_function == null) + {//当前ZML中没有查全局 + ZmlEngine engine = variableMap.getEngine(); + if (engine != null) + { + try{_function = engine.getFunction(methodName);}catch(Exception e){throw new ExpressionException("方法表达式{"+this+"}"+e.getMessage(), e);} + } + } + + if (_function == null) + {//全局也没有抛异常 + throw new ExpressionException("方法表达式{"+this+"}ZML内部和全局函数都未找到该函数的定义"); + } + + //设置函数变量表,1.原变量表,2.实参变量传入 + MapSO pageMap = new HashMapSO(); + pageMap.putAll(variableMap.getVariableMap()); + + //采用javascript的方式,按实参顺序对应形参顺序 + List varList = _function.getVariableNameList(); + for (int i=0;i newClass = ZmlEngine.getJavaClass(methodName); + if (newClass == null) + newClass = Global.forName(methodName); + + if (newClass == null) + throw new ExpressionException("方法表达式{"+this+"}对应的new构造函数类名不正确"); + + Object[] paramArray = new Object[paramList.size()]; + for (int i=0;i constructor = null; + Constructor[] constructors = newClass.getConstructors(); + for (Constructor c : constructors) + { + //判断参数个数 + Class[] paramTypes = c.getParameterTypes(); + if (paramTypes.length != paramArray.length) + continue; + + //判断每个参数类型 + boolean isSuccess = true; + for (int i=0;i clazz = paramTypes[i]; + Object param = paramArray[i]; + if (param == null) + {//参数为null时,要求不是基本类型 + if (Types.isPrimitive(clazz)) + { + isSuccess = false; + break; + } + } + else if (Types.isPrimitive(clazz)) + {//基本类型,数值型不一定匹配,要适配 + if ((Types.isInteger(clazz) && !Types.isInteger(param))//long,int,short,byte + || (Types.isDecimal(clazz) && !Types.isDecimal(param))//float,double + || (Types.isBoolean(clazz) && !Types.isBoolean(param))//boolean + || (Types.isChar(clazz) && !Types.isChar(param)))//char + { + isSuccess = false; + break; + } + } + else + {//对象类型,判断是否其子类或本类 + if (clazz != param.getClass() && !clazz.isAssignableFrom(param.getClass())) + { + isSuccess = false; + break; + } + } + } + + if (!isSuccess) + continue; + + constructor = c; + break; + } + + if (constructor == null) + throw new ExpressionException("方法表达式{"+this+"},格式不正确,没有找到对应的构造函数"); + + //_Integer,_Double可能格式不同,要匹配 + Class[] paramTypes = constructor.getParameterTypes(); + for (int i=0;i clazz = paramTypes[i]; + if (!Types.isNumber(clazz)) + continue; + + if (Types.isDecimal(clazz)) + {//小数 + Object param = paramArray[i]; + if (!Types.isDecimal(param)) + throw new ExpressionException("方法表达式{"+this+"},格式不正确,参数不匹配,要求小数"); + + //需要对double/float进行匹配 + if (Types.isDouble(clazz)) + paramArray[i] = ((Number)param).doubleValue(); + else + paramArray[i] = ((Double)param).floatValue(); + } + else + {//整数 + Object param = paramArray[i]; + if (!Types.isInteger(param)) + throw new ExpressionException("方法表达式{"+this+"},格式不正确,参数不匹配,要求整数"); + + //需要对long/byte/short/int进行匹配 + if (Types.isLong(clazz)) + paramArray[i] = ((Number)param).longValue(); + else if (Types.isInt(clazz)) + paramArray[i] = ((Number)param).intValue(); + else if (Types.isShort(clazz)) + paramArray[i] = ((Number)param).shortValue(); + else + paramArray[i] = ((Number)param).byteValue(); + } + } + + //调用方法 + try + { + constructor.setAccessible(true); + return constructor.newInstance(paramArray); + } + catch (Exception e) + { + if (e instanceof InvocationTargetException) + throw new ExpressionException("方法表达式{"+this+"},调用失败{"+((InvocationTargetException)e).getTargetException().getMessage()+"}"); + else + throw new ExpressionException("方法表达式{"+this+"},调用失败{"+e.getMessage()+"}"); + } + } + + /** 对象方法 */ + private Object buildMethod(ZmlVariable variableMap) throws ExpressionException + { + Object target = obj.build(variableMap); + if (target != null) + return buildMethod(variableMap, target.getClass(), target); + + if (!(obj instanceof _Variable)) + return null; + + Class targetClass = ((_Variable)obj).buildClass(); + if (targetClass == null) + return null; + + return buildMethod(variableMap, targetClass, null); + } + + /** 对象方法 */ + private Object buildMethod(ZmlVariable variableMap, Class targetClass, Object target) throws ExpressionException + { + //1.先漏选方法,把名称不同的和要求静态方法但不是静态方法的去掉 + List normalMethodList = new ArrayList<>(); + List arrayMethodList = new ArrayList<>(); + + Method[] methods = targetClass.getMethods(); + for (Method m : methods) + { + if (!m.getName().equals(methodName)) + continue; + + if (target == null && !Classes.isStaticMethod(m)) + continue; + + if (Classes.isMethodLastParamArray(m)) + arrayMethodList.add(m); + else + normalMethodList.add(m); + } + + if (normalMethodList.isEmpty()) + {//未找到对应的方法 + throw new ExpressionException("方法表达式{"+this+"},格式不正确,没有找到对应的方法名或要求是静态方法"); + } + + Object[] paramArray = new Object[paramList.size()]; + for (int i=0;i[] paramTypes = m.getParameterTypes(); + if (Classes.isMethodParamMatch(paramTypes, paramArray)) + {//正常的参数个数匹配成功 + method = m; + break; + } + } + + if (method == null) + {//2.2再找最后一个参数是数组的,转化个数相等再比较 + for (Method m : arrayMethodList) + { + //判断参数个数 + Class[] paramTypes = m.getParameterTypes(); + int typeLen = paramTypes.length; + int arrayLen = paramArray.length; + if (typeLen > arrayLen) + {//大于的 + continue; + } + else if (typeLen == arrayLen) + {//相等的 + if (Classes.isMethodParamMatch(paramTypes, paramArray)) + { + method = m; + break; + } + } + else + {//小于的,则支持参数最后部分转化为多个参数方式String... params的形参,而实参是"abc", "bde"的情况 + Class paramLastType = paramTypes[typeLen-1].getComponentType(); + Class[] newParamTypes = new Class[arrayLen]; + for (int i=0;i[] paramTypes = method.getParameterTypes(); + for (int i=0;i clazz = paramTypes[i]; + if (!Types.isNumber(clazz)) + continue; + + if (Types.isDecimal(clazz)) + {//小数 + Object param = paramArray[i]; + if (!Types.isDecimal(param)) + throw new ExpressionException("方法表达式{"+this+"},格式不正确,方法名找到且参数个数一致,参数值不匹配,要求小数"); + + //需要对double/float进行匹配 + if (Types.isDouble(clazz)) + paramArray[i] = ((Number)param).doubleValue(); + else + paramArray[i] = ((Double)param).floatValue(); + } + else + {//整数 + Object param = paramArray[i]; + if (!Types.isInteger(param)) + throw new ExpressionException("方法表达式{"+this+"},格式不正确,方法名找到且参数个数一致,参数不匹配,要求整数"); + + //需要对long/byte/short/int进行匹配 + if (Types.isLong(clazz)) + paramArray[i] = ((Number)param).longValue(); + else if (Types.isInt(clazz)) + paramArray[i] = ((Number)param).intValue(); + else if (Types.isShort(clazz)) + paramArray[i] = ((Number)param).shortValue(); + else + paramArray[i] = ((Number)param).byteValue(); + } + } + + //4.最后一个形参是数组,而实参不是数组的转变为数组 + boolean lastParamIsArray = paramTypes.length > 0 && Types.isArray(paramTypes[paramTypes.length-1]); + if (lastParamIsArray && !Types.isArray(paramArray[paramTypes.length-1])) + { + Class paramLastType = paramTypes[paramTypes.length-1].getComponentType(); + int num = paramArray.length-paramTypes.length+1; + Object[] objs = Classes.newInstance(paramLastType, num); + for (int i=0;i eList = bracket.getExpressionList(); + eList.trimToSize(); + + //左右括号去除 + eList.remove(0); + eList.remove(eList.size()-1); + + //解析所有操作符 + ExpressionParser.parse_Operator(eList); + + //对结果进行分析,除逗号外都是参数 + for (Expression expression : eList) + { + int type = expression.getType(); + if (type == COMMA) + continue;//,除外 + + paramList.add(expression); + } + + eList = null; + paramList.trimToSize(); + } + +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Modulus.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Modulus.java new file mode 100644 index 0000000..f51da73 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Modulus.java @@ -0,0 +1,73 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.kernel.util.Types; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 求模运算(%) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Modulus extends Operator +{ + private final Expression left; + private final Expression right; + + public _Modulus(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return MODULUS; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + Object next = right.build(variableMap); + + if (!Types.isInteger(privous) || !Types.isInteger(next)) + {//不是整数 + throw new ExpressionException("求模表达式{"+this+"},格式不正确,除数或被除数不是整数"); + } + + long dividend = ((Number)privous).longValue(); + long divisor = ((Number)next).longValue(); + return dividend % divisor; + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" % ").append(right).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Multiplication.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Multiplication.java new file mode 100644 index 0000000..23fd0fd --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Multiplication.java @@ -0,0 +1,87 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.kernel.util.Types; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 乘法运算符(*) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Multiplication extends Operator +{ + private final Expression left; + private final Expression right; + + public _Multiplication(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return MULTIPLICATION; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + Object next = right.build(variableMap); + + if (!Types.isNumber(privous) || !Types.isNumber(next)) + {//不是整数和小数 + throw new ExpressionException("乘法表达式{"+this+"},格式不正确,出现乘数不是数值型"); + } + + Number p = (Number)privous; + Number n = (Number)next; + + if (Types.isInteger(privous)) + {//整数 + if (Types.isInteger(next)) + return p.longValue() * n.longValue(); + else + return p.longValue() * n.doubleValue(); + } + else + {//小数 + if (Types.isInteger(next)) + return p.doubleValue() * n.longValue(); + else + return p.doubleValue() * n.doubleValue(); + } + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" * ").append(right).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Negative.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Negative.java new file mode 100644 index 0000000..5dbb1ca --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Negative.java @@ -0,0 +1,105 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; +import org.zhiqim.zml.expression.primitive._Decimal; +import org.zhiqim.zml.expression.primitive._Integer; + +/** + * 取负运算(-) + * + * @see _Subtraction 和减号 运算符相同,要注意区分 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Negative extends Operator +{ + private final Expression obj; + + public _Negative(Expression obj) + { + this.obj = obj; + } + + @Override + public int getType() + { + return NEGATIVE; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object value = obj.build(variableMap); + if (value instanceof Long) + { + long v = (Long)value; + return -v; + } + else if (value instanceof Double) + { + double v = (Double)value; + return -v; + } + + throw new ExpressionException("取负表达式{"+this+"}格式不正常,要求结果不是整数或小数"); + } + + @Override + public String toString() + { + return new StringBuilder("-").append(obj).toString() ; + } + + public Number getValue() throws ExpressionException + { + if (obj instanceof _Integer) + { + _Integer value = (_Integer)obj; + return -value.getLong(); + } + else if (obj instanceof _Decimal) + { + _Decimal value = (_Decimal)obj; + return -value.getDouble(); + } + else if (obj instanceof _Bracket) + { + Expression expression = ((_Bracket)obj).getExpression(); + if (expression instanceof _Integer) + { + _Integer value = (_Integer)obj; + return -value.getLong(); + } + else if (expression instanceof _Decimal) + { + _Decimal value = (_Decimal)obj; + return -value.getDouble(); + } + } + + throw new ExpressionException("[逻辑取负运算符]解析时异常,对象不是数值型["+obj+"]"); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_New.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_New.java new file mode 100644 index 0000000..90cd222 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_New.java @@ -0,0 +1,53 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * new 运算符,搭配_Method一起完成newInstance + * @see _Method + * + * @version v1.0.0 @author zouzhigang 2016-6-27 新建与整理 + */ +public class _New extends Operator +{ + @Override + public int getType() + { + return NEW; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + return null; + } + + @Override + public String toString() + { + return "new"; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Not.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Not.java new file mode 100644 index 0000000..ae30fb8 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Not.java @@ -0,0 +1,67 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 取反运算(!) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Not extends Operator +{ + private final Expression obj; + + public _Not(Expression obj) + { + this.obj = obj; + } + + @Override + public int getType() + { + return NOT; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object value = obj.build(variableMap); + if (value instanceof Boolean) + { + boolean v = (Boolean)value; + return !v; + } + + throw new ExpressionException("取反表达式{"+this+"}格式不正常,要求结果不是布尔型"); + } + + @Override + public String toString() + { + return new StringBuilder("!").append(obj).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Or.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Or.java new file mode 100644 index 0000000..34ad198 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Or.java @@ -0,0 +1,74 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.kernel.util.Types; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 或运算符(||) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Or extends Operator +{ + private final Expression left; + private final Expression right; + + public _Or(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return OR; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + if (!Types.isBoolean(privous)) + throw new ExpressionException("逻辑或表达式{"+this+"}格式不正常,要求结果不是布尔型"); + + if ((Boolean)privous) + return true;//当左值为真时,不处理右值 + + Object next = right.build(variableMap); + if (!Types.isBoolean(next)) + throw new ExpressionException("逻辑或表达式{"+this+"}格式不正常,要求结果不是布尔型"); + + return (Boolean)next; + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" || ").append(right).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Property.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Property.java new file mode 100644 index 0000000..9cc7481 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Property.java @@ -0,0 +1,126 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import java.lang.reflect.Field; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.exception.PropertNotExistException; +import org.zhiqim.zml.expression.Operator; + +/** + * 属性表达式,来自两种方式 + * 1.点号表示法:variable.property + * 2.索引表示法:variable["property"] + * + * @version v1.0.0 @author zouzhigang 2016-12-23 新建与整理 + */ +public class _Property extends Operator +{ + private String variable; + private Class clazz; + private Object target; + + private final String property; + + public _Property(String variable, String property) + { + this.variable = variable; + this.property = property; + } + + public _Property(Class clazz, String property) + { + this.clazz = clazz; + this.property = property; + } + + public _Property(Object target, String property) + { + this.target = target; + this.property = property; + } + + @Override + public int getType() + { + return PROPERTY; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + ExpressionException.asserts(clazz != null || variable != null || target != null, "属性表达式{"+this+"},实例和类不能都为null"); + ExpressionException.assertNotNull(property, "属性表达式{"+this+"},属性名不能为null"); + + if (target != null) + {//实例属性 + Field field = Classes.getFieldDeep(target.getClass(), property); + if (field != null) + {//找到字段,则表示定义是正确的 + return Classes.getFieldValue(target, field); + } + } + else if (clazz != null) + {//静态属性 + Field field = Classes.getFieldStaticDeep(clazz, property); + if (field != null) + {//找到字段,则表示定义是正确的 + return Classes.getFieldValue(null, field); + } + } + else + {//通过名称先判断实例属性还判断静态属性 + + //1.先查实例属性 + Object obj = variableMap.get(variable); + if (obj != null) + { + Field field = Classes.getFieldDeep(obj.getClass(), property); + if (field != null) + {//找到字段,则表示定义是正确的 + return Classes.getFieldValue(obj, field); + } + } + + //2 再查静态属性 + Class clazz = ZmlEngine.getJavaClass(variable); + if (clazz == null) + clazz = Global.forName(variable); + + if (clazz != null) + { + Field field = Classes.getFieldStaticDeep(clazz, property); + if (field != null) + {//找到字段,则表示定义是正确的 + return Classes.getFieldValue(null, field); + } + } + } + + throw new PropertNotExistException("未找到对应的属性"); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Subtraction.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Subtraction.java new file mode 100644 index 0000000..21a9c53 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Subtraction.java @@ -0,0 +1,133 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.kernel.util.Types; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 减法运算(-),支持整数、小数和字符相减

              + * + * 1、整数相减 56-23,46-21.12,102-'A'
              + * 2、小数相减 56.6-23,46.9-21.12,102.2-'A'
              + * 3、字符相减 'A'-23,'a'-21.12,'Z'-'A'
              + * @see _Negative 和逻辑取负 运算符相同,要注意区分 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Subtraction extends Operator +{ + private final Expression left; + private final Expression right; + + public _Subtraction(Expression left, Expression right) + { + this.left = left; + this.right = right; + } + + @Override + public int getType() + { + return SUBTRACTION; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object privous = left.build(variableMap); + Object next = right.build(variableMap); + + if ((!Types.isNumber(privous) && !Types.isChar(privous)) + || (!Types.isNumber(next) && !Types.isChar(next))) + {//不是整数和小数 + throw new ExpressionException("减法表达式{"+this+"},格式不正确,减数或被减数不是数值型"); + } + + if (Types.isInteger(privous)) + {//整数 + long minuend = ((Number)privous).longValue(); + if (Types.isInteger(next)) + { + long subtrahend = ((Number)next).longValue(); + return minuend - subtrahend; + } + else if (Types.isDecimal(next)) + { + double subtrahend = ((Number)next).doubleValue(); + return minuend - subtrahend; + } + else + { + char subtrahend = (Character)next; + return minuend - subtrahend; + } + } + else if (Types.isDecimal(privous)) + {//小数 + double minuend = ((Number)privous).doubleValue(); + if (Types.isInteger(next)) + { + long subtrahend = ((Number)next).longValue(); + return minuend - subtrahend; + } + else if (Types.isDecimal(next)) + { + double subtrahend = ((Number)next).doubleValue(); + return minuend - subtrahend; + } + else + { + char subtrahend = (Character)next; + return minuend - subtrahend; + } + } + else + {//字符 + char minuend = (Character)privous; + if (Types.isInteger(next)) + { + long subtrahend = ((Number)next).longValue(); + return minuend - subtrahend; + } + else if (Types.isDecimal(next)) + { + double subtrahend = ((Number)next).doubleValue(); + return minuend - subtrahend; + } + else + { + char subtrahend = (Character)next; + return minuend - subtrahend; + } + } + } + + @Override + public String toString() + { + return new StringBuilder().append(left).append(" - ").append(right).toString() ; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Ternary.java b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Ternary.java new file mode 100644 index 0000000..01566b2 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/operator/_Ternary.java @@ -0,0 +1,70 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.operator; + +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Operator; + +/** + * 三目运算(?a:b) + * + * @version v1.0.0 @author zouzhigang 2018-1-2 新建与整理 + */ +public class _Ternary extends Operator +{ + private Expression obj; + private Expression first; + private Expression second; + + public _Ternary(Expression condition, Expression first, Expression second) + { + this.obj = condition; + this.first = first; + this.second = second; + } + + @Override + public int getType() + { + return TERNARY; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + Object value = obj.build(variableMap); + if (value == null) + {//为null时,采用js的规则,判断为false + return second.build(variableMap); + } + + if (value instanceof Boolean) + {//值为boolean型 + return ((Boolean)value)?first.build(variableMap):second.build(variableMap); + } + + //非null且非boolean的不支持 + throw new ExpressionException("三目表达式{"+this+"}格式不正常,条件不是布尔型"); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Boolean.java b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Boolean.java new file mode 100644 index 0000000..268392e --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Boolean.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.primitive; + +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Primitive; + +/** + * 布尔原型,true/false + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Boolean extends Primitive +{ + private final boolean value; + + public _Boolean(boolean value) + { + this.value = value; + } + + @Override + public int getType() + { + return BOOLEAN; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + return value; + } + + @Override + public String toString() + { + return String.valueOf(value); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Char.java b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Char.java new file mode 100644 index 0000000..34231b6 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Char.java @@ -0,0 +1,93 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.primitive; + +import org.zhiqim.kernel.util.Asserts; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Primitive; + +/** + * 字符原型,格式为用单引号之内的一个字母或符号,如'a','$' + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Char extends Primitive +{ + private final char value; + + public _Char(String value) + { + Asserts.as(Validates.isLen(value, 3, 4)?null:"字符["+value+"]格式不对"); + Asserts.as(value.startsWith("'")?null:"字符["+value+"]格式不对"); + Asserts.as(value.endsWith("'")?null:"字符["+value+"]格式不对"); + + value = value.substring(1, value.length()-1); + if (value.length() == 1) + { + this.value = value.charAt(0); + return; + } + + //长度==2时,第一个字符必须是转义字符 + Asserts.as(value.length() == 2?null:"字符["+value+"]格式不对"); + Asserts.as('\\' == value.charAt(0)?null:"字符["+value+"]格式不对"); + + char tc = value.charAt(1); + switch (tc) + { + case '\\':this.value = '\\';;break; + case '\"':this.value = '\"';break; + case '\'':this.value = '\'';break; + case 'b':this.value = '\b';break; + case 'f':this.value = '\f';break; + case 'n':this.value = '\n';break; + case 'r':this.value = '\r';break; + case 't':this.value = '\t';break; + default:throw Asserts.exception("字符["+value+"]格式不对"); + } + } + + @Override + public int getType() + { + return CHAR; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + return value; + } + + @Override + public String toString() + { + return String.valueOf(value); + } + + public char getValue() + { + return value; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Class.java b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Class.java new file mode 100644 index 0000000..c2167d6 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Class.java @@ -0,0 +1,72 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.primitive; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Primitive; + +/** + * 类原型,如FTable.class + * + * @version v1.0.0 @author zouzhigang 2016-6-27 新建与整理 + */ +public class _Class extends Primitive +{ + private String value; + + public _Class(String value) + { + this.value = value; + } + + @Override + public int getType() + { + return CLASS; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + String className = Strings.trimRight(value, ".class"); + return Global.forName(className); + } + + @Override + public String toString() + { + return "class"; + } + + public String getValue() + { + return value; + } + + public void setValue(String value) + { + this.value = value; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Decimal.java b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Decimal.java new file mode 100644 index 0000000..01c2cd9 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Decimal.java @@ -0,0 +1,74 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.primitive; + +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Primitive; +import org.zhiqim.zml.expression.operator._Negative; + +/** + * 小数原型,float/double,零点开头后面为数字,或非零数字开头数字和一个点号连贯出现"^(0|[1-9]\\d*)(\\.\\d+)?$" + * + * @see _Negative 逻辑取负,如果前面有-号,则为负小数原型 + * + * @see Float 四个字节 + * @see Double 八个字节 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Decimal extends Primitive +{ + private final String value; + + public _Decimal(String value) + { + this.value = value; + } + + @Override + public int getType() + { + return DECIMAL; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + return Double.parseDouble(value); + } + + @Override + public String toString() + { + return value; + } + + public double getDouble() + { + return Double.parseDouble(value); + } + + public float getFloat() + { + return Float.parseFloat(value); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Integer.java b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Integer.java new file mode 100644 index 0000000..1132a34 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Integer.java @@ -0,0 +1,84 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.primitive; + +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Primitive; + +/** + * 整数原型,byte/short/int/long,非零数字开头数字连贯出现"^[1-9]\\d*$"

              + * 但是实际中可能出现0123,这种情况,和点号一起组合成_Decimal + * + * @see Byte 一个字节 + * @see Short 二个字节 + * @see Integer 四个字节 + * @see Long 八个字节 + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Integer extends Primitive +{ + private final String value; + + public _Integer(String value) + { + this.value = value; + } + + @Override + public int getType() + { + return NUMBERIC; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + return Long.parseLong(value); + } + + @Override + public String toString() + { + return value; + } + + public long getLong() + { + return Long.parseLong(value); + } + + public int getInt() + { + return Integer.parseInt(value); + } + + public short getShort() + { + return Short.parseShort(value); + } + + public byte getByte() + { + return Byte.parseByte(value); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Null.java b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Null.java new file mode 100644 index 0000000..49c763e --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Null.java @@ -0,0 +1,46 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.primitive; + +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Primitive; + +/** + * null原型 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Null extends Primitive +{ + @Override + public int getType() + { + return NULL; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + return null; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_String.java b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_String.java new file mode 100644 index 0000000..7dcd4ac --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_String.java @@ -0,0 +1,60 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.primitive; + +import org.zhiqim.kernel.json.Jsons; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.expression.Primitive; + +/** + * 字符串原型,格式为""或''之间的内容,注意转义字符 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _String extends Primitive +{ + private final String value; + + public _String(String value) + { + this.value = Jsons.removeStartEndQuotation(value); + } + + @Override + public int getType() + { + return STRING; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + return value; + } + + @Override + public String toString() + { + return new StringBuilder().append("\"").append(value).append("\"").toString(); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Variable.java b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Variable.java new file mode 100644 index 0000000..3cbf53b --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/primitive/_Variable.java @@ -0,0 +1,144 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.primitive; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.annotation.AnGlobal; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.exception.PropertNotExistException; +import org.zhiqim.zml.expression.Primitive; +import org.zhiqim.zml.expression.operator._Property; + +/** + * 变量原型,格式为字母或下划线开头,(字母、下划线和数字)连贯 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + * @version v1.0.1 @author zouzhigang 2015-10-22 增加对AnAlias,AnStatic,AnGlobal,AnNew的支持 + * @version v1.2.2 @author zhichenggang 2016-12-21 删除AnStatic的支持,修改为增加buildClass当是类结构但不是AnGlobal,AnNew时再检查调用 + * @version v1.4.0 @author zouzhigang 2018-01-19 删除对AnNew的支持,AnNew定义为必须前缀new的别名对象 + */ +public class _Variable extends Primitive +{ + private String value; + private Class cls; + + public _Variable(String value) + { + this.value = value; + } + + /** 重新设置值 */ + public void setValue(String value) + { + this.value = value; + } + + @Override + public int getType() + { + return VARIABLE; + } + + @Override + public Object build(ZmlVariable variableMap) throws ExpressionException + { + //1.判断是不是变量,如果是返回变量值 + Object instance = variableMap.get(value); + if (instance != null) + return instance; + + //2.判断是否是java系统类名String,List等 + Class cls = ZmlEngine.getJavaClass(value); + if (cls != null) + { + //认为是通过类去调用静态属性或方式,直接返回null,调用者再从buildClass获取clazz去调用 + this.cls = cls; + return null; + } + + //3.判断是否是AnAlias别名定义的类名,如Validates,DateTimes + cls = Global.getClass(value); + if (cls != null) + { + return returnAliasInstance(cls); + } + + //4.判断是否是属性,即variable.property方式 + int lastIndex = value.lastIndexOf("."); + if (lastIndex != -1) + { + String name = value.substring(0, lastIndex); + String prop = value.substring(lastIndex+1); + + try + { + return new _Property(name, prop).build(variableMap); + } + catch(PropertNotExistException e) + { + //属性未找到则不返回 + } + } + + //5.最后认为是类全称,如org.zhiqim.kernel.util.Validates全名,或没有包名的类,如ATest + cls = Classes.forName(value); + if (cls != null) + {//最少可能且最慢放最后 + return returnAliasInstance(cls); + } + + //都不对,就没办法了啦! + return null; + } + + /** 在_Method中当build为null时再检查是否是调用静态方法 */ + public Class buildClass() + { + return this.cls; + } + + private Object returnAliasInstance(Class cls) + { + if (cls.isAnnotationPresent(AnGlobal.class)) + {//定义了AnGlobal + return Global.getWithoutNew(cls); + } + + //其他的认为是通过类去调用静态属性或方式,直接返回null,调用者再从buildClass + this.cls = cls; + return null; + } + + @Override + public String toString() + { + return value; + } + + public String getValue() + { + return value; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Ampersand.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Ampersand.java new file mode 100644 index 0000000..7622bd6 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Ampersand.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.ExpressionPair; +import org.zhiqim.zml.expression.Symbol; + +/** + * 和与号原型(&&) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Ampersand extends Symbol implements ExpressionPair +{ + private boolean paired; + + @Override + public int getType() + { + return CONNECTOR; + } + + @Override + public String toString() + { + return " && "; + } + + @Override + public boolean isPaired() + { + return paired; + } + + @Override + public void setPaired() + { + this.paired = true; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Asterisk.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Asterisk.java new file mode 100644 index 0000000..fd260c9 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Asterisk.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 星号原型(*)乘号 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Asterisk extends Symbol +{ + @Override + public int getType() + { + return ASTERISK; + } + + @Override + public String toString() + { + return " * "; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_CloseBracket.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_CloseBracket.java new file mode 100644 index 0000000..2a94c66 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_CloseBracket.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 右方括号原型(]) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _CloseBracket extends Symbol +{ + @Override + public int getType() + { + return BRACKET_SQUARE_RIGHT; + } + + @Override + public String toString() + { + return "]"; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_CloseParenthesis.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_CloseParenthesis.java new file mode 100644 index 0000000..2ee8357 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_CloseParenthesis.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 右圆括号原型()) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _CloseParenthesis extends Symbol +{ + @Override + public int getType() + { + return BRACKET_RIGHT; + } + + @Override + public String toString() + { + return ")"; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Colon.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Colon.java new file mode 100644 index 0000000..2ad14e3 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Colon.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 分号原型(:),用于三目运算 + * + * @version v1.0.0 @author zouzhigang 2018-1-2 新建与整理 + */ +public class _Colon extends Symbol +{ + @Override + public int getType() + { + return COLON; + } + + @Override + public String toString() + { + return ":"; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Comma.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Comma.java new file mode 100644 index 0000000..bde0c89 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Comma.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 逗号原型(,) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Comma extends Symbol +{ + @Override + public int getType() + { + return COMMA; + } + + @Override + public String toString() + { + return ", "; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Dot.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Dot.java new file mode 100644 index 0000000..43c133d --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Dot.java @@ -0,0 +1,64 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.ExpressionPair; +import org.zhiqim.zml.expression.Symbol; +import org.zhiqim.zml.expression.operator._Method; +import org.zhiqim.zml.expression.primitive._Decimal; + +/** + * 点号原型(.)

              + * + * @see _Decimal 浮点型,Integer._Integer
              + * @see _Method 方法访问,_Name._Name_BracketLeft
              + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Dot extends Symbol implements ExpressionPair +{ + private boolean paired; + + @Override + public int getType() + { + return DOT; + } + + @Override + public String toString() + { + return "."; + } + + @Override + public boolean isPaired() + { + return paired; + } + + @Override + public void setPaired() + { + paired = true; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_DotDot.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_DotDot.java new file mode 100644 index 0000000..7d3eca6 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_DotDot.java @@ -0,0 +1,45 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 双点号原型(..) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _DotDot extends Symbol +{ + @Override + public int getType() + { + return DOTDOT; + } + + @Override + public String toString() + { + return ".."; + } + +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Equal.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Equal.java new file mode 100644 index 0000000..b08bd75 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Equal.java @@ -0,0 +1,60 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.ExpressionPair; +import org.zhiqim.zml.expression.Symbol; + +/** + * 等号原型(=) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Equal extends Symbol implements ExpressionPair +{ + private boolean paired; + + @Override + public int getType() + { + return EQUAL; + } + + @Override + public String toString() + { + return " = "; + } + + @Override + public boolean isPaired() + { + return paired; + } + + @Override + public void setPaired() + { + paired = true; + } + +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Exclamation.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Exclamation.java new file mode 100644 index 0000000..f379c4e --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Exclamation.java @@ -0,0 +1,60 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.ExpressionPair; +import org.zhiqim.zml.expression.Symbol; + +/** + * 感叹号原型(!) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Exclamation extends Symbol implements ExpressionPair +{ + private boolean paired; + + @Override + public int getType() + { + return EXCLAMATION; + } + + @Override + public String toString() + { + return "!"; + } + + @Override + public boolean isPaired() + { + return paired; + } + + @Override + public void setPaired() + { + paired = true; + } + +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Gt.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Gt.java new file mode 100644 index 0000000..6065fdd --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Gt.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 大于号原型(gt) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Gt extends Symbol +{ + @Override + public int getType() + { + return GT; + } + + @Override + public String toString() + { + return " gt "; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Gte.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Gte.java new file mode 100644 index 0000000..89f7520 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Gte.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 大于号原型(gte) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Gte extends Symbol +{ + @Override + public int getType() + { + return GTE; + } + + @Override + public String toString() + { + return " gte "; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Inequal.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Inequal.java new file mode 100644 index 0000000..d8c9117 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Inequal.java @@ -0,0 +1,45 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 不等号原型(!=) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Inequal extends Symbol +{ + @Override + public int getType() + { + return INEQUAL; + } + + @Override + public String toString() + { + return " != "; + } + +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Lt.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Lt.java new file mode 100644 index 0000000..cb05c43 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Lt.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 小于号原型(lt) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Lt extends Symbol +{ + @Override + public int getType() + { + return LT; + } + + @Override + public String toString() + { + return " lt "; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Lte.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Lte.java new file mode 100644 index 0000000..c4fb93e --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Lte.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 小于等于号原型(lte) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Lte extends Symbol +{ + @Override + public int getType() + { + return LTE; + } + + @Override + public String toString() + { + return " lte "; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Minus.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Minus.java new file mode 100644 index 0000000..ae3e346 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Minus.java @@ -0,0 +1,45 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 减号/取负原型(-) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Minus extends Symbol +{ + @Override + public int getType() + { + return MINUS; + } + + @Override + public String toString() + { + return "-"; + } + +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_OpenBracket.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_OpenBracket.java new file mode 100644 index 0000000..e44def2 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_OpenBracket.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 左方括号原型([) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _OpenBracket extends Symbol +{ + @Override + public int getType() + { + return BRACKET_SQUARE_LEFT; + } + + @Override + public String toString() + { + return "["; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_OpenParenthesis.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_OpenParenthesis.java new file mode 100644 index 0000000..224600d --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_OpenParenthesis.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 左圆括号原型(() + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _OpenParenthesis extends Symbol +{ + @Override + public int getType() + { + return BRACKET_LEFT; + } + + @Override + public String toString() + { + return "("; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Percent.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Percent.java new file mode 100644 index 0000000..e400e6a --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Percent.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 百分号原型(%),取模 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Percent extends Symbol +{ + @Override + public int getType() + { + return PERCENT; + } + + @Override + public String toString() + { + return "%"; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Plus.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Plus.java new file mode 100644 index 0000000..e6416b6 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Plus.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 加号/连接原型(+) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Plus extends Symbol +{ + @Override + public int getType() + { + return PLUS; + } + + @Override + public String toString() + { + return "+"; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Question.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Question.java new file mode 100644 index 0000000..2a1bce9 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Question.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 问号原型(?),用于三目运算 + * + * @version v1.0.0 @author zouzhigang 2018-1-2 新建与整理 + */ +public class _Question extends Symbol +{ + @Override + public int getType() + { + return QUESTION; + } + + @Override + public String toString() + { + return "?"; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Slash.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Slash.java new file mode 100644 index 0000000..c1e3f43 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_Slash.java @@ -0,0 +1,45 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.expression.Symbol; + +/** + * 斜杠原型(/),除法 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Slash extends Symbol +{ + @Override + public int getType() + { + return SLASH; + } + + @Override + public String toString() + { + return "/"; + } + +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_VerticalBar.java b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_VerticalBar.java new file mode 100644 index 0000000..dfc6c69 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/expression/symbol/_VerticalBar.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.expression.symbol; + +import org.zhiqim.zml.ExpressionPair; +import org.zhiqim.zml.expression.Symbol; + +/** + * 双竖杠符号原型(||) + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _VerticalBar extends Symbol implements ExpressionPair +{ + private boolean paired; + + @Override + public int getType() + { + return VERTICAL; + } + + @Override + public String toString() + { + return " || "; + } + + @Override + public boolean isPaired() + { + return paired; + } + + @Override + public void setPaired() + { + this.paired = true; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/loader/ClassZmlLoader.java b/zhiqim_zml/src/org/zhiqim/zml/loader/ClassZmlLoader.java new file mode 100644 index 0000000..c7b206e --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/loader/ClassZmlLoader.java @@ -0,0 +1,129 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.loader; + +import java.net.URL; +import java.net.URLConnection; + +import org.zhiqim.kernel.util.Resources; +import org.zhiqim.kernel.util.Streams; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.Zml; +import org.zhiqim.zml.ZmlCache; +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.zml.ZmlLoader; + +/** + * 类路径ZML加载器,指定类根路径和加载类,传入相对路径即可 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class ClassZmlLoader implements ZmlLoader +{ + private final ZmlEngine engine; //ZML引擎 + private final ZmlCache cache; //ZML缓存 + private final ClassZmlWatcher watcher; //类ZML监视 + + private final Class loadClass; //加载类 + private final String contextPath; //根路径 + + /** + * 类路径ZML加载器构造方法 + * + * @param engine ZML引擎 + * @param loadClass 指定可访问到ZML文件的加载类 + * @param contextPath ZML路径前缀 + */ + public ClassZmlLoader(ZmlEngine engine, Class loadClass, String contextPath) + { + //对pathPrefix检查和处理,要求格式为/org/zhiqim/example/这种格式,最终会增加前缀/和删除后面的/ + contextPath = Strings.addStartsWith(contextPath, "/"); + contextPath = Strings.removeEndsWith(contextPath, "/"); + + this.engine = engine; + this.loadClass = loadClass; + this.contextPath = contextPath; + this.cache = new ZmlCache(engine.getMaxIdleTime(), engine.getMaxKeepTime()); + this.watcher = new ClassZmlWatcher(loadClass, contextPath); + } + + /** 获取上下文环境路径 */ + public String getContextPath() + { + return contextPath; + } + + @Override + public boolean hasZml(String path) throws Exception + { + return getLastModified(path) != -1; + } + + @Override + public Zml loadZml(String path) throws Exception + { + long lastModified = getLastModified(path); + if (lastModified == -1) + { + cache.remove(path); + return null; + } + + Zml zml = cache.get(path); + if (zml != null && lastModified == zml.getLastModified()) + {//在缓存中找到,并且缓存最修改时间和文件相同返回缓存中的ZML + return zml; + } + + //未找到或最后修改时间不同,则重找 + URL url = Resources.getResource(loadClass, contextPath + path); + URLConnection conn = url.openConnection(); + String content = Streams.getString(conn.getInputStream(), engine.getEncoding()); + zml = new Zml(engine, path, lastModified, content); + cache.put(path, zml); + return zml; + } + + @Override + public long getLastModified(String path) throws Exception + { + if (!Strings.startsWith(path, "/") || !Validates.isMatch(path, engine.getPatterns())) + {//要求相对于根目录的绝对路径 + throw new Exception("ZML["+path+"]配置不正确,必须/开头且符合配置的模式"); + } + + return watcher.getLastModified(path); + } + + @Override + public void setMaxIdleTime(int maxIdleTime) + { + this.cache.setMaxIdleTime(maxIdleTime); + } + + @Override + public void setMaxKeepTime(int maxKeepTime) + { + this.cache.setMaxKeepTime(maxKeepTime); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/loader/ClassZmlWatcher.java b/zhiqim_zml/src/org/zhiqim/zml/loader/ClassZmlWatcher.java new file mode 100644 index 0000000..ef57070 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/loader/ClassZmlWatcher.java @@ -0,0 +1,79 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.loader; + +import java.io.IOException; +import java.net.URL; +import java.net.URLConnection; + +import org.zhiqim.kernel.extend.HashMapSV; +import org.zhiqim.kernel.util.Resources; + +/** + * ZML类目录检查,所有包含*.zml文件的包,当前采用11秒内不检查 + * TODO 在1.4版本后续中进行优化 + * + * @version v1.0.0 @author zouzhigang 2016-7-13 新建与整理 + */ +public class ClassZmlWatcher +{ + private final Class loadClass; + private final String pathPrefix; + private final HashMapSV modifiedMap; + + public ClassZmlWatcher(Class loadClass, String pathPrefix) + { + this.loadClass = loadClass; + this.pathPrefix = pathPrefix; + this.modifiedMap = new HashMapSV<>(); + } + + public long getLastModified(String path) + { + long[] value = modifiedMap.get(path); + if (value != null) + { + if (System.currentTimeMillis() - value[1] < 11 * 1000) + return value[0];//11秒内不再检查更新 + } + + URL url = Resources.getResource(loadClass, pathPrefix + path); + if (url == null) + {//未找到,直接返回-1 + modifiedMap.remove(path); + return -1; + } + + try + { + URLConnection conn = url.openConnection(); + long lastModified = conn.getLastModified(); + modifiedMap.put(path, new long[]{lastModified, System.currentTimeMillis()}); + return lastModified; + } + catch (IOException e) + { + modifiedMap.remove(path); + return -1; + } + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/loader/FileZmlLoader.java b/zhiqim_zml/src/org/zhiqim/zml/loader/FileZmlLoader.java new file mode 100644 index 0000000..0c5934e --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/loader/FileZmlLoader.java @@ -0,0 +1,117 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.loader; + +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.Zml; +import org.zhiqim.zml.ZmlCache; +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.zml.ZmlLoader; + +/** + * ZML文件加载器,指定文件根目录,传入相对目录即可 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class FileZmlLoader implements ZmlLoader +{ + private final ZmlEngine engine; //ZML引擎 + private final ZmlCache cache; //ZML缓存 + private final FileZmlWatcher watcher; //ZML文件监视 + + private String contextPath; + + /** + * ZML文件加载器 + * + * @param engine ZML引擎 + * @param contextPath ZML前缀 + */ + public FileZmlLoader(ZmlEngine engine, String contextPath) + { + this.engine = engine; + this.contextPath = Files.toLinuxPath(contextPath); + + this.cache = new ZmlCache(engine.getMaxIdleTime(), engine.getMaxIdleTime()); + this.watcher = new FileZmlWatcher(engine, this.contextPath); + } + + /** 获取上下文环境路径 */ + public String getContextPath() + { + return contextPath; + } + + @Override + public boolean hasZml(String path) throws Exception + { + return getLastModified(path) != -1; + } + + @Override + public Zml loadZml(String path) throws Exception + { + long lastModified = watcher.getLastModified(path); + if (lastModified == -1) + {//文件不存在删除缓存返回null + cache.remove(path); + return null; + } + + Zml zml = cache.get(path); + if (zml != null && lastModified == zml.getLastModified()) + {//有缓存且时间相同 + return zml; + } + + String filePath = contextPath + path; + String content = Files.read(filePath, engine.getEncoding()); + zml = new Zml(engine, path, lastModified, content); + cache.put(path, zml); + return zml; + } + + @Override + public long getLastModified(String path) throws Exception + { + if (!Strings.startsWith(path, "/") || !Validates.isMatch(path, engine.getPatterns())) + {//要求相对于根目录的绝对路径 + throw new Exception("ZML["+path+"]配置不正确,必须/开头且符合配置的模式"); + } + + return watcher.getLastModified(path); + } + + @Override + public void setMaxIdleTime(int maxIdleTime) + { + this.cache.setMaxIdleTime(maxIdleTime); + } + + @Override + public void setMaxKeepTime(int maxKeepTime) + { + this.cache.setMaxKeepTime(maxKeepTime); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/loader/FileZmlWatcher.java b/zhiqim_zml/src/org/zhiqim/zml/loader/FileZmlWatcher.java new file mode 100644 index 0000000..e509547 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/loader/FileZmlWatcher.java @@ -0,0 +1,177 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.loader; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.StandardWatchEventKinds; +import java.nio.file.WatchEvent; +import java.nio.file.WatchKey; +import java.nio.file.WatchService; +import java.util.HashMap; +import java.util.List; + +import org.zhiqim.kernel.extend.HashMapSV; +import org.zhiqim.kernel.logging.Log; +import org.zhiqim.kernel.logging.LogFactory; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.kernel.util.Watchs; +import org.zhiqim.zml.ZmlConstants; +import org.zhiqim.zml.ZmlEngine; + +/** + * ZML文件监视,所有包含*.zml文件的文件夹, + * 1.采用WatchService进行监视,只监视修改事件 + * 2.增加和删除时修改事件也会触发,统一检查文件是否存在来判断是增加还是删除 + * + * @version v1.0.0 @author zouzhigang 2016-7-13 新建与整理 + */ +public class FileZmlWatcher extends Thread implements ZmlConstants +{ + private static final Log log = LogFactory.getLog(FileZmlWatcher.class); + + private boolean isRunning; + + private final ZmlEngine engine; + private final String pathPrefix; + private final HashMapSV fileMap; + private final HashMapSV dirMap; + private final HashMap keyMap; + private final WatchService watcher; + + public FileZmlWatcher(ZmlEngine engine, String rootPath) + { + this.engine = engine; + this.pathPrefix = rootPath; + this.fileMap = new HashMapSV<>(); + this.dirMap = new HashMapSV<>(); + this.keyMap = new HashMap<>(); + this.watcher = Watchs.getWatchService(); + + this.start(); + } + + public long getLastModified(String path) + { + if (fileMap.containsKey(path)) + {//1.如果有数据,则直接返回 + return fileMap.get(path); + } + + String dirPath = Files.getFileDirPath(path, "/"); + File dir = new File(pathPrefix + dirPath); + if (!dir.exists() || !dir.isDirectory() || !dir.canRead()) + {//2.检查文件夹 + WatchKey key = dirMap.get(dirPath); + if (key != null) + {//取消监视 + keyMap.remove(key); + dirMap.remove(dirPath); + key.cancel(); + key = null; + } + + fileMap.remove(path); + return -1; + } + + File file = new File(pathPrefix + path); + if (!file.exists() || !file.isFile() || !file.canRead()) + {//3.文件不存在,返回-1 + fileMap.remove(path); + return -1; + } + + if (!dirMap.containsKey(dirPath)) + {//4.把文件夹加入到监视中去 + synchronized (dirMap) + { + if (!dirMap.containsKey(dirPath)) + { + try + { + Path dPath = dir.toPath(); + WatchKey key = dPath.register(watcher, StandardWatchEventKinds.ENTRY_MODIFY); + dirMap.put(dirPath, key); + keyMap.put(key, dirPath); + } + catch (IOException e) + { + log.error("监视文件夹线程添加监视时异常", e); + } + } + } + } + + //5.保存文件最后更新时间并返回 + long fileModified = file.lastModified(); + fileMap.put(path, fileModified); + return fileModified; + } + + public void run() + { + isRunning = true; + while(isRunning) + { + try + { + WatchKey key = watcher.take(); + + //1.找到文件夹 + String dirPath = keyMap.get(key); + + //2.读取事件列表 + List> eventList = key.pollEvents(); + for (WatchEvent event : eventList) + { + Path path = (Path)event.context(); + String fileName = path.toFile().getName(); + String filePath = dirPath + "/" + fileName; + if (!Validates.isMatch(filePath, engine.getPatterns())) + continue; + + File file = new File(pathPrefix + filePath); + if (!file.exists()) + fileMap.remove(filePath); + else + fileMap.put(filePath, file.lastModified()); + } + + //3.重新设置监视 + if (!key.reset()) + { + keyMap.remove(key); + dirMap.remove(dirPath); + key.cancel(); + } + } + catch (InterruptedException e) + { + log.error("监视文件夹线程被中断,退出", e); + isRunning = false; + } + } + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Break.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Break.java new file mode 100644 index 0000000..611e064 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Break.java @@ -0,0 +1,58 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.StatementException; + +/** + * 退出循环, 格式为:<#break/> + * @see _Return 退出函数或执行结束 + * @see _Continue 继续下一循环 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Break extends Statement +{ + @Override + public boolean isNesting() + { + return false; + } + + @Override + public void parseStatement() throws StatementException + { + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + {//无需返回值,则作类型判断 + return null; + } + + public static class BreakException extends RuntimeException + { + private static final long serialVersionUID = 1L; + } +} \ No newline at end of file diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Call.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Call.java new file mode 100644 index 0000000..0ec2535 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Call.java @@ -0,0 +1,78 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.StatementException; + +/** + * 调用语句不显示返回值,格式为:@{obj.setName("abc")} + * @see _Echo 调用并显示返回值 + * @see _Format 调用显示格式化的返回值 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Call extends Statement +{ + private Expression expression; + + @Override + public boolean isNesting() + { + return false; + } + + @Override + public void parseStatement() throws StatementException + { + String s = Strings.trim(getStatement(), CALL_BEGIN, CALL_END); + + try + { + expression = ExpressionParser.parseExpression(s); + } + catch(Exception e) + { + throw new StatementException(this, CALL + e.getMessage()); + } + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + { + try + { + expression.build(variableMap); + } + catch(Exception e) + { + throw new StatementException(this, CALL + e.getMessage(), e); + } + + //仅执行不返回文本 + return null; + } +} \ No newline at end of file diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Comment.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Comment.java new file mode 100644 index 0000000..dcd5842 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Comment.java @@ -0,0 +1,51 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.StatementException; + +/** + * 注释语句,格式为:<#-- 这里是注释 --> + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Comment extends Statement +{ + @Override + public boolean isNesting() + { + return false; + } + + @Override + public void parseStatement() throws StatementException + { + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + {//注释不返回文本 + return null; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Continue.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Continue.java new file mode 100644 index 0000000..3557c1e --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Continue.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.StatementException; + +/** + * 继续下一循环, 格式为:<#continue/> + * @see _Return 退出函数或执行结束 + * @see _Continue 退出循环 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Continue extends Statement +{ + @Override + public boolean isNesting() + { + return false; + } + + @Override + public void parseStatement() throws StatementException + { + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + {//无需返回值,则作类型判断 + return null; + } + + public static class ContinueException extends RuntimeException + { + private static final long serialVersionUID = 1L; + } + +} \ No newline at end of file diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Define.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Define.java new file mode 100644 index 0000000..665e5de --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Define.java @@ -0,0 +1,100 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.StatementException; + +/** + * 预先定义变量语句,一般用于include文件中定义在主文件中可用的变量,格式为:<#def i=1/> + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Define extends Statement +{ + private String variableName; + private Expression _expression; + + @Override + public boolean isNesting() + { + return false; + } + + @Override + public void parseStatement() throws StatementException + { + String s = Strings.trim(getStatement(), DEF_BEGIN, DEF_END); + int ind = s.indexOf("="); + if (ind == -1) + throw new StatementException(this, DEF + "未找到赋值符(=)"); + + variableName = s.substring(0, ind).trim(); + + try + { + String expression = s.substring(ind+1).trim(); + _expression = ExpressionParser.parseExpression(expression); + } + catch(Exception e) + { + throw new StatementException(this, DEF + e.getMessage()); + } + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + {//仅执行不返回文本 + return null; + } + + public void define(ZmlVariable variableMap) throws StatementException + { + //定义变量,把生成的新变量放置到变量表中,或覆盖到变量表中 + Object value = null; + + try + { + value = _expression.build(variableMap); + } + catch(Exception e) + { + throw new StatementException(this, DEF + e.getMessage(), e); + } + + variableMap.addVariable(variableName, value); + } + + public String getVariableName() + { + return variableName; + } + + public Expression getExpression() + { + return _expression; + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Echo.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Echo.java new file mode 100644 index 0000000..0543ee8 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Echo.java @@ -0,0 +1,80 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.StatementException; + +/** + * 响应语句,调用语句并显示返回值,格式为:${obj.getName()} + * @see _Call 调用不显示返回值 + * @see _Format 调用显示格式化的返回值 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Echo extends Statement +{ + private Expression _expression; + + @Override + public boolean isNesting() + { + return false; + } + + @Override + public void parseStatement() throws StatementException + { + String s = Strings.trim(getStatement(), ECHO_BEGIN, ECHO_END); + + try + { + _expression = ExpressionParser.parseExpression(s); + } + catch(Exception e) + { + throw new StatementException(this, ECHO + e.getMessage()); + } + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + { + Object value = null; + + try + { + value = _expression.build(variableMap); + } + catch(Exception e) + { + throw new StatementException(this, ECHO + e.getMessage(), e); + } + + //结果为null返回null表示无返回文本,不为null转化为字符串 + return (value == null)?null:String.valueOf(ZmlVariable.chkDynamicVar(value)); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_For.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_For.java new file mode 100644 index 0000000..7546c75 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_For.java @@ -0,0 +1,270 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import java.util.Iterator; +import java.util.List; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.StatementNesting; +import org.zhiqim.zml.StatementParser; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.StatementException; +import org.zhiqim.zml.statement._Break.BreakException; +import org.zhiqim.zml.statement._Continue.ContinueException; + +/** + * 迭代语句,格式为:<#for item : list>或<#for (item : list)> + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _For extends Statement implements StatementNesting +{ + private String itemVariableName; + private Expression _expression; + private List stmtList; + private boolean isBeginExclusiveLine = false; + + private transient String content; + private transient int contentBeginIndex; + + @Override + public boolean isNesting() + { + return true; + } + + @Override + public boolean isExclusiveLine() throws StatementException + { + return super.isExclusiveLine()?isBeginExclusiveLine:false; + } + + @Override + public void parseStatement() throws StatementException + { + String s = Strings.trim(getStatement(), FOR_BEGIN, FOR_END); + int ind = s.indexOf(TAG_END); + if (ind == -1) + throw new StatementException(this, FOR + "未找到单行结束符"); + + String forEach = s.substring(0, ind).trim(); + if (forEach.startsWith("(")) + {//有(开头,则认为格式为for (item : list) + forEach = Strings.trim(forEach, "(", ")").trim(); + } + //支持格式for (var item : list)格式,去除var定义 + forEach = Strings.trimLeft(forEach, "var ").trim(); + int index = forEach.indexOf(FOR_SEPARATOR); + if (index == -1) + throw new StatementException(this, FOR + "未找到节点定义符"); + + //变量 + itemVariableName = forEach.substring(0, index).trim(); + + try + { + String expression = forEach.substring(index + FOR_SEPARATOR.length()).trim(); + _expression = ExpressionParser.parseExpression(expression); + } + catch(Exception e) + { + throw new StatementException(this, FOR + e.getMessage()); + } + + //对_for内的内容进行嵌套检查,得到嵌套语句列表 + content = s.substring(ind + 1); + int brNum = Strings.getStartsWithBrNum(content); + if (brNum > 0) + {//删除<#for item : list>之后的首个\r\n + content = content.substring(brNum); + } + + isBeginExclusiveLine = brNum > 0; + contentBeginIndex = getBeginIndex() + FOR_BEGIN.length() + ind + 1 + brNum; + + //删除之前的\r\n之后的空白 + content = Strings.removeRightMaybeEmptyBlank(content); + + stmtList = StatementParser.parseStatementNesting(this); + content = null;//清除临时数据 + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + { + Object value = null; + + try + { + value = _expression.build(variableMap); + } + catch(Exception e) + { + throw new StatementException(this, FOR + e.getMessage(), e); + } + + if (value == null) + return null;//无变量,直接返回null + + if (!(value instanceof Iterator) && !(value instanceof Iterable) && !value.getClass().isArray()) + throw new StatementException(this, FOR + "对象不支持迭代"); + + try + {//循环处理 + StringBuilder strb = new StringBuilder(); + if (value.getClass().isArray()) + { + Object[] objs = Arrays.toArray(value); + for (int i=0;i it = null; + if (value instanceof Iterable) + it = ((Iterable)value).iterator(); + else + it = (Iterator)value; + + for (int i=0;it.hasNext();i++) + { + Object obj = it.next(); + + int status = each(obj, i, variableMap, strb); + if (status == 1) + break; + + if (status == 2) + continue; + } + } + + if (isEndBreak()) + {//如果结束是独占一行,则删除最后的回车 TODO + int length = strb.length(); + if (length > 0 && (strb.charAt(length-1) == _CR_ || strb.charAt(length-1) == _LF_)) + strb.setLength(length-1); + + length = strb.length(); + if (length > 0 && (strb.charAt(length-1) == _CR_ || strb.charAt(length-1) == _LF_)) + strb.setLength(length-1); + } + +// int length = strb.length(); +// if (length > 0 && isEndBreak()) +// {//如果结束是独占一行,则删除最后的回车 +// if (strb.charAt(length-1) == _CR_ || strb.charAt(length-1) == _LF_) +// { +// strb.setLength(length-1); +// } +// +// if (strb.charAt(length-2) == _CR_ || strb.charAt(length-2) == _LF_) +// strb.setLength(length-2); +// } + return strb.toString(); + } + catch(Exception e) + { + throw new StatementException(this, FOR + e.getMessage(), e); + } + } + + private int each(Object obj, int index, ZmlVariable variableMap, StringBuilder strb) throws StatementException + { + //定义局部变量 + MapSO localMap = new HashMapSO(2); + localMap.put(itemVariableName, obj); + localMap.put(itemVariableName+"_index", index); + variableMap.addLocalVariable(localMap); + + try + { + //循环处理语句列表 + StatementParser.processStatementList(stmtList, variableMap, strb); + } + catch (BreakException e) + { + return 1; + } + catch (ContinueException e) + { + return 2; + } + finally + {//清除局部变量 + variableMap.removeLocalVariable(localMap); + localMap.clear();localMap = null; + } + + return 0; + } + + /**********************************************/ + //两个临时数据,用于语句解析成嵌套语句列表 + /**********************************************/ + + @Override + public String getContent() + { + return content; + } + + @Override + public int getContentBeginIndex() + { + return contentBeginIndex; + } + + @Override + public String getPrevStatement(Statement stmt) throws StatementException + { + int ind = stmtList.indexOf(stmt); + if (ind <= 0) + return null; + + return stmtList.get(ind-1).getStatement(); + } + + @Override + public String getNextStatement(Statement stmt) throws StatementException + { + int ind = stmtList.indexOf(stmt); + if (ind == -1 || ind >= stmtList.size()-1) + return null; + + return stmtList.get(ind+1).getStatement(); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Format.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Format.java new file mode 100644 index 0000000..3ff4ccd --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Format.java @@ -0,0 +1,81 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.Zmls; +import org.zhiqim.zml.exception.StatementException; + +/** + * 格式化语句,调用语句并对显示返回值作Zmls.format,格式为:#{obj.getName()} + * @see _Call 调用不显示返回值 + * @see _Echo 调用显示返回值 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Format extends Statement +{ + private Expression _expression; + + @Override + public boolean isNesting() + { + return false; + } + + @Override + public void parseStatement() throws StatementException + { + String s = Strings.trim(getStatement(), FORMAT_BEGIN, FORMAT_END); + + try + { + _expression = ExpressionParser.parseExpression(s); + } + catch(Exception e) + { + throw new StatementException(this, FORMAT + e.getMessage()); + } + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + { + Object value = null; + + try + { + value = _expression.build(variableMap); + } + catch(Exception e) + { + throw new StatementException(this, FORMAT + e.getMessage(), e); + } + + //结果为null返回null表示无返回文本,不为null转化为字符串,并作ZML格式化 + return (value == null)?null:Zmls.format(String.valueOf(ZmlVariable.chkDynamicVar(value))); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Function.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Function.java new file mode 100644 index 0000000..a3297d1 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Function.java @@ -0,0 +1,208 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.StatementNesting; +import org.zhiqim.zml.StatementParser; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.StatementException; +import org.zhiqim.zml.statement._Return.ReturnException; + +/** + * 函数定义语句,格式为: + * + * <#function name(param1, param2)> + * + * + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Function extends Statement implements StatementNesting +{ + private String name; + private String path; + private ArrayList variableNameList; + private List stmtList; + + //是否开始指令独占一行 + private boolean isBeginExclusiveLine; + + private transient String content; + private transient int contentBeginIndex; + + public _Function() + {//ZML内部函数 + this.variableNameList = new ArrayList(); + } + + public _Function(String path) + {//全局函数 + this.path = path; + this.variableNameList = new ArrayList(); + } + + /** 全局函数定义需要path,这样就不需要到zml中去找 */ + public String getPath() + { + return path; + } + + @Override + public boolean isNesting() + { + return true; + } + + @Override + public boolean isExclusiveLine() throws StatementException + {//父类判断是false的一定是false,=true的子类判断 + return super.isExclusiveLine()?isBeginExclusiveLine:false; + } + + @Override + public void parseStatement() throws StatementException + { + String s = Strings.trim(getStatement(), FUNCTION_BEGIN, FUNCTION_END); + int ind = s.indexOf(TAG_END); + if (ind == -1) + throw new StatementException(this, FUNCTION + "未找到单行结束符"); + + String expression = Strings.formatSpace(s.substring(0, ind)); + int indName = expression.indexOf("("); + if (indName == -1) + throw new StatementException(this, FUNCTION + "未找到函数名"); + + //找到函数名 + name = expression.substring(0, indName).trim(); + + //找到函数形参 + String params = expression.substring(indName).trim(); + params = Strings.trim(Strings.trim(params, "(", ")")); + if (!Validates.isEmpty(params)) + { + String[] paramArr = params.split(","); + for (String param : paramArr) + { + variableNameList.add(param.trim()); + } + variableNameList.trimToSize(); + } + + //对函数内的内容进行嵌套检查,得到嵌套语句列表 + content = s.substring(ind + 1); + int brNum = Strings.getStartsWithBrNum(content); + if (brNum > 0) + {//删除<#function>之后的首个\r\n + content = content.substring(brNum); + } + + isBeginExclusiveLine = brNum > 0; + contentBeginIndex = getBeginIndex() + FUNCTION_BEGIN.length() + ind + 1 + brNum; + + content = Strings.removeRightMaybeEmptyBlankLine(content); + stmtList = StatementParser.parseStatementNesting(this); + content = null;//清除临时数据 + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + { + variableMap.addFunction(this); + + //本身执行不返回文本,在build中调用返回文本 + return null; + } + + /** + * 在_Method中调用返回文本 + * + * @param variableMap 变量表 + * @return 函数结果字符串 + * @throws StatementException 语句异常 + */ + public Object build(ZmlVariable variableMap) throws StatementException + { + StringBuilder strb = new StringBuilder(); + + try + { + StatementParser.processStatementList(stmtList, variableMap, strb); + return strb.toString(); + } + catch(ReturnException e) + { + return e.hasValue()?e.getValue():strb.toString(); + } + } + + public String getName() + { + return name; + } + + public List getVariableNameList() + { + return variableNameList; + } + + /**********************************************/ + //两个临时数据,用于语句解析成嵌套语句列表 + /**********************************************/ + + @Override + public String getContent() + { + return content; + } + + @Override + public int getContentBeginIndex() + { + return contentBeginIndex; + } + + @Override + public String getPrevStatement(Statement stmt) throws StatementException + { + int ind = stmtList.indexOf(stmt); + if (ind <= 0) + return null; + + return stmtList.get(ind-1).getStatement(); + } + + @Override + public String getNextStatement(Statement stmt) throws StatementException + { + int ind = stmtList.indexOf(stmt); + if (ind == -1 || ind >= stmtList.size()-1) + return null; + + return stmtList.get(ind+1).getStatement(); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_If.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_If.java new file mode 100644 index 0000000..95d09fe --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_If.java @@ -0,0 +1,625 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import java.util.ArrayList; +import java.util.List; +import java.util.ListIterator; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Types; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.StatementNesting; +import org.zhiqim.zml.StatementParser; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.StatementException; + +/** + * 判断语句,格式为:<#if a=1>内容1<#elseif a==2>内容2<#elseif a==3>内容3<#else>其他内容<#if> + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _If extends Statement implements StatementNesting +{ + private Expression _ifExpression; //if表达式 + private boolean ifHasVar; //if语名中是否有定义变量语句 + private List ifStmtList; //if语句列表 + private List<_ElseIf> elseIfList = new ArrayList<_ElseIf>(); //elseif列表 + private _Else _else; //else + private boolean isBeginExclusiveLine; + + private transient String content; + private transient int contentBeginIndex; + + @Override + public boolean isNesting() + { + return true; + } + + @Override + public boolean isExclusiveLine() throws StatementException + { + return super.isExclusiveLine()?isBeginExclusiveLine:false; + } + + @Override + public void parseStatement() throws StatementException + { + String s = Strings.trim(getStatement(), IF_BEGIN, IF_END); + int ind = s.indexOf(TAG_END); + if (ind == -1) + throw new StatementException(this, IF + "未找到单行结束符"); + + try + { + String expression = s.substring(0, ind).trim(); + _ifExpression = ExpressionParser.parseExpression(expression); + } + catch(Exception e) + { + throw new StatementException(getPath(), getBeginLine(), getBeginColumn(), IF + e.getMessage()); + } + + //对if内的内容进行嵌套检查,得到嵌套语句列表,默认isBeginExclusiveLine取值在<#if>中<#elseif>和<#else>在process时重设置 + content = s.substring(ind + 1); + int brNum = Strings.getStartsWithBrNum(content); + if (brNum > 0) + {//删除<#if>之后的首个\r\n + content = content.substring(brNum); + } + + isBeginExclusiveLine = brNum > 0; + contentBeginIndex = getBeginIndex() + IF_BEGIN.length() + ind + 1 + brNum; + + ifStmtList = StatementParser.parseStatementNesting(this); + content = null;//清除临时数据 + + //再对列表中_Html语句查找到<#elseif>和<#else> + boolean isElse = false;//先找<#else> + for (ListIterator it=ifStmtList.listIterator();it.hasNext();) + { + Statement ts = it.next(); + if (isElse) + {//如果找到else,则后面的语句全交给else处理 + it.remove(); + _else.addStatement(ts); + continue; + } + + //没有到else,则查找_Html中 + if (!(ts instanceof _Text)) + continue; + + _Text _html = (_Text)ts; + String statement = _html.getStatement(); + int indElse = statement.indexOf(IF_ELSE); + if (indElse != -1) + {//找到 + isElse = true; + _else = new _Else(); + + //拆开_html + it.remove(); + + String statement1 = statement.substring(0, indElse); + if (!Validates.isEmpty(statement1)) + { + _Text _html1 = new _Text(); + _html1.setStatement(getZml(), _If.this, statement1); + _html1.setIndexInner(0, indElse); + _html1.setIndexAll(_html.getBeginIndex(), _html.getBeginIndex()+indElse); + + it.add(_html1); + } + + String statement2 = statement.substring(indElse + IF_ELSE.length());//把<#else>过滤掉,不需要表达式 + if (!Validates.isEmpty(statement2)) + { + _Text _html2 = new _Text(); + _html2.setStatement(getZml(), _If.this, statement2); + _html2.setIndexInner(indElse + IF_ELSE.length(), statement.length()); + _html2.setIndexAll(_html.getBeginIndex() + indElse + IF_ELSE.length(), _html.getEndIndex()); + _else.addStatement(_html2); + } + } + } + + //再查找<#elseif> + boolean isElseIf = false;_ElseIf _elseif = null; + for (ListIterator it=ifStmtList.listIterator();it.hasNext();) + { + Statement ts = it.next(); + if (isElseIf) + {//如果正在处理一个elseif时,检查是否到了另一个elseif + if (!(ts instanceof _Text)) + { + it.remove(); + _elseif.addStatement(ts); + continue; + } + + //在<#elseif中,从<#if删除 + it.remove(); + + _Text _html = (_Text)ts; + String statement = _html.getStatement(); + + //判断是否有下一个 + int indElseIf = statement.indexOf(IF_ELSEIF); + if (indElseIf == -1) + {//没有下一个,整个表达式都是<#elseif + _elseif.addStatement(ts); + continue; + } + + //把前面的还给上一个<#elseif + String statement1 = statement.substring(0, indElseIf); + if (!Validates.isEmpty(statement1)) + { + _Text _html1 = new _Text(); + _html1.setStatement(getZml(), _If.this, statement1); + _html1.setIndexInner(0, indElseIf); + _html1.setIndexAll(_html.getBeginIndex(), _html.getBeginIndex()+indElseIf); + _elseif.addStatement(_html1); + } + + //新的一个开始 + _elseif = new _ElseIf(); + elseIfList.add(_elseif); + + while(true) + {//判断新的一个下面还有没有 + int indElseIf2 = statement.indexOf(IF_ELSEIF, indElseIf + IF_ELSEIF.length()); + if (indElseIf2 == -1) + {//没有下一个 + String statement2 = statement.substring(indElseIf); + if (!Validates.isEmpty(statement2)) + { + _Text _html2 = new _Text(); + _html2.setStatement(getZml(), _If.this, statement2); + _html2.setIndexInner(indElseIf, indElseIf + statement2.length()); + _html2.setIndexAll(_html.getBeginIndex()+indElseIf, _html.getBeginIndex()+indElseIf+statement2.length()); + + _elseif.addStatement(_html2); + } + break; + } + + //有下一个 + String statement2 = statement.substring(indElseIf, indElseIf2); + if (!Validates.isEmpty(statement2)) + { + _Text _html2 = new _Text(); + _html2.setStatement(getZml(), _If.this, statement2); + _html2.setIndexInner(indElseIf, indElseIf + statement2.length()); + _html2.setIndexAll(_html.getBeginIndex()+indElseIf, _html.getBeginIndex()+indElseIf+statement2.length()); + + _elseif.addStatement(_html2); + } + + //定义下一个 + _elseif = new _ElseIf(); + elseIfList.add(_elseif); + indElseIf = indElseIf2; + } + } + else + {//如果没有处理,则查找 + if (!(ts instanceof _Text)) + continue; + + _Text _html = (_Text)ts; + String statement = _html.getStatement(); + int indElseIf = statement.indexOf(IF_ELSEIF); + if (indElseIf == -1) + continue; + + //找到<#elseif>,拆开_html + it.remove(); + + //<#elseif>之前的,还给<#if> + String statement1 = statement.substring(0, indElseIf); + if (!Validates.isEmpty(statement1)) + { + _Text _html1 = new _Text(); + _html1.setStatement(getZml(), _If.this, statement1); + _html1.setIndexInner(0, indElseIf); + _html1.setIndexAll(_html.getBeginIndex(), _html.getBeginIndex()+indElseIf); + + it.add(_html1); + } + + //第一个开始 + _elseif = new _ElseIf(); + elseIfList.add(_elseif); + isElseIf = true; + + while(true) + { + int indElseIf2 = statement.indexOf(IF_ELSEIF, indElseIf + IF_ELSEIF.length()); + if (indElseIf2 == -1) + {//没有下一个 + String statement2 = statement.substring(indElseIf); + if (!Validates.isEmpty(statement2)) + { + _Text _html2 = new _Text(); + _html2.setStatement(getZml(), _If.this, statement2); + _html2.setIndexInner(indElseIf, indElseIf + statement2.length()); + _html2.setIndexAll(_html.getBeginIndex()+indElseIf, _html.getBeginIndex()+indElseIf+statement2.length()); + + _elseif.addStatement(_html2); + } + break; + } + + //有下一个 + String statement2 = statement.substring(indElseIf, indElseIf2); + if (!Validates.isEmpty(statement2)) + { + _Text _html2 = new _Text(); + _html2.setStatement(getZml(), _If.this, statement2); + _html2.setIndexInner(indElseIf, indElseIf + statement2.length()); + _html2.setIndexAll(_html.getBeginIndex()+indElseIf, _html.getBeginIndex()+indElseIf+statement2.length()); + + _elseif.addStatement(_html2); + } + + //定义下一个 + _elseif = new _ElseIf(); + elseIfList.add(_elseif); + indElseIf = indElseIf2; + } + } + } + + for (_ElseIf elseif : elseIfList) + { + elseif.parseStatement(); + } + + ifHasVar = StatementParser.hasVar(ifStmtList); + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + { + Object value = null; + + try + { + value = _ifExpression.build(variableMap); + } + catch(Exception e) + { + throw new StatementException(this, IF + e.getMessage(), e); + } + + //表达式为null表示不检查所有的if,elseif,else,如item.isTrue()时item==null导致方法返回null + if (value == null) + return null; + + //不是null,则检查是不是布尔型,如果不是报异常 + if (!Types.isBoolean(value)) + throw new StatementException(this, IF + "中表达式"+_ifExpression+",格式不正确,不是布尔型"); + + try + { + //<#if> + if ((Boolean)value) + { + if (ifHasVar) + { + //定义局部变量 + MapSO localMap = new HashMapSO(2); + variableMap.addLocalVariable(localMap); + + try + { + StringBuilder strb = new StringBuilder(); + StatementParser.processStatementList(ifStmtList, variableMap, strb); + return Strings.removeRightMaybeEmptyBlankLine(strb.toString()); + } + finally + {//清除局部变量 + variableMap.removeLocalVariable(localMap); + localMap.clear();localMap = null; + } + } + else + { + StringBuilder strb = new StringBuilder(); + StatementParser.processStatementList(ifStmtList, variableMap, strb); + return Strings.removeRightMaybeEmptyBlankLine(strb.toString()); + } + } + + //<#elseif> + for (_ElseIf elseif : elseIfList) + { + if (elseif.is(variableMap)) + return elseif.process(variableMap); + } + + //<#else> + if (_else == null) + return null; + else + return _else.process(variableMap); + } + catch(StatementException e) + { + throw new StatementException(this, IF + e.getMessage(), e); + } + + // + } + + /**********************************************/ + //两个临时数据,用于语句解析成嵌套语句列表 + /**********************************************/ + + @Override + public String getContent() + { + return content; + } + @Override + public int getContentBeginIndex() + { + return contentBeginIndex; + } + + @Override + public String getPrevStatement(Statement stmt) throws StatementException + { + List stmtList = getStatementList(stmt); + if (stmtList == null) + return null; + + int ind = stmtList.indexOf(stmt); + if (ind <= 0) + return null; + + return stmtList.get(ind-1).getStatement(); + } + + @Override + public String getNextStatement(Statement stmt) throws StatementException + { + List stmtList = getStatementList(stmt); + if (stmtList == null) + return null; + + int ind = stmtList.indexOf(stmt); + if (ind == -1 || ind >= stmtList.size()-1) + return null; + + return stmtList.get(ind+1).getStatement(); + } + + /** 获取语句所有的语句列表 */ + private List getStatementList(Statement stmt) + { + if (ifStmtList.contains(stmt)) + return ifStmtList; + + for (_ElseIf elseif : elseIfList) + { + if (elseif.elseifStmtList.contains(stmt)) + return elseif.elseifStmtList; + } + + if (_else.elseStmtList.contains(stmt)) + return _else.elseStmtList; + + return null; + } + + /**********************************************/ + //定义两个私有类 _ElseIf _Else + /**********************************************/ + + /** <#if>语句中的<#elseif>部分 */ + private class _ElseIf + { + private Expression _elseifExpression; //表达式 + private List elseifStmtList; //嵌套语句列表 + private boolean elseifHasVar; //是否有变量定义语句 + + _ElseIf() + { + elseifStmtList = new ArrayList(); + } + + void parseStatement() throws StatementException + { + _Text _html = (_Text)elseifStmtList.remove(0); + String s = _html.getStatement(); + s = s.substring(IF_ELSEIF.length()); + int ind = s.indexOf(">"); + if (ind == -1) + throw new StatementException(getPath(), getBeginLine(), getBeginColumn(), ELSEIF + "未找到单行结束符"); + + try + { + String expression = s.substring(0, ind); + _elseifExpression = ExpressionParser.parseExpression(expression); + } + catch(Exception e) + { + throw new StatementException(getPath(), getBeginLine(), getBeginColumn(), ELSEIF + e.getMessage()); + } + + String statement = s.substring(ind+1); + if (!Validates.isEmpty(statement)) + {//表达式后面的内容 + _Text firstHtml = new _Text(); + firstHtml.setStatement(getZml(), _If.this, statement); + firstHtml.setIndexInner(ind+1, statement.length()); + firstHtml.setIndexAll(getBeginIndex()+ind+1, getEndIndex()); + + elseifStmtList.add(0, firstHtml); + } + + elseifHasVar = StatementParser.hasVar(elseifStmtList); + } + + String process(ZmlVariable variableMap) throws StatementException + { + if (elseifHasVar) + { + //定义局部变量 + MapSO localMap = new HashMapSO(2); + variableMap.addLocalVariable(localMap); + + try + { + StringBuilder strb = new StringBuilder(); + StatementParser.processStatementList(elseifStmtList, variableMap, strb); + String result = strb.toString(); + int brNum = Strings.getStartsWithBrNum(result); + if (brNum > 0) + { + isBeginExclusiveLine = true; + result = result.substring(brNum); + } + result = Strings.removeRightMaybeEmptyBlankLine(result); + return result; + } + finally + {//清除局部变量 + variableMap.removeLocalVariable(localMap); + localMap.clear();localMap = null; + } + } + else + { + StringBuilder strb = new StringBuilder(); + StatementParser.processStatementList(elseifStmtList, variableMap, strb); + String result = strb.toString(); + int brNum = Strings.getStartsWithBrNum(result); + if (brNum > 0) + { + isBeginExclusiveLine = true; + result = result.substring(brNum); + } + result = Strings.removeRightMaybeEmptyBlankLine(result); + return result; + } + } + + boolean is(ZmlVariable variableMap) throws StatementException + { + Object value = null; + + try + { + value = _elseifExpression.build(variableMap); + } + catch(Exception e) + { + throw new StatementException(getPath(), getBeginLine(), getBeginColumn(), ELSEIF + e.getMessage(), e); + } + + if (!Types.isBoolean(value)) + throw new StatementException(getPath(), getBeginLine(), getBeginColumn(), ELSEIF + "中表达式"+_elseifExpression+",格式不正确,不是布尔型"); + + return (Boolean)value; + } + + void addStatement(Statement statement) + { + elseifStmtList.add(statement); + } + } + + /** <#if>语句中的<#else>部分 */ + private class _Else + { + private List elseStmtList; //嵌套的语句列表 + private boolean elseHasVar; //是否包括定义变量语句 + + _Else() + { + elseStmtList = new ArrayList(); + } + + String process(ZmlVariable variableMap) throws StatementException + { + if (elseHasVar) + { + //定义局部变量 + MapSO localMap = new HashMapSO(2); + variableMap.addLocalVariable(localMap); + + try + { + StringBuilder strb = new StringBuilder(); + StatementParser.processStatementList(elseStmtList, variableMap, strb); + String result = strb.toString(); + int brNum = Strings.getStartsWithBrNum(result); + if (brNum > 0) + { + isBeginExclusiveLine = true; + result = result.substring(brNum); + } + result = Strings.removeRightMaybeEmptyBlankLine(result); + return result; + } + finally + {//清除局部变量 + variableMap.removeLocalVariable(localMap); + localMap.clear();localMap = null; + } + + } + else + { + StringBuilder strb = new StringBuilder(); + StatementParser.processStatementList(elseStmtList, variableMap, strb); + String result = strb.toString(); + int brNum = Strings.getStartsWithBrNum(result); + if (brNum > 0) + { + isBeginExclusiveLine = true; + result = result.substring(brNum); + } + result = Strings.removeRightMaybeEmptyBlankLine(result); + return result; + } + } + + void addStatement(Statement statement) + { + elseStmtList.add(statement); + + if (!elseHasVar && (statement instanceof _Var)) + elseHasVar = true; + } + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Include.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Include.java new file mode 100644 index 0000000..1cf733b --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Include.java @@ -0,0 +1,128 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import java.lang.reflect.InvocationTargetException; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.exception.StatementException; + +/** + * 包含语句,格式为:<#include "/zview/include.zml"/>
              + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Include extends Statement +{ + private Expression expression; + + @Override + public boolean isNesting() + { + return true; + } + + @Override + public void parseStatement() throws StatementException + { + String s = Strings.trim(getStatement(), INCLUDE_BEGIN, INCLUDE_END); + if (Validates.isEmptyBlank(s)) + throw new StatementException(this, INCLUDE + "未配置被包含的文件路径"); + + try + { + expression = ExpressionParser.parseExpression(s); + } + catch (ExpressionException e) + { + throw new StatementException(this, INCLUDE + e.getMessage()); + } + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + {//执行包含的ZML + try + { + String path = getIncludePath(variableMap); + ZmlEngine engine = getZml().getEngine(); + + return engine.getZml(path).process(variableMap, getZml()); + } + catch (StatementException e) + { + throw e; + } + catch (Exception e) + { + if (e instanceof InvocationTargetException) + throw new StatementException(this, INCLUDE + ((InvocationTargetException)e).getTargetException().getMessage()); + else if (e.getCause() != null) + throw new StatementException(this, INCLUDE + e.getCause().getMessage()); + else + throw new StatementException(this, INCLUDE + e.getMessage()); + } + } + + /** 包含的ZML优先变量定义 */ + public void define(ZmlVariable variableMap) throws StatementException + { + try + { + String path = getIncludePath(variableMap); + ZmlEngine engine = getZml().getEngine(); + + engine.getZml(path).define(variableMap); + } + catch (StatementException e) + { + throw e; + } + catch (Exception e) + { + if (e instanceof InvocationTargetException) + throw new StatementException(this, INCLUDE + ((InvocationTargetException)e).getTargetException().getMessage()); + else + throw new StatementException(this, INCLUDE + e.getMessage()); + } + } + + /** 获取包含的ZML路径 */ + public String getIncludePath(ZmlVariable variableMap) throws StatementException + { + try + { + return String.valueOf(expression.build(variableMap)); + } + catch (ExpressionException e) + { + throw new StatementException(this, INCLUDE + e.getMessage()); + } + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Interceptor.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Interceptor.java new file mode 100644 index 0000000..bfa5c34 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Interceptor.java @@ -0,0 +1,152 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.util.Arrays; +import org.zhiqim.kernel.util.Classes; +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.exception.StatementException; + +/** + * 包含语句,格式为:<#interceptor "chkLogin,chkAdmin"/>
              + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Interceptor extends Statement +{ + private Expression expression; + + @Override + public boolean isNesting() + { + return false; + } + + @Override + public void parseStatement() throws StatementException + { + String s = Strings.trim(getStatement(), INTERCEPTOR_BEGIN, INTERCEPTOR_END); + if (Validates.isEmptyBlank(s)) + throw new StatementException(this, INTERCEPTOR + "未配置被包含的文件路径"); + + try + { + expression = ExpressionParser.parseExpression(s); + } + catch (ExpressionException e) + { + throw new StatementException(this, INTERCEPTOR + e.getMessage()); + } + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + { + Object request = variableMap.get("request"); + Object response = variableMap.get("response"); + if (request == null || response == null) + throw new StatementException(this, INTERCEPTOR + "[request或response]变量不存在,不支持拦截器"); + + try + { + //查询响应提供方法 + Method isResponseSuccess = Classes.getMethodDeep(request.getClass(), "isResponseSuccess"); + Method isCommitted = Classes.getMethodDeep(response.getClass(), "isCommitted"); + + String interceptors = String.valueOf(expression.build(variableMap)); + String[] interceptorArr = Arrays.toStringArray(interceptors); + for (String interceptor : interceptorArr) + { + //1.找拦截器类 + Class interceptorClass = Global.forName(interceptor); + if (interceptorClass == null) + throw new StatementException(this, INTERCEPTOR + "配置的拦截器["+interceptor+"]不正确"); + + //2.找拦截器方法 + Method method = null; + for (Method m : interceptorClass.getDeclaredMethods()) + { + //2.1方法名为intercept + if (!"intercept".equals(m.getName())) + continue; + + //2.2参数是1个 + Class[] paramTypes = m.getParameterTypes(); + if (paramTypes == null || paramTypes.length != 1) + continue; + + //2.3参数是request类或父类 + Class paramType = paramTypes[0]; + if (Classes.isImplement(request.getClass(), paramType) || request.getClass().isAssignableFrom(paramType)) + { + method = m; + break; + } + } + + if (method == null) + throw new StatementException(this, INTERCEPTOR + "配置的拦截器没有intercept(request)方法"); + + //3.执行拦截器 + Object obj = Global.getWithoutNew(interceptorClass); + method.invoke(obj, request); + + //4.判断是否响应提交了 + if ((Boolean)isCommitted.invoke(response)) + {//已被拦截器提交不再作后续的语句处理 + throw new _Return.ReturnException(); + } + + if (!(Boolean)isResponseSuccess.invoke(request)) + {//已被拦截器跳转不再作后续的语句处理 + throw new _Return.ReturnException(); + } + } + + //仅执行不返回文本 + return null; + } + catch (_Return.ReturnException e) + {//当返回值一样直接抛出 + throw e; + } + catch (Exception e) + {//其他认为是异常 + if (e instanceof InvocationTargetException) + throw new StatementException(this, INTERCEPTOR + ((InvocationTargetException)e).getTargetException().getMessage()); + else if (e.getCause() != null) + throw new StatementException(this, INTERCEPTOR + e.getCause().getMessage()); + else + throw new StatementException(this, INTERCEPTOR + e.getMessage()); + } + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Return.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Return.java new file mode 100644 index 0000000..3969249 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Return.java @@ -0,0 +1,121 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.kernel.util.Validates; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.ExpressionException; +import org.zhiqim.zml.exception.StatementException; + +/** + * 执行结束返回,函数中只退出函数,非函数结束执行, 格式为:<#return/> + * @see _Break 退出循环 + * @see _Continue 继续下一循环 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Return extends Statement +{ + private Expression expression; + + @Override + public boolean isNesting() + { + return false; + } + + @Override + public void parseStatement() throws StatementException + { + String s = Strings.trim(getStatement(), RETURN_BEGIN, RETURN_END); + if (Validates.isEmptyBlank(s)) + return; + + try + {//有表达式 + expression = ExpressionParser.parseExpression(s); + } + catch (ExpressionException e) + { + throw new StatementException(this, RETURN + e.getMessage()); + } + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + {//无需返回值,则作类型判断 + return null; + } + + /** + * 生成返回值 + * + * @param variableMap 变量表 + * @return 函数结果字符串 + * @throws StatementException 语句异常 + */ + public Object build(ZmlVariable variableMap) throws StatementException + { + try + { + return (expression==null)?null:expression.build(variableMap); + } + catch(Exception e) + { + throw new StatementException(this, CALL + e.getMessage(), e); + } + } + + /** + * 返回异常,表明调用于遇到<#return>语句,Zml和_Function会捕捉 + * + * @version v1.0.0 @author zouzhigang 2016-11-18 新建与整理 + */ + public static class ReturnException extends RuntimeException + { + private static final long serialVersionUID = 1L; + private Object value = null; + + public ReturnException() + { + } + + public ReturnException(Object value) + { + this.value = value; + } + + public Object getValue() + { + return value; + } + + public boolean hasValue() + { + return value != null; + } + } +} \ No newline at end of file diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Text.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Text.java new file mode 100644 index 0000000..fc9f6bc --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Text.java @@ -0,0 +1,59 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import org.zhiqim.kernel.constants.SignConstants; +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.StatementException; + +/** + * 纯文本语句,直接打印即可,无需解析 + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Text extends Statement implements SignConstants +{ + @Override + public boolean isNesting() + { + return false; + } + + @Override + public boolean isExclusiveLine() + {//纯文本没有独占行 + return false; + } + + @Override + public void parseStatement() + { + //noting + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + {//返回文本内容 + return getStatement(); + } +} diff --git a/zhiqim_zml/src/org/zhiqim/zml/statement/_Var.java b/zhiqim_zml/src/org/zhiqim/zml/statement/_Var.java new file mode 100644 index 0000000..5ec7dc5 --- /dev/null +++ b/zhiqim_zml/src/org/zhiqim/zml/statement/_Var.java @@ -0,0 +1,98 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.statement; + +import org.zhiqim.kernel.util.Strings; +import org.zhiqim.zml.Expression; +import org.zhiqim.zml.ExpressionParser; +import org.zhiqim.zml.Statement; +import org.zhiqim.zml.ZmlVariable; +import org.zhiqim.zml.exception.StatementException; + +/** + * 变量定义语句,格式为:<#var i=1/> + * + * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理 + */ +public class _Var extends Statement +{ + private String variableName; + private Expression _expression; + + @Override + public boolean isNesting() + { + return false; + } + + @Override + public void parseStatement() throws StatementException + { + String s = Strings.trim(getStatement(), VAR_BEGIN, VAR_END); + int ind = s.indexOf("="); + if (ind == -1) + throw new StatementException(this, VAR + "未找到赋值符(=)"); + + variableName = s.substring(0, ind).trim(); + + try + { + String expression = s.substring(ind+1).trim(); + _expression = ExpressionParser.parseExpression(expression); + } + catch(Exception e) + { + throw new StatementException(this, VAR + e.getMessage()); + } + } + + @Override + public String process(ZmlVariable variableMap) throws StatementException + { + //定义变量,把生成的新变量放置到变量表中,或覆盖到变量表中 + Object value = null; + + try + { + value = _expression.build(variableMap); + } + catch(Exception e) + { + throw new StatementException(this, VAR + e.getMessage(), e); + } + + variableMap.addVariable(variableName, value); + + //仅执行不返回文本 + return null; + } + + public String getVariableName() + { + return variableName; + } + + public Expression getExpression() + { + return _expression; + } +} diff --git a/zhiqim_zml/test/org/zhiqim/zml/test/TestContent.java b/zhiqim_zml/test/org/zhiqim/zml/test/TestContent.java new file mode 100644 index 0000000..d354099 --- /dev/null +++ b/zhiqim_zml/test/org/zhiqim/zml/test/TestContent.java @@ -0,0 +1,46 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.test; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.zml.Zmls; + +public class TestContent +{ + public static void main(String[] args) throws Exception + { + String content = "这是一段文本内容,里面有一个值为:" + + "<#if isAbc>" + + "${abc}" + + "<#else>" + + "${def}" + + "。"; + + HashMapSO variableMap = new HashMapSO(); + variableMap.put("abc", "知启蒙"); + variableMap.put("def", "标识引擎"); + variableMap.put("isAbc", false); + + String result = Zmls.parse(content, variableMap); + System.out.println(result); + } +} diff --git a/zhiqim_zml/test/org/zhiqim/zml/test/TestEcho.java b/zhiqim_zml/test/org/zhiqim/zml/test/TestEcho.java new file mode 100644 index 0000000..9901ad5 --- /dev/null +++ b/zhiqim_zml/test/org/zhiqim/zml/test/TestEcho.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.test; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.zml.Zmls; + +public class TestEcho +{ + public static void main(String[] args) throws Exception + { + String content = Files.readUTF8("./resource/echo.zml"); + + MapSO variableMap = new HashMapSO(); + variableMap.put("name", "测试表达式"); + variableMap.put("loginUrl", "/login.htm"); + variableMap.put("styleColor", "f-blue"); + variableMap.put("hasAutoComplete", false); + + String result = Zmls.parse(content, variableMap); + System.out.println(result); + } +} diff --git a/zhiqim_zml/test/org/zhiqim/zml/test/TestFor.java b/zhiqim_zml/test/org/zhiqim/zml/test/TestFor.java new file mode 100644 index 0000000..5e980b2 --- /dev/null +++ b/zhiqim_zml/test/org/zhiqim/zml/test/TestFor.java @@ -0,0 +1,62 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.test; + +import java.util.ArrayList; +import java.util.List; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.zml.Zmls; + +public class TestFor +{ + public static void main(String[] args) throws Exception + { + String content = Files.readUTF8("./resource/for.zml"); + + List list1 = new ArrayList<>(); + list1.add("11aaa 1111 aaaaa"); + list1.add("22bbb 2222 bbbbb"); + + List list2 = new ArrayList<>(); + list2.add("aa111 aaaa 11111"); + list2.add("bb222 bbbb 22222"); + + List> list = new ArrayList<>(); + list.add(list1); + list.add(list2); + + MapSO variableMap = new HashMapSO(); + variableMap.put("name", "测试表达式"); + variableMap.put("loginUrl", "/login.htm"); + variableMap.put("styleColor", "z-blue"); + variableMap.put("hasAutoComplete", false); + variableMap.put("list", list); + variableMap.put("list1", list1); + + + String result = Zmls.parse(content, variableMap); + System.out.println(result); + } +} diff --git a/zhiqim_zml/test/org/zhiqim/zml/test/TestFunction.java b/zhiqim_zml/test/org/zhiqim/zml/test/TestFunction.java new file mode 100644 index 0000000..df487c5 --- /dev/null +++ b/zhiqim_zml/test/org/zhiqim/zml/test/TestFunction.java @@ -0,0 +1,49 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.test; + +import org.zhiqim.kernel.Global; +import org.zhiqim.kernel.extend.ArrayListS; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.zml.Zmls; + + +public class TestFunction +{ + public static void main(String[] args) throws Exception + { + String content = Files.readUTF8("./resource/function.zml"); + + Global.addClass("FArrayListS", ArrayListS.class); + + MapSO variableMap = new HashMapSO(); + variableMap.put("name", "测试表达式"); + variableMap.put("loginUrl", "/login.htm"); + variableMap.put("styleColor", "f-blue"); + variableMap.put("hasAutoComplete", false); + + String result = Zmls.parse(content, variableMap); + System.out.println(result); + } +} diff --git a/zhiqim_zml/test/org/zhiqim/zml/test/TestIf.java b/zhiqim_zml/test/org/zhiqim/zml/test/TestIf.java new file mode 100644 index 0000000..a8bbc2c --- /dev/null +++ b/zhiqim_zml/test/org/zhiqim/zml/test/TestIf.java @@ -0,0 +1,47 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.test; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.zml.Zmls; + +public class TestIf +{ + public static void main(String[] args) throws Exception + { + String content = Files.readUTF8("./resource/if.zml"); + + MapSO variableMap = new HashMapSO(); + variableMap.put("name", "测试表达式"); + variableMap.put("loginUrl", "/login.htm"); + variableMap.put("styleColor", "f-blue"); + variableMap.put("hasAutoComplete", true); + variableMap.put("status", 2); + variableMap.put("type", 3); + + + String result = Zmls.parse(content, variableMap); + System.out.println(result); + } +} diff --git a/zhiqim_zml/test/org/zhiqim/zml/test/TestInclude.java b/zhiqim_zml/test/org/zhiqim/zml/test/TestInclude.java new file mode 100644 index 0000000..09235b0 --- /dev/null +++ b/zhiqim_zml/test/org/zhiqim/zml/test/TestInclude.java @@ -0,0 +1,54 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.test; + +import java.io.File; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.zml.Zml; +import org.zhiqim.zml.ZmlEngine; +import org.zhiqim.zml.Zmls; + +public class TestInclude +{ + public static void main(String[] args) throws Exception + { + ZmlEngine engine = new ZmlEngine(); + engine.setFileZmlLoader(new File("./resource")); + + String content = Files.readUTF8("./resource/include.zml"); + + MapSO variableMap = new HashMapSO(); + variableMap.put("name", "测试表达式"); + variableMap.put("loginUrl", "/login.htm"); + variableMap.put("styleColor", "f-blue"); + variableMap.put("hasAutoComplete", true); + variableMap.put("status", 2); + variableMap.put("type", 3); + + Zml template = new Zml(engine, content); + String result = Zmls.parse(template, variableMap); + System.out.println(result); + } +} diff --git a/zhiqim_zml/test/org/zhiqim/zml/test/TestOne.java b/zhiqim_zml/test/org/zhiqim/zml/test/TestOne.java new file mode 100644 index 0000000..8240650 --- /dev/null +++ b/zhiqim_zml/test/org/zhiqim/zml/test/TestOne.java @@ -0,0 +1,44 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.test; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.zml.Zmls; + +public class TestOne +{ + public static void main(String[] args) throws Exception + { + String content = Files.readUTF8("./resource/one.zml"); + + MapSO variableMap = new HashMapSO(); + variableMap.put("name", "测试表达式"); + variableMap.put("loginUrl", "/login.htm"); + variableMap.put("styleColor", "f-blue"); + variableMap.put("hasAutoComplete", false); + + String result = Zmls.parse(content, variableMap); + System.out.println(result); + } +} diff --git a/zhiqim_zml/test/org/zhiqim/zml/test/TestTemplateFormat.java b/zhiqim_zml/test/org/zhiqim/zml/test/TestTemplateFormat.java new file mode 100644 index 0000000..e0334ea --- /dev/null +++ b/zhiqim_zml/test/org/zhiqim/zml/test/TestTemplateFormat.java @@ -0,0 +1,40 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.test; + +import org.zhiqim.zml.Zmls; + +public class TestTemplateFormat +{ + public static void main(String[] args) throws Exception + { + String content = "1111\r\n${a}\r\n${a}\r\n \r\n\r\n f-add\r\n\r\n \r\n 2222"; + System.out.println(content); + System.out.println("================================================="); + String result = Zmls.parse(content, "aa", "aa"); + System.out.println(result); + System.out.println("================================================="); + String result2 = Zmls.parse(content, "a", "1"); + System.out.println("================================================="); + System.out.println(result2); + } +} diff --git a/zhiqim_zml/test/org/zhiqim/zml/test/TestVar.java b/zhiqim_zml/test/org/zhiqim/zml/test/TestVar.java new file mode 100644 index 0000000..e57ee17 --- /dev/null +++ b/zhiqim_zml/test/org/zhiqim/zml/test/TestVar.java @@ -0,0 +1,50 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.test; + +import org.zhiqim.kernel.Zhiqim; +import org.zhiqim.kernel.annotation.AnAlias; +import org.zhiqim.kernel.annotation.AnNew; +import org.zhiqim.kernel.extend.ArrayListS; +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.kernel.util.Systems; +import org.zhiqim.zml.Zmls; + +@AnAlias("TestVar") +@AnNew +public class TestVar +{ + public static void main(String[] args) throws Exception + { + Zhiqim.loadClassAliasName(Systems.getClassPathList()); + + String content = Files.readUTF8("./resource/var.zml"); + + MapSO variableMap = new HashMapSO(); + variableMap.put("ArrayListS", ArrayListS.class); + + String result = Zmls.parse(content, variableMap); + System.out.println(result); + } +} diff --git a/zhiqim_zml/test/org/zhiqim/zml/test/TestXML.java b/zhiqim_zml/test/org/zhiqim/zml/test/TestXML.java new file mode 100644 index 0000000..9037861 --- /dev/null +++ b/zhiqim_zml/test/org/zhiqim/zml/test/TestXML.java @@ -0,0 +1,43 @@ +/* + * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦] + * + * 知启蒙标记语言(zhiqim_zml)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_zml.htm + * + * This file is part of [zhiqim_zml]. + * + * [zhiqim_zml] is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * [zhiqim_zml] is distributed in the hope that it will + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with [zhiqim_zml]. + * If not, see . + */ +package org.zhiqim.zml.test; + +import org.zhiqim.kernel.extend.HashMapSO; +import org.zhiqim.kernel.extend.MapSO; +import org.zhiqim.kernel.util.Files; +import org.zhiqim.zml.Zmls; + +public class TestXML +{ + public static void main(String[] args) throws Exception + { + String content = Files.readUTF8("./resource/xml.xml"); + + MapSO variableMap = new HashMapSO(); + variableMap.put("name", "知启蒙名称"); + variableMap.put("version", "V1.4.1"); + variableMap.put("port", "50080"); + + String result = Zmls.parse(content, variableMap); + System.out.println(result); + } +}